Skip to content

Pre-push testing hook: affected-set test gate + non-invasive gates - #6706

Merged
briansrls merged 16 commits into
mainfrom
session/royal-carp-451
Jul 16, 2026
Merged

briansrls merged 16 commits into
mainfrom
session/royal-carp-451

Conversation

@gunbai-bot

@gunbai-bot gunbai-bot Bot commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

Pre-push testing hook: affected-set test gate + non-invasive gates

Rebuilds the pre-push hook (dag/gunbc/githooks_pre_push_emit.dag) so it actually runs the affected tests before push, closing the "local-green ≠ CI-red" gap, and makes every gate non-invasive (report + block, never auto-commit).

What changed

  • New affected-set test gate (ci_floor_plan.dag: gunbc_ci_witness_corpus_only_batches): the same witness corpus CI runs, scoped to the push diff via the floor's own selection authority (no forked affected-set logic). Excludes only the 72-min whole-tree compile gate and the Wet/bin lanes — declared, not silent (gunbc_ci_witness_corpus_only_batches_note). Blocks the push and reports on any failing affected test; git push --no-verify is the rare-case escape (CI stays the real wall).
  • Non-invasive fmt/artifact gates: report drift + exit 1 (was: auto cargo fmt/main_wet + git commit on your behalf + abort). Zero git commit in the emitted hook.
  • Fix: doc/artifact gates now pass --source-root dag --source-root src/v2 (the doc witness imports v2.std.*; the single-root invocation fail-closed on unresolved import). Caught by firing the enabled hook end-to-end.
  • Witness githooks_pre_push_emit_test.dag updated to the new contract (asserts no auto-commit, the test gate + --no-verify wired, both source roots) — discriminating: reds if auto-commit is reintroduced.

Proof (green-by-execution)

Fired the enabled hook exactly as git push does: HOOK_EXIT=0, 0 FAIL / 231 PASS across doc → artifact → witness → fmt gates. The affected-set gate’s first run caught a real regression (the witness above), which was fixed and re-verified.

To activate (per-clone, local config — not a committed artifact)

git config core.hooksPath .githooks (already set in the primary dev container). Cost: ~6–7 min for a small .dag diff, dominated by the whole-tree resolve; witness caching is the follow-on.

briansrls and others added 11 commits July 16, 2026 01:44
…non-invasive gates)

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

Asserts: fmt checked but no auto-commit, zero 'git commit' in the hook,
NEED_WITNESS/claim_executor/gunbc_ci_witness_corpus_only_batches wired,
--no-verify escape, dag//src/v2 witness trigger globs. Discriminating:
reds if auto-commit is reintroduced.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… catch-22, not this PR's)

The stage0_crate_layout emit produces the .rs without trailing commas
(drift-clean form) but rustfmt requires them, so post-#6677 main cannot have
that file both drift-clean and fmt-clean. Leave it matching main; the fix
belongs to the crate-layout lane, not this hook PR.
…invocations

The doc-reachability witness (and others) import v2.std.* modules; the hook's
emit_claim_batch passed only --source-root dag, so an enabled hook fail-closed
with 'unresolved import v2.std.live_tree' on any docs-changing push. Caught by
firing the enabled hook end-to-end. Witness now asserts both source roots.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@gunbai-bot
gunbai-bot Bot marked this pull request as ready for review July 16, 2026 03:44
@gunbai-bot gunbai-bot Bot changed the title dag roadmap work Pre-push testing hook: affected-set test gate + non-invasive gates Jul 16, 2026
@gunbai-bot

gunbai-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

Addressed review 38662 (cursor/composer-2.5, REQUEST_CHANGES): emit_freshness_witness now derives its trigger globs from gunbc.ci_layer_roots.witness_layer_roots (via map(r => r + "/")), and the witness test projects from layer_root_glob_prefixes() — matching witness_trigger_globs_derived — so the values can no longer fork from the single authority. Emitted hook is byte-identical (no drift). Fixed in the latest commit. — sent from royal-carp-451

briansrls and others added 2 commits July 16, 2026 04:06
…e roots from authority

- Review 38666 (cursor): the note claimed a diff-observation gap 'widens to
  the full hermetic corpus' — that is the §5 absorbing-fallback the floor was
  repaired to NOT do. Floor selection REFUSES (typed, located) on a provenance
  gap, never widens. Note corrected to match ci_spec_discovery_flip_note /
  compile_door_ledger / cli_run AFFECTED-SET REFUSAL.
- Root of the doc-gate resolve bug: emit_claim_batch now derives its
  --source-root flags from gunbc.ci_layer_roots.witness_layer_roots (single
  authority) instead of hardcoding, so the doc/artifact gates can't miss src/v2.

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

gunbai-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

