Skip to content

fix(runtime): clarify Explain artifact recovery and introspection scope - #885

Merged
XuPeng-SH merged 6 commits into
matrixorigin:mainfrom
XuPeng-SH:fix/explain-artifact-recovery
Sep 25, 2026
Merged

XuPeng-SH merged 6 commits into
matrixorigin:mainfrom
XuPeng-SH:fix/explain-artifact-recovery

Conversation

@XuPeng-SH

@XuPeng-SH XuPeng-SH commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

In session 313b540e-a311-4439-8c38-9b3fc39b1acd, a follow-up asked about an earlier runtime Explain report. The agent mistook live invocation artifact counts for an Explain catalog, searched runtime-owned tool-result files, and hit a guard whose message incorrectly implied that no Explain recovery action existed and that the result should be reported as truncated. A second, related defect allowed protected paths to leak back into recent-argument hints because that prompt path used a different predicate from the file guard.

Change

  • Make the existing on-demand introspect(explain={target:previous}) recovery route clear in the compact resident tool schema, including its mutual exclusion with an artifact handle. No per-turn lookup or database read/write path was added.
  • Label live invocation artifact counts as invocation-only, not an Explain catalog.
  • Scope the file guard to runtime-owned tool-result storage, direct Explain requests to the first-class selector, and classify that pre-execution denial as policy denied.
  • Share the guard's path predicate with recent-argument hints; cover directory, case, and Windows-separator variants so denied paths are not re-suggested.
  • Delete an unused client-local context-notice path and the duplicate hint predicate. Production Rust code is smaller overall.
  • Add a multi-turn, model-agnostic harness case that verifies report identity, capture status and coverage against durable session evidence; it requires no shell access or failed introspection calls.

Verification

  • Targeted Rust tests for artifact guard/classification, recent-hint filtering, introspection labels and lifecycle, and resident schema/byte budget; shipped harness YAML loading and cargo fmt --all -- --check passed.
  • Strict fresh-build preflight confirmed CLI, Server, and harness at clean commit b02ae4050 for the Explain case and clean commit c25db4474 for the tool-result control; the restarted Server passed readiness at both heads.
  • Real Explain harness at b02ae4050: glm-5.2 and deepseek-v4-flash each passed 1/1, each with two successful introspect calls, zero bash and failed calls, and qwen3.8-max judge 1.00.
  • Real existing large tool-result recovery harness at c25db4474: deepseek-v4-flash passed 1/1, recovered the durable bash artifact with introspect, and had zero failed or rejected calls. Earlier ordinary retrospective and tool-result recovery controls also passed.
  • A repeated older timing-heavy Explain rubric exposed unreliable timing inferences and an 8 KiB judge-evidence limit, so the new case checks the report's declared coverage rather than requiring unsupported timing reconstruction or full pagination.
  • Every staged commit was independently reviewed by gpt-6-astra at medium effort; findings in the first two stages were fixed and re-reviewed.

The Explain reader remains explicit and lazy. No database read/write path or guard match boundary was weakened. Live integrations are optional; no CI result is assumed here.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deep review of e4febd0a5a764afda0a5a7859bdacfcca088d540..c25db44741a0f73e7318776ce47d8f5540a7743a: no actionable introduced defects or blocking findings found.

Reviewed all eight changed files and followed schema projection, artifact selection/recovery, policy failure handling, recent-argument hints, and harness evidence consumption. The deleted CLI notice had no production callers. The shared predicate removes divergent filtering. policy_denied selects a permitted capability and forbids identical retries; it does not unconditionally request approval. The diff adds no database operations, artifact fetches, background loops, or waits. Existing on-demand recovery retains its existing I/O costs and ownership checks.

Nonblocking follow-up: the resident description at crates/runtime/src/tool_registry/surface.rs:433 loses the explicit target=run requires run_id guidance, while nested descriptions are stripped. Runtime validation and the canonical schema retain that contract, so this is not a demonstrated regression. A compact reminder or an exact-run harness counterexample would improve confidence without broadening the tool surface. The new previous-report case also does not establish unavailable-report or pagination behavior.

