Skip to content

do: scripted runs on a box with a live resident get compiled conversationally — add hard isolation (--no-resident) - #2018

Open
ZeroPoint95 wants to merge 1 commit into
devfrom
zeropoint95/1959-do-scripted-runs-on-a-box-with-a-live-re
Open

ZeroPoint95 wants to merge 1 commit into
devfrom
zeropoint95/1959-do-scripted-runs-on-a-box-with-a-live-re

Conversation

@ZeroPoint95

Copy link
Copy Markdown
Collaborator

Changes

  • codeaf do --no-resident (env CODEAF_NO_RESIDENT=1) refuses the resident hand-off while a live non-stuck resident holds the store: the run exits 1, names the holder's pid and host and the store path, and writes nothing to the journal, so no resident can apply a run the script did not get.
  • The refusal lives in errandRun between store setup and the journal write and probes the lease instead of fighting it; a stuck (crashed) holder is not refused and takes the stale lease as before, run/the belt road are untouched, and without the switch today's hand-off is unchanged (verified by the pinned existing hand-off tests).
  • Documented everywhere a script reader looks: docs/HEADLESS.md synopsis, flags table, resident-hand-off passage and env table, chat manual running-from-the-terminal.md and adaptive-runs.md flag tables, environmentText in cmd/codeaf/main.go, plus the changelog entry docs/changes/unreleased/1959-do-no-resident.md.
  • Final change: 8 files, +243/−3.

Closes #1959.

Validation

  • Passed locally: cd . && go test ./cmd/codeaf -run 'TestDoFailsFastWhenAnotherProcessHoldsTheResidentLock|TestAResidentServingAnotherStoreIsRefusedImmediately|TestDoNoResident|TestCodeafNoResident|TestADoErrandHandedToAResidentLeavesNoPendingLanding' -count=1 -v 2>&1 | grep -E '^(=== RUN|--- (PASS|FAIL)|PASS|FAIL|ok )'.
  • Passed locally: cd . && env -u GOOS -u GOARCH go generate ./internal/manual && go test -tags=codeaf_packed_manual ./internal/manual 2>&1 | tail -2; echo "pack exit: $?".
  • Proof · 3 of 3 claims shown locally. GitHub CI is checked after publishing.
  • ✓ With a live non-stuck resident holding the store, --no-resident (and CODEAF_NO_RESIDENT=1) refuses at the door: exit 1, holder and switch named, nothing handed over — and without the switch the hand-off is unchanged
  • ✓ The refusal reaches a script through the one ladder: exit 1 via stopError → exitCannotRun, and --json emits one envelope object with ok:false, stop:"error" and the sentence in the error field
  • ✓ No regression in the do surface, help/usage rendering, packed manual, changelog law, vet or formatting; every script-facing doc names the new switch

by codeaf factory

Factory-Approval: evt_411712d4 @ZeroPoint95 9149020

…tionally — add hard isolation (--no-resident)

Assisted-by: CodeAF
Co-Authored-By: CodeAF <267109073+agentfield-bot@users.noreply.github.com>
@ZeroPoint95
ZeroPoint95 marked this pull request as ready for review October 28, 2026 23:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

do: scripted runs on a box with a live resident get compiled conversationally — add hard isolation (--no-resident)

1 participant