Repository navigation
Closed
Labels
area/towerArea: Tower server / agent farm CLI
Description
Proposal (from a production workspace's architect, live-tested there)
Long architect sessions accumulate stale context. The refresh recipe exists today as three manual steps, and /arch-init's skill doc already documents the loop as prose (save at a resumable boundary → suggest /clear → human clears → /arch-init recovers). Package it as a command — /arch-save (or afx reset <architect> --state) that:
- Writes the dated resume block into
codev/state/<name>.md— current lanes, pending confirmations, next actions, and (live-run finding) an explicit list of session-bound monitors/watchers that die at the clear and need re-arming — everything/arch-initneeds to resume cold. Write happens strictly BEFORE any clear. - Clears the architect's own session.
- Re-injects
/arch-init <name>into the fresh session so it re-adopts identity and resumes automatically.
Design notes
- Reuse Builder context reset should be a first-class flow: save-state → /clear → re-orient #1273's machinery, not a detached scheduler. The proposal's original leg-3 design (detached process sleeping ~45s to send
/arch-init, because the sender's session dies at the clear) predates PR [Spec 1273] Builder context reset: save-state → /clear → re-orient #1305:afx resetalready implements Tower-owned interrupt →/clearvia the raw/escape channel → post-clear confirmation → re-orientation injection, for builders./arch-saveis the architect flavor: same Tower-side sequencing, but the re-orientation payload is/arch-init <name>(state-file-based recovery) instead of spawn-prompt reconstruction. Tower survives the clear; no orphan scheduler process needed. - The human-keystroke invariant must survive packaging.
/arch-init's save discipline deliberately keeps the irreversible step behind a human decision: an agent must never unilaterally destroy its own context./arch-savedoesn't break that — it relocates the human decision from "press /clear" to "invoke /arch-save" — but the command doc must say so: architects run it on the owner's direction or the owner runs it; an architect must not invoke it autonomously mid-task on its own judgment. (Standard override-carveout framing: "don't autonomously X," not "X is forbidden.") - Refuse mid-task saves. The skill doc's rule — save only at a resumable boundary, never mid-task — is the part a command CAN'T verify. At minimum the command should require a
--boundary-style acknowledgment; the quality of the resume block stays on the architect. - Gate on the Builder context reset should be a first-class flow: save-state → /clear → re-orient #1273 verify e2e. The underlying reset headline path (does
/clearactually take effect via the raw channel; what a real clear emits) is still pending its live end-to-end run./arch-saveinherits that dependency.
Evidence
The proposing workspace is live-running exactly this cycle manually (their cost architect, state file at v67) and has offered the v67 state block as a template for the resume-block format. Their run surfaced the monitor-re-arm requirement and the write-before-clear ordering as real failure modes, not theory.
Metadata
Metadata
Assignees
Labels
area/towerArea: Tower server / agent farm CLI
Activity
waleedkadous commentedon Jul 31, 2026
Resume-template candidate: the v67 state block (sanitized)
As requested — the state block that drove the live save→/clear→/arch-init cycle on 2026-07-31. One substitution: this repo is public, and the live block carries internal program content (spend figures, un-released experiment results, verbatim stakeholder quotes). Below is the same block with content genericized; every structural element is preserved verbatim from the live artifact. The un-sanitized original lives in our project at
codev/state/cost.md(v67 header) for anyone with repo access.What the live run validated, in template order:
Two live-run findings already cited in the issue body, confirmed from this side:
afx statusrace); the replacement needed a 2-consecutive-miss debounce. Worth encoding in the /arch-save flavor: a freshly re-armed monitor should self-test its predicate once before its alerts are trusted.On amendment (1): agreed, our detached-scheduler leg is obsolete if
afx resetowns interrupt→clear→re-orientation — inheriting reset's pending live-e2e gate is the right coupling. On amendment (2): the human-keystroke invariant is the part we'd insist on; autonomous self-invocation ban with a standard override carveout matches how the live run was actually operated.waleedkadous commentedon Jul 31, 2026
Correction to the monitor finding (from the same live run) — changes the spec
Earlier evidence on this issue said session-bound monitors die at the clear and need re-arming. The live run disproved half of that: monitors are session-bound, not context-bound — a watcher armed in the pre-clear context SURVIVED
/clearand fired a stale false alert 8 minutes into the fresh context, against a target that had been deliberately decommissioned before the clear. (The earlier "monitors die" observation came from a night where the sessions themselves died, which conflated the two lifecycles.) Process-level orphan checks (pgrep) can't see these — they're harness background tasks, not shell processes.Spec change for
/arch-save's post-clear checklist, order is load-bearing:Equivalently: the state block's monitor list serves two purposes — a kill-list for the transition and a re-arm list for the resumed instance — and
/arch-saveshould treat it as both.waleedkadous commentedon Sep 22, 2026
Shipped: the /arch-save cycle landed via Spec 1307 (commits b4c5d08, 45f946e) and the next-task extension via #1709 / PR #1710 (merge 69af908). Closing.