carlos / platform Public

copy: RFS-6-C75, the line for a terminal a session could not restore (rootfs plan 6)

Paul approved it unchanged on 2026-10-31. restoreFailedMsg now holds
it byte for byte (%v is the error); the deck row, copy-approved.json,
rootfsCopyIDs and rootfsCopyBuilt gain it, and TestSessionRestoreFailure
expects it. The root envelope is re-pinned in overlay rootfs-apps-6.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev 6bbe8cd1f934f455a9bd5054ac4e095cc46c2bed parent 571046c
5 files changed, +14 −11
  • approved_rootfs_copy_test.go +4 −4
  • docs/superpowers/plans/2026-10-24-rootfs-apps-copy.md +5 −2
  • interactive_cli.go +3 −3
  • interactive_cli_test.go +1 −1
  • internal/provision/testdata/plan14-root-reads-rootfs-apps-6.tsv +1 −1

Intent

Human

<task-notification> <task-id>ae15ac04065c23b5b</task-id> <tool-use-id>toolu_011TRrGCdCnCRzwETUM7tFfr</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/ba9fa944-a429-4788-9b3c-f2b2f42617f3/tasks/ae15ac04065c23b5b.output</output-file> <status>completed</status> <summary>Agent "Audit refused session attempts" finished</summary> <note>A task-notification fires each time this agent stops with no live background children of its own. The user can send it another message and resume it, so the same task-id may notify more than once.</note> <result>I've added the `interactive-refused` audit row to Plan 6 in commit `571046c5`, not pushed. Tests: the new and existing session-door tests pass once and once more under `-race`, and all five mutations were caught. **What changed** - In `internal/console/apiinteractive.go`, each refusal writes one `interactive-refused` row, before the upgrade (the HTTP answer) and after it (End refused). After the upgrade that covers a malformed Open, no console process, a channel read failure, the gate draining, and the admission refusals: busy, moving, import and a deleted record. - Each row goes through `s.auditActivity` with TargetType "instance" and Target the host. Its JSON detail holds: - `argv` or `process`, as the CLI sent them; - `status`, the HTTP code, for refusals before the upgrade; - `refused`, the refusal code, when there is one; - `detail`, the sentence sent to the CLI. - No action labels needed. Activity views show `interactive-start` raw, through the generic "Recorded %s" in `auditdetail.go`, so the new action shows the same way. - In the plan, Task 10 step 5 and the test comment that said "no audit row" now cite Paul's 2026-10-31 ruling. I also updated the matching comment in `apiinteractive_test.go`. - `make census-card` is clean and the record-write census passes, so there's nothing to re-propose. The rootfs copy gates and console censuses pass, and the console builds for darwin/arm64, windows/amd64 and linux/arm64. **Tests** (new file `internal/console/apiinteractive_refused_test.go`) - One table test runs 21 refusals and checks for exactly one row with the right detail, and no start or end row. - A second test checks that no credential and a bad credential (both 401), a service credential (403) and a stranger (404) write no row. - A third test counts store requests for a refusal before the upgrade (2) and after it (4). I took those counts from the code before the change, so the row adds none. `TestInteractiveRequestBudget` passes with its counts unchanged. **Decision for the controller** - **Host-claim refusal (409 C35):** this refusal writes no row. On a host-claim console, an audit insert goes through the claim's SQL admission, which writes `apps/&lt;acct&gt;/&lt;app&gt;/admission.json` to the bucket. That breaks the "no storage request" rule, and `TestClaimConsoleMutationInvariant` failed ("SQL rows changed in [audit]") until I removed the row. A host-claim console refuses every session at C35, so this is the only case affected. The plan sentence says so. **Gaps that follow from the design** - **Not-a-person and stranger 404s:** these write no row. At that point the door hasn't resolved an account the caller belongs to, so there is no account to write the row under. - **Failed WebSocket handshake:** a GET without the subprotocol writes no row. The WebSocket library answers it before the handler runs, and no sentence is sent. - **429 rate refusals:** these now write a row each time, so a member who floods the door adds one database insert per request. The other agent's files (`approved_rootfs_copy_test.go`, the copy deck, the root package and the census overlay) are untouched and not in my commit. Git printed its usual harmless `packed-refs.lock` message after the commit.</result> <usage><subagent_tokens>154849</subagent_tokens><tool_uses>42</tool_uses><duration_ms>1042866</duration_ms></usage> </task-notification>

