Skip to content

fix(executing-a-branch-plan): implement Axis 2/4/6 state-management fixes for Execution log - #1342

Merged
tvna merged 13 commits into
mainfrom
claude/pr-1339-prep-4tasj7
Aug 26, 2026
Merged

fix(executing-a-branch-plan): implement Axis 2/4/6 state-management fixes for Execution log#1342
tvna merged 13 commits into
mainfrom
claude/pr-1339-prep-4tasj7

Conversation

@tvna

@tvna tvna commented Aug 25, 2026

Copy link
Copy Markdown
Owner

Summary

Implements five already-designed fixes to executing-a-branch-plan's
Execution log that close state-management-quality.md's Axis 2, Axis 4,
and Axis 6 gaps, plus the branch-plan-executing ownership label this
issue also requires.

Facts

  • state-management-quality.md's own "Worked example that fires" section
    cites executing-a-branch-plan's domain-events reference file (pinned
    revision 4c17391) as [ebp], and explicitly names Axis 2 FAIL (no run
    identifier), Axis 4 FAIL (append-only convention over a whole-body
    rewrite primitive, gap unstated), and Axis 6 FAIL, leading the entry (no
    handling for a missing/truncated/unparseable log).
  • Direct read + grep of current main confirms none of the five fixes
    named in issue fix(executing-a-branch-plan): Execution log fails state-management-quality.md's Axis 2/4/6 -- 5 designed fixes not yet implemented #1339 are present yet (verified independently during
    Branch Plan re-verification, not merely trusted from the issue body).

Assumptions

Risk / blast radius

Documentation/skill-definition only -- no runtime or harness dependency
(issue #1339's own Environment section). The drafting-a-pr-to-merge
edit is scoped to one label-presence check; no other behavior in that
skill changes.

Rollback

Revert this PR; all edits are prose-only with no downstream code
dependency.

Verification

Criterion Proof method Result
Run/attempt identifier on every event Direct read of edited file PASS -- run_id field on all six events
Read-modify-write discipline documented Direct read of edited file PASS -- fetch/append/write-back + overwrite-hazard note, extended to label writes
Missing/truncated/unparseable log fails loud Direct read of edited file PASS -- all three loss modes escalate
branch-plan-executing label grant/release + check Direct read of both edited files PASS -- Step 5 grant, Step 7/9 release (last, after event+comment), Step 2 check with tool citation
Freshness-based hang detection documented Direct read of edited file PASS -- 3-poll threshold, commit-history corroboration against false positives, escalates
Two independent review rounds (4 categories + isolated skill-quality audits) find no outstanding CONFIRMED issue Direct read of current file content against each round's findings PASS -- all real findings from both rounds closed; residual risks explicitly disclosed, not silently dropped

Checklist

  • Tests pass locally
  • Docs updated if behavior changed
  • Issue number cited in every commit
  • If this PR adds/modifies a skills/*/SKILL.md, ..., a ## Skill audit evidence section discloses the required verdicts/waivers
  • N/A -- no evals/*/split.md Kept-edit-log entry added
  • N/A -- no new Stop-boundary bullets or named dispatch branches added

Related Issue

Closes #1339

Acceptance Criteria Map

Criterion Interpretation Planned ops Proof method Residual risk
Add a run/attempt identifier to each Execution log entry A second execution of the same Branch Plan must not collide with the first execution's own log entries Add an identifier field to the closed event vocabulary in domain-events-and-failure-handling.md Direct read of the edited file confirms every event in the vocabulary carries this field Exact identifier format (sequential counter, UUID, or another scheme) is left to implementation time -- fixed here as the step-4 task-list-commit SHA
Document that writing to the PR body is read-modify-write, not append The append-only convention sits on top of a whole-body-rewrite API; that gap must be stated, not left implicit Add explicit fetch -> append -> write-back steps and the hazard of a naive overwrite to domain-events-and-failure-handling.md Direct read confirms the three-step write procedure and its hazard note are both present A second concurrent writer landing between fetch and write-back is a real, disclosed residual race the one-primitive write API cannot fully close
A missing, truncated, or unparseable Execution log must fail loud, never assume zero progress Closes the framework's Axis 6, named as the leading gap in the source evaluation Add an escalation rule to domain-events-and-failure-handling.md, wired to the existing closed StageDeviated{action: escalate} vocabulary rather than a new event type Direct read confirms all three loss modes (missing/truncated/unparseable) each have a stated escalation path, each releasing the ownership label None identified
Add a branch-plan-executing ownership-signal label The real PR state is ground truth; the label is its mirror, letting drafting-a-pr-to-merge detect an in-flight execution before entering its own fix loop Add label-grant at Step 5 and label-release at Step 7/9 to executing-a-branch-plan/SKILL.md; add a label-presence check before the fix loop to drafting-a-pr-to-merge/SKILL.md's Step 2, re-checked again at Step 10 before any loop-back Direct read of both edited files confirms the grant/release points, the check, tool citations, and the fetch-modify-write-back label-write discipline are each present and consistent The drafting-a-pr-to-merge edit is scoped to this one check (plus its Step 10 re-check of the same signal); no other behavior in that skill changes. A run that dies with no session ever resuming it can leave the label standing with no automated recovery -- disclosed, not solved, since closing it needs a mechanism outside this PR's scope
Use Execution log freshness as a hang-detection proxy If N consecutive polls show no new event, treat the run as hung and escalate, reusing Axis 3's freshness/re-read reasoning Add a freshness-based escalation rule to domain-events-and-failure-handling.md, corroborated against the branch's own commit history before declaring hung Direct read confirms the polling-based staleness rule, its ground-truth corroboration step, and its escalation path are present Concrete values for N and the polling interval are left to implementation time -- fixed here as 3 consecutive polls, roughly-hourly cadence. Distinguishing "wave never dispatched yet" from "wave dispatched and died" is not fully solvable without a mechanism outside this PR's scope -- disclosed as a residual risk, mitigated by the corroboration step covering the more dangerous live-but-slow-run case

Skill audit evidence

Two SKILL.md files changed in this PR: executing-a-branch-plan and
drafting-a-pr-to-merge. Both required audits were run against each,
dispatched through this repository's own verified isolation mechanism (a
claude -p subprocess from an isolated cwd/HOME with no
CLAUDE.md/AGENTS.md in its ancestry -- see
evaluating-skill-quality/references/adversarial-self-audit.md's
Isolation verification registry; the two-control procedure was reconfirmed
this session at CLI 2.1.245). Each dispatch received the target's own
snapshot plus the reviewing skill's own reference material only -- no
calling-session framing. Content changed twice after the initial audit
(commit 6619871), driven by two independent review rounds (see Execution
log); the summary below reflects the audit's original dimension-by-dimension
findings plus a direct-read reconciliation against the final content at
commit 1ccdcf8, since a third full isolated re-dispatch was judged
disproportionate to the size of the intervening changes (ordering fixes,
field additions, cross-reference corrections -- no new mechanism or branch).

  • battle-testing-a-skill: FAIL (pre-existing, undisturbed by later fixes)
  • evaluating-skill-quality: WELL-FORMED-NOT-MATURE

