Repository navigation
fix(publication): point deferred tools at their loader and fail open on executor failure (#968, #764, #934, #962) - #1007
Nicholas023 wants to merge 6 commits into
Conversation
A registered-but-unselected pool API answered direct dispatch with PUBLICATION_GRANT_UNAVAILABLE (retry: never) on the file-lease path and a bare POLICY_DENIED on the PTC-only path, neither naming the loader. The registrar lease contract gains an optional deferred() advisor that pool publications supply; both paths now answer SDK_NOT_LOADED with a next action naming ops_load_sdk and the raw name, and stay silent when the current policy cannot load the API. Loader-less scopes still register nothing from the pool (#887).
An unselected discovery capability answered direct dispatch with PUBLICATION_GRANT_UNAVAILABLE on the shared-file lease path and POLICY_DENIED on the provider path, with a next action that never mentioned the selector. Both paths now answer CAPABILITY_NOT_SELECTED with a select: query pointer; read-only scopes that can never select a mutating capability keep the generic refusal, and a committed selection stops answering with the deferred rejection.
…ve (#962) A pwsh shadow kept the official tool hidden even when the replacing Bash executor was dead, and a consumer whose Bash slot never resolved an executor still hid the official tools behind a foreign same-name registration. Replacement shadows now lift per agent once a counterpart call settles with an unrecoverable Bash preparation failure (runtime missing, IPC mismatch, lifecycle lock busy, cache unusable, incompatible build), and mountConsumer keeps the officials admitted when its own Bash slot never resolved. Staging interruptions that the next call repairs keep the shadow.
The retained file/shell row rendered its table from the root registration view, so a registered-but-unadmitted tool - a replacement shadow on a host whose definition reads ignore when - could appear in the read_image row while the step excluded it. The row now reads the calling scope admitted view with the step tool set and falls back from context.agent to context.scope. Host-side sections that read registrations directly remain an upstream boundary.
A no-entitled-grant call consulted only the first same-agent grant carrying a deferred() advisor; when that advisor answered undefined or threw, the caller got the generic PUBLICATION_GRANT_UNAVAILABLE even though a later grant could point at ops_load_sdk or ops_discover_tools. One entry can hold several same-agent file leases (a PTC pool grant and a discovery pool grant for the same public name), so the consultation now walks every same-agent advisor in grant order, returns the first outcome that carries an error, falls through undefined and throwing advisors, and keeps the honest generic denial when none can help. Regression: publication-registrar gains a three-advisor ordering test plus first-wins and helpless controls.
|
Coordination note from #997 (P5; branch on top of ).\n\nI read this PR before starting and agree its scope — #968 loader pointers (/), #764 discover pointers, #934 admitted-view tables, #962 fail-open — is owned here. To avoid duplicating it, P5 implements only what this PR does not cover, aligned with the D3 full-tier branch:\n\n1. Permission-forbidden verdict: a mutating API inside the configured pool but forbidden under read-only refuses with an explicit permission message and no load suggestion — through (today it misanswers for pool members) and through the definition dispatcher.\n2. Revoked verdict, distinct from never-loaded: withdrawn scope ownership, a permission downgrade on a previously-selected API, and a pulled registrar grant each answer their own revocation wording ( message distinction in , new in ) instead of the single "must be admitted"/"no eligible grant" refusal.\n3. No-tool-set diagnostics: a diagnostic assembly without a step tool set no longer consumes pending loads as though it were a first model request.\n\nFor consistency we reuse your spelling for the load pointer at the PTC dispatch layer; the deferred-advisor plumbing you own in stays untouched, so expect only a small textual conflict in the code union at merge time. |
Closes #968, #764, #934, #962
What was wrong
PUBLICATION_GRANT_UNAVAILABLE(retry: never) with no loader pointer.PUBLICATION_DENIED/POLICY_DENIEDwith noops_discover_toolspointer.The change
src/publication: deferred rejections now answerSDK_NOT_LOADED(namingops_load_sdkand the raw name, effective next model step) andCAPABILITY_NOT_SELECTED(namingops_discover_toolsand aselect:query), keeping the honest generic denial when the policy cannot load/select at all. The registrar consults every same-agentdeferred()advisor in grant order;undefined/throwing advisors no longer mask a later pointer.src/publication/replacements.ts: an unrecoverable counterpart executor failure (bash-runtime-missing,bash-ipc-mismatch,bash-lifecycle-lock-busy,bash-cache-unusable,bash-runtime-incompatible) stops hiding the official tools from that agent's next model step; staging interruptions that the next call repairs keep the replacement.src/legacy/host.ts: the tooling table is rendered from the calling scope's admitted view (step tool set with acontext.scopefallback).ptc-deferred-rejection4/4,discovery-deferred-rejection4/4,publication-fail-open4/4,publication-legacy-admission-surface2/2,publication-registrar14/14; 46-suite regression batch green;check:size826 files.Validation
The gate lines above were produced on the local integration head
b21274dd(all slices merged) with the pinned local fixtures:DSH_OPS_TEST_BASH= a verified pinned MSYS bash (sha256 6cc575e9…),DSH_OPS_NIUBASH_ARCHIVE= the shipped frozen archive. Each PR branch was also built and its own suites were run before push; the counts below are from those runs.CI required run: the pull_request event for this PR triggers
ci.yml; paste the aggregateCI requiredrun URL here once it finishes.Environment
maincommit58f6e281(origin/main at submission)npm ci --ignore-scripts --offline,npm run build,npm run stage:niubash -- --offline --archive <frozen archive>)