Repository navigation
feat(analysis-view): project rich captures from an Evidence file and template path pairs - #5293
Conversation
…template path pairs
inspect_analysis_view accepts a source {kind: "evidence-file", path},
read through the shared JSON file reader, authenticated as complete
Evidence and projected like retained Evidence. A capture is then bounded
by the file reader instead of being charged as inline input at 14 bytes
per string character, which refused a 10.7 MB capture whose response
bodies the environment manifest never reads.
The environment-manifest view gains the opt-in rule sibling-pair-variance:
groups that differ only in two adjacent literals after a plural literal,
such as /repos/{owner}/{repo}/issues, merge when at least three distinct
pairs vary in both positions. Their parameters are named <singular>_namespace
and <singular>_name. A rich Gitea capture otherwise produced one tool per
repository, beyond the 128 tools model providers accept.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 081465859d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
[Medium impact] The reviewed changes appear safe to merge; no new blocking issue was found. SummaryAdds Evidence-file sources for analysis views and an opt-in rule for merging adjacent path segments. Since the previous review, file authentication moved into the reader, and malformed files now report the selected path with file-relative
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[CLI or MCP request] --> B{Source}
B -->|Evidence file| C[Read with cancellation and resource ownership]
C --> D[Check heap space]
D --> E[Authenticate Evidence]
E --> F[Check cancellation]
F --> G[Project as retained Evidence]
B -->|Inline or retained| G
G --> H[Check cancellation for file requests]
H --> I[Return view or typed error]
Reviews (9) · Last reviewed commit: "fix(analysis-view): locate Evidence file..." · Reviewed by Greptile |
…merge pairs first Evidence-file reads now take the MCP request's signal and the server's artifact resource scope: a cancelled request returns typed cancellation before authentication, before projection or after projection and records nothing, and a failed descriptor close stays owned for retry. Before authentication copies and hashes the parsed Evidence, REA checks that live heap headroom holds those copies and otherwise returns resource_constraint. sibling-pair-variance now runs before sibling-variance, so a single-position merge cannot template one half of a pair and leave too few literal pairs; with both rules the pair still merges. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a89e15ac11
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
… pair roles Authentication and projection of a file source run synchronously, so the service now yields to the event loop before each cancellation check; an abort that arrives while they run is dispatched and the request returns typed cancellation instead of a recorded result. Each sibling-pair-variance parameter records whether it is the pair's namespace or name when the pair forms, and merges keep that role, so a later sibling-variance merge of the segment before the pair cannot rename the first half as a second. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e77707ba51
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Brings in the environment export (morluto#4999) and scenario capture (morluto#5182) merges. The one conflict, the inspect_analysis_view contract text, keeps both insertions: main's sentence on scenario parents and this branch's evidence-file source. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ncellation before auth failures After main's scenario support, a capture_browser_scenario parent charged every string at 14 bytes per character even when read from its file, so the rich captures this change exists for (a 10.7 MB scenario of 1,218 reads) were refused again at the 96 MiB budget. Scenario admission now reserves what projection actually derives, before validation: the scratch of checking the largest body (two bytes per base64 character) and the decoded text of every request body. Response bodies stay borrowed, as HAR response text does; inline parents are still charged per character by inline admission. A file request aborted while its Evidence was being authenticated could return the authentication failure; the cancellation check now precedes it, so an aborted request reports typed cancellation. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
The inspect_analysis_view contract text conflicted again; main's IL2CPP wording and this branch's evidence-file sentence are both kept. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
…g derived text The derived-text estimate parsed every event against one loose schema, so a single body without content (not requested, unavailable or not exposed) failed the parse and the whole estimate fell to zero, letting large request bodies elsewhere decode without a reservation. Each event is now read on its own, as own data members of the already admitted parent, and a test with an uncaptured body beside a 2 MiB request body is refused before any text is decoded. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
kaoru0822-kitauji
left a comment
There was a problem hiding this comment.
Reviewed at e725fbd4. The evidence-file source is in good shape. I'd hold the merge for one change to sibling-pair-variance, plus a scope confirmation.
What I checked
- CI is green, all 9 automated review threads are resolved with fixes, and the branch merges cleanly into
main. - I ran the changed unit tests locally:
environmentManifestView,scenarioCaptureRecordsandsrc/application/analysisView/(88 passed). I did not rerun the boundary tests or the Gitea capture. evidence-file: the file is read through the sharedreadJsonFileand authenticated withparseEvidence. The new code checks for cancellation (with a yield) after the read, after authentication and after projection, and it uses the server'sartifactResourcesscope. The view Evidence records onlyparent_evidence_id+view, so it is identical whether the parent came inline, retained or from a file, as the PR says. The synchronous API refuses the file source with a typed error. All of this looks right to me.- Scenario admission: the per-body
derivedTextBytesestimate matches whatbrowserNetworkBodySchema'ssuperRefineactually allocates (it decodes and re-encodes one body at a time).
Should fix before merge: sibling-pair-variance merges distinct sub-resources (inline below)
The rule can't tell /{owner}/{repo} apart from /{id}/{sub-resource}. I ran a probe against this branch with ["sibling-pair-variance"]:
GET /api/v1/users/alice/followers
GET /api/v1/users/bob/following
GET /api/v1/users/carol/starred
→ one tool: /api/v1/users/{user_namespace}/{user_name} (get_users_by_user_namespace_user_name, records [0,1,2])
Three different endpoints became one tool. A browser scenario that opens profile tabs (Gitea's own /users/{u}/repos, /starred, /followers, /following, /heatmap) will produce this, so it is likely in real captures. #4933 warned about exactly this kind of silent over-generalization. Possible guards: refuse a bucket when a value in the second position appears under two or more namespaces, or require a shared literal suffix after the pair. Either way, please add this case as a regression test. If you'd rather keep the heuristic as is, at least add it to the rule's documented limitations. It would also help to note in verification.md whether any of the 63 Gitea tools merged sub-resources this way. The 12/12 task score doesn't rule it out.
Nits (non-blocking)
- An
evidence-filewhose JSON isn't valid Evidence reports schema issues undersource.path.<evidence field>(inline below). That path points at the request's string field, not at the file's contents. A file-relative path, or anEvidenceFileErrorthat carries the issues, would be clearer. - The pair loop starts at index 2, the same as
sibling-variance. So an origin-rooted/repos/{owner}/{repo}(GitHub-style, plural at index 0) never qualifies. The docs state "index 2 or later", so this is consistent, just worth knowing. - Compatibility says the budget is unchanged. That holds for inline sources, but retained scenario parents are now charged less (derived text only, instead of 14 B/char). The validation notes explain this; a line under Compatibility would make it visible.
Merge readiness
The body says "scope decision requested there" (#4933), yet the scope box is ticked. #4933 has no maintainer reply on record. The sibling PRs (#4954, #4975, #4999, #5182) were merged by maintainers, so the direction looks accepted. Still, evidence-file adds a new MCP input that reads a caller-named local file, so a maintainer should confirm it explicitly. With the pair-rule fix and that confirmation, I'd consider this ready to merge.
…ariance
A pair that ends the route, such as /users/alice/followers,
/users/bob/following and /users/carol/starred, met every pair condition
and collapsed three endpoints into /users/{user_namespace}/{user_name}.
The second half of a trailing pair names a sub-resource rather than a
namespace and name, so a pair now qualifies only when another literal
follows it (/repos/{owner}/{repo}/issues). Bare /repos/{owner}/{repo}
detail routes stay one tool per pair.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
The only conflict was the inspect_analysis_view contract text: main's Godot PCK additions are kept and the evidence-file source sentence is re-inserted after the inline-source sentence. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
…pair guard Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
gensokyo-dev
left a comment
There was a problem hiding this comment.
Reviewed with Codex assistance at 4b77f01. The change stays within read-only inspection of caller-selected local Evidence. File access uses the existing regular-file reader, request cancellation and resource owner; authentication and schema locations now belong to the file boundary. Retained/file scenario admission reserves validation scratch and derived request text before allocation. Pair inference stays opt-in and requires a trailing shared literal, preserving profile sub-resources.
Validation executed on this tree: 298 relevant source tests, 48 compiled CLI/MCP/environment boundary tests, serial static/build and docs/catalog checks, architecture guards, plus actual Gitea 28.2.0/Chromium capture -> file CLI/default stdio MCP parity -> 18 checked HTTP replays (six complete responses; twelve correctly marked 256 KiB prefixes). No macOS/Windows runtime or new model-task scoring is claimed. The original human owner’s initial readiness declaration is retained.
…ansition-view Resolve conflicts with main's evidence-file analysis-view source (morluto#5293). Keep main's evidence-file sentence in the inspect_analysis_view description together with this branch's capture_browser_scenario text. Keep both the browser-scenario authority test and main's inspectAnalysisViewWithFiles tests in AnalysisViewService.test.ts. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Summary
Allow realistic captures to become environment manifests without sending the complete Evidence inline.
inspect_analysis_viewaccepts an authenticated localevidence-filesource; the opt-insibling-pair-variancerule groups owner/repository paths only when a shared literal follows the pair. Trailing profile sub-resources remain separate tools.Refs #4933. This extends existing read-only analysis of caller-selected local Evidence. It adds no provider, target execution, network request, mutation, or transport default change.
Changes
EvidenceFileErrorwith the selected path and file-relativecontent_issues, rather than fictionalsource.path.<field>request locations.Validation
Original macOS/Gitea/model-task experiments and their limitations are recorded in verification.md. In particular, the author's 63-tool / 12-task run predates the trailing-pair guard and is not evidence of the final guard's tool count. Current follow-up does not claim new macOS/Windows runtime or model-task verification.
Author readiness
Human owner: @earakely-scale
Before merge
type(scope): outcome.🤖 Generated with Claude Code