Add DD-078 Slice 1A obligation truth model - #178
Conversation
Greptile SummaryThis PR implements DD-078 Slice 1A: stable verification identity and an in-memory truth model for obligation tracking. Two previously flagged parser bugs (the missing
Confidence Score: 5/5Safe to merge. The parser refactor is well-isolated, all previously flagged constraint boundary issues are fixed with targeted regression tests, and the new truth model's tamper-detection design prevents callers from silently zeroing the obligation denominator. Both constraint boundary parser bugs that were flagged on earlier review rounds are now guarded correctly — !in_constraint on the verification: handler and on the component id: handler — and each has a dedicated regression test. The new VerificationTruth model's canonical snapshot design means any caller-side mutation causes all truth predicates to fail closed. The 1,260-line integration suite and 17 fixture files give strong coverage. No new defects were found in this pass. Files Needing Attention: No files require special attention.
|
| Filename | Overview |
|---|---|
| src/intent.rs | Large refactor adding ParsedFeature/ParsedScenario wrappers, in_constraint flag, per-line numbering, and IdentifiedIntent. Both previously flagged constraint boundary bugs are correctly guarded; comprehensive tests cover all regression paths. |
| src/verification/ids.rs | New module: StableId, IdMode, validate_id, and slug. Explicit IDs are validated; compatibility-derived IDs use slug()-capped labels and embed the full parent value for uniqueness. Logic is correct and well-tested. |
| src/verification/model.rs | New module: VerificationTruth with orthogonal dimension enums, canonical topology tamper-detection, and coverage queries. All truth predicates fail closed; linkage and behavioral evidence remain orthogonal. |
| tests/verification_truth_tests.rs | 1,260-line integration suite covering strict/compat ID modes, constraint boundary isolation, documentation-only semantics, canonical topology tampering, and legacy AST backward-compatibility surface. |
| src/verification/mod.rs | New module root re-exporting the Slice 1A public API; clean and minimal. |
| src/lib.rs | One-line addition exposing the verification module. |
Reviews (4): Last reviewed commit: "fix: narrow Intent obligation identity s..." | Re-trigger Greptile
Summary
Adds the narrow, app-independent Intent truth foundation needed before any test runner or evidence report:
zero outcomes != verified);test:cases remain visible and prevent feature verification until represented as stable obligations;IntentFile/Feature/ScenarioAST shapes;Intent / IAL compatibility
Constraint:scenarios remain visible in the parser AST but do not interpret verification-like IDs, become obligations of the preceding feature, alter its identity/metadata/tests, trigger strict-ID requirements, or invalidate a documentation-only feature.Constraint:, technical bindings, test-data/invariant sections, and legacytest:blocks cannot swallow or mutate later behavior.id:remains prose unless it uses the explicitid: outcome.*; statementform.Deliberate non-goals
This PR does not add or freeze:
.tntunit-test declaration or runner;Those decisions require the revised testing DD and an end-to-end
ntnt testvertical slice. PRs #179 and #180 are drafts while that architecture is reconsidered.Validation
git diff --checkcargo clippy --all-targets --all-featuresremains blocked by pre-existing repository warnings/errors outside this diff, including existing approximate-constant test fixtures.