Skip to content

feat: ACP and UCP carrier adapter#418

Merged
jithinraj merged 6 commits intomainfrom
feat/acp-ucp-carrier-adoption
Feb 23, 2026
Merged

feat: ACP and UCP carrier adapter#418
jithinraj merged 6 commits intomainfrom
feat/acp-ucp-carrier-adoption

Conversation

@jithinraj
Copy link
Member

Summary

  • Adds Evidence Carrier Contract (DD-124) adapters for @peac/mappings-acp and @peac/mappings-ucp
  • ACP: attaches/extracts carriers via PEAC-Receipt HTTP header (compact JWS); case-insensitive lookup per RFC 9110; sync + async extraction
  • UCP: attaches/extracts carriers via peac_evidence webhook payload field; fallback to legacy extensions["org.peacprotocol/interaction@0.1"]; DD-129 async consistency check

Changes

@peac/mappings-acp

  • New src/carrier.ts: attachCarrierToACPHeaders, attachCarrierToACPMessage, extractCarrierFromACPHeaders, extractCarrierFromACPHeadersAsync, AcpCarrierAdapter
  • Updated src/index.ts: re-exports carrier types and functions
  • New tests/carrier.test.ts: 19 tests

@peac/mappings-ucp

  • New src/carrier.ts: attachCarrierToWebhookPayload, extractCarrierFromWebhookPayload, extractCarrierFromWebhookPayloadAsync, UcpCarrierAdapter
  • Updated src/index.ts: re-exports carrier types and functions
  • Added @peac/schema dependency for carrier validation
  • New tests/carrier.test.ts: 19 tests

Design decisions

  • DD-124: PeacEvidenceCarrier type placement
  • DD-127: ACP embed 64 KB / headers 8 KB; UCP 64 KB
  • DD-129: Async extraction enforces receipt_ref consistency

Test plan

  • ACP carrier tests pass (19 tests)
  • UCP carrier tests pass (19 tests)
  • All existing ACP tests unchanged (59 total)
  • All existing UCP tests unchanged (73 total)
  • Full gate: build (77/77), lint, typecheck, test (175 files / 4284 tests)
  • guard.sh, check-planning-leak.sh pass

Stacked on

Ship PeacEvidenceCarrier types (Layer 0, zero runtime) and Zod schemas
with shared computeReceiptRef() helper (Layer 1). Includes carrier
conformance fixtures (5 valid, 3 invalid) and verifyReceiptRefConsistency()
for DD-129 async extraction enforcement.

- kernel: PeacEvidenceCarrier, CarrierAdapter<T,U>, CarrierMeta types
- kernel: PEAC_RECEIPT_HEADER canonical constant (DD-127)
- schema: ReceiptRefSchema, CompactJwsSchema, PeacEvidenceCarrierSchema
- schema: computeReceiptRef() with WebCrypto runtime guard
- schema: validateCarrierConstraints() transport-aware validation
- schema: verifyReceiptRefConsistency() for tamper detection
- schema: CARRIER_TRANSPORT_LIMITS per-transport size constants
- conformance: 8 carrier fixtures in specs/conformance/fixtures/carrier/
- conformance: carrier category registered in manifest and tracking
Add Evidence Carrier Contract adapters for ACP and UCP mappings:

ACP (@peac/mappings-acp):
- attachCarrierToACPHeaders: sets PEAC-Receipt header with compact JWS
- attachCarrierToACPMessage: validates constraints before attachment
- extractCarrierFromACPHeaders: sync extraction with placeholder ref
- extractCarrierFromACPHeadersAsync: async with computed receipt_ref
- AcpCarrierAdapter: implements CarrierAdapter<AcpMessageLike>
- Case-insensitive header lookup per RFC 9110

UCP (@peac/mappings-ucp):
- attachCarrierToWebhookPayload: writes to peac_evidence field
- extractCarrierFromWebhookPayload: reads peac_evidence with legacy
  extension key fallback (org.peacprotocol/interaction@0.1)
- extractCarrierFromWebhookPayloadAsync: DD-129 consistency check
- UcpCarrierAdapter: implements CarrierAdapter<UcpWebhookPayload>
- Added @peac/schema dependency for carrier validation
- Remove Link header claims from module comment (not implemented)
- Throw on attach when receipt_jws absent (no silent reference drop)
- Use acp_headers (8 KB) limit for all constraint validation since
  the transport surface is PEAC-Receipt header, not body
- Update tests to match: absent JWS now throws, constraints use
  header-sized limits
@jithinraj jithinraj changed the base branch from feat/evidence-carrier-types to main February 23, 2026 18:29
@jithinraj jithinraj changed the title feat: ACP and UCP carrier adapter adoption (DD-124) feat: ACP and UCP carrier adapter adoption Feb 23, 2026
@jithinraj jithinraj merged commit 193234e into main Feb 23, 2026
7 checks passed
@jithinraj jithinraj changed the title feat: ACP and UCP carrier adapter adoption feat: ACP and UCP carrier adapter Feb 23, 2026
@jithinraj jithinraj deleted the feat/acp-ucp-carrier-adoption branch February 24, 2026 21:52
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