oficina / equipo Public

spec rev 3: fold in Astra round 2 (8 findings)

Instance-validated person acceptance, batches as steps with durable
phases, inspected tree vs tooling for inventory, completeness, per-call
note budgets, template-aware checks, recorded maker, contract v2 rollout.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 60709b7a204e1464c653de239d0ec335a251b640 parent ac48dc6
1 file changed, +167 −30
  • docs/superpowers/specs/2026-11-30-copy-trainer-and-in-place-review.md +167 −30
diff --git a/docs/superpowers/specs/2026-11-30-copy-trainer-and-in-place-review.md b/docs/superpowers/specs/2026-11-30-copy-trainer-and-in-place-review.md
index f53da111..c80fa77d 100644
--- a/docs/superpowers/specs/2026-11-30-copy-trainer-and-in-place-review.md
+++ b/docs/superpowers/specs/2026-11-30-copy-trainer-and-in-place-review.md
@@ -1,9 +1,12 @@
# Copy training and in-place review
-Status: revision 2, 2026-11-30, drafted by Claude (Opus 5.5) on
+Status: revision 3, 2026-12-01, drafted by Claude (Opus 5.5) on
`copy-trainer-spec` from main ea3022bd. Nothing is built.
-- Astra round 1: NOT READY, with 15 findings (7 P1). All were taken; the
- list is in section F.
+- Astra round 1: NOT READY, with 15 findings (7 P1).
+- Astra round 2: NOT READY, with 8 findings (3 P1). All of them were gaps
+ in the round 1 fixes.
+
+Every finding was taken; the list is in section F.
Mockups: section 9.
@@ -184,14 +187,22 @@ an optional command.
- Output: `{"version":1,"strings":[{"key","path","start","end","text","placeholders","context","kind"}]}`.
`kind` is one of button, heading, body, error, empty, label, help,
string.
-- Limits: at most 5,000 strings and 2 MiB of output. Strings over the
- limit are dropped, and the output says how many.
+- Limits: at most 5,000 strings and 2 MiB of output. If anything had to
+ be dropped, the output sets `"complete": false` and says how many.
- Keys must be unique.
-It runs with the containment, bounds and timeout of `extract`. The
-contract and its scripts come from the commit being listed, and that is
-always the default branch's tip: a reviewed and merged revision. For
-Equipo, `copy-contract.py inventory` reuses `entries()`. It sets `kind`
+It runs with the containment, bounds and timeout of `extract`.
+
+**Inspected tree versus tooling.** These are two separate things, and every
+inventory result carries both identities (the tree's commit, and the digest
+of the contract and scripts).
+- **Training** inspects the tip of the default branch, with the tooling at
+ that same tip: a reviewed, merged revision.
+- **In-place review (B3)** inspects the task's exact candidate. The tooling
+ comes from the task's trusted base, pinned as `extract` is today.
+ Candidate code never runs as adapter code.
+
+For Equipo, `copy-contract.py inventory` reuses `entries()`. It sets `kind`
from the key's prefix, and `context` from the comment after the copy.go
marker.
@@ -316,10 +327,30 @@ each, newest first. Each class has its own cap:
- **Choices**: 20 notes, 2 KiB, shown as "chose A over B and C (axis)".
- **Typed rules** from Add a note: 10 notes, 1 KiB.
-That comes to 10.5 KiB, under the 12 KiB notebook ceiling. The plan
-re-measures Copy's baseline fixture with a full notebook against the
-32,768-token pass limit. If it doesn't fit, the oldest choices are dropped
-first, then edited suggestions.
+That comes to 10.5 KiB, under the 12 KiB notebook ceiling.
+
+**How much each call carries.** Each kind of call has its own notebook
+allowance, and each is preflighted with Copy's existing conservative
+estimator:
+- one token per byte;
+- 4,096 tokens for provider framing;
+- room for the reply.
+
+| Call | Token limit | Notebook allowance |
+|---|---|---|
+| Copy pass | 32,768 (as today) | 10.5 KiB |
+| Drill prep (A3) | 16,384 | 6 KiB: words 3, edited 1, choices 1, rules 1 |
+| Ask Copy (B4) | 16,384 | 6 KiB, split the same way |
+
+**Trimming.** When a request doesn't fit, notes are dropped oldest first,
+in this order: choices, then edited suggestions, then words. Source labels
+stay on every note that's kept. Three things are never trimmed: the house
+rules, the person's typed rules, and the current instruction.
+
+**When the minimum doesn't fit.** If the house rules, the typed rules, the
+instruction and the string still exceed the limit, the call is refused
+before anything is sent, with `too_large`. The plan re-measures the Copy
+pass fixture with a full notebook.
**Precedence, stated in the prompt:**
1. the house rules at the trusted base;
@@ -388,6 +419,28 @@ first) adds the drill prep job and the `inventory` operation.
delegation revision and the notebook revision.
- The instance refuses a result whose bindings have moved.
+**Contract v2 and older peers.** Today's parser rejects every contract
+version except 1, so a v2 `.equipo/copy.json` affects every Copy
+operation, not only the new ones.
+- **Waiting.** Any Copy step, drill job or review copy whose trusted-base
+ contract is v2 goes only to a runner at the new protocol. Otherwise it
+ waits with `copy_runner_old`, as Design waits with `design_runner_old`.
+ It never fails, and it never falls back to v1.
+- **Upgrade order:**
+ 1. the instance;
+ 2. every runner on the project;
+ 3. then the reviewed change that moves the project's contract to v2,
+ merged as any change is.
+
+ Equipo's own contract moves only after all its runners are upgraded.
+- **Downgrade:**
+ 1. revert the contract to v1 on the default branch;
+ 2. settle tasks that hold person acceptances, which become pending again
+ and go to Copy or an owner;
+ 3. then downgrade the runners and the instance.
+
+ Tables and columns are kept.
+
**Migrations, all additive:**
- `copy_training`: person, offers on, revision, paused until;
- `copy_drill_sessions`: id, person, project, commit, delegation revision,
@@ -547,7 +600,11 @@ edit will change, and every edit is checked after it lands.
key as **Exact** only when both of these hold:
- the element's text equals that key's value (placeholders filled in);
- no other inventory key, or other byte range in the static file, has text
- that could produce it.
+ that could produce it;
+- the inventory is complete (`"complete": true`).
+
+An incomplete inventory can't prove that a string is unique, so its
+matches are only ever offered as a list to pick from.
When several keys could produce the text, the editor lists them all with
their context, and the person picks one, even if the page marked one of
@@ -565,9 +622,22 @@ Apply refuses an edit if any of these has moved.
changing it changes all of them. The editor says so (copy-review's lesson).
**Checked after it lands.** After every apply, the runner renders the page
-again (B5) and checks that each edited element now shows exactly the
-person's text. If one doesn't, the tray says "Changed a string with the
-same words, but this text didn't change", and offers **Undo that one**.
+again (B5) and checks each edited element. How it checks depends on the
+string:
+- **Static file text, or a string with no placeholders:** the element must
+ show exactly the person's text.
+- **A string with placeholders:** the element must match the new template,
+ with each placeholder as a wildcard. Where marks are on, the element's
+ mark must still name the same key.
+
+The tray reports one of three outcomes:
+- **Applied:** the check passed.
+- **Didn't change:** the element still shows the old text. The tray says
+ "Changed a string with the same words, but this text didn't change",
+ and offers **Undo that one**.
+- **Couldn't confirm:** the element is gone from the page, or a template
+ match isn't backed by a mark. The edit stays, and the person can check
+ it on Live.
**No mapping in B1.** Text with no mapping (built in a template, from an
app without a contract, or from the app's data) gets no outline in B1.
@@ -583,16 +653,44 @@ be edited in v1. The editor offers Comment instead.
**One batch, one operation.** Apply sends the tray's edits, at most 50, as
one batch. Send sends its comments, at most 20, as another. A batch has an
-id the client makes, and that id is its idempotency key, so a retry with
-the same id does nothing new. The batch is admitted in one transaction,
-which checks seven things:
+id the client makes, and that id is its idempotency key: a request that
+repeats an id gets the existing batch back.
+
+**A batch is a step.** Each batch runs as one ordinary step on the task:
+- an **apply** step (runner only, no model) for edits;
+- a maker or Copy step for comments.
+
+So it uses the machinery every step already has:
+- the task's one-step-at-a-time progression, which every other action
+ already respects (each of them needs the latest step to be finished);
+- the binding to step and attempt;
+- the existing `AuthorizePublication` for that step and attempt;
+- the brokered push against the expected branch head that Copy already
+ uses.
+
+**A batch's phases** are recorded durably on the batch row:
+1. **admitted**, with the task's revision and its input candidate;
+2. **dispatched**, with the step and the attempt;
+3. **published**, with the output commit. The commit carries the trailer
+ `Equipo-Batch: <id>`;
+4. **settled** or **failed**.
+
+**A lost acknowledgement.** If the push succeeded but its acknowledgement
+was lost, the next attempt of the same step looks for a commit with that
+trailer on the branch head, and reports it instead of pushing again.
+
+**Retry** means another attempt of the same step, under the existing retry
+rules. A published batch has nothing to retry.
+
+**Admission** happens in one transaction, which checks seven things:
- the actor (from the session) is the task's creator;
- the roster is current;
- the task isn't merging, final or cancel-requested;
- the latest step has finished, so no maker is running. If one is, Apply
is refused with "Design is working. Apply when it's done", and the tray
is kept;
-- no other batch is open on the task;
+- no other batch is open on the task. Because a batch is a step, the
+ task's normal progression enforces this too;
- the tray's generation matches, which covers a second device;
- each edit's bindings (B3) match the current candidate.
@@ -606,8 +704,8 @@ the task's branch:
chips that can't be reordered, and the instance refuses any change of
order, as `ValidateReview` does.
-The commit becomes the task's new candidate, and `AuthorizePublication`
-checks the expected branch head before the push. If validation fails,
+The commit becomes the task's new candidate, through the apply step's
+publication (above). If validation fails,
nothing is published, and every edit goes back to the tray with its
reason. Fresh Checks and Review follow, as for any candidate. A task that
was ready to merge goes back to review, and the switch says so before
@@ -630,9 +728,26 @@ accepted as theirs, whether or not Copy is delegated:
- **The marker.** The script writes
`COPY ACCEPTED BY <name> (in place, <date>, <record>)` only when the hash
of the applied text equals the record's hash.
-- **Release.** `copy-status.py verify` and `make copy-release-check` accept
- that marker as a human acceptance, after checking the text hash, as they
- do for historical human acceptances.
+- **The authority is the instance, not the marker.** A candidate can write
+ any marker it likes, so the instance never trusts one. It validates
+ person markers in the same place it validates Copy's markers today,
+ `copydesk.Accepted` and `copyReady`, which gain a person-record case.
+ A person marker counts only when all of these hold:
+ - a `copy_person_acceptances` record matches its key and its text hash;
+ - the record's batch is published;
+ - the record's output commit is in the candidate's history;
+ - that key's text hasn't changed since the output commit.
+
+ Any later edit to the key, or a rebase that changes its text, makes it
+ pending again. This is the same rule as for Copy's records ("rebase and
+ later edits invalidate affected acceptance"). Records only become active
+ once their batch is published.
+- **Release.** In the repository, `copy-status.py verify` and `make
+ copy-release-check` check bookkeeping only: the marker's form and the
+ text hash. They accept the person marker as a human acceptance, as they
+ do for historical ones. Whether the text was really accepted is decided
+ by the instance's check before Checks and at the merge gate, as it is for
+ Copy today.
- **Fail closed.** A contract without `accept_person`, or a runner below
the protocol, gets no person acceptance. The text stays pending for Copy
or an owner, and the tray says "Applied. Still needs copy review".
@@ -658,15 +773,18 @@ is accepted as above, whoever wrote its first draft.
Ask Copy's limits:
- It runs on the person's connections, under Copy's model ceiling.
-- Per call: 8,192 tokens and 60 seconds.
+- Per call: 16,384 tokens and 60 seconds, preflighted as A6 describes.
- Per person: one call in flight, 30 an hour, 100 a day.
- Retries are idempotent on the tap's id, and usage is recorded as Copy.
**Comments** (slice B2) are the person's words, sent on their tap. The
person addresses each comment with one of two chips:
-- **Look** goes to the task's maker: Design when it is active for the
- project, otherwise Engineering. All the Look comments in a batch become
- one maker round. It counts against the maker's run limit and fix rounds
+- **Look** goes to the maker recorded on the task (its `specialist_id`, or
+ Engineering), with the usual grant checks. Adding Design to a project
+ never changes an existing task's maker. If the recorded maker's grant
+ has been revoked, the existing replacement flow applies: the task waits,
+ and the coordinator offers Engineering. All the Look comments in a batch
+ become one maker round. It counts against the maker's run limit and fix rounds
as Try again does. The person's Send is the person acting, as in 8.4.
- **Wording** is offered only when the element maps to a key (B3), the
project is delegated, and the actor is the delegating owner. It goes to
@@ -934,6 +1052,25 @@ version has settled.
- **Forget tombstones** (A7).
- **Failures, retention, quotas** (A3, B5).
+**Astra round 2** (NOT READY, 8 findings). All were taken:
+- **Person acceptance** is validated by the instance, through
+ `copydesk.Accepted` and `copyReady`, against published records, with
+ invalidation. The release check covers bookkeeping only (B4).
+- **A batch is a step.** It has durable phases, a commit trailer to
+ reconcile a lost acknowledgement, and reuses the existing publication
+ path (B4).
+- **Inventory.** The inspected tree and the tooling revision are
+ separate: candidate trees use base-pinned tooling (A3).
+- **Completeness.** An incomplete inventory never proves a string is
+ unique (B3).
+- **Budgets per call.** Each kind of call has its own notebook allowance,
+ preflight and trimming order, and a defined refusal (A6).
+- **Template-aware checks after apply**, with three outcomes (B3).
+- **Look** goes to the task's recorded maker, through the replacement flow
+ when needed (B4).
+- **Contract v2.** Waiting, upgrade order and downgrade for every Copy
+ operation (A8).
+
## 9. Mockups
At 390 and 1280 wide, light and dark, built from Equipo's own `tokens.css`,