battle-testing-a-skill

  • executing-a-branch-plan: FAIL. 15/22 dimensions PASS, 5 N/A (no
    legal/financial/regulatory content), 2 real FAILs: dimension 10
    (Tool/privilege scope) -- the plugin-distributed deployment variant
    leaves task-level git push enforced only by an in-band prompt
    instruction plus a warn-only session hook, not structurally blocked;
    dimension 14 (Adversarial regression corpus) -- no evals/ directory
    exists for this skill's semantic judgments. Both are pre-existing,
    already-disclosed limitations in the target's own threat-model
    reference
    , untouched by any commit in this PR.
  • drafting-a-pr-to-merge: PASS. 17/22 dimensions PASS, 4 N/A, one
    FAIL on dimension 14 (no evals/ corpus) -- the same pre-existing gap
    class. A later independent-review pass separately flagged dimension 11
    (Cross-skill composition risk) against an earlier commit in this PR --
    the label's own concurrency invariant (Step 2's check) was not enforced
    on Step 10's loop-back path. Closed in commit 1ccdcf8: Step 10 now
    re-checks the label before looping back, and the Process Flow diagram's
    edge routes through Step 2 again rather than straight to Step 3;
    direct read of the current file confirms both.

evaluating-skill-quality

  • executing-a-branch-plan: WELL-FORMED-NOT-MATURE. Shape checks
    pass (56/56); no wrong-mechanism or low-cohesion finding (sequential
    cohesion, single converging outcome). Original gaps at dimension 5
    (Progressive disclosure tension with the declared Adaptive capability
    assumption), dimension 6 (Durability: two backtick-wrapped bare
    issue-citations), and dimension 7 (Bundled scripts: an admitted,
    undrifted-gated duplicate of hooks/check-bash-safety.sh) are all
    pre-existing, untouched by this PR's diff. A later independent-review
    pass additionally found, against an intermediate commit: a dimension-2
    duplication (the label's ownership rationale restated in full at three
    sites) and a dimension-6 concurrency-ownership gap (two sessions
    independently declaring the same run hung). The duplication is
    closed
    (commit 87f3e72: rationale now stated once at Step 5, cited
    elsewhere) -- direct read confirms the Related-skills and Draft-PR-first
    sections now say "not repeated here" instead of restating it. The
    concurrency-ownership gap is mitigated, not fully closed
    : the
    commit-history corroboration step (commit 87f3e72) closes the more
    dangerous false-positive direction (a live-but-slow run misdiagnosed as
    hung); the narrower "wave never dispatched vs. dispatched and died"
    case remains an explicitly disclosed residual risk, since a full fix
    needs a mechanism (heartbeat, lock) outside issue fix(executing-a-branch-plan): Execution log fails state-management-quality.md's Axis 2/4/6 -- 5 designed fixes not yet implemented #1339's own
    Constraints. Also flagged, non-blocking: an unbounded internal
    retry-loop blind spot (pre-existing) and an Invocation-mode step-level
    finding (no disable-model-invocation despite outward-facing/
    irreversible actions -- pre-existing, mitigated in consequence by the
    Step 1 authorization gate).
  • drafting-a-pr-to-merge: WELL-FORMED-NOT-MATURE. Shape checks pass
    (45/45, currently 499/500 lines); single-outcome sequential cohesion, no
    split finding. Original gaps at dimension 2 (Conciseness), dimension 3
    (Degree of freedom: unbounded retry prose on the inner-review-error
    branch), dimension 5 (Progressive disclosure), and dimension 6
    (Durability: sibling-skill path citations under a Portable declaration)
    are pre-existing. A later independent-review pass additionally found
    new dimension-3/4/6 gaps specific to the Step 2 label-check paragraph
    (no named tool call for reading the label; only two enumerated branches
    with no indeterminate/unreadable case) -- closed in commit 87f3e72:
    the check now cites github:pull_request_read method get's labels
    field explicitly and adds an "Unreadable -> treat as present,
    fail-closed" branch; direct read confirms both. The pre-existing missing
    blank line before ## Stop boundaries was also fixed as part of this
    PR's own line-budget compression (incidental, not separately tracked).

