Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
206 commits
Select commit Hold shift + click to select a range
808bdfa
docs: define staged classroom simulation contract
MajorIncident Oct 6, 2026
2a35dc5
docs: activate staged simulation roadmap
MajorIncident Oct 6, 2026
4cc497e
docs: checkpoint staged simulation workstream
MajorIncident Oct 6, 2026
dae820d
docs: add staged simulation API guardrails
MajorIncident Oct 6, 2026
294fa82
docs: govern staged Case Study authoring
MajorIncident Oct 6, 2026
8f158aa
docs: add staged simulation cold-start rules
MajorIncident Oct 6, 2026
1b845b1
docs: defer API staged rules to tested runtime tranche
MajorIncident Oct 6, 2026
4610949
feat: validate staged Case Study definitions
MajorIncident Oct 6, 2026
1f71647
feat: emit optional staged simulation metadata
MajorIncident Oct 6, 2026
9322cec
test: cover staged Case Study schema
MajorIncident Oct 6, 2026
1e22806
test: protect staged simulation manifest boundary
MajorIncident Oct 6, 2026
af6b6f2
docs: add tested staged simulation API guardrails
MajorIncident Oct 6, 2026
2a0a60f
docs: checkpoint staged Case Study schema
MajorIncident Oct 6, 2026
ccae0a1
docs: advance staged simulation to persistence
MajorIncident Oct 6, 2026
ea964de
feat: add staged exercise persistence schema
MajorIncident Oct 6, 2026
3e519b8
feat: add staged exercise repository primitives
MajorIncident Oct 6, 2026
8595e1e
test: mirror staged exercise repository semantics
MajorIncident Oct 6, 2026
f7c1e58
test: prove staged exercise repository contract
MajorIncident Oct 6, 2026
09ffaa6
feat: pin staged exercise definition identity
MajorIncident Oct 6, 2026
6979abc
test: mirror staged definition identity
MajorIncident Oct 6, 2026
2579816
test: pin exercise staged definition metadata
MajorIncident Oct 6, 2026
c01dfff
fix: keep exercise definition columns migration-safe
MajorIncident Oct 6, 2026
a2bdcfb
docs: checkpoint staged exercise persistence
MajorIncident Oct 6, 2026
a782a74
docs: advance staged simulation to API tranche
MajorIncident Oct 6, 2026
9de4618
docs: describe staged exercise persistence
MajorIncident Oct 6, 2026
d93e9df
docs: add staged exercise persistence architecture
MajorIncident Oct 6, 2026
9fde9be
docs: record staged exercise database contract
MajorIncident Oct 6, 2026
457cb50
docs: add staged exercise repository guardrails
MajorIncident Oct 6, 2026
c80a145
feat: add exercise API support repository primitives
MajorIncident Oct 6, 2026
065e60a
test: mirror exercise API support primitives
MajorIncident Oct 6, 2026
b504034
fix: bind readiness writes to observed assignment
MajorIncident Oct 6, 2026
c72cd39
test: mirror readiness assignment race guard
MajorIncident Oct 6, 2026
5563bd9
feat: add staged exercise API handlers
MajorIncident Oct 6, 2026
0aead46
feat: expose Instructor staged exercise route
MajorIncident Oct 6, 2026
14fcd95
feat: expose Student staged exercise route
MajorIncident Oct 6, 2026
a39721c
feat: expose Student exercise readiness route
MajorIncident Oct 6, 2026
e4531d8
fix: block staged Student full-case bypass
MajorIncident Oct 6, 2026
5afc004
test: cover staged exercise API authorization
MajorIncident Oct 6, 2026
cb52bbf
docs: checkpoint staged exercise APIs
MajorIncident Oct 6, 2026
9140672
docs: document staged exercise API contract
MajorIncident Oct 6, 2026
2282925
docs: advance staged simulation to edit-freeze tranche
MajorIncident Oct 6, 2026
9eea334
feat: make collaboration writes capability-policy aware
MajorIncident Oct 6, 2026
6a8fb4f
feat: resolve Classroom Student write policy
MajorIncident Oct 6, 2026
1aec6a1
feat: enforce Classroom Student write policy
MajorIncident Oct 6, 2026
96eab74
feat: persist debrief Student editing policy
MajorIncident Oct 6, 2026
438915e
test: mirror Classroom write-policy primitives
MajorIncident Oct 6, 2026
4eb7f5e
feat: enforce staged debrief editing policy
MajorIncident Oct 6, 2026
507da02
fix: make Classroom edit freeze mutation-atomic
MajorIncident Oct 6, 2026
fb8cb73
test: mirror atomic Classroom Student write path
MajorIncident Oct 6, 2026
d66eeea
test: prove server-enforced Classroom edit freeze
MajorIncident Oct 6, 2026
f3304a2
fix: preserve edit policy across pause and resume
MajorIncident Oct 6, 2026
261b28d
test: preserve freeze across pause and resume
MajorIncident Oct 6, 2026
75faed5
docs: checkpoint server-enforced exercise freeze
MajorIncident Oct 6, 2026
babf802
docs: document Classroom Student edit lock
MajorIncident Oct 6, 2026
3606546
docs: guard atomic Classroom edit freeze
MajorIncident Oct 6, 2026
c16104d
docs: define staged disclosure and edit-freeze security
MajorIncident Oct 6, 2026
1a0b316
docs: advance staged simulation to Instructor console
MajorIncident Oct 6, 2026
2624f1e
Expose staged exercise discovery to instructors
MajorIncident Oct 6, 2026
0c2be87
Add Instructor exercise console client
MajorIncident Oct 6, 2026
00e6039
Test Instructor staged exercise discovery
MajorIncident Oct 6, 2026
000e1f9
Wire Instructor exercise console lifecycle
MajorIncident Oct 6, 2026
e59a872
Add Instructor exercise console shell
MajorIncident Oct 6, 2026
7e66505
Style Instructor exercise console shell
MajorIncident Oct 6, 2026
80734d2
Test Instructor exercise console foundation
MajorIncident Oct 6, 2026
15bc152
Document Instructor exercise client boundary
MajorIncident Oct 6, 2026
d20a303
Catalog Instructor exercise console anchor
MajorIncident Oct 6, 2026
6015482
Document Tranche 6A Instructor console checkpoint
MajorIncident Oct 6, 2026
a144a64
Document Tranche 6A staged simulation checkpoint
MajorIncident Oct 6, 2026
6a69426
Add Instructor exercise draft creation
MajorIncident Oct 6, 2026
1324ff9
Add staged exercise draft selector
MajorIncident Oct 6, 2026
a457864
Style staged exercise draft setup
MajorIncident Oct 6, 2026
e4deeaf
Test Instructor exercise draft creation
MajorIncident Oct 6, 2026
57ecf55
Harden integrated classroom browser timeout
MajorIncident Oct 6, 2026
c3440eb
Add staged exercise browser fixture
MajorIncident Oct 6, 2026
1035ed7
Cover Instructor exercise draft creation in browser
MajorIncident Oct 6, 2026
40a113b
Document Instructor draft creation boundary
MajorIncident Oct 6, 2026
a503be8
Update Instructor exercise console anchor
MajorIncident Oct 6, 2026
0a9d4b4
Document Tranche 6B draft creation checkpoint
MajorIncident Oct 6, 2026
46747e5
Document Tranche 6B staged simulation checkpoint
MajorIncident Oct 6, 2026
9f6d811
Mark exercise selector option summary-excluded
MajorIncident Oct 6, 2026
bd7658a
Mark exercise selector label local-only
MajorIncident Oct 6, 2026
5f3fb56
Mark exercise options local-only for persistence guard
MajorIncident Oct 6, 2026
f7ae23a
Reconcile Tranche 6B guard fixes
MajorIncident Oct 6, 2026
9db5648
Reconcile Tranche 6B local-only controls
MajorIncident Oct 6, 2026
e42e9fe
Keep Instructor dashboard rail vertically reachable
MajorIncident Oct 6, 2026
957abe1
Restore integrated classroom acceptance timeout
MajorIncident Oct 6, 2026
116ea21
Test Instructor dashboard rail scrolling
MajorIncident Oct 6, 2026
53ce2b7
Raise integrated classroom acceptance timeout
MajorIncident Oct 6, 2026
f48e284
Add Instructor exercise lifecycle controls
MajorIncident Oct 6, 2026
2fd8c97
Add Instructor exercise lifecycle controls
MajorIncident Oct 6, 2026
d0f35b5
Style Instructor exercise lifecycle context
MajorIncident Oct 6, 2026
4b28845
Support exercise lifecycle in browser fixture
MajorIncident Oct 6, 2026
e350d59
Cover Instructor exercise start pause resume
MajorIncident Oct 6, 2026
ba1aa45
Test Instructor exercise lifecycle controls
MajorIncident Oct 6, 2026
2888beb
Document Instructor lifecycle console scope
MajorIncident Oct 6, 2026
a2e6380
Document Instructor exercise lifecycle anchor
MajorIncident Oct 6, 2026
69051a6
Document Instructor lifecycle authorization rules
MajorIncident Oct 6, 2026
4a5c90e
Document Tranche 6C checkpoint
MajorIncident Oct 6, 2026
1f0c9f0
Document Tranche 6C simulation checkpoint
MajorIncident Oct 6, 2026
1de00a1
Avoid nested Instructor roster scrolling
MajorIncident Oct 6, 2026
58c6964
Add exercise release and progress panels
MajorIncident Oct 6, 2026
e28d4aa
Style exercise release and progress panels
MajorIncident Oct 6, 2026
e044559
Add evidence release and readiness progress
MajorIncident Oct 6, 2026
5db58b4
Reuse Instructor observer from exercise progress
MajorIncident Oct 6, 2026
f7e9940
Add synthetic release and progress fixture data
MajorIncident Oct 6, 2026
d68f2dc
Implement synthetic evidence release semantics
MajorIncident Oct 6, 2026
811ef2b
Test evidence release and readiness progress
MajorIncident Oct 6, 2026
141f728
Cover evidence release and team progress
MajorIncident Oct 6, 2026
2c8145b
Annotate dynamic exercise controls as local only
MajorIncident Oct 6, 2026
1403667
Document exercise release and progress scope
MajorIncident Oct 6, 2026
58c7fd7
Document exercise release and progress guardrails
MajorIncident Oct 6, 2026
7053801
Document exercise release and progress anchor
MajorIncident Oct 6, 2026
648ee03
Document Tranche 6D checkpoint
MajorIncident Oct 6, 2026
7ee2956
Document Tranche 6D staged-simulation checkpoint
MajorIncident Oct 6, 2026
044e4f8
Add debrief controls and class rail collapse
MajorIncident Oct 7, 2026
8944ed6
Style debrief controls and collapsible class rail
MajorIncident Oct 7, 2026
35d91cb
Add collapsible Instructor class rail
MajorIncident Oct 7, 2026
4c11e77
Add debrief checkpoints and editing controls
MajorIncident Oct 7, 2026
c013b19
Add synthetic debrief checkpoints and editing policy
MajorIncident Oct 7, 2026
a89df3d
Test debrief checkpoints and editing policy
MajorIncident Oct 7, 2026
d71009f
Test mobile class rail collapse
MajorIncident Oct 7, 2026
9abcd77
Cover debrief controls and mobile rail
MajorIncident Oct 7, 2026
61aa582
Open collapsed class rail in mobile coaching journey
MajorIncident Oct 7, 2026
41c2bdd
Document Tranche 6E checkpoint
MajorIncident Oct 7, 2026
e855df0
Add Advance and Complete exercise controls
MajorIncident Oct 7, 2026
63b3b25
Complete Instructor exercise lifecycle controls
MajorIncident Oct 7, 2026
3368a1d
Extend synthetic exercise through completion
MajorIncident Oct 7, 2026
011b46a
Guard authored stage transitions precisely
MajorIncident Oct 7, 2026
1e8050a
Test Advance and Complete lifecycle
MajorIncident Oct 7, 2026
e2f5534
Cover full staged exercise completion in browser
MajorIncident Oct 7, 2026
f36be4d
Document Tranche 6F checkpoint
MajorIncident Oct 7, 2026
e307ca2
Expose stable Student class-session lifecycle
MajorIncident Oct 7, 2026
345ce8e
Add Student case reference surface
MajorIncident Oct 7, 2026
6ced2d3
Add Student staged case reference controller
MajorIncident Oct 7, 2026
d7f0467
Wire Student staged case reference lifecycle
MajorIncident Oct 7, 2026
01e6470
Style compact Student case reference
MajorIncident Oct 7, 2026
819acc2
Serve Student-safe staged exercise fixture
MajorIncident Oct 7, 2026
c24a6b8
Disconnect Student exercise session on role change
MajorIncident Oct 7, 2026
d89734a
Test stable Student session lifecycle hooks
MajorIncident Oct 7, 2026
227c4db
Test Student staged case reference
MajorIncident Oct 7, 2026
3d1ff78
Show Student case reference with assigned Intake
MajorIncident Oct 7, 2026
c87f641
Cover Student staged case reference in browser
MajorIncident Oct 7, 2026
91d7029
Prevent Student mobile workspace overlays
MajorIncident Oct 7, 2026
4605fff
Document Tranche 7A checkpoint
MajorIncident Oct 7, 2026
e43b84c
feat: add Student exercise readiness interaction
MajorIncident Oct 7, 2026
3e6e712
feat: add Student readiness controls
MajorIncident Oct 7, 2026
6106a7b
style: present Student readiness controls
MajorIncident Oct 7, 2026
ee0aaa3
test: cover Student readiness interaction
MajorIncident Oct 7, 2026
d6e9416
test: model Student exercise readiness in browser fixture
MajorIncident Oct 7, 2026
d311b7b
test: prove Student Ready and Resume Working in browser
MajorIncident Oct 7, 2026
247479f
fix: preserve absent Student readiness revision
MajorIncident Oct 7, 2026
8d70e84
feat: project frozen Student debrief as read only
MajorIncident Oct 7, 2026
3751ce5
style: signal frozen Student Intake controls
MajorIncident Oct 7, 2026
3a87248
test: cover frozen Student Intake projection
MajorIncident Oct 7, 2026
50435c3
test: prove frozen Student Intake projection in live class
MajorIncident Oct 7, 2026
9479099
docs: checkpoint Student staged interaction progress
MajorIncident Oct 7, 2026
636419a
docs: define Student freeze and checkpoint inspection boundary
MajorIncident Oct 7, 2026
0ce4b8d
feat: add scoped Instructor checkpoint lookup
MajorIncident Oct 7, 2026
3af820b
test: mirror scoped checkpoint lookup
MajorIncident Oct 7, 2026
c9f2c47
feat: gate checkpoint snapshots behind explicit Instructor read
MajorIncident Oct 7, 2026
60cc451
feat: add Instructor checkpoint inspection route
MajorIncident Oct 7, 2026
ccd3cd0
test: enforce explicit Instructor checkpoint reads
MajorIncident Oct 7, 2026
9b34669
feat: add explicit Instructor checkpoint inspection action
MajorIncident Oct 7, 2026
675c111
feat: add return-to-live checkpoint affordance
MajorIncident Oct 7, 2026
d4394b3
style: distinguish checkpoint inspection controls
MajorIncident Oct 7, 2026
eef4981
feat: render immutable checkpoint in Instructor observer
MajorIncident Oct 7, 2026
033654c
feat: connect exercise checkpoints to Instructor observer
MajorIncident Oct 7, 2026
319df8e
test: model explicit checkpoint inspection in browser fixture
MajorIncident Oct 7, 2026
24e015d
test: cover explicit Instructor checkpoint inspection
MajorIncident Oct 7, 2026
50bc75f
test: cover checkpoint-to-live Instructor observation
MajorIncident Oct 7, 2026
4d3f467
test: prove checkpoint versus live Intake in integrated class
MajorIncident Oct 7, 2026
82f7a21
perf: keep checkpoint list metadata only
MajorIncident Oct 7, 2026
7edd86b
test: mirror metadata-only checkpoint listing
MajorIncident Oct 7, 2026
73f235f
fix: keep checkpoint inspection aligned with display state
MajorIncident Oct 7, 2026
c6f5240
fix: annotate checkpoint control persistence boundary
MajorIncident Oct 7, 2026
83af52b
test: assert metadata-only checkpoint listing
MajorIncident Oct 7, 2026
b69de71
test: assert server-authoritative readiness revision
MajorIncident Oct 7, 2026
44821c5
test: extend integrated staged classroom budget
MajorIncident Oct 7, 2026
8530128
test: budget full staged classroom comparison journey
MajorIncident Oct 7, 2026
b198c52
test: isolate checkpoint comparison browser acceptance
MajorIncident Oct 7, 2026
9469c14
test: serialize integrated classroom fixture
MajorIncident Oct 7, 2026
04587bf
test: use established integrated class selectors
MajorIncident Oct 7, 2026
18f6ccd
docs: define explicit checkpoint inspection API
MajorIncident Oct 7, 2026
1093908
docs: guard checkpoint snapshot authorization
MajorIncident Oct 7, 2026
3f65333
docs: guard checkpoint observer projection
MajorIncident Oct 7, 2026
a9cc838
docs: define checkpoint inspection boundary
MajorIncident Oct 7, 2026
978cfb4
docs: checkpoint immutable debrief inspection
MajorIncident Oct 7, 2026
3aa078a
docs: complete checkpoint inspection tranche
MajorIncident Oct 7, 2026
ace5424
fix: improve Instructor exercise button contrast
MajorIncident Oct 7, 2026
6391c39
fix: improve Instructor Ready status contrast
MajorIncident Oct 7, 2026
523d245
test: mirror staged Student security in browser fixture
MajorIncident Oct 7, 2026
f5e9fcc
test: cover staged late join and security boundaries
MajorIncident Oct 7, 2026
627f81e
test: axe-check expanded mobile case reference
MajorIncident Oct 7, 2026
ceda404
test: cover mobile Instructor staged console
MajorIncident Oct 7, 2026
5178d40
test: prove readiness stays with reassigned workspace
MajorIncident Oct 7, 2026
89a5321
test: derive checkpoint revisions in browser acceptance
MajorIncident Oct 7, 2026
cf744d6
docs: checkpoint staged acceptance tranche
MajorIncident Oct 7, 2026
b000cea
docs: complete staged acceptance tranche
MajorIncident Oct 7, 2026
65390fc
docs: describe implemented staged classroom simulation
MajorIncident Oct 7, 2026
6bdd8d5
docs: reconcile exercise persistence with active APIs
MajorIncident Oct 7, 2026
e8395e1
docs: advance staged simulation roadmap to final audit
MajorIncident Oct 7, 2026
b5867ff
docs: record staged simulation final audit
MajorIncident Oct 7, 2026
8974519
docs: complete staged simulation merge-readiness audit
MajorIncident Oct 7, 2026
f6323c3
docs: define post-staged Classroom roadmap
MajorIncident Oct 7, 2026
2dfaab4
docs: close out staged simulation workstream
MajorIncident Oct 7, 2026
255e3a3
docs: hand off staged simulation to production case enablement
MajorIncident Oct 7, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ See `docs/REPOSITORY-OPERATIONS.md#delivery-resilience-for-ai-assisted-work` for

