Skip to content

Add engine v2 action discovery metadata#2876

Merged
henrypark133 merged 8 commits intov2-engine-prompt-lifecycle-alignmentfrom
v2-engine-action-discovery-metadata
Apr 23, 2026
Merged

Add engine v2 action discovery metadata#2876
henrypark133 merged 8 commits intov2-engine-prompt-lifecycle-alignmentfrom
v2-engine-action-discovery-metadata

Conversation

@henrypark133
Copy link
Copy Markdown
Collaborator

Summary

  • add canonical discovery metadata to ActionDef and expose it through the engine crate
  • map registry-backed tool discovery metadata into projected engine-v2 actions and move mission action metadata into a dedicated bridge module
  • make engine-v2 tool_info read from the callable action snapshot first so advertised actions like mission_create are discoverable without changing callable exposure policy

Testing

  • cargo fmt --all
  • cargo test action_projector --lib
  • cargo test action_discovery --lib
  • cargo test tool_info_reads_callable_action_snapshot_for_engine_native_actions --lib
  • cargo test available_actions_surfaces_leased_mission_capability --lib
  • cargo test available_actions_respects_partial_lease_grant --lib
  • cargo test available_actions_omits_capability_without_lease --lib
  • cargo test mission_create_exposes_full_schema_and_curated_summary --lib
  • cargo test mission_update_has_curated_summary_but_minimal_actions_do_not --lib
  • cargo test --test engine_v2_gate_integration --no-run
  • cargo test --test engine_v2_skill_codeact --no-run
  • cargo test --test engine_v2_sandbox_integration --no-run

Closes #2793
Part of #2834 and Section 6 of #2767.

@github-actions github-actions Bot added scope: tool Tool infrastructure size: XL 500+ changed lines risk: medium Business logic, config, or moderate-risk modules contributor: core 20+ merged PRs labels Apr 23, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request implements an action discovery system that enables models to retrieve detailed metadata, including curated summaries and schema overrides, through a new tool_info action. Key changes include adding discovery fields to ActionDef, incorporating an available_actions_snapshot into the ThreadExecutionContext, and centralizing mission-related action definitions. Review feedback focuses on centralizing name-matching logic (handling hyphen and underscore normalization) within ActionDef for better consistency and performance, and improving error feedback in the bridge when an action cannot be resolved.

Comment thread crates/ironclaw_engine/src/types/capability.rs
Comment thread crates/ironclaw_engine/src/executor/orchestrator.rs Outdated
Comment thread crates/ironclaw_engine/src/executor/orchestrator.rs
Comment thread src/bridge/action_discovery.rs
Comment thread src/bridge/action_discovery.rs
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds engine-v2 action discovery metadata so tool_info(...) and prompt surfaces can access canonical discovery names, curated summaries, and (optionally) richer discovery schemas without widening the callable tool surface.

Changes:

  • Extended ironclaw_engine::ActionDef with optional ActionDiscoveryMetadata (+ helper methods for discovery name/schema/summary and name alias matching).
  • Added bridge-side action discovery plumbing: projected tool-backed actions now carry discovery metadata; mission action metadata moved into a dedicated engine_actions module.
  • Updated engine-v2 execution paths to snapshot callable actions into ThreadExecutionContext so tool_info can resolve engine-native actions that aren’t ToolRegistry-backed.

Reviewed changes

Copilot reviewed 30 out of 30 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/engine_v2_skill_codeact.rs Updates test ActionDef literals to include the new discovery field.
tests/engine_v2_sandbox_integration.rs Updates ThreadExecutionContext construction to include available_actions_snapshot.
tests/engine_v2_gate_integration.rs Updates test ActionDef literals and ThreadExecutionContext construction for new discovery/snapshot fields.
src/tools/mod.rs Re-exports ToolDiscoverySummary and require_* helpers for bridge/tool discovery code.
src/gate/approval.rs Updates test ActionDef literal to include discovery.
src/bridge/router.rs Routes mission actions via new engine_actions::mission_capability_actions() and updates context init.
src/bridge/mod.rs Registers new bridge modules (action_discovery, engine_actions).
src/bridge/llm_adapter.rs Adds tool description hinting to call tool_info when discovery metadata exists; updates tests.
src/bridge/engine_actions.rs New module defining mission actions + curated discovery summaries/schemas for engine-v2 surfacing.
src/bridge/effect_adapter.rs Adds snapshot-based canonical name resolution and snapshot-backed tool_info handling; adds tests.
src/bridge/action_projector.rs Projects ToolRegistry tools into ActionDefs with discovery metadata (summary + schema override).
src/bridge/action_discovery.rs New helper to resolve actions and serve tool_info responses from the callable-action snapshot.
crates/ironclaw_engine/src/types/capability.rs Adds discovery metadata structs/field to ActionDef and alias-aware matches_name.
crates/ironclaw_engine/src/traits/effect.rs Adds available_actions_snapshot to ThreadExecutionContext.
crates/ironclaw_engine/src/runtime/mission.rs Updates ThreadExecutionContext construction for new snapshot field.
crates/ironclaw_engine/src/runtime/manager.rs Updates test ActionDef literals for the new discovery field.
crates/ironclaw_engine/src/lib.rs Re-exports ActionDiscoveryMetadata and ActionDiscoverySummary.
crates/ironclaw_engine/src/gate/tool_tier.rs Updates test ActionDef literal to include discovery.
crates/ironclaw_engine/src/gate/pipeline.rs Updates test ActionDef literal to include discovery.
crates/ironclaw_engine/src/gate/lease.rs Updates test ActionDef literal to include discovery.
crates/ironclaw_engine/src/executor/thread_context.rs Updates ThreadExecutionContext construction for new snapshot field.
crates/ironclaw_engine/src/executor/structured.rs Updates tests/context construction and ActionDef literals for discovery/snapshot fields.
crates/ironclaw_engine/src/executor/scripting.rs Uses matches_name for alias-aware preflight + ensures gate paused action names are canonical.
crates/ironclaw_engine/src/executor/prompt.rs Updates test ActionDef literal to include discovery.
crates/ironclaw_engine/src/executor/orchestrator.rs Populates action snapshot and canonicalizes names for single/parallel action execution paths.
crates/ironclaw_engine/src/executor/loop_engine.rs Updates test ActionDef literals to include discovery.
crates/ironclaw_engine/src/executor/context.rs Updates ThreadExecutionContext construction for new snapshot field.
crates/ironclaw_engine/src/capability/registry.rs Updates test ActionDef literals to include discovery.
crates/ironclaw_engine/src/capability/policy.rs Updates test ActionDef literal to include discovery.
crates/ironclaw_engine/src/capability/planner.rs Updates test ActionDef literal to include discovery.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/bridge/action_discovery.rs Outdated
Comment thread crates/ironclaw_engine/src/types/capability.rs Outdated
Comment thread crates/ironclaw_engine/src/executor/orchestrator.rs Outdated
Comment thread crates/ironclaw_engine/src/executor/orchestrator.rs
Comment thread src/bridge/effect_adapter.rs
Comment thread src/bridge/effect_adapter.rs
* Add deferred action inventory groundwork

