Skip to content

refactor(runtime): project one effective product-tool surface per run #1493

Closed

Description

@Astro-Han

Problem

#1099 established the shared product-tool catalog and derives HostCapabilities and deferred groups from catalog ∩ host binding. Run policy is still applied outside that projection.

#1488 exposes the remaining gap: one agentTools decision must currently be threaded through root tool construction, child-session provisioning, deferred availability, Harbor execution identity, and TaskRun tool identity. Those consumers can disagree because there is no single effective-surface result.

Decision

Add one pure projector near tool-catalog-derive.ts:

catalog + host id + host-local bindings + normalized run policy
  -> effective bound tools
  -> effective tool names
  -> HostCapabilities
  -> deferred ToolAvailability groups
  -> tool-surface identity

This is a pure composition function, not a service, store, registry, or new runtime owner. Each root Session/TaskRun composition calls it once before constructing its backend.

Rules:

  1. The catalog remains authoritative for product names, surfaces, metadata, and host affinity.
  2. Hosts continue to own tool implementations and constructors.
  3. Policy removes disabled tools before any capability, deferred-group, or identity derivation.
  4. A disabled surface cannot expose load_tools, and a persisted historical load call cannot reactivate it.
  5. Deferred groups are derived only from the effective binding.
  6. Scoped child ctx.tools remains a hard ceiling. Projection must never reintroduce parent tools into a child binding.
  7. Child-session admission for the Agent surface consumes the same projection; it must not repeat an independent boolean decision.
  8. Execution identity records the normalized surface policy and exact effective product-tool names rather than a hand-maintained approximation.
  9. Harness and external tools—Heavy Task, Task Ledger experiments, MCP tools, provider-native tools, and Pi CLI tools—remain outside the product catalog. They may contribute explicitly labelled supplemental identity entries, but cannot manufacture catalog capabilities or deferred groups.

Scope

  • Introduce the immutable effective-surface result and pure projector.
  • Migrate standard Desktop, CLI, and Headless product-tool composition to it.
  • Remove replaced pre-policy name lists and parallel capability/group derivations.
  • Preserve model-specific and scoped child bindings as explicit projector inputs.
  • Add cross-host contract tests for projection consistency.

Prefer one cohesive PR. Split only if a real Desktop model-specific dependency requires it; do not leave a second production projection path.

Non-goals

Acceptance

  • Default Headless projection contains the six isolated tools, no Agent tools, no Agent deferred group, and no Agent child admission.
  • agentTools: true restores all four Agent tools as one deferred group and enables the corresponding child admission.
  • A historical load_tools(agent) event cannot revive a disabled Agent surface.
  • Desktop and CLI retain their current effective product surfaces.
  • HostCapabilities, deferred groups, provider-visible product tools, and product-tool identity are all derived from the same effective binding.
  • Scoped child bindings cannot regain omitted parent tools.
  • No entrypoint maintains a parallel effective product-tool name list.
  • Existing permission, Heavy Task, Task Ledger, MCP, provider-native, and Pi behavior remains unchanged.

Refs #1099 and #1488. This projector is compatible with the hosted-execution direction in #853 but does not depend on that migration.

Activity

  1. self-assigned this
    on Jul 28, 2026
  2. Astro-Han commented on Jul 28, 2026

    @Astro-Han
    ContributorAuthor

    I’m taking this. I’ll implement the issue as specified in one cohesive PR: add the pure effective product-tool surface projector, migrate Desktop, CLI, and Headless product-tool composition to it, and derive child admission and execution identity from the same projection. Harness and external tools, unrelated policy work, and broader Runtime Host migration remain out of scope.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions