Files
live-quiz/planning/issue-4-follow-through.md
T
kiskaadee 49a76ef70d docs(architecture): establish issue #4 discovery baseline
Preserve the verified architectural invariants, accepted decisions,
decision provenance, and pending Stage 1 recommendations.

Introduce the decision ledger and follow-through tracker as the
authoritative planning artifacts for the next architectural phase.
2026-11-13 17:30:02 -05:00

131 lines
32 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Issue #4 Follow-Through Tracker
**Project:** `live-quiz`
**Scope:** Atomic Stage 1 decision resolution, Architectural Comprehension Walkthrough, Stage 2 ADR/architecture formalization, Stage 3 acceptance criteria, deferred implementation boundaries, and Issue #9 sequencing.
**Repository Baseline:** `main` @ `a4eeccf` ([docs/architecture.md](../docs/architecture.md), [docs/decisions/0001`–`0009](../docs/decisions/README.md)).
**Companion Artifact:** [issue-4-decision-ledger.md](issue-4-decision-ledger.md) (authoritative record of settled decisions, rationale, unapproved recommendations, and target ADR mappings).
> [!IMPORTANT]
> **Critical Sequencing Gate & Progress Maintenance Rules:**
> 1. **One Atomic Decision at a Time:** Update each atomic task (`S1-01`–`S1-17`) incrementally only after an explicit `USER_INPUT` turn resolves it. Never mark a parent or downstream milestone complete while any constituent atomic task remains unresolved.
> 2. **Preserve Approval Provenance:** Previously approved invariants (Section 0) are locked and are **not** re-opened during `S1-01`–`S1-17`; each atomic review evaluates *only* the unresolved delta listed in its deliverable.
> 3. **Walkthrough Gate:** Stage 1 closure (`S1-18`) and the **Architectural Comprehension Walkthrough (`CW-01`)** must be completed and explicitly approved by the user **before Stage 2 (`S2-*`) begins**.
---
## 0. Provenance Baseline: Verified Invariants vs. Unverified Recommendations
Direct audit of `transcript_full.jsonl` separates established user commitments from unapproved assistant recommendations:
### A. Verified Invariants (`USER_EXPLICIT` Provenance — Do Not Re-Ask)
- **Steps `820`, `825`, `827` (Handoff v2 & Baseline Corrections):**
- **`A`:** Immutable pair $A = (Q, R)$; modification of either member requires registering a new flat `assessment_id` issued by `learningctl`; `assessment_version` and version lineage eliminated; M:N Competency↔Objective and Assessment↔Objective links (Competency↔Assessment derived); Tutor owns pedagogical reassessment decisions, performs `AVAILABLE` artifact pre-flight prior to offering reassessment, and requires explicit learner consent before new registration or reassessment.
- **`B1`:** Registered $Q$ and $R$ embed `assessment_id`; $R$ carries `expected_questionnaire_hash`; $H_q = \operatorname{SHA256}(\operatorname{JCS}(Q))$ over the entire validated public questionnaire (including `assessment_id` when present); `expected_sha256` ([ADR-0007](../docs/decisions/0007-atomic-json-export-contract.md)) remains separate; standalone execution (`live-quiz start --questionnaire <path>`) is supported without `assessment_id` or `workspace_id`.
- **`C1` & Partial `C2`:** `live-quiz` commits a complete, self-contained questionnaire snapshot and initial execution metadata (`attempt_id`, optional `assessment_id`, $H_q$, optional `workspace_id`, `time_limit_ns`) to the attempt journal before learner access; recovery uses only the journal snapshot. No historical journal migration for missing snapshots is needed (no prior deployment).
- **Foundational `D` & `E` Invariants:**
- One OS-wide persistent encrypted Learning Registry (candidate: `SQLCipher`); workspaces are logical provenance resolved via nearest-ancestor `.learning-workspace` marker (`workspace_id`), rejecting Git root as workspace boundary.
- Separate host provisioning vs. `learningctl init` (`init` never silently recreates a missing global DB).
- `learningctl` (narrow domain CLI; black-box `learningctl.md`/`--help` contract) $\to$ private typed UDS IPC $\to$ `learning-registryd` (`learning-registry` OS account, systemd socket activation `Accept=no`, serialized requests).
- Non-TPM default host key protection (stored outside workspaces and separate from DB backups); `learning-registryd` owns Online Backup API encrypted-to-encrypted snapshots on schedule and before disruptive operations.
- Registration lifecycle (`REGISTERING` $\to$ `AVAILABLE` / `ABORTED`; only `AVAILABLE` is discoverable; allocated `assessment_id` never reused; registration failure $\neq$ attempt recovery).
- Temporary public-only questionnaire materialization outside workspace, deleted idempotently via `learningctl` after durable engine snapshot commit.
- Read-only `learningctl status` (`--json`, `--all`) run once at Tutor initialization (no polling); `learningctl` discovers candidate journals while `live-quiz` is sole authority for active vs. recoverable state without exposing private SQLite tables.
- Per-command `schema_version` in `learningctl --json` outputs (additive changes increment compatibly, breaking changes increment incompatibly, ignore unknown fields, reject unsupported breaking versions; exact `major.minor` string syntax remains unverified per step `827`).
- In registry-managed workflows, `attempt.json` is an intermediate artifact staged in a persistent non-workspace staging area (no TTL deletion) until the complete learning interaction (`attempt` + `evaluation` + `Tutor observations`) is committed in one atomic registry transaction (`CONSOLIDATED`) with an idempotent receipt. Standalone `attempt.json` exports remain untouched user files.
- Interaction states: `PENDING_DEBRIEF`, `DEFERRED`, `PENDING_CONSOLIDATION`, `CONSOLIDATED`, `ABANDONED`. Abandonment separates **append-only historical events** from **reversible current disposition** (`ABANDONED` $\to$ `DEFERRED` or new attempt on explicit learner request; hidden from default `status` and `--all`). Bounded debrief (1 consolidated report + ~1–3 follow-up turns) is a **facilitation guideline**, not a hard technical limit; interrupted debriefs preserve lightweight structured progress rather than full chat transcripts.
- **Step `829` (`B2.1` Accepted):** $H_q$ is computed over the original parsed JSON representation after strict validation (`extra="forbid"`, `strict=True`), never Pydantic's `model_dump()`.
- **Step `845` (`B2.2` Accepted):** Project-specific strict RFC 8785 JCS-compatible input profile scoped exclusively to `questionnaire.json` (UTF-8 without BOM, no lone surrogates or Unicode noncharacters, no Unicode normalization such as NFC/NFD performed with decoded code points preserved exactly and already-normalized NFC/NFD input accepted, no duplicate keys after unescaping, no non-finite constants, no float/exponent tokens at `parse_float` boundary, integers in $[-(2^{53}-1), +(2^{53}-1)]$; not transferred to `attempt.json`/`evaluation.json`).
- **Step `847` (`B2.3` Accepted):** 3-layer separation (strict Layer 1 parser $\to$ full RFC 8785 Layer 2 canonicalizer on Layer 1 structure $\to$ SHA-256), independent component implementations using established RFC 8785 libraries (no hand-written JCS, no shared first-party runtime package), verified by a mandatory raw-byte shared CI conformance suite.
- **Step `849` (`B2.4` Decomposition & Framing Constraints):** Decomposed `B2.4` into five subdecisions (`B2.4.1`–`B2.4.5`) with fixed constraints (`schema_version` inside $H_q$; changing it creates a new `assessment_id` without lineage; no in-place pair migration; cosmetic/internal changes do not require a new version).
### B. Unverified Recommendations Requiring Atomic Resolution (`Step 850`)
In `step 850`, a runaway assistant response simulated synthetic `<USER_REQUEST>` turns for `B2.4.1` through `E2`. None of the specific choices inside those 17 atomic items (`S1-01`–`S1-17` below) have `USER_EXPLICIT` approval yet.
---
## 1. Stage 1 Closure & Atomic Decision-Provenance Verification
> [!NOTE]
> **True Prerequisites, Soft Dependencies & Disposition Rules:**
> - **Genuine Prerequisites** lists *only* hard architectural prerequisites among open tasks (`None (Settled baseline only)` means the task has no open hard prerequisites and is ready immediately). Soft/informational implementation dependencies are labeled explicitly and do not block architectural resolution.
> - **Task IDs (`S1-01` $\to$ `S1-17`)** reflect our recommended sequential review order.
> - **Valid Atomic Dispositions:** Each atomic decision (`S1-01`–`S1-17`) closes when it receives an explicit `USER_INPUT` assigning one of: `ACCEPTED_AS_PROPOSED`, `ACCEPTED_WITH_MODIFICATIONS`, `REJECTED_IN_FAVOR_OF_ALTERNATIVE`, `DEFERRED_WITH_JUSTIFICATION`, or `NOT_APPLICABLE_WITH_JUSTIFICATION`.
| Task ID | Decision ID | Unresolved Architectural Commitment to Decide (Excluding Already-Settled Baseline) | Genuine Prerequisites | Explicit Completion Condition | Status | Resulting Artifact |
| :--- | :--- | :--- | :--- | :--- | :--- | :--- |
| **`S1-01`** | **`B2.4.1`** | **Contract Version Scope:** Whether `questionnaire.json`'s `schema_version` governs unified structure + frozen optional defaults + assessment-significant execution semantics (vs. structure-only or split version fields), and how it propagates into attempt journal & `attempt.json` provenance. | None *(Settled `BL-03`, `B2.1`, step `849`)* | Explicit `USER_INPUT` recording a justified disposition for `B2.4.1`. | `PENDING_USER_REVIEW` (`UNAPPROVED_RECOMMENDATION — step 850`) | [Ledger §3 — `S1-01`](issue-4-decision-ledger.md#s1-01--b241-contract-version-scope) |
| **`S1-02`** | **`B2.4.2`** | **Semantic Immutability Boundary:** Exact criterion separating contract-significant changes (requiring a new `schema_version`) from contract-preserving improvements (UI/CSS, accessibility, refactoring, compatible renderer patches, spec-compliance bug fixes). | `S1-01` (`B2.4.1`) | Explicit `USER_INPUT` recording a justified disposition for `B2.4.2`. | `PENDING_USER_REVIEW` (`UNAPPROVED_RECOMMENDATION — step 850`) | [Ledger §3 — `S1-02`](issue-4-decision-ledger.md#s1-02--b242-semantic-immutability-boundary) |
| **`S1-03`** | **`B2.4.3`** | **Defaults & Explicit Configuration:** Which questionnaire settings must be explicitly authored (timing, interaction mode, objectives list, behavioral rules) vs. permitted as optional omissions with frozen *"absent/none"* meaning (standalone `assessment_id`, optional stimulus blocks). | `S1-01` (`B2.4.1`) | Explicit `USER_INPUT` recording a justified disposition for `B2.4.3`. | `PENDING_USER_REVIEW` (`UNAPPROVED_RECOMMENDATION — step 850`) | [Ledger §3 — `S1-03`](issue-4-decision-ledger.md#s1-03--b243-defaults-and-explicit-configuration) |
| **`S1-04`** | **`B2.4.4`** | **Contract Version Support & Retirement:** Reconciling permanent semantic freeze with eventual engine retirement of legacy `schema_version`s (`UNSUPPORTED_SCHEMA_VERSION` fail-closed behavior, registry preservation of retired `AVAILABLE` records, and Tutor pre-flight compatibility check). | `S1-01`, `S1-02` (`B2.4.1`–`B2.4.2`) | Explicit `USER_INPUT` recording a justified disposition for `B2.4.4`. | `PENDING_USER_REVIEW` (`UNAPPROVED_RECOMMENDATION — step 850`) | [Ledger §3 — `S1-04`](issue-4-decision-ledger.md#s1-04--b244-contract-version-support-and-retirement) |
| **`S1-05`** | **`B2.4.5`** | **Migration & New Definitions Boundary:** Confirming whether `learningctl`/`learning-registryd` prohibits mechanical schema up-converters (`clone-upgrade`) in addition to prohibiting in-place pair rewrites, requiring consent-gated authoring of a new `assessment_id` linked only via shared objectives. | `S1-01` (`B2.4.1`, settled `BL-01`, `BL-02` & step `849`) | Explicit `USER_INPUT` recording a justified disposition for `B2.4.5`. | `PENDING_USER_REVIEW` (`UNAPPROVED_RECOMMENDATION — step 850`) | [Ledger §3 — `S1-05`](issue-4-decision-ledger.md#s1-05--b245-migration-and-new-definitions-boundary) |
| **`S1-06`** | **`B2.5.1`** | **Boundary Hash Calculation & Verification Authority:** Assigning authoritative $H_q$ calculation vs. verification across authoring (`live-quiz validate` hash output), registration (`learning-registryd` independent recomputation), `live-quiz recover` (digest + structural re-validation), and `learning-registryd` consolidation. | None *(Settled `BL-03`, `BL-04`, `B2.1`–`B2.3`)* | Explicit `USER_INPUT` recording a justified disposition for `B2.5.1`. | `PENDING_USER_REVIEW` (`UNAPPROVED_RECOMMENDATION — step 850`) | [Ledger §3 — `S1-06`](issue-4-decision-ledger.md#s1-06--b251-boundary-hash-calculation-and-verification-authority) |
| **`S1-07`** | **`B2.5.2`** | **Canonical Questionnaire Persistence Representation:** Whether the Learning Registry (`AVAILABLE` payload) and `live-quiz` attempt journal (`C1` snapshot) store **canonical RFC 8785 JCS UTF-8 bytes** (direct `prepare-execution` write without model re-serialization) vs. raw authored JSON bytes. | `S1-06` (`B2.5.1`, settled `BL-04`, `BL-07`) | Explicit `USER_INPUT` recording a justified disposition for `B2.5.2`. | `PENDING_USER_REVIEW` (`UNAPPROVED_RECOMMENDATION — step 850`) | [Ledger §3 — `S1-07`](issue-4-decision-ledger.md#s1-07--b252-canonical-questionnaire-persistence-representation) |
| **`S1-08`** | **`C2`** | **Legacy `attempt.json` (`assessment_version`) Policy:** Confirming whether the initial `attempt.json` schema omits `assessment_version` from day one with fail-closed rejection and zero legacy import/stripping machinery (leaving static files on disk untouched). | None *(Settled `BL-02`, `BL-05`)* | Explicit `USER_INPUT` recording a justified disposition for `C2`. | `PENDING_USER_REVIEW` (`UNAPPROVED_RECOMMENDATION — step 850`) | [Ledger §3 — `S1-08`](issue-4-decision-ledger.md#s1-08--c2-legacy-attemptjson-assessment_version-policy) |
| **`S1-09`** | **`D1a`** | **Registry Repository & Package Ownership:** Whether `learningctl`, `learning-registryd`, and host provisioning live in a separate dedicated repository vs. a three-component monorepo inside the `live-quiz` repository. | None *(Settled `BL-06`, `B2.3`, `ADR-0008`)* | Explicit `USER_INPUT` recording a justified disposition for `D1a`. | `PENDING_USER_REVIEW` (`UNAPPROVED_RECOMMENDATION — step 850`) | [Ledger §3 — `S1-09`](issue-4-decision-ledger.md#s1-09--d1a-registry-repository-and-package-ownership) |
| **`S1-10`** | **`D1b`** | **Workspace Marker Edge Cases, Fail-Closed Taxonomy & Migration Trigger:** Handling duplicate same-dir `init` and unregistered `.learning-workspace` markers, classifying fail-closed DB states (`NOT_PROVISIONED`, `MISSING_OR_LOCKED`, `CORRUPT`, `MIGRATION_REQUIRED`, `UNSUPPORTED_SCHEMA`), and requiring explicit out-of-band backup-gated migrations. | None *(Settled `BL-06`)* | Explicit `USER_INPUT` recording a justified disposition for `D1b`. | `PENDING_USER_REVIEW` (`UNAPPROVED_RECOMMENDATION — step 850`) | [Ledger §3 — `S1-10`](issue-4-decision-ledger.md#s1-10--d1b-workspace-marker-edge-cases-fail-closed-error-taxonomy--migration-trigger) |
| **`S1-11`** | **`D2a`** | **`REGISTERING` Status Visibility & `ABORTED` Tombstone Retention:** Whether incomplete `REGISTERING` definitions appear in a dedicated `learningctl status` category (vs. separate query only) without TTL expiry, and how `ABORTED` tombstones/draft blobs are retained and hidden from ordinary status. | None *(Settled `BL-07`)* | Explicit `USER_INPUT` recording a justified disposition for `D2a`. | `PENDING_USER_REVIEW` (`UNAPPROVED_RECOMMENDATION — step 850`) | [Ledger §3 — `S1-11`](issue-4-decision-ledger.md#s1-11--d2a-registering-status-visibility-and-aborted-tombstone-retention) |
| **`S1-12`** | **`D2b`** | **Startup-Commit Acknowledgment & Temp Questionnaire Cleanup Protocol:** How `live-quiz start` signals durable initial journal snapshot commitment (e.g., port-bind-first + `SESSION_READY` NDJSON line on `stdout` vs. split `init`/`serve`) so `learningctl` cleans up the temp questionnaire before the quiz ends. | None *(Hard prerequisite: settled `BL-04` / `C1` & `BL-07`; Soft / informational dependency: `S1-07` / `B2.5.2`)* | Explicit `USER_INPUT` recording a justified disposition for `D2b`. | `PENDING_USER_REVIEW` (`UNAPPROVED_RECOMMENDATION — step 850`) | [Ledger §3 — `S1-12`](issue-4-decision-ledger.md#s1-12--d2b-startup-commit-acknowledgment-and-temporary-questionnaire-cleanup-protocol) |
| **`S1-13`** | **`D3a`** | **Read-Only Active-vs.-Recoverable Attempt Inspection Contract:** How `live-quiz` tracks active process liveness (continuous `attempt-<attempt-id>.lock` `flock`) and exposes a read-only (`mode=ro`, non-unlinking lock probe) batch inspection interface for `learningctl status`. | None *(Settled `BL-04`, `BL-08`, `ADR-0006`)* | Explicit `USER_INPUT` recording a justified disposition for `D3a`. | `PENDING_USER_REVIEW` (`UNAPPROVED_RECOMMENDATION — step 850`) | [Ledger §3 — `S1-13`](issue-4-decision-ledger.md#s1-13--d3a-read-only-active-vs-recoverable-attempt-inspection-contract) |
| **`S1-14`** | **`D3b`** | **Service-Boundary Delegation Cutoff & `schema_version` Format:** Confirming exact `"<major>.<minor>"` string format for per-command `learningctl --json` `schema_version` (flagged open at step `827`), agent-vs.-admin operation separation, and delegation of systemd/UDS/group/mode/CLI-spelling specifics. | `S1-09` (`D1a` repo boundary) | Explicit `USER_INPUT` recording a justified disposition for `D3b`. | `PENDING_USER_REVIEW` (`UNAPPROVED_RECOMMENDATION — step 850`) | [Ledger §3 — `S1-14`](issue-4-decision-ledger.md#s1-14--d3b-service-boundary-delegation-cutoff-and-schema_version-format) |
| **`S1-15`** | **`D4`** | **Out-of-Band Key Escrow, Backup Integrity Verification Gate & Operational Delegation:** Reconciling non-TPM cross-host portability with `learningctl` key exclusion via privileged admin out-of-band key escrow (separate from DB backups), enforcing independent keyed integrity verification before backup promotion (mechanism conditional on the DB/encryption implementation chosen in `DEF-05`; `SQLCipher` remains a candidate only, never pruning last verified point), and delegating driver/schedule/retention tunables. | `S1-10` (`D1b` fail-closed & pre-migration backup gate) | Explicit `USER_INPUT` recording a justified disposition for `D4`. | `PENDING_USER_REVIEW` (`UNAPPROVED_RECOMMENDATION — step 850`) | [Ledger §3 — `S1-15`](issue-4-decision-ledger.md#s1-15--d4-out-of-band-key-escrow-backup-verification-gate--operational-delegation) |
| **`S1-16`** | **`E1`** | **Per-Execution Staging Slot Allocation & `--output` Destination Discipline:** Preventing reassessment/concurrent `CONFLICT_DIFFERENT_ATTEMPT` collisions before `live-quiz` generates `attempt_id` (e.g., `learningctl`-allocated per-execution staging slot passed via standard `--output <slot>/attempt.json` vs. engine `--output-dir` mode). | None *(Settled `BL-04`, `BL-09`, `ADR-0007`)* | Explicit `USER_INPUT` recording a justified disposition for `E1`. | `PENDING_USER_REVIEW` (`UNAPPROVED_RECOMMENDATION — step 850`) | [Ledger §3 — `S1-16`](issue-4-decision-ledger.md#s1-16--e1-per-execution-staging-slot-allocation-and---output-destination-discipline) |
| **`S1-17`** | **`E2`** | **Pre-Consolidation Storage Split, Pre-Debrief Status Reconciliation & `ABANDONED` Payload Retention:** Preserving the settled `BL-09` lifecycle states (`PENDING_DEBRIEF`, `DEFERRED`, `PENDING_CONSOLIDATION`, `CONSOLIDATED`, `ABANDONED`) unchanged while deciding: (1) splitting pre-consolidation registry envelopes/append-only lifecycle events from staged payloads and structured debrief checkpoints (retained in `E1` slot across `ABANDONED`), (2) read-only `status` reconciliation surfacing un-evaluated staged `attempt.json` exports via `awaiting_evaluation` — where `awaiting_evaluation` is a derived, read-only status classification used to identify an incomplete staged interaction (it is not a persisted lifecycle state, does not modify the `BL-09` state set, and does not replace `PENDING_DEBRIEF`), and (3) `B2.5.1` transactional consolidation verification. Any modification to a settled `BL-09` state requires explicit user authorization. | `S1-06` (`B2.5.1`), `S1-16` (`E1`) *(plus settled `BL-09`; no hard prerequisite on `S1-07`/`B2.5.2`)* | Explicit `USER_INPUT` recording a justified disposition for `E2`. | `PENDING_USER_REVIEW` (`UNAPPROVED_RECOMMENDATION — step 850`) | [Ledger §3 — `S1-17`](issue-4-decision-ledger.md#s1-17--e2-pre-consolidation-storage-split-pre-debrief-status-reconciliation--abandoned-payload-retention) |
| **`S1-18`** | **Closure** | **Verified Stage 1 Decision Closure Report:** Reconciled ledger of `A`–`E2` with verified `USER_EXPLICIT` provenance, explicit dispositions, dependency map, and deferred-items boundary. | `S1-01`–`S1-17` | Every atomic decision (`S1-01`–`S1-17`) has received one explicit disposition (`ACCEPTED_AS_PROPOSED`, `ACCEPTED_WITH_MODIFICATIONS`, `REJECTED_IN_FAVOR_OF_ALTERNATIVE`, `DEFERRED_WITH_JUSTIFICATION`, or `NOT_APPLICABLE_WITH_JUSTIFICATION`) backed by explicit user approval or user-authorized deferral, with provenance verified in [issue-4-decision-ledger.md](issue-4-decision-ledger.md). | **Blocked** (on `S1-01`–`S1-17`) | [issue-4-decision-ledger.md](issue-4-decision-ledger.md) |
---
## 2. Architectural Comprehension Walkthrough (Hard Sequencing Gate Before Stage 2)
> [!WARNING]
> **Hard Gate:** `CW-01` (`CW-01a`–`CW-01e` + supporting system map) must be completed and receive explicit user approval before any Stage 2 (`S2-*`) task begins. The supporting system map is an explanatory walkthrough aid, explicitly distinct from authoritative repository documentation ([docs/architecture.md](../docs/architecture.md)).
| Task ID | Expected Deliverable | Dependencies | Relevant Decision IDs | Explicit Completion Condition | Status | Resulting Artifact |
| :--- | :--- | :--- | :--- | :--- | :--- | :--- |
| **`CW-01`** | **Complete Architectural Comprehension Walkthrough & Supporting System Map** covering five required subjects:<br>• **`CW-01a`:** System context and component responsibilities (`tutor`, `quiz-designer`, `learning-objectives`, `quiz-evaluator`, `learningctl`, `learning-registryd`, `live-quiz`).<br>• **`CW-01b`:** Data flows and integration contracts (`questionnaire.json`, `rubric.json`, `attempt.json`, `evaluation.json`, JCS hashing, approved startup acknowledgment, read-only attempt inspection, consolidation receipts).<br>• **`CW-01c`:** Persistence domains and artifact lifecycles (global encrypted Learning Registry vs. ephemeral attempt SQLite journals vs. short-lived materialized questionnaires vs. approved pre-consolidation staging/persistence topology vs. standalone exports).<br>• **`CW-01d`:** Trust boundaries and security assumptions (blind pass, runtime rubric exclusion, `learning-registry` OS service boundary, non-TPM key isolation, black-box CLI guardrail, formative host threat model).<br>• **`CW-01e`:** Failure scenarios, recovery, and consistency guarantees (crash at every registration, startup, execution, export, evaluation, debrief, migration, and backup boundary). | `S1-18` | `A`–`E2`, Issues #1–#8 | All five walkthrough subjects and the supporting non-normative system map are reviewed with the user, and the user gives **explicit approval** to proceed to Stage 2. | **Blocked** (on `S1-18`) | Pending (Walkthrough Record & Supporting System Map) |
---
## 3. Stage 2 — ADR Formalization & Architecture Documentation Reconciliation
> [!NOTE]
> **Conditionality Rule:** Stage 2 deliverables (`S2-01`–`S2-06`) must not pre-encode unapproved `step 850` recommendations. Each Stage 2 artifact must incorporate the **actual user-approved Stage 1 dispositions** (including `ACCEPTED_WITH_MODIFICATIONS` and `REJECTED_IN_FAVOR_OF_ALTERNATIVE` outcomes) from [issue-4-decision-ledger.md](issue-4-decision-ledger.md) and preserve all deferred items (`DEF-01`–`DEF-05` and any Stage 1 `DEFERRED_WITH_JUSTIFICATION` dispositions) as unresolved.
| Task ID | Expected Deliverable | Dependencies | Relevant Decision IDs | Explicit Completion Condition | Status | Resulting Artifact |
| :--- | :--- | :--- | :--- | :--- | :--- | :--- |
| **`S2-01`** | **ADR Allocation & Scope Plan:** Determine exact new ADR count, numbering (`0010`+ against [docs/decisions/README.md](../docs/decisions/README.md)), and repository placement boundary based on the user-approved Stage 1 dispositions (especially `D1a` / `S1-09` and `E2` / `S1-17`), preserving deferred matters as unresolved. | `CW-01` *(Hard Gate)*, `S1-09`, `S1-17` | `A`–`E2` | User approves the exact list of amended ADRs and new ADR titles/numbers before drafting begins. | **Blocked** (on `CW-01`) | Pending |
| **`S2-02`** | **Amend Engine & Execution ADRs (`0002`, `0004`, `0005`, `0006`, `0007`):** Reconcile engine lifecycle (`0002`), input/rubric isolation & contract evolution (`0004`, `0005`), journal snapshot & active-vs.-recoverable inspection (`0006`), and identity/hash/export contracts (`0007`) strictly with the settled baseline (`BL-01`–`BL-05`, `BL-07`–`BL-08`, `B2.1`–`B2.3`) and the **actual user-approved Stage 1 dispositions** (including approved modifications or alternatives for `B2.4.*`, `B2.5.*`, `C2`, `D2b`, `D3a`, `E1`), preserving deferred matters (`DEF-01`–`DEF-03`, `DEF-05`) as unresolved. | `S2-01` | `A`, `B1`–`B2.5.2`, `C1`–`C2`, `D2b`, `D3a`, `E1` | Amended MADRs drafted, verified against approved ledger dispositions and free of regressions against Issues #1–3 & #5–8, and approved by user. | **Blocked** (on `S2-01`) | `../docs/decisions/0002-*.md`, `0004-*.md`, `0005-*.md`, `0006-*.md`, `0007-*.md` |
| **`S2-03`** | **Amend Repository & Reference Skills ADRs (`0008`, `0009`):** Reconcile component/repository ownership (`0008`) and reference skill / Tutor-registry integration (`0009`) strictly with the settled baseline (`BL-01`–`BL-02`, `BL-06`–`BL-09`) and the **actual user-approved Stage 1 dispositions** (including approved modifications or alternatives for `D1a`, `D2a`, `D3b`, `E2`), preserving deferred matters (`DEF-03`–`DEF-05`) as unresolved. | `S2-01` | `A`, `D1a`, `D2a`, `D3b`, `E2` | Amended `ADR-0008` and `ADR-0009` drafted, verified against approved ledger dispositions, and approved by user. | **Blocked** (on `S2-01`) | `../docs/decisions/0008-*.md`, `../docs/decisions/0009-*.md` |
| **`S2-04`** | **Author New MADR(s) (`0010`+) & Update ADR Index:** Formalize the new ADR(s) allocated in `S2-01` from the actual user-approved Stage 1 dispositions (recording accepted choices, selected alternatives, rationales, and explicit boundaries leaving deferred matters unresolved) and update [docs/decisions/README.md](../docs/decisions/README.md). | `S2-01` | `A`–`E2` | New MADR file(s) and `../docs/decisions/README.md` index authored and approved. | **Blocked** (on `S2-01`) | `../docs/decisions/0010-*.md` (+ any additional allocated MADR), `../docs/decisions/README.md` |
| **`S2-05`** | **Reconcile `docs/architecture.md`:** Update system diagram, component table, contract topologies, persistence lifecycles, canonicalization/versioning rules, and interaction/debrief workflows to match the approved Stage 1 dispositions and Stage 2 ADRs; remove stale `assessment_version` and unspecified-registry text while preserving deferred matters as unresolved. | `S2-02`–`S2-04` | `A`–`E2` | [docs/architecture.md](../docs/architecture.md) updated and aligned with `ADR-0001`–`0010+`. | **Blocked** (on `S2-02`–`S2-04`) | `../docs/architecture.md` |
| **`S2-06`** | **Cross-Document Consistency Verification:** Audit [docs/architecture.md](../docs/architecture.md), `../docs/decisions/0001`–`0010+`, and [docs/decisions/README.md](../docs/decisions/README.md) for terminology, invariant, exit-code, ledger-disposition fidelity, deferred-boundary preservation, and boundary consistency across Issues #1–#8. | `S2-05` | Issues #1–#8, `A`–`E2` | Verification check passes with zero cross-document contradictions and user approves Stage 2 completion. | **Blocked** (on `S2-05`) | Pending (Stage 2 Verification Report & Git Commit) |
---
## 4. Stage 3 — Acceptance Criteria
| Task ID | Expected Deliverable | Dependencies | Relevant Decision IDs | Explicit Completion Condition | Status | Resulting Artifact |
| :--- | :--- | :--- | :--- | :--- | :--- | :--- |
| **`S3-01`** | **Derive Verifiable Acceptance Criteria:** Translate reconciled `docs/architecture.md` and `ADR-0001`–`0010+` into falsifiable acceptance criteria (preserving the boundary between architectural guarantees and deferred implementation details). | `S2-06` | Issues #1–#8, `A`–`E2` | Acceptance criteria document authored, verified traceable to ADRs, and approved by user. | **Blocked** (on `S2-06`) | `../docs/acceptance-framework.md` (planned) |
---
## 5. Deferred Implementation Responsibilities (Not Completed Architecture)
These items remain **explicitly deferred** to post-Stage-3 technical design and implementation (never counted as completed architectural work):
| Task ID | Expected Deliverable | Trigger / Prerequisite | Relevant Decision IDs | Explicit Completion Condition | Status | Resulting Artifact |
| :--- | :--- | :--- | :--- | :--- | :--- | :--- |
| **`DEF-01`** | **JSON Schemas & Strict Pydantic Models:** Exact field names and `.schema.json` specs for `questionnaire.json`, `rubric.json`, `attempt.json` (incl. contract-version provenance field spelling per resolved `B2.4.1`), and `evaluation.json`, with recursive `extra="forbid"`, `strict=True`, and negative nesting tests. | Post-`S3-01` (Implementation kickoff) | `B1`, `B2.1`, `B2.2`, `B2.4.1`–`B2.4.3`, `C2` | Schemas and models pass unit + negative validation suites. | **Deferred** | Pending |
| **`DEF-02`** | **RFC 8785 Library Selection & Shared Conformance Suite:** Choose Python JCS package (`rfc8785`/`jcs` candidates) and assemble raw-byte CI conformance test vectors (official RFC 8785 vectors + `B2.2` negative parser vectors + `attempt.json` float vectors). | Post-`S3-01` | `B2.2`, `B2.3` | CI conformance suite passes identically across `live-quiz` and registry implementations. | **Deferred** | Pending |
| **`DEF-03`** | **`live-quiz` CLI Interface & Output Schemas:** Finalize subcommand spellings, flags, and JSON/output schemas for `live-quiz validate`, startup readiness acknowledgment (`D2b`), and read-only attempt inspection (`D3a`); author `live-quiz.md`. | Post-`S3-01` (and `S1-12`, `S1-13`) | `B2.5.1`, `D2b`, `D3a` | `live-quiz.md` and `--help` contracts implemented and integration-tested. | **Deferred** | Pending (`live-quiz.md`) |
| **`DEF-04`** | **`learningctl` Domain CLI Grammar & JSON Schemas:** Finalize `.learning-workspace` optional metadata fields, command/flag spellings (`assessment`, `interaction`, `backup`, reconsideration), and CLI `schema_version` / JSON schemas (`status`, consolidation receipt, structured debrief checkpoint); author `learningctl.md`. | Post-`S3-01` (and `S1-10`–`S1-17`) | `D1b`, `D2a`, `D3b`, `E1`, `E2` | `learningctl.md` and `--help` contracts implemented and validated against `learning-registryd`. | **Deferred** | Pending (`learningctl.md`) |
| **`DEF-05`** | **Host Daemon Packaging, Security & Backup Operations:** Finalize `learning-registryd` systemd `.socket`/`.service` units, UDS path/group/modes, private IPC wire framing, temp/staging XDG paths, encrypted DB driver (`SQLCipher` candidate), concrete backup integrity-check mechanism, credential storage (`LoadCredentialEncrypted=` vs. keyfile), admin key-escrow/migrate/restore tools, backup timer schedule, retention thresholds, and external sync target. | Post-`S3-01` (and `S1-09`, `S1-14`, `S1-15`) | `D1a`, `D1b`, `D2b`, `D3b`, `D4`, `E1` | Host installer, systemd units, and backup/restore drills verified in target Linux/NixOS environment. | **Deferred** | Pending |
---
## 6. Issue #9 — Companion Skill Portability & Integration Contracts (Separate Milestone)
| Task ID | Expected Deliverable | Dependencies | Relevant Decision IDs | Explicit Completion Condition | Status | Resulting Artifact |
| :--- | :--- | :--- | :--- | :--- | :--- | :--- |
| **`I9-01`** | **Original Issue #9 Discovery, ADR Reconciliation & Acceptance Criteria:** Resolve companion skill portability, single-agent vs. subagent execution fallbacks, `learningctl.md` / `live-quiz.md` black-box operating contracts, host-path neutrality, and optional Tutor facilitation UX guidance. | `S2-06` (or explicit user schedule directive) | Issue #9, `D1a`, `D3b`, `E2`, [ADR-0008](../docs/decisions/0008-two-product-repository-architecture.md), [ADR-0009](../docs/decisions/0009-modular-portable-reference-skills.md) | Issue #9 Stage 1 $\to$ Stage 2 $\to$ Stage 3 completed and explicitly approved by user. | **Open (Separate Milestone)** | Pending |