Skip to content

fix(autonomy): keep the lane-stop-gate arm record for 31 days from one constant - #18130

Merged
melodic-automation-lanes[bot] merged 3 commits into
mainfrom
work-resolve-issue/issue-17834-44987621165-1
Nov 22, 2026
Merged

melodic-automation-lanes[bot] merged 3 commits into
mainfrom
work-resolve-issue/issue-17834-44987621165-1

Conversation

@melodic-automation-lanes

@melodic-automation-lanes melodic-automation-lanes Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Closes #17834

Summary

Opened by the work-resolve-issue lane. The run's own summary:

Builds the owner's recorded decision on #17834 ("31 days, one constant"). hooks/lane-stop-gate-lib.sh now defines readonly GATE_ARM_TTL_DAYS=31. The gate derives GATE_ARM_TTL_SECONDS from it, and the arm helper's find -mtime sweep uses it, so the two lifetimes cannot drift apart. Before this change, a lane running past day 7 lost its arm record and later Stop events went unguarded. The README now says 31 days. The test suite gains a record aged 8 days, which still gates and is kept, and one aged 32 days, which no longer gates and is dropped. The README states no /loop limit: the live scheduled-tasks page still says recurring tasks expire after 7 days, so the 30-day figure in the issue is the owner's basis, not a fact this change asserts.

Not verified

  • plugins/autonomy/hooks/lane-stop-gate.test.sh was not run directly: the lane's Bash runs only the named wrappers. It is unclear whether check-affected's 17 passing checks included this suite, so the new 8- and 32-day cases are left to the PR's CI.
  • Done-when 'the hook header comments state 31 days' is met only by the constant, not by comment text. The header comment (lane-stop-gate.sh:49) says 'TTL-bounded' and never gave a day count. The repo's comment lint (necessary posture) rejected every rewritten header line that added '31 days', so the…
  • No test backdates a store file's mtime to show the arm helper's find sweep keeps an 8-day file and deletes a 32-day one. The new cases cover the gate's armed_at TTL. Backdating an mtime portably across GNU and BSD touch was left out.
  • Pre-existing, not changed here: the reviewer noted the lib's load guard (lane-stop-gate-lib.sh:42) trusts _LANE_STOP_GATE_LIB_LOADED from the environment. A repo env block that sets it would make the lib return early, and the gate would then abort under set -u and allow the stop. The gate is…
  • ai-slop:audit pass 5 of tidy ran as a rubric read only, because the lane cannot run the plugin's detect.sh. No findings file was written.
  • The checks were not re-run after tidy, because tidy changed no file. The last check-affected run already covers the final tree.

Fix

  • plugins/autonomy/hooks/lane-stop-gate-lib.sh: adds readonly GATE_ARM_TTL_DAYS=31 beside GATE_ARM_ID_RE, with a SC2034 shellcheck directive because only the two sourcing scripts read it. A comment above it gives the 31-day lifetime, names both readers (the gate's TTL check and the arm helper's find -mtime sweep), and links the README lane-stop-gate section.
  • plugins/autonomy/hooks/lane-stop-gate.sh: GATE_ARM_TTL_SECONDS=$((GATE_ARM_TTL_DAYS * 86400)) replaces the literal 7 * 86400. The header comment now says the arm record is retired by its 31-day TTL, names GATE_ARM_TTL_DAYS in lane-stop-gate-lib.sh, and links the same README section.
  • plugins/autonomy/hooks/lane-stop-gate-arm.sh: the store sweep is now find "$DIR" -type f -mtime +"$GATE_ARM_TTL_DAYS" -delete, replacing -mtime +7
  • plugins/autonomy/README.md: the arm record expires after 31 days, not 7
  • plugins/autonomy/hooks/lane-stop-gate.test.sh: two new cases after case 34. A record whose armed_at is 8 days ago still blocks an unsignaled stop and is kept. A record whose armed_at is 32 days ago does not block and is dropped. A sweep case follows. It backdates the mtimes of two files in lane-arms/ to 8 and 32 days ago, using POSIX touch -t with GNU date -d or BSD date -r. It then runs the arm helper and asserts that the 8-day file is kept and the 32-day file is deleted. Reverting the sweep to -mtime +7, or dropping it, now fails the suite.
  • .changes/autonomy/work-resolve-issue-issue-17834-44987621165-1-a55c02f3.md: new patch changelog fragment for autonomy (Changed)

Verification

The runner ran each check from the base copy against 8484f08:

  • scripts/check-changelog-fragments.sh --check: passed
  • scripts/check-changed-skills.sh --merge-base: passed

The run reports:

  • check-changelog-fragments: all 2 fragments valid
  • check-changed-skills: no changed skills, nothing to gate
  • check-affected: passed after fixes, with 17 passed, 8 skipped and 0 failed over the 6 changed files. The earlier runs failed on shellcheck SC2034 (the new constant is unused in the lib), fixed with a directive. They also failed on comment-lint, which rejected a rewritten header comment line in…
  • read https: //code.claude.com/docs/en/scheduled-tasks: the seven-day-expiry section says recurring tasks automatically expire 7 days after creation, so the README makes no claim about a 30-day /loop
  • review: a fresh-context subagent reviewed the whole diff and found no correctness bugs. It confirmed the lib is sourced before both uses on every path and that readonly cannot collide (load guard, subshells). It found that no test pins the old literals, that no other autonomy doc states 7 days for…
  • tidy (code-tidying:tidy-diff) over the 6 changed hunks made no edits. Passes 1-3 found nothing in the code lines. Pass 4 used the bundled write-for-humans default set and changed nothing. Pass 5 was a rubric read only, which found nothing.
  • Review round: the 31-day header and constant comments and the sweep test came from review feedback. The comment lint's necessary posture accepts an added comment only when its comment run carries a link, so each new comment run links the README section. The lane did not run the suite or the lint on this head; the PR's CI runs both.
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/44987621165

Left out: the items under Not verified. The review round has since added the 31-day header comment and the mtime sweep test that two of those items name.

Related

#17834

Lane-Activity: work-resolve-issue/resolve-issue
@github-actions

github-actions Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed e5b5ab47a13ee4dde58178c8e2c38223b0903d8f: read 3 of 3 changed file(s); 0 finding(s), 0 as inline comments.

Security review (incremental, blocking only): no security issues found.

This review covers only what changed since 8484f0816d4416a5ec2280f90cf3b246b58065e5, in 3 files. I read every hunk of all 3 files in the incremental diff. This lane already reviewed an earlier head, so this review reports only CRITICAL and IMPORTANT findings.

What changed and what I checked:

  • plugins/autonomy/hooks/lane-stop-gate-lib.sh and plugins/autonomy/hooks/lane-stop-gate.sh: only comments changed. They now state the 31-day arm-record lifetime, name GATE_ARM_TTL_DAYS and link to the changelog. readonly GATE_ARM_TTL_DAYS=31 and all executable code are unchanged. No instruction, trust control or merge hold is narrowed.
  • plugins/autonomy/hooks/lane-stop-gate.test.sh: this is test-only code. It adds an age_file_days helper that uses bash's built-in printf '%(…)T' and touch -t with quoted arguments built from test constants. It also adds a sweep test that runs the arm helper with a fixed literal id inside the test's own $DATA_DIR. No untrusted input reaches it, and it involves no token, secret or path outside the test directory.
  • Earlier findings: the two resolved threads (the missing header comment and the sweep that no test could catch breaking) are addressed by these hunks. Neither raises a security point.
  • Nothing else applies: the change touches no plugin manifest, trust-path control, credential or billable resource.

critical-findings: 0

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

claude-review: 2 inline finding(s) on 8484f0816d4416a5ec2280f90cf3b246b58065e5; the summary is in this lane's pull request comment.

claude-lane: claude-review

@github-actions

github-actions Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed e5b5ab47a13ee4dde58178c8e2c38223b0903d8f: read 3 of 3 changed file(s); 0 finding(s), 0 as inline comments.

Code review (incremental, blocking only): PR #18130, 8484f08 → e5b5ab4

This lane already reviewed an earlier head, so this pass reports only blocking findings. I read all three changed files.

There are no blocking findings.

