| 1 | # Equipo: exploration tasks |
| 2 | |
| 3 | Status: 2026-11-12, revision 2.1, built. Revision 1 (33afeb9) drew NOT |
| 4 | READY from Astra round 1 (§11); the coordinator approved the cuts in §10. |
| 5 | Revision 2 drew READY AFTER FIXES from round 2, all eight findings |
| 6 | mechanical; they are folded in (§12). Drafted by |
| 7 | Claude (Opus 5.5) on `exploration-tasks` from main 7140df3. Builds on |
| 8 | thin v1, merge authority, release preview (protocol 9) and needs-you |
| 9 | triage. |
| 10 | |
| 11 | ## 0. Why |
| 12 | |
| 13 | Paul, on the barber mockups task: "Why is it trying to merge mockups |
| 14 | anyway?" Equipo has one kind of task, a change that ends in a merge. |
| 15 | Mockups, prototypes, design options and spikes are exploration: they end |
| 16 | at a preview and Paul's choice, never a merge. |
| 17 | |
| 18 | Staging's `tk5fen4uajpn` (paulca/threatmin, "Create two clickable barber |
| 19 | app mockups") is Ready to merge: checks passed, Review approved with a |
| 20 | preview config, its preview failed `preview_failed` (no credential) and |
| 21 | its merge failed `merge_failed`. Not merged. |
| 22 | |
| 23 | ## 1. The kind |
| 24 | |
| 25 | - `chat_tasks.kind`: `change` ("" reads as change; today's behaviour) or |
| 26 | `explore`. Each step records the kind it was dispatched under |
| 27 | (`chat_steps.kind`). |
| 28 | - **The coordinator sets it** on `record_task` (`kind`, optional, |
| 29 | default `change`). Its house rule: mockups, prototypes, design options |
| 30 | and spikes are `explore`; anything meant to ship is `change`. |
| 31 | - **Paul switches it** on the task page (`POST /api/v1/tasks/{id}/kind |
| 32 | {kind, revision}` and the page form). Only the creator, an owner, at |
| 33 | the task's current revision, and only **at rest**: the task is not |
| 34 | ended, cancel-requested or merging, no step of it is queued or running |
| 35 | (previews included), and no merge step is unfinished. One transaction: |
| 36 | - to `explore`: open merge cards withdrawn; `merge_asked`, `ready_sha` |
| 37 | and `merge_eligible` cleared; Ready to merge goes back to In review; |
| 38 | - to `change`: open direction cards withdrawn; |
| 39 | - either way `direction_asked` is cleared, a thread note says what |
| 40 | changed, and `advance` runs. |
| 41 | - **Judgements count only for their kind.** `progressFor` takes a Review |
| 42 | verdict only from a Review dispatched under the task's kind, or under |
| 43 | `change` (a change Review is at least as strict). So a task switched to |
| 44 | `change` gets checks and a change Review on its candidate before the |
| 45 | gate ever decides; switched to `explore`, an earlier change approval |
| 46 | stands. |
| 47 | |
| 48 | ## 2. The explore flow |
| 49 | |
| 50 | `advanceTask` routes an exploration to `advanceExplore` **first**, before |
| 51 | the merge handling, so merge steps (the barber task's failed one |
| 52 | included) never steer it, and nothing of it reaches Ready to merge. |
| 53 | |
| 54 | 1. **Engineering** builds. Its brief (instance-written) says this is an |
| 55 | exploration and requires `release/preview.json` (`{"output": |
| 56 | "<dir>"}`) naming committed static output. |
| 57 | 2. **No checks.** Review reads the candidate next. Its brief says it is |
| 58 | an exploration: judge whether it does what was asked and is safe to |
| 59 | publish as a static preview, not production readiness. Changes |
| 60 | requested take the ordinary fix rounds, then needs-you triage asks as |
| 61 | for any task. |
| 62 | 3. **Approved:** the release preview is scheduled as today (approval |
| 63 | with `has_preview`, protocol 9; previews stay ancillary), and at once, |
| 64 | without waiting for it, the **direction card**: one per candidate |
| 65 | (`direction_asked`), in the creator's conversation, "Which direction |
| 66 | for %s?", answers **Build this one**, **Try again** (with a note) and |
| 67 | **Drop it**. `NeedsYou` is `direction`. The preview line is filled in |
| 68 | when the card or task is shown: the candidate's deployed preview link; |
| 69 | else the branch on Amadan with "Previews aren't set up yet" (the |
| 70 | primary, at protocol 10, reports previews off) or "There's no preview |
| 71 | of this version" (anything else). |
| 72 | 4. **An answer** is valid only on an open card at its revision, for the |
| 73 | creator, while the task is an exploration, its newest candidate is |
| 74 | `direction_asked`, approved under the rules of §1, the branch is at it, |
| 75 | and no step is queued or running; else 409 with the card. A new |
| 76 | candidate, a branch move, an ending and a kind switch withdraw the |
| 77 | card. |
| 78 | - **Build this one**, in the answer's transaction: a new `change` task |
| 79 | of the creator in the same project (inserted directly: no |
| 80 | similarity check, no housekeeping pass), title "Build: %s", brief |
| 81 | this task's brief and a paragraph naming the explored branch and |
| 82 | commit to read for the design. It starts **from the default |
| 83 | branch**, like any task, and is started at once (its Engineering |
| 84 | step dispatched). `explored_from` on it, `built_as` on this task, |
| 85 | which ends `done`. A second answer finds the card answered (409); |
| 86 | `built_as` set also refuses. |
| 87 | - **Try again**, with Paul's note (required, at most 1,000 bytes): |
| 88 | another Engineering round on the candidate with the note in its |
| 89 | brief (`chat_steps.note`). Paul's tap: never budgeted. |
| 90 | - **Drop it:** the ordinary cancel of a task at rest. The branch stays. |
| 91 | 5. **Never a merge.** `mergegate.Decide` returns `never` for an |
| 92 | exploration first, a person's Merge included (`Inputs.Explore`); |
| 93 | `startMerge` refuses one too; `mergeOffered` is false for one. |
| 94 | |
| 95 | ## 3. Triage, the sweep and duplicates |
| 96 | |
| 97 | - `direction` is a genuine decision: `triage.Classify` leaves it in |
| 98 | Needs you with no recommendation. The stall sweep's kick runs |
| 99 | `advance`, which for an exploration is `advanceExplore`. |
| 100 | - **Kinds never meet as duplicates.** `similarTasks` (record_task's own |
| 101 | check and its `DuplicateOf`), the duplicate detectors' view and the |
| 102 | combine and link actions (`foldable`, `hkLink`, checked again in the |
| 103 | transaction) only pair tasks of the same kind. |
| 104 | |
| 105 | ## 4. The barber task, once |
| 106 | |
| 107 | `Store.ExploreOnce(ctx, "tk5fen4uajpn")` at start-up, after re-triage: |
| 108 | one transaction, a trusted bootstrap entry (no person principal): |
| 109 | - a ledger row (`chat_housekeeping`, detector `kind_switch`, key |
| 110 | `explore:<task>`) exists: nothing (it already ran); |
| 111 | - the task is missing, ended or merged: the row is written (`expired`, |
| 112 | reason `ended`), nothing else; |
| 113 | - the task is merging, cancel-requested, or a step is queued or running: |
| 114 | nothing is written (transient; the next start looks again); |
| 115 | - otherwise the same internal switch as Paul's (§1, without the person |
| 116 | and revision checks) and the row (`done`), together. |
| 117 | Paul switching it back later is never undone: the row exists. |
| 118 | |
| 119 | ## 5. Wire: protocol 10 |
| 120 | |
| 121 | `wire.ProtocolExplore` (10) becomes `ProtocolCurrent`: |
| 122 | - `Capabilities.previews` (bool, omitempty): the primary loaded a |
| 123 | preview credential. |
| 124 | - `record_task`'s `kind`. |
| 125 | |
| 126 | **Downgrade** (its own step; `Encode` accumulates every step's flag): |
| 127 | - a hello's `previews` is dropped below 10, and the runner's first hello |
| 128 | never carries it (it is sent before the welcome): the next hello does |
| 129 | once the welcome says 10, as for empty repositories; |
| 130 | - below 10, `record_task`'s `kind: "change"` is dropped; `kind: |
| 131 | "explore"` is **kept**, so an older instance's strict decoder refuses |
| 132 | the whole call (an exploration never becomes a change). The runner, |
| 133 | knowing its spoken protocol, answers such a call itself first with a |
| 134 | tool error saying Equipo needs an update before it can record an |
| 135 | exploration. |
| 136 | |
| 137 | | Combination | Behaviour | |
| 138 | |---|---| |
| 139 | | new instance, runner at 9 | no `kind` arrives: changes; Paul's switch works; previews unknown, so the card says there is no preview unless one deployed | |
| 140 | | old instance, new runner | spoken 9: explorations are refused with the update message; changes as today | |
| 141 | | new both | as specified | |
| 142 | |
| 143 | `schedulePreview` skips a primary at 10 that reports previews off. |
| 144 | |
| 145 | ## 6. Data |
| 146 | |
| 147 | Migration 0067 (additive): `chat_tasks.kind`, `explored_from`, |
| 148 | `built_as`, `direction_asked`; `chat_steps.kind`, `note`. `wire.Task` |
| 149 | gains `kind` (omitempty), `explored_from`, `built_as` (task refs) and |
| 150 | `direction` (`{preview_url, branch_url, previews_off}`); `AnswerCard` |
| 151 | gains an optional `note`. |
| 152 | |
| 153 | ## 7. Tests, failing first |
| 154 | |
| 155 | Contracts (`internal/thintest`): |
| 156 | - `TestExploreFlow`: record with `kind: explore`; Engineering's brief |
| 157 | requires the preview config; no checks; Review's brief says |
| 158 | exploration; approval with a preview schedules it and raises the |
| 159 | direction card at once; the card shows the preview once deployed; no |
| 160 | merge step ever. |
| 161 | - `TestExploreBuildThisOne`: a linked change task, from the default |
| 162 | branch, its brief naming the branch and commit, started; this task |
| 163 | done; a replayed answer 409. |
| 164 | - `TestExploreTryAgain`: a round with the note; no note refused; a new |
| 165 | candidate withdraws the card and asks again. |
| 166 | - `TestExploreDropIt`: cancelled; nothing sent to the forge. |
| 167 | - `TestExploreNeverMerges`: the gate, the task page's Merge and a merge |
| 168 | card answer: refused. |
| 169 | - `TestExploreKindSwitch`: change at Ready to merge to explore (merge card |
| 170 | withdrawn, direction asked); explore to change (checks and a change |
| 171 | Review before the gate); refused while a step runs, merging, ended, |
| 172 | for a teammate, at a stale revision; a round trip asks again. |
| 173 | - `TestExplorePreviewsOff`: a primary at 10 without previews: no preview |
| 174 | step, the card says previews aren't set up and links the branch. |
| 175 | - `TestExploreBarberOnce`: the failed-merge state switches once and |
| 176 | raises the direction card; Paul switches it back; another start leaves |
| 177 | it; merged, ended and missing write the row; running writes nothing. |
| 178 | - `TestExploreKindsNotDuplicates`: record_task's similarity, combine and |
| 179 | link never pair an exploration with a change. |
| 180 | - `TestExploreDirectionStays`: triage and the sweep leave it in Needs you. |
| 181 | - Mixed versions: a runner at 9; the record_task downgrade both ways. |
| 182 | |
| 183 | Unit: `Decide` with `Explore`; `Encode` at 10 and below; the first hello |
| 184 | without previews. Every guard broken once and its test watched failing. |
| 185 | |
| 186 | ## 8. Copy (delegated Astra pass) |
| 187 | |
| 188 | The direction card's question, three answers and the note field and its |
| 189 | notes after answering; the preview, branch, "previews aren't set up" |
| 190 | and "no preview" lines; the kind label, the two switch actions and their |
| 191 | thread notes; "Build: %s" and the build brief's paragraph; Needs you |
| 192 | `direction`. |
| 193 | |
| 194 | ## 9. Out of scope |
| 195 | |
| 196 | Choosing between several explorations side by side; deleting previews |
| 197 | or branches; waiting for a preview before asking. |
| 198 | |
| 199 | ## 10. Round 1 and where it went |
| 200 | |
| 201 | 1. Downgrade into a change: `kind: explore` is never stripped; an old |
| 202 | instance refuses the call and the runner says why (§5). |
| 203 | 2. First hello: `previews` withheld until the welcome; flags accumulate |
| 204 | (§5). |
| 205 | 3. The barber's failed merge: explorations route before merge handling |
| 206 | (§2). |
| 207 | 4. Running work: switches only at rest; judgements count only for their |
| 208 | kind (§1). |
| 209 | 5. Card validity: bound to the candidate, revalidated on answer, |
| 210 | withdrawn on every change, reset on a switch (§2.4). |
| 211 | 6. Inherited changes: "Build this one" starts from the default branch |
| 212 | and names the explored branch in its brief (§2.4). |
| 213 | 7. Atomic, replay-safe build: one transaction, a direct insert, the card |
| 214 | and `built_as` as guards (§2.4). |
| 215 | 8. Duplicates: kind equality in every pairing and in the transaction |
| 216 | (§3). |
| 217 | 9. Bootstrap: a trusted entry, row and switch together, transient states |
| 218 | write nothing (§4). |
| 219 | 10. Previews: nothing waits for them; the card fills the line in when |
| 220 | shown (§2.3). |
| 221 | |
| 222 | ## 12. Round 2 (revision 2): READY AFTER FIXES, folded in |
| 223 | |
| 224 | 1. Kind-aware progress everywhere: a Review that does not count for the |
| 225 | kind, and an exploration's checks and merges, are skipped by |
| 226 | `progressOfKind` altogether (never `last`), and triage's last word and |
| 227 | the fix round's feedback read only what counts. |
| 228 | 2. Rest needs proof: a step withdrawn, or failed or cancelled without |
| 229 | its termination proof, is not at rest (`busy`), for the switch, the |
| 230 | answers and the start-up switch (which then writes nothing). |
| 231 | 3. Owners only: the direction answer checks the creator is a current |
| 232 | owner in its transaction. |
| 233 | 4. Asked afresh: a branch move and Try again clear `direction_asked`, so |
| 234 | the same commit is asked about again with a new card. |
| 235 | 5. Previews advertised later: when the primary's hello first says |
| 236 | previews are on, each open approved candidate without a preview gets |
| 237 | one (`reschedulePreviews`, once per candidate). |
| 238 | 6. Replays: `exploreRefused` answers an exploration on a connection below |
| 239 | 10, before sending, and in place of an older instance's strict |
| 240 | refusal of a call queued at 10; a stored success is never replaced. |
| 241 | 7. Resumed sessions: an exploration's fix round puts its rule in the |
| 242 | dispatch's feedback too, and Try again's note is in both. |
| 243 | 8. The person API's fold (`MarkDuplicate`) checks kinds too. |
| 244 | |
| 245 | Copy (delegated Astra pass, verdicts applied verbatim): "What next for |
| 246 | %s?", "Build this one", "Try again", "Drop it", "What should change? A |
| 247 | note is required to try again.", "Equipo is waiting for your choice.", |
| 248 | "Previews aren't set up yet.", "There's no preview of this version.", |
| 249 | "Open the branch on Amadan", "Exploration", "Make it an exploration", |
| 250 | "Make it a change", the two thread notes, "Build: %s", the build brief's |
| 251 | paragraph and the answered notes. |
| 252 | |
| 253 | Migration 0067. |
| 254 | |
| 255 | ## 11. Astra round 1 (revision 1): NOT READY |
| 256 | |
| 257 | `gpt-6-astra`, effort high, read-only, against revision 1 and main |
| 258 | 7140df3. Findings as given, shortened; revision 2 must answer each. |
| 259 | |
| 260 | 1. **Critical, §5.** Dropping `kind: explore` below 10 turns an |
| 261 | exploration into a mergeable change on an older instance. Fix: never |
| 262 | downgrade an exploration; the runner refuses to record one below 10 |
| 263 | (a tool error asking for an update); only plain changes pass. |
| 264 | 2. **Important, §§5, 7.** The runner's first hello is encoded before the |
| 265 | welcome, so `previews: true` would reach an older strict decoder and |
| 266 | force protocol 1. And `Encode` assigns `changed = |
| 267 | downgradePreview(body)`, which would drop an earlier step's flag. |
| 268 | Fix: withhold `previews` until the welcome says 10 (as empty |
| 269 | repositories do); accumulate the flags; test the real handshake. |
| 270 | 3. **Important, §§1, 2, 4.** `advanceTask` handles a failed merge |
| 271 | (`mergeFailed`) before judging, so the barber task, whose merge |
| 272 | failed, would go back to Ready to merge, and a conflict would start a |
| 273 | rebase. Fix: route explorations before the merge handling and ignore |
| 274 | old merge failures in their Needs you and triage. |
| 275 | 4. **Important, §§1, 2, 7.** A switch does not settle running work: an |
| 276 | exploration Review finishing after a switch to change keeps a weaker |
| 277 | approval. Fix: record the kind each step was dispatched under; a |
| 278 | switched-to-change task needs a change Review; check merges in flight |
| 279 | inside the switch; interleaving tests. |
| 280 | 5. **Important, §§1, 2.4, 6.** The direction card is not invalidated by |
| 281 | a new candidate, a branch move, a cancel, another round or a kind |
| 282 | round trip (`direction_asked` would suppress the new card). Fix: bind |
| 283 | to candidate and a decision generation; revalidate on answer; reset |
| 284 | on every change. |
| 285 | 6. **Critical, §2.4.** Basing "Build this one" on the explored SHA hides |
| 286 | the inherited mockup changes from Review and the merge facts (both |
| 287 | measure from `BaseSHA`), though merging brings them to the default |
| 288 | branch. Fix: keep Engineering's start apart from the review and merge |
| 289 | baseline, or start from the default branch. |
| 290 | 7. **Important, §§2.4, 7.** "Build this one" needs one atomic, |
| 291 | replay-safe creation (child, both links, answered card, parent done, |
| 292 | dispatch, one key), outside `record_task`'s similarity and |
| 293 | housekeeping; and a fetchable source when the explore branch moves or |
| 294 | goes. |
| 295 | 8. **Important, §3.** `record_task`'s own similarity (`similarTasks`, |
| 296 | `DuplicateOf`) and the combine and link guards (`hkLink`, `foldable`) |
| 297 | also need kind equality, not only the detectors. |
| 298 | 9. **Important, §§4, 7.** The one-time barber switch needs a trusted |
| 299 | bootstrap path (not the creator's switch with a made-up actor), the |
| 300 | conversion and its consumed row in one transaction, and defined |
| 301 | outcomes for merging (transient) versus merged or missing (final). |
| 302 | 10. **Important, §§2.3-2.4, 7.** Waiting for the preview makes previews |
| 303 | drive progress though they are ancillary, and `RetryTask` can retry a |
| 304 | failed preview after the card opened. Fix: track preview readiness |
| 305 | per candidate on every settlement path, or do not wait for it. |
| 306 | |