Repository navigation
Add staged classroom simulation and debrief orchestration - #315
Merged
Merged
Conversation
MajorIncident
marked this pull request as ready for review
October 7, 2026 04:20
This was referenced Oct 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
b141d55050207e4cf7ce842a4452a220a5268968feature/classroom-staged-simulationmainGoal
Turn the live Classroom substrate into an Instructor-orchestrated staged simulation:
Tranche 1 — architecture / server contract
Architecture checkpoint:
808bdfaa74e7e6a11a88173ee43c5c86d9a8da51.Canonical contract:
docs/classroom-staged-simulation.md.Decisions:
stateis source/exemplar material and cannot be the staged Student feed;simulationdefinition; official stages must never be inferred from a completed Intake payload;exercise_revision;Governance checkpoints:
2a35dc5b81eaa8427bf91d7b8897e09417af18cc;4cc497e4410d3562c20161199212cc98879e5355;af6b6f21a8e4f25f014a8362857a1c15e252775b(restored alongside tested schema work);294fa82164f10c3a0cc14a2f8577abde51b04c31;8f158aa58ba70b188e4b4bfe28490499f1279a4c.No schema/runtime/UI changes are part of this tranche.
Tranche 2 — staged Case Study authoring schema
Implementation checkpoint:
af6b6f21a8e4f25f014a8362857a1c15e252775b.Documentation checkpoint:
ccae0a1800b7e2dd269c2da19ad095685698db1e.Implemented:
simulationis accepted only on protectedcase-studyresources;assetId, not arbitrary public URLs;Validation on implementation head:
Tranche 3 — exercise persistence / repository
Implementation checkpoint:
c01dfff2f2bd1f9d7625901860210cc00eee7051.Documentation checkpoint:
457cb50edd94e355a9e7ec83f11972590da6b4b7.Implemented:
classroom_exercises, optional-release, workspace-readiness, and immutable-checkpoint persistence;exercise_revision;Final validation on documentation head
457cb50edd94e355a9e7ec83f11972590da6b4b7after definition-identity hardening:Exact next tranche: Tranche 4 exercise APIs/authorization only — Instructor create/read/lifecycle/release/debrief/checkpoint/advance/complete, Student class-session current release + workspace readiness, staged-definition drift checks, and active-staged-case full-payload bypass closure. Build the full authorization matrix. Do not expose a claimed edit-freeze guarantee until Tranche 5 enforces it on Student collaboration PUT, and do not add exercise UI yet.
Tranche 4 — exercise APIs / authorization
Implementation/security-test checkpoint:
5afc0041db89348d97ca0986cab89491765d0e00.Documentation checkpoint:
2282925ce7f5f52609f85bb0a8610856ecf87653.Implemented:
POST/GET/PATCH /api/classes/exercisefor staged draft creation/read plus start/pause/resume/optional release/begin-debrief/advance/complete;exercise_revisionlifecycle and immutable stage ordering;GET /api/classes/exercise/studentwith cumulative Student-safe release only;editFreezeEnforced: falseuntil the collaboration write guard lands.Validation:
Exact next tranche: Tranche 5 server-enforced Student editing policy — enforce the staged exercise editing policy on
classroom-studentcollaboration PUT before revision mutation, preserve GET/presence/coaching/readiness and Standalone/no-exercise behavior, define the temporary-lock response contract, and add direct authorization/regression tests. No exercise UI yet.Tranche 5 — server-enforced Student editing policy
Implementation checkpoint:
261b28d488538964ccd73132ed568d73628f6411.Documentation checkpoint:
1a0b316fabfb46f07267acbc6393b3a1ad2c7edc.Implemented:
classroom-studentsnapshot writes resolve the current staged exercise editing policy while primary/Standalone collaboration bypasses Classroom policy;PUT /api/workspaces/sessionreturns 423 Locked with stable codeclassroom-editing-locked;defaultDebriefEditPolicy;set-editingsupports explicit debrief freeze/unfreeze;editFreezeEnforced: trueand authoritativestudentEditingEnabled.Validation:
Exact next tranche: Tranche 6 Instructor exercise console inside the existing live Instructor dashboard. Add staged Case Study selection/draft creation, Instructor-only stage/facilitation material, lifecycle/release/debrief/freeze/advance/complete controls, team readiness/progress, optimistic-conflict refresh, and existing observer/coaching navigation. Keep Student staged-case UI and production official-case staging deferred.
Planned implementation tranches
simulation, validation/cross-references, public-boundary tests; no production stage guesses.Security / rollback
Cold restart
Read:
AGENTS.md;docs/classroom-staged-simulation.md;docs/classroom-architecture.md;docs/classroom-api.md;docs/classroom-roadmap.md;docs/classroom-workstream.md;api/AGENTS.md;templates/AGENTS.md;Tranche 6A — Instructor exercise console foundation
Implementation spans
2624f1e...throughd20a303....Implemented:
GET /api/classes/exerciseexposes a server-filteredavailableCaseStudieslist containing staged Case Study summaries only;src/classroomExerciseInstructor.jsowns memory-only exercise discovery/current-state reads;Tranche 6B — staged Case Study selection and draft creation
Implementation spans
6a69426...through5f3fb56...; deterministic synthetic browser-fixture support is atc3440eb....Implemented:
caseStudyId;created: falseidempotent reuse both hydrate the server-owned draft in memory;Tranche 6C — Start/Pause/Resume and current-stage Instructor context
Implementation spans
53ce2b7...through2888beb..., followed by documentation synchronization on the same branch.Implemented:
exerciseRevision;Tranche 6D — optional evidence release and team readiness/progress
Implementation spans
1de00a1...through green implementation head2c8145b...; durable documentation checkpoint is7ee2956....Implemented:
release-contentuses the currentexerciseRevision;workspaceStaterenders Ready/Working progress;selectWorkspace()path;Validation on
2c8145b31f96403f59ff3b41d9396fd2a3ac86ed:Tranche 6E — Begin Debrief, checkpoint review, editing policy, and compact class rail
Implementation spans
044e4f82...through green implementation head61aa582...; durable documentation checkpoint is41c2bdd....Implemented:
studentEditingEnabledis shown separately from Pause/Resume;set-editing; the existing server 423 write guard remains the actual enforcement boundary;Validation on
61aa582e9faee9a7e500796634c5cc06e256ff14:Mobile workspace UX follow-on: align Notes and the Instructor class rail around the same compact-mobile principle. Prefer an always-discoverable collapsed header/launcher rather than hiding either surface; evaluate making Notes default-collapsed on narrow screens and reducing its collapsed chrome.
Tranche 6F — Advance/Complete and Instructor-console lifecycle completion
Implementation spans
e855df09...through green implementation heade2f5534...; durable documentation checkpoint isf36be4da....Implemented:
Validation on
e2f5534aa0e85bccc2bee0e73275c9b77d000f3d:Tranche 7A — Student current-stage case-reference foundation
Implementation spans
e307ca2...through green implementation head91d7029...; durable documentation checkpoint is4605fff....Implemented:
src/classroomExerciseStudent.jsowns the Student staged-exercise reference rather than expanding assignment authority;GET /api/classes/exercise/student; rotating workspace capabilities remain collaboration-only;classroomStudent.jsnow exposes separate stable session lifecycle hooks, so team reassignment rotates workspace authority without disconnecting the staged exercise reference;Validation on
91d7029bec5cddaf251d02301a4fd1ce97dc908c:Tranche 7B — Student Ready / Resume Working
Implemented:
PUT /api/classes/exercise/student/ready, sending exactly{ ready: boolean };e43b84c...through247479f..., with browser acceptance throughd311b7b....Tranche 7C — frozen-debrief Student Intake projection
Implemented:
8d70e84...through50435c3...;636419a9a49cda92e57036ad990e814550aa1081.Completed Tranche 8A — immutable checkpoint inspection versus current live work
/api/classes/exercise/checkpoint?workspaceId=...is Instructor/class/stage scoped and never mints workspace authority or mutates live Intake;0ce4b8d...through8530128..., with browser isolation/stabilization through04587bf...;Completed Tranche 9 — integrated staged security / late-join / reassignment acceptance
classroom-editing-lockedwith zero snapshot/revision mutation;89a5321a750606cff6fbf34ccf75ef40dc3def07: repository quality 302 tests / 301 pass / 0 fail / 1 intentional skip; Browser E2E 28 passed / 10 intentional skips / 0 failed / 0 flaky; all required gates green.Completed Tranche 10 — final documentation/security/merge-readiness audit
templates/*.jsonexcluded from Vercel source upload, generateddist/as public output;simulation; synthetic staged content remains test-only;Final audited head:
8974519108d6735383b8358373d005188501a785Final validation:
Status: ready for review. Do not merge automatically. Production official-case staging remains deferred until authoritative instructional material is supplied and reviewed.
Post-merge roadmap
The staged-simulation engine is complete, but production-Classroom work continues as separate follow-ons:
intakeTargetIdsto stable Intake targets and close the deferred dynamic Possible Cause coaching-identity gap.Recommended order: merge #315 → #316 → #317, with #318/#319 as facilitation-completeness work and #320 able to proceed in parallel.
No official production Case Study staging should be added as a shortcut before #316 and authoritative source review.