Archetype Metadata
archetype: workflow
evidence_tier: smoke
linked_policy:
- docs/dev/worktree_lifecycle.md
- docs/code_review.md
- AGENTS.md
Goal / Problem
Observed behavior
During the exact-head review of release-tooling PR #8318, a worktree on branch
review/pr-8318-review-20260903 created synthetic merge commit
12347725eaeaa89de03de5bb9e9a9e8a7b5cdad3 and then explicitly pushed
HEAD:fix/issue-8285-erratum-successor-20260902 with force-with-lease. That changed the remote
implementation PR head after its exact-head checks and reviews, despite the worktree's declared
read-only review purpose. The incident was detected by the final remote-head compare-and-swap guard;
#8318 was closed unmerged and replaced by #8320 at the preserved exact commit.
Expected behavior
A read-only review or synthetic-integration worktree must be technically unable to push any remote
ref. Integration checks should use a no-commit merge that is always aborted and should prove the
reviewed remote refs are unchanged before returning success.
Reproduction
# In a worktree intended only for review:
git merge --no-edit origin/main
git push origin HEAD:fix/example-implementation --force-with-lease=<expected-old-sha>
Today the explicit destination refspec bypasses the fact that the review branch has no upstream.
Scope
- Affected modules: linked-worktree creation/review helpers, push guards, and agent review guidance.
- Regression: no; this is an observed missing safety boundary.
- In scope:
- define a machine-detectable read-only review-worktree mode;
- reject every
git push initiated from that mode, including explicit HEAD:<other-branch> and
force-with-lease refspecs;
- provide a canonical synthetic-integration helper using
--no-commit --no-ff, guaranteed abort,
and before/after git ls-remote assertions;
- add regression coverage for blocked review pushes and allowed implementation-worktree pushes;
- update review-agent instructions to use the guarded helper.
- Out of scope:
Added Value Estimation
- User impact: prevents an apparently read-only review from silently invalidating reviewed PR state.
- Benchmark impact: protects immutable release and evidence branches from unrelated merge absorption.
- Maintenance impact: converts a behavioral instruction into an executable, testable boundary.
- Why now: the failure occurred during the September erratum release and required a replacement PR.
Effort Estimation
- Rough estimate: 4-8 hours.
- Best estimate: 6 hours.
- Unknowns: whether the safest implementation is a per-worktree Git config, guarded wrapper,
pre-push hook, or a combination; compatibility with existing shared hooks must be tested.
Complexity Estimation
- Implementation complexity: medium.
- Dependencies: existing worktree helpers and Git hook installation path.
- Open questions: how to preserve the guard across fresh shared-venv worktrees without changing
remote behavior for implementation worktrees.
Risk Assessment
- Functional risk: a broad guard could block legitimate pushes.
- Compatibility risk: worktree-local Git configuration differs across installed Git versions.
- Rollout risk: guidance-only fixes can still be bypassed by explicit refspecs.
- Mitigation: test both negative review mode and positive implementation mode; fail closed only when
the worktree is explicitly classified read-only.
Affected Files
scripts/dev/create_worktree.sh or a dedicated review-worktree helper — establish protected mode.
- repository Git-hook/bootstrap owner — reject pushes from protected review worktrees.
.agents/skills/implementation-verification/SKILL.md and review workflows — require guarded
synthetic integration.
tests/dev/ — subprocess regression tests with a temporary bare remote.
Definition of Done
Success Metrics
- The incident reproduction deterministically fails before the remote ref changes.
- Before/after remote-ref snapshots are byte-identical in a successful review integration check.
- Existing implementation push workflows retain their expected behavior.
Validation / Testing
Estimate Discussion
- Values reflect a bounded workflow/tooling guard plus subprocess Git tests.
- Confidence: 80%; Git-version and hook-installation behavior may expand the test matrix.
- The estimate should be revised after identifying the canonical shared hook/config owner.
Project Metadata
- Priority: high while release branches are active.
- Effort: 6 hours.
- Reviewed: no.
Archetype Metadata
Goal / Problem
Observed behavior
During the exact-head review of release-tooling PR #8318, a worktree on branch
review/pr-8318-review-20260903created synthetic merge commit12347725eaeaa89de03de5bb9e9a9e8a7b5cdad3and then explicitly pushedHEAD:fix/issue-8285-erratum-successor-20260902with force-with-lease. That changed the remoteimplementation PR head after its exact-head checks and reviews, despite the worktree's declared
read-only review purpose. The incident was detected by the final remote-head compare-and-swap guard;
#8318 was closed unmerged and replaced by #8320 at the preserved exact commit.
Expected behavior
A read-only review or synthetic-integration worktree must be technically unable to push any remote
ref. Integration checks should use a no-commit merge that is always aborted and should prove the
reviewed remote refs are unchanged before returning success.
Reproduction
Today the explicit destination refspec bypasses the fact that the review branch has no upstream.
Scope
git pushinitiated from that mode, including explicitHEAD:<other-branch>andforce-with-lease refspecs;
--no-commit --no-ff, guaranteed abort,and before/after
git ls-remoteassertions;Added Value Estimation
Effort Estimation
pre-push hook, or a combination; compatibility with existing shared hooks must be tested.
Complexity Estimation
remote behavior for implementation worktrees.
Risk Assessment
the worktree is explicitly classified read-only.
Affected Files
scripts/dev/create_worktree.shor a dedicated review-worktree helper — establish protected mode..agents/skills/implementation-verification/SKILL.mdand review workflows — require guardedsynthetic integration.
tests/dev/— subprocess regression tests with a temporary bare remote.Definition of Done
HEAD:<implementation-branch>and force-with-lease attempts fail before remote mutation.Success Metrics
Validation / Testing
tests/dev/coverage plusBASE_REF=origin/main scripts/dev/pr_ready_check.sh.Estimate Discussion
Project Metadata