audit remediation: test extraction, panic elimination, deduplication, doc sync#75
Conversation
|
This pull request is abnormally large and would use a significant amount of tokens to review. If you still wish to review it, comment |
Greptile SummaryThis PR completes a v1 audit remediation across 69 files with four phases of work: test extraction (~7,800 lines of inline tests moved to dedicated Key changes:
One minor design concern: Confidence Score: 4/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[cluster.rs::expand] -->|ExpandedGraph| B{E.3 check\nExternalInput as edge sink?}
B -->|Yes| C[ExpandError::InvariantViolation\nrule_id = E.3]
B -->|No| D[validate.rs::validate]
D -->|GraphValidationError| E{Validation\nfailed?}
E -->|V.1 cycle| F[GraphValidationError::CycleDetected]
E -->|V.8 missing prim| G[GraphValidationError::MissingPrimitive]
E -->|V.3/V.4/V.5/V.7| H[GraphValidationError::*]
E -->|Pass| I[execute.rs::execute]
I --> J{R.7 check\nNotEmitted reaches\naction value conversion?}
J -->|Yes| K[ExecError::ActionSkipViolation\nnode + port]
J -->|No| L[ExecutionReport]
M[catalog.rs::register_compute] --> N{X.10 check\nSeries default value?}
N -->|Yes| O[ValidationError::UnsupportedParameterType]
N -->|No| P[ParameterMetadata registered]
style C fill:#f9a,stroke:#c66
style F fill:#f9a,stroke:#c66
style G fill:#f9a,stroke:#c66
style H fill:#f9a,stroke:#c66
style K fill:#f9a,stroke:#c66
style O fill:#f9a,stroke:#c66
style L fill:#9f9,stroke:#696
style P fill:#9f9,stroke:#696
Reviews (3): Last reviewed commit: "fix: correct boundary-outputs error vari..." | Re-trigger Greptile |
… doc sync Phase 5 — Test Extraction (AGENTS.md §4B): - Extract 11 inline #[cfg(test)] blocks to separate files (~7,800 lines) - Restore lost manifest_usecases/tests.rs from prior commit - Production files: catalog.rs, main.rs, adapter/lib.rs, action/registry.rs, compute/registry.rs, trigger/registry.rs, init_project.rs, graph_yaml.rs, dispatch.rs, provenance.rs, manifest_usecases.rs Phase 6 — Panic Elimination: - cluster.rs E.3: debug_assert!(unreachable!()) -> ExpandError::InvariantViolation - execute.rs R.7: unreachable!() -> ExecError::ActionSkipViolation - catalog.rs X.10: unreachable!() -> map_compute_param_value returns Result - demo_1.rs: panic!() -> Result with try_summarize_report/try_compute_summary; original signatures preserved as convenience wrappers - SDK: .expect() -> lifecycle_violation error returns Phase 7 — Logic Consolidation: - Deduplicate is_valid_id (4 copies -> common::is_valid_id) - Deduplicate json_type_name (2 copies -> adapter/src/common.rs) - Deduplicate SHA256 hashing (capture+replay -> compute_effect_hash) - Deduplicate find-duplicates pattern (3 inline -> find_first_duplicate) - Rename runtime::types::ValidationError -> GraphValidationError; add pub type alias for backward compatibility - render_cli_error_json: #[allow(dead_code)] -> #[cfg(test)] Phase 8 — Compliance & Tooling: - Add //! headers to 25+ files across adapter, CLI, SDK, supervisor, tools - Expand LAYER-2 boundary check to all prod crates including CLI - Add LAYER-4 (ontology reinterpretation) and LAYER-5 (loader semantic enforcement) guards to verify_layer_boundaries.sh - Fix HostRuleViolation exemption bypass (strip wrapper before scanning) - Improve strip_cfg_test_modules to handle string literals and declarations - Synchronize docs for E.3 (ExpandError), R.7 (ActionSkipViolation), and GraphValidationError rename across 10 doc files - Correct validate.rs header: V.1=cycles, E.3=ExternalInput rejection - Document serde(default) backward-compat intent on ActionEffect.intents - Add __pycache__/ to .gitignore 898 tests pass. 0 warnings. cargo fmt clean. verify_layer_boundaries.sh passes.
5f6505b to
112127b
Compare
Summary
Final v1 audit remediation — 69 files, 898 tests passing, 0 warnings.
Phase 5: Test Extraction (AGENTS.md §4B)
Phase 6: Panic Elimination
Phase 7: Logic Consolidation
Phase 8: Compliance & Tooling
Verification