Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
3779a73
feat(transcript): implement dedicated transcript protocol for Zoo Cod…
Gh0st352 Aug 23, 2026
a032a4d
Added Chat Output to readme
Gh0st352 Aug 23, 2026
b5d9fee
feat: enhance transcript handling and synchronization in webview
Gh0st352 Aug 23, 2026
11dec87
fix(pre-commit): comment out pnpm lint command
Gh0st352 Aug 23, 2026
49bf624
fix(pre-push): comment out check-types command in pre-push hook
Gh0st352 Aug 23, 2026
58a4158
Delete apply_zoo_code_incremental_transcript_fix.py
Gh0st352 Aug 23, 2026
bb468b2
Delete ZOO_CODE_GRAY_SCREEN_FIX_README.md
Gh0st352 Aug 23, 2026
250d495
Uncomment check-types command in pre-push hook
Gh0st352 Aug 23, 2026
7cdf18c
Uncomment lint command in pre-commit hook
Gh0st352 Aug 23, 2026
dc38597
fix: address memory leak and improve transcript handling in ClineProv…
Gh0st352 Aug 24, 2026
e50a7fe
fix: address transcript synchronization review findings
Gh0st352 Aug 24, 2026
6ddeed2
test: initialize transcript sequence state in provider stubs
Gh0st352 Aug 24, 2026
0dab875
test: exercise edited message submission
Gh0st352 Aug 24, 2026
0d3e655
test: verify transcript republish completion
Gh0st352 Aug 24, 2026
8f16c10
fix(webview): clear focused task without reload
Gh0st352 Aug 24, 2026
c9d6f8b
fix: address transcript streaming review feedback
Gh0st352 Aug 27, 2026
1b4f970
test: align state ordering regression with transcript transport
Gh0st352 Sep 1, 2026
eb33eab
test: cover transcript transport mutation gaps
Gh0st352 Sep 4, 2026
ad19c20
test: cover transcript transport mutation edges
Gh0st352 Sep 4, 2026
3c061b2
test: address transcript review feedback
Gh0st352 Sep 4, 2026
32fb122
fix: expire incomplete transcript snapshots
Gh0st352 Sep 4, 2026
ae010aa
test: cover transcript snapshot timeout mutations
Gh0st352 Sep 4, 2026
b21a821
fix: address transcript transport review feedback
Gh0st352 Sep 5, 2026
4607239
fix(task): await transcript snapshots after overwrite persistence
Gh0st352 Sep 6, 2026
9a09252
fix(task): synchronize transcript snapshots on overwrite and resume
Gh0st352 Sep 6, 2026
b073ebc
test(task): assert readiness before pending action replay
Gh0st352 Sep 6, 2026
a32a0d1
fix(tests): await theme transitions before visual assertions
Gh0st352 Sep 7, 2026
6c8c3fd
test(webview): assert injected animation by target and identity
Gh0st352 Sep 7, 2026
ad4a52d
fix(webview): capture transcript snapshots before queueing
Gh0st352 Sep 8, 2026
d3c1130
test(webview): align upstream history test with empty-task transport
Gh0st352 Sep 11, 2026
14fcfb8
fix(webview): release stale transcript work and verify transport prot…
Gh0st352 Sep 11, 2026
0e35038
fix(task): deliver leading transcript updates and pin resume ordering
Gh0st352 Sep 11, 2026
15e9c3b
perf(webview): index transcript updates and assert atomic timeout rec…
Gh0st352 Sep 11, 2026
94fcaae
test: cover transcript transport mutation gaps
Gh0st352 Sep 11, 2026
1d74db0
fix(transcript): simplify ownership and verify canonical frames
Gh0st352 Sep 11, 2026
89fb5ff
fix(transcript): preserve producer identity across task replacement
Gh0st352 Sep 11, 2026
ea47b60
fix(transcript): bound model test runtime and simplify dispatch
Gh0st352 Sep 12, 2026
4696070
fix(webview): reject transcript frames without an active task
Gh0st352 Sep 12, 2026
847165c
Merge branch 'main' into Fix_MemoryLeak_GrayScreen
Gh0st352 Sep 17, 2026
9e5a02f
fix(webview): coalesce transcript recovery and address review feedback
Gh0st352 Sep 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions apps/cli/src/ui/__tests__/transcript-focus.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import { render } from "ink-testing-library"

import { createMockClient } from "../../agent/extension-client.js"
import { useMessageHandlers, type UseMessageHandlersReturn } from "../hooks/useMessageHandlers.js"
import { useCLIStore } from "../store.js"

describe("dedicated transcript focus compatibility", () => {
beforeEach(() => useCLIStore.getState().reset())
afterEach(() => useCLIStore.getState().reset())

it("does not consume CLI resume readiness before the historical transcript arrives", () => {
let handlers: UseMessageHandlersReturn | undefined
function Harness() {
handlers = useMessageHandlers({ nonInteractive: false })
return null
}
useCLIStore.getState().setIsResumingTask(true)
const { unmount } = render(<Harness />)
try {
expect(handlers).toBeDefined()
const before = useCLIStore.getState()
handlers!.handleExtensionMessage({ type: "clineMessagesFocus", taskId: "task-1", taskInstanceId: "new" })
expect(useCLIStore.getState()).toBe(before)
expect(useCLIStore.getState().isResumingTask).toBe(true)
handlers!.handleExtensionMessage({
type: "state",
state: { clineMessages: [{ ts: 1, type: "say", say: "text", text: "Historical first message" }] },
})
expect(useCLIStore.getState().messages).toEqual([
expect.objectContaining({ content: "Historical first message" }),
])
expect(useCLIStore.getState().isResumingTask).toBe(false)
} finally {
unmount()
}
})

it("does not initialize the noninteractive client or overwrite its legacy transcript", () => {
const { client } = createMockClient()
client.handleMessage({ type: "clineMessagesFocus", taskId: "task-1", taskInstanceId: "new" })
expect(client.isInitialized()).toBe(false)
client.handleMessage({
type: "state",
state: { clineMessages: [{ ts: 1, type: "ask", ask: "tool", partial: false }], mode: "code" },
})
expect(client.isWaitingForInput()).toBe(true)
client.handleMessage({ type: "clineMessagesFocus" })
expect(client.isWaitingForInput()).toBe(true)
expect(client.getCurrentMode()).toBe("code")
})
})
11 changes: 8 additions & 3 deletions docs/architecture/task-lifecycle-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ Zoo Code checks task lifecycle protocols through one compositional verification
pnpm lifecycle:model-check
```

The command runs six independent bounded submodels in sequence:
The command runs seven independent bounded submodels in sequence:

1. the persisted task delegation lifecycle;
2. shared-store concurrency across task-history hosts;
3. production-backed provider handoff and scheduler ordering;
4. the task cleanup protocol;
5. request-stream parser scoping; and
6. completion persistence.
5. request-stream parser scoping;
6. completion persistence; and
7. production-backed transcript transport ownership and snapshot ordering.

This umbrella command is the single model-check entry point in the `compile` CI job after type checking. Command-level composition does not merge the submodels' state spaces: each checker retains its own bounds, transitions, invariant ownership, reachability requirements, and counterexample format. In particular, parser state is not part of the persisted lifecycle graph. The focused parser checker remains directly runnable with `pnpm parser-scope:model-check` for debugging.

Expand Down Expand Up @@ -80,6 +81,10 @@ The known-unsafe witnesses currently compare exact shortest action sequences. Th

The umbrella command also runs a separate bounded child model for in-memory abort, disposal, and provider-shutdown ordering. It models cleanup settlement and rejection as environment transitions and makes no filesystem, editor Promise, fairness, or timing-liveness claim. See [Task cleanup protocol model check](./task-cleanup-protocol-model.md).

## Transcript transport model

The umbrella command also runs **pnpm transcript-transport:model-check**, an exhaustive bounded explorer over the same production reducer used by the provider's transcript driver. It checks cancellable FIFO ownership, the single physical-send barrier across invalidations, task-scoped sequences, and atomic snapshot start/chunk/end ordering. Named landmarks require held posts, repeated resync, task switching/clear, queued deltas, and failure/recovery; injected legacy/mutant policies demonstrate invariant sensitivity. Its receiver oracle is not the React implementation, and an already-initiated physical send may complete after invalidation. See [Transcript transport ownership and bounded verification](./transcript-transport-model.md) for exact bounds, correspondence, counterexamples, and limitations. This independent protocol does not extend the persisted lifecycle state space.

## Provider handoff and scheduler model

`scripts/check-provider-handoff-scheduler.ts` is a separate bounded adapter model for the runtime boundary that the persisted lifecycle graph does not represent. Its breadth-first explorer normalizes provider-keyed records and owner arrays before deduplicating canonical states, then exhaustively explores enabled action orderings through depth 15 with a 20,000-state budget. It imports `selectHandoffExecutionContext` and the existing `delegateTaskToChild` and `completeDelegatedChild` reducers. A direct saved, unsaved, and locked-profile matrix verifies task-local configuration isolation. Stale provider lookup is caught before this pure selector, so focused provider tests verify the failed lookup, contextual log, and fallback. The protocol state then models two provider instances, their claims and parent snapshots, authoritative parent/child records, current task publication, commit/start ownership, the child scheduler permit, queued and resumed parent state, and one bounded redelegation generation.
Expand Down
Loading
Loading