Skip to content

feat(integrations): decision-audit sink — cpex-ocsf-audit records denials off the cpex#166 seam - #457

Merged
Levaj2000 merged 1 commit into
mainfrom
claude/review-teryl-updates-4yluxj
Aug 18, 2026
Merged

feat(integrations): decision-audit sink — cpex-ocsf-audit records denials off the cpex#166 seam#457
Levaj2000 merged 1 commit into
mainfrom
claude/review-teryl-updates-4yluxj

Conversation

@Levaj2000

Copy link
Copy Markdown
Owner

Delivers the WS-A / P1 step the guinea-pig report (#456) left open: the OCSF audit plugin now consumes the first-class audit seam from contextforge-org/cpex#166 and records what the passive post-hook stream structurally never saw — denials, suppressed transform-denies, panics, and modifications.

What changed

  • Registration (factory.rs, emitter.rs): with no hooks: listed, the plugin auto-attaches as a cpex AuditHandler via Plugin::as_audit_handler — the same contract as the upstream audit-logger. Hook-listed instances stay legacy post-hook observers and deliberately do not also attach, so one invocation never emits twice. Empty hooks: (previously a config error) is now the recommended sink mode; the factory logs which mode it inferred.
  • Mapping (ocsf.rsbuild_event + apply_decision): verdict → security_control — Deny → action_id 2 / disposition Blocked with the violation surfaced at status_code/status_detail (a fail-closed panic arrives as plugin_panic, distinguishable by code); Allow-after-modification → 4 Modified; plain Allow → 1 Allowed. activity_*/type_uid are untouched — they describe the operation, the action describes the ruling.
  • Decision facts under unmapped.cpex.*, inside the hashed bytes: ordered per-plugin steps in a stable snake_case vocabulary (incl. deny_ignored — flagged flat so "every suppressed deny" is one SIEM query — and aborted, distinct from error), invocation span (W3C ids), entry-taint labels, content input/output hashes, and the seam's (epoch, stream_id, stream_seq, emission_seq) completeness/ordering stamps. Chained records make all of it tamper-evident: a renumbered stream breaks the fingerprint chain (tested).
  • Honest edge records: non-CMF dispatches (delegation, identity) emit from extensions alone with activity_id 0; zero-plugin invocations emit with an explicit empty steps array.

Verification

  • 11 new tests, 32 total, all green against cpex feat/audit-seam @ 386710a (the post-hardening seam head), rustc 1.96.1; cargo check --all-targets clean and the emit_sample example runs unchanged.
  • Docs updated: README wiring section (sink mode first), SEAM-PORT-RESULTS.md addendum, lib.rs revision header, changelog.

Follow-up (tracked)

AuditHandler::on_effect — effect-lifecycle events (token mints) want a richer OCSF class than API Activity 6003 (e.g. Authentication 3002); deliberately out of this PR.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TKAGmGAp5ECmcjFuHei5q8


Generated by Claude Code

…ials off the cpex#166 seam

Delivers the WS-A / P1 step the guinea-pig report (#456) left open. With no
hooks: listed, the plugin auto-attaches as a cpex AuditHandler (same
registration contract as the upstream audit-logger; hook-listed instances
stay post-hook observers and never double-emit) and consumes the finalized
DecisionLog at every pipeline verdict. Deny maps to action 2/Blocked with
the violation surfaced at status_code/status_detail (plugin_panic stays
distinguishable by code), allow-after-modification to Modified, plain allow
to Allowed; ordered per-plugin steps (incl. deny_ignored, flagged flat, and
aborted, distinct from error), span, entry taint, content hashes and the
(epoch, stream_id, stream_seq, emission_seq) stamps ride under
unmapped.cpex.* inside the hashed bytes, tamper-evident in the attestation
chain. Non-CMF dispatches and zero-plugin invocations emit honest records.
11 new tests (32 total, green against seam head 386710a); on_effect
lifecycle mapping tracked as follow-up.

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

vercel Bot commented Aug 18, 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 18, 2026 10:16pm
dashboard Ready Ready Preview Aug 18, 2026 10:16pm

@Levaj2000
Levaj2000 marked this pull request as ready for review August 18, 2026 22:28
@Levaj2000
Levaj2000 merged commit d6beb10 into main Aug 18, 2026
7 checks passed
@Levaj2000
Levaj2000 deleted the claude/review-teryl-updates-4yluxj branch August 18, 2026 22:28
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