Skip to content

WURK agent-to-human x402 connector + daemon wiring#94

Open
mizuki0x wants to merge 4 commits into
mainfrom
feat/wurk
Open

WURK agent-to-human x402 connector + daemon wiring#94
mizuki0x wants to merge 4 commits into
mainfrom
feat/wurk

Conversation

@mizuki0x

Copy link
Copy Markdown
Contributor

Agent-to-human microjobs for Covenant: agents hire vetted humans to review work, paid per winner in USDC over x402. Scope is the agent-to-human family only; the engagement/vote endpoints are unreachable through this crate.

What's here

  • covenant-wurk crate: the x402 v2 pay loop, free submission view, creator-mode winner selection, and 3 MCP tools (wurk.hire_humans, wurk.job_status, wurk.choose_winners). 23 unit tests, parsers pinned to real fixtures.
  • Daemon wiring: DaemonWurkExecutor in covenantd. Paid create routes through budget/settlement/audit and the x402 signer sidecar; view and choose-winners are free reads. Gated by COVENANT_WURK_ENABLED.

WURK quirks handled (reverse-engineered from x402-core, undocumented)

  • Retry the payment against the job-specific resource.url; a fresh job is minted per create GET, so retrying the create URL mismatches the signed requirement.
  • x402 v2 payload with the chosen requirement echoed into accepted (the matcher deepEquals it), the PAYMENT-SIGNATURE header, and the PayAI-sponsored feePayer.
  • Signing reuses covenant-x402's PayaiSolanaSigner sidecar; covenant-wurk extracts the signed tx and re-wraps it in the v2 payload, so covenant-x402 is unchanged.

Verified

Crate + daemon unit tests pass. Live on mainnet: created and settled a real agent-to-human job end to end, transaction finalized on-chain, $0.01 USDC debited from the treasury.

Note: CI fmt is red on pre-existing workspace files, unrelated to this change.

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.

1 participant