Skip to content

feat: Triptyque de la Preuve — 3 levels of watermark#4

Merged
desiorac merged 1 commit into
mainfrom
feat/triptyque-preuve
Feb 25, 2026
Merged

feat: Triptyque de la Preuve — 3 levels of watermark#4
desiorac merged 1 commit into
mainfrom
feat/triptyque-preuve

Conversation

@desiorac
Copy link
Copy Markdown
Member

Summary

  • Level 1 — Digital Stamp: injects _arkforge_attestation into JSON response body (after hashing — chain hash unaffected)
  • Level 2 — Ghost Stamp: 4 X-ArkForge-* HTTP headers on every proxy response (Proof, Verified, Proof-ID, Trust-Link)
  • Level 3 — Visual Stamp: content negotiation on GET /v1/proof/{id}Accept: text/html serves a self-contained HTML proof page with colored badge (green/orange/red). JSON remains default for backward compat
  • Short URL: GET /v/{proof_id} → 302 redirect to full proof endpoint

Files changed

File Change
trust_layer/templates.py New — HTML proof page renderer (render_proof_page, _esc anti-XSS)
trust_layer/proxy.py _inject_digital_stamp() + call in success path
trust_layer/app.py Ghost Stamp headers, Visual Stamp content negotiation, /v/{id} short URL
tests/conftest.py Patch TRUST_LAYER_BASE_URL on app module
tests/test_triptyque.py New — 22 tests (7 L1 + 3 L2 + 8 L3 + 4 escape)

What does NOT change

  • Chain hash integrity (attestation injected AFTER hashing)
  • verify_proof_integrity() logic
  • Existing JSON API contract (additive only)
  • X-ArkForge-Proof header (backward compat preserved)

Test plan

  • 96/96 tests passing (pytest tests/ -v)
  • curl POST /v1/proxy → verify _arkforge_attestation in response body
  • Verify 4 X-ArkForge-* headers in proxy response
  • Browser → /v1/proof/{id} with Accept: text/html → HTML page with badge
  • curl GET /v1/proof/{id} (no Accept) → JSON unchanged
  • GET /v/{id} → 302 redirect

🤖 Generated with Claude Code

Level 1 (Digital Stamp): inject _arkforge_attestation into JSON response
body after hashing — chain hash integrity unaffected.

Level 2 (Ghost Stamp): 4 X-ArkForge-* HTTP headers on every proxy
response (Proof, Verified, Proof-ID, Trust-Link).

Level 3 (Visual Stamp): content negotiation on GET /v1/proof/{id} —
Accept: text/html serves a self-contained HTML proof page with colored
badge (green/orange/red). JSON remains default for backward compat.

Short URL: GET /v/{proof_id} → 302 redirect to full proof endpoint.

22 new tests, 96/96 passing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@desiorac desiorac merged commit a1e236c into main Feb 25, 2026
2 checks passed
@desiorac desiorac deleted the feat/triptyque-preuve branch February 25, 2026 20:42
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