Skip to content

feat(scripts): edge-ingest demo — the $100 Agent story, signed and fed to the platform - #485

Merged
Levaj2000 merged 2 commits into
mainfrom
claude/cpex-praxis-port-planning-ejmnst
Aug 22, 2026
Merged

feat(scripts): edge-ingest demo — the $100 Agent story, signed and fed to the platform#485
Levaj2000 merged 2 commits into
mainfrom
claude/cpex-praxis-port-planning-ejmnst

Conversation

@Levaj2000

Copy link
Copy Markdown
Owner

Wires the demo assets to the ingest endpoint shipped in #484. scripts/demo_edge_ingest.py generates the four mandate-draw records of the $100-agent storyline — the same shapes as the committed cpex-ocsf-audit samples, now chained and DSSE-signed exactly per the emitter's construction (this is the "regenerate the spend story from a signed run" upgrade promised in the demo kit) — and plays four acts against POST /api/v1/audit/ingest:

  1. Act 1 — three draws land, the fourth is denied over-limit → 4× verified, chain positions 1–4, the deny carrying mandate_exceeded and the draw-receipt join key.
  2. Act 2 — the batch replayed → 4× duplicate, nothing re-stored.
  3. Act 3 — a record edited after signing → quarantined with fingerprint mismatch, stored verbatim.
  4. Act 4 — a record after a lost epoch (stream_seq 4 → 7) → verified with the gap surfaced as an anomaly; the chain re-anchors.

Offline mode (--out PREFIX) writes the signed NDJSON + demo public key instead of calling the API — the same artifact feeds the immutable-ledger cpex adapter, so one generator drives both sinks of the joint demo. Online mode auto-registers the edge given AI_IDENTITY_TOKEN (Clerk), or uses a pre-registered EDGE_INGEST_KEY. Follows the demo_mandate_overspend.py conventions (env config, colored narrative); the signing key is a fixed demo scalar, public half only ever reaching the platform.

Test: api/tests/test_edge_ingest_demo.py loads the script and drives all four acts through the real endpoint via TestClient — if the demo and the verifier ever drift apart, this fails before a live demo does.

20 passed, 2 warnings in 62.55s   (test_edge_ingest_demo.py + test_edge_ingest.py)

Offline artifact separately round-tripped through BatchVerifier: all 4 records verified. Ruff check + format clean. No schema, dependency, or endpoint changes — script + test only.


🤖 Generated with Claude Code

https://claude.ai/code/session_017L4gxSTs5uuCEANgpL1i9F


Generated by Claude Code

…d to the platform

Wires the demo assets to the new ingest endpoint (#484): generates the
four mandate-draw records of the $100-agent storyline as chained,
DSSE-signed OCSF events in exactly the emitter's shape, and plays four
acts against POST /api/v1/audit/ingest — the story verifies with chain
positions, the replay dedupes, a record edited after signing quarantines
with fingerprint mismatch, and a record after a lost epoch verifies with
the stream gap surfaced. Offline mode (--out) writes the signed NDJSON +
demo public key so the same artifact feeds the immutable-ledger cpex
adapter — one generator, both sinks of the joint demo. Auto-registers
the edge given a Clerk token, or uses EDGE_INGEST_KEY.

The end-to-end test loads the script and drives all four acts through
the real endpoint, so demo and verifier can't silently drift apart.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017L4gxSTs5uuCEANgpL1i9F
@vercel

vercel Bot commented Aug 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ai-identity-landing Ready Ready Preview Aug 22, 2026 5:08pm
dashboard Ready Ready Preview Aug 22, 2026 5:08pm

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017L4gxSTs5uuCEANgpL1i9F
@Levaj2000
Levaj2000 marked this pull request as ready for review August 22, 2026 17:49
@Levaj2000
Levaj2000 merged commit 28b64a3 into main Aug 22, 2026
11 checks passed
@Levaj2000
Levaj2000 deleted the claude/cpex-praxis-port-planning-ejmnst branch August 22, 2026 17:49
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