Repository navigation
Cut Agent over to the catalog-driven provider boundary - #12
Conversation
There was a problem hiding this comment.
Pull request overview
This PR completes the cutover to a catalog-driven capacity-provider boundary by removing the embedded control-plane/API + legacy agent runtime surface, and leaving a smaller outbound-only provider runtime that relies on SDK RC18 catalog contracts and a trusted external executor module.
Changes:
- Removed the embedded API/SDK runtime surfaces, legacy tests/fixtures, and deployment templates that belonged to the prior control-plane-in-agent model.
- Introduced a trusted executor boundary (loader + contracts) and modernized provider runner tests around catalog-driven lifecycle calls.
- Updated provider configuration/manifest terminology from “Market” to “control plane/server profile”, plus associated packaging and build outputs.
Reviewed changes
Copilot reviewed 133 out of 308 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| vitest.config.ts | Simplifies Vitest configuration to only run modern tests. |
| treeseed.package.yaml | Removes Railway-specific capacity provider block from package metadata. |
| tests/unit/provider/runtime-event-reporter.test.ts | Removes legacy provider event reporter unit tests. |
| tests/unit/provider/error-diagnostics.test.ts | Removes legacy provider error diagnostics unit tests. |
| tests/unit/provider/disk-capacity.test.ts | Removes legacy disk capacity admission unit tests. |
| tests/unit/provider/configuration/runtime-version.test.ts | Removes legacy runtime version unit test. |
| tests/unit/provider/capabilities.test.ts | Removes legacy provider capabilities unit test. |
| tests/unit/provider/budgets.test.ts | Removes legacy provider budget discovery unit test. |
| tests/unit/provider/assignment-result-reporter.test.ts | Removes legacy assignment completion/retry unit tests. |
| tests/unit/provider/assignment-performance-summary.test.ts | Removes legacy performance summary unit test. |
| tests/unit/agents/workflow-execution-provider.test.ts | Removes legacy workflow execution provider adapter unit test. |
| tests/unit/agents/validation/failure-classifier.test.ts | Removes legacy agent failure classification unit test. |
| tests/unit/agents/validation/early-completion.test.ts | Removes legacy early-completion validation unit test. |
| tests/unit/agents/tools/operational-content-response.test.ts | Removes legacy operational content tool unit test suite. |
| tests/unit/agents/timing/assignment-status-tool.test.ts | Removes legacy assignment status timing unit test. |
| tests/unit/agents/timing/assignment-process-timeout.test.ts | Removes legacy assignment process timeout unit test. |
| tests/unit/agents/timing/assignment-activity-tool.test.ts | Removes legacy assignment activity tool unit test. |
| tests/unit/agents/fallback-controller.test.ts | Removes legacy fallback controller unit test. |
| tests/unit/agents/execution-retry-propagation.test.ts | Removes legacy execution retry propagation unit test. |
| tests/unit/agents/definitions/agent-definition-compatibility.test.ts | Removes legacy agent definition compatibility unit test. |
| tests/unit/agents/contributions/non-agpl-contribution-policy.test.ts | Removes legacy contribution-policy unit test. |
| tests/unit/agents/content-artifacts.test.ts | Removes legacy content artifact ownership unit test. |
| tests/unit/agents/agent-tool-schema.test.ts | Removes legacy agent tool JSON schema validation unit test. |
| tests/unit/agents/agent-authoring-diagnostics.test.ts | Removes legacy authoring diagnostics unit test. |
| tests/unit/agents/adapters/opencode.test.ts | Removes legacy OpenCode adapter unit test. |
| tests/unit/agents/adapters/codex-child-pipe-guard.test.ts | Removes legacy Codex child-pipe guard unit test. |
| tests/support/setup-runtime.ts | Removes global test runtime setup file used by legacy suites. |
| tests/modern/provider-runner.test.ts | Adds focused tests for the catalog-driven provider assignment runner. |
| tests/modern/provider-boundary.test.ts | Adds boundary/ownership tests (no raw /v1, no Market terminology, fail-closed executor). |
| tests/integration/services/agent-worktrees.test.ts | Removes legacy integration tests for agent worktrees. |
| tests/integration/provider/testing/connection-scheduler.test.ts | Removes legacy provider scheduler integration tests. |
| tests/integration/provider/projects/projects-core/availability-projection.test.ts | Removes legacy availability projection integration test. |
| tests/integration/provider/coordination/provider-market-client.test.ts | Removes legacy “Market” client integration tests. |
| tests/integration/provider/capacity/providers/execution-provider-selection.test.ts | Removes legacy execution-provider selection integration tests. |
| tests/integration/provider/accounts/manager-session-recovery.test.ts | Removes legacy manager session recovery integration test. |
| tests/integration/agents/testing/message-chain.test.ts | Removes legacy message-chain suite integration test. |
| tests/integration/agents/capacity/providers/codex-provider.recovers-required-response-suspension-from-durable-tool-evidence.test.ts | Removes legacy Codex reconciliation integration test. |
| tests/integration/agents/agent-tool-copilot.test.ts | Removes legacy Copilot tool integration test. |
| tests/fixtures/runtime-site/treeseed.site.yaml | Removes legacy runtime-site fixture config. |
| tests/fixtures/runtime-site/src/manifest.yaml | Removes legacy runtime-site fixture manifest. |
| tests/fixtures/agent-tests/workday-reporter/basic/trigger-message.json | Removes legacy agent-tests fixture. |
| tests/fixtures/agent-tests/workday-reporter/basic/expected-result.json | Removes legacy agent-tests fixture. |
| tests/fixtures/agent-tests/releaser/basic/trigger-message.json | Removes legacy agent-tests fixture. |
| tests/fixtures/agent-tests/releaser/basic/expected-result.json | Removes legacy agent-tests fixture. |
| tests/fixtures/agent-tests/knowledge-optimizer/basic/trigger-message.json | Removes legacy agent-tests fixture. |
| tests/fixtures/agent-tests/knowledge-optimizer/basic/expected-result.json | Removes legacy agent-tests fixture. |
| tests/fixtures/agent-tests/knowledge-generator/basic/trigger-message.json | Removes legacy agent-tests fixture. |
| tests/fixtures/agent-tests/knowledge-generator/basic/expected-result.json | Removes legacy agent-tests fixture. |
| tests/fixtures/agent-tests/governed-mutation/basic/chain.json | Removes legacy agent-tests fixture. |
| tests/fixtures/agent-tests/governance-steward/basic/trigger-message.json | Removes legacy agent-tests fixture. |
| tests/fixtures/agent-tests/governance-steward/basic/expected-result.json | Removes legacy agent-tests fixture. |
| tests/fixtures/agent-tests/docs-reviewer/basic/trigger-message.json | Removes legacy agent-tests fixture. |
| tests/fixtures/agent-tests/docs-reviewer/basic/expected-result.json | Removes legacy agent-tests fixture. |
| tests/fixtures/agent-tests/docs-planner/basic/trigger-message.json | Removes legacy agent-tests fixture. |
| tests/fixtures/agent-tests/docs-planner/basic/expected-result.json | Removes legacy agent-tests fixture. |
| tests/fixtures/agent-tests/docs-engineer/basic/trigger-message.json | Removes legacy agent-tests fixture. |
| tests/fixtures/agent-tests/docs-engineer/basic/expected-result.json | Removes legacy agent-tests fixture. |
| tests/fixtures/agent-tests/codebase-cartographer/basic/trigger-message.json | Removes legacy agent-tests fixture. |
| tests/fixtures/agent-tests/codebase-cartographer/basic/expected-result.json | Removes legacy agent-tests fixture. |
| tests/contract/provider/workday-contracts.test.ts | Removes legacy provider workday contract tests. |
| tests/contract/provider/provider-architecture.test.ts | Removes legacy provider architecture contract tests. |
| tests/contract/package/release-version.test.ts | Removes legacy release version policy tests. |
| tests/contract/agents/verified-context-query-input.test.ts | Removes legacy verified context query contract test. |
| tests/contract/agents/starter-contracts.test.ts | Removes legacy starter contract tests. |
| tests/contract/agents/agent-contracts.test.ts | Removes legacy agent contract tests. |
| templates/railway/capacity-provider.yml | Removes Railway deployment template. |
| templates/github/deploy-capacity-provider.workflow.yml | Updates wording to “trusted provider-host secrets”. |
| src/services/runtime-paths.ts | Removes legacy processing/runtime path helpers. |
| src/services/report-paths.ts | Removes legacy workspace report path utilities. |
| src/services/approval-policy.ts | Removes legacy approval policy helpers tied to removed surfaces. |
| src/services/agent-worktrees.ts | Removes legacy worktree manager implementation. |
| src/provider/treedx/repositories/treedx-handle.ts | Removes legacy TreeDX handle normalization. |
| src/provider/reporting/runtime-event-reporter.ts | Removes legacy runtime event reporting helper. |
| src/provider/reporting/mode-run-reporter.ts | Removes legacy mode-run telemetry helper. |
| src/provider/reporting/message-recorder.ts | Removes legacy message recorder helper. |
| src/provider/reporting/error-diagnostics.ts | Removes legacy error diagnostics helper. |
| src/provider/reporting/codex-event-message.ts | Removes legacy Codex event message helper. |
| src/provider/projects/projects-core/availability-projection.ts | Removes legacy availability projection implementation. |
| src/provider/operations/runner-contracts.ts | Removes legacy runner contract types. |
| src/provider/lifecycle/entrypoint.ts | Removes legacy Codex-auth materialization path from provider entrypoint. |
| src/provider/execution/promise-timeout.ts | Removes legacy promise timeout helper. |
| src/provider/execution/kernel-bridge-support.ts | Removes legacy kernel bridge support helpers. |
| src/provider/execution/executor-loader.ts | Adds trusted executor module loader with caching and validation. |
| src/provider/execution/contracts.ts | Adds executor request/result/observation contracts for external executors. |
| src/provider/coordination/lease-client.ts | Removes legacy lease client proxy/boundary utilities. |
| src/provider/coordination/contracts.ts | Adds minimal control-plane connection contract. |
| src/provider/coordination/connection-state.ts | Renames connection state fields from Market to control plane/server profile terminology. |
| src/provider/coordination/client.ts | Renames client creation to “control plane” and adds operation-path derivation helper. |
| src/provider/configuration/value-utils.ts | Removes legacy value utility helpers. |
| src/provider/configuration/manifest.ts | Renames profile env var helpers and resolves control-plane URL/audience via server profiles. |
| src/provider/configuration/capabilities.ts | Changes capability discovery to advertise “external-executor” only when configured. |
| src/provider/capacity/assignments/kernel-assignment.ts | Removes legacy kernel assignment shaping. |
| src/provider/capacity/assignments/assignment-tool-policy.ts | Removes legacy tool policy extraction helpers. |
| src/provider/capacity/accounting/usage-reporter.ts | Removes legacy usage accounting helpers. |
| src/provider/accounts/identity.ts | Replaces identity/proof generation with local Ed25519 JWK + signed proof helper. |
| src/provider-governance.ts | Updates public exports to the new control-plane naming. |
| src/index.ts | Shrinks public package surface to provider runtime + executor boundary exports. |
| src/api/support/templates.ts | Removes embedded API template catalog loader. |
| src/api/support/server.ts | Removes embedded API server entrypoint. |
| src/api/support/sdk-routes.ts | Removes embedded API SDK route surface. |
| src/api/support/sdk-dispatch.ts | Removes embedded API SDK dispatch helper. |
| src/api/support/http.ts | Removes embedded API HTTP helper utilities. |
| src/api/support/capabilities.ts | Removes embedded API capability helpers. |
| src/api/support/app.ts | Removes embedded API router/app wiring. |
| src/api/projects/projects-core/project-route-helpers.ts | Removes embedded API project route helper utilities. |
| src/api/operations/operations.ts | Removes embedded API workflow operation execution. |
| src/api/operations/operations-routes.ts | Removes embedded API operation routes. |
| src/api/index.ts | Removes embedded API exports. |
| src/api/hosting/railway.ts | Removes Railway-hosted embedded API server implementation. |
| src/api/capacity/providers/providers.ts | Removes embedded API provider registry resolution. |
| src/api/auth/tokens.ts | Removes embedded API token implementation. |
| src/api/auth/d1-database.ts | Removes embedded API D1 database wiring. |
| src/agents/tools/treedx-proxy-tool.ts | Removes legacy TreeDX proxy tool schema definitions. |
| src/agents/tools/status/assignment-status-tool.ts | Removes legacy assignment status tool implementation. |
| src/agents/tools/status/assignment-activity-tool.ts | Removes legacy assignment activity tool implementation. |
| src/agents/tools/runtime/agent-tool-runtime-types.ts | Removes legacy agent tool runtime types. |
| src/agents/tools/path-scope/path-matcher.ts | Removes legacy path scope matcher. |
| src/agents/tools/content/relation-validation.ts | Removes legacy content relation validation helper. |
| src/agents/tools/assignment/discussion-tool.ts | Removes legacy assignment discussion tool implementation. |
| src/agents/tools/agent-tool-copilot.ts | Removes legacy Copilot tool mapping implementation. |
| src/agents/testing/e2e-harness.ts | Removes legacy e2e harness exports. |
| src/agents/support/spec-types.ts | Removes legacy agent spec normalization types. |
| src/agents/support/spec-loader.ts | Removes legacy agent spec loader. |
| src/agents/support/registry-helper.ts | Removes legacy registry helper. |
| src/agents/support/cli.ts | Removes legacy agent CLI implementation. |
| src/agents/kernel/validation/output-validator.ts | Removes legacy output validation logic. |
| src/agents/kernel/validation/fallback-controller.ts | Removes legacy fallback controller. |
| src/agents/kernel/validation/failure-classifier.ts | Removes legacy failure classifier. |
| src/agents/kernel/telemetry/telemetry.ts | Removes legacy kernel telemetry recording. |
| src/agents/kernel/telemetry/activity-profile-resolver.ts | Removes legacy activity profile resolver. |
| src/agents/kernel/runtime/runtime-helpers.ts | Removes legacy runtime helpers (incl. timeouts). |
| src/agents/kernel/runtime/kernel-runtime.ts | Removes legacy kernel runtime resolver/inspector. |
| src/agents/kernel/execution/run-types.ts | Removes legacy execution run types. |
| src/agents/kernel/execution/execution-result.ts | Removes legacy bounded result builder. |
| src/agents/kernel/capacity/assignments/assignment-preflight.ts | Removes legacy assignment preflight logic. |
| src/agents/kernel/artifacts/artifact-receipts.ts | Removes legacy artifact receipt helpers. |
| src/agents/index.ts | Removes legacy agents module export. |
| src/agents/handlers/writer.ts | Removes legacy writer handler. |
| src/agents/handlers/shared.ts | Removes legacy handler shared utilities. |
| src/agents/handlers/results/execution-content-completion.ts | Removes legacy execution completion evidence builder. |
| src/agents/handlers/reporter.ts | Removes legacy reporter handler. |
| src/agents/handlers/releaser.ts | Removes legacy releaser handler. |
| src/agents/handlers/execution-content-artifacts.ts | Removes legacy execution content artifact receipt collector. |
| src/agents/handlers/actor.ts | Removes legacy actor handler. |
| src/agents/contracts/run.ts | Removes legacy run contract types. |
| src/agents/contracts/research.ts | Removes legacy research note contract. |
| src/agents/content/content-artifacts.ts | Removes legacy content artifact path utilities. |
| src/agents/cli-tools.ts | Removes legacy CLI tools re-export. |
| src/agents/adapters/tools/verification.ts | Removes legacy verification adapter. |
| src/agents/adapters/tools/research.ts | Removes legacy research adapter. |
| src/agents/adapters/tools/mutations.ts | Removes legacy mutation adapter. |
| src/agents/adapters/runtime/codex-runtime-home.ts | Removes legacy Codex runtime-home helper. |
| src/agents/adapters/repositories/repository.ts | Removes legacy repository inspection adapter. |
| src/agents/adapters/codex/execution-codex.ts | Removes legacy Codex execution exports. |
| src/agents/adapters/codex/execution-codex-stream.ts | Removes legacy Codex streaming helper. |
| src/agents/adapters/codex/execution-codex-redaction.ts | Removes legacy Codex redaction helper. |
| src/agents/adapters/codex/execution-codex-receipts.ts | Removes legacy Codex receipts helpers. |
| src/agents/adapters/codex/execution-codex-deadline.ts | Removes legacy Codex deadline contract helper. |
| src/agents/adapters/codex/codex-child-pipe-guard.ts | Removes legacy Codex child pipe guard implementation. |
| src/agents/adapters/accounts/notification.ts | Removes legacy notification adapter. |
| src/agents/adapters/accounts/codex-auth.ts | Removes legacy Codex auth materialization helper. |
| scripts/support/verify-driver.ts | Simplifies verify driver to directly run verify:direct. |
| scripts/capacity/providers/test-capacity-provider-live-tools.ts | Removes legacy live-tools acceptance script. |
| scripts/capacity/providers/build-capacity-provider-container.ts | Removes Railway-related pruning for runtime container build. |
| scripts/build/build-dist.ts | Updates dist build to exclude scripts/templates; still flattens dist/src into dist. |
| scripts/agents/test-agent-contracts.ts | Removes legacy agent contract test runner script. |
| scripts/agents/agents.ts | Removes legacy agents CLI wrapper script. |
| docs/src/content/objectives/core.md | Updates the core objective to reflect the outbound-only provider boundary. |
| Dockerfile | Removes copying templates/docs into the container; removes Railway runtime stage. |
| .github/workflows/content.yml | Removes obsolete content-publisher workflow. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| @@ -1,12 +1,10 @@ | |||
| import { chmodSync, copyFileSync, cpSync, existsSync, mkdirSync, readdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs'; | |||
| import { copyFileSync, existsSync, mkdirSync, readdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs'; | |||
Independent-review availability receiptExact head GitHub rejected the requested |
Outcome
Agent becomes a small outbound-only capacity-provider runtime: API owns authority and scheduling, SDK owns portable contracts and the remote client, and Agent owns trusted execution, provider custody, recovery, usage, and terminal evidence.
Work authority
Contributor mode (select one):
Plan
Remove embedded control-plane and SDK implementation, retain only provider-side responsibilities, adopt SDK RC18 catalog clients, add a trusted executor boundary, replace legacy tests with focused modern checks, and leave live execution fail-closed.
Changes and commits
Verification
Risk and rollback
This is an intentional prerelease break. Without TREESEED_AGENT_EXECUTOR_MODULE the provider advertises no executable capacity and leases no work. Roll back by reverting the two listed commits before staging integration; no database, TreeDX, workday, assignment, image, or production mutation occurred.
Completion summary
The embedded API, public Agent CLI/SDK runtime, raw dispatch/content implementations, stale integrations, content publisher, and their legacy tests are removed. The remaining runtime is independently buildable and catalog-driven. Hosted exact-head checks and independent review remain the next acceptance actions.
Submission checklist