Addressed review 38666 (cursor/composer-2.5, REQUEST_CHANGES): you're right — the note misstated fail-closed selection. It claimed a diff-observation gap 'widens to the full hermetic corpus', which is exactly the §5 absorbing-fallback the floor was repaired to NOT do. Corrected: a provenance/diff-observation gap REFUSES with a typed, located diagnostic (never widens, never silently skips), aligned with ci_spec_discovery_flip_note, compile_door_ledger, and the cli_run AFFECTED-SET REFUSAL. Also fixed the root of a separate doc-gate resolve bug found by firing the hook: emit_claim_batch now derives its --source-root flags from ci_layer_roots.witness_layer_roots instead of hardcoding, so the doc/artifact gates can't miss src/v2. Both in the latest commit. — sent from royal-carp-451

@gunbai-bot

gunbai-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

Addressed review 38672 (6212367).

emit_run_witness no longer hardcodes the source roots — it now derives them from gunbc.ci_layer_roots.witness_layer_source_flags_rooted(roots: witness_layer_roots), the same authority ci_spec.dag:364/439 uses for the floor's claim_executor invocation. And I closed the deeper fork the finding pointed at: emit_claim_batch was hand-rolling the same fold (a second spelling of the unrooted flags), so it now routes through witness_layer_source_flags(roots: witness_layer_roots). One authority for the --source-root flags across claim_executor (rooted) and claim_batch (unrooted); a witness_layer_roots change can no longer diverge them.

Emitted .githooks/pre-push bytes are byte-identical (regen: zero drift, same sha 18d8bf05...); the hook witness githooks_pre_push_emit_witnesses still PASSes green-by-execution.

— sent from royal-carp-451

briansrls added a commit that referenced this pull request Jul 16, 2026
Revert .githooks/pre-push and githooks_pre_push_emit.dag to main — the
--source-root src/v2 fix is redundant with #6706 ci_layer_roots authority.
Revert src/v2/std/algebra.dag to main; §3 dissolve ships in a separate PR.

Host-converge Slice 1 does not import v2.std.algebra.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gunbai-bot

gunbai-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

CI investigation: the failing check is NOT introduced by this PR — it is an inherited main-red.

Failing witness: doc_graph_has_no_orphan_docs (dag/test/claim/doc_reachability_witness_test.dag) returned Bool(false) in batch 2 of the floor.

