AgentState is the frontend half of the three-place cross-process shape
(agent-state-shape-contract). resources and
logs were typed any[], so every consumer lost type checking on the two list fields that
drive the canvas cards and the Progress step list — a rename or field typo on the backend
(state.py Resource/Log) could not be caught on the frontend at compile time. Resource
was already defined one block up in the same file, and the backend had a matching Log
TypedDict. The brain notes the looseness was "deliberate" — but loose typing is exactly what
lets a silent shape drift render nothing, which is why it was worth tightening.
Resolution (2026-07-30)
src/lib/types.ts now declares resources: Resource[] (:23) and logs: Log[] (:24),
with Log = { message: string; done: boolean } added as a named export at :14 — matching
the backend TypedDict field-for-field. was reused as-is. Verified against
current source this pass.
The old citations are gone on purpose. This row previously cited
src/lib/types.ts:11 :: any[] and :12 :: any[]; neither token exists any more, and line 11
is now part of the unrelated Citation interface — a cite that still resolved by line number
but pointed at the wrong thing. The cites above point at the fix instead, so the row stays
checkable rather than decorative.
One consequence worth knowing before touching this file: the types are now load-bearing for
createInitialAgentState (types.ts:32, see
coagent-initialstate-divergence) —
widening a field back to any would silently switch the seed's compile-time check off too.