Execution-requirements drift (companion checker,
gitapex_scan_execution_requirements_drift.py): executing-a-branch-plan
reports 4 pre-existing findings (a network-command pattern in a bundled
shell script with no declared network.mode; tools.write/tools.shell
undeclared despite mutating-action/shell-invocation language) --
independently confirmed present on origin/main before this PR, not
introduced by it. drafting-a-pr-to-merge reports no drift. Both
re-confirmed clean of new drift after every commit in this PR.

Independent review verdict

  • Verdict: CLEAN
  • Verified commit: de67cf2

Outer layer. This repository has no confirmed Anthropic "Claude Code
Review" GitHub App installation; GitHub Copilot review was requested
(github:request_copilot_review) twice -- once against commit 1ccdcf8,
again against this verdict's own verified commit after the merge below.
Copilot's review is Comment-only with no pass/fail signal of its own -- a
materially weaker guarantee than the App's severity summary, not
equivalent -- and no response had been posted by the time this verdict was
recorded either time. This gap is disclosed rather than silently treated as
full coverage; any comment Copilot posts after this point will be triaged
the same as any other review-thread finding (Step 3's own untrusted-input
discipline) and, if it names a real defect, looped back through Step 3
before this section is re-recorded.

Inner layer (mandatory, ran regardless of the outer layer's
availability).
Three independent-review rounds have now run against this
PR, each via fresh subagent dispatches with no stake in the change:

  • Round 1 (against commit 0628483): 4 parallel category-focused passes
    (correctness, regression/blast-radius, reuse/simplification,
    convention-adherence) plus 2 isolated battle-testing-a-skill/
    evaluating-skill-quality dispatches. Found 10 real, independently
    convergent issues (see Execution log for the full list) -- most
    seriously, a concurrency bug (drafting-a-pr-to-merge's Step 10 could
    resume its fix loop without re-checking the ownership label, bypassing
    the concurrency gate Step 2 exists to enforce) and an unspecified label
    write mechanism (a naive single-field write would have silently
    replaced the PR's entire label set). All 10 fixed in commit 87f3e72.
  • Round 2 (verification pass against commit 87f3e72's own fixes,
    checking whether round 1's findings were actually closed rather than
    merely addressed at their original site): found the fix round itself
    had left 2 real regressions standing (a Stop-boundaries bullet in
    executing-a-branch-plan/SKILL.md still stating the pre-fix label-
    release ordering; a third StageDeviated literal missing required
    fields in a file round 1's diff never touched) plus 6 lower-severity
    cross-reference/completeness gaps introduced by the same round's heavy
    line-budget compression. All 8 fixed in commit 1ccdcf8.
  • Round 3 (against merge commit de67cf2, after origin/main advanced
    past this branch's fork point and produced a real merge conflict --
    see Execution log): a fresh dispatch adversarially reviewed the manual
    conflict resolution in skills/executing-a-branch-plan/SKILL.md Step 5
    (which combined this branch's own label-grant text with origin/main's
    independently-added requirement to carry .github/PULL_REQUEST_TEMPLATE.md's
    ## Merge gate: independent review note verbatim into the opened PR
    body) plus every other file the merge touched
    (threat-model-and-authorization.md, drafting-a-pr-to-merge/SKILL.md's
    own verdict-heading rename to match this exact heading). Live-verified
    (not just read) by actually running
    gitapex_scan_independent_review_heading_drift.py (clean) and the full
    independent-review-pending pytest suite (69 passed) against the merged
    files. No defect from the merge itself found. One pre-existing,
    out-of-scope gap was incidentally surfaced: executing-a-branch-plan/SKILL.md's
    own Output section (PR: bullet) does not mention the merge-gate note
    Step 5 now also requires the draft PR to carry -- confirmed byte-identical
    across the merge-base, this branch, and origin/main alike, so the gap
    predates this PR entirely and originates in the same origin/main commit
    that added the Step 5 requirement, not in this PR's own diff or its
    merge resolution. Left unfixed here per issue fix(executing-a-branch-plan): Execution log fails state-management-quality.md's Axis 2/4/6 -- 5 designed fixes not yet implemented #1339's own Constraints
    (no scope creep beyond the five named fixes and the one
    drafting-a-pr-to-merge check).

Every candidate finding from all three rounds was independently validated
against the actual current file content (not the finder pass's own
assertion) before being treated as real; nothing below the reporting
threshold was fixed, and nothing above it was left outstanding. No
outstanding CONFIRMED finding remains as of the verified commit above.

Execution log

  • PlanApproved -- Branch Plan approved via in-session operator confirmation, branch published at commit 2a39d6c.
  • TaskCompleted{run_id: 2a39d6c, task_id: A, commit_sha: a3d3526} -- domain-events-and-failure-handling.md: run identifier, RMW discipline, loss/absence handling, freshness/hang detection.
  • TaskCompleted{run_id: 2a39d6c, task_id: B, commit_sha: 6ef4aa1} -- executing-a-branch-plan/SKILL.md: grant/release branch-plan-executing label at Step 5/9.
  • TaskCompleted{run_id: 2a39d6c, task_id: C, commit_sha: 8d374d2} -- drafting-a-pr-to-merge/SKILL.md: label-presence check in the draft branch.
  • TaskCompleted{run_id: 2a39d6c, task_id: fixup-body-length, commit_sha: 6c908e7} -- drafting-a-pr-to-merge/SKILL.md: compressed label-check prose (CI's own body-length shape check had failed at 510 lines; now 500).
  • TaskCompleted{run_id: 2a39d6c, task_id: step8-refactor, commit_sha: bb9a984} -- Step 8 refactor/simplify pass (fresh subagent, independent of the task agents): tightened prose, fixed a line-wrap and a step-number terminology collision.
  • TaskCompleted{run_id: 2a39d6c, task_id: step8-adversarial-review, commit_sha: ee75592} -- Step 8 adversarial code review (second fresh subagent): fixed dangling step-11 refs, a stale edge-case note, a Rollback-manifest ambiguity, a missing defer branch in the Process Flow diagram, a label/mergeable_state terminology collision, and an unqualified label token.
  • TaskCompleted{run_id: 2a39d6c, task_id: skill-audit-disclosure, commit_sha: 6619871} -- ran battle-testing-a-skill and evaluating-skill-quality against both changed SKILL.md files via isolated claude -p dispatch; disclosed in the ## Skill audit evidence section.
  • StageDeviated{run_id: 2a39d6c, task_id: null, reason: "Step 9 handoff at commit 6619871 was premature -- a deeper self-review before requesting the outer/inner Step 8 layers found the label mechanism and hang-detection design itself carried unfixed defects", action: retry} -- the PR was marked ready for review at 6619871 before this skill's own required two-layer review (drafting-a-pr-to-merge Step 8) had actually run against it; caught before any human/CI signal, treated as a retry into a fix round rather than a stop-and-replan since the underlying ACM criteria were still correct, only the implementation needed correction.
  • TaskCompleted{run_id: 2a39d6c, task_id: step8-fix-round-1, commit_sha: 87f3e72} -- closed all 10 findings from Step 8 inner-layer review round 1 (4 category-focused passes + 2 isolated skill-quality audits) against commit 0628483: label-write RMW discipline + tool citations, Step 10 label re-check before loop-back, label-release ordering (last, after event+comment), missing run_id fields in 2 StageDeviated literals, 3x-duplicated label rationale consolidated to 1 site, escalation-circularity claim softened to a disclosed residual risk, hang-detection commit-history corroboration against false positives, Process Flow defer-as-sink diagram/prose contradiction, over-elaborated Related-skills paragraph trimmed.
  • TaskCompleted{run_id: 2a39d6c, task_id: step8-fix-round-2, commit_sha: 1ccdcf8} -- closed all 8 findings from a Step 8 verification pass checking whether round 1's fixes actually held: a Stop-boundaries bullet with the pre-fix label-release ordering, a third under-specified StageDeviated literal in threat-model-and-authorization.md, Loss-and-absence-handling never itself stating the label release, a defer-loop caption citing the wrong retry-target step, a temporally self-contradictory rollback-offer parenthetical, an unspecified recheck cadence on the hang-detection corroboration branch, a Worked Example not reflecting the new Step 10 rule.
  • Step 9 handoff (corrected) -- All tasks complete, both Step 8 review rounds clean, local HEAD (1ccdcf8) confirmed to match origin/claude/pr-1339-prep-4tasj7. The branch-plan-executing label was never actually applied to this PR: the label-grant mechanism is itself part of this PR's own not-yet-merged implementation, so it could not be self-applied before it existed -- recorded here rather than silently glossed over, no label-removal action needed as a result. Ownership of this PR's activity passes to drafting-a-pr-to-merge's normal entry point.
  • StageDeviated{run_id: 2a39d6c, task_id: null, reason: "origin/main advanced past this branch's fork point (7d4e6d2 -> cdf17c0, merging PR #1331) while drafting-a-pr-to-merge was driving this PR to its terminal state, producing mergeable_state: dirty", action: retry} -- drafting-a-pr-to-merge Step 7's "dirty" branch: resolved via git fetch origin main && git merge origin/main --no-edit (merge commit de67cf25fa342f6d4f404028c1ebe0277aeaf41b), one real conflict in executing-a-branch-plan/SKILL.md Step 5 (this branch's label-grant text vs. origin/main's independently-added ## Merge gate: independent review note carry-forward requirement), resolved by combining both clauses; every other touched file auto-merged cleanly. Resolution documented in a PR comment per Step 7's own always-comment rule. origin/main's own merge additionally renamed the independent-review-pending gate's canonical heading from ## Step 8 independent review verdict to ## Independent review verdict -- this section renamed to match, per Round 3 above.
  • TaskCompleted{run_id: 2a39d6c, task_id: step8-round-3-merge-review, commit_sha: de67cf2} -- Step 8 re-run (mandatory re-confirmation after a diff-changing merge, not a stale-verdict carry-forward): fresh adversarial dispatch plus live gate/pytest execution found no defect from the merge resolution itself (see ## Independent review verdict above for the one incidentally-surfaced, pre-existing, out-of-scope finding).
  • Step 9 handoff (re-confirmed) -- All tasks complete, all three Step 8 review rounds clean (see ## Independent review verdict above), merge conflict resolved and pushed, local HEAD (de67cf2) confirmed to match origin/claude/pr-1339-prep-4tasj7. Ownership of this PR's activity remains with drafting-a-pr-to-merge's normal entry point; that skill's own Step 9 (mark draft: true) follows once mergeable_state is reconfirmed clean against this head.

@tvna
tvna deployed to ruleset-verify August 25, 2026 22:29 — with GitHub Actions Active
@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 15687586-9109-43e1-ba54-169306691e03


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Aug 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.54%. Comparing base (cdf17c0) to head (de67cf2).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1342   +/-   ##
=======================================
  Coverage   99.54%   99.54%           
=======================================
  Files         123      123           
  Lines       21896    21896           
  Branches     2682     2682           
=======================================
  Hits        21797    21797           
  Misses         99       99           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…s handling, hang detection to Execution log

Closes #1339
@tvna
tvna deployed to ruleset-verify August 25, 2026 22:34 — with GitHub Actions Active
@tvna
tvna deployed to ruleset-verify August 25, 2026 22:36 — with GitHub Actions Active
@tvna
tvna deployed to ruleset-verify August 25, 2026 22:37 — with GitHub Actions Active
…0-line body cap

The added label-presence check pushed SKILL.md body length to 510 lines,
failing the repo's own body-length shape check (CI, pytest). Tightened
the wording without changing what it says.

Closes #1339
@tvna
tvna deployed to ruleset-verify August 25, 2026 22:47 — with GitHub Actions Active
…erminology collision

Independent refactor pass over the aggregate diff: drop a duplicated
"in this same step", rewrap lines the earlier edits left over-long, and
disambiguate "between steps 1 and 3" (read as this skill's own numbered
steps) to "between the fetch and the write-back" (the local list items
actually meant). Behavior-preserving only.

Closes #1339
@tvna
tvna deployed to ruleset-verify August 25, 2026 22:48 — with GitHub Actions Active
…ge-case note, and rollback ambiguity

Independent adversarial-review pass over the aggregate diff (fresh
subagent, correctness-focused, separate from the refactor pass):

- Two dangling lowercase "step 11" references in
  domain-events-and-failure-handling.md actually meant
  drafting-a-pr-to-merge's own Step 11 (escalate to the owner) --
  executing-a-branch-plan only has steps 1-9. Disambiguated per this
  file's own foreign-step-naming convention.
- The "vs. drafting-a-pr-to-merge" Related-skills entry still described
  the mid-execution-draft misread as prevented only "in practice" by the
  step-5 subscribe boundary, contradicting this same PR's own label
  check in drafting-a-pr-to-merge's Step 7. Updated so the label is the
  direct fix and the subscribe boundary is the second layer.
- The Rollback section's "the branch's own first commit" becomes
  ambiguous once a re-run publishes a second task-list commit under a
  different run_id onto the same branch. Scoped the revert manifest to
  TaskCompleted events carrying the current run_id.

Also fixes, found independently during the same pass:
- drafting-a-pr-to-merge's own Process Flow diagram didn't show the new
  branch-plan-executing defer branch, contradicting Step 7's own "the
  diagram is the source of truth" claim. Added the edge and sink.
- "do not stop at the label" collided with the pre-existing "draft"
  state-name terminology; reworded to "state name".
- "Check `branch-plan-executing` first" read as a skill name (this
  file's own backtick convention); reworded to name it as a label.

Closes #1339
@tvna
tvna deployed to ruleset-verify August 25, 2026 23:06 — with GitHub Actions Active
…for CLI 2.1.245

Per this repository's own live per-platform isolation registry
(Subagent dispatch's exclusion requirement): re-ran the two-control
verification procedure ahead of a battle-testing-a-skill /
evaluating-skill-quality audit round for #1339's own executing-a-
branch-plan and drafting-a-pr-to-merge changes, at a CLI version
(2.1.245) newer than any recorded entry. Both controls held; recording
per the registry's own "record a new entry" requirement.

Refs #1339
@tvna
tvna deployed to ruleset-verify August 25, 2026 23:13 — with GitHub Actions Active
@tvna
tvna marked this pull request as ready for review August 25, 2026 23:25
…p-back findings on the label/hang-detection design

Fixes design bugs found by re-review of this PR's own accumulated diff
before requesting the two-layer independent review:

- Freshness/hang detection previously read as applying while a wave is
  outstanding, but Step 6 only writes a wave's events in a single batch
  after it returns -- every healthy multi-hour wave would eventually
  read as hung. Rescoped to apply only on a resumed session with no live
  memory of the dispatch; documented the residual risk a run dying with
  no resume ever leaves unresolved (out of scope per issue #1339's own
  constraint limiting drafting-a-pr-to-merge to the bare label check).
- branch-plan-executing had no release path outside step 9's success
  path, so a stop-and-replan/escalate dispatch left the label standing
  forever -- a deadlock against drafting-a-pr-to-merge's own step 2 defer,
  and a circular escalation target (that step's own Step 11 is never
  reached while the label persists). Added a general release-on-
  stop-and-replan/escalate rule to the StageDeviated event vocabulary and
  wired it into executing-a-branch-plan's own step 7 and Stop boundaries.
- Softened the read-modify-write section's overclaim about what the
  fetch-then-write-back window actually protects against a second
  concurrent writer.
- Added the previously-uncovered "heading not found" loss mode to Loss
  and absence handling's dispatch table.
- Updated the Draft-PR-first pattern section and three stale
  drafting-a-pr-to-merge "step 7" citations left over from moving its
  label check to step 2.
- Compressed drafting-a-pr-to-merge/SKILL.md back to the 500-line body
  cap after the step 2 label-check addition, and updated its frontmatter
  description to disclose the new defer branch.

Issue #1339.
@tvna
tvna deployed to ruleset-verify August 25, 2026 23:58 — with GitHub Actions Active
…pendent review findings on the label mechanism

A fresh two-layer Step 8 review (4 adversarial subagent passes plus two
isolated battle-testing-a-skill/evaluating-skill-quality dispatches)
against the previous fix-round commit found several convergent, real
defects in the branch-plan-executing label mechanism and the
freshness/hang-detection design:

- Confirmed and closed a genuine concurrency bug: drafting-a-pr-to-merge's
  own Step 10 looped back to Step 3 on finding a new blocker without
  re-checking the label first, bypassing the very gate Step 2 exists to
  enforce for a run resumed days into monitoring. Step 10's prose and the
  Process Flow diagram edge now route back through Step 2.
- Neither file named a tool call for reading or writing the label, and a
  naive single-field label write (the only write shape this repo's
  GitHub MCP tool exposes) would silently replace the PR's entire label
  set. Added a fetch-modify-write-back discipline for label writes,
  mirroring the PR-body RMW discipline already documented, plus explicit
  tool citations for the read side.
- Label release on a stop-and-replan/escalate dispatch happened before
  the event write and human-facing comment completed, letting a
  concurrently-polling drafting-a-pr-to-merge session start acting during
  that window. Reordered to release last in every dispatch branch.
- Two `StageDeviated{action: ...}` event literals in the Failure dispatch
  table omitted the run_id/task_id/reason fields the same diff's own
  closed-set schema requires everywhere else.
- The label's ownership-signal rationale was restated in full at three
  separate sites across two files; consolidated to one canonical
  statement with cross-references at the other two.
- Softened an overclaimed escalation-circularity fix: releasing the label
  stops indefinite deferral, but drafting-a-pr-to-merge's Step 3 still has
  no mechanism to recognize an escalation comment as a stop signal rather
  than something to fix -- named as a residual risk, not solved, since
  closing it needs a second check outside this PR's declared scope.
- Hang detection now corroborates log staleness against the branch's own
  commit history before declaring a run hung, closing the false-positive
  path where releasing the label on a live-but-slow run would itself
  create the concurrent-access hazard the label exists to prevent; the
  narrower "wave never dispatched vs. dispatched and died" case this
  cannot distinguish is disclosed as a residual risk.
- Fixed the Process Flow diagram calling `defer` a terminal "sink" while
  the prose describes it as a cyclical recheck loop.
- Trimmed an over-detailed restatement of drafting-a-pr-to-merge's own
  Step 7 internals from executing-a-branch-plan's Related skills section.

Re-verified both files at 500/500 and 56/56 deterministic shape checks,
and the repository's own execution-requirements-drift scanner reports no
new drift on either file.

Issue #1339.
@tvna
tvna deployed to ruleset-verify August 26, 2026 00:33 — with GitHub Actions Active
…on findings on the previous fix round

An independent verification pass against the previous fix-round commit
(checking whether findings #1-#9 were actually closed, not merely
addressed at their original site) found the fix round itself had
introduced or left standing several inconsistencies:

- executing-a-branch-plan/SKILL.md's own Stop-boundaries bullet still
  stated the label-before-comment ordering the same round's fix corrected
  everywhere else -- releasing the label before the escalation comment
  posts recreates the exact race that fix was meant to close. Reordered.
- A third `StageDeviated{action: escalate}` literal in
  threat-model-and-authorization.md, identical in shape to the two fixed
  in the prior commit, was missed because that file wasn't touched by
  that diff. Added the missing run_id/task_id/reason fields.
- Loss and absence handling's three loss-mode bullets never themselves
  stated the label release, even though the general ordering rule implies
  it applies there too. Added an explicit statement covering all three.
- The Process Flow legend's new defer-loop caption cited "retrying step
  2" where step 2's own authoritative text says "retrying step 3" for the
  identical loop. Aligned the caption to the authoritative text.
- The stop-and-replan dispatch's rollback-offer parenthetical read as
  temporally self-contradictory (closing the PR, then a later clause
  saying to offer the rollback "before closing"). Rewritten as an
  explicit ordered sequence.
- Hang detection's new commit-history corroboration branch left "keep
  waiting" with no stated recheck cadence. Named the same roughly-hourly
  cadence used elsewhere in the same section.
- The Worked example's Step 10 item didn't demonstrate the new
  label-recheck-before-loopback rule from the same round's own fix.
  Updated to show it.

Re-verified both files at 499/500 and 56/56 deterministic shape checks,
full pytest suite green (one pre-existing, unrelated failure confirmed
present on main independent of this branch), and no new
execution-requirements-drift.

Issue #1339.
@tvna
tvna deployed to ruleset-verify August 26, 2026 00:54 — with GitHub Actions Active
claude added 2 commits August 26, 2026 04:05
…nches

CI's own skill-audit-gate flagged drafting-a-pr-to-merge's frontmatter
description change (disclosing the new defer branch) as needing eval
coverage evidence: touch evals/<skill>/tasks/ or eval-status.md, or
disclose an eval-coverage-disclosure: WAIVED line.

Added real fixture coverage instead of waiving it, since the new
branches this PR actually introduced (the branch-plan-executing label
check at step 2, and step 10's label re-check before looping back) had
no fixture at all:

- ownership-label-present.yaml: label present -> defer without running
  the fix loop.
- ownership-label-recheck-on-loopback.yaml: step 10 finds a new blocker
  -> re-checks the label before looping back, not step 3 directly.

Regenerated docs/skill-eval-status.md (fixture count 24 -> 26) via its
own generator script. One fixture's initial output_not_contains entry
("run steps 3") was dropped after the repo's own fixture-assertion
linter flagged it as a negation-trap: the skill's Stop boundaries
already say "never run steps 3-6's fix loop," so banning that substring
would also reject a correct denial.

Issue #1339.
…tasj7

# Conflicts:
#	skills/executing-a-branch-plan/SKILL.md
@tvna
tvna deployed to ruleset-verify August 26, 2026 12:34 — with GitHub Actions Active

tvna commented Aug 26, 2026

Copy link
Copy Markdown
Owner Author

Merge conflict resolution (mergeable_state: "dirty" -> resolved)

origin/main advanced past this branch's fork point (7d4e6d2 -> cdf17c0, merging PR #1331, issue #1326's bash-safety-bypass closure) while this PR's fix rounds were in progress, producing a real merge conflict.

What was done: git fetch origin main && git merge origin/main --no-edit (merge commit de67cf25fa342f6d4f404028c1ebe0277aeaf41b).

Conflict (1 file, 1 hunk): skills/executing-a-branch-plan/SKILL.md, Step 5's "Open a draft PR and subscribe" paragraph. This branch's own HEAD had added branch-plan-executing label-grant text there; origin/main had independently added a requirement to carry forward .github/PULL_REQUEST_TEMPLATE.md's ## Merge gate: independent review note verbatim into the opened PR body (needed by main's new gitapex_scan_independent_review_heading_drift.py gate, which now tracks that exact phrase as live text in this file). Resolved by combining both clauses into one paragraph -- draft-PR-open now carries the ACM, the seeded Execution log section, the PR-template note verbatim, and the label grant, in that order.

Other files (skills/drafting-a-pr-to-merge/SKILL.md's verdict-heading rename from ## Step 8 independent review verdict to ## Independent review verdict, threat-model-and-authorization.md's issue-#1326 bash-safety updates, and everything else origin/main carried) auto-merged with no conflict; diffed against origin/main directly to confirm this branch's own prior edits (the run_id/label-release-ordering fixes) survived intact.

Follow-up required by the same main-side change: this PR body's own ## Step 8 independent review verdict heading is being renamed to ## Independent review verdict in the next update, matching the gate's new canonical heading text (independent-review-pending check already flagged the mismatch as failure against the merged head) -- verdict content and verified-commit SHA are being re-recorded against this new head in the same update, not merely relabeled.


Generated by Claude Code

@tvna
tvna merged commit 8cf80ce into main Aug 26, 2026
28 of 29 checks passed
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.

fix(executing-a-branch-plan): Execution log fails state-management-quality.md's Axis 2/4/6 -- 5 designed fixes not yet implemented

2 participants