* fix(engine): address deferred action inventory follow-up

* fix(engine): address deferred inventory review feedback

* test: fix fmt and clippy failures
@github-actions github-actions Bot added scope: channel/web Web gateway channel scope: tool/builtin Built-in tools scope: tool/wasm WASM tool sandbox scope: llm LLM integration scope: extensions Extension management labels Apr 23, 2026
…ment' into v2-engine-action-discovery-metadata

# Conflicts:
#	crates/ironclaw_engine/src/executor/loop_engine.rs
@henrypark133 henrypark133 merged commit d7f1fd5 into v2-engine-prompt-lifecycle-alignment Apr 23, 2026
17 checks passed
@henrypark133 henrypark133 deleted the v2-engine-action-discovery-metadata branch April 23, 2026 21:55
henrypark133 added a commit that referenced this pull request Apr 23, 2026
* fix(engine): align prompt metadata refresh with resume state

* fix(engine): finish prompt refresh compaction coverage (#2869)

* fix(engine): preserve prompt refresh on resume (#2869)

* Add engine v2 action discovery metadata (#2876)

* Add engine v2 action discovery metadata

* fix(engine): address action discovery review (#2876)

* fix(engine): address follow-up review comments (#2876)

* fix(engine): satisfy clippy in orchestrator lookup

* fix(engine): propagate action snapshots in executor paths (#2876)

* fix(bridge): restrict tool_info to callable actions (#2876)

* [codex] Finish engine v2 deferred action inventory cleanup (#2889)

* Add deferred action inventory groundwork

* fix(engine): address deferred action inventory follow-up

* fix(engine): address deferred inventory review feedback

* test: fix fmt and clippy failures
henrypark133 added a commit that referenced this pull request Apr 25, 2026
…#2868)

* engine-v2: make available_actions callable-only for blocked providers

* fix(engine): address review fixture tempdir leak (#2868)

* engine-v2: refresh canonical prompt metadata on resume (#2869)

* fix(engine): align prompt metadata refresh with resume state

* fix(engine): finish prompt refresh compaction coverage (#2869)

* fix(engine): preserve prompt refresh on resume (#2869)

* Add engine v2 action discovery metadata (#2876)

* Add engine v2 action discovery metadata

* fix(engine): address action discovery review (#2876)

* fix(engine): address follow-up review comments (#2876)

* fix(engine): satisfy clippy in orchestrator lookup

* fix(engine): propagate action snapshots in executor paths (#2876)

* fix(bridge): restrict tool_info to callable actions (#2876)

* [codex] Finish engine v2 deferred action inventory cleanup (#2889)

* Add deferred action inventory groundwork

* fix(engine): address deferred action inventory follow-up

* fix(engine): address deferred inventory review feedback

* test: fix fmt and clippy failures

* engine-v2: trim unused callable discovery payload

* tests: restore env vars in review-fix cases

* engine-v2: populate callable snapshots consistently

* Unify v2 integration enablement on tool_activate

* engine-v2: tighten tool_info inventory and approvals

* llm: normalize tool_info hint syntax

* engine-v2: tighten tool_activate install approval lookup

* tests: align gmail settings-first flow with approval contract

* engine-v2: fix remaining tool surface review issues

* engine-v2: restore auto-approve defaults

* fix(engine): align v2 tool permissions with defaults

* fix(engine): close v2 callable snapshot gaps

* fix(bridge): label latent-only providers accurately
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor: core 20+ merged PRs risk: medium Business logic, config, or moderate-risk modules scope: channel/web Web gateway channel scope: extensions Extension management scope: llm LLM integration scope: tool/builtin Built-in tools scope: tool/wasm WASM tool sandbox scope: tool Tool infrastructure size: XL 500+ changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants