Skip to content

feat: standards channel staleness alarm and pre-promotion consumer verification (#1173) - #1293

Merged
don-petry merged 4 commits into
mainfrom
claude/issue-1173-standards-staleness-and-verify
Oct 11, 2026
Merged

don-petry merged 4 commits into
mainfrom
claude/issue-1173-standards-staleness-and-verify

Conversation

@don-petry

@don-petry don-petry commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Two supports for the hand-promoted standards channel: a daily alarm that says when a promotion is due, and a scripted check that it is safe before the tag moves.

Staleness alarm

  • scripts/standards-staleness.sh compares standards/ on standards/v<major>-stable with the default branch. standards-staleness.yml runs it once a day at 10:23 UTC and on manual dispatch (with a dry_run input).
  • It keeps one issue open while either holds: a file under standards/workflows/ differs, or the oldest unpublished change to standards/ is more than 7 days old (STANDARDS_STALENESS_MAX_DAYS).
  • The issue lists the differing files. Each run updates it in place and a run closes it once the channel catches up.
  • It never promotes anything.

Pre-promotion verification

  • cut-standards-release.sh verify <ref> runs every known channel consumer pinned to the candidate commit and exits non-zero if any fails.
  • cut --verify runs the same check first and refuses to cut on a failure, writing no tag.
  • The consumers are data: scripts/lib/standards-channel-consumers.json. Today that is the repo-template drift guard and the persona manifest validator, both in petry-projects/.github-private.

Docs

  • standards/standards-versioning.md documents both steps and states plainly that a promotion is fleet-wide with no canary stage.

Closes #1173 ("standards/v1-stable has no staleness alarm and no pre-promotion consumer verification — it fell 14 commits / 8 files behind main unnoticed").

Problem

standards-versioning.md makes promotion a human decision, but nothing told that human when. The channel fell 14 commits and 8 standards/ files behind main, and the symptom surfaced in another repo as a red drift check. The verification done before the v1.1.0 cut was by hand and written down nowhere.

Decision for review: --verify is opt-in

The issue asks that the tooling "refuses to cut if any consumer fails". cut --verify does that. cut without the flag behaves exactly as before.

I did not make verification the default because it would change what cut does for every existing caller and test, and this repo's rule is that such a change needs human approval. If you want it on by default, say so and it is a small follow-up (with a --no-verify escape for rollbacks).

Failure handling

  • Alarm: a comparison that cannot be read, or a response missing its fields, fails the run. It is never reported as fresh.
  • Alarm, file list: the differing files come from the two git trees of standards/, read at commit SHAs resolved up front. The compare API caps its file list at 300 for the whole repo, so it is not used for this. An unreadable or truncated tree listing fails the run.
  • Alarm, age: the age is taken from the oldest commit that touched standards/ after the channel commit. If none is listed, it falls back to the channel commit's own date and the issue says "at most N days".
  • Verify: an unreadable or empty consumer list, an unresolvable ref, a malformed row and an unavailable checkout all fail.
  • Verify, hollow green: a zero exit code alone is not a pass, and a consumer row without expect_output is refused as malformed. Each consumer declares output that proves it ran and output that must not appear. The drift guard exits 0 when it cannot compute a baseline and skips the file, so its "Could not compute" warning is rejected.

Risk

Low to medium.

  • The alarm is a new scheduled workflow with issues: write. Its only writes are opening, editing and closing one issue that carries a hidden marker.
  • verify executes commands from standards-channel-consumers.json in a clone of each consumer repo, on the operator's machine, with the operator's gh login. Those are the same two commands the operator already ran by hand.
  • cut is unchanged unless --verify is passed.

Test plan

  • bats tests/standards_release.bats tests/standards_staleness.bats: 88 pass (28 existing, 22 new for verify, 38 new for the alarm). No existing test was edited.
  • The same 88 pass on stock macOS bash 3.2, which the operator scripts must support.
  • shellcheck --severity=warning -x on the four scripts: clean. actionlint on both workflows: clean. check-cron-timing.sh: passes. markdownlint-cli2 on the standard: 0 errors.
  • Run against live GitHub with real gh on 2026-10-11 (all read-only):
    • verify main: both consumers PASS.
    • verify main with a Python that lacks jsonschema: the persona validator is reported FAIL exit-1 with its error shown, and the run is refused.
    • cut v9.9.9 --commit <main sha> --verify --dry-run: verifies, then "no tags written".
    • cut ... --verify --dry-run with a SHA that does not exist: "REFUSE to cut".
    • DRY_RUN=true standards-staleness.sh: 1 differing standards/ file, 0 templates, 0 days old, decision PENDING, nothing to do.
    • The same with SS_CHANNEL=standards/v1.0.0: 20 differing files, 11 templates, decision STALE, and the issue body it would open.
  • Not run: the workflow itself, and a real issue open/edit/close. Those paths are covered with a stubbed gh only.

Rollback

Revert this PR. If the alarm has opened an issue, close it by hand.

Monitoring

The first scheduled run of "Standards Channel Staleness" after merge. Its job summary shows the channel, the branch, the count of differing files and the decision. With today's state it should report PENDING and open nothing.

Interaction contract

  • N/A — this PR does not add or change an agentic role. The new workflow is a no-LLM gh + jq check.

🤖 Generated with Claude Code

…rification (#1173)

standards/v1-stable is promoted by hand and has no canary stage. Nothing said
when a promotion was due, and nothing checked that one was safe: the channel
once fell 14 commits and 8 standards/ files behind main unnoticed.

Staleness alarm
- scripts/standards-staleness.sh compares standards/ on the channel with the
  default branch, once a day (standards-staleness.yml).
- It keeps one issue open while a file under standards/workflows/ differs, or
  the oldest unpublished change is more than 7 days old
  (STANDARDS_STALENESS_MAX_DAYS). The issue lists the differing files, is
  updated in place, and is closed once the channel catches up.
- A comparison that cannot be read fails the run. It is never reported as fresh.
- The decision and the issue text are a pure core, scripts/lib/standards-staleness.sh.

Pre-promotion verification
- `cut-standards-release.sh verify <ref>` runs every known channel consumer
  pinned to the candidate commit and exits non-zero if any fails.
- `cut --verify` runs the same check first and refuses to cut on a failure. It
  is opt-in, so `cut` without it behaves as before.
- The consumers are data: scripts/lib/standards-channel-consumers.json. Each
  declares the output that proves it ran, so a consumer that skips its checks
  and exits 0 does not pass.

standards-versioning.md documents both steps and states that a promotion is
fleet-wide with no canary stage.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@don-petry
don-petry requested a review from a team as a code owner October 11, 2026 02:29
@don-petry don-petry added the dev-lead:hands-off Exclude from dev-lead agent automation label Oct 11, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 1 minute.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: d0e7efaa-5839-4ef5-9535-52b6eaeedd3d

📥 Commits

Reviewing files that changed from the base of the PR and between 4bb3e7a and bad9cea.


📒 Files selected for processing (10)
  • .github/workflows/standards-release-tests.yml
  • .github/workflows/standards-staleness.yml
  • scripts/cut-standards-release.sh
  • scripts/lib/standards-channel-consumers.json
  • scripts/lib/standards-release.sh
  • scripts/lib/standards-staleness.sh
  • scripts/standards-staleness.sh
  • standards/standards-versioning.md
  • tests/standards_release.bats
  • tests/standards_staleness.bats

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Comment thread scripts/standards-staleness.sh Outdated
Comment thread scripts/standards-staleness.sh Outdated
@codeant-ai

codeant-ai Bot commented Oct 11, 2026

Copy link
Copy Markdown

CodeAnt Nitpicks

1 code suggestion

1. A consumer row without expect_output skips this check and can return PASS on exit code alone, letting an unverified candidate pass.

Incomplete implementation · scripts/cut-standards-release.sh:253

@codeant-ai

codeant-ai Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

CodeAnt PR Risk: Low Risk

  • The PR appears safe to merge based on the current implementation and the safeguards shown.
  • The staleness check pins both commits before comparing standards trees, and fails on incomplete listings rather than treating them as fresh.
  • The added tests cover consumer verification failures and staleness decisions, including unreadable or truncated tree listings.

Assessed commit: 3f0e3719ba40

@don-petry

Copy link
Copy Markdown
Contributor Author

dev-lead is withholding action on this item.

It is labeled dev-lead:hands-off (deliberately kept off-limits to dev-lead (e.g. changes to the dev-lead automation itself)), so dev-lead will not pick it up while that label is present. This notice is posted once so the withhold is visible rather than looking like a stalled run.

To re-enable automated pickup: remove the dev-lead:hands-off label.

…git trees, require expect_output

Staleness alarm
- Both ends are resolved to commit SHAs first, and the compare and the commit
  list run at those SHAs. A branch that moves mid-run can no longer pair one
  commit's diff with another commit's SHA.
- The differing files now come from the two git trees of standards/, not from
  the compare response. Compare lists at most 300 changed files for the whole
  repo, so a standards change could be cut off, read as "no difference", and
  close an open alarm. Equal tree SHAs mean standards/ is identical. A listing
  that is unreadable or truncated fails the run.

Verification
- A consumer row must declare expect_output. Without it the consumer would pass
  on its exit code alone. Such a row is refused as malformed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@donpetry-bot

Copy link
Copy Markdown
Contributor

Advisory bots were rate-limited; auto-approval is withheld until they recover. pr-review-sweep will re-review this PR after 2026-10-11T04:06:16Z.

@sonarqubecloud

Copy link
Copy Markdown

@don-petry
don-petry merged commit 9834969 into main Oct 11, 2026
30 checks passed
@don-petry
don-petry deleted the claude/issue-1173-standards-staleness-and-verify branch October 11, 2026 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dev-lead:hands-off Exclude from dev-lead agent automation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

standards/v1-stable has no staleness alarm and no pre-promotion consumer verification — it fell 14 commits / 8 files behind main unnoticed

2 participants