← Back to Pull requests

fix(assistant): keep the discovery Session to read and report tools #6256

Closed
unknown closed this pull request without merging on Oct 23, 2026 09:56 UTC
View on GitHub
unknown unknown commented on Oct 23, 2026 07:01 UTC
Author

Summary

The proactive discovery Session runs open-ended investigation in the background. At origin/main@59f61cf7d it could do more than investigate and report:

  • create a Matter the conversation cannot see (MatterDelegate, #6249);

  • adopt an unassigned conversation Matter (MatterAdopt);

  • write, edit, checkpoint, control or create conversation memory indexes (MemoryIndex*, #6250);

  • call Bot-only and initiative-configuration tools that were rejected only at execution.
  • This PR gives the discovery Session its own exclusion list. The same visibility policy now governs the model-facing catalog and execution, so a tool hidden from a Session cannot run in it either. Read tools, DiscoveryReport and DiscoveryContext stay available. The conversation, the Bot and index workers are unchanged.

    Fixes #6249. Refs #6250 (open: the allowlist decision for MemorySourceQuery and MemoryExtract; native shell and edit tools in the discovery Session were not verified). Refs #6247 (RFC).

    Behavior change

  • A discovery Session no longer lists or runs the tools in DISCOVERY_EXCLUDED_TOOLS (index-initiative/discovery-capabilities.ts).

  • A discovery Session that tries to create a Matter gets an error instead of an invisible Matter. Discovery reports the need through DiscoveryReport.

  • No change for ordinary conversations, the Bot, or index workers.
  • Verification

    Regression tests were written first and run against the unfixed code: 4 of 6 failed, and the 2 that passed are guards for behavior that was already correct (conversation-delegated tasks cannot be controlled from discovery; discovery can still read conversation memory).

    | Check | Result |
    |---|---|
    | npm run typecheck (runtime-host, Node 24.21.0) | pass |
    | discovery-boundary.test.ts, 6 tests | 6 of 6 pass (4 of 6 fail on the unfixed code) |
    | npm run test:assistant (memory-network, index-initiative, proactive-matters) | 195 of 195 pass |
    | npm run test:dist (runtime-host) | see the note below |
    | biome check and asf-license-headers check on changed files | pass |

    Note on test:dist: the full run exposed one pre-existing failure and several load-sensitive timeouts.

  • assistant Host fallback registers a task workspace … fails on origin/main@59f61cf7d as well. I checked this by stashing this change and rebuilding the clean baseline. It is unrelated to the discovery boundary and is not fixed here.

  • Four timeout-style failures (interrupt atomically …, two Clients share one execution …, invocation-owned detached Host retires …, non-serving Runtime Host kernel) pass when run in isolation. They failed only under the full concurrent run.

  • Two failures in assistant-initiative-boundary.test.ts came from this change: the test harness did not provide tools.filter, and the new fail-closed check rejected it. The harness now provides it.
  • Review focus

  • Classification of each excluded tool. MatterRead, MatterReadFile, InboxList and InboxRead are excluded because they are worker-only or Bot-only. Please confirm none is needed by discovery.

  • Not covered yet. MemorySourceQuery and MemoryExtract remain available. Native shell and edit tools were not exercised because the test fixture exposes plugin tools only.
  • AI use

  • Generative tooling made a substantive contribution
  • Tool(s) and scope: Claude Code (Anthropic) investigated the code paths, wrote the regression tests and the change, and drafted this description. The checks above were run locally by the tool. Human review is pending; the contributor of record owns the change's accuracy and licensing. Commits carry Generated-by: Claude Code.

    Checklist

  • Tests cover the change and fail without it

  • Lint, format, typecheck and the affected suites pass locally (see the note on test:dist)
  • Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • 🤖 Generated with Claude Code

    Diff: 498 lines (+373 / -125) across 6 files Reviewer: me2seeks Review duration: 175m
    All Vouch review confidence checks passed
    Residual risk 0.19 = Change Risk (0.47) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.47 · 498 lines diff across 6 files
    0.47
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    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
    Diff Size diff_size
    0.372
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #6256"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% 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: 47.5% (MEDIUM) · Higher = larger blast radius
    47.5%
    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: 60.5% · Lower = rushed or shallow review
    60.5%
    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: 18.8% · Safe to merge
    18.8%
    Repository