Skip to content

feat(v2-draft): apply ERC-8210 v2 changelog items 5/8/11/15/16#3

Open
wangbin9953 wants to merge 6 commits into
mainfrom
v2-draft
Open

feat(v2-draft): apply ERC-8210 v2 changelog items 5/8/11/15/16#3
wangbin9953 wants to merge 6 commits into
mainfrom
v2-draft

Conversation

@wangbin9953

Copy link
Copy Markdown
Owner

Reference implementation update aligned with the v2 revision plan:

  • 改动 5: Add typed custom errors for commitToJob reverts (InsufficientAvailableAmount, DuplicateCommitment, AdverseSelectionBlocked, AccountNotActive) so off-chain orchestrators can branch on failure reason.

  • 改动 8: Store keccak256(reason) in Claim.reasonHash; carry raw reason bytes via the ClaimResolved event for off-chain indexers (IPFS CID / on-chain attestation refs).

  • 改动 16: Add Implementation Note on the canonical claimId derivation pattern (keccak256(abi.encode(jobId, claimant))) for ERC-8183 integer-keyed Job registries.

  • 改动 11 (new file src/IRiskHook.sol): expose both computeRecommendedAmount (v1-compat) and computeRecommendedAmountWithEvidence (v2 evidence + score).

  • 改动 15 (new file src/IIndependenceSignal.sol): two delivery modes (assessIndependence on-chain oracle / verifyAttestation signed payload), with rationale-level invariants on partial signals, empty-evidence semantics, and the no-fail-closed rule.

Both new interface files are marked "v2 draft, pending co-author review" — composition story with IRiskHook and the 5th signal category remain open.

Tests: 14/14 AAPCore tests pass on this branch.

Pending v2 items NOT included (待 Henry review / more evidence):

  • 改动 10 RoleCollusion CoverageType
  • 改动 17 first-class composition metadata fields on Claim

wangbin9953 and others added 6 commits May 19, 2026 13:46
Reference implementation update aligned with the v2 revision plan:

- 改动 5: Add typed custom errors for commitToJob reverts
  (InsufficientAvailableAmount, DuplicateCommitment,
  AdverseSelectionBlocked, AccountNotActive) so off-chain
  orchestrators can branch on failure reason.

- 改动 8: Store keccak256(reason) in Claim.reasonHash; carry
  raw reason bytes via the ClaimResolved event for off-chain
  indexers (IPFS CID / on-chain attestation refs).

- 改动 16: Add Implementation Note on the canonical claimId
  derivation pattern (keccak256(abi.encode(jobId, claimant)))
  for ERC-8183 integer-keyed Job registries.

- 改动 11 (new file src/IRiskHook.sol): expose both
  computeRecommendedAmount (v1-compat) and
  computeRecommendedAmountWithEvidence (v2 evidence + score).

- 改动 15 (new file src/IIndependenceSignal.sol): two delivery
  modes (assessIndependence on-chain oracle / verifyAttestation
  signed payload), with rationale-level invariants on partial
  signals, empty-evidence semantics, and the no-fail-closed rule.

Both new interface files are marked "v2 draft, pending co-author
review" — composition story with IRiskHook and the 5th signal
category remain open.

Tests: 14/14 AAPCore tests pass on this branch.

Pending v2 items NOT included (待 Henry review / more evidence):
- 改动 10 RoleCollusion CoverageType
- 改动 17 first-class composition metadata fields on Claim

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…lds)

改动 10B — Add RoleCollusion CoverageType:
- IAAP.CoverageType enum gains RoleCollusion between SettlementDefault and
  the extension-reserved AMLFreeze/SlashingLoss entries.
- AAPCore.commitToJob bound check now permits RoleCollusion as a core type.
- MockERC8183 carries a _roleCollusionAttested mapping + markRoleCollusion
  helper to simulate an external independence-layer attestation; eligibility
  for coverageType=3 requires (Completed AND attested).
- New test_15 exercises the full RoleCollusion path: pre-attestation file
  reverts, post-attestation file succeeds, resolveClaim + payout complete.

改动 17B — First-class composition metadata fields on Claim:
- IAAP.Claim struct gains bytes32 upstream, reasoningCID, slashEvidenceHash
  (default bytes32(0) when unused).
- IAAP.fileClaim signature extended with the three optional bytes32 params;
  IAAP.ClaimFiled event carries them so indexers can subscribe directly
  without decoding the opaque evidence payload.
- AAPCore.fileClaim threads the fields into storage and the event.
- All existing tests updated to the new fileClaim signature.
- New test_16 verifies the fields round-trip through storage.

Tests: 16/16 AAPCore tests pass (14 v1 + 2 new for v2).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Per-改动 status sheet covering all 17 v2 changelog items + the rejected
feedback bucket + reference-impl repo companion work + open
"待确认事项" items. Mirrors the v2 修改清单 sections but framed from the
reference-implementation side: what landed where, what's pending, who decides,
when it can ship.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Per Jacky's request — the field was duplicative with internal context and
better left implicit.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…try layout) (#4)

Rebased on v2-draft after Jacky seeded the registry index + governance:

- File moved to docs/profiles/verification-v0.3.md per registry layout
- Entry index row added in docs/receipt-profiles.md (status: candidate)
- Top meta line dropped (no longer applicable)
- IETF draft references updated from -00 to -01 (spec + cross-refs)
- JWS typ renamed to application/vnd.verification.v0.3+jws (profile-namespaced)
- New section 'Signing discipline' separated from 'Required fields'
- Versioning section proposes tighter mapping ID convention:
    <issuer-slug>-v<major>.<minor>-<YYYY-MM-DD>
  AgentTrust already conforms; AgentOracle current ID footnoted with
  migration path at next mapping rotation.

All sections now align with the 11-section template Jacky shipped.

Co-authored-by: Joe Krausz <Joe@agentoracle.co>
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