Files
live-quiz/docs/decisions/0004-questionnaire-rubric-separation.md
kiskaadee a4eeccf304 docs(architecture): reconcile physical and structural answer-leakage boundaries in Issue 7
- Narrow runtime guarantee to physical exclusion of private evaluation data from live-quiz.
- Mandate recursive Pydantic extra='forbid' across all nested public-contract models.
- Specify context-isolated post-hoc evaluation boundary following successful terminal publication.
- Clarify that prompt semantic quality and cross-question clues are authoring QA concerns.
- Explicitly reject automated semantic leakage pipelines and artificial navigation restrictions.
- Reconcile ADR-0004 problem statement, consequences, and threat model.
2026-11-11 23:31:15 -05:00

5.0 KiB

ADR-0004: Physical Separation of Questionnaire and Rubric

  • Status: Accepted
  • Date: 2026-11-10

Context

A core pedagogical invariant of the assessment model is the blind pass: the learner must demonstrate unassisted performance against an invariant standard without receiving private evaluation criteria while completing the assessment. We needed an architectural mechanism to prevent private evaluation data from entering the learner-facing runtime.

Decision

Enforce complete physical and structural decoupling of the assessment specification at the filesystem and contract levels into two distinct artifacts:

  1. questionnaire.json: The public presentation contract containing question IDs, markdown prompts, diagrams, options, and code stubs. Passed directly to live-quiz.
  2. rubric.json: The private evaluation contract containing expected answers, observable criteria (Complete/Partial/Insufficient), failure mode diagnoses, and misconception signatures. Retained outside live-quiz and supplied exclusively to the post-hoc evaluator after terminal publication.
flowchart TD
    QD["Quiz Designer"]

    QD --> Q["questionnaire.json"]
    QD --> R["rubric.json"]

    Q --> LQ["live-quiz"]
    LQ --> A["attempt.json"]

    R --> E["Evaluator"]
    A --> E

    E --> EV["evaluation.json"]

    style R stroke:#d97706

Architectural Safeguards & Boundaries

  1. Physical Runtime Separation: questionnaire.json is the only assessment-definition artifact accepted by live-quiz. No supported CLI option, configuration parameter, API, or runtime code path allows rubric.json or its contents to enter the engine. Private evaluation data is never transmitted to the browser or exposed in the learner-facing tutoring context before assessment conclusion.
  2. Recursive Structural Contract Separation & Pydantic Inheritance: The public and private specifications are maintained as separate Pydantic models. Because Pydantic v2 does not automatically propagate model_config = ConfigDict(extra="forbid") across nested BaseModel boundaries, root-level configuration alone is insufficient. Every public-contract model at every nesting depth (including root questionnaire, question models, option objects, and input blocks) must explicitly inherit from a shared strict base model (e.g. StrictBaseModel) configured with extra="forbid" or declare extra="forbid" directly. Contract test suites must enforce negative validation tests asserting that unexpected evaluation properties are rejected at multiple nesting levels.
  3. Context-Isolated Post-Hoc Evaluation: quiz-evaluator operates purely as f(\text{rubric.json}, \text{attempt.json}) \to \text{evaluation.json} and receives rubric.json and attempt.json only after successful terminal publication. The evaluator receives zero conversational history, tutor notes, or learner-profile context. The Tutor subsequently uses evaluation.json during the debrief.
  4. Ergonomic Presentation & Explicit Non-Goals: live-quiz retains its standard one-question-at-a-time presentation for cognitive ergonomics, but does not impose navigation locking or anti-backtracking mechanisms solely for security. Furthermore, the system explicitly rejects automated LLM-based semantic leakage detection or cross-question answer-leakage graph analysis; semantic prompt quality remains an authoring responsibility.

Alternatives Considered

  • Single Unified Assessment JSON with Runtime Filtering: Rejected. Passing a single file containing both questions and answer keys creates a severe risk of accidental solution leakage through permissive API routes, serialization bugs, or client-side inspection.
  • Automated Semantic Leakage Detection Pipelines: Rejected. Introduces substantial LLM latency and coordination overhead for a personal formative assessment tool where prompt clarity is an authoring design concern.

Consequences

  • Positive: Physical exclusion of the private rubric artifact from the engine and structural rejection of undeclared evaluation properties in the public questionnaire; the runtime cannot expose private rubric data it never receives through browser DevTools, API inspection, or network monitoring (though this does not prevent semantically equivalent information from appearing in public questionnaire content); clean, testable separation between assessment execution and post-hoc grading.
  • Engineering Guarantee & Scope Boundary: Physical separation guarantees that the live-quiz runtime does not receive or expose private evaluation data. It does not guarantee that public questionnaire content authored by an LLM or human is semantically free of answers, clues, or cross-question leakage. Host-level inspection of local files or process memory remains outside the formative assessment threat model.