feat: add task proof sdk#36
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds an initial public “task/proof SDK” surface to compute-core by introducing portable task/lease/network/P2P wire contracts under protocol/, plus a minimal HTTP client for task submission and read-only observation (task listing/snapshot and proof listing/lookup). It also documents the boundary that scheduling/worker lifecycle/settlement/etc. remain outside compute-core.
Changes:
- Add public protocol types and validation for tasks, leases, network policy, and P2P session policy.
- Add a small
net/httpclient with strict JSON decoding and a token-over-HTTPS (non-loopback) guard. - Add focused protocol/client/compatibility tests and supporting plan/design documentation.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents the expanded public SDK scope and explicitly preserves the compute-core boundary. |
| protocol/types.go | Adds new public wire contracts (Task/Lease/NetworkPolicy/P2P) and validation helpers. |
| protocol/task_test.go | Introduces contract validation tests for the new Task and Lease types. |
| protocol/product_capture_compat_test.go | Adds a compatibility proof test for the public symbol surface needed by product-capture. |
| protocol/client.go | Implements the minimal task/proof HTTP client plus strict decode and safety guards. |
| protocol/client_test.go | Adds httptest coverage for auth header behavior, strict decode, status errors, and HTTPS token guard. |
| docs/plans/2026-06-06-task-proof-sdk.md.scope-lock | Adds the scope-lock hash for the plan. |
| docs/plans/2026-06-06-task-proof-sdk.md | Adds the executable implementation plan for this phase. |
| docs/plans/2026-06-06-task-proof-sdk-plan-review.md | Adds the plan adversarial review report. |
| docs/plans/2026-06-06-task-proof-sdk-design.md | Adds the design document for the SDK surface and boundaries. |
| docs/plans/2026-06-06-task-proof-sdk-design-review.md | Adds the design adversarial review report. |
| docs/plans/2026-06-06-task-proof-sdk-alignment.md | Adds design/plan alignment reporting. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Scope
This is Phase 1, compute-core PR only. It intentionally does not change workflow-compute, switch product-capture imports, deploy staging, register local agents, tag a release, or extract a reusable control plane.
TDD Evidence
Task/lease RED:
GOWORK=off go test ./protocol -run 'Test(TaskValidatesPortableWorkloadContract|TaskRejectsMalformedPortableContract|LeaseValidatesAgentWireContract|LeaseRejectsMalformedAgentWireContract)' -count=1failed with undefined public Task/Lease/Capabilities/NetworkPolicy types.
Task/lease GREEN:
GOWORK=off go test ./protocol -run 'Test(TaskValidatesPortableWorkloadContract|TaskRejectsMalformedPortableContract|LeaseValidatesAgentWireContract|LeaseRejectsMalformedAgentWireContract)' -count=1passed.Lease invariant proof:
with the lease expiry ordering validation removed,
TestLeaseRejectsMalformedAgentWireContractfailed because the error no longer includedexpires_at; restored validation and the focused suite passed.Client RED:
GOWORK=off go test ./protocol -run 'TestClient(SubmitTaskUsesStrictJSONAndBearerAuth|ListSnapshotAndProofLookup|RejectsTokenOverNonLoopbackHTTP|StatusErrorDoesNotExposeBody|StrictDecodeRejectsUnknownFields)' -count=1failed with undefined public client/wrapper/DecodeStrict symbols.Client GREEN:
same focused command passed after implementation.
HTTPS invariant proof:
with the token-over-non-loopback-HTTP guard removed,
TestClientRejectsTokenOverNonLoopbackHTTPfailed; restored guard and the focused client suite passed.Verification
bash /Users/<name>/.codex/plugins/cache/autodev-marketplace/autodev/6.5.0/tests/plan-scope-check.sh --verify-lock /Users/<name>/.config/autodev/worktrees/workflow-plugin-compute-core/task-proof-sdk/docs/plans/2026-06-06-task-proof-sdk.md-> PASSgit diff --checkrg -n "jon|dogfood|MacBook|Application Support/WorkflowCompute|/Users/" README.md docs protocol || true-> no matchesGOWORK=off go test ./protocol -count=1GOWORK=off go test ./... -count=1