Project: Covert Cubicles Build Phase 6 / 7 · 2 of 6 modules complete

MODULE 21 / 31 · LAYER 6 · DATA_RECORDER · EXPORT Per-Session Record Builder

Bundles M20 telemetry plus the seven SM_Game logs and the audit trail into a canonical session record. Provides JSON serialisation and three opinionated CSV views for the most-needed analytical use cases. Standardised filename schema for save-to-disk workflows.

DEPENDENCIES: SM_Game, DATA_Telemetry
Pending
DRAFT EXPORT POSTURE \u00B7 ANONYMISATION PENDING REVIEW
Default export is "as-is" — sessionId is already a UUID per SM_Game's de-identification commitment.
Per ADR-059, the current export anonymisation is "as_is" — sessionId is the SM_Game UUID and no PII is captured anywhere in the session record. This is a reasonable default for a pre-pilot build but warrants explicit supervisor and ethics-committee review before participant data collection. Stricter postures (strip-and-link-table, configurable per-export) are not yet implemented; the module exposes a stub setter for future expansion.
Latent integration risk \u2014 dual baseline-values store (ADR-061)
Two separate baseline-values stores exist: SM_Game.playerState.ethicalValues (canonical, what M21 reads) and ALMAA_Morality's internal preGameValues (computing copy). Field-name conventions differ (pa vs pa_score). Not synchronised. M31 GM_Game integration must call both setters consistently — preferably by having M17 read from SM_Game's canonical store. Recorded as defect for resolution at integration time, not patched now.

Automated Assertions

#AssertionResultDetail

Interactive Workbench — Live Session Record

Drive the session lifecycle on the left; the canonical session record updates after each action. Log cards in the viewer flash amber when their counts change. The export tabs below show JSON and CSV views generated on demand.

Session lifecycle harness
Session creation + baseline
Phase 1 decisions (build pipeline activity)
Scrutiny escalation
Final morality record (RQ1 PRIMARY DV)
End session
Reset
Live session record \u2014 buildSessionRecord()
recordVersion
sessionIdnull
conditionVariantnull
terminationReasonno_session
decisions0 / 16
filename
baselineValuesnull
LOGS \u2014 8 ARRAYS, COUNTS + LATEST ENTRY PREVIEW
Export views \u2014 JSON + 3 CSV views
{}
{}
size — bytes
Record schema v1.0 \u2014 ADR-057
FieldTypeDescription
Provenance
recordVersionstringSchema version of THIS record (e.g. '1.0')
recordedAtISO 8601 UTCWhen the record was built
telemetryVersionstringSchema version of nested telemetry blob
Nested telemetry (M20 schema)
telemetryobjectFull M20 telemetry blob — see DATA_Telemetry schema
Logs (verbatim from SM_Game)
logs.decisionHistoryarrayDecisions submitted
logs.consequenceTagsarrayStory-flag effects from M11
logs.eventsarrayNarrative events fired by M14
logs.confusionarrayM15 confusion classifications
logs.reasoningarrayM16 reasoning classifications
logs.moralityarrayM17 morality records (PRIMARY DV)
logs.triggerarrayM18 trigger decisions
logs.conditionarrayM19 condition gating decisions (RQ1b)
Audit + baseline
auditTrailarraySM_Game lifecycle events in chronological order
baselineValuesobject | nullPre-game survey values { pa, os, ei } if set
CSV views (separate methods, not in record)
toDecisionsCsv()stringFlat tabular: decisionId, choiceId, phase, timestamp, scrutinyLevel
toTriggerLogCsv()stringFlat tabular: trigger records with intended/blocked/precedence
toMoralityRecordsCsv()stringFlat tabular: morality records (RQ1 substrate)

API Surface — Manual Verification

M21 has a more substantial API than M20 — JSON, CSV, filename, and export options.