Skip to content

feat: issue tenant-safe credential references - #9

Open
seonghobae wants to merge 5 commits into
feat/completion-decision-apifrom
feat/credential-orchestration
Open

feat: issue tenant-safe credential references#9
seonghobae wants to merge 5 commits into
feat/completion-decision-apifrom
feat/credential-orchestration

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a tenant-scoped credential_record projection with composite registration/decision integrity
  • add POST .../completion-decisions/{completion_decision_id}/credentials for issued external credential references
  • extend the real PostgreSQL/API quality smoke path with issuance and duplicate-conflict assertions
  • update the product gap baseline, architecture, data model, README, and changelog

Buyer-visible outcome

A learner who reaches a persisted, Rust-evaluated completed decision can receive one local credential reference without copying Open Badges/CLR payloads or collapsing learner, tenant, registration, and decision identity.

Evidence

  • actionlint .github/workflows/quality.yml
  • cargo +1.97.1 fmt --all -- --check
  • cargo +1.97.1 test --workspace --all-targets --locked (6 passed)
  • cargo +1.97.1 clippy --workspace --all-targets --locked -- -D warnings
  • RUSTDOCFLAGS='-D warnings' cargo +1.97.1 doc --workspace --no-deps --locked
  • cargo +1.97.1 build --bin lms_api --locked
  • fresh real PostgreSQL 18.4/API smoke with a NOSUPERUSER NOBYPASSRLS role: 15 RLS policies; completion decision returned completed; credential issuance returned issued; duplicate issuance returned HTTP 409; cross-tenant issuance returned HTTP 400
  • disposable migration rollback/reapply smoke: 15 policies before, 0 kernel tables after rollback, 15 policies after reapply
  • current-head GitHub workflows are queued: Quality 32440007668, SAST 32440007637, Security 32440007712, OpenCode 32440007620, Noema 32440007677, Strix 32440007679, scheduler 32440007631, Close Empty PR 32440007617

Scope boundary

This is a reference projection, not Open Badges/CLR conformance or a released external adapter. Assessment execution, versioned external contracts, browser E2E, revocation workflow, audit/outbox, and production coverage/load evidence remain explicit follow-up gaps.

Merge gate

The branch is stacked on PR #8. Please review exact current head f22806a539a9e6fe3f1943013dd74f14e648ffdb against base cb649e9fa3ec15e408e91da94ce6c743217cd12c and rerun all required checks. Do not treat local or green CI checks as semantic approval.


Open in Devin Review

@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: 9c540ebc-7073-48cc-82ed-1d59180f2612

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.

Exact-head review request for 2099bd6: the credential projection is tenant-scoped, uses composite registration/decision integrity, requires completed status, and maps duplicate issuance to 409. Local Rust checks, actionlint, and real PostgreSQL 18.4 API smoke evidence passed. Please independently review this exact head and rerun the required workflow checks; 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.

Updated exact-head review request for a60ff94: the workflow now pins both validate and rust-kernel checkouts to the pull request head SHA. Please independently review this current head and use only its required check results for merge decisions.

@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 10ec343. 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.

…to HEAD

# Conflicts:
#	.github/workflows/quality.yml
#	CHANGELOG.md
#	README.md
#	docs/ARCHITECTURE.md
#	docs/product-technical-gap-baseline.md

Copy link
Copy Markdown
Contributor Author

Current-head review request for f22806a539a9e6fe3f1943013dd74f14e648ffdb against base cb649e9fa3ec15e408e91da94ce6c743217cd12c. The stack was reconciled with current PR8. Local evidence: 6 Rust tests, pinned fmt/clippy/rustdoc/build, and actionlint passed; real PostgreSQL/API smoke with a NOSUPERUSER NOBYPASSRLS role returned 15 policies, completed decision, issued credential, duplicate HTTP 409, and cross-tenant HTTP 400; rollback/reapply returned 15 policies after reapply and zero kernel tables after rollback. Required current-head workflows are queued. Please independently re-check composite registration/decision integrity, credential source-reference boundaries, duplicate semantics, RLS/tenant isolation, rollback ordering, and CI coverage. COMMENT only; no approval or protected-merge bypass is requested.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

decision_id=$(python3 -c 'import json, sys; print(json.load(open(sys.argv[1]))["completion_decision_id"])' "$RUNNER_TEMP/lms_completion_response.json")
test "$(psql --host 127.0.0.1 --username lms_kernel --dbname lms_kernel_test \
--tuples-only --no-align --command "SELECT count(*) FROM completion_decision WHERE tenant_id = '$tenant_id' AND learner_id = '$learner_id'")" = '1'
credential_id=$(curl --fail --silent --show-error --request POST \
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