Skip to content

fix(self-deploy): drift-resilient checkout for #4914 — CI guard + accurate reference doc - #4926

Open
rysweet wants to merge 3 commits into
mainfrom
feat/issue-4914-nodeoptions-max-old-space-size32768-saved-preferen
Open

fix(self-deploy): drift-resilient checkout for #4914 — CI guard + accurate reference doc#4926
rysweet wants to merge 3 commits into
mainfrom
feat/issue-4914-nodeoptions-max-old-space-size32768-saved-preferen

Conversation

@rysweet

@rysweet rysweet commented Jul 28, 2026

Copy link
Copy Markdown
Owner

Problem (#4914)

Self-deploy checkout wedged every Overseer cycle for hours, leaving the running binary commits behind merged main and firing ProcessHealth ooda.log tail contains recent ERROR line(s). Root cause:

error: Your local changes to the following files would be overwritten by checkout:
        .github/hooks/amplihack-hooks.json

A prior deploy left the disposable canonical checkout with a locally-modified tracked file (.github/hooks/amplihack-hooks.json, rewritten out-of-band each session), which aborts git checkout --detach <merged_sha> — a self-reinforcing wedge.

What shipped where

Zero-BS note

The reference doc documents only symbols and tests that exist. Earlier draft artifacts describing non-existent write_manifest_if_changed / checkout_detached_with_retry / gate_uncertain / dirty_retry symbols, and out-of-scope docs for separate issues (overseer OODA self-healing, PR-dedup pre-flight), were removed from this branch.

Verification

  • cargo test --test docs_integrity — green (links + nav integrity)
  • 33 self_deploy::tests_source_prep tests — green (dirty-tree reset, skip-fetch path, warm-dir preservation, override-not-reset gate)
  • 2 self_deploy_hooks_tracked_invariant tests — green
  • pre-push gate: fmt + 484 race-subset tests + clippy --all-targets --all-features --locked -D warnings — green

Closing #4914 itself is an operational Overseer action.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

rysweet and others added 3 commits July 28, 2026 00:16
…iant (#4914)

The self-deploy checkout wedged every Overseer cycle because the tracked
.github/hooks/amplihack-hooks.json drifted, aborting 'git checkout --detach'
with 'your local changes would be overwritten'. The reset-before-checkout
repair shipped in #4878; this adds the durable CI regression guard for the
drift *source*:

- hooks_manifest_and_scripts_are_git_tracked: the manifest (and its hook
  scripts) must stay git-tracked — untracking/gitignoring is NOT the fix
  (SR-P1-2, supply-chain integrity).
- hooks_dir_has_no_untracked_drift_in_a_clean_checkout: a fresh checkout must
  leave .github/hooks/ pristine, so a reappearing unconditional manifest
  rewrite turns CI red instead of silently re-wedging self-deploy.

Skips cleanly outside a git work tree (vendored/packaged builds).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>


The self-deploy checkout wedged every Overseer cycle because a tracked-file
drift (.github/hooks/amplihack-hooks.json, rewritten out-of-band each session)
aborted 'git checkout --detach' with 'your local changes would be overwritten'.
The code repair shipped in #4878 (reset+clean the disposable canonical checkout
before checkout, fail-closed canonical-only gate) and its CI regression guard in
#4914 (tests/self_deploy_hooks_tracked_invariant.rs). This adds the reference
doc for that shipped fix.

Zero-BS: the doc describes ONLY code that exists. It documents the shipped
reset_source_tree scrub on both prepare paths, the double-canonicalized
is_canonical_src_repo gate, the remove_stale_checkout clone-clean recovery, and
the git-tracked / drift-free invariant test — and lists only the real tests in
src/self_deploy/tests_source_prep.rs and the invariant target. No invented
write_manifest_if_changed / checkout_detached_with_retry / gate_uncertain /
dirty_retry symbols. Added to mkdocs nav for discoverability.

Verified: cargo test --test docs_integrity (green), the 33 tests_source_prep
tests (green), and the 2 hooks-tracked invariant tests (green).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…variant (#4914)

CI's `clippy --all-targets --all-features` reds on
`tracked_files.iter().any(|f| *f == MANIFEST_REL)` (manual_contains); the
commit-stage `clippy --no-deps` (lib only) did not cover the test target.
Use the idiomatic `Vec::contains` so the branch's #4914 regression guard is
clippy-clean under the full CI gate.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.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