Skip to content

P1: bind authorized tool ceiling to durable agent execution and project selected tools at provider boundary #190

Description

@James3014

CONTRACT DELTA / IMPLEMENTATION HOLD — 2026-09-20
Keep the authorized-tool-ceiling invariant, but do not hard-wire it further into current provider-specific DevSpace adapters until #15 decides the execution-plane boundary. G1/G2 remain portable design requirements; implementation locus is unsettled.

Parent / authority boundary

Parent integration/governance owner: James3014/Nexus-new#982.

This child owns only the DevSpace execution-control side of the frozen G0/G1 seam. It does not select capabilities, route/provider/model/worker, create Nexus authority, or decide the Nexus Planner candidate-tool set.

AUTO_CHAIN=false.

Fresh evidence fence

Source/runtime rebound on 2026-09-18:

  • DevSpace GitHub/main: d0a616d2abdb13a08cdbd6e9e890a6ab9f4a7e9e
  • live primary source: d0a616d2abdb13a08cdbd6e9e890a6ab9f4a7e9e
  • live build: devspace-1.0.7-d0a616d2
  • live server instance: 6d56d227-fd9a-4656-acea-ddb4b18e7815
  • live capability manifest: 573adbf44929ea46ff88749f78e4e8ac8c612932165690828adedd33bcd71082

Canonical local checkout is not a safe mutation target: local main was behind origin and had an unrelated modification. Implementation must use an isolated worktree against fresh base.

Problem

The local-agent durable path currently persists ExecutionContract and binds the complete contract into the start-replay request hash, but provider launch receives only:

prompt
workspaceRoot
providerSessionId
writeMode
model
effort
cliProviderId
environment

There is no durable authorizedToolCeiling, no validated selectedTools subset passed to the provider boundary, and no canonical ToolProjectionManifest / actual-exposure evidence.

The existing ExecutionBinding type is useful normalized vocabulary but is not currently the persisted local-agent authority carrier. Do not create a second tool-scope truth owner around it.

Frozen authority invariant

trusted admission authority
  -> persisted ExecutionContract.authorizedToolCeiling
  -> validated selectedTools ⊆ authorizedToolCeiling
  -> derived ToolProjectionManifest
  -> leaf provider adapter
  -> actualExposedTools / authoritative constructed exposure
  • OWNER_DIRECT: the trusted Owner admission boundary supplies the exact ceiling. No Nexus grant or fabricated Planner identity.
  • NEXUS_GOVERNED: Nexus supplies a ceiling bound to its externally validated authority / Planner candidate-set lineage. DevSpace validates/transports it and never re-selects it.
  • Missing or mismatched ceiling on a tool-bearing projected execution fails closed.
  • No fallback to provider catalog/profile defaults/full tool universe.
  • tools_allowed or prompt/request policy is not authorization truth.
  • ToolProjectionManifest is evidence/derivation, never a Planner.

G0 provider-family classification

Family Current class for JIT subset Existing physical seam
Codex REQUEST_ONLY_NOT_ENFORCED Codex SDK thread/sandbox options; no selected-tool input in current path
Grok REQUEST_ONLY_NOT_ENFORCED ACP with empty external mcpServers; no selected built-in subset
Agy REQUEST_ONLY_NOT_ENFORCED ambient global MCP isolated, but built-in selected subset not projected
OMP ENFORCED_NATIVE_PROVIDER capable, JIT not wired DevSpace-owned config + CLI --tools fixed by write mode
Cline REQUEST_ONLY_NOT_ENFORCED ACP + empty external mcpServers + auto-approve/plan mode; no selected built-in subset
OpenCode ENFORCED_NATIVE_PROVIDER capable, JIT not wired SDK per-tool PermissionConfig, currently fixed by write mode

Do not generalize one adapter mechanism across all six families.

Required source delta

G1 — durable contract

Extend the persisted/replay-bound execution contract with one exact authorized tool ceiling and provenance sufficient to distinguish Owner-direct from Nexus-governed lineage.

Requirements:

  • canonical ordering / duplicate handling frozen;
  • deterministic ceiling hash;
  • ceiling participates in durable replay identity;
  • continuation cannot widen/change the ceiling;
  • compatibility copies, if any, must exactly match the durable authority;
  • legacy/no-tool behavior explicitly versioned or fail-closed where projection is requested.

G2 — selection/projection contract

Add one transport-neutral projection input/output contract:

  • task/attempt identity;
  • durable contract / replay identity;
  • authority mode + provenance;
  • authorized ceiling + hash;
  • selected tools + hash;
  • provider/model/profile/direct identity;
  • runtime/build identity;
  • enforcement mode;
  • projected/constructed exposure identity;
  • actual exposed tools/count where authoritatively observable;
  • observation status;
  • used tools where observable.

Reject before provider launch when selectedTools is not a subset of the ceiling.

G3 — native leaf adapters

Implement only proven native seams first:

  • OMP: derive --tools from validated projection instead of fixed write-mode-only set, while preserving effect/write restrictions.
  • OpenCode: derive per-tool permission config from validated projection while preserving non-tool authority boundaries.

No adapter may append defaults and still claim the smaller selected set.

G4 — truthful unsupported paths

For Codex/Grok/Agy/Cline, inspect the exact current provider-native/managed control surface.

  • If a real subset control exists, implement it at the smallest leaf seam with tests.
  • If not, emit REQUEST_ONLY_NOT_ENFORCED and NOT_OBSERVED; do not claim enforcement.
  • Existing sandbox/write/effect controls remain separate from tool-visibility enforcement.

G5 — negative/replay controls

At minimum:

  1. selected tool outside ceiling rejected pre-launch;
  2. changed ceiling under same attempt/replay identity rejected;
  3. continuation cannot widen;
  4. OWNER_DIRECT cannot carry Nexus grant/fake Planner provenance;
  5. NEXUS_GOVERNED cannot substitute owner-direct evidence;
  6. adapter cannot append a default tool and claim smaller exposure;
  7. provider/model/profile/runtime substitution invalidates projection evidence;
  8. request-only path cannot emit ENFORCED_*;
  9. missing exposure telemetry remains NOT_OBSERVED;
  10. timeout/outcome-unknown cannot cause broadened redispatch.

Non-goals

  • no CapabilityPlanner implementation in DevSpace;
  • no second tool registry;
  • no provider/model/worker routing;
  • no broad model/profile cleanup;
  • no benchmark conclusions;
  • no merge/deploy/restart/release authority from this Issue;
  • no false equivalence between effect sandboxing and tool-surface projection.

Acceptance evidence

Before Candidate acceptance:

  • exact base/head/diff;
  • focused execution-contract/replay tests;
  • OMP and OpenCode positive + hostile projection tests;
  • truthful unsupported-path tests;
  • continuation/replay tamper tests;
  • affected local-agent regression suite;
  • typecheck/build;
  • git diff --check;
  • independent review confirms no second Planner/router/tool-registry/authority was created.

Live cross-provider physical canaries remain owned/coordinated by Nexus-new#982.

Exact next gate

DEVSPACE_G1_DURABLE_TOOL_CEILING_CONTRACT_TASK_CARD_OR_EQUIVALENT_GOVERNED_AUTHORITY

This change touches execution authorization semantics. Do not mutate source until the repository's governed mutation authority is satisfied.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions