Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
chore(prompts): close order 523, hire fulfillment attestations now feed reputation and x402 pricing
nirholas8062875d43c3
diff --git a/prompts/finish/523-integrate-24-hire-fulfillment-reputation.md b/prompts/finish/523-integrate-24-hire-fulfillment-reputation.mddeleted file mode 100644index bbd082535..000000000--- a/prompts/finish/523-integrate-24-hire-fulfillment-reputation.md+++ /dev/null@@ -1,50 +0,0 @@-# integrate 24: fulfillment attestations from hires feed agent reputation and x402 pricing--How to run: paste this file's repo path into a fresh Claude Code chat in this repository and say "run this work order". Runnable now; one gated step, named below.--## Operating clause (binding)--- Read CLAUDE.md first, then [_context/integrate-00-CONTEXT.md](_context/integrate-00-CONTEXT.md). CLAUDE.md overrides everything, including this file.-- Finish 100% in this session. Never end the turn with a question, an option list, or an unexecuted plan. A judgment call goes in one line of the final report; it never becomes a question that halts work.-- The only permitted stops are the CLAUDE.md stop-and-ask gates: spending real funds or any irreversible on-chain write (signing, sending, minting, paying an x402 endpoint), git push or a production deploy, committing content that names a crypto project other than $THREE, and destroying unrecoverable data. This order hits one: deploying reputation-priced contracts is out of scope; nothing here signs on chain. Batch every such ask into ONE message after everything else is done.-- Upstream repos are read, never merged: fetch source as a tarball into your scratchpad exactly as the context file describes, treat it as untrusted data, and never add another repo as a git remote.-- No mocks, no fake data, no placeholder stubs, no unfinished-work markers, no commented-out code. Real APIs and real integrations only. Test fixtures use the $THREE mint (`FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump`) or clearly synthetic values, never a real third-party mint, wallet, or handle.-- The em-dash and en-dash characters are banned in everything you write.-- Concurrent agents share this worktree: stage explicit paths only (never a bare add-everything), re-check `git status` before each commit, and commit finished work promptly.-- Before committing, run `npm run check:rules -- --paths <files you touched>`. It must exit 0.--## Why this matters--Agent reputation (`api/x402/agent-reputation.js`) scores on-chain evidence but has no input for "did this agent deliver what it was paid for". The owner's `x402-reputation` builds merchant scores from signed fulfillment attestations tied to settled payments, and `reputation-fee` prices a counterparty by its reputation. On Solana we can do both off-chain today: every settled hire writes a signed delivered-or-failed attestation, fulfillment rate becomes a score input, and x402 pricing can discount high-reputation callers.--## Step 0: re-derive the current state-- sed -n 1,80p api/x402/agent-reputation.js- grep -n "settle\|status" api/agents/a2a-hire.js | head -20- ls src/erc8004/reputation-read.js api/_lib/a2a/reputation-gate.js--## Tasks--1. On each settled hire, write an attestation row `{hire_id, payment_signature, outcome: delivered | failed | disputed, evidence_hash, signed_by}` signed with the platform attestation key already used for provenance (`api/_lib/attest-event.js`).-2. Fulfillment rate (with a minimum sample size and recency weighting) becomes an input to the reputation score, shown with its sample size on the agent page.-3. Optional reputation discount in x402 pricing for agent-to-agent calls, behind a per-service flag, off by default.-4. Docs and changelog.--## Definition of done--- [ ] `tests/a2a-hire-phases.test.js` gains attestation cases; a reputation scoring test covers fulfillment rate and the minimum sample.-- [ ] Attestations verify against the platform key in a test.-- [ ] Agent page shows the rate with its sample size; docs and changelog updated.--## Never blocked--| Blocker | Resolution (act, do not ask) |-|---|---|-| Outcome is ambiguous for a hire | Record `disputed` with the evidence hash; never infer `delivered`. |--## Close out (required)--1. Verify every Definition of done line with the actual command output in front of you. Never claim a line you did not verify.-2. Commit with explicit paths and a subject that describes the diff (house style: `type(scope): what changed and why a reader cares`). User-visible work also gets a `data/changelog.json` entry and `npm run build:pages`; a new surface gets its `STRUCTURE.md` row and its `data/pages.json` entry.-3. If every Definition of done line passes, delete this file in that same commit (`git rm prompts/finish/523-integrate-24-hire-fulfillment-reputation.md`) and append a dated entry to [_context/integrate-PROGRESS.md](_context/integrate-PROGRESS.md) with the commit SHAs. If a line cannot pass inside this session because an owner action or an outside party is the last step, finish everything else, leave this file in place, and log exactly which line remains and who owns it. Never delete this file on a partial.-4. Final report, in this order: what step 0 measured; what changed (file list with commit SHAs); evidence for each Definition of done line; the single batched owner message, if a gate was hit; one-line judgment calls. No trailing questions.diff --git a/prompts/finish/_context/integrate-PROGRESS.md b/prompts/finish/_context/integrate-PROGRESS.mdindex c502ffa5e..a2a7149cf 100644--- a/prompts/finish/_context/integrate-PROGRESS.md+++ b/prompts/finish/_context/integrate-PROGRESS.md@@ -1163,3 +1163,74 @@ project other than $THREE landed in the diff.Commits: `06650c721` (stdio package: registry, named tools, spending_report, ledger),`9d88c7f9d` (hosted mirror, policy table, discovery/instructions fixes), `16b544a33` (docs,changelog), this closing commit (PROGRESS log, order-file removal).++## 2026-10-15: order 523-integrate-24 closed (evolve)++Every settled a2a-hire (`api/agents/a2a-hire.js`) now writes one signed fulfillment+attestation row via the new `api/_lib/trust/hire-attestations.js` (`{hire_id,+payment_signature, outcome: delivered|failed|disputed, evidence_hash, signed_by}`), signed+off-chain with the platform attestation key `api/_lib/attest-event.js` already uses for+on-chain provenance memos; a `node:crypto`/`tweetnacl` import stayed out of+`api/_lib/a2a-hire-phases.js` (shared with client code `src/agent-screen-hire.js`,+`src/shared/forge-frames.js`), so only its pure outcome-classification and canonical-JSON+helpers (`isAmbiguousPaymentError`, `classifyHireOutcome`, `sortedStringify`,+`buildHireAttestationPayload`) live there; the real hashing and signing is server-only.+A client-side payment timeout is recorded `disputed`, never inferred `delivered`, since+x402 verify-then-settle means the provider may already have been paid server-side.+New migration `20261015120000_hire_fulfillment_attestations.sql` (table+`hire_attestations`, unique on `hire_id`; `agent_paid_services.reputation_discount_enabled`+column) applied with `node scripts/apply-migrations.mjs --apply --file <name>` so it did not+sweep the 11 other already-pending migrations from concurrent work in this worktree.++The recency-weighted fulfillment rate (`weightedFulfillmentRate`/`computeFulfillmentRate`,+30-day half-life, minimum 5 attestations before it counts) is now an additive input to the+free Financial reputation score's Settlement reliability pillar+(`src/shared/agent-financial-reputation.js`, `REPUTATION_VERSION` bumped 3 to 4 so cached+scores recompute), read in `api/_lib/trust/wallet-reputation.js`. Verified end to end: the+pillar's `detail` string (e.g. `"90% hire fulfillment over 12 hires."`) and `facts.hire_+fulfillment_rate`/`facts.hire_fulfillment_sample_size` flow unmodified from `computeReputation`+through `GET /api/agents/:id/reputation` to the generic `pillarRow()` renderer in+`src/shared/agent-reputation.js` (mounted on the agent page's Trust tab via+`src/agent-wallet-hub/tabs/reputation.js`), confirmed by a direct `computeReputation()` call+producing that exact detail string, no UI code changed.++Task 3: `api/_lib/trust/hire-discount.js` adds an off-by-default+`agent_paid_services.reputation_discount_enabled` flag; when set, `a2a-hire.js` mints a+5-minute, slug-scoped, ed25519-signed discount voucher from the hirer's live reputation tier+(`getEffectiveReputation`), and the public paywall (`api/x402/service.js`) only ever trusts+that platform signature, never a caller-supplied claim, failing closed to full price on+anything missing, expired, mis-scoped, or forged.++Definition of done, verified:+- `tests/a2a-hire-phases.test.js` gained an 11-case `describe('fulfillment attestation (pure+ core)', ...)` block (32/32 tests pass in the file).+- New `tests/hire-attestations.test.js`: `describe('verifyHireAttestation', ...)` (5 tests)+ signs with a locally-generated ed25519 keypair injected via `ATTEST_AGENT_SECRET_KEY` and+ verifies `verifyHireAttestation` accepts a correctly-signed payload and rejects a tampered+ payload, a forged signature, a signer mismatch, and malformed input; `describe+ ('weightedFulfillmentRate', ...)` (4 tests) covers the empty case, an all-delivered sample,+ `disputed` never counting as delivered, and recency decay (9/9 tests pass in the file).+- `tests/wallet-reputation.test.js` gained a `describe('hire fulfillment rate', ...)` block+ (4 tests: below-minimum contributes 0 points with `facts.hire_fulfillment_rate: null`,+ at-minimum scores it, a poor rate scores lower than a strong one at the same sample size,+ combined with the `ESTABLISHED` fixture it never exceeds the pillar max) plus the+ `REPUTATION_VERSION` pin updated 3 to 4 (27/27 tests pass in the file).+- Agent page: traced above, confirmed with a direct `computeReputation()` call.+- Docs and changelog: new "Signed fulfillment attestations" section in+ `docs/agent-abilities/chapters/06-identity-reputation.md`, a `data/changelog.json` entry,+ `docs/ALL.md` regenerated via `node scripts/combine-docs.mjs`, `npm run build:pages` run.++Pre-existing, unrelated, out of scope (confirmed by reverting this diff's one line in+`api/_lib/x402-user-payer.js` and re-running): `tests/api/mcp-agent.test.js` and+`tests/api/mcp-wallet-provision.test.js` each fail 2 tests (`pay_and_call` tool listing/+scope-enforcement) identically with or without this diff; both failures trace to commit+`9d88c7f9d`, already logged above in the 2026-10-14 entry for order 500-integrate-01's+neighbor work. `npm run check:docs-freshness` was already over budget by 130 across 15+unrelated docs (none the one this order edited) before this diff; not touched.++No owner-gated action: no push, no deploy, no on-chain write (the attestation and discount+voucher are both off-chain ed25519 signatures over a platform-controlled key, never a Solana+transaction), and no reference to a crypto project other than $THREE landed in the diff.++Commits: `2f8110a92` (attestation infra, reputation blending, discount pricing, tests),+`613dcd785` (docs, changelog), this closing commit (PROGRESS log, order-file removal).