The push fixes both findings this lane posted on 8484f08:

  • Header comments now state the 31-day lifetime (autonomy: lane-stop-gate arm record TTL (7 days) vs the 30-day /loop limit (held for the owner, security) #17834 Done-when, "the hook header comments state 31 days"): met.
  • The sweep test can now fail ("The find -mtime sweep … uses that constant"): met.
    • The new case at lane-stop-gate.test.sh:569-581 backdates the mtimes of two files in $DATA_DIR/lane-arms/ to 8 and 32 days ago.
    • It then runs the staged arm helper, which sweeps the same directory with find "$DIR" -type f -mtime +31 (lane-stop-gate-arm.sh:132).
    • Under -mtime +7 the 8-day file would be deleted, and with no sweep the 32-day file would stay, so either regression now fails the suite.
    • Each stamp truncates to the minute, so each file ends up slightly older than its nominal age. The 32-day file is therefore past -mtime +31, and the 8-day file is well inside it.
    • The date stamp uses TZ=UTC printf '%(…)T' and then TZ=UTC touch -t, so both steps read the stamp as UTC. The repo already uses the same pattern in hook-utils.sh:3324.
    • This needs Bash 4.2 or later. On an older Bash the stamp would come out empty, touch -t would fail, and the 32-day check would fail visibly rather than pass by mistake.
    • The fresh sweepfresh00aaaa arm record has a current mtime, and REC_4B (rewritten at line 554) also has a recent mtime, so the sweep leaves both alone. No later case lists lane-arms/.

I did not run the test suite or the comment lint. The PR says CI runs both; that is the author's claim and I have not checked it.

Closing issue #17834: the five Done-when items are met in the code. That the suite "passes" is claimed by the author and was not checked here.

Loosened check: the incremental change touches only comments and tests and loosens nothing. Loosened checks would be marked: fail (lane default; the prompt has no loosened_check_verdict: or loosened_check_patterns: line); patterns: 0. The citation requirement was not checked because the prompt has no loosened_check_decision_record: line.

No plugin manifest changed. Nothing in this push spends credits or adds cost.

Verifier dropped 0 of 0 candidates.

@melodic-automation-lanes

melodic-automation-lanes Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor Author

Unattended merge: native auto-merge leaves this pull request unarmed at head e5b5ab47a13ee4dde58178c8e2c38223b0903d8f. No person needs to act: a lane clears this reason, and the next scheduled run judges it again.

pr-merge's gate holds it on its risk score (evidence-unbound:claude-review: not bound: no-run;
  evidence-unbound:claude-security-review: not bound: no-run)

@github-actions

github-actions Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/address-feedback

Run 44996953966, attempt 1

Field Value
Model rung 0
Leg handoff
Run job success
Activity step success
Commits pushed none (read lane)
Run 44996953966

Failed GitHub API calls

No failed call recorded by the run job's scripts.

Lane-Activity: pr-unblock/address-feedback
Lane-Thread: PRRT_kwDOTCGFQM66gl6p
Lane-Thread: PRRT_kwDOTCGFQM66gl6q
@github-actions

github-actions Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/apply-feedback-patch

Run 44996953966, attempt 1

Field Value
Model rung 0
Leg base
Run job failure
Activity step failure
Commits pushed none recorded
Run 44996953966

Failed GitHub API calls

