Skip to content

§0 construction-justification rule (authoring-time): every lens records why its class can't be construction - #5476

Merged
briansrls merged 3 commits into
mainfrom
session/sunny-cat-109
Jun 21, 2026
Merged

briansrls merged 3 commits into
mainfrom
session/sunny-cat-109

Conversation

@gunbai-bot

@gunbai-bot gunbai-bot Bot commented Jun 21, 2026 •

Copy link
Copy Markdown
Contributor

What

ROADMAP §0 meta-item — the authoring-time construction-justification rule (DESIGN §5/§6), layered on top of the #5433 inert-lens backstop (it does not supersede it).

DESIGN §6: a lens is validation — it concedes the bad state is writable. So before adding a lens you must justify why the class can't be made unwritable by construction. This PR makes that judgment a recorded, fail-closed requirement.

Shape (the §7 recursion — construction applied to the rule itself)

The judgment (which §5 class + why) is unstructurable human residue. The requirement to have recorded one is structurable — so the missing-justification state is made unwritable:

  • v2.lens.common.construction_justification — single-authority typed model: ConstructionClass = WallNow | WallAfterGrounding | RatchetForever (DESIGN §5's three buckets, reusing the expressibility-frontier §2 region names — not a parallel taxonomy) + ConstructionJustification { class, rationale }.
  • All 35 top-level v2.lens.* modules now carry a data construction_justification: ConstructionJustification = … decl — the mark on the carrier (§3/§6), classified from each lens's existing header. Mirrors the extdeps_external_authority_anchor precedent.
  • Fail-closed presence check in discover_floor_corpus_rows (sibling to the Lens hygiene: import-closure inert-lens backstop + promote 5 inert lenses to floor-discovered witnesses (§0) #5433 inert check; reuses is_top_level_lens_module so the two cover the same set). A top-level lens with no recorded justification fails the floor closed.

Why this layers on #5433, not over it

A judgment applied at authoring time executes nothing, so it can't replace a corpus check. Both run in floor discovery; neither subsumes the other.

Verification (green-by-execution)

  • cargo test -p v1-compiler --lib construction_justification_hygiene_tests (3 tests: scan predicate, discriminating detector RED-on-missing/GREEN-on-recorded, whole-corpus green) + inert backstop tests still green.
  • .dag resolution confirmed end-to-end by running real witnesses across all three variants: discrimination (WallAfterGrounding), cost (WallNow), synthesis (RatchetForever) — all resolved 32 sources → true.
  • cargo fmt --all --check + cargo clippy -p v1-compiler --lib -- -D warnings clean.

Residue / follow-on (honest)

  • The correctness of each recorded class is review, not gated (deciding decidability is itself ③).
  • Modules recorded WallNow (cost, application_serializer) + support module affected_set_examples flag a §3 home question (computations/support filed under v2.lens.*); relocating them touches module resolution → marked follow-up.

Plan: docs/plans/construction-justification-rule.md.

🤖 Generated with Claude Code

@gunbai-bot gunbai-bot Bot changed the title §0 construction-justification rule (authoring-time, DESIGN §6): before adding a lens justify why the class cannot be made construction; layered ON TOP of the #5433 inert-lens backstop, does NOT supersede it §0 construction-justification rule (authoring-time): every lens records why its class can't be construction Jun 21, 2026
@gunbai-bot
gunbai-bot Bot marked this pull request as ready for review June 21, 2026 18:33
@briansrls
briansrls merged commit dcac225 into main Jun 21, 2026
1 check passed
@briansrls
briansrls deleted the session/sunny-cat-109 branch June 21, 2026 20:32
briansrls added a commit that referenced this pull request Jun 21, 2026
…everse-soundness fns + #5476 construction_justification)

The merge commit was auto-snapshotted with unresolved markers; this restores the
hand-resolved file (my reverse roster-soundness section AND main's #5476
construction_justification decl, with the brace fix).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
briansrls added a commit that referenced this pull request Jun 21, 2026
… reconcile checkboxes to merged PRs (#5488)

Operator ask: bolded inline milestones so the checkboxes line up with where
we're headed in dependency order, with checkpoints verifiable along the way.

- Each section opens with a **◆ Milestones** spine: the verifiable checkpoints
  in dep order (✓ reached · ▸ now · ○ ahead). §5 carries the critical path
  (de-fork Step 1 ✓ → NOW cargo-green → ... → KEYSTONE regen-verify → TERMINAL
  src/v1 deleted). Read L->R = the path.
- Reconcile checkboxes to reality (6 merges verified merged): §5 cross-tree
  import -> [x] #5473; §0 construction-justification -> [x] #5476; §0 fenced
  cross-tree-import-activation -> [x] #5473 (escalate item closed).
- Fold in bright-stag's honest line-33 de-vacuum wording (EmitHostGate ✓ #5477;
  4 advisory lenses widened+bounded, whole-corpus deferred to .dag reflection)
  — one PR not two.
- invert-hand-maintained plan §3.1: the near-term PR->checkbox status slice (a
  GitHub Action / drift-check over the (#NNNN) anchors) that kills the manual
  reconcile pain before full emit-from-.dag lands — answers the operator's
  'associate a PR -> check the box' question as a slice of the same project.

Co-authored-by: Brian Searls <briansrls@gunb.ai>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
briansrls added a commit that referenced this pull request Jun 22, 2026
…t be green-on-main at merge or not enrolled yet; class-fix for the floor-skew that has red the fleet three times; see the emission-ingestion-inverse plan section 2 (#5475)

* WIP: Gate-hygiene roster-completeness assertion: a floor-enrolled gate must b

* realization-vocab reverse roster-soundness gate: every exception-roster entry must name a live non-edge sidecar importer (shrinking-ratchet integrity, DESIGN §5/§6)

Forward clean_tree witness proves every live importer is rostered; this proves the
converse — a STALE roster entry (migrated-off / deleted path) keeps a dead excuse that
silently re-excuses a future re-leak at that path (§5 fail-open) and lies about the
ratchet shrinking. Asserts the FROZEN roster against the SAME independent live import-fact
scan the forward gate uses; roster is a parameter so the planted-stale control reds against
the real live scan (non-tautological). Proven by execution: real roster PASS, real roster +
one stale entry FAIL, planted control PASS, forward witnesses unaffected.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* WIP: Gate-hygiene roster-completeness assertion: a floor-enrolled gate must b

* Resolve merge conflict markers in realization_vocab lens (keep both reverse-soundness fns + #5476 construction_justification)

The merge commit was auto-snapshotted with unresolved markers; this restores the
hand-resolved file (my reverse roster-soundness section AND main's #5476
construction_justification decl, with the brace fix).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Brian Searls <briansrls@gunb.ai>
Co-authored-by: Claude Opus 4.8 (1M context) <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