Skip to content

feat: add effective learner affiliations - #6

Open
seonghobae wants to merge 3 commits into
feat/enrollment-verticalfrom
feat/learner-affiliation
Open

feat: add effective learner affiliations#6
seonghobae wants to merge 3 commits into
feat/enrollment-verticalfrom
feat/learner-affiliation

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a tenant-safe affiliation endpoint for partner, customer, employee, and other supported learner kinds
  • enforce active membership, effective-date ordering, and database exclusion constraints
  • map PostgreSQL unique/exclusion conflicts to HTTP 409 and extend the real CI smoke path
  • reconcile the current PR5 base while preserving the PR4 least-privilege and rollback evidence

Evidence

  • exact current head 4cfb77f5403cba5fd53c37a794da1d2695ecf999
  • base is current PR5 head b92fc86438b881c2d83cb2d98f8d21337811623f
  • actionlint .github/workflows/quality.yml
  • cargo +1.97.1 fmt --all -- --check
  • cargo +1.97.1 test --workspace --all-targets --locked
  • cargo +1.97.1 clippy --workspace --all-targets --locked -- -D warnings
  • RUSTDOCFLAGS='-D warnings' cargo +1.97.1 doc --workspace --no-deps --locked
  • real PostgreSQL/API smoke: learner 201, first partner affiliation 201, overlapping partner affiliation 409, parallel customer affiliation 201, cross-tenant affiliation 400
  • git diff --check

Scope boundary

This is the effective-dated affiliation slice of issue #3. Sponsor/payer role records, external identity/Orgmetra adapters, progress, assessment, completion execution, credential issuance, browser E2E, and production readiness remain follow-up work.

Review request

Please review the exact current head 4cfb77f5403cba5fd53c37a794da1d2695ecf999 against b92fc86438b881c2d83cb2d98f8d21337811623f. 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: 5fdf1470-e7af-484b-90b6-8fff622807da

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 faec3e7b84348fbcc5d4ec726ddd5958a073d023 against base feat/enrollment-vertical. Re-check affiliation-kind validation, effective-date intervals, tenant membership and exclusion-conflict behavior, SQLSTATE-to-HTTP conflict mapping, 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 c0aa670. 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:
#	CHANGELOG.md
#	README.md
#	docs/ARCHITECTURE.md
#	docs/product-technical-gap-baseline.md

Copy link
Copy Markdown
Contributor Author

@OpenCode review only the exact current head 4cfb77f against base b92fc86. Re-check effective-dated affiliation validity, same-kind overlap conflict handling, parallel affiliation semantics, tenant isolation, and the reconciled parent workflow. Leave an independent review or approval for this exact head only. Do not update code, merge, self-approve, bypass protections, or treat queued Checks as proof.

@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 bugs or issues to report.

Open in Devin Review

--header 'content-type: application/json' --data "$payload" \
"http://127.0.0.1:8080/v1/tenants/$tenant_id/learners")" = '409'
learner_id=$(python3 -c 'import json, sys; print(json.load(open(sys.argv[1]))["learner_id"])' "$RUNNER_TEMP/lms_api_response.json")
affiliation_id=$(curl --fail --silent --show-error --request POST \

@opencode-agent opencode-agent 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.

Pull request overview

OpenCode cannot approve yet because required coverage evidence did not pass.

Review outcome

1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence

  • Problem: The required coverage-evidence job result was failure, so OpenCode cannot establish approval sufficiency for this head.

  • Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.

  • Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present.

  • Result: REQUEST_CHANGES

  • Reason: coverage-evidence result was failure, so required test/docstring evidence was not proven for current head 4cfb77f5403cba5fd53c37a794da1d2695ecf999.

  • Head SHA: 4cfb77f5403cba5fd53c37a794da1d2695ecf999

  • Workflow run: 32701003305

  • Workflow attempt: 1

Coverage evidence

Coverage Decision

  • Result: FAIL
  • Test evidence: not proven passing
  • Docstring evidence: not proven passing when configured
  • Failure count: 1

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Workflow: quality.yml"]
  S1 --> I1["GitHub Actions review job"]
  I1 --> R1["Review risk: Workflow: quality.yml"]
  R1 --> V1["actionlint plus required checks"]
  Evidence --> S2["Changed file (3 files)"]
  S2 --> I2["repository behavior"]
  I2 --> R2["Review risk: Changed file (3 files)"]
  R2 --> V2["required checks"]
  Evidence --> S3["Docs (2 files)"]
  S3 --> I3["operator or user guidance"]
  I3 --> R3["Review risk: Docs (2 files)"]
  R3 --> V3["docs review"]
Loading

@opencode-agent

Copy link
Copy Markdown

OpenCode Review Overview

  • Head SHA: 4cfb77f5403cba5fd53c37a794da1d2695ecf999
  • Workflow run: 32701003305
  • Workflow attempt: 1
  • Gate result: REQUEST_CHANGES (approval step)

Pull request overview

OpenCode cannot approve yet because required coverage evidence did not pass.

Review outcome

1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence

  • Problem: The required coverage-evidence job result was failure, so OpenCode cannot establish approval sufficiency for this head.

  • Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.

  • Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present.

  • Result: REQUEST_CHANGES

  • Reason: coverage-evidence result was failure, so required test/docstring evidence was not proven for current head 4cfb77f5403cba5fd53c37a794da1d2695ecf999.

  • Head SHA: 4cfb77f5403cba5fd53c37a794da1d2695ecf999

  • Workflow run: 32701003305

  • Workflow attempt: 1

Coverage evidence

Coverage Decision

  • Result: FAIL
  • Test evidence: not proven passing
  • Docstring evidence: not proven passing when configured
  • Failure count: 1

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Workflow: quality.yml"]
  S1 --> I1["GitHub Actions review job"]
  I1 --> R1["Review risk: Workflow: quality.yml"]
  R1 --> V1["actionlint plus required checks"]
  Evidence --> S2["Changed file (3 files)"]
  S2 --> I2["repository behavior"]
  I2 --> R2["Review risk: Changed file (3 files)"]
  R2 --> V2["required checks"]
  Evidence --> S3["Docs (2 files)"]
  S3 --> I3["operator or user guidance"]
  I3 --> R3["Review risk: Docs (2 files)"]
  R3 --> V3["docs review"]
Loading

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