Repository navigation
Closed
Description
Problem or outcome
Milestone 1 (the operable shell) is complete: #2, #4, #6, #8, #10 all closed. The next milestone is versioned program configuration — the most consequential schema in the product, because finalized records pin to exact program versions forever (PRINCIPLES.md 5) and ADR 0001 named configuration-version tooling as a cost to design early. Implementation should not start until the owner settles the questions below; this issue is the design work record.
Proposed shape (for reaction, not a fait accompli)
- Program / ProgramVersion split:
programis the stable identity;program_versionis an immutable, publishable unit. Drafts are mutable until published; publishing freezes the version and everything it references. Enrollments pin aprogram_version, never aprogram. - Version contents as owned rows, not JSON blobs: phases (with non-linear transitions), competencies, tasks, forms, and rating scales as typed tables keyed to the owning
program_version. Database invariant 5 from the domain model (all referenced configuration belongs to the pinned version) becomes enforceable foreign keys instead of application discipline. - Immutability enforcement: published versions get the same trigger-enforced protection as
audit_event— UPDATE/DELETE rejected at the database oncepublished_atis set. - Export/import: a documented, versioned JSON format for whole program versions (PRINCIPLES.md 9), round-trip tested; the canonical record-bytes design (Milestone 0 exit) informs its normalization.
- Vertical slice order: schema + domain services + export/import first with API; authoring UI in the same milestone but a following slice, per the architecture's "web interface is part of every vertical slice" applied at milestone granularity.
Decisions that need the owner
- Rating scale semantics: fixed per-program-version numeric scales with anchors (e.g. 1–7 with definitions), or fully agency-defined shapes (pass/fail, narrative-only, mixed per competency)? This drives the evaluation schema for every later milestone.
- Phase transition model: is a directed graph with explicit allowed transitions enough (covering remediation loops and skips), or do centers need conditional/rule-based transitions in v1?
- Form model: how structured is a Daily Observation Report form — fixed sections owned by the product with agency-configurable competency lists and labels (my recommendation, per the anti-form-builder principle), or does the form itself need configurable sections?
- Draft collaboration: does program authoring need multiple concurrent editors in Milestone 2, or is single-editor with last-write honesty acceptable until proven needed?
- Version numbering: agency-visible version labels (free text like "2026 CTO Program rev B") alongside internal monotonic version numbers — acceptable?
Expected proof (once design is settled)
- ADR for the program-version model
- Migration + domain services + export/import round-trip tests
- A complete invented training program published, enrolled, exported, and reproduced (Milestone 2 exit)
Related roadmap, decisions, or issues
docs/roadmap.mdMilestone 2;docs/domain-model.mdTraining configuration; ADR 0001- Builds on the Milestone 1 foundation (Adopt the ConaryLabs house repo contract and PR gate #2, Milestone 1: first-run setup, administrator accounts, sessions, and password recovery #4, Milestone 1: embedded SvelteKit shell for setup, sign-in, recovery, and status #6, Milestone 1: automatic scheduled backups, retention, and a tested restore path #8, Milestone 1: persisted in-app notices, with backup failures as the first producer #10)
Metadata
Metadata
Assignees
Labels
No labels
Activity
TusanHomichi commentedon Aug 28, 2026
Recording design input and owner direction from design discussion, ahead of the ADR.
Design input: external standards traceability
Centers align training programs to published external standards. CALEA's public-safety communications accreditation program is a driving example — its training standards cover new-hire, CTO-style, and annual in-service requirements, and assessors periodically ask agencies for proofs of compliance — alongside APCO ANS training standards and state POST/continuing-education requirements. Two consequences for this schema:
Standards citations are versioned configuration. A competency, task, or program version can carry agency-entered citations to external standards (body, edition, clause, optional note). The product never embeds standard text (copyrighted, access-controlled reference material) and never grows standards-body-specific code paths (PRINCIPLES.md 1). Citations freeze with the published program version (PRINCIPLES.md 5): when a standards body revises an edition, existing records keep the citations they were created under. Coverage reporting — "every finalized record supporting clause X in this accreditation cycle" — belongs with Milestone 5 exports, but the citation fields exist from the first configuration migration so that report is a query, not a retrofit.
Phases are optional on a program version. Annual/in-service training is a real program shape with no phase progression — topics and hours per cycle rather than a graph. Continuing-education tracking itself can wait for a later milestone, but the schema must not structurally assume phased programs, or annual training becomes a schema break instead of a feature.
Owner direction on the five decisions
Settled frame: agencies configure the vocabulary; the product owns the grammar. Configurability lives in content — terminology, scales, competency lists, labels, citations, phase graphs — not in structure. Two reasons: under PRINCIPLES.md 5 every published configuration shape is a permanent reproduction obligation (deterministic exports must render it for the life of every record pinned to it), and a recognizably consistent record structure is part of what makes a record defensible to a third party such as an accreditation assessor, arbitrator, or counsel.
Decisions 1 and 5 are where agency customization fully lands; 2–4 are where structure stays product-owned. That boundary is the pattern to hold through implementation.
Next
ADR for the program-version model encoding the above, then the schema + domain services + export/import slice with round-trip tests, per the expected proof in this issue.
Generated by Claude Code
TusanHomichi commentedon Aug 28, 2026
Slice 1 is merged: #15 (closes #14) implements ADR 0007 — migration 0004 with composite-FK enforcement of invariant 5, trigger-enforced publish freeze proven by raw-SQL tests, phase-optional versions, authoring/publish services gated on
manage_programs, attributable lifecycle audit events, and the versioned JSON export/import with a byte-identical round trip onto a clean installation (docs/formats/program-version-export.md).Remaining under this issue, per the vertical-slice order:
program_version, never a program.This issue stays open as the Milestone 2 design record until the milestone exit — a complete invented training program published, enrolled, exported, and reproduced — is demonstrated end to end.
Generated by Claude Code
TusanHomichi commentedon Aug 28, 2026
Slice 2 is merged: #17 (closes #16) adds the program HTTP API (stable refusal codes, itemized
problemsin the error envelope) and the embedded authoring interface — programs list with create/import, version management with publish/discard/export/import-as-next-version, the structured content editor (drafts wholesale-replaced per ADR 0007, published versions read-only), and a section-level compare view. Proven by five API integration tests and a browser e2e that authors, publishes, and compares a version through the real binary.Remaining under this issue: enrollment pinning — enrollments connecting a trainee to a published
program_version, never a program — and then the Milestone 2 exit demonstration (a complete invented program published, enrolled, exported, and reproduced).Generated by Claude Code
TusanHomichi commentedon Aug 28, 2026
Milestone 2 is complete. Three slices, each merged green:
The exit criterion — a complete invented training program can be published, enrolled, exported, and reproduced — is a passing test (
milestone_two_exit_publish_enroll_export_reproduceintests/enrollments.rs): published on one installation, a trainee enrolled, exported, reproduced byte-identically on a clean installation, then published and enrolled there as well. The browser e2e drives the same authoring, publish, enrollment, and compare flows through the compiled binary.Every owner decision recorded above is encoded in ADR 0007 and implemented as decided. Next per the roadmap: Milestone 3 — sessions and drafts.
Generated by Claude Code