Repository navigation
chore(loop): weekly retro schedule, credential guard, dependabot CI fix - #37
Merged
Merged
Conversation
The comment pointed at `scripts/loop/lib/route.mjs`; the shared library moved to `scripts/loop/shared/` in D10. Caught while reviewing the trigger table.
The router already distinguished the weekly cron, but the workflow only declared the daily one, so `retro-scheduled` could never fire — the weekly self-optimisation pass was dead code. Added `23 3 * * 1` (Mondays, 03:23 UTC). The comment records why the string must match `WEEKLY_CRON` exactly: the router compares the cron value with equality, so a typo here would silently run a sweep instead of failing loudly. Verified by parsing the cron values back out of the workflow and feeding them to the real router — daily resolves to `sweep`, weekly to `retro-scheduled` — and by confirming the stage maps to `skills/retro/SKILL.md`.
Two related credential problems on `pull_request`. D21 — the dependabot red CI. `Comment coverage on PR` failed with "Resource not accessible by integration (HTTP 403)": GitHub issues a read-only GITHUB_TOKEN to Dependabot-triggered runs, which it treats like fork runs. An earlier note in the defect log claimed `permissions:` could not help; that is the **fork** rule, not the Dependabot one — the official docs name `permissions` as the fix. The `test` job now grants `pull-requests: write`, so a Dependabot PR no longer reports a failed CI whose tests all passed. D28 — runs that cannot authenticate at all. Dependabot-triggered runs and fork PRs get **no secrets**, not merely no write permission, so even the read-only external-PR analysis (which needs the LLM key) and `deps` (which needs R2) are impossible in that context. The loop job now skips them, so they are visibly skipped instead of failing at `Pull state from R2` and looking like a real defect. `pull_request_target`, `issues`, `schedule`, `release` and `workflow_dispatch` keep their secrets and still run. Verified the guard's truth table across 12 event shapes: every event with secrets runs, Dependabot and fork PRs skip, and a missing head repository falls back to skipping.
Contributor
Coverage
|
This was referenced Sep 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three fixes that landed after #36 was merged — they were pushed to the branch a minute too late to be included, so they are re-applied here on top of
main. Nothing in #36 is reverted or rewritten; this is the tail of that work.1. Wire the weekly retro schedule
The router already distinguished the weekly cron, but the workflow only declared the daily one, so
retro-scheduledcould never fire — the weekly self-optimisation pass was dead code:The comment records why the string must match
WEEKLY_CRONexactly: the router compares the cron value with equality, so a typo would silently run a sweep instead of failing loudly. Verified by parsing the cron values back out of the YAML and feeding them to the real router (daily → sweep,weekly → retro-scheduled), and by confirming that stage maps toskills/retro/SKILL.md.2. Guard
pull_requestruns that have no secretspull_requestis the only event we listen to where secrets can be absent — GitHub treats a Dependabot-triggered run like a fork run (read-only token, no secrets at all), and a fork PR never has them. Unguarded, such a run dies atPull state from R2and shows up as a redloop: indistinguishable from a real defect, while it cannot do anything useful anyway.Verified across 12 event shapes: every event carrying secrets still runs, Dependabot and fork PRs skip, and a missing head repository falls back to skipping.
Consequence, accepted deliberately for A1 (recorded as D28): the router's
depsand external-PRreadonlyrows cannot actually run, because even a read-only analysis needs the LLM key. Enabling them later means giving that path its own credentials (pull_request_targettwo-step per host spec §6, or Dependabot secrets). The trigger table inscripts/loop/README.mdnow marks both rows as unrunnable so the docs match reality.3. Fix the Dependabot red CI (D21)
Comment coverage on PRfailed withResource not accessible by integration (HTTP 403): GitHub issues a read-onlyGITHUB_TOKENto Dependabot-triggered runs. Thetestjob now grantspull-requests: write, so a Dependabot PR no longer reports a failed CI whose tests all passed.Correction worth noting: I earlier claimed in #36 that
permissions:could not lift this. That is the fork rule, not the Dependabot one — the official docs namepermissionsas the fix for Dependabot runs. The defect log has been corrected rather than quietly deleted.Also
4691a27-equivalent: a stale path in the cron comment still pointed atscripts/loop/lib/route.mjsafter the D10 rename toshared/.actionlintclean on both workflows; local regression suite (route decisions 17/17, failure classification 9/9, CLI flow with its guards, all orchestrator paths) still green.