feat(scripts): edge-ingest demo — the $100 Agent story, signed and fed to the platform - #485
Merged
Merged
Conversation
…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
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017L4gxSTs5uuCEANgpL1i9F
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Wires the demo assets to the ingest endpoint shipped in #484.
scripts/demo_edge_ingest.pygenerates 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 againstPOST /api/v1/audit/ingest:mandate_exceededand the draw-receipt join key.fingerprint mismatch, stored verbatim.stream_seq4 → 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 givenAI_IDENTITY_TOKEN(Clerk), or uses a pre-registeredEDGE_INGEST_KEY. Follows thedemo_mandate_overspend.pyconventions (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.pyloads 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.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