Attributed to this commit: 31.6 g CO₂e (4,065,258 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on rootfs-apps-6-interactive, never backward from it. A turn that produced more than one commit books all of its tokens to the last one, and a concurrent session on this branch can add to the same figure. Some of it was priced using the shared default rate, because no model-specific factor row exists yet for at least one model involved. The Carbon view has the repo total, which is never derived from this attribution.

diff --git a/approved_rootfs_copy_test.go b/approved_rootfs_copy_test.go
index dc7fc870a..d0d5d2699 100644
--- a/approved_rootfs_copy_test.go
+++ b/approved_rootfs_copy_test.go
@@ -143,7 +143,7 @@ var rootfsCopyIDs = []string{
"RFS-6-C65",
// Plan 6's copy gaps, approved by Paul 2026-10-31
"RFS-6-C66", "RFS-6-C67", "RFS-6-C68", "RFS-6-C69",
- "RFS-6-C70", "RFS-6-C71", "RFS-6-C72", "RFS-6-C73", "RFS-6-C74",
+ "RFS-6-C70", "RFS-6-C71", "RFS-6-C72", "RFS-6-C73", "RFS-6-C74", "RFS-6-C75",
}
// rootfsCopyStruck is every id the deck marks struck, pinned, so a row can
@@ -274,9 +274,9 @@ var rootfsCopyBuilt = []string{
// reason (internal/host/interactive.go)
"RFS-6-C66", "RFS-6-C67", "RFS-6-C68", "RFS-6-C69",
// Plan 6 Task 13's copy gaps (approved 2026-10-31): carlos help's console
- // line (main.go), C21's three reasons and the signal line
- // (interactive_cli.go)
- "RFS-6-C70", "RFS-6-C71", "RFS-6-C72", "RFS-6-C73", "RFS-6-C74",
+ // line (main.go), C21's three reasons, the signal line and the
+ // restore-failure line (interactive_cli.go)
+ "RFS-6-C70", "RFS-6-C71", "RFS-6-C72", "RFS-6-C73", "RFS-6-C74", "RFS-6-C75",
// Plan 6 Task 13: carlos run -it and carlos console (run.go,
// interactive_cli.go, interactive_term_other.go); RFS-6-C27 is Task 10's
"RFS-6-C01", "RFS-6-C02", "RFS-6-C03", "RFS-6-C04", "RFS-6-C05", "RFS-6-C06", "RFS-6-C07", "RFS-6-C08",
diff --git a/docs/superpowers/plans/2026-10-24-rootfs-apps-copy.md b/docs/superpowers/plans/2026-10-24-rootfs-apps-copy.md
index 100d14a96..f0c2a12bf 100644
--- a/docs/superpowers/plans/2026-10-24-rootfs-apps-copy.md
+++ b/docs/superpowers/plans/2026-10-24-rootfs-apps-copy.md
@@ -16,6 +16,8 @@ Added 2026-10-31: RFS-6-C66 to C69, the copy gaps Plan 6 Tasks 4, 9 and 12 left.
Added 2026-10-31: RFS-6-C70 to C74, the copy gaps Plan 6 Task 13 left (Astra's P2 4 and the concerns of its report): the console line of carlos help, three reasons for RFS-6-C21 and the line for a signal after a session started. Paul approved all five unchanged in his copy review on 2026-10-31. The gate's inventory (`rootfsCopyIDs`) and built list (`rootfsCopyBuilt`) gained all five in the same commit.
+Added 2026-10-31: RFS-6-C75, the line for a terminal a session could not restore (Task 13 fix round 1, Astra's re-review). Paul approved it unchanged in his copy review on 2026-10-31. The gate's inventory and built list gained it in the same commit.
+
The rules:
- A row is `pending` until Paul approves it in the copy review. His edits are
@@ -549,6 +551,7 @@ From the plan: Every string is human text the plan introduces. Existing approved
| RFS-6-C72 | interactive_cli.go (sessionExit: RFS-6-C21's reason for an interrupted End with no Detail; added 2026-10-31, approved unchanged by Paul in his copy review 2026-10-31) | the box ended it without saying why | approved |
| RFS-6-C73 | interactive_cli.go (sessionExit: RFS-6-C21's reason for an end code this CLI does not know, the code; added 2026-10-31, approved unchanged by Paul in his copy review 2026-10-31) | the box gave a reason this version of carlos does not know (%s) | approved |
| RFS-6-C74 | interactive_cli.go (session: carlos got SIGTERM, SIGHUP or an outside SIGINT after the session started; the host, then the signal's name; exit 128+n; added 2026-10-31, approved unchanged by Paul in his copy review 2026-10-31) | %s: the session ended because carlos received %s | approved |
+| RFS-6-C75 | interactive_cli.go (restoreFailedMsg: printed to stderr when a session's terminal could not be restored, after the retry; the error; added 2026-10-31, approved unchanged by Paul in his copy review 2026-10-31) | carlos could not put your terminal back to normal: %v. run reset to fix it | approved |
## Conflicts
@@ -585,5 +588,5 @@ the earlier counts had not followed Plans 1 and 4's later rows.
- Plan 3: 33 live, 2 struck, 35 rows
- Plan 4: 144 live, 2 struck, 146 rows
- Plan 5: 44 live, 0 struck, 44 rows
-- Plan 6: 74 live, 0 struck, 74 rows (RFS-6-C47 revised and RFS-6-C65 added and approved on 2026-10-30; RFS-6-C66 to C74 added and approved on 2026-10-31)
-- Total: 406 live, 4 struck, 410 rows
+- Plan 6: 75 live, 0 struck, 75 rows (RFS-6-C47 revised and RFS-6-C65 added and approved on 2026-10-30; RFS-6-C66 to C75 added and approved on 2026-10-31)
+- Total: 407 live, 4 struck, 411 rows
diff --git a/interactive_cli.go b/interactive_cli.go
index 82c830f24..d67092e61 100644
--- a/interactive_cli.go
+++ b/interactive_cli.go
@@ -118,9 +118,9 @@ type sessionInput interface {
// errInputStopped is a sessionInput's Read after Stop.
var errInputStopped = errors.New("carlos: input stopped")
-// restoreFailedMsg is the one diagnostic for a terminal left raw (internal,
-// not reviewed copy).
-const restoreFailedMsg = "carlos: could not restore the terminal: %v"
+// restoreFailedMsg is RFS-6-C75, the one line for a terminal left raw: the
+// error.
+const restoreFailedMsg = "carlos could not put your terminal back to normal: %v. run reset to fix it"
// sessionClient is what runSession runs on: the dial, the terminal, the
// streams and the signals that end a session (SIGINT, SIGTERM, SIGHUP).
diff --git a/interactive_cli_test.go b/interactive_cli_test.go
index 588419c76..14154f658 100644
--- a/interactive_cli_test.go
+++ b/interactive_cli_test.go
@@ -864,7 +864,7 @@ func TestSessionRestoreFailure(t *testing.T) {
}
ev := r.log.all()
calls := r.log.count("restore") + r.log.count("restore failed")
- diag := "err: carlos: could not restore the terminal: EIO\n"
+ diag := "err: carlos could not put your terminal back to normal: EIO. run reset to fix it\n"
last := "err: " + ixCLIHost + ": the session ended after 30 minutes without a keystroke\n"
switch {
case calls != tc.calls:
diff --git a/internal/provision/testdata/plan14-root-reads-rootfs-apps-6.tsv b/internal/provision/testdata/plan14-root-reads-rootfs-apps-6.tsv
index f2eb5ffed..44939c505 100644
--- a/internal/provision/testdata/plan14-root-reads-rootfs-apps-6.tsv
+++ b/internal/provision/testdata/plan14-root-reads-rootfs-apps-6.tsv
@@ -138,7 +138,7 @@ internal/activator/cmdunit.go cmdUnit.Poll legacy accepted-legacy accepted-legac
internal/activator/rootfs_service.go Service.rootfsTick legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Tasks 7 and 8: per activator tick, lists residents (Registry.ResidentInstances through the DueStore), and for each rootfs entry kills generations whose replica reports a lost lease with no watch installed, stops an exited rootfs process (StopExited), and supervises; then drops forgotten residents and reserves proactive starts (residentJob) for resident-shaped, unheld rows within the start ceiling after the locked admission;rev3=census-ruling-rootfs-apps-3-workers;basis=rootfs Plan 3 Group W, W1.10: when the tick kills a lost-lease resident's generations it also starts stopRootfsWorkersAtLoss(e) beside them; superviseRootfsLocked (a no-op in Group A) is now the worker supervision; the same 15 read sites, no read added; stops more, starts nothing new on its own;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 7a: the no-signal fallback also covers a hibernating rootfs entry with a one-shot unit that may run (oneShotHoldsLocked); it latches ownerKilled and runs each one-shot kill func (KillOneShot to root's existing /stop) with go off a.mu, beside a resident's killResidentGens and stopRootfsWorkersAtLoss as before; new site +whole:Route is e.route.Rootfs(); stops more, starts nothing registry:Host@1842,registry:Host@2071,registry:Host@2427,whole:Route@113,whole:Route@1200,whole:Route@1795,whole:Route@1824,whole:Route@1993,whole:Route@2024,whole:Route@2106,whole:Route@2271,whole:Route@2320,whole:Route@2465,whole:Route@397,whole:Route@803,whole:Route@824 de44f5578a049a224f06a302863752c3a4ff53767478a54d08e373db018efe82
@remove internal/instancectl/cmd.go Server.handleCmdStatus
@removed internal/instancectl/cmd.go Server.handleCmdStatus H3 census-ruling-rootfs-apps-6;absent;basis=rootfs Plan 6 Task 6: moved whole to Server.oneShotStatus (role-aware; see its claim), not deleted: no check, refusal or validation is lost
-@coverage . ffb9ecf54351e9e97eae074b119d2af259869b1478e32d2c3fa558fe76ecebba
+@coverage . b57f3c3cc2b7fea1bfd1a9368aa8328dd180793ceb5392ed11caa95bf887c9ab
@coverage internal/activator 72f34fc88388e97bbd0d84d0256f409ca6931af0b6127ebb7895b01a02f2e73d
@coverage internal/appconfig cac8d8ef7538a456d034801c95ce6508a4983e5516b3bbbd302bec0fbafdd479
@coverage internal/host 5fa4abbdabdf0d6816ab3e589fd563fe9291b5921fe529cb2383adf0497937b1