carlos / platform Public

docs: interactive sessions (rootfs plan 6)

Built: RFS-6-C58 to RFS-6-C61.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev cbd939d3443fe99fb8a7d749f8549a7ad3d7800f parent d1ec4db
3 files changed, +28 −4
  • approved_rootfs_copy_test.go +2 −0
  • docs/site/cli.md +22 −0
  • docs/superpowers/plans/2026-10-24-rootfs-apps-copy.md +4 −4

Intent

Human

<task-notification> <task-id>aebb31b964a387a07</task-id> <tool-use-id>toolu_01FfqKuEHuXwam4ANu2VbH14</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/ba9fa944-a429-4788-9b3c-f2b2f42617f3/tasks/aebb31b964a387a07.output</output-file> <status>completed</status> <summary>Agent "Plan 6 Task 13: CLI run -it, console" 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>**Status: DONE_WITH_CONCERNS.** `carlos run -it` / `--interactive` and `carlos console` are built and tested; three commits, not pushed. CI on this tip will be red until Task 14 adds the docs heading (concern 1). **Commits** - b7a67601 interactive: a refusal before the upgrade keeps its status and body. `interactive.Dial` now returns a `*RefusedError` with the status, headers and body (up to 64 KiB). It still matches `websocket.ErrBadStatus`. The CLI prints the console's own sentence and exits 2, from the one dial. - b087cc3f cli: carlos run -it and carlos console. Copy ids RFS-6-C01 to C26, C28 to C31 and C65 are added to `rootfsCopyBuilt`, and the deck's file cells now name the real paths. No unapproved string was needed. - d1ec4dbe census. Overlay rootfs-apps-6 re-proposed: the 60 earlier claims carried over unchanged, plus 8 new units. Seal is now e1618040, and `make census-card` is clean afterwards. The record-write census re-pins `main` and lists `openSession`. No approval requested. **Tests:** each run once. The new tests pass (CLI, typed dial error, and the CLI against a real `console.Server` and the Task 10 door), as do the copy gate, census and existing run, console and host interactive tests. `-race` passes once. All 10 mutations were caught. The darwin/arm64, windows/amd64 and linux/arm64 builds and vet are clean. **Concerns** 1. **CI is red:** `internal/docsite` `TestCLICommandsAreDocumented` fails because `console` has no `### carlos console` heading in `cli.md`. Plan Task 14 expects this and fixes it. 2. `carlos help` doesn't list `console`; no approved row covers that line. 3. After the session starts, SIGTERM, SIGHUP or an outside SIGINT restores the terminal and exits 128+n without a message, because no approved sentence exists for it. 4. The real termios code is covered only by builds and vet. The tests use a fake terminal, so nothing has exercised it on a real terminal yet. 5. Three end reasons (`hangup`, `replaced`, and `interrupted` with no reason) have no approved message of their own: - `replaced` reuses the approved C69 words as C21's reason. - `hangup` and a bare `interrupted` print the reason code, e.g. "…was interrupted: interrupted". In practice the CLI doesn't receive these. 6. A console refusal whose body never finishes still holds the dial until the CLI's 30 s limit, as before. **Could someone open `carlos run -it --app shop --instance shop.bab.dev.oncarlos.com -- sh` on dev once this is released?** Yes, with conditions. The code path from CLI to console to box to terminal is complete. What's still needed: - Land and release the branch, rolling dev boxes before the dev console (Task 14 docs first, since the docs gate blocks CI). - An owner runs `carlos apps set shop --interactive on`. - The dev console must hold the release signing key and not be a host-claim console. - The box must be on the nested layout, without claims armed, with `CARLOS_RELEASE_PUBKEY` set, and able to reach the console. - The instance must be a hibernating exec or rootfs instance (not pooled, not served from its own address). - **`-- sh` only gives a shell if shop is a rootfs app whose image has `sh`.** On a binary app the command runs as the app's own binary with `sh` as its argument, as `carlos run` does today. - Task 15's dev-box checklist hasn't been run, so no real-terminal check has happened yet. The full report is in `/home/paulca/amadan.net/carlos/platform/.claude/worktrees/rootfs-apps-6/.superpowers/sdd/2026-10-24-rootfs-apps-6-interactive/task-13-report.md`.</result> <usage><subagent_tokens>297023</subagent_tokens><tool_uses>117</tool_uses><duration_ms>1974625</duration_ms></usage> </task-notification>