Root: main commit 8322580 (#6708) added docs/plans/emitted-crate-partition-design.md with no inbound link, so it is an orphan in the doc-reachability graph. That witness fails identically on main itself (run 29471295796, head eba7679) and on the prior main run — it is a standing main-red, blocking every open PR via the refs/pull/N/merge ref (head union main).

Evidence this PR is clean: this branch changes NO docs (git diff origin/main...HEAD -- docs/ is empty) and doc_graph_has_no_orphan_docs PASSes when run against this branch in isolation. The affected-set widened to pull the doc witness in only because the shared ci_floor_plan.dag edit touches a widely-imported module — the witness itself is green on our contents.

I am fixing the orphan separately (a narrow main-targeting PR that links the doc), NOT bundling it here — bundling would swap an inherited red for a doc change that reads as this PR's. This PR stays byte-identical hook wiring.

Merge readiness otherwise: 2 distinct approving providers (claude review 38679, cursor review 38680, both on this head 6212367), no open REQUEST_CHANGES, mergeable=MERGEABLE. Its CI will re-run green once main's orphan is fixed.

— sent from royal-carp-451

@briansrls
briansrls merged commit ebb8e2f into main Jul 16, 2026
3 checks passed
@briansrls
briansrls deleted the session/royal-carp-451 branch July 16, 2026 05:46
gunbai-bot Bot pushed a commit that referenced this pull request Jul 16, 2026
Wire WitnessCorpusRun into githooks_pre_push_plan (layer-root trigger
globs + gunbc_ci_witness_corpus_only_batches authority) and stage0
transport; keeps the emitted hook a thin exec shim.

Co-authored-by: Cursor <cursoragent@cursor.com>
gunbai-bot Bot pushed a commit that referenced this pull request Jul 16, 2026
Integrate main (#6706 witness-corpus, #6711 deploy, #6723 doc graph)
while retaining the thin emitted pre-push hook and Rust transport from
this branch; witness corpus policy lives in githooks_pre_push_plan.dag.

Co-authored-by: Cursor <cursoragent@cursor.com>
briansrls added a commit that referenced this pull request Jul 16, 2026
* WIP: Host-converge Slice 1: wire first real knob (srv1 memory-cap)

* WIP: Host-converge Slice 1: wire first real knob (srv1 memory-cap)

* WIP: Host-converge Slice 1: wire first real knob (srv1 memory-cap)

* WIP: Host-converge Slice 1: wire first real knob (srv1 memory-cap)

* WIP: Host-converge Slice 1: wire first real knob (srv1 memory-cap)

* Dissolve v2.std.algebra fork onto flat std.algebra (P0 field wall).

The nested Monoid/Semigroup/etc. definitions in v2.std.algebra conflicted with
std.algebra after the field-presence wall landed: lookup saw flat fields while
module imports still expected nested literals. Re-export std.algebra types so
all consumers share one authority.

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

* WIP: Host-converge Slice 1: wire first real knob (srv1 memory-cap)

* Mark host_converge_slice1 shell transport with dissolution scaffold.

Mirror fleet_show_effective_read: concat systemctl show/set-property
scripts executed via shell.Exec.Run carry host_converge_slice1_transport_script_scaffold
bound to live_deploy_emit_shell_dissolution_trigger; witness asserts Scaffold row.

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

* Route srv1 converge CLI dispatch via operator_host_srv1 identity.

Replace stringly `host == "srv1"` with HostIdentity comparison against
the fleet_intent_network authority so slice-2 dispatch stays discoverable.

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

* WIP: Host-converge Slice 1: wire first real knob (srv1 memory-cap)

* WIP: Host-converge Slice 1: wire first real knob (srv1 memory-cap)

* Fix fleet_converge_cli parse error in srv1 dispatch guard.

Parenthesize `(operator_host_srv1 as String)` so `as` does not bind the
following `if` block — unparenthesized form caused expected LBrace parse
failure and compile-clean gate red on batch 1.

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

* WIP: Host-converge Slice 1: wire first real knob (srv1 memory-cap)

* Fail-closed on probed_at: refuse instead of "unknown" sentinel.

host_converge_slice1_probed_at returns Absent when date -Iseconds fails
or is empty; all converge/reapply/read-back paths refuse with a typed
reason rather than fabricating a timestamp (§5 absorbing fallback).

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

* Address review 38621: drop grep witness, note ByteSize dissolve-on.

Remove host_converge_slice1_apply_path_wired substring assertion; knob
coverage stays on execution witnesses. Document inherited String seam
debt on scope disposition for live_deploy.emit.

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

* WIP: Host-converge Slice 1: wire first real knob (srv1 memory-cap)

* WIP: Host-converge Slice 1: wire first real knob (srv1 memory-cap)

* WIP: Host-converge Slice 1: wire first real knob (srv1 memory-cap)

* WIP: Host-converge Slice 1: wire first real knob (srv1 memory-cap)

* WIP: Host-converge Slice 1: wire first real knob (srv1 memory-cap)

* Fix Optional null matches in slice1; document MemoryLimitAbsent routing.

Use wildcard Optional arms in host_converge_slice1 converge_loop (runtime
null ≠ ConvergeVerdict::Absent). Route MemoryLimitAbsent through
converge_verdict("", …) with a one-line intent note — semantics unchanged
because effective=="" always yields Absent. Pre-push doc witness passes
--source-root src/v2 for v2.std.live_tree resolution.

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

* Fix Optional null matches in slice1; document MemoryLimitAbsent routing.

Use wildcard Optional arms in host_converge_slice1 converge_loop (runtime
null ≠ ConvergeVerdict::Absent). Route MemoryLimitAbsent through
converge_verdict("", …) with a one-line intent note — semantics unchanged
because effective=="" always yields Absent. Pre-push claim_batch calls pass
--source-root src/v2 for v2 module resolution.

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

* WIP: Host-converge Slice 1: wire first real knob (srv1 memory-cap)

* WIP: Host-converge Slice 1: wire first real knob (srv1 memory-cap)

* Fix fleet_converge_cli witness live-tree disposition; pin Absent routing.

Replace srv1 converge_cli_run with hermetic converge_cli_routes_to_slice1 +
host_converge_slice1_fixture_receipt so SubstrateInputsOnly stays honest.
Add executable witness that MemoryLimitAbsent routes to Absent via converge_verdict.

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

* Unbundle #6695: revert hook edits and std/algebra per ruling.

Revert .githooks/pre-push and githooks_pre_push_emit.dag to main — the
--source-root src/v2 fix is redundant with #6706 ci_layer_roots authority.
Revert src/v2/std/algebra.dag to main; §3 dissolve ships in a separate PR.

Host-converge Slice 1 does not import v2.std.algebra.

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

* WIP: Host-converge Slice 1: wire first real knob (srv1 memory-cap)

---------

Co-authored-by: Brian Searls <briansrls@gunb.ai>
Co-authored-by: Cursor <cursoragent@cursor.com>
gunbai-bot Bot pushed a commit that referenced this pull request Jul 16, 2026
Push-time auto-commit retired in #6706 non-invasive gates, not #6720;
the thin-shim PR only moved check-only policy into the typed plan.

Co-authored-by: Cursor <cursoragent@cursor.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