## Long-running Classroom Program

The Standalone / Student / Instructor program is tracked by #288. Any work touching experience roles, classes, classroom workspaces, instructor observation, coaching, or protected Case Studies must read `docs/classroom-architecture.md`, `docs/classroom-roadmap.md`, and `docs/classroom-workstream.md` before editing. Class/API authorization work must additionally read `docs/classroom-api.md` and `api/AGENTS.md`.
The Standalone / Student / Instructor program is tracked by #288. Any work touching experience roles, classes, classroom workspaces, instructor observation, coaching, or protected Case Studies must read `docs/classroom-architecture.md`, `docs/classroom-roadmap.md`, and `docs/classroom-workstream.md` before editing. Class/API authorization work must additionally read `docs/classroom-api.md` and `api/AGENTS.md`. Staged exercise/debrief work under #313 must also read `docs/classroom-staged-simulation.md`.

Classroom invariants:

Expand All @@ -48,6 +48,7 @@ Classroom invariants:
- student credentials never provide class/workspace enumeration;
- Case Study unlock passwords are pedagogy, not authentication;
- protected Case Study metadata/payloads are server-gated, absent from public browser/static assets, and authored `templates/*.json` remains excluded from Vercel deployment; `src/templates.manifest.js` is Standard-only and browser code must never import `api/protected-case-studies.manifest.js`.
- staged simulation content follows `docs/classroom-staged-simulation.md`: future-stage and Instructor-only material are server-withheld, complete protected Case Study `state` cannot bypass an active staged release, and exercise/checkpoint state never enters Intake serialization;
- public Vercel static output comes only from generated `dist/`; never set `outputDirectory` back to `.` or otherwise expose repository docs/tests/scripts/AGENTS/authoring files. `scripts/build-vercel-public.mjs` owns the allowlisted browser bundle and is part of the canonical quality gate.