Attributed to this commit: 85.6 g CO₂e (11,101,795 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 e1bb9a84e..f0c147691 100644
--- a/approved_rootfs_copy_test.go
+++ b/approved_rootfs_copy_test.go
@@ -278,6 +278,8 @@ var rootfsCopyBuilt = []string{
"RFS-6-C09", "RFS-6-C10", "RFS-6-C11", "RFS-6-C12", "RFS-6-C13", "RFS-6-C14", "RFS-6-C15", "RFS-6-C16",
"RFS-6-C17", "RFS-6-C18", "RFS-6-C19", "RFS-6-C20", "RFS-6-C21", "RFS-6-C22", "RFS-6-C23", "RFS-6-C24",
"RFS-6-C25", "RFS-6-C26", "RFS-6-C28", "RFS-6-C29", "RFS-6-C30", "RFS-6-C31", "RFS-6-C65",
+ // Plan 6 Task 14: the docs (docs/site/cli.md)
+ "RFS-6-C58", "RFS-6-C59", "RFS-6-C60", "RFS-6-C61",
}
func mustParseRootfsRecord(t *testing.T) []copyRow {
diff --git a/docs/site/cli.md b/docs/site/cli.md
index 0d3413384..4b15b788d 100644
--- a/docs/site/cli.md
+++ b/docs/site/cli.md
@@ -218,6 +218,12 @@ box, after the first one has stayed up for ten seconds; it starts at 1. Any
member of the app can change both, here or on the app's settings page in the
console.
+--interactive on lets any member open a terminal session on the app's instances with carlos run -it or carlos console. A session can read and change everything the instance can, so it is off until an owner turns it on. Any member can turn it off.
+
+```sh
+carlos apps set shop --interactive on
+```
+
`carlos apps set` also controls the update settings an instance may change:
```sh
@@ -705,8 +711,16 @@ A hibernating instance is woken first. A live one keeps serving, and the command
For a rootfs app the command after -- runs inside the instance's image and is found on the image's PATH.
+With -it, the command runs in a terminal session instead: what you type goes to it and its screen comes back, so a REPL or a shell works. The app must allow it first, with carlos apps set <app> --interactive on, which only an owner can do. A session ends when the command exits, after 30 minutes without a keystroke, after 6 hours, or soon after your connection drops. A deploy, a restart or a move of the instance ends it too. Ctrl-C and Ctrl-D go to the command. One session at a time per instance, beside any run. Who opened it, where, when it ended and how are in the audit log. What you type and what it prints are not kept.
+
+```sh
+carlos run -it --app shop --instance shop.example.com -- bin/rails console
+```
+
carlos run exits with the command's own status, 128 plus the signal number when a signal ended it, 124 when it timed out, 125 when it was interrupted or the instance let go of it without a result, 130 when you cancelled it, 3 when the box refused it or did not pick it up within 60 seconds, and 2 when the console refused it.
+A session exits with the command's own status, 124 when it ended for lack of keystrokes or at 6 hours, 125 when it was interrupted or its box's connection dropped, 130 when you cancelled it before it started, 3 when the box refused it or none opened it within 60 seconds, 2 when the console refused it, and 1 when carlos lost its connection to the console.
+
carlos logs shows when each run started, who asked for it and how it ended. The command's output is not kept there. A service's run reads "started by service ci", with the person it named, if any, marked as the service's statement.
If you cannot tell whether a run started (the connection dropped as you sent it), start it with `--idempotency-key <key>`. The key is a string you choose: 1 to 128 characters of letters, digits, dots, underscores, colons and hyphens. Run the same command again with the same key and the same files, and carlos says `already started: run <id>` and follows that run, instead of starting a second. Each `--file` is hashed first, because a key only matches a request that is the same in every byte. The same key with a different command, timeout or file is refused with `idempotency_key_reused`. A key is yours alone: no other person or service can see it or collide with it. It is honoured for 24 hours, or until you have made 32 newer keyed admissions on that instance, whichever comes first. After that the same key starts a new run. If the run has since finished and its output was read, or has been cleared away, carlos says `run <id> was already started with this key, and its output is no longer kept` and exits 2: the run happened, but there is nothing left to follow.
@@ -779,6 +793,14 @@ Keyed creates are off until the operator of the console turns them on, with `CAR
Deleting an instance deletes its keys with it. A retry that arrives after the host was deleted and created again starts a fresh run on the new instance.
+### carlos console
+
+Opens the console process your app's manifest declares, in a terminal session, as carlos run -it would. carlos ship fills one in for Rails, Laravel and Django apps when the manifest has none. An app without one is refused, and the message says how to name a command instead.
+
+```sh
+carlos console --app shop --instance shop.example.com
+```
+
### carlos schedule
Gives an app a timetable. A schedule is a time and a path: at each fire the
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 c823ecce7..882dd657b 100644
--- a/docs/superpowers/plans/2026-10-24-rootfs-apps-copy.md
+++ b/docs/superpowers/plans/2026-10-24-rootfs-apps-copy.md
@@ -530,10 +530,10 @@ From the plan: Every string is human text the plan introduces. Existing approved
| RFS-6-C55 | internal/host/interactive.go (`carlos logs`, sessionEndedLine, built by Plan 6 Task 12) | interactive session %s did not start: %s | approved |
| RFS-6-C56 | internal/host/interactive.go (`carlos logs` refusal, sessionRefusedWords, built by Plan 6 Task 12) | interactive sessions are off for this app | approved |
| RFS-6-C57 | internal/host/interactive.go (`carlos logs` refusal, sessionRefusedWords, built by Plan 6 Task 12) | the box was still closing the last session | approved |
-| RFS-6-C58 | `cli.md`, `### carlos run` | With -it, the command runs in a terminal session instead: what you type goes to it and its screen comes back, so a REPL or a shell works. The app must allow it first, with carlos apps set <app> --interactive on, which only an owner can do. A session ends when the command exits, after 30 minutes without a keystroke, after 6 hours, or soon after your connection drops. A deploy, a restart or a move of the instance ends it too. Ctrl-C and Ctrl-D go to the command. One session at a time per instance, beside any run. Who opened it, where, when it ended and how are in the audit log. What you type and what it prints are not kept. | approved |
-| RFS-6-C59 | `cli.md`, `### carlos console` | Opens the console process your app's manifest declares, in a terminal session, as carlos run -it would. carlos ship fills one in for Rails, Laravel and Django apps when the manifest has none. An app without one is refused, and the message says how to name a command instead. | approved |
-| RFS-6-C60 | `cli.md`, `carlos apps set` | --interactive on lets any member open a terminal session on the app's instances with carlos run -it or carlos console. A session can read and change everything the instance can, so it is off until an owner turns it on. Any member can turn it off. | approved |
-| RFS-6-C61 | `cli.md`, exit codes | A session exits with the command's own status, 124 when it ended for lack of keystrokes or at 6 hours, 125 when it was interrupted or its box's connection dropped, 130 when you cancelled it before it started, 3 when the box refused it or none opened it within 60 seconds, 2 when the console refused it, and 1 when carlos lost its connection to the console. | approved |
+| RFS-6-C58 | docs/site/cli.md (carlos run, a paragraph; was `cli.md`, `### carlos run`; built by Plan 6 Task 14) | With -it, the command runs in a terminal session instead: what you type goes to it and its screen comes back, so a REPL or a shell works. The app must allow it first, with carlos apps set <app> --interactive on, which only an owner can do. A session ends when the command exits, after 30 minutes without a keystroke, after 6 hours, or soon after your connection drops. A deploy, a restart or a move of the instance ends it too. Ctrl-C and Ctrl-D go to the command. One session at a time per instance, beside any run. Who opened it, where, when it ended and how are in the audit log. What you type and what it prints are not kept. | approved |
+| RFS-6-C59 | docs/site/cli.md (carlos console, a section; was `cli.md`, `### carlos console`; built by Plan 6 Task 14) | Opens the console process your app's manifest declares, in a terminal session, as carlos run -it would. carlos ship fills one in for Rails, Laravel and Django apps when the manifest has none. An app without one is refused, and the message says how to name a command instead. | approved |
+| RFS-6-C60 | docs/site/cli.md (carlos apps set, a paragraph; was `cli.md`, `carlos apps set`; built by Plan 6 Task 14) | --interactive on lets any member open a terminal session on the app's instances with carlos run -it or carlos console. A session can read and change everything the instance can, so it is off until an owner turns it on. Any member can turn it off. | approved |
+| RFS-6-C61 | docs/site/cli.md (carlos run, exit codes, a paragraph; was `cli.md`, exit codes; built by Plan 6 Task 14) | A session exits with the command's own status, 124 when it ended for lack of keystrokes or at 6 hours, 125 when it was interrupted or its box's connection dropped, 130 when you cancelled it before it started, 3 when the box refused it or none opened it within 60 seconds, 2 when the console refused it, and 1 when carlos lost its connection to the console. | approved |
| RFS-6-C62 | `cli.md`, `### carlos run`, replaces RFS-3-C28 | On a customer fleet, the instance's box reaches the console for the run itself, so carlos run works there as it does on any other box. | approved |
| RFS-6-C63 | `carlos logs` (box, a run grant that did not verify) | run %s was not started on this box: its grant could not be verified | approved |
| RFS-6-C64 | `carlos logs` (box, the relay dropped mid-run) | run %s lost its connection to the console, so it was stopped | approved |