Skip to content

Lever a: affected-set-scoped compile-clean gate - #6315

Merged
briansrls merged 23 commits into
mainfrom
session/bold-ant-731
Jul 6, 2026
Merged

briansrls merged 23 commits into
mainfrom
session/bold-ant-731

Conversation

@briansrls

@briansrls briansrls commented Jul 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

First slice of ROADMAP lever (a): per-PR compile-clean scopes to affected shard entries instead of always resolving the whole dag/ tree.

Proof path is local/ctrl-build (scripts/lever_a_local_verify.sh) — zero long CI runner burn until #6239 compile-wall lands.

Acceptance criteria (operator checklist)

Test plan

  • scripts/lever_a_local_verify.sh — fast Rust refusal/scoping receipts + disposition witness driver (ctrl-build)
  • cargo test -p v1-compiler --lib scoped_plan_refuses compile_clean_scoping
  • GATE 1b/1c + GATE 2 local receipts (ctrl-build; not CI floor)
  • CI budgets match main (10m ci job kill; no 140m+ job backstop in this PR)

@gunbai-bot
gunbai-bot Bot marked this pull request as ready for review July 6, 2026 05:03
@gunbai-bot

gunbai-bot Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Addressed the importer-propagation witness finding in 9f81fd1.

dag_compile_clean_scope_importer_touched_by_v2_logic_edit_holds now touches src/v2/std/logic.dag and expects dag/test/claim/parse_test.dag (a real v2.std.logic importer in the shard roster), not dag_compile_clean_transport.dag — transport reaches logic via tools.host_prelude → std.logic, not v2.std.logic.

— sent from bold-ant-731

@gunbai-bot

gunbai-bot Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Addressed the CI activation finding in 82fca12.

compile_clean_scope_plan_for_ci now activates lever-a scoping when GITHUB_ACTIONS=true (the runner's own signal, same as install_group_syntax / floor_diff_observe) or when GUNBC_CI_DIFF_BASE is explicitly set. In CI, diff observation uses gunbc_ci_spec.diff_policy defaults (origin/main...HEAD) via floor_git_diff_name_status_range → floor_observe_git_diff_name_status_for_ci — no separate env export needed. Local dev without either signal still uses WholeTree.

Receipt: github_actions_activates_compile_clean_scoping asserts the plan is never WholeTree under GITHUB_ACTIONS=true with GUNBC_CI_DIFF_BASE unset.

— sent from bold-ant-731

@gunbai-bot

gunbai-bot Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Addressed both non-blocking nits from the opus approval in e29b8ef.

  1. EnvGuard hoist — single EnvGuard (with set/remove) at module scope in witness_layer_roots_compile_clean_tests; both receipt tests share it.
  2. Empty-diff single authority — removed the Rust changed_paths.is_empty() short-circuit in compile_clean_scope_plan_for_ci; empty touched paths now flow through compile_clean_scope_disposition_from_touched (same SkipNoAffectedEntries path as witness_empty_touched_skips).

— sent from bold-ant-731

@gunbai-bot
gunbai-bot Bot force-pushed the session/bold-ant-731 branch from e29b8ef to 260d6c0 Compare July 6, 2026 06:28
@gunbai-bot

gunbai-bot Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Re: empty changed_paths on successful observation (opus note, non-blocking).

Already fail-closed upstream: floor_name_status_diff_from_reconciliation (floor_diff_observe.dag:306-320) maps nonzero git exit, truncated -z stream, and unknown status letters to NameStatusDiffFail — never NameStatusDiffOk with a fabricated empty list. Ok(([], _)) is only reachable when git exits 0 and the parsed name-status record set is genuinely empty (no-op diff).

Receipts: witness_invalid_base_name_status_fails_closed in src/v2/test/claim/workflow/floor_diff_observe_witness_test.dag (misconfigured base → NameStatusDiffFail, not skip), plus Rust scoped_plan_refuses_on_invalid_diff_base on the compile-clean bridge. Empty touched paths then flow through compile_clean_scope_disposition_from_touched (same path as witness_empty_touched_skips), not a Rust-only short-circuit.

Agree a dedicated “zero rows ⇒ exit 0” receipt could be added in a follow-up; not required for lever-(a) merge.

— sent from bold-ant-731

@gunbai-bot

gunbai-bot Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Addressed the SkipNoAffected silent-bypass finding in 62b3219.

Finding verified: .dag disposition correctly returns SkipNoAffectedEntries when no shard import-closure intersects touched paths, and the Rust bridge mapped that to Ok(None) → green for both witness_layer_roots_compile_clean_check and _emit_check. That was wrong for non-empty Rust/CI/infra-only diffs (e.g. src/v1/stage0/src/cli_run.rs, .github/workflows/ci.yml).

Fix: compile_clean_scope_plan_for_ci now widens SkipNoAffected → WholeTree unless compile_clean_touched_paths_allow_ci_skip holds (empty touched paths, or all under docs/). Substrate disposition is unchanged; only the CI bridge applies this belt — scoped runs and refused paths are unaffected.

Receipt: ci_skip_allowed_only_for_empty_or_docs_only_touches in witness_layer_roots_compile_clean_tests.

— sent from bold-ant-731

@gunbai-bot

gunbai-bot Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Addressed the non-blocking docs-only classifier authority nit (opus, 36019) in 27934034af + d7ec6343b0.

Finding verified: compile_clean_touched_paths_allow_ci_skip was a Rust-side parallel to .dag disposition — honest §5 defensive intent, but not witnessed in substrate.

Fix: Added RequireWholeTree to CompileCleanScopeDisposition in dag/tools/dag_compile_clean_scope.dag, with compile_clean_touches_allow_skip (empty / docs/ only) deciding skip vs whole-tree before the Rust bridge runs. Rust now maps RequireWholeTree → WholeTree and no longer carries a starts_with("docs/") override.

Witnesses: witness_rust_only_touch_requires_whole_tree, witness_ci_yaml_touch_requires_whole_tree (+ enrolled tests in dag_compile_clean_scope_witness_test.dag).

— sent from bold-ant-731

@gunbai-bot

gunbai-bot Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Addressed the non-exhaustive witness match nit (opus, 36022) in fab580d948.

witness_empty_touched_skips and witness_docs_only_touch_skips now include a RequireWholeTree => false arm, aligned with the other disposition witnesses. By construction empty/docs-only inputs still land on skip, but a future classifier reroute would no longer silently green.

Re: plan-resolve ~77m eating lever-a headroom — agreed, non-blocking. The on-carrier dissolve-on note and timeout receipt on ci_workflow.dag track floor memoization (M1/M2); payoff materializes once affected entry sets are small and resolve is memoized.

— sent from bold-ant-731

@gunbai-bot

gunbai-bot Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Re: opus non-blocking notes (36044).

Double compile_clean_scope_plan_for_ci: Verified — witness_layer_roots_compile_clean_check and _emit_check each call it independently (cli_run.rs:934-965). Batch-1 today only invokes the check leg (dag_compile_clean_transport.dag:50-51 → dag_compile_clean_gate_passes); emit is opt-in via dag_compile_clean_witness_test.dag enrollment. So the duplicate resolve+diff shell-out is real when both legs run in one process (unit test emit_success_implies_check_success, or if both witnesses enroll), but not on the current batch-1 hot path. Agree worth caching between legs — deferring to floor-shared-compute memoization (same dissolve-on as plan-resolve headroom) rather than a process-global cache that could stale across EnvGuard test mutations.

docs/ skip classifier: Agree shard-intersection is the load-bearing gate; compile_clean_touches_allow_skip is a pure optimization for empty/docs-only diffs. Root-level design docs (DESIGN.md, etc.) correctly land on RequireWholeTree (fail-closed). No .dag assets under docs/ are import-closure-relevant today; if that changes, disposition should route through shard intersection, not the docs prefix alone.

— sent from bold-ant-731

gunbai-bot Bot pushed a commit that referenced this pull request Jul 6, 2026
Receipt run 28798100556 (PR #6314 @ e0de059): plan resolve ~72m + batch-1
reconcile ~51m, second compile pass in-flight at 135m step kill.
Receipt run 28790989476 (PR #6315): same 135m wall (~182m job time).
Update operator-ruling prose block to 195/250m; regen ci.yml from
expected_ci_yml (not hand-edited). dissolve-on unchanged: re-derive
DOWNWARD when compile-clean scoping/memoization lands.

Co-authored-by: Cursor <cursoragent@cursor.com>
gunbai-bot Bot pushed a commit that referenced this pull request Jul 6, 2026
Raise gunbc_ci_floor_step_timeout_minutes 135→195; job backstop derives
to 250m (45+195+5+5). Update operator-ruling prose in
gunbc_ci_job_timeout_policy_disposition and gunbc_ci_floor_gate_step_budget_note
to match data (195/250m, not stale 135/190m).

Receipts (135m step kill, rust_tests green):
- run 28798100556 — PR #6314 @ e0de059: plan resolve ~72m + batch-1
  reconcile ~51m, second compile pass in-flight at kill
- run 28790989476 — PR #6315: same wall (~182m job time)

ci.yml regenerated via generated_artifact_gate::main_wet (expected_ci_yml).
dissolve-on unchanged: re-derive DOWNWARD when compile-clean scoping lands.
Cross-link #6315 — same two files; second merge must reconcile loudly.

Co-authored-by: Cursor <cursoragent@cursor.com>
Brian Searls and others added 15 commits July 6, 2026 17:41
…sses.

The live shard-roster scan is O(corpus) cold; gate-1 soundness receipts
belong in dag_compile_clean_scope_witness_test.dag execution path.

Co-authored-by: Cursor <cursoragent@cursor.com>
…ransport.

dag_compile_clean_transport reaches logic via tools.host_prelude → std.logic,
not v2.std.logic; a touch on src/v2/std/logic.dag should scope dag/test/claim/parse_test.dag.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
EnvGuard tests share GUNBC_CI_DIFF_BASE/GITHUB_ACTIONS and can race
under parallel cargo test; with_env_test_lock fixes the inaccurate
single-threaded SAFETY claim (opus review, non-blocking).

Co-authored-by: Cursor <cursoragent@cursor.com>
Filter keys and collect_dag_files paths both normalize through the same
authority; drop the redundant raw-path contains check (opus review nit).

Co-authored-by: Cursor <cursoragent@cursor.com>
…out.

Receipt run 28780252806 / job 85333980084 on 43cc771: plan-entry resolve
~77m before batch-1; compile-clean still in-flight at 135m step kill. Ci job
backstop 190m→235m to match.

Co-authored-by: Cursor <cursoragent@cursor.com>
Brian Searls and others added 5 commits July 6, 2026 17:43
RequireWholeTree is now the modeled authority for non-empty non-docs
touches with no shard intersection; Rust maps it to WholeTree without
a parallel starts_with("docs/") heuristic. Witnesses cover Rust/CI paths.

Co-authored-by: Cursor <cursoragent@cursor.com>
Align witness_empty_touched_skips and witness_docs_only_touch_skips
with the three-variant CompileCleanScopeDisposition coproduct.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gunbai-bot
gunbai-bot Bot force-pushed the session/bold-ant-731 branch from 270c1e3 to 4b5d6de Compare July 6, 2026 17:43
gunbai-bot Bot pushed a commit that referenced this pull request Jul 6, 2026
Raise gunbc_ci_floor_step_timeout_minutes 135→195; job backstop derives
to 250m (45+195+5+5). Update operator-ruling prose in
gunbc_ci_job_timeout_policy_disposition and gunbc_ci_floor_gate_step_budget_note
to match data (195/250m, not stale 135/190m).

Receipts (135m step kill, rust_tests green):
- run 28798100556 — PR #6314 @ e0de059: plan resolve ~72m + batch-1
  reconcile ~51m, second compile pass in-flight at kill
- run 28790989476 — PR #6315: same wall (~182m job time)

ci.yml regenerated via generated_artifact_gate::main_wet (expected_ci_yml).
dissolve-on unchanged: re-derive DOWNWARD when compile-clean scoping lands.
Cross-link #6315 — same two files; second merge must reconcile loudly.

Co-authored-by: Cursor <cursoragent@cursor.com>
Rebase kept main's 10m job-level starvation kill on ci_job, which
cancelled release build before the floor could run (run 28811393429).
Lever-a interim uses gunbc_ci_job_backstop_timeout_minutes (235m);
10m kill stays on-carrier as #6323 dissolve-on target.

Co-authored-by: Cursor <cursoragent@cursor.com>
Brian Searls and others added 2 commits July 6, 2026 20:07
Operator ruling (gentle-owl-459): restore main budgets (floor 135m,
ci job 10m starvation-kill, rust gate 30m / job 90m) — no 140m+ runner
burn. Add ./docs path-normalization witness and scripts/lever_a_local_verify.sh
for ctrl-build receipts; GATE 3 blocked on #6239 compile-wall.

Co-authored-by: Cursor <cursoragent@cursor.com>
Compose disposition receipts in lever_a_local_receipts_hold (.dag);
script only invokes claim_batch --wet. Scaffold note + dissolution
trigger on-carrier; GATE follow-ons documented in substrate not bash.

Co-authored-by: Cursor <cursoragent@cursor.com>
@briansrls
briansrls merged commit f68da89 into main Jul 6, 2026
1 of 3 checks passed
@briansrls
briansrls deleted the session/bold-ant-731 branch July 6, 2026 20:24
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