feat(harness): add planner build plan authoring - #785
Conversation
Add strict, capability-scoped build-plan validation, atomic plan versioning, explicit source rebasing, focused planner context, and content-free telemetry. Closes: SAP-3068
Review — PR #785 (round 1)Public-copy hygiene: clean. Findings1. The shipped
|
…v1' into conductor/e4-sap-3068-authoring-tools
…v1' into conductor/e4-sap-3068-authoring-tools
Address review findings around exact-source CAS, durable replay, explicit rebase resolutions, fail-closed production boundaries, and planner context safety.\n\nRefs: SAP-3068
|
Addressed both review passes in Automated findings:
Independent findings:
Security coverage also exercises planned/manual builder denial, capability rotation/revocation, strict rejection of model-supplied scope, malformed collections, and cross-project source rejection. The #784 Fresh verification: 72 focused tests, typecheck, lint, build, 3,365 standard tests, and 10 performance tests all pass. Correction at |
Review — PR #785 (round 2, delta since
|
Closes: SAP-3068
|
Addressed the exact-head follow-up findings in
Fresh verification at the pushed head:
|
Closes: SAP-3068
|
Addressed the historical client-reference identity blocker in
Fresh verification at the pushed head: Prettier check; focused tests (6 files / 78 tests); typecheck; lint; production build; full harness suite (213 files / 3,384 tests plus 3 performance files / 10 tests); and stacked diff check all passed. |
Closes: SAP-3068
|
Correction and current-head remediation for the remaining concurrency gap, pushed in
Fresh exact-head verification: scoped Prettier check; focused tests (6 files / 81 tests); typecheck; lint; production build; full harness suite (213 files / 3,387 tests plus 3 performance files / 10 tests); and stacked diff check all passed. This remediation is ready for independent re-review; this response does not claim that review is complete. |
Primary change type
Problem and motivation
Trusted Agent Map planners need a structured, capability-bound way to author delivery intent without editing canonical files or giving builders global plan mutation authority. The E2 map tools cover architecture topology, but not exact-version build-plan creation, validation, atomic editing, or explicit source rebasing.
Summary and scope
Adds strict schemas and a transport-neutral
BuildPlanServicefor read, validate, apply, and rebase operations. The existing Agent Map MCP endpoint registers these tools only for server-resolved map-planner identities while preserving the shipped E2 surface for all trusted roles. The service enforces exact plan/source versions, project scope, atomic plan/assignment/brief/receipt persistence, request-ID replay protection, bounded safe results and ID mappings, update-only canonical identities, and explicit assignment/repository/artifact rebase resolutions through injected compiler and impact boundaries. Client-correlated server IDs are scoped by the prospective plan version, keeping validate/apply mappings identical at one expected state while preventing later reuse of a client reference from aliasing immutable historical identities.Planner create/resume context now carries a bounded exact-source/plan status, accurately describes the read/contracts-only transition, and tells the planner not to loop when authoring is unavailable. Content-free tool telemetry and security coverage verify role gating and prevent authored content from entering events. Production mutation composition fails closed with stable dependency errors until the follow-on installs the real brief compiler and impact evaluator. Confirmed-revision authoring likewise fails closed until the confirmed-revision persistence layer supplies an exact
AgentMapRevisionSnapshotreader; the current upstream revision work exposes contracts but no durable reader. Session creation, architecture confirmation, builder-result acceptance, repository creation, deployment, and E5 behavior remain out of scope.Related work
Closes: SAP-3068
Depends on: #784
Validation
Tests and documentation
Added strict-schema, service/idempotency/concurrency/atomicity/source-race/rebase, historical-read, mapping-boundary, canonical-ID authority, prospective-version identity, create-collision, atomic brief-history-limit, allocator-failure, MCP discovery/denial/telemetry, fail-closed full-server composition, and new/resumed focused-context tests. The identity regression verifies validate/apply mapping equality and a fresh canonical ID after create/remove/recreate with the same request-local client reference. Deterministic interleaving tests pause apply and rebase on their preflight store read, commit the same request reentrantly, and verify the outer call returns the persisted replay; a changed-payload race still returns
idempotency_key_reused. Updated the planner profile and session-start guidance; the production integration requirements are documented above because this is a capability-bound internal MCP surface.Compatibility and release impact
authoring_unavailableuntil the follow-on supplies production compiler/impact dependencies, and confirmed-revision operations returnrevision_source_unavailableuntil an exact revision reader is wired..changeset/quiet-planners-author.mdfor@sapiom/harness.Security
will follow the
Security Policy for
private reporting.
AI assistance
OpenAI Codex implemented the scoped schemas, service, MCP wiring, tests, and planner guidance from the approved SAP-3068 plan. The result was self-reviewed against the exact stacked diff and verified with focused tests, harness typecheck/lint, and the complete harness standard/performance suites.
Checklist
CONTRIBUTING.md, and this contribution follows the direct-PR or issue-first policy.any N/A checks above.