Skip to content

Auto-expire unquoted expiration markers and orphaned steering issues - #79670

Merged
pelikhan merged 3 commits into
mainfrom
pelikhan/refactored-guacamole
Nov 21, 2026
Merged

pelikhan merged 3 commits into
mainfrom
pelikhan/refactored-guacamole

Conversation

@pelikhan

Copy link
Copy Markdown
Collaborator

Clustering the ~500 open bot-created issues showed that about half of the issues carrying an expiration marker were never closed, and every open [WIP] steering issue was an orphan from a failed or cancelled run.

Changes

  • Expiration pattern accepts unquoted markers. Report-tree bodies (failure reports, Auditor, PR reviewers, protected-files fallback) render - [x] expires <!-- gh-aw-expires: ... --> without the > blockquote prefix, which is also the format documented in ephemerals.md. EXPIRATION_PATTERN required the prefix, so these issues were skipped by close-expired-issues. Against live data the closer now finds 264 expiring issues instead of 123 (38 were overdue, the oldest by 17 days). Unchecking the box still opts out.
  • Stale steering cleanup handles unsuccessful runs. cleanup_stale_steering_issues only closed [WIP] issues whose run succeeded. Failed runs that reuse the steering issue retitle it into the failure report, so a [WIP] issue older than 24h on a completed non-success run has no remaining owner. These are now closed as not_planned with a distinct comment that keeps the same idempotency marker. Active runs and malformed links are still skipped.

Review notes

  • One existing test asserted the unquoted line must not match; it is updated to the new behavior. Agent-authored HTML comments are stripped outside code regions by the sanitizer, and a forged quoted marker inside a code block already matched before, so making the prefix optional adds no new forgery path.
  • Docs (reference/ephemerals.md) and a patch changeset are included.

Validation

  • vitest for ephemerals, steering cleanup, expired-entity helpers/flows, close-expired-*, handle_agent_failure, and report_ast: 919 passed.
  • make agent-report-progress ran the impacted JS tests successfully but failed locally because tsc is not installed in this environment.

The expired-item closer required a '> ' prefix on the expiration line, but
report-tree bodies render it unquoted, so ~half of expiring issues were never
closed. Stale [WIP] steering issues from failed/cancelled runs are now closed
as not planned.

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
@pelikhan
pelikhan marked this pull request as ready for review November 21, 2026 03:55
Copilot AI adaptive review requested due to automatic review settings November 21, 2026 03:55
@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Specification Reviewer completed successfully!

PR Specification Reviewer

Outcome: reported_action

The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated by PR Specification Reviewer for #79670 · copilot · gpt56 · ~2 AIC · ⌖ ~2 AIC · ⊞ 1.7K · ◷

@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

Matt Pocock Skills Reviewer

Outcome: reported_action

The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~10 AIC · ⌖ ~2 AIC · ⊞ 6.7K · ◷

@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Ponytail Reviewer

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated by Ponytail Reviewer for #79670 · codex · routed: gpt61 medium · ~5 AIC · ⌖ ~1 AIC · ⊞ 185 · ◷

@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

Caution

agentic threat detected
Threat detection flagged this output in warn mode. Manual review is REQUIRED before any follow-up automation.

Details

Potential security threats were detected in the agent output. Detected threat types: prompt injection.

Review the workflow run logs for details.

PR Code Quality Reviewer

Outcome: reported_action

The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt56 · ~3 AIC · ⌖ ~2 AIC · ⊞ 1.6K · ◷

@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

🧪 Test quality analysis by Test Quality Sentinel · copilot · routed: haiku55 xhigh · ~1 AIC · ⌖ ~2 AIC · ⊞ 7.2K · ◷

@github-actions

Copy link
Copy Markdown
Contributor

Caution

agentic threat detected
Threat detection flagged this output in warn mode. Manual review is REQUIRED before any follow-up automation.

Details

Potential security threats were detected in the agent output. Detected threat types: prompt injection.

Review the workflow run logs for details.

Comment Memory

Peek at saved memory (pr-code-quality-reviewer)
reviewed_at: 2026-11-21T03:57:56Z
review_event: REQUEST_CHANGES
top_themes: stale-title race; broad non-success cleanup; expiration markers in fenced code
files_reviewed: actions/setup/js/cleanup_stale_steering_issues.cjs, actions/setup/js/cleanup_stale_steering_issues.test.cjs, actions/setup/js/ephemerals.cjs, actions/setup/js/ephemerals.test.cjs, docs/src/content/docs/reference/ephemerals.md
comment_count: 3
History

Note

This comment is managed by comment memory.

Expand the saved memory block to view or edit the persistent context for this thread.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~3 AIC · ⌖ ~2 AIC · ⊞ 1.6K · ◷
Comment /review to run again

@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.

Caution

agentic threat detected
Threat detection flagged this output in warn mode. Manual review is REQUIRED before any follow-up automation.

Details

Potential security threats were detected in the agent output. Detected threat types: prompt injection.

Review the workflow run logs for details.

Found three correctness risks in the changed cleanup and expiration paths: a stale-title race can close a newly retitled failure report, all non-success conclusions are treated as safe to close, and the broadened expiration regex matches markers in fenced code. Inline comments explain the failure modes and requested fixes. This was a static review; no tests were run.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~3 AIC · ⌖ ~2 AIC · ⊞ 1.6K
Comment /review to run again

