The host env file is product-flavoured; the factory's host-state layer should own a generic one #37
Closed
opened 2026-08-23 15:25:32 +00:00 by matou-build-agent
·
7 comments
No Branch/Tag specified
main
sandcastle/rescue-20261120-212246
sandcastle/rescue-20261120-202650
sandcastle/rescue-20261120-202316
sandcastle/worker/20261120192753-1909682
sandcastle/rescue-20261120-191443
sandcastle/rescue-20261120-195103
sandcastle/rescue-20261120-201254
sandcastle/rescue-20261120-201438
sandcastle/rescue-20261120-144756
sandcastle/rescue-20261120-184843
sandcastle/rescue-20261120-190817
sandcastle/rescue-20261120-045815
sandcastle/rescue-20261120-143144
sandcastle/rescue-20261120-144025
sandcastle/worker/20261120032838-3834852
sandcastle/worker/20261120034547-1076409
sandcastle/rescue-20261120-031041
sandcastle/rescue-20261120-035031
sandcastle/rescue-20261120-041046
sandcastle/rescue-20261120-041556
sandcastle/rescue-20261120-042712
sandcastle/rescue-20261120-044145
sandcastle/rescue-20261120-044401
sandcastle/worker/20261120020735-3225234
sandcastle/rescue-20261120-025017
sandcastle/worker/20261120012937-3577764
sandcastle/rescue-20261120-024432
sandcastle/rescue-20261120-012510
sandcastle/rescue-20261120-020027
sandcastle/rescue-20261120-022005
sandcastle/rescue-20261120-023040
sandcastle/rescue-20261120-023059
sandcastle/rescue-20261120-023617
sandcastle/rescue-20261120-023726
sandcastle/rescue-20261120-024624
sandcastle/rescue-20261120-030108
sandcastle/rescue-20261120-011059
sandcastle/rescue-20261119-235227
sandcastle/rescue-20261119-220002
sandcastle/rescue-20261119-234418
sandcastle/worker/20261119210537-2901903
sandcastle/rescue-20261119-215319
sandcastle/worker/20261119210832-2140478
sandcastle/rescue-20261119-205729
sandcastle/worker/20261119195637-2051281
sandcastle/rescue-20261119-203604
sandcastle/rescue-20261119-212545
sandcastle/rescue-20261119-213258
sandcastle/rescue-20261119-214233
sandcastle/rescue-20261119-215039
sandcastle/rescue-20261119-200052
sandcastle/rescue-20261119-202558
sandcastle/rescue-20261119-202859
sandcastle/rescue-20261119-204522
sandcastle/rescue-20261119-202901
sandcastle/worker/20261119192821-2242548
sandcastle/rescue-20261119-201432
sandcastle/worker/20261119185826-1049892
sandcastle/rescue-20261119-192442
sandcastle/rescue-20261119-194543
sandcastle/rescue-20261119-195715
sandcastle/rescue-20261119-195042
sandcastle/rescue-20261119-194153
sandcastle/rescue-20261119-193223
sandcastle/rescue-20261119-181821
sandcastle/rescue-20261119-182031
sandcastle/rescue-20261119-191400
sandcastle/rescue-20261119-184524
sandcastle/rescue-20261119-185251
sandcastle/rescue-20261119-190111
sandcastle/rescue-20261119-171507
sandcastle/rescue-20261119-172406
sandcastle/rescue-20261119-180227
sandcastle/rescue-20261119-181611
sandcastle/rescue-20261119-183926
sandcastle/rescue-20261119-165410
sandcastle/rescue-20261119-181300
sandcastle/worker/20261119152654-1251003
sandcastle/rescue-20261119-175608
sandcastle/rescue-20261119-153212
sandcastle/rescue-20261119-155612
sandcastle/rescue-20261119-161612
sandcastle/rescue-20261119-162645
sandcastle/rescue-20261119-151259
sandcastle/worker/20261119-091545-699963
sandcastle/rescue-20261119-152400
sandcastle/rescue-20261119-150650
sandcastle/rescue-20261119-151018
sandcastle/rescue-20261119-145753
sandcastle/rescue-20261119-144640
sandcastle/worker/20261119-141805-b375a7
sandcastle/rescue-20261119-143616
sandcastle/rescue-20261119-142315
sandcastle/rescue-20261119-143536
sandcastle/rescue-20261119-144907
sandcastle/rescue-20261119-150929
sandcastle/rescue-20261119-140252
sandcastle/rescue-20261119-132837
sandcastle/rescue-20261119-140917
sandcastle/rescue-20261118-232015
sandcastle/rescue-20261118-224358
sandcastle/rescue-20261118-231012
sandcastle/rescue-20261118-221954
sandcastle/rescue-20261118-223235
sandcastle/rescue-20261118-215029
sandcastle/rescue-20261118-220457
sandcastle/rescue-20261118-213647
sandcastle/rescue-20261118-213651
sandcastle/rescue-20261118-203142
sandcastle/rescue-20261118-201242
sandcastle/rescue-20261118-160449
sandcastle/worker/20261118-151037-fa1423
sandcastle/rescue-20261118-141033
sandcastle/rescue-20261118-153435
sandcastle/rescue-20261118-155226
sandcastle/rescue-20261118-140135
sandcastle/rescue-20261118-072336
sandcastle/rescue-20261118-071306
sandcastle/rescue-20261118-065902
sandcastle/rescue-20261118-070925
sandcastle/rescue-20261118-064628
sandcastle/rescue-20261118-060611
sandcastle/rescue-20261118-063652
sandcastle/rescue-20261118-065117
sandcastle/rescue-20261118-065556
sandcastle/rescue-20261118-055026
sandcastle/worker/20261118-000033-5f0b74
sandcastle/rescue-20261118-054929
sandcastle/rescue-20261118-053613
sandcastle/worker/20261118-050837-870db6
sandcastle/rescue-20261118-051315
sandcastle/rescue-20261118-052156
sandcastle/rescue-20261118-053056
sandcastle/rescue-20261118-042651
sandcastle/rescue-20261118-050517
sandcastle/rescue-20261118-052017
sandcastle/rescue-20261118-052046
sandcastle/rescue-20261118-053617
sandcastle/rescue-20261118-040341
sandcastle/rescue-20261118-035452
sandcastle/rescue-20261117-180034
sandcastle/worker/20261117-173516-cca624
backport/idss-2068-2111-2114
sandcastle/rescue-20261117-123242
sandcastle/rescue-20261117-124231
backport/idss-2057
sandcastle/rescue-20261116-154411
sandcastle/rescue-20261117-175037
sandcastle/rescue-20261116-153352
sandcastle/rescue-20261107-062749
session-runner-land-mode-recheck-2181
sandcastle/rescue-20261107-061316
fp/idss-2180
sandcastle/rescue-20261107-060212
forward-port/provision-disk-guard
sandcastle/rescue-20261107-060021
sandcastle/rescue-20261107-054649
sandcastle/worker/20261107-043349-cf0d7e
backport/idss-2177
sandcastle/rescue-20261116-175301
sandcastle/rescue-20261116-175950
backport/idss-2176
sandcastle/rescue-20261106-135208
sandcastle/rescue-20261107-045600
sandcastle/rescue-20261107-051315
sandcastle/rescue-20261107-053423
sandcastle/worker/20261106-111451-8c1ff0
sandcastle/rescue-20261106-023514
sandcastle/rescue-20261106-113455
sandcastle/rescue-20261106-115043
sandcastle/rescue-20261106-121303
sandcastle/rescue-20261106-134211
sandcastle/worker/20261106-013937-c15abc
fix/336-job-locality-runner-uuid
sandcastle/rescue-20261106-000320
sandcastle/rescue-20261105-113317
sandcastle/rescue-20261105-235352
sandcastle/rescue-20261106-020541
sandcastle/rescue-20261106-022516
sandcastle/rescue-20261106-024735
sandcastle/rescue-20261106-024744
sandcastle/rescue-20261106-024751
sandcastle/worker/20261105-104416-4319e1
sandcastle/rescue-20261105-111401
sandcastle/worker/20261105-054650-133b83
sandcastle/rescue-20261105-104304
sandcastle/rescue-20261105-110432
sandcastle/rescue-20261105-110637
sandcastle/rescue-20261105-112240
sandcastle/rescue-20261105-102818
sandcastle/worker/20261105-090131-e38a52
sandcastle/rescue-20261105-101105
sandcastle/rescue-20261105-094209
sandcastle/rescue-20261105-095705
sandcastle/rescue-20261105-091351
sandcastle/rescue-20261105-092126
sandcastle/rescue-20261105-093755
sandcastle/rescue-20261105-095339
sandcastle/rescue-20261105-101509
sandcastle/worker/20261105-033507-997386
sandcastle/worker/20261105-072852-43a339
sandcastle/rescue-20261105-085215
sandcastle/rescue-20261105-090546
sandcastle/rescue-20261105-090731
sandcastle/rescue-20261105-091600
sandcastle/worker/20261105-073544-9e3e7b
sandcastle/rescue-20261105-085541
sandcastle/worker/20261105-030149-b06fe6
sandcastle/rescue-20261105-075223
sandcastle/rescue-20261105-080157
sandcastle/rescue-20261105-081231
sandcastle/rescue-20261105-081252
sandcastle/rescue-20261105-081916
sandcastle/rescue-20261105-082029
sandcastle/rescue-20261105-082600
sandcastle/rescue-20261105-082859
sandcastle/rescue-20261105-083557
sandcastle/rescue-20261105-084327
sandcastle/rescue-20261105-090802
sandcastle/rescue-20261105-092213
sandcastle/worker/20261105-004228-d59980
sandcastle/worker/20261104-200255-c897e8
sandcastle/rescue-20261105-021604
sandcastle/rescue-20261105-062428
sandcastle/rescue-20261105-064420
sandcastle/worker/20261104-185608-12e745
sandcastle/rescue-20261105-011719
sandcastle/rescue-20261104-221030
sandcastle/rescue-20261105-003304
sandcastle/rescue-20261105-005511
sandcastle/rescue-20261105-013351
sandcastle/rescue-20261105-015246
sandcastle/worker/20261104-204335-4df59d
sandcastle/worker/20261104-144451-39719f
sandcastle/rescue-20261104-210849
sandcastle/rescue-20261104-211127
sandcastle/rescue-20261104-212722
sandcastle/worker/20261104-194113-a58f71
sandcastle/rescue-20261104-193329
sandcastle/rescue-20261104-200835
sandcastle/rescue-20261104-201057
sandcastle/rescue-20261104-202237
sandcastle/rescue-20261104-204239
sandcastle/rescue-20261104-185105
sandcastle/rescue-20261104-185510
sandcastle/rescue-20261104-192703
sandcastle/rescue-20261104-184907
sandcastle/rescue-20261104-183301
sandcastle/rescue-20261104-183354
backport/idss-2161
backport/idss-2155
fp/idss-2147
backport/idss-2145
backport/idss-2134
backport/idss-2119
sandcastle/worker/20261030-141035-c3d689
sandcastle/worker/20261030-125730-11b08b
sandcastle/worker/20261030-172321-20db0e
backport/idss-2114
backport/idss-2112
forward-port/idss-2111
forward-port/idss-2068
backport/idss-2111
backport/idss-2110
backport/idss-2106
backport/idss-2068
backport/idss-2104
sandcastle/rescue-20261030-110900
sandcastle/worker/20261029-055633-763b74
sandcastle/worker/20261029-000831-e4c652
sandcastle/worker/20261028-162655-0e8071
sandcastle/rescue-20261030-110112
sandcastle/rescue-20261030-110131
sandcastle/rescue-20261030-110135
sandcastle/rescue-20261030-110153
sandcastle/rescue-20261030-110156
sandcastle/rescue-20261030-110200
sandcastle/rescue-20261030-110220
backport/idss-1913
agent/issue-306
runner-busy-not-stalled
sandcastle/worker/20261024-045639-da1b9a
sandcastle/worker/20261023-060833-778cbe
fleet-queue-watcher-301-proposal
floor-vue
sandcastle/worker/20261021-191646-b93327
sandcastle/worker/20261021-233637-f21837
sandcastle/worker/20261021-233255-c766f7
sandcastle/worker/20261021-040000-b7a28d
backport/idss-2050
backport/idss-2050-session-pr-landing
sandcastle/worker/20261020-221737-cc96f3
backport/idss-2052
agent/issue-289
backstop-waiting-runs
sandcastle/worker/20261017-204619-942ae4
sandcastle/worker/20261017-204620-aa17c2
sandcastle/worker/20261017-144914-3ec608
sandcastle/worker/20261017-063336-7f5d31
sandcastle/rescue-20261017-062529
sandcastle/worker/20261017-010124-c49097
sandcastle/worker/20261017-003840-0c4ab1
sandcastle/rescue-20261017-054742
sandcastle/worker/20261017-053155-61c4c7
sandcastle/worker/20261017-050606-f20d66
sandcastle/rescue-20261017-052443
sandcastle/worker/20261017-050839-ec5b54
sandcastle/rescue-20261017-052212
sandcastle/worker/20261017-050442-495e4b
sandcastle/rescue-20261017-051857
sandcastle/worker/20261017-000426-34fa18
agent/issue-272
agent/issue-273
agent/issue-244
agent/issue-269
sandcastle/rescue-20261016-184726
sandcastle/rescue-20261016-184906
sandcastle/rescue-20261016-185533
sandcastle/rescue-20261016-191907
sandcastle/rescue-20261016-192219
sandcastle/worker/20261016-155725-c51ed1
agent/issue-195
agent/issue-196
agent/issue-197
agent/issue-198
agent/issue-200
agent/issue-203
agent/issue-205
agent/issue-206
agent/issue-207
agent/issue-209
agent/issue-213
agent/issue-216
agent/issue-217
agent/issue-218
agent/issue-222
agent/issue-238
agent/issue-208
sandcastle/worker/20261016-155833-1b8f77
agent/issue-241
agent/issue-230
agent/issue-239
land/issue-193
forward-port/idss-2048
backport/idss-2048
agent/issue-237
agent/issue-225
agent/issue-193
agent/issue-176
backport/1717-unclaimed-commit-gate
backport/1733-drive-yield-runlog
fix/159-rehearsal-report-token-leak
fix/157-ready-list-standdown
fix/154-verdict-no-match-trap
factory-floor-visual-rework
landing-shell-guard
No results found.
Labels
Clear labels
agent-blocked
Sandcastle hit a blocker — human resolves it, then re-adds ready-for-agent
agent-working
Claimed by a live swarm run — other hosts skip it
bug
Something is broken
deferred
Ruled defer-with-criteria: parked until a revisit criterion in the issue body fires
enhancement
New feature or improvement
landing-pr
Additive: this ticket lands ONLY by a PR with screenshots (or a waiver) that a human merges — ADR 0265. Only a human removes it.
model-haiku
Per-ticket model override (additive): run this ticket on the cheap/fast model
model-opus
Per-ticket model override (additive): run this ticket on the top-tier model
model-sonnet
Per-ticket model override (additive): run this ticket on the mid-tier model
needs-info
Waiting on reporter for more information
needs-triage
Maintainer needs to evaluate this issue
no-triage
Escape hatch: triage automation must skip this issue
priority
Additive urgency marker — the swarm queue works these first
ready-for-agent
Fully specified, ready for an AFK agent
ready-for-human
Needs the human's hands, eyes, or a one-way-door ruling (ADR 0174)
ready-for-session
Needs an interactive agent session (host creds/protected paths/live doors), not the human (ADR 0174)
wontfix
Will not be actioned
No labels
agent-blocked
agent-working
bug
deferred
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-info
needs-triage
no-triage
priority
ready-for-agent
ready-for-human
ready-for-session
wontfix
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Dependencies
No dependencies set.
Reference
Matou/dev-factory#37
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?
Follow-up from #3 / ADR 0004 ("Consequences", last bullet).
An enrolled host's shared env file — the one every factory cron line sources for its tokens and PATH — is named and shaped after one product's rehearsal loop (
~/swarm/rehearsal-env.sh:FORGEJO_TOKEN,CLAUDE_CODE_OAUTH_TOKEN/_B,MATTERMOST_*sitting beside that product'sREHEARSAL_DRIVE_*, broker URL and payload dir). ADR 0004 left it alone deliberately: the registry names it as a path, so the ownership move needed no rename, and renaming a live file every cron line sources is not a change to make in the same breath as moving the crontab.What's needed
envdirective points at, and the product's own env for its drive variables, sourced by that product's own hand-maintained cron lines..sandcastle/.env) — #3's rule 6.env, re-runonboard.sh host-cron install, and only then retire the old file — withcrontab -lproving no line still sources it.Ruled by agent under ADR 0174 — veto anytime
Two calls here: who executes this, and whether the last step destroys anything.
Ruling 1 —
ready-for-session, notready-for-agent, and notready-for-humanEvery artefact this ticket touches lives on the host, outside any repo:
~/swarm/rehearsal-env.sh, the host registry'senvdirective, the crontab. A swarm worker runs in a container against a worktree and cannot reach them. An interactive session on the workstation can. That is precisely theready-for-sessionrole (docs/agents/triage-labels.md), and it matches the parent: #3 is itselfready-for-sessionfor the same reason ("host crontab is live infrastructure").Not
ready-for-human: theready-for-humanbar is Ben's hands, Ben's eyes, or a one-way-door ruling. This is a file split plus a re-point, every step revertible, with no GUI or trust surface to look at.The credential angle is worth naming, since the file holds
FORGEJO_TOKENandCLAUDE_CODE_OAUTH_TOKEN/_B. This ticket moves where credentials are sourced from; it does not mint, rotate, widen, or expose them — so it is not the "personal credentials" one-way door. The session must hold that line: same host, samechmod 600, never into a repo, never into.sandcastle/.env(#3's rule 6). If the split turns out to need a new or rotated token, that part stops and comes back asready-for-human.Ruling 2 — the retire step is
mv, neverrmThe ticket's sequencing ends "and only then retire the old file". Deleting a live file that every factory cron line sources is the one step in this arc that is not cheaply revertible — and data destruction is on the one-way-door list. It does not have to be. Rule: rename it aside (
~/swarm/rehearsal-env.sh.retired-<date>, mode preserved) rather than delete. A missed cron line then fails loud and is onemvfrom restored, and the whole ticket stays a two-way door an agent session may execute. Actual deletion is a separate, later, human call once the retired file has sat unused through a full cycle.Why this is a two-way door
New file + a registry line + a cron reinstall, each revertible by re-pointing and re-running the installer; the old file is preserved by ruling 2. No security-posture widening (same host, same modes, same secrets), no member-facing trust accept, no spend.
What proves it
crontab -lafter the reinstall — every line sources the new factory-owned env, no line sources the old path — plus one green tick per enrolled repo's cron entry observed before the old file is renamed aside. That is the ticket's own stated proof and it is sufficient.Blocked on #3 — dependency wired
Two of this ticket's steps name artefacts that do not exist in
maintoday: the registry'senvdirective andonboard.sh host-cron install. Verified — there is no~/swarm/host-registry.confreader, noonboarding/host-state-lib.sh, and nohost-cronsubcommand anywhere in the tree (grep -rln "host-registry\|host-state-lib\|host-cron"returns nothing), andSTATUS.md:166still reads "Host state (crontab, lock, swarm.db) — ⚠️ still lives ad hoc on matou-workstation; move here = #3". #3 is open.So this is
ready-for-sessionbehind #3, wired as a native Forgejo dependency so the DAG holds it (list-ready-tasks.sh:88-97,session-runner.sh:172both skip issues with open dependencies).Session brief
Goal. The shared host env every factory cron line sources is factory-owned and product-neutral; one product's drive variables live in that product's own env, sourced by that product's own hand-maintained cron lines.
Sequence — each step verified before the next:
FORGEJO_TOKEN,CLAUDE_CODE_OAUTH_TOKEN/_B,MATTERMOST_*) + PATH. Host-only,chmod 600, never in a repo, never in.sandcastle/.env(#3 rule 6).REHEARSAL_DRIVE_*, broker URL and payload dir in the product's own env.envdirective at the new file.onboard.sh host-cron install.crontab -lthat no line still sources the old path, and watch one green tick per enrolled repo.mvthe old file aside (ruling 2). Neverrm.Also in scope, and this part is repo work:
session-runner.sh:20— the header's example cron line hardcodes/home/dev/swarm/rehearsal-env.shandMatou/idssinside a vendored harness file, which CLAUDE.md's blast-radius rule forbids. #35's brief already claims that one-line comment fix; if #35 lands first this is done, otherwise do it here. It is the only in-repo trace of the old path.Constraint. Host-only otherwise — no harness file names the env path (the registry does), so nothing else here is vendored and no pin bump is involved.
Ben — veto the
mv-not-rmruling, or pull this to your own hands, any time.Correction — #37 is not blocked; #3 landed mid-triage
The "Blocked on #3" section of my previous comment is wrong, and the dependency it wired has been removed.
#3 closed at
2026-08-23T15:29:34Z— four minutes after this follow-up was filed, and between my firstgit fetchand the write.origin/mainnow carries94ab290 host state is factory-owned: render an enrolled host's crontab from a registry (advances #3), and with it exactly the artefacts I reported missing:docs/adr/0004-host-state-is-factory-owned-and-installed-from-a-host-registry.mdonboarding/host-state-lib.shonboarding/templates/host-registry.conf.example— which declares theenv <file>directive this ticket re-points ("host env sourced by each session-runner tick (tokens/PATH; host-only, never in a repo)")onboard.sh host-cron {render|diff|install}STATUS.md:166on the new main also confirms the registry is live onmatou-workstation, diff clean. So step 3 (re-point the registry'senv) and step 4 (onboard.sh host-cron install) are both executable today, against an installed registry, and the "Sequencing" the ticket asked for is now runnable end to end.Everything else in the previous comment stands unchanged:
ready-for-session(host-only artefacts, an interactive session on the workstation, not a containerised swarm worker), the credential line (move where they are sourced from — never mint, rotate, widen, or expose; if a new or rotated token turns out to be needed, that part stops and returns asready-for-human), and ruling 2 (retire bymvto~/swarm/rehearsal-env.sh.retired-<date>, neverrm— deletion is the one step that would not be cheaply revertible, and it does not have to be taken to finish this ticket).Net effect: this is
ready-for-sessionand actionable now, not parked.One extra detail the new main makes concrete —
installsplices a single marker-delimited block and passes every line outside it through byte-identical, so the product's own hand-maintained cron lines (the ones that should keep sourcing the product's env for itsREHEARSAL_DRIVE_*) survive the reinstall untouched. That is precisely the split this ticket wants, and the installer already enforces the boundary.Ruled by agent under ADR 0174 — veto anytime.
Ruling: DEFERRED. Same gap as #35: the ticket's plan requires "the
registry's
envdirective" to point the split env file at, and re-runningonboard.sh host-cron install— neither the registry'senvdirective nora
host-cronsubcommand ofonboard.shexist in this repo yet (bothbelong to #6, still open,
ready-for-session). This ticket can't be scopedprecisely until #6 lands.
Why two-way door: a sequencing call only, reversible the moment #6 lands.
What proves it:
grep -n "host-cron" onboarding/onboard.shand anyreference to a registry
envdirective both come up empty in this repotoday.
Ruled: DEFERRED
Revisit when: #6 lands (the host registry's
envdirective andonboard.sh host-cron installexist).Ruled by: agent, under ADR 0174, during headless
/triage, 2026-08-23.Note for whoever revisits: this ticket's own body says "no harness file
names the path... nothing here is vendored" and its sequencing ends in
"
crontab -lproving no line still sources it" — that's live host state,not a repo change a sandboxed swarm worker can make. Once unblocked, route
to
ready-for-session, notready-for-agent(the same bar #3 itself islabelled under).
Marked as blocked by #6 via Forgejo's issue dependencies.
Agent Brief
Category: enhancement
Summary: Split the host's shared env file into a factory-owned file (generic tokens/PATH) and each product's own env, so the factory-owned file stops being named and shaped after one product.
Current behavior: An enrolled host's shared env file — sourced by every factory cron line, now named by the
envdirective inhost-registry.conf(ADR 0004) — is still product-flavoured: it mixes generic factory tokens (FORGEJO_TOKEN,CLAUDE_CODE_OAUTH_TOKEN/_B) with one product's own drive variables (MATTERMOST_*, that product'sREHEARSAL_DRIVE_*, broker URL, payload dir). ADR 0004's "Consequences" section names this explicitly as unresolved: "the host env file is still product-flavoured in name and content... renaming it is a host-side follow-up, not a harness change."Desired behavior: The factory-owned host env file carries only the generic tokens/PATH every cron line needs. Each product owns its own env file for its drive-specific variables, sourced by that product's own hand-maintained cron lines (outside the factory-managed marker block). The registry's
envdirective points at the new factory-owned file. No harness file names a product or a host-specific path.Sequencing (why this needs a session, not a swarm worker — see "Why human" below):
host-registry.confenvdirective to point at it.onboarding/onboard.sh host-cron installso the rendered cron block sources the new file.crontab -lproves no line still sources the old file, retire it.Acceptance criteria:
envdirective) contains no product-specific variable names.onboarding/onboard.sh host-cron diffreports no unexpected change after the switch.crontab -lon the enrolled host shows no line sourcing the old product-flavoured file.Out of scope:
onboarding/host-state-lib.sh's registry schema — theenvdirective already exists and already takes a path; this is a host-side data migration, not a schema change.Why human
This is a live-infrastructure mutation on the actual enrolled host: creating/renaming real files under the host's home dir, editing the live
host-registry.conf, and runningonboard.sh host-cron installagainst the real crontab. A swarm worker (sandboxed, no host credentials or crontab access) structurally cannot do this — the same reasoning that routed #3 itself to a session ("host crontab is live infrastructure... not swarm-workable"). No open design judgement is being deferred to a human here; this isready-for-session(an interactive session's standing), notready-for-human.Verification: Confirmed by ADR 0004's own text (landed closing #3 immediately prior to this triage pass), which independently names this exact gap in near-identical terms.
Correction — my "DEFERRED" ruling above is withdrawn
A second
/triagepass ran concurrently with this one. It made the same"blocked on #6" call I did, at first — then caught that #3 landed mid-run
(
origin/maingaineddocs/adr/0004-*.md,onboarding/host-state-lib.sh,onboarding/templates/host-registry.conf.examplewith itsenvdirective,and
onboard.sh host-cron {render|diff|install}) and self-corrected to"actionable now, not parked."
I fetched
origin/maintoo early in my own pass and never re-fetchedbefore ruling, so I made the same now-stale call without catching the
landing. Re-fetching now confirms it: #3 is closed, ADR 0004 and
host-state-lib.share onmain.Removed the
deferredlabel and the#6dependency link I'd added. Thecorrect state is the one already on the issue:
ready-for-session, perthe earlier ruling, its correction comment, and the session brief in this
thread — session-shaped because every artefact this ticket touches (the
host env file, the registry, the live crontab) lives outside any repo, not
because anything is still missing.
Correction: the "blocked by #6" dependency is wrong
This ticket currently carries a native Forgejo dependency on #6
("onboard-host: host registry + idempotent machine enrolment"), added by a
concurrent triage pass that conflated two different registries.
#6's own body is explicit that it is a different registry — the
worker-pool capacity/scheduling registry (
hosts/<name>.conf: heavy-workerslots, drive-exclusivity, coverage) that feeds
Matou/ourcloud#577'ssemaphore — and says outright: "Moving existing hosts' state wholesale —
that's #3; this ticket must not fight it, only converge." The
envdirective and
onboard.sh host-cron {render,diff,install}this ticket(#37) needs both shipped with #3 (now closed,
docs/adr/0004-*.mdonmain), not #6. #6 is unrelated to what #37 needs.Net effect: #37 is not blocked by #6. The
ready-for-sessionlabelalready on this ticket is correct and unblocked today.
Attempted fix, didn't land: tried to remove the dependency via
Forgejo's
DELETE /issues/{index}/dependenciesAPI (the documentedIssueMeta{index,owner,repo}body, matching thePOSTshape this repo'sown
forgejo-lib.shuses). It 500s with an empty message on this instance(gitea 1.22.0-based) — reproduced on a control case (removing #35's
already-closed #3 dependency, which should be inert either way) with the
same 500, so this is a platform bug, not a payload mistake. Query-param and
form-encoded variants were also tried; same failure mode.
What this means operationally:
session-runner.sh's picker skips anyticket with an open dependency, so until this stray edge is removed,
#37 will not actually surface to a session despite carrying the correct
ready-for-sessionlabel. Removing it needs either a working API routethis session doesn't have, or a human clicking "Remove" in the Forgejo web
UI (the web UI may use a different internal path than the public REST
endpoint that failed here).
Ben — this needs your hands only because the tooling to fix it via API is
broken, not because of any judgement call; the correction itself (#37 is
not blocked by #6) stands under ADR 0174 as a two-way door, proven by #6's
own "explicitly out of scope" section and #3's already-landed ADR 0004.
Close report — #37 landed, live on
matou-workstationRuled by agent under ADR 0174 — veto anytime. Two-way door throughout: one
lib change in the vendor-excluded
onboarding/**layer, plus host-side filesand a crontab splice that were backed up before every write.
What the ticket asked, and one thing it did not know
The split is done as asked. While scoping it, one fact reshaped the design:
the shared file is not only read by the product's hand-maintained cron lines
—
session-runner.sh:61readsREHEARSAL_DRIVE_ISSUEand filters itsready-for-sessionqueue withselect(.number != $drive)(line 162). So withone host env file,
dev-factory's own session-runner tick was excludingissue 657 from its queue because that is idss's standing-drive number — a
per-repo issue number filtering another repo's queue, the #35/#36 defect
family. Latent, not live: idss #657 is closed and carries
ready-for-agent,not
ready-for-session.That is why the split is not just "two files": the registry gained a directive
so the layering is declared.
Landed —
828ab97(pushed tomain)repo-env <owner/repo> <file>inonboarding/host-state-lib.sh: thehost
envis the factory-owned shared layer (PATH + the tokens every factoryline needs), and a repo's own product variables live in its own host-only
file, sourced after it, on that repo's session line only. Both layers are
spelled out on the rendered cron line rather than implied. A repo declaring
no
repo-envrenders byte-identically to before.repo, a missing file, two declarations for one repo.
onboarding/templates/host-registry.conf.example;onboarding/README.mdgains "The env layer is two files, not one".onboarding/tests/host-state-lib-test.sh94 → 103 checks, eachproven RED before the lib changed. Full offline suite green (67 files).
onboarding/**is vendor-excluded — nothing vendored changed, so nore-vendor and no pin bump.
The host cutover (sequenced exactly as the ticket asked)
~/swarm/env-backups/*.pre-37-20260824T001002Z): the envfile, the registry, and the live crontab. Undo is one
cp/crontab <file>.~/swarm/host-env.sh(PATH,FORGEJO_TOKEN,CLAUDE_CODE_OAUTH_TOKEN/_B, theMATTERMOST_*trio) and~/swarm/idss-env.sh(DIGITALOCEAN_ACCESS_TOKEN,IDSS_BROKER_URL/_PAYLOAD_DIR,REHEARSAL_DRIVE_ISSUE/_TARGET,ELECTRON_OVERRIDE_DIST_PATH). Both mode 600, host-only — never in a repo,never in
.sandcastle/.env(rule 6).Proof of equivalence: sourcing
host-env.sh+idss-env.shunderenv -iproduces a variable set identical to sourcing the pre-split file —compared by per-variable sha256 fingerprint, so no value was printed.
env→host-env.sh,repo-env Matou/idss→idss-env.sh),host-cron diffreviewed, thenhost-cron install, then afull
onboard-host enrol(16-check preflight green,verifygreen,host-capacity.envregenerated soHOST_ENV_FILEnames the new path).names both layers:
. host-env.sh && . idss-env.sh && rehearsal-executor.sh.crontab -lproves no line sources the old path, and the fileis gone.
Live proof, per line. Each installed line was re-run under a cron-like
env -i /bin/sh -cwith its entry point swapped for a probe:And in the real world since: the re-pointed executor line ran at 00:16Z and
printed its normal
#657 is closedverdict — which it can only reach with bothFORGEJO_TOKENandREHEARSAL_DRIVE_ISSUEin hand. A live API call using onlyhost-env.shreturned HTTP 200.The one shim, named honestly
~/swarm/rehearsal-env.shis not deleted — it is now a symlink tohost-env.sh.Matou/idss'stoken-sync.ymlwrites the org Claude andMattermost secrets into that absolute path, and this repo is pull-only
(ADR 0001), so deleting it would have broken token rotation with a fix I cannot
push. Verified in a scratch dir that its exact write path
(
open(f, "w").write(s)) writes through the symlink, preserving the link,the target's comments and mode 600 — so a rotation lands in the factory-owned
file, which is where those five variables belong anyway. Filed as
Matou/idss#719: re-point the workflow, thenrmthe symlink.Residue, none of it silent
Matou/idss#719— the workflow re-point + the symlink's removal, plusidss's own comments naming the old path.
elitebook-03is untouched — no door from this machine; its/home/swarm/swarm/rehearsal-env.shis still one product-flavoured file.Belongs with #6's outstanding enrolment residue.
ready-for-agent, filed) — two harness files still carry producthost facts:
rehearsal-report.sh's auth-failure message namesrehearsal-env.sh, andsession-runner.shdefaultsREHEARSAL_DRIVE_ISSUEto one product's issue number 492 (
list-ready-tasks.shalready defaults itempty, which is the right shape). Both are vendored, so they were kept out of
this host-only ticket.
two new files I
head-ed one of them and printed aFORGEJO_TOKENand aDIGITALOCEAN_ACCESS_TOKENvalue into this session's transcript(
~/.claude/projects/…, host-local, dev-owned). Checked: neither valueappears in
~/swarm/logs/session-runner-dev-factory.logor any other log,and nothing was sent off the host. I did not rotate either token — that
is a one-way-ish action affecting every loop on the host and is yours to
judge.
STATUS.mdheader + the host-state and capacity rows updated in the samecommit. Closing.
rehearsal-env.sh(idss #719) #44