Every classroom PR must update `docs/classroom-workstream.md` before handoff with its issue, PR/base dependency, current HEAD, completed/incomplete work, validation, risks, and exact next action. For stacked PRs, state the merge order and never describe an unmerged dependent PR as independently mergeable.
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ The database stores only SHA-256 capability hashes. `CLASS_EXPIRY_DAYS` optional

See `docs/classroom-api.md` for the endpoint/capability matrix and `SECURITY.md` for the security boundary. Instructor observation is implemented through the separate GET-only `/api/classes/observe` path, authorized by the Instructor class capability after class/workspace ownership is proven. It never resolves through the editable workspace-alias path.

#313 staged simulation is implemented end-to-end on the active classroom branch. Protected Case Studies may carry an explicit server-only `simulation` definition; additive Neon tables persist class exercise lifecycle, optional releases, workspace readiness, and immutable debrief checkpoints. Running exercises pin the staged-definition version plus a definition fingerprint and inherit the owning class expiry. Instructor APIs/UI support staged selection, Start/Pause/Resume, controlled evidence release, debrief, explicit edit freeze/unfreeze, checkpoint inspection, Advance, and Complete. Student staged reads use the stable class-session capability, expose only current/cumulative Student-safe material, support Ready/Resume Working, and project frozen debrief Intake read-only while the server enforces writes with HTTP 423. These tables and clients do **not** duplicate live Intake state: collaboration workspaces remain the only live snapshot/revision source of truth, checkpoint snapshots are historical read-only evidence, and Classroom exercise/session state stays outside Intake persistence/export/summary. Production official Case Study stage content remains intentionally unauthored until authoritative material is supplied.

### Conflict recovery and two-window testing

Updates use optimistic revision control: each complete snapshot retains the revision observed when it was captured. Text edits wait about 300 ms so typing is responsive, blur flushes pending text, and completed select, checkbox, radio, and button-driven changes save immediately where the owning control is identifiable. Only one PUT is sent at a time; edits made during that request collapse to the latest snapshot and follow the successful response at its returned revision. A stale write receives HTTP 409 and cannot overwrite the newer row.
Expand Down
4 changes: 4 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ Protected Case Study delivery is a separate server boundary. The public browser

Protected Case Study catalog responses contain metadata only; payloads are selected in authenticated POST bodies, not query strings. All protected Case Study responses use `Cache-Control: no-store` and `Referrer-Policy: no-referrer`. The rotating mode password remains a pedagogical progression control and is **not** an authentication boundary.

For #313 staged simulation, Student progressive disclosure is server-side authorization, not UI hiding. A Student class-session may receive only the cumulative Student-safe release through the current exercise stage. Future-stage material, Instructor facilitation/model/exemplar material, and the complete protected Case Study source `state` must not be returned through the staged Student endpoint. If a class has a staged exercise record for a Case Study, Student full-payload retrieval for that case is blocked even after exercise completion unless a future explicit reveal contract is added.

Staged Student edit freeze is also server-enforced. When the represented class's current exercise has `student_editing_enabled=false`, an active `classroom-student` alias may still GET the collaboration workspace and maintain presence, but `PUT /api/workspaces/session` returns HTTP **423** with code `classroom-editing-locked`. The write must not mutate snapshot or revision. Production enforcement repeats the lock predicate atomically inside the workspace UPDATE to close check-then-write races. Standalone/primary collaboration tokens and classes with no current staged exercise are not subject to this Classroom lock.

Authored JSON under `templates/*.json` is build-time source and is excluded from Vercel uploads with `.vercelignore`. Production must use committed generated manifests and run `npm run verify:protected-cases`; do not change the Vercel build back to a command that needs excluded authoring JSON. The verifier must remain in the canonical quality gate and must prove protected IDs/names are absent from public browser runtime assets.

Public static delivery is also an explicit allowlist boundary. `scripts/build-vercel-public.mjs` emits only browser runtime files plus the intentionally public `docs/eula.md` to `dist/`, and Vercel must keep `outputDirectory: "dist"`. Never return static output to the repository root: production previously exposed internal Markdown and build scripts when `outputDirectory` was `.`. Other `docs/`, `tests/`, `scripts/`, AGENTS files, authoring material, and repository metadata must not be public assets.
Expand Down
29 changes: 29 additions & 0 deletions api/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,32 @@ Rules:
- assignment changes use optimistic `assignment_revision` checks; a conflicting update may leave old access revoked, but must never leave old access valid or remap it to a new workspace.
- stale presence cleanup after reassignment uses internal workspace identity, not the revoked bearer token.
- individual live workspaces remain single-participant; cross-class destination assignment is rejected generically.

## #313 staged simulation direction

Read `docs/classroom-staged-simulation.md` before modifying exercise/stage/protected-resource behavior.

Rules:
- exercise lifecycle is class-scoped Instructor authority and remains separate from Intake snapshots, collaboration revision, and coaching revision;
- Student staged exercise reads authenticate with the stable Student class-session capability and return only the represented learner's class-level release/readiness context;
- a Student class-session token still does **not** authorize collaboration edits;
- future-stage material and Instructor-only facilitation/model/exemplar content must be omitted server-side from Student responses;
- never ship a complete staged Case Study to the browser and rely on UI hiding for progressive disclosure;
- existing protected Case Study `state` is complete source/exemplar material; when that case is the active staged exercise, the Student full-payload route must not bypass staged release;
- optional content release, debrief, and stage advance are Instructor-only and optimistic-revision protected;
- Student/team Ready state resolves the participant's current assignment server-side; stale pre-reassignment authority cannot mutate old-team exercise state;
- beginning debrief must capture idempotent immutable workspace checkpoints before any optional post-debrief edits;
- if Student editing is frozen, enforce it on the `classroom-student` collaboration snapshot write path; UI read-only projection alone is not authority;
- frozen Student snapshot PUT uses HTTP 423 with stable code `classroom-editing-locked`; the rejected request must not advance collaboration revision;
- the real workspace mutation must repeat the Classroom freeze predicate atomically with the UPDATE so a freeze racing a Student save fails closed; a preflight policy check alone is insufficient;
- Classroom freeze must not block workspace GET, presence, Instructor observation/coaching, Student staged reads/readiness, or Standalone/primary collaboration tokens;
- Pause/Resume preserve the current Student editing policy. Only stage debrief defaults and explicit Instructor debrief `set-editing` may change that policy;
- late joiners receive only the current cumulative Student release; reassignment changes workspace Intake/readiness, not class exercise stage;
- exercise persistence uses one non-completed exercise per class initially, optimistic `exercise_revision`, idempotent optional releases, workspace-scoped readiness, immutable first-write-wins debrief checkpoints, and class-bounded expiry;
- every running exercise pins the staged simulation version plus a definition fingerprint; later API reads/mutations must fail closed if the current protected definition does not match;
- checkpoint snapshots are facilitation evidence only and must never overwrite or become the live collaboration snapshot automatically;
- normal Instructor exercise payloads must expose checkpoint **metadata only**; snapshot bytes require the explicit Instructor-only current-stage debrief checkpoint read and must remain class/workspace/stage scoped;
- the checkpoint read is GET-only, must never mint workspace edit authority, and must reject Student/join/assignment/unrelated-class authority without leaking whether another team's checkpoint exists;
- `student_editing_enabled=false` is now a server-enforced security boundary for `classroom-student` snapshot PUT; preserve that invariant when changing exercise or collaboration code;
- do not create production stage definitions from guessed official case boundaries. Synthetic deterministic staged content is acceptable in tests until authoritative material is supplied.

Loading
Loading