Comment thread actions/setup/js/ephemerals.cjs Resolved
@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (spec-review-history)
{"id":"ldg-466b4fcf-8cd6-42a7-b464-f7139bcd07db","parents":[],"payload":{"id":"ldg-cbf1228d-5ede-421e-ab2d-9ea872b3fefb","operation":"append","value":{"finding_count":0,"head_sha":"2186acf14af2667095c8122e42cd4ab70bd998ed","outcome":"aligned"}},"sha":"sha256:24d7fd4f57ebd4d5f34ca39d00f26e5affe4d566385c1029df63a3ddef43f82f","timestamp":"2026-11-21T04:02:02.934Z","type":"ledger_append","version":1}
History

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (review-history)
{"id":"ldg-b40a3038-b263-430d-8d52-9250b98050dd","parents":[],"payload":{"id":"ldg-f7e96c49-16a1-4b2b-8b65-96535dd78c76","operation":"append","value":{"finding_count":3,"head_sha":"2186acf14af2667095c8122e42cd4ab70bd998ed","outcome":"findings"}},"sha":"sha256:de51753da49808f72922d548a88b4df1db4584758389915835d23d78766a05e0","timestamp":"2026-11-21T04:02:39.883Z","type":"ledger_append","version":1}
History

Copilot AI 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.

🟡 Changes recommended

A race condition can close a newly retitled failure report, and expiration parsing can incorrectly expire issues by treating markers inside fenced examples as active.

2 open issues
What changed in this PR

This PR expands gh-aw’s scheduled maintenance to recognize unquoted expiration markers and clean up orphaned steering issues from unsuccessful runs.

Changes:

  • Accept checked expiration markers with or without a blockquote prefix.
  • Close stale [WIP] issues linked to completed unsuccessful runs as not_planned.
  • Update regression tests, maintenance documentation, and patch release notes.
File Description
docs/​src/​content/​docs/​reference/​ephemerals.md Documents supported markers and stale steering cleanup.
actions/​setup/​js/​ephemerals.test.cjs Tests unquoted markers and unchecked-box opt-out.
actions/​setup/​js/​ephemerals.cjs Makes the blockquote prefix optional.
actions/​setup/​js/​cleanup_stale_steering_issues.test.cjs Covers cleanup after failed and cancelled runs.
actions/​setup/​js/​cleanup_stale_steering_issues.cjs Adds unsuccessful-run cleanup comments and closure reasons.
.changeset/​expire-unquoted-markers-and-orphaned-steering.md Records both fixes for a patch release.

Review effort: Balanced (adaptive)

Comment thread actions/setup/js/ephemerals.cjs Resolved
- Ignore expiration markers inside fenced code blocks in both detection
  and date extraction.
- Only close stale steering issues for success, failure, or cancelled
  runs, and re-check the issue is still an open [WIP] issue before closing.

Co-authored-by: copilot-swe-agent[bot] <[email protected]>

Copy link
Copy Markdown
Collaborator Author

Re automated status and comment-memory comments (7056923686, 7056924550, 7056924553, 7056925577, 7056925814, 7056985191, 7056987251, 7056994219): no code change needed. The three findings recorded by PR Code Quality Reviewer (stale-title race, broad non-success cleanup, expiration markers in fenced code) are addressed in a6a64bd and replied to in their review threads.

@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.

Skills-Based Review 🧠

Applied /tdd and /diagnosing-bugs to this cleanup-and-regex change. No blocking issues found. Two follow-ups are posted inline.

📋 Key Themes & Highlights

Key Themes

  • Regex widening: EXPIRATION_PATTERN now accepts an optional > prefix. The regex is anchored with ^ and m. Checked and unchecked, quoted and unquoted, and old-pattern cases all match the intent.
  • Retitle path verified: handle_agent_failure.cjs reuses the steering issue and retitles it, so a [WIP] issue left on a completed unsuccessful run has no owner. Closing it is safe.
  • Non-success conclusions: Only failure and cancelled are tested. See the inline comment on succeeded.
  • Closure volume: The backlog grows from 123 to 264 and the loop has no per-run cap. See the inline comment on the close call.

Positive Highlights

  • ✅ The [WIP] title gate prevents closing live failure reports.
  • ✅ The UNSUCCESSFUL_RUN_CLEANUP_COMMENT path reuses the idempotency marker, so repeat runs do not duplicate comments.
  • ✅ The changeset and docs update match the behavior.

Not Verified

  • The vitest suites (the PR body cites 919 passing) were not run. npm ci in actions/setup/js fails on the environment TLS proxy with a self-signed certificate. Please confirm CI is green.
  • The ephemerals.cjs:56 doc comment still shows only the blockquote form. This is a nit outside the diff.

@copilot please address the inline comments above.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~10 AIC · ⌖ ~2 AIC · ⊞ 6.7K
Comment /matt to run again

@pelikhan
pelikhan merged commit f9d9998 into main Nov 21, 2026
40 checks passed
@pelikhan
pelikhan deleted the pelikhan/refactored-guacamole branch November 21, 2026 04:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants