Skip to content

fix: AGENTS marker, report_incomplete labels, queue:max strip, quick-setup --dry-run#42

Open
norrietaylor wants to merge 6 commits into
mainfrom
fix/bundle-pr-b-templates-scripts-hygiene
Open

fix: AGENTS marker, report_incomplete labels, queue:max strip, quick-setup --dry-run#42
norrietaylor wants to merge 6 commits into
mainfrom
fix/bundle-pr-b-templates-scripts-hygiene

Conversation

@norrietaylor

Copy link
Copy Markdown
Owner

Summary

Bundled fix PR targeting four templates/scripts hygiene issues. Per-issue summary below; commit history is split one commit per issue for review.

#17 — AGENTS.md marker drift (docs only)

The E2E runbook step A3 grepped for <!-- ch-oracles:start/end -->, but the template emits <!-- ch-oracles:build-commands:begin/end --> (consistent with every other repo reference). Updated E2E-TEST.md to use the actual marker convention. No template change — preserves backward compatibility with existing installs.

#18report_incomplete issues missing chore agent:* label

When a chore exits via report_incomplete (e.g., uv/ruff blocked by firewall), gh-aw posts a generic [aw] X failed issue with label agentic-workflows only. Consumers filtering on agent:lint:python (etc.) silently miss every infra failure.

Added report-incomplete: { labels: [<slot>] } to every chore's safe-outputs frontmatter using the per-chore slot label (agent:lint:<lang>, agent:doc-drift, agent:dep-drift, agent:coverage, agent:worker-tuning, agent:conflict). Lock files recompiled; verified each lock now sets GH_AW_REPORT_INCOMPLETE_LABELS.

#28 — Invalid concurrency.queue: max key in every lock file

gh-aw codegen emits queue: max under concurrency:, which is not a valid GitHub Actions key. actionlint flags it; GitHub silently drops it; intended queueing behavior is lost.

Added scripts/strip-invalid-queue-key.py — a narrow post-compile filter that removes only lines exactly matching queue: max. Wired it into .github/workflows/gh-aw-validate.yml between gh aw compile and the diff-quiet gate. Includes a --check mode for CI assertion.

Tracked upstream: this is option (b) from the issue. A proper fix belongs in gh-aw; the strip script is the bridge until that lands.

#29--dry-run misnomer

The existing --dry-run flag was actually a CI smoke mode (sources from local checkout, still writes to target). When the runbook A2 piped curl|bash with --dry-run, SCRIPT_DIR resolved to /tmp and the script errored with local wrapper missing: //wrappers/....

  • Renamed the existing flag to --ci-smoke (semantics preserved).
  • Added a true --dry-run that prints what would be written (with provenance) and exits 0 without touching the target. Safe under curl|bash.
  • The two are mutually exclusive.
  • Refreshed scripts/quick-setup.sh.sha256.
  • Updated .github/workflows/install-smoke.yml to use --ci-smoke.
  • Refreshed E2E-TEST.md A2 prose to describe the new dry-run semantics.

Test plan

  • gh aw compile runs cleanly against every workflow (14/14, 0 warnings).
  • python scripts/strip-invalid-queue-key.py .github/workflows/*.lock.yml removes exactly 14 lines (one per lock file).
  • actionlint -color is clean.
  • shellcheck --severity=warning scripts/*.sh is clean.
  • python scripts/audit-wrapper-permissions.py wrappers/*.yml passes.
  • python scripts/test-{chore-consistency,safe-output-allowlists,label-classification}.py pass.
  • Mirror parity (diff workflows/X.md .github/workflows/X.md) holds for every workflow.
  • Spot-check: GH_AW_REPORT_INCOMPLETE_LABELS env var appears in every lock file with the correct slot label.
  • --dry-run exits 0 with no writes (validated against an empty /tmp/qs-test).
  • --ci-smoke installs all 14 wrappers + templates into a fixture (validated locally; same invocation as install-smoke.yml).
  • CI green on PR (validated after push).

Closes #17
Closes #18
Closes #28
Closes #29

🤖 Generated with Claude Code

norrietaylor and others added 4 commits May 21, 2026 08:00
The runbook's grep checked for `<!-- ch-oracles:start/end -->`, but the
template at `templates/.github/AGENTS.md` (and every other repo
reference) uses the sub-namespaced `<!-- ch-oracles:build-commands:begin
-->` / `<!-- ch-oracles:build-commands:end -->` form. Operators
following A3 would always see a wc -l count of 0 and bail.

Update E2E-TEST.md A3 to use the actual marker convention. The template
form is kept (per #17's option 1 — smallest change, doesn't break
existing installs).

Closes #17

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The old `--dry-run` flag was a misnomer: documented in E2E-TEST.md A2 as
a write-free preview, but its actual semantics were "source files from
the local ch-oracles checkout" (CI smoke mode). When operators followed
A2 verbatim and piped curl|bash, SCRIPT_DIR became `/tmp`, the local
source root resolved to `/`, and the script errored with
`local wrapper missing: //wrappers/...`.

Rename the existing flag to `--ci-smoke` (preserves CI smoke semantics)
and add a true `--dry-run` that prints every file the installer would
write (with provenance — local-source or upstream URL) and exits 0
without touching the target. The two modes are mutually exclusive.

Also:
- Refresh `scripts/quick-setup.sh.sha256` after the rewrite.
- Point `.github/workflows/install-smoke.yml` at `--ci-smoke`.
- Update E2E-TEST.md A2 prose to describe the new dry-run semantics.

Closes #29

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…#18)

When a chore exits via `report_incomplete` (e.g., its required toolchain
is firewall-blocked and `uv sync` fails), gh-aw files a generic
`[aw] X failed` issue with label `agentic-workflows`. The issue does
NOT carry the originating chore's `agent:*` slot label, so consumers
filtering on `agent:lint:python` (or any other agent slot) to triage
their lint backlog silently miss every infrastructure failure.

Add `report-incomplete: { labels: [<slot>] }` to every chore workflow's
safe-outputs config so the meta-failure issue carries both the gh-aw
generic label AND the chore's slot label. Mappings:

- chore-style-{python,rust,go,toml,ncl} → agent:lint:<lang>
- docs-patrol                            → agent:doc-drift
- dependency-review                      → agent:dep-drift
- test-coverage-detector                 → agent:coverage
- trivial-dep-bump-{python,rust,go}      → agent:dep-drift
- worker-fix, worker-iterate             → agent:worker-tuning
- pr-conflict-resolver                   → agent:conflict

Every label here already exists in `templates/.github/labels.yml` and is
in the chore's existing safe-output allowlist (verified by
test-safe-output-allowlists.py).

Frontmatter only — lock files recompiled in the next commit alongside
the queue:max strip.

Closes #18

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
gh-aw's codegen emits an extension key `queue: max` under every
generated lock file's `concurrency:` block. The key is not valid GitHub
Actions syntax — `concurrency:` accepts only `group:` and
`cancel-in-progress:`. actionlint flags it as `syntax-check`; GitHub
Actions silently drops it at runtime, so the queueing behavior the
codegen intended (rather than the implicit `cancel-in-progress: false`
fallback alone) is lost across all 14 chores.

Add `scripts/strip-invalid-queue-key.py` as a narrow post-compile
filter. It removes only lines whose stripped content exactly equals
`queue: max`, so user code with a legitimate `queue:` key elsewhere is
unaffected. Includes a `--check` mode for CI to assert the strip ran.

Wire the strip step into `.github/workflows/gh-aw-validate.yml` between
`gh aw compile` and the `git diff --quiet` consistency gate, so
committed lock files match what GitHub Actions actually accepts.

The 14 lock files in this commit are the recompile of all workflows
(including the report-incomplete labels from the previous commit) with
`queue: max` lines stripped. Net diff: -14 invalid keys, +14 label
embeddings.

Closes #28

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented May 21, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Rate limit exceeded

@norrietaylor has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 43 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4459f5e0-cfda-4a09-9abe-46f1ae6f2a1a

📥 Commits

Reviewing files that changed from the base of the PR and between 55b0247 and b0e855d.

📒 Files selected for processing (5)
  • .github/workflows/gh-aw-validate.yml
  • .github/workflows/worker-iterate.lock.yml
  • .github/workflows/worker-iterate.md
  • scripts/strip-invalid-queue-key.py
  • workflows/worker-iterate.md
📝 Walkthrough

Walkthrough

This PR addresses three interconnected workflow and installer issues: safe-outputs labeling for failed agent runs, invalid YAML in generated lock files, and CLI mode semantics in the installer. Across 13 workflows and supporting scripts, incomplete runs now emit issues tagged with agent-specific labels, all lock files are corrected via a post-processing script, and the installer's dry-run/smoke-test modes are clarified and fixed.

Changes

Safe-outputs report-incomplete labeling

Layer / File(s) Summary
Lock file report-incomplete configuration updates
.github/workflows/chore-style-{go,ncl,python,rust,toml}.lock.yml, .github/workflows/dependency-review.lock.yml, .github/workflows/docs-patrol.lock.yml, .github/workflows/pr-conflict-resolver.lock.yml, .github/workflows/test-coverage-detector.lock.yml, .github/workflows/trivial-dep-bump-{go,python,rust}.lock.yml, .github/workflows/worker-{fix,iterate}.lock.yml
All 13 lock files regenerate metadata/heredoc identifiers and update safeoutputs/config.json and GH_AW_SAFE_OUTPUTS_HANDLER_CONFIG to include create_report_incomplete_issue with agent-specific labels and [incomplete] title prefix.
Workflow markdown report-incomplete configuration
.github/workflows/chore-style-*.md, .github/workflows/dependency-review.md, .github/workflows/docs-patrol.md, .github/workflows/pr-conflict-resolver.md, .github/workflows/test-coverage-detector.md, .github/workflows/trivial-dep-bump-*.md, .github/workflows/worker-*.md, workflows/chore-style-*.md, workflows/dependency-review.md, workflows/docs-patrol.md, workflows/pr-conflict-resolver.md, workflows/test-coverage-detector.md, workflows/trivial-dep-bump-*.md, workflows/worker-*.md
All 13 workflow markdown files add safe-outputs.report-incomplete blocks with corresponding agent-specific labels.

Invalid queue key removal

Layer / File(s) Summary
Queue key stripping script and implementation
scripts/strip-invalid-queue-key.py
New Python script removes invalid queue: max lines from .lock.yml files, with --check validation mode for CI.
CI validation and lock file stripping
.github/workflows/gh-aw-validate.yml
Validation step runs the strip script on generated lock files and updates the stale-file error message to instruct users to run both gh aw compile and the strip script locally.

Installer mode correction and runbook alignment

Layer / File(s) Summary
Installer --ci-smoke flag and dry-run improvements
scripts/quick-setup.sh
Adds explicit --ci-smoke mode with local source validation; refactors --dry-run to emit planned actions without writing; enforces mutual exclusion; updates logging and completion flow.
Smoke test workflow and checksum update
.github/workflows/install-smoke.yml, scripts/quick-setup.sh.sha256
The smoke test workflow step uses --ci-smoke instead of --dry-run; checksum is regenerated.
E2E runbook marker format alignment
E2E-TEST.md
Runbook is updated to document the actual ch-oracles:build-commands:begin/end marker format and align dry-run output expectations with planned-action behavior.

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • norrietaylor/ch-oracles#11: Both PRs modify scripts/quick-setup.sh and its CLI mode handling around --dry-run and installer flow, directly addressing installer semantics and smoke test compatibility.

🐰 Workflows now label their incomplete woes,
Invalid queues are scrubbed away,
And installers know which mode they chose—
No more dry-run clouds to confuse the day!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes all four main changes: AGENTS marker fix, report_incomplete labels, queue:max stripping, and --dry-run semantics correction.
Description check ✅ Passed The description comprehensively details all four issues (#17, #18, #28, #29) with per-issue summaries, test plan, and closure statements aligned to the pull request objectives.
Linked Issues check ✅ Passed All changes directly address the four linked issues: #17 (AGENTS marker), #18 (report_incomplete labels), #28 (queue:max removal), #29 (--dry-run vs --ci-smoke split).
Out of Scope Changes check ✅ Passed All changes remain within scope of the four linked issues. Updates to workflow files, scripts, docs, and checksums are directly tied to fixing the identified problems.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/bundle-pr-b-templates-scripts-hygiene

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

@norrietaylor

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 21, 2026

Copy link
Copy Markdown
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 8

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/docs-patrol.md (1)

1-1: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Recompile lock files to clear the current CI blocker.

gh-aw-validate is failing with: “Compiled lock files are stale…”. Re-run gh aw compile workflows/*.md && python scripts/strip-invalid-queue-key.py .github/workflows/*.lock.yml and commit the regenerated lock diffs before merge.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/docs-patrol.md at line 1, Re-run the docs compile and lock
regeneration steps to refresh stale compiled lock files: run `gh aw compile
workflows/*.md` followed by `python scripts/strip-invalid-queue-key.py
.github/workflows/*.lock.yml`, review the resulting changes to the
.github/workflows/*.lock.yml files, and commit the updated lock diffs so
`gh-aw-validate` no longer fails due to “Compiled lock files are stale…”.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/chore-style-go.lock.yml:
- Line 1: CI is failing because compiled lock artifacts are stale; rerun the
compilation and stripping steps described in the review so generated lock files
match expectations: run the exact commands `gh aw compile workflows/*.md` and
then `python scripts/strip-invalid-queue-key.py .github/workflows/*.lock.yml`,
review the updated .github/workflows/*.lock.yml outputs, and commit the
regenerated lock files so gh-aw-validate passes.

In @.github/workflows/chore-style-python.lock.yml:
- Line 1: Lock artifacts in .github/workflows/chore-style-python.lock.yml are
stale; re-generate the workflow lock files and strip invalid queue keys then
commit the updates: run "gh aw compile workflows/*.md" to regenerate the
.lock.yml outputs, run "python scripts/strip-invalid-queue-key.py
.github/workflows/*.lock.yml" to clean invalid queue keys, verify changes to
.github/workflows/chore-style-python.lock.yml (and any other .lock.yml files),
then add/commit and push the updated lock files.

In @.github/workflows/test-coverage-detector.md:
- Around line 40-42: The CI is failing due to stale compiled lock files after
updating the workflow frontmatter (the "report-incomplete" labels block);
regenerate the compiled lock files by running the compile command and cleanup
script shown in the comment: run `gh aw compile workflows/*.md` then `python
scripts/strip-invalid-queue-key.py .github/workflows/*.lock.yml`, verify the
resulting .github/workflows/*.lock.yml files, and commit the regenerated lock
files so gh-aw-validate passes.

In `@scripts/quick-setup.sh.sha256`:
- Line 1: The recorded checksum in scripts/quick-setup.sh.sha256 is stale and
must be regenerated to match the current scripts/quick-setup.sh; run a SHA-256
checksum on scripts/quick-setup.sh, overwrite scripts/quick-setup.sh.sha256 with
the new digest (so the contents exactly match the output for
scripts/quick-setup.sh), then commit the updated scripts/quick-setup.sh.sha256
so CI’s install-smoke step sees the correct checksum.

In `@scripts/strip-invalid-queue-key.py`:
- Around line 44-47: The current loop removes any line matching QUEUE_MAX_RE
regardless of context; modify the logic to only remove "queue: max" entries that
are direct children of a concurrency: block by tracking context: when you see a
line matching /^\s*concurrency:\s*$/ set a flag and record its indentation
(e.g., len(match.group(0)) or count leading spaces), clear the flag when you
encounter a line with indentation less than or equal to the concurrency indent
or a new top-level key, and only increment removed/continue if QUEUE_MAX_RE
matches and the current flag is true and the queue line's indentation is
strictly greater than the recorded concurrency indent; reference the existing
variables/regex QUEUE_MAX_RE, original, and the for-loop over
original.splitlines(keepends=True) to locate where to insert the
context/indent-tracking logic.

In `@workflows/chore-style-toml.md`:
- Around line 54-57: The compiled workflow lock files are stale after editing
the "report-incomplete" workflow (label agent:lint:toml); run the compilation
and strip script exactly as in the review (gh aw compile workflows/*.md then
python scripts/strip-invalid-queue-key.py .github/workflows/*.lock.yml) to
regenerate the .lock.yml files, verify the outputs, and commit the updated lock
files so gh-aw-validate passes.

In `@workflows/trivial-dep-bump-go.md`:
- Around line 45-47: The compiled workflow artifacts are stale after updating
workflows/trivial-dep-bump-go.md (the report-incomplete job and its labels such
as "agent:dep-drift"); re-run the repository's workflow compilation/post-filter
pipeline (the same pipeline used by gh-aw-validate) to regenerate the compiled
lock/MD artifacts, verify gh-aw-validate passes, and commit the resulting
generated changes so the compiled artifacts are in sync with the edited
workflows/*.md files.

In `@workflows/worker-fix.md`:
- Around line 73-75: The CI is failing due to stale compiled lock files;
regenerate the compiled artifacts and commit them. Run the workflow compiler (gh
aw compile) against the workflow markdown sources referenced in this PR, then
run the strip-invalid-queue-key.py script to normalize/strip invalid queue keys
from the generated lock artifacts, verify gh-aw-validate passes locally, and
commit the updated lock files so the "report-incomplete" workflow label CI check
can proceed.

---

Outside diff comments:
In @.github/workflows/docs-patrol.md:
- Line 1: Re-run the docs compile and lock regeneration steps to refresh stale
compiled lock files: run `gh aw compile workflows/*.md` followed by `python
scripts/strip-invalid-queue-key.py .github/workflows/*.lock.yml`, review the
resulting changes to the .github/workflows/*.lock.yml files, and commit the
updated lock diffs so `gh-aw-validate` no longer fails due to “Compiled lock
files are stale…”.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1f57dce0-062e-4dbe-bec9-d36b8209efdc

📥 Commits

Reviewing files that changed from the base of the PR and between 62a687e and 55b0247.

📒 Files selected for processing (48)
  • .github/workflows/chore-style-go.lock.yml
  • .github/workflows/chore-style-go.md
  • .github/workflows/chore-style-ncl.lock.yml
  • .github/workflows/chore-style-ncl.md
  • .github/workflows/chore-style-python.lock.yml
  • .github/workflows/chore-style-python.md
  • .github/workflows/chore-style-rust.lock.yml
  • .github/workflows/chore-style-rust.md
  • .github/workflows/chore-style-toml.lock.yml
  • .github/workflows/chore-style-toml.md
  • .github/workflows/dependency-review.lock.yml
  • .github/workflows/dependency-review.md
  • .github/workflows/docs-patrol.lock.yml
  • .github/workflows/docs-patrol.md
  • .github/workflows/gh-aw-validate.yml
  • .github/workflows/install-smoke.yml
  • .github/workflows/pr-conflict-resolver.lock.yml
  • .github/workflows/pr-conflict-resolver.md
  • .github/workflows/test-coverage-detector.lock.yml
  • .github/workflows/test-coverage-detector.md
  • .github/workflows/trivial-dep-bump-go.lock.yml
  • .github/workflows/trivial-dep-bump-go.md
  • .github/workflows/trivial-dep-bump-python.lock.yml
  • .github/workflows/trivial-dep-bump-python.md
  • .github/workflows/trivial-dep-bump-rust.lock.yml
  • .github/workflows/trivial-dep-bump-rust.md
  • .github/workflows/worker-fix.lock.yml
  • .github/workflows/worker-fix.md
  • .github/workflows/worker-iterate.lock.yml
  • .github/workflows/worker-iterate.md
  • E2E-TEST.md
  • scripts/quick-setup.sh
  • scripts/quick-setup.sh.sha256
  • scripts/strip-invalid-queue-key.py
  • workflows/chore-style-go.md
  • workflows/chore-style-ncl.md
  • workflows/chore-style-python.md
  • workflows/chore-style-rust.md
  • workflows/chore-style-toml.md
  • workflows/dependency-review.md
  • workflows/docs-patrol.md
  • workflows/pr-conflict-resolver.md
  • workflows/test-coverage-detector.md
  • workflows/trivial-dep-bump-go.md
  • workflows/trivial-dep-bump-python.md
  • workflows/trivial-dep-bump-rust.md
  • workflows/worker-fix.md
  • workflows/worker-iterate.md

Comment thread .github/workflows/chore-style-go.lock.yml
Comment thread .github/workflows/chore-style-python.lock.yml
Comment thread .github/workflows/test-coverage-detector.md
Comment thread scripts/quick-setup.sh.sha256
Comment thread scripts/strip-invalid-queue-key.py
Comment thread workflows/chore-style-toml.md
Comment thread workflows/trivial-dep-bump-go.md
Comment thread workflows/worker-fix.md
Addresses CodeRabbit feedback on PR #42.

The previous implementation stripped any 'queue: max' line globally, but the
docstring stated it should only target lines directly inside a 'concurrency:'
block. Tightened strip_file() to track the active concurrency-block indent
and only remove queue:max lines whose indent is strictly greater than the
concurrency-line's indent. Block ends when indent falls back to or below
the concurrency line.
Resolve worker-iterate.lock.yml conflict by regenerating from the merged
source via gh aw compile + strip-invalid-queue-key.py. Source workflows
.md files auto-merged cleanly — only the generated lock needed regeneration.
@norrietaylor

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 21, 2026

Copy link
Copy Markdown
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment