refactor(engine): integration tests and related fixes#59
Open
refactor(engine): integration tests and related fixes#59
Conversation
…xecutor - Extract `ResourceLimits` struct (run_timeout_ms, channel_buffer) from `EngineSection` with `[engine.limits]` TOML nesting - Move `build_petgraph` to `Graph::to_petgraph()` method - Remove `retry`/`timeout` from `ResolvedNode` — policy resolution now happens at execution time via `NodeExecutor::effective_retry()` and `effective_timeout()` (node-level falls back to engine default) - `compile()` takes `&Graph` (no mutation) and only `channel_buffer` - Remove `default_retry`/`default_timeout` from `EngineInner` - Update `Nvisy.example.toml` with `[engine.limits]` and concurrency Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…llback Split pipeline/config.rs into pipeline/config/ module: - mod.rs: RuntimeConfig, merge(), tests - engine.rs: EngineSection, ResourceLimits with validator derive - subsystem.rs: OcrSection, LlmSection, SttSection, TtsSection - validate.rs: RuntimeConfig::validate() and resolve_env() Other changes: - Replace version: u32 with semver::Version (default 0.1.0) - Remove dead `enabled` fields from all subsystem sections - Add #[validate(range(min = 1))] on channel_buffer - Add #[validate(nested)] on EngineSection retry/timeout/limits - Add RuntimeConfig::resolve_env() for NVISY_*_API_KEY env fallback - Call validate() and resolve_env() in Cli::load() - Update Nvisy.example.toml with semver, env var docs, no enabled Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace monolithic tests/pipeline.rs with focused test modules: - fixtures/mod.rs: shared helpers (engine, actor, upload_text, graph builders) - engine.rs: construction and config lifecycle (3 tests) - config.rs: TOML parsing, example file, validation, merge (6 tests) - content.rs: CRUD, bulk delete, nonexistent errors, actor isolation (8 tests) - context.rs: CRUD, bulk delete, nonexistent errors, actor isolation (7 tests) - compilation.rs: graph validation — empty, duplicate IDs, dangling edges, self-loops, backward edges, concurrency policy (8 tests) - runs.rs: run listing, get/delete/cancel nonexistent, failed run lifecycle, bulk delete, actor isolation, analytics (10 tests) All tests use Result<()> return type instead of .unwrap() panics. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ContentData is now pure bytes + source identity. All descriptive attributes (supplied MIME, detected MIME, filename) live on ContentMetadata, which the registry persists separately. This fixes the round-trip bug where text content lost its MIME type through the registry, causing Document::decode to fail. Changes across 6 crates: nvisy-core: - ContentData: remove supplied_mime, detected_mime, filename fields; remove with_content_type(), with_filename(), content_type(), infer_document_type(); add detect_mime() method; simplify constructors - ContentMetadata: add content_type, detected_content_type, filename fields; add builder methods and content_type()/infer_document_type() - Content: add infer_document_type() combining metadata + magic bytes; add content_type(), metadata_mut() nvisy-codec: - Document::decode takes &Content instead of &ContentData nvisy-engine: - DocumentEnvelope carries ContentMetadata through the pipeline - ImportFile operation accepts Content, preserves metadata through decompression/decryption - Registry auto-detects MIME on store via ContentData::detect_mime(); ContentHandle::content() returns full Content from both keyspaces - Executor passes Content to import; audio extraction reads filename from envelope metadata - EncryptedContent: remove filename field (was always None) - Tests: add 4 successful Engine::run tests; use anyhow::Result nvisy-server: - File upload sets MIME/filename on ContentMetadata instead of ContentData nvisy-python: - ExifModule takes Content instead of ContentData Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ContentBytes was a thin wrapper around bytes::Bytes with helpers for text conversion (as_hipstr, is_likely_text). These are now methods directly on ContentData. No external consumers existed. Removes: ContentBytes struct, content_bytes.rs, with_content_bytes(), content_bytes() accessor, prelude re-export. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Standardize all tracing target constants to follow the `nvisy_engine::<module>::<name>` convention: - registry::content, registry::context: rename COMPONENT → TARGET, prefix with nvisy_engine:: - nvisy_engine::crypto → nvisy_engine::op::encryption - nvisy_engine::compression → nvisy_engine::op::compression - nvisy_engine::op::audial_extraction → nvisy_engine::op::speech - Add TARGET to pipeline/default.rs and pipeline/runs/state.rs - Add target: TARGET to all tracing calls that were missing it Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.