diff --git a/Cargo.lock b/Cargo.lock index 021bd7bc..50e2a95b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2879,7 +2879,7 @@ checksum = "252afb9ae5eaa683babdc6a068b3f5726eb19e05070c731f9b2a23a7c3e8ed34" [[package]] name = "elide" version = "0.1.0" -source = "git+https://github.com/nvisycom/elide?branch=main#4c1d378db831441c2b6f9877fcd3f35dc75a7d89" +source = "git+https://github.com/nvisycom/elide?branch=main#7328e8a565a76f7ea2af05812f72230788c3feaa" dependencies = [ "async-trait", "elide-codec", @@ -2900,7 +2900,7 @@ dependencies = [ [[package]] name = "elide-bentoml" version = "0.1.0" -source = "git+https://github.com/nvisycom/elide-provider?branch=main#17b3fb2282a5a5aec7dab3cf2d9ebc6d3d0ad5e7" +source = "git+https://github.com/nvisycom/elide-provider?branch=main#766ead26f95c7df7849acd2f3ddd5cf0c3366a90" dependencies = [ "async-trait", "base64 0.23.1", @@ -2917,7 +2917,7 @@ dependencies = [ [[package]] name = "elide-codec" version = "0.1.0" -source = "git+https://github.com/nvisycom/elide?branch=main#4c1d378db831441c2b6f9877fcd3f35dc75a7d89" +source = "git+https://github.com/nvisycom/elide?branch=main#7328e8a565a76f7ea2af05812f72230788c3feaa" dependencies = [ "async-trait", "bytes", @@ -2939,7 +2939,7 @@ dependencies = [ [[package]] name = "elide-context" version = "0.1.0" -source = "git+https://github.com/nvisycom/elide?branch=main#4c1d378db831441c2b6f9877fcd3f35dc75a7d89" +source = "git+https://github.com/nvisycom/elide?branch=main#7328e8a565a76f7ea2af05812f72230788c3feaa" dependencies = [ "async-trait", "elide-core", @@ -2950,7 +2950,7 @@ dependencies = [ [[package]] name = "elide-core" version = "0.1.0" -source = "git+https://github.com/nvisycom/elide?branch=main#4c1d378db831441c2b6f9877fcd3f35dc75a7d89" +source = "git+https://github.com/nvisycom/elide?branch=main#7328e8a565a76f7ea2af05812f72230788c3feaa" dependencies = [ "async-trait", "blake3", @@ -2969,7 +2969,7 @@ dependencies = [ [[package]] name = "elide-detection" version = "0.1.0" -source = "git+https://github.com/nvisycom/elide?branch=main#4c1d378db831441c2b6f9877fcd3f35dc75a7d89" +source = "git+https://github.com/nvisycom/elide?branch=main#7328e8a565a76f7ea2af05812f72230788c3feaa" dependencies = [ "elide-core", "futures", @@ -2981,7 +2981,7 @@ dependencies = [ [[package]] name = "elide-engine" version = "0.1.0" -source = "git+https://github.com/nvisycom/elide?branch=main#4c1d378db831441c2b6f9877fcd3f35dc75a7d89" +source = "git+https://github.com/nvisycom/elide?branch=main#7328e8a565a76f7ea2af05812f72230788c3feaa" dependencies = [ "bytes", "elide-codec", @@ -2993,13 +2993,14 @@ dependencies = [ "serde", "serde-value", "serde_json", + "smallvec", "uuid", ] [[package]] name = "elide-export" version = "0.1.0" -source = "git+https://github.com/nvisycom/elide-runtime?branch=main#fd4072388e1dd5b195862d7641eeb8d770146cfa" +source = "git+https://github.com/nvisycom/elide-runtime?branch=main#9f800a84600d45a6c71b52645a3ac03db970ec55" dependencies = [ "csv", "elide", @@ -3011,7 +3012,7 @@ dependencies = [ [[package]] name = "elide-fake" version = "0.1.0" -source = "git+https://github.com/nvisycom/elide?branch=main#4c1d378db831441c2b6f9877fcd3f35dc75a7d89" +source = "git+https://github.com/nvisycom/elide?branch=main#7328e8a565a76f7ea2af05812f72230788c3feaa" dependencies = [ "async-trait", "elide-core", @@ -3022,7 +3023,7 @@ dependencies = [ [[package]] name = "elide-governance" version = "0.1.0" -source = "git+https://github.com/nvisycom/elide-runtime?branch=main#fd4072388e1dd5b195862d7641eeb8d770146cfa" +source = "git+https://github.com/nvisycom/elide-runtime?branch=main#9f800a84600d45a6c71b52645a3ac03db970ec55" dependencies = [ "elide-core", "elide-operator", @@ -3036,7 +3037,7 @@ dependencies = [ [[package]] name = "elide-lingua" version = "0.1.0" -source = "git+https://github.com/nvisycom/elide?branch=main#4c1d378db831441c2b6f9877fcd3f35dc75a7d89" +source = "git+https://github.com/nvisycom/elide?branch=main#7328e8a565a76f7ea2af05812f72230788c3feaa" dependencies = [ "async-trait", "elide-core", @@ -3047,7 +3048,7 @@ dependencies = [ [[package]] name = "elide-llm" version = "0.1.0" -source = "git+https://github.com/nvisycom/elide?branch=main#4c1d378db831441c2b6f9877fcd3f35dc75a7d89" +source = "git+https://github.com/nvisycom/elide?branch=main#7328e8a565a76f7ea2af05812f72230788c3feaa" dependencies = [ "async-trait", "derive_builder", @@ -3068,7 +3069,7 @@ dependencies = [ [[package]] name = "elide-ner" version = "0.1.0" -source = "git+https://github.com/nvisycom/elide?branch=main#4c1d378db831441c2b6f9877fcd3f35dc75a7d89" +source = "git+https://github.com/nvisycom/elide?branch=main#7328e8a565a76f7ea2af05812f72230788c3feaa" dependencies = [ "async-trait", "derive_builder", @@ -3082,7 +3083,7 @@ dependencies = [ [[package]] name = "elide-ocr" version = "0.1.0" -source = "git+https://github.com/nvisycom/elide?branch=main#4c1d378db831441c2b6f9877fcd3f35dc75a7d89" +source = "git+https://github.com/nvisycom/elide?branch=main#7328e8a565a76f7ea2af05812f72230788c3feaa" dependencies = [ "async-trait", "derive_builder", @@ -3094,7 +3095,7 @@ dependencies = [ [[package]] name = "elide-office" version = "0.1.0" -source = "git+https://github.com/nvisycom/elide?branch=main#4c1d378db831441c2b6f9877fcd3f35dc75a7d89" +source = "git+https://github.com/nvisycom/elide?branch=main#7328e8a565a76f7ea2af05812f72230788c3feaa" dependencies = [ "bytes", "hipstr", @@ -3106,7 +3107,7 @@ dependencies = [ [[package]] name = "elide-operator" version = "0.1.0" -source = "git+https://github.com/nvisycom/elide?branch=main#4c1d378db831441c2b6f9877fcd3f35dc75a7d89" +source = "git+https://github.com/nvisycom/elide?branch=main#7328e8a565a76f7ea2af05812f72230788c3feaa" dependencies = [ "aes-gcm", "async-trait", @@ -3128,7 +3129,7 @@ dependencies = [ [[package]] name = "elide-pattern" version = "0.1.0" -source = "git+https://github.com/nvisycom/elide?branch=main#4c1d378db831441c2b6f9877fcd3f35dc75a7d89" +source = "git+https://github.com/nvisycom/elide?branch=main#7328e8a565a76f7ea2af05812f72230788c3feaa" dependencies = [ "aho-corasick", "async-trait", @@ -3148,7 +3149,7 @@ dependencies = [ [[package]] name = "elide-pdf" version = "0.1.0" -source = "git+https://github.com/nvisycom/elide?branch=main#4c1d378db831441c2b6f9877fcd3f35dc75a7d89" +source = "git+https://github.com/nvisycom/elide?branch=main#7328e8a565a76f7ea2af05812f72230788c3feaa" dependencies = [ "bytes", "hipstr", @@ -3160,7 +3161,7 @@ dependencies = [ [[package]] name = "elide-pipeline" version = "0.1.0" -source = "git+https://github.com/nvisycom/elide-runtime?branch=main#fd4072388e1dd5b195862d7641eeb8d770146cfa" +source = "git+https://github.com/nvisycom/elide-runtime?branch=main#9f800a84600d45a6c71b52645a3ac03db970ec55" dependencies = [ "bytes", "elide", @@ -3181,7 +3182,7 @@ dependencies = [ [[package]] name = "elide-provider" version = "0.1.0" -source = "git+https://github.com/nvisycom/elide-runtime?branch=main#fd4072388e1dd5b195862d7641eeb8d770146cfa" +source = "git+https://github.com/nvisycom/elide-runtime?branch=main#9f800a84600d45a6c71b52645a3ac03db970ec55" dependencies = [ "elide", "elide-bentoml", @@ -3195,7 +3196,7 @@ dependencies = [ [[package]] name = "elide-redaction" version = "0.1.0" -source = "git+https://github.com/nvisycom/elide?branch=main#4c1d378db831441c2b6f9877fcd3f35dc75a7d89" +source = "git+https://github.com/nvisycom/elide?branch=main#7328e8a565a76f7ea2af05812f72230788c3feaa" dependencies = [ "elide-core", "hipstr", @@ -3205,7 +3206,7 @@ dependencies = [ [[package]] name = "elide-review" version = "0.1.0" -source = "git+https://github.com/nvisycom/elide-runtime?branch=main#fd4072388e1dd5b195862d7641eeb8d770146cfa" +source = "git+https://github.com/nvisycom/elide-runtime?branch=main#9f800a84600d45a6c71b52645a3ac03db970ec55" dependencies = [ "elide", "elide-governance", @@ -3217,7 +3218,7 @@ dependencies = [ [[package]] name = "elide-stt" version = "0.1.0" -source = "git+https://github.com/nvisycom/elide?branch=main#4c1d378db831441c2b6f9877fcd3f35dc75a7d89" +source = "git+https://github.com/nvisycom/elide?branch=main#7328e8a565a76f7ea2af05812f72230788c3feaa" dependencies = [ "async-trait", "derive_builder", @@ -3229,7 +3230,7 @@ dependencies = [ [[package]] name = "elide-template" version = "0.1.0" -source = "git+https://github.com/nvisycom/elide-runtime?branch=main#fd4072388e1dd5b195862d7641eeb8d770146cfa" +source = "git+https://github.com/nvisycom/elide-runtime?branch=main#9f800a84600d45a6c71b52645a3ac03db970ec55" dependencies = [ "elide-core", "elide-governance", @@ -6995,7 +6996,7 @@ version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03da047801ff44bb6a4d407d4860c05fd70bb81714e6b2f3812603d5b145b042" dependencies = [ - "heck 0.4.1", + "heck 0.5.0", "itertools 0.14.0", "log", "multimap", @@ -8564,7 +8565,7 @@ version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1c97747dbf44bb1ca44a561ece23508e99cb592e862f22222dcf42f51d1e451" dependencies = [ - "heck 0.4.1", + "heck 0.5.0", "proc-macro2", "quote", "syn 2.0.119", @@ -8576,7 +8577,7 @@ version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "287f59010008f0d7cf5e3b03196d666c1acc46c8d3e9cf34c28a1a7157601e72" dependencies = [ - "heck 0.4.1", + "heck 0.5.0", "proc-macro2", "quote", "syn 2.0.119", diff --git a/crates/nvisy-server/src/handler/detections.rs b/crates/nvisy-server/src/handler/detections.rs index cac90773..6a64d684 100644 --- a/crates/nvisy-server/src/handler/detections.rs +++ b/crates/nvisy-server/src/handler/detections.rs @@ -632,12 +632,14 @@ async fn redact_detection( let mut reviewed = blob.load_audit(&engine, workspace.id, &audit_file).await?; // Layer the reviewer's edits onto the working audit's report before redaction. - // Validation is report-relative (an unknown target or a self-contradiction → - // 400, via `EditError`'s `From` impl) so a reviewer is never told a decision - // took effect when the document says otherwise. + // Both validation and landing are report-relative (an unknown target, a + // self-contradiction, or an edit naming a part of the wrong modality → 400, via + // `EditError`'s `From` impl), so a reviewer is never told a decision took effect + // when the document says otherwise. `apply` is fallible in its own right: some + // landing failures (a modality mismatch) surface only when the edit lands. if let Some(edits) = &request.edits { edits.validate(&reviewed.report)?; - edits.apply(&mut reviewed.report); + edits.apply(&mut reviewed.report)?; } let document = blob.build_document(&file, detection.id).await?; diff --git a/crates/nvisy-server/src/service/run_blob_store.rs b/crates/nvisy-server/src/service/run_blob_store.rs index 4172adb0..ee06c6c7 100644 --- a/crates/nvisy-server/src/service/run_blob_store.rs +++ b/crates/nvisy-server/src/service/run_blob_store.rs @@ -143,6 +143,15 @@ impl RunBlobStore { /// Reads a workspace file's bytes from object storage and builds an engine /// [`Document`], stamping the run's id as the correlation id. + /// + /// The document's name is the file's original filename, and its format is + /// resolved from the stored `file_extension` (the trusted, `NOT NULL` column + /// the codec dispatches on — the filename may lie about the type). The name is + /// the engine's identity for the document: it roots every part path and is how + /// `anonymize` matches an audit back to its document, so redaction would + /// silently no-op if it differed between passes. Both detect and redact build + /// from the same input-file row through here, so the name is identical by + /// construction. pub async fn build_document( &self, file: &WorkspaceFile, @@ -176,7 +185,9 @@ impl RunBlobStore { .with_context(err.to_string()) })?; - Ok(Document::new(bytes, file.file_extension.clone()).with_correlation_id(correlation_id)) + Ok(Document::new(file.original_filename.clone(), bytes) + .with_extension(file.file_extension.clone()) + .with_correlation_id(correlation_id)) } /// Encrypts the analysis, writes it to the audit bucket, and builds the