diff --git a/01_CURRENT_STATE.md b/01_CURRENT_STATE.md new file mode 100644 index 0000000000000..ebbc73431caec --- /dev/null +++ b/01_CURRENT_STATE.md @@ -0,0 +1,186 @@ +# T3 Fork — Current State and Roadmap + +**Updated:** 2026-11-07 browser-only D4/D2 upstream recovery review. U/R/H final status remains as of 2026-11-06; D2 packaged shipping and real-provider K3 unverified; integration HOLD. +**2026-11-07 BROWSER D4/D2 DIAGNOSTICS:** [Public browser-only recovery/D2 ledger](docs/orchestration-v2/browser-d4-d2-upstream-recovery-ledger-20261107.md) records current upstream `main` **210 commits after the frozen U source**, newly merged recovery paths (#30560, #31292, #31854, #31842), and directly checked older-experiment agent MCP continuation-field exposure. These are **source observations and proposed targeted D4 regression coverage, not local H tests or a proven D4 defect**. Existing worker-reported U/R/H statuses unchanged; **D2 packaged/authenticated shipping NOT VERIFIED; K3 real-provider start NOT VERIFIED; INTEGRATION HOLD**. Public browser ledger is distinct from and **does not modify** the restricted local 461-line routing ledger. No fork-main merge/push, worker dispatch, paid test, source change, release or default-on. The prior upstream drift counts below are point-in-time historical snapshots. +**NEW MANAGER TRANSITION (2026-11-06):** [Complete T3 Fork successor-manager handoff](docs/orchestration-v2/overall-manager-transition-handoff-20261106.md) is the concise manager entrypoint after Current State and Coordination Protocol. It consolidates final U/R/H scopes, unchanged fork main, remote upstream drift, separate upstream PR cooperation, D2 packaged/K3 live-provider blockers, routing/ledger duties, private evidence, and approvals. Creating this handoff **did not launch workers, change source, merge, push or grant a new product authorization**. +**Classification:** CURRENT PROJECT STATE — authoritative snapshot for manager continuation, not a code change. +**Repository:** [jermur788/t3code](https://github.com/jermur788/t3code) +**Maintained on:** `planning/resource-efficient-continuation-20261103` — **not fork main**. +**Companion:** [OVERALL_MANAGER_HANDOFF.md](OVERALL_MANAGER_HANDOFF.md), [Coordination/Handoff Protocol](02_COORDINATION_HANDOFF_PROTOCOL.md). + +**Read this before historical chat and handoffs.** Inspect live GitHub and T3 Runtime/worktree truth before relying on recorded branch heads. Older dated Current State and manager reconciliation notes are historical where they conflict with this snapshot. + +## Mission / authority + +Build an **upstream-friendly T3 fork with a provider-neutral Project Runtime**. Instructions, specs and accepted decisions, project/task/handoff state, and execution evidence must survive changes in model/provider/worker/conversation. Providers are replaceable workers, never owners of project truth. CCF/game development is an initial use case; extensions should remain generic. The dashboard is a separate project that consumes T3's authoritative Runtime APIs. + +The **user decides product policy, significant architecture trade-offs, merges/releases, irreversible operations and material paid costs**. Implementation truth: inspected repo/runtime > reproducible tests > implementation docs > worker claims. Product intent: latest user instruction > accepted decisions > current milestone > governing spec. Research and suggestions are not decisions unless adopted. + +## Current repository and integration checkpoint + +| Surface | Recorded checkpoint / status | +| --- | --- | +| **Fork main — INTEGRATED** | `fb67545d790c5c001e8f85827f219ab6493c435e` — new normal two-parent PR #21 merge commit | +| **PR #21** | [Upstream reconciliation + Evidence V0 P2 repair](https://github.com/jermur788/t3code/pull/21) **CLOSED / MERGED** on 2026-11-04 12:33Z. Existing reviewed source head was `0e0c7bc2cb1bb805f273123686303a68e1c2807c`. | +| Upstream main | `8b44f42b14c8e273156474a924ccf29680dd7857` at prior manager fetch; **not refreshed for this merge** | +| Incorporated upstream parent | `bb4afa5425c52104a9261fa2d022cb8ba2fcc099`: upstream release-preparation baseline **25 commits after** actual `v0.1.7` tag, not exact tag or necessarily newest upstream | +| P2 repair branch | `fix/evidence-v0-pruning-completeness-p2-20261104` remains separate, but its reviewed code/test/evidence is incorporated via PR #21 | +| Resource-efficient continuation planning | [Research-only draft PR #20](https://github.com/jermur788/t3code/pull/20): separate and unmerged | +| Default-off continuation experiment | `experiment/continuation-default-off-gate-20261104` at `b3b8da54e0b8b184a1cf4e667d53e73e04f85074`: **excluded from fork main** | +| Post-merge qualification / closure | **`LOCAL RUNTIME PASS (reported)` / `EVIDENCE CLOSED LOCALLY (reported)` / `REVIEW PASS WITH FINDINGS (recorded)`**. Package checksums verified by local workers; nothing published. [Evidence-closure manager reconciliation](docs/orchestration-v2/manager-postmerge-pr21-evidence-closure-reconciliation-20261104.md). | + +**Merge method and authority:** On 2026-11-04 at 12:31Z user explicitly authorized the fork-main merge after a discussion of benefits and risks. The Overall Manager checked PR #21 open/draft/mergeable, the exact unchanged source and target heads, the zero-hosted-check state, and a comparison showing the PR ahead with no commits behind. It updated the PR's outdated description to the current acceptance and limitations, marked it ready for review, and used GitHub's `merge_pull_request` with `merge_method=merge` and an **expected PR head** guard. GitHub reported **merged=true**. + +**Independent post-merge GitHub checks:** PR #21 is CLOSED / MERGED, fork `main` points at `fb67545d790c5c001e8f85827f219ab6493c435e`, and that commit has **two exact parents**: previous fork-main head `d3bedef12a31f368e5c5a6b279445bea39a6a13a` and reviewed PR head `0e0c7bc2cb1bb805f273123686303a68e1c2807c`. Source on `main` contains both the pruning metadata read and `orchestration-v2-pruned` marker. No Git history rewrite or squash. The repository reports **zero hosted checks** for this merge. + +## Current milestone — fork main integrated, locally qualified, and evidence CLOSED LOCALLY + +**Integration independently confirmed:** [PR #21](https://github.com/jermur788/t3code/pull/21) is merged/closed, fork `main` remains at normal merge `fb67545d790c5c001e8f85827f219ab6493c435e` (previous fork-main parent plus reviewed P2-repaired source parent). **`INTEGRATED`**, not a production release. User approved the fork-only integration and accepted the older Evidence V0 decoder upgrade limitation. + +**2026-11-04 20:00Z worker return:** `POST-MERGE LOCAL RUNTIME PASS (worker-reported) / EVIDENCE CLOSED LOCALLY (worker-reported) / INDEPENDENT REVIEW PASS WITH FINDINGS (recorded)`. The manager independently re-fetched the GitHub PR/main and inspected client-mode/MCP handoff-access source. The worker's *local package bytes, browser screenshots, raw logs and ledger* are **not remotely available to the manager** and have not been independently re-executed. [Complete manager reconciliation](docs/orchestration-v2/manager-postmerge-pr21-evidence-closure-reconciliation-20261104.md) preserves this attribution and the worker's material findings. + +### What the local workers report as passed + +- Actual merged-main baseline: fresh uncached 40/40-package typecheck, Evidence V0 and Project Runtime tests, `check:changed` 81 files/2,075 tests with formatting/lint/knip/GraphQL/React checks PASS, and web build PASS. Earlier artifact-hygiene failures were corrected in the reported frozen-tree run. The broad check represents fork-vs-upstream, **not just PR #21**. +- Rendered fork Project Home, five development cards, Workspace/Development control and upstream route/back navigation; normal app stop/start on persisted SQLite preserved two project Runtime/task/evidence state and cross-project isolation; genuine V2 pruning produced a deterministic `orchestration-v2-pruned` `incomplete/unknown` marker, separate truncation/unresolved outcomes, valid updated JSONL decoding. No live paid providers. +- **Mode persistence qualification now closed within a narrow client-local scope:** verified `localStorage["t3-fork:interface-mode"] = "workspace"` after real server process stop/start and same-profile reload, rendered Workspace home again and compared Development; three screenshots/per-step server/page facts reported. The manager inspected [the browser-local mode implementation](https://github.com/jermur788/t3code/blob/main/apps/web/src/forkWorkspaceMode.ts). **No server-side, browser-process-restart or cross-device persistence claim.** +- **Evidence preservation and sanitization reported:** originals **164 files / 9,803,931 bytes, checksums 164/164 OK**. Reviewed v2 package **89 files / 754,717 bytes, checksums 87/87 OK** (excluding checksum and size files), 78 sanitized files; previous v1 package 63/63 OK. Package snapshot at 19:55:35Z. Original ledger append-only; three final post-snapshot entries change the final ledger checksum but package v2 remained byte-identical to the reviewed snapshot. Actual source files/checksums remain **only on the local verification host**; no branch push, publication or external ledger copy. Worker-attributed proof is recorded in [closure reconciliation](docs/orchestration-v2/manager-postmerge-pr21-evidence-closure-reconciliation-20261104.md). +- Independent review: Codex GPT-6.1 Terra Medium and Claude Sonnet 5.5 Medium issued **PASS WITH FINDINGS**, including earlier mode-proof weakness and v1 UUID sanitization/inventory weakness; later hardened mode proof and revised v2 package were reviewed with no remaining material sanitization/integrity finding reported. DeepSeek V4.1 Flash orchestrated only; eight closure dispatches, two material rework loops, no quota failure, failover or Opus. Provider balances/reset times remained UNKNOWN. + +### Open verification/authority boundaries + +1. **App-level handoff write and isolation: `NOT RUN / OPERATIONAL BLOCKER`.** No free supported append route was available in the tested host: WebSocket Project Runtime RPC offers list/read only; `t3_project_handoff_append` is an MCP session-scoped tool. The manager inspected [RPC source](https://github.com/jermur788/t3code/blob/main/apps/server/src/projectRuntime/ProjectRuntimeRpc.ts) and [MCP handler](https://github.com/jermur788/t3code/blob/main/apps/server/src/mcp/toolkits/project/handlers.ts). Prior **service-level** isolation tests are not app-level proof; other externally configured no-cost providers are not exhaustively ruled out. **Do not bypass auth or initiate new provider-feature work without user/spec authority.** +2. **Evidence publication: `NOT AUTHORIZED / NOT DONE`.** `EVIDENCE CLOSED LOCALLY` replaces the earlier local packaging blocker; **remotely retrievable primary evidence remains unavailable**. Local v2 package and restricted ledger are not GitHub artifacts. The minimal proposed *publication* subset is 78 sanitized text files plus newly scrubbed manifest/map/checksums; worker says one host-path string must be removed. Keep originals, restricted ledger, SQLite DB, screenshots, raw JSONL, fixture metadata and binaries local. No publication, push or paid transfer without **separate user decision**. +3. Not tested: browser-process restart/cross-device mode propagation, SIGKILL/crash recovery, Add-project UI, native/remote/tunnel, hosted CI (zero checks), production live-provider operation or a newer upstream commit. **`NOT PRODUCTION VERIFIED`.** +4. The closed-enum `orchestration-v2-pruned` marker is not readable by older strict `orchestration-evidence/v0` decoders; user approved a **fork-only coordinated reader upgrade**, not universal backward compatibility or a stable external-format policy. +5. The experimental default-off continuation branch remains unmerged. D2 public shipping exclusion and D4 strict revocation remain **separate unmet public-release gates**; nothing here changes those decisions. + +**2026-11-05 12:25Z local preparation return:** DeepSeek successfully dispatched Codex GPT-6.1 SOL Medium for local staging, and Claude Sonnet 5.5 Medium gave **independent read-only PASS** after two low-severity redaction corrections. Worker reports a **private, unpublished 81-file / 629,098-byte candidate**, comprising 78 sanitized files plus `MANIFEST.md`, `SANITIZED-MAP.json` and `SHA256SUMS.txt`; 89-file v2 source mounted read-only, preserved with 87/87 checks; final 78 sanitized file digests matched and the updated map has 78 entries. Sensitive pattern scans found zero residual matches but **cannot prove absolute absence of private strings**, especially since reviewer sampled rather than read each line of the three largest logs. Seven dispatches, no quota errors; remaining provider allowance UNKNOWN. Original local `main` ref is stale but was not moved. No commit, push, upload or production action occurred. + +**2026-11-05 12:46Z accepted local integrity correction:** the preceding [metadata checksum task](docs/orchestration-v2/task-pr21-sanitized-subset-metadata-hashes-correction-20261105.md) **was dispatched and completed** under the existing local-only user approval. Worker reported the private candidate still has **81 files / 629,261 bytes**: 78 byte-identical sanitized text files, unchanged `MANIFEST.md` and `SANITIZED-MAP.json`, and the **only changed file** `SHA256SUMS.txt`, now covering **80 distinct, sorted relative paths** (the 78 text files plus both metadata files), with **80 OK / 0 FAILED**, checksum self-file excluded and digest reported separately. The reviewer independently re-derived 80-entry integrity, used the genuine prior 78-entry witness rather than an unreliable writer-created before-image, verified no symlinks/path escapes and reported **PASS**. Three correction dispatches, ten dispatches across both preparation/correction tasks, no quota failure or Opus; provider balance/reset UNKNOWN. [Detailed manager acceptance](docs/orchestration-v2/manager-pr21-sanitized-subset-integrity-acceptance-20261105.md) records the precise worker-vs-manager evidence boundary. **Status upgraded to `LOCAL PREPARATION INTEGRITY PASS (worker-reported) / INDEPENDENT REVIEW PASS (recorded) / PRIVATE / NOT PUBLISHED`.** The original governing task exists on the planning branch; prior missing-doc issue was host-local ref/fetch discrepancy resolved at worker correction. Manager independently checked unchanged GitHub PR/main but has **not** read private candidate bytes. The optional one-line checksum-scope explanation in `MANIFEST.md` is **not a required fix** because the 80-entry verification is sufficient; editing the manifest would cause a new digest/review cycle. + +**External evidence transfer is still `NOT AUTHORIZED`.** The fork GitHub repository is **PUBLIC**, so a branch inside this repo is **publicly readable** even if it does not merge into main. Any transfer demands separate user authority on exact files, routing-name disclosure and destination/visibility; original ledgers, restricted files and binaries stay local. No fork-main source edit, release or paid provider call is authorized. + +## Stage 2 — D4 A+B implemented and K1/K2 full-root RUNTIME PASS, K3 PARTIAL; not integrated + +**2026-11-05 13:50Z worker return:** all three [Stage 2 read-only task packets](docs/orchestration-v2/handoff-stage2-browser-first-three-lanes-20261105.md) **were dispatched and returned**, each with independent **PASS WITH FINDINGS** (worker-recorded) and follow-up corrections. DeepSeek V4.1 Flash orchestrated only; Codex/Sonnet workers performed source/probes/reviews. **10 dispatches, no quota failures, actual remaining quotas/reset times UNKNOWN; some actual Sonnet effort was LOW even where MEDIUM requested.** Worker-host raw evidence and [consolidated handoff](docs/orchestration-v2/manager-stage2-three-lane-return-reconciliation-20261105.md) are private local assets; browser manager independently inspected supporting GitHub source/refs but **could not replay local commands or inspect local ledger bytes**. **No source edits, commits, pushes, merges, release, feature enablement or paid-model calls.** [Authoritative manager reconciliation](docs/orchestration-v2/manager-stage2-three-lane-return-reconciliation-20261105.md) preserves exact scope/results, corrections and risks. + +**GitHub checkpoint (independently re-fetched):** fork `main` `fb67545d790c5c001e8f85827f219ab6493c435e`, PR #21 merged; default-off experiment `experiment/continuation-default-off-gate-20261104` `b3b8da54e0b8b184a1cf4e667d53e73e04f85074` remains isolated (34 ahead / 336 behind main); latest upstream `pingdotgg/t3code` main `337c5858c33bc7f8f6dfd391a2c279fa0f7e4d17`, 50 commits after incorporated upstream base. Local stale `main` was not moved by workers. + +### Lane A — D4 transaction boundary + +**`SCOPE-BOUNDED FEASIBILITY PASS (worker-reported) / REVIEW PASS WITH FINDINGS (recorded)`.** Real service-subset tests on **same-path/same-inode SQLite across separate processes**, with `BEGIN IMMEDIATE` writer serialization; fixture **guarded revoke-first** yielded **0 runs / 0 start effects / 0 receipts** vs unguarded **1/1/1**, no replay duplication; intentional red-before race exit 1 and barrier 16/16 PASS. Manager verified source contains three direct `run.created` emitters in `Orchestrator.ts` and `EventSink.commitCommand` transaction path. **This is NOT an integrated D4 guard or production PASS.** Real `continuation:null` revocation through full server root, guard provenance/typed denial, crash, pruning, provider start remain unproven. + +**Critical corrected execution lifecycle:** initial `ThreadLaunchService` uses `defer_start`: persists a `preparing` run **without** a pending `provider-turn.start` effect. Later `prepared-run.release` creates that effect. The previously illustrated initial pending effect was a **fixture**, not real initial launch. **D4 requires a product-approved contract** both for no *new* run created after revocation and for whether an already-created `preparing` run may be released/started afterward. [D4 proposed contract, corrected](docs/orchestration-v2/d4-transactional-revocation-proposed-contract-20261105.md) remains `DESIGN PROPOSED / PRODUCT DECISION / REVIEW REQUIRED`—**not implementation authorized**. + +### Lane B — D2 tool-list exposure + +**`SCOPED SOURCE-LOADED MCP AUDIT PASS (worker-reported)` / `D2 SHIPPING VERIFIED = FALSE`.** Production transport source loaded with **mocked services**: **79 tools** both trees; continuation input schema disclosed via task create/update (`+323 B` per relevant schema; 18 paths each), 4 task output schemas each +351 B **outside context-budget formula**, other unrelated tool byte drift. Agent budget **56,753 → 57,399 = +646 bytes**; committed budget **58,519 → 59,165**; raw transport **187,026 → 189,796**. Main advertised **no continuation**; default-off experiment still advertised continuation. Independent review reproduced the scoped measurements (worker-recorded). [D2 audit plan updated](docs/orchestration-v2/d2-shipping-exclusion-audit-plan-20261105.md). + +**Manager gate decision:** mocked-registry source transport is sufficient to establish D2 design risk, **not shipping verification**. Before public release require the **actual packaged shipping server** plus authorized paired-client tool enumeration (or demonstrably equivalent production-authenticated integration), input/output schema and byte-budget tests. **Strategy B** (explicit agent MCP projections omitting continuation while preserving internal operator authority) is a future preferred design **only if integration is separately approved**; no code change authorized. + +### Lane C — upstream/experiment reconciliation preview + +**`READ-ONLY PREVIEW COMPLETE (worker-reported)`.** Full worker comparison **50 upstream commits / 610 paths, +23,931/−26,742 lines**; experiment **30 paths (10 docs, 12 tests, 8 source)**. Read-only merge-tree conflicts **1** experiment→main, **2** main→upstream, **9** experiment→upstream; **dry-run counts, not completed integrations**. Worker's suggested sequence **upstream catch-up first, re-land continuation as fresh bounded changes** is a recommendation, **not authorized**. Manager independently checked upstream current refs and source hotspots; browsed a **non-exhaustive** shortlist of *open/unmerged* upstream PRs affecting SQLite writer, command receipts, provider effect lifecycle and MCP/scheduled tasks. [Manager reconciliation](docs/orchestration-v2/manager-stage2-three-lane-return-reconciliation-20261105.md) links them. Full per-commit replay and exhaustive open-PR inventory still not done. + +### D4 K1/K2 real-root qualification returned at 21:43Z and accepted within isolated scope + +**User-accepted D4 A+B contract unchanged:** **A** no new continuation run after durably committed operator revocation; **B** no release/start of definitely unstarted `preparing` run after revocation; uncertain/in-flight provider work is explicitly reconciled with safe best-effort stop, **not** externally atomic cancellation. + +**Actual worker-reported local state:** one clean unpushed isolated branch `d4/ab-revocation-guard-20261105` with **12 commits / 15 files / +2359/-50**, based on the original divergent experimental continuation tip, **not integrated**. No published branch was found by browser GitHub search. The manager cannot independently read the local code/logs. + +**K1 — `FULL-SERVER ASSEMBLY RUNTIME PASS (worker-reported; independent reviewer reran)`:** real exported `layerMakeServer` production root (same used by `runServer`), temp test homes, actual combined shared `SqlClient` and same SQLite path/inode, second writer blocked under `BEGIN IMMEDIATE`. Operator `updateTask(continuation:null)` as `user:maintainer` then real continuation path: **0 new runs, 0 provider-start effects, 0 accepted new-run receipt, typed denial, 0 adapter opens**. Launch-first exactly **one run/one effect**, idempotent same-attempt replay. Ordinary non-continuation user-run unaffected. + +**K2 — `NATURAL ASYNC RELEASE RUNTIME PASS (worker-reported; independent reviewer reran)`:** actual `schedulePreparation` held before `prepared-run.release`, real operator revocation, release denied with terminal cancelled run/orchestration attempt/Runtime attempt, failed (not done) tracker once, no start effect/adapter call/accepted release receipt or worktree. Same/fresh command retry/replay idempotent, late `prepared-run.fail` no-op, and real `reconcile_required` downgrade defect repaired. Denial intentionally observed via **durable state**, not by synchronous error to `launch()` caller. + +**K3 — `PARTIAL`:** full-root process crash/SIGKILL/restart/pruning, provider-portable stub runs and live/real adapter turns not established. Tests rely on installed/authenticated Claude/Codex adapters but intercept `openSession` and make **no paid/live provider turns**. External `startTurn` atomicity is outside accepted contract. D2 agent-facing `continuation` fields remain in the **unmerged experiment** and are an independent public-shipping blocker, **not K1/K2 failure**. No public release or hosted CI evidence. + +**Test/review provenance:** worker + independent reviewer each ran assembly suite **5/5 exit 0**; reviewer separately **94/94 focused exit 0**. Worker reports Runtime subtree **208 tests**, `check:changed` **118 tests**, server typecheck and lint/format/knip/GraphQL all PASS. Reviewer was **Codex GPT-6.1 SOL Medium on second Codex subscription**, different from the Sonnet implementation worker; final **REVIEW PASS WITH FINDINGS**, no blocking K1/K2 defect. Codex A exhausted until provider-reported **2026-11-08 21:15 UTC**; both Claude subscriptions temporarily quota-limited at report; Codex B available at review but remaining/reset UNKNOWN; DeepSeek orchestration-only. No source merge, push, production, paid provider call. [Full manager K1/K2 reconciliation](docs/orchestration-v2/manager-d4-full-root-k1-k2-verification-reconciliation-20261105.md). + +**Closure:** Original D4 implementation and [full-root verification packet](docs/orchestration-v2/task-d4-full-server-assembly-verification-20261105.md) are **COMPLETED / DO NOT REDISPATCH**. **Manager accepts K1/K2 RUNTIME PASS in isolated scope**, not `D4 INTEGRATED` or `PRODUCTION VERIFIED`. K3 remains partial for later release/integration qualification. No more local work is currently authorized by the bounded verification packet. + +**Superseded decision checkpoint:** The [integration options brief](docs/orchestration-v2/manager-post-d4-integration-options-20261105.md) previously recommended a bounded upstream-first isolated trial. **User explicitly AUTHORIZED that first trial on 2026-11-05 at 22:14Z**; fresh continuation/D4 re-land, fork-main merge, Git push/PR and production work remain **NOT AUTHORIZED**. Browser manager independently re-fetched latest upstream `25b53299b75d4d8d1d0667ad47e9cfed3749776e`, now **91 commits** ahead of the incorporated upstream parent (an additional 41 since Stage 2 initial research) with changed Orchestrator/ProviderTurnStart/MCP paths. This is **new drift requiring local source and merge-tree verification**, not permission for main integration. The earlier 1/2/9 read-only conflict counts are now historical to older upstream and must be refreshed. No direct merge of the 34-ahead/336-behind experimental branch. Current fork `main` remains at integrated PR #21 baseline `fb67545d790c5c001e8f85827f219ab6493c435e`, and original isolated experiment unchanged; PR #21 evidence user **KEEP PRIVATE**. Four detached Stage 2 verification worktrees, local D4 branch and read-only Files volume must remain untouched absent cleanup authorization. + +## Current state — overnight U/R/H COMPLETED and STOPPED after H (11:47 final return) + +**Latest:** user supplied the final [overnight U/R/H worker handoff](docs/orchestration-v2/manager-overnight-urh-final-reconciliation-20261106.md) on 2026-11-06 11:47. **`U G-U FINAL PASS / R G-R FINAL PASS / H ISOLATED INTEGRATION-READINESS CANDIDATE + REVIEW PASS / D2 PACKAGED SHIPPING NOT VERIFIED / K3 LIVE-PROVIDER START NOT VERIFIED / NOT INTEGRATED / NOT PRODUCTION VERIFIED`**. This supersedes previous R cross-provider review HOLD and H-not-started notes; original U/R handoff packets are HISTORICAL. No fourth stage authorized. All results below are **worker-reported**; the browser cannot inspect private local source/logs. + +**Sources and isolation:** Local-only clean U `trial/upstream-catchup-20261105` at `c037460c2f4a98e8c8f849928c92af6cb80e3d80` based on frozen upstream `25b53299b75d4d8d1d0667ad47e9cfed3749776e`; R `stage-r/continuation-d4-20261106` at `90f2f2d254b901a7b424474c615ac6dc69f945ec`, 4 commits / 33 files / +8613/−95; H `stage-h/d2-k3-20261106` at reported short local head `6550e1ca09`, **1 local commit / 9 files / +1079/−410, tests and fixtures only**. All worktrees reported clean and unpushed. Browser GitHub 2026-11-06 verified fork main unchanged at `fb67545d790c5c001e8f85827f219ab6493c435e`, and **no U/R/H remote branches**. Preserved primary/stale main, existing Stage 2/D4 worktrees, read-only Files mount and PRIVATE PR #21 evidence. Do not infer direct local source verification from remote absence. + +**U G-U FINAL PASS:** previous 900s monolithic `check:changed` timeout **NOT green**, but **367/367 affected files** executed in 29 complete batches, **8022 tests passed +65 Runtime/Evidence tests**, zero failed, four known OS/Nushell skips and **39/39 uncached workspace typechecks**. Different-provider independent reviewer PASS. U selected upstream tip remains **frozen**; don't auto-chase new upstream before integration decision. + +**R G-R FINAL PASS (reported):** fresh default-off continuation and D4 A+B implementation on U-derived branch, explicit `T3CODE_EXPERIMENTAL_CONTINUATION=1` for enablement. Full real server-root K1/K2 **8/8 PASS**: true operator `continuation:null`, single SQLite writer/transaction, revoke-first zero new durable runs/start effects/accepted receipts/adapter calls, async prepared release cancels unstarted run and attempt without start, idempotent replay and `reconcile_required` preservation; launch-first one run/start effect; ordinary user unaffected. Worker focused **206/206**, prior reviewer **210/210**, `check:changed` all phases **22 files/294 tests**, **36 package typechecks** PASS. Prior 2 bounded repair cycles found/repaired serious worktree/authorization paths. **Later qualifying independent Codex GPT-6.1 SOL Medium READ-ONLY REVIEW PASS WITH FINDINGS**, no blocking/major and independently reran **K1/K2 8/8, 199 focused, 7 budget tests**. This **CLOSES** prior cross-provider G-R hold. Prior Claude Opus R fallback was **USER-CONFIRMED APPROVED**, no further Opus; no paid API reported. + +**H completed (tests/fixtures only):** new isolated H worktree with **118/118 focused tests across 11 files**, `check:changed` all phases PASS **26 files / 335 tests**, **36 package typechecks**; independent Claude Sonnet 5.5 Medium different-provider read-only reviewer **REVIEW PASS**, reran 118/118 and confirmed restart-test refactor preserved existing bodies/budget assertions. **H DID NOT implement a new production MCP projection**; its tests validate the inherited R behavior and add recovery qualification. Source-loaded D2 agent-facing `tools/list` **82 tools / 2269 paths / 58799 UTF-8 bytes**, identical to frozen U baseline, **0 continuation-attributable bytes** and no experimental continuation create/update/result field; internal operator policy create/read/update/revoke preserved. **`D2 SCOPED SOURCE-LOADED PASS`**, but **packaged authenticated paired-client schema/list and shipping behavior NOT VERIFIED**. + +**K3 bounded runtime PASS / release PARTIAL:** disposable temp DB restart persistence; deterministic disposable child-process SIGKILL/barrier + two reopens, no provider resurrection; real pruning/truncation and honest `incomplete/unknown`; no extra effect on revoked replay; cross-project isolation and ordinary runs; two adapter-independent provider stubs, default-off. **Real external provider `startTurn` crash windows, power loss, native/relay client or hosted production remain unexercised**; no externally atomic provider cancellation promised. Missing two fail-closed mutation tests, silent operator-edit stall/fenced-outbox state and broader late-fail remain as nonblocking release-risk items. + +**Routing, provenance and limits:** durable host-local restricted ledger is **461 lines**, append-only, verified after write per handoff. No exposed Runtime task/handoff append tool; fallback permissible but **do not claim Runtime-native orchestration persistence**. **16/18 actual distinct technical/reviewer dispatches**: U 5, failed Codex 1, R 7, independent Codex review 1, H writer 1, H different-provider reviewer 1; seven extra `t3_thread_send` turns were actual **same-task resumes**, not new assignments. DeepSeek orchestration only. No model live/paid turns/spend reported, not independently browser-verified. Overnight authorization **ended after H**; remaining two slots do not authorize an extra stage. + +**Next proposed locally executable task:** [Packaged/authenticated D2 agent MCP shipping-schema verification](docs/orchestration-v2/task-post-h-packaged-d2-shipping-verification-proposed-20261106.md) is **PREPARED / AWAITING OWNER AUTHORIZATION / NOT DISPATCHED**. It requires a supported packaged client+auth flow and real shipping schema bytes, no paid turns, no fork-main merge or production. If packaged auth cannot be run without unsafe credentials/cost, report OPERATIONAL BLOCKER, not a shipping PASS. + +**Next product gates:** (1) packaged/authenticated paired-client D2 `tools/list`/operator policy verification and shipping byte budget; (2) scoped real-provider K3 start/crash/reconcile verification only under clear provider/cost safety; (3) full CI/build/release/native/UI verification as relevant; (4) distinct user approval for any fork-main merge, push/public PR, release or default-on enablement. Keep U/R/H **ISOLATED / NOT INTEGRATED / NOT PRODUCTION VERIFIED**. See [manager final review](docs/orchestration-v2/manager-overnight-urh-final-reconciliation-20261106.md). A parallel **cooperative upstream PR #28777 conflict/test handoff** remains **PREPARED / NOT DISPATCHED**, distinct from U/R/H and this completed overnight ledger. + +## Accepted continuation safety decisions (binding; separate workstream) + +**D1 — experimental default-off gate:** user approved and it is **IMPLEMENTED / local RUNTIME PASS / independent REVIEW PASS** on [isolated gate branch](https://github.com/jermur788/t3code/tree/experiment/continuation-default-off-gate-20261104). Enabled only when the server environment exactly sets `T3CODE_EXPERIMENTAL_CONTINUATION=1`. Missing/invalid stays off; non-null policy writes and automatic review/repair/replay are blocked while off; safely unambiguous unlaunched receipts cancel, uncertain ones require reconciliation. 192 Project Runtime tests and full changed-file checks passed locally. **Not merged into main or PR #21.** + +**D2 — public shipping exclusion:** user approved requiring **experimental continuation and its agent-facing tool-schema overhead to be excluded before any public release**. This is a **release acceptance requirement, not implemented**. The experimental continuation's earlier +646-byte MCP tool-list delta is tolerated **only in isolated/unmerged research**, not approved for shipping. + +**D3 — experimental cancellation:** best-effort final authorization check + receipt cancellation/reconciliation is acceptable **only for isolated stub-provider experimentation**. Known final-check-to-external-launch race can start one turn after revocation; do not claim it closed. + +**D4 — product contract ACCEPTED on 2026-11-05:** user approved **A** strict no-new-run at durable `run.created` transaction commit after revocation, plus **B** blocking prepared-but-not-started release/start when safely provable, with cancellation/reconciliation for ambiguous/in-flight work. [Binding D4 accepted contract](docs/orchestration-v2/d4-accepted-revocation-contract-20261105.md) overrides older undecided options. This is **NOT IMPLEMENTED** and not an externally atomic provider-start promise; no new authority/epoch table, large upstream engine rewrite, or main merge was approved. + +Governing spec: [Continuation staged safety](docs/orchestration-v2/continuation-staged-safety-governing-spec-20261104.md). + +## Other project tracks / historical continuity + +- **Project Runtime V1, Development Profiles V1, Task/Handoff State V1, Fork Project Home and Runtime Task Routing & Execution V1** were integrated/verified in the earlier project-state record. Their implementation must remain intact under upstream sync. +- **Documentation V1**: integrated, but the independent fresh-user golden-path and troubleshooting/restart qualification in the 2026-10-31 Current State was still **PENDING / OPERATIONAL BLOCKER** at last supported evidence. Do not silently mark Documentation V1 `VERIFIED`; reconcile separately after current PR #21 verification. +- **Adaptive Orchestration direction**: evidence-driven, provider-neutral and cost-aware, with retained CCF overnight evidence and provider/model/attempt routing records. A learned router is *not* authorized merely because the direction is accepted; avoid premature autonomous routing-policy claims. +- **Upstream PR #28777 — Maria's Nov 5 response, reviewed Nov 6:** [PR](https://github.com/pingdotgg/t3code/pull/28777) author acknowledged our [test-only interrupted-delegated-review regression patch](https://github.com/jermur788/t3code/blob/research/pr-28777-continuation-regression-20261103/docs/orchestration-v2/research-pr28777-original-interrupted-corrected.patch) but **the current PR head does not include the `original-interrupted` test case** (manager verified diff and source). [Maria's update](https://github.com/pingdotgg/t3code/pull/28777#issuecomment-6637277589) says she merged current main without rebase, preserved two eval cases, remeasured budgets below main and passed 28 CI checks; [her budget reply](https://github.com/pingdotgg/t3code/pull/28777#discussion_r4487097364) says **no `agent-context-increase` label required**, and CodeRabbit withdrew its request. **Current GitHub API: OPEN / NOT MERGED / `mergeable_state=dirty`** against newer main, notwithstanding Maria's no-conflicts statement at her update. **Live child client/session retention remains unverified**. Upstream research only; no PR comment, patch push or main integration authorized. Keep fork PRs #20/#21 distinct. +- **New separately prepared cooperative upstream task, 2026-11-06 11:40:** User asks for a self-contained **DeepSeek-orchestrated conflict/test cooperation handoff** for another chat or T2/T3 Code. [Task packet](docs/orchestration-v2/task-upstream-pr28777-cooperative-conflict-and-regression-20261106.md) now **PREPARED / NOT DISPATCHED**: new isolated local lane to diagnose current PR merge conflicts, prepare a minimal resolution, rebase our `original-interrupted` test-only patch and verify/review it. Initial technical writer Codex SOL Medium, independent reviewer Sonnet Medium; Opus Low/Medium only for justified hard escalation under user routing discretion. Mandatory durable pre/post-dispatch Runtime/append-only routing ledger. **No public push, PR submission, author-branch edit or comment without separate user authorization.** This is separate from ongoing local Stage R G-R HOLD and must not disturb U/R/H/source/evidence. Keep cooperative contributor/maintainer choice over whether to include preventive test. + +## Routing / execution state + +**Accepted user routing directive, 2026-11-04:** DeepSeek only orchestrates future T3 Code tasks; it does **not** implement, edit source or execute development tests. It coordinates worker selection, subscription supervision, attempts, review, state/ledger updates and handoff. All implementation/tests use Codex **GPT-6.1 SOL Medium** or Claude **Sonnet 5.5 Medium**. Escalate genuinely difficult unresolved work to **Claude Opus 5.5** as justified. Use distinct model/provider for independent read-only review. Preserve one writer per overlapping lane; normal two evidence-backed remediation attempts apply before expensive escalation when safe. + +The user reported DeepSeek/OpenCode at **~10% of its 30-day allocation with ~10 days remaining** (user observation at 09:46Z, not telemetry). Reserve that subscription for coordination. Track separately each provider/subscription availability, actual capacity evidence/UNKNOWN, quota and provider-confirmed five-hour reset; checkpoint, safely switch to an available authorized pool, or resume after reset using a real supported T3 host mechanism. If background resumption is unavailable, write a precise continuation handoff; never claim a nonexistent automatic scheduler. + +Every future local task handoff must include a **copy/paste-ready DeepSeek instruction** plus a durable source link, using the [accepted compact template](docs/orchestration-v2/DEEPSEEK_ORCHESTRATOR_HANDOFF_TEMPLATE_V1.md). Runtime task/attempt/handoff records are preferred; append-only branch ledger fallback. Record route/attempt/alternatives, exact model/effort, capacity evidence, reason, tests and review, outcomes and next action as events occur. No fabricated costs or reset times. + +The completed P2 repair used DeepSeek V4.1 Flash for orchestration + implementation and Codex review under the prior already-issued packet. The new directive applies **prospectively**; do not retroactively alter its evidence or routing history. Browser manager has GitHub/source access, not a live local T3 worker bridge. + +## Pending gates and required user decisions + +| Gate | Current state | Next action / authority | +| --- | --- | --- | +| Upstream reconciliation and P2 Evidence V0 | **`INTEGRATED`**, independently verified GitHub fork-main merge | Maintain accepted baseline; no remerge | +| Post-merge local runtime qualification | **`LOCAL RUNTIME PASS (worker-reported) / REVIEW PASS WITH FINDINGS (recorded)`** | Source/evidence limitations retained, no production PASS | +| Original evidence and sanitized package v2 | **`EVIDENCE CLOSED LOCALLY (worker-reported)`** with reported hashes and two independent reviews | Originals/package remain host-local; no remote audit claim | +| Sanitized evidence candidate preparation + checksum correction | **`LOCAL PREPARATION INTEGRITY PASS (worker-reported) / REVIEW PASS (recorded)`** — 81 files; 80/80 non-self checksum PASS | [Manager acceptance](docs/orchestration-v2/manager-pr21-sanitized-subset-integrity-acceptance-20261105.md). Both local tasks complete; no further worker rerun needed, candidate remains private | +| Sanitized evidence publication/upload | **`KEEP PRIVATE / NOT AUTHORIZED / NOT DONE` — user decision 2026-11-05** | Retain completed candidate and original evidence on worker host; do not propose or initiate publication as a pending task. Any future reversal requires an explicit new user instruction | +| Workspace/Development mode persistence | **`CLIENT-LOCAL RUNTIME PASS (reported)`** for normal server restart/same-profile reload | Browser-process restart/cross-device still NOT VERIFIED | +| App-level handoff write/isolation | **`NOT RUN / OPERATIONAL BLOCKER`** in tested no-cost host | Service-level tests exist; new credential/stub architecture needs separate decision | +| Hosted CI, live-provider/production/native/remote | **`NOT VERIFIED`** | No production claim | +| Old Evidence V0 decoder compatibility | **Coordinated fork upgrade accepted** | Public stable external format versioning still needed | +| Experimental continuation branch | **`NOT INTEGRATED`** | Keep isolated | +| D2 public shipping exclusion | **`DEFERRED` / not implemented** | Separate public release gate | +| D4 strict production revocation | **`A+B ACCEPTED / IMPLEMENTED ISOLATED (worker-reported) / K1 + K2 FULL-ROOT RUNTIME PASS (reviewer reran) / K3 PARTIAL / NOT INTEGRATED OR PRODUCTION VERIFIED`** | [Manager final K1/K2 reconciliation](docs/orchestration-v2/manager-d4-full-root-k1-k2-verification-reconciliation-20261105.md). Original D4 packets CLOSED; D2 and later release remain separately gated | +| D2 built MCP tool-list audit | **`SCOPED SOURCE-LOADED TRANSPORT AUDIT PASS / PACKAGED SHIPPING NOT VERIFIED`** | 79 tools, +646 context bytes in experiment, default-off does not hide it; require packaged/authorized client before release | +| Upstream catch-up U | **`IMPLEMENTED LOCAL (worker-reported) / STATIC PASS WITH 900s TIMEOUT CAVEAT / BOUNDED RUNTIME PASS / REVIEW PASS / NOT INTEGRATED`** | [Manager U review](docs/orchestration-v2/manager-upstream-trial-return-reconciliation-20261106.md): 91 frozen upstream commits, 2 conflicts, 8,087 batched passing tests; no main merge | +| Overnight G-U / upstream candidate | **`G-U FINAL PASS (worker-reported; monolithic timeout caveat)`** | [U/R/H final reconciliation](docs/orchestration-v2/manager-overnight-urh-final-reconciliation-20261106.md); 367 affected files and 39 uncached typechecks; local/unpushed | +| Stage R continuation + D4 | **`G-R FINAL PASS (worker-reported; Codex independent cross-provider REVIEW PASS WITH FINDINGS)`** | K1/K2 actual server root 8/8, Codex reran 8/8 and focused tests; previous R review HOLD **CLOSED**; default-off, isolated | +| Stage H D2/K3 | **`ISOLATED INTEGRATION-READINESS CANDIDATE / REVIEW PASS / D2 SOURCE-LOADED PASS, PACKAGED NOT VERIFIED / K3 BOUNDED RUNTIME PASS, LIVE PROVIDER NOT VERIFIED`** | H **tests/fixtures only**, 118 focused and 335 changed-file tests PASS; different-provider review; overnight **STOPPED AFTER H**; no new stage authorized | +| Research PR #20 / Documentation V1 | **Unmerged draft / fresh-user qualifier deferred** | Separate scope | + +## Next manager loop — final U/R/H qualified locally; release/integration decisions open + +1. Read Project Instructions → Current State → Coordination/Handoff Protocol → [final U/R/H manager reconciliation](docs/orchestration-v2/manager-overnight-urh-final-reconciliation-20261106.md) → overnight amendment and accepted D2/D4 specifications → actual local Runtime/restricted ledger when authorized. **U G-U, R G-R FINAL PASS, H REVIEW PASS** (worker-reported). Earlier R G-R HOLD, H NOT STARTED and pending cross-provider review handoffs are **HISTORICAL / DO NOT REDISPATCH**. +2. **Full browser-visible truth:** fork `main` unchanged, U/R/H branches all LOCAL ONLY and not present in remote; no browser access to their private source/logs. Do not overclaim `INTEGRATED`, `PRODUCTION VERIFIED`, packaged D2 or live-provider K3. H changed tests/fixtures only, not a production D2 implementation. +3. The user-approved overnight sequence **STOPPED AFTER H**, with 16/18 distinct technical/review dispatches logged in permitted restricted ledger; remaining slots do **not** extend authorization. DeepSeek routing and T3 Runtime task/handoff append is **not** available in that host session, so the fallback is not proof of provider-neutral Runtime-native orchestration. +4. **Next material user choice:** whether to authorize a bounded, preferably no-cost **packaged/authenticated D2 MCP shipping-schema verification**, optionally controlled provider-start K3 crash qualification with explicit costs/credentials, before integration. Prepare scoped task on accepted authority; stop for material paid use, real user processes/data, product architecture, source push. Distinguish later fork-main merge/public PR/production enablement decisions. +5. Before any integration, freeze/refresh actual upstream/fork refs, inspect own worktree and unrelated changes, reconcile U/R/H migrations and current upstream drift; use separate isolated one-writer lane, relevant independent review, full CI/build/UI and restart evidence; never merge old divergent experiment directly. No shared-main merge or Git push without approval. +6. Separate parallel [upstream PR #28777 cooperative conflict/regression task](docs/orchestration-v2/task-upstream-pr28777-cooperative-conflict-and-regression-20261106.md) is **PREPARED / NOT DISPATCHED** and must preserve U/R/H worktrees and private PR #21 evidence. Public upstream comment/PR submission still needs approval. + +**Hard stops:** any main merge, Git push/public PR, production/default-on, material paid model/infrastructure, new authority store/architecture, destructive cleanup, disclosure of private evidence or weakening of release verification without owner decision. diff --git a/02_COORDINATION_HANDOFF_PROTOCOL.md b/02_COORDINATION_HANDOFF_PROTOCOL.md new file mode 100644 index 0000000000000..02b9fb4364fbb --- /dev/null +++ b/02_COORDINATION_HANDOFF_PROTOCOL.md @@ -0,0 +1,220 @@ +# T3 Fork — Coordination and Automatic Handoff Protocol + +**Classification:** STABLE COORDINATION INSTRUCTIONS, mirrored to shared GitHub from the project's governing Coordination/Handoff Protocol. Update this deliberately if the governing protocol changes; do not silently reinterpret it. +**Current state:** [01_CURRENT_STATE.md](01_CURRENT_STATE.md). **Manager continuation:** [OVERALL_MANAGER_HANDOFF.md](OVERALL_MANAGER_HANDOFF.md). + +## Purpose + +Make multi-worker and multi-manager development continue with minimal manual relay while preserving explicit authority, repo safety, and verifiable state. + +## Canonical-state rule + +Chat history is not project state. + +Canonical continuation should come from: +1. Project Instructions; +2. Current State / Roadmap; +3. governing spec; +4. Runtime task state; +5. latest authoritative handoff; +6. inspected repository/runtime evidence. + +Historical handoffs may explain how the project arrived here, but they must not override newer accepted state. + +## When a handoff is mandatory + +Create a handoff automatically after any substantial: +- implementation task; +- investigation that changes architectural understanding; +- review with material findings or pass verdict; +- verification/qualification gate; +- integration/merge; +- blocker that changes sequencing; +- provider/thread/worktree transition where another worker will continue; +- manager-chat transition; +- long phase whose accumulated state would otherwise require rereading chat history. + +Tiny local fixes inside one ongoing worker session do not need separate handoffs unless they materially change accepted state. + +## Mandatory paste-ready DeepSeek orchestration handoffs (accepted user policy, 2026-11-04) + +Whenever the next authorized action needs a T3 Code worker/session, the Overall Manager must provide **one complete, copy-and-paste-ready handoff in the user-facing reply** and preserve the same authoritative packet in Runtime or the branch ledger. Writing or linking a packet never starts a worker. Use the [compact standard handoff template](docs/orchestration-v2/DEEPSEEK_ORCHESTRATOR_HANDOFF_TEMPLATE_V1.md) with task-specific governing spec, base, scope, verification and stop conditions. + +**DeepSeek is an orchestration-only resource** for future dispatches: task decomposition, selecting workers, supervising status and usage limits, inspecting evidence, routing bounded repairs/reviews, maintaining authoritative task/ledger records, and completing handoffs. **Do not route implementation, source edits, development test execution or code review to DeepSeek.** Preserve its limited OpenCode subscription for high-leverage coordination. This does not retroactively invalidate already-dispatched P2 work, which ran under the prior task packet. + +**Development worker policy:** Assign **all implementation, debugging and test execution** to **Codex GPT-6.1 SOL — Medium** or **Claude Sonnet 5.5 — Medium**, selecting on task fit, actual provider/subscription availability, ownership, and available capacity evidence. Independent reviewer must be a different provider/model from the implementer and read-only. Escalate materially difficult unresolved security/concurrency/integration to **Claude Opus 5.5** at the least adequate effort (normally Low/Medium initially); Opus is not a default. Two genuinely different evidence-backed routine remediation attempts precede expensive escalation when safe; immediate authority/security stops do not wait for retries. DeepSeek remains orchestrator throughout. + +**Subscription watch and recovery:** Each subscription (e.g. separate Claude pools) is tracked independently at start, dispatch, completion, auth/quota error, and logical transition: `AVAILABLE`, `BUSY`, `COOLDOWN/QUOTA`, `LOGIN-UNAVAILABLE`, or `UNKNOWN`; task in flight; source and provider-reported five-hour reset/window; remaining allowance if actually available. The user's **~10% remaining 30-day DeepSeek allocation with ~10 days remaining** is a dated user report, *not* live measurement. If a worker hits an actual limit, checkpoint its owned work and ledger, reroute to an available authorized model/subscription if safe, or resume after a **provider-confirmed reset** using a real supported T3 continuation mechanism. If the host cannot wait/resume unattended, publish an exact restart-ready handoff; do not claim background automatic restart. Never bypass quotas or invent allowance/reset times. + +**Ledger:** Update T3 Project Runtime task/attempt/handoff state as events happen; fall back to an append-only owned branch ledger if Runtime is unavailable. Record UTC time, task and attempt, orchestrator, requested and actual worker provider/model/effort, options rejected and reason, capacity and source (or UNKNOWN), branch/worktree writer, tests/outcomes/failure, independent reviewer, next action. Keep observed facts, orchestrator claims, and retrospective inferences distinct; do not promote worker claims to independently proven success. + +**Template completeness:** start command for DeepSeek; objective and governing spec; actual repo/base/ownership; worker and quota policy; acceptance tests; independent review; ledger location; escalation, stop and final handoff instructions. Preserve one writer per overlapping lane. No worker may merge, rewrite history, incur material paid cost, bypass security or change accepted architecture without applicable authorization. + +**Status:** Accepted prospective orchestration/routing policy. The previously issued P2 handoff and its completed historical provider choices are not reinterpreted as violations. + +## Worker end-of-task protocol + +Before ending substantial work, the worker should: +1. inspect final repo/worktree status; +2. run the acceptance/verification required by the task packet; +3. update the Runtime task if available; +4. append a Runtime handoff if available; +5. return the same essential handoff to the manager; +6. stop without starting an unauthorized milestone. + +If Runtime handoff tooling is unavailable, the structured handoff returned to the manager is mandatory and the manager should persist/reconcile it as soon as possible. + +## Required handoff fields + +### VERDICT +One of the precise project states appropriate to the task, e.g. IMPLEMENTED, STATIC PASS, RUNTIME PASS, REVIEW PASS, VERIFIED, BLOCKED. + +### BASE / CHECKPOINT +- starting base; +- branch/worktree; +- final revision/checkpoint; +- relevant upstream revision; +- working-tree cleanliness. + +### RESULT +- concise description of what changed or was learned; +- files/components affected; +- intentional exclusions. + +### VERIFICATION +- exact tests/checks run; +- important counts/results; +- runtime/UI/restart/provider evidence where required; +- checks not run and why. + +### FAILURES / RISKS +- real failures encountered and repairs; +- unresolved risks; +- blocker classification where applicable. + +### REVIEW +- reviewer/provider/model for material reviews; +- findings; +- repairs; +- re-review result. + +### INTEGRATION STATE +- not integrated / PR open / merged / verified integrated head; +- whether content drift exists; +- whether cleanup remains. + +### NEXT +- exact next authorized action; +- whether user action is needed; +- explicit stop condition if no further work is authorized. + +## Manager handoff-consumption protocol + +When a worker returns a handoff, the manager should automatically: +1. compare it with the governing spec/task packet; +2. inspect repo/runtime evidence proportionate to risk; +3. reject unsupported status claims; +4. classify defects/blockers; +5. route routine repairs or independent review without asking the user; +6. update Current State and Runtime task/handoff state when appropriate; +7. integrate if already authorized and acceptance is satisfied; +8. verify the integrated head where required; +9. issue the next authorized task packet. + +The manager should not stop simply to report that a worker finished. + +## Automatic continuation state machine + +`TASK ISSUED -> IMPLEMENTATION -> REVIEW/VERIFY -> REPAIR IF NEEDED -> RE-REVIEW -> INTEGRATE IF AUTHORIZED -> VERIFY INTEGRATED HEAD -> UPDATE CANONICAL STATE -> NEXT AUTHORIZED TASK` + +Only leave this flow for a genuine stop condition. + +## Stop conditions requiring the user + +Stop for: +- product choice; +- material architecture trade-off; +- meaningful scope expansion; +- irreversible/destructive decision; +- unresolved security or integration conflict; +- paid infrastructure/material cost decision; +- conflict between current user intent and accepted project direction. + +Do not stop for routine: +- test failures; +- implementation defects; +- review findings; +- migration fixes; +- lint/typecheck issues; +- CI retries/reconciliation; +- evidence collection; +- already-authorized integration. + +## Task-packet requirements + +Substantial task packets should be self-contained and include: +- TASK; +- ROUTING; +- BASE/CONTEXT; +- GOVERNING SPEC; +- GOAL; +- IN SCOPE; +- OUT OF SCOPE; +- OWNERSHIP; +- ACCEPTANCE; +- VERIFICATION; +- STOP CONDITIONS; +- HANDOFF. + +A packet must work without manager-chat history. + +## Parallel work + +Use parallel workers only when ownership is non-overlapping or isolated by worktree/component. One writer per overlapping lane. Independent read-only review/research may run in parallel. The manager owns reconciliation and integration order. + +## Manager transition protocol + +Before creating a fresh manager chat: +1. update Current State / Roadmap; +2. ensure active tasks have current status and latest handoffs; +3. record the authoritative repo base and active milestone/gate; +4. archive or clearly mark stale source files as historical; +5. create a concise Overall Manager handoff only for details not already captured canonically. + +The new manager should not need the old chat to continue. + +## Source hygiene + +Maintain a small canonical source set. Prefer updating current-state files over adding endless chronological handoff documents. + +Recommended project sources: +- `PROJECT_INSTRUCTIONS` — stable behavior/authority rules (stored in Project Instructions; this markdown is a copy/reference); +- `01_CURRENT_STATE.md` — volatile current base, milestone, decisions, roadmap, immediate next action; +- `02_COORDINATION_HANDOFF_PROTOCOL.md` — stable task/handoff/continuation process; +- governing milestone specs as separate authoritative sources when active. + +When a source becomes historical, mark/archive it rather than leaving contradictory “current” instructions discoverable beside the new state. + +## Source authority labels + +When practical, classify sources as: +- decision; +- spec; +- implementation truth; +- coordination state; +- research; +- reference; +- historical. + +When sources conflict, follow the project authority model and surface the conflict rather than silently blending them. + +## User-facing reporting + +Keep detailed technical evidence in handoffs. User-facing updates after important transitions should state: +1. what changed; +2. what passed/failed; +3. what it means; +4. what happens next; +5. whether the user must act. + +If no user action is needed, say so and continue. diff --git a/JAS_T3_FORK_MANAGER_HANDOFF_20261104.md b/JAS_T3_FORK_MANAGER_HANDOFF_20261104.md new file mode 100644 index 0000000000000..141c2ae193236 --- /dev/null +++ b/JAS_T3_FORK_MANAGER_HANDOFF_20261104.md @@ -0,0 +1,29 @@ +# Jas — T3 Fork Manager Handoff +**Updated:** 4 November 2026 +**Status:** Current transition brief; detailed truth lives in linked sources. + +## Role and objective +You are the **Overall Manager** for T3 Fork; the user makes final product decisions. Build an upstream-friendly fork with a **provider-neutral Project Runtime**. State, decisions, tasks, handoffs and execution evidence must persist outside chats and individual models. CCF is the first use case; the operations dashboard remains a separate project. + +## Read first +- [Current State / Roadmap](01_CURRENT_STATE.md) — authoritative milestone, decisions, blockers. +- [Coordination/Handoff Protocol](02_COORDINATION_HANDOFF_PROTOCOL.md) — task lifecycle, routing, verification, Git safety. +- [Full manager handoff](OVERALL_MANAGER_HANDOFF.md) — context and accepted authority. +- [Pre-merge verification task](docs/orchestration-v2/task-verify-reconciled-v017-before-main-20261104.md). + +Inspect live GitHub, Runtime and worktrees before trusting recorded statuses. Worker claims are not proof. + +## Current position +- [Fork-only PR #21](https://github.com/jermur788/t3code/pull/21) is **OPEN, DRAFT, UNMERGED**; fork `main` is unchanged. It reconciles upstream **v0.1.7**, resolving seven conflicts. Local evidence reports 40-package typecheck, web build and 2,072 changed-file tests passing; independent Codex review was clean. **No hosted CI or complete production verification** was established. +- [PR #20](https://github.com/jermur788/t3code/pull/20) remains a separate draft research PR. +- [Default-off continuation experiment](https://github.com/jermur788/t3code/tree/experiment/continuation-default-off-gate-20261104) is implemented and reviewed **on an isolated branch**; it is **not in PR #21 or main**. + +## Decisions already approved +The experiment must be **server-gated off by default**. Best-effort cancellation is acceptable only in isolated stub testing. Before public release, exclude experimental agent-facing schemas and their extra context cost, and guarantee **no new run creation after durable authorization revocation**. Strict launch semantics still need architectural review; do not change upstream execution internals unilaterally. + +## Next authorized action +**Complete pre-merge verification for PR #21**: rendered UI for both route surfaces; file-backed restart and cross-project isolation; Evidence V0 recovery/export after pruning; affected tests, typechecks and budget checks; independent review. Use a fresh isolated worktree. Record routing choices and evidence in Runtime or a durable ledger. + +DeepSeek can coordinate routine work; escalate difficult security/integration issues to Codex/Claude-class models. Use two distinct evidence-backed repair attempts before escalation; enforce one writer per code lane. + +**Do not merge PR #21, enable production, rewrite history or spend materially without approval.** After verification, update canonical state and request a separate merge decision. Written handoffs do not start workers. diff --git a/OVERALL_MANAGER_HANDOFF.md b/OVERALL_MANAGER_HANDOFF.md new file mode 100644 index 0000000000000..1fb09bf8b654c --- /dev/null +++ b/OVERALL_MANAGER_HANDOFF.md @@ -0,0 +1,82 @@ +# Overall Manager — Authoritative Continuation Handoff + +**Updated:** 2026-11-06 after 11:47 U/R/H final handoff: U and R FINAL PASS, H isolated REVIEW PASS and scoped D2/K3 qualification; packaged D2, real-provider crash and production NOT VERIFIED. +**2026-11-07 BROWSER-ONLY DIAGNOSTICS:** Read [new public D4/D2 recovery evidence ledger](docs/orchestration-v2/browser-d4-d2-upstream-recovery-ledger-20261107.md) after [Current State](01_CURRENT_STATE.md). It records 210 upstream commits beyond frozen U, new upstream unstarted-run and usage-limit auto-resume recovery paths, grouped/batched shutdown changes, and direct old-experiment MCP schema exposure. It **does not** amend the private overnight ledger or prove local H packaged D2, D4 K3 external provider start, or a D4 defect. **Integration HOLD; fork main unchanged; no dispatch.** +**NEW MANAGER TRANSITION (2026-11-06):** [Complete T3 Fork successor-manager handoff](docs/orchestration-v2/overall-manager-transition-handoff-20261106.md) is the concise manager entrypoint after Current State and Coordination Protocol. It consolidates final U/R/H scopes, unchanged fork main, remote upstream drift, separate upstream PR cooperation, D2 packaged/K3 live-provider blockers, routing/ledger duties, private evidence, and approvals. Creating this handoff **did not launch workers, change source, merge, push or grant a new product authorization**. +**Classification:** MANAGER HANDOFF / CURRENT CONTINUATION ENTRYPOINT. +**Status:** Documentation published on the shared fork's **planning branch**, not fork main. No code merge, provider execution or production configuration change is effected by this file. + +## Mandatory read order for a new Overall Manager + +1. **Project Instructions** in the active ChatGPT T3 Fork Project. User is the final product decision maker; assistant is Overall Manager. +2. [**01_CURRENT_STATE.md**](01_CURRENT_STATE.md) — canonical current base, decisions, project milestone, active task, blockers. +3. [**02_COORDINATION_HANDOFF_PROTOCOL.md**](02_COORDINATION_HANDOFF_PROTOCOL.md) — stable lifecycle, handoff, safety, verification and transition rules. +4. [Accepted staged continuation safety spec](docs/orchestration-v2/continuation-staged-safety-governing-spec-20261104.md). + - **Current Stage 2 entrypoint:** [browser manager assessment](docs/orchestration-v2/manager-stage2-browser-first-assessment-20261105.md), [D4 proposed contract](docs/orchestration-v2/d4-transactional-revocation-proposed-contract-20261105.md), [D2 shipping audit plan](docs/orchestration-v2/d2-shipping-exclusion-audit-plan-20261105.md). These supersede earlier generic research priorities; proposals are not accepted architecture decisions. +5. [Current bounded Evidence V0 pruning repair task](docs/orchestration-v2/task-evidence-v0-pruning-completeness-p2-20261104.md), then [completed V1–V5 qualification packet](docs/orchestration-v2/task-verify-reconciled-v017-before-main-20261104.md) and [PR #21 source/conflict ledger](https://github.com/jermur788/t3code/blob/integration/fork-upstream-reconciliation-trial-20261104/docs/orchestration-v2/fork-upstream-reconciliation-routing-ledger-20261104.md). +6. Inspect current GitHub PRs and repo heads / any live T3 Runtime tasks and handoffs. Latest reported Git history is *not* enough to establish current clean state. + +Historical chats are supporting evidence; do not treat them as authoritative if a newer canonical document or repo contradicts them. + +## Situation in one paragraph + +**Latest 2026-11-06 11:47 worker handoff is final for the authorized overnight U→R→H sequence.** U upstream catch-up **G-U FINAL PASS** (367 test files / 8,022 passing tests + 65 supplements, 39 uncached typechecks, complete batched substitution for a timed-out 900s monolithic wrapper), R default-off continuation and D4 A+B **G-R FINAL PASS** with actual combined root K1/K2 **8/8**, focused/changing-file checks passing and **new Codex GPT-6.1 SOL Medium cross-provider read-only review PASS WITH FINDINGS**, and H **ISOLATED INTEGRATION-READINESS CANDIDATE / REVIEW PASS** with 118 focused / 335 changed-file tests passing and independent Claude Sonnet 5.5 review. H changed **tests and fixtures only**, not a production D2 schema implementation: source-loaded agent MCP tool list matches U baseline with zero continuation-attributable bytes; **D2 PACKAGED AUTHENTICATED SHIPPING NOT VERIFIED**. K3 disposable restart/crash/pruning and two-stub provider-neutral verification PASS in scope; real external-provider start/crash windows and power-loss not verified. **All three local worktrees clean/unpushed per worker report; browser independently checked fork main unchanged and no U/R/H remote branches.** The final ledger reports **16/18 distinct technical/reviewer dispatches**, plus 7 classified same-task resumes, with restricted local append-only fallback because T3 Runtime append was not exposed. Stage R owner-approved Opus recorded, no further Opus. **OVERNIGHT TASK STOPPED AFTER H — no fourth stage or automatic merge.** [Final manager reconciliation](docs/orchestration-v2/manager-overnight-urh-final-reconciliation-20261106.md) is canonical; old R cross-provider gate handoff and H-not-started status are historical, **DO NOT REDISPATCH**. The separate upstream cooperative PR #28777 handoff is independently **PREPARED / NOT DISPATCHED**, no overlap or public contribution yet. Next requires a user choice on packaged D2 / controlled K3 and eventually isolated integration, fork-main merge and release. No private evidence publication or paid external turn authorized. + +## BASE / CHECKPOINT + +- Repo `jermur788/t3code` fork `main`: `fb67545d790c5c001e8f85827f219ab6493c435e`, unchanged at last manager GitHub check. Two parents: prior main `d3bedef12a31f368e5c5a6b279445bea39a6a13a`, reviewed PR #21 head `0e0c7bc2cb1bb805f273123686303a68e1c2807c`. PR #21 **CLOSED / MERGED**. Upstream parent is release-preparation code 25 commits after v0.1.7 tag, not necessarily latest upstream. +- Authoritative [Current State](01_CURRENT_STATE.md), [post-merge qualification manager review](docs/orchestration-v2/manager-postmerge-pr21-verification-reconciliation-20261104.md), and [new post-merge evidence-closure manager review](docs/orchestration-v2/manager-postmerge-pr21-evidence-closure-reconciliation-20261104.md). Older local-package checklist is historical, not a future task to redo. +- Local-only verification/evidence on worker host: `/media/jer/Files/Worktrees/t3-postmerge-pr21-verification-20261104`; originals `/media/jer/Files/Worktrees/pr21-verify-evidence-20261104/` (164 files / 9,803,931 bytes, worker-checksums OK); v2 package `/media/jer/Files/Worktrees/pr21-evidence-package-20261104-v2/` (89 files / 754,717 bytes, worker-checksums OK); final restricted ledger delta `/media/jer/Files/Worktrees/pr21-evidence-final-ledger-20261104/`. The worker-reported local verification branch **was not found in GitHub** at manager query; **no link to original raw evidence is established**. +- [Accepted DeepSeek-only template](docs/orchestration-v2/DEEPSEEK_ORCHESTRATOR_HANDOFF_TEMPLATE_V1.md) applies to future worker dispatches. The **previous evidence-closure handoff was actually executed** and returned; do not dispatch that same task again. + +## VERDICT / RESULT / VERIFICATION + +**`INTEGRATED` (independently checked GitHub) / `POST-MERGE LOCAL RUNTIME PASS (worker-reported)` / `EVIDENCE CLOSED LOCALLY (worker-reported)` / `REVIEW PASS WITH FINDINGS (worker-recorded)`; `NOT PRODUCTION VERIFIED`.** + +- Preceding post-merge local qualification reported fresh typecheck 40 packages, Evidence V0 suite 36 tests, eight Project Runtime/Task suites 103 tests, broad 81 test files/2,075 tests, successful web build, rendered fork Project Home/upstream navigation, live-app SQLite stop/start and cross-project read isolation, and genuine V2 pruning marker with old-decoder incompatibility correctly identified. +- Closure workers checked 164/164 original file checksums and 87/87 v2-package checksums (self-checksum and SIZE excluded). Package v2 reportedly contains 78 sanitized files; revised after prior UUID leakage and stale-inventory reviewer findings. Three traceIds and a redacted `Bearer ` label remain. All sanitization claims are **worker-reported pattern checks**, not manager-certified safe for public upload. Ledger changed after package snapshot by three disclosed append-only entries while package v2 stayed unchanged. +- **Mode check now CLIENT-LOCAL PASS:** `localStorage["t3-fork:interface-mode"]` held `workspace` through application stop/start and same-profile page reload; source confirms this key and development default. No browser-process restart or cross-device claim. +- **Handoff write/isolation still NOT RUN:** MCP `t3_project_handoff_append` is session-scoped and project RPC offers list/read only; worker host lacked a supported no-cost append path. Manager inspected those source boundaries. Do not infer external local provider possibilities are impossible or that service-level tests prove app-level operation. +- Two independent read-only reviewer roles recorded **PASS WITH FINDINGS** after two legitimate rework loops on mode evidence and package-v2 redaction. DeepSeek V4.1 Flash orchestrated only, not implementation/test; Codex SOL Medium and Sonnet 5.5 Medium executed; Opus not used; quotas/reset data UNKNOWN. +- **Not independently reviewed raw bytes:** manager cannot see worker-local 9.8-MB originals/755-KB package, screenshots or full ledger; no hosted CI, paid live-provider, production/native/remote qualification. Do not claim a remote audit trail was published. + +## NEXT — U/R/H complete; qualify remaining shipping gates or decide integration sequence + +1. Read Project Instructions → [Current State](01_CURRENT_STATE.md) → [Coordination Protocol](02_COORDINATION_HANDOFF_PROTOCOL.md) → [FINAL U/R/H manager reconciliation](docs/orchestration-v2/manager-overnight-urh-final-reconciliation-20261106.md) → accepted D2/D4 governing specs → actual Runtime/restricted ledger/source when access is authorized. The old [R cross-provider review packet](docs/orchestration-v2/handoff-stage-r-cross-provider-review-gate-20261106.md) is **COMPLETED BY LATER REVIEW** and MUST NOT be redispatched. +2. **Final stage statuses:** U `G-U FINAL PASS` with 900s monolithic wrapper timeout **not green**, full batched manifest PASS; R `G-R FINAL PASS` with qualifying Codex cross-provider reviewer + K1/K2 full-root; H `ISOLATED LOCAL REVIEW PASS / SCOPED D2 SOURCE-LOADED PASS / BOUNDED K3 RUNTIME PASS`, **D2 PACKAGED/REAL PROVIDER PRODUCTION NOT VERIFIED**. All worker-reported, browser GitHub verifies fork main unchanged/no U/R/H remote branches. +3. **Overnight stop honored:** U/R/H STOPPED AFTER H, **16/18 distinct technical/reviewer dispatches** reconciled and 7 same-task resumes, no fourth stage authorized by the unused 2 slots. Restricted 461-line local routing ledger only; T3 Runtime task/handoff append API unavailable in that session. Preserve source, log and security boundaries. +4. **Next authorized manager work:** assess release/integration options in browser and prepare a decision-ready scoped task. **User decision required** before any new T3 Code local qualification stage; recommended first is no-cost **packaged/authenticated D2 MCP agent `tools/list` and internal operator-policy verification**, then scoped K3 controlled real provider start/crash work if its cost/credentials/safety can be approved. Real provider external `startTurn` atomicity was outside D4 accepted contract and may remain a limitation with honest reconciliation rather than false guarantee. +5. After selected qualification, separately authorize safe upstream-aware integration based on verified fork-main/worktree base and tests/review; do not merge divergent old experiment directly. Full CI/build/UI/native/relay/restart as target requires; no Git push/PR, fork main merge, default-on, production, paid provider, new DB authority or destructive cleanup without explicit approval. +6. **Parallel separate task:** [upstream PR #28777 cooperative conflict/test handoff](docs/orchestration-v2/task-upstream-pr28777-cooperative-conflict-and-regression-20261106.md) **PREPARED/NOT DISPATCHED**, with distinct isolated owner, mandatory routing ledger; no public comment or patch submission without approval. Preserve this independent of U/R/H and private PR #21 evidence. + +## USER-ACCEPTED DECISIONS (do not re-ask) + +- User authorized creation of **fork draft PR #21**, then at 2026-11-04 11:44Z selected **Option A**, explicitly accepting the **fork-only coordinated old-Evidence-V0 decoder upgrade limitation** and PR-source promotion. Promotion was completed. +- User separately approved **merging PR #21 into fork `main`** at 2026-11-04 12:31Z. Normal two-parent merge completed and independently verified. **Never re-ask merge permission for the already merged PR #21 or repeat the merge**. +- User approved DeepSeek **orchestration-only** for all future worker tasks, with Codex GPT-6.1 SOL Medium or Claude Sonnet 5.5 Medium doing implementation/tests, Claude Opus 5.5 for justified escalations, per-subscription capacity/watch/reset tracking, and real-time ledger updates. User reported a low DeepSeek monthly allowance on 2026-11-04; exact current balance/reset UNKNOWN. +- On 2026-11-05, user approved **local-only preparation/review of the 78-file sanitized text evidence publication candidate**. No upload, commit, push or publication; any actual external transfer requires a new, destination-specific user decision. +- **Later on 2026-11-05, user explicitly decided KEEP PRIVATE.** This supersedes consideration of publication as the immediate next milestone: do not publish, upload or transfer candidate/original evidence or ask again about a destination unless the user explicitly changes direction. +- User approved the **separate default-off server gate** for isolated continuation experimentation — implemented on unmerged experimental branch. +- User requires **exclusion of experimental agent-facing continuation tool-schema overhead before public release** (D2); this release requirement remains unmet and unmerged. +- User permits **best-effort last-check/reconciliation only for isolated stub-only continuation experiments** (D3), with known provider-start race explicitly bounded. +- **User ACCEPTED D4 contract A+B on 2026-11-05 14:10Z:** (A) strict no new durable `run.created` after revocation commits, (B) prevent release/start of prepared-but-unstarted work where verifiable, cancel safely and reconcile uncertain/in-flight work without pretending external provider stop is atomic. [Binding accepted contract](docs/orchestration-v2/d4-accepted-revocation-contract-20261105.md). **Not implementation, main integration or permission for new authority tables/large engine rewrite.** +- **On 2026-11-05 22:14Z, user explicitly AUTHORIZED one bounded reversible local upstream catch-up TRIAL** on a new isolated worktree starting from fork main. Scope: local upstream application, routine conflict fixes, tests, independent review; no push/PR, fork-main merge, D4 continuation re-land, paid providers, deployment or unrelated cleanup. [Trial spec](docs/orchestration-v2/upstream-catchup-isolated-trial-governing-spec-20261105.md) and [complete task](docs/orchestration-v2/task-upstream-catchup-isolated-trial-20261105.md). + +**Not approved:** evidence publication/upload, any shared/main Git push/merge, upstream catch-up beyond the selected overnight U source freeze, experimental/D4 integration beyond conditionally authorized **local-only R prototype**, public release, production continuation, material paid-provider work, unsafe credential bypass, new authority database, large engine rewrite, destructive Git operations. Local evidence remains PRIVATE. Isolated D4 task preparation is not a local worker launch; worktree ownership and source-write scope must be verified at dispatch. + +## Open risks and milestone context + +- **U/R/H local sequence complete and stopped:** [final reconciliation](docs/orchestration-v2/manager-overnight-urh-final-reconciliation-20261106.md) supersedes previous Stage R HOLD. R Codex cross-provider reviewer reran 8 full-root K1/K2 checks and focused suites; H Sonnet different-provider reviewer reran 118 focused tests. All claims from returned host workers, browser cannot inspect unpushed source. +- **D2 scope boundary:** H altered only tests/fixtures. R source-loaded `tools/list` has 82 tools, 2269 fields, 58799 UTF-8 bytes, zero extra continuation schema fields versus U. **Packaged/authenticated paired-client shipping D2 NOT VERIFIED**, and remains a release gate. +- **K3 scope boundary:** disposable restart, SIGKILL child, pruning/recovery and two provider-neutral stubs PASS locally; real external provider-start crash race, power-loss and production stop/reconcile not tested. Do not claim atomic external provider cancellation. +- **Residual R findings:** silent operator-edit stall, two missing fail-closed mutation regressions, fenced-start outbox status, broader late fail; consider before default-on/release, not classified as blocking already-passed isolated gates. H test stdout noise low severity. +- **Static/runtime gate limitations:** U 900s monolithic wrapper nonzero but entire manifest 29 batches/review PASS; R/H changed-file checks PASS, full hosted CI, native desktop/mobile, remote/relay, release smoke/packaged MCP remain unrun. Evidence V0 historical old-decoder coordinated-upgrade limitation unchanged. +- **Ledger capacity and authority:** 16 distinct technical/reviewer dispatches out of overnight 18 max; seven same-lane resumes counted separately, no further overnight tasks. Final 461-line restricted local ledger reported durable; no native Project Runtime task/handoff append tool accessible. Stage R Opus owner-approved by user; no paid spend reported. Preserve all existing worktrees, stale local main, private PR #21 evidence KEEP PRIVATE. +- **Upstream integration drift:** frozen U upstream tip is historical relative to newer upstream; refreshing and conflict resolution before main integration is a new bounded task, not an automatic consequence of U/R/H PASS. Fork `main` remains unchanged; no U/R/H remote branches. +- **Separate upstream PR #28777 cooperation:** [dedicated DeepSeek handoff](docs/orchestration-v2/task-upstream-pr28777-cooperative-conflict-and-regression-20261106.md) PREPARED/NOT DISPATCHED. Maria feedback and current conflict state recorded in Current State; no upstream patch push/comment authorized or done in this turn. + +**Prepared next T3 Code option:** [proposed no-cost packaged/authenticated D2 verification handoff](docs/orchestration-v2/task-post-h-packaged-d2-shipping-verification-proposed-20261106.md), **NOT AUTHORIZED / NOT DISPATCHED**. This is distinct from finished overnight U/R/H. A further user decision is needed to launch local technical work. Do not auto-use unused overnight dispatch slots. + +## STOP / TRANSITION + +**U G-U FINAL PASS / R G-R FINAL PASS / H ISOLATED REVIEW PASS (worker-reported), overnight sequence COMPLETE/STOPPED.** D2 source-loaded agent MCP schema PASS, **PACKAGED AUTHENTICATED SHIPPING NOT VERIFIED**. K3 disposable process/restart/pruning/stub PASS; **real provider-start and production NOT VERIFIED**. Fork main unchanged, all U/R/H branches local/unpushed. **No fourth stage**, public push/PR/main merge, default-on or production authorized from the original overnight task. Next user product authorization: choose whether to run a scoped packaged D2 qualification (recommended first), optionally real-provider K3 with explicit cost/safety approval, and later decide fresh upstream-aware integration. Independent upstream #28777 cooperative task remains prepared and undispatched. Maintain authoritative state, private local ledger and all worktrees; no destructive Git/evidence disclosure. diff --git a/docs/README.md b/docs/README.md index b51165dd72166..686e8460c5392 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,3 +1,13 @@ +## T3 Fork — Overall Manager current state + +- [Canonical Current State / Roadmap](../01_CURRENT_STATE.md) — current branch, active PR, accepted decisions and next authorized task. +- [Overall Manager Handoff](../OVERALL_MANAGER_HANDOFF.md) — continuation entrypoint for a new manager/worker. +- [Coordination and Handoff Protocol](../02_COORDINATION_HANDOFF_PROTOCOL.md) — stable authority, evidence, routing and safety process. + +These shared coordination documents are maintained on the planning branch; verify live repo/PR truth before acting. They are **not** a production merge or release instruction. + +--- + # T3 Code docs ## T3 Fork diff --git a/docs/orchestration-v2/DEEPSEEK_ORCHESTRATOR_HANDOFF_TEMPLATE_V1.md b/docs/orchestration-v2/DEEPSEEK_ORCHESTRATOR_HANDOFF_TEMPLATE_V1.md new file mode 100644 index 0000000000000..3c1109da83c62 --- /dev/null +++ b/docs/orchestration-v2/DEEPSEEK_ORCHESTRATOR_HANDOFF_TEMPLATE_V1.md @@ -0,0 +1,19 @@ +# DeepSeek Orchestrator Handoff — V1 (ACCEPTED) + +**Status:** ACCEPTED prospective coordination policy (4 November 2026). For future T3 Code worker handoffs; do not retroactively rewrite completed P2 routing. The Coordination/Handoff Protocol governs task authority and transitions. + +**Task:** [objective] · **Spec:** [path] · **Repo/base:** [branch/checkpoint] · **Owned lane:** [worktree/files] · **Acceptance:** [checks]. + +> **DeepSeek — start this authorized T3 Code task as orchestrator ONLY.** +> +> **Role:** You coordinate, decompose, dispatch, supervise workers, monitor subscriptions, inspect evidence, maintain the ledger, arrange independent review and return the handoff. **Do not implement, edit code or run development tests.** Conserve your own context and model usage. +> +> **Development workers:** Use **Codex GPT-6.1 SOL (Medium)** or **Claude Sonnet 5.5 (Medium)** for **all implementation and tests**. Choose by task fit and live subscription availability. Use a different provider/model for independent read-only review. Escalate difficult unresolved architecture/security/concurrency work to **Claude Opus 5.5 (Low/Medium)** when justified; ordinary defects get two materially different evidence-backed remedies first. DeepSeek remains orchestrator. +> +> **Capacity supervisor:** DeepSeek/OpenCode has **~10% of its 30-day allocation with ~10 days left (user report)**; reserve it for orchestration. Track each subscription separately at start, dispatch, completion, provider error and task transition: **AVAILABLE / BUSY / COOLDOWN / LOGIN-UNAVAILABLE / UNKNOWN**, remaining allowance, source and provider-reported five-hour reset. When a worker is limited: checkpoint its work, switch to another authorized available subscription, or resume after a **confirmed** reset if T3 can supervise the wait. Otherwise record a precise resumption handoff. Never bypass limits or invent quota/reset information. +> +> **Live ledger:** Update **T3 Runtime task/attempt/handoff records**, or an **append-only branch ledger** if unavailable, at each routing/switch/retry/review event: UTC time; task; requested and actual provider/model/effort; alternatives/reason; capacity/reset evidence; owner/base; tests/outcome/failure; reviewer; next action. Distinguish **observed fact**, **orchestrator claim** and **inference**. A worker report is not proof of acceptance. +> +> **Safety and finish:** Check repository/worktree ownership, enforce one writer per overlapping lane, independently verify, repair/re-review and continue authorized work. No merge, destructive Git action, material paid use or architecture/product decision without approval. Return **VERDICT / BASE / RESULT / TESTS / REVIEW / ROUTING LEDGER / RISKS / NEXT**. If T3 cannot launch workers, report **NOT DISPATCHED** and why. + +**Manager verdict:** Accepted as the default concise paste-ready worker-orchestration wrapper. Add the task-specific governing spec, exact branch/ownership, acceptance tests and safe stop conditions before dispatch. The template itself does not create a worker or approve a merge. diff --git a/docs/orchestration-v2/DEEPSEEK_ORCHESTRATOR_HANDOFF_TEMPLATE_V1_PROPOSED.md b/docs/orchestration-v2/DEEPSEEK_ORCHESTRATOR_HANDOFF_TEMPLATE_V1_PROPOSED.md new file mode 100644 index 0000000000000..88389aa5931c8 --- /dev/null +++ b/docs/orchestration-v2/DEEPSEEK_ORCHESTRATOR_HANDOFF_TEMPLATE_V1_PROPOSED.md @@ -0,0 +1,19 @@ +# DeepSeek Orchestrator Handoff — V1 Template (PROPOSED) + +**For Overall Manager review; not yet governing.** For future tasks only; do not interrupt the already-dispatched P2 work. + +**Task:** [objective] · **Spec:** [path] · **Repo/base:** [branch/checkpoint] · **Owned lane:** [worktree/files] · **Acceptance:** [checks]. + +> **DeepSeek — start this authorized T3 Code task as orchestrator ONLY.** +> +> **Role:** You coordinate, decompose, dispatch, supervise workers, monitor subscriptions, inspect evidence, maintain the ledger, arrange independent review and return the handoff. **Do not implement, edit code or run development tests.** Conserve your own context and model usage. +> +> **Development workers:** Use **Codex GPT-6.1 SOL (Medium)** or **Claude Sonnet 5.5 (Medium)** for **all implementation and tests**. Choose by task fit and live subscription availability. Use a different provider/model for independent read-only review. Escalate difficult unresolved architecture/security/concurrency work to **Claude Opus 5.5 (Low/Medium)** when justified; ordinary defects get two materially different evidence-backed remedies first. DeepSeek remains orchestrator. +> +> **Capacity supervisor:** DeepSeek/OpenCode has **~10% of its 30-day allocation with ~10 days left (user report)**; reserve it for orchestration. Track each subscription separately at start, dispatch, completion, provider error and task transition: **AVAILABLE / BUSY / COOLDOWN / LOGIN-UNAVAILABLE / UNKNOWN**, remaining allowance, source and provider-reported five-hour reset. When a worker is limited: checkpoint its work, switch to another authorized available subscription, or resume after a **confirmed** reset if T3 can supervise the wait. Otherwise record a precise resumption handoff. Never bypass limits or invent quota/reset information. +> +> **Live ledger:** Update **T3 Runtime task/attempt/handoff records**, or an **append-only branch ledger** if unavailable, at each routing/switch/retry/review event: UTC time; task; requested and actual provider/model/effort; alternatives/reason; capacity/reset evidence; owner/base; tests/outcome/failure; reviewer; next action. Distinguish **observed fact**, **orchestrator claim** and **inference**. A worker report is not proof of acceptance. +> +> **Safety and finish:** Check repository/worktree ownership, enforce one writer per overlapping lane, independently verify, repair/re-review and continue authorized work. No merge, destructive Git action, material paid use or architecture/product decision without approval. Return **VERDICT / BASE / RESULT / TESTS / REVIEW / ROUTING LEDGER / RISKS / NEXT**. If T3 cannot launch workers, report **NOT DISPATCHED** and why. + +**Manager review requested:** Accept the template, then update the Coordination Protocol and Current State for **future** handoffs. Keep the already-issued P2 handoff unchanged unless separately redirected. diff --git a/docs/orchestration-v2/bounded-decision-escalation-design-20261103.md b/docs/orchestration-v2/bounded-decision-escalation-design-20261103.md new file mode 100644 index 0000000000000..b5bdb41291c0f --- /dev/null +++ b/docs/orchestration-v2/bounded-decision-escalation-design-20261103.md @@ -0,0 +1,73 @@ +# Bounded agent decision, review and escalation + +Date: 2026-11-03 +Status: USER-DIRECTED DESIGN REQUIREMENT / NUMERIC PRODUCTION POLICY PROPOSED, NOT ACCEPTED / NO IMPLEMENTATION +Owner: T3 Fork Project Runtime policy (not upstream V2 provider-session loop) +Source: user instruction on 2026-11-03 to prevent unlimited agent back-and-forth and force autonomous decision or human escalation +Inputs: [source-level Argus comparison](preimplementation-architecture-reuse-research-20261103.md), [continuation stub experiment](continuation-stub-provider-spike-task-20261103.md), accepted [fork product direction](../internals/fork-product-direction.md) + +## Required behavior + +For a single project task, an Engineer, Reviewer, Manager or other agents may exchange evidence or proposed fixes only under a **finite authorized decision budget**. They must not spend indefinite turns debating without producing a new accepted artifact, a passing test, a distinct falsifiable hypothesis or a clear blocker. + +At a decision boundary: +1. **Accept** when an independent review and deterministic acceptance checks agree, the evidence belongs to the current task and attempt, and no separate user authorization is required. +2. **Bounded technical repair / change approach** when evidence identifies a specific, authorized defect and the remaining budget permits it. Agents may make implementation-level choices within the accepted spec and permissions. +3. **Escalate to the user** when the remaining issue is a product trade-off, security/integration authorization, material scope change, irreversible action, or unresolved technical disagreement at the decision budget limit. +4. **Blocked / defer** if the bottleneck is external or an operational dependency, not something another reasoning turn can resolve. Do not convert a known provider error into endless retry. + +The **user owns final product decisions**. An agent may select among technically valid already-authorized options, but may not settle a contested product choice by silently expanding its authority. + +## Use existing upstream T3 execution state; don't add another engine + +- Upstream T3 owns provider turn mechanics and run/receipt/outbox execution. +- Fork Project Runtime owns the **project-task decision budget** and durable outcome, linked to attempt, independent review, evidence and task revision. +- A completion event is not authorization for another turn. A worker claim is not verification. +- Keep one clear responsibility: no Planner→Manager→Reviewer model loop unless a real open question requires it. After a clean independent review, deterministic acceptance is preferable to another Manager model call. + +## Lessons from Argus (source inspected; not run here) + +Argus already has several safeguards, but **not one universal hard stop by default**: +- [Engineer round config](https://github.com/microsoft/ArgusAgent/blob/main/argus/engineer/round_config.py) defaults `max_rounds = 0` (unlimited), `soft_round_limit = 12`, `hard_escalate_rounds = 24`, `no_progress_threshold = 2`, `stall_threshold = 4`, with a separate elapsed-time decision-progress guard. The soft limit stops two successive non-progress review judgments; the hard escalation calls for an explicit forward-progress signal and may allow productive longer tasks. +- [Engineer settlement](https://github.com/microsoft/ArgusAgent/blob/main/argus/engineer/round_settlement.py) uses Reviewer `forward_progress` and operator questions as structured decisions. Unknown progress does not count as a verified stall. It explicitly treats healthy running external work as not stalled. +- [Supervisor constants](https://github.com/microsoft/ArgusAgent/blob/main/argus/life/supervisor/_constants.py) default to three consecutive replans and three repeated completion rejections before stopping the loop; [mission settlement](https://github.com/microsoft/ArgusAgent/blob/main/argus/life/supervisor/_mission_execution_settlement.py) persists per-item replan streak so a restart does not reset the limit. +- [Supervisor config](https://github.com/microsoft/ArgusAgent/blob/main/argus/life/supervisor/_config.py) defaults to circuit-breaking a repeated subagent failure family after three failures in a 72-hour window, even if each attempt has a different task description. +These are examples for test cases and rule design, not evidence that default Argus meets the requested finite decision-budget invariant. + +## Proposed policy dimensions (defaults not yet product-approved) + +- **Repair/review exchanges:** propose one independent review and at most **two** automatically authorized repair-and-review cycles on the same issue. After that, stop and present options; no agent can reset the counter by rephrasing its complaint, switching models, or launching another child thread. This number is a **synthetic-test parameter**, not a deployed production setting. +- **No-progress detection:** fingerprints group equivalent objections and failed hypotheses; mere text changes, elapsed time, generated code churn or additional model turns do not demonstrate forward progress. Evidence of a previously failing test now passing or a newly falsified hypothesis does. +- **Time/cost budget:** guard total manager/reviewer/model calls and elapsed *decision-wait* time in addition to round count; design the configurable production ceiling after measuring realistic cases. Healthy long-running tests/builds are excluded from no-progress timers, but still subject to ordinary approved compute/resource budgets and heartbeat reporting. +- **Global guard:** nested delegation cannot reset the parent's finite task budget. Count all child reviewer/repair rounds against the same project task, with bounded per-task and per-project spend if measurement permits. +- **Repeated same-cause failures:** transient provider failures have their own bounded retry policy; identical technical failures after a provider swap are not a new issue. Preserve the failure/attempt count across restarts. +- **Stop semantics:** `needs_user_decision`, `blocked` or an equivalent existing Runtime-supported state (avoid inventing new states without reviewing contracts). Show concise description, evidence, paths tried, remaining options and the specific user question. Do not spin in background. +- **Escalation quality:** user should see what succeeded, what failed, what attempts were made, remaining budget, whether any choice is within scope, and the cost/risk of the options, not raw back-and-forth transcripts. + +## Bounded automatic example + +1. Worker implements a previously accepted task. +2. Independent reviewer identifies one reproducible issue. +3. First repair fixes it; reviewer checks the same current task/revision. +4. If the reviewer still rejects for the same reason, one more authorized repair may try a materially different technical approach. +5. If still unresolved, stop and ask the user a specific question, or mark blocked on a technical dependency. Do not ask another model to keep voting on the same evidence. + +Where a clean review passes at any step, accept after deterministic checks; no extra manager vote. A reviewer disagreement without new evidence is not permission for another model call. + +## Acceptance tests for the stub-provider spike (synthetic, no model/credentials) + +- Passing clean review -> accept exactly once; `0` redundant manager calls. +- Same underlying review objection recurs despite changed wording -> after configured finite exchange budget, one user escalation, zero further review or worker launches. +- Material new evidence within authorized scope -> permit next bounded attempt if budget available. +- A worker or reviewer asks for a product decision, new credentials, merge or extra scope -> immediate user gate; cannot consume another autonomous decision round to bypass it. +- Restart/replay/child delegation/provider switch cannot reset budget or duplicate escalation/dispatch. +- Healthy asynchronous test wait with heartbeat does not incorrectly spend review rounds or trigger no-progress escalation. +- Repeated transient provider outage -> bounded operational retry policy, then blocked; not presented as technical-review disagreement. +- Missing review provenance, wrong task version or ambiguous execution -> fail closed. +- Result carries a bounded decision receipt with source attempt, task version, reviewer evidence, budget used and next action; use existing storage/receipts when possible. + +## Status and decision boundaries + +This file records the **accepted qualitative user requirement** of finite agent debate and forced decision/escalation. The exact production policy (default exchange count, time/cost ceilings, overrides and whether the user can opt into more autonomy) remains a **product choice** and should be recommended from a small synthetic and later live, controlled benchmark. The immediately authorized synthetic spike may use a fixed two-repair test budget; that test must not silently turn the numeric value into a production default. + +No implementation, provider run, cost, production policy, upstream outreach or merge was performed by this design note. diff --git a/docs/orchestration-v2/browser-d4-d2-upstream-recovery-ledger-20261107.md b/docs/orchestration-v2/browser-d4-d2-upstream-recovery-ledger-20261107.md new file mode 100644 index 0000000000000..94afc41174811 --- /dev/null +++ b/docs/orchestration-v2/browser-d4-d2-upstream-recovery-ledger-20261107.md @@ -0,0 +1,33 @@ +# Browser evidence ledger — D4 diagnostics / D2 validation / upstream recovery +**Date:** 2026-11-07 (exact event time not provided by repository APIs; not fabricated). +**Classification:** Public, **browser-verified repository/source observations and scoped inferences**. No worker-local, private PR #21, credential, SQLite, execution log, or restricted routing ledger content was copied. +**Authority:** Latest user instruction allows continued D4 diagnostics, D2 validation and this planning-branch ledger update; **integration HOLD**, no fork-main merge/push, no release/default-on, no material paid/provider work. This is **not** authorization to start an additional U/R/H implementation stage. +**Canonical references:** [Current State](../../01_CURRENT_STATE.md), [Coordination Protocol](../../02_COORDINATION_HANDOFF_PROTOCOL.md), [D4 accepted A+B contract](d4-accepted-revocation-contract-20261105.md), [D2 audit plan](d2-shipping-exclusion-audit-plan-20261105.md), [final U/R/H reconciliation](manager-overnight-urh-final-reconciliation-20261106.md). + +## Ledger event 1 — base and custody refresh +- **Evidence class — OBSERVED FACT:** GitHub comparison of fork `main` against its accepted PR #21 integrated base returned `identical / ahead 0 / behind 0`; no fork-main update. U/R/H source and raw test logs are still described in project state as local-only and **were not accessible to this browser pass**. This is not a local worktree cleanliness check. +- **Evidence class — OBSERVED FACT:** GitHub comparison from frozen U upstream parent `25b53299b75d4d8d1d0667ad47e9cfed3749776e` to current upstream `main` returned **210 commits ahead, 0 behind** at browser observation. Current upstream head was independently checked as `83a3674ffd84ffb33de768210c806cb1ac53fd80`. GitHub's per-file compare output was capped at **300 files**, so it is **not a complete changed-file inventory**. Prior 168-commit and older conflict counts are historical. +- **Routing/attempt:** Browser-only inspection by ChatGPT GPT-6; zero T3 delegated workers or development-test executions. Provider subscription quotas/reset times **UNKNOWN**. No T3 Project Runtime task/attempt/handoff append path available to this browser. The **restricted 461-line overnight ledger was not read or modified**; this public addendum must not be represented as its append. +- **Result:** `BROWSER SOURCE REVIEW / UPSTREAM COMPATIBILITY RISK`; no new integration readiness verdict. + +## Ledger event 2 — upstream recovery changes actually on main +GitHub source commits below were confirmed as ancestors of current upstream `main` using commit-to-main comparisons. Do not confuse commit inspection with fork-U/R/H runtime verification. + +1. **Retry unstarted runs —** [upstream #30560](https://github.com/pingdotgg/t3code/commit/737afe24bd20d1390f36fa6f5d4e7974dffead3c). `ProviderRuntimeRecoveryService` can preserve/requeue certain `starting` but never-started user runs; `Orchestrator` uses a fresh `provider-turn.start` effect identity when restoring a queued run. **Retrospective inference:** after future upstream incorporation, test that a revoked **synthetic continuation**, if it enters a comparable recovery path, cannot gain a fresh start effect or resurrect a cancelled attempt. Ordinary user runs must remain unaffected. **No observed D4 bypass**. +2. **Usage-limit auto-resume survives restart —** [upstream #31292](https://github.com/pingdotgg/t3code/commit/240446e2d9625600b0c841faf6bddf367bd26967) (2026-11-07). Adds `usageLimitContinuationOfRunId` to run provenance; when an unsent auto-resume is recovered, the worker request identity can rotate and a stale unsent prompt is removed. `UsageLimitRecoveryWorker` dispatches a server-created `message.dispatch` with `dispatchMode: start_immediately`. **Retrospective inference:** distinguish upstream **usage-limit auto-resume** from fork **operator-authorized synthetic Project Runtime continuation**; don't treat server-created provenance as authorization and don't accidentally deny unrelated legitimate recovery. Test interactions, but this source alone does **not** prove the paths share the D4 authority gate. +3. **Grouped shutdown reconciliation —** [upstream #31854](https://github.com/pingdotgg/t3code/commit/1bdb6cf1cfb55bff8d007caf6f5a36a4001a84cc). Groups recovery commits and signals cancelled effects only after durable group commits. **Retrospective inference:** compare outbox cancellation, command receipts and transaction ordering against D4 A+B during a future upstream-aware trial. No direct test on private R/H was run here. +4. **Batched recovery projection reads —** [upstream #31842](https://github.com/pingdotgg/t3code/commit/c22251163132534c4f2048ac35bad8caad0708db). Consolidates ten collections into one SQLite snapshot with ordering/filters retained; includes tests. **Retrospective inference:** recheck recovery snapshot expectations and K3 restart/idempotency tests after an authorized sync. Throughput or crash-safety of the fork is **not independently established** here. + +**Required D4 diagnostic matrix for the next authorized local qualification (not executed):** (i) revocation before run transaction; (ii) revoke between preparing and release; (iii) revoke, crash/restart, requeue candidate, cancelled-effect identity; (iv) retry/replay of same request; (v) independent ordinary user run; (vi) usage-limit auto-resume without cross-grant of synthetic authority; (vii) batched shutdown/restart and pruning; (viii) uncertain external start yields `reconcile_required`, never invented atomic stop. Retain a separate source identity for every effect and authorization revision. These tests are proposed **coverage additions**, not accepted failures. + +## Ledger event 3 — D2 independently inspectable source exposure +- **Evidence class — OBSERVED FACT:** On fork `main`, `packages/contracts/src/projectRuntime.ts` has no `continuation` task field. On the older isolated `experiment/continuation-default-off-gate-20261104` branch, the same contracts expose optional `continuation` in task read, create and update types. In both branches `apps/server/src/mcp/toolkits/project/runtimeTools.ts` is byte-identical and spreads task create/update schema fields into agent `t3_project_task_create` / `t3_project_task_update` parameters while omitting `routing` only. This is an independently observed **old-experiment source schema-leak risk**, not a new packaged-client result and **not a claim about private H production code**. +- **Evidence class — WORKER CLAIM PRESERVED:** The final H worker/reviewer reported source-loaded 82 tools / 2,269 paths / 58,799 UTF-8 bytes, zero continuation-attributable overhead against frozen U; the current browser has neither H source nor package/client credentials for independent replay. +- **Verdict:** `D2 SOURCE-LEVEL COMPARISON CONFIRMED IN PUBLIC BASE/OLD EXPERIMENT; D2 PACKAGED AUTHENTICATED SHIPPING NOT VERIFIED`. No packaged server was built; no authenticated paired-agent `tools/list` obtained; no agent-negative/operator-positive authorization pair executed. +- **Required next proof (no-cost, scoped, with owned H worktree):** actual packaged server and supported authenticated agent client; complete tool-list schemas and exact UTF-8 budget compared to frozen U; positive operator create/read/update/revoke; rejected agent attempt; default-off, isolation and CAS/replay; different-provider read-only review. Stop for unavailable safe credentials, material cost, code-scope expansion, or unsafe environment. Existing [D2 task packet](task-post-h-packaged-d2-shipping-verification-proposed-20261106.md) supplies the remaining worker procedure. + +## Ledger event 4 — authority, integration and next action +- **OBSERVED FACT:** No fork-main merge or push was performed in this browser work; planning-only documentation record is separate from runtime/private evidence. No worker was dispatched, no test suite was executed, and no live provider or user DB was touched. +- **VERDICT:** `BROWSER DIAGNOSTICS COMPLETE / D4 K1+K2 ISOLATED RUNTIME PASS REMAINS WORKER-REPORTED / K3 LIVE-PROVIDER PARTIAL / D2 PACKAGED SHIPPING NOT VERIFIED / INTEGRATION HOLD`. +- **FAILURE CLASS:** No newly proved implementation defect. `UPSTREAM COMPATIBILITY / REVIEW REQUIRED` for changed recovery paths; `OPERATIONAL BLOCKER` for browser-only packaged/authenticated D2 and private H worktree access. +- **NEXT:** Continue only safe browser source review. For local D2 packaged validation, run the accepted scoped packet through a real supported T3 Code/OpenCode session with DeepSeek as **orchestrator only**, Codex SOL Medium or Sonnet Medium as worker, another provider as independent read-only reviewer, and restricted private ledger writes before/after dispatch. Do not silently use unfinished overnight dispatch capacity. No integration, public release, default-on, paid K3/provider-start crash trial, raw-evidence publication or fork-main push without separately granted scope. diff --git a/docs/orchestration-v2/browser-handoff-a-continuation-implementation-20261103.md b/docs/orchestration-v2/browser-handoff-a-continuation-implementation-20261103.md new file mode 100644 index 0000000000000..a6d67c792e1bc --- /dev/null +++ b/docs/orchestration-v2/browser-handoff-a-continuation-implementation-20261103.md @@ -0,0 +1,43 @@ +# Browser Handoff A — Build the T3 Fork continuation spike + +**TASK / ROLE**: You are the implementation worker in a **separate ChatGPT browser chat**. Execute the browser-capable development now using the connected GitHub app. You are not the overall manager, and you must not conflate design with runtime proof. The user has authorized a **reversible synthetic experiment**, not deployment, integration or a new production architecture. + +**Repository**: https://github.com/jermur788/t3code +**Current main**: refresh live; the last source inspection on 2026-11-03 found the fork's main at `d3bedef12a...` (this is a locator, never blindly assume it remains current). +**Development branch**: create a **new dedicated fork branch** (suggest `experiment/browser-task-continuation-spike-20261103`) from refreshed **fork main**. Do not write feature code on main or on the research branch. One code writer. Do not overwrite collaborators' branches or work. +**Research branch**: `planning/resource-efficient-continuation-20261103`, containing the accepted research-gate findings and scoped task packet. +**Routing**: browser-connected GitHub for source/code/test authorship; only exact runnable tests/restarts and independent runtime inspection go to a local T3 worker later. + +## Read before writing + +1. [Full task packet](https://github.com/jermur788/t3code/blob/planning/resource-efficient-continuation-20261103/docs/orchestration-v2/continuation-stub-provider-spike-task-20261103.md). +2. [Finite decision budget](https://github.com/jermur788/t3code/blob/planning/resource-efficient-continuation-20261103/docs/orchestration-v2/bounded-decision-escalation-design-20261103.md): user directs finite repair/review exchanges, evidence-based progress and forced decision or user escalation. **Two repair cycles is a synthetic experiment parameter, not a production default.** +3. [Source-level Argus/T3 and upstream comparison](https://github.com/jermur788/t3code/blob/planning/resource-efficient-continuation-20261103/docs/orchestration-v2/preimplementation-architecture-reuse-research-20261103.md). +4. [Accepted fork product direction](https://github.com/jermur788/t3code/blob/main/docs/internals/fork-product-direction.md), [Runtime routing / execution specs](https://github.com/jermur788/t3code/tree/main/docs/orchestration-v2), and [Project Runtime internals](https://github.com/jermur788/t3code/blob/main/docs/internals/project-runtime.md). +5. If accessible in the Project, read `02_COORDINATION_HANDOFF_PROTOCOL.md` and `01_CURRENT_STATE_UPDATED_2026-10-31.md` before work; live repository evidence overrides stale snapshot. Documentation V1 remains **INTEGRATED / FINAL VERIFICATION PENDING**, unrelated to this experiment. + +## Goal + +Implement the **smallest additive fork-owned project-task policy** to decide, after a reconciled worker attempt terminates, whether to dispatch a previously authorized review, accept a clean independent review, attempt a bounded authorized repair, block, or request user judgment. It is **not** the generic provider-turn continuation system: upstream T3 already has run/event, durable receipt/outbox and child wake mechanisms. + +## Execute in the browser + +1. Inspect live repo/branch status, current tests, task ownership and existing services. Focus on `apps/server/src/projectRuntime/RuntimeTaskExecutionService.ts`, `ProjectRuntimeService.ts`, `OrchestrationEvidenceService.ts`, and upstream-owned `apps/server/src/orchestration-v2/{EventSink,EffectOutbox,EffectWorker,RunExecutionService}.ts`. Identify the narrow actual hook and whether existing `request_key`, task revision and command receipts already prevent duplicate dispatch. Inspect existing test fixtures first. +2. Form a minimal, explicit policy contract, bounded to this experiment: input = authoritative task revision, source attempt and terminal transition, approved next-action policy, verified handoff/review evidence, spent decision budget. Output = exactly one `no_action | review | repair_or_retry | ask_user | blocked` decision with reason and references. +3. Implement the policy and focused synthetic tests on the **dedicated branch**, reusing T3's existing guarded execution service. Prefer no new database table, no separate queue, no new provider driver, no touching upstream internals. If existing receipts cannot establish crash-safety, stop at the design gap rather than invent a second storage engine. +4. Cover passing review (no redundant manager call, no repair), failed review plus explicitly authorized repair, two-cycle budget exhaustion and one human escalation, same-failure rephrasing, provider change or restart not resetting budget, stale task revision, wrong-thread handoff, missing or contradictory review evidence, denied scope, duplicate/reordered events, ambiguous attempts, cancellation and failed launch. Distinguish healthy long-running tests from unproductive debate. +5. Inspect and self-review every modified code area. Add useful test definitions, type-level checks and instructions for local verification, but **do not claim tests ran** unless an actual runnable environment executed them. If GitHub-only editing cannot ensure safe correctness, deliver a precise patch/design with the blocker and test plan rather than fabricating pass status. + +## Exclusions and authority + +No second Argus/DeepSeek engine, no new authoritative task store, no real model calls/keys, no CCF/Unity work, no new paid resources, no production routing/policies, no auto-merge, no destructive operations, no main integration and no public upstream contribution. Do not modify unrelated work. Never silently change accepted user scope or verification policy. A worker's `completed` is **not** `VERIFIED`. If an architectural redesign, additional persistence owner or material security question becomes necessary, stop for manager/user decision. + +## Acceptance and status + +Deliver source-level implementation plus focused synthetic tests in a separate branch, and a complete **local verification handoff** with precise test commands, expected outputs, restart/replay protocol and negative test criteria. If code is committed but not executed, report **IMPLEMENTED / RUNTIME NOT RUN** (not RUNTIME PASS, REVIEW PASS or VERIFIED). If only source review/design was possible, report **SOURCE-INSPECTED** and the specific blocker. + +The local verification must independently check attempts and receipts persisted before dispatch, exactly one review and repair launch under retry/restart, no unauthorized retry, no verified state with failing evidence, and no duplicate question after budget exhaustion. Independent code/security review and integration into main are separate later gates. + +## Required return handoff + +**VERDICT; BASE/BRANCH; RESULT (files/functions changed); VERIFICATION (commands run vs not run); RISKS/BLOCKERS; REVIEW; INTEGRATION STATE; NEXT EXACT LOCAL TEST TASK; USER DECISION needed, if any.** Include durable GitHub links, not just chat claims. Keep research/experiment data clearly labeled; coordinate any state update through the overall manager. diff --git a/docs/orchestration-v2/browser-handoff-b-upstream-pr-28777-20261103.md b/docs/orchestration-v2/browser-handoff-b-upstream-pr-28777-20261103.md new file mode 100644 index 0000000000000..093fed3d000f6 --- /dev/null +++ b/docs/orchestration-v2/browser-handoff-b-upstream-pr-28777-20261103.md @@ -0,0 +1,43 @@ +# Browser Handoff B — Review and improve upstream PR #28777 + +**TASK / ROLE**: You are the **independent upstream source reviewer / test-preparation worker** in a **different ChatGPT browser chat**. Execute the available review and source-level testing preparation using the connected GitHub app. Aim to help the existing upstream contribution without duplicating it. Do not assume the PR is merged, correct or already verified. No public interaction without explicit approval. + +**Upstream**: https://github.com/pingdotgg/t3code +**Existing PR**: https://github.com/pingdotgg/t3code/pull/28777 +**Reported defect**: https://github.com/pingdotgg/t3code/issues/28734 +**Fork/research workspace**: https://github.com/jermur788/t3code/tree/planning/resource-efficient-continuation-20261103 +**Branch base**: refresh live upstream main and the PR head before review; last checked on 2026-11-03, PR was OPEN and unmerged. **Do not use our fork's older main as if it were the current upstream PR base.** Never modify the PR author's branch. +**Routing**: source inspection, independent review and (where possible) test-file authorship in browser; local runnable regression tests and optional model tool-selection evals only when explicitly permitted and resources exist. + +## Read before acting + +1. [Full PR-specific test packet](https://github.com/jermur788/t3code/blob/planning/resource-efficient-continuation-20261103/docs/orchestration-v2/upstream-pr-28777-behavioral-verification-task-20261103.md). +2. [Upstream contribution guide](https://github.com/pingdotgg/t3code/blob/main/CONTRIBUTING.md). This permits small focused bug fixes but demands precise reproduction and evidence; maintainers are not required to accept outside PRs. Respect model attribution rules and the one-underlying-defect-per-PR rule. +3. [Upstream defect/PR triage](https://github.com/jermur788/t3code/blob/planning/resource-efficient-continuation-20261103/docs/orchestration-v2/upstream-contribution-triage-20261103.md). +4. Source: `packages/provider-core/src/server/orchestrationInstructions.ts`, `apps/server/src/mcp/toolkits/orchestrator/tools.ts`, `apps/server/src/mcp/OrchestratorMcpService.ts` (`sendToThread`), `apps/server/src/orchestration-v2/Orchestrator.ts` (`recordSubagentFollowup`), and `DelegatedCompletionDelivery.test.ts`. + +## Problem and source findings so far + +A user asked the parent agent to **continue a previously interrupted, unfinished delegated review**. Current upstream instructions say each new review/re-check uses `delegate_task`; the parent launched a replacement child, losing the easy reuse of prior conversation. PR #28777 changes **model-facing instructions and `t3_thread_send` documentation**, not the execution engine, to distinguish existing-child continuation from a genuinely independent fresh review. + +The current engine can create a new **follow-up task/run with a new task ID inside the same child thread**; it does not reopen the original task ID. Existing completion tests include an interrupted *follow-up* among test outcomes, but the particular inspected test seeds an *original completed child*, so it does not conclusively prove the **original interrupted** case. PR author reports focused checks and a dry-run eval fixture, but **no live before/after model tool-choice eval**. + +## Execute now in the browser + +1. Refresh the PR, related issue, upstream main and overlapping PRs. Read the complete changed-file patch and repository tests. Establish what is actually covered before calling anything a gap. +2. Independently trace the runtime contract for `t3_thread_send` into a **previously interrupted and reconciled child**: lineage, who may send, request-key replay, new task identity, preserved conversation, pending question/approval, parent completion delivery and cancellation. Differentiate a new independent review, same-child continuation and resuming a *currently pending* request. +3. Produce a concise code review with source links and precise findings (correct / unproven / defect), separating instruction quality from runtime guarantees and model selection behavior. +4. Where a real, nonduplicative test gap exists, author the **smallest deterministic regression test(s)** for an original-interrupted child followed by `t3_thread_send`, with a stable request key, one new follow-up task/wake, original task remaining terminal and no duplicate delivery. Add negative tests only where they directly support PR scope. Prefer testing the existing lifecycle over modifying production code. +5. **Branch safety**: if GitHub tools can create a separate test branch from the *actual PR head commit* in a repository to which you have write access, use that. If not, create a self-contained unified test patch/diff or a new Markdown test-spec file in our **research-only** branch for later local application. Do not pretend a patch on our fork's stale main is compatible with the upstream PR. Never force-push, cherry-pick into main, or rewrite the author's head without authorization. +6. Evaluate whether an independent provider model tool-selection check is needed to prove the instruction works. Specify exact test prompts and controls, but **do not spend paid tokens or access private provider credentials** in the browser or locally without user approval. +7. Recommend one of: (A) existing PR is sufficient, (B) add missing focused tests to the author's PR through a proposed diff, (C) report a newly proven separate runtime bug, or (D) hold because evidence is insufficient. Do not open duplicate upstream PRs. + +## Exclusions and authority + +No upstream issue/PR comments, code review submission, pushes to someone else's branch, new public PR or public disclosure of private project data without explicit user approval. No fork runtime changes, no paid models, no unrelated feature, no production deployment, no integration or merge. Browser file inspection and a privately stored test patch are authorized. + +## Verification and handoff + +Indicate exact source revisions, files and scenarios inspected. Mark **SOURCE-INSPECTED** if only reviewed, **IMPLEMENTED / TESTS NOT RUN** if a code patch exists but was not executed. Do not claim RUNTIME PASS or verified model behavior from prompt assertions. A local follow-up, if needed, must include the precise upstream PR base, isolated worktree setup, focused commands and expected completion-delivery evidence. + +Return: **VERDICT; BASE/PR STATE; REVIEW FINDINGS with line-level evidence; NEW TESTS/DIFF AND LOCATION; VERIFICATION run vs pending; RISKS/BLOCKERS; RECOMMENDED PUBLIC FEEDBACK text (not posted); NEXT ACTION; USER APPROVAL required for posting.** Persist findings in a unique private GitHub research file or branch so the Overall Manager can reconcile them. diff --git a/docs/orchestration-v2/continuation-staged-safety-governing-spec-20261104.md b/docs/orchestration-v2/continuation-staged-safety-governing-spec-20261104.md new file mode 100644 index 0000000000000..b7d5f33dc5742 --- /dev/null +++ b/docs/orchestration-v2/continuation-staged-safety-governing-spec-20261104.md @@ -0,0 +1,80 @@ +# Governing spec — staged safety of Project Runtime continuation + +**Authority:** Accepted user decision, 2026-11-04 01:09 Europe/Dublin. +**Status:** **D1–D5 user-accepted decisions unchanged / staged U→R→H isolation COMPLETE (worker-reported) / U G-U FINAL PASS / R G-R FINAL PASS with Codex independent reviewer / H D2 SOURCE-LOADED SCHEMA PASS and K3 BOUNDED RUNTIME PASS / H REVIEW PASS / D2 PACKAGED AUTHENTICATED SHIPPING NOT VERIFIED / LIVE-PROVIDER K3 NOT VERIFIED / NOT INTEGRATED OR PRODUCTION VERIFIED**. See [final manager reconciliation](manager-overnight-urh-final-reconciliation-20261106.md). Older incomplete stage-status paragraphs below are historical, not active blockers. +**Decision source:** User explicitly approved both staged recommendations in Overall Manager chat. +**Candidate source:** [Overnight reviewed implementation](https://github.com/jermur788/t3code/tree/overnight/deepseek-continuation-20261104). +**Evidence:** [Overnight manager reconciliation](manager-reconciliation-overnight-20261104.md), [F4 gate memo](https://github.com/jermur788/t3code/blob/overnight/deepseek-continuation-20261104/docs/orchestration-v2/overnight-f4-gate-decision-memo-20261104.md), [routing ledger](https://github.com/jermur788/t3code/blob/overnight/deepseek-continuation-20261104/docs/orchestration-v2/overnight-deepseek-routing-ledger-20261104.md). + +## 1. Accepted product decisions (binding) + +**D1 — experimental feature gate now.** Implement a **disabled-by-default server-side gate** for the synthetic Project Runtime continuation feature, while keeping the experimental code isolated from fork main. A deployable server must be inert unless explicitly enabled in an authorized experimental environment. An agent or client cannot enable it through task creation, MCP, model output or an arbitrary per-task flag. This is a reversible in-tree experiment, not permission to expose it in production. + +**D2 — shipping exclusion before public release.** Before a public shipping build/release, remove or exclude the experimental continuation feature from shipping code and **agent-facing tool schemas**, unless an explicitly new user product decision replaces this requirement. This includes avoiding the experimental +646-byte MCP tool-list overhead in public shipping artifacts. The +646-byte overhead is provisionally tolerated **only on isolated, unmerged experimental branches**, not accepted as a production prompt-budget increase. Recalculate bytes on any merged/rebased source; do not assume the earlier snapshot remains accurate. + +**D3 — revocation during experiment.** The currently implemented **best-effort last authorization recheck plus durable receipt cancellation/reconciliation** is accepted for isolated, stub-only experiments. The known gap between the last recheck and the external `ThreadLaunchService.launch` can still permit one turn to start after policy withdrawal. Preserve this explicit limitation; do not claim strict cancellation. + +**D4 — strict production requirement, A+B CONTRACT ACCEPTED 2026-11-05.** The user selected **(A)** no new continuation `run.created` event may durably commit when authorization revocation committed first, with a transactionally coherent guard, and **(B)** prepared-but-unstarted continuation runs must be prevented from releasing/starting after revocation where their unstarted state can be established; uncertain/in-flight work must be cancelled where safe and explicitly reconciled without a false guarantee of atomic external-provider cancellation. The [binding D4 accepted contract](d4-accepted-revocation-contract-20261105.md) specifies ordering, provenance, verification and stop conditions. This remains **a release acceptance requirement, not IMPLEMENTED or verified**, and no direct fork-main merge, new authority store or substantial upstream engine rewrite was approved. D3 best-effort experimental behavior remains explicitly nonproduction. + +**D5 — integration remains separately gated.** The user approved the **staged direction and bounded nonproduction implementation/research**, not a merge to fork main, a production PR, live-provider spend, public upstream submission, irreversible migration, or an unbounded V2 engine rewrite. Keep only one writer per overlapping code lane. + +## 2. Implementation work: default-off nonproduction gate + +The proposed implementation must be upstream-friendly and use existing Project Runtime abstractions. + +**Gate surfaces that must all honor the same server-controlled state:** + +1. Project Runtime `createTask` and `updateTask`: reject new or modified **non-null continuation authorization** when disabled, including requests from server-derived `user:` actors. Ordinary task changes and explicit removal (`continuation: null`) must remain available so the operator can cleanly revoke stale policy. Worker/MCP actor restrictions remain. +2. `RuntimeTaskExecutionService.advanceContinuation` and any other automatic decision entry paths, including startup `reconcileActiveAttempts`: dispatch no new review or repair while the gate is off. Do not log a false successful continuation. +3. `launchAttempt` / replay of a pending continuation receipt: validate the server gate just before the existing authorization check. While off, an unlaunched receipt must become `cancelled` if no thread exists or `reconcile_required` if a thread may exist; preserve receipt IDs and history, do not delete it or launch another turn. +4. Existing non-continuation task execution, handoff, routing and Project Runtime V1 remain unaffected when the gate is off. +5. Explicitly-enabled experiments may execute only under an intentionally enabled server configuration and pre-existing operator-authorized source task. **No default-on fallback** for absent/malformed configuration. Do not allow a serialized task payload or agent-facing RPC to turn the global server gate on. + +**Gate implementation guidance:** Prefer a small shared server-side capability/configuration checked by both services with deterministic tests. Avoid process-global mutation in parallel tests and avoid widening the public MCP contract merely to carry a gate. Use already available configuration abstractions or an injectable test-layer; inspect actual repo before deciding exact wiring. If a safe gate requires a material server architecture change, stop with REVEW REQUIRED rather than silently expanding scope. + +### Acceptance and verification + +- Gate **off by default** with missing and malformed configuration; no new continuation policy can be granted; optional explicit policy removal and ordinary task edits still work. +- Gate-off terminal worker reconcile **does not dispatch** automatic review/repair; gate-off startup scan does not dispatch. +- Gate-off pending review **and repair** restart replay preserve deterministic receipts and never call external launch; ambiguous existing-thread case is handled with `reconcile_required`. +- Gate-on path maintains all 42 existing focused continuation tests (or their refreshed equivalent) and normal independent review/repair, fixed budget, exact task revision and stale-source rejection behavior. +- Agent/MCP actors cannot grant or enable policy and no arbitrary user task payload can bypass the server gate. +- Correct operation under two instances against same SQLite and after restart (per existing fixtures). Context budget measured, any change explained. Never weaken tests to pass. +- `vp test run apps/server/src/projectRuntime`, targeted gate/security/restart suites, `vp run typecheck`, `vp run check:changed`; inspect exact exit codes and tests. No real providers, paid models or UI needed for the bounded gate. +- At least one **independent code/security review** of the gate and its interactions is required; reviewer must not be the code writer. + +## 3. Parallel nonwriting task: upstream compatibility and strict revocation design research + +**Source:** [Overnight trial merge report](https://github.com/jermur788/t3code/blob/overnight/deepseek-continuation-20261104/docs/orchestration-v2/overnight-upstream-compatibility-20261104.md). Prior trial reported 8 conflicts in preexisting fork divergence, **not** in continuation-owned files, but this is **not a completed integration or verification**. Refresh upstream main immediately before any new trial. + +**Research acceptance:** +- Compare current upstream release/main and relevant issues/PRs to fork main and experiment, distinguish existing upstream implementation vs proposed changes vs fork code. +- Map conflicts (including V2 event/launch behavior, migrations, shared contract/budget and generated sources) with exact file/ownership evidence. A safe **disposable trial merge** is permitted in an isolated local worktree only; do not reset, stash, rewrite, merge main or publish upstream. +- Re-measure the MCP tool-budget snapshot **on the actual reconciled tree**, not by copying an old constant. +- Prepare a separate strict-revocation architecture analysis: whether an upstream launch/receipt or run-create guard can atomically test a source authorization epoch or similar transactionally coherent state; behavior for in-flight vs new runs; user cancellation at each boundary; multi-process/restart tests, observability and upstream compatibility. **No engine changes yet**; any new authority store or significant cross-boundary contract is REVIEW REQUIRED / PRODUCT DECISION. + +## 4. Ownership, routing and status + +- **Manager:** browser/Overall Manager owns this spec, authority, review and integration sequencing. +- **Code lane:** one local T3 Code worker on a new isolated gate branch/worktree, starting at the exact published overnight branch. DeepSeek/OpenCode for recon/test scaffolding; Codex/Claude-class for gate safety/concurrency and independent security review as needed. +- **Research lane:** browser-manager read-only current-upstream inspection can occur immediately, independently of code writes. Local disposable trial merge allowed with exclusive ownership. +- **Status initial:** D1–D4 ACCEPTED; gate implementation TASK READY, NOT IMPLEMENTED; strict revocation contract DESIGN REQUIRED; public shipping exclusion RELEASE GATE; actual fork/upstream merge NOT INTEGRATED. +- **No automatic status upgrades:** implementation != tests != review != integration != VERIFIED. Persist real attempt and routing decisions in Project Runtime where available; otherwise append to branch-local ledger. No fabricated token costs or provider runtime status. + +## 5. No-go boundaries and stop conditions + +No main merge, unreviewed production setting exposure, direct upstream PR push, new standalone orchestrator/database, force operations, destructive cleanup, material paid provider calls, public release or silent acceptance of best-effort cancellation in production. + +Stop for a significant new upstream launch API, cross-process atomicity guarantee or new data authority; raise a design decision with source-backed options and continue independent nonwriting tasks. + +## Next canonical action + +**2026-11-05 21:43Z superseding action:** The user-accepted D4 A+B contract has now been implemented on an isolated local-only D4 branch. The full real `layerMakeServer` production-root K1 transaction/revocation check and K2 natural async `schedulePreparation` release-denial test **RUNTIME PASS (worker-reported, independently reviewer-rerun)**. K3 broader crash/restart/pruning/provider-portability is **PARTIAL**, not waived for production contexts. The [manager K1/K2 reconciliation](manager-d4-full-root-k1-k2-verification-reconciliation-20261105.md) records exact scope, tests, reviewer, quotas and local provenance. [Original D4 implementation task](task-stage2-d4-isolated-implementation-20261105.md) and [full-root verification task](task-d4-full-server-assembly-verification-20261105.md) are **COMPLETED** and MUST NOT be redispatched. + +**Next requires separate product/integration authority:** Evaluate upstream catch-up (current upstream 91 commits beyond the incorporated parent), then consider re-landing isolated continuation+D4 as **fresh bounded changes on a safe integrated-main base**, not merging the divergent experiment branch. No upstream sync, local code work, Git push/PR/main merge, public shipping or production enablement is authorized by K1/K2 PASS. D2 remains an unmet public shipping schema-exclusion gate, including test against a real packaged client/authenticated tool listing. Do not touch private PR #21 evidence or retained verification worktrees. + +## 2026-11-06 11:47 — latest qualification record, no product-contract change + +The user-accepted D1–D5 semantics are unchanged. The overnight isolated U/R/H sequence completed and stopped after H: U upstream trial **G-U FINAL PASS** with the disclosed 900-second monolithic timeout covered by all 367 affected files in 29 batches; R default-off continuation and D4 A+B **G-R FINAL PASS** after qualifying different-provider Codex read-only review and full-root K1/K2 8/8; H **reviewed tests/fixtures-only qualification** with source-loaded agent-facing D2 tool list identical to frozen U baseline (zero continuation fields/bytes), disposable restart/crash/pruning and two-provider stub tests PASS. **H did not implement new production schema projection code**. [Manager evidence, limitations, exact reported test counts](manager-overnight-urh-final-reconciliation-20261106.md). + +**Unresolved release gates remain** D2 **packaged/authenticated paired-client MCP tool enumeration** and real external provider-start crash/reconciliation windows, alongside full CI/build and target UI/native verification. No extra stage was authorized beyond H; no Git push, PR, fork-main merge, public release, production default-on, material paid provider or destructive operations. User must authorize the next bounded task. [Proposed packaged D2 verification task](task-post-h-packaged-d2-shipping-verification-proposed-20261106.md) is **PREPARED / AWAITING USER AUTHORIZATION / NOT DISPATCHED**. The original user-accepted D4 contract still controls any later integration/release. diff --git a/docs/orchestration-v2/continuation-stub-provider-spike-task-20261103.md b/docs/orchestration-v2/continuation-stub-provider-spike-task-20261103.md new file mode 100644 index 0000000000000..551791ec655ee --- /dev/null +++ b/docs/orchestration-v2/continuation-stub-provider-spike-task-20261103.md @@ -0,0 +1,112 @@ +# Bounded spike: T3-native automatic continuation + +Date: 2026-11-03 +Status: SOURCE-RESEARCH GATE PASSED; READY FOR BOUNDED LOCAL STUB EXPERIMENT AFTER REPO/OWNERSHIP PRECHECK; NOT IMPLEMENTED +Owner: T3 Code local isolated worker, with Overall Manager evidence review +Repository: jermur788/t3code +Base: current main as of review, revalidate before work (reported d3bedef12a31); use fresh isolated worktree +Governing direction: docs/internals/fork-product-direction.md; Project Runtime and RTE-V1 contracts; 02_COORDINATION_HANDOFF_PROTOCOL.md and current state +Design review: user-supplied independent Sonnet read-only analysis from 2026-11-03; manager source spot-check of current main + +## Why this bounded experiment is authorized + +Independent reviewer recommends T3-native continuation rather than replacing the coordinator with DeepSeek Superagent, confidence roughly 80%. Source review confirms: +- T3's RuntimeTaskExecutionService persists attempt-first launches, active-attempt gating, reconciliation, cancellation and handoff linking. +- ProjectRuntimeService requires passing evidence for a passing verification milestone, but this input validation **is not independent proof** that acceptance or review really passed. Execution terminal `completed` does not automatically mean task VERIFIED. +- DeepSeek Superagent bundles an application Engine with exclusive ownership of Triggers/Threads/Tickets/Assignments and a separate persistent Store, and its ACP surface does not expose that orchestration domain. +- Superagent prototype and Harness have MIT licences and can legally be forked/maintained if upstream stops; that does not make maintenance free. +- DeepSeek Harness's ACP worker entrypoint is already documented by T3. No new provider driver is required for this spike. + +The independent reviewer ran no code. This authorizes a **reversible local test**, not adoption of a final product architecture. Option B may be reopened if future APIs, security guarantees or measured effort materially change. + +## Pre-implementation research gate (2026-11-03) + +Before starting the local code writer, reconcile the source findings from [the comparison with Argus, DeepSeek Superagent, OpenHands and Cloudroom](preimplementation-architecture-reuse-research-20261103.md) with the active governing spec and Current State. + +- Confirm T3's existing execution attempt and event outbox/commit mechanisms already cover the intended duplicate-prevention boundary before adding persistence. Do not assume upstream EventSink can take new fork-specific effect types without a compatibility review. +- Preserve the Argus-style direct fast path (no redundant Manager turn after a clean independent review) and require evidence provenance, revision freshness and scope before admitting any completion. +- Preserve the DeepSeek-style distinction between an incoming event and an authorization grant. +- Record which design facts and event seams were source-inspected, and which still need runtime proof. +- Keep the task a reversible synthetic proof, not a release or policy enablement. This gate may be satisfied by manager source review and a bounded accepted spec; it does not require another full external framework audit. + +## New preflight gate from 2026-11-03 upstream-first research + +The source-level audit gate **passed on 2026-11-03**. The Overall Manager reconciled the attached upstream-first study and a code-level Argus-versus-native-T3 comparison in [the living research report](preimplementation-architecture-reuse-research-20261103.md). This only clears the **isolated, synthetic, reversible spike**; it does not accept a production architecture, authorize a merge, or grant real-provider access. The detailed task boundaries and the existing accepted product/RTE contracts are the scoped governing requirements for this experiment. The attached study changes the cost-minimizing sequence: + +1. Confirm where upstream T3 Orchestration V2 already implements post-worker continuation, durable effects/receipts, cross-provider handoffs and recovery. Distinguish generic provider-child post-settle wakeups from fork-specific project-level `review -> repair -> next task` decisions. +2. Search active upstream issues, discussions, pull requests and forks for relevant implementations before adding fork code. The latest source review found ongoing upstream proposals and unmerged continuation fixes; no proposal is an accepted API until integrated and verified. +3. Attribute every necessary remaining capability to upstream T3, existing fork Project Runtime policy, an optional external agent component, or a deliberate deferred decision. Record expected security/rebase cost. +4. Assess whether Argus's project/mission/reviewer stage machinery is materially cheaper to reuse for the **upper policy layer** than extending T3 Runtime. Do not assume the earlier Sonnet recommendation against DeepSeek also resolves Argus. +5. **Finding:** T3 upstream already owns provider post-settle continuation; T3 Fork still lacks demonstrated autonomous **project-task review/repair** selection. The isolated synthetic spike may proceed in a separate worktree, using existing T3 task-revision, request-key and command/effect receipts rather than creating duplicate execution state. A new table or upstream-internal effect type requires separate source justification and reviewer approval before implementation. + +The separate DeepSeek 12-item todo/progress discrepancy is an observability candidate; it does not authorize changes within this spike. + +## Narrow architecture interpretation and stop rule + +- **Not in scope:** implement provider turn completion wakes, rewrite T3 orchestration V2, install Argus/DeepSeek Superagent as a manager, synchronize a second task store, or modify the upstream MCP delegation contract. These are already existing upstream services or material architecture changes. +- **Only new semantic decision:** a task-level policy determines whether a **previously authorized** review or bounded repair should follow a reconciled terminal worker attempt. It must validate task/attempt/reviewer provenance and reject stale or untrusted completion claims. +- **No-model-call clean review:** follow Argus's independently reviewed fast path: once trusted review plus deterministic guards pass, do not pay for a redundant Manager semantic vote. +- **Crash boundary:** first test existing per-task `request_key` uniqueness and persisted attempt-before-launch behavior. The policy must not invent extra identities, stores or side effects for a duplicate run event. If this cannot guarantee safe recovery after a durable action intent but before launch, STOP and report a design gap before expanding. +- **Authorization:** operator-owned accepted scope and verification requirements cannot be changed by a worker; a repair may use another provider only under an existing explicit policy. User gates for merge, destructive actions and paid models remain unchanged. +- **Baseline distinction:** RTE-V1 launch/recovery tests are integrated VERIFIED; this *new continuation feature* remains NOT IMPLEMENTED until the isolated spike passes. + +## Initial gate: repo and task ownership + +Before any write: inspect repo, branch/worktree, current head, status, unrelated changes, running workers and lane owner. Never stash/reset/discard/force-push/rebase shared history. Create a new separate worktree/branch off the refreshed main head, not PR #20's docs branch. One code writer. Compare the existing Runtime/Orchestrator service and relevant upstream extension points first. This is a test with stub providers, no paid models or external credentials. + +## Objective + +Prove that T3 can deterministically advance one previously authorized Runtime task after worker completion, with no second orchestrator/store, no repeat dispatch after replay/restart, and no authority inferred from a worker's success claim. + +## Implement only the minimum + +- Add a bounded continuation evaluator triggered by an existing authoritative run/attempt terminal transition or reconciliation seam. It reads T3 Runtime state, handoff, verification, action authorization and task revision; never reads Superagent data. +- It produces one structured next-action decision: `no_action`, `review`, `repair_or_retry`, `ask_user` or `blocked`, with a recorded reason, evidence references, source attempt/transition identity and versioned policy. +- For the prototype, permit automatic launch only of an **already-authorized** review task. A repair/retry is allowed only with explicit prior task policy and a separate test case; a review failure cannot silently grant extra scope. +- Use existing Runtime execution launch and its idempotent command receipts. Add at most one narrowly scoped persistence record/table for the continuation action receipt if genuinely necessary. Do not introduce a second engine, task status owner, queue or mutable shadow task database. +- Keep no-model-call fast path. No LLM in the experiment; no new model-selection policy. Let DeepSeek remain a configurable low-cost model/worker outside the spike. +- Fail closed on missing evidence, unresolved review, stale revision, ambiguous worktree/provider permission, `reconcile_required` attempt, duplicate terminal event and active execution. +- Maintain user gate for merges, destructive operations, material architecture/security changes and unapproved paid resources. + +## Finite agent decision budget (user-directed requirement, 2026-11-03) + +The user requires that selective orchestration never degenerates into unbounded Manager/Reviewer/Engineer debate. See [bounded-decision escalation design](bounded-decision-escalation-design-20261103.md), which records the qualitative requirement and identifies numeric production thresholds as **proposed, not yet accepted**. + +For this stub-provider experiment only, use a configurable **two-repair-and-review-cycle** test budget per task. Each reviewed repair attempt consumes one cycle; rephrasing a complaint, restarting T3, selecting another provider/model, or spawning a child does **not** reset the budget. A valid clean review completes with no redundant Manager model turn. An unresolvable same-issue disagreement at the limit produces exactly one durable `ask_user`/blocked decision and launches no further work. An operator-owned product choice triggers `ask_user` immediately regardless of unused budget. + +Add negative tests: same failure under different wording, duplicate events and restart after one consumed cycle, provider switch, real new evidence before exhaustion, no progress despite activity, one healthy long-running external test which must **not** count as idle debate, and a request for unauthorised scope. Keep this policy over fork Project Runtime; **do not** implement a separate generic provider conversation-limit mechanism or modify upstream V2. Do not make two cycles a production default on the strength of synthetic tests alone. + +## Acceptance and verification paths + +**A. Successful review, no retry** +1. Create a synthetic Runtime implementation task and an explicitly authorized independent review task. +2. Stub worker X completes; persist attempt and worker handoff, not a `verified` task by assumption. +3. Reconciliation / terminal event proposes exactly one authorized review action. +4. Stub reviewer Y completes with synthetically supplied valid review evidence. Task verification and status may advance only according to existing trusted Runtime validation rules and the explicit review acceptance path. +5. Replay terminal events and restart/reload the server; prove a review is **not launched twice**, and a passing review causes **no repair/retry**. + +**B. Failed review, conditional repair** +1. On a separate synthetic task, reviewer Y supplies failing evidence. +2. If prior authorization explicitly permits bounded repair, select alternative stub provider Z and launch only one repair attempt using the existing guarded Runtime execution. Otherwise return `ask_user` or `blocked`. +3. Repeated events, duplicate requests, crashes and restart must not duplicate repair. Verify no task transitions to `verified` with failing evidence. + +**C. Negative and recovery cases** +- Missing handoff, wrong-thread handoff, stale task revision, missing/failed evidence, provider unavailable, denied authorization, active attempt, ambiguous attempt, failed launch, crash before/after receipt, stop/cancel, repeated out-of-order terminal events. +- Existing T3 single-active-attempt behavior remains intact. Existing event graph/adapter behavior remains unchanged outside the additive seam. + +**Pass:** deterministic action selection, exactly-once externally observed dispatch under retries/restart for each authorized action; no duplicate engine; at most one additional narrow receipt table; isolation and permissions preserved; tests and restart evidence pass; independent source/security review accepts. +**Fail:** a second state owner is required, safety depends on unenforced prompt rules, lifecycle ambiguity produces duplicate external execution, or task acceptance is inferred from terminal completion without evidence. + +## Explicit exclusions + +- No Superagent installation or process; no real provider keys, real repository side effects, new paid models, CCF changes, Sample 3R2/4 benchmark, production routing/profile/adaptive policy changes, auto-merge, multi-project scheduler, new user-facing UI or Letta/Mastra integration. +- Do not close the existing Documentation V1 golden-path gate by implication. It remains independently `FINAL VERIFICATION PENDING`. +- Do not claim end-to-end DeepSeek Harness ACP qualification from this synthetic test. + +## Completion and coordination + +Run focused T3 tests/typecheck/format as appropriate; capture test command and output, server restart/replay evidence, modified files and any upstream compatibility hotspots. Perform independent code/security review of dispatch, ownership and crash consistency. Do not integrate to main without the governing spec/acceptance review and existing integration authority. + +Return: VERDICT (implemented/static pass/runtime pass/review pass where supported); repo base and branch; exact scope and generated receipts; test commands and outcomes; independent review; remaining defects; merge/integration recommendation; blockers; canonical Runtime task/handoff update if available; next safe action. + +If this spike demonstrates that native continuation requires a large second state system, stop and compare the cost of a limited DeepSeek Superagent bridge instead of extending the design further. diff --git a/docs/orchestration-v2/d2-shipping-exclusion-audit-plan-20261105.md b/docs/orchestration-v2/d2-shipping-exclusion-audit-plan-20261105.md new file mode 100644 index 0000000000000..4ce8e0301445c --- /dev/null +++ b/docs/orchestration-v2/d2-shipping-exclusion-audit-plan-20261105.md @@ -0,0 +1,51 @@ +# D2 — Shipping-surface exclusion: browser source audit and local build test plan + +**Date:** 2026-11-05. +**Status:** ANALYSIS COMPLETE (browser source inspection); **BUILT-ARTIFACT VERIFICATION NOT RUN**. D2 requirement is user ACCEPTED, but any implementation technique for eventual integration remains a separate design choice. +**Sources:** [accepted staged safety spec](continuation-staged-safety-governing-spec-20261104.md), [T4 research](https://github.com/jermur788/t3code/blob/experiment/continuation-default-off-gate-20261104/docs/orchestration-v2/staged-continuation-t4-strict-revocation-and-shipping-20261104.md), [Current State](../../01_CURRENT_STATE.md). + +## What browser inspection establishes + +- The current fork `main` is the merged upstream reconciliation + P2 fix, while continuation code resides on isolated `experiment/continuation-default-off-gate-20261104`. The experimental branch is **34 commits ahead and 336 commits behind current main** in GitHub's comparison, so rebase/merge assumptions are invalid. +- The experiment modifies shared `packages/contracts/src/projectRuntime.ts` with optional `continuation` fields on Project Runtime task read/create/update schemas and a new continuation enum/type. `apps/server/src/mcp/toolkits/project/runtimeTools.ts` imports the task create/update schemas and assembles agent tool definitions, so the advertised input schema can change **even if the feature is server-gated off**. Other shared surfaces (WebSocket, mobile, desktop) may depend on these types and must be inventoried before a merged implementation. +- Worker history measured an experimental **+646-byte** agent-facing MCP `tools/list` delta. This is earlier reported evidence, not remeasured on current reconciled main. A default-off runtime gate does not itself remove advertised schema fields or prompt overhead. D2 requires **no exposed experimental continuation schema/tool fields in public shipping artifacts**, and no unapproved prompt-budget increase. +- The chosen D2 implementation does not have to be active for current fork `main` while continuation stays isolated. **The fork main baseline still requires an actual built-tool-list check before any public release**; do not claim it already passed merely because branch-specific source is absent. + +## Viable shipping strategies and trade-offs + +**A. Branch/source exclusion (preferred until D4 is accepted and integration is authorized):** continue keeping all experimental continuation code/contracts off fork main and out of release builds. Lowest current risk and no upstream tool-schema edits; however, the feature is unavailable to main and eventually integration must be revisited. Test built shipping artifact to confirm. + +**B. Build-selected contracts/tool schemas:** if the user later approves integrating a default-off feature, construct separate internal continuation-capable contracts and a shipping-safe, explicit MCP advertised task schema that omits `continuation` regardless of runtime flag. Avoid trusting static TypeScript erasure or a runtime feature gate to remove JSON Schema. Requires testing all output surfaces and code generation; may introduce maintenance/rebase cost. + +**C. Release-time source code stripping:** run build tooling to omit experimental continuation paths before packaging; can avoid schema deltas but has divergent build trees and difficult assurance. Do not approve or implement without a defined reproducible build/CI guard. + +**Not acceptable:** leaving continuation fields in the agent-facing MCP tool list while returning `continuation_disabled` at runtime; a static string search as the only test; silently counting prior experimental +646 bytes as approved public overhead. + +## Local worker verification needed (read-only / stub) + +1. On exact fork main and exact isolated experiment in two **separate, owned, clean worktrees**, inspect generated/schema-emission code, built MCP tool list, contract types, context budget and provider adapter advertising. Confirm origin refs and no overlap with other workers. +2. Build and launch **local stub/no-cost** server instances in each worktree; capture complete `tools/list` JSON (sanitized) from genuine tool enumeration, with exactly the same provider configuration and auth context. Exclude tokens/credentials from captured artifacts. +3. Validate tool names, optional properties, nested continuation fields, response/runtime task schema exposure, and actual serialized bytes (not only code size). Compare matched source baselines while accounting for legitimate upstream changes; source and build snapshots separately. Identify all client surfaces reusing these contracts. +4. Check `agentContextBudget.json` and the test that guards prompt/tool-schema budget. Identify whether current shipping main has any accidental experimental schema leak; if found, classify as `IMPLEMENTATION DEFECT` and report to manager, **do not modify main**. +5. Run targeted tests/compile to check that removal of agent-facing continuation fields does not prevent operator-only internal authority or mutate normal Runtime task creation. This can be a **test proposal**; do not implement an architecture-dependent schema split without accepted design. +6. Return the actual built-tool-list diff/hash, measured bytes, provider/configuration conditions, verification commands/exits, risks and a recommended minimal shipping strategy. Use different-provider independent read-only review. + +## Release gate + +To mark **D2 shipping exclusion VERIFIED** on a particular public build, capture: +- exact shipping source/ref/build profile and **built** server's `tools/list`; +- no experimental continuation authority/tool fields anywhere in agent advertised surface; +- measured prompt/tool-schema budget compared against the accepted shipping ceiling (no default-on or +646-byte accidental promotion); +- non-continuation Project Runtime task creation/read/update and MCP tools still functional; +- independent review and reproducible automated build test. + +D2 is a **future public release requirement**. **No public release is authorized**. No change to fork main, branch inclusion, upstream APIs or production settings is authorized by this audit plan. + +## 2026-11-05 source-loaded MCP audit return — scoped PASS, no packaged release verification + +[Manager's three-lane reconciliation](manager-stage2-three-lane-return-reconciliation-20261105.md) records worker-reported independent review **PASS WITH FINDINGS**, corrected. Actual `tools/list` from production-transport source loaded against **mocked services** reported **79 tools** on both main and experiment, with **+646 UTF-8 bytes in the agent-context budget** (56,753 vs 57,399), **+323 bytes** per task-create/update input schema for optional continuation, four task output schemas **+351 bytes** each outside the budget formula and other unrelated byte drift. Committed budget 58,519 vs 59,165; raw JSON size 187,026 vs 189,796. The source-loaded main tree advertised no experimental continuation field; the isolated experiment's field was exposed **even with the server gate disabled**. + +**Qualification:** This is **`D2 SCOPED AUDIT PASS (worker-reported)`**, **not `D2 SHIPPING VERIFIED`**. The handler registry/services were mocked, and neither packaged public-release server nor real paired-client authenticated tool enumeration was tested. Actual shipping release acceptance therefore **requires a built/packaged artifact with supported, genuinely authorized paired-client enumeration (or an equivalently faithful production-auth integration harness), plus a reproducible schema-budget gate**. Manager will not waive that requirement based solely on mocked registry enumeration. + +If experimental continuation is later approved for integration, **strategy B** (explicit shipping-safe agent MCP projections that omit operator-only `continuation` in the relevant create/update/success schemas while preserving internal authority) is a recommended approach, not an approved source change. Keep experimental code isolated for now, or public shipping must exclude it entirely. + diff --git a/docs/orchestration-v2/d4-accepted-revocation-contract-20261105.md b/docs/orchestration-v2/d4-accepted-revocation-contract-20261105.md new file mode 100644 index 0000000000000..acff6299e199e --- /dev/null +++ b/docs/orchestration-v2/d4-accepted-revocation-contract-20261105.md @@ -0,0 +1,74 @@ +# D4 — Accepted execution revocation contract (A + B) + +**Authority:** User explicitly agreed to Overall Manager's recommended **A + B** on 2026-11-05 at 14:10 UTC, following the plain-English explanation and the three-lane qualification review. +**Status:** **A+B ACCEPTED / ORIGINAL ISOLATED D4 K1/K2 FULL-ROOT PASS / NEW U-DERIVED R RE-LAND K1/K2 8/8 PASS (worker-reported) AND DIFFERENT-PROVIDER CODEX REVIEW PASS WITH FINDINGS / H BOUNDED K3 RECOVERY PASS (tests/fixtures only) / EXTERNAL PROVIDER START/PRODUCTION PARTIAL / NOT INTEGRATED / NOT PRODUCTION VERIFIED**. Contract unchanged. [Latest U/R/H manager reconciliation](manager-overnight-urh-final-reconciliation-20261106.md). +**Scope:** Project Runtime operator-authorized **synthetic continuation**, currently isolated on the default-off experimental branch. Not a grant of autonomous authority to agents; no main merge, upstream catch-up, provider-production testing, release or material paid spend. +**Companion:** [staged safety governing spec](continuation-staged-safety-governing-spec-20261104.md) (D1–D5), [Stage 2 verification](manager-stage2-three-lane-return-reconciliation-20261105.md), [historical design alternatives](d4-transactional-revocation-proposed-contract-20261105.md), [Current State](../../01_CURRENT_STATE.md). + +## 1. Binding acceptance rules + +### A. Strict no-new-run after durable operator revocation + +**Linearization point:** durable transaction commit that creates a **new** continuation `run.created` event in T3's authoritative orchestration event store. Revocation means the authorized operator's removal/invalidation of the source continuation policy (`continuation: null` or otherwise invalidating the exact authorized revision) is **durably committed first**. + +**Rule:** If revocation commits before the would-be continuation run-creation transaction, that transaction **MUST NOT** commit `run.created`, a start effect, or a falsely successful command receipt under the revoked authorization. This must hold for concurrent writers, retries, delayed launch, replay and server restart. A task/attempt receipt reserved earlier than revocation is *not* permission to create a run afterward. + +The guard must be bound to **project ID, exact source task authorization identity/revision**, and an internally trusted continuation launch provenance; include target/attempt/request identity where necessary for idempotency. A worker/agent/MCP request key, a handoff, prompt, route, or a thread's `createdBy` alone **MUST NOT** mint authority. Denial is deterministic and fail-closed without a new run; produce typed, inspectable reason/status without exposing private policy data. + +**Implementation preference, not an unreviewed API mandate:** use a narrow upstream-friendly **private transaction-time guard** at the orchestration command/event commit boundary, leaving normal user dispatch unchanged and avoiding a new authority table where existing task revision plus same-DB write ordering is sufficient. Any significant upstream engine contract expansion, added durable authority table/epoch, or failure to prove shared SQLite transaction semantics is **REVIEW REQUIRED** rather than permission to improvise. + +### B. Prepared but not started after revocation + +**Observed actual path:** `ThreadLaunchService.launch` invokes `message.dispatch` with `dispatchMode: defer_start`. That path creates a durable `preparing` run **without** `provider-turn.start`; a later `prepared-run.release` can enqueue start work. The earlier fixture's initial pending start effect was not the real lifecycle. + +**Rule:** If revocation is already committed and the system can reliably establish that the run **has not begun execution**, T3 **MUST block its pending release/start and must not deliberately enqueue a new provider-start effect** under that revoked continuation authorization. Cancel unsettled effects where this can be established safely. For any ambiguous in-progress release/worker/provider start, classify `reconcile_required`, retain durable provenance, and attempt safe best-effort cancellation/stop; do not silently mark it cancelled or successful. The feature remains default-off outside an authorized experiment. + +**Scope boundary:** The user **did not require a globally atomic guarantee over an external provider's `startTurn` call**, and did not require an immediate/guaranteed stop of an already-running provider. For work already executing when revoked, request stop/cancellation where supported and record whether it was acknowledged; reconcile uncertain cases. Do **not** claim transactional external-provider cancellation based only on SQLite checks. If later product requirements demand stricter external-start linearization, return for a **new architecture decision**. + +### C. Nonnegotiable data/operation constraints + +- **Only an operator** may grant, modify, or revoke continuation authorization. Agents/providers cannot re-grant it via task input, MCP, prompt, route or hidden schema. +- Authorization is **project-scoped**; wrong-project/task/source/revision contexts must fail closed. Preserve accepted task CAS revisions, immutable attempt/receipt provenance, and idempotency. +- Distinguish `pending` (Runtime attempt), `preparing` (durable run), `provider-start effect queued/claimed`, and `running` (provider accepted); never collapse them to one launch state. +- A pre-revocation committed run may still exist on replay. Returning its prior durable receipt is not **new run creation**; however, replay after revocation may **not** create a new run, enqueue a fresh start for a provably unstarted run, or resurrect cancelled effects. +- Gate disabled/authorization removed must not affect **normal user-created runs or non-continuation Project Runtime execution**, nor degrade existing service-level project isolation, Evidence V0, handoff or routing contracts. +- Respect D2: **no experimental continuation input/output field or budget increase** in public shipping agent-facing MCP schemas unless separately accepted. The present default-off gate is insufficient to hide it. +- Preserve server-owned Runtime/orchestration state; no chat, hidden worker reasoning or dashboard copy becomes the authoritative revocation ledger. + +## 2. Ordering/acceptance examples + +| Scenario | Accepted behavior | +| --- | --- | +| Revocation durable before new run commit | Deny new continuation `run.created`, deny start effect, no accepted-success receipt; preserve attempt as cancelled or reconcile-required by known shell/run state | +| New run commit wins before revocation | Run exists exactly once; separate B gate applies if still `preparing`; no duplicate via replay | +| Revocation between `run.created` and `prepared-run.release` | If definitely not executing, prevent release/start; record cancellation and retain provenance | +| `prepared-run.release` raced against revocation or external provider start | Inspect durable effect/provider evidence; stop if safe, otherwise mark `reconcile_required`, no invented cancellation guarantee | +| Pre-revoke attempt receipt replay after restart | Re-check operator authority before **any new run**, fail closed if revoked; do not reissue new start work; preserve historical receipt | +| Independent project / ordinary user run | No D4 restriction accidentally inherited | +| Concurrent policy edits or stale revision | CAS conflict or fail-closed authorization result, never an automatic re-grant | +| Crash, lost client, incomplete/pruned history | Conservatively reconcile; never fabricate a past run or successful stop | + +## 3. Implementation/verification contract (not yet executed) + +The implementation must operate on an **isolated owned worktree** after exact-base/status review and should be designed as a small generic T3 extension. The experimental continuation remains outside fork `main`. The Stage 2 subset demonstrated same-file/inode SQLite writer ordering and a fixture guard, **not** full server-root `continuation:null` handling or a finished D4 code path. + +**Required checks before any D4 PASS:** + +1. Inspect full server dependency graph, real operator revoke update and exact `BEGIN IMMEDIATE` transaction/DB identity. Show that authorization check and event/effect/receipt commit share required serialization **in actual server assembly**, not merely an isolated subset. +2. Inventory every continuation-reachable `run.created` path (three currently direct emitters), `prepared-run.release` paths and provider-start effect/recovery path; prove internal provenance cannot be forged from public/MCP commands. +3. Deterministically test both transaction orderings across separate SQL connections/processes; revocation between run creation and release; effect claimed/start uncertainty; same-key replay and startup reconciliation, crash/pruning, concurrent operator task revisions and cross-project/task isolation. +4. Verify fail-closed guard denial returns a typed outcome and **no false accepted receipt**; normal user launches, default-off gate, D2 schema exclusion, and other Project Runtime V1 behavior remain unchanged. +5. Run fresh focused tests, full relevant typecheck/changed checks and real local stub/no-cost server integration where possible. Independent read-only concurrency/security and upstream compatibility review by a **different provider/model**, then repair and re-review. +6. Preserve accepted statuses: `IMPLEMENTED`, `STATIC PASS`, `RUNTIME PASS`, `REVIEW PASS`, `INTEGRATED`, `VERIFIED` only where evidenced. No production/published/release PASS from mock/fixture tests. + +**Stop/decision gate:** Stop for inability to establish transaction atomicity, unavoidable public/protocol expansion, significant upstream engine rewrite, new authority/epoch database, cross-process distributed locks, an externally atomic provider-start promise, or conflict with D2/upstream main. Report options; do not silently weaken A/B. A future merge/main integration, upstream sync, production enablement, material spend, public PR/release or destructive Git operation all require their own authorization. + +## 4. Current accepted acceptance position after 2026-11-05 21:43Z return + +**A+B product contract remains ACCEPTED without revision.** The isolated local D4 implementation's **K1 real production-root transaction ordering and K2 natural async preparation/release denial are now RUNTIME PASS (worker-reported; independently re-run)** per [manager reconciliation](manager-d4-full-root-k1-k2-verification-reconciliation-20261105.md). Worker reported 5/5 full assembly tests and reviewer reran 5/5 plus 94/94 focused; K3 extra tests are **PARTIAL** for process crash/restart/pruning and provider-portable stub/adapter coverage. No externally atomic provider-start guarantee is asserted or required by A+B. The local implementation branch remains unpushed/unobservable to this browser. **Not integrated, not production verified** and D2 experimental agent MCP schema exposure remains a separate public shipping blocker. + +**Original [isolated implementation packet](task-stage2-d4-isolated-implementation-20261105.md) and [full-server assembly verification packet](task-d4-full-server-assembly-verification-20261105.md) are COMPLETED, not pending.** No more local work is authorized from them. Future upstream catch-up, safe continuation re-land, D2 shipping schema exclusion, fork-main merge and release each require their own scoped authority and verification. The original acceptance checklist remains binding for those later integration/release contexts; K3 partial must not be silently promoted to VERIFIED. + +## 2026-11-06 11:47 — post-reland evidence / contract remains unchanged + +The overnight isolated R implementation re-applied minimum default-off continuation+D4 A+B on accepted U candidate. Per returned worker/reviewer evidence, **K1/K2 8/8 real-root**; a genuinely different-provider **Codex SOL Medium READ-ONLY review** reran 8/8 plus 199 focused/7 budget checks and returned **PASS WITH FINDINGS, no blocker/major**. H's later **tests-only** qualification covers disposable process restart/SIGKILL/reopen, genuine pruning/truncation, idempotent replay, default-off and two adapter-independent provider stubs, with independent review PASS. This does **not** establish externally atomic provider `startTurn` or production/live-provider crash behavior; that is explicitly outside A+B and remains a separate release qualification decision. [Final manager result](manager-overnight-urh-final-reconciliation-20261106.md). No fork-main merge, public push/PR, default-on enablement or deployment. **The user-accepted A+B product contract is not amended.** diff --git a/docs/orchestration-v2/d4-transactional-revocation-proposed-contract-20261105.md b/docs/orchestration-v2/d4-transactional-revocation-proposed-contract-20261105.md new file mode 100644 index 0000000000000..725ad60e00241 --- /dev/null +++ b/docs/orchestration-v2/d4-transactional-revocation-proposed-contract-20261105.md @@ -0,0 +1,86 @@ +# D4 — Proposed durable-run-creation revocation contract (browser source review) + +**Date:** 2026-11-05. +**Status:** **HISTORICAL RESEARCH / SUPERSEDED BY [ACCEPTED D4 A+B CONTRACT](d4-accepted-revocation-contract-20261105.md) on 2026-11-05.** The options and unchosen alternatives below remain reference material; do not treat old undecided language as current authority. D4 implementation is still NOT RUN / NOT INTEGRATED. +**Purpose:** advance the already-accepted D4 *requirement*, not silently choose a material orchestration/transaction architecture. +**Governing:** [accepted staged continuation safety spec](continuation-staged-safety-governing-spec-20261104.md), [prior T4 design research](https://github.com/jermur788/t3code/blob/experiment/continuation-default-off-gate-20261104/docs/orchestration-v2/staged-continuation-t4-strict-revocation-and-shipping-20261104.md), and [Current State](../../01_CURRENT_STATE.md). + +## Confirmed repository facts (browser code inspection) + +1. Fork `main` and [PR #21](https://github.com/jermur788/t3code/pull/21) were re-fetched; main is `fb67545d790c5c001e8f85827f219ab6493c435e` (merged reconciliation). Experimental continuation is **not** in main. Isolated `experiment/continuation-default-off-gate-20261104` at `b3b8da54e0b8b184a1cf4e667d53e73e04f85074` has diverged: GitHub comparison with current fork main returned **34 ahead / 336 behind** (different histories; **not** an estimate of cherry-pick effort). Isolate integration and do not fast-forward or merge it directly. +2. Current upstream `pingdotgg/t3code` `main` at `337c5858c33bc7f8f6dfd391a2c279fa0f7e4d17` was **50 commits ahead** of incorporated upstream release-preparation parent `bb4afa5425c52104a9261fa2d022cb8ba2fcc099` as fetched 2026-11-05. GitHub compare file list limited to its first 300 paths; these include provider adapters, Orchestrator, projections, MCP and persistence. This is **forward-compatibility review input, not an upstream update**. +3. The current fork and current upstream have **identical blob contents** for `apps/server/src/orchestration-v2/EventSink.ts` and `ThreadLaunchService.ts` at this inspection (GitHub blob SHAs equal across both). ProviderTurnStartService differs between fork/upstream. Recheck on an actual local worktree before implementation. +4. `ThreadLaunchService.launch` creates/claims a thread, then dispatches `message.dispatch` as the initial message (`ThreadLaunchService.ts` near 835–1028), and obtains its run from the returned `run.created` event. A thread shell can therefore exist even if run creation is subsequently rejected; this is an expected reconcile/cleanup state, **not** proof of an executed provider turn. +5. `Orchestrator.ts` dispatches `message.dispatch` and emits `run.created` plus possibly a `provider-turn.start` effect (near 6191 / 6620–6699; other paths may emit runs too). `Orchestrator.ts` around 13685 passes planned events and effects to `EventSink.commitCommand`. +6. `EventSink.commitCommand` around 635–711 reserves a command receipt, appends events, applies projections and enqueues effects via a **single `sql.withTransaction`** through `commitThenPublish` (around 259–283). It **currently has no continuation authorization guard**. A pre-commit orchestration planning check cannot by itself close a revocation race. +7. In the isolated experiment, `RuntimeTaskExecutionService.launchAttempt` around 715–781 re-reads a continuation's operator authorization and checks the default-off gate **before** calling `runLaunch`. It explicitly records a remaining gap between receipt insert/last check and the external launch. The revision-CAS source operator update uses `project_runtime_tasks` and `sql.withTransaction`; `ProjectRuntimeService.ts` near 666–719 notes `BEGIN IMMEDIATE` around a conditional revision update. The SQL services appear to use the same V2 store in the application, but **proving connection/database identity and cross-process transaction serialization in the actual runtime is a mandatory implementation precondition**, not yet an independent runtime PASS. +8. Current experimental shared `packages/contracts/src/projectRuntime.ts` adds `ProjectRuntimeContinuationPolicy` and optional `continuation` on task read/create/update types; MCP project task tools reuse contracts through `runtimeTools.ts`. This can increase **advertised** schemas even when continuation is disabled at runtime. D2 needs built-artifact validation, not source-only grep. + +## Proposed precise D4 invariant / linearization + +**Proposal B (preferred for product sign-off):** `launch` for the D4 invariant means **durable commit of a new `run.created` orchestration event**, not insertion of a Runtime attempt receipt and not a provider subprocess's `startTurn` callback. + +> If revocation of a particular operator-authorized continuation is durably committed before the transaction that would create a new continuation run, **that transaction must not commit a new `run.created` event or associated `provider-turn.start` effect**. This must hold across retries/replay/restart/concurrent writers. + +Use **existing task revision and explicit scope** as the initial guard source. Bind to project ID, exact source task ID, expected accepted task revision, continuation mode/authorization marker and any necessary target/attempt/request identity; do not infer authority from a worker, handoff, prompt, request key alone or a role string. + +A private server-issued guard context is carried down the host's specific continuation dispatch path, not exposed as an agent-writable MCP/RPC contract. **Guard MUST be evaluated while holding the very transaction/write serialization that commits `run.created` and the outbox effect**. Denial must be typed and fail-closed with no new run/event/effect; any command receipt/retry behavior must stay internally consistent and idempotent. Recovery must mark the Runtime attempt cancelled or `reconcile_required` depending on observed thread/run uncertainty. Do not leak sensitive authorization details in errors or logs. + +**Generic upstream-friendly boundary:** Evaluate a narrow internal `runCreateAuthorization` / `commitGuard` abstraction where `Orchestrator` sends events/effects to `EventSink`, rather than teaching upstream command planning about Project Runtime tables. Implement the fork-specific predicate in a separate injected service/adapter if possible. A proposed API/name is **not** an approved extension; review local types, command provenance, and any other run-creation paths before choosing an actual interface. Reject a design that merely adds one more check in `RuntimeTaskExecutionService.launchAttempt` or provider `startTurn`; that remains susceptible to check-to-commit races. + +## Ordering and in-flight scope (separate product contract) + +| Ordering | Proposed outcome | +| --- | --- | +| Revocation commits before new guarded run transaction | Run creation denied; no `run.created`/start effect. Receipt reconciled. | +| New run commits before revocation commits | Run was already created; it is **in-flight/existing** for D4. Whether to stop it is a separate policy. | +| Receipt created before revocation but run not yet created | Deny run on replay; safely cancel/reconcile receipt. | +| Same key replay after originally accepted run | Return/locate original durable outcome only; **never create a second run** or re-launch after revocation. | +| Different project or normal user-initiated run | Remains unaffected; no implicit cross-project auth or denial. | +| Work already queued in effect outbox | Secondary best-effort check before provider start can narrow exposure, but cannot atomically guarantee external provider calls. | + +**Not yet decided:** if a provider has not started when authorization is revoked **after** run creation, should we attempt to cancel that pending outbox effect, or allow it to become in-flight? Preferred defense-in-depth is to cancel where provably unstarted and reconcile uncertain cases, **without claiming atomic provider-start revocation**. The exact user-visible status and in-flight stop contract need separate product sign-off. This is distinct from the narrow no-*new-run* guarantee above. + +**Alternate proposal C:** define launch as external `startTurn` invocation. A database transaction cannot atomically bracket an external provider call. This demands a different, stronger distributed/process coordination contract and explicit failure semantics. **Do not claim B solves C.** + +**Alternate proposal D:** add an authorization-epoch table. This adds new authoritative state and migrations; **no approval exists**. Use only if the revision-based predicate is shown insufficient after source/runtime review, and request a separate architecture decision. + +## Preconditions before any writable implementation + +1. Inspect actual fork `main`, experimental branch, origin upstream current head, worktrees, uncommitted changes, and one-writer ownership. **No local main write, no destructive Git, no merge, no paid provider calls.** +2. Prove task revocation updates and event sink commit use the **same transactional database and writer-ordering semantics** in the relevant single/multi-process runtime. If not, **REVIEW REQUIRED**; do not silently assume atomicity. +3. Identify **every** `run.created` path and why it may/may not be used by continuation, including queued/steered messages, recovery and delegated paths. Instrument guard only when a signed/private internal continuation launch context is present, not for regular user traffic. +4. Define denial/receipt replay semantics so no command can appear accepted if its run/event was not committed; test restart from each checkpoint. +5. Upstream compatibility assessment: compare generic extension-point size with alternative existing abstractions; design so a future upstream fast-forward need not fork substantial internals. No upstream PR/post unless authorized. + +## Acceptance/verification matrix (proposal; worker must derive exact tests from final accepted spec) + +- Revocation-before-run barrier **fails closed**; no run event, no provider-start outbox effect, no provider process start; Runtime attempt terminal `cancelled` or `reconcile_required` as evidenced. +- Run-before-revocation preserves exactly one accepted run; no duplicate/replayed run after restart; in-flight behavior is explicitly recorded without overstating stop semantics. +- Concurrent callers on separate SQLite connections and two server processes where practical; same project and cross-project isolation; stale expected revision, malformed/missing guard, wrong actor, removed policy, gate-off, cancelled/blocked source task. +- Replayed pending receipt after process restart and after history pruning; no invented success; old receipts/idempotency correct. +- Normal user-created threads and non-continuation Runtime task execution unchanged; provider-neutral stubs for two providers when available. +- Typecheck and focused tests, changed-file checks, MCP `tools/list` unchanged for ordinary shipping baseline, web build where touched; rendered UI only if interface changes. **Run raw tests on accepted implementation worktree; browser source inspection alone is not runtime verification.** +- Independent read-only review of concurrency, security boundary, upstream compatibility and tests by a different provider/model. Use precise `IMPLEMENTED / STATIC PASS / RUNTIME PASS / REVIEW PASS / INTEGRATED / VERIFIED` labels only when actual evidence warrants. + +## Decisions required from product owner + +1. **Choose D4 linearization contract:** `run.created` durable commit (proposal B, recommended) or external provider start (proposal C, materially different). +2. Decide in-flight policy after a run has committed but provider has not started (best-effort cancel/reconcile versus stronger requirement). +3. Only if necessary: authorize a new authority/epoch table or an upstream-engine extension larger than the proposed generic guard. +4. Later: separate fork-main merge, production enablement and public release decisions. + +**Historical note:** The owner subsequently **ACCEPTED A+B** in [the governing D4 contract](d4-accepted-revocation-contract-20261105.md). That document governs. This older proposal does not authorize new authority tables, external-start atomicity, production release or main integration. + +## 2026-11-05 three-lane qualification return — critical `defer_start` correction + +**Status:** `SCOPE-BOUNDED FEASIBILITY PASS (worker-reported) / independent REVIEW PASS WITH FINDINGS (recorded)`; D4 remains **PROPOSED / NOT IMPLEMENTED**. See [manager reconciliation](manager-stage2-three-lane-return-reconciliation-20261105.md). + +- Lane A proved a test/fixture transaction guard can prevent a new run when a revocation commits first, on the same SQLite file/inode across separate processes, with **0/0/0** runs/start effects/receipts in guarded scenario versus **1/1/1** unguarded. Red-before test intentionally exited 1 and barrier schedule passed 16/16. **This was not a full server installation of a real operator revocation or a permanent engine guard.** +- The real `ThreadLaunchService` initial message uses `dispatchMode: defer_start`; new run is persisted in `preparing` with **NO initial `provider-turn.start` outbox effect**. The effect is created later through `prepared-run.release`. The prior illustrative assumption of an initial pending start effect was **fixture-only and incorrect for this path**. This distinction is material to D4: guard run creation, then separately define and test **whether release of an already-created but not-started run may occur after revocation**. +- Full `server.ts` root integration, operator `continuation:null` revision CAS, provenance/unforgeability of the private guard, typed denial, crash/pruning behavior and provider-start race remain unproven. Do not classify as `D4 VERIFIED`. +- **Recommended two-part contract for owner approval:** (1) no **new durable `run.created`** commit after revocation commits; (2) for already-created `preparing` runs, attempt to deny or cancel `prepared-run.release` and provider start if no execution has begun, and conservatively mark uncertain cases for reconciliation. Existing already-started runs require separate stop semantics. Part (2) must not be mislabelled as an atomic cross-process provider-call guarantee unless a stronger mechanism is explicitly designed/tested. +- A future guarded implementation must test revocation **between run creation and release**, plus release/replay/stop concurrency and idempotent receipts. Avoid either omitting late-start policy or silently broadening D4 to a stronger external-start linearization without user consent. + +**This note refines but does not adopt the product choices below.** No code work, merge or production authorization was given by the three-lane read-only return. + diff --git a/docs/orchestration-v2/deepseek-letta-combination-feasibility-20261103.md b/docs/orchestration-v2/deepseek-letta-combination-feasibility-20261103.md new file mode 100644 index 0000000000000..bec0e7303890e --- /dev/null +++ b/docs/orchestration-v2/deepseek-letta-combination-feasibility-20261103.md @@ -0,0 +1,64 @@ +# Feasibility: DeepSeek Superagent + Letta Code for T3 Fork + +Date: 2026-11-03 +Status: RESEARCH FEASIBILITY / PROPOSAL ONLY / NO INTEGRATION OR PRODUCT DECISION + +## Question and verdict + +Can the proactive event-driven work intake and authorization patterns from DeepSeek's dsh-superagent prototype be combined with Letta Code's persistent memory and stateful agent identity? **Yes architecturally**; there is also an existing Letta ACP adapter suitable for a **bounded compatibility probe**. A working integration with T3 has **not** been demonstrated. + +The preferred design is compositional, not two competing orchestration runtimes. + +## Boundary and architecture + +1. **T3 Project Runtime owns authoritative project truth:** project goals/specs, accepted decisions, tasks, handoffs, source/evidence refs, review decisions, execution attempts, provider provenance and authorization. +2. **DeepSeek-derived continuation policy (adapt patterns, not necessarily code):** subscribed source events/worker outcomes, deterministic admission, scoped immutable authorization/mandates, task ownership, duplicate suppression, retry limits, waiting-for-human classification, outbox/receipt patterns, deliberate silence and human-attention panel. Use existing T3 service/events; no second ticket/execution DB. +3. **Letta-derived experience memory:** opt-in per-agent or shared-project *advisory* context, compact recurring lessons, retrieved prior failures, skills and provenance-backed context files with Git history. Letta's memory changes cannot silently promote claims into accepted T3 project state. Only validated, explicitly admitted lessons can become governed instructions or accepted decisions. +4. **T3 provider-neutral worker boundary:** one frontier provider and one open-weight provider can be swapped; the same project-state records and work permissions still apply. A Letta stateful agent may be one optional T3-managed ACP worker, not a privileged new manager by default. +5. **Efficiency fast path:** deterministic event handling first, memory retrieval only when context needed, only bounded low-cost inference for ambiguous next actions, strong manager only for consequential judgment. Cap memory-reflection frequency and prompt size; measure net cost through verification. + +Conceptual flow: + +`GitHub/CI/worker result → T3 event and task reconciliation → deterministic authority gate → optional memory retrieval + low-cost recommendation → authorized T3 execution/review → verification/admitted lesson → T3 Runtime` + +## Existing integration seam worth testing + +Letta publishes [letta-acp](https://github.com/letta-ai/letta-acp), an ACP-over-stdio adapter. Current documentation describes: +- Local mode with state on the user's computer and an optional Ollama model provider. +- Reusing the same Letta agent across sessions via explicit agent identity. +- Implemented ACP session lifecycle, load/replay, model selection, permission callback and MCP tool injection. +- Limitations: no client-side terminal execution or ACP plan updates in the adapter documentation. +- Cloud mode stores agent memory outside T3; local mode is the privacy-preserving first probe. + +T3 already supports ACP providers generally, but no evidence currently confirms Letta ACP is usable in this fork with correct session/restart, permissions, auth, routing or worktree isolation. **Do not call integration IMPLEMENTED or RUNTIME PASS.** + +## Safety and portability hazards + +- Letta agent memory is agent-owned and may contain unreviewed inferences; it is not equivalent to canonical project task truth. Memory poisoning and stale advice are possible. +- Letta's agent-state storage is separate from T3's. Offline project export/restore must succeed without the Letta service or agent identity; memory may improve quality but cannot be essential to continuation. +- Letta's README says full AgentFile import/export has been removed; memory and conversation transcript exports remain. Do not promise arbitrary agent identity migration across runtimes. +- DeepSeek's research prototype explicitly warns it is not production-ready; its Executor sessions run commands as the operator OS user without approval. Do not copy that security boundary. +- Integration may increase latency/cost through memory inference, MCP overhead or duplicate state. Measure before making memory retrieval the default. +- Scoped authorization must never be inferred from external comments, memory records, a worker's report or model judgment. + +## Suggested low-cost pilot + +1. Browser-side source compatibility review only: compare Letta ACP's published methods to T3's ACP driver and capability registration and map observed gaps. +2. In an isolated local test home, run one synthetic T3 Runtime task with an explicitly configured local Letta ACP agent, no production credentials. Verify ordinary execution, permission denial, handoff recording and restart/reload retention. +3. Repeat with memory disabled vs a small provenance-labeled prior lesson; compare token usage, prompt size, completed-task quality and additional tool latency. A memory benefit needs observable outcomes, not merely recall. +4. Simulate unavailability of Letta and of the frontier provider separately. Verify T3 project state is still recoverable and an alternate worker can resume at an authorized boundary without Letta memory. + +Stop for authentication, third-party service cost, unexpected filesystem or outbound network access, worktree isolation mismatch, security conflict or source conflicts. + +## Primary references + +- https://github.com/deepseek-ai/dsh-superagent-prototype/blob/main/docs/001-domain.md +- https://github.com/deepseek-ai/dsh-superagent-prototype/blob/main/docs/002-authorization.md +- https://github.com/deepseek-ai/dsh-superagent-prototype/blob/main/docs/003-execution.md +- https://github.com/deepseek-ai/dsh-superagent-prototype/blob/main/docs/007-architecture.md +- https://github.com/letta-ai/letta-code +- https://www.letta.com/blog/context-repositories/ +- https://docs.letta.com/concepts/stateful-agents +- https://github.com/letta-ai/letta-acp + +Research only; no production changes, provider registration, new dependency or automatic event launches authorized. diff --git a/docs/orchestration-v2/handoff-deepseek-orchestrator-evidence-v0-p2-20261104.md b/docs/orchestration-v2/handoff-deepseek-orchestrator-evidence-v0-p2-20261104.md new file mode 100644 index 0000000000000..ad4f6fdb3a27c --- /dev/null +++ b/docs/orchestration-v2/handoff-deepseek-orchestrator-evidence-v0-p2-20261104.md @@ -0,0 +1,66 @@ +# PASTE INTO T3 CODE — DeepSeek Overall-Task Orchestrator: Evidence V0 P2 + +**Issued:** 4 November 2026. +**Type:** executable local orchestration handoff for the currently authorized P2 repair. +**Owner:** DeepSeek as **mandatory task orchestrator**; user remains final product and merge authority. +**State on issue:** prepared, not dispatched; no branch or production merge is approved. + +## START / ROLE + +You are the **DeepSeek orchestrator for the T3 Fork Evidence V0 pruning-completeness P2 repair**. Begin coordination and execute already-authorized work in the **local T3 Code host now**, using available tools and workers. This message is intended to start an actual T3 orchestration session, not to create another planning-only note. If the T3 host cannot launch workers or lacks repository/runtime access, report the precise blocker and preserve a handoff; do not pretend the task started. + +**Read before work, in order:** +1. Project Instructions and `01_CURRENT_STATE.md` on `planning/resource-efficient-continuation-20261103`. +2. `02_COORDINATION_HANDOFF_PROTOCOL.md` and `OVERALL_MANAGER_HANDOFF.md` on the same planning branch. +3. Governing P2 task: `docs/orchestration-v2/task-evidence-v0-pruning-completeness-p2-20261104.md`. +4. Draft PR #21, its manager decision comment, candidate source, current Runtime task state, worktrees and routing ledger. Treat older chat/status as context, not proof. + +**Main goal:** reproduce and repair the Evidence V0 bug where partial pruning of upstream V2 event history can silently yield a seemingly complete export. Implement only a bounded, read-only, appropriately scoped **pruned/incomplete** indicator based on the existing upstream pruning watermark. Prove in a real fixture that missing history is not fabricated or misrepresented. + +## REQUIRED ORCHESTRATION AND MODEL ESCALATION + +- **DeepSeek is the orchestrator for the full task lifecycle**, not only an initial reconnaissance worker. Remain responsible for worker dispatch, liveness, ledger, evidence inspection, repair cycles, independent review, manager-ready verdict and durable handoff. Do not silently replace the orchestrator with Codex/Claude. +- Prefer **DeepSeek/OpenCode** workers for reconnaissance, test design, narrow implementation, routine repairs and local check execution. The orchestrator may implement directly if doing so is least costly and preserves independent review. +- For a routine failure, attempt **two materially different, evidence-backed low-cost solutions** before escalating; record why each failed. The two attempts are not a license to bypass an immediate security, integration or product stop. Do not retry unchanged instructions merely to satisfy a count. +- When complexity justifies stronger reasoning, escalate an explicitly bounded **worker or reviewer subtask** to **Codex GPT-6.1 SOL** (typically high reasoning) or **Claude Sonnet 5.5** (normally medium). Choose based on capability fit, available capacity and actual failure evidence; record alternatives and reasons. If those are insufficient for genuinely difficult architecture, concurrency or security analysis, escalate to **Claude Opus 5.5**, low/medium effort initially, with reason recorded. +- Preserve reviewer independence: ideally different provider/model from the implementer; reviewers are read-only. A stronger model does not inherit integration, merge, budget or product authority. If exact provider/model is unavailable, do not invent it or silently substitute; record unavailable/UNKNOWN, choose the next authorized compatible route or stop only the blocked lane. +- Record actual orchestrator provider/model/version, selected and rejected provider/model, attempts, capacity evidence/UNKNOWN, route origin, outcome, reviewer and resource observations when available. Never invent quotas, tokens, cost or reset times. + +## BASE / SAFETY + +- Repository: `jermur788/t3code`. The **fork-only draft PR #21** branch is `integration/fork-upstream-reconciliation-trial-20261104`. The isolated **repair branch** has already been prepared: `fix/evidence-v0-pruning-completeness-p2-20261104`. It was created from the accepted PR candidate with **no repair source changes**. +- Fetch and **pin actual remote heads** before work; confirm current PR draft/open/unmerged, fork main unchanged, and no drift in the repair branch. Recheck upstream release-preparation parent and its difference from the v0.1.7 tag; do not assume exact tag. +- Inspect `git worktree list`, `git status`, task/worker ownership and disk space before any write. Use a **fresh uniquely owned external-volume worktree** on the prepared repair branch. Preserve every pre-existing worktree/dirty file; **never stash/reset/clean/rebase/force-push/rewrite shared history**. +- One writer on Evidence V0 service/contract/test files. Independent reviewer may read the same branch but must not write. +- **No merge, PR #21 head change, new PR, main update, public upstream action, production feature enablement, paid live app-provider call or destructive operation**. If an architectural/spec or security trade-off is unavoidable, stop that lane and return evidence/options for manager/user decision. + +## IMPLEMENTATION / ACCEPTANCE + +- Inspect `apps/server/src/projectRuntime/OrchestrationEvidenceService.ts`, `apps/server/src/projectRuntime/OrchestrationEvidenceService.test.ts`, `packages/contracts/src/orchestrationEvidence.ts`, upstream `apps/server/src/orchestration-v2/ProjectionMaintenance.ts` and `apps/server/src/persistence/OrchestrationEventStore.ts`. +- First add a **red regression**: create referenced V2 history in a disposable SQLite DB, advance the genuine pruning boundary using the supported maintenance path, prove at least one event was actually deleted while some events remain, then export/reconstruct Evidence V0. Capture before/after event counts, boundary, expected and observed completeness. +- Make a **small additive repair** using upstream's published `prunedThroughSequence` (or appropriate existing metadata interface). Emit a deterministic, machine-readable, scoped `incomplete/pruned` evidence marker; when scope is uncertain say UNKNOWN. A global pruning watermark alone is not proof a particular thread lost history. Avoid false positives for unaffected new threads and false claims of exact loss. +- Preserve explicit `orchestration-v2-unresolved` when referenced history is genuinely absent, and distinct existing per-thread read-bound truncation. Preserve deterministic identifiers, ordering, JSONL decode and original no-prune behavior. Do not fabricate events, create a second event store, migrations or change upstream execution/recovery internals. +- Test: unpruned full history; partially pruned referenced history; fully absent referenced thread/run; unrelated newly created thread/project after watermark; bound/truncation; restart/reopen; cross-project isolation; stable JSONL/schema. +- If conservative correct detection cannot be done without changing material contract semantics, stop and return **reproducing red test + scoped alternatives**, not an unreviewed workaround. + +## VERIFY AND INDEPENDENT REVIEW + +Run and record exact commands/exits for the targeted Evidence V0 and Projection Maintenance tests, changed contract tests, `vp run typecheck`, `vp run check:changed upstream/main`, `AgentContextBudget.test.ts`, and web build if applicable. Use the actual pinned baseline and log test counts, skipped cases, context-budget bytes and changed files. No hosted CI PASS claim unless an actual hosted run exists. Preserve the earlier independent V1/V2 screenshots and original prune fixture by copying **sanitized** evidence from the local host to the durable task record. + +After local green, dispatch a **read-only independent review** to a different provider/model: Codex GPT-6.1 SOL high or Claude Sonnet 5.5 medium; use Opus 5.5 only for a materially hard unresolved issue. Reviewer must assess pruning-boundary races, incomplete vs unresolved semantics, no false-new-thread markers, contract compatibility, no upstream-engine changes and test strength. Repair findings in the owned implementation lane; rerun and re-review. + +## LEDGER / DURABLE CONTINUATION + +**Start a task routing and execution ledger immediately**, either in the available T3 Project Runtime task/handoff interfaces (preferred) or an **append-only file on the dedicated repair branch** (fallback), e.g. `docs/orchestration-v2/evidence-v0-p2-repair-routing-ledger-20261104.md`. Initialize it before the first dispatch, maintain it **at each decision/attempt**, and publish it with the final branch/handoff. Do not reconstruct missing measurements afterward. + +Each entry records: UTC time; task/child; action and attempt; orchestrator/worker provider/model/reasoning; alternatives considered; rationale and prior failure; selected branch/worktree/owner; provider capacity and source (or UNKNOWN); commands/exits and actual result; verification/reviewer evidence; defect classification; next action. Label **OBSERVED FACT**, **ORCHESTRATOR CLAIM**, and **RETROSPECTIVE INFERENCE** distinctly. Include worker liveness/completion and whether a handoff was persisted. + +**Do not stop because a worker finishes.** Inspect, reconcile, repair/re-review routine findings, update task and ledger, then proceed automatically through safe authorized work. Do not mark stronger states than evidence proves. + +## FINAL REQUIRED RETURN TO OVERALL MANAGER + +Return **VERDICT; BASE/WORKTREE/OWNERS; RESULT/changed files; RED→GREEN fixture and actual pruning boundary; TESTS with exact exits/counts; independent REVIEW with provider/model and findings; ROUTING/ATTEMPTS/capacity ledger; FAILURES/RISKS; INTEGRATION STATE; NEXT authorized action and user decision needed**. Include durable GitHub links to updated task ledger and exact owned repair branch and verified evidence artifacts. Mark anything unrun `NOT RUN`. + +Success return: **`P2 REPAIR — LOCAL TEST PASS / INDEPENDENT REVIEW PASS / READY FOR MANAGER PROMOTION REVIEW; PR #21 NOT INTEGRATED`**. The Overall Manager, not this worker, decides whether/how to promote the candidate fix and later asks the user for separate merge approval. + +**Launch the authorized local task now, under DeepSeek orchestration, or state the exact operational blocker.** diff --git a/docs/orchestration-v2/handoff-deepseek-postmerge-evidence-closure-20261104.md b/docs/orchestration-v2/handoff-deepseek-postmerge-evidence-closure-20261104.md new file mode 100644 index 0000000000000..1d900279d1733 --- /dev/null +++ b/docs/orchestration-v2/handoff-deepseek-postmerge-evidence-closure-20261104.md @@ -0,0 +1,31 @@ +# PASTE INTO T3 CODE — DeepSeek-only post-merge evidence portability and two residual checks + +**Status:** PREPARED / NOT DISPATCHED. **Scope:** local, read-only qualification and a sanitized evidence package; no implementation, source edits, commit, push or merge authorized. Main is already merged. + +> **DeepSeek: orchestrate only.** Read Project Instructions → [Current State](../../01_CURRENT_STATE.md) → [Coordination Protocol](../../02_COORDINATION_HANDOFF_PROTOCOL.md) → [manager reconciliation](manager-postmerge-pr21-verification-reconciliation-20261104.md) → [accepted compact DeepSeek template](DEEPSEEK_ORCHESTRATOR_HANDOFF_TEMPLATE_V1.md). Inspect actual active Runtime task records and worktree/worker ownership. **Do not code, edit source, run development tests or consume implementation tokens.** +> +> **Goal:** (1) preserve the *actual* completed post-merge verification ledger and sanitized evidence/command manifest in a portable, auditable package; (2) optionally close the two still-unproven app-level checks, **without using paid providers or altering fork `main`**. + +## Base and safety + +- Repository `jermur788/t3code`. Verified integrated fork `main`: `fb67545d790c5c001e8f85827f219ab6493c435e`. PR #21 is **already merged**. Always fetch/verify the actual remote head before work; if it changed, classify drift and stop this lane. +- Local verification worktree reported at `/media/jer/Files/Worktrees/t3-postmerge-pr21-verification-20261104` on local `verify/postmerge-pr21-20261104`; its original ledger was reported at `docs/orchestration-v2/postmerge-pr21-verification-ledger-20261104.md`. Evidence directory reported at `/media/jer/Files/Worktrees/pr21-verify-evidence-20261104/`. These **are local paths and may not exist in other sessions**. Browser manager could not fetch the branch/ledger from GitHub. Inspect actual files and do not invent continuity or proof. +- Before any local action confirm `git status`, worktree ownership, no ongoing writer, and no unrelated changes. Preserve original evidence and all existing worktrees. No stash/reset/clean/rebase, no fork-main writes, no PR operations. **Do not commit or push any branch until separately authorized by the user**. A complete GitHub summary exists, but is not the original raw ledger. + +## Worker routing and bounded work + +1. DeepSeek routes all actual shell, file-packaging, browser and test execution to **Codex GPT-6.1 SOL Medium** or **Claude Sonnet 5.5 Medium**, based on actual per-subscription capacity. Use a different provider/model read-only reviewer. **Opus 5.5** only if justified by a material unresolved issue; preserve DeepSeek coordination allotment. +2. Worker A: inspect the *actual* ledger and approximately 8.2 MB local evidence tree from the previous run. Verify file paths, hash manifest, command outcomes, timestamps, baseline, and that screenshots/logs/JSONL support the user-submitted claims. Produce a **sanitized portable manifest** and a copy of the append-only ledger, stripping tokens, paths that expose secrets, credentials or personal data. Preserve originals unchanged and label any missing evidence `NOT FOUND`. Prefer a safe export location **outside** the source worktree; do not push/archive binaries to GitHub without separate permission. Return explicit file names and a proposed durable publication destination/size/sensitivity classification for user decision. If T3 Runtime task/receipt update is exposed and authorized, persist there. +3. Worker B (optional; no paid calls): inspect whether a **true local stub-provider** can create an application-level task handoff through supported APIs. If feasible, record handoff creation, project A/B isolation and read/list behavior **after application restart** in the existing isolated disposable state. If append requires a paid/live model and no stub exists, record **NOT RUN / OPERATIONAL BLOCKER**; do not bypass interfaces or claim service-level isolation proves app-level behavior. +4. Worker B (optional): verify **Workspace/Development mode persistence** across a real normal stop/start using a disposable local `.t3` and rendered UI; record before/after state and screenshots or exact URLs. Avoid unrelated UI changes. Crash/SIGKILL and Add-project UI coverage remain outside this bounded task unless already free to observe. +5. Reviewer: independently read-only review the manifest, source evidence and any new local results, identify overclaims, and classify whether the two gaps are actually closed or remain deferred. + +## Capacity/ledger requirements + +DeepSeek supervises every worker and per-subscription quota/availability at activation, dispatch, completion, auth/quota error and task transition. Record exact model/effort, options considered, capacity UNKNOWN if not exposed, provider-confirmed five-hour reset where known, checkpoint and safe reroute/continuation plan. Do not invent resets, schedule a nonexistent automatic restart or work around subscription quotas. Update Runtime or append-only **local** ledger with UTC, attempt, actor, ownership, commands/exits/evidence, reviewer, failure classification and next action as facts occur. Preserve independent read-only review and one writer per any overlapping evidence package. + +## Terminal handoff + +Return **VERDICT / ACTUAL BASE / LOCAL EVIDENCE INVENTORY / LEDGER VERIFIED OR NOT / SANITIZED MANIFEST LOCATION / B1-B2 APP-LEVEL TESTS WITH EXITS / INDEPENDENT REVIEW / CAPACITY ROUTING LEDGER / FAILURES / SAFE PUBLICATION PLAN / NEXT**. Never claim the local files were remotely published unless a legitimate read can retrieve them. + +**Do not start a new main merge, source implementation, Git push, public release or paid-provider call**. If tools are unavailable, report `NOT DISPATCHED` and exact blocker. If a durable evidence branch push is needed, **present a minimal non-destructive publish plan for separate user approval** first. diff --git a/docs/orchestration-v2/handoff-deepseek-postmerge-pr21-verification-20261104.md b/docs/orchestration-v2/handoff-deepseek-postmerge-pr21-verification-20261104.md new file mode 100644 index 0000000000000..7a8a561381ac5 --- /dev/null +++ b/docs/orchestration-v2/handoff-deepseek-postmerge-pr21-verification-20261104.md @@ -0,0 +1,34 @@ +# PASTE INTO T3 CODE — DeepSeek-only post-merge PR #21 qualification + +**Status:** Bounded post-merge verification handoff, prepared by browser Overall Manager, **NOT DISPATCHED**. +**Authority:** User approved and manager completed fork-main PR #21 merge on 2026-11-04. **No further merge, production release or experimental continuation enablement is authorized.** + +## Exact task + +You are **DeepSeek, the orchestration-only supervisor** of post-merge baseline verification. Do not write source, implement features, perform development tests, or run shell test commands yourself. Assign all code/test/UI work to **Codex GPT-6.1 SOL Medium** or **Claude Sonnet 5.5 Medium**, selecting by observed provider/subscription availability and task fit. Escalate to **Claude Opus 5.5** only for a truly hard unresolved architecture/security/integration issue. Ensure a different provider/model performs read-only independent assessment when appropriate. + +**Repo:** `jermur788/t3code`. Fork `main` at the browser-verified merge checkpoint `fb67545d790c5c001e8f85827f219ab6493c435e`, merging PR #21 head `0e0c7bc2cb1bb805f273123686303a68e1c2807c` and prior fork main `d3bedef12a31f368e5c5a6b279445bea39a6a13a`. **Confirm actual live remote heads again; don't trust stale data.** + +**Read first:** Project Instructions, `01_CURRENT_STATE.md`, `02_COORDINATION_HANDOFF_PROTOCOL.md`, `OVERALL_MANAGER_HANDOFF.md` on `planning/resource-efficient-continuation-20261103`, accepted [orchestrator template](DEEPSEEK_ORCHESTRATOR_HANDOFF_TEMPLATE_V1.md), [PR #21](https://github.com/jermur788/t3code/pull/21), its local verification ledgers and [P2 manager source review](manager-evidence-v0-p2-promotion-review-20261104.md). Inspect live Runtime tasks/handoffs, worktrees, branch status, writer ownership and disk capacity. + +## Worker task / acceptance + +1. **Source/base safety:** establish a fresh **read-only or uniquely owned external-volume verification worktree** at the exact merged `main`; do not change `main`, any existing user worktree, the P2 repair branch, the separate default-off continuation experiment, or upstream. Confirm merge ancestry, presence of Project Runtime/Evidence V0 pruning fix, and **absence of experimental continuation code** from PR #21. +2. **Static/targeted checks:** delegate typecheck, focused Evidence V0 + Projection Maintenance, Project Runtime/restart/isolation, agent-context-budget tests, `vp run check:changed upstream/main` using the correct pinned references, and applicable web build. Record exact executed commands, exits, test counts, changed-file baseline and failures. Avoid claiming a hosted CI pass; hosted checks were zero at merge. +3. **Rendered UI gate:** have a worker **actually launch** the local app with stub/no-cost providers and inspect browser rendering for **fork Project Home, its mode controls, upstream thread/environment route navigation and browser back**. Capture screenshots or a concise rendered inspection record. A successful web build alone is not sufficient. +4. **Durability/isolation gate:** worker uses file-backed SQLite, creates two separate projects with task/handoff/evidence state, restarts/reopens the application/database, and proves no cross-project leakage; record actual SQL/test artifacts and any limitations. No production claim. +5. **Evidence integrity gate:** verify an actual V2 maintenance prune in the **merged main code**, exported `orchestration-v2-pruned` marker and `incomplete/unknown` semantics, preserved unresolved/truncation markers, unaffected post-boundary threads, JSONL decoding, and old-decoder upgrade limitation. Confirm no fabricated missing events. +6. **Provider neutrality:** use stubs and multiple provider configurations where practical; no real paid provider usage without a separate user-approved cost decision. Do not silently expand into D2/D4 automatic continuation or production revocation work. +7. **Independent review:** send a read-only summary of inspected outcomes to a different provider/model than the execution worker. Classify any issues as implementation defect, verification failure, operational blocker, upstream compatibility, review required, or product decision. Ordinary fixes may be **proposed** or undertaken only on a **new isolated owned repair branch** after a bounded task/spec check; no unapproved merges or main writes. + +## Subscription watch and durable ledger + +At activation, each worker dispatch, completion, provider error and task transition, DeepSeek records **per-subscription** availability (AVAILABLE / BUSY / COOLDOWN / UNAVAILABLE / UNKNOWN), actual allowance/capacity and provider-confirmed five-hour reset if exposed, as well as model, reasoning effort, reason for route/alternatives, owner/worktree, attempt, command outcomes, review, failures and next action. User reported DeepSeek/OpenCode at ~10% remaining 30-day allowance with ~10 days left as of 2026-11-04; this is a **dated report, not live quota measurement**. **DeepSeek does not implement or execute tests**. If a worker hits limits, checkpoint, reroute safely to an authorized available provider/subscription, or resume after confirmed reset **only if the live T3 host supports it**; otherwise produce a restart-ready handoff. No quota bypass, invented resets or unverified automatic scheduling. + +Write each transition to **T3 Runtime task/attempt/handoff** if available; otherwise use append-only `docs/orchestration-v2/postmerge-pr21-verification-ledger-20261104.md` in a fresh dedicated verification branch/worktree (not fork `main` or the shared planning branch). Label OBSERVED FACT / WORKER CLAIM / RETROSPECTIVE INFERENCE and preserve sanitized screenshots/test outputs and exact pinned refs. Do not re-label worker reports as manager-independent execution. + +## Completion + +Return a durable, manager-readable **VERDICT / BASE / OWNERS / IMPLEMENTATION DELTA (none expected) / RENDERED UI / RESTART & ISOLATION / REAL PRUNING EVIDENCE / STATIC TESTS WITH EXITS / PROVIDER CONFIGS / REVIEW / ROUTING + QUOTA LEDGER / LIMITATIONS / NEXT**. + +Allowed positive outcome: `INTEGRATED ON FORK MAIN / POST-MERGE LOCAL RUNTIME PASS / REVIEW PASS`, with separate limitations. **Never call it PRODUCTION VERIFIED** without production-level evidence and separate authority. If local execution tools are missing, return `NOT DISPATCHED` and precise blocker. **Start actual worker dispatch now only after confirming tools and ownership; writing this handoff is not dispatch.** diff --git a/docs/orchestration-v2/handoff-overnight-autonomous-orchestrator-20261106.md b/docs/orchestration-v2/handoff-overnight-autonomous-orchestrator-20261106.md new file mode 100644 index 0000000000000..23bcb184ef494 --- /dev/null +++ b/docs/orchestration-v2/handoff-overnight-autonomous-orchestrator-20261106.md @@ -0,0 +1,52 @@ +# PASTE INTO T3 CODE — Overnight conditional DeepSeek orchestration (U → R → H) + +**LATEST OWNER CLARIFICATION (2026-11-06 10:24):** User confirms prior Stage R Claude Opus fallback was approved. Earlier statements describing that specific use as unauthorized are superseded. Different-provider independent review and dispatch-budget audit are still required before G-R final pass; this does not authorize unrestricted future Opus use. See [decision record](stage-r-opus-owner-approval-clarification-20261106.md). + + +**State:** **AUTHORIZED CONDITIONAL LOCAL EXECUTION / HANDOFF PREPARED / NOT DISPATCHED**. +**New user authority:** 2026-11-06 00:14 Europe/Dublin: permit maximum safe continuation while asleep **if the manager-set measurable gates pass**, without asking ChatGPT between accepted steps. +**Binding amendment:** [Overnight conditional-autonomy amendment](overnight-conditional-autonomy-amendment-20261106.md). This is a narrow superseding authority relative to the earlier [upstream-only trial](upstream-catchup-isolated-trial-governing-spec-20261105.md); it permits downstream **local-only conditional** R and H stages, **not main merge, push, release or production**. + +## Exact instruction for DeepSeek/OpenCode to execute upon receiving this packet + +> **You are DeepSeek V4.1 Flash, the ORCHESTRATOR ONLY.** Read the T3 Fork Project Instructions, [Current State](../../01_CURRENT_STATE.md), [Coordination/Handoff Protocol](../../02_COORDINATION_HANDOFF_PROTOCOL.md), [full overnight amendment](overnight-conditional-autonomy-amendment-20261106.md), [accepted D4 A+B contract](d4-accepted-revocation-contract-20261105.md), [D2 shipping exclusion accepted spec](continuation-staged-safety-governing-spec-20261104.md), and [current upstream trial packet](task-upstream-catchup-isolated-trial-20261105.md), then actual Runtime task/attempt/handoff state and repository/worktree evidence. +> +> **Do not implement code, invoke shell/test tools, perform code review or edit source yourself.** Your function is to select authorized technical workers, maintain one-writer ownership and quota ledger, inspect their exact tests/reviews, dispatch bounded repairs and promote only completed gates. Use Codex GPT-6.1 SOL Medium or Claude Sonnet 5.5 Medium for engineering/tests; independent read-only reviewer from the **different provider/model**. No Opus/paid API spending. If independent reviewer unavailable, fail the gate rather than assert PASS. +> +> **Goal:** complete as much safe work as possible in the current actual T3 Code host session without ChatGPT/manager intervention: (U) reviewed upstream catch-up trial, then if G-U passes (R) fresh isolated continuation + D4 re-land, then if G-R passes (H) isolated D2 tool-schema exclusion and K3 recovery/portability hardening. **Do NOT proceed to fork-main merge, public push/PR, deploy or paid provider turns**. Stop after H or at the first unresolvable gate. +> +> **Ref preflight (dated, re-fetch and freeze once):** fork `jermur788/t3code` `main` was `fb67545d790c5c001e8f85827f219ab6493c435e`; upstream `pingdotgg/t3code` `main` was `79ee39fdcbb8638e625a05cd26f4f92e5d6a9319`; original continuation experiment `experiment/continuation-default-off-gate-20261104` `b3b8da54e0b8b184a1cf4e667d53e73e04f85074`; private local D4 source at last worker report `f68db477a053bfe0211c6d92bf116711c1d55371`. Source code in private D4 branch is reference-only, **never merge/rebase it wholesale**. Live upstream may have advanced again; choose and record exact current tip ONCE at U start and do not chase moving upstream after freeze. Preserve primary/stale-main checkout, four detached Stage 2 worktrees, local D4 worktree, Files read-only mount and private PR #21 evidence. +> +> **STAGE U — already approved upstream trial.** First inspect remotes/dirty branches/worktrees/ownership/disk. Create new uniquely named owned local trial branch/worktree from exact fork main. Merge/apply the frozen upstream tip on the **trial branch only**, resolve routine conflicts, preserve Project Runtime, Evidence V0, modes, upstream provider interfaces. Run actual required format/lint/typecheck/focused and relevant package/server tests, project isolation, DB restart/persistence, receipts, provider-neutral stubs and rendered UI if touched. Obtain independent different-provider read-only review. **G-U PASS requires zero unresolved conflicts, zero new unaccepted test failures, all mandated tests and rendered UI PASS where applicable, no experimental continuation/schema imported, no unresolved material review findings, complete local upstream inventory and retained evidence.** If any requirement fails, perform at most two bounded repair/retest/re-review cycles. If still failing or major architecture conflict, STOP and hand off. No fork-main merge. +> +> **STAGE R — automatically authorized ONLY on recorded G-U PASS.** Create a **second new owned local worktree/branch** from the exact accepted U candidate tip. Freshly adapt only the minimum default-off continuation and accepted D4 A+B implementation to that new base; use old experiment/local D4 as read-only reference, **not a diverged merge or wholesale cherry-pick**. Preserve no-new-run transaction guard and prepared-run release/retry protection. Run real-root K1 (true `continuation:null`, 0 new run/accepted receipt/start effect when revoke-first) and K2 (natural async release after revoke, 0 adapter starts, cancelled/reconcile state, replay), cross-project, default-off, ordinary-user/provider-neutral regression tests and typecheck; document D2 experimental MCP schema exposure if present, not a shipping PASS. Independent different-provider read-only review. **G-R PASS requires actual full-root K1/K2 tests PASS, default-off works, no auth regression, zero unaccepted test failures, no new authority DB/major engine rewrite and no open material reviewer findings.** Max two repair/retest/re-review cycles. If fail, STOP. Do not merge/push. +> +> **STAGE H — automatically authorized ONLY on recorded G-R PASS.** Create a **third new owned local branch/worktree** from reviewed R. Prototype minimal D2-safe agent task MCP input/output projections while retaining internal operator continuation authorization, measure built `tools/list` and context bytes against matching U baseline. No agent-advertised continuation input/output and **0 continuation-attributable byte overhead** for G-H D2 source/built candidate; packaged/authenticated paired-client test required before any `D2 SHIPPING VERIFIED` claim. Add bounded K3 restart/crash/pruning and two-provider stub coverage in **disposable temp test processes/DBs only**; do not kill a live T3 process or touch user data. Typecheck and relevant tests; independent reviewer. If packaged test or K3 is blocked, mark **PARTIAL / OPERATIONAL BLOCKER** transparently. **STOP after H in all outcomes**; no fourth stage. +> +> **Numeric caps:** total **at most 18 technical implementation/test/reviewer dispatches** across U/R/H, at most **two repair/re-review cycles per stage**. Never weaken tests, auto-spend money, bypass quotas, or rely on unconfirmed subscription resets. If provider worker/reviewer unavailable, checkpoint and STOP at current gate. DeepSeek's limited quota should be conserved. Track actual requested vs effective model effort, subscription AVAILABLE/BUSY/COOLDOWN/UNKNOWN and precise errors. +> +> **MANDATORY ROUTING LEDGER — before EVERY assignment and after its outcome:** Record the DeepSeek orchestrator's own choice for each dispatch, retry, rejected/deferred assignment, provider switch and independent review. Each entry includes UTC, U/R/H stage, task/attempt, local worktree/base, chosen provider/model/subscription alias, requested and ACTUAL effort, why that provider and not alternatives, quota/reset/cooldown or UNKNOWN, independence from code author, dispatch/error/result, evidence/test/review refs, stage-gate verdict, remaining dispatch/repair budget and next action. Persist in authoritative Runtime routing/task/attempt/handoff when supported, **else a RESTRICTED LOCAL APPEND-ONLY LEDGER** outside source worktrees. **Do not dispatch again if the ledger cannot be written**; classify OPERATIONAL BLOCKER and return a durable restart handoff. Chat history alone is not an acceptable record. Never publish subscription/private logs or credentials to GitHub. See amendment §6.1. +> +> **Evidence + authority:** Stage tasks/attempts/handoffs in T3 Project Runtime if accessible; otherwise **restricted local append-only ledger outside source**. Gate summaries must be validated from exact command exit statuses, worktree refs, diff and independently recorded review, not just worker `DONE`. Never copy private logs to the public GitHub planning branch. No auto source push, PR, fork-main merge, continuation production enabling, major authority/schema/engine architecture decision, new authority epoch table/migration, deletion/unmount, paid external model turn, credential bypass or PR #21 evidence transfer. +> +> **Return on final STOP:** `OVERNIGHT VERDICT / EXACT FROZEN SOURCE AND U R H CANDIDATE REFS / WORKTREES OWNED / G-U G-R G-H CHECKLIST (PASS/FAIL/PARTIAL) / TEST EXITS + ENVIRONMENT / MODEL + QUOTA LOG / INDEPENDENT REVIEWS + REPAIRS / D4 A+B / D2 SCHEMA BYTE DIFF / K3 RECOVERY / OPEN BLOCKERS / STATUS NOT INTEGRATED / NEXT USER PRODUCT DECISION`. A local `IMPLEMENTED / STATIC PASS / RUNTIME PASS / REVIEW PASS` is **not** `INTEGRATED` and not production verification. +> +> **Host limit:** This handoff does not create an unattended scheduler or guarantee the T3 process remains alive. Continue only through genuinely supported local T3 Code dispatch/continuation while active. If session exits, save a precise restart-ready handoff; do not claim future autonomous resume. + +## 2026-11-06 00:27 upstream U return — read this before executing the old start-U block + +**U was already run and returned. DO NOT restart it.** [Manager reconciliation](manager-upstream-trial-return-reconciliation-20261106.md) accepted the U isolated trial's technical evidence (complete 367 affected test files in 29 batches; monolithic wrapper 900s TIMEOUT, NOT green; bounded runtime/web smoke, independent review PASS). Frozen source was the previous selected upstream tip; browser observes 22 later upstream commits, which must NOT be automatically chased under the source-freeze rule. + +**`G-U FINAL PROMOTION HOLD`:** the user explicitly requires a durable **per-routing-decision** log. The U handoff reports a private ledger path and 3 writer + 2 reviewer dispatches, but does NOT prove each decision was logged; the browser manager cannot read the local file. **Before any new R technical worker dispatch, first execute [this coordinator-only routing audit and gate handoff](handoff-upstream-to-r-routing-gate-20261106.md).** Inspect local Runtime/ledger, reconcile missing historical decisions truthfully, verify durable write, then append `G-U FINAL PASS` only if supported. If ledger unavailable, STOP. This later instruction **supersedes** the old paragraph that assumes U has not yet started. H remains gated on real R result. No source push/merge/release. + +## 2026-11-06 10:11 Stage R return — superseding next action + +**U ledger audit has now RETURNED:** G-U FINAL PASS worker-reported with all five trial assignments accounted for and retrospective fields clearly labeled. **Stage R has also already been IMPLEMENTED and tested** locally: K1/K2 8/8 full-root, focused 206/210, changed-file 294, 36 package typechecks all worker-reported PASS; no main merge/push. **DO NOT redispatch U or Stage R implementation.** + +**G-R FINAL PASS is NOT accepted yet under the binding overnight authorization.** R implementation switched from failed Codex sharing-limit dispatch to **Opus 5.5 Medium without the overnight-required separate owner approval**, and R's final reviewer was **another Claude subscription**, not a different provider. Independent review must be from **Codex GPT-6.1 SOL Medium** or another expressly permitted genuinely different provider, READ ONLY, on the immutable R final source. The overnight amendment says same-provider review must stop gate promotion. Two R repair cycles are spent; if real material defect remains, STOP, don't silently start third repair. Report/ledger must separately account for **13 distinct technical assignments plus 7 reported same-lane continuation turns** against 18 real-dispatch cap. + +**NEXT:** use the narrower [R cross-provider review and routing audit handoff](handoff-stage-r-cross-provider-review-gate-20261106.md) as the **immediate instruction**. Its first step is checking the current remote planning docs, the actual local R candidate/ledger and provider availability. **Do not start H** until qualifying R review + budget/authority ledger permit a durable G-R FINAL PASS. H is still conditionally preapproved **local only**, but may stop for quota/resources. No public push, main merge, release, live paid provider or Opus calls. + +## Manager note + +The extra R/H stages are **not** implied by the earlier upstream-only authority; they rely on the **new explicit overnight instruction** and the detailed gating amendment. Each stage stays local-only. This packet itself does **not** start a T3 Code worker. diff --git a/docs/orchestration-v2/handoff-stage-r-cross-provider-review-gate-20261106.md b/docs/orchestration-v2/handoff-stage-r-cross-provider-review-gate-20261106.md new file mode 100644 index 0000000000000..fcb7e5fd3755e --- /dev/null +++ b/docs/orchestration-v2/handoff-stage-r-cross-provider-review-gate-20261106.md @@ -0,0 +1,33 @@ +# DeepSeek handoff — Stage R cross-provider independent-review and routing-authority gate + +**LATEST OWNER CORRECTION, 2026-11-06 10:24:** The user confirmed they had approved Stage R Opus. Disregard prior unauthorized-Opus findings below; record the prior fallback as **OWNER-APPROVED**. Still require cross-provider independent review and accurate dispatch counting before G-R final pass. This does not authorize new unrestricted Opus use. See [owner clarification](stage-r-opus-owner-approval-clarification-20261106.md). + +**State:** **`PREPARED / NOT DISPATCHED`**. R local IMPLEMENTED/STATIC/FOCUSED RUNTIME PASS reported; `G-R FINAL PASS` **NOT ACCEPTED**, H **NOT STARTED**. +**Purpose:** close the current overnight review-authority discrepancy and reconcile actual dispatch budget WITHOUT redoing implementation or restarting U. +**Governing:** [Overnight conditional U→R→H amendment](overnight-conditional-autonomy-amendment-20261106.md) (particularly §4, §6 and §6.1), [accepted D4 A+B](d4-accepted-revocation-contract-20261105.md), [Current State](../../01_CURRENT_STATE.md), [Stage R manager reconciliation](manager-stage-r-return-reconciliation-20261106.md), [Coordination/Handoff Protocol](../../02_COORDINATION_HANDOFF_PROTOCOL.md). + +## PASTE INTO THE ACTIVE T3 CODE / DeepSeek V4.1 Flash ORCHESTRATOR SESSION + +> **You are DeepSeek V4.1 Flash, orchestration ONLY**. No source edits, code reviews, shell test execution or code fixes by DeepSeek. Read Project Instructions → Current State → Coordination/Handoff Protocol → [full overnight amendment](overnight-conditional-autonomy-amendment-20261106.md) → [manager Stage R return](manager-stage-r-return-reconciliation-20261106.md) → this handoff → actual T3 Runtime tasks/handoffs/routing ledger and local worktree source. +> +> **CRITICAL source-availability correction:** Your previous handoff claimed the 2026-11-06 manager docs and overnight amendment were missing from the planning branch. The browser manager independently fetched them via GitHub from `jermur788/t3code`, branch `planning/resource-efficient-continuation-20261103` on 2026-11-06. **They EXIST remotely.** Use GitHub read-only fetch/API or an authorized refresh of your own references; do **not** assume an old local clone or unfetched ref is canonical, do not move existing user checkouts. You must read the latest exact amendment. It says **NO Opus without separate user approval**, independent reviewer **different provider/model**, and same-provider reviewer availability means stop advancement. +> +> **Already accepted U:** local U catch-up candidate `trial/upstream-catchup-20261105` `c037460c2f4a98e8c8f849928c92af6cb80e3d80`, frozen upstream selected tip `25b53299b75d4d8d1d0667ad47e9cfed3749776e`; G-U ledger audited and G-U FINAL PASS **worker-reported**. Do NOT rerun upstream merge/batched tests, auto-chase current upstream or publish local source. Earlier user-approved conditional local-only R/H still applies **only after exact accepted gates**. +> +> **R candidate to inspect, READ-ONLY:** local worktree `/home/jer/dev/stage-r-continuation-d4-20261106`, branch `stage-r/continuation-d4-20261106`, final `90f2f2d254b901a7b424474c615ac6dc69f945ec`, clean per last report, four commits / 33 files / +8,613/-95 based on U. Preserve all existing worktrees, no checkout/reset/stash/rebase/branch rewrite/cleanup. R has tested real-root D4 K1/K2 8/8, focused tests 206/206 writer + 210/210 reviewer, changed-file 294 and 36-workspace typecheck PASS (worker-reported). Two repair/re-review cycles were consumed. Do not call R `G-R FINAL PASS` on that alone. +> +> **REVIEW/ROUTING DISCREPANCIES TO RESOLVE BEFORE H:** R writer switched to **Claude Opus 5.5 Medium** after Codex subscription sharing failure. The prior overnight amendment **did not authorize Opus**, despite the worker handoff calling it authorized. Record its actual rationale/decision evidence as an **authority deviation**; no retroactive invention, no more Opus. R's subsequent review used a different **Claude subscription/context**, NOT a different vendor/provider; under the overnight rule this is **not qualifying independent review**. Require one **cross-provider different-model READ-ONLY** review of the exact R final diff and raw tests by **Codex GPT-6.1 SOL Medium** on an actually available authorized subscription. If Codex login/quota/sharing unavailable or paid calls required, STOP `REVIEW REQUIRED / OPERATIONAL BLOCKER`; never substitute another Claude account. +> +> **Before dispatch, audit the restricted routing ledger:** account for **13 reported DISTINCT technical/reviewer assignments** (U 5 + one failed Codex sharing-limit dispatch + R 7) and **7 additional same-lane continuation turns**. The user's overnight cap is **18 technical worker/reviewer DISPATCHES**. Continuations are not automatically new dispatches, but inspect actual task/session lifecycle and routing records to classify whether each was a same-task resume or a fresh dispatch; log real provider/model/effort, cost/quota or UNKNOWN, UTC and decisions. If actual cap reached, STOP; do not choose the convenient count. Ensure this new review fits remaining cap and a future H implementation AND independent review can fit later. Mandatory durable entry **before assignment and after result**, Runtime first or restricted append-only private ledger, with verified write. No durable ledger = STOP. +> +> **Independent review scope:** inspect **the exact immutable R final head**, actual code and tests, fresh re-land fidelity against accepted D1/D3/D4, internal context/provenance unforgeability, transaction-time no-new-run guard, natural async prepared release, idempotent replay, `reconcile_required` preservation, previous **B1 worktree leak / M1 mutable review target bypass / M2 agent-visible policy** findings, remaining two fail-closed mutation tests, completed-attempt storage-forgery residual, default-off behavior, normal user/project isolation, D2 MCP schema exposure and upstream compatibility. Confirm actual source/ref and test evidence, not just earlier Claude PASS. **READ ONLY: no edits, commits, push, PR or merge**. Return `PASS`, `PASS WITH FINDINGS`, or `FAIL` with precise materiality and evidence. No third repair cycle is authorized within this overnight amendment; if material bug appears, STOP and request bounded new scope rather than secretly implementing. +> +> **G-R promotion rule:** Only after a true different-provider Codex read-only REVIEW PASS with **no unresolved material finding**, correct prior Opus-routing provenance recorded, dispatch/continuation budget and durable routing ledger verified, and actual R technical results matching accepted spec, may you append `G-R FINAL PASS` with evidence to canonical Runtime/ledger. The overall status remains LOCAL ISOLATED, NOT INTEGRATED/PRODUCTION. If reviewer fails, cannot be sourced, or count exceeds cap, STOP. Do not weaken independence rule or label same-vendor different-account as cross-provider. +> +> **Conditional Stage H (only if G-R final PASS, preauthorized by user):** Using remaining truly available dispatch/review budget, create a **third NEW isolated local writer-owned branch/worktree** from R's accepted immutable tip. Implement the narrowly scoped D2 experimental agent-facing task MCP input/output schema projection exclusion while preserving operator-only internal authorization and default-off; require built `tools/list` measurement against the matching U shipping baseline with 0 continuation-attributable input/output byte overhead. Do disposable K3 process restart/crash/pruning, replay and provider-neutral two-stub tests. No real T3 user database, host process kill, external paid provider, major upstream engine rewrite or authority schema change. Different-provider independent review; mark `PARTIAL` for unavailable packaged/paired-client authentication or crash tests, **do not call shipping verified**. Respect total 18 dispatch ceiling and max two bounded repair/re-review cycles **for H**, append every routing decision. **STOP after H in all outcomes** and return one authoritative handoff. If insufficient compliant capacity/budget, STOP before H and return detailed residual plan. +> +> **Hard stops unchanged:** NO local/fork `main` merge, Git push/public PR/upstream publication, auto upstream refresh, default-on/production activation, material paid API calls, more Opus, new epoch/authority table, unsafe security bypass, destructive Git, cleanup/remount, modifying existing user branches/worktrees, publishing PR #21 private evidence. The user owns integration/release choices. Source from private worktrees must not be copied into public GitHub planning docs/logs. +> +> **Return:** `R ROUTING AUDIT / OPUS AUTHORITY DEVIATION / DISPATCH vs RESUME ACCOUNTING / DIFFERENT-PROVIDER REVIEW RESULT & FINDINGS / VERDICT G-R FINAL PASS OR HOLD / IF H STARTED: BRANCH, TESTS, D2 UTF-8 BYTES, K3, INDEPENDENT REVIEW / ACTUAL QUOTAS & COST / INTEGRATION STATE NOT INTEGRATED / NEXT STOP OR OWNER DECISION`. If you cannot dispatch a compliant different-provider reviewer, return immediately, do not attempt H. + +**Browser status:** The browser manager confirmed the governing planning documents and fork main. The R source/review are LOCAL UNPUSHED and could not be directly inspected. **This complete handoff is authored/published but not locally dispatched**. diff --git a/docs/orchestration-v2/handoff-stage2-browser-first-three-lanes-20261105.md b/docs/orchestration-v2/handoff-stage2-browser-first-three-lanes-20261105.md new file mode 100644 index 0000000000000..b4aa76dfc1ea8 --- /dev/null +++ b/docs/orchestration-v2/handoff-stage2-browser-first-three-lanes-20261105.md @@ -0,0 +1,57 @@ +# PASTE INTO T3 CODE — Stage 2 three-lane read-only qualification + +**Current status:** **COMPLETED / RETURNED 2026-11-05 13:50Z**, with three worker-reported scope-limited results and independent PASS WITH FINDINGS reviews. **THIS STARTER IS HISTORICAL — DO NOT REDISPATCH.** [Full manager reconciliation](manager-stage2-three-lane-return-reconciliation-20261105.md). Its original text below remains as the task authorization record, not a pending action. No source implementation, main merge, production release, Git push or paid infrastructure was authorized. + +## Exact T3 Code DeepSeek orchestration instruction + +> **DeepSeek V4.1 Flash / OpenCode: ACT AS ORCHESTRATOR ONLY.** Do not implement source, edit files, execute tests, perform Git commands, generate artifacts or review code yourself. Read the T3 Fork Project Instructions, the current [Current State](../../01_CURRENT_STATE.md), [Coordination/Handoff Protocol](../../02_COORDINATION_HANDOFF_PROTOCOL.md), [Manager Stage 2 browser assessment](manager-stage2-browser-first-assessment-20261105.md), [D4 proposed contract](d4-transactional-revocation-proposed-contract-20261105.md), [D2 audit plan](d2-shipping-exclusion-audit-plan-20261105.md), and this handoff. Read active Runtime tasks/handoffs before dispatch to avoid duplicate work. If exact canonical GitHub planning docs are missing locally, fetch the planning branch and check the exact remote ref; do not invent replacement instructions. + +**Objective:** use worker-host capabilities ONLY for what the browser manager could not verify: D4 DB/event-commit atomicity, actual D2 built MCP tool-list measurement, and read-only upstream/experiment merge preview. The Overall Manager has ALREADY inspected public GitHub main/upstream, documented proposed D4/D2 design and updated canonical state. Avoid repeating that context work. + +**Known refs, refresh from live remote first:** +- Fork `jermur788/t3code` `main`: `fb67545d790c5c001e8f85827f219ab6493c435e`. +- Isolated experimental continuation: `experiment/continuation-default-off-gate-20261104` at `b3b8da54e0b8b184a1cf4e667d53e73e04f85074`. +- Upstream `pingdotgg/t3code` `main`: `337c5858c33bc7f8f6dfd391a2c279fa0f7e4d17`. +- Incorporated upstream release-preparation parent: `bb4afa5425c52104a9261fa2d022cb8ba2fcc099`. +- GitHub reports experiment **34 ahead / 336 behind** fork main; upstream **50 commits ahead** of incorporated parent. These are dated checkpoints, not guaranteed live metrics. + +**Safety preflight:** require exact repo path, remotes, worktree/branch status, owned lanes and independent mount/free-space checks. The user has private PR #21 evidence and a read-only Files mount; **do not touch, remount, unmount, delete, clean, stash, reset or upload** it. User's local `main` was stale and must not be moved for these tasks. Preserve unrelated uncommitted work and one writer per code/evidence lane. Prefer two or three distinct read-only worktrees with isolated disposable build caches/output outside all user worktrees, when host disk capacity permits. + +### Lane A — D4 transaction and run creation safety (priority 1) + +**Spec:** [full local D4 atomicity handoff](task-stage2-d4-atomicity-feasibility-20261105.md). Dispatch Codex GPT-6.1 SOL Medium or Claude Sonnet 5.5 Medium for actual source/database/command-path testing. Prove whether Project Runtime revocation writes and `EventSink.commitCommand` share the same SQLite file/transaction ordering across two connections and processes. Enumerate `run.created` paths, receipt idempotency and replay/restart behavior, and demonstrate the race between experimental preflight and engine commit. Produce exact guard placement and red-before tests. **Read-only investigation; no engine-hook implementation**. Independent different-provider/model read-only review. + +**Result required:** DB identity and write serialization proof, all relevant run paths, ambiguity/replay behavior, suggested generic guard and tests, risks, reviewer verdict, precise architecture decision needed. + +### Lane B — D2 genuine built agent-tool schema audit (priority 2) + +**Spec:** [full built MCP schema handoff](task-stage2-d2-built-mcp-shipping-audit-20261105.md). Dispatch separate worker to compare actual built `tools/list` schema and UTF-8 byte counts on fork main versus isolated experiment using genuine permitted stub/testkit MCP auth. Inspect shared task contracts and MCP tool properties. Historic +646 bytes is contextual only; measure afresh. No model calls with material cost. Propose a release CI gate and shipping-safe schema strategy; **no source modifications**. Independent different-provider/model read-only review. + +**Result required:** exact built artifacts/config, tool-list JSON/schema/property diff, bytes and budget, missing auth/test limitations, no secret capture, review verdict. + +### Lane C — upstream/reconciliation source preview (priority 3) + +**Spec:** [full read-only preview handoff](task-stage2-upstream-experiment-reconciliation-preview-20261105.md). Using complete paginated upstream inventory and local read-only merge-tree, map conflicts and tests for future adaptation of experimental continuation to current fork main. Inspect new upstream changes since incorporated parent, provenance of merged versus merely open PRs, rebase hotspots, provider adapter/Orchestrator/MCP/SQLite changes. **No merge, cherry-pick, rebase, source edits, direct upstream PR or Git ref updates**. Independent different-provider/model read-only review. + +**Result required:** current refs, complete upstream delta, experiment branch delta, dry-run conflicts, test/rebase hotspots and recommended future sequence. + +### Routing/capacity and evidence + +- DeepSeek is coordination-only. Actual engineering/test workers: **Codex GPT-6.1 SOL Medium** or **Claude Sonnet 5.5 Medium**, based on actual per-subscription availability and task fit. Independent read-only review from the **other model/provider**. Claude Opus 5.5 only for truly difficult unresolved security/concurrency architecture, with recorded justification and no unapproved paid use. +- Separate safe read-only lanes may run concurrently only if T3 supports isolated worktrees, memory/resource budgets and reviewer independence. Otherwise run A then B then C. Each task records exact owned worktree, source/base, SHA in internal ledger (not user-facing reply), command exits, provider/model/effort, alternative reasons, quota/cooldown state and provider-confirmed five-hour reset or UNKNOWN, errors, reviewer, next action. +- Use authoritative T3 Runtime task/attempt/handoff records if accessible. Otherwise a **new restricted local append-only Stage 2 ledger** owned by the worker orchestrator, kept outside source worktrees. Do not commit or upload raw logs/screenshots or private PR #21 evidence. No invented cost, provider availability or schedule. + +### Stop/return + +Return one consolidated durable handoff: +**VERDICT / LIVE BASES / ACTIVE OWNERS / LANE A ATOMICITY + RUN PATHS / LANE B BUILT TOOL SCHEMA / LANE C RECONCILIATION PREVIEW / COMMAND EXITS + EVIDENCE / INDEPENDENT REVIEWS / SUBSCRIPTION ROUTING LEDGER / BLOCKERS CLASSIFIED / SAFE NEXT TASK / PRODUCT DECISIONS REQUIRED**. + +All three lanes are *research and qualification*. Do not call them `D4 IMPLEMENTED`, `D2 SHIPPING VERIFIED`, `INTEGRATED` or `PRODUCTION VERIFIED`. D4 `run.created` versus provider-start linearization and in-flight contract remain **product decisions**, and any engine/source implementation requires explicit accepted spec/owned lane. Nothing here authorizes a fork-main merge, external evidence transfer, public release, provider production spend or history rewrite. + +**If no T3 Code worker is accessible:** return `NOT DISPATCHED` with a precise tool/capacity blocker; do not claim a GitHub handoff itself launched a worker. + +## Consolidated return — completed + +The 2026-11-05 local handoff reports **A scoped D4 same-database transaction feasibility pass** (guard test fixture, not full-server D4 implementation), **B source-loaded MCP transport with mocked services schema audit PASS** (79 tools, +646 experimental agent-context bytes, not packaged release verification), and **C 50-commit upstream/experiment dry-run preview** (1/2/9 simulated conflicts, no actual integration). All three returned independent **PASS WITH FINDINGS** after corrections. Real `ThreadLaunchService` uses `defer_start`: the `preparing` run has **no start effect until later `prepared-run.release`**, which makes pre-start revocation policy a separate D4 owner decision. DeepSeek orchestrated only, 10 worker dispatches, quotas UNKNOWN and some actual Sonnet effort LOW. No code edits, commits, pushes, merges, release, paid provider call or evidence upload reported. + +**Status `COMPLETED` — never redispatch these lanes.** Read [manager reconciliation](manager-stage2-three-lane-return-reconciliation-20261105.md), [Current State](../../01_CURRENT_STATE.md), corrected [D4 proposal](d4-transactional-revocation-proposed-contract-20261105.md) and [D2 audit](d2-shipping-exclusion-audit-plan-20261105.md). D4 code writer requires an explicit product contract. Upstream catch-up/re-land and public shipping remain separately gated. diff --git a/docs/orchestration-v2/handoff-upstream-to-r-routing-gate-20261106.md b/docs/orchestration-v2/handoff-upstream-to-r-routing-gate-20261106.md new file mode 100644 index 0000000000000..fb75ad497ad76 --- /dev/null +++ b/docs/orchestration-v2/handoff-upstream-to-r-routing-gate-20261106.md @@ -0,0 +1,24 @@ +# DeepSeek coordinator-only handoff — U completed, audit routing ledger, then conditional R + +**Status:** **U COMPLETED (worker-reported) / TECHNICAL G-U PASS WITH TIMEOUT CAVEAT / ROUTING-LEDGER GATE HOLD / R NOT DISPATCHED**. +**Binding authority:** [overnight U→R→H amendment](overnight-conditional-autonomy-amendment-20261106.md), especially §6.1. +**Source record:** [manager U return reconciliation](manager-upstream-trial-return-reconciliation-20261106.md), [accepted D4 A+B](d4-accepted-revocation-contract-20261105.md), [Current State](../../01_CURRENT_STATE.md). +**Scope:** **coordination-only, inspect/reconcile exact local routing ledger before any R technical worker**. This is NOT permission for a Git push, main merge, expanded source rebase or release. + +## Paste into the active T3 Code DeepSeek orchestration session + +> You are **DeepSeek V4.1 Flash — COORDINATOR ONLY**, no source editing, shell/tests or code review. Read Project Instructions → Current State → Coordination/Handoff Protocol → [overnight gated amendment](overnight-conditional-autonomy-amendment-20261106.md) → [manager returned U review](manager-upstream-trial-return-reconciliation-20261106.md) → this packet → Runtime task/attempt/handoff/ledger. **U upstream trial has already completed** on a clean local-only branch. Do **NOT** rerun its 29 test batches, overwrite its local branch, sync more upstream, or ask again for the accepted isolated R conditional authority. +> +> **Report/evidence checkpoints (validate locally before continuing):** U trial branch `trial/upstream-catchup-20261105` at `c037460c2f4a98e8c8f849928c92af6cb80e3d80`, fork-main base `fb67545d790c5c001e8f85827f219ab6493c435e`, **frozen U upstream tip** `25b53299b75d4d8d1d0667ad47e9cfed3749776e`, two routine conflicts, batch 367 affected test files / 8,022 passing, 65 focused additional, 39 uncached workspace typechecks, real isolated server restart/persistence, MCP 82 tools with no continuation field, bounded UI smoke, two-pass different-provider reviewer PASS. **Single monolithic `check:changed` timed out at 900 seconds (exit 1); never claim it green.** Manager accepted equivalent entire test manifest executed in 29 review-checked sequential batches as a scoped **STATIC PASS WITH TIMEOUT CAVEAT**, not a full CI pass. Four OS/opt-in skips are pre-existing. U isolated source reported no experimental continuation/D4 import, but independent reviewer could not separately prove that negative claim. +> +> **MANDATORY G-U ROUTING LEDGER AUDIT — BEFORE ANY R WORKER DISPATCH:** inspect **the existing restricted local ledger** `/home/jer/dev/upstream-catchup-trial-20261105-evidence/LEDGER.md` and canonical T3 Runtime records if connected. Confirm at minimum all **3 Codex writer dispatches** and **2 Claude reviewer dispatches** were recorded with stage/task/attempt, chosen provider/model/subscription, requested/actual effort, why chosen/alternatives, quota/reset or UNKNOWN, timing, assignment, result, observed test/review evidence and next action. Record each factual observation with source; don't invent or imply contemporaneous entries where none exist. If incomplete, append a marked **RETROSPECTIVE** reconciliation using actual accessible dispatch/review transcripts. Verify the append succeeded durably. Report any unverifiable items transparently. **If no durable ledger write can be confirmed, STOP: `OPERATIONAL BLOCKER — ROUTING LEDGER UNAVAILABLE`.** A chat answer is not a routing ledger. +> +> **Gate transition:** if U source/worktree state still matches, the accepted test/review evidence remains credible, all 5 dispatches accounted for in a durable record, and no unresolved material U finding, append an explicit **`G-U FINAL PASS (scoped, timeout caveat disclosed)`** entry with its evidence refs. Under the user's 2026-11-06 overnight **conditional local-only authority**, you may then proceed to **Stage R** without seeking another user response. If any of those conditions fails, **STOP with classified blocker and a restart-ready handoff**. Do not lower the gate to make progress. +> +> **R scope, only after G-U FINAL PASS:** create an entirely **NEW** isolated writer-owned local branch/worktree from the reviewed frozen **U trial candidate tip**, not newest upstream. Fresh-adapt the minimum default-off continuation and accepted D4 A+B as new bounded changes using divergent experiment/local D4 branches as read-only references **only**, no wholesale merge/cherry-pick. Codex GPT-6.1 SOL Medium or Claude Sonnet 5.5 Medium technical worker; **different provider/model** read-only reviewer. Test full real-server-root D4 K1/K2, transactional revoke-first 0 new run/effect/accepted receipt, natural prepared-run release cancellation, replay, default-off, cross-project/no agent mint, normal users, typecheck, schema budget disclosure and rendered UI if touched. Respect **G-R** exact terms of overnight amendment; only on G-R PASS may separate isolated H worktree/prototype begin. Maximum **18 technical/reviewer dispatches total across overnight U/R/H**, U already used **5**, so **at most 13 remain** (unless other actual attempts must also count). **At most two repair/retest/re-review cycles per stage.** Use subscription availability as observed, never guessed; persist each future routing decision before dispatch and actual result after. +> +> **Hard stops:** no Git push/public PR, fork-main merge, source override of existing worktrees, upstream drift auto-merge, release/production, material engine/authority architecture, paid provider turns, destructive Git, credential bypass, actual live service/DB harm, private PR #21 evidence disclosure, or advancing on incomplete independent review. The user controls integration into `main` and product/release decisions. +> +> **Return:** `U LEDGER AUDIT VERDICT / DISPATCH DECISIONS ACCOUNTED FOR / DURABLE APPEND VERIFICATION / G-U GATE PASS OR HOLD / R OWNERSHIP + TASK IF STARTED / TESTS/REVIEW/ROUTING QUOTAS / NEW RISKS / NEXT AUTHORIZED ACTION`. Keep full IDs/local evidence in private Runtime/ledger; no sensitive logs on public GitHub. + +**Manager note:** At time of authoring, browser manager cannot read this local ledger or unpushed U source. A complete R technical dispatch is **conditional** on the ledger gate above; no worker has been dispatched by writing this handoff. diff --git a/docs/orchestration-v2/independent-cloud-review-coordinator-vs-superagent-20261103.md b/docs/orchestration-v2/independent-cloud-review-coordinator-vs-superagent-20261103.md new file mode 100644 index 0000000000000..3f815c28476a8 --- /dev/null +++ b/docs/orchestration-v2/independent-cloud-review-coordinator-vs-superagent-20261103.md @@ -0,0 +1,93 @@ +# Independent cloud-model architecture review — T3 coordinator vs DeepSeek Superagent + +Date: 2026-11-03 +Status: REVIEW REQUEST / NO DECISION / NO RUNTIME OR PRODUCTION CHANGE +Target reviewer: independent cloud model capable of source-level software architecture and systems integration (prefer Claude Sonnet/Codex-class; use stronger model only if required). The current browser-side manager prepared this brief but **did not run the independent reviewer**. + +## Request + +Investigate, independently and skeptically, which route minimizes **total development, operating, verification and future maintenance cost** while preserving the governing product promise: T3 Fork's provider-neutral Project Runtime owns authoritative project state, and a non-developer can preserve project history and safely continue through substitute frontier or open-weight agents. + +Compare fairly: + +- **A — Continue native T3 coordination:** evolve existing Runtime/orchestration application services with a small deterministic completion/authorization/continuation policy; DeepSeek low-cost models can be manager/router workers through existing T3 providers. Borrow concepts from the Superagent prototype, but no Superagent runtime dependency. +- **B — DeepSeek Superagent as primary coordinator:** run the existing DeepSeek Superagent orchestration engine, integrated with T3 Project Runtime as canonical tasks/decisions/verification/permissions. Determine what it actually takes to avoid a duplicate ticket ledger, execution engine or authority. +- **C — Bounded hybrid or alternative:** DeepSeek Harness as an ACP worker, Superagent as a narrower event intake or project-specific worker only, or a thin bridge that preserves state ownership. Explain whether C is genuinely cheaper than A and B or just hides complexity. + +**Do not infer that the cheapest DeepSeek *model* implies that its Superagent *software* should become T3's coordinator.** Likewise, do not assume sunk cost in T3 makes continuing it optimal. Recommend replacing any unnecessary T3 coordinator code when the external alternative genuinely earns its integration cost. + +## Grounded facts to check + +1. T3 has durable project tasks, append-only handoffs, source/decision references, routing, execution attempts, restart reconciliation, orchestration V2 command/event lifecycle and MCP. Inspect actual repo code, not just docs, and distinguish implemented from designed behavior. +2. T3 supports generic ACP command providers; its user documentation explicitly gives `dsh --profile acp` as DeepSeek Harness entrypoint. This **does not establish** that the Superagent's ticket/evaluation engine is controllable through ACP: ACP primarily exposes agent/session operations. +3. DeepSeek Harness is official MIT-licensed **developer-preview** software with compatibility-breaking changes and an explicit no-security-audit warning. +4. DeepSeek dsh-superagent-prototype is MIT licensed but explicitly **a research prototype**, not an official production product, with an application Engine, own Trigger/Thread/Eval/Mandate/Ticket/Assignment/Subscription Store and outbox/effect lifecycle. A default Executor executes shell commands without approval as the operator OS user. Its scope is one GitHub repo per deployment, not generic multi-project T3 Runtime. +5. Published Superagent package targets a prerelease DSH dependency range; evaluate exact tested version pair, release strategy and likely T3 maintenance burden instead of inferring compatibility from semver. +6. Our previous DeepSeek model-level routing/orchestration trials are user-supplied evidence that the DeepSeek model was a reliable low-cost orchestrator in that benchmark, but are **not** an end-to-end verification of DeepSeek Superagent in T3. +7. Browser-based ChatGPT remains optional. Do not require a browser↔T3 automation bridge or assumption of a free browser token allowance. + +## Direct source references + +**T3 Fork**: +- https://github.com/jermur788/t3code/blob/main/docs/internals/project-runtime.md +- https://github.com/jermur788/t3code/blob/main/docs/internals/runtime-routing.md +- https://github.com/jermur788/t3code/blob/main/docs/orchestration-v2/orchestrator-mcp-server.md +- https://github.com/jermur788/t3code/blob/main/docs/orchestration-v2/rte-040-execution-bridge.md +- https://github.com/jermur788/t3code/blob/main/docs/orchestration-v2/rte-050-recovery-cancellation.md +- https://github.com/jermur788/t3code/blob/main/docs/internals/adding-a-provider.md +- https://github.com/jermur788/t3code/blob/main/docs/user/providers-acp.md +- https://github.com/jermur788/t3code/blob/main/apps/server/src/projectRuntime/RuntimeTaskExecutionService.ts +- https://github.com/jermur788/t3code/blob/main/apps/server/src/projectRuntime/ProjectRuntimeService.ts +- https://github.com/jermur788/t3code/blob/main/apps/server/src/projectRuntime/OrchestrationEvidenceService.ts +- https://github.com/jermur788/t3code/blob/main/apps/server/src/projectRuntime/AdaptiveRoutingService.ts +- https://github.com/jermur788/t3code/blob/main/docs/internals/fork-product-direction.md + +**DeepSeek**: +- https://github.com/deepseek-ai/dsh-superagent-prototype/blob/main/README.md +- https://github.com/deepseek-ai/dsh-superagent-prototype/blob/main/docs/001-domain.md +- https://github.com/deepseek-ai/dsh-superagent-prototype/blob/main/docs/002-authorization.md +- https://github.com/deepseek-ai/dsh-superagent-prototype/blob/main/docs/003-execution.md +- https://github.com/deepseek-ai/dsh-superagent-prototype/blob/main/docs/007-architecture.md +- https://github.com/deepseek-ai/dsh-superagent-prototype/blob/main/package.json +- https://github.com/deepseek-ai/dsh-superagent-prototype/blob/main/LICENSE +- https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/architecture.md +- https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/acp/acp/README.md +- https://github.com/deepseek-ai/deepseek-harness/blob/master/SAFETY.md +- https://github.com/deepseek-ai/deepseek-harness/blob/master/LICENSE + +Research supporting branch and separate proposal (not governing spec): +- https://github.com/jermur788/t3code/pull/20 + +## Required comparison / research method + +1. Map existing **T3 task authority**, **orchestration lifecycle**, **provider interface**, **worktree/permissions**, **review evidence**, **restart/replay**, and **source-of-truth APIs** to corresponding DeepSeek Superagent concepts. Mark each as direct reuse, simple adapter, schema translation, duplicated ownership, replacement, or unproven. +2. For option B, identify **minimum real code modifications** or bridge interfaces needed for Superagent to accept T3 tasks, authorize against T3, execute through T3-approved providers/worktrees, and report evidence/accepted outcomes back. Distinguish minimal interoperability from complete authority delegation. Test whether its Store can remain local derived/cache only without bifurcated truth. +3. For option A, identify **minimum missing continuation features** and where they fit within currently existing Runtime/Orchestrator services. Do not overstate unfinished code. +4. For option C, explain exactly what value exists beyond plugging DeepSeek Harness ACP into T3 and using a DeepSeek model through our existing providers. If implementation is equivalent to A plus a second database, reject as duplication. +5. Address non-coder operator experience and when the human must approve; no unreviewed merges or unsafe shell execution. +6. Explain upstream maintenance strategy: track DSH/Harness version pins, exact T3 extension points, wrappers vs code forks, security updates, testing gates; whether our ability to fork mitigates abandonment and at what cost. +7. Compare costs in **effort bands and dependencies**, not invented dollar/token totals: initial integration, end-to-end verification, expected maintenance for first 3/6/12 months, number of trust boundaries, migration/recovery burden, and measured vs unknown model/runtime cost. +8. Identify a cheap **reversible spike** that directly falsifies a key assumption (e.g. Superagent can be orchestrator with T3 Runtime still canonical, without a second task owner). It must run in isolated home/branch with synthetic tasks, no production credentials. +9. Identify what a first attempt should prove in one integration test: terminal worker event → authorized next action → independent review → evidence + task reconciliation → restart → provider swap, no duplicate dispatch. +10. Consider whether maintaining two orchestration engines would violate upstream-friendly T3 principles. Be explicit when a design would require changing upstream internals and create ongoing rebase hotspots. + +## Deliverable and acceptance + +- Executive verdict: A, B, C or defer, plus reasons and confidence. +- At least one fair steelman for each of A and B and strongest counterargument to the winner. +- Component-by-component overlap/seam table with source pointers. +- **Smallest implementation step** to discriminate alternatives with pass/fail criteria and expected engineering scope. +- Risk register: security, failover/project portability, upstream drift, local/cloud cost, operational failure/recovery, auth, privacy, maintenance. +- States labelled: source-inspected, static hypothesis, tested runtime, unverified. +- Decision thresholds: what evidence would cause reversal, not just a single preferred option. +- Do not claim to have run tests unless real logs and environment evidence support them. + +## Boundaries / safety + +Read-only research and design only. No production routing/profile/adaptive changes, no benchmark launches, no CCF changes, no merges, no credential manipulation, no external upload of private Runtime data. The ongoing benchmark credential issue is unrelated; do not consume its test resources. + +Stop for product choices, meaningful paid infrastructure cost, security-sensitive modifications or incompatible ownership models. + +## Handoff to the manager + +Return **VERDICT; BASE and inspected revisions; RESULTS with source evidence; VERIFICATION and gaps; BLOCKERS by class; DESIGN OPTIONS; RECOMMENDED REVERSIBLE SPIKE; NEXT ACTION; and anything requiring user authority.** The reviewer opinion is advisory, not an accepted product decision, and the project manager must reconcile it with canonical Current State and actual repo/runtime implementation. diff --git a/docs/orchestration-v2/independent-continuation-hardening-review-20261104.md b/docs/orchestration-v2/independent-continuation-hardening-review-20261104.md new file mode 100644 index 0000000000000..64a98c277599b --- /dev/null +++ b/docs/orchestration-v2/independent-continuation-hardening-review-20261104.md @@ -0,0 +1,82 @@ +# Independent source re-review — continuation authorization hardening + +Date: 2026-11-04 (Europe/Dublin) +Reviewer: Overall Manager / ChatGPT GPT-6, connected GitHub source inspection, independent from the local worker. + +## VERDICT + +**REVIEW PASS (bounded source/security review for R1, R2, R3)** on the published [authorization-hardening branch](https://github.com/jermur788/t3code/tree/fix/continuation-authorization-hardening-20261103). **Local RUNTIME PASS is worker reported**, with test-first failures and success evidence in the user handoff; the browser reviewer did **not** run tests/CI. **NOT INTEGRATED, NOT PRODUCTION ENABLED.** Broader deployment is still BLOCKED by the explicit F4 experimental-feature gate, budget-review decision, the external launch-time revocation race and real-provider/UI qualification. This is a narrow review pass, **not** a release approval or claim that all execution races are resolved. + +### Base and inspection + +- GitHub branch head was confirmed to match the worker report; parent is the prior security-repair branch and fork main remains separate. +- Commit inspection found four changed files: `RuntimeTaskExecutionService.ts`, `RuntimeTaskContinuationPolicy.ts`, `RuntimeTaskContinuationSecurity.test.ts` and the handoff document. No additional new table, migration, contract or context-budget snapshot change. +- Reviewed the full relevant production diff, continuation authorization/replay and stop-writer functions, test names and the file-backed test scenarios including source/review/repair scope edits, two-service stop-write race, malformed keys, restart and opposite control cases. +- Previous research review: [original security findings](independent-continuation-security-review-20261103.md) and [first repair review with R1/R2/R3](independent-continuation-security-repair-review-20261103.md). +- Local reports: prior 78 focused tests on repair branch; **after hardening 39/39 focused three-file tests, 179 projectRuntime tests, clean typecheck and `check:changed` including 111 tests**. Not independently executed; no original raw logs mounted. + +## Findings and evidence + +### R1 — stale source, reviewer, repair task revisions: SOURCE REVIEW PASS + +`authorizeReviewContinuation` now requires the source task to have the exact root packet revision + 1, and the reviewed cursor task to have its exact own post-handoff revision. `authorizeContinuationDispatch` also requires exact reviewed cursor and review lane post-handoff revisions. `launchAttempt` additionally checks the continuation target task's *current revision* against the persisted launch packet before an external launch. These checks preserve the pure evaluator's historical `>=` rule for rewalking older shared-lane links without allowing that loose check to authorize a new launch. + +The file-backed restart tests cover source scope edit, reviewer scope edit, reviewer acceptance edit before repair, repair target scope edit, and source scope edit before repair. In all five reported scenarios, an altered source or lane invalidates the old pending receipt without a second launch. Normal unchanged pending-receipt replay remains covered in the prior suite. + +Limit: execution still has the acknowledged last-authorization-check-to-external-launch race. The source-review result does not prove a zero-launch guarantee under concurrent revocation. + +### R2 — newer operator decisions vs delayed blocked escalation: SOURCE REVIEW PASS + +`holdForUser` accepts the decision's source-task revision and checks it against the current source revision and presence of synthetic continuation policy. It writes with `expectedRevision` from the original decision, and treats a CAS conflict as a superseded decision rather than retrying. Existing cancelled/blocked safeguards remain. + +File-backed tests use two independent service instances and a controlled read barrier to race a newer operator `done`, `deferred`, or continuation-withdrawn decision against the delayed stop. They confirm no overwrite, durable revision preservation and no duplicate launch after restart. This addresses prior R2 for the tested interleaving. + +Limit: no sustained multi-host contention qualification. + +### R3 — reserved continuation request-key namespace: SOURCE REVIEW PASS + +Public `execute` now checks `key.startsWith("cont:v1:")`; even malformed keys cannot be used as ordinary receipt keys. The internal dispatcher still requires parseable, rederived authorization. Tests reject malformed variants and preserve a normal caller-provided request key on the same repair lane. + +Limit: this prevents **new** forged/malformed requests. Historical malformed rows, if present in a migrated/experimental database, are not retroactively removed. Existing budget SQL counts rows by prefix; legacy rows can conservatively consume budget. This is fail-closed for unauthorized work, but comment language saying all counted rows are host-issued only holds for new post-fix writes. No migration/scrubbing was attempted; full production data migration is out of scope. + +### F1–F3, F5: prior regressions preserved within the observed test evidence + +The previous public-key authorization bypass, source cancellation/policy removal, durable blocked decision and reviewer-evidence-not-VERIFIED invariants remain implemented. No second queue/state owner or new provider engine was introduced. The local worker reports all existing tests passing. + +## Explicit non-acceptance / unresolved gates + +1. **F4 — hard integration blocker.** The schema's `mode: "synthetic"` is an operator-selectable *label*, not an enforced stub-only environment/disabled-by-default feature gate. A merged normal server could route real model launches. Do not merge to main until a disabled-by-default gate or removal from shipping builds is designed and tested. The previous experimental `+646`-byte MCP tool-list budget increase remains a separate review gate. No contract/budget change was added by hardening. +2. **External-launch TOCTOU remains.** The final recheck and external `ThreadLaunchService.launch` are not atomic with revocation, so a concurrent withdrawal in that narrow window could still start one turn. Reconciliation/cancellation handles ambiguous or already-created work after the fact; they cannot guarantee *no* post-revocation start. This risk must receive an explicit revocation-contract/architecture decision for real providers. +3. **No real-provider/model or UI qualification.** Provider native session/prompt behavior, operator `ask_user` notification, and rendered user experience remain unverified. Durable `blocked` records are not notifications. +4. **No upstream rebase qualification.** The branch is based on fork main, not current upstream. Existing upstream Orchestration V2 should be inspected again before integration. +5. **No fresh independent executable run.** A second local runner should repeat focused tests, `projectRuntime` suite, typecheck and `check:changed` on the exact published branch, preserving the user worker's worktrees. + +## NEXT — bounded independent runtime qualification handoff + +**Role:** Independent read-only local verification worker; no code writer needed unless a verified defect appears. **Location:** fresh isolated worktree, newly checked out at latest published `fix/continuation-authorization-hardening-20261103` head. Do not reuse the implementing worker's mutable worktree as evidence of independent rerun. **Preflight:** inspect repo, branch, status, ownership, dirty files and fetch remote; do not stash/reset/discard/force-push. No real providers/model calls. + +**Run:** + +```bash +vp test run apps/server/src/projectRuntime/RuntimeTaskContinuationPolicy.test.ts apps/server/src/projectRuntime/RuntimeTaskContinuationRestart.test.ts apps/server/src/projectRuntime/RuntimeTaskContinuationSecurity.test.ts +vp test run apps/server/src/projectRuntime +vp run typecheck +vp run check:changed +``` + +**Verify:** all commands exit 0 and no unexpected changes; source/review/repair post-handoff version binding; worker `done`/`deferred`/policy withdrawal cannot be overwritten by delayed stop; malformed `cont:v1:` keys rejected; successful original receipt replay still works; no `VERIFIED` elevation, no third repair. If failures, classify as fixture vs implementation defect; stop before substantial modifications, return exact failing output. Confirm test result counts against the published artifact, without inventing source statistics. + +**Return fields:** VERDICT / BASE and status / exact commands and evidence / defects / REVIEW / INTEGRATION / NEXT. Keep `NOT INTEGRATED`, no PR/merge/production activation or cleanup. + +### Product/architecture decision boundary — separate from this bounded re-run + +Before production integration, Overall Manager must ask the user to choose revocation semantics: (a) narrow best-effort last-check with already-receipted launch reconciled/cancelled, or (b) strict no-new-launch-after-revocation, which may require cooperation with upstream launch engine and careful atomicity design. No choice has been adopted. A shipping gate and agent-context budget approval are independently required. Do not infer permission for either from this review or clean tests. + +## Governance/status summary + +- **IMPLEMENTED** on isolated branch. +- **RUNTIME PASS (local worker evidence)**: yes for the reported suites. +- **REVIEW PASS (independent source scope R1–R3)**: yes, limited to the inspected code and scenarios. +- **INTEGRATED / VERIFIED for production**: no. +- **Release blockers:** F4 shipping gate; unresolved final-check/launch revocation semantics; context budget, upstream compatibility, real-provider/UI qualification. +- **Coordination:** upstream PR #28777 continuation-comment task is distinct, already publicly submitted, and does not prove this experimental policy safe for production. diff --git a/docs/orchestration-v2/independent-continuation-security-repair-review-20261103.md b/docs/orchestration-v2/independent-continuation-security-repair-review-20261103.md new file mode 100644 index 0000000000000..aea2c73e7442b --- /dev/null +++ b/docs/orchestration-v2/independent-continuation-security-repair-review-20261103.md @@ -0,0 +1,78 @@ +# Independent source/security re-review — continuation security repair + +**Date:** 2026-11-03. **Reviewer:** Overall Manager (independent GitHub source inspection). +**Source:** [Published security-repair branch](https://github.com/jermur788/t3code/tree/fix/continuation-security-repair-20261103); its head was confirmed against the 2026-11-03 worker handoff. +**Verdict:** **PARTIAL REVIEW PASS ON REPAIRED SCENARIOS / REVIEW REQUIRED FOR NEW STALE-REVISION AND STOP-AUTHORITY CASES / NOT INTEGRATED.** +**Verification basis:** Worker-reported 78/78 focused tests and final `check:changed` (101 tests); the browser reviewer independently read the implementation and relevant file-backed tests, but **did not independently execute a test suite, CI, provider or UI**. + +## Scope and positive evidence + +The repair is additive within `RuntimeTaskExecutionService.ts`, plus a new file-backed security regression suite and handoff text. No changes to Project Runtime contract, migrations, upstream execution internals or MCP-budget snapshot were introduced by this repair. Existing experimental contract and its +646-byte budget growth remain from the previous experiment branch. + +1. **F1 — earlier externally minted continuation-key bypass is repaired on its tested path.** The public `execute` route passes `continuation=null` to `runExecute`, which rejects keys parsed as `cont:v1:r:` or `cont:v1:p:`. The internal continuation dispatcher re-derives the current task policy and decision before constructing the attempt; a passing review, exhausted budget and cancelled source cannot be used to mint a repair via a forged key. [Source](https://github.com/jermur788/t3code/blob/fix/continuation-security-repair-20261103/apps/server/src/projectRuntime/RuntimeTaskExecutionService.ts). +2. **F2 — cancellation/policy-removal tests pass in documented windows.** Receipt insertion now checks source revision/status/mode in SQL, and pending launches revalidate policy before attempting `ThreadLaunchService.launch`. The new tests coordinate two service instances against the same file-backed SQLite database and cover cancellation or removal of the `continuation` policy before insertion, plus restart of a pending receipt after withdrawal. These tests do *not* establish full atomicity with the external launch. +3. **F3 — terminal failed-review/contradictory-evidence stop becomes durable.** `advanceContinuation` now persists one blocked source-task record for `blocked` as well as `ask_user` decisions. Tests show no duplicate blocker across restart. `reconcile_required` is kept ambiguous rather than mislabeled as a definitive failure. +4. **F5 and acceptance boundary preserved.** Reviewer evidence does not upgrade the project source task to `VERIFIED`; the independent reviewer and two-cycle cap remain synthetic policy checks. Reviewer identity means a separate owner/provider instance, not independently authenticated acceptance evidence. +5. **F4 — integration blocker preserved.** `mode: synthetic` is not a stub-provider-only runtime gate. If merged into a running fork, existing UI/RPC authorizations could activate real provider work. It must be removed from shipping builds or disabled-by-default before integration. The +646-byte MCP tool-list increase still needs a substantive product/context review. + +**Do not call the branch REVIEW PASS or production-safe based on passing tests alone.** Two additional stale-state authorization scenarios remain evident in current source. + +## Additional findings from independent inspection + +### R1 — HIGH: pending continuation can survive an unrelated accepted-scope or review-task revision + +**Source:** `authorizeReviewContinuation` calls `evaluateContinuation` with the *current* `cursorTask`; the evaluator rejects only `cursorTask.revision < cursorAttempt.receipt.packet.taskRevision + 1`, rather than requiring the expected exact post-handoff revision and preventing later operator edits. `advanceContinuation` enforces an exact equality on its initial scan, but `launchAttempt`'s pending-receipt replay does **not** use that scan guard. Pending review launch checks source's current policy/status and that a handoff matches the *old execution packet*, but not the unchanged authoritative accepted-scope revision. A review-target task's current revision is likewise not checked at replay against the stored packet. + +**Concrete risk:** After a worker's terminal handoff and a durable review receipt, an operator changes source task scope/acceptance criteria, or the review task scope, without removing the continuation policy. On restart, a `pending` review can be reauthorized from the old worker handoff and launched using a stale packet (and possibly stale review instructions). The operator's accepted modification should not be bypassed by old continuation intent. This is **source-level risk, not a reproduced failure**. + +**Required test:** Start file-backed source worker → terminal handoff → one review receipt. Force receipt to pending and remove stub thread as the current restart harness does; change (a) **source scope** after handoff and (b) **review task scope** after receipt in distinct scenarios, leaving policy/status enabled. Recreate service and run startup reconcile; assert **no new external launch**, durable explicit stop or reconciliation state, and no change to VERIFIED. Repeat for pending repair after independent review task acceptance criteria/revision changes. + +**Required solution property:** Bind the original task/review policy and target task version to the durable launch authorization, not merely the existence of a policy with the same ID. Use current Project Runtime revision CAS and existing attempt packet fields, no second state owner. Decide how intentional operator-edited scope can explicitly authorize resuming (new task execution/intent) rather than silently inheriting an old pending receipt. Do not weaken the exact-revision checks to make tests pass. + +### R2 — HIGH: terminal stop can overwrite a newer user decision + +**Source:** `holdForUser` reads the current source task and returns only if it is `blocked` or `cancelled`. It then uses the *current* revision in `runtime.updateTask` to write `status: blocked`. Unlike dispatch, it does not verify the source's revision/policy from the decision that caused escalation. + +**Concrete risk:** During continuation, an operator can change the source task to `done` (with required result) or `deferred`; a stale reviewer failure/unresolved-decision callback can later overwrite that newer operator decision to `blocked` even though the old continuation should be superseded. `updateTask`'s CAS is against the freshly read revision, so it will not detect this semantic staleness. Also, a revoked `continuation` policy alone is not checked before the status write. **Not yet reproduced under a deterministic race test.** + +**Required test:** Add a controlled barrier after `advanceContinuation` has read the enabled source and before the terminal `holdForUser` write; with a second service instance update source to `done` / `deferred` or remove continuation. Assert the operator's newer status and policy survive, no blocked write occurs, no extra provider launch and no duplicate prompt. Re-run process/reconciliation to confirm persistence. + +**Required solution property:** The stop writer must be authorized by the same current source revision/status/policy as the decision and must fail closed if the operator changed task state. Keep a durable operational reason for *current* failures, but do not invent a second source of truth or overwrite explicit newer decisions. + +### R3 — LOW / defensive: reserved request-key prefix matching is narrower than the documentation + +The public guard invokes `isContinuationRequestKey`, which uses `parseContinuationRequestKey` and matches **only well-formed** `cont:v1:[rp]:` keys, whereas comments say the entire `cont:v1:` namespace is reserved. A malformed `cont:v1:p:` can be accepted as an ordinary request key; the broad SQL `LIKE 'cont:v1:p:%'` in `repairCyclesFor` would still count such a row if used on a repair task, contaminating the budget even though no internal continuation occurred. Ordinary caller access still requires a valid authorized task; this is chiefly denial-of-service/budget integrity, not the original unauthorized repair bypass. Recommended small fix: reserve all keys that **start with** the namespace, and count only genuine host-issued continuation receipts, if feasible without new state. + +**Test:** Invoke ordinary public `execute` on a ready repair task with malformed `cont:v1:p:` and verify it is rejected with no attempt/budget consumption. Existing ordinary nonreserved key must remain accepted. + +## Known, explicitly unresolved security boundary + +**TOCTOU between last authorization check and external `ThreadLaunchService.launch`.** The worker acknowledges this as an execution-service handoff window; the SQL receipt insertion and pre-launch check are not one atomic external operation. This cannot be labeled “fully fixed” for strict *no post-revocation launch* semantics. For a reversible stub experiment, document the limited guarantee and retain a stop/cancel/reconcile path. For production real-agent launch, require a precise revocation contract and an architecture/security decision or cooperative execution-engine guard if zero new launch after withdrawal is mandatory. Do not claim tests cover a gap they did not coordinate. + +## Other checks and limits + +- Multi-instance simulated concurrency was exercised with distinct service layers and a shared file-backed DB; sustained multi-process/host contention was not qualified. +- `runExecute`'s source CAS in the INSERT queries current source **revision**, status and synthetic mode, but not the entire policy JSON. The revision guard is meaningful **provided every authorized modification advances revision** through the Project Runtime service; raw DB writes are outside the supported trust boundary. However, pre-launch authorization must also enforce staleness as in R1. +- `reconcileActiveAttempts` retries without a new run only when a row is truly pending; cancelled/ambiguous are distinct. The security suite explicitly tests handling of prior launched threads. +- Handoffs remain worker-authored evidence with thread/actor/attempt matching, **not cryptographically attested tests**. F5 is deferred, and no VERIFIED state is automatically written. +- The source-level review did **not** perform an upstream rebase, real-provider test, UI inspection or end-to-end operator notification. The escalation is a `blocked` task record, not an actual user-visible notification action. + +## Exact next repair/verification handoff — narrow, test-first + +**OWNER:** One T3 Code/Codex-class local worker for authorization/race-sensitive repair, separate from upstream PR #28777 and from fork main. **USER APPROVAL:** Already authorized bounded synthetic correctness; no approval required to add narrowly scoped negative tests and repair the experiment. Product/architecture choice required for changing production revocation semantics or shipping feature flags. + +**REPO/BASE:** `jermur788/t3code`, published `fix/continuation-security-repair-20261103` branch at reviewed head; inspect live head again before write. Confirm worktree, dirty state, other writers and file ownership. Create a **new isolated review-hardening worktree/branch** from this repair branch, or arrange exclusive one-writer ownership to continue the existing branch. Do not edit main, overwrite the earlier experiment/qualification worktrees, stash/reset/force-push or merge. + +**GOAL:** Reproduce R1 and R2 with deterministic file-backed SQLite/stub-provider tests; preserve all earlier F1/F2/F3 fixes and the passed 78/101 tests. Add R3 malformed-key guard if it is truly a small safe change. Do not broaden into product UI, real model launches or another state store. + +**ACCEPTANCE:** R1 scope/review edit stops pending automatic continuation/replay with no new external launches; R2 newer operator decisions and policy withdrawal survive delayed block processing; R3 invalid prefix cannot poison repair budget. Keep allowed same-revision crash replay working. Fail closed under ambiguous thread state; preserve safe idempotent command receipt and original budget/reviewer assertions. No VERIFIED transition from reviewer claims. + +**TEST:** First record failing negatives on reviewed branch; then minimum implementation fix, and rerun full continuation files and `vp run check:changed` with recorded output and file-backed startup/restart evidence. Include independent two-service concurrency in at least one case. Document remaining external-launch TOCTOU and F4 as explicit integration blockers, not newly “fixed.” + +**STOP CONDITIONS:** Any fix requiring changes to generic upstream V2 launch/effect core, a new authoritative queue/table or material security/product contract: stop for architectural decision. No paid models, no network outreach, no production enablement, no merge. + +**RETURN:** Result by R1/R2/R3 and F1–F5; exact failing test outputs before repair and passing after; changes and links, DB/restart/concurrency verification, scope/authority rationale, residual security risk, current integration state; complete continuation handoff for next manager review. Preserve existing worktrees. + +## Decision/status + +**Current state:** `IMPLEMENTED`; bounded local `RUNTIME PASS` for reported tests; **independent REVIEW REQUIRED (R1/R2 + F4/integration)**; `NOT INTEGRATED`, `NOT PRODUCTION ENABLED`. No new upstream contribution from this fork experiment. Continued synthetic hardening is within existing scope. **The documented remaining TOCTOU is not silently accepted as a production security guarantee.** diff --git a/docs/orchestration-v2/independent-continuation-security-review-20261103.md b/docs/orchestration-v2/independent-continuation-security-review-20261103.md new file mode 100644 index 0000000000000..ae7eb754bb1b6 --- /dev/null +++ b/docs/orchestration-v2/independent-continuation-security-review-20261103.md @@ -0,0 +1,89 @@ +# Independent source/security review — browser continuation experiment + +Date: 2026-11-03 +Reviewer: Overall Manager, OpenAI GPT-6 through connected GitHub source inspection (independent of the implementing browser and local workers) +**Review verdict: REVIEW REQUIRED — implementation defects / authorization gaps found.** +**Prior evidence accepted at appropriate level:** local worker reports 66/66 focused tests on the published head, and previous `check:changed` passed 88 tests and typechecks. The manager inspected the live source and tests in GitHub; **did not re-run local tests, real providers, CI or UI**. +**Integration:** NOT INTEGRATED, NOT ENABLED IN fork main, NO PR opened for this experiment. This review does **not** supersede the existing local RUNTIME PASS on the tested subset; it identifies important **untested cases**. + +Inspected published branch: https://github.com/jermur788/t3code/tree/experiment/browser-task-continuation-spike-20261103 +Current fork main remains distinct. Review of code as published after the two local qualification commits. Source: +- [RuntimeTaskExecutionService.ts](https://github.com/jermur788/t3code/blob/experiment/browser-task-continuation-spike-20261103/apps/server/src/projectRuntime/RuntimeTaskExecutionService.ts) +- [RuntimeTaskContinuationPolicy.ts](https://github.com/jermur788/t3code/blob/experiment/browser-task-continuation-spike-20261103/apps/server/src/projectRuntime/RuntimeTaskContinuationPolicy.ts) +- [ProjectRuntimeService.ts](https://github.com/jermur788/t3code/blob/experiment/browser-task-continuation-spike-20261103/apps/server/src/projectRuntime/ProjectRuntimeService.ts) +- [ProjectRuntimeRpc.ts](https://github.com/jermur788/t3code/blob/experiment/browser-task-continuation-spike-20261103/apps/server/src/projectRuntime/ProjectRuntimeRpc.ts) +- [ProjectRuntime contract](https://github.com/jermur788/t3code/blob/experiment/browser-task-continuation-spike-20261103/packages/contracts/src/projectRuntime.ts) +- [File-backed restart tests](https://github.com/jermur788/t3code/blob/experiment/browser-task-continuation-spike-20261103/apps/server/src/projectRuntime/RuntimeTaskContinuationRestart.test.ts) +- [Implementation handoff](https://github.com/jermur788/t3code/blob/experiment/browser-task-continuation-spike-20261103/docs/orchestration-v2/browser-continuation-implementation-handoff-20261103.md) + +## Source-supported strengths + +1. Fork-owned policy is additive and provider-agnostic; no Argus/Superagent engine, duplicate queue or new authoritative task database. +2. `ProjectRuntimeRpc` creates server-derived `user:` actor for UI actions, while `ProjectRuntimeService.createTask/updateTask` reject agent actors attempting to modify `continuation`. This is meaningful origin guarding at existing API boundaries. +3. Project, task and source handoff identity are checked; matching thread/actor and review-provider independence are enforced at both evaluator and resolved launch. Distinct provider instance and task owner is only a syntactic reviewer-independence property, **not proof of independent acceptance quality**. +4. Existing execution-attempt receipts are saved before launch, and replay uses durable keys/launch IDs. The file-backed restart tests cover one review, an isolated pending receipt, two repairs and a blocked source after budget exhaustion. Clean review intentionally leaves source verification unchanged. +5. The `maxRepairCycles <= 2` ceiling applies only to the `synthetic` policy schema, not an accepted production default; no agent can edit it through the existing worker actor path. + +## Findings (priority and source trace) + +### F1 — HIGH: externally supplied continuation request keys can bypass conditional policy decisions + +**Source:** `RuntimeTaskExecutionService.execute` accepts arbitrary `clientRequestId` and interprets keys matching `cont:v1:([rp]):(.+)` as a continuation. For `p` (repair), it checks only that a referenced review attempt belongs to an operator-named review task and is completed with a matching handoff. **It does not check that the review evidence was FAIL, that the current operator policy budget has remaining cycles, that source remains authorized/current, or that the continuation evaluator actually chose `repair_or_retry`.** The regular user-facing `ProjectRuntimeRpc.executeTask` exposes `clientRequestId`; no reserved namespace protection is visible. Existing readByRequestKey/unique constraints prevent repeat keys, but not a *new* attacker- or caller-chosen key. + +**Consequence:** A caller could request a repair using `cont:v1:p:` when the target task remains executable, without the policy's failure/budget decision. Different past completed review attempt IDs can mint different keys. This violates user-controlled conditional scope and finite agent-debate budget. This is a **source-level authorization defect**. Whether a particular UI currently permits entering a chosen key is not relevant to the service contract; do not claim a browser exploit was run. + +**Required fix:** Reserve continuation key namespace from ordinary UI/agent calls, and make execution revalidate a durable *host-issued authorization/decision* or deterministically re-evaluate source policy plus review evidence/budget under a guarded transaction before inserting the attempt. Do not rely on a key prefix itself being a capability. Avoid second task ledger or queue. Test that a caller's invented `cont:v1:p:...` for a passing review is rejected, for a failed review after budget exhaustion is rejected, and an ordinary unrelated clientRequestId remains accepted. Test authorized internal dispatch and restart still pass. + +### F2 — HIGH: task cancellation or policy revocation can race with automatic dispatch + +**Source:** `advanceContinuation` reads `sourceTask` and its policy once at entry. It then performs multiple asynchronous reads/reconciliations/route queries; `dispatchAuthorized` rechecks the **target** task and invokes `execute`, but there is **no atomic guard tying the source task's current revision/status/policy** to the attempt insertion. The per-service `Semaphore.make(1)` serializes some attempt operations within one service instance, not independent user task edits or separate server processes. A persisted `pending` attempt is replayed via `reconcileAttemptRow` without rechecking current source authorization. + +**Consequence:** If the operator cancels the source task or removes `continuation` during the pause between policy read and launch, an old decision can still launch work; even if the first dispatch was authorized, a pending receipt may be replayed after revocation. This undermines the accepted stop/authority semantics. Exact runtime interleaving has **not been reproduced yet**; a deterministic barrier test is required. + +**Required fix:** Bind authorization to current source revision/status and policy at the same durable decision/dispatch boundary, including resumption of pending receipts. Define precise revocation semantics: a new cancellation should prevent any not-yet-dispatched continuation and should not discard a provably launched task without a recorded stop. Use CAS/transactional intent as the existing services permit, not a second orchestrator. If the existing receipt model cannot close the gap safely, stop for architecture/security review rather than inventing new state. + +**Tests:** barrier between initial source read and `execute`, concurrent operator policy remove / source status cancel, two service instances against same SQLite, restart after durable pending receipt and before launch, prove no post-revocation new external launch, and no ambiguous duplicate dispatch. + +### F3 — MEDIUM: fail-closed `blocked` decisions are dropped instead of recorded for the operator + +**Source:** `evaluateContinuation` returns `blocked` for failed/cancelled reviewer, missing/contradictory evidence, non-independent review and invalid handoff. In `advanceContinuation` both the worker and reviewer paths persist an operator blocker **only for `ask_user`**, while any other non-`review` / non-`repair_or_retry` decision returns silently. The negative test for failed or ambiguous review checks only “no more launch,” not a durable explanation/terminal status for the source. + +**Consequence:** The feature safely avoids new work but may leave a source task apparently ready with no visible reason for stopping. This falls short of the user's qualitative requirement that a stalled agent chain eventually makes a decision or escalates. Distinguish `reconcile_required` (ambiguous, await real reconciliation) from a terminal failed review. Do not mislabel ambiguous work as definitively failed. + +**Required fix:** Persist a durable, idempotent blocked/operational stop decision with current task/evidence references when the reason is actionable or terminal, without inventing a second task status owner. Define how waiting/ambiguous states remain pending and observable. Add a negative file-backed restart test for failed review and conflicting evidence that proves one operator-visible reason after replay, and never a repair. + +### F4 — MEDIUM / PRE-RELEASE GATE: `synthetic` is a label, not a global inert feature gate + +The contract permits an operator to add a `mode: "synthetic"` policy through `ProjectRuntimeRpc.createTask/updateTask`, and reconciliation automatically dispatches real T3 launches if enabled with non-stub providers. **This is harmless while the experiment branch is isolated and not integrated**, but if merged into a normal production build, the word `synthetic` alone does not enforce a stub-only environment or a disabled-by-default global switch. + +Before any integration, either remove the experimental API from shipping builds or add a disabled-by-default feature gate and explicit non-production execution constraints. Its `+646`-byte MCP tool-list budget impact is genuine and requires context-budget justification; avoid shipping a general agent-visible experimental policy without a need. The tool-budget snapshot is [agentContextBudget.json](https://github.com/jermur788/t3code/blob/experiment/browser-task-continuation-spike-20261103/apps/server/src/provider/agentContextBudget.json) (59165 bytes, from 58519). Do not treat budget-snapshot updates as permission to increase shared agent prompts. + +### F5 — REVIEW: reviewer provenance and acceptance level still limited + +`handoffMatchesAttempt` validates project/task/thread, packet revision, linked handoff ID and `createdBy = thread:`; it does **not** cryptographically bind review evidence to trusted tests. Provider and owner separation are reasonable minimum checks for this synthetic experiment, but future real acceptance must identify the review run/provider and external test provenance, prevent wrong-attempt reuse of later same-thread handoffs, and distinguish reviewer claim from verification authority. No `VERIFIED` transition is written here, which is correct. + +## Local evidence and status classification + +- **IMPLEMENTED**: standalone synthetic continuation source and tests on experiment branch. +- **RUNTIME PASS (bounded, worker reported)**: 5 focused files / 66 passing tests in latest handoff; earlier 7 / 88 `check:changed` pass on adjacent code. Source inspected by manager, **not rerun independently**. +- **REVIEW REQUIRED / IMPLEMENTATION DEFECT**: F1, F2; scope is continuation authorization and atomicity. F3 missing durable escalation, F4 pre-release visibility. +- **NOT INTEGRATED / NOT PRODUCTION ENABLED**: fork main and upstream unchanged. No external model/session/UI qualification. +- The already-published upstream PR #28777 contribution is a separate task and does not verify this continuation policy. + +## Next exact bounded repair and verification task — T3 Code + +**TASK/OWNER:** One isolated local T3 Code writer, Codex/Claude-class due to concurrency/atomicity and security-sensitive authorization. Keep one writer for `apps/server/src/projectRuntime` and `packages/contracts/src/projectRuntime.ts`. Overall Manager reviews returned evidence; optional independent second reviewer after tests. Use the least costly capable model for independent read-only tests first. + +**REPO/BASE:** `jermur788/t3code`, current experiment branch `experiment/browser-task-continuation-spike-20261103`. Confirm current remote head, local branch, worktree, clean status, unrelated changes, ownership and running workers. Use a **new isolated review-repair worktree/branch** based on the published experiment head; do not overwrite the current local qualification worktree, main or research branch. One writer only. Source is deliberately a synthetic spike; no automatic merge. + +**GOAL:** Close F1/F2 with deterministic failing tests first, then minimal security fix using existing Project Runtime/SQL/receipt abstractions. Address F3 with one observable blocked decision as possible without expanding product scope. Document F4 as strict integration gate rather than silently enabling production. + +**IN-SCOPE:** Fix only continuation authorization/decision binding, revocation race, and durable stop semantics. Tests cover forged request keys, pass-vs-fail evidence, exhaustion, task policy revoke/cancel mid-flight, concurrent reconcilers, two services on one SQLite file, restart of pending intent, and a failed/ambiguous review stop path. Keep `no VERIFIED from reviewer claim`. Preserve exact existing test scenarios and 2-cycle synthetic budget. Reuse all current T3 V2 launch IDs, request keys and receipt store. File-backed restart tests mandatory. + +**STOP/ESCALATE IF:** Truly safe revocation requires new authoritative store/queue, intrusive modifications to upstream EventSink/EffectWorker/ThreadLaunch, changing public UI/production permissions or unapproved paid resources; record the design blocker rather than improvising. Concurrent process tests may expose deeper SQLite isolation limits; do not relax tests to pass. + +**TESTS:** Existing focused 5 files/66 tests plus new negatives; `vp run check:changed` on final branch and relevant typecheck/lint/format. Record command outputs, deterministic replay, expected blocked state and exact changed files. Verify no extra global agent-context budget growth without explicit justification; if contract changes unavoidable, record it. + +**RETURN HANDOFF:** verdict per finding (fixed/blocked), branch/base/changed paths, exact before/after failing test output, full relevant command results, authorization/provenance/replay rationale, remaining risks, independent review status, integration not done and next action. Preserve original worktrees; no stashes, resets, force-pushes or destructive cleanup. Do not open a production PR or merge main. + +**PUBLIC/PRODUCT:** User approval remains required for new production policy or material architecture changes; the synthetic repair work is authorized by the existing bounded experiment direction. diff --git a/docs/orchestration-v2/manager-d4-full-root-k1-k2-verification-reconciliation-20261105.md b/docs/orchestration-v2/manager-d4-full-root-k1-k2-verification-reconciliation-20261105.md new file mode 100644 index 0000000000000..555027b7d25e6 --- /dev/null +++ b/docs/orchestration-v2/manager-d4-full-root-k1-k2-verification-reconciliation-20261105.md @@ -0,0 +1,53 @@ +# Manager reconciliation — D4 A+B full-server K1/K2 qualification + +**Received:** 2026-11-05 21:43 UTC user-supplied local worker handoff after the [bounded closure task](task-d4-full-server-assembly-verification-20261105.md). +**Authority:** [user-accepted D4 A+B](d4-accepted-revocation-contract-20261105.md), [staged safety D1–D5](continuation-staged-safety-governing-spec-20261104.md). +**Disposition:** **`K1 FULL-SERVER ASSEMBLY RUNTIME PASS (worker-reported; independent reviewer reran)` / `K2 NATURAL ASYNC RELEASE RUNTIME PASS (worker-reported; independent reviewer reran)` / `K3 PARTIAL` / `INDEPENDENT REVIEW PASS WITH FINDINGS` / `NOT INTEGRATED` / `NOT PRODUCTION VERIFIED`**. These are qualification statements **for the isolated local branch only**. Original private worker commands/logs and implementation source remain on local host and were not independently inspected from browser. The manager reviewed consistency with the accepted contract and the upstream/fork GitHub refs. + +## Provenance and branch checkpoint + +- Worker reports D4 worktree `/home/jer/dev/d4-ab-20261105`, branch `d4/ab-revocation-guard-20261105`, based on original unmerged continuation experiment `b3b8da54e0b8b184a1cf4e667d53e73e04f85074`; latest **local** D4 head `f68db477a053bfe0211c6d92bf116711c1d55371`, 12 commits, 15 files, +2359/−50, worktree clean and owned by original worker. It has **no tracking remote and was not pushed**; browser GitHub branch fetch returned NOT FOUND, consistent with this report. Manager does not claim to have read these new source files. +- GitHub fork `main` remains at merged PR #21 `fb67545d790c5c001e8f85827f219ab6493c435e`; old experimental continuation branch remains at `b3b8da54e0b8b184a1cf4e667d53e73e04f85074`. No fork main or experimental branch was changed by this local result. +- **Upstream drift newly measured by browser manager:** current `pingdotgg/t3code` `main` `25b53299b75d4d8d1d0667ad47e9cfed3749776e` is **41 commits newer** than the previous Stage 2 upstream snapshot `337c5858c33bc7f8f6dfd391a2c279fa0f7e4d17`. GitHub compare reports **225 changed paths**, including `Orchestrator.ts`, `ProviderTurnStartService.ts`, `ThreadLaunchService.test.ts`, MCP and contracts. This is a **read-only drift assessment**, not authorization or completion of upstream catch-up. + +## K1 — full real production server-root ordering (PASS within reported scope) + +- Worker and independent reviewer separately ran `apps/server/src/projectRuntime/D4FullServerAssembly.test.ts` using **the actual exported `layerMakeServer` production-root composition**, which `runServer` launches, with `ServerConfig.layerTest` isolated temporary home paths; claimed no substitution of service under test. Actual installed/authenticated provider adapter dependencies existed, but adapter open-session calls were trapped and **0 live model turns occurred**. +- The actual server-root SQL identity was recorded: same normalized DB path/inode and shared `SqlClient` for Orchestrator/EventSink/ProjectRuntime; `PRAGMA database_list` consistent; a second real writer connection blocked until production writer rollback under `BEGIN IMMEDIATE`. +- Actual operator `ProjectRuntimeService.updateTask(continuation:null)` with `user:maintainer` durably incremented the source task revision, followed by internal `reconcileAttempt → advanceContinuation → ThreadLaunchService → Orchestrator → EventSink`. +- Revoke-first: **0 new runs, 0 `provider-turn.start` effects, no accepted run-creation receipt**, typed `EventSinkCommitDenied`, attempt cancelled, **0 adapter open-session calls**. +- Launch-first: **1 run / 1 start effect**; same-attempt replay returns byte-identical receipts and effects, including after revocation. Ordinary-user control still executes normally with ordinary authority despite revoked continuation source, preserving isolation. +- Manager classification: **K1 `FULL-SERVER ASSEMBLY RUNTIME PASS` (worker-reported, independently rerun)**, not a production deployed/service-auth result. No independent browser copy of test logs. + +## K2 — natural asynchronous prepared-release/stop (PASS within reported scope) + +- Actual `ThreadLaunchService.schedulePreparation` was barrier-held at `prepared-run.release` while a real run was `preparing` and no start effect existed. Real operator revocation committed through Runtime, then release proceeded. +- After denial: run, orchestration attempt and Runtime attempt all **cancelled**; **0** start effects, **0** adapter calls; preparation tracker `finish(failed)` once and never `done`; no accepted `:launch:release` receipt; no retained worktree. +- Same-ID release/retry and fresh-ID release/retry after revocation denied without duplicating events; late `prepared-run.fail` idempotently no-ops or replays its receipt, with byte-identical durable events/effects/attempts. `reconcile_required` no longer downgraded by late run terminal status after a found defect was corrected. +- Async failure is **observed via durable terminal state**, not direct exception reaching `launch()` caller: `schedulePreparation` uses `Effect.ignoreCause`. The user-accepted contract requires truthful state, not synchronous propagation. +- Manager classification: **K2 `NATURAL ASYNC RELEASE RUNTIME PASS` (worker-reported, independently rerun)** under controlled local server-root conditions; not proof of externally atomic provider cancellation. + +## K3 — partial additional checks and remaining conditions + +- Correctness testing reported **5/5** full-root tests, independent reviewer **94/94** focused guard/runtime/launch/effect-worker tests, worker Runtime subtree **208** tests, server typecheck exit 0, changed-file **118** tests + lint/format/knip/GraphQL/typecheck exit 0. Reviewer independently reran root **5/5** and focused **94/94**. All claims are from worker handoff; exact raw logs retained privately. +- Review performed by **Codex GPT-6.1 SOL Medium on a second Codex subscription**, different provider from Sonnet implementation worker. Review verdict **PASS WITH FINDINGS**, no blocking defect within K1/K2. Not the same provider/model as the main implementer. +- Reviewer identified **pre-existing D2 MCP schema exposure** in experimental base: task create/update and returned task tool shapes still advertise `continuation` while runtime gate is off. **D2 remains a separate public release blocker**, not a K1/K2 failure. Main shipping fork currently excludes experimental continuation source. +- Nonblocking conservative `reconcile_required` preservation now applies to all reserved `cont:v1:` attempts, not just one revocation subtype; not ordinary attempts, no state downgrade. +- Tests require locally installed/authenticated Codex/Claude adapters although session openings are intercepted (no paid live provider turns), reducing **portable-stub coverage**. +- **Not established:** real process crash/SIGKILL/restart/pruning with full root, live provider external-turn race, multi-adapter real provider execution, wider repo/UI/hosted CI and production app; internal authorization/attempt JSON stripping beyond explicitly tested paths still needs evidence when shipping. D2 output/input schema release exclusion remains unmet. K3 is **PARTIAL** and must not be silently promoted to complete. +- External `startTurn` atomic cancellation was explicitly excluded by user-accepted D4 A+B semantics, so it is not reintroduced as a blocker for K1/K2. + +## Reparative work, routing and operational constraints + +- Worker reported a corrected late `prepared-run.fail` after cancellation (red-before assertion), real `reconcile_required` preservation under CAS, and test-only `noBrowser:true` option to avoid unintended browser tabs during the production-root test. +- The local D4 branch is now reported as **12 commits/15 files** with exact final head above; previous 3-commit status is HISTORICAL. No source has been pushed to GitHub. +- DeepSeek V4.1 Flash **orchestration only**. Codex A subscription had **5** implementation/test dispatches and is exhausted until **2026-11-08 21:15 UTC** (provider-reported); Claude Sonnet 5.5 had **4** dispatches and both Claude subscriptions rate-limited on review attempts; Fable 5.1 review attempts were denied by quota. Codex B subscription completed independent review (1 dispatch), quota available then but exact remaining allowance/reset **UNKNOWN**. No Opus, paid-provider call or live model turn. +- Preserve primary checkout, four detached Stage 2 worktrees, D4 local branch and restricted evidence ledgers. Worker reports no dirty/unrelated changes, no repo ref movement, no push/merge and private PR #21 evidence untouched. **No cleanup, unmount or evidence transfer is authorized.** + +## Manager outcome and next safe action + +**Accept K1/K2 scoped qualification**, retain K3 PARTIAL, D2 shipping exclusion OPEN and the D4 implementation as **ISOLATED / NOT INTEGRATED / NOT PRODUCTION VERIFIED**. No further local work is authorized within this completed verification task and no new T3 Code task is dispatched by the browser manager. + +**Next material user decision:** whether to authorize upstream catch-up and a *separate, later* fresh re-land of the isolated continuation/D4 code onto an integration branch based on merged fork main; never merge this divergent experimental D4 branch directly. The upstream drift changed again today; refresh refs and security hotspots before writing. The fork's current main excludes experimental continuation and remains the safe integrated baseline. Any future re-land needs a governing spec, one owned isolated writer, fresh tests/review, D2 shipping projection exclusion design and an explicit main merge/production decision. + +**No implied authority:** no public Git push/PR, fork main merge, production activation, material paid costs, new epoch/authority database, evidence publication or destructive cleanup. User explicitly chose to keep all PR #21 evidence PRIVATE. The manager may prepare browser-only product/integration decision materials, but the next large code-lane/write remains gated by owner approval. diff --git a/docs/orchestration-v2/manager-d4-isolated-implementation-return-review-20261105.md b/docs/orchestration-v2/manager-d4-isolated-implementation-return-review-20261105.md new file mode 100644 index 0000000000000..7a8f1e76dacdc --- /dev/null +++ b/docs/orchestration-v2/manager-d4-isolated-implementation-return-review-20261105.md @@ -0,0 +1,55 @@ +# Overall Manager — D4 isolated A+B implementation return reconciliation + +**Report received:** 2026-11-05 17:54Z through user-provided private worker handoff. +**Source-of-evidence distinction:** worker-reported private local implementation and test/reviewer logs; browser manager independently re-fetched public fork `main`, existing experiment and governing specs, **not** the local-only D4 branch, code, or restricted ledger. +**Status:** **`IMPLEMENTED (worker-reported) / STATIC PASS (worker-reported) / SCOPED RUNTIME PASS (worker-reported) / INDEPENDENT REVIEW PASS WITH FINDINGS (worker-recorded) / REQUIRED FULL-SERVER ASSEMBLY VERIFICATION NOT DEMONSTRATED / NOT INTEGRATED / NOT PRODUCTION VERIFIED`.** This is **not** overall contract acceptance, a source-code audit by the browser, or a release authorization. + +## Provenance / base and ownership + +- Fork `main` still at integrated PR #21 `fb67545d790c5c001e8f85827f219ab6493c435e` and experimental branch still at `b3b8da54e0b8b184a1cf4e667d53e73e04f85074`, independently checked through GitHub. +- Worker reports its local-only isolated D4 branch `d4/ab-revocation-guard-20261105` based on the experimental tip, with **three commits**, **13 files**, **+1430 / -44**, clean worktree and no push/remote tracking. Browser manager requested that branch from the public GitHub fork and received **NOT FOUND**, consistent with *not pushed*; it cannot inspect or verify those changes. +- Worker reports primary development-profiles checkout and four Stage 2 read-only worktrees preserved, no changes to fork main, experiment ref or upstream, no production activation. This local source still sits on a branch **34 commits ahead / 336 behind** fork main. It is **not** a safe integration base; future fresh re-land requires separate explicit authorization. + +## Worker-reported implementation + +**A — new-run commit guard:** narrow internal `Context.Reference` authority issued by `RuntimeTaskExecutionService` only for reserved continuation attempts; binds exact project/source/target revisions, attempt, thread, request key and kind. `EventSink.commitCommand` accepts optional generic `CommandCommitGuard` and evaluates it **inside the existing SQL commit transaction**, after duplicate command receipt resolution and before event append/outbox enqueue. `ContinuationCommitGuard.launchGuard` reads live source/target/attempt SQL rows under the transaction, requires exact revision and `continuation.mode = synthetic`; denial is typed `EventSinkCommitDenied`, transaction rolls back with no run, start effect or accepted-success command receipt. + +**B — prepared-run and effect protection:** `preparationGuard` covers `prepared-run.release` and `prepared-run.retry`, using durable attempt JSON provenance from deterministic Runtime message identity. On denial Orchestrator uses `dispatchPreparedRunFail` terminal compensation for run/attempt/node/preparation/error items, a distinct compensation command, and typed caller denial; replay re-denies. `cancellationGuard` marks cancelled only where no start effect is known and does not overwrite `reconcile_required`. `EffectWorker` checks guard before provider call, attempts safe stop/reconciliation on denial and does not call `startTurn` if guard denies. `server.ts` reportedly shares one memoized continuation gate between orchestration and Runtime. No contracts, MCP schema or migration changes and no new authority/epoch table. + +**Crucial approved semantics:** The initial continuation launch is `defer_start`: durable `preparing` run, no provider start effect until later `prepared-run.release`. A protects new-run commits and B protects definite pre-start release; neither promises atomic cancellation of an external provider call after an EffectWorker guard has passed. This follows the [user-accepted A+B contract](d4-accepted-revocation-contract-20261105.md) in design, subject to verification. + +## Verification and review as reported + +- Codex technical implementer: changed-file check **8 files/113 tests EXIT 0**, explicit acceptance suite **10 files/153 tests EXIT 0**, server typecheck **EXIT 0**. Intentional red baseline **EXIT 1** as expected (a run would be created without the new guard); regression mutation fails as expected when Runtime catch logic is removed. +- Independent read-only Claude Sonnet 5.5 reviewer: core implementation suite **45 tests EXIT 0**, targeted ThreadLaunch suite **4 passed, 45 filtered**. Reviewer **did not** replay 153-test or changed-file runs. Exact raw logs/private code not available to browser manager. +- Initial reviewer `REVIEW REQUIRED` with seven findings: incomplete terminal projection; release denial returned success; cancelled classification too broad; worker reconcile/stuck stop; uncertainty downgraded by cancellation guard; preparation guard fail-open; upstream cost concern. Writer repaired in two rounds; final reviewer **PASS WITH FINDINGS**, no blocking defect. All findings are *worker-recorded*, not new independent browser conclusions. +- DeepSeek V4.1 Flash orchestration only, Codex GPT-6.1 SOL Medium four dispatches (including preflight and two repairs), Claude Sonnet 5.5 Medium three review dispatches. No Opus/paid provider/failover; quotas and resets **UNKNOWN**. +- No repo-wide suite, executable HTTP/full-server root, live provider, two real adapters, UI/browser, SIGKILL/crash end-to-end or production verification. + +## Unclosed acceptance requirements and classification + +**1. Required full-server assembly — `VERIFICATION INCOMPLETE / REVIEW REQUIRED` (not shown to fail):** The [accepted D4 contract](d4-accepted-revocation-contract-20261105.md) explicitly requires the *actual* server root's `ProjectRuntimeService.updateTask(continuation:null)` operator revocation, `EventSink` transaction, `Orchestrator` receipt and shared SQLite path/connection ordering to be proven. Worker inspected `server.ts` and ran separate real-layer/process tests, **not a combined executable root assembly test**. It may be correct, but no general pass can be claimed from the separate results. + +**2. Natural async release-denial propagation — `VERIFICATION INCOMPLETE`:** `ThreadLaunchService.schedulePreparation` forks and ignores cause; compensating writes terminal `cancelled` attempt and tracker failure. Worker did **not** observe the full natural scheduled-preparation lifecycle from real revocation to typed error/terminal projections. Need one bounded deterministic integration test where feasible. + +**3. Real operator policy removal at launch/release layer — `VERIFICATION INCOMPLETE`:** Real `continuation:null` tested at guard level but launch/retry used missing source-row fixture, not a complete operator-revoke sequence. Add accepted-revoke-late-start path in combined test. + +**4. Cancelled `prepared-run.fail` no-op and recovery — `VERIFICATION INCOMPLETE`:** traced in code but not asserted in a test. Consider as narrowly scoped assertion in same task. SIGKILL and full provider live calls remain separately scoped and not necessary to falsely label release verified. + +**5. Internal stored authority data — `REVIEW RISK`:** hidden `$.continuationAuthorization` in attempt JSON; public read/list stripping was asserted. Need confirm no other JSON/DB/RPC/telemetry/MCP surface leaks authorization, and that a client cannot forge it. Lack of browser access to local source prevents independent confirmation. + +**6. Empty thread on denied initial launch — `KNOWN RESIDUAL`:** permitted only if no durable run/start effect and recovery remains truthful; decide cleanup separately, not a reason for destructive changes. + +Do not weaken accepted A/B semantics or quietly remove the full-assembly check to gain a pass. These are **verification gaps**, not evidence of a demonstrated implementation defect. Do not demand a second entire full review unless new test findings materially change code. + +## Decision / next safe work + +**Overall Manager disposition:** accept the worker-reported `IMPLEMENTED` milestone on its **isolated local branch** and the narrowly reported `STATIC PASS / SCOPED RUNTIME PASS / REVIEW PASS WITH FINDINGS`; **withhold overall D4 acceptance and any integration authorization** pending the real combined assembly/revocation evidence. This is routine closure of an already-accepted task acceptance requirement, **not** a new product choice and not permission to alter main. + +[Bounded full-assembly verification and minimal corrective tests](task-d4-full-server-assembly-verification-20261105.md) is the **one next authorized local task**, prepared for DeepSeek orchestration-only, Codex or Sonnet implementation/test execution, independent different-provider read-only review if touched. Must use existing isolated branch/worktree with verified ownership and preserve three existing implementation commits; no Git push/merge/upstream catch-up, no D2 schema changes, no paid providers, no PR #21 evidence access and no destructive worktree cleanup. If full server root cannot be instantiated without paid credentials, classify precise `OPERATIONAL BLOCKER` and propose faithful safe harness; do not invent a PASS. + +After it returns, manager re-evaluates with source/test/reviewer evidence. If accepted, **separate owner authorization** is required for the much larger re-land of continuation onto merged fork main, which is still divergent from this experimental base. No production or release approval is implied. + +## Superseding result 2026-11-05 21:43Z + +**This document's earlier full-server verification gap has since been CLOSED within K1/K2 isolated scope.** [New manager K1/K2 reconciliation](manager-d4-full-root-k1-k2-verification-reconciliation-20261105.md) records real exported `layerMakeServer` production-root, same SQLite transaction, true operator `continuation:null` and natural async `schedulePreparation` verification. K1 and K2 **RUNTIME PASS (worker-reported, independently re-run)**; K3 additional crash/restart/pruning and provider-portability **PARTIAL**. Local branch NOT INTEGRATED, production NOT VERIFIED. The recommended verification task is now **COMPLETED**, not pending. Preserve earlier report as historical context only; do not redispatch. diff --git a/docs/orchestration-v2/manager-evidence-v0-p2-promotion-review-20261104.md b/docs/orchestration-v2/manager-evidence-v0-p2-promotion-review-20261104.md new file mode 100644 index 0000000000000..aa38ed1098009 --- /dev/null +++ b/docs/orchestration-v2/manager-evidence-v0-p2-promotion-review-20261104.md @@ -0,0 +1,64 @@ +# Manager promotion review — Evidence V0 P2 pruning repair + +**Date:** 2026-11-04 +**Classification:** Overall Manager independent GitHub/source review, not a local test execution or merge. +**Verdict:** **BOUNDED SOURCE REVIEW PASS / WORKER-REPORTED LOCAL TEST PASS / INDEPENDENT REVIEW RECORDED PASS — READY FOR SEPARATE PROMOTION DECISION WITH EXPLICIT V0 DECODER COMPATIBILITY LIMITATION**. +**PR #21:** draft, open, unmerged, base and head unchanged at manager inspection. **NOT INTEGRATED / NOT PRODUCTION VERIFIED**. + +## Evidence and exact scope + +- Fork repo: `jermur788/t3code`. +- Existing PR #21 source branch: `integration/fork-upstream-reconciliation-trial-20261104`, head `70203ed5a95dbe1762da1ad2a46c4f153f910492`. +- Isolated repair branch: `fix/evidence-v0-pruning-completeness-p2-20261104`. Reviewed production/test checkpoint `a03a8bce92ea2de65a92a112bf9771388673094b`; final docs-only handoff checkpoint `0e0c7bc2cb1bb805f273123686303a68e1c2807c`. +- GitHub comparison: repair is a linear five-commit descendant, **zero commits behind** the PR source; **exactly three source/test files** and two task evidence documents changed. No fork-main or PR #21 source changes were present. +- [Worker final handoff](https://github.com/jermur788/t3code/blob/fix/evidence-v0-pruning-completeness-p2-20261104/docs/orchestration-v2/evidence-v0-p2-repair-handoff-20261104.md) and [append-only routing ledger](https://github.com/jermur788/t3code/blob/fix/evidence-v0-pruning-completeness-p2-20261104/docs/orchestration-v2/evidence-v0-p2-repair-routing-ledger-20261104.md) inspected. The manager did **not** access worker-host raw logs or rerun local tests; provider/capacity and command results below are evidenced by committed worker ledger and test source, not independent host execution. + +## Independent source inspection + +1. `OrchestrationEvidenceService.ts`: existing `EVENT_LOG_PRUNED_THROUGH` watermark is read from canonical projection metadata inside the existing read-only export path; referenced thread event reads remain bounded. A thread with an oldest retained event **strictly below** the watermark gains one `orchestration-v2-pruned` derived-view event with `status=incomplete`, `completeness=unknown`, `reason=pruned-history-boundary`, watermark and oldest-retained-sequence facts. Marker summary remains bounded; stable ID uses SHA-256 digest of full thread ID; identity remains in `recordId`, `threadId` and reference. There is no claim of exact loss or fabricated V2 events. +2. Existing `orchestration-v2-unresolved` and per-thread `orchestration-v2-truncation` markers are preserved. New marker is conservative because the watermark is global and cannot prove deletion of a particular thread's events. +3. `OrchestrationEvidenceService.test.ts`: real `ProjectionMaintenanceV2` and SQLite fixture writes six V2 events, advances actual prune boundary, verifies deletion/retention, observes exactly one referenced incomplete marker, and excludes a newer thread. File-backed SQLite test reopens the database and checks post-boundary second-project isolation. Long 4,096-character identifier scenario checks bounded marker ID/summary, JSONL schema decode, reconstruction event schema decode and stable repeated output. No existing tests were weakened in reviewed diff. +4. `packages/contracts/src/orchestrationEvidence.ts`: only a new closed-enum literal and an explicit decoder-upgrade warning were added. No migration, upstream V2 engine/pruning change, source-route change or synthetic continuation policy landed. +5. Server wiring: production `server.ts` already provides NodeCrypto platform services to its runtime dependency tree, and `ProjectRuntimeRpc.test.ts` builds the evidence layer with NodeCrypto. The newly required Digest service is also supplied explicitly in focused test layers. This supports wiring confidence **at source/typecheck level**, not a fresh live server startup claim. + +## Reported local verification / review + +- Red→green actual-pruning regression: missing marker reproduced then corrected; additional red→green guards for overlong summaries and overlong marker IDs. +- Focused Evidence V0 + Projection Maintenance: **39/39 PASS**; with context budget: **40/40 PASS**. +- Typecheck: **40/40 packages PASS** after final test-only change. +- `check:changed upstream/main`: **81 test files / 2,075 tests PASS**, format/lint/knip/GraphQL/typecheck/React compiler passed; broad run preceded last *test-only* schema-decode assertion, followed by focused 39-test and typecheck rerun. +- Agent context budget: **7,496 / 9,224 / 58,519 bytes**, unchanged. Web build PASS (reported). +- Four independent read-only Codex review rounds are recorded: `CHANGES REQUIRED` for summary bound, `CHANGES REQUIRED` for marker-ID bound, `PASS WITH FINDINGS` for reconstruction-schema assertion coverage, then **PASS** after correction. Separate reviewer provider/model from implementer. +- No hosted CI/checks, live-provider execution, rendered UI or production test of the repaired branch. Prior pre-repair PR #21 UI/restart qualification remains valid in its measured scope; it is **not** a fresh production qualification of the changed branch. +- Historical routing: DeepSeek V4.1 Flash both orchestrated and implemented this already-dispatched task, and Codex reviewed. The user's later **prospective** DeepSeek orchestration-only directive has been adopted into the [Coordination/Handoff Protocol](../../02_COORDINATION_HANDOFF_PROTOCOL.md) and the [standard handoff template](DEEPSEEK_ORCHESTRATOR_HANDOFF_TEMPLATE_V1.md) for future tasks; do not misrepresent the historical route as following that newer policy. + +## Compatibility decision required for promotion + +**Known limitation:** the `orchestration-evidence/v0` envelope retains its version string but its **closed record-type enum** gains `orchestration-v2-pruned`. Clients using the old base-commit decoder **reject exports containing that record**. This is **not universally backward-decodable**. + +The repaired code and its tests are accepted for bounded source correctness **with that limitation explicitly recorded**. Under a fork-only coordinated application/decoder upgrade, promoting the repair as-is is a reasonable technical choice; it is **not** permission to claim compatibility with unchanged external consumers, nor a user-approved public compatibility contract. If independent old V0 decoders must continue to work, commission a separate versioning/negotiation design before promotion. + +Other bounded risks: conservative false-positive incompleteness for threads older than the global watermark; reliance on upstream keeping creation events and stream heads; absence of hosted CI/live provider production evidence. + +## Manager decision and next action + +1. **Manager disposition:** `SOURCE REVIEW PASS / P2 REPAIR ACCEPTED FOR PROMOTION CONSIDERATION`. Correctness and regression scope are acceptable for a fork-only candidate. No new implementation task is needed unless backward-decoder compatibility is required. +2. **Authority boundary:** the local worker did **not** have permission to update PR #21; the Overall Manager likewise will **not** advance the PR head or merge without the user's separate authorization. The repair branch is preserved intact. +3. **Next product/coordination choice:** request **one explicit authorization to advance PR #21's draft source branch to the reviewed repair branch** with the documented old-decoder upgrade requirement. This is **not merge approval**. On approval, re-fetch exact heads/ownership, perform a guarded non-rewriting fast-forward from source to accepted repair checkpoint, confirm no drift/unrelated changes and update PR status/ledger. If the user does not accept the decoder compatibility limitation, defer promotion and prepare a separate versioned-contract design for decision. +4. **Later, separate gate:** only after PR #21 contains accepted repair and current checks/provenance are reconciled should the manager request user approval for a fork-only merge. Production release gates D2/D4 remain separate and unmet. + +**No main update, PR #21 source update, merge, release, or production continuation activation was performed by this review.** + +## Promotion outcome — recorded after user acceptance at 11:44Z + +The user **selected Option A**, accepting coordinated reader upgrades for the closed-enum Evidence V0 pruning marker and authorizing **source-branch promotion only**. The Overall Manager verified PR #21 remained open/draft/unmerged with its expected unchanged source head, that the repair was a fast-forward descendant with exactly the reviewed source/test changes and durable handoff/ledger, and that fork `main` was unchanged. A GitHub `update_ref` with `force=false` and `expected_sha` succeeded on the **existing PR source branch**. A subsequent independent GitHub PR and branch read confirmed the new source head `0e0c7bc2cb1bb805f273123686303a68e1c2807c`, fork main unchanged, PR **OPEN/DRAFT/UNMERGED** and GitHub REST `mergeable=true`, `mergeable_state=clean`. No hosted checks, no source rebase or history rewrite, no PR merge, no production activation. + +**State now: `PROMOTED TO DRAFT PR #21`; not `INTEGRATED` into fork main.** The old-decoder limitation has been expressly accepted for this fork-only source promotion, but does not establish general public schema backward compatibility. The remaining authority gate is a **separate user decision about merging PR #21 to fork main**. Earlier sections describe the pre-promotion review snapshot, not current unpromoted status. + +## Fork-main integration outcome — user approval and GitHub verification, 12:33Z + +On 2026-11-04 at 12:31Z the user explicitly approved merging PR #21 into fork `main` as the accepted **development baseline**. The Overall Manager re-read live PR #21, checked head/base and mergeable/clean status, checked zero hosted checks, and confirmed that the PR head was the previously reviewed P2 promotion checkpoint with no new target commits. The PR description was reconciled with completed V1/V2/P2 verification and current limitations; it was marked ready for review. GitHub's `merge_pull_request` was invoked with **merge_method=merge** and **expected_head_sha** set to the reviewed candidate; the operation reported **merged=true**. + +Independent post-merge REST queries verified the PR **CLOSED/MERGED** (2026-11-04 12:33:37Z) and fork `main` at normal merge commit `fb67545d790c5c001e8f85827f219ab6493c435e`. The commit has two parents: previous fork main `d3bedef12a31f368e5c5a6b279445bea39a6a13a` and reviewed PR head `0e0c7bc2cb1bb805f273123686303a68e1c2807c`. Main's Evidence service contains the canonical pruning metadata read and the `orchestration-v2-pruned` marker. The hosted check-run count is zero. **Result: `INTEGRATED` into fork main; still `NOT PRODUCTION VERIFIED`, and no fresh post-merge local runtime/UI qualification is claimed.** + +The fork-only old-decoder coordinated-upgrade limitation remains accepted. PR #20 and the default-off experimental continuation gate remain separate; D2/D4 public-release gates remain unmet. The next bounded action is the **prepared, not dispatched** [DeepSeek-only post-merge smoke verification handoff](handoff-deepseek-postmerge-pr21-verification-20261104.md); use Codex GPT-6.1 SOL Medium or Claude Sonnet 5.5 Medium for all development/test work, as required by the new user routing policy. Do not remerge PR #21 or write to fork main without a separate user decision. diff --git a/docs/orchestration-v2/manager-fork-upstream-reconciliation-acceptance-20261104.md b/docs/orchestration-v2/manager-fork-upstream-reconciliation-acceptance-20261104.md new file mode 100644 index 0000000000000..f0a915caa13a4 --- /dev/null +++ b/docs/orchestration-v2/manager-fork-upstream-reconciliation-acceptance-20261104.md @@ -0,0 +1,64 @@ +> **CURRENT STATUS NOTE — PR #21 OPEN / DRAFT / UNMERGED:** After this original acceptance record, the user approved opening a fork-only draft PR, and [PR #21](https://github.com/jermur788/t3code/pull/21) was created. The original “PR creation needs approval” language below is **historical**. **Merge approval remains outstanding.** For current authority and next task, read [Current State](../../01_CURRENT_STATE.md) and [Overall Manager Handoff](../../OVERALL_MANAGER_HANDOFF.md). + +# Manager acceptance — fork/upstream v0.1.7 reconciliation trial + +**Date:** 2026-11-04 (Europe/Dublin), review at user handoff ~08:17. +**Overall Manager verdict:** **REVIEW PASS (bounded conflict-resolution review); CANDIDATE ACCEPTED FOR NEXT INTEGRATION GATE; NOT INTEGRATED; NOT PRODUCTION VERIFIED.** +**Authority:** manager accepts the isolated reconciliation result for continuation of authorized validation, NOT permission to update fork main, open a new PR, ship, or enable synthetic continuation. Those remain separate actions. +**Current candidate:** [fork/upstream reconciliation branch](https://github.com/jermur788/t3code/tree/integration/fork-upstream-reconciliation-trial-20261104) at the reported pushed checkpoint. +**Independent worker evidence:** [routing, conflict, verification, and read-only review ledger](https://github.com/jermur788/t3code/blob/integration/fork-upstream-reconciliation-trial-20261104/docs/orchestration-v2/fork-upstream-reconciliation-routing-ledger-20261104.md). +**Prior authority:** [fork/upstream task](task-fork-upstream-reconciliation-20261104.md); [approved staged safety spec](continuation-staged-safety-governing-spec-20261104.md). + +## What manager independently checked through GitHub + +- Branch exists at user-reported head; last commit is the ledger. The preceding commit is a **true merge commit with two parents**: fork-derived prepared branch (itself descending from fork main) and upstream v0.1.7; no history rewrite. GitHub compare confirms branch **ahead of fork main, zero commits behind**, with fork main exactly unchanged. The compare counts include upstream's history; they are not a count of manually resolved conflict files. +- Source-inspected `apps/server/src/mcp/OrchestratorMcpService.ts` around `capabilities()`: it uses upstream `resolveProjectProviderInstanceEnabled(settings, parent.thread.projectId, provider.instanceId)` and fork `providerEligibilityIssues` + `providerConstraintMessages`, preserving caller-project restrictions in the exposed capability reasons. +- Source-inspected `packages/shared/src/usageLimits.ts`: the fork-owned `resolveProviderInstanceCapacity` still exists, `hubAccountName` is in the code, and the merged bound display name falls back to account/email-derived behavior as described. Full resolver behavior is supported by local 71-test result, not independently executed in browser. +- Inspected `runtimeLayer.test.ts`, `linkOrigin.test.ts` and `PeerForwarding.test.ts` presence of NodeCrypto, retained fork test helpers and upstream in-process MCP layers. +- Confirmed agent-context budget snapshot still reads `7496 / 9224 / 58519`; the worker's locally executed AgentContextBudget test supports a matching measured snapshot on the reconciled tree. +- Queried `RuntimeTaskContinuationGate.ts` and `RuntimeTaskContinuationPolicy.ts` on the reconciliation branch: **absent**. This is expected: the branch does not include the separate experimental gate/synthetic continuation policy. There is no permission to merge the gate. +- Read worker ledger and exact command outputs recorded there. Repo test claim: `vp build` web 7430 modules, `vp run typecheck` 40 packages, `vp run check:changed upstream/main` 81 files / 2072 tests, various focused suites and context budget, all final exit 0. Earlier Playwright/format failure was repaired before final rerun. This is worker-recorded **local RUNTIME PASS / STATIC PASS**, not independently run by this manager. +- Read actual independent Codex reviewer routing and returned verdict from persisted worker ledger: **CLEAN**, no reported findings. Independent reviewer did not run tests and did not review all upstream history. This supports **REVIEW PASS for the seven resolved conflict scopes**, not complete end-to-end sign-off. +- Queried GitHub commit statuses, check-runs and workflow runs at the branch head: **zero hosted checks/runs returned**. Thus **GitHub CI PASS is not claimed**. The commit status API's generic `pending` state was accompanied by an empty status array; it is not a failed or successful CI run. +- Current upstream main was **one additional commit ahead** of the explicitly pinned v0.1.7 merge baseline at inspection, affecting VCS and review/diff/UI code; this does not invalidate the frozen v0.1.7 trial but means it is **not current upstream main**. Do not claim latest-main sync. + +## Accepted details of trial + +The historically predicted eighth conflict did not reproduce at the pinned upstream source. Seven conflicts were resolved on the isolated branch with source-preserving merge choices: +1. `OrchestratorMcpService.ts`: project-scoped provider enablement plus fork eligibility reasons. +2. `linkOrigin.test.ts`: fork Runtime mocks plus upstream in-process MCP server layer. +3. `PeerForwarding.test.ts`: same two-sided layer union. +4. `GrokAdapterV2.test.ts`: fork and upstream imports both retained. +5. `runtimeLayer.test.ts`: upstream expanded test, crypto and thread uniqueness plus fork test helpers. +6. `routeTree.gen.ts`: regenerated, includes both fork home and upstream thread routes. +7. `usageLimits.ts`: capacity resolver and hub-account display naming preserved. + +The Effect 4.1.2 compatibility repairs and Evidence V0 EventStoreV2 import are documented and supported by typecheck/test passes. No fresh main branch write, no production feature enablement, no public upstream contribution. + +## What acceptance does NOT cover + +1. **UI VERIFICATION REQUIRED:** generated route composition builds but has not been inspected in a rendered app. Under project policy, build PASS is not equivalent to UI runtime VERIFIED. +2. **RUNTIME VERIFICATION REQUIRED:** cross-project isolation, restart recovery under updated upstream Orchestrator/EffectWorker, and Evidence V0 export following event-history pruning are not proven by the reported focused suites. +3. **HOSTED CI NOT RUN:** no branch-level GitHub Actions/status checks were found. Local checks provide bounded confidence only. Pre-commit hook was skipped on a large merge index, with compensating local gate runs; this is documented, not waived. +4. **DIFF BASE CONFIDENCE:** `check:changed upstream/main` tested the fork-specific delta against the pinned upstream merge base, not the entire 327-commit upstream update as if each commit were newly written. High confidence requires targeted regression suite coverage and/or full host CI after PR. +5. **RELEASE GATES UNCHANGED:** D2 experimental agent-facing exclusion and D4 strict production revocation must be satisfied before any production continuation; fork/upstream reconciliation alone does not implement these. +6. **No direct repository disk check:** previously reported root capacity recovered to 48 GB free and external volume 92 GB free, but browser manager cannot verify `df` remotely. A local worker should confirm before heavier tests. + +## Decision and recommended sequence + +**Decision A — Manager accepted** the isolated reconciled trial as a **candidate baseline** for eventual fork-main integration. Source-level conflict resolution **REVIEW PASS**, local test/verification **RUNTIME PASS**, but **INTEGRATION/PUBLIC RELEASE still NOT VERIFIED**. The candidate branch is frozen at its accepted checkpoint until a fresh change requires delta review. + +**Decision B — User approval required:** choose **draft fork-only PR to main** (recommended) rather than direct fast-forward because the change contains extensive upstream history, meaningful provider/orchestration internals, no hosted CI and unverified rendered UI and recovery semantics. The PR provides a durable review surface and makes hosted checks available where configured; it does **not** automatically merge or deploy. Do not create PR until user explicitly authorizes. Direct fast-forward should not be done without explicit authority and final required verification. + +**Meanwhile authorized:** read-only manager review and a bounded *local verification-only* task (without code edits or merge) for rendered UI route composition, restart/recovery/cross-project isolation and Evidence V0 export on the candidate branch. If a defect appears, open a separate isolated one-writer repair lane and update the accepted trial only after rerunning affected checks and independent review. No real/paid provider calls. + +**Next exact action:** user approves draft PR or direct main update after manager presents tradeoffs; for recommended draft PR, browser manager can open it with connected GitHub when explicitly authorized, keep draft and unmerged, verify branch/CI status and use a local verification handoff for the missing runtime/UI cases. If user declines PR, preserve the accepted branch and run tests in isolation. + +## Status + +- IMPLEMENTED — seven conflict resolutions + compatibility repairs, on isolated branch. +- STATIC PASS / RUNTIME PASS — local worker tests and build, documented, not independently re-executed in browser. +- REVIEW PASS — independent Codex conflict review and manager source spot check; limited scope. +- INTEGRATED — **NO**; fork main untouched. +- VERIFIED — **NO** as production UI/restart/provider acceptance. +- PRODUCT DECISION — fork-main promotion method (draft PR vs explicitly authorized direct update); D4 detailed launch boundary remains separately unresolved; D2 not yet implemented. diff --git a/docs/orchestration-v2/manager-gate-branch-review-20261104.md b/docs/orchestration-v2/manager-gate-branch-review-20261104.md new file mode 100644 index 0000000000000..918e732fe2aed --- /dev/null +++ b/docs/orchestration-v2/manager-gate-branch-review-20261104.md @@ -0,0 +1,59 @@ +# Independent manager source review — default-off continuation gate + +**Date:** 2026-11-04, after the local gate handoff (~06:39 Europe/Dublin). +**Source of truth:** exact pushed [isolated gate branch](https://github.com/jermur788/t3code/tree/experiment/continuation-default-off-gate-20261104), [T3 local routing ledger](https://github.com/jermur788/t3code/blob/experiment/continuation-default-off-gate-20261104/docs/orchestration-v2/staged-continuation-routing-ledger-20261104.md), [T3 trial](https://github.com/jermur788/t3code/blob/experiment/continuation-default-off-gate-20261104/docs/orchestration-v2/staged-continuation-t3-upstream-trial-20261104.md), [T4 design](https://github.com/jermur788/t3code/blob/experiment/continuation-default-off-gate-20261104/docs/orchestration-v2/staged-continuation-t4-strict-revocation-and-shipping-20261104.md). +**Governing decisions:** [accepted staged safety spec](continuation-staged-safety-governing-spec-20261104.md). +**Verdict:** **MANAGER SOURCE REVIEW PASS for D1 isolated default-off gate**, **local RUNTIME PASS and independent model REVIEW PASS supported by worker evidence**, **NOT INTEGRATED / NOT PRODUCTION ENABLED / NOT VERIFIED for public shipping**. + +## Actual source inspected + +GitHub branch head matched the worker handoff. Fork main remains unchanged. The browser manager fetched the gate implementation commit's complete changed-file list and reviewed production changes and new gate test names/portions in published source: + +1. New `RuntimeTaskContinuationGate` Effect context service: a single `enabled` capability; `layerFromEnvironment` is lazy at layer build, and **only exact** `T3CODE_EXPERIMENTAL_CONTINUATION=1` enables it. No task/MCP/RPC parameter writes this service. Missing/invalid values fail closed. +2. `ProjectRuntimeService.createTask/updateTask`: non-null continuation creation/mutation is rejected while off with `continuation_disabled`; explicit removal or unrelated edits are permitted. Existing operator-only actor validation remains for on mode. A new contract enum literal is additive; old client error decoder compatibility is not established (documented). +3. `RuntimeTaskExecutionService`: disabled capability prevents `advanceContinuation`, `dispatchContinuation`, internally authorized `runExecute`, and `launchAttempt` of saved continuation receipts. Pending receipt with **definitely absent** thread is cancelled; *present or unreadable* thread is `reconcile_required`, preserving uncertainty and receipt history. Non-continuation execution still runs its normal path. +4. `server.ts`: shared gate capability wired into the Project Runtime/Runtime Task Execution service graph once from server environment. +5. `RuntimeTaskContinuationGate.test.ts`: test cases cover default-off env, task creation/update and removal, inert startup scan, pending review restart and ambiguous thread, pending repair restart, public-execute replay and gate-on revoked unreadable-thread case. Prior continuation tests deliberately inject `ContinuationGate.layer(true)` and unrelated layers explicitly inject `false`. + +**Assessment:** D1's concrete acceptance criteria are implemented in the inspected source. The gate is not the D2 public-shipping exclusion and it cannot close the D4 revocation gap by itself. No independent browser test commands or real provider/GUI check were run. + +## Verification and external review record + +T3 local worker records, not independently reproduced by the browser manager: +- T1 final: `vp test run apps/server/src/projectRuntime` 13 files, 192/192 tests, exit 0; `vp run typecheck` 39/39 packages, exit 0; `vp run check:changed` exit 0 with format, lint, knip, GraphQL, typecheck and 14 test files. Dedicated AgentContextBudget test passes on clean gate tree. +- T2: independent `claudeAgent` / Claude Opus 5.5, high-effort review returned **ACCEPT WITH FIXES**. Writer added 3 scenarios, made the environment layer lazy, renamed helper and resolved documentation concerns. Independent delta re-review **ACCEPT**; same reviewer did not write code. +- T5: Claude review call returned **API RATE LIMIT** and **no review evidence**. Coordinator routed to independent `codex` / GPT-6.1 Sol at high effort; reviewer returned **ACCEPT FOR EXPERIMENTAL PUSH** and ran gate tests 10/10. The routing ledger recorded the failed route, actual model, rejected choices and final outcomes; there was no successful paid external provider evaluation in this test suite. +- All source/test changes and docs were fast-forward pushed to the isolated branch; no PR or merge. + +**Status precision:** IMPLEMENTED / worker-local RUNTIME PASS / independent worker-review REVIEW PASS / independent manager source REVIEW PASS for D1 only. This does **not** mean integrated VERIFIED, strict revocation guaranteed, public-shipping budget accepted or UI/provider exercised. + +## T3 upstream reconciliation: not yet an integration failure in the gate + +Isolated worker trial against its fetched upstream main produced **8 conflicts in pre-existing fork divergence**, no continuation-file textual conflicts. Trial was aborted and unmerged; `usageLimits.ts` conflict markers prevented testing on the combined tree. This is **INTEGRATION CONFLICT / UPSTREAM COMPATIBILITY**, not evidence that the D1 gate failed. The historical report cannot substitute for a fresh trial. + +**Fresh browser delta check:** current upstream main advanced **10 additional commits** after the worker's trial base (as of this manager's GitHub fetch), including changes in `Orchestrator.ts`, `ThreadManagementService.ts`, `OpenCode2AdapterV2.test.ts`, `runtimeLayer.test.ts`, and other provider/adapter code. Therefore upstream behavioral requalification is material even if the eight textual conflict filenames remain constant. Refetch before local integration trial. The new isolated reconciliation branch is based on **fork main**, deliberately excludes the gate experiment until the fork/upstream base itself is reconciled. + +## Accepted decisions and unresolved release gates + +- **D1 — ACCEPTED AND IMPLEMENTED for isolated development:** default-off server gate. **No activation or merge authorized.** +- **D2 — ACCEPTED AS RELEASE REQUIREMENT, NOT IMPLEMENTED:** public shipping build must exclude experimental continuation and agent-facing schema bytes. Current recommendation is to keep the experiment on a separate branch; if shipping source ever includes it, implement a compile/build-schema exclusion and verify built `tools/list`, not merely source configuration. +- **D3 — ACCEPTED FOR STUB EXPERIMENTS:** best-effort recheck/reconciliation only. The characterization test confirms a post-withdrawal turn may still start in the final-check/external-call window. +- **D4 — ACCEPTED RELEASE REQUIREMENT, DESIGN PENDING:** no new continuation run after durably committed withdrawal. The T4 memo proposes atomic `run.created` guard (existing Project Runtime source revision) as a primary linearization point and an optional provider-turn-start check. This would touch upstream-owned command/effect infrastructure and requires an explicit design boundary before code. **No user approval to add a new epoch/authority table or change the upstream engine is presumed.** +- **Additional qualification:** cross-project isolation, simultaneous insert, real-provider and UI/operator notification, old-client error decoding, historical malformed receipts and actual reconciled-tree tool budget remain incomplete. + +## Operational blocker / repo safety + +Local worker reported root filesystem at 100% with about 231 MB free. Browser manager has no access to confirm current free space. New local trial/build work should use existing large `/media/jer/Files` volume and first inspect `df -h`, actual project/temporary/cache locations and working-tree ownership. **Do not clean caches or old worktrees without an explicit safe inventory and authorization.** If even temporary files or package stores cannot be placed safely, classify `OPERATIONAL BLOCKER`. No reset/stash/force-push/discard, no main rewrite. + +## Manager authorization and next tasks + +**AUTHORIZED (bounded, isolated):** create/own a new fork-main/upstream reconciliation trial branch and worktree, reproduce and resolve routine conflicts one by one, run tests on reconciled trial tree, perform independent code/security review, and preserve a durable handoff. **No merge to main or public upstream PR**, no production enablement. Stop on unresolved change to provider/V2 semantics or nontrivial policy/architecture tradeoff. Branch [integration/fork-upstream-reconciliation-trial-20261104](https://github.com/jermur788/t3code/tree/integration/fork-upstream-reconciliation-trial-20261104) was created by browser manager from fork main and is initially code-untouched. + +**RESEARCH ONLY:** strict D4 launch linearization and new authority-state feasibility. No upstream engine modifications until governing spec/architecture review is accepted. D2 public exclusion is not a gate to this isolated reconciliation task. + +**Task packet:** [bounded upstream reconciliation and security verification](task-fork-upstream-reconciliation-20261104.md). +**Routing:** DeepSeek for initial conflict archaeology/testing, Codex/Claude-class for semantic conflict repair and independent review; record actual route/attempts/wake and failure evidence in Runtime or a branch-local ledger. Two genuinely different attempts per routine defect before stronger escalation; max four unless new evidence. + +## Next + +Start the bounded local reconciliation task in an isolated **external-volume** worktree; continue read-only D4 design work. Return classified blockers rather than improvising upstream core changes. Reconcile the resulting branch against this review and accepted spec; main integration stays unauthorized pending verified combined tree and separate user approval. diff --git a/docs/orchestration-v2/manager-overnight-urh-final-reconciliation-20261106.md b/docs/orchestration-v2/manager-overnight-urh-final-reconciliation-20261106.md new file mode 100644 index 0000000000000..f583dfd6c45e0 --- /dev/null +++ b/docs/orchestration-v2/manager-overnight-urh-final-reconciliation-20261106.md @@ -0,0 +1,53 @@ +# Overall Manager reconciliation — final gated U/R/H overnight return + +**Received:** 2026-11-06 11:47 Europe/Dublin, user-supplied *Overnight U/R/H — final handoff*. +**Controlling authority:** [Overnight conditional-autonomy amendment](overnight-conditional-autonomy-amendment-20261106.md), [accepted D4 A+B](d4-accepted-revocation-contract-20261105.md), [Coordination/Handoff Protocol](../../02_COORDINATION_HANDOFF_PROTOCOL.md), [Current State](../../01_CURRENT_STATE.md). +**Manager disposition:** **`U G-U FINAL PASS (worker-reported; documented monolithic timeout equivalence)` / `R G-R FINAL PASS (worker-reported; Codex cross-provider reviewer reran tests)` / `H ISOLATED INTEGRATION-READINESS CANDIDATE / STATIC + SCOPED RUNTIME PASS (worker-reported) / REVIEW PASS (different-provider reviewer reran focused tests)` / `D2 SOURCE-LOADED AGENT SCHEMA PASS, PACKAGED SHIPPING NOT VERIFIED` / `K3 DISPOSABLE PROCESS/RESTART/PRUNING PASS, LIVE-PROVIDER ATOMIC START NOT VERIFIED` / `NOT INTEGRATED` / `NOT PRODUCTION VERIFIED`.** +**State transition:** Overnight U/R/H sequence **COMPLETED and STOPPED after H** per owner-approved stopping point. The earlier R cross-provider review gate/H-not-started verdict is **SUPERSEDED** by this final handoff. No fourth stage or new technical dispatch authorized under this finished overnight packet. + +## Sources and evidence confidence + +- This manager has the **user-provided authoritative worker handoff**, not direct programmatic access to the local worktrees, test logs, actual executed commands, SQLite files, or the private 461-line routing ledger. Results below are accurately described as **worker-reported**; reviewer re-runs are independently performed *per worker's record*, not by this browser. +- Browser GitHub ref checks on 2026-11-06 confirm fork `jermur788/t3code` `main` remains `fb67545d790c5c001e8f85827f219ab6493c435e`, and U `trial/upstream-catchup-20261105`, R `stage-r/continuation-d4-20261106` and H `stage-h/d2-k3-20261106` are **not present as remote branches**. This is consistent with the returned local-only reports, not proof of local HEADs or clean worktree status. Original experimental continuation remote branch unchanged. The remote planning branch exists; worker reports its previously missing 2026-11-06 files were later fetched read-only, correcting stale local-ref lookup. +- Actual local-only branches reported clean and preserved: **U** `/home/jer/dev/upstream-catchup-trial-20261105` `c037460c2f4a98e8c8f849928c92af6cb80e3d80`; **R** `/home/jer/dev/stage-r-continuation-d4-20261106` `90f2f2d254b901a7b424474c615ac6dc69f945ec`; **H** `/home/jer/dev/stage-h-d2-k3-20261106` `6550e1ca09` (short ref as provided; do not guess full hash). H one local commit, **9 files, +1079/−410**, compared with R. All not pushed, no PR/main merge/release/production. Existing primary, 4 detached Stage 2 worktrees, D4 local branch, U/R and private PR #21 evidence protected. + +## U — accepted upstream-frozen candidate + +- Exact selected upstream was deliberately frozen at `25b53299b75d4d8d1d0667ad47e9cfed3749776e` for this U run (91 upstream commits incorporated relative to previous parent), not automatically advanced to latest moving upstream. Later upstream updates require separate revalidation before any future main merge. +- **367/367 affected test files** run in 29 manifest-checked batches: **8022 passing tests**, **0 failures**, **4 known OS/Nushell skips**; **65** supplemental Project Runtime/Evidence V0 tests. **39/39** fresh uncached workspace typechecks. Independent reviewer `REVIEW PASS`. +- Monolithic `check:changed` returned nonzero solely due to a **900s test-run deadline**; exact affected manifest passed via complete independent batch execution. Manager accepts equivalent **bounded trial verification** while preserving `MONOLITHIC WRAPPER NOT GREEN`. No broader hosted CI/production claim. + +## R — default-off continuation + D4 A+B re-land + +- Fresh adapted continuation and accepted D4 A+B on separate R branch based on frozen U, **4 commits/33 files/+8613/−95**, default-off unless explicit `T3CODE_EXPERIMENTAL_CONTINUATION=1`. Two bounded repair cycles fixed reported major defects (worktree leak; mutable target/multiple bypasses; agent-visible policy; async terminal status; runtime enabled gate). +- **K1/K2 real server-root D4 tests 8/8 PASS**, writer focused **206/206**, independent reviewer focused **210/210** on preceding rounds; `check:changed` 22 files/**294 passing tests**, typecheck **36 packages** and static phases PASS. Later **cross-provider read-only Codex GPT-6.1 SOL Medium reviewer** reports **PASS WITH FINDINGS**, no blocking/major and separately reran K1/K2 **8/8**, **199 focused tests**, **7/7 budget tests**. This **CLOSES previous G-R cross-provider-review HOLD** and permits recorded **G-R FINAL PASS** within isolated R scope. +- Prior Stage R Opus fallback remains **OWNER-APPROVED** on 2026-11-06 10:24 correction; no subsequent Opus. Record model and cost evidence without fabricating earlier approval timestamp. This is not unrestricted future Opus authorization. +- D4 K1: actual `layerMakeServer` assembly/SQL path and inode, `BEGIN IMMEDIATE` writer serialization, real operator `continuation:null` revocation; revoke-first **0 new runs / 0 `provider-turn.start` effects / 0 accepted receipts / 0 adapter opens**, typed denial; launch-first exactly 1 run/start effect; replay idempotent; ordinary runs unaffected. K2: actual asynchronous `schedulePreparation` barrier, operator revoke-before-release, cancelled run/orchestration+Runtime attempt, failed tracker once, **0 start effects/adapter calls**, no worktree/accepted release receipt, idempotent release/retry/late fail, `reconcile_required` preserved. **No externally atomic provider `startTurn` guarantee asserted**. + +## H — *tests/fixtures only* D2/K3 qualification + +**Important distinction:** H changed **tests and fixtures only** in 9 files; it did not add a new production MCP schema implementation. D2 hiding of agent-facing continuation fields and the internal operator policy behavior are exercised on the inherited R candidate. Do not claim H shipped a new API or D2 production fix. + +- H focused suite **118/118 over 11 files PASS**, `check:changed` all phases PASS with **26 affected test files / 335 tests** and **36-package typecheck**. Independent **Claude Sonnet 5.5 Medium** reviewer (different provider than H Codex technical writer) reports **REVIEW PASS**, no blocking/medium; reran **118/118**, verified restart-test refactor preserved bodies and budget assertions. Low-severity test stdout noise only. +- D2 **source-loaded agent-visible tools list**: **82 tools / 2269 field paths**; names/descriptions/input schemas **58799 UTF-8 bytes**, byte-identical with the frozen U baseline, **0 continuation-attributable bytes**, no experimental `continuation` in task create/update/output schemas. Unrelated `t3_worktree_handoff` delivery status inventoried and retained. Internal operator create/read/update/revoke remains accessible only under operator policy. **`D2 SCOPED SOURCE-LOADED PASS`**. +- **Not demonstrated:** packaged server + real authenticated paired-agent MCP `tools/list` enumeration, real release-context schema budget, client compatibility in shipping distribution. Therefore **`D2 PACKAGED SHIPPING NOT VERIFIED`** remains a **public release blocker**; source-level schema absence is necessary but not shipping proof. +- K3 **recovery scope PASS** on disposable file-backed temp SQLite: restart persistence for policy/task/attempt/receipt/handoff, committed revocation, no duplicate effects on replay, `reconcile_required` preserved; disposable spawned child process SIGKILL at deterministic barrier + two reopens, no provider resurrection; real history pruning/truncation emits honest `incomplete/unknown` markers and preserves revocation; two adapter-independent provider stubs, project isolation and ordinary runs intact; default-off verified. **Not demonstrated:** real external provider-start race/crash atomicity, OS/power-loss, hosted production. **`K3 BOUNDED RUNTIME PASS / RELEASE PARTIAL`**, never `PRODUCTION VERIFIED`. + +## Worker routing / cost / durable authority + +- Returned ledger reports **16 of max 18 DISTINCT technical/reviewer dispatches**: U 5, failed Codex dispatch 1, R 7, Codex cross-provider R read-only review 1, H Codex writer 1, H Claude reviewer 1. **Two unused** under this exact overnight authorization; the seven additional `t3_thread_send` turns were classified as **same-task resumes** rather than distinct dispatches using actual session/task records. The manager has not separately inspected those private records. +- No further Opus used. Stage R Opus use recorded **owner-approved**. Codex B and Claude B availability/cost as reported; worker states **no paid API spend and no live external provider turns**, not browser independently verified. DeepSeek coordinated only; no source/tests by DeepSeek. +- T3 Project Runtime task/handoff append tool was **not exposed to the local orchestrator**, so it used the permitted **restricted local append-only ledger**; final ledger reported **461 lines** with verified local SHA-256 (full digest in worker handoff/host ledger, not user-facing summaries). Private routing/cost/account evidence remains private. Missing direct T3 Runtime append means future bidirectional orchestration bridge remains unverified; don't claim the product already persists routing as a first-class Runtime service. +- Distinguish this **COMPLETED U/R/H lane** from the separate [prepared cooperative upstream PR #28777 conflict/test task](task-upstream-pr28777-cooperative-conflict-and-regression-20261106.md), which is still **NOT DISPATCHED** and **must not** be charged to the completed overnight budget or used to mutate these isolated branches. + +## Remaining release and integration gates + +1. **D2 packaged authenticated shipping enumeration:** build/load packaged T3 server with supported real MCP client and actual login/authorized listing; compare exact shipping `tools/list` schemas+UTF-8 bytes with agreed baseline for agent create/update/return and internal operator privilege boundaries; protect credentials; no public release. Source-loaded PASS does not qualify packaged client. +2. **K3 real-provider start/crash qualification:** controlled explicit provider integration where supported and authorized, actual external `startTurn` race/crash/stop/reconciliation; avoid paid infrastructure without approval. No external atomicity promise beyond accepted D4 A+B. +3. **Full CI/build/release smoke and UI/native/relay scope:** both H/R isolated current branches only have focused and changed-file PASS, not merged-head hosted CI or real packaged desktop/mobile/client. Evidence V0 old-decoder fork-only coordinated-upgrade limitation still needs handling in future release context. +4. **Integration decision:** choose a target fork-main snapshot, compare selected/frozen upstream tip with then-current upstream, create an owned integration/re-land plan, inspect overlap and DB migration lineage, and obtain explicit authority before any Git push/PR/fork main merge. No direct merge of old divergent experiment. Integration/production/default-on are separate user choices. +5. **Residual R risks:** silent operator-edit stall, two fail-closed mutation regressions missing, fenced-start outbox status and broader late-fail no-op; nonblocking for isolated readiness but assess before default-on/release. H low-severity stdout noise. + +**Required next step:** Stop automatic overnight execution after H, reconcile canonical state, present discrete choices to user. A separately scoped **no-cost packaged D2 verification plan** is a sensible first next step, with optional follow-on real-provider crash qualification if auth/cost/user chooses. Do not silently spend, launch new local tasks or merge the fork. + +**Final:** `OVERNIGHT U/R/H COMPLETED / ISOLATED CANDIDATE REVIEW PASS / D2 PACKAGED SHIPPING BLOCKED / K3 LIVE PROVIDER QUALIFICATION OPEN / NOT INTEGRATED / NOT PRODUCTION VERIFIED`. diff --git a/docs/orchestration-v2/manager-post-d4-integration-options-20261105.md b/docs/orchestration-v2/manager-post-d4-integration-options-20261105.md new file mode 100644 index 0000000000000..7685dfec6f278 --- /dev/null +++ b/docs/orchestration-v2/manager-post-d4-integration-options-20261105.md @@ -0,0 +1,34 @@ +# Manager integration decision brief — after D4 K1/K2 local qualification + +**As of:** 2026-11-05 21:43Z D4 worker handoff and subsequent browser GitHub source/ref checks. +**Authority:** **OPTION 1 (reversible isolated local upstream-first trial) AUTHORIZED by user's explicit 'auth' on 2026-11-05 22:14Z.** Scope is governed by [upstream trial spec](upstream-catchup-isolated-trial-governing-spec-20261105.md) and [complete T3 Code packet](task-upstream-catchup-isolated-trial-20261105.md), status **PREPARED / NOT DISPATCHED**. Options 2/3 remain unselected; **no fork-main merge, continuation/D4 re-land, Git push/PR, public release or production approved**. +**Evidence:** [D4 full-root K1/K2 manager reconciliation](manager-d4-full-root-k1-k2-verification-reconciliation-20261105.md), [Stage 2 upstream experiment preview](manager-stage2-three-lane-return-reconciliation-20261105.md), [Current State](../../01_CURRENT_STATE.md). + +## Established checkpoints and remaining risk + +- Fork `main` at merged PR #21 `fb67545d790c5c001e8f85827f219ab6493c435e`: integrated and previously locally qualified, not production verified. +- Default-off experimental continuation branch `b3b8da54e0b8b184a1cf4e667d53e73e04f85074` remains separate/divergent. It was previously measured 34 ahead/336 behind fork main. Local unpushed D4 branch `d4/ab-revocation-guard-20261105` based on experiment has 12 worker-reported local commits/15 files. **Do not directly merge/rebase the divergent experiment or D4 branch onto main**. +- Current upstream `pingdotgg/t3code` main `25b53299b75d4d8d1d0667ad47e9cfed3749776e`, **91 commits** after incorporated upstream release-preparation parent. This includes **41 newer commits since the Stage 2 preview**, 225 changed paths, notably `Orchestrator.ts`, `ProviderTurnStartService.ts`, `ThreadLaunchService.test.ts`, MCP and shared contracts. Prior dry-run conflict counts **1/2/9 are historical to an older upstream snapshot** and do not predict this updated merge. +- D4 K1/K2 isolated full-server runtime evidence is accepted within its test scope; K3 crash/restart/pruning/portability PARTIAL. D2 agent MCP continuation schema exposure remains a **public shipping exclusion requirement** and existing experiment fails it when gate off. D4 success does not authorize D2 unsafe shipping. + +## Options for owner decision + +**1. Upstream-first isolated trial (AUTHORIZED, not yet dispatched).** One **bounded, isolated, reversible** new worktree derived from currently integrated fork main to apply the latest upstream delta, preserving fork Runtime extensions and P2 Evidence V0 semantics. One technical writer + different-provider review, tests/visual verification required for touched surfaces. **No push, no main merge, no public release, and no continuation re-land in this first task.** Stop for material architecture/security/rebase conflict; preserve all uncommitted work. After acceptance, separately decide whether to re-land the isolated continuation/D4 implementation as fresh changes onto this updated safe base. + +**2. Re-land continuation/D4 before upstream catch-up.** Authorize a separate bounded fresh application of the experimental changes onto the existing integrated fork-main base. This may temporarily lower short-term merge complexity but creates additional rebase exposure, because upstream is now 91 commits forward and includes orchestration and provider-start changes. D2 must be split/omitted from shipping MCP schemas before any release and K1/K2 rerun on the new base. **Not recommended as default**. + +**3. Defer integration.** Keep fork main unchanged and D4 evidence isolated; later reconsider after upstream settles or a higher-priority project task needs the Runtime feature. Safest immediate option, with no automated continuation available on main. + +**Only option 1 is now an accepted scope authorization**, not permission to merge to main, push, activate continuation or publish evidence. The [governing spec](upstream-catchup-isolated-trial-governing-spec-20261105.md) controls execution. Private D4/PR #21 evidence remains untouched. + +## If option 1 is adopted — future bounded T3 Code packet requirements + +Before local technical writing, Overall Manager must issue/update a governing upstream reconciliation spec with exact upstream/fork sources, conflict policy, P2 Evidence V0 compatibility, Runtime persistence/isolation, D2 omission, test/review gates and stop conditions. Confirm live refs, existing branch/worktrees, ownership, uncommitted files, disk/free space; use a **new uniquely owned isolated worktree** based on fork main. DeepSeek orchestration-only, Codex SOL Medium or Sonnet Medium code/tests, a distinct provider/model independent read-only reviewer; actual quotas/reset or UNKNOWN. No Opus or paid-resource spending unless separately authorized. + +**Required verification** includes relevant repo-wide typechecks and tests, database restart persistence, provider-neutral Runtime tests, event/command receipt correctness, app-level MCP compatibility when provider setup is available, and rendered UI inspection if upstream touches UI. Do not weaken tests merely to pass. If conflict demands a new architecture or changing authorization, stop with proposals and user decision. Produce an authoritative Runtime/local restricted handoff and manager acceptance review. Do **not** automatically chain into continuation re-land or push. + +## Later re-land — separately approved + +On an accepted, verified integration base, reintroduce the **minimum** continuation plus D4 A+B changes as fresh bounded commits in an isolated writer-owned branch, never by merging the old diverged experiment. Retain default-off, a valid private transactional run guard, prepared-run release behavior and D2 public-shipping agent-schema exclusion. Re-run **real-root K1/K2**, K3 recovery qualification as required by release target, MCP paired-client/packaged release schema budget, provider-neutral tests and independent review. A separate explicit decision is required before any fork-main merge, Git push/PR, production enablement or public release. + +**2026-11-05 22:14Z transition:** User authorized option 1; the dedicated [trial implementation packet](task-upstream-catchup-isolated-trial-20261105.md) is PREPARED / NOT DISPATCHED. No local code work or main merge performed by this authorization. Future continuation re-land, public push/PR and fork-main merge still require separate decisions. diff --git a/docs/orchestration-v2/manager-postmerge-pr21-evidence-closure-reconciliation-20261104.md b/docs/orchestration-v2/manager-postmerge-pr21-evidence-closure-reconciliation-20261104.md new file mode 100644 index 0000000000000..eaf654a36b5c6 --- /dev/null +++ b/docs/orchestration-v2/manager-postmerge-pr21-evidence-closure-reconciliation-20261104.md @@ -0,0 +1,57 @@ +# Manager reconciliation — post-merge PR #21 evidence closure + +**As of:** 2026-11-04 20:00 UTC, after user-supplied DeepSeek orchestration return. +**Authority:** Overall Manager GitHub source/repo inspection plus an attributed worker handoff. Browser manager cannot directly inspect host-only original/package bytes or replay local commands. +**Verdict:** **`INTEGRATED / POST-MERGE LOCAL RUNTIME PASS (worker-reported) / EVIDENCE CLOSED LOCALLY (worker-reported) / REVIEW PASS WITH FINDINGS (worker-recorded)`**. **No remote evidence publication, no hosted CI and not production verified.** + +## Independently checked facts + +- [PR #21](https://github.com/jermur788/t3code/pull/21) remains CLOSED / MERGED, fork `main` remains the accepted normal merge commit `fb67545d790c5c001e8f85827f219ab6493c435e`. No new fork-main source change was observed by manager. +- [`apps/web/src/forkWorkspaceMode.ts`](https://github.com/jermur788/t3code/blob/main/apps/web/src/forkWorkspaceMode.ts) explicitly uses `localStorage` key `t3-fork:interface-mode`, default `development`, with `workspace` and `development` as its literals. It does not establish server-side mode persistence, cross-device synchronization or full browser-process restart. +- [ProjectRuntimeRpc.ts](https://github.com/jermur788/t3code/blob/main/apps/server/src/projectRuntime/ProjectRuntimeRpc.ts) exposes `listHandoffs` and `readHandoff` but no RPC `appendHandoff`. [MCP project tool](https://github.com/jermur788/t3code/blob/main/apps/server/src/mcp/toolkits/project/runtimeTools.ts) registers `t3_project_handoff_append`; [handler](https://github.com/jermur788/t3code/blob/main/apps/server/src/mcp/toolkits/project/handlers.ts) delegates to `runtime.appendHandoff`. [MCP session registry](https://github.com/jermur788/t3code/blob/main/apps/server/src/mcp/McpSessionRegistry.ts) issues scoped credentials, and [MCP HTTP server](https://github.com/jermur788/t3code/blob/main/apps/server/src/mcp/McpHttpServer.ts) rejects unusable credentials. This corroborates the reported normal path, but **does not prove no alternate externally configured no-cost provider exists**. +- Prior local verification `verify/postmerge-pr21-20261104` branch/ledger was **not available through GitHub** on the last manager fetch; the user reports no commit/push and all package bytes still on their local host. Do not invent a remote URL or stronger independent artifact-inspection claim. + +## Worker-reported closure with precise scope + +**Original evidence inventory:** 164 files / 9,803,931 bytes, **164/164 checksum verification PASS**. +**Sanitized package v2:** 89 files / 754,717 bytes, **87/87 checksum PASS**, excluding package checksum file and SIZE.json. 78 sanitized files; worker reports no UUIDs, file paths, localhost markers, secrets or email addresses in its pattern checks. Three traceIds and a redacted `Bearer ` label remain, not a credential claim. Sanitization is pattern-bounded and lossy; manual recipient review is still warranted before any publication. +**v1:** reported unchanged; **63/63 checksums**. +**Snapshot:** 2026-11-04 19:55:35Z. +**Ledger:** original append-only ledger reportedly has snapshot checksum `dfcc484c…26e4`; post-snapshot final checksum `e93a86f1…6f2b`, reflecting three documented later entries. Package v2 stayed byte-identical to reviewed snapshot. Verify the complete actual digests from local evidence rather than inferring from these abbreviated report values. +**Source evidence provenance:** worker reports primary artifact confirmation of fresh uncached 40/40-package typecheck (294.6 s), last `check:changed` exit 0 on 221 changed files with 81 suites / 2,075 passing tests, web build pass, actual rendered home/modes/thread route, file-backed app stop/start and two-project isolation, V2 event pruning with deleted 4/boundary 6, 1,025/1,025 current-decoder JSONL lines, and old V0 decoder rejection of the new marker. The manager **has not directly inspected the package or transcripts**. + +**Missing original artifacts:** raw restart RPC frames, frozen historical ledger content, standalone reviewer transcripts. Worker-generated `record.json` contributes some attribution; screenshot images lack embedded URL/time. No evidence substitutes for those missing materials. + +### Application-level check dispositions + +| Check | Disposition | Evidence boundary | +| --- | --- | --- | +| Workspace/Development mode after **normal server restart and same-browser-profile reload** | **`LOCAL RUNTIME PASS (worker-reported), client-local only`** | Local storage remained `workspace` with a fresh server process/page origin; three screenshots + per-step JSON reported. Not proven for browser-process restart, other profile/device or server-side persistence. | +| App-level handoff **write, isolation and restart** | **`NOT RUN / OPERATIONAL BLOCKER`** | No permitted no-cost append path exposed in worker host; RPC list/read only, MCP append uses provider-session credential. Earlier *service-level* handoff tests are not equivalent. Externally configured local provider possibilities not exhaustively ruled out. | +| Browser/production/live provider and hosted CI | **`NOT VERIFIED`** | Zero hosted checks; no live-paid-provider use, production, crash/SIGKILL, remote/tunnel or native-client pass. | + +**Independent review (worker-reported):** Codex GPT-6.1 Terra Medium reviewed app gaps (`PASS WITH FINDINGS`), Sonnet 5.5 Medium reviewed package v1 (found UUID sanitization and stale inventory defects), later mode evidence and package v2 (each `PASS WITH FINDINGS`, no remaining sanitization/integrity overclaim finding). Review has **not** been upgraded to an unconditional production PASS by the manager. + +**Routing:** eight closure dispatches across Codex GPT-6.1 SOL Medium, Claude Sonnet 5.5 Medium and Codex GPT-6.1 Terra Medium, with DeepSeek V4.1 Flash performing orchestration-only/ledger work. Two corrected rework loops, zero quota errors/Opus escalations/failovers. Workers reported `AVAILABLE` but **actual remaining subscription quotas/reset times remained UNKNOWN**. + +## Where evidence physically remains + +- Originals under `/media/jer/Files/Worktrees/pr21-verify-evidence-20261104/`. +- Sanitized package v2 at `/media/jer/Files/Worktrees/pr21-evidence-package-20261104-v2/` with inventory/checksums/manifest. +- Final restricted ledger delta at `/media/jer/Files/Worktrees/pr21-evidence-final-ledger-20261104/`. +- Local `verify/postmerge-pr21-20261104` worktree. **No publication, Git commit, branch push, PR attachment or production deployment** reported. Local custody plus checksums = `EVIDENCE CLOSED LOCALLY`, **not `REMOTE AUDIT PASS`**. + +## Publication decision (separate user authority) + +Worker recommends a **minimal sanitized text-only subset**: 78 files from `sanitized/`, a separately scrubbed `MANIFEST.md` and `SANITIZED-MAP.json`, and fresh checksums, reviewed before any network transfer. The worker has identified a host-local absolute path in current manifest/inventory that must be removed first. Keep `ledger-original.md`, `REVERIFICATION.json`, `BASE.json`, SQLite DBs, screenshots, raw JSONL, fixture `.git` and `node_modules` entirely local. **Do not upload the whole package or binaries.** + +**Current approval:** no permission to publish, push or upload any evidence, so **publication is `NOT AUTHORIZED / NOT DONE`**. The next meaningful user decision is whether to authorize a **locally prepared, reviewed publication subset**, and, separately, its destination and actual transfer. Use the [existing accepted DeepSeek orchestration-only handoff policy](DEEPSEEK_ORCHESTRATOR_HANDOFF_TEMPLATE_V1.md) for any resulting worker dispatch. Do not describe the subset as externally available until it is fetched and independently checked after publication. + +## Product/project implications + +- Fork development baseline remains `INTEGRATED`; post-merge qualification remains `LOCAL RUNTIME PASS (worker-reported)` with `REVIEW PASS WITH FINDINGS`. Local evidence packaging is closed; remote reproducibility remains unproven. +- Do not commission a new MCP privilege bypass or production-facing no-cost stub just to close the handoff test. Such a feature would be material scope expansion / authentication-boundary review, requiring spec and user decision. A future supported stub path or independently authorized environment can test it. +- Evidence V0 old-decoder coordinated-upgrade requirement remains user-accepted for fork only; not stable external format compatibility. +- Separate default-off continuation experiment remains unmerged. D2 public shipping exclusion and D4 strict revocation are still unresolved public-release constraints; neither was changed here. + +**Canonical manager sources:** [Current State](../../01_CURRENT_STATE.md) · [Overall Manager Handoff](../../OVERALL_MANAGER_HANDOFF.md) · [post-merge qualification reconciliation](manager-postmerge-pr21-verification-reconciliation-20261104.md). diff --git a/docs/orchestration-v2/manager-postmerge-pr21-verification-reconciliation-20261104.md b/docs/orchestration-v2/manager-postmerge-pr21-verification-reconciliation-20261104.md new file mode 100644 index 0000000000000..55a154016c0ef --- /dev/null +++ b/docs/orchestration-v2/manager-postmerge-pr21-verification-reconciliation-20261104.md @@ -0,0 +1,43 @@ +# Manager reconciliation — PR #21 post-merge local qualification + +**As of:** 2026-11-04 19:28 UTC (worker handoff received). +**Authority:** Overall Manager review of user-supplied worker handoff + independent GitHub branch/PR inspection. +**Verdict:** `INTEGRATED / POST-MERGE LOCAL RUNTIME PASS (worker-reported) / INDEPENDENT REVIEW PASS WITH FINDINGS (worker-recorded)`; **NOT PRODUCTION VERIFIED**. + +## Distinguish independent observations from worker claims + +**Independently verified through GitHub by browser manager** +- [PR #21](https://github.com/jermur788/t3code/pull/21) is **CLOSED/MERGED**, source head `0e0c7bc2cb1bb805f273123686303a68e1c2807c`, and fork `main` remains at normal two-parent merge `fb67545d790c5c001e8f85827f219ab6493c435e`. +- The two parents were independently confirmed during prior post-merge source review: former fork main `d3bedef12a31f368e5c5a6b279445bea39a6a13a` and reviewed PR head `0e0c7bc2cb1bb805f273123686303a68e1c2807c`. +- Remote branch `verify/postmerge-pr21-20261104` **was not found** via GitHub Branch API, and the reported `docs/orchestration-v2/postmerge-pr21-verification-ledger-20261104.md` could not be fetched from that branch at review time. This is consistent with worker's report of **no commit/push**: the ledger and binary evidence are **host-local only**. This is a **provenance/continuity limitation**, not proof the local results are false. +- No GitHub-hosted check result was established. Previous GitHub inspection found zero hosted check-runs. Manager did not have direct access to the worktree or the 8.2-MB evidence directory. + +**Detailed worker-reported post-merge execution (not independently replayed by browser manager)** +- Exact merged `main` checked out in a clean independent external-volume verification worktree. Local `main` preserved; no pushes/commits/merges/reset/main writes. +- Fresh uncached `vp run typecheck`: **40/40 packages**, exit 0 (294.6 s). Evidence service: **36 tests**, exit 0. Eight Project Runtime/Task suites: **103 tests**, exit 0. After correcting untracked artifact/ledger hygiene, `vp run check:changed upstream/main` returned **exit 0**: 221 changed files; format/lint/knip/GraphQL, typecheck, 81 test files/**2,075 tests** and 40 React compiler checks passed. First two attempts exited 1 on artifacts, not product files, according to worker report. Web build exit 0 (52.54 s), chunk-size warning only. +- Real local browser with stub/no-cost providers showed **Runtime-enabled Fork Project Home** and all five development cards, mode dropdown with Workspace/Development and Workspace selection hiding development cards, upstream draft thread composer, and browser-back preserving home. Reported steady-state no browser errors, failed requests, unhandled rejections or non-OK fetches; benign router/pre-pairing warnings noted. +- App-level stop/start on **file-backed SQLite**; two separate projects created via live server WebSocket RPC, instructions/tasks/result markers/evidence persisted identically; cross-project reads rejected before/after restart. This is **app stop/start**, not crash/SIGKILL recovery; projects were created through RPC, not the Add-project UI. +- Real EventSink + ProjectionMaintenance V2 pruning: 4 events deleted, published watermark 6, exactly one deterministic Evidence V0 `orchestration-v2-pruned` marker on earlier referenced thread (`incomplete/unknown`), post-boundary thread unmarked, distinct 1,000-event truncation and three unresolved markers. New decoder reported **1025/1025 JSONL lines** decoded, old decoder rejected only the pruning marker, confirming accepted fork-only coordinated-upgrade limitation. No missing events fabricated. +- Orchestration: DeepSeek V4.1 Flash **orchestrated only**; workers Codex GPT-6.1 SOL Medium and Claude Sonnet 5.5 Medium, independent reviewers Codex GPT-6.1 Terra Medium and Claude Sonnet 5.5 Medium. Eight dispatches, zero capacity failures, two artifact-hygiene retries; no Opus, subscription failover or provider-confirmed reset. Subscription availability and cost not independently measured here. +- Two independent **read-only reviewer PASS WITH FINDINGS** reports in worker handoff; follow-up reportedly closed some narrow gaps. The manager does **not** re-label these as unconditional production review or as independently inspected raw reviewer logs. + +## Precise residual limitations + +1. **App-level handoff isolation** was **not** exercised through a live app write (RPC offers read/list, append reportedly requires live model). Prior **service-level** test covers it. Do not claim app-level handoff isolation PASS. +2. **Mode persistence across restart** was not verified. The browser verified the mode toggle within a session only. +3. No SIGKILL/crash recovery test; app was stopped and restarted normally. No Add-project UI creation path tested. +4. `check:changed upstream/main` validates the **fork-vs-upstream delta**, not uniquely the PR #21 diff. Worker resolved baseline to the expected upstream merge-base. Final cached typecheck is supplemented by one fresh uncached PASS reported at the same merged main. Web build was separately successful despite overlap. +5. Older Evidence V0 closed-enum decoders **cannot** read the new `orchestration-v2-pruned` line; user accepted coordinated upgrades for fork-only main. +6. Upstream local `main` was one commit newer than the incorporated release-preparation baseline; this newer upstream change was not qualified in this run. +7. **No hosted CI, live paid providers, production deployment or external/native/remote end-to-end qualification.** UI/screenshots/logs/raw worker ledger exist **only on local verification host** and are unavailable to browser manager. Do not claim remote or independently reproducible evidence has been published. + +## Manager classification / next actions + +- **Milestone state upgraded:** from `post-merge local NOT RUN` to **`POST-MERGE LOCAL RUNTIME PASS (worker-reported), REVIEW PASS WITH FINDINGS (worker-recorded)`**. Fork `main` integration is independently verified by GitHub; not production verified. +- **Evidence portability:** `OPERATIONAL BLOCKER` for external audit until the actual host-local ledger and *sanitized* manifest/test proofs are persisted to a durable retrievable location. The manager's summary here preserves the user-supplied handoff but is not a substitute for the raw task ledger. +- **Two optional bounded follow-ups:** (a) app-level handoff write/read/isolation using a truly stub/no-cost provider, **only if the host exposes a supported path**; (b) mode preference persistence through actual server restart. If unsafe/unavailable, record NOT RUN/OPERATIONAL BLOCKER rather than fabricate. Avoid altering merged fork main or paying for live models. +- **Further priority:** reconcile local evidence and update Runtime task/handoff when available; keep separate D2 tool-schema exclusion, D4 strict continuation revocation and public-release/production decisions distinct. The experimental continuation branch remains unmerged. No main write/merge/production activation authorized by this review. + +**Host-local ledger (not remotely fetched):** `docs/orchestration-v2/postmerge-pr21-verification-ledger-20261104.md` in local `verify/postmerge-pr21-20261104` worktree. +**Host-local evidence (not remotely fetched):** `/media/jer/Files/Worktrees/pr21-verify-evidence-20261104/`, about 8.2 MB, according to handoff. +**Canonical current state:** [01_CURRENT_STATE.md](../../01_CURRENT_STATE.md). diff --git a/docs/orchestration-v2/manager-pr21-sanitized-subset-integrity-acceptance-20261105.md b/docs/orchestration-v2/manager-pr21-sanitized-subset-integrity-acceptance-20261105.md new file mode 100644 index 0000000000000..19a391f270e35 --- /dev/null +++ b/docs/orchestration-v2/manager-pr21-sanitized-subset-integrity-acceptance-20261105.md @@ -0,0 +1,41 @@ +# Manager acceptance — PR #21 private sanitized evidence candidate integrity + +**Reported at:** 2026-11-05 12:46 UTC. +**Authority:** User-supplied worker return; independent GitHub repository/source/task checks by Overall Manager. **Worker-host candidate, raw ledger and screenshots were not directly inspected by the browser manager.** + +**Verdict:** `LOCAL PREPARATION INTEGRITY PASS (worker-reported) / INDEPENDENT REVIEW PASS (worker-recorded) / CANDIDATE PRIVATE / NOT PUBLISHED`. **The previously open 78-of-80 checksum coverage defect is resolved on the local worker host according to the return.** + +## Independent manager observations + +- [Fork PR #21](https://github.com/jermur788/t3code/pull/21) remains CLOSED/MERGED; remote fork `main` remains on the same normal integration commit `fb67545d790c5c001e8f85827f219ab6493c435e`. +- [Original task](task-pr21-sanitized-evidence-subset-local-preparation-20261105.md) and [bounded metadata checksum correction](task-pr21-sanitized-subset-metadata-hashes-correction-20261105.md) both exist on the GitHub planning branch. The earlier worker-host missing-document discrepancy was resolved by refreshing the planning ref read-only. +- GitHub fork repository visibility is **PUBLIC**. Any evidence pushed to a dedicated branch in the same repo would also be publicly accessible. This is an **external disclosure**, not a private archive. +- The manager had no live mount/access to the private home-directory candidate, local source v2, restricted ledger or raw reviewer output; no independent disk checksum replay or manual full disclosure review was performed by the manager. + +## Worker-reported completed correction + +- Exact fork-main evidence baseline unchanged. Local `main` remained at its pre-merge parent (stale), repo working tree clean; no local ref moved. +- Candidate **81 regular text files / 629,261 bytes**: 78 sanitized source text files, `MANIFEST.md`, `SANITIZED-MAP.json` and `SHA256SUMS.txt`; 14 directories, directories mode `0700`, files `0600`, zero symlinks/special files/path escapes/forbidden raw evidence. +- Checksum file now **80 sorted distinct relative paths**, covering exactly the 78 sanitized files plus `MANIFEST.md` and `SANITIZED-MAP.json`, omitting only checksum self-reference; **80 OK / 0 FAILED** when checked from candidate root. Two metadata digests were added; original 78 sanitized files and both metadata files reported byte-identical to the prior reviewed candidate. Only `SHA256SUMS.txt` changed, its digest separately recorded in private worker return. +- Independent reviewer deliberately **rejected a same-minute writer-created “before” artifact as unreliable prior-state proof**, and instead validated all 78 evidence files against the genuine independently preserved earlier 78-entry checksum witness. This is an evidence-quality improvement. +- Current `SANITIZED-MAP.json` has 78 records with exact final hashes/byte counts. The upstream source v2 map previously had only 77/78 and was reconciled through the source v2 package checksum; source v2 remained read-only, **87/87 checks PASS** in the worker return. +- Fresh privacy/credential/path scans were reported clean across all 81 files, including raw, percent-decoded and JSON-unicode-escaped forms. Exceptions were non-sensitive package names, public commit/content digests and explicit redaction markers. **Pattern scans cannot rule out every possible undiscovered personal string or secret.** +- Reviewer Claude Sonnet 5.5 Medium issued **PASS** after writer Codex GPT-6.1 SOL Medium finished correction. Reviewer independently recomputed 80-entry coverage, ordering, nonmutation, zero symlinks, permissions, mount status, repository status and ledger factual claims. +- Three dispatches for correction; combined local candidate preparation/correction total **10 dispatches**, zero provider quota failures/failovers and no Opus or live paid-provider use. DeepSeek V4.1 Flash only coordinated; exact provider quota/reset values remained `UNKNOWN`. Restricted ledger is outside candidate. +- No repo commit, branch push, candidate upload, GitHub comment attachment, publication, production enablement, paid-model call or source edits reported. Original Files volume remains mounted **read-only**, and was not unmounted. + +## Residual limitations / no-new-task classification + +- Candidate is restricted by local filesystem permissions but **not encrypted**; it is not yet transfer-hardened. No browser-manager access to final bytes, no externally retrievable evidence source. +- Independent disclosure reviewer did not read every line of the three longest logs; original writer did, and automated scans were reported against full candidate. Redaction is lossy; format provenance and model/provider names were deliberately retained. +- `MANIFEST.md` does **not** explicitly state the checksum coverage scope. This is a minor optional documentation improvement, **not a present acceptance blocker** because the independently reviewed 80-entry checksum file and relative map demonstrate scope. Editing the manifest now would invalidate the current manifest digest and require another verification/review cycle; do not dispatch such change without a clear benefit. +- Existing inherited limitations: no hosted CI, production or live paid-provider end-to-end, crash/SIGKILL, native/relay/tunnel, browser-process restart or app-level handoff write/isolation. Older strict Evidence V0 decoders require the user-accepted coordinated upgrade. +- `LOCAL PREPARATION INTEGRITY PASS` is distinct from `REMOTE AUDIT PASS` and `PRODUCTION VERIFIED`. No public guarantee of secret absence. + +## Gate and safe next action + +**The local preparation and metadata checksum correction are COMPLETE (worker-reported / review-recorded). No new local execution task is warranted.** The user previously authorized **local preparation only**, not publication. Next decision is **whether any evidence should leave the local machine**. If so, user must identify destination and visibility and decide whether to retain provider/model routing names. A branch of this public fork is **public**. Prefer keeping candidate local or using an explicitly approved **private** maintainer-controlled destination over uploading operational evidence to the public repository without a concrete audience/need. A subsequent transfer would require explicit authorization of exact reviewed files and method, and may require transfer hardening appropriate to destination. + +**Do not move local `main`, clean stray temporary files, unmount the read-only volume, modify `MANIFEST.md`, repack candidate, push, publish or pay for provider calls by implication.** + +**Sources:** [Current State](../../01_CURRENT_STATE.md) · [manager handoff](../../OVERALL_MANAGER_HANDOFF.md) · [prior manager staged candidate review](manager-pr21-sanitized-subset-preparation-review-20261105.md). diff --git a/docs/orchestration-v2/manager-pr21-sanitized-subset-preparation-review-20261105.md b/docs/orchestration-v2/manager-pr21-sanitized-subset-preparation-review-20261105.md new file mode 100644 index 0000000000000..6ef3c2c3973ba --- /dev/null +++ b/docs/orchestration-v2/manager-pr21-sanitized-subset-preparation-review-20261105.md @@ -0,0 +1,37 @@ +# Manager reconciliation — PR #21 sanitized local publication candidate + +**Date:** 2026-11-05, after 12:25Z user-supplied worker return. +**Authority:** Overall Manager independent GitHub repo/governing packet inspection plus worker-attributed local staging return. No browser-manager access to the private candidate bytes or worker-host ledger. +**Historical verdict at 12:25Z:** `LOCAL STAGING COMPLETE (worker-reported) / INDEPENDENT REVIEW PASS (recorded) / FINAL CHECKSUM COVERAGE CORRECTION REQUIRED / NOT PUBLISHED`. **This earlier correction requirement was RESOLVED by the 12:46Z worker return. See [final integrity manager acceptance](manager-pr21-sanitized-subset-integrity-acceptance-20261105.md).** Fork `main` and PR #21 remain unchanged/merged. **Not production verified; not a disclosure safety guarantee.** + +## Independently verified facts + +- [PR #21](https://github.com/jermur788/t3code/pull/21) is merged/closed and fork `main` remains at the previously verified two-parent integration commit. No new fork-main changes observed. +- **Governing task document really exists** on the shared GitHub planning branch: [`task-pr21-sanitized-evidence-subset-local-preparation-20261105.md`](task-pr21-sanitized-evidence-subset-local-preparation-20261105.md), with the local-only authorization and no-upload restrictions. Worker reported this file missing on local and remote refs; the manager's GitHub file API fetched it successfully. Treat that as a **worker-host ref/fetch visibility discrepancy** of unknown cause, not a missing governing specification. +- The task's Step B requires a **fresh checksum file covering every staged publishable artifact except the checksum file itself**. Given the worker-reported final inventory of **78 sanitized files + `MANIFEST.md` + `SANITIZED-MAP.json` + `SHA256SUMS.txt` = 81 files**, this requires **80 checksum entries**. Worker reports only **78 entries**, covering sanitized files. Unless the worker can produce evidence of metadata hashes elsewhere, `MANIFEST.md` and `SANITIZED-MAP.json` are omitted from the checksummed publishable set. This is a **small acceptance defect, not an allegation of data corruption**. The independent reviewer PASS did not surface it. Correct on the existing owned local lane and independently re-review final bytes. + +## Worker-reported source and staging + +- v2 package read-only on worker-host Files filesystem after a read-only volume mount; source inventory **89 files / 754,717 bytes**, expected package checksum **87/87**, no source mutation, before/after inventory match. The original package's SANITIZED-MAP reportedly has **77 entries for 78 files**; missing entry for sanitized `EXPORT-SUMMARIES.json` was reconstructed from its matching source package checksum and tracked provenance, not by silently inventing bytes. This discrepancy should be retained in the local evidence ledger. +- Local private staging directory outside repo/source: 81 files / **629,098 bytes**, restricted directories 0700 and files 0600, all ASCII/UTF-8 text, 78 sanitized files and three metadata files. No raw ledger, SQLite DB, screenshot, raw JSONL, fixture Git metadata, node_modules or other restricted evidence reported inside. +- Writer reported full reads of all 78 sanitized files (including three large logs), zero residual patterns in raw/URL-decoded/JSON-unicode-escaped scans, local redactions for a draft path fragment and account descriptor; meaningful repo-relative paths and provider/model provenance retained. **Pattern tests do not prove absence of arbitrary secrets**. Reviewer did not personally inspect all lines of the three longest logs. +- Writer reports 78/78 hashes for sanitized files, a 78-entry per-file sanitized map verified against disk, and reviewer Claude Sonnet 5.5 Medium round 1 `PASS WITH FINDINGS`, round 2 `PASS` after low-severity disclosure corrections. Reviewer re-derived scans and sampled high-risk files. +- Seven routed worker/review dispatches; Codex GPT-6.1 SOL Medium writes, Sonnet 5.5 Medium read-only reviews, DeepSeek V4.1 Flash coordination only; no capacity errors or failovers, actual quota/reset observations UNKNOWN. +- A local-only read-only filesystem mount was created to access source package; unmount it only after verifying **no other activity needs the volume**. Manager cannot inspect mounted state or safely unmount from browser. +- Local `main` was reported stale relative to unchanged remote `main`; do not move local refs as a side effect of evidence correction. One empty temporary file reported, no cleanup authorized by this packet. + +## Precise open issues and authority boundaries + +**Routine acceptance correction:** add hashes for `MANIFEST.md` and `SANITIZED-MAP.json` to the final publishable checksum set (80 distinct relative entries), then hash/verify all 80 with no self-reference, re-run candidate membership, path/traversal, content and disclosure checks, confirm v2 source unchanged and independent read-only reviewer PASS on corrected package. If metadata files contain any checksum self-reference that would make a circular digest, stop and report a precise blocker rather than weakening coverage. No re-execution of PR #21 integration or original 164-file package verification is needed. + +**Evidence portability:** candidate remains **private local only**, not remotely accessible to manager. Current fork repository is **PUBLIC** at GitHub. A dedicated branch on the same repo is therefore **PUBLICLY READABLE**; it must not be called a private evidence archive. If user later chooses publication, obtaining destination/visibility and precise files/routing-name policy are **separate product/security approvals**. Do not publish now. + +**No permission:** Git commit, branch push, PR creation, GitHub comment with candidate contents, upload, email, archive transfer, public release, paid-provider testing, fork-main change, destructive Git or auth bypass. Keep raw/restricted and source package untouched. + +**Status:** closure of local staging integrity is pending only the 80-entry checksum correction and reviewer recheck. Worker reported independent PASS on disclosure, but **manager cannot independently inspect private bytes**. Production/live-provider/hosted CI and app-level MCP handoff isolation remain outside this task. + +**Next bounded packet:** [Metadata checksum coverage correction (DeepSeek-only orchestration)](task-pr21-sanitized-subset-metadata-hashes-correction-20261105.md). This task is prepared, **not dispatched**. It is routine correction inside the authorized local-only preparation; no new publication consent is inferred. + +## Historical finding disposition — resolved at 12:46Z + +The missing `MANIFEST.md` and `SANITIZED-MAP.json` checksum entries were added during a bounded local-only correction. A different-model read-only reviewer verified 80/80 sorted non-self entries, exact candidate membership and preservation of all 78 original sanitized file bytes and both metadata files. **Final current status: `LOCAL PREPARATION INTEGRITY PASS (worker-reported) / INDEPENDENT REVIEW PASS (recorded) / NOT PUBLISHED`.** See [manager acceptance](manager-pr21-sanitized-subset-integrity-acceptance-20261105.md) for provenance and limitations. The earlier verdict in this document is historical, not an open defect, and the correction packet must not be dispatched again. Publication/transfer still lacks explicit user authorization. diff --git a/docs/orchestration-v2/manager-pr28777-evidence-review-and-upstream-draft-20261103.md b/docs/orchestration-v2/manager-pr28777-evidence-review-and-upstream-draft-20261103.md new file mode 100644 index 0000000000000..f98c681b37671 --- /dev/null +++ b/docs/orchestration-v2/manager-pr28777-evidence-review-and-upstream-draft-20261103.md @@ -0,0 +1,67 @@ +## Upstream submission — confirmed 2026-11-03 + +**User approval:** Explicitly given in manager chat immediately before submission (2026-11-03 22:07 UTC). + +**ACTION COMPLETE:** [Top-level contribution comment posted to upstream PR #28777](https://github.com/pingdotgg/t3code/pull/28777#issuecomment-6616620085) under the connected user's GitHub identity. GitHub returned the comment identifier; subsequent direct read independently verified the actual published body, author, timestamp, patch URL and verification report URL. + +The published comment offers the **passing original-interrupted test-only patch** to the existing upstream PR author, describes the 34/34 focused local test pass and static checks, distinguishes command-ID replay from end-to-end MCP request-key replay, and notes the two previously raised instruction issues without claiming they were repaired. This is a public comment, **not** a new PR, commit to upstream, merge, or proof that the author accepted it. + +**Current status:** UPSTREAM FEEDBACK POSTED / AWAITING MAINTAINER RESPONSE OR PR INTEGRATION. Keep original fork worktrees and research files intact; no cleanup authorized. The separate fork continuation experiment is unaffected. Next step is monitor PR response and offer narrow requested help if necessary, with normal safety and contribution boundaries. Recheck PR head if patch adoption changes the source. No product decision or paid model use required for read-only response monitoring. + +# Manager evidence review and draft upstream feedback — PR #28777 + +Date: 2026-11-03 +Verdict: **RUNTIME PASS, supported by worker-executed local tests and fetched evidence; independent manager SOURCE REVIEW PASS; LIVE MODEL EVAL NOT RUN; UPSTREAM FEEDBACK POSTED**. +Ownership: T3 Fork Overall Manager. Public posting requires user authorization. + +## Source and artifacts independently fetched + +- [Upstream PR #28777](https://github.com/pingdotgg/t3code/pull/28777) — verified **open, unmerged**, head unchanged from the test run. +- [Tested local verification report](https://github.com/jermur788/t3code/blob/research/pr-28777-continuation-regression-20261103/docs/orchestration-v2/research-pr28777-local-verification-results-20261103.md) — downloaded through connected GitHub file reading; documents the exact contributor-fork source version, test commands, exit status and excerpts. +- [Corrected regression patch](https://github.com/jermur788/t3code/blob/research/pr-28777-continuation-regression-20261103/docs/orchestration-v2/research-pr28777-original-interrupted-corrected.patch) — fetched directly; one test file changed (`apps/server/src/orchestration-v2/DelegatedCompletionDelivery.test.ts`), status and shape match report. +- [Original independent browser review](https://github.com/jermur788/t3code/blob/research/pr-28777-continuation-regression-20261103/docs/orchestration-v2/research-pr28777-browser-review-handoff-20261103.md), including source/contract evidence. +- User/local worker's report says a byte-for-byte patch checksum match. The browser manager **inspected** the published patch and its content but **did not rerun a local cryptographic hash, TypeScript compiler or Vitest**. The recorded summary contains selected test-output excerpts, not the entirety of the local test and typecheck logs. + +## What evidence supports + +- The original delegated child is seeded as `interrupted`; a follow-up starts in the same child thread with a different run ID and delegated task ID; the original task remains terminal. +- Re-dispatching the same **orchestration command ID** produces a single new follow-up run; this is *not* a full MCP `clientRequestId` replay test. +- A second parent wake refers to a committed cohort with exactly the new follow-up task ID and matching delivery message/generation. A prior browser-authored fixture incorrectly referenced `taskIds` on the `ProviderContinuationRequest`; the local worker repaired the test, not the runtime. +- Repeated recovery does not duplicate the follow-up task or context transfer. +- Report shows `vp test run apps/server/src/orchestration-v2/DelegatedCompletionDelivery.test.ts --reporter=verbose` passing **34/34, exit 0**; `cd apps/server && vp run typecheck` exit 0; focused `vp fmt --check` and `vp lint` exit 0. +- No provider-native session continuity, live model-choice improvement, full CI or end-to-end MCP request-key replay was verified. + +## Independent source concerns (already identified in the upstream discussion) + +1. [The PR's instruction](https://github.com/mohamedhanydawood/t3code/blob/fix/resume-interrupted-review/packages/provider-core/src/server/orchestrationInstructions.ts) tells the agent to use `t3_pending_request` for both `hasPendingQuestion` and `pendingApproval`. [That tool](https://github.com/mohamedhanydawood/t3code/blob/fix/resume-interrupted-review/apps/server/src/mcp/toolkits/thread/tools.ts) explicitly excludes approvals and cannot approve permissions. Distinguish pending questions (tool-mediated answer) from permission approvals (user action in the child context), without starting an extra run. +2. [The delegation result contract](https://github.com/mohamedhanydawood/t3code/blob/fix/resume-interrupted-review/packages/contracts/src/orchestratorMcp.ts) permits `childThreadId: null` when the child is in a linked environment, with `remoteChild` supplying its environment/thread identity. The proposed instruction mentions only `childThreadId`. Before suggesting a precise remote-routing fix, verify actual `t3_thread_send` cross-environment permissions with the current tool schema. +3. These are **source concerns, not tests failing** in the newly executed original-interrupted regression. Similar warnings were already placed in the upstream PR by CodeRabbit, so feedback should acknowledge prior reports instead of presenting them as new discoveries. + +## Recommendation + +**Offer the passing, test-only regression to the *existing PR author* in one concise PR comment if the user approves.** Avoid a second upstream PR, unilateral changes to the contributor's branch, broad unsolicited rewrite or purported proof of live model behavior. + +The test-only patch is already publicly accessible by GitHub link; sharing the link would give the author an actionable reproducible artifact. The user requested upstream help but has not yet authorized public GitHub posting. Do not post until they expressly approve. + +## Proposed public PR comment (NOT POSTED) + +> I checked the original-*interrupted* delegated-child scenario against this PR's current head, using a separate local worktree. I added a test-only regression to the existing completion-delivery suite: **34/34 focused tests passed**, as did the server typecheck and focused format/lint checks. +> +> The new case verifies that the original task remains interrupted, `t3_thread_send` continuation creates a distinct follow-up task/run in the **same child thread**, a repeated orchestration command ID does not create another task, the committed parent wake cohort includes exactly that follow-up, and recovery does not duplicate task/transfer records. +> +> Corrected test-only patch: https://github.com/jermur788/t3code/blob/research/pr-28777-continuation-regression-20261103/docs/orchestration-v2/research-pr28777-original-interrupted-corrected.patch +> +> Commands, results and limitations: https://github.com/jermur788/t3code/blob/research/pr-28777-continuation-regression-20261103/docs/orchestration-v2/research-pr28777-local-verification-results-20261103.md +> +> This is **not** an end-to-end MCP request-key replay test or a live model-choice evaluation. I also confirmed the two previously raised guidance points: permission approvals cannot be answered by `t3_pending_request`, and linked-environment children may have no local `childThreadId`. Those are separate from what this test proves. +> +> If useful, you can incorporate the focused test case into this PR rather than opening a separate PR. + +## Handback + +**Result:** local RUNTIME PASS (test evidence source fetched); manager source review PASS for test-only scope, no independently repeated execution. +**Changed files in manager lane:** this documentation note only, on the research planning branch. +**Upstream:** PR still open; no comment, review, push or merge made. +**Blockers:** live model behavior still unverified and optional; no technical blocker to offering the verified regression patch. +**Next action:** explicit user approval to post the prepared comment to existing PR #28777; then use the GitHub connector to post once, if authorized and supported, and confirm the public link. Alternatively hand over the exact comment to the user. Keep the original local worktrees until no longer needed; cleanup is separately authorized. +**Other lane:** fork continuation experiment is independent; do not alter its writer branch or status based on this PR's outcome. diff --git a/docs/orchestration-v2/manager-reconciliation-overnight-20261104.md b/docs/orchestration-v2/manager-reconciliation-overnight-20261104.md new file mode 100644 index 0000000000000..f488c404ecda4 --- /dev/null +++ b/docs/orchestration-v2/manager-reconciliation-overnight-20261104.md @@ -0,0 +1,124 @@ +> **CANONICAL STATE MOVED — 2026-11-04:** This accumulated dated manager note is retained as **historical evidence**. The single current manager entrypoints are [01_CURRENT_STATE.md](../../01_CURRENT_STATE.md) and [OVERALL_MANAGER_HANDOFF.md](../../OVERALL_MANAGER_HANDOFF.md). The existing dated sections below may describe prior stages as open after they were completed; newer canonical state overrides them. + +# CURRENT MANAGER STATE — fork-only reconciliation draft PR opened (2026-11-04) + +**This section is current and supersedes prior “PR not approved/opened” language below.** + +**NEW AUTHORIZED ACTION COMPLETE:** User expressly approved a **fork-only draft PR** to review the accepted v0.1.7 reconciliation candidate, and the manager created [draft PR #21 — Reconcile T3 fork main with upstream v0.1.7](https://github.com/jermur788/t3code/pull/21). Source branch: `integration/fork-upstream-reconciliation-trial-20261104`; target: fork `main`. GitHub returned and subsequent independent fetch verified: **open, draft, not merged**, source and base at reviewed heads, `mergeable_state: clean`, fork main unchanged. No upstream PR or public posting beyond this fork PR. **No permission to merge**, mark ready for review, enable continuation, or deploy. + +**PR size warning:** GitHub reports approximately **28,984 changed files**, reflecting historical upstream/fork divergence and merge ancestry; this count is not the seven manually reconciled files. Review needs focus on conflict-resolution source, migration/adapter/permission changes and tests, not an assumption that the entire change set was independently inspected. No GitHub-hosted checks/check-runs are present on the PR head at this check; no CI PASS claim. + +**Current verification gate:** [Separate local verification packet](task-verify-reconciled-v017-before-main-20261104.md) still pending for rendered route UI, restart and cross-project isolation, and Evidence V0 after pruning. Existing local test and independent review evidence support **STATIC/RUNTIME PASS and scoped REVIEW PASS**, not production VERIFIED. Current candidate is pinned to upstream v0.1.7; check later upstream changes before promotion. + +**Separate experiment:** [Default-off continuation gate](https://github.com/jermur788/t3code/tree/experiment/continuation-default-off-gate-20261104) is NOT included in PR #21. Public shipping exclusion D2 and strict production revocation D4 remain unimplemented release gates. Preserve separate code lanes, routing ledger and no destructive Git operations. + +**Next authorized action:** continue bounded local verification only. Reconcile evidence, then ask user separately for merge/production actions. Maintain fork main unchanged until that approval. + +--- +# CURRENT MANAGER STATE — fork/upstream v0.1.7 trial accepted, not integrated (2026-11-04 ~08:17 Dublin) + +**Supersedes earlier “eight conflicts blocked” status below.** The isolated fork/upstream reconciliation trial has now **resolved seven actual conflicts** against pinned upstream v0.1.7. The historical eighth did not recur. All conflicts were resolved in [isolated branch](https://github.com/jermur788/t3code/tree/integration/fork-upstream-reconciliation-trial-20261104), which is a **clean descendant of fork main** and contains the true two-parent upstream merge. Fork main still unchanged. The gate experiment is **not** part of this branch. + +**Evidence:** user-provided worker handoff and committed [routing/verification ledger](https://github.com/jermur788/t3code/blob/integration/fork-upstream-reconciliation-trial-20261104/docs/orchestration-v2/fork-upstream-reconciliation-routing-ledger-20261104.md). Local worker reports 40-package typecheck, web build, 81 files/2072 tests in check:changed and context-budget snapshot 58519 bytes, all final PASS; independent Codex reviewer returned CLEAN. Manager inspected core MCP and capacity merges, test-layer union and branch ancestry; **did not rerun tests**. No GitHub-hosted branch checks found; don't invent CI PASS. [Detailed manager acceptance](manager-fork-upstream-reconciliation-acceptance-20261104.md). + +**Decision:** isolated reconciliation candidate **REVIEW PASS / ACCEPTED FOR NEXT INTEGRATION GATE**, **NOT INTEGRATED into fork main**, **NOT production VERIFIED**. Still need rendered UI route inspection, restart/cross-project isolation with new recovery internals, Evidence V0 after upstream pruning, and final main-promotion review. [Bounded read-only/isolated verification handoff](task-verify-reconciled-v017-before-main-20261104.md) prepared; no worker dispatched by browser manager. + +**Latest upstream:** current main was one additional commit ahead of pinned v0.1.7 at browser check. Maintain pinned release baseline for this candidate; do not mislabel as fresh upstream main. Newer changes need separate future sync if adopted. + +**Product authority:** User explicitly approved default-off experimental gate D1, best-effort only in isolated experiments D3, shipping exclusion D2 and strict production revocation D4. User has **not** approved a new fork-main PR or direct main update. **Recommended next user choice: fork-only draft PR against main** (review and CI surface, not merge) vs direct fast-forward. Manager recommends draft PR due extensive upstream changes and missing UI/restart qualification. No PR has been created. + +**Status:** IMPLEMENTED (reconciled branch) / STATIC+RUNTIME PASS (local worker reports) / REVIEW PASS (narrow independent source) / INTEGRATED NO / PRODUCTION VERIFIED NO. Separate continuation gate branch remains reviewed but isolated. + +--- +# CURRENT MANAGER STATE — 2026-11-04 after default-off gate review + +**This section is current and supersedes older T0–T5 “ready” or decision-pending language below.** User-approved D1/D3 work was implemented and reviewed in the isolated gate branch; D2/D4 remain binding release requirements. + +**ACCEPTED IMPLEMENTATION:** [Default-off experimental continuation gate](https://github.com/jermur788/t3code/tree/experiment/continuation-default-off-gate-20261104), **IMPLEMENTED / worker-local RUNTIME PASS / independent T2 and T5 worker REVIEW PASS / independent manager SOURCE REVIEW PASS** limited to experimental default-off surfaces. Never mark main INTEGRATED/VERIFIED: fork main unchanged. 13 Project Runtime files, 192 tests passed per local host evidence; 39-package typecheck and `check:changed` also reported passing. Manager independently fetched source diff and tests, not raw local logs/host runtime. [Detailed manager gate review](manager-gate-branch-review-20261104.md). + +**BLOCKED FOR INTEGRATION:** new fork/upstream combined tree not validated. Prior local trial produced 8 pre-existing fork-vs-upstream conflicts outside candidate continuation files. Manager checked newer upstream changes after trial, including Orchestrator and adapter modifications; reconnection required. Root local filesystem was reportedly 100% full; use external-volume worktree after fresh disk preflight, no unapproved cleanup. + +**NEXT AUTHORIZED TASK:** Separate [bounded fork-upstream reconciliation packet](task-fork-upstream-reconciliation-20261104.md) on [manager-prepared isolated trial branch](https://github.com/jermur788/t3code/tree/integration/fork-upstream-reconciliation-trial-20261104), **not dispatched by browser manager**. The trial branch now has a [routing/conflict ledger seed](https://github.com/jermur788/t3code/blob/integration/fork-upstream-reconciliation-trial-20261104/docs/orchestration-v2/fork-upstream-reconciliation-routing-ledger-20261104.md), and no local code/conflict resolution is claimed. DeepSeek coordinator on real T3 host, with separate code ownership and independent Codex/Claude review for sensitive conflicts. Authorized only on isolated branch; no main merge/upstream push/PR/production provider enablement. + +**D2** remains accepted shipping exclusion: public release cannot contain the experimental agent-facing continuation surface or its +646-byte tool-budget increase. **D4** remains accepted strict post-revocation release requirement, but the architecture defining the linearization boundary and authority source is **PRODUCT DECISION / DESIGN REVIEW REQUIRED**. T4 memo suggests atomic durable run-creation guard against existing task revisions and defense-in-depth provider turn-start cancellation. No upstream engine change/new authority store is authorized yet. + +**Routing/state:** T3 local worker ledger reported DeepSeek writing; independent Claude Opus 5.5 reviewed and Codex GPT-6.1 Sol accepted after the first reviewer route was rate-limited. These are host-reported actual routes with limited browser validation. New reconciliation ledger is seed-only and must be updated with real dispatch, rejected candidates, retries and results. + +**Stop/decision policy:** Continue bounded upstream reconciliation safely; do not decide release semantics or provider execution engine by assumption. User approval is required for material changes to upstream command/effect core, new authority table/epoch, public merge/release and significant infrastructure cost. + +--- +## Accepted staged product decisions — 2026-11-04 01:09 Europe/Dublin (CURRENT) + +**This section supersedes the earlier “product choices pending” language below.** The user explicitly **approved both recommended staged directions**. They are now **ACCEPTED DECISIONS**, not research or proposals. + +- **D1:** Implement default-off server-side gating NOW for the isolated synthetic continuation experiment, across new policy writes, automatic reconciliation and pending-receipt launch/replay. A server operator may explicitly enable testing; agent/task data cannot enable the global gate. +- **D2:** Before any public shipping release, exclude experimental continuation and its agent-facing tool-schema overhead. The experimental +646-byte MCP budget increment is tolerated **only on the isolated, unmerged experiment branch**. It is **not** a public release budget acceptance. +- **D3:** Existing best-effort authorization recheck + cancel/reconcile is accepted for isolated stub-only experimentation; known final-check/external-launch window remains a documented limitation. +- **D4:** Production requires strict no-new-run-after-committed-revocation. This is a **release requirement** and separate design/verification gate, not authorization to change upstream execution internals now. +- **D5:** Fork main merge, production enablement, upstream post/PR and real-provider usage remain NOT AUTHORIZED by this approval. + +**New governing source:** [Staged continuation safety spec](continuation-staged-safety-governing-spec-20261104.md). +**Active bounded T3 task:** [Default-off implementation, independent review, safe upstream reconciliation, strict revocation research](task-handoff-staged-continuation-safety-20261104.md). +**Writable task branch:** [Dedicated default-off gate experiment](https://github.com/jermur788/t3code/tree/experiment/continuation-default-off-gate-20261104), created by manager from published overnight branch; **no implementation written yet** at this checkpoint. Worktree ownership/repo status must be inspected by local worker before writes. + +**New upstream reconnaissance snapshot:** upstream main advanced 14 commits beyond the prior trial base at manager check 2026-11-04 01:10 UTC; changes include mobile/UI and Claude-provider code. This does **not** establish merge compatibility, override the 8 historical fork conflicts or authorize a rebase. Fetch again before local trial. [Current upstream main](https://github.com/pingdotgg/t3code/tree/main). + +**Manager routing/continuation:** browser manager completed source inspection, decisions/spec/task and branch creation; cannot run a local T3 Code worktree or local TypeScript test suite from this browser/GitHub connection. Code and tests are therefore assigned to isolated local T3 Code. Route actual worker and independent reviewer through T3 host; log each decision/route/attempt in Runtime if exposed, otherwise branch-local ledger. No live background task is started by the browser. + +**Next exact action:** T3 Code starts the complete accepted task packet on the already-created gate branch, then returns verified evidence for manager reconciliation. No further product choice is needed for T0–T5 while operating under these constraints. + +# Overall Manager reconciliation — DeepSeek overnight queue + +**Date:** 2026-11-04 (Europe/Dublin) +**Decision authority:** user. +**Source of implementation truth:** published GitHub branch, inspected code changes and test source; local test logs and subagent receipts remain in T3 host / local files, not mounted in this browser session. +**Overall status:** **IMPLEMENTED; local RUNTIME PASS (worker-executed, documented); independent local reviewer REPAIRS PASS; manager SOURCE SPOT-REVIEW PASS for narrow overnight fix; NOT INTEGRATED; NOT PRODUCTION ENABLED; PRODUCT DECISIONS PENDING**. + +## Evidence fetched and reconciled + +- [Overnight published branch](https://github.com/jermur788/t3code/tree/overnight/deepseek-continuation-20261104), fetched through the GitHub connector. At review the branch head matched the user's handoff and fork main was unchanged. +- [Authoritative overnight completion handoff](https://github.com/jermur788/t3code/blob/overnight/deepseek-continuation-20261104/docs/orchestration-v2/overnight-morning-handoff-20261104.md). +- [Routing and child supervision ledger](https://github.com/jermur788/t3code/blob/overnight/deepseek-continuation-20261104/docs/orchestration-v2/overnight-deepseek-routing-ledger-20261104.md). Entries 0001–0011 include chosen provider/model, alternatives rejected, reasons, dispatch, completion and reviewed remediation; the initial static stage registry in the same append-only document is superseded by completion events and final handoff. No active agents remained according to the terminal worker record; browser manager cannot inspect the host session's live status. +- [Upstream compatibility report](https://github.com/jermur788/t3code/blob/overnight/deepseek-continuation-20261104/docs/orchestration-v2/overnight-upstream-compatibility-20261104.md), [F4 decision memo](https://github.com/jermur788/t3code/blob/overnight/deepseek-continuation-20261104/docs/orchestration-v2/overnight-f4-gate-decision-memo-20261104.md) and [operator checklist](https://github.com/jermur788/t3code/blob/overnight/deepseek-continuation-20261104/docs/orchestration-v2/overnight-operator-checklist-20261104.md). +- Inspected the actual overnight code-fix GitHub diff. The public continuation request-key prefix guard is now case-insensitive; the repair budget's SQLite query now uses case-sensitive `GLOB`; dedicated case-variant regression tests are present. The bounded overlap test is correctly named as *re-entry after existing receipt*, not a full simultaneous-insert proof. Launch-time withdrawal is documented and tested as a **known failure mode**, not a security fix. + +## Stage verdicts + +- **O0 DONE:** isolated clean worktree and actual no-op child wake confirmed in reported host evidence. Project Runtime task store was not exposed to this T3 session; branch-local ledger is the authoritative fallback, NOT a Runtime task/receipt claim. +- **O1 local RUNTIME PASS:** 39 focused tests, 179 Project Runtime tests and typecheck passed on the pristine candidate. An initial `check:changed` run raced O2 edits into the same worktree, violating intended serial gating; coordinator classified this self-inflicted failure, repaired format/lint, and reran complete final gates. Treat final rerun, not in-flight baseline check, as evidence. +- **O2 bounded pass:** idempotent re-entry test and characterization of final-check/external-launch cancellation race. This **does not prove a truly simultaneous insert nor strict no-launch-after-revocation semantics**. +- **O3 research:** upstream merge trial at the recorded upstream base found 8 pre-existing fork/upstream conflicts; no continuation-owned conflict observed in that trial. No merge or compatibility certification. +- **O4 decision memo:** F4 default-off server gate vs build exclusion vs operator-only surface, context delta +646 bytes from previous snapshots, revocation alternatives. **Research not adoption.** +- **O5 independent local review pass after repair:** host report identifies `claudeAgent` / Claude Sonnet 5.5 review + delta re-review, no code written by reviewer. One new case-variant budget defect and docs/test wording were corrected. Final worker reports 42/42 focused tests, 182/182 projectRuntime tests, typecheck 39/39 and `check:changed` exit 0. Independent reviewer ran a 25-test security file and context-budget 1/1; browser manager **has not independently executed local suites**. +- **O6 partial read-only:** checklist and missing-test inventory; no public upstream PR action. + +## Routing reconciliation + +Coordinator chosen: local `opencode` DeepSeek V4.1 Flash, as requested. Independent review: `claudeAgent` Claude Sonnet 5.5, high effort; re-review by same reviewer allowed because reviewer did not edit code. Alternative routes and rejection reasons are in ledger. The one local format/lint correction did not require two *failing* attempts or a stronger solver; “two attempts before giving up” is a recovery rule, not a mandate to spend on solved problems. Token/cost total and quota were not measured; do not invent them. T3 host confirmed completion wake on a no-op child and both review tasks in local report, but no persistent Project Runtime task store was exposed. + +## Current open blockers and non-claims + +1. **PRODUCT DECISION F4:** `synthetic` label is not default-off; candidate remains unmerged. Option A: default-off server enforcement (reversible, leaves +646 model-facing tool-list bytes). Option B: exclude feature from shipping builds (removes model-facing cost but needs build/contracts work). Option C: operator-only / remove agent-facing exposure (potential partial savings, requires measuring). The O4 memo recommends A for in-tree experiments and B before any public release. Not yet user-approved. +2. **PRODUCT DECISION REVOCATION:** best-effort final recheck + reconciliation (one turn may still start in race) vs strict atomic no-new-launch-after-withdrawal (likely requires upstream execution-core cooperation). Neither a new guarantee nor a product choice is adopted. +3. **UPSTREAM COMPATIBILITY / INTEGRATION CONFLICT:** 8 conflicts at the trial base are unrelated to candidate continuation files. At manager check upstream had advanced beyond that base; a two-commit comparison immediately afterward changed web terminal/settings files only, but upstream continues moving. Always refetch before any trial merge and test the complete merged tree. +4. **REVIEW REQUIRED:** live provider/model, UI/operator notification, true simultaneous insertion, cross-project isolation and legacy malformed receipts remain unqualified. “Blocked task” is not an outbound notification. Historical malformed rows are not retroactively scrubbed. +5. **EVIDENCE LIMIT:** worker-executed local tests and reviewer claims are supported by committed handoff/ledger and source inspection; raw local logs and live T3 host state were not independently fetched or replayed in this manager session. Do not describe this as mainline VERIFIED or independently executed by browser. + +## Upstream PR #28777 — separate tracked contribution + +[Our posted test contribution](https://github.com/pingdotgg/t3code/pull/28777#issuecomment-6616620085) received [acknowledgement from the PR author](https://github.com/pingdotgg/t3code/pull/28777#issuecomment-6618573858) on 2026-11-03. The author merged latest upstream main into the PR branch, which remains open/unmerged at manager check. The PR changed-file list still does NOT include our `DelegatedCompletionDelivery.test.ts` patch. No further public comment authorized or needed now; monitor read-only until a request/meaningful change. + +## Next authorized manager actions + +**Can proceed without decisions:** read-only upstream delta inspection, prep a separate isolated fork-main/upstream reconciliation task, preserve conflict evidence, prepare acceptance/CI/test plan and reviewer checklist. Any actual repo merge, source-branch rebase, publishing a PR, production gate, agent budget acceptance or revocation contract implementation waits on the respective authority and safe owned lane. No reset/stash/force-push or cleanup of existing worktrees. + +**Need user choices (not yet made):** +- F4 for experimentation and shipping: A now and B before release vs B immediately vs operator-only C; specifically whether temporary +646 bytes is acceptable on an *unmerged experimental branch*. +- Revocation service contract: best-effort/reconcile as experiment-only vs strict no-post-revocation-launch as a production requirement; strict requires architecture feasibility review, not an automatic upstream core edit. +- Later, whether to open a draft fork PR after compatibility work. Not needed now. + +**Suggested bounded next T3 handoff AFTER decisions:** one isolated integration/reconciliation owner, fresh fork/upstream bases, resolve the 8 pre-existing conflicts without touching main, check V2 execution semantics, apply chosen F4 gate in owned branch, rerun relevant projectRuntime/agent-context/typecheck/format/CI-equivalent tests on *merged tree*, obtain independent review, return detailed handoff. Maintain NOT INTEGRATED until user approves merge and accepted verification. Security-sensitive revocation changes must have their own governing spec and separate code lane if strict semantics chosen. + +## Final checkpoint + +**REVIEW PASS** on local bounded continuation experiment per reported independent review; **RUNTIME PASS** on test-only stub scenarios per local execution; **NOT INTEGRATED**, **NOT VERIFIED FOR REAL PROVIDERS OR PRODUCTION**, **product choice outstanding**. No active local monitoring/scheduled agent was started by the browser manager. diff --git a/docs/orchestration-v2/manager-reconciliation-upstream-pr-28777-20261103.md b/docs/orchestration-v2/manager-reconciliation-upstream-pr-28777-20261103.md new file mode 100644 index 0000000000000..a155008647e82 --- /dev/null +++ b/docs/orchestration-v2/manager-reconciliation-upstream-pr-28777-20261103.md @@ -0,0 +1,113 @@ +# Manager reconciliation — completed browser review of upstream PR #28777 + +Date: 2026-11-03 +Status: LOCAL RUNTIME PASS EVIDENCE FETCHED / MANAGER SOURCE REVIEW PASS / NO UPSTREAM SUBMISSION + +## Final evidence gate — supersedes earlier access blocker + +The local evidence capture reported at 21:59 UTC has been published and checked through the GitHub connector. **This supersedes earlier statements below that corrected patch/log evidence was not accessible.** + +- [Corrected patch and local results](manager-pr28777-evidence-review-and-upstream-draft-20261103.md) independently fetched and source-reviewed by Overall Manager. The report contains 34/34 focused tests and exit-0 checks; the patch is a test-only one-file diff and checks the committed parent-run wake cohort. There was no independent execution rerun by the manager. +- **Current verdict:** local **RUNTIME PASS** supported by worker execution and retrieved evidence; manager **SOURCE REVIEW PASS**; live model-choice / provider-session / MCP request-key qualification NOT RUN. +- Public upstream communication and merge remain **NOT AUTHORIZED / NOT DONE**. [Ready-to-post but unsent feedback](manager-pr28777-evidence-review-and-upstream-draft-20261103.md) is stored. Next stop is for user approval to post to existing PR; no further local testing is required for the narrow test-only contribution unless the author or maintainer asks. +- Existing worktrees remain intact. No cleanup authorized. + +## Received handoff and evidence + +Independent browser review finished on [its separate research branch](https://github.com/jermur788/t3code/tree/research/pr-28777-continuation-regression-20261103), after the [task packet](browser-handoff-b-upstream-pr-28777-20261103.md). + +- [Complete browser review and local test handoff](https://github.com/jermur788/t3code/blob/research/pr-28777-continuation-regression-20261103/docs/orchestration-v2/research-pr28777-browser-review-handoff-20261103.md) +- [Original-interrupted regression patch](https://github.com/jermur788/t3code/blob/research/pr-28777-continuation-regression-20261103/docs/orchestration-v2/research-pr28777-original-interrupted-regression.patch) +- [Upstream original PR](https://github.com/pingdotgg/t3code/pull/28777), still OPEN/unmerged at this reconciliation; reviewed head unchanged. + +No source files were patched in the fork or upstream by this worker: the new test is stored as a standalone `.patch` artifact. Review claims no local build/test execution, no paid model calls and no public comments. This agrees with inspected GitHub commit contents and PR status. + +## Substantive findings + +1. Existing instruction fix is conceptually correct for explicit continuation of a settled interrupted local child in the **same child thread**, distinct from opening a fresh independent review. Parent task identity is not reopened; new child run/follow-up task is expected. +2. Upstream's existing follow-up table covers interrupted *follow-up outcomes*, but seeds the *original* child as completed; patch adds a focused original-interrupted case and duplicate command replay/parent wake/recovery assertions. Whether it passes has **not** been tested. +3. Two adjacent instruction problems, already noted in the existing PR discussion, warrant author attention: + - The `t3_pending_request` tool explicitly excludes permission approvals; a `pendingApproval` should lead to user authorization in the child context, not a tool-mediated answer. + - Remote/linked-environment children can have null local `childThreadId`, requiring the remote child identity in applicable send operations. Confirm actual remote transport support before claiming resolution. +4. Existing modeled tool-selection eval was configured/dry-run, not independently executed with providers. No evidence of improved model choice yet. + +## Review verdict and next action + +**TEST GAP / GUIDANCE CORRECTIONS.** Do not claim a runtime regression in upstream from this read-only evidence. Do not open a duplicate PR. + +**Earlier local test assignment (COMPLETED per 21:43 worker report; retained here as historical scope):** Local independent T3 Code test worker with **one writer, separate worktree**: +- inspect status/ownership and do not touch unrelated work; +- fetch the exact original PR branch/head from the upstream contributor's public fork; +- verify the raw regression patch applies with `git apply --check` before applying; +- run `vp test run apps/server/src/orchestration-v2/DelegatedCompletionDelivery.test.ts`, focused server typecheck/format/lint, plus replay and follow-up assertions; +- if the patch fails to apply or tests expose fixture issues, repair the *test-only* patch on an isolated branch without weakening acceptance criteria; +- report command logs, outcome, modified paths, evidence and whether a minimal test-only addition should be sent to the upstream author; +- do not post/upstream-push, amend the author's branch, spend model credits, integrate main or change product policy. + +The local test assignment was reported complete. The remaining operational gap is access to the corrected patch and actual logs in the manager environment. A full executable task packet, base/ref and focused assertions are in the linked review handoff. User approval is required for public posting. + +## 2026-11-03 local verification handoff received (21:43 UTC) + +**Classification: WORKER-REPORTED RUNTIME PASS / INDEPENDENT ARTIFACT INSPECTION PENDING.** The local worker returned an exact command/result handoff in manager chat. The file paths below are on the user's **local** machine and cannot be read by the browser-side manager or GitHub connector unless uploaded/pushed. Do not promote the status to independently VERIFIED or an upstream contribution. + +### Reported base, ownership and test evidence + +- Original upstream PR author's source head was fetched and confirmed unchanged against the review handoff. +- New isolated worktree: `/home/jer/dev/t3code-pr28777-test-20261103`; own branch `test/pr28777-original-interrupted-20261103`. No upstream author branch or upstream main was modified, no public comment, PR or push was made. +- `git apply --check` passed; patch applied to **one test file** only. +- `vp test run apps/server/src/orchestration-v2/DelegatedCompletionDelivery.test.ts`: **34/34 passed** per worker report. +- `apps/server` typecheck: exit 0; focused `vp fmt --check` and `vp lint`: pass. +- Local result record: `/tmp/opencode/pr28777/RESULTS.md`; corrected patch: `/tmp/opencode/pr28777/original-interrupted.corrected.patch`; logs: `test.log`, `typecheck.log`, `lint.log` in the same local folder. +- Worktree remains in place; no cleanup was requested or authorized. + +### Fault found and repaired + +The original browser-authored patch incorrectly accessed `wake.delegatedCompletion?.taskIds`. `ProviderContinuationRequest.delegatedCompletion` exposes `parentRunId`, `generation`, `messageId`; task IDs belong to the committed parent-run wake cohort. Local worker corrected the assertion to check same wake generation and message ID, and `taskIds` exactly containing only the new follow-up. It also corrected the test comment: repeated **command ID** is covered, not end-to-end MCP `clientRequestId` semantics. + +This was reported as a **TEST FIXTURE DEFECT**, not an upstream runtime implementation defect. The repaired test reportedly proves that an original task remains interrupted, the continuing task obtains a distinct run/task ID, replaying the same command ID does not create another follow-up, the parent wake identifies the continuing task and recovery does not create duplicate transfers/tasks. + +### Remaining uncertainty + +- **Not run:** MCP request-key end-to-end replay, live model tool selection, provider-native history/session reuse and full upstream CI. +- **Source concerns unchanged:** PR wording for `pendingApproval` versus `t3_pending_request`, and remote/linked child with null local `childThreadId`; both were already flagged in the upstream PR discussion and are **not new defects demonstrated by this local test**. +- **Evidence access:** browser manager checked its tool container for the local results, corrected patch and worktree; none was mounted. Logs and corrected patch are not yet verified from actual bytes. +- **Upstream status:** PR #28777 remains open/unmerged at last check. Re-check when preparing contribution. + +### Action and stop boundary + +1. Preserve the isolated worktree until verification material is durably captured; **do not automatically remove**. +2. The local worker should place the corrected test patch and a sanitized `RESULTS.md` (including commands, counts and selected log excerpts) into a **new unique file path on the existing research branch** or upload those two artifacts into the manager chat; no production source changes, upstream pushes or third-party credentials. A simple narrow follow-up task can accomplish this. Do not copy any private path contents or secrets from logs without inspection. +3. Overall Manager checks exact changed test and evidence before certifying the test-only contribution as ready to offer. Independent runtime re-run is optional for a single synthetic regression if artifact logs and exact base support the claimed result; no false stronger status. +4. Prepare polite, nonduplicative feedback to the **existing PR author** offering verified original-interrupted test evidence and pointing to the previously observed instruction issues. Do not open a competing PR. +5. **Stop for explicit user authorization** before making the public upstream comment or offering a patch on behalf of this project. Upstream merge, fork main integration and destructive worktree cleanup are not authorized. + +### Draft external feedback (NOT POSTED) + +> I independently checked the original-interrupted delegated-review case against this PR's current source in an isolated worktree. The focused completion-delivery suite passed after adding a regression case (34 tests total), and the server typecheck plus focused format/lint checks passed. The case checks that the original task remains interrupted, the new follow-up has a distinct task/run, repeating the same orchestration command ID does not duplicate work, the committed wake cohort names the follow-up, and recovery adds no duplicate transfers. This is not an end-to-end MCP request-key or live model-choice test. I can share the focused test-only patch and sanitized logs. I also noticed the pending-approval/tool-description and linked-environment child-identity questions raised earlier in this discussion remain relevant; these are separate from what the test proves. + +**Important:** Do not use the draft's `independently checked` wording in an actual public message until the manager can inspect the worker's corrected patch/logs, or attribute it explicitly to the local worker report. + + +## Bounded follow-up handoff — preserve corrected local verification evidence + +**TASK:** Publish corrected test-only patch and sanitized verification record to the **existing fork research branch** for the Overall Manager to inspect. **ROUTING:** T3 Code local code worker with access to the existing completed local test worktree and `/tmp/opencode/pr28777/` artifacts; this cannot be completed by the GitHub-only browser connector because paths are not mounted here. + +**BASE/CONTEXT:** Upstream PR #28777 current state, unchanged PR source version as recorded in the preceding worker report. Existing local isolated worktree `/home/jer/dev/t3code-pr28777-test-20261103`; current branch `test/pr28777-original-interrupted-20261103`. Research destination `jermur788/t3code` branch `research/pr-28777-continuation-regression-20261103` (already exists). Manager record: this document, and original browser research handoff on the research branch. + +**SCOPE/OWNERSHIP:** Read-only source/runtime evidence export plus at most two **new** files in `docs/orchestration-v2/` on the research branch: (1) exact corrected `.patch`, (2) sanitized local test `RESULTS.md` with focused commands, actual output summaries and file lists. Preserve the original patch and reviewer handoff unchanged. One documentation writer. Other task code lanes unaffected. + +**PREFLIGHT:** Inspect both repositories/branches, working-tree cleanliness, untracked changes and other running writers before writable Git operations. Refresh remote research branch to avoid overwriting newer research. Do not reset, stash, force-push, delete or clean any worktree. Confirm file contents contain no secrets, tokens, private project strings or irrelevant machine paths beyond benign reproducibility information. + +**ACCEPTANCE:** Corrected patch contains the repaired wake-cohort assertion rather than `ProviderContinuationRequest.taskIds`; exact one-test-file scope; evidence document cites focused run 34/34, server typecheck/format/lint results and paths to full local logs, and distinguishes command-ID replay from MCP request-key replay. Link the original PR source version and the captured local test worktree base. Any unavailable log content is marked unverified, never fabricated. + +**VERIFY:** Fetch the two new GitHub research files back through the connector and confirm exact content; report source/local test status and changed paths. Optional single focused test rerun if the already-reported output cannot be tied to the corrected patch. The write is evidence capture, not a new upstream code contribution. + +**OUT OF SCOPE:** No upstream author branch modification, public PR review/comment/issue reply, new standalone upstream PR, merge to main, production changes, paid model calls, or deletion of the existing worktree. + +**STOP:** If research branch moved with conflicting files or local logs have secrets, stop with the conflict. Public sharing and any cleanup remain operator-authorized. + +**RETURN:** VERDICT; exact changed research files/URLs; source base and captured test log evidence; bytes checked and sensitive-data screening; remaining untested cases; upstream posting recommendation; user authorization still required. + +## Coordination + +Task A (fork synthetic continuation) is separate and unaffected, on its own isolated code lane. Task B's completed source review is accepted as context, **not proof** of PR correctness. Keep the review result canonical via this note and do not overwrite the worker's independent branch. PR #20 remains a draft research collection, not an integration request. diff --git a/docs/orchestration-v2/manager-stage-r-return-reconciliation-20261106.md b/docs/orchestration-v2/manager-stage-r-return-reconciliation-20261106.md new file mode 100644 index 0000000000000..161aeba84630f --- /dev/null +++ b/docs/orchestration-v2/manager-stage-r-return-reconciliation-20261106.md @@ -0,0 +1,44 @@ +# Overall Manager — G-U ledger audit and Stage R return reconciliation + +**Received:** 2026-11-06 10:11 local user-provided authoritative DeepSeek/T3 Code handoff. +**Authority:** [conditional overnight U→R→H amendment](overnight-conditional-autonomy-amendment-20261106.md), [user-accepted D4 A+B](d4-accepted-revocation-contract-20261105.md), [Coordination/Handoff Protocol](../../02_COORDINATION_HANDOFF_PROTOCOL.md), [prior manager U qualification](manager-upstream-trial-return-reconciliation-20261106.md), [Current State](../../01_CURRENT_STATE.md). +**Manager verdict:** `G-U FINAL PASS (worker-reported durable ledger audit; browser cannot inspect host-local ledger)`; **`R IMPLEMENTED (worker-reported) / STATIC PASS (reported) / BOUNDED FULL-SERVER K1/K2 RUNTIME PASS (reported) / REVIEW PASS WITH FINDINGS (worker-recorded but NON-INDEPENDENT under overnight cross-provider rule) / G-R FINAL PROMOTION HOLD / H NOT STARTED / NOT INTEGRATED / NOT PRODUCTION VERIFIED`.** Do not count Stage R G-R FINAL PASS simply because the worker handoff labeled it so. + +## 2026-11-06 10:24 owner confirmation — supersedes previous Opus-authority finding + +**The user explicitly stated "i apporved opus" in response to the manager's claim of unauthorized Stage R Opus use. The manager therefore retracts that allegation.** The Stage R Opus 5.5 fallback is **OWNER-CONFIRMED APPROVED**; previous paragraphs asserting unauthorized use or lack of approval below are **historical and superseded**. The user's confirmation does not establish the earlier approval timestamp or cost, which should be recorded from actual routing evidence or UNKNOWN; it does not authorize unrestricted future Opus use or material paid calls. [Canonical clarification](stage-r-opus-owner-approval-clarification-20261106.md). + +**Unchanged G-R gate:** the Stage R implementation was Claude Opus and the reported review was another Claude account/context. The overnight acceptance criterion still requires a genuinely *different provider* independent read-only review (e.g. Codex SOL Medium) plus truthful dispatch-versus-continuation budget accounting. **G-R FINAL HOLD remains, but solely for those review/budget checks; there is no Opus-authority deviation.** No H started or main integration authorized. + +## 1. G-U ledger audit closure (reported, not locally reproduced by browser) + +- DeepSeek reports auditing a restricted U ledger against actual T3 Runtime provider records and subscription settings. All **five** trial assignments were reconciled: three Codex SOL medium implementation/testing/typecheck dispatches on `ChatGPT - OpenAI B` and two Claude Sonnet 5.5 medium independent reviews on `Claude A`. +- Report says previously missing subscription names, exact dispatch times and Claude quota details are **explicitly RETROSPECTIVE**; provider-reported Claude A quota allowed, 5-hour 1–7% remaining and seven-day 37–38% remaining as of recorded window; Codex B allowance/reset UNKNOWN. +- Report says the append-only U ledger was durably saved (372 lines and checksum), and `G-U FINAL PASS` appended. **Browser manager cannot read local ledger or independently verify checksum**, so this is accepted as `WORKER-REPORTED DURABLE G-U PASS` with provenance, not as independently browser-audited. +- Source-checkpoint issue: worker handoff claims 2026-11-06 manager reconciliation, overnight amendment and related docs were not found in local checkout, trial worktree, local branches or planning branch. **Browser independently fetched these exact documents from remote `jermur788/t3code` branch `planning/resource-efficient-continuation-20261103` on 2026-11-06**; they **do exist there**. Their absence on worker host indicates a stale/unfetched/incorrect local planning ref or lookup, **not missing published authority**. This matters for the unauthorized Opus routing below. Before future dispatch, retrieve the current full authoritative amendment from the remote planning branch or the manager's complete handoff, without modifying primary checkout/user branches. Do not copy private logs there. + +## 2. R isolated implementation return (reported) + +- **Owned branch/worktree:** `stage-r/continuation-d4-20261106` on `/home/jer/dev/stage-r-continuation-d4-20261106`, derived from accepted frozen U trial `c037460c2f4a98e8c8f849928c92af6cb80e3d80`. Final local head `90f2f2d254b901a7b424474c615ac6dc69f945ec`, **four local commits**, clean, **33 paths / +8613/-95**, no remote/push/merge. Fork main remains `fb67545d790c5c001e8f85827f219ab6493c435e` as independently re-fetched. Browser GitHub branch lookups for U and R returned `NOT_FOUND` as expected for unpushed local branches; **browser manager has not inspected R source, diffs, local tests or private review logs**. +- **Accepted A+B report:** default-off only if `T3CODE_EXPERIMENTAL_CONTINUATION=1` explicitly set; transaction-time guard prevents new durable continuation run after committed operator revocation, prepared-run release/start fails closed for unstarted runs, claimed starts `reconcile_required`, late fail idempotent and replay safe. +- **Tests:** full combined server-root D4 K1/K2 **8/8 PASS** (revocation before run/create/setup/release), worker focused Runtime/continuation **206/206**, reviewer focused **210/210 over 13 files**, server typecheck passed; reported `check:changed` all phases green including format/lint/knip/GraphQL, typecheck 36 packages and **22 files/294 tests PASS**. No full CI, native/mobile, real provider release smoke or packaged deployment. All results are **worker-reported**, not browser executed. +- **Review trajectory:** first review FAIL with **B1 worktree leak, M1 mutable review target and M2 agent-visible policy**; first repair resolved B1/M2 but second review FAIL discovered further M1 bypass (blocked source/completed attempt). Second repair reportedly closed M1 and additional async terminal/feature-gate paths. Final narrowly scoped review PASS WITH FINDINGS, no reported reachable bypass. Residual: direct DB/storage write forged completed-attempt handoff guarded by policy lock, two untested fail-closed mutations, default-on/UX stall gaps (not authorized to turn on), small carry-forward nits. Record these as **reviewer-claimed closure**, not independently accepted cross-provider approval. + +## 3. Historical review and authority concerns — Opus concern superseded; cross-provider G-R HOLD remains + +**A — cross-provider independent review not demonstrated.** Latest [overnight amendment §6](overnight-conditional-autonomy-amendment-20261106.md) is explicit: independent read-only reviewer must be a **different provider/model**, and **if only same-provider reviewers available, stop stage advancement**. Report says an **Opus 5.5 Medium fallback** performed R implementation, while a separate **Claude subscription/context** reviewed. Both are **Anthropic/Claude**; a separate account/context does **not** constitute a different provider. This invalidates the stronger `G-R FINAL PASS` verdict under the actual accepted gate, even though local reviewer tests passed. It needs one truly **cross-provider read-only review** of the exact R final source and evidence, e.g. **Codex GPT-6.1 SOL Medium** if a compliant subscription is available, or an explicit new user decision changing the independence requirement. No need to rerun full U or R tests just to close reviewer identity. + +**B — Opus not authorized in overnight amendment.** The same amendment says `No Opus or material paid calls without user approval` and restricts technical implementations to Codex SOL Medium / Claude Sonnet Medium. [Stable Protocol](../../02_COORDINATION_HANDOFF_PROTOCOL.md) permits **exceptional** Opus escalation for hard concurrency/security cases, but the **newer/more specific overnight instruction supersedes it**, and the handoff's sharing-limit failure is not itself proof that security escalation conditions/approval were satisfied. The worker's statement `your Opus fallback was used as authorized` is a **claim**, but the browser manager finds no documented **separate user approval** in the governing sources. Record **`ROUTING-AUTHORITY DEVIATION / REVIEW REQUIRED`**, preserve evidence of who/when/why selected Opus, whether paid spend occurred (worker states no paid API calls), and **do not use Opus again without explicit owner approval**. Do not treat past Opus use as retroactive user consent. + +**C — dispatch budget and continuation accounting.** Report counts **13 distinct technical/reviewer assignments** (U five, failed Codex one, R seven) against the overnight maximum **18 technical/reviewer DISPATCHES**. **Five nominal dispatches remain** if the seven same-lane turns truly were continuations of existing worker assignments; they do **not automatically become seven new dispatches** without inspecting provider/session lifecycle records. However, their model capacity usage is real. The handoff reports **seven additional same-lane continuation turns**; if any were actually fresh new task assignments, recalculate budget and potentially STOP at cap. The orchestrator must inspect the durable per-attempt ledger and classify by real dispatch vs resume semantics, not choose a favorable count. Two R bounded repair/re-review cycles already consumed; no third repair cycle is authorized by the overnight policy. + +**Overall G-R status:** **`R IMPLEMENTED + LOCAL TESTS PASS / G-R CROSS-PROVIDER REVIEW REQUIREMENT NOT MET / ROUTING-AUTHORITY DEVIATION RECORDED / G-R FINAL PASS NOT ACCEPTED / H PROHIBITED`.** These are **governance/review verification gaps**, not a demonstrated new code defect from the reported test suite. The new user message reports the candidate is stopped with no H; retain this as current execution truth. + +## 4. Next safe bounded action / no new product choice for routine review + +- **One local coordinator + cross-provider read-only review handoff**: [R independent-review and routing audit](handoff-stage-r-cross-provider-review-gate-20261106.md), **PREPARED / NOT DISPATCHED**. DeepSeek must fetch the actual remote planning amendment, inspect R final worktree/diff/ledger, verify Opus routing provenance and dispatch/resume count, and if an authorized **Codex GPT-6.1 SOL Medium** subscription is available assign **one READ-ONLY review of the exact immutable R tip**. Do not allow a Claude-family reviewer to substitute or use Opus again. Require an explicit reviewer `PASS` with no material findings and a durable gate entry before G-R FINAL PASS. Existing test evidence should be verified rather than needlessly rerun. +- **If cross-provider review fails, no Codex slot/cap remains, or new material issue requires a third repair/architecture change:** STOP `REVIEW REQUIRED / PRODUCT DECISION / OPERATIONAL BLOCKER` and return a precise user-facing choice. Do not invent acceptance. A permitted independent review is routine continuation within already authorized R scope, not a public merge authorization. +- **If cross-provider review passes and durable routing/budget audit is clean:** `G-R FINAL PASS` may be recorded. The **user's prior conditional local-only H authorization** remains applicable and may be exercised only if resource/reviewer budget suffices and existing accepted H criteria are satisfiable; **stop H** if not. H must be on another isolated branch with D2 agent MCP projection and disposable K3 recovery tests, independent reviewer; never production-shipping `VERIFIED` absent packaged authentic client test. +- **Forbidden:** fork-main merge, source Git push/public PR, upstream auto-refresh, default-on continuation, paid provider/Opus, new authority table/major architecture, destruction or modification of user's existing worktrees, private PR #21 evidence publication. Existing forks and private ledgers preserved; **D4 K1/K2 reviewed on old isolated branch** remain distinct from the new reported R test pass. + +**Final handoff distinction:** `G-U FINAL PASS (worker-reported)` / `R IMPLEMENTED + TEST PASS (worker-reported)` / `R INDEPENDENT CROSS-PROVIDER REVIEW HOLD + UNAUTHORIZED OPUS ESCALATION CLAIM` / `H NOT STARTED` / `NOT INTEGRATED`. diff --git a/docs/orchestration-v2/manager-stage2-browser-first-assessment-20261105.md b/docs/orchestration-v2/manager-stage2-browser-first-assessment-20261105.md new file mode 100644 index 0000000000000..d3f67dc571302 --- /dev/null +++ b/docs/orchestration-v2/manager-stage2-browser-first-assessment-20261105.md @@ -0,0 +1,47 @@ +# Overall Manager — browser-first Stage 2 orchestration assessment + +**As of:** 2026-11-05. **Status:** `BROWSER SOURCE REVIEW COMPLETE / PROPOSED D4 CONTRACT / D2 RESEARCH PLAN / THREE LOCAL HANDOFFS PREPARED, NOT DISPATCHED`. +**Scope:** read-only GitHub source/upstream/PR inspection and canonical docs on the existing planning branch. No product source change, fork-main merge, build, test execution, experiment enablement or paid provider call. + +## Live observed source/repo checkpoints + +- [Fork PR #21](https://github.com/jermur788/t3code/pull/21): CLOSED/MERGED, fork `main` remains `fb67545d790c5c001e8f85827f219ab6493c435e`. +- [Research PR #20](https://github.com/jermur788/t3code/pull/20): OPEN/DRAFT, **not integrated**; description has older checkpoint statements and must not override current State. +- Isolated default-off continuation experiment `experiment/continuation-default-off-gate-20261104`: `b3b8da54e0b8b184a1cf4e667d53e73e04f85074`, not contained in fork main; comparison vs current fork main reports `ahead 34, behind 336`, not a clean fast-forward. +- Current upstream `pingdotgg/t3code` main `337c5858c33bc7f8f6dfd391a2c279fa0f7e4d17`; incorporated upstream release-preparation parent `bb4afa5425c52104a9261fa2d022cb8ba2fcc099`; GitHub comparison reports **50 commits ahead**. Only 300 changed filenames were exposed by one compare response, so complete changed-path inventory remains a local follow-up. +- Current fork/upstream `apps/server/src/orchestration-v2/EventSink.ts` and `ThreadLaunchService.ts` blob contents matched exactly; `ProviderTurnStartService.ts` differs. Upstream changes include provider adapters, orchestrator, projections, MCP, SQLite initialization, provider context and tests. A clean updater is **not presumed**. +- The existing user-accepted D1 default-off experimental gate remains implemented/tested on its separate branch, while D2 is an unmet shipping acceptance gate and D4's exact stronger contract still requires product acceptance. No source writes to implement either. + +## Technical findings + +**D4 race source confirmed:** experimental `RuntimeTaskExecutionService.launchAttempt` rechecks permission before `runLaunch` but can lose authorization before new engine run creation. `ThreadLaunchService.launch` dispatches `message.dispatch` after creating/claiming a thread, and Orchestrator's event plan includes `run.created` plus provider-turn effects. `EventSink.commitCommand` commits command receipt, events, projections and outbox inside one SQL transaction; there is no continuation guard there today. Both fork/upstream EventSink sources currently match. Thus a **transaction-level predicate on the new run commit** is the preferred concept, not an additional preflight check, but same-DB/cross-connection atomicity must be proved locally. + +**D4 exact acceptance remains a product choice:** `run.created` durable commit as the no-new-run linearization (preferred) versus external provider start; separate handling for already-created/in-flight work. A new authority table, upstream engine contract, provider revocation guarantees, and production release were **not approved**. + +**D2 exposure source confirmed:** isolated experiment adds optional `continuation` to shared task contracts; MCP task tooling imports those contracts, so the schema can be advertised even when runtime gate is off. Existing historical +646-byte tool-schema delta is a worker report, **not remeasured on current build**. Current fork main excludes the experimental code but has not had an independently verified built `tools/list` shipping artifact check. + +**Reconciliation risk:** experimental continuation branch diverged after fork/upstream integration; upstream has moved again. Need bounded read-only merge preview and test map before any future implementation/integration authorization. + +## Browser-generated durable outputs + +1. [D4 proposed transaction contract](d4-transactional-revocation-proposed-contract-20261105.md): precise no-new-`run.created` invariant, guard placement, receipt replay, cross-process/checkpoint tests, product decision list. **PROPOSED, not implementation authorized**. +2. [D2 shipping source audit and build test plan](d2-shipping-exclusion-audit-plan-20261105.md): source schema exposure, options, genuine built MCP `tools/list` acceptance tests. **BROWSER ANALYSIS, built artifact NOT RUN**. +3. [D4 read-only feasibility packet](task-stage2-d4-atomicity-feasibility-20261105.md): one local technical worker + different-provider reviewer to prove SQLite transaction semantics, enumerate all run paths and generate precise red-before test plan. **PREPARED / NOT DISPATCHED**. +4. [D2 built-MCP schema audit packet](task-stage2-d2-built-mcp-shipping-audit-20261105.md): local stub/server build and actual `tools/list` measurement on main vs experiment, independently reviewed. **PREPARED / NOT DISPATCHED**. +5. [Upstream/experiment reconciliation preview packet](task-stage2-upstream-experiment-reconciliation-preview-20261105.md): read-only full 50-commit inventory and merge-tree conflict/test hotspot map; **no merge**. **PREPARED / NOT DISPATCHED**. + +## Browser vs local execution and task sequence + +**Completed in browser:** source inspection, current branch/PR/upstream comparison, D4/D2 proposal and review-ready specifications, fully bounded local test/handoff instructions, project-state reconciliation. Browser manager can continue inspecting public GitHub and writing canonical planning docs without T3 Code. No verified automatic T3 Code bridge exists. + +**Remaining local:** actual SQLite transaction concurrency proof, built MCP `tools/list`, provider stub run/restart/exit evidence, worktree ownership checks and full multi-commit Git conflict preview. These require workers using T3 Code and local worktrees. + +**Recommended safe execution sequence:** (a) dispatch read-only D4 feasibility and D2 built schema audit in **separate owned lanes**, (b) read-only reconciliation preview after head verification (can run parallel if ownership/capacity permits), (c) manager reconciles primary evidence/review and takes explicit D4 product contract decision, (d) only then issue or release a writable D4 implementation packet on isolated worktree, independently review, test and decide a *separate* integration step. D2 public-release build verification and production release always remain separate. DeepSeek **orchestrator only**, Codex GPT-6.1 SOL Medium / Claude Sonnet 5.5 Medium execution and different-provider/model review, with no invented capacity data or reset schedule. + +**No automatic dispatch from browser:** these are GitHub task packets, not live T3 Runtime launches. User or connected local T3 host must actually start a session; never call `PREPARED` an implemented or dispatched task. + +## Existing milestone integrity + +PR #21 evidence originals and sanitized 81-file candidate remain **PRIVATE by explicit user decision**; locally reported integrity 80/80 PASS with independent review, no public upload. Do not re-open evidence publication as a Stage 2 task. Fork main **INTEGRATED / POST-MERGE LOCAL RUNTIME PASS (worker-reported)**, **NOT PRODUCTION VERIFIED**. The browser did not copy private evidence. + +D2/D4 are release gates, not permission to bring isolated continuation onto main. No history rewrite, force push, main source write, branch merge, provider spending, public release or product intent reinterpretation occurred. diff --git a/docs/orchestration-v2/manager-stage2-three-lane-return-reconciliation-20261105.md b/docs/orchestration-v2/manager-stage2-three-lane-return-reconciliation-20261105.md new file mode 100644 index 0000000000000..852807f04e8bb --- /dev/null +++ b/docs/orchestration-v2/manager-stage2-three-lane-return-reconciliation-20261105.md @@ -0,0 +1,77 @@ +# Overall Manager reconciliation — Stage 2 three read-only qualification lanes + +**Received:** 2026-11-05 13:50Z, user-supplied completed DeepSeek/T3 Code handoff. +**Manager review:** browser source and live GitHub comparison performed on 2026-11-05. **Raw host-local evidence not available to browser manager**. Worker consolidated handoff reportedly at a restricted local `/home/jer/dev/stage2/ledger/HANDOFF-STAGE2-THREE-LANES-20261105.md`. No remote copy was inspected or published. +**Verdict:** `STAGE 2 READ-ONLY QUALIFICATION RETURNED`. Lane A `SCOPE-BOUNDED FEASIBILITY PASS (worker-reported)`; Lane B `SCOPED BUILT/TRANSPORT SCHEMA AUDIT PASS (worker-reported; NOT PACKAGED SHIPPING VERIFIED)`; Lane C `READ-ONLY RECONCILIATION PREVIEW COMPLETE (worker-reported)`. Each lane's independent review: **PASS WITH FINDINGS (worker-recorded)**, follow-up corrections applied. **Not D4 implemented; not D2 shipping verified; no source integration or production claim.** + +## Live base / provenance + +- [PR #21](https://github.com/jermur788/t3code/pull/21) remains integrated in fork `main` at `fb67545d790c5c001e8f85827f219ab6493c435e`, independently re-fetched by browser manager. +- Isolated `experiment/continuation-default-off-gate-20261104` remains at `b3b8da54e0b8b184a1cf4e667d53e73e04f85074`, 34 ahead/336 behind fork main, merge-base reported by local worker to be pre-merge fork main. No continuation integration. +- Upstream `pingdotgg/t3code` `main` remains `337c5858c33bc7f8f6dfd391a2c279fa0f7e4d17`, 50 commits ahead of incorporated upstream parent, independently checked through GitHub. The worker refreshed a stale remote-tracking upstream ref **without moving local main**. +- Worker reports clean primary checkout on feature/development-profiles branch; separate owned worktrees/lane artifacts left available for inspection. No commit, source edit, main ref movement, Git branch push, merge, public release, feature enablement, paid provider call, cleanup or evidence publication. +- Source references inspected in browser: `apps/server/src/orchestration-v2/Orchestrator.ts` has three direct `run.created` emitters around lines 6191, 6620, 7587; `ThreadLaunchService.ts` near 998 uses `dispatchMode: defer_start`, with initial run event near 1018; `EventSink.ts` near 635–711 commits events and effect outbox in a SQL transaction. This **corroborates the source paths**, but not the local process-level test output. + +## Lane A — D4 DB/launch feasibility + +**Worker-reported scope-bounded pass:** +- `packages/shared/src/nodeSqliteClient.ts` around 1251 uses `BEGIN IMMEDIATE`; `EventSink.ts` around 635 is the event-command transaction. Tested service subset on a **same file path and inode across separate processes**. +- A **test guard/fixture** with revocation committed first returned **0 new runs, 0 start effects, 0 receipts**; unguarded baseline produced **1/1/1**; replay did not duplicate. `red-before.mjs` intentionally exited 1 when the race reproduced; 16/16 barrier cases exited 0. This is evidence of feasibility, **not proof of an integrated run-create authorization hook** or the final denial behavior. +- **Crucial correction to browser proposal:** real initial `ThreadLaunchService` uses `defer_start`: commits a `preparing` run **with no `provider-turn.start` effect at initial creation**. A later `prepared-run.release` enqueues the start effect. The earlier pending start effect example was a fixture, **not a faithful full start lifecycle**. Therefore even strict guard on initial `run.created` does not automatically control a later prepared-run release after revocation. +- **Not proven:** full `server.ts` dependency/layer/root path, real `continuation:null` operator revoke transaction, typed auth-denial/receipt propagation, internal guard provenance and unforgeability, SIGKILL/crash/pruning/restart end-to-end, and packaged production provider-start behavior. + +**Manager disposition:** `D4 TRANSACTION FEASIBILITY PASS (worker-reported; subset only)`. Primary no-*new-run* boundary remains **PROPOSED**. Need a user-accepted contract for both (a) durable new-run commit and (b) pre-provider-start behavior of already-created `preparing` runs; do not silently infer strict stop from run commit alone. If no external `startTurn` guarantee is desired, still define a fail-closed best-effort cancellation/reconciliation policy before release. See [D4 proposal](d4-transactional-revocation-proposed-contract-20261105.md). + +## Lane B — D2 MCP schema and byte budget + +**Worker-reported audited source-loaded production transport with mocked services**, **not packaged release binary or paired-client full-server acceptance**: +- 79 tools enumerated in both trees; only **input schema** difference relevant to continuation is optional `continuation` on task create/update, reported +323 bytes / 18 property paths each. Four task tools gain +351 bytes of `outputSchema` apiece, **outside** the reported context-budget formula. Additional unrelated tool drift +12/+36/+84 bytes; avoid attributing all raw size change to continuation. +- Agent-context budget formula baseline **56,753 → 57,399 = +646 bytes**; committed budget **58,519 → 59,165**; raw transport JSON size **187,026 → 189,796**. Independent reviewer reportedly reproduced these numbers. The +646 finding is now a current **scoped measurement**, not only a stale historical snapshot. +- Current merged fork `main` advertises **no continuation field** in tested mocked/source-loaded transport; experiment advertises it **even while server continuation gate is off**. Browser manager independently re-inspected experimental shared task contracts with `continuation` and MCP project task tool inputs. +- **Not proven:** actual packaged public-release server, paired-client authenticated MCP enumeration, native/mobile schema, production provider handshake, final build budget or complete output-schema packaging. + +**Manager disposition:** `D2 SCOPED SOURCE-LOADED MCP AUDIT PASS (worker-reported)`; **`D2 SHIPPING VERIFIED = FALSE`**. For a future public release require an actual shipping/packaged artifact's built `tools/list` and authorized paired-client or equivalent production-authenticated enumeration, plus schema/byte budget release test. The mock-backed source transport audit is sufficient for architectural risk identification, **not** for final release certification. **Strategy B** (omit operator-only continuation fields from relevant MCP projection schemas, preserving internal authority) is the preferred design **if integration is later approved**, but requires exact source/contract verification and acceptance; no implementation authorized. + +## Lane C — merge/rebase preview + +- Worker reports **50 upstream commits / 610 changed paths / additions 23,931, deletions 26,742**, and **30 experimental paths** (10 documentation, 12 tests, 8 source). +- Local read-only merge-tree dry runs: experiment → merged fork main **1 conflict**; fork main → newest upstream **2 conflicts**; experiment → current upstream **9 conflicts**. These are **dry-run path counts**, not a promise that an actual integration is trivial. +- Browser independently compared refs and source: current fork/upstream `EventSink.ts` and `ThreadLaunchService.ts` match; Orchestrator, ProviderTurnStart, MCP/SQLite/provider adapters have drift. +- Worker's recommendation: future **upstream catch-up first, then re-land continuation as fresh bounded changes**, rather than merging divergent experiment into main. This is a **proposed sequence**, not authority to merge or change refs. +- Gaps: full per-commit replay not simulated; open upstream PRs were not inventoried in original worker return. + +**Manager supplementary browser search for OPEN upstream PR hotspots (non-exhaustive, and none are merged as of query):** +- [#30067 — asynchronous SQLite writer](https://github.com/pingdotgg/t3code/pull/30067): touches `nodeSqliteClient.ts`, persistence and foundational tests. **High relevance** to D4 transaction ordering; don't design on a future worker mechanism as though already integrated. +- [#18385 — cross-thread command receipt ID race](https://github.com/pingdotgg/t3code/pull/18385): touches `Orchestrator.ts` and receipt-race tests. **High relevance** to D4 replay/typed rejection. +- [#31466 — delegated child provider session release](https://github.com/pingdotgg/t3code/pull/31466): touches `Orchestrator`, EffectWorker/EffectOutbox and provider lifecycle. **Relevant** to in-flight provider-start/reconciliation. +- [#30864 — reader transaction round trips](https://github.com/pingdotgg/t3code/pull/30864): touches `nodeSqliteClient.ts`. **Medium** database concurrency relevance. +- [#31129 — scheduled task steer/restart modes](https://github.com/pingdotgg/t3code/pull/31129): changes ThreadManagement, scheduled task/MCP/contract and delivery modes. **Medium** path/provenance overlap, not same D4 operator continuation capability. +- [#31366 — scheduled task run failure outcome](https://github.com/pingdotgg/t3code/pull/31366): touches scheduled task, MCP tools/handlers and server. **Medium** task result provenance relevance. + +These **OPEN PRs are upstream proposals**, not incorporated upstream code. Search is a **risk-oriented shortlist**, not complete inventory of every open PR. + +**Manager disposition:** `PREVIEW COMPLETE (worker-reported) + OPEN PR HOTSPOT SCREEN (browser)`. No upstream catch-up or experimental re-land authorized. Exact latest refs/merge conflicts must be refreshed on any future writable worktree. + +## Review / ledger / operational conditions + +- Three local lanes reviewed **PASS WITH FINDINGS** with corrections reportedly applied; no browser access to original reviewer transcripts or host files. Worker reported all fetch/worktree/install commands exit 0, intentional red-before exit 1, barrier 16/16 PASS, wrong bearer 401, other probes exit 0. Do **not** misrepresent expected red-test failures as an implementation defect or elevate them to production PASS. +- **10 dispatches** across Codex and Sonnet workers/reviewers, no Opus, no quota error/failover, all remaining subscription allowance **UNKNOWN**. Some **Sonnet actual effort LOW despite MEDIUM requested**; persist actual instead of requested. DeepSeek remained orchestration-only. +- Worker reports `/media/jer/Files` mounted **read-only**, local root approximately **46 GB free** at report time and **four detached read-only lane worktrees still present**. This is a local operational state, not an instruction to remount, delete, prune or clean. No cleanup authorized; preserve until evidence/ownership confirmed and explicit non-destructive disposal scope is approved. + +## Manager decisions vs product decisions + +**Decisions the manager can make now without product architecture authority:** +- Accept **scope-limited research qualification** and close A/B/C read-only task packets as **completed** with detailed findings. +- Keep production/public shipping statuses `NOT VERIFIED`, keep continuation isolated, keep PR #21 evidence **PRIVATE**. +- Require packaged, real authorized MCP tool-list verification for release (mocked registry is sufficient for development risk finding only). +- Treat Strategy B as preferred *future* MCP schema projection approach, not an instruction to edit source now. +- Do **not** clean up worker worktrees or unmount read-only volume in this turn; they are retained as audit/debug assets. Do not repeat closed work. + +**Owner product/architecture decisions still required before writable Stage 2 code:** +1. Is D4's primary ordering guarantee defined at **durable new `run.created` commit** (recommended) or at external provider turn start (stronger non-transactional semantics)? +2. For already-created `preparing` runs awaiting `prepared-run.release`, should revocation **deny release/start where provably unstarted and reconcile uncertain attempts** (recommended) or accept that an already-created run may still start? Define observable in-flight states and operator stop policy. +3. Separately authorize **upstream catch-up** and (later) **re-landing isolated continuation**, each with own exact source, owner, tests, review and merge decision. Browser manager recommends proposing upstream reconciliation first, but has not begun it. +4. User chooses whether shipping build uses excluded experiment-only branch or explicit build-selected agent projection if future integration occurs. Existing D2 excludes experimental schema from public shipping regardless. +5. Cleanup of detached local worktrees or remount/unmount operations requires verified ownership/evidence and explicit safe scope; no destructive action assumed. + +**Next:** manager presents the two D4 contract choices for user acceptance. After accepted spec, prepare an isolated **one-writer D4 implementation packet**, independent review and targeted tests. No source edits or main merge until authorized. Upstream catch-up/re-land remain separately gated. See [Current State](../../01_CURRENT_STATE.md) and [Manager Handoff](../../OVERALL_MANAGER_HANDOFF.md). diff --git a/docs/orchestration-v2/manager-upstream-trial-return-reconciliation-20261106.md b/docs/orchestration-v2/manager-upstream-trial-return-reconciliation-20261106.md new file mode 100644 index 0000000000000..c864778cdce4a --- /dev/null +++ b/docs/orchestration-v2/manager-upstream-trial-return-reconciliation-20261106.md @@ -0,0 +1,41 @@ +# Manager reconciliation — completed isolated upstream catch-up trial and overnight gate + +**Received:** 2026-11-06 00:27 Europe/Dublin from user-provided worker/consolidated handoff. +**Authority:** [authorized upstream trial spec](upstream-catchup-isolated-trial-governing-spec-20261105.md), [conditional overnight U→R→H amendment](overnight-conditional-autonomy-amendment-20261106.md), [Coordination/Handoff Protocol](../../02_COORDINATION_HANDOFF_PROTOCOL.md). +**Manager verdict:** **`U IMPLEMENTED (worker-reported) / STATIC PASS WITH TIMEOUT CAVEAT / BOUNDED RUNTIME PASS (worker-reported) / REVIEW PASS (worker-recorded, independent provider) / LOCAL ISOLATED CANDIDATE ACCEPTED FOR NEXT-GATE EVALUATION / NOT INTEGRATED / NOT PRODUCTION VERIFIED`.** +**Overnight G-U technical gate:** **`TECHNICAL CRITERIA MET WITH DISCLOSED EXCEPTIONS`** per reviewed worker evidence, not independent browser re-execution. **`G-U PROMOTION HOLD — ROUTING-LEDGER CONTINUITY NOT YET VERIFIED`** under the user's later routing-log instruction. No R worker may be dispatched until the ledger is inspected, durable gaps faithfully reconciled, and gate signoff appended. No fork-main/source integration implied. + +## Evidence provenance and live ref corroboration + +- Worker reports fork authoritative `origin/main` `fb67545d790c5c001e8f85827f219ab6493c435e`, local stale `main` left at `d3bedef12a31f368e5c5a6b279445bea39a6a13a`; isolated `trial/upstream-catchup-20261105` at `c037460c2f4a98e8c8f849928c92af6cb80e3d80`, local worktree `/home/jer/dev/upstream-catchup-trial-20261105`, clean. Trial first incorporated selected upstream tip `25b53299b75d4d8d1d0667ad47e9cfed3749776e` in local trial merge `53226a2b2c9d3ff78a77e2bbe07299ea832e5c5b`, then one narrow fix commit. Browser re-fetched fork `main` and isolated old experiment at their known tips and found **no published trial branch**. The browser cannot inspect unpushed trial code or private worker logs, so no direct implementation/code review or test re-execution is claimed. +- Upstream **currently** `e945fcc50fb28b4f5bde72fa44d764db7f5a9b42`, **22 commits newer** than the trial's frozen selected tip (browser compare, at review time). This is source drift, **not a defect in the authorized frozen-source trial**. **Do not automatically chase/merge new upstream into U/R/H** under the overnight freeze; later integration needs a fresh source/merge decision. +- Worker reports **91 upstream commits, 780 changed paths, +30,839/−27,707**, final trial tree 781 paths +30,840/−27,708. Paths by area: server 200, web 139, mobile 138, client-runtime 66, desktop 31, contracts 15, provider-core 4; changes include Effect/tsgo, provider-instance IDs, Claude Ultracode and scheduled thread modes. Browser GitHub compare previously returned max 300 paths; therefore complete 780 inventory is **worker-reported**, not browser independently reproduced. +- Exactly **2 conflicting files** reported: `packages/client-runtime/package.json` retaining fork Runtime/development-profiles exports plus upstream provider-instance-IDs export, and `apps/server/src/provider/agentContextBudget.json` recomputed combined-tree budgets (Claude 7,476 / Codex 9,204 / MCP 58,799). One correction to fork migration 003 changes only a comment diagnostic from `preferSchemaOverJson` to `globalJsonInEffect` (worker-reported, no SQL/transform/order changes). +- Primary checkout, existing four Stage 2 detached worktrees, unpushed D4 branch, read-only Files mount and private PR #21 evidence were reported untouched. No public Git push/PR/main merge/deploy/experimental continuation re-land. + +## Static and bounded runtime verification — worker evidence + +- Fresh uncached typechecks **39/39 affected workspaces PASS**, no cache hits. Affected tests **367/367 files / 8,022 passing tests / 0 failures / 4 preexisting OS/opt-in skips**, completed as **29 sequential batches** (longest 189.2s). Evidence V0 and Runtime CAS/isolation suite **65 more PASS**, aggregate **370 files / 8,087 PASS / 0 failed / 4 skipped**. No tests weakened or new skipped tests reported. +- **Important caveat:** monolithic `check:changed` returned **exit 1 due solely to its 900s time ceiling on the 367-file test phase**; its other phases (format/lint, knip, GraphQL/React Compiler etc.) passed. The matching 367-file affected manifest was executed to completion in batches, and the independent reviewer reportedly rederived the manifest and totals. Therefore **accept equivalent test coverage for this bounded isolated trial** as `STATIC PASS WITH TIMEOUT CAVEAT`; **do not report a single green `check:changed`** or production/hosted CI. CI remains a later gate. +- Local isolated server launched/stopped three times against trial-specific temporary home/SQLite; authenticated RPC checked task revision CAS, stale writes, project isolation, actor provenance, Evidence export, handoff and persisted task/provenance/Evidence across process restart. 69 DB tables and `integrity_check ok`, two stub attempts correctly `reconcile_required`, one handoff, no continuation/D4 tables. Duplicate create/stop command receipts idempotent. +- MCP source/runtime enumeration reported **82 tools, 11 Runtime tools, no experimental continuation/D4 schema field**. This is adequate **for U baseline absence in bounded trial**, **not** D2 packaged authenticated public shipping verification for a future R/H branch. +- Bounded rendered web inspection of Runtime home and project settings with a screenshot; **native desktop/mobile/relay/live-provider streaming/crash recovery NOT RUN**. Wider 780-path behavioral coverage is necessarily partial; do not label full product verified. +- Reviewer **Claude Sonnet 5.5 Medium READ-ONLY** (different from Codex GPT-6.1 SOL Medium writer), two passes, final `REVIEW PASS`. Reviewer independently checked merge faithfulness, two conflicts, full affected-test manifest and totals, and resolved previous material findings; **could not independently prove negative claims** that no continuation/D4 source was imported and no live paid turns occurred. Non-ancestry/source audit and 69-table/82-tool observed absence support the negative source claim, but remain **worker-attested**, not fully independently reproduced. Record as evidence caveat, not falsely 'verified by reviewer.' +- DeepSeek V4.1 Flash orchestrator only. Writer Codex `OpenAI B` Medium **3 dispatches**, reviewer Claude `Claude A` Medium **2 dispatches**, no failover, no Opus/paid provider calls (worker report), actual subscription quotas/resets **UNKNOWN**. The private append-only ledger is reported at `/home/jer/dev/upstream-catchup-trial-20261105-evidence/LEDGER.md`; the report **does not establish ledger completeness for every routing decision**, nor show requested/actual effort and rejected/deferred routing options per decision. This is a **separate evidence gate**. + +## Evaluation against overnight G-U and authority reconciliation + +**Technical G-U:** two conflicts resolved, complete worker-reported upstream inventory, relevant typechecks/tests/runtime/restart/isolation/receipts/MCP/UI smoke, independent different-provider `REVIEW PASS`, no unresolved material issue. The single failed monolithic wrapper command is an **operational test-duration limit** and its entire selected test manifest passed in reviewed equivalent sequential batches. Manager provisionally accepts **`G-U TECHNICAL PASS WITH TIMEOUT CAVEAT`** for the bounded trial only. Existing nonportable Windows/Nushell and wide native/provider/relay paths remain out of trial coverage. The independent review's unproved absence claims remain clearly marked worker-supported. + +**Routing audit G-U:** latest user instruction required durable records for **each orchestrator dispatch/reroute/review decision**. The worker handoff gives a ledger location and 3+2 dispatch totals but not the individual entries; browser manager has no access to that local file. **Do not claim complete routing-ledger compliance.** Before sending a new R technical worker, DeepSeek must inspect the actual ledger through authorized tools/coordinator, verify that the 5 dispatch/review events and their choices/effort/quota/reasons are recorded, and append an explicit gate transition. If earlier decisions were never logged, append a **truthfully marked retrospective reconstruction** tied to returned worker transcripts, noting that it is not contemporaneous. If durable write or evidentiary reconstruction is impossible, stop as `OPERATIONAL BLOCKER — ROUTING LEDGER UNAVAILABLE/INCOMPLETE`. Never invent entries. + +**User authority:** User's earlier 2026-11-06 00:14 overnight amendment explicitly permits **local-only R re-land conditional on G-U** and H conditional on G-R; the current worker handoff's phrase "no continuation/D4 re-land ... authorized" describes what *that prior U-only packet did not authorize or start*, not a new explicit user revocation of the later amendment. However, nothing was started, and **no technical R dispatch is permitted while routing-ledger continuity remains unchecked**. The user has not authorized a public push/PR, fork-main merge, production or release. + +## Manager next steps and hard stops + +1. Mark **U original upstream trial COMPLETED**, no re-run, and preserve all local candidates/evidence. Update Current State/Manager Handoff to `STATIC PASS WITH TIMEOUT CAVEAT / BOUNDED RUNTIME PASS / REVIEW PASS` in isolated scope, `NOT INTEGRATED`. +2. Issue a **one-step, coordination-only route-ledger/G-U audit handoff** as a prerequisite to any R worker assignment. Do not repeat U's 8,087 passing tests. If ledger continuity verified and independently reviewed test manifest/reporter evidence remains credible, DeepSeek may mark **G-U FINAL PASS** and advance to R under the existing overnight local-only conditional authorization. The frozen selected upstream tip remains the U candidate; do not chase newest upstream. +3. For R, use a **new owned isolated worktree from accepted local U candidate** and fresh minimal default-off continuation+D4 A+B changes, never direct merge of old divergent experiment or unpushed D4 branch. K1/K2 full-root test and reviewer G-R mandatory; only on G-R PASS may H begin. Hard STOP after H. Updated [overnight amendment](overnight-conditional-autonomy-amendment-20261106.md) remains controlling. +4. Fork main `fb67545d790c5c001e8f85827f219ab6493c435e` and isolated experiment unchanged, no remote trial branch; code/logs local to user's host. No Git push/PR/main merge, broad rebase, live/paid-provider spend, real DB/test service disruption, private PR #21 evidence transfer or destructive Git. All are separate user decision points. + +**Precise stage result:** `U COMPLETE AND TECHNICALLY ACCEPTED WITH CAVEATS / ROUTING-GATE HOLD / R NOT STARTED / H NOT STARTED / NOT INTEGRATED / NOT PRODUCTION VERIFIED`. diff --git a/docs/orchestration-v2/overall-manager-transition-handoff-20261106.md b/docs/orchestration-v2/overall-manager-transition-handoff-20261106.md new file mode 100644 index 0000000000000..a74b707afce51 --- /dev/null +++ b/docs/orchestration-v2/overall-manager-transition-handoff-20261106.md @@ -0,0 +1,69 @@ +# New Overall Manager transition handoff — T3 Fork + +**As of:** 2026-11-06, after final U/R/H return (11:47 local) and live GitHub read. +**Authority/status:** **AUTHORITATIVE MANAGER TRANSITION ENTRYPOINT**, a navigation and state reconciliation record, not a new product decision, task dispatch or implementation. The user requested a manager transition; this document should let a new manager begin without rereading prior conversations. +**Project identity:** **T3 Fork** ("T Tree Fork" in the latest user request): upstream-friendly T3 derivative, with a provider-neutral, durable **Project Runtime**. Providers are replaceable workers, never owners of state. CCF/game development is the first use case; architecture remains generic. Separate open-source operations dashboard consumes documented T3 Runtime services/APIs and does not own truth. + +## 1. Mandatory read order and authority + +1. Project Instructions for T3 Fork and [Coordination/Handoff Protocol](../../02_COORDINATION_HANDOFF_PROTOCOL.md): execution authority, worker routing, durable handoff, privacy, safe Git. +2. [Current State/Roadmap](../../01_CURRENT_STATE.md): milestone, fork main, accepted decisions, gates and links. +3. This transition handoff, then [full Overall Manager Handoff](../../OVERALL_MANAGER_HANDOFF.md). +4. Active governing contracts: [staged continuation D1–D5 spec](continuation-staged-safety-governing-spec-20261104.md), [accepted D4 A+B](d4-accepted-revocation-contract-20261105.md), [final U/R/H evidence reconciliation](manager-overnight-urh-final-reconciliation-20261106.md). +5. For any specific next task, read its **exact current packet, active T3 Runtime task and authoritative private handoff**, then inspect actual repository, worktree and test evidence. Historical chats are supporting context **only**. + +**Precedence:** latest user instruction > accepted decisions > current milestone > governing spec for product intent; inspected repo/runtime > reproducible tests > docs > worker claims for implementation. Research/plans are not product decisions until adopted. The user makes product/security/architecture/merge/release/paid-cost decisions. No manager change may silently expand existing task authorization. + +## 2. Verified repository truth and candidate custody + +- GitHub fork: `jermur788/t3code`. **Fork `main` remains at the previously merged PR #21 evidence/Project Runtime baseline**, unchanged in the latest browser GitHub check on 2026-11-06. The local machine's `main` was previously stale and should **never** be silently moved/reset. +- Canonical planning/manager documents live on remote branch `planning/resource-efficient-continuation-20261103`, **NOT** on `main`. The previous worker initially claimed 2026-11-06 manager sources missing due to an unrefreshed local reference, then corrected this. Always resolve the remote branch explicitly rather than assume a local checkout is current. +- Upstream `pingdotgg/t3code` `main` is moving. **New browser comparison on 2026-11-06 shows 168 commits after the exact upstream checkpoint frozen for the U trial** (previously 22). This drift does **not** negate the completed U scoped qualification but invalidates assuming the old conflict list predicts a future merge. Before any integration, refresh exact upstream and fork refs, locally inventory complete diff/conflicts and requalify. +- Worker-reported local-only clean source lanes (NOT published to GitHub): **U** `/home/jer/dev/upstream-catchup-trial-20261105` (`trial/upstream-catchup-20261105`); **R** `/home/jer/dev/stage-r-continuation-d4-20261106` (`stage-r/continuation-d4-20261106`); **H** `/home/jer/dev/stage-h-d2-k3-20261106` (`stage-h/d2-k3-20261106`). U incorporates one intentionally frozen earlier upstream tip; R is fresh continuation+D4 on U; H is a **tests/fixtures-only** qualification on R. The browser checked those names are absent as fork remote branches; this is *consistent* with local-only worker reports, **not** direct inspection of the private source or cleanliness. +- Preserve prior local **D4 A+B** isolated branch/worktree, four detached Stage 2 worktrees, primary development-profiles checkout, stale local main and read-only Files mount. **PR #21 originals/sanitized evidence: KEEP PRIVATE**, no file reading/copying/transfer/publication without new authority. Never stash, reset, clean, delete, force-push or rewrite others' work. Verify owner/base/dirty state before each new code writer. One writer per overlapping lane. + +## 3. Current milestone: U/R/H locally qualified, overnight sequence CLOSED + +**Final reported verdict:** **`U G-U FINAL PASS` / `R G-R FINAL PASS` / `H ISOLATED INTEGRATION-READINESS CANDIDATE — REVIEW PASS` / `NOT INTEGRATED` / `NOT PRODUCTION VERIFIED`.** All the following results are **worker-reported** with independent re-runs reported by distinct providers, not reproduced in this browser. See [final manager reconciliation](manager-overnight-urh-final-reconciliation-20261106.md). + +- **U: upstream catch-up trial.** Affected tests 367 files / **8,022 passes**, 65 additional Runtime/Evidence passes, 39/39 fresh workspace typechecks; independent review PASS. A single monolithic `check:changed` **timed out at 900 seconds** and is **NOT green**; all selected affected test files passed in 29 sequential manifest-checked batches. Local runtime/restart/isolation and bounded rendered web smoke passed per worker. Frozen upstream source now old relative to moving upstream. +- **R: default-off continuation and D4 strict revocation.** Real combined server-root D4 **K1/K2 8/8 PASS**, source-focused 206/206; Codex cross-provider independent read-only review **PASS WITH FINDINGS, no blocking/major**, and independently reran 8/8, 199 focused, 7 budget checks; `check:changed` 22 files / 294 tests and 36 package typechecks pass. Two bounded R repair/review cycles fixed worktree leak and authorization/target mutation/async state issues. Prior R cross-provider HOLD is **CLOSED**. The user expressly confirmed that earlier **Opus** implementation fallback was approved. Default-off is retained; synthetic continuation requires explicit experimental enablement. +- **H: D2/K3 hardening qualification, tests and fixtures only.** Focused **118/118**, changed-file **335** tests, 36 package typechecks pass; independent Claude reviewer reran 118/118, REVIEW PASS. Agent-visible **source-loaded** MCP tool listing: 82 tools, 2,269 field paths and **58,799 UTF-8 bytes**, byte-identical to frozen U with **zero continuation-attributable schema fields/bytes**; operator-only internal continuation policy tests pass. H **did not implement new production agent schema code**. +- **K3 bounded recovery:** temp/file-backed DB restart/persistence; disposable child SIGKILL/barrier and two reopens; pruning and truthful incomplete/unknown; replay prevents extra starts; two adapter-independent provider stubs and project isolation pass. **Real provider `startTurn` race/crash, OS power loss and externally atomic cancellation NOT demonstrated**. Don't overstate the accepted D4 A+B contract; uncertain external start remains reconciliation/best-effort stop. +- **Routing/cost:** 16 of 18 **distinct** technical/reviewer overnight dispatches reportedly used; seven additional same-lane `t3_thread_send` turns were verified as resumes, not new assignments. Restricted append-only ledger 461 lines, durable write confirmed by worker. T3 Runtime task/handoff append **not exposed** in worker's local session, so **do not claim Runtime-native recording already exists**; it remains a product bridge gap. DeepSeek orchestration only, no paid API/live-provider turns reported. **The 18-dispatch overnight authorization ENDED AFTER H**; two unused slots are not permission for a fourth stage. +- **Preserved integration state:** fork main unchanged, no U/R/H push/PR/merge, no release, default-on enablement or production. **All stages' task packets are COMPLETED/HISTORICAL**, do not redispatch U, R cross-provider review, or H tests. + +## 4. Open release and integration gates (do not silently mark PASS) + +1. **D2 PACKAGED/AUTHENTICATED SHIPPING NOT VERIFIED**. Source-loaded tool schema pass is not a supported real packaged T3 server + authenticated paired-agent MCP `tools/list` proof. Need actual packaged tool-list input/output schema inspection/UTF-8 comparison against U, positive operator-only create/read/update/revoke and negative agent-access tests, appropriate authentication and source integrity, with different-provider reviewer. [Complete proposed scope](task-post-h-packaged-d2-shipping-verification-proposed-20261106.md) is **PREPARED / AWAITING OWNER AUTHORIZATION / NOT DISPATCHED**. Prefer no-cost supported credentials and disposable processes; STOP for costs/auth exceptions/architecture expansion. +2. **K3 controlled real-provider start/crash qualification** and broader release-grade recovery still open; disposable process/stub results do not establish external `startTurn` atomicity, full OS power loss, session retention or hosted service behavior. Scoped credential/cost and safety authorization needed. Never run crash tests on live user services/DBs. +3. **Full CI/build/release/desktop/mobile/relay/target rendered UI and production verification** not yet established on H merged code; H not integrated. Evidence V0's accepted **fork-only coordinated old-decoder upgrade limitation** remains an explicit known release compatibility boundary. +4. **Upstream-aware integration** needs a **new, authorized** scoped trial with current fork/upstream heads, one writer/worktree, conflict analysis on moving upstream, preservation of Runtime, Evidence V0, session lifecycle/migrations and provider-neutral behavior, relevant tests/review. **No direct merge of the old divergent experimental/D4 branches**. Any fork-main merge, push/public PR, release, production/default-on, major architecture/authority or material paid cost is a separate explicit user decision. + +## 5. Separate active research/work packet: cooperative upstream PR #28777 + +- Public [upstream PR #28777](https://github.com/pingdotgg/t3code/pull/28777) addresses model-facing instructions for resuming interrupted child reviews versus independent new `delegate_task`. Maria's November 5 review reported branch update, context-budget below baseline, 28 checks passing then; **current GitHub API (2026-11-06) reports OPEN, NOT MERGED and `mergeable_state=dirty` against newer base**. No contradiction: her report was point-in-time. +- Our existing [test-only `original-interrupted` regression patch](https://github.com/jermur788/t3code/blob/research/pr-28777-continuation-regression-20261103/docs/orchestration-v2/research-pr28777-original-interrupted-corrected.patch) passed 34 focused tests in prior isolated run, contributor acknowledged it; **it is not incorporated in the PR's current source**. It protects original interrupted task status, distinct follow-up in same thread, command replay idempotency, wake cohort and recovery duplicates; it does **not** establish live provider tool choice/session retention. Cooperative author-choice, not an upstream acceptance requirement. +- User requested a second-chat/T2/T3 Code **DeepSeek-orchestrated cooperative conflict resolution + test adaptation** handoff. [Complete packet](task-upstream-pr28777-cooperative-conflict-and-regression-20261106.md) is **AUTHORIZED FOR BOUNDED ISOLATED LOCAL PREPARATION / HANDOFF PREPARED / NOT DISPATCHED**. Initial technical writer Codex SOL Medium; different-provider Claude Sonnet Medium read-only reviewer; Opus Low/Medium only for justified hard escalation under the user's task-specific model discretion, no material paid spend. Durable routing decision ledger **before every dispatch and after every outcome**. New unique isolated worktree, no collision with U/R/H. **Do not post public comments, push/PR or edit contributor branch without user approval**. This separate task does not reuse the finished overnight 18-dispatch authorization. + +## 6. Manager working loop and routing + +- Prefer browser-capable work first: connected GitHub source/ref checks, specs, handoff preparation, diff/PR reviews when accessible. Do not delegate merely because local tools exist, but do not claim local source/tests were inspected when only a worker handoff was returned. No verified browser→T3 Code automatic bridge; a link or written task **is NOT dispatched**. +- Significant ambiguous architecture/integration work needs governing spec before write. After every worker result: inspect evidence → reconcile with spec/state → classify failures → bounded repair/re-review/retest → update Runtime/ledger and Current State → integrate only when specifically authorized → verify integrated head → next authorized step. Do not stop merely on worker DONE, and never promote a pass beyond tested scope. +- **DeepSeek V4.1 Flash: coordination ONLY**. Codex GPT-6.1 SOL Medium or Claude Sonnet 5.5 Medium implement/test, one writer on each overlapping lane; independent read-only reviewer from a **different provider/model**. Claude Opus 5.5 Low/Medium is justified escalation only; owner confirmed its *past* R use, not blanket future Opus/paid approval. Track subscription/effort/quota/reset observed or UNKNOWN; conserve DeepSeek quota. +- **Durable per-routing-decision ledger mandatory:** record UTC, task/attempt/lane/base, selection/rejection/reroute/review, provider/model/account alias, requested vs actual effort, reason, quota/reset or UNKNOWN, tested result/review and next action **before and after each dispatch**. Persist to Project Runtime if supported, else restricted append-only local ledger and verify write. Chat text not a ledger. No durable write → STOP new dispatch. Treat `t3_thread_send` same-task resume differently from new delegation by real task/session identity; never undercount provider capacity. +- **Hard stops:** irreversible/destructive Git, shared/main push/merge, public upstream contribution, user-credential bypass, publication of private evidence, new durable authority store/large orchestration/provider redesign, real live-service/DB crash, material paid provider/infrastructure and production enablement. Preserve others' branches/worktrees and local private evidence. UI changes require *rendered* inspection, persistence *restart*, provider-neutral behavior preferably multiple providers. + +## 7. Next manager actions and decisions + +**Immediate without new user permission:** 1) accept this transition as navigation, 2) check current state/ref drift against live sources as needed, 3) present concise choices or prepare browser-only review of the **separate authorized upstream cooperative packet**. The upstream packet is locally preparable within its scope but **not dispatched**; if the next step requires T3 Code, issue the complete paste-ready DeepSeek handoff, never merely a partial instruction. + +**Next owner choice for the fork's principal release path:** whether to **authorize [packaged/authenticated D2 verification](task-post-h-packaged-d2-shipping-verification-proposed-20261106.md)** first (recommended), then potentially controlled real-provider K3 qualification, and only thereafter decide the upstream-aware integration and fork-main merge. These are **separate approvals**, no automatic sequence or paid cost promise. + +**What NOT to do:** do not restart completed U/R/H, use unused overnight dispatch slots as ongoing permission, claim shipping safety from source-loaded MCP tests, integrate the stale upstream U candidate directly into fork main, open a competing upstream PR, publish private PR #21 evidence, or infer that a host-local ledger is a first-class Project Runtime service. + +## 8. Transition verification / custody + +- This transition record and [Current State](../../01_CURRENT_STATE.md) / [Overall Manager Handoff](../../OVERALL_MANAGER_HANDOFF.md) are manager-authored documentation on the planning branch. No product code, local worktrees, user data or evidence were modified. +- Browser checks on 2026-11-06: fork main unchanged, upstream live head advanced **168 commits** beyond frozen U tip, upstream PR #28777 **open/dirty**, U/R/H branch names absent from fork remote. Remote `planning/resource-efficient-continuation-20261103` is accessible. Re-check at execution time; all dynamic refs may change. +- Next manager must keep **distinction between accepted decisions, worker-reported isolated results and browser-verified remote facts**, and update canonical state after every substantial continuation. A new manager should not need this conversation's hidden reasoning or old chats. diff --git a/docs/orchestration-v2/overnight-conditional-autonomy-amendment-20261106.md b/docs/orchestration-v2/overnight-conditional-autonomy-amendment-20261106.md new file mode 100644 index 0000000000000..cd08c41398b0a --- /dev/null +++ b/docs/orchestration-v2/overnight-conditional-autonomy-amendment-20261106.md @@ -0,0 +1,128 @@ +# Overnight conditional-autonomy amendment — upstream trial → continuation/D4 → D2/K3 + +**FINAL RESULT — 2026-11-06 11:47:** The authorized overnight U→R→H sequence **COMPLETED and STOPPED after H**, per [manager final reconciliation](manager-overnight-urh-final-reconciliation-20261106.md). U **G-U FINAL PASS**, R **G-R FINAL PASS** after genuine Codex cross-provider read-only review, H **ISOLATED INTEGRATION-READINESS CANDIDATE / REVIEW PASS**, source-loaded D2 schema **SCOPED PASS**, packaged/authenticated D2 and real-provider start/crash **NOT VERIFIED**, **NOT INTEGRATED / NOT PRODUCTION VERIFIED**. R Opus was owner-approved; previous R review HOLD is CLOSED. All prior stop/promotion instructions below are **HISTORICAL and MUST NOT be redispatched**. The final ledger reported 16/18 distinct technical/reviewer dispatches, 7 same-task resumes and 461-line restricted local durable fallback (T3 Runtime append unavailable). The unused 2 dispatch slots do not authorize new overnight stages.\n\n**LATEST OWNER CLARIFICATION (2026-11-06 10:24):** User confirms prior Stage R Claude Opus fallback was approved. Earlier statements describing that specific use as unauthorized are superseded. Different-provider independent review and dispatch-budget audit are still required before G-R final pass; this does not authorize unrestricted future Opus use. See [decision record](stage-r-opus-owner-approval-clarification-20261106.md). + + +**Authority:** New user instruction 2026-11-06 00:14 Europe/Dublin: "I want to do as much work as possible while I'm asleep, create an amendment for the orch agent so that it can continue on without your input if the work meets certain targets that you can set in the handoff." +**Classification:** **ACCEPTED CONDITIONAL LOCAL-ONLY EXECUTION AUTHORIZATION**, a narrow amendment to the [2026-11-05 authorized upstream trial](upstream-catchup-isolated-trial-governing-spec-20261105.md) and [Coordination/Handoff Protocol](../../02_COORDINATION_HANDOFF_PROTOCOL.md). Not a change to stable coordination invariants. +**Status at authoring:** **AMENDMENT PREPARED / NOT DISPATCHED**; no automatic browser-to-T3 Code connection established; no work launched by writing this document. +**Why:** permit DeepSeek to advance through a fixed sequence of **reversible isolated local work** without asking ChatGPT/Overall Manager after every successful, independently reviewed gate. The user retains product authority outside the enumerated scope. + +## 1. Strict scope of delegated autonomy + +The user's new instruction **conditionally authorizes** three stages, sequentially, and only while the currently running T3 Code/OpenCode session can actually invoke, supervise and receive worker outputs: + +- **U — current upstream catch-up trial:** already authorized. Create a new owned local worktree from verified fork main; integrate **one frozen upstream checkpoint** there; resolve routine conflicts; independently review/tests. No fork-main merge. +- **R — fresh continuation + D4 re-land candidate:** **NEW conditional permission** only when U earns a complete G-U pass. Create a separate NEW isolated worktree/branch from the **reviewed, immutable U candidate tip**. Reimplement/adapt the minimum isolated continuation and previously accepted D4 A+B as **fresh changes** based on reference source and accepted specs; **do not merge/rebase/cherry-pick the old divergent experimental or private D4 branch wholesale**. Keep feature server default-off. Local-only experimental agent MCP overhead may remain temporarily but must be measured and recorded, NEVER treated as public shipping. +- **H — bounded hardening of that local candidate:** **NEW conditional permission** only when R earns complete G-R pass. On a separate new owned isolated branch/worktree from the **reviewed R candidate tip**, implement a minimal **D2 agent-facing shipping-schema exclusion prototype** using existing fork abstractions (internal operator continuation authority retained; agent-facing task input/output schema omits experimental continuation), and run additional **K3 restart/crash/pruning and provider-neutral stub tests** in disposable, isolated temp homes when technically feasible. This is research-quality local hardening, **not approval of a public shipping build or a final architectural decision**. Do not invent a new authority store, change public product behavior or weaken accepted release checks. + +**No fourth stage.** If H passes, compile one complete integration-readiness dossier and **STOP** for user/manager review. No push, PR, merge to fork main, actual public build release, deployment or production enablement. Do not silently start more upstream syncing, run provider-paid live tests or create a different project. + +**Explicitly superseded only to this extent:** older docs say that *any* continuation re-land requires separate user approval. The 2026-11-06 instruction **now grants one conditional local-only R re-land prototype** after G-U; it **does not** authorize final re-land into fork `main`, main integration, public Git push, or production. + +## 2. Source freeze, repos and worktree isolation + +**Latest browser-checked at amendment creation:** fork `jermur788/t3code` `main` `fb67545d790c5c001e8f85827f219ab6493c435e`; upstream `pingdotgg/t3code` `main` `79ee39fdcbb8638e625a05cd26f4f92e5d6a9319` (18 newer commits since previous 2026-11-05 upstream check); old experiment `experiment/continuation-default-off-gate-20261104` `b3b8da54e0b8b184a1cf4e667d53e73e04f85074`. Local unpushed D4 implementation reported at `f68db477a053bfe0211c6d92bf116711c1d55371` and remains local-only. All SHA identifiers are internal checkpoints, not permission to move any existing branch. + +**At actual execution:** fetch and verify live remotes and owner/dirty/ownership/disk, select the **exact current upstream tip once for U**, record it and **FREEZE** for this overnight run. If upstream advances afterward, record a drift note; **do not auto-chase further upstream commits** or restart U. If fork `main` changed since the last verified checkpoint, inspect differences and stop for conflicts with user's concurrent code. Never overwrite user work. + +One writer per stage; stages run **in order**, with **different new owner-isolated worktrees**, not simultaneous overlapping writes. U/R/H build caches, temp DBs, process IDs and artifacts isolated. Preserve primary checkout, stale local main, experimental D4 branch, four detached Stage 2 worktrees, evidence ledgers and read-only Files mount. No `git reset`, `clean`, `stash`, force, rebase of existing owner worktrees, branch deletion, unmount, shared history rewrite, push or artifact publication. Local commits on new stage branches only. Fetching remote-tracking refs without moving user branches is permitted. + +## 3. Measurable G-U (upstream trial → re-land) gate + +**DeepSeek may automatically authorize R only if ALL are evidenced:** + +1. U worktree owned/clean (other than known isolated evidence), exact upstream tip frozen and incorporated in **new local candidate**, fork baseline preserved; **zero unresolved Git conflicts**, and a complete upstream commit/file inventory recorded (not truncated GitHub compare). All touched fork Runtime, Evidence V0, profiles/modes, persisted task/handoff/revision and orchestration ownership invariants preserved. +2. Required typecheck, formatter/linter/changed-file checks and relevant server/provider/DB/MCP tests run **exit 0**. Existing baseline failures may be classified separately **only** with reproducible same-base proof and independent reviewer agreement; no acceptance of new failures. No tests weakened/disabled simply to pass. +3. Persistence/restart and project isolation verified at scope required by trial spec; command-receipt/idempotency and provider-neutral stub coverage where practical; **no experimental continuation code/MCP field accidentally imported**. If upstream touched web UI, a **rendered UI inspection** is required; if unavailable, gate does NOT pass. +4. Different provider/model independent **read-only REVIEW PASS with zero unresolved critical/high or material medium findings**. Upstream conflicts and their resolutions explicitly reviewed; no unreviewed new migration/security/provider authority change. +5. D2 shipping main baseline has no experimental `continuation` field in tested agent-facing input/output schemas. Distinguish source-level and packaged/authenticated evidence; **do not invent shipping VERIFIED**. + +**If G-U fails:** allow bounded routine repair/re-review on U (Section 6); do not create R code worktree. Stop on architecture/authority conflict, unverified critical check, or review blocker. + +## 4. Measurable G-R (fresh continuation + D4 → hardening) gate + +**DeepSeek may automatically authorize H only if ALL are evidenced:** + +1. R is a **new clean isolated branch derived from reviewed frozen U candidate**. Differences from U are **fresh bounded changes**, not a raw divergent branch merge. Preserve Project Runtime provider-neutral semantics and D1 default-off gate. No new authority DB/epoch/migration, public MCP capability enablement or material upstream engine redesign; if needed, stop for user product decision. +2. **D4 A+B K1 and K2 re-demonstrated on R's actual server-root assembly**, with true operator `continuation:null` revocation, transactional no-new-`run.created` (0 new runs/effects/accepted receipts) and natural `schedulePreparation → prepared-run.release` prevention, including typed denial, idempotent replay and `reconcile_required` preservation. Required focused/concurrency/cross-project/ordinary-user regression tests exit 0; no automatic external provider-start atomicity promise. +3. Default-off disabled server performs **no continuation automatically** in normal test config. Internal operator-only authority cannot be minted through agent/MCP/task content. Confirm no D1/D3/D4 regression and no tests weakened. +4. Source-level and built/source-loaded `tools/list` measurement explicitly records any **experimental D2 agent schema exposure**; on local unmerged R it is a known release blocker, **not authority to ship**. H must address it. If tooling cannot even measure or enumerate tool schema with supported auth/testkit, stop for blocker rather than assuming pass. +5. Relevant repo/source server/typecheck/changed-file tests exit 0, rendered UI if modified, and independent **different-provider read-only REVIEW PASS** with no unresolved material findings. Review the **actual adapted R diff**, not only the old isolated D4 handoff. + +**If G-R fails:** bounded repairs/review within R permitted; do not start H. Material upstream execution/authorization redesign or change in accepted A+B contract is a hard stop. + +## 5. Measurable G-H (bounded D2/K3 hardening → stop) gate + +Within a new H worktree, **limited authorized work**: + +- D2: explicitly separate internal operator-only `continuation` state from agent-facing task create/update/result MCP JSON schemas, preserving Runtime authority and normal tasks. Prefer minimal upstream-friendly task schema projections where present, not a new public API. Obtain **actual built server/tool-list output**, no `continuation` in agent advertised input **or output** paths, and measure tool count, field paths, UTF-8 bytes/context budget compared with the exact matching U shipping baseline. **Added continuation-schema byte overhead in the agent-visible shipping baseline must be zero**. If a true packaged paired-client/authenticated MCP check is unavailable, classify **`D2 PACKAGED SHIPPING NOT VERIFIED`**, even if source/mock tests pass. This does **not** authorize actual public shipping. +- K3: run safe process restart/crash recovery and history-pruning/idempotent replay tests **only against disposable temp processes and DBs**; never kill a user service, change persistent real T3 Runtime state, or write/read PR #21 evidence. Use adapter-independent stubs for two providers where possible. Preserve honest `incomplete/unknown` Evidence V0 and no resurrected execution after revoke. If credentials/test harness unavailable, mark **OPERATIONAL BLOCKER / PARTIAL**, do not bypass authentication. +- Static, focused runtime, cross-project, default-off, ordinary-user regression tests and distinct-provider read-only review required for any claim of H `RUNTIME PASS`. No destructive test against user's live DB, no production claim. + +**G-H completion target:** `ISOLATED INTEGRATION-READINESS CANDIDATE / REVIEW PASS` with precisely scoped D2/K3 test verdicts. **If D2 packaged check or K3 crash/restart remains partial, call it PARTIAL, not RELEASE VERIFIED**. Either way, **STOP after H** and return a single combined handoff; do not auto-merge, push or deploy. + +## 6. Repair/resource budgets and unattended routing + +- Orchestrator: **DeepSeek V4.1 Flash COORDINATION ONLY**. It cannot execute shell tests, author source edits, implement, or review; route technical changes/test execution to **Codex GPT-6.1 SOL Medium** or **Claude Sonnet 5.5 Medium** only. Independent **different provider/model** for read-only review. If only same-provider reviewers are available, **stop advancement at the gate** (still record findings), not substitute an independence claim. No Opus or material paid calls without user approval. +- **At most two bounded repair → retest → independent re-review cycles PER STAGE** after the first implementation/test pass. Track each distinct failure; routine defects may be fixed, but never weaken tests to pass or hide findings. If unresolved by cap, stop with classified blocker and exact continuation packet. +- **At most 18 technical worker/reviewer dispatches TOTAL** across U/R/H in this overnight run (including first tests, reviews and repairs); DeepSeek calls minimized given previously reported limited allowance. On limit, stop, save task/evidence and report. Never invent token allowance/reset times or bypass provider limits. +- Check each provider subscription's actual **AVAILABLE/BUSY/COOLDOWN/LOGIN-UNAVAILABLE/UNKNOWN**, requested and actual model/effort, real five-hour reset reported or `UNKNOWN`. When quota hits, checkpoint and use *another permitted, available* provider; if no independent reviewer capacity exists, stop at gate. No pretending to schedule unattended resumption; continue only if the actual T3 Code host supports supervised in-session dispatch and result collection. +- Every stage/attempt: write authoritative **T3 Project Runtime task/attempt/handoff** if available. Otherwise append to a **new, restricted local evidence ledger** outside source worktrees, with UTC, owner, exact branch/base, command exits, failure/review results, quotas and next gate. The GitHub planning branch contains specifications only; **no private logs/evidence/sensitive paths/tokens** should be pushed. DeepSeek may move to next stage only after reading actual worker + reviewer evidence, not worker self-assertion. +- **No fabricated async promise:** a Markdown amendment is not an active agent or automation. It cannot start local workers by itself. Continue autonomously only while an existing supported T3 Code process/session genuinely runs; otherwise return a restart-ready handoff. + +### 6.1 Mandatory decision-by-decision routing ledger (user clarification, 2026-11-06 00:21) + +**The DeepSeek orchestration chat MUST persist its OWN routing decisions, not merely worker final results.** For **every proposed, selected, rejected, deferred, retried, re-routed or escalated** technical-worker/reviewer assignment, append a durable entry **before dispatch if possible**, then append the observed outcome immediately on return. Include: + +1. UTC timestamp; U/R/H stage; task and attempt identifiers; exact local base/worktree owner; current gate and remaining total/cycle budget. +2. **Routing decision** (dispatch, retry, swap provider/subscription, postpone, stop, independent review), selected provider/model/subscription **non-sensitive alias**, requested and actually observed reasoning effort; any considered alternative that materially affected choice. +3. **Reason:** task difficulty/risk and model fit, estimated/observed resource cost or UNKNOWN, subscription remaining quota/reset/cooldown from actual provider telemetry or UNKNOWN, independence from implementation author, worktree ownership/conflict constraints. +4. Dispatch status, actual provider result/error/timeout/rate-limit, test/review evidence refs and exits (as applicable), acceptance verdict, corrective action, next authorized task or reason for stopping. +5. All gate promotions: reference the exact U/R/H checklist, test outputs and **independent reviewer** result; record who/what authorized promotion. A self-reported worker DONE is never sufficient. + +**Durability target:** authoritative T3 Runtime task/attempt/routing/handoff records if supported; otherwise a **restricted local append-only routing ledger** under the existing overnight evidence owner, not a source worktree. Never claim a Runtime write succeeded without checking the result. If a real durable ledger write is unavailable, **stop before the next worker dispatch**, report `OPERATIONAL BLOCKER: ROUTING LEDGER UNAVAILABLE`, and return a restart-ready handoff. Chat text alone is **not** an acceptable ledger. Do not copy private routing logs or account details to the public GitHub repository. + +**Audit rule:** stage completion must include ledger continuity (every dispatch and review accounted for), actual-versus-requested effort, subscription selection/re-routing reasons, and accurate quotas or UNKNOWN. The Overall Manager may publish sanitized high-level **state summaries** on the planning branch; the local T3 Code orchestrator is responsible for writing the actual host-local ledger. This ChatGPT browser session does **not** have direct access to that local ledger. + +### 6.2 Post-U reconciliation, 2026-11-06 00:27 — timeout-equivalent coverage and routing gate + +**Latest stage evidence:** the upstream U local trial returned a clean candidate with all **367 affected test files executed and passing in 29 independently manifest-checked batches**, 39/39 fresh workspace typechecks, relevant static phases, bounded real-server restart/persistence/RPC, bounded rendered web smoke and different-provider `REVIEW PASS`. The monolithic `check:changed` wrapper exited 1 **only because the 367-file test phase exceeded its 900-second ceiling**. This **must never** be called a green wrapper. The manager accepts **the exact complete affected-file set plus the separately passing static phases** as **equivalent bounded trial coverage** without weakening or skipping a test; label `G-U TECHNICAL PASS WITH TIMEOUT CAVEAT`. If any part of the manifest was not actually run, later test failures were hidden, or reviewer cannot establish equivalence, `G-U` is **FAIL/HOLD** and R cannot start. + +**Mandatory routing audit remains:** User's later §6.1 requires a durable record of DeepSeek's actual routing decisions. The U return identifies a private ledger and reports 3 Codex dispatches + 2 Claude reviews, **but the browser manager cannot inspect the ledger contents**. Consequently **`G-U FINAL PASS` is ON HOLD**, despite accepted technical evidence. Before the FIRST R worker dispatch, DeepSeek must examine that ledger and connected Runtime task history, account for all 5 decisions, append accurate contemporaneous/retrospective classifications and an evidenced gate signoff. If the durable ledger cannot be accessed/written, **STOP** as operational blocker; do not promote a chat narrative to project state. + +**Frozen source:** U was deliberately built against upstream `25b53299b75d4d8d1d0667ad47e9cfed3749776e`. Browser-checked current upstream is **22 commits newer**. Under the overnight freeze, **do not auto-sync those extra commits**, reset U or restart its already passed tests. R, if authorized after routing audit, starts from the **reviewed local U candidate**, not moving upstream main. + +**Next exact coordinator handoff:** [U→R mandatory routing audit](handoff-upstream-to-r-routing-gate-20261106.md). This check is **coordination-only** and must not be mistaken for permission to push, merge, rebase original D4 branches or run paid calls. If the last U handoff says separate owner approval for re-land, note that the later user overnight amendment **already conditionally authorized a local-only R prototype**, but **not** fork-main integration; the routing gate must still pass. + +### 6.3 Stage R return and cross-provider review HOLD (2026-11-06 10:11) + +Stage R is **LOCALLY IMPLEMENTED** per a user-supplied worker return: 4 local commits/33 paths, default-off continuation plus accepted D4 A+B, full-server K1/K2 **8/8 PASS**, worker focused tests **206/206**, prior reviewer focused tests **210/210**, `check:changed` 22 files/294 tests and 36 package typechecks PASS. Two bounded repair cycles closed source/worktree findings according to the return. **Source and raw logs remain local/unpushed**, so the browser manager did not execute or inspect them. + +**User's overnight G-R independence gate is NOT satisfied:** The return states **Claude Opus 5.5 Medium** took over implementation after Codex sharing-limit failure; the final reviewer was a **different Claude subscription/context**, not a different provider. The more specific overnight policy explicitly requires a different provider/model, and says if only same-provider review is available, **STOP ADVANCEMENT**. Separate subscriptions do not establish independent provider review. Mark **`G-R FINAL HOLD`**, regardless of a worker's `G-R FINAL PASS` label. An actual Codex GPT-6.1 SOL Medium **READ-ONLY** review of the immutable R final source/diff/tests can close the ordinary review gate if available and no material findings remain; no code changes/new repair cycle are implied. + +**Opus policy deviation:** This amendment explicitly said **NO Opus absent owner approval**. The return calls the fallback 'authorized' but supplies no matching newer explicit user decision. The general Coordination Protocol's exceptional Opus escalation guidance does not override this narrower overnight restriction. Record routing provenance, source lookup/authority failure and no paid calls asserted; **do not retroactively label it authorized or use Opus again**. If a new serious issue requires a third R repair cycle/architecture expansion, STOP for owner decision. + +**Dispatch budget audit:** R return reports **13 distinct technical/reviewer assignments** across U/R and **7 extra same-lane provider continuation turns**. The cap is **18 technical/reviewer DISPATCHES**, not an unlimited token/time budget. Inspect actual session and ledger evidence to determine which turns were resumes and which fresh dispatches. Do not automatically count every same-task continuation as a distinct assignment, but **never ignore actual new dispatches**. If 18 reached or independent review cannot fit, STOP. Nominal headroom is five only if all seven additional turns truly resumed existing assignments. + +**Canonical planning sources DO exist:** Remote branch `planning/resource-efficient-continuation-20261103` contains this amendment and both manager handoffs, as independently re-fetched on 2026-11-06. Local worker claim of missing docs is a stale/unfetched/incorrect source lookup issue, not evidence of missing published policy. Retrieve exact remote sources READ-ONLY before any next dispatch. + +**Next one-step handoff:** [R cross-provider review and routing audit](handoff-stage-r-cross-provider-review-gate-20261106.md), **PREPARED / NOT DISPATCHED**. **H HAS NOT STARTED**, and may not start unless this review plus ledger/cap audit earns a durable `G-R FINAL PASS`. Existing conditional local-only H authority survives; public push, main merge, production, paid provider, default-on and new authority architecture remain forbidden. + +## 7. Non-negotiable hard stops + +Immediately stop and return to user/manager for **PRODUCT DECISION / INTEGRATION CONFLICT / UPSTREAM COMPATIBILITY / SECURITY REVIEW REQUIRED / OPERATIONAL BLOCKER** on any of: + +- Main branch writes or merges, Git push/public PR/upstream publication; release or production enablement; autonomous operation of a real external provider under new feature. +- New authority table/epoch or migration, material orchestration/provider/session internals redesign, major public contract change, disabling/muting security authorization, or an unresolvable concurrency race. +- Destructive Git, deleting/remounting worktrees/Files, killing live services or writing real user DB, exporting private PR #21 evidence, external credential access/bypass or paid API spend. +- Fork main/uncommitted work ownership changes under task; source conflicts that cannot be resolved without discarding others' modifications; failed/missing critical tests; unresolved material independent review finding. +- Provider quota exhausted with no compliant worker/reviewer, timeouts/host no longer supports in-session continuation, or technical dispatch/repair cap reached. + +Do **not** advance because a worker says `DONE`; advance only if the exact **G-U or G-R gate evidence** was checked and recorded. No gate can be waived by a worker without a new user product decision. + +## 8. Final morning handoff / stop + +Produce one durable handoff **`OVERNIGHT U/R/H VERDICT / EXACT FROZEN BASES / WORKTREES & OWNERSHIP / STAGE RESULTS & TEST COMMANDS/EXITS / INDEPENDENT REVIEWS & REPAIRS / D4 K1 K2 / D2 TOOL SCHEMA BYTE DIFF / K3 RECOVERY / QUOTA & COST LEDGER / UNRESOLVED FAILURES / INTEGRATION STATE / RECOMMENDED NEXT PRODUCT DECISION`**. User-facing summary should not include opaque SHA IDs; keep internal IDs in restricted ledger and canonical docs as needed. + +**Final state remains `NOT INTEGRATED / NOT PRODUCTION VERIFIED`**, regardless of isolated candidate quality. The user can then review a fully prepared and independently checked candidate before any future main merge or public shipping approval. diff --git a/docs/orchestration-v2/overnight-deepseek-routing-ledger-20261104.md b/docs/orchestration-v2/overnight-deepseek-routing-ledger-20261104.md new file mode 100644 index 0000000000000..e1a221ffff1cb --- /dev/null +++ b/docs/orchestration-v2/overnight-deepseek-routing-ledger-20261104.md @@ -0,0 +1,75 @@ +# Overnight DeepSeek — Routing, attempts, worker roster and evidence ledger + +Date: 2026-11-04 (Europe/Dublin). Status: **PREPARED ONLY — no live DeepSeek run has yet been observed in this manager chat**. +Classification: COORDINATION STATE / seed. This file is a template and historical initial checkpoint, not a substitute for canonical T3 Project Runtime routing/attempt receipts. +Parent handoff: https://github.com/jermur788/t3code/blob/planning/resource-efficient-continuation-20261103/docs/orchestration-v2/overnight-deepseek-serial-handoff-20261104.md + +## Baseline snapshot (not live task outcomes) +- Target branch: fix/continuation-authorization-hardening-20261103; source review accepted R1/R2/R3 for bounded code paths; fork main separate. All heads must be re-fetched by the actual local coordinator at kickoff. +- Local implementer reports successful tests: 39 focused, 179 projectRuntime and check:changed 111. These are **not** independently rerun by the planning manager. +- F4 production feature gate, +646-byte MCP context change and final external launch TOCTOU remain decisions/risks. No permission to enable or merge. +- Requested coordinator: DeepSeek. **Actual provider instance/model, token/cost, session, start time, capacity and liveness are UNKNOWN / NOT DISPATCHED as of planning.** +- No active local worker, scheduled background job or automatic T3 completion bridge was created by this GitHub documentation write. + +## Serialized stage registry +| Stage | Scope | Requested primary route | Status at seed | Actual resolved route | Next | +| --- | --- | --- | --- | --- | --- | +| O0 | Preflight, host supervision and Runtime/ledger bootstrap | DeepSeek coordinator | READY, not dispatched | UNKNOWN | Verify host and ownership | +| O1 | Independent executable qualification | Cheapest eligible independent test runner; DeepSeek coordinates | READY, not dispatched | UNKNOWN | Fresh worktree, 4 commands | +| O2 | Additional failure/concurrency qualification | DeepSeek; stronger review if safety issues | WAITING on O1 | UNKNOWN | Deterministic tests | +| O3 | Upstream compatibility reconnaissance | DeepSeek low-cost read-only | WAITING on O2 or independent blocker | UNKNOWN | Current upstream source | +| O4 | F4 gate/context-cost analysis/prototype only | DeepSeek plus independent capable reviewer | WAITING on O3 | UNKNOWN | Compare options, no adoption | +| O5 | Independent security review and morning handoff | Independent stronger reviewer for security | WAITING on O4 | UNKNOWN | Review evidence and write handoff | +| O6 | Spare capacity: approved read-only checks | DeepSeek | OPTIONAL | UNKNOWN | Only after prior checkpoints | + +## Worker roster (append/refresh; do not claim presence) +| Child task | Role | Provider/model (resolved by host) | Thread / worktree | State | Last host event UTC | Owner | Completion channel | Next check/action | +| --- | --- | --- | --- | --- | --- | --- | --- | --- | +| None yet | DeepSeek requested, not started | UNKNOWN | UNKNOWN | NOT DISPATCHED | none | none | not established | O0 | + +## Routing decision event template — append one record at decision/dispatch/result +**Event number:** +**UTC timestamp / evidence source:** +**Parent stage/task and child task:** +**Attempt #:** <1..4>; **type:** initial / retry / fallback / escalation / independent review +**Goal, acceptance, base, worktree and code owner:** <...> +**Requested by and coordinating model:** +**Candidates in order:** +**Rejected candidates:** +**Chosen planned:** +**Resolved actual:** +**Eligibility/capacity:** +**Cost/control objective:** +**Dispatch and completion:** +**Hypothesis and attempt delta:** +**Command/test evidence and result:** +**Escalation decision:** +**Current child liveness:** +**Outcome/next:** + +## Routing event 0000 — planning request (not a dispatch) +- **Observed:** user asked for DeepSeek-led overnight serial execution, at least two genuinely different attempts per routine issue, escalation to stronger available models, child supervision and explicit route tracking. +- **Requested coordinator:** DeepSeek; **resolved:** UNKNOWN / NOT STARTED. +- **Candidate selection reasoning:** DeepSeek is preferred for cost-effective coordination, reading and bounded fixes; security/race-sensitive escalation to available Codex/Claude-class when necessary. No particular model/version is assumed installed, available, or paid for. +- **Rejected candidates:** none yet; availability not checked in local T3. +- **Execution evidence:** planning handoff and ledger drafted through connected GitHub. **No local command, live subagent dispatch, paid provider or background monitor executed.** +- **Next:** actual T3 Code operator launches O0; coordinator confirms host routing provider/model, records session and first live event. + +## Per-task issue and retry log template +| Stage | Issue | Attempt 1 hypothesis/evidence/result | Attempt 2 *different* hypothesis/evidence/result | Stronger model selection and why | Attempt 3/4 result | Classification | Next | +| --- | --- | --- | --- | --- | --- | --- | --- | +| none | not started | — | — | — | — | — | O0 | + +## Liveness / handoff events (append one on every transition) +| UTC | Task | Old state → new state | Host proof or log | Last observed route | Handoff | Next action | +| --- | --- | --- | --- | --- | --- | --- | +| not started | O0 | READY (planning only) | planning document, no host | UNKNOWN | none | Start local coordinator | + +## Final reconciliation checklist +- [ ] Every actual child appears in roster with host-backed state and single code owner. +- [ ] Every dispatch/retry/fallback/escalation has planned and resolved model/provider with reasons and rejection codes. +- [ ] Unknown token/cost/quota not converted into invented estimates. +- [ ] Every substantial child produced Runtime handoff or authoritative fallback. +- [ ] Every stage lists precise verification and remaining unexecuted gates. +- [ ] Morning handoff reconciles source/branch against real repo and Runtime, preserves NOT INTEGRATED. +- [ ] No unauthorized merge, real provider call, upstream public action, or production enablement. diff --git a/docs/orchestration-v2/overnight-deepseek-serial-handoff-20261104.md b/docs/orchestration-v2/overnight-deepseek-serial-handoff-20261104.md new file mode 100644 index 0000000000000..1b8c8f76ce357 --- /dev/null +++ b/docs/orchestration-v2/overnight-deepseek-serial-handoff-20261104.md @@ -0,0 +1,111 @@ +# T3 Fork — Overnight DeepSeek Orchestration Handoff +Date: 2026-11-04 (Europe/Dublin) +Classification: COORDINATION / AUTHORIZED BOUNDED EXECUTION. NOT a production policy decision. +Coordinator: DeepSeek running inside a live local T3 Code orchestrator session. Overall Manager: ChatGPT for morning reconciliation. +Repo: jermur788/t3code. +Governing protocol: 02_COORDINATION_HANDOFF_PROTOCOL.md and Current State; task-specific source: independent-continuation-hardening-review-20261104.md. +Canonical source review: https://github.com/jermur788/t3code/blob/planning/resource-efficient-continuation-20261103/docs/orchestration-v2/independent-continuation-hardening-review-20261104.md +Candidate branch: fix/continuation-authorization-hardening-20261103. +Ledger seed/template: https://github.com/jermur788/t3code/blob/planning/resource-efficient-continuation-20261103/docs/orchestration-v2/overnight-deepseek-routing-ledger-20261104.md + +## Mission and permissions +Run a serial queue of safe, bounded tasks overnight and maximize verified progress without user interaction. DeepSeek is the default coordinator and first solver. Escalate genuinely difficult debugging, concurrency, authorization, integration and architecture analysis to an already-available Codex/Claude-class model after at least TWO **distinct, evidenced** troubleshooting attempts, as defined below. An independent reviewer must not approve its own code changes. + +No PR, merge to fork main, production enablement, public upstream communication, real/paid external provider evaluation, destructive Git commands, expansion of authoritative stores, or upstream V2 execution-core rewrite is authorized. The user remains final authority for product choices, revocation contract, public releases, significant architecture and material costs. Do not blindly keep trying at a security/authority stop. + +An overnight handoff is **not itself an active background process**. The local operator must launch this in an actual running T3 Code session with working subagent tools. The coordinator should continue only while the host is alive and capable of dispatching and receiving completion. If interrupted, persist a resumable checkpoint and report the operational blocker; don't claim remote supervision. + +## Starting truth — verify fresh, never assume +At preparation, candidate head matched last local handoff; fork main was still separate. Upstream pingdotgg/t3code main had newer activity. Fetch and inspect both heads at kickoff. Local worker reports passing: focused 39/39, projectRuntime 179/179, check:changed including 111 tests, typecheck. Independent browser **source review PASS** is scoped to R1/R2/R3; it did not rerun tests. F4 is a hard feature gate; +646 bytes to MCP context on original experiment; final prelaunch-check/external-launch TOCTOU remains unclosed. Worker handoffs are evidence claims, not proof. + +## Preflight (mandatory) +- Verify repo path and remotes, current branch, base, status, untracked files, worktree ownership, active local agents, provider configurations, budgets, and pending tasks. +- Fetch candidate/upstream/fork main and ensure recorded base matches inspectable history. Do not reset, stash, force-push, discard or rewrite shared history. +- Create a **new isolated overnight branch/worktree** for any writes, based on the verified candidate; do not write into earlier qualification or security-repair worktrees. Serial one-writer ownership for overlapping files. +- Create/refresh parent and stage tasks in Project Runtime if available; keep separate instruction/source/project/task/attempt/handoff provenance. If Runtime unavailable, maintain a branch-local copy of the ledger and handoff (not only chat) and record the reason. +- Set up completion/wake routing in the actual T3 host; verify one no-op or short read-only child result is returned before unattended progression. If no reliable completion delivery, do not claim unattended child monitoring; work serially in a single active host session or stop with precise blocker. + +## Serial overnight work queue +Use numbered stages in order. Move to the next stage automatically only after the prior stage has a durable result, evidence and handoff. A later stage may execute read-only without the previous stage passing only if it is truly independent and code ownership remains safe. Never promote failure claims to PASS. + +### Stage O0 — Bootstrap supervision, ledger, routing +Owner: DeepSeek coordinator. No code writes aside from isolated ledger. +Acceptance: clean preflight or classified existing changes; host completion channel verified; parent + stages recorded; routing plan entered; all existing branches/worktrees preserved; at least one actual child response or explicit limitation. Ledger row for the initial coordinator provider/model resolved *from host* (unknown until then). +Handoff: repository base, providers available, task roster, cost/resource envelope, active code writer and next task. + +### Stage O1 — Fresh independent executable verification +Owner: an independent low-cost capable local test worker, not the implementer. Coordinator supervises. +Base: frozen published hardening head, fresh isolated worktree; tests use only stub providers. Run with exact exit codes: + vp test run apps/server/src/projectRuntime/RuntimeTaskContinuationPolicy.test.ts apps/server/src/projectRuntime/RuntimeTaskContinuationRestart.test.ts apps/server/src/projectRuntime/RuntimeTaskContinuationSecurity.test.ts + vp test run apps/server/src/projectRuntime + vp run typecheck + vp run check:changed +Verify source-scope and reviewer/repair-scope revision invalidation, latest user done/deferred/withdraw superseding stale blocked outcome, malformed key reservation, normal replay, no third repair/no VERIFIED, restart results. Preserve logs and commands, not just summary. Compare counts to handoff; discrepancies are not automatically defects. +Acceptance: all pass and clean tree, OR a reproducible classified blocker with two valid attempts/escalation; never rewrite tests merely to pass. + +### Stage O2 — Targeted safety and failure-path qualification +Owner: DeepSeek for test design/straight implementation; stronger model when concurrency or security-sensitive changes are necessary. +Use same isolated overnight code lane. Inspect and write deterministic tests for the **known** external launch TOCTOU, source-reexecution-mid-chain behavior, historical malformed receipts, task scope/acceptance revision drift, cross-project isolation and two-service SQLite contention. Prioritize new tests that reveal real defects and prevent duplicates/unauthorized dispatch. Do not invent a production revocation contract or change upstream engine. For the final-check/launch race, characterize exactly what occurs and document tradeoffs with a fixture; **do not assert a strict atomic fix without its source evidence**. +Acceptance: reproducible tests/contract and a bounded risk statement. Safe routine fixes on this experiment branch may proceed through two attempts + independent review. If an upstream execution-engine modification, new ledger or different revocation promise is necessary, classify PRODUCT DECISION/REVIEW REQUIRED and move to independent authorized read-only work, not risky implementation. + +### Stage O3 — Upstream-first compatibility reconnaissance +Owner: DeepSeek read-only GitHub/repo analyst; optional independent cheaper reviewer. +Fetch current upstream pingdotgg/t3code main and relevant open PRs/issues for execution/continuation overlaps. Compare our fork's touched contracts, ProjectRuntime execution service, orchestration events, provider context budget and migrations. Record real source/merge hotspots and difference between upstream implementation, PR proposal and our fork. +If feasible without destructive history edits, create **separate disposable local compatibility worktree/branch** to test applying our changes onto a fresh updated base; cherry-pick or apply patches only when safe and owned. Never rebase shared/published branches, merge to main or push upstream. After any changed base, rerun relevant tests. If conflicts are architectural, stop that implementation lane and write an exact compatibility report. +Acceptance: source-linked compatibility matrix, precise blockers, option with least upstream churn, and evidence of any executed tests. No "upstream compatible" claim without a real check. + +### Stage O4 — F4 production-gate and context-budget design / reversible prototype +Owner: DeepSeek design lead, Codex/Claude-class reviewer for security gating. +Analyze how to make the experimental continuation unavailable by default in a normal shipping build. Candidate options: exclude experimental public contract/UI entry points from shipping; or explicit default-off server enforcement with robust owner/user control, no provider prompt/budget leak. Measure actual MCP tool-list delta and offer a minimal non-production proof of concept **only on isolated experimental branch** if it can be reversed easily and does not change accepted architecture. +Do NOT make a product choice for user, approve the 646-byte context cost, treat "synthetic" as a gate, or integrate. If prototype changes contracts, preserve versioning and tests and mark as proposal requiring user choice. +Acceptance: decision memo with option pros/cons, failure modes, actual budget bytes, minimal patch/test evidence where safe, and explicit recommendation without adoption. Leave unresolved choice in PRODUCT DECISION state. + +### Stage O5 — Independent review, integration readiness, and morning handoff +Owner: independent reviewer (prefer a stronger model for security-sensitive review) not the latest implementer. Coordinator reconciles review vs repo/tests. Check authorization, actor provenance, revision CAS, task/handoff trust, restart isolation, shared target collision, repair budget, project boundaries, final external launch limitation, global feature gate and context cost. Re-review any routine defect after corrections. Do not self-certify or elevate reviewer evidence to VERIFIED. +Acceptance: line-specific findings, status RUNTIME PASS/REVIEW PASS only where proven, precise unresolved categories, clean worktree, committed checkpoint(s) on a new isolated experimental branch (normal fast-forward push permitted only after sanity/secret check and no conflicting owner), and durable final handoff. **NOT INTEGRATED** remains mandatory. + +### Stage O6 — Spare capacity only (safe, independent) +After O1–O5 complete or become blocked, continue with strictly read-only tasks already within the accepted continuation direction: inspect outstanding upstream PR response on #28777 without posting; prepare a documentation-only operator checklist for restart/cancel/escalation; inventory existing missing tests in projectRuntime. Record as research, NOT adopted decisions. Do not silently switch to unrelated product milestones or paid verification. + +## Routing policy and ROUTING LEDGER — mandatory for every child +Canonical routing evidence lives in Project Runtime execution receipts/attempts if available; otherwise append the following immutable records to the **branch-local** overnight ledger. A "summary" is not enough. Log one row BEFORE dispatch, one event AT routing resolution and one AFTER result. Include rejections and fallbacks, not just chosen provider. + +Required per-attempt fields: +- UTC timestamp, parent task ID, stage, child task ID, attempt number, scope/acceptance, source/base/worktree. +- Requesting actor and orchestrator (DeepSeek); **proposed** provider/model and **actually resolved** provider instance, model, driver, runtime mode; route source (task/profile/project/default), candidate order, isolation/worktree policy, eligible/disabled status, rejected candidate + reason, fallback used; exact host IDs only in durable ledger, not user-facing message. +- Why chosen: difficulty/risk, comparative cost and already-available quota/capacity, expected value, capability match, independent-review constraint. Unknown price/quota is "unknown," not fabricated. +- Dispatch time, last receipt/wake/liveness event, current state (READY/RUNNING/WAITING/REVIEW/BLOCKED/DONE), tool/command ID/request key if supplied, child thread, completion/handoff ID, last verified progress. +- Result: elapsed time if measured, token/cost only if measured, commands/tests/log file evidence, PASS/FAIL/review/retry, root cause, code owner, errors. +- Retry/escalation: first and second hypotheses, what actually changed, trigger, old/new model/provider, why stronger model was necessary, budget impact, accepted/denied outcome. +- Next action, provenance source and whether User/Manager approval is needed. Never silently change providers or reuse an unverified model identity. + +Make routing a **decision event** even when no worker is launched (candidate rejected due to unavailable provider/quota, incomplete scope, overlapping writer, security boundary). At each stage boundary reconcile ledger entries against actual T3 receipt, resolved route and Git/worktree truth; do not accept a worker self-reported route without host evidence when available. + +Template and initial facts: docs/orchestration-v2/overnight-deepseek-routing-ledger-20261104.md on the planning branch. Copy/update the ledger into the new owned overnight branch and/or Runtime as the live authoritative record. Do not overwrite append-only history on other branches. + +## Retry, escalation and no-infinite-loop rules +For each routine defect/blocker (test, typecheck, formatting, missing fixture, broken host command): +1. **Attempt 1:** DeepSeek identifies failure with exact log and a hypothesis; makes smallest authorized fix and reruns affected checks. +2. **Attempt 2:** DeepSeek tests a *materially different* explanation or isolation strategy, compares upstream/runtime truth, modifies plan, reruns. Simply executing the same failed command twice without new evidence is not two attempts. +3. **If both fail:** escalate a precise, bounded handoff to an **already available** stronger Codex/Claude-class model for security/concurrency/integration. Record *before* and *after* routing evidence. Stronger solver gets at most two bounded attempts before marking BLOCKED or requesting explicit new scope. +4. Cap the chain at **four total actual solution attempts per issue** (2 DeepSeek + up to 2 stronger) absent genuinely new evidence or a separate approved task. Hard stops remain immediate for product/architecture decision, destructive action, unauthorized paid cost, or security conflict. Never retry an unsafe action just to meet a quota. +5. If no stronger model is available or quota can't be used safely, record operational blocker, skip only to independent authorized tasks and keep the original code lane safely paused. No surprise provider spend. +6. A completed child is not accepted until the coordinator inspects logs and changed files, reconciles with spec/state, obtains required independent review and writes the handoff. Failed children do not automatically reopen ownership or authorize parallel writers. + +This retry policy is about **overnight engineering worker attempts**. It is **not** the experimental source-task policy's two-repair-cycle limit. + +## Monitor all children and keep progress moving +Before each child dispatch, record exact owner, task, attempt and expected completion channel. While a child is active use T3's native completion-wake/event and supported liveness or status mechanisms; verify actual host signals, not self-authored promises. When a child completes, inspect, accept/reject, release its code lane and launch the next authorized stage immediately. A missing completion is WAITING/OPERATIONAL BLOCKER, never silently DONE. If the child could have partially changed files, inspect repo/status before retry or model escalation. No overlap with previous writer. Persist roster/checkpoint after *every* change of state or provider/model. + +Use bounded health checks only as supported by local T3 runtime. If the host doesn't support timed background checks or true scheduled agents, report that limitation, avoid claiming all subagents are monitored during a disconnected session and rely on durable recovery at restart. Don't burn tokens polling idle workers with no new evidence. + +## Morning handoff contract +At finish or interruption provide: +VERDICT per stage; BASE/CHECKPOINT (branch/worktree/cleanliness, upstream); RESULT and changed paths; VERIFICATION commands/exit codes/stub-or-live; FAILURES/RISKS with classifications; REVIEW with reviewer provider/model; INTEGRATION STATE; NEXT exact action; USER DECISIONS pending; **routing ledger link** and a small routing table (task, selected model/provider, alternatives rejected, attempt count, escalation reason, verified outcome); all outstanding subagent status and last verifiable liveness event. Provide full durable task/handoff entries in Runtime when supported and commit a ledger snapshot. Do not fabricate timestamps, cost metrics, or child completion. + +## Stop conditions +Product-choice/security gate, material architecture tradeoff, new authoritative queue/store, production revocation semantics, upstream V2 core rewrite, irreversible Git operations, real or material paid provider calls, unresolved merge conflict, or violated worktree ownership require user action on the affected task. The DeepSeek coordinator may continue with other non-overlapping read-only stages while preserving blocked state. For any defect, classification must be IMPLEMENTATION DEFECT, VERIFICATION FAILURE, OPERATIONAL BLOCKER, REVIEW REQUIRED, INTEGRATION CONFLICT, UPSTREAM COMPATIBILITY or PRODUCT DECISION. + +## Host launch instruction +In T3 Code, start an active DeepSeek parent/orchestrator session with: +"Read the entire overnight DeepSeek serial handoff and routing ledger at the GitHub links above; verify the source and repository base; execute O0–O6 serially using T3's existing subagent dispatch/completion features. You own coordination and ledger updates, not product decisions. Attempt each routine blocker twice with distinct evidence-led approaches before escalating to a stronger available model, maximum four attempts total. Keep all child routing choices, provider/model changes, readiness, status and result in canonical Runtime and the append-only ledger. Follow all stop rules. End with an authoritative morning handoff. Do not merge or enable production." diff --git a/docs/orchestration-v2/preimplementation-architecture-reuse-research-20261103.md b/docs/orchestration-v2/preimplementation-architecture-reuse-research-20261103.md new file mode 100644 index 0000000000000..34873f9c46630 --- /dev/null +++ b/docs/orchestration-v2/preimplementation-architecture-reuse-research-20261103.md @@ -0,0 +1,225 @@ +# Pre-implementation comparative research: automatic continuation and project governance + +Date: 2026-11-03 +Status: READ-ONLY SOURCE RESEARCH / ADVISORY / NO IMPLEMENTATION +Scope: reduce needless T3 orchestration code before the planned stub-provider continuation spike. +Owner: browser-side Overall Manager; not an independent runtime review. + +## Question + +Should T3 first inspect the most comparable open-source project-management and agent-orchestration systems before implementing its own continuation logic? + +**Yes.** The focus is not picking a replacement framework; it is identifying small, validated design patterns T3 lacks and avoiding duplicated execution/state ownership. This report records the initial code/documentation archaeology performed in the browser. No tests, installations or external agent calls were run. + +## Immediate-relevance ranking + +| Rank | Source | What the inspected implementation actually has | Ideas worth testing in T3 | Do not import blindly | +| --- | --- | --- | --- | --- | +| 1 | [Microsoft Argus](https://github.com/microsoft/ArgusAgent) | Official public MIT-licensed repository; persistent Projects → Missions → Roles → provider sessions; role-owned review and stage transitions; durable event log/mission history, learned skills and evidence admission; multiple backend CLIs including DSH. [Core concepts](https://github.com/microsoft/ArgusAgent/blob/main/docs/CORE_CONCEPTS.md), [layout](https://github.com/microsoft/ArgusAgent/blob/main/docs/LAYOUT.md), [stage decision code](https://github.com/microsoft/ArgusAgent/blob/main/argus/manager/_stage_ops.py) | (a) Fast direct path for short engineering tasks; (b) no redundant Manager semantic vote after a clean independent reviewer verdict; (c) explicit role authority and evidence admission; (d) bounded context packet and per-role cost accounting | Its own Python project database, mission runner, role sessions, backlog and daemon would replace/compete with T3; author-reported autonomy benchmarks are not T3 evidence | +| 2 | [DeepSeek Superagent prototype](https://github.com/deepseek-ai/dsh-superagent-prototype) | MIT research prototype; [single transactional Engine](https://github.com/deepseek-ai/dsh-superagent-prototype/blob/main/src/core/engine.ts), [domain](https://github.com/deepseek-ai/dsh-superagent-prototype/blob/main/docs/001-domain.md) and [authorization](https://github.com/deepseek-ai/dsh-superagent-prototype/blob/main/docs/002-authorization.md); [outbox](https://github.com/deepseek-ai/dsh-superagent-prototype/blob/main/src/app/outbox.ts) atomically records receipts/effects; event source Trigger and authorized Mandate are distinct | Deterministic intake/idempotence, explicit scope, queued after-commit effects, context-only subscriptions not gaining authority, human-question state, failed-ticket hold; edge-case tests | Its own Ticket/Assignment/Store lifecycle, DSH alpha plugin host, default unsafe command execution; not a drop-in ACP coordinator | +| 3 | [OpenHands Automation + SDK](https://github.com/OpenHands/automation) | Beta automation service owns webhooks/cron/runs and dispatch; [dispatcher](https://github.com/OpenHands/automation/blob/main/openhands/automation/dispatcher.py) has multi-worker locking, async terminal callbacks, retryable vs permanent errors; [models](https://github.com/OpenHands/automation/blob/main/openhands/automation/models.py) persist integration-event IDs and run linkage; SDK's conversation owns agent execution and persist-before-publish events | Separate event admission from execution; coalescing repeat external events; narrow event-to-run boundary; explicit idempotency and classification of provider errors | Its extra service, database and Python backend would duplicate T3's event/attempt lifecycle | +| 4 | [Cloudroom](https://github.com/davidondrej/cloudroom) | [Harness adapters](https://github.com/davidondrej/cloudroom/blob/main/core/docs/harnesses.md) separate process ownership from agent inference; [session lifecycle](https://github.com/davidondrej/cloudroom/blob/main/core/docs/session-lifecycle.md) preserves accepted requests, stable request IDs, uncertainty states, saved session history, sleep/recovery | Do not replay uncertain side effects; durability barriers before acknowledgement; recover after outage without turning missing history into false success | Native session owner/runtime and local/cloud replication machinery overlap with T3; more useful for later provider-failover qualification | +| 5 | [Letta Code / Letta ACP](https://github.com/letta-ai/letta-code) | Agent experience memory with Git-versioned context and local ACP interface. [Letta ACP](https://github.com/letta-ai/letta-acp) offers optional stateful worker integration | Retain provenance-labelled lessons, permit optional experience memory, measure saved context | Treating memory as accepted project truth, or requiring Letta for restart portability | +| 6 | [Mastra](https://github.com/mastra-ai/mastra) | TypeScript agent workflows/checkpoints and [memory module](https://github.com/mastra-ai/mastra/tree/main/packages/memory) | Potential later study of observational memory/compaction | Full workflow engine over existing T3 lifecycle without evidence of lower net cost | + +**Correction:** Argus is not closed source. Its [MIT licence](https://github.com/microsoft/ArgusAgent/blob/main/LICENSE) permits modification and forking, subject to copyright/notice retention. Microsoft Research publishes [the technical report](https://www.microsoft.com/en-us/research/publication/argus-a-general-purpose-agentic-reasoning-runtime-for-long-horizon-tasks/). + +## Most significant discovery: Argus's own token-overhead problem + +Argus's [architecture simplification plan](https://github.com/microsoft/ArgusAgent/blob/main/docs/architecture-simplification-plan.md) documents a short coding task that initially incurred excessive Planner/Manager/Reviewer calls, even after a reviewer had clean evidence. The documented remedy is a direct execution path: skip Planner for simple tasks and avoid a second semantic decision after a clean independent review if deterministic completion checks suffice. Their historical single-task numbers are *author-reported*, not comparative proof for T3. + +Their [stage-transition code](https://github.com/microsoft/ArgusAgent/blob/main/argus/manager/_stage_ops.py) implements a clean-review fast path guarded by context fingerprints and a shared-lock commit to reject stale decisions. T3 should test equivalent semantics using its existing revision/attempt guards, not introduce a second ledger. + +**Architectural warning:** Argus itself is a sizeable Python system with backlog/event/mission stores and ongoing architecture simplification. Reusing its *tested mechanisms* is lower-risk than embedding its full runtime in T3. + +## Implications for the T3 continuation spike + +Keep one T3 authoritative project task and execution graph. Revise detailed implementation planning to account for these checks: + +1. **Fast-path rule:** Automatically dispatch only a next action previously authorized by T3; do not use a model simply to acknowledge a terminal event. Explicitly measure routing/manager/reviewer token overhead per accepted result when real providers are introduced later. +2. **Review provenance rule:** A worker terminal `completed` is not verification. Syntactically passing evidence is not itself independently authenticated. Tie admitted evidence to the correct task, attempt, review identity and expected state; block stale or contradictory verdicts. +3. **No second verdict rule:** If review passes and all deterministic acceptance gates hold, do not make an additional Manager semantic call. For disputed/ambiguous reviews, escalate. +4. **Event intake rule:** External GitHub/CI or model data is context, not authority. Deduplicate event and action receipts, handle failed after-commit dispatch and preserve uncertainty across restart. +5. **Error rule:** Differentiate missing evidence, permanent authorization failure, transient provider outage and ambiguous execution. Never automatically retry a completed side effect or treat missing history as success. +6. **Safety:** Real shell actions must use existing T3 permission/worktree controls; external prototypes' defaults are not T3 security guarantees. + +Before writable implementation, inspect concrete existing T3 service/event hooks and tests to avoid duplicating a code path already present. The current [stub-provider spike](https://github.com/jermur788/t3code/blob/planning/resource-efficient-continuation-20261103/docs/orchestration-v2/continuation-stub-provider-spike-task-20261103.md) remains a separate, draft implementation task, not a passed test. + +## Research sequencing + +- **Browser completed:** public licence and architecture checks; T3 Runtime and Superagent code review; Argus role, event log, stage authority and short-path analysis; OpenHands dispatcher/event source separation; Cloudroom request/receipt persistence; Letta/Mastra integration-shape inspection. +- **Next, before implementation:** a narrow code-to-code mapping for Argus clean-review admission vs T3 task verification, and DeepSeek outbox/eval receipts vs T3 execution service; check exact test seam. This should produce a small accepted governing spec and only one code lane. Existing independent Sonnet comparative review favors native T3 coordination; this research adds failure-mode details rather than overturning that conclusion. +- **Then:** isolated synthetic continuation experiment with existing T3 Runtime, no keys or models. Require replay, restart, stale-evidence and idempotency negative tests, independent code review. This work is local-tool-dependent and should be routed to T3 Code only after source/spec comparison. + +## Precise existing T3 continuation seam (second read-only inspection) + +- [RuntimeTaskExecutionService.ts](https://github.com/jermur788/t3code/blob/main/apps/server/src/projectRuntime/RuntimeTaskExecutionService.ts): `reconcileAttemptRow` maps terminal Orchestration V2 run status into the persisted Runtime attempt and links the matching-thread handoff. `reconcileAttempt` is explicit, and `reconcileActiveAttempts` is called for startup/recovery. This currently does **not** establish a live, continuous next-action dispatcher for every terminal worker event. +- The same service's `execute` already checks task revision, active attempt, routing and a caller request key, and persists a pending attempt before launching. Automatic continuation must call this guarded seam instead of making its own worker-launch path. +- [EventSink.ts](https://github.com/jermur788/t3code/blob/main/apps/server/src/orchestration-v2/EventSink.ts) provides `writeWithEffects`, conditional writes, committed-event publication and command receipts; [EffectOutbox.ts](https://github.com/jermur788/t3code/blob/main/apps/server/src/orchestration-v2/EffectOutbox.ts) already persists idempotent queued effects and recovery receipts, with [EffectWorker.ts](https://github.com/jermur788/t3code/blob/main/apps/server/src/orchestration-v2/EffectWorker.ts) as the effect executor. However, the existing effect request schema is deliberately closed to known orchestration effect types. Reusing this outbox for fork-owned task continuation **requires an explicit compatibility and dependency-boundary review**, not blindly adding a new effect type to upstream internals. +- [Argus stage ops](https://github.com/microsoft/ArgusAgent/blob/main/argus/manager/_stage_ops.py) offers a concrete example of checking a clean independent reviewer verdict plus a current-context fingerprint before an extra Manager model turn, closely matching T3's revision-based safety requirements. +- [Argus MCP plugin](https://github.com/microsoft/ArgusAgent/blob/main/argus/plugin/mcp_server.py) exposes project creation/listing, message, status, diagnostics, stop and artifacts, **not** external ownership injection for T3 task truth. Argus-as-complete-coordinator is therefore not a proved drop-in path, even though its source is MIT-licensed. + +**Implementation implication:** First decide whether a small fork-owned after-commit listener/continuation receipt is enough, with no new table, or whether limited durable state is required. Do not modify upstream EventSink or EffectWorker until source-level review proves the extension is safe and cheaper than a fork-owned service. + + +## 2026-11-03 addendum: attached upstream-first study and real-run progress evidence + +**Source status:** attached eight-page *Upstream-First Strategy for T3 Fork* is secondary/advisory architecture research, not a governing decision. A separate supplied Runtime timeline describes the 2026-11-03 DeepSeek/CCF qualification; its reconstruction has not been independently replayed in this browser session. Both are additional evidence, not proof of runtime integration. + +### Upstream-first capability ownership + +The study argues that T3's current Orchestration V2 is an app-owned, provider-neutral execution and event substrate rather than a thin agent UI. It recommends checking upstream main, issues, discussions, PRs and forks before fork-specific implementation; generic execution semantics, receipts, delegated continuation, wakeups, provider lifecycle, worktree handling and context efficiency belong upstream when possible. Fork-owned capabilities remain authoritative specs, accepted decisions, dependency-aware project tasks, review/verification policy, autonomous next-work selection and non-developer governance. + +**This does not close the prior Argus-versus-DeepSeek-versus-T3 build/reuse comparison.** The attached study itself treats the architecture comparison as its next input. In particular, Argus as potential coordinator has not yet received the same independent review as DeepSeek. + +Specific source references: +- Upstream Orchestration V2 [overview](https://github.com/pingdotgg/t3code/blob/main/docs/orchestration-v2/README.md), [core graph](https://github.com/pingdotgg/t3code/blob/main/docs/orchestration-v2/core-graph-and-data-model.md), and [orchestrator MCP](https://github.com/pingdotgg/t3code/blob/main/docs/orchestration-v2/orchestrator-mcp-server.md). +- [Persistent initiatives idea](https://github.com/pingdotgg/t3code/discussions/16269) and [project-scoped memory proposal](https://github.com/pingdotgg/t3code/discussions/15858): community proposals, **not accepted upstream implementations**. +- [Orchestration-context efficiency proposal](https://github.com/pingdotgg/t3code/discussions/17253): reports an instruction-text reduction of ~21% in one block; actual provider token savings unverified. +- [Review resumption issue](https://github.com/pingdotgg/t3code/issues/28734): open when checked on 2026-11-03. +- [Antigravity async-child wake issue](https://github.com/pingdotgg/t3code/issues/17412): GitHub API shows closed on 2026-11-02 for lack of information; subsequent reports say it still reproduces. [PR #30083](https://github.com/pingdotgg/t3code/pull/30083) proposes continuation/streaming fixes and is **open, unmerged** on 2026-11-03. Do not equate closed issue with verified resolution. Separate [wake and paragraph streaming PRs](https://github.com/pingdotgg/t3code/pull/28204) and [#28221](https://github.com/pingdotgg/t3code/pull/28221) also remain open on the inspection date. + +### Supplied DeepSeek run progress correction (separate, user-supplied evidence) + +A separate supplied execution analysis finds that an agent-authored twelve-item todo list stopped receiving updates while T3 Runtime continued storing tool and run events. The user-visible display was stale for ~4h51m of a ~4h54m run, with ~4h24m in serial Unity tests and an ~1h01m invalid Unity method wait. The qualification was still **BLOCKED / NEEDS MORE EVIDENCE**, not VERIFIED. Neither model reasoning time nor tokens are instrumented. Thus: +- Do not treat displayed plan item number as authoritative Runtime progress or as model-performance evidence. +- Separate **agent-authored plan snapshot**, **actual event/step heartbeat**, **Runtime task/attempt state**, and **review/qualification verdict** in both research and eventual UX. +- Treat plan freshness, append-only plan versions, declared revision and explicit current-step evidence as a **candidate generic T3 observability improvement** only after checking upstream discussions/PRs/code. Do not mix it into the continuation spike or CCF production work. +- Use the run to motivate telemetry: measure model turn latency, tools/tests/waits, retries and final verified outcome separately, not elapsed UI-label time. + +### Updated research and implementation gate + +1. First complete an evidence-backed *current-upstream and community overlap map* for every proposed fork implementation primitive. Where upstream already owns a receipt/outbox/recovery guarantee, remove the duplicate fork item or narrow it to an integration/policy adapter. +2. Finish independent Argus vs T3 upper-layer comparison and precise DeepSeek component reuse/migration economics. Distinguish generic orchestration runtime from project-level task authority. +3. Make explicit owner/adopter decisions for each atomic capability: upstream candidate, existing upstream, thin T3-fork policy, optional worker/memory, or defer. +4. Re-evaluate the isolated stub continuation experiment. Prefer T3's existing execution and effect lifecycle; don't add new tables or fork an upstream runner absent a proved gap. Keep this spike **unstarted** until the comparison and governing spec are reconciled. +5. Track the progress-UI analysis as a separate observability candidate, pending source validation and user-facing rendered testing if implemented. + +**Status:** research and source recon completed in browser; no code, deployment, upstream contribution, test or provider change. + + +## Next browser-capable research handoff — comparative architecture gate + +**TASK / ROUTING:** Browser-side Overall Manager, read-only GitHub source/research, no external agent needed. This is an architectural research task, not a local implementation assignment. + +**BASE / CONTEXT:** Compare the live upstream `pingdotgg/t3code` main, fork `jermur788/t3code` main, current Argus and DeepSeek source at known inspected revisions; refresh every head before final findings. Use this document and the attached *Upstream-First Strategy* as research; the accepted [fork product direction](https://github.com/jermur788/t3code/blob/main/docs/internals/fork-product-direction.md) and current Project Runtime/coordination sources govern authority. + +**GOAL:** Decide, with code-level evidence, which *atomic* continuation/review/authority/observability capabilities are already provided by upstream, should be contributed upstream, should remain fork-specific policy, can be imported from Argus/DeepSeek, or should be deferred. + +**IN SCOPE:** +1. Read current T3 orchestration V2 event/receipt/effect/continuation services, Runtime execution/review/evidence contracts and their focused tests. Compare fork vs upstream rather than relying only on docs. +2. Investigate Argus as a possible **upper-layer project coordination policy** replacement: list exact project/mission/stage/reviewer interfaces, external write APIs, durable state owners, package coupling, provider independence, error/replay semantics and minimal adapter boundaries. +3. Investigate DeepSeek Superagent's Event/Policy/Eval/Mandate/Outbox seams only to identify independent reusable concepts or code; do not assume ACP transports its coordination engine. +4. Inspect live upstream PRs/issues/discussions for overlap. Record **proposal vs open PR vs merged main vs tested** separately, and whether upstream wants contributions. +5. Classify real-run 12-item todo staleness as distinct progress-observability source question; look for existing upstream plan revision/heartbeat features and candidate patch scope without building them. +6. Deliver an owner/reuse matrix, maintenance cost bands, strongest counterarguments to winning architecture, and precise pass/fail criteria for any remaining synthetic experiment. + +**OUT OF SCOPE:** no code modifications, source migrations, subagent installs, credentials, paid inference, CCF/Unity runs, project-state rewrites, implementation starts, PR merges or outreach to upstream without separate authorization. + +**OWNERSHIP:** Read-only source inspection; GitHub draft research branch may be updated by one documentation writer. T3 Runtime, upstream T3 execution graph and user-owned project authority do not change. + +**ACCEPTANCE:** All material claims link to exact source file/function or discussion/PR; no second authoritative task/attempt store proposed; actual upstream implementation distinguished from pending proposals; Argus direct-embed constraints explicitly examined; total-effort and token-measurement uncertainties noted; selection criteria remain reversible and user controls product choice. + +**VERIFICATION:** Source-level only (`SOURCE-INSPECTED`); no `RUNTIME PASS` claimed. If a code experiment is recommended, define isolated stub task(s), replay/restart/idempotence/security negative tests and acceptance criteria. Reconcile with Current State (Documentation V1 remains separately pending), record updated source base and handoff. + +**STOP CONDITIONS:** user decision on replacing accepted Project Runtime authority, upstream contribution identity/public disclosure, paid infrastructure, destructive operations, material scope expansion or unresolved security conflict. + +**HANDOFF RETURN:** Verdict/alternatives, source revisions and links, implementation truth vs claims, capability matrix, maintenance/rebase risks, verification gaps, blocker classification, recommended smallest next task, state/PR changes and product decision (if any) requiring user action. + + + +## Source-level decision gate completed: Argus vs T3 and live upstream overlap (2026-11-03) + +**Verdict: SOURCE-INSPECTED / ARCHITECTURE RECOMMENDATION ONLY. No T3 or Argus runtime was executed in this investigation.** + +### Revisions and authority + +- Upstream T3: \`pingdotgg/t3code main\`, source inspected on 2026-11-03, head \`9def583f8e315f644708501ebcf1f3d4bb320444\` at final refresh. Active repository; re-check before writable work. +- Fork: \`jermur788/t3code main\`, \`d3bedef12a31f368e5c5a6b279445bea39a6a13a\`. The 2026-10-31 Current State records a historical integrated base; live repo base takes precedence. +- Argus official source: \`microsoft/ArgusAgent main\`, \`fdfeb715b0749db176c7d8b3212a717fb81087ba\`; MIT licensed. Official stable source is distinct from its development-preview repository. No packaged-release compatibility claim. +- DeepSeek Superagent research prototype: \`deepseek-ai/dsh-superagent-prototype main\`, \`8c32a9dc5d72c033816c6a8110b37f40cf94fba4\`, MIT, single researched initial snapshot; DeepSeek Harness master at \`8bd073392eef6f54e921a093b95076248eb08cbb\`. +- Primary product authority: [accepted fork product direction](https://github.com/jermur788/t3code/blob/main/docs/internals/fork-product-direction.md) — durable Project Runtime above upstream T3's execution graph. Prior Sonnet review comparing native T3 to DeepSeek Superagent is advisory and did not review Argus. + +### Argus source-to-source feasibility + +| Argus capability | Examined actual source | Reuse/adoption judgment | +|---|---|---| +| Project identity, durable mission backlog, history and sessions | [Core concepts](https://github.com/microsoft/ArgusAgent/blob/main/docs/CORE_CONCEPTS.md), [backlog/event journal](https://github.com/microsoft/ArgusAgent/blob/main/argus/life/memory.py), [event log](https://github.com/microsoft/ArgusAgent/blob/main/argus/life/event_log.py) | **Do not embed as project owner.** Argus stores its own \`backlog.jsonl\`, \`events.jsonl\`, \`handoffs/\`, role sessions and project-state roots; T3 already stores authoritative tasks/handoffs and run attempts in SQLite and V2 events. A bridge would require dual-ledger reconciliation or a wholesale migration/replatforming. | +| Public external control | [MCP tools](https://github.com/microsoft/ArgusAgent/blob/main/argus/plugin/mcp_server.py) and [service façade](https://github.com/microsoft/ArgusAgent/blob/main/argus/plugin/service.py) | Exposes Argus project create/list/message/status/doctor/stop/artifacts. No observed MCP operation accepts a T3 Runtime task as an externally authoritative mission with external commit/review ownership. HTTP APIs are broader but bind to Argus's own backlog/daemon lifecycle. **Not a drop-in T3 coordinator interface.** | +| Role separation, Manager/Planner/Engineer/Reviewer | [Layout/layers](https://github.com/microsoft/ArgusAgent/blob/main/docs/LAYOUT.md), [role prompts](https://github.com/microsoft/ArgusAgent/blob/main/argus/roles/prompts/manager.py) | **Borrow authority semantics and test cases.** Managers select permitted work, Engineer does work, Reviewer judges independently, provider sessions are replaceable. No need for a second four-role execution loop if T3 already dispatches worker and reviewer providers. | +| Clean independent reviewer fast path | [stage operations](https://github.com/microsoft/ArgusAgent/blob/main/argus/manager/_stage_ops.py) \`_is_clean_reviewer_acceptance\`, \`_commit_stage_decision_if_current\` | **High-value design reuse**: validate all structured review fields and a current-context fingerprint; commit under lock; skip another Manager model semantic turn after a clean, accepted review. Reimplement a narrow TypeScript policy at the T3 Runtime boundary rather than importing a Python project manager. | +| Operator-owned vs manager-owned changes | [project contract](https://github.com/microsoft/ArgusAgent/blob/main/argus/core/project_contract.py), \`Clause.authority\`, \`confirmation_changes\`, \`revise_contract\` | **High-value policy reuse**: distinguish precise/semantic checks from who may change them; technical working parameters can be manager-owned but accepted objectives, scope and exclusions remain operator-owned. Do not let an agent's remembered context revise authority. | +| Review, repair and stage/dependency correctness | [mission settlement](https://github.com/microsoft/ArgusAgent/blob/main/argus/life/supervisor/_mission_execution_settlement.py) and [stage-machine contract](https://github.com/microsoft/ArgusAgent/blob/main/argus/skills/stage_machine.py) | Borrow guards: reviewer \`done\` is necessary but not always sufficient, invalid or superseded task claims block completion; unfinished sibling tasks prevent stage advance; repair capability has explicitly bounded authority. T3 must implement these as project-policy invariants, not a second Argus task store. | +| Durable commands, input receipts and event replay | [daemon commands](https://github.com/microsoft/ArgusAgent/blob/main/argus/daemon/commands.py), [event log](https://github.com/microsoft/ArgusAgent/blob/main/argus/life/event_log.py) | **Mostly already solved by upstream T3** through its V2 event store, receipt/outbox and state transitions; do not import parallel persistence. Add any absent project-policy receipts only where idempotent T3 \`clientRequestId\` is insufficient. | +| Provider/harness interchangeability | [RunnerBackend protocol](https://github.com/microsoft/ArgusAgent/blob/main/argus/core/ports.py) and CLI adapters, including DSH | Compatible in *principle* with replaceable models, but Argus uses Python subprocess/CLI backend and manages its own role sessions, whereas T3 uses TypeScript provider drivers, ACP and V2 threads. This is a cross-language runtime replacement, not a TypeScript package import. | +| Overhead reduction | [architecture simplification plan](https://github.com/microsoft/ArgusAgent/blob/main/docs/architecture-simplification-plan.md) | Use a direct, deterministic lane for routine tasks; allocate Planner and reviewer calls selectively. The plan reports significant earlier excess overhead and improved short-path behavior; these are **Argus author-reported measurements, not transferable T3 benchmarks**. | + +**Argus integration feasibility conclusion:** A complete Argus replacement could be made legally (MIT) but would require moving T3 Runtime's task authority into Argus or writing a nontrivial bidirectional bridge, plus operating a separate Python daemon and reconciling provider/model identities, worktrees, security and tests. Its public MCP bridge is not a substitute for that work. The existing T3 task/attempt substrate is already verified to a stronger level than the *new* continuation policy being considered. The smaller option is to port/implement **specific Argus policy behavior and tests**, while continuing to monitor Argus upstream. Reject a second canonical project ledger. + +**Strongest case for Argus:** It already implements complete long-running mission supervision and independent reviewer gates, with operational edge cases beyond our narrow synthetic scenario. A fully isolated comparative trial might show materially lower time/tokens to independently verified outcomes. If it demonstrates this with T3 truth preserved, reopen replacement. Source inspection cannot prove relative runtime performance. + +### Live upstream and fork capability-to-owner matrix + +Statuses refer to **source inspection** unless an existing integrated T3 test evidence packet is explicitly named; they do not assert live tests from this research. + +| Atomic capability | Upstream T3 current source | Fork-specific current source | Recommended owner and action | +|---|---|---|---| +| Multi-provider sessions, model provenance, agent execution and delegated child work | **Implemented**: [orchestrator MCP API](https://github.com/pingdotgg/t3code/blob/main/docs/orchestration-v2/orchestrator-mcp-server.md), [RunExecutionService](https://github.com/pingdotgg/t3code/blob/main/apps/server/src/orchestration-v2/RunExecutionService.ts), adapters/provider contracts | RTE bridge uses upstream thread launch and provider selection | **Upstream**. Do not write another engine or dispatch route. DeepSeek Harness optional ACP worker, not coordinator. | +| Durable run events, command receipts, effect queuing and replay | **Implemented**: [EventSink.writeWithEffects/commitCommand](https://github.com/pingdotgg/t3code/blob/main/apps/server/src/orchestration-v2/EventSink.ts), [EffectOutbox](https://github.com/pingdotgg/t3code/blob/main/apps/server/src/orchestration-v2/EffectOutbox.ts), [EffectWorker](https://github.com/pingdotgg/t3code/blob/main/apps/server/src/orchestration-v2/EffectWorker.ts) | No need for second EventSink or queue | **Upstream**. Fork should consume existing receipts and \`clientRequestId\` guards; adding a fork-specific effect type to upstream is a rebase hotspot and requires a demonstrated gap. | +| Background provider task completed → parent wake/continue | **Implemented, not universally reliable**: [ProviderContinuationService](https://github.com/pingdotgg/t3code/blob/main/apps/server/src/orchestration-v2/ProviderContinuationService.ts) and [ProviderContinuationRequests](https://github.com/pingdotgg/t3code/blob/main/packages/provider-core/src/server/ProviderContinuationRequests.ts). Some wakeups and streaming remain defective in specific adapters. | Not the same as Runtime project review/repair policy | **Upstream generic correctness**. Track [Antigravity fix PR](https://github.com/pingdotgg/t3code/pull/30083), [sibling wake PR](https://github.com/pingdotgg/t3code/pull/28204), [idle streaming PR](https://github.com/pingdotgg/t3code/pull/28221), all **open/unmerged** on inspection. No fork-owned equivalent. | +| Reliable worker-attempt start, cancellation and restart reconciliation | **Existing V2 run/receipt/recovery services**: [ProviderRuntimeRecoveryService](https://github.com/pingdotgg/t3code/blob/main/apps/server/src/orchestration-v2/ProviderRuntimeRecoveryService.ts), [RunExecutionService](https://github.com/pingdotgg/t3code/blob/main/apps/server/src/orchestration-v2/RunExecutionService.ts) | [RuntimeTaskExecutionService](https://github.com/jermur788/t3code/blob/main/apps/server/src/projectRuntime/RuntimeTaskExecutionService.ts) persists a task-specific attempt before launch, one active attempt per task, deterministic \`clientRequestId\` per task, startup reconcile and ambiguous \`reconcile_required\`. [RTE final verification](https://github.com/jermur788/t3code/blob/main/docs/orchestration-v2/rte-070-final-verification.md) records tests and live evidence. | **Split**: upstream owns run/session execution; fork owns task-to-execution linkage and its authoritative project task. Do not duplicate worktrees or run state. | +| Cross-project delegation and worktree child ownership | Existing MCP concepts; destination selection still under work | Fork uses project task, isolated worktree base when launching | **Potential upstream**. [PR for cross-project child delegation](https://github.com/pingdotgg/t3code/pull/28859) open/unmerged, with reported tests. Evaluate/consume when accepted; do not copy into fork now. | +| Durable project specs, sources, accepted decisions, tasks, handoffs | T3 execution project/thread objects and **Ideas proposal** for initiatives, not a verified canonical project-task contract | **Implemented**: [ProjectRuntimeService](https://github.com/jermur788/t3code/blob/main/apps/server/src/projectRuntime/ProjectRuntimeService.ts) with task revision, handoffs, sources and user/UI mutation separation. [Fork product direction](https://github.com/jermur788/t3code/blob/main/docs/internals/fork-product-direction.md) accepted. | **Fork-specific authority**; preserve. Monitor [initiative discussion](https://github.com/pingdotgg/t3code/discussions/16269) for possible future generic upstream shell, without surrendering accepted task truth. | +| Project-level worker completion → independent review → repair/next action | Upstream delegate_task/task_status expose individual app-owned child runs but **do not supply T3 Fork's project-level verification and product authority policy** | Existing attempt outcome is updated via explicit Recheck or startup reconciliation, not yet a proven event-driven project continuation service | **Missing fork-only policy**. Small deterministic continuation evaluator over T3 task revisions, accepted scope, evidence and existing execution service. Do not confuse with provider post-settle continuation. | +| Independent review and verified task acceptance | Upstream child review can be dispatched but has no fork Project Runtime verification semantics | [ProjectRuntimeService](https://github.com/jermur788/t3code/blob/main/apps/server/src/projectRuntime/ProjectRuntimeService.ts) rejects passing milestones without a pass-marked evidence entry; [OrchestrationEvidenceService](https://github.com/jermur788/t3code/blob/main/apps/server/src/projectRuntime/OrchestrationEvidenceService.ts) exports provenance. **Pass-marked evidence input validation is not independent authentication.** | **Fork policy**: require reviewer identity, task/attempt/version binding, evidence provenance, current-state guard and explicit authorized decision before automatic status advance. Borrow Argus clean-review guards. | +| Manager/Planner/Reviewer role selection and token economy | Upstream supplies selectable provider workers; not a mandatory manager policy | Development Profiles and adaptive routing evidence are present; adaptive behavior verification still pending | **Fork high-level policy**, optional model. Argus direct-path rules and reviewer fast path; route a model only when deterministic evidence cannot decide. Avoid hard-coded four-role loop. | +| Provider-neutral project memory and reusable lessons | [Idea/working community fork](https://github.com/pingdotgg/t3code/discussions/15858), **not integrated upstream main** | Authoritative Runtime sources/handoffs already exist; separate agent memory not established | **Defer elective memory**. Letta/Mastra optional advisory; maintain separate accepted project truth. Coordinate with upstream memory proposal if adopted. | +| Cost/performance observations and learned routing | Upstream [RunMetrics](https://github.com/pingdotgg/t3code/blob/main/apps/server/src/orchestration-v2/RunMetrics.ts) and provider telemetry | [OrchestrationEvidenceService](https://github.com/jermur788/t3code/blob/main/apps/server/src/projectRuntime/OrchestrationEvidenceService.ts) and adaptive routing components, not qualified end-to-end for learned policy | **Existing upstream telemetry + fork evidence linkage**. Avoid another telemetry database. Collect verified cost per accepted outcome in separate authorized pilots. | +| Agent-authored plan versus actual progress | Upstream V2 turn/run events exist; plan/checklist update behavior is separate | A supplied CCF/DeepSeek trace showed a stale \`Task 1 of 12\` user-facing label while test/tool work advanced. No runtime test in this research | **Potential generic upstream observability improvement, separate workstream**: show authoritative run event progress/last-step and plan freshness rather than treating an agent-maintained todo counter as execution truth. No change in continuation spike. | + +### Community and contribution gate + +- Upstream [README](https://github.com/pingdotgg/t3code/blob/main/README.md) still states it is mostly not accepting contributions, may consider small fixes, and generally declines large features; Ideas discussions are the route for feature requests. Therefore **upstream-first does not mean blocking T3 Fork's roadmap on upstream acceptance**. +- [Initiatives discussion](https://github.com/pingdotgg/t3code/discussions/16269), [memory discussion](https://github.com/pingdotgg/t3code/discussions/15858), and [context-efficiency discussion](https://github.com/pingdotgg/t3code/discussions/17253) are community research/proposals, not merge evidence. +- [Antigravity wake issue](https://github.com/pingdotgg/t3code/issues/17412) was closed for missing follow-up, with subsequent reports of continuing failure. A closed issue is **not** proof that current upstream works. The three relevant remediation PRs listed above remain unmerged; their authors report various tests/live probes that have **not been rerun** in this investigation. +- [Cross-project delegation PR](https://github.com/pingdotgg/t3code/pull/28859) remains open/unmerged. May reduce future fork work but does not currently establish an accepted interface. +- High-maintenance conflict hotspots: upstream \`EventSink\`, \`EffectWorker\`, V2 provider adapters, \`ThreadManagementService\`, MCP tools, and shared contracts. Prefer one fork-owned continuation policy service using existing public service calls and task revision guards. + +### Cost, alternatives and falsification + +| Architecture | Initial development and verification | Ongoing maintenance exposure | Verdict | +|---|---|---|---| +| **A: T3 Runtime + thin fork continuation policy** | **Small–medium** source-estimated missing policy + stub-provider crash/replay tests; no new provider engine. Need local runtime evidence. | Low–medium; monitor upstream V2 interfaces, keep policy additive and independently tested. | **Preferred working hypothesis, confidence moderate-high on architecture only.** | +| **B: Argus as main coordinator** | **Large**: Python service integration, project/mission/run schema migration or dual-state mapping, task authority sync, credentials/worktree isolation, review/verification reconciliation and safety qualification. | High, two release/language/runtime surfaces; may improve if Argus releases an external task-store/adjudication API. | Reject as near-term primary runtime on inspected interfaces, **not** as potential future standalone benchmark/worker. | +| **C: DeepSeek Superagent as main coordinator** | **Medium–large**: tightly coupled DSH prerelease host, Superagent's transactional Ticket/Assignment owner vs T3 Runtime, additional security boundary. ACP worker interface does not expose its Engine. | High, prototype alpha drift, separate state machine and sandbox/approval work. | Not favored; DeepSeek model/Harness remains an optional worker. | +| **D: composable small components** | Low for existing ACP workers and *behavioral* reuse; medium-high if separate workflow/memory databases are introduced. | Depends on dependency count and ownership overlap. | Adopt only independently valuable leaf integrations, not a stack of orchestration engines. | + +Cost bands are **engineering estimates based on inspected source boundaries**, not measured person-days, inference tokens, 12-month dollar costs or benchmarks. Maintenance-abandonment is legally manageable through MIT forks but operationally nonzero. + +**Would reverse preferred A if:** (1) a sandboxed Argus run using a T3-owned task/verification adapter demonstrates cheaper verified outcomes *without* a second authoritative ledger; (2) Argus or DeepSeek exposes a supported external task store/policy engine independent of native mission/ticket lifecycle; (3) T3's project continuation requires more new durable task-state infrastructure than the inspected existing receipts support; or (4) upstream lands a generic project-level continuator that our fork can simply configure. + +### Minimal next work and acceptance gate + +1. **Research gate complete** for source-level Argus feasibility and the current upstream/community overlap. No runtime comparison was performed; do not claim Argus operationally inferior. Any decision to replace the accepted T3 Project Runtime requires the user. +2. **Specification delta (manager/browser)**: keep governing Project Runtime and RTE-V1 contracts; define deterministic task-level transition \`worker terminal -> authorized review -> verified acceptance OR authorized bounded repair/human stop\`. Use a task revision and current attempt/handoff provenance. Decide whether existing T3 attempt \`request_key\` + command receipts are sufficient to prevent duplicate dispatch after crash, before adding any persistence. Model escalation occurs only on ambiguity or new product tradeoffs. Include a direct, no-manager-model fast path after an independent clean review. +3. **Reversible local synthetic spike** (existing task packet, now narrowed): isolate worktree/home; no paid model, creds, real repository side effects or auto-merge. Test worker X -> reviewer Y with passing evidence -> stop, and review failure -> bounded repair on stub Z only under prior task authorization. Include crash before/after attempt-intent commit, duplicate/reordered terminal events, stale task revisions, wrong-thread handoffs, no evidence, provider unavailable, cancellation, \`reconcile_required\`, explicit human stop. Restart must not double-dispatch. Verify source never revives a terminal attempt and a worker success claim never becomes VERIFIED. +4. **Review and integration only after evidence**: independent code/security reviewer challenges authorization, project ownership, replay, state races and accidental upstream modification. Respect Documentation V1's separate **INTEGRATED / FINAL VERIFICATION PENDING** gate and operational blocker. + +**Verdict for research task:** **SOURCE-INSPECTED / REVIEW REQUIRED for any governing spec change / RUNTIME NOT RUN / NOT INTEGRATED.** The originally proposed spike is **not** itself executed. No user approval needed to finish documentation or design the reversible stub task; a product decision is required to substitute Argus/DeepSeek as canonical project owner. + +### Structured handoff + +**BASE:** fork main and upstream/Argus/DeepSeek heads above, research branch \`planning/resource-efficient-continuation-20261103\` only; no code worktree touched. + +**RESULT:** source inspected Argus project/mission, role, stage, contract, event/replay and MCP; compared T3 upstream effect/continuation/adapter services against fork Project Runtime task execution and evidence. Completed capability ownership and overlap map. + +**VERIFICATION:** public repository code and current PR/issue status checks only. No tests, builds, provider runs or UI inspection during this research. Prior RTE final-verification packet is historical evidence for fork task execution V1, not verification of the new policy. + +**RISKS:** upstream change velocity, Argus-to-T3 dual truth, upstream large-contribution reluctance, unmerged provider wake fixes, evidence authentication, duplicate dispatch at crash boundary. + +**NEXT:** update the existing continuation spike task packet to reflect this result; finalize only the narrow task-level policy design and then run isolated stub-provider verification in T3 Code if already authorized. Do not proceed to real credentials or model spending without user approval; no merge into main until policy review and test evidence. + + +## Evidence limits + +This is browser source inspection, not an installation, runtime test, security audit, or independent review. Claims about live multi-day autonomy, speedups, cost or installed compatibility remain external authors' reports. The current user priority is to maximize verified outcomes per token and preserve project truth across providers; no production route, integration or adoption of Argus, OpenHands, DeepSeek Superagent, Cloudroom, Letta or Mastra is authorized by this note. diff --git a/docs/orchestration-v2/provider-independent-project-continuity-research-20261103.md b/docs/orchestration-v2/provider-independent-project-continuity-research-20261103.md new file mode 100644 index 0000000000000..237b4d7e2b50d --- /dev/null +++ b/docs/orchestration-v2/provider-independent-project-continuity-research-20261103.md @@ -0,0 +1,78 @@ +# Research: Provider-independent project continuity and AI development orchestration + +Date: 2026-11-03 +Status: RESEARCH / NOT A PRODUCT DECISION / NOT VERIFIED FOR T3 INTEGRATION + +## Research question + +Which public projects or research programs most closely support a non-developer managing software development across interchangeable frontier or open-weight models **without losing project truth, provenance, tasks, accepted decisions, reviews, or execution evidence** when providers/harnesses change? + +Not equivalent: *switching an LLM in a chat*, *switching an agent harness*, and *preserving canonical project state across both*. + +## Ranking method + +Qualitative research relevance to T3 Fork, not popularity or objective product quality. Consider (1) durable provider-independent project state, (2) model/harness replaceability including local models, (3) automated planning/continuation/review with evidence, (4) non-developer operator UX, (5) ease of reusing ideas without a second orchestration engine. Scores are intentionally omitted: evidence is not uniform, many projects have research claims rather than independent qualification. + +## Ranked landscape + +| Rank | Project | Distinctive, source-supported capability | Gap / caution for T3 | +| --- | --- | --- | --- | +| 1 | [Microsoft Argus](https://github.com/microsoft/ArgusAgent) | Persistent Manager → Planner → Engineer ↔ read-only Reviewer; role-specific authority, evidence admission, multiple CLI backends, human gates; [paper](https://arxiv.org/abs/2608.05144) | Most relevant architectural comparator, but author-reported autonomy performance is not independent verification; avoid replacing T3 Runtime | +| 2 | [OpenHands Agent Canvas / SDK / Hub](https://github.com/OpenHands/software-agent-sdk) | Open-source browser control surface, local/self-host/cloud runtime options, multiple model and ACP agent backends; persisted events/conversation, state restoration and model changes | Agent/conversation persistence does not on its own establish canonical accepted project decisions or task truth | +| 3 | [Cloudroom](https://github.com/davidondrej/cloudroom) | Self-hostable session history, multiple harnesses, cloud/local isolation and transfer, loops and historical workflow scan | Session portability and loop suggestions are not a verified provider-neutral project-governance ledger; hosted features/plan dependencies | +| 4 | [DeepSeek dsh-superagent prototype](https://github.com/deepseek-ai/dsh-superagent-prototype) + [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) | Event intake and tickets, scoped router/worker, GitHub-triggered work, durable event/authorization structure, extensible plugin harness | Author calls the superagent a research prototype, not production; single repo; permissive OS execution, security boundary requires redesign | +| 5 | [Letta Code](https://github.com/letta-ai/letta-code) | Durable agent identity across conversations, git-backed memory, configurable models, cloud/local/self-host deployments, recall and skills | Remembered agent context is not synonymous with verified decisions; cloud/local state location must be explicit and export tested | +| 6 | [Mastra](https://github.com/mastra-ai/mastra) | TypeScript agents/workflows with persisted checkpoints, suspension, recovery, approvals and usage aggregation | Framework rather than non-developer project manager; review restart/duplicate-resume boundaries before borrowing | +| 7 | [LangGraph](https://github.com/langchain-ai/langgraph) | Checkpointers for execution-thread recovery; stores for cross-thread data; human interrupts/resumption | Framework state alone does not define project/task authority; T3 already has analogous lifecycle storage | +| 8 | [Temporal](https://github.com/temporalio/sdk-typescript) | Deterministic durable workflows, history/replay, retries, recovery and model-call activity isolation | Excellent technical reference but heavy dependency and competing workflow engine likely inappropriate for upstream-friendly T3 | +| 9 | [goose](https://github.com/aaif-goose/goose) | Open local desktop/CLI/API agent; 15+ model providers including Ollama; MCP extensions | Strong fallback worker/harness, less direct evidence of canonical multi-agent project governance | +| 10 | [Cline](https://github.com/cline/cline) and [n8n](https://github.com/n8n-io/n8n) | Cline supplies model-neutral Plan/Act coding and rules; n8n supplies user-accessible deterministic workflow/agent automation | Valuable UX/workflow patterns, but both require a separate durable project truth and reviewed acceptance layer for T3 goal | + +## Related empirical research + +- [RoadmapBench (May 2026)](https://arxiv.org/abs/2605.15846): long-horizon, multi-file, version-level software development remains difficult; validates a need for outcome-level verification rather than call latency. +- [The Horizon Gap (Aug 2026)](https://arxiv.org/abs/2608.06663): separates long task horizon, context length, and cross-task persistence; maps memory/planning/execution/evaluation shortcomings. +- [AMA-Bench (ICML 2026)](https://proceedings.mlr.press/v306/zhao26bs.html): agent memory evaluation should track trajectories and tool/environment observations, not only chat recall. +- [Argus (Aug 2026)](https://arxiv.org/abs/2608.05144): role-specific trust/admission and externally persisted project state. + +## Research conclusions for T3 Fork + +1. **Provider failover is a project-level invariant, not a UI model-picker feature.** The user must retain accepted decisions, tasks, ownership, review state, execution history and evidence even if the active model, provider, subscription, agent or conversation becomes unusable. +2. **Open-weight fallback must be qualified**, not promised. A local model needs a compatible harness, tools, sufficient hardware/capacity and task-specific verification. Some difficult work may become slower or blocked; continuity of project data and authority should still work. +3. **Borrow principles, not an orchestration engine.** T3 already has project Runtime, handoffs, execution attempts, recovery, orchestration events/MCP and adaptive evidence. Avoid duplicating these with LangGraph/Temporal/Argus data stores. +4. **Non-developer experience is central:** present a plain-language project cockpit with goal, current milestone, trusted decisions, verification status, blockers, what the system will do next and what needs user authority. +5. **Portable export/restore should be tested offline:** project specs and sources + accepted-state ledger + task/handoff execution history + provenance and evidence refs + provider-neutral routing intent. Separate encrypted credentials, which require re-authentication on new providers. +6. **Failover qualification scenario:** start with a frontier model, persist a complex in-progress task, disable the provider, restore/reopen using a different local/open-weight model through another harness, verify that canonical project state is unchanged and execution resumes only at an authorized boundary. Include schema/version migration, machine restart, read-only independent review, and honest failure classification. +7. **Efficiency:** prioritize deterministic completion/reconciliation, no-model-call routing fast paths, structured short handoffs, selective model escalation, measured cost to verified results. + +## Immediate follow-on research priorities + +- **Argus deep technical comparison**: inspect role authority model, manager event loop, proof ledger, resumption semantics, provider adapter boundary, and nondeveloper UX. Compare with T3's existing Runtime and note what is novel. +- **OpenHands SDK/Hub capability comparison**: test portable agent/conversation restoration across model and ACP harness, preservation of external task truth, cost measurement and sandbox boundaries. +- **Cloudroom vs Letta**: examine durable session/agent memory, export/self-host and what is lost on changing providers, harnesses or host machine. +- **DeepSeek Superagent**: continue existing T3-specific analysis, distinguish paper architecture from prototype, especially event intake, scope/authorization, retries and security. +- **User-facing fallback readiness**: propose project export/restore and a provider-offline drill as a feature acceptance test; do not change production model routing merely because fallback is visible. + +## Evidence and claims + +These are source-code/documentation observations and an analytical relevance ranking. No cross-provider T3 failover run or installation of third-party tools was performed. Vendor self-reported autonomy performance and compatibility should not be treated as independently verified. Historical releases and prototype labels are not interchangeable with integration status. + +Relevant primary sources: +- https://github.com/microsoft/ArgusAgent +- https://www.microsoft.com/en-us/research/publication/argus-a-general-purpose-agentic-runtime-for-long-horizon-reasoning/ +- https://github.com/OpenHands/software-agent-sdk +- https://github.com/OpenHands/docs/blob/main/openhands/usage/agent-canvas/overview.mdx +- https://github.com/davidondrej/cloudroom +- https://www.cloudroom.dev/docs/harnesses +- https://github.com/deepseek-ai/dsh-superagent-prototype +- https://github.com/deepseek-ai/deepseek-harness +- https://github.com/letta-ai/letta-code +- https://docs.letta.com/concepts/stateful-agents +- https://github.com/mastra-ai/mastra +- https://github.com/langchain-ai/langgraph +- https://github.com/temporalio/sdk-typescript +- https://github.com/aaif-goose/goose +- https://github.com/cline/cline +- https://github.com/n8n-io/n8n + +Do not promote this research note into a governing specification without an accepted user/product decision. diff --git a/docs/orchestration-v2/resource-efficient-continuation-proposal.md b/docs/orchestration-v2/resource-efficient-continuation-proposal.md new file mode 100644 index 0000000000000..97b862bf273b5 --- /dev/null +++ b/docs/orchestration-v2/resource-efficient-continuation-proposal.md @@ -0,0 +1,91 @@ +# Resource-Efficient Automatic Continuation — design proposal + +Date: 2026-11-03 +Status: PROPOSED / NOT IMPLEMENTED / NOT ACCEPTED AS GOVERNING SPEC + +## Decision context + +The user has prioritized improving T3 Fork's self-sufficient, provider-neutral orchestration efficiency over implementing a dedicated ChatGPT-browser ↔ T3 Code bridge. Browser work remains useful when currently available and resource-efficient, but the core orchestration path must operate without ChatGPT. A future change in ChatGPT/Codex usage economics must not require redesigning project truth. + +This document proposes implementation mechanics for review; it does **not** authorize a production routing change, an automatic learned policy, or an uncontrolled agent-launch loop. + +## Goal and measure + +Minimize **total resource use per accepted, verified result**, subject to the same quality, provenance, authorization, and verification standards. Count the manager/router's own model usage, context assembly and transfer, tools, review, retries, failures, queue/capacity, human intervention, and wall time. Report unknown measurements as `UNKNOWN`; do not substitute response latency or UI progress duration for verified task cost. + +## Existing implementation to reuse + +- Project Runtime task records, append-only handoffs, project instructions, and revision guards: `apps/server/src/projectRuntime/ProjectRuntimeService.ts`. +- One active execution attempt per task, persisted launch receipts, restart reconciliation, and linked worker handoffs: `RuntimeTaskExecutionService.ts`; do not build a second execution graph. +- Project/profile/task worker route resolution: `docs/internals/runtime-routing.md`; eligibility is not authorization. +- Existing V2 orchestration events, MCP thread/delegation tools and thread lifecycle: `docs/orchestration-v2/orchestrator-mcp-server.md`. +- Adaptive evidence and capacity records: `AdaptiveRoutingService.ts`; these are evidence storage, not permission to select or launch providers automatically. +- `OrchestrationEvidenceService.ts` for reconstructing what ran rather than trusting worker claims or stale plan progress. + +Inspect the current implementation and upstream before designing any new event listener, scheduler, or policy interface. + +## Proposed continuation pipeline + +1. **Persist and reconcile:** On a terminal worker/reviewer run or a new handoff, use existing events and Runtime reconciliation to resolve the task, attempt, latest handoff, owner, and authorized next step. Do not require a model call for event detection. +2. **Deterministic gate first:** Check task revision, governing spec, mandatory acceptance evidence, execution provenance, review requirement, ownership, unresolved blockers, active attempts, and duplicate-action receipts. A terminal attempt alone does not prove task acceptance. +3. **Choose a minimal next action:** Use deterministic rules where the required next step is explicit (e.g. request missing evidence, schedule a mandated independent review, perform an already-authorized bounded recheck, or mark an unresolved blocker). Never launch a worker merely because one finished. +4. **Interpret only when needed:** If evidence is ambiguous, use a low-cost model with a compact, referenced packet. Its output is a structured recommendation plus uncertainty, not an authorization grant. +5. **Escalate selectively:** Invoke a stronger manager for disputed verification, architecture-sensitive repairs, security/integration conflicts, material scope/cost or ownership changes. Stop for user authority where required. +6. **Execute through current Runtime:** Once policy authorizes a specific action, reuse existing task execution, provider resolution, worktree safety, and idempotent command receipts. Append the routing/continuation rationale and measured outcomes to durable state. +7. **Continue:** Re-evaluate the next safe action after completion, with loop/budget limits. Avoid waking the manager just to forward an unambiguous status update. + +GitHub is a **code/evidence exchange surface**, not the authoritative task-state database. Direct ChatGPT/GitHub development is an optional execution destination only after verified automatic invocation and result-return capabilities exist. The native T3 path must not depend on it. + +## Authority and failure rules + +- Latest user instruction > accepted decisions > current milestone > governing spec for intent; inspected implementation and repeatable tests dominate worker claims for implementation truth. +- No automatic merges, destructive Git operations, credential changes, production policy changes, benchmark freeze, or unauthorized milestone transitions. +- Respect one writer per overlapping lane, independent review requirements, task base and checkout ownership. +- Use stable task/attempt/action identifiers with deduplication and compare-and-set state transitions. On restart, rehydrate unresolved decisions from existing evidence; never launch duplicate workers. +- Fail closed when the evidence, provider, worktree, ownership, review, or expected task revision is ambiguous. +- Cap automatic retry/repair rounds and resource spend per task. After the cap, set a precise blocker and escalate; do not create an unbounded model-to-model loop. +- Keep observable task/plan freshness separate from actual Runtime execution progress. A stale agent-authored todo is not evidence of stalled execution. + +## Cost-aware routing policy (initial) + +Prefer, in order: + +1. zero-model-call deterministic check/action; +2. reuse an already-running local agent/worker if safe and cheaper than a handoff; +3. cheap model assessment for bounded interpretation; +4. strong manager for consequential uncertainty; +5. optional external/browser path **only** when supported, authorized and proven to reduce total cost, including activation/context/return overhead. + +This is a proposed baseline for evaluation, **not** a learned router or permission to change production Development Profiles. Provider/model preferences should be justified by observed end-to-end outcomes and capacity rather than static reputation. Do not assume a model's nominal token price predicts completed-task cost. + +## Incremental delivery / verification + +### Phase 0 — read-only baseline + +Reconstruct representative completed/blocked task cycles from existing Runtime, review and execution evidence. Separate model, tool, wait, verification, repair, and human coordination effort where available. Identify predictable next-action transitions and cases where the system would have needed a manager judgment. Explicitly identify instrumentation gaps. + +**Acceptance:** evidence-backed transition inventory, no production changes, no speculative time savings reported as measured. + +### Phase 1 — shadow continuation evaluator + +Implement a bounded read-only evaluator at existing Runtime application-service boundaries; on terminal event/handoff, emit a proposed next-action record with reason, evidence refs, authority class, and confidence/unknowns. Do not dispatch agents or alter routing. Test replay, duplicate events, crash/restart, missing handoff, conflicting review, stale plan, and failed provider credential scenarios. + +**Acceptance:** deterministic replay gives a stable classification; no duplicate proposals for a logical transition; zero worker launches; immutable evidence remains intact; independent review passes. + +### Phase 2 — narrow authorized execution + +After explicit acceptance of Phase 1 evidence and a governing policy, enable only an allowlisted, low-risk transition (such as launching an already-required review or authorized verification task), through existing Runtime execution. Record action receipts and budget; deny ambiguous transitions and keep human/strong-manager escalation. + +**Acceptance:** real worker test, restart/reload persistence, correct active-slot/idempotency behavior, negative permission tests, and a measured comparison against manual continuation. + +### Phase 3 — evidence-driven optimization + +Compare deterministic-only, cheap-router, and strong-manager escalation strategies on equivalent tasks and verification gates. Promote a learned/adaptive recommendation only with sufficient countable evidence and a separately accepted policy. + +## Explicitly deferred + +A dedicated automatic ChatGPT-browser bridge, external cloud scheduler, parallel second orchestration engine, autonomous learned routing, cross-user data sharing, and bulk UI/production routing rewrites. Re-evaluate external ChatGPT integration only if a verified mechanism and measured net advantage justify the implementation/maintenance cost. + +## Immediate next authorized task + +Read-only Phase 0 baseline and source/API seam inspection, then a reviewed Phase 1 governing spec and acceptance tests. Do not launch a code-writing worker or change production routing until the bounded implementation task is accepted and repo/worktree ownership is confirmed. diff --git a/docs/orchestration-v2/stage-r-opus-owner-approval-clarification-20261106.md b/docs/orchestration-v2/stage-r-opus-owner-approval-clarification-20261106.md new file mode 100644 index 0000000000000..a56d0bf49bb75 --- /dev/null +++ b/docs/orchestration-v2/stage-r-opus-owner-approval-clarification-20261106.md @@ -0,0 +1,11 @@ +# Stage R — owner confirmation of Opus approval + +**Decision clarification:** On 2026-11-06 at 10:24 local time, the user explicitly stated: **"i apporved opus"** in direct response to the manager's assertion that Opus lacked approval. The user is the final authority over provider use. Treat this as **owner confirmation that the Stage R Claude Opus fallback was approved**. Do not continue to classify its past use as an unauthorized routing event. + +**Evidence boundary:** The current conversation does not establish the exact earlier timestamp or mechanism of that approval, nor any material paid API spend. Preserve the coordinator's recorded routing rationale, provider-instance/subscription, effective effort, quota and spend evidence (or UNKNOWN); do not invent when it was approved or claim cost verified from this correction. The older overnight "no Opus without approval" default was therefore **satisfied for the specific Stage R fallback as confirmed by the owner**; this clarification does not confer unrestricted approval for future Opus dispatches, paid API calls, production, major architecture changes, Git push or integration. + +**Separately still open:** The accepted overnight G-R gate requires an independent **different-provider** read-only review. The Stage R implementer was Claude Opus, and the reported reviewer was a separate Claude subscription/context, not a different provider. A different subscription alone does not satisfy the stronger cross-provider requirement. The reviewed R code and tests can retain their reported status, but **G-R FINAL PASS is HELD only for the outstanding cross-provider review and verified 18-dispatch budget/ledger accounting**. No H implementation until those checks pass. The user has not waived independent cross-provider review by confirming Opus approval. + +**Current action:** [R cross-provider review and routing audit handoff](handoff-stage-r-cross-provider-review-gate-20261106.md) remains the next safe local work; remove the old 'unauthorized Opus' accusation from active instructions. Stage R code stays isolated/unpushed. [Current State](../../01_CURRENT_STATE.md) and [manager handoff](../../OVERALL_MANAGER_HANDOFF.md) govern subsequent progress. + +**Status:** **OPUS FALLBACK OWNER-CONFIRMED / CROSS-PROVIDER G-R REVIEW HOLD / STAGE H NOT STARTED / NOT INTEGRATED**. diff --git a/docs/orchestration-v2/staged-continuation-routing-ledger-20261104.md b/docs/orchestration-v2/staged-continuation-routing-ledger-20261104.md new file mode 100644 index 0000000000000..c89e9635ec5ad --- /dev/null +++ b/docs/orchestration-v2/staged-continuation-routing-ledger-20261104.md @@ -0,0 +1,41 @@ +# Staged continuation safety — routing, attempts and verification ledger + +**Date:** 2026-11-04 (Europe/Dublin). +**Status:** PREPARED / NOT DISPATCHED. This is not evidence of a running worker. +**Source:** [Approved staged spec](continuation-staged-safety-governing-spec-20261104.md), [T3 Code task packet](task-handoff-staged-continuation-safety-20261104.md), and [overnight route evidence](https://github.com/jermur788/t3code/blob/overnight/deepseek-continuation-20261104/docs/orchestration-v2/overnight-deepseek-routing-ledger-20261104.md). +**Code base:** [Isolated gate branch](https://github.com/jermur788/t3code/tree/experiment/continuation-default-off-gate-20261104), fork main unchanged. + +## Prepared stage registry (all unstarted) +| Stage | Task | Intended coordinator/worker | Status | Resolved provider/model | Exit criterion | +| --- | --- | --- | --- | --- | --- | +| T0 | Host/repo preflight, ownership, Runtime availability | DeepSeek coordinator | READY | Unknown: not dispatched | Branch, status, worker/wake verification | +| T1 | Default-off gate, negative tests and local qualification | Single capable code writer, coordinator routes | WAITING | Unknown | Off/on/restart tests + typecheck/check:changed | +| T2 | Independent security review and repair | Different provider/model reviewer | WAITING | Unknown | Reviewer findings fixed/re-reviewed | +| T3 | Upstream trial reconciliation on current bases | DeepSeek recon, owned disposable merge worktree | WAITING | Unknown | Matrix, tests on actual trial tree, budget remeasure | +| T4 | Strict revocation design and shipping exclusion memo only | Read-only architect, reviewed if material | WAITING | Unknown | Options, modelled races, no engine changes | +| T5 | Final evidence, security gate, handoff | Coordinator + independent reviewer | WAITING | Unknown | Durable evidence and precise NOT INTEGRATED | + +## Routing/worker event schema — append for each actual decision + +Record a first **decision** entry before dispatch; second **resolved** entry when host returns the model; third **outcome** when evidence is inspected; include rejected candidates/fallbacks and repairs. Do not turn planned names into reported executed route. + +- UTC timestamp; task stage/ID, subagent/thread/attempt ID if host returns it; parent/owner/worktree/repo base. +- Desired model/provider/driver/effort and **actual resolved** provider instance/model/driver/route source/isolation; available alternatives, rejected ones and reasons; cost/quota only when measured. +- Scope/acceptance, risk class, expected independent review, approximate relative resource strategy without invented estimates. +- Dispatch/start/wake/progress/finish event and source, last true liveness, code lane ownership, status and next action. +- Error/hypothesis, first/second distinct attempts and evidence, escalation rationale and actual stronger route (max four total meaningful repair attempts; no unsafe reattempt). +- Verification commands/logs/exit codes; branch changes; reviewer and acceptance; handoff reference; approval gating. +- Reconcile with Project Runtime receipts when available; if not exposed, mark this document the fallback state and persist append-only events. + +## Event 0000 — Manager planning (NOT a dispatched worker) + +- **Authority:** user fully approved stage direction in chat 2026-11-04 01:09 Europe/Dublin. +- **Planned coordinator:** DeepSeek; no T3 live host/worker available in browser manager. Actual model instance/availability/cost UNKNOWN. +- **Planned route:** DeepSeek for routine reconnaissance and bounded first attempts; Codex/Claude-class for gate concurrency/authorization-sensitive debugging and independent reviewer, based on actual available models. No paid external model run authorized. +- **Browser-executed tasks:** inspected live GitHub source and upstream delta; wrote governing spec/task; created isolated gate branch. No TypeScript/tests run, no production writes/merges. +- **State:** T0 READY. Actual dispatch **NOT STARTED**. Next T3 Code operator starts coordinator and records its real route and worktree. +- **Approvals pending:** none for isolated default-off implementation/research. Actual merge/public release and material upstream engine architecture remain separately gated. + +## Final reconciliation requirements + +Before terminal PASS, verify every task's actual route, logs and independent review, preserve all worktrees, and label `NOT INTEGRATED` until separately authorized merge. Do not claim O0–O6 past records are current live worker statuses; keep this task's own events. diff --git a/docs/orchestration-v2/task-d4-full-server-assembly-verification-20261105.md b/docs/orchestration-v2/task-d4-full-server-assembly-verification-20261105.md new file mode 100644 index 0000000000000..5514e92ae8ee3 --- /dev/null +++ b/docs/orchestration-v2/task-d4-full-server-assembly-verification-20261105.md @@ -0,0 +1,40 @@ +# D4 — bounded full-server assembly, natural release and real revocation closure + +**State:** **COMPLETED / K1 FULL-SERVER ASSEMBLY RUNTIME PASS / K2 NATURAL ASYNC RELEASE RUNTIME PASS (worker-reported, independently re-run) / K3 PARTIAL / REVIEW PASS WITH FINDINGS / NOT INTEGRATED**. This original packet is historical; **DO NOT REDISPATCH**. [Authoritative manager return](manager-d4-full-root-k1-k2-verification-reconciliation-20261105.md). +**Nature:** continuation of already-authorized isolated D4 implementation verification, **not** new architecture/product scope. +**Binding specs:** [accepted D4 A+B](d4-accepted-revocation-contract-20261105.md), [staged safety](continuation-staged-safety-governing-spec-20261104.md), [original isolated implementation packet](task-stage2-d4-isolated-implementation-20261105.md), [manager return reconciliation](manager-d4-isolated-implementation-return-review-20261105.md). +**Scope:** full-root verification and minimal tests/bug fixes on **existing isolated local D4 branch only**. No upstream catch-up/re-land/main merge/public PR/release/provider spend. + +## TASK / ROUTING + +**DeepSeek V4.1 Flash — coordinator only.** Read Project Instructions → Current State → Coordination/Handoff Protocol → accepted A+B → this packet → latest Runtime task/handoff. Assign all source inspection, test authoring, shell execution and repairs to **Codex GPT-6.1 SOL Medium or Claude Sonnet 5.5 Medium**. A **different provider/model** performs independent read-only review of material changed source/tests and actual evidence, with actual effort/allowance/reset logged (or `UNKNOWN`). No unapproved paid providers or Opus escalation. One writer; no concurrent modifications to owned D4 code lane. + +**Preflight:** existing local isolated branch `d4/ab-revocation-guard-20261105` at worker-reported `b83fd79b94b7ed776ddb88f0b6edd949b1ef90cd`, base isolated experiment `b3b8da54e0b8b184a1cf4e667d53e73e04f85074`. Fork `main` was `fb67545d790c5c001e8f85827f219ab6493c435e`. **Verify exact host repo, branch/worktree, status, base, 3 existing local commits, ownership, free space and uncommitted changes before any write**; inspect actual `server.ts`, `nodeSqliteClient.ts`, `EventSink`, `ContinuationCommitGuard`, `RuntimeTaskExecutionService`, `ThreadLaunchService`, `prepared-run.release`, `EffectWorker` and test harness. Preserve primary checkout, 4 detached Stage 2 worktrees, restricted ledgers, read-only Files volume and unrelated work. No reset/stash/clean/rebase/force/unmount/delete. + +## Bounded objective and required evidence + +**Check 1 — actual combined server dependency assembly (mandatory).** Build a no-cost executable test/harness using the **real server's composed service layers** (`server.ts` or its actual production root composer, not merely independently instantiated services) and isolated temporary `dbPath`. Verify that operator source-task revocation (`updateTask(continuation:null)` with real user actor), Runtime execution authorization, `Orchestrator`, `EventSink.commitCommand` and effect/outbox use correct **same SQLite database/transaction ordering and memoized server continuation gate**. Use two actual SQL connections/processes for deterministic ordering where available. Explicitly record the file/inode/connection observations without exposing user filesystem secrets. Revoke-first must return **zero new `run.created` events, zero new start effects, zero accepted-success receipts** and typed denial; launch-first yields one run and idempotent replay. Show test assertions/command exit logs, not solely code-review inference. If test harness cannot instantiate true production root without real provider credentials, **OPERATIONAL BLOCKER**, report exact cause and a faithful supported stub injection proposal; don't counterfeit an assembly PASS. + +**Check 2 — natural async preparation denial (mandatory where feasible).** Run the *actual* `ThreadLaunchService.schedulePreparation` path with a deterministic barrier before `prepared-run.release`; revoke operator policy through actual Runtime task update after the run exists and before release; exercise the asynchronous release callback, the failed preparation tracker, typed caller/compensation boundary, terminal projection, cancelled Runtime attempt and no start effect. Show that `Effect.ignoreCause` does not falsely report success, orphan the worktree or mask a reconcile-required case. If no direct caller receives the typed denial because of fork/background execution, assert accurate externally observable durable state instead of promising synchronous exception propagation. + +**Check 3 — narrow gaps and safety (run alongside):** real `continuation:null` release/retry vs missing-source-row stand-in; `prepared-run.fail` idempotent no-op on terminal cancelled; replay/restart remains denied; never downgrade `reconcile_required`; hidden durable `continuationAuthorization` not exposed by any public read/list/RPC/agent MCP/wire/telemetry path, and not forged from caller-controlled data. Confirm default-off and ordinary user/non-continuation behavior unaffected. Provider external-start atomicity is explicitly **out of contract**. + +**Check 4 — verification/review:** execute new targeted tests, changed-file check, server typecheck and relevant integration tests; include two provider stubs if practical, without live API spend. Re-run any test touched by repairs. A different-model/provider **read-only** reviewer should inspect actual changed diff and raw test output. Repair routine bounded test/implementation defects within the accepted A+B contract, then re-review as needed; do not weaken tests to pass. Record exact command exits, test counts and retained local evidence in Runtime or a restricted local ledger. Do not rely on the earlier 153-test count as proof of this new assembly check. + +## Accepted outcomes + +- `FULL-SERVER ASSEMBLY RUNTIME PASS (worker-reported) / REVIEW PASS` **only when exact real production-root assembly has executed** the operator-revoke vs run-creation transaction and the scheduled-release test path, with independently reviewed evidence. +- `STATIC PASS / PARTIAL RUNTIME PASS / OPERATIONAL BLOCKER` if a faithful full root cannot run; record exact missing provider/auth/fixture, no invented PASS and no source integration. +- `IMPLEMENTATION DEFECT` if actual root exposes a race or cancellation logic fails; bounded repair/re-review permitted while within spec. `REVIEW REQUIRED / PRODUCT DECISION` for a new authority table, engine redesign, new source integration, security bypass, paid external provider or stronger external-start guarantee. + +## STOP / RETURN + +**No merge, push, PR, upstream catch-up, experimental re-land, public release, production enablement, public evidence publication, paid provider call, new authority/epoch table, destructive cleanup or unmount.** The user approved isolated D4 development and its existing verification, not re-landing 336-behind experimental code onto main. Preserve all private PR #21 evidence. + +Return a complete authoritative handoff: **VERDICT / EXACT BASE WORKTREE + OWNERSHIP / FULL ROOT LAYER WIRING AND SHARED DB EVIDENCE / OPERATOR `continuation:null` ORDERING / NATURAL `schedulePreparation` RELEASE PATH / ZERO-RUN/EFFECT/RECEIPT ASSERTIONS / TYPED DENIAL + RECOVERY / PUBLIC AUTH PROVENANCE / TEST COMMANDS + COUNTS/EXIT / REVIEW + REPAIRS / ROUTING EFFORT/QUOTA / UNVERIFIED ITEMS / INTEGRATION STATE / NEXT**. + +If no local bridge is connected, the browser manager cannot launch these tasks automatically. This packet is a **durable local handoff, NOT DISPATCHED** until explicitly started by an active T3 Code session. + +## Returned 2026-11-05 21:43Z — outcome supersedes task instructions + +**K1 PASS:** worker and independent different-provider reviewer ran real exported `layerMakeServer` production-root with temporary homes, shared SQLite `SqlClient` / `BEGIN IMMEDIATE` identity confirmed. Real operator `continuation:null` revocation precedes run launch → **0 new runs / 0 start effects / no accepted receipt / typed denial / 0 adapter session opens**. Launch-first gave one run and stable replay; ordinary user runs unaffected. **K2 PASS:** real asynchronous `schedulePreparation` held until revocation, then release/retry denied, terminal cancelled projections, zero start effects, no accepted release receipt and a failed tracker; late `prepared-run.fail` idempotent; `reconcile_required` preserved after an actual defect was repaired. **K3 PARTIAL:** real crash/restart/pruning, portable provider stub/paired model and shipping D2 unavailable. Review **PASS WITH FINDINGS**; reviewer reran full-root 5/5 plus focused 94/94 tests; other worker claims and quotas in [manager reconciliation](manager-d4-full-root-k1-k2-verification-reconciliation-20261105.md). No code pushed/merged; isolated local branch only. Browser manager cannot inspect private branch source or raw logs. No additional local task or production action authorized by this completed packet. diff --git a/docs/orchestration-v2/task-evidence-v0-pruning-completeness-p2-20261104.md b/docs/orchestration-v2/task-evidence-v0-pruning-completeness-p2-20261104.md new file mode 100644 index 0000000000000..f1f9dc0183acb --- /dev/null +++ b/docs/orchestration-v2/task-evidence-v0-pruning-completeness-p2-20261104.md @@ -0,0 +1,69 @@ +# T3 Fork — Evidence V0 pruning-completeness P2 repair + +**Issued:** 2026-11-04 by Overall Manager after independent pre-merge verification handoff. +**Classification:** GOVERNING BOUNDED REPAIR TASK / PR #21 MERGE GATE. +**Status:** TASK PREPARED — worker NOT dispatched by writing this document. +**Parent gate:** [Pre-main verification V1–V5](task-verify-reconciled-v017-before-main-20261104.md). +**Candidate base:** fork-only [draft PR #21](https://github.com/jermur788/t3code/pull/21), accepted reconciliation head `70203ed5a95dbe1762da1ad2a46c4f153f910492`. +**Authority:** corrective implementation/tests only on a separately owned worktree/branch; **no PR #21 head update or fork-main merge without manager review and explicit applicable authority**. + +## Decision and problem + +V1 rendered UI, V2 file-backed reopen/cross-project, V3 actual-pruning fixture, and V4 local gates were reported PASS by the 2026-11-04 verification worker. Independent Codex read-only review reported **CLEAN WITH FINDINGS**. The V3 fixture reproduced a P2 evidence-integrity limitation: + +- `before: 3`, `remaining: 2`, `after: 2`, `deleted: 1`, `unresolved: 2`. +- A wholly absent referenced V2 history is represented by explicit `orchestration-v2-unresolved` events. +- Partially pruned history with retained V2 events can be exported without any incomplete/pruning marker, misleading callers about completeness. + +The worker's screenshots, logs, and fixture are currently at local paths `/tmp/opencode/evidence/`, `/tmp/opencode/evidence/test-packet/`, and `/tmp/opencode/v017-verification-ledger-20261104.md` on its host. Their bytes have **not** been independently retrieved or durably published by the browser manager. Preserve/export sanitized evidence to the task ledger or GitHub review branch before claiming independent verification. + +Manager source inspection agrees with the mechanism: `apps/server/src/projectRuntime/OrchestrationEvidenceService.ts` checks its 1,000-event per-thread bound but does not consult the upstream pruning boundary. `apps/server/src/persistence/OrchestrationEventStore.ts` publishes `prunedThroughSequence`, and `apps/server/src/orchestration-v2/ProjectionMaintenance.ts` advances this boundary before event removal. Existing Evidence V0 contracts allow incomplete observations but currently distinguish read-limit truncation from unresolved references; neither unambiguously describes earlier pruned history. + +**Manager quality decision:** do **not** recommend PR #21 for fork-main merge while this known evidence-integrity limitation remains uncorrected. This is a technical acceptance recommendation, not an unauthorized merge, release or new global product policy. The user retains final authority to accept the limitation and approve a merge notwithstanding this recommendation. + +## TASK + +Implement a minimal, upstream-friendly, deterministic **read-only completeness indicator** for Evidence V0 exports/reconstruction when referenced V2 history may have been pruned. Prove the result using real isolated SQLite pruning/restart fixtures. Keep PR #21 and its accepted candidate checkpoint unchanged until manager re-review. + +## ROUTING + +- Work class: **LOCAL/CODE REQUIRED** for tests and application changes; browser source/packet review performed by ChatGPT GPT-6 Overall Manager. +- **Mandatory DeepSeek orchestrator for the entire local lifecycle**. Hand this task to a real running DeepSeek T3 Code orchestration session using the [complete copy/paste handoff](handoff-deepseek-orchestrator-evidence-v0-p2-20261104.md); no published note automatically dispatches a worker. +- DeepSeek may execute/delegate routine implementation and tests to **DeepSeek/OpenCode**. Capture actual provider/model, alternatives, reason, capacity (UNKNOWN if unmeasured), resource observations, attempts and outcomes in Project Runtime or an append-only lane ledger. Update the ledger **during execution**. +- If stronger analysis is justified, DeepSeek assigns a bounded task to **Codex GPT-6.1 SOL** (high as justified) or **Claude Sonnet 5.5** (medium); if these fail on a genuinely hard issue, **Claude Opus 5.5** (low/medium initially). Keep **DeepSeek as orchestrator** throughout; do not silently replace it. Reviewer must be different provider/model from implementer and read-only. +- Escalate hard concurrency/security/integration issues directly; ordinary failing tests get up to two materially distinct evidence-backed low-cost repair attempts first, max four bounded solution attempts unless separately authorized. One writer for Evidence V0 contract/service/test surfaces; reviewer does not edit. Never consume real/paid app-under-test providers. + +## BASE / PREFLIGHT / OWNERSHIP + +1. Freshly fetch fork `main`, PR #21 candidate and upstream release-prep parent. Confirm candidate still matches the accepted head, status, unrelated worktrees, active writers and sufficient disk space. The actual upstream parent is **25 commits after tag `v0.1.7`**, not the tag itself; it remains one commit behind latest upstream main at manager's 2026-11-04 inspection. +2. Use a **fresh, uniquely owned external-volume worktree** on the dedicated repair branch; do not rewrite or modify existing verification/reconciliation/experiment worktrees. No stash/reset/force-push/cleanup. +3. Own only these plausible files: `apps/server/src/projectRuntime/OrchestrationEvidenceService.ts`, its existing test file, and (if additive schema is strictly required) `packages/contracts/src/orchestrationEvidence.ts` with focused schema tests. No edits to upstream V2 event pruning, threading, provider-start, migrations, or storage schema. + +## GOVERNING ACCEPTANCE BEHAVIOR + +1. If the referenced thread's available history may have lost pre-boundary V2 events due to the published pruning watermark, Evidence V0 must **not assert complete history**. Emit a deterministic, machine-readable incomplete/pruned marker with authority `orchestration-v2`, `recordBasis: derived-view`, stable ID, scope and explicit `completeness: unknown` or equivalent. +2. Distinguish **known missing individual references** (existing unresolved marker), **bounded read** (existing per-thread truncation), and **possible history loss from pruning**. Do not change meaning of the existing read-limit truncation event to mean pruning. A strictly additive evidence record type may be needed; keep it minimal and version-compatible with the existing V0 envelope. Avoid unreviewed breaking schema changes. +3. Use the **existing persisted pruning boundary** from upstream; do not create a duplicate event log, history index, migration or provider polling subsystem. A global watermark is not per-thread proof of missing data: characterize cases conservatively as incomplete/unknown rather than falsely claiming exact deleted counts. Do not mark newly created threads after the watermark as incomplete solely because unrelated history was pruned. +4. Fresh/no-prune histories retain identical meaningful export data and deterministic ordering. Repeated exports preserve stable event identities, facts and references (except documented export timestamps). +5. Under actual partial pruning, export and reconstruct both expose incomplete/pruning provenance; fully absent referenced histories continue to be unresolved. Cross-project isolation and bounded reads remain intact. No fabricated V2 events or known-complete claim. +6. If accurate scoped detection requires a new material contract, changes a documented guarantee, or cannot be achieved using existing source metadata, **stop with tests and options** for manager/user architecture decision rather than silently rewriting V2 internals. + +## VERIFICATION + +- Add a focused **red-before/green-after** regression in the existing Evidence V0 test suite using a real file-backed SQLite fixture or correctly initialized in-memory projection-maintenance layer. Demonstrate the published pruning boundary and at least one actual deleted event; avoid only mocking the watermark. +- Cover (a) fresh full history, (b) partially pruned referenced history with retained V2 event(s), (c) fully unavailable referenced thread/run, (d) unrelated project/thread whose complete history begins after the watermark, (e) per-thread read bound, (f) deterministic JSONL/contract decode, and (g) restart/reopen plus project isolation where practical. +- Run affected `OrchestrationEvidenceService.test.ts`, contract/schema tests and `ProjectionMaintenance.test.ts` (or equivalent), then `vp run typecheck`, `vp run check:changed upstream/main`, `AgentContextBudget.test.ts` and web build if contract/schema changes could affect app-facing material. Report exact commands, exits, counts and measured tool-list snapshot; no invented CI or provider metrics. +- Request a distinct read-only reviewer; review failure semantics, watermark races, long V2 ID bounds, additive contract validity, and no change to upstream source of truth. +- Manager inspects exact final diff/test receipts. PR #21 can be marked repair-accepted **only after** reproducible passing local evidence and independent review, followed by a decision about promoting the fix to the PR branch. PR #21 is not merged by this task. + +## OUT OF SCOPE / STOP CONDITIONS + +No synthetic continuation gate or D2/D4 release change; no strict run-start redesign, migrations, upstream public contribution, paid model evaluation, direct fork-main update, PR creation/merge, branch history rewrite, tests weakened to pass, or copy of unsanitized private data into GitHub. + +Stop for new authorization on a material API semantics or architecture tradeoff, unexpected overlapping ownership, security conflict or irreversible action. An observed P2 fix is not authorization to ship. + +## REQUIRED HANDOFF + +Return **VERDICT; BASE/CHECKPOINT and clean worktree; RESULT and exact owned files; TESTS/exits including red→green; PRUNING REPRO evidence; REVIEW provider/model/verdict; FAILURES/risks; INTEGRATION STATE; NEXT and user-decision gate**. Persist in Runtime where available, otherwise add a durable task-lane ledger and return it to the manager. Mark unrun checks **NOT RUN**, never PASS. + +Final desired state is **P2 REPAIR REVIEW PASS / READY FOR MANAGER PROMOTION DECISION**, not `INTEGRATED` or `PRODUCTION VERIFIED`. diff --git a/docs/orchestration-v2/task-fork-upstream-reconciliation-20261104.md b/docs/orchestration-v2/task-fork-upstream-reconciliation-20261104.md new file mode 100644 index 0000000000000..7fddebd92bd27 --- /dev/null +++ b/docs/orchestration-v2/task-fork-upstream-reconciliation-20261104.md @@ -0,0 +1,92 @@ +# T3 Code handoff — fork main ↔ upstream T3 reconciliation (isolated) + +**Issued:** 2026-11-04. **Authorization:** Overall Manager, under already-approved staged safety/continuation direction. This authorizes only a **separate bounded compatibility and conflict-resolution trial** in an isolated branch and local worktree. It is NOT a merge into main, production integration, or a new upstream PR. + +**TASK:** Reconcile preexisting fork/upstream divergence for the eight known conflicts, verify resulting **trial** tree, and return a durable evidence-based recommendation. Continuation gate stays isolated; no new shipping decision required for this task. + +**ROUTING:** DeepSeek/OpenCode coordinator for low-cost source archaeology, test triage, and routine conflict resolutions; Codex/Claude-class code solver for any security-sensitive Orchestrator/MCP, routing/capacity or concurrency semantics; separate independent reviewer from the last writer. In T3 host, log proposed and actual provider/model/instance, route origin/eligibility, alternatives rejected, reason, attempt number, completion events and outcomes. Never infer unavailable quota/cost. User-requested two evidence-distinct attempts per ordinary technical blocker before escalating; up to two further attempts with stronger model (max four total). Immediate stop for architecture/security/permission boundaries. + +**GOVERNING SPEC:** [Accepted staged continuation safety](continuation-staged-safety-governing-spec-20261104.md), [independent manager gate review](manager-gate-branch-review-20261104.md), [coordination protocol](https://github.com/jermur788/t3code/blob/planning/resource-efficient-continuation-20261103/docs/orchestration-v2/task-handoff-staged-continuation-safety-20261104.md) and project instructions. **Current source evidence:** [gate-branch trial and eight conflicts](https://github.com/jermur788/t3code/blob/experiment/continuation-default-off-gate-20261104/docs/orchestration-v2/staged-continuation-t3-upstream-trial-20261104.md). + +**REPOSITORY:** `jermur788/t3code`; remotes `origin` (fork), `upstream` (`pingdotgg/t3code`). +**PREPARED REMOTE BRANCH:** `integration/fork-upstream-reconciliation-trial-20261104` — created by browser manager from **fork main**, not from the continuation-gate branch. Confirm its exact remote base before write. **NO writes to fork main or upstream.** + +**Known previous trial:** eight conflicts at an older upstream base. Latest browser reconnaissance showed upstream advancing further, with at least 10 more commits beyond the T3 worker's trial source, including Orchestrator, ThreadManagement and adapter/runtime-layer tests. Do **not** assume eight remains exact; fetch latest at execution. + +## Stage R0 — preflight, security and operational readiness + +1. Inspect actual repo path/remotes/branches, all worktrees (`git worktree list --porcelain`), dirty/untracked files, active workers and one-writer ownership. Do not overwrite or repurpose the existing gate worktree or detached trial worktree. Preserve other users' changes. +2. **Root filesystem was reported 100% full (~231 MB remaining) during prior T3 run.** Run `df -h` and check space on `/media/jer/Files`. Create a **new isolated reconciliation worktree on that external volume** if safe. Keep disposable local temp/cache/dependency installations on sufficient space if supported; do not modify global package caches destructively or clean any old worktrees without explicit authorization. If not enough capacity, classify `OPERATIONAL BLOCKER` and continue read-only source analysis. +3. Fetch fork main, prepared remote trial branch and upstream main. Record exact bases, branch ownership and status in the **branch-local routing ledger**. If worktree/branch ownership conflicts, pause before any write. Verify actual child completion channel before assuming monitoring. +4. Route independent review early for conflict-sensitive design; avoid starting a second overlapping writer. + +**Acceptance R0:** confirmed clean/safely owned worktree, sufficient disk resource for chosen commands, prepared worker roster and actual model routing records. Otherwise precise blocker. + +## Stage R1 — reproduce and classify the conflicts on fresh upstream + +Using the exclusively owned trial branch/worktree, attempt a **non-fast-forward trial merge** of freshly fetched upstream into the fork-derived branch, without touching fork main or upstream remote. Preserve the unmerged conflict state only inside this worktree until each hunk is classified. + +Known historical eight files: +1. `apps/server/src/mcp/OrchestratorMcpService.ts` — **security/authority-sensitive**, review RPC/tool exposure and provider-neutral semantics. +2. `apps/server/src/mcp/linkOrigin.test.ts` — preserve fork Project Runtime DI/coverage and upstream test fixtures. +3. `apps/server/src/orchestration-v2/Adapters/GrokAdapterV2.test.ts` — provider adapter fixture compatibility. +4. `apps/server/src/orchestration-v2/Adapters/OpenCode2AdapterV2.test.ts` — provider adapter behavior and fixture changes. +5. `apps/server/src/orchestration-v2/runtimeLayer.test.ts` — upstream V2 runtime-layer behavior and fork service graph. +6. `apps/server/src/peer/PeerForwarding.test.ts` — preserve fork DI and upstream peer tests. +7. `apps/web/src/routeTree.gen.ts` — generated; reconcile authoritative route sources and regenerate, **do not hand-edit generated code** as final solution. +8. `packages/shared/src/usageLimits.ts` — **resource/routing-sensitive**, preserve fork capacity evidence and updated upstream semantics, do not resolve by wholesale selecting one side without tests. + +For each hunk, record: upstream behavior, fork behavior, selected intended merged behavior, spec authority, actual source lines, test affected, and a risk classification. **If a conflict materially changes provider/permission/security or quota semantics and no unambiguous source-preserving resolution exists, stop that code change and request architecture review.** Do not guess a side to make the merge green. + +**Acceptance R1:** source-backed conflict matrix using **current** upstream, including any new conflicts, no invented resolution claims. + +## Stage R2 — bounded conflict resolutions on the owned trial branch + +- One writer for overlapping files; route security-sensitive `OrchestratorMcpService` and `usageLimits` to a capable Codex/Claude-class worker where justified, with DeepSeek coordinating. +- Prefer upstream behavior plus isolated fork-owned extension where both can be preserved. Keep provider-neutral Runtime and existing fork abstractions. Avoid rewriting upstream event/driver/session internals. +- Fix fixture integration without weakening tests. For generated route tree, use the actual generator to resolve from canonical sources; inspect unexpected route changes. +- No new database/migration, new provider policies, or acceptance contract. If these prove necessary, classify `PRODUCT DECISION` or `UPSTREAM COMPATIBILITY` and preserve evidence. +- Maintain each conflict's attempts in the ledger: at least two materially different evidence-backed approaches for *routine failures* before escalation; do not retry destructive/unsafe actions. +- A successfully resolved trial may be committed **only to this isolated owned reconciliation branch** after tests, independent review, secrets check and ownership confirmation. Do not push upstream, create a new PR or merge into fork main. + +**Acceptance R2:** no conflict markers; exact intended semantics documented; reviewers can inspect the diff. If blocked, keep branch and do not misreport merged-tree PASS. + +## Stage R3 — verification on the actual reconciled trial tree + +When code is syntactically coherent: +- Run relevant targeted test suites for all eight conflict files, especially V2 orchestration adapters/runtime/peer/MCP, `usageLimits` tests, and web route generation/build smoke. Record exact commands/exits. +- Run `vp run typecheck`, `vp run check:changed` (or clearly explain if worktree baseline or resource limits prevent it), `vp test run apps/server/src/provider/AgentContextBudget.test.ts`, and relevant provider routing/Project Runtime tests. Do not change budget snapshot simply to greenwash an increase. +- Re-measure agent-facing MCP tool list on the **reconciled actual code**, not the old clean upstream or gate branch snapshot. Record changed packages, source and test environment. +- Confirm existing fork Runtime and core upstream behavior were not silently dropped. Cross-project isolation and restart behavior get actual evidence where touched. +- For any user-facing route/visual behavior changed during conflict resolution, render/inspect UI or mark **UI VERIFICATION REQUIRED**. A code-only route generator pass is not equivalent to visually verified UI. + +**Acceptance R3:** reproducible relevant static/runtime test results on isolated trial with no unexpected changes. If an upstream breaking change prevents tests, classify and attempt routine repair as authorized; stop for new architecture. + +## Stage R4 — independent review, disposition, handoff + +Have a different provider/model review the final conflict resolution and test evidence. Pay particular attention to `OrchestratorMcpService`, capacity/routing policy, provider-specific test semantics, migrations, generated route tree and any newly introduced upstream changes. Review must not be performed solely by the code writer; record routing/effort, why chosen, findings and delta re-review. + +Return a **durable T3 handoff** with: +- VERDICT per stage and conflict file; +- BASE/CHECKPOINT (latest upstream/fork and isolated worktree/branch/clean status); +- RESULT (diff, tests, any unmerged/blocked areas); +- VERIFICATION (exact commands, exit codes, logs; executed vs not); +- FAILURES/RISKS with precise blocker classifications; +- REVIEW (independent provider/model and findings); +- ROUTING LEDGER (all choices, rejections, attempts, actual completion/liveness); +- INTEGRATION STATE (**NOT INTEGRATED into main**); NEXT exact safe task. + +No stronger completion status than evidence. Push to **owned isolated trial branch** via ordinary fast-forward only after acceptance. Preserve existing worktrees; no resets, force-pushes or unrelated cleanup. + +## Separate work not in scope + +- The default-off continuation gate remains on `experiment/continuation-default-off-gate-20261104` and must not be silently applied in this fork/upstream sync trial. +- D4 strict no-new-continuation-run-after-revocation is an accepted *release requirement* but the linearization authority/engine hook is **not yet a coding decision**. Read-only research may continue separately. +- D2 shipping exclusion and agent-facing budget removal is approved as a release gate, but no public shipping branch or build exclusion is implemented by this task. +- No production release, public PR, real-provider paid evaluation, main merge, upstream push or destructive cleanup. + +## Stop conditions + +Material permission/routing/usage-limit semantics collision; a new authoritative state owner; upstream Orchestrator/EffectWorker core changes beyond compatibility; irreversible DB operations; security-sensitive ambiguity; insufficient local disk capacity; conflicting ownership; unapproved provider cost; surprise live-provider invocation. Stop the affected write lane and return source-backed options; continue only independently safe research. + +**FIRST EXACT LOCAL ACTION:** Fetch and verify latest `origin/main`, `origin/integration/fork-upstream-reconciliation-trial-20261104`, and `upstream/main`; inspect the local worktree list and `df -h`. Pick a new safe external-volume worktree, record resolved coordinator route, then reproduce current conflicts without main edits. No further user question is needed for this isolated trial. diff --git a/docs/orchestration-v2/task-handoff-staged-continuation-safety-20261104.md b/docs/orchestration-v2/task-handoff-staged-continuation-safety-20261104.md new file mode 100644 index 0000000000000..e5e72ae7c6879 --- /dev/null +++ b/docs/orchestration-v2/task-handoff-staged-continuation-safety-20261104.md @@ -0,0 +1,79 @@ +# T3 Code handoff — staged continuation safety and upstream reconciliation + +**Issued:** 2026-11-04 (Europe/Dublin) +**Owner:** DeepSeek/OpenCode as orchestration coordinator; single code writer for the gate; separate independent reviewer. Use Codex/Claude-class when security-sensitive gate and concurrency reasoning justifies it. Record actual routed provider/model, eligibility, reasons, alternatives, retries and outcomes. +**Repository:** `jermur788/t3code`. +**Governing spec:** [Accepted continuation staged safety spec](continuation-staged-safety-governing-spec-20261104.md). +**Routing ledger seed:** [Staged gate/reconciliation routing and attempt ledger](staged-continuation-routing-ledger-20261104.md). Treat every proposed provider/model as NOT DISPATCHED until live T3 resolves it. +**Evidence:** [Reviewed overnight checkpoint](https://github.com/jermur788/t3code/blob/overnight/deepseek-continuation-20261104/docs/orchestration-v2/overnight-morning-handoff-20261104.md), [overnight routing ledger](https://github.com/jermur788/t3code/blob/overnight/deepseek-continuation-20261104/docs/orchestration-v2/overnight-deepseek-routing-ledger-20261104.md), [F4 options](https://github.com/jermur788/t3code/blob/overnight/deepseek-continuation-20261104/docs/orchestration-v2/overnight-f4-gate-decision-memo-20261104.md). + +## USER DECISION — already accepted, do not request again + +1. Implement a **default-off server-side switch now** so the synthetic continuation is safe to keep **isolated for experimentation**. +2. **Exclude experimental continuation and agent-facing tool-schema overhead before any public shipping release.** The known +646 bytes is provisionally tolerated in the *unmerged experiment only*, not approved as a public-release increase. +3. Current **best-effort** last-check + cancellation/reconciliation is allowed **only** for isolated stub-provider experiments. Production requires strict no-new-run-after-committed-revocation behavior. Strict design may need upstream execution-engine changes and must be specified/reviewed separately. No such change is authorized by this handoff. +4. No merge to fork main, no production enablement, no new draft PR, no upstream comment/push and no real or paid providers without separate authority. + +## BASE / OWNERSHIP + +- Start at existing remotely created, **untouched** branch: `experiment/continuation-default-off-gate-20261104`. It was created by the browser manager from the published and independently reviewed `overnight/deepseek-continuation-20261104` head. Confirm live remote history before writing. +- User's earlier overnight worktree `/home/jer/dev/t3code-overnight-deepseek-20261104` and older security/qualification worktrees must stay intact. Create a **fresh isolated gate worktree**. Inspect `git status`, all worktree owners, branch and remotes, unrelated changes, collaborators and active writers first. +- One writer for `apps/server/src/projectRuntime`, contract-adjacent code and tests. The separate upstream-recon lane is read-only or uses an independently isolated disposable worktree; no parallel overlapping writes. +- Fork main is NOT the implementation base and remains untouched. Current upstream main **changes rapidly**: at manager reconnaissance 2026-11-04 01:10 UTC it had advanced another 14 commits beyond the overnight trial base, principally mobile/UI plus Claude provider changes. Refetch before trial; do not assume the overnight eight-conflict list is final. + +## SERIAL TASK QUEUE + +### T0 — Confirm runtime and routing authority + +DeepSeek coordinator inspects available providers/models, exact code base, project/source state, tests and host capabilities. Prove real worker completion channel before relying on unattended continuation. Maintain routing-choice ledger with proposed and actually resolved provider/model/driver, origin, reasons, rejected candidates, cost/quota only if observed, attempt count, completion event, result and next action. If Project Runtime task store is not exposed, use a new append-only branch-local ledger and return durable handoff. Record any background-monitor limitation. No invented liveness. + +### T1 — Implement default-off gate, test-first + +**Goal:** a shared server-controlled continuation capability, default false, that cannot be enabled from task/MCP/agent data. Prefer existing server config/DI conventions with deterministic test injection instead of a mutable global process flag across concurrent test suites. No new database, queue, migration or orchestration engine. + +Required behavior and negative tests, with failures recorded **before** minimal repair: + +- `ProjectRuntimeService.createTask`: when off, reject a **non-null** `continuation` policy even for `user:` actor; ordinary task creation still succeeds. Preserve existing agent actor self-grant denial when on. +- `ProjectRuntimeService.updateTask`: when off, reject adding/modifying non-null policy; explicit `continuation: null` removal must still work, as must unrelated edits of a legacy task that already contains policy. Do not allow task owner/client to flip global gate. +- `RuntimeTaskExecutionService.advanceContinuation`, terminal attempt reconciliation and startup recovery: off means no new automatic review/repair, no synthetic blocked-state side effect solely from disabled feature. Ordinary execution and handoff read unaffected. +- `launchAttempt`: on startup when a historical pending continuation review or repair receipt is present while off, perform no external launch. Preserve receipts; cancel if thread is definitely absent, or retain `reconcile_required` if thread may exist. The disabled gate must not be bypassed via a replay of a saved request key. +- Gate-on explicitly configured **isolated test** paths must still pass all prior continuation tests, including duplicate/replay limits, exact post-handoff revision binding, malformed and case-variant key reservation, two-repair synthetic budget, source cancellation, stop-writer CAS, reviewer independence and no automatic VERIFIED. +- Default is off under missing/invalid settings. Prove server-derived, not agent-selected. Avoid expanding agent-visible MCP fields or further increasing tool context without a separate explicit review. + +**Verification:** full `apps/server/src/projectRuntime` tests, targeted off/on and SQLite restart suites, `vp run typecheck`, `vp run check:changed`, any existing budget test. Record executed commands/counts/exit codes. Stub providers only, no real model calls. Claim no stronger verdict than evidence. + +### T2 — Independent security review and bounded repairs + +Different provider/model reviewer from T1 writer. Inspect every gate surface, attempted bypasses, source of configuration, cancellation/replay semantics, read/write actor provenance, and that off mode doesn't accidentally block ordinary task operations. Verify no hidden agent-facing default-on path and no prod exposure. If routine issue found, writer corrects and reruns tests, reviewer re-reviews. Use up to two *different, evidence-backed* low-cost troubleshooting attempts before escalating a genuine difficult bug to available Codex/Claude-class, with at most four bounded total attempts per issue. Security/architecture/paid-cost stop conditions are immediate, not retry targets. + +### T3 — Separate upstream compatibility reconciliation (safe trial only) + +After T1/T2 gate branch has a clean proven checkpoint, fetch current `pingdotgg/t3code` main and fork main, inspect exact current heads and change lists. Fork and upstream have substantial divergence. Run a **disposable, isolated** trial merge/replay, never a rewrite of published or shared history. Reconcile the overnight report's eight preexisting conflicts against latest upstream; show actual file conflicts, upstream-owned/fork-owned behavior changes, and V2 launch/provider effects. If an upstream compatibility conflict entails architectural policy, record it and stop that write lane. Never accept auto-merged code as proof of runtime compatibility. + +For any executable trial base, rerun the stage T1 test suite and typechecks on **that actual resulting tree**, with exact exit codes, re-measure MCP tool-list bytes and document any new agent-context increase. If trial cannot be completed safely, return source-backed matrix and blockers instead of claiming compatibility. Do not merge fork main or push upstream. + +### T4 — Strict production revocation design and shipping exclusion research + +Read-only architecture/spec task; assess strict no-new-launch after durable withdrawal using existing upstream ThreadLaunchService/EffectWorker/receipts; define linearization point, transactional authority provenance, cross-process/restart behavior, cancellation of existing runs, and verification scenarios. Identify whether an upstream API change is necessary, how to remain upstream-friendly, and rebase hotspots. No implementation of engine changes or new authority state. + +Document a **separate public-release exclusion strategy** (feature absent from shipping agent-visible schemas; effect on context budget measured). If it requires a material architecture change, classify PRODUCT DECISION, record options but do not expand implementation. + +### T5 — Final independent readiness review and durable handoff + +Verify all T1/T2 changes, test/log provenance, routing/attempt ledger, branch base, active workers and worktree cleanliness; check T3 research/conflicts and T4 proposals. Publish normal fast-forward commit/push **only to the owned experimental gate branch** after verification and secret review. No PR/main integration. Mark precise states `IMPLEMENTED`, `RUNTIME PASS`, `REVIEW PASS`, `NOT INTEGRATED`, and residual `BLOCKED` gates. Preserve all original worktrees. Return full manager handoff, actual provider/model routing table, and exact follow-up action for browser review. + +## MONITOR / RETRY RULES + +- Only one active writer per shared code lane. Record every child dispatch, last verified host wake/liveness event, end result and handoff. +- Do not start T2 until T1's changes and tests are settled; do not begin T3 trial in same worktree with pending code changes. +- For routine implementation defects: first evidence-based attempt; second materially different diagnosis; stronger model may take up to two additional tries if both failed. Do not spend the entire quota if solved. No repeated unchanged command counts as a new attempt. +- If T3 is blocked by architecture, continue T4 read-only and complete final checkpoint; don't claim the blocked task passed. +- If completion or Runtime is unavailable, preserve a clear resumable handoff rather than claiming continuous monitoring. + +## SECURITY / STOP CONDITIONS + +Do not introduce a second runtime database/queue, intrusive upstream engine changes, policy enablement in a shipping server, paid external usage, source history rewrite, destructive worktree operations, merge/main changes or public upstream writes. Stop for material changes in cancellation contract, build-exclusion mechanism that touches upstream ownership, true atomic launch guarantee, irreversible migration, conflict with other writers or material cost. + +## RETURN HANDOFF FIELDS + +**VERDICT** by T0–T5; **BASE/CHECKPOINT** (exact branch, worktree, status, current upstream); **RESULT** and file changes; **VERIFICATION** commands, counts/exits and test environment; **FAILURES/RISKS** and classification; **REVIEW** provider/model and independence; **ROUTING LEDGER** with candidates, rejected options, actual resolved model, attempts, cost only when measured; **INTEGRATION STATE**; **NEXT** and any specific user decisions (do not re-ask accepted D1–D4). diff --git a/docs/orchestration-v2/task-post-h-packaged-d2-shipping-verification-proposed-20261106.md b/docs/orchestration-v2/task-post-h-packaged-d2-shipping-verification-proposed-20261106.md new file mode 100644 index 0000000000000..96a892db911e2 --- /dev/null +++ b/docs/orchestration-v2/task-post-h-packaged-d2-shipping-verification-proposed-20261106.md @@ -0,0 +1,32 @@ +# PROPOSED TASK — packaged/authenticated D2 agent MCP release-schema verification + +**Status:** **PREPARED / AWAITING USER AUTHORIZATION / NOT DISPATCHED / NO SHIPPING CLAIM**. +**Parent evidence:** [final overnight U/R/H manager reconciliation](manager-overnight-urh-final-reconciliation-20261106.md), [Current State](../../01_CURRENT_STATE.md), [Coordination/Handoff Protocol](../../02_COORDINATION_HANDOFF_PROTOCOL.md), [staged safety governing spec](continuation-staged-safety-governing-spec-20261104.md). +**Why next:** H provided **source-loaded tool-list D2 PASS** (82 tools/2269 paths/58799 UTF-8 bytes, zero continuation-attributable fields/bytes) but **NOT a real packaged authenticated agent MCP listing**. Closing that gap is a focused release-readiness gate, separate from any fork-main merge, Opus expansion, or real-provider K3 start/crash work. + +## 1. Exact goal and acceptance + +Demonstrate through **actual supported build/packaging and an authenticated agent MCP client session** that experimental continuation internals are **not** exposed in shipping agent-facing create/update/result schemas while the server's **operator-only** continuation policy can still create/read/update/revoke under correct authorization. Use the **same frozen U/R/H isolated code candidate** to start; do not merge anything to fork main or import old divergent experiment. + +Required proof, with actual test harness and recorded artifacts: + +1. **Preflight:** inspect exact local H worktree/head/base/status/owner, current package/client build scripts, supported authentication method and existing non-sensitive credentials. Preserve U/R/H and all other user worktrees and private PR #21 evidence. No live user DB/system service modification, no disabled security checks or credential bypass. +2. **Build and run packaged server/client:** use a **distinct disposable home, database, process and credentials/identity** created by supported test flow. Demonstrate that the actual distributable or production-equivalent package (not only TS/source-loaded toolkit) exposes the exact expected MCP tool list to a real **authorized agent client**, plus a rejected unauthorized control if supported. Capture tool names, parameters, results and actual serialized UTF-8 measurements against the matching frozen U shipping baseline. +3. **D2 schema assertions:** no experimental `continuation` in agent-visible task create/update/input/output and task listing/serialization; **0 continuation-attributable agent tool-schema bytes** relative to equivalent U baseline. Preserve unrelated `t3_worktree_handoff` delivery-status field. Agent must not be able to mint or alter operator continuation authority through tool parameters, conversation content, mutable task JSON or policy transport. Demonstrate operator-only create/read/update/revoke with correct authenticated authority, and a negative agent attempt. +4. **Behavior checks:** default-off; ordinary Runtime tasks unaffected; no unsolicited execution; project/task isolation and revision CAS preserved; outputs don't inadvertently leak continuation through another agent-visible surface. Avoid strengthening contract beyond accepted D1–D5. If schema projection differs in packaged environment from source-loaded results, classify release BLOCKER and repair only after explicit code-scope authorization if needed. +5. **Verification:** clean package/typecheck/changed-file static checks, relevant auth/MCP/Runtime suites and a **different-provider independent READ-ONLY review** of test outputs and any code changes. UI rendered inspection only if this task actually touches UI. Do not call a unit-test/mock fixture an actual packaged-client PASS. +6. **Durable handoff and ledger:** mandatory pre/post-dispatch T3 Runtime if supported, else verified restricted append-only ledger outside source. Record model/provider/effort/subscription/quota or UNKNOWN, source refs, tests/command exits, reviewer, secrets handling, exact `PASS / PARTIAL / BLOCKED`, new findings, no user data exposure. + +**Disallowed:** Git push/PR/main merge, real-provider paid turn, production/default-on, new authority table or architecture rewrite, modifying live credentials/user DB, worktree destruction, private evidence copying or writing to public GitHub. A real cost/paid subscription or auth exception requires separate approval. + +## 2. Routing (if user accepts this task) + +DeepSeek V4.1 Flash **orchestration-only**; assign one bounded test/build worker from **Codex GPT-6.1 SOL Medium** or **Claude Sonnet 5.5 Medium** based on actual capacity, with **the other provider** read-only independent reviewer. User-confirmed prior Stage R Opus approval does not automatically authorize new Opus. Ask user only for credentials/cost/product permission if essential; never guess. Two ordinary repair cycles max if they fit **newly authorized** task budget; the finished overnight 18-dispatch budget was for U/R/H and **must not be treated as ongoing approval**. + +If no supported real packaged/authenticated MCP client path can be exercised with safe included-cost credentials, report **`D2 PACKAGED SHIPPING NOT VERIFIED / OPERATIONAL BLOCKER`** with precise setup requirement, do not invent shipping PASS. + +## 3. Completion and next decision + +Return **`VERDICT / EXACT H SOURCE/BASE / PACKAGING & AUTH PATH / MCP tool-list source-vs-package byte/field diff / OPERATOR/AGENT NEGATIVE ACCESS RESULTS / TYPECHECK+TEST EXITS / INDEPENDENT REVIEW / ROUTING LEDGER / REMAINING D2 OR K3 RISKS / NO INTEGRATION / NEXT OWNER CHOICE`**. + +Even a D2 packaged PASS does **not** authorize fork-main merge, live real-provider K3 safety testing, production, public release, or default-on. **The next distinct decision** is whether to run controlled real-provider K3 qualification, begin a separate isolated upstream-aware integration trial, or defer. diff --git a/docs/orchestration-v2/task-pr21-sanitized-evidence-subset-local-preparation-20261105.md b/docs/orchestration-v2/task-pr21-sanitized-evidence-subset-local-preparation-20261105.md new file mode 100644 index 0000000000000..9558a68af75ad --- /dev/null +++ b/docs/orchestration-v2/task-pr21-sanitized-evidence-subset-local-preparation-20261105.md @@ -0,0 +1,44 @@ +# PR #21 sanitized evidence publication candidate — LOCAL PREPARATION ONLY + +**Task status:** **COMPLETED (worker-reported) / INDEPENDENT REVIEW PASS (recorded)**. User authorized LOCAL PREPARATION on 2026-11-05; workers completed text-only staging at 12:25Z and the subsequently identified 80-entry checksum correction at 12:46Z. **This original orchestration packet is historical; do not re-dispatch.** [Final manager acceptance](manager-pr21-sanitized-subset-integrity-acceptance-20261105.md). **NOT AUTHORIZED:** any Git commit, push, upload, attachment, publication, network transfer, paid-provider use, fork-main write or production action. + +**Governing coordination:** [Current State](../../01_CURRENT_STATE.md), [Coordination/Handoff Protocol](../../02_COORDINATION_HANDOFF_PROTOCOL.md), [Manager evidence-closure reconciliation](manager-postmerge-pr21-evidence-closure-reconciliation-20261104.md), [accepted DeepSeek orchestration template](DEEPSEEK_ORCHESTRATOR_HANDOFF_TEMPLATE_V1.md). + +## Paste into T3 Code — complete DeepSeek orchestrator handoff + +> **DeepSeek V4.1 Flash / OpenCode: START THIS AUTHORIZED TASK AS ORCHESTRATOR ONLY.** Coordinate and route the local work, supervise provider capacity and evidence, maintain task/attempt/ledger, and arrange independent review. **Do not write files, run shell commands, package evidence, conduct tests or perform development work yourself.** +> +> **Task:** Prepare a *new* sanitized, location-scrubbed, text-only PR #21 verification evidence subset for **local review only**, based on the already worker-checked package v2. Do not re-run original evidence closure, change fork `main`, test production providers, or revisit completed integration. This is a disclosure-review preparation, **not** approval to distribute evidence. +> +> **Repo/base:** `jermur788/t3code` fork `main` was verified at `fb67545d790c5c001e8f85827f219ab6493c435e` (normal PR #21 merge) as of manager review; confirm live remote main still matches or stop for baseline drift. Do not open or rewrite any branch to complete this bounded task. +> +> **Local sources to verify before use:** sanitized package v2 reportedly at `/media/jer/Files/Worktrees/pr21-evidence-package-20261104-v2/` (**89 files / 754,717 bytes**, with **78 sanitized text files**). Original full evidence at `/media/jer/Files/Worktrees/pr21-verify-evidence-20261104/`, and restricted ledger delta at `/media/jer/Files/Worktrees/pr21-evidence-final-ledger-20261104/` **must remain local and untouched**. These are reported worker-host paths, not browser-visible assets. Inspect existence and ownership; no assumption another host has the files. +> +> **Worker allocation:** Dispatch **Codex GPT-6.1 SOL Medium** or **Claude Sonnet 5.5 Medium** to perform all file inspection, sanitization, manifest generation, hashing and technical checks. Choose based on current subscription availability and task fit. Assign an **independent read-only reviewer using a different provider/model**. Opus 5.5 is reserved for material unresolved security/architecture concerns; ordinary redaction issues get evidence-backed rework at Medium first. One writer owns the new staging lane; do not mutate the checked v2 source package. +> +> **Step A — safety/preflight:** Verify current worker host, clean/owned worktree and source package inventory, hashes and timestamps. Record any missing files as `NOT FOUND`. Detect whether original source path strings or metadata from v2 manifest/inventory need location redaction, including the one previously noted absolute `/media/...` path. Confirm all package-v2 originals remain unchanged by comparing the existing trusted checksums. Never `git clean/reset/stash`, delete, overwrite, or infer permission from existence of files. +> +> **Step B — local staging:** Create an exclusively owned **new directory outside the repository and outside the v2/original evidence directories**, with a noncolliding name and restrictive local permissions (prefer 0700). Copy **only** the 78 text files from v2 `sanitized/`. Create a newly location-scrubbed `MANIFEST.md`, `SANITIZED-MAP.json` with **relative paths only**, and a fresh checksum file covering every staged publishable artifact (excluding checksum self-reference). Nothing from `ledger-original.md`, `REVERIFICATION.json`, `BASE.json`, SQLite DBs, screenshots, raw JSONL, raw RPC frames, `.git`, `node_modules`, raw logs or binary files may enter the candidate. Do **not** copy a whole archive or simply reuse the old manifest without scrubbing. +> +> **Step C — privacy and integrity checks:** Automatically scan staged text for host-specific absolute paths (Unix/Windows), home/usernames, `localhost` or loopback endpoints, UUIDs, email addresses, credentials, auth headers/tokens, secrets, API keys, access URLs with query secrets, and three previously reported trace IDs; redact or minimize all nonessential identifiers. Inspect suspicious strings manually; **pattern checks alone are not a privacy guarantee**. An inert redacted `Bearer ` label is not a credential, but reviewer must decide whether it is necessary; prefer removing the whole label if not essential. Avoid introducing new path leaks in manifests, checksum filenames, metadata, log excerpts or the final handoff. Validate all text encodings and relative-map targets, forbid traversal/symlinks, verify no binary content, recount files/bytes, and verify 100% of generated checksums. Hashes must refer to the new staged copy, **not** merely the old v2 package. Record exact scan commands/results without copying private matches into a public record. +> +> **Step D — independent disclosure review:** The different-provider/model reviewer performs **read-only** inspection of precisely the staged subset and final inventory; checks real text for disclosure risk, paths and trace identifiers, claims versus backing evidence, checksum manifest scope, no source mutations, and exact file exclusions. Request rework by the owner if findings remain; rerun scans/checks and reviewer inspection. A PASS WITH FINDINGS must preserve open findings explicitly. +> +> **Step E — local handoff only:** Leave the final candidate directory **on the same host**, access-restricted; report its exact local path only in the **private T3 Code handoff**, never as a public GitHub comment. Present a concise non-sensitive candidate inventory (relative names, counts, total bytes and checksum result), reviewer verdict, remaining disclosure risks, and a **proposed** destination/visibility (not a transfer action). **Do not commit, push, open a PR, attach files, email, upload, publish or expose the subset to an external service.** Return for separate manager/user approval before any such action. +> +> **Capacity / ledger:** At dispatch, completion, quota error and task transition record UTC, task/attempt, selected and actual provider/model/effort, other options and reason, per-subscription actual availability/cooldown and provider-confirmed five-hour reset or UNKNOWN, worktree/lane ownership, command exit/evidence, redaction changes, independent reviewer and next action. DeepSeek monthly remaining balance is a dated user report, not telemetry. If a subscription is exhausted, checkpoint/reassign safely or await a *confirmed* reset only if host supports resumable supervision; otherwise return precise continuation. Use Project Runtime task/handoff/attempt state if available; otherwise append-only **restricted local ledger outside the staging subset**. Do not publish sensitive evidence in the ledger. +> +> **Finish:** Return **VERDICT / SOURCE PACKAGE VERIFIED / SOURCE CHECKSUMS / STAGED CANDIDATE INVENTORY AND LOCATION / SANITIZATION TESTS / CHECKSUMS / SOURCE PACKAGE UNCHANGED / REVIEW / ROUTING + CAPACITY LEDGER / DISCLOSURE RISKS / PUBLICATION PROPOSAL / NEXT**. Classify this as `LOCAL STAGING PASS`, `PASS WITH FINDINGS`, or `BLOCKED` based on inspected evidence — **never `PUBLISHED`**. If worker launch is not actually supported, return `NOT DISPATCHED` with the blocker. + +## Manager acceptance requirements + +1. The v2 and original evidence are not modified. The candidate contains exactly the reviewed text subset plus fresh scrubbed manifests/checksums, with no raw or restricted material. +2. 100% staged checksum verification; exact counts and scope; path/symlink/traversal/credential scans plus manual disclosure review and independent reviewer of **actual final bytes**. +3. No repo commits, branch pushes, network transfers, disclosure or paid models. The only new files live in a private local staging directory and restricted task ledger. +4. Any public/private publication requires a **new explicit user authorization** identifying exact reviewed files, audience/destination and transfer method. This approval covers local preparation **only**. + +## Result — local preparation finished, no publication + +The worker return reports a private **81-file** candidate comprising **78 sanitized text files**, `MANIFEST.md`, `SANITIZED-MAP.json`, and `SHA256SUMS.txt`; final independently reviewed checksum list has **80 non-self entries, 80/80 PASS**. The source v2 package was checked read-only without modifications; all 78 sanitized files and the two metadata files remained unchanged through final checksum correction. Independent Claude Sonnet 5.5 Medium reviewer recorded PASS on the corrected candidate after Codex GPT-6.1 SOL Medium worker execution and DeepSeek orchestration-only supervision. Browser manager verified repository main/PR state and the task document but has not seen the private candidate bytes. + +**Task is complete; do not re-run.** Candidate remains privately held on worker host, not uploaded, published or linked from GitHub. See [final manager integrity acceptance](manager-pr21-sanitized-subset-integrity-acceptance-20261105.md) and [Current State](../../01_CURRENT_STATE.md). Any evidence transfer requires a **separate exact-file, destination/visibility, routing-name and transfer-method user approval**. diff --git a/docs/orchestration-v2/task-pr21-sanitized-subset-metadata-hashes-correction-20261105.md b/docs/orchestration-v2/task-pr21-sanitized-subset-metadata-hashes-correction-20261105.md new file mode 100644 index 0000000000000..fd586f2e7afe3 --- /dev/null +++ b/docs/orchestration-v2/task-pr21-sanitized-subset-metadata-hashes-correction-20261105.md @@ -0,0 +1,36 @@ +# PR #21 private sanitized evidence — bounded metadata checksum completion + +**Task state:** **COMPLETED — LOCAL PREPARATION INTEGRITY PASS (worker-reported), independent REVIEW PASS (recorded)**, returned 2026-11-05 12:46Z. Original instruction packet below is historical and **must not be re-dispatched**. [Manager acceptance](manager-pr21-sanitized-subset-integrity-acceptance-20261105.md). +**Authority:** Continuation of user's 2026-11-05 **local-only** evidence preparation approval; routine integrity correction. Nothing authorizes publication, uploading or moving local `main`. +**Governing sources:** [Original local-staging task](task-pr21-sanitized-evidence-subset-local-preparation-20261105.md), [Manager review](manager-pr21-sanitized-subset-preparation-review-20261105.md), [Current State](../../01_CURRENT_STATE.md), Coordination/Handoff Protocol and accepted DeepSeek orchestrator template. The original task **exists on GitHub planning branch**; local worker's missing-document finding is a fetch/ref discrepancy of unknown cause. + +## PASTE INTO T3 CODE — DeepSeek orchestrator instruction + +> **DeepSeek: Orchestrate only; do not edit files, run tests/checks or operate Git yourself.** This is a **single bounded local correction** to the completed PR #21 private sanitized evidence candidate, not a new evidence sanitization, PR merge, source implementation or a publication task. +> +> **Live verification before work:** fetch/read the governing task from the GitHub planning branch `planning/resource-efficient-continuation-20261103`. If absent locally, compare actual remote URL/credentials/ref and use the canonical browser-verified document link, not an invented substitute; do not rewrite history or update local main. Confirm original fork `main` is still the already-merged PR #21 development baseline. +> +> **Actual candidate and v2 source package:** use the exact paths from the **private user-supplied worker return**, rather than copying home-directory or volume paths into this public planning-branch task. Candidate is access-restricted; source v2 package remained mounted read-only at prior return, and local `main` was stale. Verify live ownership, mount, file inventory and no concurrent writers. Do not unmount, remount writable, reset, clean, move local main or alter originals without a new explicitly authorized operation. If source is temporarily unavailable, rely only on *previously verified* source checks and do not fabricate a fresh verification. +> +> **Specific defect:** Candidate has 81 files: 78 sanitized evidence files plus `MANIFEST.md`, `SANITIZED-MAP.json`, `SHA256SUMS.txt`. Existing sums file has only **78 entries**; original task requires a checksum for **every publishable artifact except checksum self-reference**. Thus `MANIFEST.md` and `SANITIZED-MAP.json` must also be covered. The target is **80 distinct, relative, sorted SHA-256 entries**, 80/80 verification PASS. Preserve existing 78 content files and their bytes exactly. +> +> **Worker:** Assign **Codex GPT-6.1 SOL Medium** or **Claude Sonnet 5.5 Medium** as the one writer of the candidate metadata, based on actual capacity; independent read-only reviewer must use the **other provider/model**. DeepSeek only supervises routing and append-only restricted ledger. No Opus unless a material architecture/security issue is found. Keep per-subscription quota/reset/availability observations exact or UNKNOWN. +> +> **Execution:** Confirm every file count and checksum against candidate on disk. Recompute the 80-entry relative checksum manifest including the two metadata files and all 78 evidence files, omitting SHA256SUMS itself; use atomic local replacement within the candidate only after checking ownership and recording the prior checksum. Do not mutate `MANIFEST.md` or `SANITIZED-MAP.json` unless a *specific integrity issue* requires it; if either metadata file embeds a checksum of the checksum file, stop for circularity diagnosis. Verify SHA256SUMS's line count, membership, stable sorted ordering, integrity of 80/80 targets, and no symlinks/traversal/absolute paths. Re-run focused automated scans on entire final candidate (including metadata), manually examine high-risk strings, and confirm all 78 sanitized file hashes and source-v2 package invariance. Since the sums file itself changes, report its **new own digest separately** in the private return, rather than attempting to include it as a self-entry. +> +> **Independent read-only review:** Re-derive 80/80 integrity, check exact 81-file membership, source v2 unchanged, corrected task compliance, and privacy/disclosure risks including the existing reviewer qualification about large logs. Prior disclosure PASS remains source context; do not claim it proves the new metadata state. If review finds a genuine defect, allow bounded rework and re-review, without publishing any files. +> +> **Stop and return:** Complete **VERDICT / ACTUAL BASE / OWNED LANE / BEFORE–AFTER CHECKSUM INVENTORY / 80/80 CHECK / SANITIZED EVIDENCE FILES UNCHANGED / METADATA INTEGRITY / DISCLOSURE RECHECK / INDEPENDENT REVIEW / CAPACITY ROUTING LEDGER / RISKS / NEXT**. Label `LOCAL PREPARATION INTEGRITY PASS (worker-reported)` only if all criteria actually pass. Otherwise return `VERIFICATION FAILURE` or `OPERATIONAL BLOCKER` with evidence and exact next safe step. The corrected candidate stays private on the host; **do not push, commit, attach, email, upload or publish it**. Any transfer requires a separate explicit user decision about exact reviewed candidate, destination/visibility and routing-name exposure. + +## Acceptance + +- No implementation/source changes, no upstream/milestone merge, no main ref movement, no mutation of original v2 package/restricted evidence. +- Exactly 78 unchanged sanitized text files + two tracked metadata files + checksum self-file; **80 uniquely accounted entries and 80/80 verification PASS**; separately report checksum-file digest. +- Source package/previous ledger preserved, no secret/privacy regression, independent different-provider/model read-only review, factual task ledger. +- No external transfer. Fork repo is **public**; a "dedicated branch" would also be publicly readable. + +## Completed task result — supersedes the pre-dispatch status + +The user returned actual DeepSeek-orchestrated execution: 3 dispatches (Codex GPT-6.1 SOL Medium writer, Claude Sonnet 5.5 Medium read-only reviewer, Codex ledger recording). The private 81-file candidate now has a corrected `SHA256SUMS.txt` with 80 distinct sorted relative entries covering 78 unchanged sanitized evidence files and unchanged `MANIFEST.md` and `SANITIZED-MAP.json`; SHA256SUMS excludes itself. Worker reported **80/80 checksum PASS**, no symlinks/path escapes, full unchanged source checks and fresh disclosure scans; reviewer independently re-derived the same using the genuine prior 78-entry witness instead of writer-created before-artifact and returned **PASS**. All work was local and no Git commit, push, upload, publication or production action occurred. Fork `main` remained unchanged. + +This closes the bounded correction as `LOCAL PREPARATION INTEGRITY PASS (worker-reported) / REVIEW PASS (recorded)` but **not independent browser-manager disk inspection or remotely published audit proof**. Pattern-based scan and reviewer log-sampling caveats remain. The public GitHub fork is not a private publication target. Any evidence transfer still requires separate user approval for exact files/destination/visibility/routing names. **Do not re-dispatch this packet.** diff --git a/docs/orchestration-v2/task-stage2-d2-built-mcp-shipping-audit-20261105.md b/docs/orchestration-v2/task-stage2-d2-built-mcp-shipping-audit-20261105.md new file mode 100644 index 0000000000000..b810bca5fc770 --- /dev/null +++ b/docs/orchestration-v2/task-stage2-d2-built-mcp-shipping-audit-20261105.md @@ -0,0 +1,33 @@ +# Stage 2 / D2 — compare actual built agent-facing tool schemas + +**Status:** **COMPLETED — READ-ONLY QUALIFICATION RETURNED**, 2026-11-05 13:50Z. This handoff below is historical: **DO NOT REDISPATCH**. **Authority:** user-accepted D2 public shipping exclusion requirement; read-only local build/test qualification only, no source implementation or release. **Browser plan:** [D2 shipping-surface audit](d2-shipping-exclusion-audit-plan-20261105.md). + +## Result (supersedes this historical pre-dispatch packet) + +LANE B CLOSED — SOURCE-LOADED PRODUCTION TRANSPORT WITH MOCKED SERVICES, scoped audit PASS (worker-reported), independent PASS WITH FINDINGS (recorded). 79 tools; +646 agent-budget bytes; output schema overhead separately measured. Current merged main has no continuation field; isolated experiment does despite gate off. Not packaged/release or paired-client D2 VERIFIED. [Manager reconciliation](manager-stage2-three-lane-return-reconciliation-20261105.md). + +The user supplied the local consolidated result and restricted ledger. Original screenshots/logs/attempt transcripts were not available to the browser manager. All related work was read-only against product source and no commits/merges/releases/paid-provider calls occurred. Any future writable task needs separate accepted spec and authority. + +## Paste into T3 Code — DeepSeek orchestration-only task + +> **DeepSeek — supervise only.** Read Project Instructions → Current State → Coordination Protocol → D2 plan. Choose the least costly authorized worker with verified quota evidence or UNKNOWN. Do not code, run tests, edit, package artifacts or use paid providers yourself. +> +> **Objective:** use the *actual built local server and schema enumeration* to determine whether the current merged fork `main` has any experimental continuation exposure, and exactly what would leak into MCP `tools/list` if the isolated experiment were integrated. D2 requires excluding experimental agent-facing tool-schema overhead before public shipping; a default-off gate is not enough. +> +> **Exact code checkpoints at packet writing:** `main` `fb67545d790c5c001e8f85827f219ab6493c435e`, `experiment/continuation-default-off-gate-20261104` `b3b8da54e0b8b184a1cf4e667d53e73e04f85074`. Re-fetch both. Preserve existing worktrees and any local stale main. Use independent clean/owned **read-only source worktrees** for separate builds with isolated generated artifacts and disposable .t3 state; no product source writes or merges. +> +> **Worker:** Codex GPT-6.1 SOL Medium or Claude Sonnet 5.5 Medium. Independent read-only reviewer from different provider/model. +> +> **A. Source surface:** inspect `packages/contracts/src/projectRuntime.ts` and `apps/server/src/mcp/toolkits/project/runtimeTools.ts` plus generated OpenAPI/JSON Schema/client bindings, `agentContextBudget.json`, and generated tool definitions. Track operator-only `continuation` fields versus server internal data, agent MCP create/update schemas and any desktop/mobile/WebSocket exposure. Do not claim TypeScript types disappear from runtime schemas without proof. +> +> **B. Real schema measurement:** run local builds/stub-mode server/testkit as supported for *both separate checkpoints*. Enumerate the **actual** `tools/list` through supported MCP authorization/test harness. Never forge/bypass session tokens. Capture sanitized diff of tool names/property paths, serialized UTF-8 bytes and exact config/profile. Compare equalized environment and contract versions, not stale snapshots. Recompute source and tool budget; worker-reported historical +646 bytes is only context. +> +> **C. D2 analysis:** record whether current shipping baseline truly advertises no continuation field and what minimal build/source exclusion mechanism would be needed *if* future integration is approved. Propose static source check **and** built-tool-list release gate; ensure normal Runtime tasks and provider-neutral MCP tools remain functional. If actual MCP enumeration cannot run without a live provider, classify `OPERATIONAL BLOCKER` and use testkit only with precise scope, not an invented PASS. +> +> **D. Review/ledger:** distinct-provider read-only review of actual logs/schema comparisons and no-secret provenance; record exact commands, tests, runtime config, model/effort, provider quotas/reset evidence or UNKNOWN, worktree ownership and next safe task in Runtime or restricted local append-only ledger. +> +> **Return:** VERDICT / REFS / BUILT TOOL-LIST ACCESS / NAME+SCHEMA+BYTE DIFF / CONTEXT BUDGET / CLIENT CONTRACT SURFACES / D2 SHIPPING STRATEGY OPTIONS / CI TEST PROPOSAL / REVIEW / CAPACITY LEDGER / NEXT. +> +> **No source changes, paid providers, branch pushes/commits, upstream PRs, fork-main merge, evidence-publication or public release.** `D2 RESEARCH/AUDIT PASS` does not mean `D2 SHIPPING VERIFIED` until a specific built public artifact passes the approved release check. + +**Why local:** no trusted built server/MCP environment or provider session is accessible from this browser manager; GitHub source review alone cannot establish tool-list bytes. diff --git a/docs/orchestration-v2/task-stage2-d4-atomicity-feasibility-20261105.md b/docs/orchestration-v2/task-stage2-d4-atomicity-feasibility-20261105.md new file mode 100644 index 0000000000000..f1c76fbbe31fb --- /dev/null +++ b/docs/orchestration-v2/task-stage2-d4-atomicity-feasibility-20261105.md @@ -0,0 +1,35 @@ +# Stage 2 / D4 — cross-transaction feasibility and run-creation path qualification + +**Status:** **COMPLETED — READ-ONLY QUALIFICATION RETURNED**, 2026-11-05 13:50Z. This handoff below is historical: **DO NOT REDISPATCH**. **Authority:** read-only, source-led feasibility/testing and independent review, not implementation of new production authority or upstream engine edits. **Spec:** [browser proposed D4 contract](d4-transactional-revocation-proposed-contract-20261105.md) is PROPOSED, not yet user-accepted. Governing D4 requirement in [staged safety spec](continuation-staged-safety-governing-spec-20261104.md) is accepted. + +## Result (supersedes this historical pre-dispatch packet) + +LANE A CLOSED — SCOPE-BOUNDED FEASIBILITY PASS (worker-reported), independent PASS WITH FINDINGS (recorded). Not D4 implemented or a full-server pass. Worker returned same-file/inode cross-process barrier tests and corrected defer-start lifecycle: initial run preparing has no start effect; later prepared-run.release controls start. Remaining real operator revoke/typed denial/full-server/restart gaps. [Manager reconciliation](manager-stage2-three-lane-return-reconciliation-20261105.md). + +The user supplied the local consolidated result and restricted ledger. Original screenshots/logs/attempt transcripts were not available to the browser manager. All related work was read-only against product source and no commits/merges/releases/paid-provider calls occurred. Any future writable task needs separate accepted spec and authority. + +## Paste into T3 Code — DeepSeek orchestration-only task + +> **DeepSeek V4.1 Flash — orchestrate only.** Do not edit source, run shell, execute tests or perform code implementation. Read Project Instructions → Current State → Coordination/Handoff Protocol → D4 proposed contract and this packet → Runtime task/handoff truth. +> +> **Objective:** answer the narrowly unresolved D4 engineering questions with code, actual SQL transaction evidence and deterministic stub-only experiments, so the Overall Manager can request the necessary product architecture sign-off and assign the smallest future code writer. **Do not modify existing product source, merge main, enable experimental continuation in production, or consume paid providers.** +> +> **Repo/base:** `jermur788/t3code` fork `main` was `fb67545d790c5c001e8f85827f219ab6493c435e`; isolated continuation experiment `experiment/continuation-default-off-gate-20261104` was `b3b8da54e0b8b184a1cf4e667d53e73e04f85074`. Current `pingdotgg/t3code` upstream head was `337c5858c33bc7f8f6dfd391a2c279fa0f7e4d17`. **Fetch and re-confirm exact live heads, Git status, unrelated changes, worktrees, base/ownership** before proceeding. Separate read-only or owned verification worktrees; preserve local stale `main` and all uncommitted work. No `git reset/clean/stash/rebase`. +> +> **Execution worker:** Codex GPT-6.1 SOL Medium or Claude Sonnet 5.5 Medium, based on current provider availability/cost; independent read-only reviewer from the other provider/model. Use Opus 5.5 only for material unresolved security/concurrency architecture and record why. +> +> **A. Atomicity proof:** inspect actual `SqlClient` and SQLite file/path/connection lifecycle for `ProjectRuntimeService.updateTask`, `RuntimeTaskExecutionService`, `EventSink.commitCommand`, `Orchestrator.message.dispatch` and effect outbox. Confirm source and engine share the **same SQLite DB and writer ordering**. Show real SQLite `BEGIN IMMEDIATE` or equivalent behavior under *two connections*, and restart/process boundaries where practical. Do not infer SQL isolation from a comment alone. If they do not share an atomic DB, return `REVIEW REQUIRED` with specific alternative. +> +> **B. Run paths / idempotency:** enumerate every `run.created` creation path in merged `main`, including regular messages, queued/steered/restarted/delegated work, and which can be reached by experimental continuation through `ThreadLaunchService`. Locate accepted/rejected command receipt, duplicate dispatch and pending Runtime attempt replay semantics. Analyze existing thread-shell-without-run recovery. Verify no direct provider-start bypass for this continuation path. +> +> **C. Revocation window:** prove with reproducible scheduling/barrier tests or a minimal isolated test harness (outside tracked source; no implementation changes) that experimental final check occurs before engine transaction and can be invalidated by a later task revision commit. Identify where a **private generic guard** can be injected with minimum upstream diff and no user/MCP-authored capability. +> +> **D. Proposed test cases:** supply precise runnable red-before test outlines for revoke-before-run vs run-before-revoke, concurrent writers/transactions, retries/replay after restart, task/project isolation, policy gate off, stale task revisions, guarded denial with no outbox, ordinary non-continuation paths unchanged. Do not weaken existing tests to make examples pass; an unimplemented proposed guard is not a `RUNTIME PASS`. +> +> **E. Evidence and independent review:** provide source file/line refs, actual command/test exits if run, observed SQLite identity/transaction logs, any red-before failure, an upstream hotspot list, risks and minimal potential design diff. Independent different-provider review of your conclusions. Record capacity and provider resets as observed or UNKNOWN, exact model/effort, task/attempt and owner; use T3 Runtime when exposed, otherwise local append-only ledger in a new owned evidence location. +> +> **Return:** VERDICT / BASE AND WORKTREES / DB ATOMICITY OBSERVED OR UNKNOWN / ALL RUN PATHS / RACE EVIDENCE / PROPOSED GUARD EXTENSION / TEST PLAN / UPSTREAM REBASE RISK / REVIEW / ROUTING + QUOTA / NEXT. `FEASIBILITY PASS` is not `D4 IMPLEMENTED`. Mark source issues as `REVIEW REQUIRED` or `OPERATIONAL BLOCKER` precisely. +> +> **No source edits, Git commits/pushes/merges, public posting, production enablement or paid provider calls.** Stop for material architecture/security decision or inability to prove atomicity. Do not auto-run a D4 implementation task until the owner accepts the run-created vs provider-start contract and in-flight semantics. + +**Why not browser-only:** current GitHub source was inspected and proposed contract published, but an actual multi-connection/multi-process SQLite ordering test and worker-host execution-path instrumentation require local T3 Code runtime. diff --git a/docs/orchestration-v2/task-stage2-d4-isolated-implementation-20261105.md b/docs/orchestration-v2/task-stage2-d4-isolated-implementation-20261105.md new file mode 100644 index 0000000000000..5b9ec37d6fe8f --- /dev/null +++ b/docs/orchestration-v2/task-stage2-d4-isolated-implementation-20261105.md @@ -0,0 +1,77 @@ +# D4 — One bounded isolated implementation, tests and independent review + +**State:** **COMPLETED LOCALLY — IMPLEMENTED (worker-reported) / SCOPED RUNTIME PASS / REVIEW PASS WITH FINDINGS / REQUIRED FULL-SERVER ASSEMBLY VERIFICATION OPEN / NOT INTEGRATED**. This original task packet is historical; **DO NOT REDISPATCH**. [Manager reconciliation](manager-d4-isolated-implementation-return-review-20261105.md), [targeted verification follow-up](task-d4-full-server-assembly-verification-20261105.md). +**User authority:** On 2026-11-05 user accepted **A + B** revocation behavior. This packet scopes the next isolated implementation/test step only; it does not authorize merge into fork `main`, automatic production rollout, upstream catch-up, public release, new authoritative tables, material paid-provider calls, or external evidence transfer. +**Canonical governing spec:** [D4 ACCEPTED A+B](d4-accepted-revocation-contract-20261105.md), [D1–D5 staged safety spec](continuation-staged-safety-governing-spec-20261104.md). [Stage 2 source/feasibility findings](manager-stage2-three-lane-return-reconciliation-20261105.md). [Current State](../../01_CURRENT_STATE.md). [Coordination/Handoff Protocol](../../02_COORDINATION_HANDOFF_PROTOCOL.md). + +## TASK / GOAL + +Implement the narrowly accepted D4 guarantee **only in an isolated owned worktree/branch**: + +**A — transactional no-new-run:** after the operator's revocation is durably committed, a new continuation `run.created` MUST NOT commit under that revoked authorization. + +**B — pre-start stop:** if a run was already created in `preparing`, but execution is definitely not started when revocation is observed, block `prepared-run.release`/start and cancel unsettled effects; if release/provider-start may already be underway, preserve provenance and explicitly `reconcile_required` with safe stop attempts, never falsely claim absolute cancellation of an external call. + +**No other product behavior expansion.** Feature remains default-off and outside main. Existing normal user commands and non-continuation Runtime work must be unchanged. D2 public agent schema remains a separate release gate. + +## BASE / OWNERSHIP / ROUTING + +**Browser-verified at task creation:** fork `jermur788/t3code` `main` `fb67545d790c5c001e8f85827f219ab6493c435e`, isolated default-off continuation `experiment/continuation-default-off-gate-20261104` `b3b8da54e0b8b184a1cf4e667d53e73e04f85074`, upstream `pingdotgg/t3code` `337c5858c33bc7f8f6dfd391a2c279fa0f7e4d17`. **These are checkpoints, not permission to reset local main or merge refs.** Worker must refresh live remote, inspect all local worktrees, branch and dirt, ownership, unrelated changes, permissions, read-only mounts and free disk before writes. The user's primary checkout was reportedly on a development-profiles branch, local main stale, and four Stage 2 detached evidence worktrees exist; **do not reuse, alter, clean or delete those lanes**. Create a **new unique local worktree/branch** with one writer, forked from a *verified exact base*, preserving all uncommitted work. No force operations, stash, reset, cherry-pick/merge main or main write without separate authority. If a clean usable code base would require substantial reconciliation of divergent experiment and merged main, **STOP as INTEGRATION CONFLICT / REVIEW REQUIRED** and propose a minimal strategy; do not silently start large re-land or upstream catch-up. + +**Orchestrator:** DeepSeek V4.1 Flash **only coordination, attempt/ledger updates and worker routing**, not code edits, shell/tests, packaging or independent code review. +**Technical implementer:** Codex GPT-6.1 SOL Medium or Claude Sonnet 5.5 Medium (appropriate task-fit/current available subscription). One writer. +**Independent reviewer:** the **other provider/model**, read-only, ideally concurrency/security familiar. Opus 5.5 only for demonstrated material unresolved security/concurrency problem and explicit allowed capacity/cost. Actual provider/model/effort, quota state/cooldown/five-hour reset or UNKNOWN per task dispatch, no invented values. No paid provider API calls. + +## IMPLEMENTATION SEQUENCE (bounded) + +1. **Preflight and proof before code:** Inspect the exact real full `server.ts` service/layer wiring and durable `ProjectRuntimeService.updateTask` revocation (`continuation:null`) versus `EventSink.commitCommand` transactions/DB identity. Worker Stage 2 only proved a service subset across two processes; if DB/coordinator serialization isn't real in the full root, **STOP** rather than implementing a best-effort promise. Inspect all three `run.created` emitters in `Orchestrator`, run/receipt outbox flows, `ThreadLaunchService` `defer_start`, `prepared-run.release`, effect worker/provider turn-start, restart replay and D2 schema touchpoints. +2. **A — private commit-time authorization:** Use a narrow upstream-friendly private guard/context carried only by the server-owned continuation launch path (never client-, agent-, tool- or prompt-mintable). Enforce the exact source authorization scope/revision **inside the transaction that would commit `run.created`**. Ensure denied attempts do not persist a fresh run, start effect or an accepted-success receipt; distinguish prior successful command receipts from new run creation. Typed refusal and Runtime attempt cancellation/reconciliation consistent with known thread/run state. Avoid altering regular message dispatch/queue/restart semantics. +3. **B — release/start revocation protection:** For the actual two-phase `defer_start` path, ensure `prepared-run.release` does not create a new start effect after a durably committed revocation when its `preparing` run is provably unstarted. Safe cancellation for unsettled effects; when provider-start has possibly been claimed/initiated, mark for explicit reconciliation and attempt supported best-effort stop. Do not assert atomic control of external provider `startTurn` unless a separately accepted architecture can prove it. Guarantee no extra provider-start work resurrected by replay/restart. +4. **Keep separate:** no new authority/epoch tables or schema migration without an explicit review/decision; no large upstream-engine rewrites, new public MCP capability, user-visible continuation enablement, dashboard state ownership, provider-specific custom policy or changes to shipping D2 advertised tool schemas. Never weaken existing acceptance tests just to pass. +5. **Evidence and review:** Stage 2 fixture results are baseline context, not proof. Implement deterministic real root tests and independent read-only review of the actual code and logs, repair any material findings and rerun. + +## ACCEPTANCE TEST MATRIX + +**Atomic ordering and scope** +- Revocation commit before guarded new run commit: **0 new runs, 0 start effects, no falsely accepted receipt**, typed denial, source/attempt durable state correct. +- Run commit before revocation: exactly one durable run; no duplicate from same-key replay; B applies if it remains unstarted. Distinct unrelated user-created runs unaffected. +- Two SQLite connections and separate server processes where practical: deterministic barriers and CAS ordering. Different project/source/task/revision, malformed/forged context and unauthorized actor all fail closed for continuation, never leak authority across projects. + +**Prepared-run and effect lifecycle** +- Revoke after `run.created` while `preparing`, before `prepared-run.release`: **no new provider-start effect** and correct terminal/reconcile status. +- Race with release/event commit/effect claim: if provably unstarted, deny start and cancel safely; otherwise `reconcile_required` + stop attempt, never invent `cancelled`/provider acceptance. +- Crash/restart, pending receipt replay, old attempts/history pruning: no unauthorized new run or release; preserve IDs/provenance, no resurrected effects. +- Server gate disabled, previous policy removed, stale task revision or conflicting edit: fail closed for synthetic continuation. Existing service-level isolation remains. + +**Regression and shipping** +- Ordinary user and non-continuation Project Runtime tasks work as before; existing D1 default-off behavior unchanged. +- Agent MCP `tools/list` and operator-only contract semantics: do not unintentionally broaden public tool schema (D2 packaged certification still separate). +- Fresh typecheck, focused and changed-file checks, web build if touched; rendered UI only if modified; actual local no-cost/stub provider restart integration where supported. Test two provider adapters when practical and no paid live calls. + +**Review:** distinct provider/model **READ-ONLY** review of transaction atomicity, authorization provenance, error/receipt idempotency, B release vs provider race, upstream compatibility and tests. Rework and re-review until accepted or classify blocker; record exact commands/exits/log custody and test coverage; do not claim `RUNTIME PASS` from fixture-only testing. + +## STOP CONDITIONS + +Return to Overall Manager as `REVIEW REQUIRED` / `INTEGRATION CONFLICT` / `UPSTREAM COMPATIBILITY` / `PRODUCT DECISION` if: +- full-server transaction ordering doesn't support the accepted A guarantee; +- protected continuation cannot be distinguished from normal launches without adding a public/forgeable input; +- a correct A/B implementation requires a **material upstream engine redesign, new authoritative table/epoch, distributed lock, dangerous migration, changing D2 shipping contract, or stricter external-provider-start semantics**; +- independent security reviewer flags unresolved privilege or cancellation safety bug; +- only way forward would move experimental source into fork main or merge upstream without approval; +- paid services, private evidence export, destructive Git/cleanup or production enablement would be needed. + +Do not substitute a final preflight check for a transaction guard. Do not claim an agent-facing default-off feature is shipping-safe. + +## REQUIRED HANDOFF + +**VERDICT / BASE + WORKTREE OWNERS / GOVERNING CONTRACT / PRECISE DIFF / RUN-COMMIT GUARD AND B RELEASE BOUNDARY / RECEIPT, REPLAY AND RESTART BEHAVIOR / TEST COMMANDS + RESULTS / FAILURES + REPAIRS / INDEPENDENT REVIEW + RE-REVIEW / PROVIDER/MODEL/EFFORT/QUOTAS / INTEGRATION STATE / NEXT AUTHORIZED ACTION**. + +If a bounded clean implementation is infeasible because the experimental branch is heavily divergent, **stop after verified preflight and return a specific integration conflict**. Do not carry out upstream catch-up or broad experimental re-land silently. + +**Outcome required:** `IMPLEMENTED` or `BLOCKED` on an **isolated branch only**. `INTEGRATED` and `VERIFIED` require future separate evidence and merge authorization. This packet is **prepared, not dispatched** by the browser manager. + +## 2026-11-05 17:54Z — returned implementation result, supersedes original task text + +The user provided the local worker handoff. The isolated branch reportedly has **3 local commits, 13 files, +1430/-44, clean**, on the original divergent experimental base, not pushed. **A implemented:** private continuation authorization context and SQL transaction-time `EventSink.commitCommand` guard; typed denial and rollback before run/start/accepted receipt. **B implemented:** guarded `prepared-run.release`/`prepared-run.retry` with terminal cancellation compensation, durable provenance, `EffectWorker` start recheck and reconciliation of ambiguous starts. No new schema, MCP tool field, epoch table or migration. Worker-reported static and focused test results: **113 changed-file tests, 153 acceptance tests, server typecheck all PASS**, independent Claude review **45 focused PASS + 4 ThreadLaunch PASS**, reviewer declined to claim other suites personally rerun. Two correction/re-review cycles closed the initial seven review findings; final **PASS WITH FINDINGS**. The browser manager has not inspected the unpushed local source or private logs. + +**Acceptance gap remains:** actual combined `server.ts` root with real operator `continuation:null`, shared SQLite transaction wiring and natural async `schedulePreparation` release denial is **not demonstrated**. Contract Check 1 is REQUIRED; the [bounded verification handoff](task-d4-full-server-assembly-verification-20261105.md) is the next routine task **PREPARED / NOT DISPATCHED**, not a repeat of implementation. `IMPLEMENTED` is accepted as worker-reported isolated milestone; overall `VERIFIED / INTEGRATED / PRODUCTION` is withheld. No merge, push, paid provider or release permission. [Manager assessment](manager-d4-isolated-implementation-return-review-20261105.md) preserves details and limitations. **Do not rerun this original packet.** diff --git a/docs/orchestration-v2/task-stage2-upstream-experiment-reconciliation-preview-20261105.md b/docs/orchestration-v2/task-stage2-upstream-experiment-reconciliation-preview-20261105.md new file mode 100644 index 0000000000000..22e53a6d6c7f1 --- /dev/null +++ b/docs/orchestration-v2/task-stage2-upstream-experiment-reconciliation-preview-20261105.md @@ -0,0 +1,31 @@ +# Stage 2 — read-only upstream/experimental continuation reconciliation preview + +**Status:** **COMPLETED — READ-ONLY QUALIFICATION RETURNED**, 2026-11-05 13:50Z. This handoff below is historical: **DO NOT REDISPATCH**. **Authority:** inspect/review and plan only. No merge, commit, rebase or source integration authorized. **Current milestone:** fork-main PR #21 merged and locally qualified; continuation remains isolated; D4 implementation contract pending user choice. + +## Result (supersedes this historical pre-dispatch packet) + +LANE C CLOSED — READ-ONLY PREVIEW COMPLETE (worker-reported), independent PASS WITH FINDINGS (recorded). 50 upstream commits/610 changed paths, 30 experiment paths; simulated conflicts 1 experiment→main, 2 main→upstream, 9 experiment→upstream. Upstream catch-up then fresh continuation re-land is proposed only; no ref changes. Browser manager screened selected OPEN upstream PR hotspots; not merged or exhaustive. [Manager reconciliation](manager-stage2-three-lane-return-reconciliation-20261105.md). + +The user supplied the local consolidated result and restricted ledger. Original screenshots/logs/attempt transcripts were not available to the browser manager. All related work was read-only against product source and no commits/merges/releases/paid-provider calls occurred. Any future writable task needs separate accepted spec and authority. + +## Paste into T3 Code — DeepSeek orchestration-only task + +> **DeepSeek — orchestration only.** Read Project Instructions, Current State, Coordination/Handoff Protocol, [D4 proposed contract](d4-transactional-revocation-proposed-contract-20261105.md) and [D2 plan](d2-shipping-exclusion-audit-plan-20261105.md). Route all code/reconciliation analysis and optional isolated test commands to Codex GPT-6.1 SOL Medium or Claude Sonnet 5.5 Medium; independent different-provider/model review. Do not perform source edits/tests yourself. +> +> **Goal:** produce an evidence-based forward-compatibility and integration **preview**, not a merge. The experiment branch is **34 ahead / 336 behind** current fork main at previous GitHub comparison. Current upstream `pingdotgg/t3code` had **50 commits beyond** the incorporated release-preparation parent; the compare endpoint returned only the first 300 changed filenames and must not be treated as exhaustive. +> +> **Preflight:** verify repo, exact fork-main/upstream/experimental remote heads, all local dirty worktrees, owners, current task lanes, available external-volume space. Previous main `fb67545d790c5c001e8f85827f219ab6493c435e`; experiment `b3b8da54e0b8b184a1cf4e667d53e73e04f85074`; upstream `337c5858c33bc7f8f6dfd391a2c279fa0f7e4d17`. Stop and reconcile if any changed. No reset, force, stash, cherry-pick, rebase, commit or push. +> +> **A. Source map:** compare experimental fork-only files against current main. Identify changed schema, RuntimeTaskExecutionService, ProjectRuntimeService, authorization gate, task packet, tests, agent context budget, server layers and docs; classify each as preserve, obsolete, adapt, or separate research. Identify conflicts and upstream touched/rebase hotspots in `Orchestrator`, provider adapters, MCP, projections, runtime DB, build and generated route/tools schemas. +> +> **B. Upstream 50-commit scan:** retrieve **complete** commit list and relevant changed paths with pagination if needed, distinguish merged upstream implementation from open proposals, classify material security/concurrency and provider changes. GitHub browser review already found latest fork/upstream `EventSink.ts` and `ThreadLaunchService.ts` contents **identical**, while `ProviderTurnStartService.ts` differs; revalidate on exact current refs. Do not try to sync all 50 commits by default. +> +> **C. Dry-run conflict/verification plan:** using git read-only comparisons/merge-tree (without updating refs) estimate expected conflicts and associated test lanes for *two independent future operations*: experimentally adapting continuation to the **currently merged fork main**, and a future upstream catch-up. Sequence to minimize rebase cost while preserving upstream-friendly abstractions. Provide a concrete one-writer future implementation packet, not code changes; list acceptance tied to D4/D2 specs. +> +> **D. Risk review:** independent reviewer checks upstream provenance, no old experimental code accidentally brought into shipping agent-facing schemas, and that no unapproved conflict resolution overwrites user work. Record exact model/effort, available quota or UNKNOWN, test commands, read-only outputs and user-decision gates in Runtime or local append-only ledger. +> +> **Return:** VERDICT / CURRENT REFS AND OWNERS / COMPLETE UPSTREAM CHANGE INVENTORY / EXPERIMENT DELTA / ANTICIPATED CONFLICTS / TEST + REBASE HOTSPOTS / PROPOSED SAFE SEQUENCE / REVIEW / COST + ROUTING EVIDENCE / NEXT. +> +> **No source writes, merges, branch pushes/commits, experimental enablement, paid-provider calls or production changes.** Do not interpret a clean hypothetical merge as integration authorization. Stop on material architecture or upstream incompatibility findings. + +**Why local:** a dry-run merge-tree, accurate complete upstream delta, locally tracked worktrees and targeted execution tests require the repo/host; browser GitHub review has covered initial source-level triage. diff --git a/docs/orchestration-v2/task-upstream-catchup-isolated-trial-20261105.md b/docs/orchestration-v2/task-upstream-catchup-isolated-trial-20261105.md new file mode 100644 index 0000000000000..750eceb74201e --- /dev/null +++ b/docs/orchestration-v2/task-upstream-catchup-isolated-trial-20261105.md @@ -0,0 +1,39 @@ +# TASK — authorized isolated upstream catch-up trial (one writer, no fork-main merge) + +**Status:** **U TRIAL COMPLETED LOCALLY (worker-reported) / STATIC PASS WITH 900s WRAPPER TIMEOUT CAVEAT / BOUNDED RUNTIME PASS / INDEPENDENT REVIEW PASS / NOT INTEGRATED**. This packet is **HISTORICAL — DO NOT REDISPATCH**. [Manager U reconciliation](manager-upstream-trial-return-reconciliation-20261106.md). [Next one-step routing ledger gate](handoff-upstream-to-r-routing-gate-20261106.md) is prepared but not dispatched. **Important 2026-11-06 override:** the user requested unattended gated continuation; [overnight U→R→H handoff](handoff-overnight-autonomous-orchestrator-20261106.md) and [binding amendment](overnight-conditional-autonomy-amendment-20261106.md) supersede this original U-only packet's instruction to stop after trial **only if G-U and subsequent stage gates pass**. No fork-main merge/push/production. User's 2026-11-05 22:14Z **"auth"** approves only option 1 from [integration options](manager-post-d4-integration-options-20261105.md). +**Governing spec:** [upstream trial contract](upstream-catchup-isolated-trial-governing-spec-20261105.md), [Current State](../../01_CURRENT_STATE.md), [Coordination/Handoff Protocol](../../02_COORDINATION_HANDOFF_PROTOCOL.md), [D4 K1/K2 qualification](manager-d4-full-root-k1-k2-verification-reconciliation-20261105.md). +**Goal:** isolated local candidate incorporating latest upstream without losing fork Project Runtime, Evidence V0 or client modes; reproduce tests and independently review. **NOT a merge into `main`, no continuation or D4 re-land, no Git push/PR/production.** + +## Copy/paste into T3 Code — DeepSeek V4.1 Flash orchestrator + +> You are **DeepSeek V4.1 Flash: orchestration ONLY**. You must **not** edit product source, run shell commands/tests, author code fixes or independently review code. Read Project Instructions → 01_CURRENT_STATE.md → 02_COORDINATION_HANDOFF_PROTOCOL.md → `docs/orchestration-v2/upstream-catchup-isolated-trial-governing-spec-20261105.md` → this packet → latest Runtime active tasks/handoffs. The owner **authorized one bounded, reversible, isolated upstream catch-up trial** on 2026-11-05 22:14Z, **not** a merge to main, public Git push, experimental continuation re-land, release or production change. Do not ask for approval again for this exact trial, but stop if a material architecture/safety decision is needed. +> +> **Routing:** Choose **one** technical writer/test worker: Codex GPT-6.1 SOL Medium or Claude Sonnet 5.5 Medium, based on actual subscription capacity; **a different provider/model** for independent READ-ONLY review. Preserve one writer per overlapping lane. DeepSeek coordinates/records decisions and cannot perform technical execution. No default Opus or paid model calls; after real quota errors checkpoint and reroute safely, never guess subscription reset. Note last worker report Codex A exhausted until 2026-11-08 21:15 UTC, Claude pools rate-limited; Codex B worked recently, allowance/reset UNKNOWN. All states are stale until checked. +> +> **Known browser checkpoints (refresh from live before first write):** fork `jermur788/t3code` `main` `fb67545d790c5c001e8f85827f219ab6493c435e` (reviewed PR #21 merged); `pingdotgg/t3code` upstream `main` `25b53299b75d4d8d1d0667ad47e9cfed3749776e`; upstream release-preparation base previously incorporated `bb4afa5425c52104a9261fa2d022cb8ba2fcc099` (91 upstream commits beyond); isolated experiment `experiment/continuation-default-off-gate-20261104` `b3b8da54e0b8b184a1cf4e667d53e73e04f85074`. The LOCAL unpushed D4 `d4/ab-revocation-guard-20261105` was reported at `f68db477a053bfe0211c6d92bf116711c1d55371`, not remotely retrievable. **Do not use experiment/D4 code as this new trial's base.** +> +> **Preflight before any writes:** Verify exact local repo, remotes, remote heads, primary checkout status, uncommitted changes, branches/worktrees, existing owners, permissions and free disk. Report source/base and local-main stale ref. Preserve `feature/development-profiles-v1` primary checkout, the four detached Stage 2 worktrees and their untracked probes, the local D4 worktree, and the user's read-only `/media/jer/Files` volume. PR #21 originals/sanitized evidence **KEEP PRIVATE**: no read/copy/move/upload/remount/delete. No `git reset`, `stash`, `clean`, force operations, branch/worktree removal or history rewrite. Fetch remote tracking data only. **Create a new uniquely named, owned local trial branch/worktree directly from the exact verified fork-main commit**, with separate generated caches and temporary test home. Local trial commits are permitted inside that one owned branch; **never push**. +> +> **A. Evidence-based upstream inventory:** Compare the selected actual upstream tip with the incorporated upstream parent and fork main. Retrieve complete changed files and all 91-or-current upstream commits through local Git; the browser endpoint returned only first 300 file paths. Inspect upstream accepted implementation separately from OPEN PRs/proposals. Run a non-mutating `git merge-tree` preview; record current conflicts (old preview's 1/2/9 counts are outdated). Classify conflict/hotspots: Orchestrator, ProviderTurnStart, provider adapters, projection, SQLite/persistence/migrations, MCP/tools, contracts, server/web/desktop and worktree/session internals. +> +> **B. Isolated upstream application:** In ONLY the new owned trial worktree, integrate the selected upstream tip with fork main, resolve **routine** conflicts while retaining upstream-compatible abstractions and all fork-only Runtime, P2 Evidence V0, development profile/mode and handoff/persistence semantics. A local merge commit or bounded trial fix commits are allowed; no source modification to existing primary/stale main or other branches. Do not drop task/attempt/handoff state, rewrite migrations, change provider routing, or add a fresh authority DB. If conflict requires significant Orchestrator/provider/auth/session redesign, new authority, rebase of unrelated work, unsafe upstream history edits or paid infrastructure, **STOP with REVIEW REQUIRED / UPSTREAM COMPATIBILITY / PRODUCT DECISION**, do not improvise. +> +> **C. Actual verification:** Verify exact included upstream parent and fork changes. Run appropriate format/lint/typecheck/check:changed, focused tests around upstream-touched paths, and relevant server/packages tests. Verify provider-neutral Runtime task CAS/isolation and handoff/attempt persistence after restart/reload; P2 Evidence V0 truthful completeness and fork-only old-decoder compatibility, command receipt/idempotency, normal user runs and provider adapter mock/stub paths. Confirm **NO experimental continuation/D4 code accidentally imported** and no `continuation` MCP tool-schema leak in the trial shipping baseline. Render and inspect web UI if touched; do not claim UI PASS from static tests. Use no-cost mocks/stubs for provider tests; no paid live model calls or credential bypass. If app-level MCP requires unavailable credentials, record exact `OPERATIONAL BLOCKER`. +> +> **D. Independent review:** After technical worker's targeted tests, a different provider/model reviews the actual diff, conflicts, upstream fidelity, Runtime/Evidence/Project state preservation, DB migrations, tool schema and security; read-only. Repair legitimate bounded defects, re-review/retest, preserve test rigor. Do not silently accept material upstream incompatibility. +> +> **E. Ledger/handoff:** DeepSeek writes Runtime task/attempt/handoff if available, otherwise restricted owned append-only local ledger. Record exact base and upstream head, worktree owner, source changes, local commit IDs internally, tested commands/exit counts, actual model/effort, quotas/reset or UNKNOWN, reviewer, findings/retries, integration state, evidence custody and next safe action. +> +> **Return one durable final:** `VERDICT / EXACT BASE AND LOCAL TRIAL HEAD / FORK-UPSTREAM COMMITS+PATHS / CURRENT CONFLICT LIST AND RESOLUTIONS / MODIFIED FILES & FORK INVARIANTS / VERIFIED TESTS + FAILURES / DB RESTART/EVIDENCE/MCP/UI RESULTS / INDEPENDENT REVIEW / MODEL-ROUTING AND QUOTAS / RISKS, BLOCKERS / INTEGRATION STATE / NEXT PRODUCT DECISION`. Status can be local `IMPLEMENTED / STATIC PASS / RUNTIME PASS / REVIEW PASS`; **never** `INTEGRATED` or `PRODUCTION VERIFIED` on an isolated trial. **STOP** after returning trial; do not automatically re-land continuation/D4, push, PR or merge `main`. + +## Acceptance / task owner + +**One writer on isolated worktree only.** The user approved the trial; exact starting head selection, checkout owner, tests, standard conflict repairs and independent review are routine inside this authorization. DeepSeek supervises but performs no shell/source execution. Review must use a different provider/model. The task ends with a reproducible local upstream candidate plus tests/review or a precise classified blocker. **Original PR #21 evidence must remain PRIVATE; old experimental D4 code is preserved but never imported.** Browser manager has no verified automatic T3 Code launch bridge: task is **PREPARED / NOT DISPATCHED** until local session receives this packet. + +## 2026-11-06 overnight conditional-authority amendment (latest user intent) + +The user separately authorized conditional continuation **U → R → H**, only on each independently verified pass and only in new isolated local branches, in [the binding amendment](overnight-conditional-autonomy-amendment-20261106.md) with [complete T3 Code paste-ready handoff](handoff-overnight-autonomous-orchestrator-20261106.md). Any older clause in this document saying "stop after U" or "separate permission for ALL isolated re-land" is superseded **only for the gated local-only R/H prototypes**, not for fork-main integration, Git push/public PR, paid-provider work, release, production, destructive Git or new architecture. G-U failure always stops next-stage progression. No local T3 Code dispatch has been started by browser. + +## 2026-11-06 00:27 — superseding completed-trial result + +U returned clean on local `trial/upstream-catchup-20261105`, **91 frozen upstream commits / 780 changed paths**, 2 routine conflicts resolved, 1 diagnostic comment correction, 39/39 fresh affected-workspace typechecks, **367/367 affected test files passed in 29 batches** (8,022 tests, 0 failed, 4 pre-existing skipped), plus 65 Runtime/Evidence checks. A single monolithic `check:changed` did **not** pass because its test phase hit the 900s limit; record **STATIC PASS WITH TIMEOUT CAVEAT**, not a green wrapper. Isolated server RPC/restart/persistence/project isolation, bounded UI smoke, MCP 82 tools/11 Runtime tools with no experimental continuation schema, and independent different-provider reviewer PASS were worker-reported. No branch push/PR/main merge or continuation/D4 re-land. [Manager reconciliation](manager-upstream-trial-return-reconciliation-20261106.md) accepted scoped technical U results but **G-U overnight promotion is HELD until durable per-dispatch routing-ledger continuity is verified**. [Coordinator-only routing-gate handoff](handoff-upstream-to-r-routing-gate-20261106.md) governs; do not repeat U. Current upstream has moved 22 commits past frozen trial tip; do not auto-chase. diff --git a/docs/orchestration-v2/task-upstream-pr28777-cooperative-conflict-and-regression-20261106.md b/docs/orchestration-v2/task-upstream-pr28777-cooperative-conflict-and-regression-20261106.md new file mode 100644 index 0000000000000..186670bffca74 --- /dev/null +++ b/docs/orchestration-v2/task-upstream-pr28777-cooperative-conflict-and-regression-20261106.md @@ -0,0 +1,59 @@ +# TASK — cooperative upstream PR #28777 conflict resolution and interrupted-review regression + +**State:** **AUTHORIZED FOR BOUNDED ISOLATED LOCAL PREPARATION / HANDOFF PREPARED / NOT DISPATCHED / NOT UPSTREAM SUBMITTED**. User instruction 2026-11-06 11:40:53 Europe/Dublin requests a complete handoff usable in another chat or T2/T3 Code, with **DeepSeek as orchestrator**, model routing/escalation decided by manager, and a **durable decision ledger**. The user wants *cooperative testing* with existing upstream contributors, not a competing implementation. +**Governing:** [Coordination/Handoff Protocol](../../02_COORDINATION_HANDOFF_PROTOCOL.md), [Current State](../../01_CURRENT_STATE.md), [manager handoff](../../OVERALL_MANAGER_HANDOFF.md), [DeepSeek template](DEEPSEEK_ORCHESTRATOR_HANDOFF_TEMPLATE_V1.md). +**Public upstream PR:** https://github.com/pingdotgg/t3code/pull/28777 — **"fix(orchestrator): clarify resuming interrupted delegated reviews"**; related external issue linked from PR; **not** the local Runtime continuation/D4 feature. +**Our public cooperative contribution:** https://github.com/pingdotgg/t3code/pull/28777#issuecomment-6616620085 ; test-only patch: https://github.com/jermur788/t3code/blob/research/pr-28777-continuation-regression-20261103/docs/orchestration-v2/research-pr28777-original-interrupted-corrected.patch ; original verification: https://github.com/jermur788/t3code/blob/research/pr-28777-continuation-regression-20261103/docs/orchestration-v2/research-pr28777-local-verification-results-20261103.md . + +## 1. Verified public research checkpoint (refresh before acting) + +- Manager's 2026-11-06 GitHub connector read: **PR #28777 OPEN / UNMERGED**, 7 changed files, head on author's existing `fix/resume-interrupted-review` branch; API reported **`mergeable_state=dirty`**, indicating conflicts *at that read*. Its base/head may change again. **Maria's earlier "no conflicts" was true for an earlier point in time, not a permanent state.** Do not invent conflicting file names from the API alone. +- The existing PR changes **model-facing instructions** rather than orchestrator runtime lifecycle: `packages/provider-core/src/server/orchestrationInstructions.ts` and tests; `apps/server/src/mcp/toolkits/orchestrator/tools.ts` and instruction tests; `docs/orchestration-v2/orchestrator-mcp-server.md`; `evals/mcp-tool-use/cases/orchestration.ndjson`; `apps/server/src/provider/agentContextBudget.json`. +- The distinction in the PR: **resume interrupted unfinished work** by `t3_thread_send` in the existing child conversation (or remote child address), **new independent review/re-check** via fresh `delegate_task`; pending question vs `pendingApproval` must not be conflated. Main product intent remains unchanged. +- Maria's [reply](https://github.com/pingdotgg/t3code/pull/28777#issuecomment-6637277589) said current main had been merged into the PR without rebase; both eval cases preserved; context budgets below main; `vp run check:changed` and all 28 hosted checks passed then. Her [review reply](https://github.com/pingdotgg/t3code/pull/28777#discussion_r4487097364) confirmed **no agent-context-increase label is required** at that specific head, and CodeRabbit withdrew its label request. **Do not repeat those past results as tests of a future conflict-resolution head.** +- PR author [acknowledged our separate 34-test regression and patch](https://github.com/pingdotgg/t3code/pull/28777#issuecomment-6618573858), but the manager independently checked the current PR diff AND `DelegatedCompletionDelivery.test.ts` at the head: our `original-interrupted` test case **was not present**. No maintainer rejection/objection has been established. +- The patch verifies **stable behavioral invariants**: original delegated task remains interrupted; continuation creates a distinct follow-up task/run in the SAME child thread; replay of identical orchestration command ID is idempotent; correct committed parent-wake cohort refers to follow-up; restart/recovery does not duplicate tasks or context transfers. **It does NOT verify end-to-end MCP `clientRequestId` replay, provider-native session retention or live model tool choice.** Avoid inflating claims. +- Distinct from unrelated upstream PRs and fork PR #20/#21. Keep fork PR #21 private evidence completely untouched. + +## 2. Goal, tasks and delivery boundaries + +**Deliver one reviewable cooperative contribution package, not a competing upstream PR:** + +**A — Current conflict diagnosis (read-only first).** Re-fetch PR head/base mergeability and *exact* upstream main; examine Git merge-tree in a **NEW isolated throwaway local worktree** or equivalent read-only Git index. Identify actual conflicting paths/hunks, attribution to upstream changes vs our fork, and whether branch advanced during study. Do not guess the conflict from CodeRabbit comments or old merge checks. Produce minimal conflict resolution **as an isolated candidate/patch**, preserving PR author's branch and existing guidance/eval intent. If the PR becomes mergeable/merged while working, cease conflict-repair and report current state; avoid needless changes. + +**B — Cooperative regression test adaptation.** Port the existing **test-only** `original-interrupted` patch to the PR's *current* source under the isolated test lane. Preserve stable, externally relevant assertions; if an internal assertion overfits implementation, separate essential contract from optional detail. Demonstrate **red-before** on a codebase where missing/wrong behavior is observable if feasible; otherwise clearly document why it is a *preventive regression* that passes already-correct production code. Do not artificially break runtime code or weaken tests to demonstrate red. Verify at least the old 34-case focused completion-delivery suite, current affected-package typecheck and changed-file lint/format; widen tests for touched instructions/evals and entire PR merged candidate as feasible. Record exact commands, exit codes, source refs and environment. Run tests on the **exact candidate after applying all relevant merge-conflict resolutions**, not only a stale source snapshot. + +**C — Independent review and author-ready package.** Review the isolated diff with a **different provider/model from writer**, read-only. Check upstream compatibility, preservation of the PR's narrow instructions, regression behavioral relevance, no duplicate testing or patch accidentally rewriting main, privacy, disabled provider side effects, and whether test belongs in this PR versus separate follow-up. Address routine findings in at most 2 bounded repair/review cycles. Produce: (1) conflict hunk-by-hunk rationale and minimal patch/commit reference; (2) optional self-contained test-only patch against author PR; (3) review and test ledger; (4) a **short respectful proposed message** for existing PR author offering these as optional, no insistence on merging test as a blocker. **Draft only; do NOT post public comments, push to upstream, open a competing PR, or modify the author's branch without explicit user approval.** This final public-coordination decision is reserved for user. + +**Out of scope:** new Runtime/D4 architecture, automatic continuation product integration, overwriting Stage U/R/H trials, improving unrelated PRs, rebuilding whole fork main, public Git operations, live provider SDK calls requiring material costs, default-on continuation, production enablement or relaxing task security/permission instructions. + +## 3. Preflight and owned execution lane + +1. Read Project Instructions → Current State → Coordination Protocol → this packet → actual Runtime and authoritative handoff. Reconcile public PR state and latest fork branch; distinguish source behavior from review comments/worker claims. +2. Confirm exact repo/remotes, existing dirty work, branch/worktree list, source commits and owners, no overlapping writer, disk capacity, and provider subscription availability. **Do not touch primary checkout, stale local main, fork main, local U/R/D4 worktrees, four Stage 2 detached worktrees, read-only Files mount, or PR #21 private evidence**. No stash/reset/clean/force push/rebase shared history/worktree deletion. +3. Create a *new* uniquely named, separately owned **isolated conflict/test worktree** from a newly fetched **exact upstream PR head**, with remote upstream-main ref and distinct temporary test state. Run `git merge-tree`/equivalent before writable source changes. Allow **local-only** branch commits and patch files for reproducibility; no remote publish. +4. If upstream PR moves, record source drift. Do not silently overwrite or force-update author's head. Re-evaluate current merge/conflict relevance once at the end and record stale-candidate caveat. + +## 4. Provider choice and escalation — authorized bounded routing + +- **DeepSeek V4.1 Flash**: **orchestration ONLY**, not shell/code editing/testing/independent review. Select, brief, supervise and review evidence; update Runtime/ledger before each dispatch and after each outcome; keep one writer. +- **Initial technical writer: Codex GPT-6.1 SOL Medium** (best fit for Git merge-tree diff, source-level regression adaptation and targeted tests), using an available subscription on the user's T3/OpenCode host. If Codex unavailable, **Claude Sonnet 5.5 Medium** may implement. Do not presume any subscription quota/reset; use observed available/unknown status. +- **Independent READ-ONLY reviewer: Claude Sonnet 5.5 Medium if Codex writes; Codex GPT-6.1 SOL Medium if Claude writes.** A second subscription of the same Claude vendor does **not** satisfy the stronger independent cross-provider convention for this project. Reader must see the exact immutable final candidate and actual test logs, not only worker prose. +- **Escalation:** The user explicitly delegated **model selection and justified escalation for this task**. Use **Claude Opus 5.5 Low/Medium** only for a genuinely difficult, unresolved merge/integration or authorization/concurrency issue after two materially different evidence-led remedies, or if other authorized workers cannot safely solve it. DeepSeek records why less costly approaches failed and obtains a different-provider Codex independent review of any Opus-authored resolution. Opus is **not** the first resort for a 7-file docs/instructions PR. Subscription-included model dispatch is within this user routing permission; **material paid API spending/infrastructure remains a user decision**. No unannounced paid bypasses. +- **Bounded attempt limits:** up to **2 repair/retest/re-review cycles per isolated candidate**, with actual per-subscription capacity/quotas, cost/UNKNOWN and resets logged. If no independent review is possible or source/authority conflict material, stop; do not substitute worker claim for verified PASS. Keep this task's routing budget separate from the prior overnight U/R/H dispatch cap (different user-authorized task), but report exact number of new technical/reviewer dispatches; don't claim reset of real subscription quotas. + +## 5. Mandatory durable decision ledger and evidence + +**Before each planned dispatch/switch/repair/reviewer assignment:** append a durable entry to **T3 Project Runtime task/attempt/handoff/routing state if available**, else **a restricted append-only local task ledger** in a newly owned evidence directory outside code worktree. Fields: timestamp UTC; task/stage; decision and considered alternatives; owner/source base; provider/model/subscription alias; **requested vs effective effort**; quota/cooldown/reset *observed or UNKNOWN*; reason/model fit; review independence; scope; next gate. Verify write succeeded. + +**After every outcome:** append actual provider/model/effective effort, command/test exits, source/diff refs, failure/rate limit, correction/review outcome, quota impact, next authorized action; distinguish dispatch from same-lane continuation and historical reconstructions from contemporaneous entries. **No durable writable ledger → STOP before the next technical dispatch (`OPERATIONAL BLOCKER`)**. Do not keep project routing truth only in a chat. Never upload private provider/account/evidence logs, tokens or PR #21 artifacts into public GitHub. + +Stage promotion requires source/diff inspection, reproducible test evidence, independent review, resolved material findings, ledger continuity and clear `IMPLEMENTED / STATIC PASS / RUNTIME PASS / REVIEW PASS` statuses, not just DONE. + +## 6. Stop conditions and final expected handoff + +**Stop immediately** for unresolved security/architecture conflict, materially changed PR intent, need to edit authorization/runtime behavior, unverified test failure/review finding, exceeded bounded repair cycles, inaccessible local worktrees or provider capacity, public source action or material paid cost. If public author prefers a separate follow-up PR or declines test, present that as a collaborator choice rather than trying to force our test into #28777. + +**Required final:** `VERDICT / PR HEAD & BASE / CURRENT MERGEABILITY / EXACT CONFLICTED PATHS + RESOLUTION PATCH / REGRESSION PATCH/TEST ASSERTIONS / RAW TEST COMMANDS+EXITS / INDEPENDENT REVIEW / ROUTING LEDGER+QUOTA+ESCALATION / PUBLIC COMMENT DRAFT / SOURCE DRIFT / RISKS/OPEN QUESTIONS / NEXT USER DECISION`. Attach or reference complete diff and test log **by path/ref** in owned local evidence; don't paste long logs in chat. Keep candidate **ISOLATED / NOT UPSTREAM SUBMITTED / NOT MERGED**. Even a green candidate does not authorize Git push, review thread edits or posting public comments. + +**Execution:** This packet is a durable handoff only. ChatGPT has **not dispatched** a local DeepSeek/T2/T3 Code worker; copying this instruction to an agent-capable session is required unless a verified bridge exists. diff --git a/docs/orchestration-v2/task-verify-reconciled-v017-before-main-20261104.md b/docs/orchestration-v2/task-verify-reconciled-v017-before-main-20261104.md new file mode 100644 index 0000000000000..6606041cdef08 --- /dev/null +++ b/docs/orchestration-v2/task-verify-reconciled-v017-before-main-20261104.md @@ -0,0 +1,46 @@ +> **CURRENT AUTHORITY UPDATE — draft PR already opened, 2026-11-04:** The user approved and the manager created [fork-only draft PR #21](https://github.com/jermur788/t3code/pull/21). It is OPEN / DRAFT / UNMERGED. This task is still authorized **for verification only**. Do **not** open another PR, ask again for draft-PR permission, merge PR #21, or edit fork main. Later **merge approval** remains separate. Follow [current state](../../01_CURRENT_STATE.md) and [manager handoff](../../OVERALL_MANAGER_HANDOFF.md) if any older line below conflicts. + +# T3 Code — independent pre-main validation of accepted v0.1.7 reconciliation + +**Issued:** 2026-11-04 by Overall Manager, under authorized bounded verification. +**Verdict required:** independently inspect and run the missing UI, restart, cross-project and Evidence V0 checks **without altering the accepted candidate branch or fork main**. Stop for user decision on any material fix or product behavior change. +**Manager review:** [Manager acceptance with precise evidence limits](manager-fork-upstream-reconciliation-acceptance-20261104.md). +**Candidate:** `jermur788/t3code`, branch `integration/fork-upstream-reconciliation-trial-20261104` at its current *accepted* checkpoint. Freeze and record actual remote head before running. +**Worker:** independent capable local T3 Code verification worker; DeepSeek/OpenCode for test/runbook and low-cost local checks. Stronger model for hard security/integration analysis if a reproducible defect appears. Never let implementing conflict resolver self-certify its own fix. + +## Preflight and authority +1. Fetch fork main, candidate branch and pinned upstream v0.1.7, inspect status, active workers, branch/worktree ownership, latest remote heads, no unrelated dirty files. User has NOT approved merge or opening new PR. +2. Confirm space with `df -h` before installs/builds; previous local report: 48 GB free on root, 92 GB external, but live capacity must be rechecked. +3. Use a **fresh, owned, read-only or disposable external-volume worktree** from exact accepted candidate head. Existing reconciliation/gate worktrees and main stay intact. No reset, stash, force-push, destructive cleanup or overwriting another writer. +4. Prove available test and browser harness. Persist actual routing decisions, candidate/rejected models, host liveness, attempts, commands/exits and handoff in T3 Project Runtime if available; otherwise isolated appended ledger file. No fabricated cost/quota. + +## Verification queue (serial) + +### V1 — UI render inspection +- Start local app/dev server in a safe isolated mode; do not invoke real provider model calls. Inspect **rendered** web routing for both fork `/_chat/home` and upstream `/threads/$environmentId/$threadId` (use known fixture/mock route parameters). Capture screenshots or a reproducible screenshot/console log path, and check initial navigation/back links, error boundaries and console errors. +- Include the rendered layout when route registration or context is relevant. A successful Vite build alone is **STATIC PASS, not UI VERIFIED**. +- If browser runtime unavailable, report operational blocker and preserve evidence; do not fabricate screenshots. + +### V2 — restart and project isolation +- Run or add **verification-only** deterministic, non-production SQLite fixture tests of fork Project Runtime across process/layer restart with two projects. Confirm project A receipts/handoffs/routing do not affect B, and pending receipt behavior remains idempotent under upstream V2 recovery changes. Do not turn on synthetic continuation gate—it is not in the reconciliation branch. Use stubbed providers, fresh file-backed SQLite and documented receipts. +- Inspect actual `Orchestrator`, `ThreadManagementService` and recovery path changes from upstream. If tests do not exist, document the exact coverage gap and propose minimal test-only packet rather than changing production code under this task. + +### V3 — Evidence V0 after pruning +- Reproduce a supported event-history pruning/recovery scenario in isolated test SQLite; verify fork Evidence V0 reconstruction/export semantics and correct failure when source event history is genuinely absent. A worker claim or unit test unrelated to pruning is insufficient. +- If the new upstream internals changed the contract, classify **UPSTREAM COMPATIBILITY** and return a source-backed failing reproduction. Do not invent a migration or second event store. + +### V4 — final bounded static/CI-equivalent checks +- Rerun target suites affected by any benign test-fixture changes, and `vp run typecheck`, `vp run check:changed upstream/main`, context budget test, and UI/web build as needed. Record exact commands, exit codes, counts, measured tool-list bytes and which baseline was used. The accepted branch's initial local record was green, but this independent run establishes any new evidence. +- Inspect GitHub-hosted CI availability. At manager review the branch head had **zero check-runs/status contexts/workflow runs**. Do not label missing CI as passing or failing. +- No paid provider or live API tests. T3 may use existing local model routing for workers; log actual provider/model and separate model execution from app-under-test providers. + +### V5 — independent acceptance & durable handoff +- Have a reviewer from a different provider/model assess test evidence and relevant source when results materially change confidence. Do not conflate local verification success with production VERIFIED. +- Return: VERDICT by V1–V4, BASE/WORKTREE/OWNERS, actual route/attempt decisions, tests and UI image/log evidence paths, defects/classification, independent review, repo state, NEXT, and explicit **NOT INTEGRATED**. +- Do not amend/commit/push to accepted integration branch unless separately approved; for any discovered test-only changes use a separate isolated verification branch with one writer and return a diff for manager review. + +## Stop conditions +No fork main update, draft PR, public upstream action, production continuation activation, changing provider/session/orchestration event semantics, new migrations/authority state, paid infrastructure, destructive Git commands, or cleanup of existing worktrees. Any substantial code change requires a separate bounded task and independent review. + +## Expected manager next step +After evidence returns, manager updates candidate acceptance/risks. User approval is still needed to create the recommended **fork-only draft PR** or to promote branch to main directly; neither is authorized by this handoff. Public D2 shipping exclusion and D4 strict revocation remain separate release gates. diff --git a/docs/orchestration-v2/upstream-catchup-isolated-trial-governing-spec-20261105.md b/docs/orchestration-v2/upstream-catchup-isolated-trial-governing-spec-20261105.md new file mode 100644 index 0000000000000..6949fbebad781 --- /dev/null +++ b/docs/orchestration-v2/upstream-catchup-isolated-trial-governing-spec-20261105.md @@ -0,0 +1,70 @@ +# Governing spec — isolated upstream T3 catch-up trial after D4 A+B + +**Authority:** Explicit user reply **"auth"**, 2026-11-05 22:14 UTC, accepting [option 1: upstream-first bounded isolated trial](manager-post-d4-integration-options-20261105.md). +**Status:** **U TRIAL COMPLETED (worker-reported) / STATIC PASS WITH WRAPPER TIMEOUT CAVEAT / BOUNDED RUNTIME PASS / REVIEW PASS / NOT INTEGRATED**. [Manager returned U qualification](manager-upstream-trial-return-reconciliation-20261106.md). Overnight G-U **TECHNICAL GATE CONDITIONALLY ACCEPTED, ROUTING-LEDGER HOLD** pending durable verification under user-mandated §6.1. The original pre-dispatch plan below is historical. **OVERNIGHT AMENDMENT ACTIVE:** [2026-11-06 conditional U→R→H delegation](overnight-conditional-autonomy-amendment-20261106.md) adds limited downstream **local-only** stages after objective gates, superseding this document's earlier unconditional stop-after-U instruction. No main merge, push, release or production authority. +**Classification:** user-accepted governing scope and acceptance criteria, NOT authority to push, PR, merge fork `main`, re-land continuation, release or deploy. +**Companions:** [Current State](../../01_CURRENT_STATE.md), [Coordination/Handoff Protocol](../../02_COORDINATION_HANDOFF_PROTOCOL.md), [D4 K1/K2 review](manager-d4-full-root-k1-k2-verification-reconciliation-20261105.md), [post-D4 integration options](manager-post-d4-integration-options-20261105.md). + +## 1. Authorized outcome and boundaries + +Bring **current upstream T3 main** into a **new owned local trial branch/worktree based on the *integrated fork main***; resolve routine local conflicts **without changing fork main**, then run scoped verification and independent read-only review. Local commits on **only this new trial branch** may be made if needed to preserve a reproducible candidate. A local upstream merge into the trial branch is allowed; an upstream merge **into fork main** is not. Do not force/rewrite shared history. + +This task **does not include** importing/rebasing the old divergent continuation experiment, the unpushed D4 A+B implementation, new Project Runtime behavior, D2 schema projection implementation, production deployment, upstream submission or a public/source push. The trial is an **upstream baseline qualification** only; D4 remains preserved in its private isolated worktree and K3 remains PARTIAL. + +**Acceptance result:** a candidate isolated branch/worktree that preserves accepted fork-specific Project Runtime and P2 Evidence V0 behavior while incorporating the selected exact upstream tip, with reproducible tests and independent review. **PREVIEW, STATIC PASS, RUNTIME PASS and REVIEW PASS are separate evidence statuses.** No `INTEGRATED` status until a future separately approved fork-main merge and integrated-head verification. + +## 2. Source checkpoint and change risk (dated, refresh at execution) + +**Browser independently inspected on 2026-11-05:** +- Fork `jermur788/t3code` main: `fb67545d790c5c001e8f85827f219ab6493c435e` (PR #21 integrated). +- Upstream `pingdotgg/t3code` main: `25b53299b75d4d8d1d0667ad47e9cfed3749776e`. +- Incorporated upstream release-preparation parent: `bb4afa5425c52104a9261fa2d022cb8ba2fcc099`. +- Upstream comparison reports **91 commits ahead**, including **41 new since prior Stage 2 snapshot**; GitHub compare returned the **first 300 changed paths** only. Obtain **complete** exact diff with local Git before implementation. The previous Stage 2 dry-run merge conflict counts reflect an *older* upstream head and are **not usable for acceptance**. +- Latest source hotspots: `apps/server/src/orchestration-v2/Orchestrator.ts`, `ProviderTurnStartService.ts`, provider adapters (especially Claude/Codex), `ProjectionStore.ts`, `ThreadLaunchService` tests, `apps/server/src/mcp/OrchestratorMcpService.ts`, `packages/contracts`, `packages/shared/src/nodeSqliteClient.ts`/persistence. `EventSink.ts` and `ThreadLaunchService.ts` matched upstream in earlier checkpoint, but revalidate on actual new upstream tip. + +**Fork-specific protected areas:** provider-neutral Project Runtime schema/services and persistence, task/attempt/handoff and routing, development modes/profiles, private/internal operator auth, Evidence V0 old-decoder coordinated upgrade limitation accepted for fork only, upstream-compatible thread/worktree/session lifecycles. Use accepted specs and current repo tests as authority; do not silently drop/replace fork-only migrations or alter Evidence V0 completion semantics. + +## 3. Preflight and worktree safety — before first write + +1. Read Project Instructions → [Current State](../../01_CURRENT_STATE.md) → [Coordination Protocol](../../02_COORDINATION_HANDOFF_PROTOCOL.md) → this governing spec → latest Runtime active tasks/handoffs and local host ledger. Confirm exact repo/remotes, all worktrees, branches, upstream/fork bases, task owners, dirty/untracked files, available disk and permissions. +2. Do **not** update existing stale local `main`, primary development-profiles checkout, four detached Stage 2 verification worktrees, or local unpushed D4 branch/evidence. PR #21 original/sanitized evidence remains **KEEP PRIVATE**; do not copy, read, upload or delete. Do not remount/unmount the read-only Files volume. +3. Fetch upstream/fork remote tracking refs only (non-destructive). If upstream has advanced, report both requested and selected exact tips; use current upstream unless changed source introduces a material security/architecture conflict. **Create a NEW uniquely named local branch/worktree from verified fork-main commit**, not by merging/rebasing any existing dirty worktree. One writer; isolated caches/state/test DB. +4. Check disk capacity and provider subscription availability before expensive builds. If local worktree cannot safely be isolated, report `OPERATIONAL BLOCKER`; no stash/reset/clean, force-push, branch deletion or history rewrite. + +## 4. Bounded implementation method + +1. **Provenance/rebase screen:** produce complete paginated/locally generated upstream commit and changed-path inventories. Distinguish merged upstream code from open PR proposals and fork-only state. Recompute conflict set with `git merge-tree`/equivalent on exact refreshed refs. Record material source/rebase hotspots and which old research counts are obsolete. +2. **Upstream trial on new owned branch only:** attempt upstream integration locally with reproducible non-destructive Git steps; resolve routine conflicts using upstream-compatible interfaces and preserve fork-specific Project Runtime, Evidence V0 and development profile/mode semantics. No direct checkout/reset of primary/stale `main` and no force operations. Local trial commits permissible; no push/PR. +3. **Architecture safety:** prefer existing upstream abstractions and isolated fork extensions. **STOP / REVIEW REQUIRED** if upstream has changed provider/orchestrator/session Git/worktree or DB authority such that accepted Runtime or Evidence semantics cannot be preserved without new architecture, significant core rewrite, new durable authority/migration, credential/security bypass or scope expansion. +4. **No continuation re-land:** Do not copy files/commits from `experiment/continuation-default-off-gate-20261104` or `d4/ab-revocation-guard-20261105` into the new trial. D4 K1/K2 remain qualified only on their original local branch. D2 shipping schema exclusion remains outstanding if any experimental feature is later reintroduced. +5. **Record exactly what was merged:** upstream provenance, any resolved conflicts, temporary changes, local commits on trial branch, all remaining divergences, and discarded or deferred changes. No silent acceptance of upstream breaking an accepted behavior. + +## 5. Acceptance and verification matrix + +**Static:** complete typecheck/format/lint/check:changed as applicable; focused server/web/contract/database tests and provider adapter tests for touched paths. Re-run failed tests after legitimate fixes; never weaken them simply to pass. Record all commands/exits and any unsupported test mode. + +**Runtime:** verify Project Runtime task CAS/revision/provenance, project isolation, task attempts and handoffs across normal restart/reload; Evidence V0 old-decoder fork limitation and misleading completeness prevention; ordinary thread/run/command receipt/idempotency and provider-neutral two-provider stub paths where practical. If upstream touches UI, inspect actual rendered UI after building. Verify default-off experiment isn't accidentally in new trial and D2 agent-facing continuation schema doesn't leak. + +**Compatibility:** compare relevant source/behavior with latest upstream, verify no fork-only regressions, record upstream issues/PRs that are **open proposals** separately from merged source. If full end-to-end provider or app-level MCP cannot run due to existing no-cost credential constraints, mark `OPERATIONAL BLOCKER` with exact reason; no fake PASS. + +**Independent review:** other authorized provider/model from implementer, **READ-ONLY**; specifically audit preservation of Runtime, Evidence V0, client modes, DB changes, receipt semantics, upstream rebase hotspots, accidental continuation import and test adequacy. Repair/re-review routine defects within bounded scope. Stop for material unresolved conflicts and ask owner rather than inventing decisions. + +**Completion states:** `IMPLEMENTED` local trial branch only; `STATIC PASS` on actually executed checks; `RUNTIME PASS` on demonstrated behavior; `REVIEW PASS` after independent review; **NOT INTEGRATED / NOT VERIFIED PRODUCTION** until future independent fork-main merge/release steps. + +## 6. Routing / custody / stop conditions + +**DeepSeek V4.1 Flash** orchestration-only: routing, task/ledger state, capacity watch, verification triage. No direct source writes, shell execution, code review or technical tests by DeepSeek. **Codex GPT-6.1 SOL Medium OR Claude Sonnet 5.5 Medium**: single technical writer/tester using actual available subscription; independent different-provider/model read-only review. **Opus** only for truly difficult unresolved security/concurrency architecture with explicit approval; no paid API calls. Record actual model/effort/quotas/reset or `UNKNOWN` and provider error/failover per attempt. At last report Codex A exhausted until 2026-11-08 21:15 UTC; Claude accounts rate-limited; Codex B had demonstrated review capacity but remaining allowance UNKNOWN—**re-measure, do not presume**. + +**Hard stops:** Git push, PR, merge into fork `main`, upstream publication, experimental continuation/D4 re-land, production enablement, public shipping, major provider/orchestration redesign, new authority DB, destructive worktree cleanup, paid-resource cost, credential bypass, changes to PR #21 evidence or user-owned branches. The user's "auth" applied **only to this bounded trial**. + +**Handoff:** update Runtime task and complete durable record when available, else restricted append-only local ledger, then return **VERDICT / BASE & OWNERSHIP / EXACT UPSTREAM TIP / CHANGED PATHS & CONFLICTS / LOCAL TRIAL COMMITS/FILES / TEST COMMANDS & RESULTS / RUNTIME PERSISTENCE & EVIDENCE CHECKS / INDEPENDENT REVIEW/REPAIRS / MODEL/QUOTAS / RISKS/BLOCKERS / INTEGRATION STATE / NEXT DECISION**. Continue routine repair/review within scope; **do not proceed automatically into continuation re-land or fork main merge**. + +**Initial:** `AUTHORIZED / SPEC ACCEPTED / TASK TO BE DISPATCHED VIA LOCAL T3 CODE / NO VERIFIED AUTOMATIC BROWSER-TO-LOCAL WORKER BRIDGE`. + +## 2026-11-06 overnight conditional-authority amendment (latest user intent) + +The user separately authorized conditional continuation **U → R → H**, only on each independently verified pass and only in new isolated local branches, in [the binding amendment](overnight-conditional-autonomy-amendment-20261106.md) with [complete T3 Code paste-ready handoff](handoff-overnight-autonomous-orchestrator-20261106.md). Any older clause in this document saying "stop after U" or "separate permission for ALL isolated re-land" is superseded **only for the gated local-only R/H prototypes**, not for fork-main integration, Git push/public PR, paid-provider work, release, production, destructive Git or new architecture. G-U failure always stops next-stage progression. No local T3 Code dispatch has been started by browser. + +## 2026-11-06 completed isolated U trial — superseding state + +The U candidate was created on a clean local-only worktree and separately reviewed; 367 affected test files passed in 29 batches, but monolithic `check:changed` hit its 900s ceiling, so it is **not a single green command**. No public source was pushed and no merge into fork main occurred. [Manager U reconciliation](manager-upstream-trial-return-reconciliation-20261106.md) accepts this bounded local trial evidence and preserves coverage gaps. **G-U next-stage advancement is on a routing ledger hold** because the report links a private local ledger without proving the user's required per-dispatch decision records. The [coordination-only ledger audit handoff](handoff-upstream-to-r-routing-gate-20261106.md) must run before any R technical worker dispatch. The overnight conditional R/H local-only authority remains adopted but unexercised; no automatic upstream refresh beyond the frozen U source tip. diff --git a/docs/orchestration-v2/upstream-contribution-triage-20261103.md b/docs/orchestration-v2/upstream-contribution-triage-20261103.md new file mode 100644 index 0000000000000..882e5689e5634 --- /dev/null +++ b/docs/orchestration-v2/upstream-contribution-triage-20261103.md @@ -0,0 +1,67 @@ +# Upstream contribution triage — T3 Orchestration V2 + +Date: 2026-11-03 +Status: READ-ONLY SOURCE TRIAGE / NO EXTERNAL UPSTREAM ACTION / NO CODE CHANGE +Owner: Overall Manager in browser +Source of authority: T3 Fork accepted product direction, Current State, source inspection; not a new product decision. + +## Aim + +Reduce T3 Fork's ongoing divergence and total maintenance by contributing **small, independently useful upstream bug fixes** that are relevant to our project. Do **not** recreate accepted upstream services in the fork, open duplicate PRs, or assume an issue's closed status is verified resolution. + +Upstream contribution requirements: [CONTRIBUTING.md](https://github.com/pingdotgg/t3code/blob/main/CONTRIBUTING.md). The project does **not** actively solicit large outside contributions. Focused obvious bug fixes may be submitted without a discussion; larger behavior changes require a triaged issue or explicit maintainer approval. One underlying defect per PR. Provide exact reproduction, narrowed tests, observed before/after evidence, and relevant UI evidence where required. Do not claim maintainer acceptance from an issue or from reviewer tests. + +## High-value upstream overlap as of 2026-11-03 + +| Defect / value | Live proposal status | Best contribution rather than duplication | +|---|---|---| +| Explicitly resume an interrupted delegated review instead of launching a replacement (saves tokens and preserves context) | [Issue #28734](https://github.com/pingdotgg/t3code/issues/28734) OPEN; [PR #28777](https://github.com/pingdotgg/t3code/pull/28777) OPEN, unmerged. Patch clarifies `t3_thread_send` vs `delegate_task`, docs, and prompt-string tests. PR author says live model evals not run. | **Priority 1: independent review of existing PR**. Check the code's actual interrupted-thread outcome, child-task follow-up ownership and `taskId` delivery; propose behavior/replay negative tests. Static string assertions alone don't prove that a model chooses the correct tool or that runtime will deliver the result. Avoid a duplicate patch. | +| Sibling delegated-completion wakeup lost if another wake is interrupted | [Issue #28175](https://github.com/pingdotgg/t3code/issues/28175) OPEN; [PR #28204](https://github.com/pingdotgg/t3code/pull/28204) OPEN, unmerged, 2 files; author includes replay tests and desktop before/after recordings | **Priority 2: independent source/replay review** for sibling delivery, Stop semantics, wake generation idempotence and ordering. Do not add a competing implementation or change T3 fork's event graph. | +| A nested delegated task finishes after its parent child-run, but follow-up reports stale result early | [PR #21877](https://github.com/pingdotgg/t3code/pull/21877) OPEN; reported targeted tests. Distinct original-task race [issue #24297](https://github.com/pingdotgg/t3code/issues/24297) OPEN has [PR #24391](https://github.com/pingdotgg/t3code/pull/24391) OPEN | **Priority 3: independent crash/race review** on existing PR(s); trace `delegatedTaskId`, nested child waits, terminal receipt, and delivery once. Test queued, failed-start and duplicated wake cases. | +| Antigravity parent never resumes after background child completion; paragraph streaming stalls | [Issue #30082](https://github.com/pingdotgg/t3code/issues/30082) OPEN; [PR #30083](https://github.com/pingdotgg/t3code/pull/30083) OPEN, unmerged; narrower [PR #28221](https://github.com/pingdotgg/t3code/pull/28221) OPEN | Follow active work and offer focused verification only with an environment capable of authentic Antigravity tests. Beware overlapping changes across multiple PRs; avoid claiming a single fix covers all symptoms. | +| User steering a waiting `delegate_task` loses the child's completion | [Issue #27362](https://github.com/pingdotgg/t3code/issues/27362) OPEN; [PR #27387](https://github.com/pingdotgg/t3code/pull/27387) OPEN | Lower immediate priority than above; test and review if our actual use reproduces. | +| Cross-project delegated execution in the same local environment | [PR #28859](https://github.com/pingdotgg/t3code/pull/28859) OPEN, unmerged. This is an extension, not an established bug correction. | Monitor upstream for acceptance, consume if merged and verified. Do not pitch as an unsolicited generic upstream feature without maintainer approval. | + +Related [issue #17412](https://github.com/pingdotgg/t3code/issues/17412) is CLOSED for missing detail despite later reproduction comments and current PRs; this closure is not proof of fix. + +## First review target: interrupted delegated reviews + +**Base:** Always refresh upstream main and PR head before review. Current PR #28777 patch modifies injected orchestration instruction, tool description, docs, two instruction-focused tests, one model-eval case and context size budget; no provider/runtime scheduler fix. Its model eval is not claimed to have run. + +**Question:** Does the wording accurately distinguish (a) genuinely independent review/re-check that must get a new child, (b) explicit user-requested continuation of an interrupted/paused child preserving its existing thread, and (c) an active pending approval/question that needs direct response, *without* silently changing task ownership or creating duplicate completion delivery? + +**Browser review steps:** +1. Read [source instructions](https://github.com/pingdotgg/t3code/blob/main/packages/provider-core/src/server/orchestrationInstructions.ts), the [PR diff](https://github.com/pingdotgg/t3code/pull/28777/files), the [tool's command specification](https://github.com/pingdotgg/t3code/blob/main/apps/server/src/mcp/toolkits/orchestrator/tools.ts), `OrchestratorMcpService` follow-up binding and `Orchestrator` completion/wake semantics. +2. Check that PR documentation does not falsely imply that resuming an interrupted *task* reopens the same task ID: it opens a new run in the same thread with preserved conversation context. Describe if the resulting parent-task identity or completion wake is different. +3. Identify deterministic regression tests that do not require paid tokens or an account: interrupted child with previous history; explicit continuation; current/future `hasPendingQuestion` / `pendingApproval`; a genuine second independent review; duplicate `clientRequestId`; stale/cancelled task state; failed follow-up; provider unavailable. +4. If the patch is correct but lacks behavioral evidence, suggest a **test-only contribution to existing PR author/maintainer** instead of reopening the whole problem. Do not post unsolicited comments or open PRs until the owner explicitly approves public outreach. +5. Only after a clear gap is established, request approval for a focused upstream contribution with the minimal diff and reproduction. No generated changes to `main` or production until separate verified code path. + +## Separate, potential new upstream issue + +The user's reported DeepSeek run displayed stale `Task 1 of 12` while execution continued. This is **not yet an upstream-reproduced defect** because it may be an agent-authored stale plan, provider behavior, or the presentation layer. Research source and event timeline before filing; distinguish app-owned run progress, agent-authored plans, and independent verified result. No claim of stale plan as a proved upstream T3 bug. + +## First-pass review of PR #28777's behavioral seam (source inspection) + +- The patch changes [orchestrationInstructions.ts](https://github.com/pingdotgg/t3code/blob/main/packages/provider-core/src/server/orchestrationInstructions.ts) and the `t3_thread_send` tool description rather than the execution engine. It adds prompt-string tests and a tool-use eval fixture; the PR authors' note says the live model eval was not run. +- [Orchestrator.ts](https://github.com/pingdotgg/t3code/blob/main/apps/server/src/orchestration-v2/Orchestrator.ts) has a `recordSubagentFollowup` path that links a new run in an existing child thread with a new `delegatedTaskId`. Its current [DelegatedCompletionDelivery.test.ts](https://github.com/pingdotgg/t3code/blob/main/apps/server/src/orchestration-v2/DelegatedCompletionDelivery.test.ts) includes follow-up cases (completed/interrupted/failed, overlapping, restart) around the existing mechanism. +- **Narrow remaining verification question:** not whether existing `t3_thread_send` can ever run follow-ups, but whether this exact amended instruction makes the *parent model choose the correct tool* for explicit interrupted-review continuation, as opposed to a new independent review. That needs model-tool-use eval or a recorded before/after provider run and cannot be established by prompt string assertions alone. +- Tool documentation must remain precise that conversation/context resumes **within the same child thread**, but an interrupted original task is not reopened under the same task identity. Results must still be attached to the new follow-up task's lineage and delivered once. +- Any upstream contribution should be framed as **adding missing independent verification to the existing PR**, if evidence identifies a gap. Do not file a duplicate PR or assume its current tests fail. There was no local test or model eval in this inspection. + +## Contribution decision rule + +1. Reproduction and scope first. +2. Existing active PR? **Review/test it**, avoid competing PR. +3. No PR and clearly localized upstream reliability bug? Inspect upstream main and tests. Small fix can be proposed using the focused-bug exception; larger changes need upstream agreement. +4. Is it T3 Fork's authoritative task/decision policy rather than generic execution reliability? **Do not upstream** the opinionated project-manager layer; keep fork additive. +5. Upstream declines to merge? Keep the smallest independent isolated patch in the fork only if needed; record the rebase hotspot and periodically check whether upstream supersedes it. +6. No public PR, issue comment, reviewer submission or disclosure of user/private Runtime data without explicit authorization. Existing accepted project source already establishes generic upstream-first strategy; public outreach remains separate. + +## Actions, status, and handoff + +- SOURCE-INSPECTED: upstream contributing policy; issue/PR current status; selected patches and public test evidence. +- NOT VERIFIED: no local build, branch checkout, model eval, real provider test or new independent test run. +- No main or production code changes, no upstream comments or PR submissions. +- Next browser-safe work: review PR #28777's behavioral seam and any tests it should gain. If reviewer findings require local replay tests, send a bounded test-only task with exact repo, base, scope, acceptance and code owner, not a generic full architecture handoff. +- Operator approval required for upstream public posting, production integration/merges, paid model tests and new architecture scope. diff --git a/docs/orchestration-v2/upstream-pr-28777-behavioral-verification-task-20261103.md b/docs/orchestration-v2/upstream-pr-28777-behavioral-verification-task-20261103.md new file mode 100644 index 0000000000000..62d5b34c86fd3 --- /dev/null +++ b/docs/orchestration-v2/upstream-pr-28777-behavioral-verification-task-20261103.md @@ -0,0 +1,57 @@ +# Upstream contribution task — verify PR #28777, avoid a competing fix + +Date: 2026-11-03 +Status: SOURCE REVIEW COMPLETE / BEHAVIORAL TESTS PENDING / UPSTREAM OUTREACH NOT AUTHORIZED +Owner: browser Overall Manager for source review; separate isolated local T3 Code test worker only for tests if invoked +Upstream repository: https://github.com/pingdotgg/t3code +Existing upstream PR: https://github.com/pingdotgg/t3code/pull/28777 +Issue: https://github.com/pingdotgg/t3code/issues/28734 +Ownership: do not amend someone else's open PR head or create a duplicate submission. + +## Objective + +Determine whether the existing PR successfully teaches parent agents to resume *interrupted unfinished delegated review work* in an existing child thread with `t3_thread_send`, while retaining `delegate_task` for a genuinely fresh independent review. Provide practical missing **test evidence** or a precise code-review finding to the existing author/maintainers only after authorized public outreach. + +## Source-inspected findings (2026-11-03) + +- Upstream [CONTRIBUTING.md](https://github.com/pingdotgg/t3code/blob/main/CONTRIBUTING.md) permits focused obvious bug fixes with evidence. It does not guarantee review or merge; changes to product behavior and substantial scope may require prior maintainer approval. One problem per PR. +- PR #28777 is **OPEN and unmerged** at the source review. It changes [orchestrationInstructions.ts](https://github.com/pingdotgg/t3code/blob/main/packages/provider-core/src/server/orchestrationInstructions.ts), `t3_thread_send` tool description, docs, context budget, prompt assertions and an eval fixture. The PR explicitly says **no runtime lifecycle code was changed**; the author reports focused tests but not a live before/after model eval. +- [OrchestratorMcpService.sendToThread](https://github.com/pingdotgg/t3code/blob/main/apps/server/src/mcp/OrchestratorMcpService.ts) uses stable request-key-based command/message IDs and sends into the existing thread; the returned `taskId` is conditional on a new run being bound to delegated work. +- [Orchestrator.recordSubagentFollowup](https://github.com/pingdotgg/t3code/blob/main/apps/server/src/orchestration-v2/Orchestrator.ts) attaches a **new delegated task ID** to a new run in the old child thread, after finding the original app-owned child and requiring an already-settled original result. It is *not* an in-place reopening of the interrupted original task. The new task's completion should wake the parent independently. +- Existing [DelegatedCompletionDelivery.test.ts](https://github.com/pingdotgg/t3code/blob/main/apps/server/src/orchestration-v2/DelegatedCompletionDelivery.test.ts) has an important table of interrupted/failed/stopped/restarted follow-up results, overlap, repeated recovery and notifications. In the inspected table, the **original child** is seeded as *completed* and the later **follow-up** is marked interrupted/failed/stopped. This does not, by itself, verify the user-reported path where the original review was interrupted **before** the follow-up. Do not claim the scenario is absent from the entire upstream test suite without a full test search. +- PR's model-eval case (and new string tests) demonstrates intended guidance, not measured model tool choice. The author explicitly records an unavailable live model eval. No browser test was run here. + +## Main verification question + +Can `t3_thread_send` from a scoped parent to an **original app-owned child whose review was interrupted and has already settled** create exactly one follow-up task in the same child thread, preserve the previous history and provider session where supported, deliver the terminal result to the parent, and leave the original task terminal/non-reopened? + +If the parent task or child is not truly settled, or a pending request still holds, what exact command does the policy prescribe and what does the runtime accept? Test both rather than assuming the new instruction is always correct. + +## Recommended test matrix + +1. **Original interrupted:** seed original delegated child run as interrupted, reconcile its parent task, send explicit continuation with a fixed `clientRequestId`; assert same `childThreadId`, **new** task ID only if ownership is bound, original task never reopens and exactly one eventual parent completion notification. If no new task is created, record that as a targeted bug/contract gap *not fixed by prompt wording*. +2. **Original completed / new independent review:** establish that the instruction still routes a genuinely independent review through `delegate_task` into a fresh child, and a same-conversation follow-up through `t3_thread_send`. Ensure both remain distinguishable in task lineage. +3. **Pending approval/question:** do not send a new child message that bypasses the pending request; use the documented `t3_pending_request` mechanism, and assert no duplicate dispatch. +4. **Request replay:** retry `t3_thread_send` with the same request key; exactly one new follow-up. Different explicit new user instructions are allowed separate tasks only when authorized. +5. **Runtime negatives:** old child removed/archived, parent permissions changed, task stopped/cancelled, provider unavailable, stale thread lineage. Fail closed; no surprise broad permission or replacement worker. +6. **Agent behavior:** if model test resources become available, run small before/after tool-selection evals using the exact original user prompt and a fresh-review control, label model/provider/context. Do not spend paid tokens or use credentials without approval. + +## Minimal contribution strategy + +1. **Browser source review is done.** Do not create another PR that merely repeats the wording. +2. The local test writer should first check whether the existing suite covers the original-interrupted scenario; add only necessary test cases in a **separate isolated branch** based on upstream main plus PR head/patch, with synthetic orchestration events and no model calls. +3. If tests pass, prepare a concise evidence-backed suggestion for the PR author; offer a minimal *test-only patch* without altering their branch. If tests reveal a runtime gap beyond #28777's scope, record it separately and ask the author/maintainer whether they prefer an issue or new small PR. +4. No public review comment, issue response, PR submission, or push to someone else's branch without explicit user authority and appropriate GitHub identity. +5. Update our fork's source research with findings, but do not cherry-pick this PR into fork main unless its behavior is independently needed and verified. + +## Repo/worktree safety and independent lane + +This work belongs to the **upstream contribution lane**, not the fork continuation spike. Before any local write, inspect actual upstream repo branch/base, dirty status, related uncommitted changes, workers and file ownership. Use a new isolated upstream worktree and a unique T3 home. One writer in this lane. Do not stash/reset, rewrite, force-push or modify the PR author's remote branch. Pin both upstream main and the PR head locally for reproducibility. Respect the upstream [contribution instructions](https://github.com/pingdotgg/t3code/blob/main/CONTRIBUTING.md) including model attribution policy. + +## Acceptance / handoff + +- Existing PR behavior classified as `PASS`, `TEST GAP`, or `IMPLEMENTATION DEFECT` for each case, with exact commands/logs. +- Existing test coverage identified, additions minimal and focused, tests and relevant typechecks pass. +- No unproved claim that model behavior improved; independent prompt/tool-use evals require separately authorized provider access. +- Handoff: reviewed bases, changed files and isolated branch, test commands/outcomes, reproductions, risk, exact proposed feedback, blocker classification, whether a public contribution is worth making, and next action for Overall Manager. +- If upstream merges or supersedes #28777 while reviewing, stop/refresh and retarget evidence rather than pursuing obsolete changes.