Skip to content

feat: add tenant audit provenance events - #13

Open
seonghobae wants to merge 3 commits into
feat/evidence-idempotencyfrom
feat/audit-provenance
Open

feat: add tenant audit provenance events#13
seonghobae wants to merge 3 commits into
feat/evidence-idempotencyfrom
feat/audit-provenance

Conversation

@seonghobae

Copy link
Copy Markdown
Contributor

Summary

  • add a tenant-scoped audit_event_record with opaque service actor defaults, correlation UUID, source authority/version, event identity, and SHA-256 event digest
  • enforce append-only audit rows with PostgreSQL RLS plus a mutation-rejecting trigger
  • record successful assessment import, completion publication, credential issue, and credential revocation transitions in the same transaction
  • do not duplicate assessment, learner, credential, or provider payloads; idempotent assessment retries and repeated revocation do not create duplicate audit events
  • extend the exact-head API smoke gate to assert 16 tenant policies, four audit events, and mutation rejection
  • document the current provenance evidence and remaining correlation propagation/export gap

Evidence

  • real PostgreSQL 18.4 API E2E on a NOSUPERUSER application role: assessment retry returned the same evidence ID; audit count was 4 with four distinct correlation IDs; cross-tenant audit visibility was 0; update mutation was rejected by the append-only trigger
  • cargo test --workspace --all-targets --locked
  • cargo clippy --workspace --all-targets --locked -- -D warnings
  • RUSTDOCFLAGS=-Dwarnings cargo doc --workspace --no-deps --locked
  • cargo build --bin lms_api --locked
  • cargo fmt --all -- --check
  • actionlint
  • git diff --check

Gate

This is stacked on PR #12 and remains unmerged product evidence until an independent current-head review and required Checks pass. Merge only after re-fetching exact head 4fafb5d and confirming protected rules.

@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: fbcf4443-7d6d-4270-904c-0ce72afcf4c6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@seonghobae seonghobae left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current-head review request for 4fafb5d. Please independently verify the append-only audit trigger, tenant RLS behavior under the application role, transaction atomicity for assessment/completion/credential lifecycle events, and the exact-head quality assertions. This is a COMMENT only; no approval or protected-merge bypass is requested.

@seonghobae seonghobae left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current-head review request for e31ed03. Re-verify the exact-head diff, required Checks, tenant/security boundaries, and any valid review findings after the shared Rust component-install fix. COMMENT only; no approval or protected-merge bypass is requested.

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