Commit Graph

9 Commits

Author SHA1 Message Date
pulse-triage[bot]
c5d2cd0850 Reuse the complete contract index within each source lookup
The protected parser improvement still leaves lookup parsing every contract twice: its path references and dependent-update classification load the same working tree separately. Share the invocation-local complete index, reread it on every new lookup, and never substitute ambient contracts for an explicitly empty snapshot. Standalone index/commit guards keep their exact selected-source reads and reject a borrowed working-tree index in those modes. Add full current-reference equivalence, changed/deleted source, empty-source and source-selection controls.

Contract-Neutral: Preserve ownership, dependent references, verification obligations and source-selection rules; reuse only the complete working-tree index within one lookup and prevent empty-snapshot fallback.
Change-source: pulse-maintainer
2026-10-31 21:47:23 +00:00
pulse-triage[bot]
edd1e3e940 Parse numbered contract items without repeated prefix scans
Exact-main governance spent 168 seconds in subsystem lookup tests. A source profile attributes most lookup time to constructing and probing 99 numbered-list prefixes per line. Use one bounded equivalent match, preserving the existing 1..99 syntax, content and source offsets; retain full-index differential and adversarial parser coverage.

Contract-Neutral: Preserve contract syntax, reference offsets, ownership and verification requirements; only remove repeated prefix construction and scanning.
Change-source: pulse-maintainer
2026-10-31 20:48:20 +00:00
rcourtman
5f5f7ac7fc Read the guard's registry and contracts from the evaluated commit
The completion guard's CI mode now compares contract text against the
evaluated commit (#2502), but it still decided which contracts a commit
owed from HEAD's registry and contract index. CI walks a branch with HEAD
at the tip (or at main after a merge), so a later commit could change an
earlier commit's verdict. If a later commit added a Shared Boundaries
reference to a file, an earlier commit that was complete when written got
blocked. If a later commit dropped ownership of a file, an earlier commit
that changed it without its contract passed. The pre-commit hook read
both from the commit's own index, so CI and the hook could still
disagree.

repo_file_io and subsystem_contracts can now read from a revision as well
as the working tree or index. A revision read uses only that commit's
tree and fails closed rather than falling back to the disk. In diff-base
mode the guard reads the registry and contract index from the evaluated
commit, as does the Prettier-only inference that --commit enables.
Replaying CI's per-commit loop over the last 120 commits on main gives
the same verdicts as before.
2026-10-05 10:04:06 +01:00
rcourtman
971520a8e5 fix(release-control): scrub hook git env in remaining scratch-repo git users
The core.bare=true corruption of the shared repository recurred on
2026-07-17: a script that runs scratch git commands while the pre-commit
environment from a linked worktree (absolute GIT_DIR) is still exported
re-initializes the REAL repository as bare. a0fda6b26 fixed four helper
test files but missed two spots in scripts/release_control/internal:

- verify_commit_slice_test.py's git() helper only popped GIT_INDEX_FILE,
  so its scratch 'git init' calls re-init the real repo when GIT_DIR is
  inherited. It now scrubs via the shared repo_file_io.strip_local_git_env.
- verify_commit_slice.py's production git_env() kept the inherited hook
  env even when unit tests patch REPO_ROOT to a temporary repository,
  pointing git plumbing (including index writes) at the wrong repo. It
  now scrubs in the test-patched branch only, matching format_staged_go.

Regression teeth:
- verify_commit_slice_test.py gains a canary test that exports the real
  hook env shape (absolute GIT_DIR + GIT_INDEX_FILE, no GIT_WORK_TREE —
  with GIT_WORK_TREE set the corruption does not reproduce) against a
  scratch repo + linked worktree and asserts core.bare stays false.
- repo_file_io_test.py (runs in the pre-commit battery) gains a static
  guard failing any release-control *_test.py that runs scratch
  'git init' without referencing strip_local_git_env.
- The six hand-rolled 4-var pop loops from a0fda6b26 migrate to the
  shared strip_local_git_env helper so the guard enforces one pattern.

Verified: full release-control battery green; every touched test file
also green with GIT_DIR/GIT_INDEX_FILE pointed at a canary repo's linked
worktree, canary config and status intact afterward.
2026-07-17 16:39:17 +01:00
rcourtman
ef50c10a9a fix(release-control): scrub inherited git env in hook scratch-repo helpers
Pre-commit runs from a linked git worktree export an absolute GIT_DIR.
The release-control test helpers and the test-patched branch of
git_env() only removed GIT_INDEX_FILE, so their scratch-repo commands
targeted the REAL repository: 'git init' in a tempdir re-initialized it
with core.bare=true (breaking git status/commit for every checkout and
worktree) and the subsequent scratch 'git add' failed the hook.

Scrub GIT_DIR, GIT_WORK_TREE, GIT_INDEX_FILE, and GIT_COMMON_DIR in:
- git_env() of format_staged_go.py, governance_stage_guard.py, and
  subsystem_contracts.py (test-patched branch only; production hook
  behavior unchanged)
- the scratch-repo git() helpers in format_staged_go_test.py,
  governance_stage_guard_test.py, readiness_assertion_guard_test.py,
  subsystem_contracts_test.py

Matches the pattern contract_audit_test.py and status_audit_test.py
already used. Verified the full hook test battery passes with
GIT_DIR/GIT_WORK_TREE/GIT_INDEX_FILE pointed at a canary repo, which
stays un-corrupted.
2026-07-17 15:52:11 +01:00
rcourtman
1e8daa84c0 fix: remediate dependency alerts 2026-04-09 09:35:28 +01:00
rcourtman
40e095a9a0 Tighten control-plane subsystem lookup context 2026-03-30 09:42:16 +01:00
rcourtman
c826707f60 Rename contract graph helper 2026-03-19 14:46:35 +00:00
rcourtman
778a2577b6 feat: Pulse v6 release 2026-03-18 16:06:30 +00:00