Forgejo CI-token provisioning is a re-derivation trap every time; promote it to a skill #452
Labels
No labels
burndown-2026-06
coherence-core
consult
headless
interactive
P0
P1
P2
P3
P4
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
coilyco-flight-deck/infrastructure#452
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What happened
Rotating
CI_RELEASE_TOKENwith the newwrite:packagescope (the operator followup from #448) took the better part of a session and hit the same walls we hit every previous time we touch a Forgejo CI credential. The code fix was one line. The operating the fix was the slog. This issue exists to capture that friction so the next run is a lookup, not a re-derivation.The re-derivation trap
Every component below is knowable, and most were already written down somewhere, yet the flow got reconstructed from scratch anyway because nothing ties them together:
--name /forgejo/api-tokengets rewritten to a Windows path beforeaws.exesees it, so everyaws ssmcall 404sParameterNotFoundandput-parameterwould silently write a mangled name. This was already documented inkai-windows-envskill, but disconnected from the token flow, so it cost most of the session to rediscover. Now hard-guarded in all six operator provision scripts (commitsd1d7900,7627c34).POST /users/{u}/tokensrefuses token and admin auth (probed today: HTTP 401). Only a password works. Since login is GitHub OAuth, there is no password, so API-mint is out.coilyco-opsbot is the designated headless minter. It was built for exactly this. Agents keep re-litigating "real-user vs bot" because the decision was never recorded. It is recorded now: use the bot.PUT /orgs/{org}/actions/secrets/.... The mint + SSM stash run as the bot, the org secret gets finished with the admin PAT. This split is non-obvious and bites every time.write:repositoryis notwrite:package. The whole of #448. The package registry needswrite:packageexplicitly.workflow_dispatch, and the API exposes no rerun endpoint (onlyGET runs/{id}). Re-running a failed job is a UI click or a fresh push. There is no way around this from a script today.Ask
Promote this whole flow into a skill (proposed
tooling-forgejo-token-provisioningin agentic-os-kai) that:provision-ci-release-token,provision-coilyco-ops-bot,provision-flux-deploy-token,provision-tap-bump-token,provision-github-app,grant-coilyco-ops-org-repo-create.[[kai-windows-env]],[[kai-aws-auth]],[[kai-brew-release]].Infra
docs/has no runbook for this either, so a repo-side companion is fair game.Related
kai-windows-envskill (already held trap 1)🔒 Reserved by
ward agent --driver claude— containerengineer-claude-infrastructure-452on hostKAI-SERVERis carrying this issue (reserved 2026-07-03T17:10:41Z). Concurrentward agentruns are blocked until it finishes or the reservation goes stale (2h0m0s TTL);--forceoverrides.Do not comment on or edit this issue to steer the run while it is reserved. The engineer seeded the body once at launch and never re-reads it, so a comment or edit reaches only human readers, never the running engineer. A correction goes to a new issue, dispatched fresh — that is the only channel that reaches a run in flight. Where the forge supports it, ward locks this conversation to make that a road-block rather than a convention (ward#494).
— Claude (she/her), via
ward agent🔒 Reserved by
ward agent --driver claude— containerengineer-claude-infrastructure-452on hostKAI-DESKTOP-TOWERis carrying this issue (reserved 2026-07-05T03:22:03Z). Concurrentward agentruns are blocked until it finishes or the reservation goes stale (2h0m0s TTL);--forceoverrides.Do not comment on or edit this issue to steer the run while it is reserved. The engineer seeded the body once at launch and never re-reads it, so a comment or edit reaches only human readers, never the running engineer. A correction goes to a new issue, dispatched fresh — that is the only channel that reaches a run in flight. Where the forge supports it, ward locks this conversation to make that a road-block rather than a convention (ward#494).
— Claude (she/her), via
ward agentWARD-OUTCOME: done - token-minting skill now tables the whole Forgejo credential family, states the seven traps up front, and cross-links the three kai-* skills.
Honest retrospective: most of the substance was already sitting in the
token-mintingoperator skill (it even name-dropped "infra#452 trap #4" before I got here), so this was less a promotion than finishing three specific gaps the skill hadn't closed: the six-column table, the seven traps stated up front, and the[[kai-windows-env]]/[[kai-aws-auth]]/[[kai-brew-release]]cross-links.The one real judgment call: the issue proposed the skill in agentic-os-kai, but the seven provision scripts all live in infra and infra already grew its own operator skill layer (infra#451). Authoring-layer convention says the skill lives where the scripts live, and a second copy in agentic-os-kai would just be drift, so I landed it here and put the full table in a new
references/forgejo-token-family.md.What fought back: the 80-line / 4000-char doc-size cap. The seven traps plus the table pointer plus the cross-links pushed SKILL.md to 4010 chars on the first pass, so it took a trim to land at 3970. Nothing else resisted. The pre-commit pylint failure was a sandbox red herring (uv could not write its interpreter into a read-only /opt), not my markdown.
Confidence: high on the docs themselves, all skill hooks green. One caveat worth naming: the verify-column commands are transcribed faithfully from each script, not each re-run live against real tokens, since I did not actually rotate anything. Rough edge / possible follow-up: the
[[...]]cross-links point at agentic-os-kai skills that no infra-side hook can validate, so a rename over there drifts silently. A thin pointer skill in agentic-os-kai back to this one might be worth a small issue if that surface wants discoverability from its side too.