mirror of
https://github.com/morluto/rea.git
synced 2026-11-09 00:07:18 +00:00
Add the environment-state analysis view. From the parents the environment manifest accepts, it extracts the data the capture's reads observed before the first related write: entity types with an identity field (proved by a path parameter or inferred from an identity name), entities with their recorded values and provenance, documents for written non-entity paths, and a render plan per read tool that is kept only when it reproduces the tool's latest initial recordings from the state; every other read tool is a recorded view with the reason. The Evidence is always inferred. Response-body decoding moves to a domain owner shared with replay, exact JSON parsing moves to the owner of the exact-number policy, the manifest and state views share parent admission and record grouping, and projectAnalysisView takes its accumulators as one object. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1.6 KiB
1.6 KiB
Implementation plan
- Move response-body decoding from the environment source into
recordedResponseBody.tswith the caller's byte limit, and exact JSON parsing intoexactJsonNumber.ts, so replay and state extraction share one owner each. - Add
environmentStateRules.tsas pure helpers: write classification, API bases and roots, entity location, identity names, JSON pointers of depth one, value bytes and the entity and list renderers. - Add
EnvironmentStateExtraction.tsfor planning item and list tools, observing entities and assembling the result,environmentStateMerge.tsfor merging observations, andenvironmentStateGate.tsfor reproducing each plan's recordings; every body is parsed through a budget callback and released before the next. - Add
EnvironmentStateAccumulator.ts, extending the manifest accumulator so grouping is shared, retaining record lines and references to the admitted records, and charging bodies and kept values. - Add
environmentStateView.tswith the request schema (sharing the manifest'stemplate_rulesschema), the result fields and the projector; share capture admission and record grouping with the manifest view; register the kind and pass accumulators toprojectAnalysisViewas one object; always seal the result inferred. - Cover domain, service, MCP, CLI, catalog and acceptance behavior; document the view in the capture guide, the agent environments guide, the contracts reference and the authored skill.
No new tool, provider, side effect or network activity is introduced. The state is a projection of already retained Evidence; serving it is deferred.