Skip to content

feat(engine): review operations pattern#46

Merged
martsokha merged 9 commits intomainfrom
feature/engine
Mar 11, 2026
Merged

feat(engine): review operations pattern#46
martsokha merged 9 commits intomainfrom
feature/engine

Conversation

@martsokha
Copy link
Member

No description provided.

martsokha and others added 3 commits March 10, 2026 23:19
…ghout

Remove sync `map` from contexts (redundant with parallel_map/sequential_map),
add #[inline] to trivial accessors, extract inline logic from `call` into
dedicated &self methods, implement Ingestion operation, add tracing debug
to all implemented operations, and switch from Result<T, Error> to Result<T>.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…docs

Add &self method stubs with tracing to all 9 placeholder operations,
remove #[allow(dead_code)] from their TARGET constants, merge split
impl blocks, fix typos, and add operation tables to module docs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move record types (RedactionDecision, RedactionRecord, PolicyEvaluation,
RedactionMap, ReviewDecision) from nvisy-ontology::record into
nvisy-engine::provenance::record and delete the ontology module.

Restructure provenance into action/ and record/ submodules. Rename
FileAudit → Audit, FileAuditEntry → AuditEntry, FileAuditEntryKind →
AuditEntryKind. Absorb RedactionDecision and RedactionRecord into Audit
so it becomes the single per-document compliance artifact.

Add DocumentEnvelope as the per-document pipeline state: document +
entities + audit. Add Document::source() delegation to nvisy-codec.

Fixes: no-op builder validate, missing PolicyEvaluation constructor,
missing serde rename_all on PolicyEvaluation, reviewer_id String → Uuid,
broken doc link in envelope, a/an grammar in doc links.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@martsokha martsokha self-assigned this Mar 10, 2026
@martsokha martsokha added docs improvements, updates or additions to docs feat request for or implementation of a new feature labels Mar 10, 2026
@martsokha martsokha changed the title Feature/engine feat(engine): review operations Mar 10, 2026
martsokha and others added 4 commits March 11, 2026 00:30
…cross pipeline

- Extract DetectionMethod and DetectionOutput into own submodules for cleaner entity/mod.rs
- Add Entities newtype wrapping Vec<Entity> with derive_more (Deref, DerefMut, From, IntoIterator)
- Replace hand-rolled From<T> impls on Location with derive_more::From
- Add PartialEq to Entity, Entities, Location, ImageLocation, AudioLocation
- Add PartialEq + Eq to TextLocation, TabularLocation, ModelInfo
- Replace Vec<Entity> with Entities in all operation I/O types across nvisy-engine
- Add Entities to ontology prelude

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Rename `mime` to `supplied_mime` for clarity
- Add `filename: Option<PathBuf>` with `with_filename()` builder
- Compute `detected_mime` eagerly on construction (remove `detect_mime(&mut self)`)
- Remove mutable `document_type()` method in favor of immutable `infer_document_type()`
- Three-strategy type inference: supplied MIME > magic bytes > filename extension
- Add `DocumentType::from_extension(&OsStr)` for extension-based detection
- Extend `Document::decode` to handle all formats (text, image, audio, rich)
- Update `Ingestion` to return `DocumentEnvelope` with improved docs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…nce correctness

- Use eagerly-computed `detected_mime` in `infer_document_type` instead
  of re-running `infer::get()` on every call
- Compare `from_supplied` vs `from_detected` independently so the
  mismatch warning doesn't compare the same source against itself
- Use `with_content_type()` builder in server handler instead of direct
  field mutation; also propagate `filename` to `ContentData`
- Simplify `Document::decode` doc to defer to `infer_document_type`
- Update ingestion module docs to describe all three strategies
- Add tests for `from_extension`, filename refinement, and extension fallback
- Fix clippy: collapse nested `if let` + `if`

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace the Encryption stub with a full AES-256-GCM implementation and
add a symmetric Decryption operation. Shared crypto primitives (wire
format, key provider trait, algorithm enum) live in utility/crypto.rs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@martsokha martsokha changed the title feat(engine): review operations feat(engine): review operations pattern Mar 11, 2026
martsokha and others added 2 commits March 11, 2026 10:17
…compression stub

Rename lifecycle operations to be more concise and symmetric:
- Ingestion → Import (pairs with Export)
- Publish → Export (pairs with Import)
- Add Decompression boilerplate (mirrors Compression)

Update all references across compiler, provenance, executor, and docs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@martsokha martsokha merged commit 07ad176 into main Mar 11, 2026
5 checks passed
@martsokha martsokha deleted the feature/engine branch March 11, 2026 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs improvements, updates or additions to docs feat request for or implementation of a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant