Skip to content

Commit 8edbb03

Browse files
authored
Merge pull request #23 from HodeTech/development
feat(education): complete P02d-2 authoring and convergent seed
2 parents 1d3a0f7 + 1613143 commit 8edbb03

154 files changed

Lines changed: 10754 additions & 1718 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.claude/skills/seed-tenant/SKILL.md‎

Lines changed: 159 additions & 334 deletions
Large diffs are not rendered by default.

‎CLAUDE.md‎

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@ the conventions you must follow when contributing.
77
## What this is
88

99
LearnStack is a **white-label platform for multi-branch education
10-
businesses that teach live** — not a single LMS, and not an education
11-
product of its own. One binary, one schema, and one set of container
10+
businesses that teach live**. Its endorsed product direction adds an optional
11+
LearnStack-branded Course Marketplace while preserving independent institution
12+
sites. [ADR-0049](docs/decisions/0049-institution-sites-and-course-marketplace.md)
13+
and [Phase 09a](docs/roadmap/phase-09a-course-marketplace-pilot.md) remain Proposed;
14+
marketplace architecture, commerce and delivery are not implemented or Accepted.
15+
One binary, one schema, and one set of container
1216
images serve a language school, a yoga studio, a music school, or a
1317
coding bootcamp. What differs between them is **tenant customization
1418
data** loaded at provisioning, not code
@@ -22,9 +26,10 @@ capability invocation (running submitted code, scoring speech) are
2226
platform features gated by plan — they need a release, not a
2327
customization row. Link to that section; do not restate it.
2428

25-
LearnStack ships in three production deployment modes — SaaS, Dedicated,
26-
Self-Hosted — backed by the companion **LearnStack Hub** control plane
27-
(separate repository, see
29+
LearnStack targets three production deployment modes — SaaS, Dedicated,
30+
Self-Hosted — with current readiness recorded in
31+
[Deployment Models](docs/architecture/25-deployment-models.md#supported-today-versus-prepared-seam).
32+
The companion **LearnStack Hub** control plane lives in a separate repository (see
2833
[ADR-0019](docs/decisions/0019-learnstack-hub.md)). On developer
2934
workstations the Hub repo is the sibling directory `../LearnStack-Hub`;
3035
GitHub: https://github.com/HodeTech/LearnStack-Hub. The Hub repository
@@ -60,10 +65,22 @@ reader. The whole .NET suite runs with **zero skips**, which the runner now refu
6065
let change.
6166
**[Phase 02d](docs/roadmap/phase-02d-walking-skeleton.md) is in progress**: its kickoff
6267
shipped the packet table and the decision register, and every later packet opens with
63-
its decision pass. **P02d-1 is complete**: Education's domain, schema and isolation
64-
proofs pass, all three steps completed two independent agent review rounds, and the
65-
five live required checks pass on [PR #22](https://github.com/HodeTech/LearnStack/pull/22). Education
66-
commands and seed writes belong to P02d-2; public reads belong to P02d-4.
68+
its decision pass. **P02d-1 is complete and merged** through
69+
[PR #22](https://github.com/HodeTech/LearnStack/pull/22) on 2026-09-14. Education's
70+
domain, schema and isolation proofs pass; all three steps completed two independent
71+
agent review rounds. The [merge closeout](docs/roadmap/phase-02d-walking-skeleton.md#merge-and-closeout-2026-09-14)
72+
records verification of the final PR head and merge commit. **P02d-2's decision pass
73+
is Accepted — 2026-10-02**: its [decision package](docs/roadmap/phase-02d-walking-skeleton.md#p02d-2-decision-package-2026-10-02)
74+
and ADR-0050/0051 establish protected content, exact write contracts and four
75+
implementation steps. Implementation resumed on development: Step 1 supplies the
76+
access-policy migration, exact-definition/locale contracts, presentation validation
77+
and contextual seed verification queries; both review rounds passed. Step 2 adds
78+
locale/branding writers and whole-value setting audit redaction; both review rounds
79+
passed.
80+
Step 3 adds Education writers; both review rounds and a fresh focused fix review
81+
passed. Step 4 completes convergent seed execution after both review rounds.
82+
P02d-2 implementation and final verification are complete; PR review/merge remains
83+
pending. P02d-3 read internals are next; public reads belong to P02d-4.
6784

6885
**Phase 01** shipped the .NET 10 solution scaffold under `backend/`
6986
(core + 7 modules × 4 projects + 4 test projects including the
@@ -242,8 +259,9 @@ and `Organization` aggregates and `TenancyDbContext`; Customization —
242259
`CustomizationDbContext`; Audit — `AuditEntry`, `AuditConfig` and `AuditDbContext`;
243260
and Education — separate `Course` and `Lesson` roots, their contained translations
244261
and `EducationDbContext`. Content, Identity and Media remain scaffolded.
245-
P02d-1's implementation, agent reviews and required PR checks are complete.
246-
Command and public-read surfaces belong to the later packets. Other module-level references
262+
P02d-1 is merged; its implementation, agent reviews and required PR checks are complete.
263+
P02d-2 supplies unrouted authoring commands and seeded content; public reads belong
264+
to P02d-4. Other module-level references
247265
in the docs (e.g. `ILiveClassProvider`, `ITenantSearch`) still describe intended
248266
shape owned by their named phases.
249267

@@ -318,7 +336,13 @@ let the entry point pick it.
318336
- **No → ship the port now, the adapter on a named trigger.** Dapr pub/sub, Kafka, Valkey-backed cache, Vault, APISIX, the Hub entitlement source, signed licence keys, custom-domain TLS automation, `audit_log` partitioning. Each has a port in `LearnStack.SharedKernel` wherever [ADR-0035 § The gated set](docs/decisions/0035-demand-gated-infrastructure.md#the-gated-set) names one, a working default implementation (`InProcessEventBus`, `InMemoryCacheService`, `ConfigurationSecretProvider`, `NullEntitlementProvider`), an owning phase, and a written trigger condition. A building block missing any of those, other than a port that table records as absent, is not demand-gated — it is missing.
319337
- **Provider adapters everywhere.** Payments, auth, storage, search, live classroom, notifications, **event bus, cache, secrets, Hub contract, entitlement source, host resolver** — all sit behind interfaces. No SaaS lock-in in `Domain` or `Application`. See [20-infrastructure-stack.md](docs/standards/20-infrastructure-stack.md).
320338
- **The Hub contract is governed by two invariants, not by a count** ([ADR-0034](docs/decisions/0034-hub-contract-surface-invariant.md)): (1) the Hub stores **no tenant content** — courses, lessons, learners, enrollments, sessions and media live only in LearnStack, and the Hub holds tenant *metadata* only; (2) **every LearnStack↔Hub crossing goes through a named adapter** — `IEntitlementProvider`, `IUsageReporter`, `IHubTenantSync`, and nothing else may hold a Hub client. Adding an endpoint still requires an ADR, because the surface is a cross-repository contract both repositories have to agree on.
321-
- **One binary, five `DeploymentMode` values, two of them wired.** Selection happens at the composition root; module code never branches on the mode ([ADR-0020](docs/decisions/0020-triple-deployment-hybrid-license.md), enforced by `Modules_Do_Not_Reference_DeploymentMode`). `Development` and `SaaS` are wired end to end; `Dedicated`, `SelfHostedOnline` and `SelfHostedAirGapped` are **prepared seams, not supported deployments**, until [Phase 11](docs/roadmap/phase-11-production-hardening.md) builds their adapters and integration suites.
339+
- **One binary, five `DeploymentMode` values.** Selection happens at the composition
340+
root; module code never branches on the mode
341+
([ADR-0020](docs/decisions/0020-triple-deployment-hybrid-license.md), enforced by
342+
`Modules_Do_Not_Reference_DeploymentMode`).
343+
[Deployment Models § Supported today versus prepared seam](docs/architecture/25-deployment-models.md#supported-today-versus-prepared-seam)
344+
owns the current foundation wiring, remaining adapters and production-readiness
345+
boundary; a selectable enum value is not a supported deployment.
322346

323347
## Conventions when editing docs
324348

‎README.md‎

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ and database schema, while keeping their own content, branding and tenant bounda
2424
The product design supports a platform subdomain and optional custom domains; a
2525
business does not need to bring its own domain.
2626

27+
The endorsed direction adds an **optional Course Marketplace** alongside those
28+
sites: shared discovery, platform checkout, commission and institution payouts.
29+
Its [pilot plan](docs/roadmap/phase-09a-course-marketplace-pilot.md) and
30+
[direction ADR](docs/decisions/0049-institution-sites-and-course-marketplace.md) are
31+
Proposed; payment, seller operations and marketplace delivery are still ahead.
32+
2733
The difference between those businesses lives in
2834
[tenant customization data](docs/architecture/32-tenant-customization-model.md).
2935
The [platform vision](docs/architecture/01-platform-vision.md) defines the scope and
@@ -37,16 +43,17 @@ the boundary between customization and capabilities that require platform code.
3743
## What it does
3844

3945
The product vision connects discovery, course content and live teaching in one place.
40-
Three surfaces serve the people on each side of that experience:
46+
The planned surfaces serve the people on each side of that experience:
4147

4248
| Surface | Who it serves | Intended experience |
4349
|---|---|---|
4450
| **Public site** | Visitors and prospective learners | Discover a school, browse its catalog and explore its content. |
4551
| **Admin Studio** | Institution staff and instructors | Author content, manage people and organize teaching. |
4652
| **Learner portal** | Enrolled learners | Work through lessons, track progress and join live sessions. |
53+
| **Optional Course Marketplace** | Learners and participating institutions | Shared discovery and central checkout; endorsed target, architecture approval pending. |
4754

4855
These are planned product capabilities. Today, the frontend contains route scaffolds
49-
for all three surfaces; the status below separates delivered foundations from the
56+
for the first three surfaces; the status below separates delivered foundations from the
5057
remaining product work.
5158

5259
**Built for different ways of teaching.** Content types and level taxonomies already
@@ -58,17 +65,25 @@ items, rules, custom fields and notification templates; their delivery is tracke
5865
## Where it is today
5966

6067
**Phase 01 and Phase 02a are complete. Phase 02d is in progress.**
61-
[P02d-1](docs/roadmap/phase-02d-walking-skeleton.md) delivers the Education domain,
62-
schema and isolation proofs. **P02d-2** owns course and lesson command handlers and
63-
seed writes; **P02d-4** owns anonymous public API reads. Browser rendering follows
64-
in P02d-5–7.
68+
[P02d-1](docs/roadmap/phase-02d-walking-skeleton.md#merge-and-closeout-2026-09-14) is
69+
**complete and merged**: Education domain, schema and isolation proofs.
70+
**P02d-2's decision package and ADR-0050/0051 are Accepted** as of 2026-10-02,
71+
with four implementation steps. Step 1 implements the access policy, exact
72+
definition/locale readers, text-card metadata validation and seed verification queries.
73+
Both Step 1 review rounds passed. Step 2 adds locale/branding writers and JSON audit
74+
redaction; both review rounds passed. Step 3 adds Education writers; both review
75+
rounds and the focused fix review passed. Step 4 completes convergent seed
76+
execution after both review rounds. P02d-2 is verified and ready for PR review;
77+
merge remains pending. P02d-3 read internals are next.
78+
**P02d-4** owns anonymous public API reads. Browser rendering follows
79+
in P02d-5–7; none of these later packets has started.
6580

6681
| Area | Delivered now | Next milestone |
6782
|---|---|---|
68-
| **Tenancy** | Tenant provisioning, organizations, host resolution and database isolation | User membership and permissions in [Phase 03](docs/roadmap/phase-03-identity-admin.md) |
69-
| **Customization** | Content types, level taxonomies, payload validation and built-in seeds | Remaining authoring capabilities across [Phases 04–08a](docs/roadmap/README.md) |
83+
| **Tenancy** | Tenant provisioning, organizations, locales, branding, host resolution and database isolation | User membership and permissions in [Phase 03](docs/roadmap/phase-03-identity-admin.md) |
84+
| **Customization** | Content types, level taxonomies, exact-definition readers, text-card metadata validation and tenant-authored seeds | Remaining authoring capabilities across [Phases 04–08a](docs/roadmap/README.md) |
7085
| **Audit** | Classified write path and transactional durability for business changes | Operational hardening in [Phase 11](docs/roadmap/phase-11-production-hardening.md) |
71-
| **Education** | Course and Lesson aggregates, translations, migrations and isolation tests | Commands, seeded content and public reading in [P02d-2–4](docs/roadmap/phase-02d-walking-skeleton.md) |
86+
| **Education** | Course and Lesson aggregates, translations, protected-content policy, scoped authoring commands, complete demo seeds and isolation tests | Public reading in [P02d-4](docs/roadmap/phase-02d-walking-skeleton.md) |
7287
| **API foundation** | Error contracts, validation, tenancy, concurrency and observability infrastructure | Authentication and durable event processing in [Phase 02b](docs/roadmap/phase-02b-events-auth.md) |
7388
| **Frontend** | Next.js app and public / studio / portal route scaffolds | First two-tenant browser demo in [P02d-5–7](docs/roadmap/phase-02d-walking-skeleton.md) |
7489

@@ -106,8 +121,10 @@ make seed # start infrastructure, apply migrations, seed two demo tenants
106121
```
107122

108123
The seed provisions `demo-english` and `demo-yoga`, their organizations and host
109-
mappings, plus built-in content-type and taxonomy definitions. **It does not yet seed
110-
courses or lessons**; P02d-2 owns those writes.
124+
mappings, enabled locales, distinct branding, built-in and tenant-authored definitions,
125+
and eight scoped courses, ten lessons and twenty-seven translations. It uses the
126+
ordinary authoring pipeline and verifies completed acts before skipping them on rerun.
127+
[SeedData](backend/src/LearnStack.Tools.Seeder/SeedData.cs) owns the complete inventory.
111128

112129
### 3. Start the applications in separate terminals
113130

0 commit comments

Comments
 (0)