Validation: reran observation_recovery_and_reflection_are_eager and default_always_load_surface_has_a_fixed_schema_budget; both passed. git diff --check passed. Reused prior live evidence: previous-report recovery passed with GLM and DeepSeek at b02ae4050; large tool-result recovery passed at c25db4474. Those are small samples, not a reliability estimate. CI was still running when inspected; no CI completion was awaited or assumed.

Independent judgment: a fresh gpt-6-astra medium reviewer completed a separate full-diff review and also found no actionable introduced defect. Final head was rechecked unchanged at c25db4474 before submission. Submitted as COMMENT because the authenticated account is also the PR author and cannot approve its own PR.

@XuPeng-SH
XuPeng-SH merged commit 50d96e3 into matrixorigin:main Sep 25, 2026
27 checks passed
@XuPeng-SH
XuPeng-SH deleted the fix/explain-artifact-recovery branch September 25, 2026 11:36
@loveRhythm1990 loveRhythm1990 mentioned this pull request Sep 28, 2026
5 tasks done
mergify Bot pushed a commit that referenced this pull request Sep 28, 2026
## Summary

Synchronize the workspace version from `0.2.9` to `0.2.10`. This pull request only updates release metadata. It does not change runtime behavior, create a tag, publish container images, or create a GitHub Release.

`main` already contains the fixes and features that this version names:

- Run-lifecycle 409 conflicts carry stable, structured error codes, and the pre-admission rejection contract is complete for session-slot conflicts (#886).
- Bounded session recovery is hardened (#883).
- Explain artifact recovery and introspection scope is clarified (#885).
- Client-owned skills are routed with the server catalog (#881).
- Execution evidence and progress feedback are grounded for judgment (#880).
- MCP bindings are preserved across chat turns (#887).
- The composer no longer goes stale after a coalesced resize (#889).
- Next-turn assessments are persisted for observability (#888).
- Live run observation load is reduced (#891).
- Partial usage summary output is simplified (#890).
- Web dependency patch/minor updates (#895).

Pinned MatrixOne and Memoria image digests are unchanged.

MOI publishes the client from the selected Astra commit. After this change is on `matrixorigin/Astra`, a MOI source build can set `astra_version` to `0.2.10` and check it against this commit's `Cargo.toml`. Publishing the GitHub Release is a separate step: after merge, run `make release-publish VERSION=0.2.10` from a clean `main` checkout. This pull request does not do that.

## Related issue

No related issue.

## Change type

- [x] Build, CI, or maintenance

## User and compatibility impact

Installed clients do not change until a bundle or GitHub Release is built from this commit. There is no configuration migration. The source version becomes `0.2.10`.

## Architecture and complexity delta

N/A

- Canonical owner changed or extended: none
- Existing implementations and callers searched: the version surfaces covered by `make release-prepare`
- Superseded code, states, tables, shims, or self-only tests removed: none
- If parallel implementations remain, their boundary and retirement condition: none

## Verification

- Commands and results: `make release-prepare VERSION=0.2.10` succeeded. `LC_ALL=C make release-check VERSION=0.2.10` passed.
- Public entrypoint exercised: not published.
- Unhappy paths exercised: `validate-release-version.sh` confirmed the `0.2.10` version surfaces are internally consistent.
- Database verification: not applicable. `make check` and `make test-offline` were not run because this change only rewrites version metadata.

## Final checklist

- [x] I added or updated tests at the layer that owns the behavior, or explained why no test is needed.
- [x] I updated public or design documentation for contract changes, or the change needs no documentation update.
- [x] I checked the diff for credentials, private URLs, customer data, generated files, and other sensitive information.
- [x] The PR title follows the repository's Conventional Commit format.

🤖 Generated with [Claude Code](https://claude.com/claude-code)


Approved-by: XuPeng-SH <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant