Skip to content

feat: persist policy-evaluated completion decisions - #8

Open
seonghobae wants to merge 4 commits into
feat/progress-projectionfrom
feat/completion-decision-api
Open

feat: persist policy-evaluated completion decisions#8
seonghobae wants to merge 4 commits into
feat/progress-projectionfrom
feat/completion-decision-api

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add completion policy and immutable revision endpoints
  • add external evidence-reference endpoint that stores only source metadata
  • invoke the Rust completion engine and persist replayable decisions/evidence links
  • mark the registration completed only after a valid decision is committed
  • extend the real PostgreSQL/API CI smoke path and rehydration unit coverage

Evidence

  • actionlint .github/workflows/quality.yml
  • cargo +1.97.1 fmt --all -- --check
  • cargo +1.97.1 test --workspace --all-targets --locked (6 domain tests passed)
  • cargo +1.97.1 clippy --workspace --all-targets --locked -- -D warnings
  • RUSTDOCFLAGS='-D warnings' cargo +1.97.1 doc --workspace --no-deps --locked
  • fresh real PostgreSQL/API smoke with a NOSUPERUSER NOBYPASSRLS role: registration, policy, revision, evidence, and completion decision returned successfully; the decision status was completed and one decision row persisted
  • disposable migration rollback/reapply smoke: 14 policies before, 0 kernel tables after rollback, 14 policies after reapply
  • current-head GitHub workflows are queued: Quality 32439260438, SAST 32439260436, Security 32439260417, OpenCode 32439259302, Noema 32439259338, Strix 32439259314, scheduler 32439259385, Close Empty PR 32439259247

Scope boundary

This is the policy/evidence/completion persistence slice of issue #3. Assessment integration, credential issuance, released external contracts, browser E2E, provenance/observability, hot partitions, and production readiness remain follow-up work.

Review request

Please review commit cb649e9fa3ec15e408e91da94ce6c743217cd12c as the exact current head against base 00269c3fadba66596e696f544fcbd5b78540c54d. 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: 40366dcd-08b9-40ca-bb0a-1b2bb4bf2155

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

Copy link
Copy Markdown
Contributor Author

Please perform an independent review of the exact current head 9e679f075cd77cf34e3287771fa6d3a4e5b7dd2d against base feat/progress-projection. Re-check policy revision immutability, external-payload exclusion, Rust evaluation/replay fingerprint, registration/evidence tenant boundaries, decision transactionality, repeated replay behavior, migration/RLS, and CI smoke coverage. Do not treat green checks as semantic approval.

@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 3137d34. 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.

# Conflicts:
#	.github/workflows/quality.yml
#	CHANGELOG.md
#	README.md
#	docs/ARCHITECTURE.md

Copy link
Copy Markdown
Contributor Author

Current-head review request for cb649e9fa3ec15e408e91da94ce6c743217cd12c against base 00269c3fadba66596e696f544fcbd5b78540c54d. Local evidence: 6 Rust tests, format/clippy/rustdoc/actionlint passed; fresh PostgreSQL/API completion smoke completed one decision through a NOSUPERUSER NOBYPASSRLS role; rollback/reapply returned 14 policies after reapply and zero kernel tables after rollback. GitHub Quality/SAST/Security/OpenCode/Noema/Strix/scheduler/Close Empty runs for this exact head are queued. Please independently re-check policy/revision immutability, source-payload exclusion, Rust evaluation/replay identity, registration/evidence tenant boundaries, transactionality, RLS, 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 2 additional findings.

Open in Devin Review

"http://127.0.0.1:8080/v1/tenants/$tenant_id/learners/$learner_id/attempts/$attempt_id/progress")" = '400'
test "$(psql --host 127.0.0.1 --username lms_kernel --dbname lms_kernel_test \
--tuples-only --no-align --command "SELECT count(*) FROM progress_projection WHERE tenant_id = '$tenant_id' AND learner_id = '$learner_id'")" = '1'
policy_id=$(curl --fail --silent --show-error --request POST \
--data '{"policy_name":"Completion CI"}' \
"http://127.0.0.1:8080/v1/tenants/$tenant_id/completion-policies" \
| python3 -c 'import json, sys; print(json.load(sys.stdin)["completion_policy_id"])')
revision_id=$(curl --fail --silent --show-error --request POST \
--data '{"revision_number":1,"required_evidence_kinds":["activity"]}' \
"http://127.0.0.1:8080/v1/tenants/$tenant_id/completion-policies/$policy_id/revisions" \
| python3 -c 'import json, sys; print(json.load(sys.stdin)["completion_policy_revision_id"])')
evidence_id=$(curl --fail --silent --show-error --request POST \
--data '{"evidence_kind":"activity","source_authority":"lrs","source_snapshot_reference":"snapshot-ci-1","source_digest":"sha256:ci-evidence","source_version":"v1"}' \
"http://127.0.0.1:8080/v1/tenants/$tenant_id/learners/$learner_id/registrations/$registration_id/evidence" \
| python3 -c 'import json, sys; print(json.load(sys.stdin)["decision_evidence_reference_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