Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
17 changes: 17 additions & 0 deletions CONTEXT.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,23 @@ never the decision. There is exactly one persisted link format
(inferred or local-link) and never on a dry run. The project client
(control plane over HTTP, CLI API client, fake in tests) is its one seam.

## Tool Replay Reconciliation

The single owner of deciding which tool-call and tool-result occurrences in
UI-message replay history are authoritative for provider conversion:
`src/chat/tool-replay-reconciliation.ts`. Matching is by part **object
identity**, so one pass over history marks parts as matched, superseded,
batch-starting, or transient-but-preserved without mutating them. Provider
conversion and message preparation both consult this module rather than
re-deriving which occurrence wins.

## Message Part Interpretation

The single owner of interpreting one message part — tool, text, reasoning, or
file — into a normalized shape: `src/chat/message-part-parsing.ts`. Provider
conversion and Tool Replay Reconciliation both read parts through it, so a
change to how a part is recognized lands in one file.

## Stream Delivery

The separate agent-loop fan-out boundary that will route lifecycle frames to
Expand Down
9 changes: 9 additions & 0 deletions scripts/lint/ban-chat-antipatterns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,15 @@ const FILE_SIZE_CEILINGS: Record<string, number> = {
"src/react/components/chat/chat-actions.tsx": 203,
"src/react/components/chat/chat/controlled-chat.tsx": 242,
"src/react/components/chat/chat/app-mode-chat.tsx": 177,
// Chat core: message construction and provider-conversion, split along its
// real seams (part-field-access, message-part-parsing, tool-replay
// reconciliation). Not React components, so this map does not subject them
// to the antipattern ratchets above — it only pins their size.
"src/chat/conversation.ts": 1018,
"src/chat/message-prep.ts": 2016,
"src/chat/tool-replay-reconciliation.ts": 294,
"src/chat/message-part-parsing.ts": 264,
"src/chat/part-field-access.ts": 66,
};

function checkFileSizes(): boolean {
Expand Down
Loading