-
Notifications
You must be signed in to change notification settings - Fork 0
Add supervisor executor adapter contract #482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,137 @@ | ||
| # Supervisor Executor Adapter Gateway Contract | ||
|
|
||
| ## Purpose | ||
|
|
||
| This document is the first SpecGraph-side contract surface for proposal | ||
| `0056_supervisor_executor_adapter_gateway`. | ||
|
|
||
| The gateway is a launch-and-observe boundary for nested supervisor executors. It | ||
| does not implement a BYOK demo, a SpecSpace UI, a container runner, or an | ||
| alternate executor backend. It defines the request and report shapes that future | ||
| runtime implementations must use when they connect external executors to | ||
| SpecGraph. | ||
|
|
||
| ## Boundary | ||
|
|
||
| ```text | ||
| SpecGraph supervisor | ||
| -> bounded executor request | ||
| -> executor adapter gateway | ||
| -> backend-specific runner | ||
| -> normalized executor report | ||
| -> supervisor validation and gates | ||
| ``` | ||
|
|
||
| The adapter gateway is not the trust boundary. It prepares a backend-specific | ||
| run and reports what happened. Existing deterministic supervisor validation | ||
| continues to decide whether the run is acceptable. | ||
|
|
||
| ## Responsibility Split | ||
|
|
||
| The executor adapter gateway is the current in-repository anti-corruption layer | ||
| between deterministic SpecGraph core behavior and future non-deterministic agent | ||
| runtime behavior. | ||
|
|
||
| SpecGraph owns: | ||
|
|
||
| - canonical graph state; | ||
| - specification and proposal records; | ||
| - deterministic validation; | ||
| - search, indexing, reports, and lifecycle state; | ||
| - supervisor planning state and review gates. | ||
|
|
||
| The gateway owns only the boundary: | ||
|
|
||
| - normalize a bounded execution request; | ||
| - invoke an external executor adapter; | ||
| - collect the structured report contract; | ||
| - classify execution results without deciding graph acceptance. | ||
|
|
||
| A future dedicated SpecAgent runtime may own provider adapters, sandbox runtime, | ||
| agent identity, capability enforcement, BYOK execution, and tool policy. That | ||
| future extraction is justified only after real runtime use cases prove the | ||
| boundary: for example a second executor backend, direct SpecSpace job execution, | ||
| separate deploy secrets, or provider-dependent release cadence. | ||
|
|
||
| ## Request Contract | ||
|
|
||
| A bounded executor request must contain: | ||
|
|
||
| - `request_id`: stable request identifier for correlation. | ||
| - `workspace_root`: repo-relative or sandbox-root workspace reference. | ||
| - `target_ref`: target spec, proposal, operator request, or smoke fixture. | ||
| - `provider_config_ref`: opaque runtime provider configuration reference. | ||
| - `policy_envelope`: sandbox, approval, allowed-path, and timeout constraints. | ||
| - `capability_envelope`: declared backend capabilities for this run. | ||
|
|
||
| The gateway must not store API key values, raw provider secrets, billing account | ||
| details, or web authentication session data. BYOK-style provider configuration | ||
| is represented only through `provider_config_ref`. | ||
|
|
||
| ## Report Contract | ||
|
|
||
| A normalized executor report must contain: | ||
|
|
||
| - `request_id`: the request being answered. | ||
| - `run_id`: concrete executor run identifier. | ||
| - `status`: `ready`, `blocked`, or `failed`. | ||
| - `logs_ref`: redacted/local-only log reference. | ||
| - `produced_artifacts`: repo-relative artifacts produced by the run. | ||
| - `policy_decisions`: adapter-side policy decisions and denials. | ||
| - `error_class`: normalized failure class. | ||
|
|
||
| `status: ready` means the executor produced a report that can enter supervisor | ||
| validation. It does not mean the task succeeded, the graph should be mutated, or | ||
| review gates can be skipped. | ||
|
|
||
| ## Error Classes | ||
|
|
||
| The initial normalized error vocabulary is: | ||
|
|
||
| - `none` | ||
| - `provider_config_missing` | ||
| - `auth_unavailable` | ||
| - `unsupported_backend` | ||
| - `policy_denied` | ||
| - `timeout` | ||
| - `protocol_failure` | ||
| - `executor_crash` | ||
| - `unknown` | ||
|
|
||
| Backends may produce backend-specific details, but viewer-facing projections | ||
| should use the normalized class first. | ||
|
|
||
| ## BYOK/Demo Precursor | ||
|
|
||
| This contract intentionally supports a future BYOK demo through | ||
| `provider_config_ref`, not through stored secrets. | ||
|
|
||
| Out of scope for this contract slice: | ||
|
|
||
| - SpecSpace login. | ||
| - BYOK form. | ||
| - OpenAI billing or account logic. | ||
| - Timeweb deployment wiring. | ||
| - Real Codex/Copilot/Claude/Gemini container runner. | ||
| - Agent Passport enforcement implementation. | ||
|
|
||
| ## Safety Requirements | ||
|
|
||
| - The gateway must not persist raw prompt text or secrets. | ||
| - Backend fallback must not broaden permissions. | ||
| - Unsupported backends must fail before launch. | ||
| - Experimental backends require explicit operator selection. | ||
| - Canonical mutations require normal supervisor validation. | ||
| - Raw logs are local-only unless redacted into a derived artifact. | ||
| - Adapter success is never final supervisor success. | ||
|
|
||
| ## Policy Artifact | ||
|
|
||
| The machine-readable policy surface is: | ||
|
|
||
| ```text | ||
| tools/supervisor_executor_adapter_policy.json | ||
| ``` | ||
|
|
||
| The policy declares request/report required fields, status vocabulary, error | ||
| classes, BYOK boundary rules, and non-overridable invariants. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2723,13 +2723,52 @@ | |
| "proposal_id": "0056", | ||
| "posture": "bounded_runtime_followup", | ||
| "runtime_surfaces": [ | ||
| "tools/supervisor.py", | ||
| "tests/test_supervisor.py", | ||
| "tools/supervisor_executor_adapter_policy.json", | ||
| "docs/supervisor_executor_adapter_gateway_contract.md", | ||
| "docs/proposals/0056_supervisor_executor_adapter_gateway.md" | ||
| ], | ||
| "runtime_markers": [], | ||
| "validation_markers": [], | ||
| "observation_markers": [] | ||
| "runtime_markers": [ | ||
| { | ||
| "path": "tools/supervisor_executor_adapter_policy.json", | ||
| "pattern": "\"artifact_kind\": \"supervisor_executor_adapter_policy\"" | ||
| }, | ||
|
Comment on lines
+2730
to
+2734
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
With these runtime markers satisfied by only the new policy JSON/docs, Useful? React with 👍 / 👎. |
||
| { | ||
| "path": "tools/supervisor_executor_adapter_policy.json", | ||
| "pattern": "\"request_contract\"" | ||
| }, | ||
| { | ||
| "path": "tools/supervisor_executor_adapter_policy.json", | ||
| "pattern": "\"report_contract\"" | ||
| }, | ||
| { | ||
| "path": "docs/supervisor_executor_adapter_gateway_contract.md", | ||
| "pattern": "## Request Contract" | ||
| }, | ||
| { | ||
| "path": "docs/supervisor_executor_adapter_gateway_contract.md", | ||
| "pattern": "## Report Contract" | ||
| } | ||
| ], | ||
| "validation_markers": [ | ||
| { | ||
| "path": "tests/test_supervisor.py", | ||
| "pattern": "def test_supervisor_executor_adapter_policy_declares_request_report_contract(" | ||
| }, | ||
| { | ||
| "path": "tests/test_supervisor.py", | ||
| "pattern": "def test_proposal_0056_executor_adapter_contract_runtime_is_covered(" | ||
| } | ||
| ], | ||
| "observation_markers": [ | ||
| { | ||
| "path": "docs/supervisor_executor_adapter_gateway_contract.md", | ||
| "pattern": "tools/supervisor_executor_adapter_policy.json" | ||
| }, | ||
| { | ||
| "path": "docs/proposals/0056_supervisor_executor_adapter_gateway.md", | ||
| "pattern": "## Contract-Only Realization Slice" | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "proposal_id": "0057", | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This new contract is published technical guidance for future executor implementations, but the commit does not add a corresponding
Sources/SpecGraph/Documentation.docc/page or updatetools/docc_sync_contract.json.AGENTS.mdrequires DocC to stay synchronized wheneverdocs/changes affect published technical guidance, so the public DocC docs will omit this executor adapter contract while the repository docs present it as canonical.Useful? React with 👍 / 👎.