Skip to content

Promote discovery typecheck gate to blocking (advisory debt = 0) - #5772

Closed
gunbai-bot[bot] wants to merge 14 commits into
mainfrom
session/smart-wolf-187
Closed

gunbai-bot[bot] wants to merge 14 commits into
mainfrom
session/smart-wolf-187

Conversation

@gunbai-bot

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

Copy link
Copy Markdown
Contributor

Promote the discovery typecheck gate to blocking (advisory debt = 0)

North-star of node adhoc-a238574f-912: "promote the discovery advisory typecheck gate to blocking once clean."

Finding: the debt is already 0, not ~779

The "~779" was prose carried in #5760's receipt-test ignore reason at authoring time. Intervening PRs drove it to zero. Two independent measurements confirm:

  • Whole-tree-at-once compile_to_resolved over all 1372 sources → 0 advisory typecheck diagnostics.
  • Per-entry discovery resolution over all 389 floor entries (the exact gate mechanism, shared MultiEntryIndex, ~875s run) → 0 logged and 0 distinct.

Since the corpus is clean, the precondition for promotion is met.

Change: remove the demotion seam (construction, not validation — §5)

The DiscoveryCorpusAdvisory gate's only behavioral effect was demoting 8 typecheck diagnostic kinds (UnresolvedType, TypeMismatch, ArityMismatch, VariantNotFound, FieldNotFound, NonExhaustiveMatch, MissingAnnotation, VariantCollision) so per-entry discovery resolve wouldn't fail on them — they were only logged as advisory(typecheck):. (compile_to_resolved_discovery_corpus_advisory was a pure alias of compile_to_resolved.)

Rather than leave an inert "advisory" seam that no longer demotes (a §2/§3 dead-concept / §5 lie), this removes the demotion entirely: the discovery floor now blocks on typecheck diagnostics via is_interpreter_blocking_diagnostic, identical to the strict path. The bad state (silently-demoted typecheck debt re-accumulating) becomes unwritable — the floor itself is the construction wall; a future typecheck regression fails the discovery floor loudly.

Removed (Rust seed + .dag authority, kept coherent):

  • is_discovery_corpus_advisory_typecheck_diagnostic, is_discovery_corpus_blocking_diagnostic (v1_std_core.rs, 00_core.dag)
  • compile_to_resolved_discovery_corpus_advisory (v1_compiler_compile.rs, compile.dag)
  • ResolveTypecheckGate enum + gate threading, log_discovery_advisory_typecheck, and the census collector (cli_run.rs)
  • the three demotion/census/receipt tests (pipeline.rs)

Added: discovery_corpus_typecheck_diagnostics_are_blocking — a fast discriminating test proving a typecheck error now surfaces as a blocking diagnostic under the promoted gate.

Verification

  • cargo build -p v1-compiler ✓
  • cargo clippy -p v1-compiler -p v1-compiler-tests --all-targets -D warnings ✓
  • new test green by execution ✓
  • full CI floor is the canonical consumer (runs on this PR).

🤖 Generated with Claude Code

@gunbai-bot gunbai-bot Bot changed the title Drive down the ~779 whole-tree typecheck diagnostics unmasked by #5760 parse-resilience; north-star = promote the discovery advisory typecheck gate to blocking once clean Promote discovery typecheck gate to blocking (advisory debt = 0) Jun 25, 2026
@gunbai-bot
gunbai-bot Bot marked this pull request as ready for review June 25, 2026 01:19
@gunbai-bot

gunbai-bot Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

CI red on af5eae37 is inherited infra/main-red, not this diff (investigated, not waved off):

  1. generated_artifact_drift_gate_passes → false is identically red on main (run 28143363204 @ 4a18d01a: same FAIL [batch 2] generated_artifact_drift_gate_passes, discovery-corpus PASS). This PR touches 0 dsl/ files (git diff origin/main...HEAD -- dsl/ is empty) and the drift gate compares dsl/-authored artifacts, so this diff cannot drive it. It's a pre-existing main-red in the generated-artifact authority lane, not this PR's.

  2. rust_tests → parse_table_memo_divergent_token_streams_remain_sound is a contention perf-budget flake: it blew its 90s/120s budget after running 1648s wall under fleet load (timing assert! at parse_table_memo_amortization_test.rs:110). This PR doesn't touch that file; compile_to_resolved is unchanged (only a pass-through alias was deleted).

This PR's actual deliverable is green-by-execution on both heads: PASS [batch 2] discovery-corpus — 1026 witnesses, 0 skipped — confirming the promoted typecheck gate blocks and whole-tree advisory debt is 0. No fix is owed here; the two reds are inherited/infra and clear on their own lanes.

— sent from smart-wolf-187

briansrls added a commit that referenced this pull request Jun 25, 2026
…locks fleet) (#5821)

* Fix main CI floor: orphan-doc reachability + inline-shell roster (unblocks fleet)

Two discovery witnesses are RED on main, inherited by every PR (jointly,
not from any single PR's own diff):

1. doc_graph_has_no_orphan_docs — two docs unreachable from the doc-graph
   roots (ROADMAP/DESIGN): docs/plans/input-envelope-roadmap.md (#5801) and
   docs/plans/resource-aware-scheduler.md. Both are arms of the same
   cost->schedule loop owned by the reachable hub
   docs/plans/realization-measurement-loop.md, so a "Companion plans" link
   block there makes them reachable via honest doc-to-doc edges (no ROADMAP
   regen, no generated-artifact drift-gate exposure).

2. medium_structure_clean_tree_holds — inline-shell literal
   `git rev-parse HEAD 2>/dev/null | tr -d` in
   dsl/gunbc/tools/roadmap_spawn_request.dag:8 (added by #5797), the same
   transport-fusion/inline-shell residue class as the 5 entries already on
   medium_structure_exception_roster. Add it as a sanctioned residue data row
   (no lens detection logic touched); owed deeper fix = dissolve the inline
   shell into a modeled git operation (tracked separately, roadmap-spawner
   owner).

Both verified green-by-execution with discriminating controls (each witness
returns false when its fix is stashed). Greens main's floor → unblocks #5808
and #5772.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Fix main floor: cite orphan plan docs via .dag authority + roster the roadmap-spawn shell leak

Two discovery witnesses are RED on main and inherited fleet-wide:

1. doc_graph_has_no_orphan_docs — resource-aware-scheduler.md and
   input-envelope-roadmap.md were unreachable from the doc-graph roots.
   Fixed at the authority: add a "Companion plans" citation block to
   realization_measurement_loop_body() (the semantic home — both are
   companion arms of the realization→measurement loop), then regenerate
   the .md byte-faithfully via `main_wet`. Editing the generated .md by
   hand would red generated_artifact_drift_gate_passes (it is a
   PlanArtifact projection of the .dag authority).

2. medium_structure_clean_tree_holds — roadmap_spawn_request.dag:8
   (added by #5797) carries an inline `git rev-parse` shell literal,
   a medium-structure leak. Add the file to the lens exception roster
   (sanctioned §5-honest residue under active modeling; shrinking
   ratchet, dissolves when the shell op becomes a modeled effect).

Green-by-execution against a worktree-built binary (correct workspace_root):
doc_graph_has_no_orphan_docs=true, doc_graph_has_no_dangling_links=true,
medium_structure_clean_tree_holds=true, drift gate=ExitSuccess.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Brian Searls <briansrls@gunb.ai>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
@gunbai-bot
gunbai-bot Bot marked this pull request as draft June 25, 2026 23:33
@gunbai-bot

gunbai-bot Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

Closing as superseded by #5826.

#5772's premise — that promoting the discovery advisory typecheck gate to blocking is a meaningful 'advisory-debt=0' milestone — is refuted by execution: the advisory path is structurally unreachable (resolve-stage diagnostics are caught gate-insensitively upstream; the only downgradeable classes, TypeMismatch/ArityMismatch, are never emitted by the v1 typechecker), so the blocking gate can never fire = a §6 inert lens. Nothing to salvage or rebase.

The real advisory measuring instrument is #5826: ResolveTypecheckGate::DiagnosticsCollector + the whole_tree_typecheck_advisory bin that actually counts the whole-tree diagnostics (179 over 22 modules). The drive-to-0 lever is the enroll-22-roots + fix-QN-collision/closure-merge campaign that follows #5826, with blocking promotion staying operator-gated.

Branch session/smart-wolf-187 is left intact (it is the live session branch, not deleted).

— sent from smart-wolf-187

@gunbai-bot gunbai-bot Bot closed this Jun 25, 2026
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