Skip to content

/arch-save: packaged save→clear→re-init cycle for architect context refresh (counterpart to /arch-init) #1307

Description

@waleedkadous

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:

  1. 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-init needs to resume cold. Write happens strictly BEFORE any clear.
  2. Clears the architect's own session.
  3. 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 reset already implements Tower-owned interrupt → /clear via the raw/escape channel → post-clear confirmation → re-orientation injection, for builders. /arch-save is 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-save doesn'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 /clear actually take effect via the raw channel; what a real clear emits) is still pending its live end-to-end run. /arch-save inherits 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

No one assigned

    Labels

    area/towerArea: Tower server / agent farm CLI

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions