Repository navigation
refactor(capabilities): declare standalone and host-gated availability on the contract - #11270
Merged
Merged
Conversation
…y on the contract
Contracts declare availability: "standalone" or { host: <feature> }, and CapabilityInventory interprets the declaration once through one feature table, replacing 39 per-name branches. HOST_RESTRICTED_FEATURES moves to the contracts layer.
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Contributor
[Low impact] The PR appears safe to merge; no actionable issues were found. SummaryMoves availability declarations onto 44 tool contracts and replaces repeated name checks with shared rules in
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
Contracts["ToolContract.availability"] --> Inventory["CapabilityInventory"]
Policy["Host, configuration, and provider facts"] --> Inventory
Inventory --> Standalone["Standalone rules"]
Inventory --> Hosted["Host checks and EVM limiter"]
Inventory --> Existing["Existing named and provider rules"]
Standalone --> Result["Reported tool availability"]
Hosted --> Result
Existing --> Result
Reviews (1) · Last reviewed commit: "refactor(capabilities): declare standalo..." · Reviewed by Greptile |
19 tasks
Plastic-time
added a commit
to Plastic-time/rea
that referenced
this pull request
Nov 15, 2026
Main morluto#11264 registers service-backed MCP tools through one binding table, and morluto#11270 declares tool availability on the contract. The merge takes main's createServer.ts and CapabilityInventory.ts, then: - binds inspect_pe_rich_header in serviceToolBindings.ts and passes the service to registerServiceTools, like inspect_pe_imports; - marks the contract "standalone"; - removes registerPeRichHeaderTool.ts, as main removed its siblings.
20 of 29 tasks
Merged
19 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Part of plan W1 (one owner for adding a tool). The capability inventory decided most tools' availability with
name === "..."branches insrc/application/CapabilityInventory.ts(56 on main), so a new tool needed both a contract and a hand-written branch. Most branches said one of two things: the tool is a standalone workflow that is always available, or it is an optional host integration gated by host support and one configuration flag.Contracts now declare that with
availability: "standalone"oravailability: { host: <feature> }, and the inventory interprets the declaration once. 44 contracts declare it; the inventory has 17name ===checks left, all named rules that do not fit the two shapes.Refs #10583
Problem and expected behavior
Expected: a new standalone or host-gated tool is reported correctly by
list_capabilities/get_session_statusfrom its contract alone. Before (from reading the source, not run): without a matching branch, such a tool fell through to the provider rules for its kind, for exampleprovider_missingfor a native-provider tool that needs no deep provider.Change and scope
src/contracts/toolAvailability.ts(new):ToolAvailabilityDeclaration("standalone" | { host: HostRestrictedFeature }).HOST_RESTRICTED_FEATURESmoves here from the application layer so contracts can name a feature;sessionAvailabilityPolicy.tsimports it from here.ToolContract.availability?is declared on:persistentDebugger), JavaScript recovery, binary layout, recorded crash, packet capture (2), signal recording (2), pcap capture, EVM interface, firmware inspection and extraction.CapabilityInventory.ts:HOST_FEATURESgives each feature's configuration flag and remediation (the remediation strings are unchanged).hostFeatureAvailabilityapplies it through the existinghostRestrictedAvailability, so an unsupported host still takes precedence over configuration.webModuleImportAvailability), Wasm/WABT, the EVM limiter after its host check (evmLimiterAvailability), Android/ADB/Apktool/JEB owner probes, browser/electron/runtime providers, process capture, navigation context, and composed enhanced workflows.javascriptApplicationAvailabilityand the firmware-kind branch are deleted.Not included:
toolEffects.tsstill holds the effect audit per tool name; folding it into the contract declaration is the next W1 step, and the MCP binding loop is #11264.Contract and boundary impact
CapabilityInventoryis the only interpreter. The superseded name branches are removed.availabilityis an internal contract field; it is not part of any advertised schema, andnpm run verify:advertised-schemasreports the summary current.docs/public/product-catalog.json), package, or installation impact: none.Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
Evidence and regression coverage
src/application/CapabilityInventory.test.tsadds "declared contract availability", which is driven by the declarations themselves:unsupported_hostwith a remediation when its feature's host is unsupported.Validation performed
npm run test:focused -- src/application/CapabilityInventory.test.ts src/application/CapabilityInventory.optionalReads.test.ts src/application/binary/BinarySessionLiveness.test.ts src/application/binary/BinarySessionRefusalAlternatives.test.ts src/application/binary/BinarySessionStatus.test.ts tests/boundary/providers/readinessRemediationInventory.test.ts tests/boundary/providers/ida/idaCapabilityInventory.test.ts tests/boundary/mcp/serverIdentity.test.ts tests/boundary/mcp/sessionTargetRequirements.test.ts tests/boundary/evm/evmLimiterAvailability.test.ts tests/boundary/mcp/capabilityRemediationMcp.test.ts tests/boundary/mcp/debuggerHostAvailability.test.ts tests/boundary/mcp/packetCaptureAvailability.test.ts tests/boundary/mcp/sessionAvailabilityRecovery.test.ts tests/boundary/mcp/callRelationshipAvailability.test.ts tests/boundary/mcp/firmwareMcp.test.ts tests/boundary/mcp/signalRecordingMcp.test.ts tests/boundary/mcp/javascriptRecoveryMcp.test.ts tests/boundary/mcp/recordedCrashMcp.test.ts tests/boundary/mcp/pcapMcp.test.ts: 19 files passed and 2 skipped; 185 tests passed and 8 skipped.npx oxfmt --check .: passed.npm run check:fast: passed.node scripts/verify/architecture-guards.mjs: passed.npm run verify:advertised-schemas: passed.Compatibility, safety, and release
Author readiness
Human owner:
Before merge
type(scope): outcome.