wire the reseed publish step into .forgejo (protected-path residual of #601) #606
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Matou/idss#606
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?
Problem
The reseed pipeline's publish half (#601, ADR 0185) needs a Forgejo Actions step that runs on green push to
mainand invokesscripts/bootstrap-reseed/publish.sh(buildagent-x86_64+ sha256 + RELEASE → Forgejo generic package registry). That step lives in.forgejo/workflows/— a protected path a Sandcastle agent may not edit (#445 tree-fingerprint rollback). So #601 shipped the tested publish logic but not its CI trigger; the pipeline cannot publish until this lands.Proposed fix
Add a job/step to
.forgejo/workflows/ci.yml(or a new.forgejo/workflows/publish-agent.yml) that, only when theseamjob is green and onpushtomain:Notes for the session:
publish.shalready self-guards on the agent-affecting set (OC_BOOTSTRAP_AGENT_PATHS=agent/ go.mod go.sum internal/) and no-ops on docs-only ranges and on re-publishing an existing sha (409 idempotent) — so apaths:filter is optional, not required for correctness.SWARM_FORGEJO_TOKEN) needs write:package scope onMatou; confirm/extend it.github.event.beforeis the diff base for the agent-affected guard; on the first run it may be the zero-sha —publish.shtolerates a bad base by simply publishing (guard is belt-and-braces; the workflow gate is primary).Why ready-for-session (not ready-for-human)
Per ADR 0174 / #445: a protected
.forgejo/change needs an interactive session's standing, not Ben. The change is a two-way door (a workflow step, revertible by commit; provable by the published package appearing after a green main push). A session rules on it, escalating toready-for-humanonly if it finds a genuine one-way door (e.g. widening the PAT scope counts as a security-posture call — rule that explicitly).Found while implementing #601 (the reseed pipeline). Companion residual: the droplet-side timer install remains on #601 for Ben.
Ruled by agent under ADR 0174 — veto anytime.
Landed the two-way-door part:
a33d153adds apublishjob to.forgejo/workflows/ci.yml(needs: seam, gatedgithub.event_name == 'push' && github.ref == 'refs/heads/main'— neverpull_requestorworkflow_dispatch), checking out full history (fetch-depth: 0, requiredso
publish.sh'soc_reseed_agent_affectedguard can resolveGIT_BASE..GIT_SHA) and runningscripts/bootstrap-reseed/publish.sh(#601)inside
nix develop, same PATH fix as theseamjob.Proof it actually fires, in order, on the real trigger: the push ran
ci run #7938 —
seamsucceeded, thenpublishran (only afterseamwas green, only onthis push-to-main) and succeeded. Its range (
8ccebac..a33d153) touched only.forgejo/andSTATUS.md, sooc_reseed_agent_affectedcorrectly computed"not agent-affecting" against full history and no-op'd before ever calling
the package API — the job order/gating/checkout-depth are proven; the actual
upload path (the part that needs
write:package) is not yet exercised bythis run and will only run for real on the next agent-affecting push (touching
agent/,go.mod,go.sum, orinternal/).One-way-door residual, not ruled — routing to
ready-for-human:SWARM_FORGEJO_TOKENis aswarm-botmachine-user PAT deliberately scoped towrite:repository+write:issueonly, per Ben's explicit #449 rulingbounding what a swarm credential can do ("without admin/org scope a worker
cannot mint tokens, touch other repos, or widen itself" —
docs/architecture/07-secrets-architecture.md). It has nowrite:packagescope. Forgejo PATs can't have scopes added after creation — extending it
means minting a new PAT (interactive login to the
swarm-botaccount) andswapping the org secret. That's a security-posture widening of a credential
Ben named explicitly, and minting it needs an account credential this
session doesn't hold — ADR 0174's one-way-door list (personal/account
credentials + security-posture widenings), not something a session
self-authorizes.
Why human
Ben: either (a) mint a new
swarm-botPAT withwrite:packageadded andPUT /api/v1/orgs/Matou/actions/secrets/SWARM_FORGEJO_TOKENthe new value,or (b) rule that
write:packageshould NOT go on the shared swarm token andname an alternative (e.g. a narrower publish-only token as its own org
secret). Once the token is right, the wiring above needs no further changes
— the next agent-affecting push to
mainwill publish for real. No agentaction possible past this point.
Companion residual (droplet-side timer install) remains on #601, also Ben's.
Root cause of the never-publishing publish job, and the fix (2026-08-20 session with Ben):
SWARM_FORGEJO_TOKENhas no package scope — probed 401 on package PUT / 403 on read. The only agent-affecting push since wiring (ce94770, run 7960) failed exactly there; every other "publish success" was the guard's no-op. Ben minted a package-scoped PAT (identityben) → org secretREGISTRY_FORGEJO_TOKEN;ci.ymlpublish job reads it (7a35076). Registry seeded by hand from the laptop:idss-agent@7a35076(three 201s). Remaining gate for CI to take over:seamis red on main (lint debt) → #621.Closing (Ben, 2026-08-24). The remaining gate —
seamred on main (lint debt) — was cleared by #621 (fcbe3ac8, closed 2026-08-21). Today on main:seam✅ 13:31Z (0ae4f97) →publish✅ 13:37Z (first run instead of skipped) →publish-broker✅ 13:38Z;seam✅ again 13:43Z (18bda3e). The publish job now fires on every main push with the package-scopedREGISTRY_FORGEJO_TOKEN.Caveat for the record: a
publishsuccess on a push that touches no agent files is theoc_reseed_agent_affectedguard no-op. The first agent-affecting push to main will be the end-to-end proof of an automated registry publish — if that fails, reopen with the run URL.