swarm: harness-sync — ourcloud .sandcastle is canonical; the shared libs reach matou-app mechanically, never by memory #250
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
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Matou/idss#250
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?
Parent
Swarm ops (self-healing-swarm design). Sibling of #238 (multi-project queue hygiene — that ticket namespaces the runtime; this one keeps the code of the two harnesses from diverging).
What's true today
Matou/ourcloud,Matou/matou-app); each carries its own.sandcastle/harness. The generic infrastructure files are maintained by copy-paste.4342c01(heal.sh, heal-lib.sh, heal-prompt.md from ourcloud canonical, transform:Matou/ourcloud→Matou/matou-app).limit-lib.sh,ask-human.sh,notify-mattermost.shwere verified identical.Dockerfile/README.md/check-verifications.sh/gate*/preflight-triage.sh/list-ready-tasks.shdiffer and were deliberately NOT touched — repo-specific until ruled otherwise.What to build
In ourcloud (the canonical side):
.sandcastle/harness-manifest— the explicit list of shared files (start:heal.sh heal-lib.sh heal-prompt.md limit-lib.sh ask-human.sh notify-mattermost.sh) and the single allowed transform (the repo-slug substitution)..sandcastle/sync-harness.sh— renders each manifest file for a target repo and, when the rendered result differs from the target's tip, commits + pushes it (shallow clone, own workdir — never the locked swarm workdirs, the resume-asks pattern). Idempotent; a no-op sync makes no commit..sandcastle/(or fold into an existing cron). Credential: verify the runner's existing token can push to matou-app; if not, that is one ask-human for a repo-scoped token — do not widen silently.Acceptance criteria
Task manifest
Landed in
7643818onmain.ourcloud is canonical. New pieces:
.sandcastle/harness-manifest— the generic shared files (heal.sh,heal-lib.sh,heal-prompt.md,limit-lib.sh,ask-human.sh,notify-mattermost.sh,check-harness-drift.sh) + the one allowed transform (the repo-slug substitution). Repo-specific files (Dockerfile/README.md/gate*/run-swarm.sh/…) are deliberately OFF the manifest and never touched (AC4)..sandcastle/sync-harness.sh Matou/matou-app— renders each manifest file in its own throwaway workdir (never a locked swarm workdir), commits + pushes only on a diff naming the canonical rev, idempotent (unchanged manifest → no commit, AC1), rebase-retry so a concurrent push is not misread as auth failure, and fails LOUD via ask-human on a push it cannot land — never a silent skip (AC3). Ships a.harness-canonicalmarker + aharness-drift.ymlinto the target..sandcastle/check-harness-drift.sh— far-side alarm: re-renders the manifest files from the recorded canonical rev and reds ci if a copy was edited directly, naming the file + the canonical rule (AC2). Generic (no slug); no-marker repos are a green no-op..forgejo/workflows/harness-sync.yml— trigger on push to main paths.sandcastle/**; runs the sync againstMatou/matou-appon the same runner token that already pushes matou-app main (credential expected present; sync fails loud if narrowed).Credential note (from the ticket): the runners SWARM_FORGEJO_TOKEN already pushes to
Matou/matou-appmain (swarm.yml), so no new token was needed; if it is ever narrowed,sync-harness.shsurfaces it via ask-human rather than drifting.Seam / evidence:
.sandcastle/tests/sync-harness-test.sh— 7 groups over local git fixtures (no network), pinning all four ACs: the slug transform + rev-named commit, the dry-run/idempotent no-op, the credential-fail ask-human, and the drift check going red on a direct far-side edit.bash -nclean on all three scripts. STATUS.md updated (new lead + #238 deferred item closed); README documents the trio.Deferred, honest: the first real sync commit into matou-app and its drift-check going live are one push-to-main away — verified offline in-sandbox only (the workflow fires on the next
.sandcastle/**push to ourcloud main). AC5-style far-side wiring is shipped BY the sync (it writesharness-drift.ymlinto matou-app), so no manual matou-app edit is required.