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
0c837d4
feat(transcript): implement dedicated transcript protocol for Zoo Cod…
Gh0st352 Aug 23, 2026
a68150c
Added Chat Output to readme
Gh0st352 Aug 23, 2026
4abfcf6
feat: enhance transcript handling and synchronization in webview
Gh0st352 Aug 23, 2026
ab44bdf
fix(pre-commit): comment out pnpm lint command
Gh0st352 Aug 23, 2026
ffdddcd
fix(pre-push): comment out check-types command in pre-push hook
Gh0st352 Aug 23, 2026
89194c0
Delete apply_zoo_code_incremental_transcript_fix.py
Gh0st352 Aug 23, 2026
564b6ce
Delete ZOO_CODE_GRAY_SCREEN_FIX_README.md
Gh0st352 Aug 23, 2026
6677497
Uncomment check-types command in pre-push hook
Gh0st352 Aug 23, 2026
bc65542
Uncomment lint command in pre-commit hook
Gh0st352 Aug 23, 2026
36a4c9e
fix: address memory leak and improve transcript handling in ClineProv…
Gh0st352 Aug 24, 2026
861c6be
fix: address transcript synchronization review findings
Gh0st352 Aug 24, 2026
27be21e
test: initialize transcript sequence state in provider stubs
Gh0st352 Aug 24, 2026
6c26083
test: exercise edited message submission
Gh0st352 Aug 24, 2026
736433a
test: verify transcript republish completion
Gh0st352 Aug 24, 2026
7b6cb98
fix(webview): clear focused task without reload
Gh0st352 Aug 24, 2026
540c3db
fix: address transcript streaming review feedback
Gh0st352 Aug 27, 2026
5e2d951
test: align state ordering regression with transcript transport
Gh0st352 Sep 1, 2026
107cb13
test: cover transcript transport mutation gaps
Gh0st352 Sep 4, 2026
5afa2c0
test: cover transcript transport mutation edges
Gh0st352 Sep 4, 2026
5feab48
test: address transcript review feedback
Gh0st352 Sep 4, 2026
5aa3359
fix: expire incomplete transcript snapshots
Gh0st352 Sep 4, 2026
4f301d0
test: cover transcript snapshot timeout mutations
Gh0st352 Sep 4, 2026
52adfa9
fix: address transcript transport review feedback
Gh0st352 Sep 5, 2026
7b07fdf
fix(task): await transcript snapshots after overwrite persistence
Gh0st352 Sep 6, 2026
b4854c1
fix(task): synchronize transcript snapshots on overwrite and resume
Gh0st352 Sep 6, 2026
b7daa94
test(task): assert readiness before pending action replay
Gh0st352 Sep 6, 2026
95b581e
fix(tests): await theme transitions before visual assertions
Gh0st352 Sep 7, 2026
0c8edf8
test(webview): assert injected animation by target and identity
Gh0st352 Sep 7, 2026
53cbb97
fix(webview): capture transcript snapshots before queueing
Gh0st352 Sep 8, 2026
f7591e7
test(webview): align upstream history test with empty-task transport
Gh0st352 Sep 11, 2026
7346fbb
fix(webview): release stale transcript work and verify transport prot…
Gh0st352 Sep 11, 2026
d87c5ab
fix(task): deliver leading transcript updates and pin resume ordering
Gh0st352 Sep 11, 2026
6e137b9
perf(webview): index transcript updates and assert atomic timeout rec…
Gh0st352 Sep 11, 2026
8620ca3
test: cover transcript transport mutation gaps
Gh0st352 Sep 11, 2026
f7d2abb
fix(transcript): simplify ownership and verify canonical frames
Gh0st352 Sep 11, 2026
190b186
fix(transcript): preserve producer identity across task replacement
Gh0st352 Sep 11, 2026
bfe857f
Merge branch 'main' into Fix_MemoryLeak_GrayScreen
Gh0st352 Sep 12, 2026
1679bf3
fix(transcript): bound model test runtime and simplify dispatch
Gh0st352 Sep 12, 2026
d258df9
fix(webview): reject transcript frames without an active task
Gh0st352 Sep 12, 2026
1dba3a8
Merge branch 'main' into Fix_MemoryLeak_GrayScreen
Gh0st352 Sep 12, 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