Skip to content

Commit 8423db5

Browse files
authored
feat(missions): adopt bounded panel inventory and selected headers (#1264)
Main **bounded-inventory UI adoption** following #1246, #1249 and #1250. The live panel now uses `createMissionPanelInventory` → `fetchMissionPanel`; public `fetchMissions` fan-out is removed. ## Contract and UI - Independently verifiable 50-row directory/field windows: echoed `{order,offset,end,total}`, window content digest, collection-order continuation fence. - Inventory summaries carry actor counts. A selected header excludes whole actor/receipt/task collections; those are separately paged. Native-scheduler `document`, cleanup `documentPending` and history `requestID` survive. - Initial durable `finishHighWater` is captured before discovery and seeds once: later-discovered old completions stay seen; new completions above the fixed baseline stay unseen, including deletion/purge counter gaps. - Explicit Show more/Retry for summaries, cleanup, fields, marks and actors; loaded-only search. Selected/reader identities work outside the first inventory page and do not wait for stalled discovery. - Last-good display, owner/generation/page-revision fencing, failed-middle Retry, no automatic changed-cursor restart. Separate actor observations never become atomic whole-mission absence or recovery authority. - Exact cleanup retry/lost-ACK identity preserved. Snapshot/admission/internal/mutation authority stays full. No mass snapshot fallback. - All ten help locales updated. Every response stays within **64 KiB**, request within **16 KiB**; logical reconstruction has explicit budgets/deadlines before allocation and publication. Native per-Location lists and producer-sized enumeration/hash costs remain disclosed. ## Measurements - 50/120 summary rows: 11,915 bytes, one transfer, zero warm range/map reads. - Valid 601-actor selected header: 3,226 bytes. - Explicit actor continuation: 160 root observations, largest measured body 61,471 bytes. - All 2,101 pending cleanups reachable; initial finish baseline remains fixed during new completions. - Notes-only revision: one wanted header, no task transfer or expanded-task reread. ## Qualification fixes included - Directory-only project Location omitted `workspaceID:undefined`, which strict document CAS rejects; adapter now omits only an absent optional field. Regression verifies directory-only and supplied-workspace placement without weakening validation. - Missing edit still returns mission-not-found/404. - Native document-cleanup receipts/replay are checked exactly; safe help-fixture link teardown and a data favicon fix remain test-only. ## Validation and recovery disclosure Implementation recovered after another session's dependency-junction cleanup deleted the original worktree. Tracked changes came from saved Git state; nine new sources were reconstructed from 137 archived successful operations and nine read checkpoints. All sources were checkpointed, then qualified in a new independently installed worktree. Original/evidence/recovery checkpoint remain untouched. Passing: typechecks, real UI build, 1,322 UI tests, 1,381 server tests plus one optional skip, 615 latest-complete serial browser cases, 31 help checks, plugin rebuild and 21 isolated OpenCode 2.2.3 gates. Twelve negative controls caught/restored. This is not a claim that the initial browser sweep was entirely green: one extension-fixture activation failure passed two fresh full-file reruns unchanged. Test manifests are explicit/nonempty; no borrowed dependencies or implicit Node discovery. Qualification report/provenance retained by the coordinator. Current-passage compaction (slice 5) remains the next separate work; scheduler #1259 is already merged.
1 parent 7349d73 commit 8423db5

116 files changed

Lines changed: 2856 additions & 309 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎dev-docs/CACHE_REFRESH_CONVENTIONS.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ where their authority, lifetime or runtime differs.
4040
| Transcript pages | Session reducer reads and first latest-window loads merge their page with the rows streamed during the fetch; only destructive events (deletion, revert commit, inbox cancellation, compaction boundaries) restart a reducer read. Reloads and history windows keep revision checks. Rules in [TRANSCRIPT.md](TRANSCRIPT.md). | UI `stores/opencode-data.ts`, `opencode-data-read-merge.ts`, `session-api.ts` |
4141
| Mission bodies | Display-only content-route reads keyed by workspace, project, mission and selector; continuations pinned to their first slice's digest, read only as far as the shown page needs. One read at a time per body with coalesced demand. The panel's maps are compact: a descriptor in place of each body. A shown body is read again when its map's descriptor names another digest (a map naming no descriptor expects nothing); a plugin update, reconnect or new stream advances the entry's invalidation epoch, so a request sent before it neither settles nor parks the body and one fresh read follows. The last good body stays shown until the newer one covers it; failures (a plugin without content reads included) show beside it and park until demand, an invalidation or Retry. Intents copying inputs (edit prefill, Save as brief) accept only bodies whose digests are their snapshot's descriptors. Unshown bodies stay within 4 MiB / 128 bodies, LRU. Never authority. Rules in [MISSIONS.md](MISSIONS.md) (Body display, Compact maps). | UI `stores/mission-content-store.ts`, `stores/mission-content.ts`, `components/mission-target-bodies.ts` |
4242
| Mission task pages | A compact map holds a page of its tasks; reads further (`loadTasks`: a window of 50 or tasks by name) name the map's display order and run in turn per mission, an identical waiting read coalesced and a running one followed by one trailing read. Each read is recorded before it is sent; rows, reports and reads each keep the revision of the page that answered them, so a page vouches only for what it answered. An answer in the shown order merges into the list read's own map (a row it holds stays unless a page answered it later), a refusal or another order reads the list again. List publications keep the rows of the same order (last good display), drop caches of maps no longer listed, and read again each read last answered before the map's revision, from scratch in another order. A failure keeps the rows with Try again and parks its read until a later revision or an explicit retry; it stays shown until a read answers it, whatever else succeeds. Attention windows count as covered only for the attention sequence they answered. A body a row read further describes is expected at that page's revision; an older plugin's undescribed history is read again when its report metadata changes. `clear` fences reads in flight (epoch and cache identity). Reads share the secondary background budget. Never authority. Rules in [MISSIONS.md](MISSIONS.md) (Task pages). | UI `stores/mission-store.ts`, `stores/mission-task-pages.ts` |
43-
| Opt-in Mission panel transfer | `panelPage` reads index summary/cleanup rows or exactly one mission range, in JSON-body transfers of at most 64 KiB. Range envelopes carry the named observation's damage flags and discarded count; damaged reconstruction refuses `damaged` separately from clean absence. Native output alternatives and the HTTP seam share the strict result schema. Cursors pin only the chosen collection's digest and exact row/character position; unrelated collections can change without invalidating it. A changed collection refuses rather than joining observations. Consumers preserve per-page provenance and park failed cursors for explicit Retry. Every transfer hashes its whole source afresh; directory serialization occupies the hints' project append exclusion, and full traversal has approximately quadratic source-work cost at a fixed budget. UI reads further into tasks use this transport; picker discovery, maps, activity and cleanup display retain the list contract. | server `missions/mission-panel-page.ts`, `MissionControl.panelPage`, route `POST .../missions/panel-page` |
43+
| Mission panel inventory | Live picker/cleanup discovery uses explicit 50-row logical windows through `panelPage`. Content digests verify that window; a separate order digest covers the collection's row values and fences further selections. Only selected/reader-wanted missions load bounded headers and task windows; root collection/extension descriptors permit exact field reads. Every window retains its own revision and failed selector. A failed middle window stays failed through unrelated successes; changed cursors park for explicit restart/Retry. Passive refresh reads first windows and wanted headers, preserving expanded displays without replaying every read after unrelated revisions. Initial discovery point-reads the durable finish counter before hints; completion seeding happens once, independently of partial summary maxima. Exact cleanup reconciliation keeps its existing single-mission path. Every transfer retains the shared secondary slot through bounded stream cleanup, with one 30-second logical deadline and source-specific preallocation limits. Hints serialization/order work remains in the append lane and linear in the whole chosen collection per transfer. | UI `stores/mission-panel-inventory.ts`, `lib/mission-task-page-read.ts`; server `missions/mission-panel-page.ts`, `mission-panel-header.ts`, `MissionControl.panelPage` |
4444
| Opt-in Mission live windows | `panelPage` activity selects at most 160 actors of one mission; marks select at most 16 hint contexts of 10 actors. Native observation reuses existing budgets and root/connection/deletion fences after the append exclusion. Every continuation re-observes and refuses changed content; zero automatic restarts and no retained observation cache. Partial/unknown family and request coverage stay explicit, including off-page actors. Consumers park failed windows, retain last-good display and restart changed rows from their first piece explicitly. | server `missions/mission-activity-context.ts`, `mission-panel-observation.ts`, `activity.ts` |
4545
| Mission task transport | One requested window or named read through `panelPage`, 64 KiB per response and 16 KiB per selector. Each secondary slot covers headers plus bounded body consumption/cancellation; one 30-second deadline starts before the store queue and covers final hash/validation/publication. Window text admits at most 8 Mi UTF-16 units, 24 MiB UTF-8, 64 MiB cumulative wire bodies and bounded JSON structure/nested compact shapes. Digest/length/header, semantic selector/report/counter checks and UTF-16LE SHA-256 precede publication; WebCrypto and the pinned browser-safe fallback cover secure and HTTP-only origins. Partial text is operation-local; failures park with Retry, while supersession stays distinct from empty success. Last-owner release advances a monotonic mission lifetime; concurrent owners preserve it. Live readers own reconnect refresh demand independently of the panel. | UI `lib/mission-task-page-read.ts`, `mission-task-page-schema.ts`, `mission-task-window-budget.ts`, `mission-task-read-lifetime.ts`, `stores/mission-store.ts` |
4646
| Render cache | Explicit versioned values scoped to instance/session, invalidated by version only. | UI `lib/global-cache.ts` |

‎dev-docs/MISSIONS.md‎

Lines changed: 88 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -565,9 +565,10 @@ An ordinary journal's finish carries the project's finish number (`mission.finis
565565
### Opt-in bounded panel transport
566566

567567
`MissionControl.panelPage`, the `panelPage` RPC and `POST /api/workspaces/:id/missions/panel-page`
568-
provide a byte-bounded display transport alongside the `list`, `mission` and `tasks` contracts
569-
used by the current UI. The transport covers persisted directory, compact-map data and
570-
opt-in live actor observations (§Paged live activity). The UI keeps the list route's activity projection. Its schema,
568+
provide the live one-time panel's byte-bounded display transport. The `list`, `mission`
569+
and `tasks` contracts also serve explicit compatibility/reconciliation callers. The
570+
transport covers persisted directory, selected header/field data and live actor
571+
observations (§Paged live activity). Its schema,
571572
types, byte counter and paginator live in `missions/mission-panel-page.ts`.
572573

573574
- Every successful body, including `available`, the envelope, escaped nested text and the
@@ -672,9 +673,90 @@ surrogates, under the same logical budget and deadline.
672673
The producer/consumer contract tests live in `packages/ui/tests/contracts/`, outside
673674
the browser application's source graph, and run in the Missions UI unit CI step.
674675

675-
Picker discovery, selected/wanted maps, activity and cleanup display retain the list
676-
contract; exact cleanup reconciliation retains its single-mission read. Completion
677-
seeding uses that complete inventory.
676+
Picker discovery and cleanup history read explicit `window:{offset,order?}` selections
677+
of at most 50 rows. The envelope echoes `window:{order,offset,end,total}`: `page.digest`
678+
commits the chosen window alone, while `window.order` commits all row values of the
679+
collection and fences subsequent selections. Each sliced logical window is assembled,
680+
hash-verified and schema/identity-checked before adoption. A changed continuation parks
681+
with Retry from offset zero; failed middle windows retain their exact selector and last
682+
display independently of successes elsewhere. Expanded windows are retained with their
683+
own observation revisions; passive refresh reads the first directory windows and wanted
684+
headers, leaving other windows for explicit continuation/retry. Search filters loaded
685+
summaries and says so while discovery remains partial. Summary windows carry `actorCount`
686+
in place of actor-ID fan-out. Only selected and reader-wanted missions load headers/tasks.
687+
688+
`{source:"mission",missionID,header:true}` returns one bounded
689+
`{root,collections,tasks,coordinator?,control?}` row. Root identity/state, body descriptors
690+
and small exact extension values stay inline. Collections carry
691+
`{characters,digest,total,array,order?}`; actors also name their observation order.
692+
The top-level task metadata carries its page, pinned task/report IDs and source version.
693+
The coordinator is one exact copied actor, including its Location, for full-ACK identity.
694+
Wanted headers publish independently of directory reads; an explicit refresh awaits its
695+
owned header reconciliation. Last-owner release fences pending work while retaining a
696+
last-good header for a later selection. Task-source versions suppress unrelated expanded
697+
task rereads. Actors, all compact reports, history and claims use independently selected
698+
field windows. Lifecycle receipt/pending collections use `field:"control"` with
699+
`part:"receipts"|"pending"`; lifecycle identity and counts stay in compact control.
700+
Field lanes retain the root field and part separately; the owning root descriptor
701+
invalidates structured and raw part windows together, and Retry preserves the exact part.
702+
Pending first reads share that invalidation. Publication rechecks the owning descriptor;
703+
successful reads retire only failures unchanged since their admission.
704+
The selected mission reads its unified document projection. `document`, boolean cleanup
705+
`documentPending` and history `requestID` retain their exact shapes; scheduling editors
706+
keep their descriptor-pinned bodies/content reads. Snapshot/admission, internal and
707+
mutation contracts retain full authority.
708+
709+
Any persisted field also accepts `text:true` with a window. Its offset names one
710+
surrogate-safe 32-Ki-unit page of the field's exact JSON; `window.order` hashes the
711+
complete JSON and `page.digest` independently verifies the chosen string row. The UI's
712+
explicit raw-page controls read one page at a time under a 256-Ki-unit assembly budget,
713+
including when a structured scalar/row exceeds its structured assembly budget. Structured
714+
summary/header/field/observation windows use 256 Ki/1 Mi/8 Mi/24 Mi units respectively.
715+
Every logical admission shares task transport deadlines, cancellation and two-slot
716+
accounting, through validation and publication; a missing capability never widens a read.
717+
718+
Windowed cleanup discovery retains every pending intent, including document-only pending
719+
deletions, with the settled-history policy applied separately. Rows use the composite
720+
mission/deletion identity and validate immutable request/revision/options before adoption.
721+
Only a complete same-order traversal retires last-good directory rows. Summary revision
722+
merges are qualified by connection epoch. Native observations carry their own epoch and
723+
observation cycle; failed/older windows retain display while fresh membership and recovery
724+
coverage come only from current windows. Separately observed windows keep whole-mission
725+
idle/absence unknown.
726+
727+
An initial summary request (`initial:true`) point-reads the durable finish counter under
728+
the project's append exclusion before traversing hints, returning `finishHighWater` on
729+
its first transfer. Failed/corrupt counter reads fail closed. The window seeds that
730+
project's persisted completion watermark once, including deleted/purged finishes and
731+
counter gaps. Later pages and refreshes preserve the initial boundary; separately shown
732+
new completions are recorded without advancing over unseen/unloaded ones. Exact cleanup
733+
retry reconciliation retains its single-mission read and immutable request/revision/option.
734+
735+
Project-scoped completion records inherit an existing folder record before durable-counter
736+
seeding. Saved whole-inventory watermarks retain their unseen boundary; bounded legacy
737+
hashed-ID positives persist across reloads and partial discovery, covering colliding IDs
738+
while exact discovered rows also supply sequence positives. Passive first-window validation
739+
retains a failed middle selector;
740+
an obsolete collection order marks that failure changed until an explicit restart succeeds.
741+
742+
Fixed host, plugin and workspace unavailable refusals retain their typed cause through
743+
the bounded owner and its localized unavailable guidance. Last-good display survives;
744+
malformed data, transport failures, changed orders and damaged ranges keep distinct errors.
745+
746+
The inventory consumer (`stores/mission-panel-inventory.ts`) uses the task consumer's
747+
slot-owning response/cancel boundary and UTF-16LE SHA-256. Logical character ceilings are
748+
256 Ki for 50 summaries, 1 Mi for a selected header, 8 Mi for field windows and 24 Mi for
749+
the existing bounded activity/mark contexts and correlated native records. UTF-8 input
750+
is bounded at three times that ceiling and cumulative wire input at eight times it;
751+
the existing JSON structural-token/depth limits also apply. Over-budget values refuse
752+
explicitly and keep last-good display, with exact source fields still addressable.
753+
One 30-second operation deadline covers queueing, cleanup, hash, validation and adoption.
754+
Last-owner release and connection epochs abort/fence trailing work; concurrent owners
755+
retain their mission lifetime. Visible demand observes only the first mark window and
756+
each wanted mission's first actor window. Further windows are explicit, retain their own
757+
provenance and remain partial/unknown as a whole-mission claim. Positive requests survive
758+
partial coverage and open the ordinary interruption dock; separate windows never combine
759+
into atomic absence or recovery authority.
678760
The recurrence-passage reader keeps its own transport.
679761
Consumers adopting this transport key pages by workspace,
680762
project and the complete source selector, retain each page's own revision, and keep a

‎docs/help/de/missions.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Missionen
22

3+
Für ein zu großes gespeichertes Feld wählen Sie **JSON-Rohdaten seitenweise lesen**. **Vorherige Seite** und **Nächste Seite** lesen exakte, begrenzte Teile; bei einer geänderten Sammlung beginnt **Erneut versuchen** auf der ersten Seite.
4+
5+
Die Auswahl lädt jeweils 50 Missionsübersichten; **Weitere laden** setzt die Suche fort. Die Suche filtert nur geladene Missionen. Nur ausgewählte oder im Leser angeforderte Missionen laden ihre Details. Bereinigung, Aktivität und Anfragen haben eigene Zähler und **Weitere laden**. Ungelesene Akteure und Anfragen bleiben unbekannt, auch nach mehreren getrennten Beobachtungen. **Gespeicherte Felder lesen** bietet exakte Seiten für Akteure, Berichte, Verlauf, Belege und Metadaten. Bei einem Fehler bleibt die letzte Anzeige; **Erneut versuchen** wiederholt das Fenster, eine geänderte Sammlung beginnt beim ersten Fenster. Lesen startet keine Arbeit. Historische Abschlüsse werden einmal anhand des dauerhaften Projektzählers erfasst; neue Abschlüsse bleiben bis zur Anzeige ungesehen.
6+
37
Missionen verbinden einen dauerhaften Projektplan mit nativen OpenCode-Unterhaltungen. Der Koordinator plant und delegiert; der Aufgabenbaum erfasst Abhängigkeiten und Ergebnisse. Ein gespeicherter Plan, eine angenommene Eingabe und beobachtete Ausführung sind unterschiedliche Tatsachen.
48

59
## Erstellen, dann ausdrücklich starten {#create}

‎docs/help/en/missions.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Missions
22

3+
For a persisted field too wide to read as rows, choose **Read raw JSON pages**. **Previous page** and **Next page** read exact, bounded parts of that field; a changed collection requires **Try again** from its first page.
4+
5+
The picker loads 50 mission summaries at a time; **Load more** continues discovery. Search filters loaded missions only. Only selected or reader-targeted missions load their detail. Cleanup history, actor activity and request marks have their own loaded counts and **Load more** controls. Unread actors and requests remain unknown, even after several separately observed windows. **Read persisted fields** in the overview provides exact paged actor, report, history, receipt and extension metadata. A failed window keeps its last display and **Try again** retries it; a changed collection restarts from its first window. Reading or retrying never starts work. Historical completions are seeded once from the durable project finish counter; newly finished missions remain unseen until shown, including while discovery is incomplete.
6+
37
Missions pair a durable project plan with native OpenCode conversations. The coordinator plans and delegates; the task tree records dependencies and results. A saved plan, an admitted input and observed execution are different facts.
48

59
## Create, then explicitly start {#create}

‎docs/help/es/missions.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Misiones
22

3+
Para un campo guardado demasiado grande, elija **Leer páginas de JSON sin procesar**. **Página anterior** y **Página siguiente** leen partes exactas y acotadas; si cambia la colección, **Intentar de nuevo** vuelve a la primera página.
4+
5+
El selector carga 50 resúmenes por vez; **Cargar más** continúa la exploración. La búsqueda filtra solo las misiones cargadas. Solo las misiones seleccionadas o abiertas en el lector cargan sus detalles. La limpieza, la actividad y las solicitudes tienen contadores y controles **Cargar más** propios. Los actores y solicitudes sin leer siguen siendo desconocidos, incluso tras observar varias ventanas por separado. **Leer campos guardados** permite consultar páginas exactas de actores, informes, historial, recibos y metadatos. Una ventana fallida conserva la última vista; **Intentar de nuevo** la relee, y una colección cambiada vuelve a la primera ventana. Leer no inicia trabajo. Las finalizaciones históricas se reconocen una sola vez mediante el contador duradero; las nuevas permanecen sin ver hasta mostrarse.
6+
37
Las Misiones combinan un plan de proyecto duradero con conversaciones nativas de OpenCode. El coordinador planifica y delega; el árbol de tareas registra dependencias y resultados. Un plan guardado, una entrada admitida y una ejecución observada son hechos distintos.
48

59
## Crear y después iniciar explícitamente {#create}

0 commit comments

Comments
 (0)