devbox mode copy deck (#474): DBX-C1..C49 draft, pending Paul's review, and its gate
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 files changed,
+185
−0
approved_devbox_copy_test.go+70 −0docs/superpowers/plans/2026-10-30-devbox-mode-copy.md+115 −0
Intent
Human
subagents
Attributed to this commit: 5.64 g CO₂e (689,655 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on design-devbox-mode, 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_devbox_copy_test.go b/approved_devbox_copy_test.go| new file mode 100644 |
| index 000000000..a8732d8c2 |
| --- /dev/null |
| +++ b/approved_devbox_copy_test.go |
| @@ -0,0 +1,70 @@ |
| +// approved_devbox_copy_test.go |
| +package main |
| + |
| +import ( |
| + "os" |
| + "regexp" |
| + "strconv" |
| + "testing" |
| +) |
| + |
| +// The copy gate of devbox mode (devbox plan Task 1). The deck is a markdown |
| +// table in the moves record's format, read with the moves gate's parser and |
| +// checked with its helpers, so "applied" means the same thing in every gate: |
| +// |
| +// - TestDevboxCopyRecordIsComplete: the deck names exactly DBX-C1 to |
| +// DBX-C49; |
| +// - TestDevboxBuiltCopyIsApproved: an id in devboxCopyBuilt is an approved |
| +// row (a string reaches code only after Paul has approved it); |
| +// - TestDevboxBuiltCopyIsApplied: a built row's text is in the file it |
| +// names; |
| +// - TestDevboxCopyHasNoEmDash. |
| +const devboxCopyRecordPath = "docs/superpowers/plans/2026-10-30-devbox-mode-copy.md" |
| + |
| +var devboxCopyIDPattern = regexp.MustCompile(`^DBX-C[1-9][0-9]*$`) |
| + |
| +// devboxCopyIDs is the deck's inventory: DBX-C1 to DBX-C49, pinned. |
| +var devboxCopyIDs = func() []string { |
| + ids := make([]string, 0, 49) |
| + for i := 1; i <= 49; i++ { |
| + ids = append(ids, "DBX-C"+strconv.Itoa(i)) |
| + } |
| + return ids |
| +}() |
| + |
| +// devboxCopyBuilt is every deck id whose text the code or docs now carry. |
| +// The task that writes a row's text adds its id here in the same commit. |
| +var devboxCopyBuilt = []string{} |
| + |
| +func mustParseDevboxRecord(t *testing.T) []copyRow { |
| + t.Helper() |
| + raw, err := os.ReadFile(devboxCopyRecordPath) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + rows, err := parseCopyTable(string(raw), devboxCopyRecordPath, devboxCopyIDPattern, "a DBX-C<n>") |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + if len(rows) == 0 { |
| + t.Fatalf("%s has no rows", devboxCopyRecordPath) |
| + } |
| + return rows |
| +} |
| + |
| +func TestDevboxCopyRecordIsComplete(t *testing.T) { |
| + reportAll(t, checkMovesInventory(mustParseDevboxRecord(t), devboxCopyIDs)) |
| +} |
| + |
| +func TestDevboxCopyHasNoEmDash(t *testing.T) { |
| + reportAll(t, checkMovesNoEmDash(mustParseDevboxRecord(t))) |
| +} |
| + |
| +// A built id names a row, once, and the row is approved. |
| +func TestDevboxBuiltCopyIsApproved(t *testing.T) { |
| + reportAll(t, checkRunBuilt(mustParseDevboxRecord(t), devboxCopyBuilt)) |
| +} |
| + |
| +func TestDevboxBuiltCopyIsApplied(t *testing.T) { |
| + reportAll(t, checkRunApplied(builtRows(mustParseDevboxRecord(t), devboxCopyBuilt), ".")) |
| +} |
diff --git a/docs/superpowers/plans/2026-10-30-devbox-mode-copy.md b/docs/superpowers/plans/2026-10-30-devbox-mode-copy.md| new file mode 100644 |
| index 000000000..31ae6286b |
| --- /dev/null |
| +++ b/docs/superpowers/plans/2026-10-30-devbox-mode-copy.md |
| @@ -0,0 +1,115 @@ |
| +# Devbox mode: copy deck (draft, 2026-10-30) |
| + |
| +Every user-facing string the devbox mode series writes: the `carlos devbox` |
| +usage and help, its output, every refusal the CLI renders, and the runbook |
| +prose in `infra/devbox/README.md`. The gate is `approved_devbox_copy_test.go` |
| +at the repo root (Task 1). It reuses the moves gate's parser, so the format is |
| +the same: one table per heading, columns id, file, text, status. |
| + |
| +The rules: |
| + |
| +- A row is `pending` until Paul approves it in the copy review (the |
| + `copy-review` skill). His edits are applied to the text here verbatim and |
| + the row becomes `approved`. |
| +- No task writes a row's text into code or docs while the row is pending. |
| + The task that writes it adds the id to `devboxCopyBuilt` in |
| + `approved_devbox_copy_test.go` in the same commit; from then on the gate |
| + fails unless the row is `approved` and its text is in the file it names. |
| +- In a Go file the text is one string literal, or one `fmt.Sprintf`, |
| + `fmt.Errorf` or `errors.New` format, equal to the row with `%s` or `%d` |
| + where the row has a `<placeholder>`. Never a trailing newline inside the |
| + literal: print with `Fprintln`. The one exception is a row whose file cell |
| + says "a fragment": its text is a piece of a larger literal (the top-level |
| + usage text), and the gate looks for it inside one. |
| +- No em dashes. A full stop and a new sentence instead. CLI sentences are |
| + lower case after the first word. |
| + |
| +The registrar (the devbox service) answers with a machine code and data |
| +only, never prose. Every word a person reads is rendered by the CLI from this |
| +deck, so each refusal below is the CLI's rendering of one registrar code. |
| + |
| +Placeholders: `<url>` a link's full address, such as |
| +`https://shop.devbox.example.com`; `<name>` a link's name, one DNS label; |
| +`<owner>` the username of the account that owns a link; `<port>` a port |
| +number; `<path>` a local folder path as the person typed it; `<file>` a file |
| +inside the folder, relative to it; `<branch>` the current git branch; |
| +`<socket>` the registrar socket's path; `<age>` a link's age, a count and one |
| +letter (`5m`, `3h`, `2d`); `<command>` the word the person typed after |
| +`carlos devbox`. |
| + |
| +The `list` table is columns separated by padding: name, owner, kind, target, |
| +age, state. A live link's target is `127.0.0.1:<port>` and a folder link's |
| +target is the folder's name as it was shared. |
| + |
| +## Usage and help |
| + |
| +| id | file | text | status | |
| +|---|---|---|---| |
| +| DBX-C1 | main.go (a fragment of the usage text) | publish a dev server or a folder as a link on this devbox | pending | |
| +| DBX-C2 | devbox_cli.go | usage: carlos devbox share [--port <port> or --dir <path>] [<name>] | pending | |
| +| DBX-C3 | devbox_cli.go | usage: carlos devbox unshare [<name>] | pending | |
| +| DBX-C4 | devbox_cli.go | usage: carlos devbox list | pending | |
| +| DBX-C5 | devbox_cli.go | unknown devbox command <command>. use share, unshare or list | pending | |
| +| DBX-C6 | devbox_cli.go | share publishes https://<name>.<devbox domain> to people on the tailnet. without a name it uses your git branch | pending | |
| +| DBX-C7 | devbox_cli.go | the port your dev server listens on, on 127.0.0.1. the link follows it live | pending | |
| +| DBX-C8 | devbox_cli.go | a folder of static files to publish. the link serves a copy, and sharing again replaces it | pending | |
| +| DBX-C9 | devbox_cli.go | unshare removes a link you published. without a name it uses your git branch | pending | |
| +| DBX-C10 | devbox_cli.go | list shows every link on this devbox, who owns it and whether it is answering | pending | |
| + |
| +## Output |
| + |
| +| id | file | text | status | |
| +|---|---|---|---| |
| +| DBX-C11 | devbox_cli.go | <url> | pending | |
| +| DBX-C12 | devbox_cli.go | removed <url> | pending | |
| +| DBX-C13 | devbox_cli.go | name owner kind target age state | pending | |
| +| DBX-C14 | devbox_cli.go | no links yet. publish one with: carlos devbox share --port <port> <name> | pending | |
| +| DBX-C15 | devbox_cli.go | live | pending | |
| +| DBX-C16 | devbox_cli.go | folder | pending | |
| +| DBX-C17 | devbox_cli.go | answering | pending | |
| +| DBX-C18 | devbox_cli.go | not answering | pending | |
| +| DBX-C19 | devbox_cli.go | serving | pending | |
| +| DBX-C20 | devbox_cli.go | account removed | pending | |
| + |
| +## Refusals |
| + |
| +| id | file | text | status | |
| +|---|---|---|---| |
| +| DBX-C21 | devbox_cli.go | <name> is taken by <owner>. pick another name | pending | |
| +| DBX-C22 | devbox_cli.go | <name> is not a name a link can have. use 1 to 63 lower case letters, digits or hyphens, with no hyphen at the start or end | pending | |
| +| DBX-C23 | devbox_cli.go | the branch <branch> has no letters or digits to make a name from. give a name: carlos devbox share <name> | pending | |
| +| DBX-C24 | devbox_cli.go | no name given, and there is no git branch to take one from. give a name: carlos devbox share <name> | pending | |
| +| DBX-C25 | devbox_cli.go | <port> is not a port. use a number from 1 to 65535. the link points at 127.0.0.1 on this machine | pending | |
| +| DBX-C26 | devbox_cli.go | give either --port for a dev server or --dir for a folder, not both and not neither | pending | |
| +| DBX-C27 | devbox_cli.go | <path> is not a folder | pending | |
| +| DBX-C28 | devbox_cli.go | <path> is over 200 MiB once packed. share a smaller folder | pending | |
| +| DBX-C29 | devbox_cli.go | <file> is a symbolic link or a special file. only plain files and folders can be shared. remove it and try again | pending | |
| +| DBX-C30 | devbox_cli.go | the devbox has no room for another folder. remove one you no longer need with carlos devbox unshare, or tell whoever runs this devbox | pending | |
| +| DBX-C31 | devbox_cli.go | not your link. ask its owner, <owner>, to remove it | pending | |
| +| DBX-C32 | devbox_cli.go | no link called <name>. see what exists with: carlos devbox list | pending | |
| +| DBX-C33 | devbox_cli.go | could not reach the devbox service at <socket>. check that it is running, or tell whoever runs this devbox | pending | |
| +| DBX-C34 | devbox_cli.go | if you are inside an agent sandbox, that is the likely cause: the sandbox blocks the socket. run this command outside the sandbox | pending | |
| +| DBX-C35 | devbox_cli.go | the devbox service answered with something this carlos does not understand. update carlos and try again | pending | |
| + |
| +## Runbook: infra/devbox/README.md |
| + |
| +Headings, the purpose paragraph, one sentence for each one-time root step and |
| +each smoke-check item. Commands, paths and the environment file's contents |
| +sit in code blocks under these sentences and are not copy. |
| + |
| +| id | file | text | status | |
| +|---|---|---|---| |
| +| DBX-C36 | infra/devbox/README.md | # Devbox mode: one-time install | pending | |
| +| DBX-C37 | infra/devbox/README.md | Devbox mode lets anyone with an account on this machine publish a link such as https://shop.devbox.example.com. The link is open to the tailnet only, and it points at their own dev server or at a folder of static files. Someone with root does the steps below once. After that nobody needs root or sudo, and nothing runs as root. | pending | |
| +| DBX-C38 | infra/devbox/README.md | ## Install, once, as root | pending | |
| +| DBX-C39 | infra/devbox/README.md | Create the service user. It is a system account with no login, and nobody else can read its files. | pending | |
| +| DBX-C40 | infra/devbox/README.md | Install the carlos binary and the unit file. The unit runs as that user and may bind port 443 and nothing else. | pending | |
| +| DBX-C41 | infra/devbox/README.md | Write the environment file, readable only by the service user. It holds the devbox's tailnet address and domain, and the AWS key for the certificate challenge record. | pending | |
| +| DBX-C42 | infra/devbox/README.md | Create the IAM policy from route53-acme-policy.json, attach it to the key, and enable the unit. | pending | |
| +| DBX-C43 | infra/devbox/README.md | ## DNS | pending | |
| +| DBX-C44 | infra/devbox/README.md | Add one A record, by hand, once: *.devbox.example.com pointing at this machine's tailnet IPv4 address. | pending | |
| +| DBX-C45 | infra/devbox/README.md | ## Check that it works | pending | |
| +| DBX-C46 | infra/devbox/README.md | As an ordinary user, then again as an agent account, run a dev server on 127.0.0.1, publish it, open the link from another device on the tailnet, and see an edit appear through live reload. | pending | |
| +| DBX-C47 | infra/devbox/README.md | Publish a folder and see it with its _headers file applied. | pending | |
| +| DBX-C48 | infra/devbox/README.md | Try to repoint or remove the other account's link. Both must be refused, and carlos devbox list must show both links with their owners. | pending | |
| +| DBX-C49 | infra/devbox/README.md | Check that no certificate order was placed for any name the wildcard does not cover, and that nothing listens on any address except the tailnet one. | pending | |