Skip to content

feat(substrate): v1.3 — fail-soft vocab partition with block firewall - #85

Merged
Joncik91 merged 1 commit into
mainfrom
v1.3-vocab-fail-soft
May 15, 2026
Merged

feat(substrate): v1.3 — fail-soft vocab partition with block firewall#85
Joncik91 merged 1 commit into
mainfrom
v1.3-vocab-fail-soft

Conversation

@Joncik91

Copy link
Copy Markdown
Owner

Summary

  • Changes _validate_view_trust_profile from raise-on-misplaced to a return-tuple contract (profile, findings) so that misplaced trust tokens produce structured block-severity trust-token-misplaced findings instead of an opaque ValueError.
  • Semantic firewall is preserved: misplaced tokens are dropped from the returned profile so downstream taint/UX checks see them as absent, in order to prevent silent mis-analysis.
  • The lock cannot complete while a trust-token-misplaced finding exists (block-tier gate), because the partition's semantic guarantee must hold.

Why

Two operators hit the opaque ValueError during dogfooding. The semantic partition (untrusted-input belongs to implementing-agent, not human-user) is correct and must be preserved — relaxing it would silently mislead the evaluator's taint check. The fix converts the error to a structured finding with a suggested_fix field that names the correct view, so that the walker can re-prompt inline ("Move 'untrusted-input' to 'implementing-agent' view") instead of surfacing a stack trace.

Files changed

  • bin/substrate_wizard.py_validate_view_trust_profile new contract; run_per_view returns tuple[str, list]; CLI surfaces findings to stderr
  • bin/findings.py — registers trust-token-misplaced in KNOWN_KINDS
  • docs/glossary.mdtrust-token-misplaced entry with rationale and user_action
  • tests/test_substrate_wizard_partition_fail_soft.py — 7 new tests covering misplaced tokens, two misplaced in one view, correctly-placed tokens, mixed valid+misplaced
  • tests/test_substrate_wizard.py, tests/test_v1_review_followups.py — updated to new return-tuple contract

Test plan

  • pytest tests/test_substrate_wizard_partition_fail_soft.py — 7 tests, all green
  • pytest tests/test_v1_review_followups.py — updated disambiguation-hint tests assert on finding, not on raise
  • pytest tests/ — 1974 passed, zero regressions
  • untrusted-input in human-user view → one block finding, token not in profile
  • accessibility-required in implementing-agent view → block finding pointing to human-user
  • Two misplaced tokens → two separate block findings
  • Correctly placed token → no finding, token in profile

🤖 Generated with Claude Code

_validate_view_trust_profile changed from raise-on-misplaced to
return-tuple contract: (profile_minus_misplaced: list[str],
findings: list[Finding]). Each misplaced token produces one
block-severity trust-token-misplaced finding.

Semantic firewall preserved: misplaced tokens are dropped from the
returned profile so downstream taint/UX checks see them as absent —
no silent mis-analysis path. "Fail-soft" is purely ergonomic: the
structured finding carries a suggested_fix pointing the operator to
the correct view, and the walker can re-prompt inline instead of
surfacing an opaque ValueError.

The lock cannot complete while a trust-token-misplaced finding exists
(block-tier, same gate as all other block findings).

Call sites updated: run_per_view now returns tuple[str, list]; CLI
surfaces findings to stderr and exits 1 when any exist. Two existing
tests that asserted on the raise are updated to assert on the finding.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@Joncik91
Joncik91 merged commit 3f2b9a1 into main May 15, 2026
2 checks passed
Joncik91 added a commit that referenced this pull request May 15, 2026
…ype (#88)

Minor release composing three Wave 2 PRs (#85, #86, #87) plus a small
walker-side plumbing fixup surfaced by the Wave 3 Opus aggregate review.

- Plugin marketplace bump 1.2.1 → 1.3.0 (both metadata.version and
  plugins[0].version)
- README badges: test count 1967 → 2003, version 1.2.1 → 1.3.0
- README components line: v1.2 → v1.3
- CHANGELOG entry summarizing item 8 (catalog seed), item 9 (vocab
  fail-soft with block firewall), item 10 (layer5 prototype), and the
  walker fixup
- bin/walker.py: _VIEW_TO_CATALOG_VIEW_TYPE realigned so product-input
  routes to input-shape and product-output routes to output-shape, the
  exemplar-options call site queries input-shape instead of help-text,
  and the input-exemplar-pi concern prompt references the input-shape
  view type instead of the v1.1 placeholder language. The walker's
  binding-suggestion path and the cross_view_gate's validation path now
  query the same catalog view types.

No spec contract changes — v1.0/v1.1/v1.1.1/v1.2.0/v1.2.1 locked specs
continue to validate.

2003 tests passing (1967 v1.2.1 baseline + 36 across the three v1.3
PRs). Zero regressions.

Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant