Skip to content

feat: add task proof sdk#36

Merged
intel352 merged 13 commits into
mainfrom
feat/task-proof-sdk
Jun 6, 2026
Merged

feat: add task proof sdk#36
intel352 merged 13 commits into
mainfrom
feat/task-proof-sdk

Conversation

@intel352
Copy link
Copy Markdown
Contributor

@intel352 intel352 commented Jun 6, 2026

Summary

  • add public task/status/lease/capability/network/P2P wire contracts to compute-core
  • add a minimal task/proof HTTP client for submit/list/snapshot/proof lookup with strict decode and token-over-HTTPS guard
  • add product-capture public SDK compatibility proof and document that scheduling, worker lifecycle, settlement, dashboards, staging rollout, and reusable control-plane extraction remain outside compute-core

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=1
failed with undefined public Task/Lease/Capabilities/NetworkPolicy types.

Task/lease GREEN:
GOWORK=off go test ./protocol -run 'Test(TaskValidatesPortableWorkloadContract|TaskRejectsMalformedPortableContract|LeaseValidatesAgentWireContract|LeaseRejectsMalformedAgentWireContract)' -count=1 passed.

Lease invariant proof:
with the lease expiry ordering validation removed, TestLeaseRejectsMalformedAgentWireContract failed because the error no longer included expires_at; restored validation and the focused suite passed.

Client RED:
GOWORK=off go test ./protocol -run 'TestClient(SubmitTaskUsesStrictJSONAndBearerAuth|ListSnapshotAndProofLookup|RejectsTokenOverNonLoopbackHTTP|StatusErrorDoesNotExposeBody|StrictDecodeRejectsUnknownFields)' -count=1 failed 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, TestClientRejectsTokenOverNonLoopbackHTTP failed; 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 -> PASS
  • git diff --check
  • rg -n "jon|dogfood|MacBook|Application Support/WorkflowCompute|/Users/" README.md docs protocol || true -> no matches
  • GOWORK=off go test ./protocol -count=1
  • GOWORK=off go test ./... -count=1

Copilot AI review requested due to automatic review settings June 6, 2026 04:43
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/http client 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.

Comment thread protocol/types.go
Comment thread protocol/client.go
@intel352 intel352 merged commit 1cf5e60 into main Jun 6, 2026
4 checks passed
@intel352 intel352 deleted the feat/task-proof-sdk branch June 6, 2026 04:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants