Skip to content

Extract two-track personalization engine for survey evals#102

Draft
sw1029 wants to merge 2 commits into
mainfrom
codex/two-track-personalization-engine
Draft

Extract two-track personalization engine for survey evals#102
sw1029 wants to merge 2 commits into
mainfrom
codex/two-track-personalization-engine

Conversation

@sw1029
Copy link
Copy Markdown
Owner

@sw1029 sw1029 commented May 31, 2026

Summary

  • .5 bridge PR: move the final two-track personalization policy into src/recognizer/two-track-personalization-engine.ts while keeping survey and magic-circle surfaces as callers or preserved references.
  • Add tinyml-noisy-eval and tutorial-threshold-eval survey routes, Vite entries, API validation, and focused tests.
  • Add the shape-composition analysis track, datacard lab support, and archived survey/magic-circle preservation marker.

Related Issues

  • Closes:
  • Related:
  • Follow-up: Unity Input capture / Stroke recognition / Personalization layer port should consume the engine behavior without reintroducing survey-only policy formulas.

Why Needed

  • The tutorial capture personalization logic was embedded in the survey prototype. This PR makes the final two-track policy reusable as one recognizer-side engine before Unity-specific integration.
  • Survey and magic-circle prototype paths remain available for reference, but new personalization formulas now have a single owner.

Changed Boundaries

  • Policy engine: src/recognizer/two-track-personalization-engine.ts
  • Survey callers: survey/tutorial-threshold-eval/, survey/tinyml-noisy-eval/
  • API persistence and validation: scripts/survey-api-server.mjs, scripts/survey-api-server.d.mts
  • Analysis/support track: src/recognizer/datacard-shape-lab.ts, scripts/*shape*analysis.py, survey/shape-composition-tracing/
  • Out of this PR by request: Unity project code and Unity-generated screenshot/capture artifacts.

Handoff

  • Unity migration should port from the engine-level decisions and state summaries, not from survey DOM/control code.
  • If the Unity PR needs the prior prototype context, use archive/legacy-survey-magic-circle/README.md as the path map for retained survey and magic-circle references.

Verification

  • npm run validate:docs
  • npm test
  • Focused test: npm test -- survey-api-server.test.ts datacard-shape-lab.test.ts two-track-personalization-engine.test.ts (33 passed)
  • npm run build
  • Unity EditMode tests:
  • Unity PlayMode tests:
  • GitHub checks observed: CI [Child #73] 핵심 사운드 1차 셋업 #74 passed; CodeQL [Child #73] 층별 결정적 모먼트 9개 구현 #77 is still in progress.
  • Not run; reason: full npm test, docs validation, and Unity tests were left for follow-up because this PR intentionally excludes Unity changes and the focused affected tests plus build passed locally.

Notes

  • Scope: recognizer/survey two-track personalization, survey API persistence, datacard analysis support, and legacy prototype preservation notes.
  • Out of scope / follow-up: Unity code currently dirty in the local workspace remains excluded from this PR.
  • Risk notes: survey/a50c3bd7cd0f45359c_shape-composition-survey.json is a large analysis input artifact, so reviewers should expect the diff to be data-heavy.

Review Checklist

  • This PR changes user-facing UI or behavior.
  • This PR changes recognizer behavior.
  • This PR changes docs, task state, or project process.
  • This PR changes ML artifacts, datasets, generated outputs, or capture/export behavior.
  • This PR changes logging, survey fields, privacy, or research data handling.
  • This PR needs screenshots or a short playtest note.

Screenshots / Playtest Notes

No screenshot attached for this PR. Local verification covered compile/build and focused recognizer/API tests; Unity and browser playtest artifacts are intentionally outside this split.

}

function createInitialState() {
const sessionId = compactId();
function buildPayload() {
return {
schemaVersion: SCHEMA_VERSION,
sessionId: state.sessionId,
return {
schemaVersion: SCHEMA_VERSION,
submissionId: `tinyml_${compactId()}`,
sessionId: state.apiSession?.sessionId ?? localSessionId(),
return {
schemaVersion: SCHEMA_VERSION,
submissionId: `tutorial_threshold_${compactId()}`,
sessionId: state.apiSession?.sessionId ?? localSessionId(),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants