mirror of
https://github.com/morluto/rea
synced 2026-10-27 06:33:32 -04:00
2e6b38cef0
* feat(environment): render more read tools from the state and describe responses Keep main's environment serving and fold in coverage for non-entity reads, response summaries, and MCP tool annotations. Squashed rebase of #5352 onto main. * fix(environment): keep rendered documents and quoted samples inside their budgets A recorded body of exponential numbers can render past 256 KiB and turn a working read into a state size error, so that document stays a recorded replay. Description samples are measured after JSON quoting, and the replay-fallback catalog check uses a tool count the longer response descriptions still separate. Co-authored-by: morluto <morluto@users.noreply.github.com> * test(environment): pin the replay card this branch serves The replay-only card test pinned main's 11,131-byte card. This branch's descriptions name each tool's recorded responses, so the card it serves is 12,818 bytes; the pin and its name follow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: morluto <morluto@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2.1 KiB
2.1 KiB
Implementation plan
- In
environmentStateRules.ts, parse pointers into tokens and letatandreplaceAtread and replace element 0 of a one-element array at the root or in one member; extendlocateItemwith those forms after the object forms, requiring an identity name there; addidentityCandidates, the identity names then suffix-named fields, and letlocateListprefer arrays identified by name, then arrays of two or more items identified by suffix. - In
EnvironmentStateExtraction.ts, plan lists with the shared candidates, treat an empty recording as unconstraining, accept a suffix-named field only once a recording shows it distinct across two or more items, leave reads without a list or identity to documents, drop the written-path requirement and thenot-entityfallback, recordpath-variesapart fromquery-varies, and keep each entity's earliest sighting;environmentStateMerge.tscites records in timeline order. Removenot-entityfrom the reason type and result schema, addpath-varies, and describe the new pointer forms andfield-namebasis. - Move the classification of retained bodies (none, base64, cut, JSON, text)
into
replayedBodyinenvironmentSource.ts, which owns recorded exchanges; replay renders from it and tool descriptions read its JSON case. - Make
environmentToolDefinitionstake theEnvironmentSource; describe the first2xxJSON record, else the first JSON record labelled with its status, one level deep with the state's list rule and the existing sample budget; list the manifest tool's statuses; and charge the whole description and the tool's MCP annotations to the catalog reservation. Update the serve and bundle callers. - Let the tool definitions own the MCP annotations derived from the method and
the query-
POSTrule;serveEnvironment.tsregisters them and the card leaves them out. - Cover domain, services, adapters and the compiled MCP boundary; document the rules in the capture guide, descriptions and hints in the agent environments guide, and the contract text.