Method Path Status
PATCH /repos/{repo}/git/refs/heads/*/* 422

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

pr-unblock / address-feedback finished round 1 of max 4 on b852616.

@github-actions

github-actions Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/publish-feedback

Run 44996953966, attempt 1

Field Value
Model rung 0
Leg base
Run job success
Activity step success
Commits pushed none recorded
Run 44996953966

Failed GitHub API calls

No failed call recorded by the run job's scripts.

@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-refine/fix-docs

Run 44989936952, attempt 1

Field Value
Model rung 0
Leg handoff
Run job success
Activity step success
Commits pushed none (read lane)
Run 44989936952

Failed GitHub API calls

No failed call recorded by the run job's scripts.

@github-actions

github-actions Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/fix-ci

Run 44993965374, attempt 1

Field Value
Model rung 1
Leg handoff
Run job success
Activity step success
Commits pushed none (read lane)
Run 44993965374

Failed GitHub API calls

No failed call recorded by the run job's scripts.

@github-actions

github-actions Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/apply-patch

Run 44993965374, attempt 1

Field Value
Model rung 1
Leg base
Run job success
Activity step skipped
Commits pushed none recorded
Run 44993965374

Failed GitHub API calls

No failed call recorded by the run job's scripts.

@melodic-automation-lanes

melodic-automation-lanes Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor Author

The pr-unblock lane stopped fix-ci on this pull request: the lane could fix a failing check only by weakening a required check, and the head has no fresh fixer round left (it ran one, or an earlier lane stop already spent its same-head retry), so a session builder takes it. The lane labels it needs-session for a session builder, who makes the change this lane cannot, and the run ends in a failing pr-unblock/fix-ci status on the head the lane gated.

When a retry on this head can change the outcome, the lane runs one on its own, up to its per-head cap, and edits this comment if it stops again; a run that does not stop clears the status. When no retry can (a review thread the lane does not take or settle, or a failing check after the retries are spent), a person resolves the threads or gets the checks green, then dispatches the workflow below: that run finds the cause gone and clears the status. On a pull request the lanes App opened, the dispatchers start that run once per stop; on any other, a person does. A new commit to the branch starts clean.

To run it again on this head now, dispatch the pr-unblock workflow:

gh workflow run pr-unblock.yml -R melodic-software/claude-code-plugins -f pr-number=18130 -f activity=fix-ci

@github-actions

github-actions Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/report-escalation

Run 44996953966, attempt 1

Field Value
Model rung 0
Leg base
Run job success
Activity step success
Commits pushed none recorded
Run 44996953966

Failed GitHub API calls

No failed call recorded by the run job's scripts.

@melodic-automation-lanes melodic-automation-lanes Bot added the needs-session A pr-unblock stop a session builder takes: a change the lane cannot make. Not an owner stop. label Nov 22, 2026
…table date stamping

The plugin contract validator bars the org name anywhere under the
autonomy plugin, so the two comments that linked the plugin README now
link the upstream 30-day /loop expiry (Claude Code 2.1.330 changelog)
that the 31-day TTL outlasts. The test's file-aging helper formats its
touch -t stamp with the bash printf %()T builtin in place of GNU date -d,
which the shell portability lint rejects. No test count changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RAoAtUnz4WHB5auUnwQYq7
@kyle-sexton kyle-sexton removed the needs-session A pr-unblock stop a session builder takes: a change the lane cannot make. Not an owner stop. label Nov 22, 2026
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path is about to arm native auto-merge at head e5b5ab47a13ee4dde58178c8e2c38223b0903d8f, the head its arming checks judged. The arm fails if the head moves first.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Merge-Risk: max=MEDIUM demote=false head=e5b5ab47a13ee4dde58178c8e2c38223b0903d8f rubric=10.7.0 rater=claude-opus-5-5 checker=claude-opus-5-5

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Nov 22, 2026
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

pr-unblock / address-feedback finished round 2 of max 4 on e5b5ab4.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The pr-unblock lane stopped address-feedback on this pull request: a fix the lane recorded did not reach the branch, so none of its review replies was posted. The lane sets no label: the run ends in a failing pr-unblock/address-feedback status on the head the lane gated.

When a retry on this head can change the outcome, the lane runs one on its own, up to its per-head cap, and edits this comment if it stops again; a run that does not stop clears the status. When no retry can (a review thread the lane does not take or settle, or a failing check after the retries are spent), a person resolves the threads or gets the checks green, then dispatches the workflow below: that run finds the cause gone and clears the status. On a pull request the lanes App opened, the dispatchers start that run once per stop; on any other, a person does. A new commit to the branch starts clean.

To run it again on this head now, dispatch the pr-unblock workflow:

gh workflow run pr-unblock.yml -R melodic-software/claude-code-plugins -f pr-number=18130 -f activity=address-feedback

Merged via the queue into main with commit b3710fa Nov 22, 2026
107 of 111 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-17834-44987621165-1 branch November 22, 2026 07:22
@github-actions

Copy link
Copy Markdown
Contributor

Post-merge mutation testing

Killed 2, survived 1, timeout 0, no coverage 0, invalid 0, not run 0.
Covered-code score 67%; mutation score 67%.

File Killed Survived Timeout No coverage Invalid Not run
plugins/autonomy/hooks/lane-stop-gate-arm.sh 1 0 0 0 0 0
plugins/autonomy/hooks/lane-stop-gate-lib.sh 0 1 0 0 0 0
plugins/autonomy/hooks/lane-stop-gate.sh 1 0 0 0 0 0

Surviving mutants

Location Operator Disposition Cause
plugins/autonomy/hooks/lane-stop-gate-lib.sh:54 other productive input-gap

The run's summary has the full report.

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.

autonomy: lane-stop-gate arm record TTL (7 days) vs the 30-day /loop limit (held for the owner, security)

1 participant