← Back to Pull requests

feat(runtime): search retained tool-result references with Grep #6128

Open
unknown opened this pull request with 223 lines diff across 2 files
View on GitHub
unknown unknown commented on Oct 16, 2026 03:01 UTC
Author

Summary

Agents can use Grep on a maka://runtime/tool-results/... address to locate evidence before expanding it with Read, instead of paging through unrelated output or repeating the source operation. Searches reuse the Session-authenticated readable result, retain exact completed-search line counts within a 7,500-byte JSON response, and supply digest-bound Read hints for clipped Unicode/JSON lines. Conversation copies remap generated addresses while preserving matched source text.

Counts cover retained content; execution metadata preserves known upstream output truncation. Existing preview/storage policy and filesystem searches continue through their existing paths.

Fixes #6127

Verification

  • Complete @maka/runtime suite: 3,940 passed, 14 platform-specific skips, zero failures; final targeted search, Read/Grep, ledger, copy and provider-loop regressions also pass.

  • Negative control: removing the result-search binding makes the preview → Grep → Read provider-loop regression fail; restoring it passes.

  • Passed full build, lint, format check, typecheck, Knip for Desktop and UI, and ASF header checks.

  • Simplified response shaping to one final envelope budget; byte limits, omission counts and long-line recovery still pass.
  • AI use

  • No generative tool made a substantive contribution

  • Generative tooling made a substantive contribution
  • Tool(s) and scope: OpenAI Codex assisted with implementation, regression tests, documentation and this description. The commit includes a Generated-by: OpenAI Codex trailer.

    Checklist

  • Tests cover the change and fail without it

  • Lint, format, typecheck and the affected suites pass locally
  • Does this PR entail a change in behavior?

  • Yes — described under Summary above

  • No
  • Diff: 223 lines (+167 / -56) across 2 files Reviewer: Astro-Han Review duration: 1897m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.37) × (1 − Review Confidence (0.43)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.37 · 223 lines diff across 2 files
    0.37
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    42%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.324
    Real PR Conversation Timeline
    1 comments
    "Review active on #6128"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 43.0% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 36.8% (MEDIUM) · Higher = larger blast radius
    36.8%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 43.0% · Lower = rushed or shallow review
    43.0%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 21% · Safe to merge
    21%
    Repository