feat(harness): add durable build planning contracts - #784
Conversation
Define strict versioned plan, brief, assignment, and submission records over exact Agent Map sources. Add canonical semantic and record digests, aggregate migration and integrity checks, exact-source resolution, validators, and crash-atomic persistence primitives. Closes: SAP-3067
Closes: SAP-3067
Follow-up review — PR #784 (delta since
|
Closes: SAP-3067
Expose the complete explicit v1 handoff type closure and key planning integrity verification by the raw bytes read from disk. Closes: SAP-3067
|
Addressed the follow-up review in
Fresh validation: focused 7 files / 46 tests, typecheck, lint, build, full harness 210 files / 3,339 tests, performance 3 files / 10 tests, Changeset status, PR labeler (21 tests), formatter, and diff checks all passed. |
Primary change type
Problem and motivation
E2 persists exact architecture proposal and revision history, but its project build-plan pointer had no durable delivery contract behind it. E4 needs immutable, exact-source-bound plans, focused agent briefs, stable planning assignments, and structured builder submissions without copying the architecture graph or relying on conversation transcripts.
Summary and scope
Adds strict versioned build-planning contracts and codecs; canonical semantic and full-record SHA-256 digests; exact proposal/revision source resolution; bounded deterministic completeness, relationship-aware dependency evidence, freshness, and eligibility validation; and crash-atomic build-planning history inside the existing per-project Agent Map aggregate. Stable agent assignment/brief identities, current-plan CAS for compiled briefs, request tombstones, explicit history quota errors, assignment/submission provenance integrity, and raw-content-keyed integrity caching are covered by persistence tests.
Relationship validation now projects E2 actor-oriented
readsedges into effective data-flow direction and validates producer/consumer paths through artifacts and resources. This letsResearch -> writes -> ResearchReportplusMarketing -> reads -> ResearchReportproveprovides-inputandconsumes-outputdependencies while preserving ownership-root, direction, and exact-contract checks; genericusesedges remain shared-resource evidence rather than producer/consumer proof.The package-root export is intentionally limited to exact-source references, stable plan/brief/assignment handoff references, the builder submission contract, their complete transitive branded/member type closure, and the shared source comparator required by downstream hosts. A package-root consumer test constructs and consumes the whole supported v1 handoff without subpath imports. Full persistence/compiler records remain internal. Authoring MCP tools, brief compilation, planning-session fan-out, repositories, deployment, and implementation authorization remain out of scope.
Related work
Related issue or discussion:
Closes: SAP-3067
Validation
Tests and documentation
Added contract/codec malformed fixtures, digest vectors, exact proposal/revision identity cases, populated E2 migration, current-plan CAS regression, ownership-root dependency and port evidence cases, golden writes/reads flow through an ownerless artifact with valid input-port linkage and wrong-direction/wrong-contract negatives, a package-root handoff consumer, same-size/restored-mtime tamper detection, idempotency tombstones, explicit history limits, corruption/provenance detection, restart/history, locking, pointer consistency, and atomic-write coverage. Documentation is N/A because this ticket adds an internal persistence foundation with no user-facing workflow; release and downgrade behavior is documented in the Changeset and compatibility section.
Compatibility and release impact
@sapiom/harnessChangeset with the v2 downgrade limitation.Security
will follow the
Security Policy for
private reporting.
AI assistance
OpenAI Codex implemented and revised the contracts, persistence primitives, validation, and tests. I inspected the complete diff against
origin/mainand verified it with focused tests, typecheck, lint, package build, the full harness test/performance suites, Changesets status, and the repository PR-template classifier.Checklist
CONTRIBUTING.md, and this contribution follows the direct-PR or issue-first policy.any N/A checks above.