Repository navigation
FlashDay evidence kernel bootstrap — vendor + bridge seam (no merge) - #1
Merged
Merged
Conversation
…ynthesis Fork-of-record: Thunderkill016/flashday-next ← Talljack/echo-type @ deccdf5 (MIT). Baseline green: typecheck, biome, 1081 vitest, build. Architecture: EchoType stays the product shell; the FlashDay vNext kernel owns capability/evidence/planner semantics via a narrow bindAttempt bridge. FSRS remains memory-only; assessment demoted to placement estimate. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…@85ce4101) The evidence kernel — capabilities, contracts, evidence, bind, evaluators, projection, learner-model, planner, next-for-you, correction-episodes, curriculum-checks, persist, store-memory, risk-priors, mission-runner, pilot-harness, fixtures + the one external dep core/mission-checks.js — vendored unchanged so the tested engine is the shipped engine. ui-session.js + ui/ excluded (FlashDay-UI coupled). Excluded from biome lint/format: vendored upstream code must stay byte-identical to FlashDay src for future sync diffs. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
EchoType submits a registered taskId + what the learner did; the contract derives everything semantic (capability, purpose, context, freshness, transfer, authority). Deterministic contracts re-score the response — a UI 'correct=true' can never mint evidence. - createRegistry runs the kernel authoring gate (checkCurriculum); fixtureRegistry wires the vendored curriculum byte-for-byte - submitAttempt/submitObservation → bindAttempt/bindObservation → append-only Dexie event store (new table evidenceEvents, schema v21, fingerprint-deduped, conflict-throwing) - projectState replays events → capability milestones - nextAction → selectNextTask in shipped reference mode (B0/B1 stay experiment surfaces) - 27 contract pins: forgery rejection, correct=true≠capability, completion≠mastery, supported≠independent, STT≠pronunciation (asr authority caps at SUPPORTED), practiced≠transfer, assessment needs stable attemptId, FSRS fields inert, learner isolation, dedupe/conflict, persist→replay determinism, retention lag, auditable Next-For-You reason Tests: 27/27 bridge pins; suite 1108 passed / 3 skipped; typecheck + biome clean. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Vendor landed at src/vnext/ (mission-runner included — reference selector path needs it), persistence is Dexie v21 evidenceEvents, bridge API documented as shipped. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The §11 slice: one registered mission driven end-to-end by the vendored
kernel — the reference planner selects each step (reason surfaced in
UI), the session driver mirrors ui-session evidence semantics
(deterministic attemptIds from the committed log, support_use events +
stamped snapshots before commit, feedback only after evidence lands,
live-task lock, exposure never minting attempts), and Dexie
evidenceEvents is the durable replay source — refresh resumes mid-
trajectory.
- bridge: emittedEventType picks purpose×response event types;
evaluator missingFunctions propagate for demand routing;
submitAttempt returns {event, evalResult}; evaluationCtx carries
learnerName for state_own_name matching
- session.ts: createMissionSession over the bridge (init/screen/start/
view/support/play/commit/next/projection/decision)
- /mission page: intro → input → task (text/choice, support controls,
TTS play) → feedback → summary with replay-derived capability states
- dashboard: 'Next For You' entry card under the Today surface
- mission-copy.ts: Vietnamese-first frames/hints/models ported from
FlashDay's shipped vnext copy
- e2e/mission-meet-person.spec.ts: real-browser drive of the canonical
learner — baseline fail on ask_name → hinted supported → clean retry
→ INDEPENDENT → +25h delayed → RETAINED → changed-context
TRANSFERRED → fresh checkpoints — asserted against IndexedDB
evidenceEvents, incl. refresh persistence
Tests: 1114 passed / 3 skipped (bridge 27 + session 6 new).
Browser: playwright spec green; artifacts in test-results/.
Demo seam: fdn:timeOffsetMs localStorage / __FDN_TIME_OFFSET__ shifts
the session clock so delayed_retrieval is reachable in verification —
the 24h lag remains kernel policy, only time moves.
Adversarial review of the vertical slice surfaced three evidence-integrity
defects, each pinned by a failing reproduction before the fix:
- Cross-learner leak: syncEvents mirrored the whole table, so a second
learner saw intro.resumed=true and foreign rows fed the selector.
Now only the session's learnerId is mirrored.
- Post-reload support stamp: support_use landed durably but the commit
after a reload stamped support:{} — the union the projection computes
was never written into the attempt itself. The stamp now unions logged
support_use for the attemptId via the kernel's own unionSupport.
- Append race: get→add was not atomic, so concurrent identical commits
crashed with ConstraintError instead of deduping. append now re-reads
on add failure: identical dedupes, different refuses, none rethrows.
Also: the demo clock seam (fdn:timeOffsetMs) is dev-only so production
builds cannot fast-forward retention; sync() catches store rejections so
an integrity refusal can't wedge the UI busy; markPromptShown is wired so
latencyMs evidence is real.
New pins: 9 falsification unit tests + a browser spec attacking refresh
at prompt/feedback/summary, back/forward nav, double-submit, and forged
IndexedDB rows.
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Thunderkill016
marked this pull request as ready for review
October 1, 2026 11:48
This was referenced Oct 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
FlashDay evidence kernel bootstrap on EchoType
Vendored FlashDay vNext kernel + a forge-proof evidence bridge + the first real vertical slice (
mission.meet_new_person) through the actual UI, verified end-to-end in Chromium with durable IndexedDB evidence.Baseline (upstream
deccdf5e)pnpm installclean · typecheck PASS · biome PASS (647 files) · vitest 1081 pass / 3 skip · build PASS (69 pages). Full audit indocs/flashday/BASELINE_AUDIT.md.What shipped
src/vnext/(27 files,cmp-verified;ui/excluded as FlashDay-shell code).src/lib/evidence-bridge/): caller supplies observed reality + registeredtaskId; semantics are re-derived from the contract —capabilityId,purpose,context,freshness,transfer,bindingcannot be authored by the caller.bindAttempt/bindObservationmint kernel-valid evidence;projectStatereplays;nextActionruns the shipped reference selector with an exposedreason.evidenceEventstable (schema v21), append-only with fingerprint dedupe: identical re-delivery dedupes, same-id-different-content refuses (no last-write-wins), add-race re-checked atomically.session.ts): deterministic attempt ids recomputed from the committed log,support_use+ stamped snapshot before commit, feedback only after evidence lands, live-task selection lock, learner-scoped mirroring./missionpage (intro → diagnostic → input → retrieval/interaction with real support controls → feedback → summary) + "Next For You" card on/dashboard. Every served step renders the planner'sreason.Verification on
8b540e8pnpm typecheck— PASSpnpm lint(biome, 656 files) — PASSpnpm test— 1124 pass / 3 skip (187 files; +43 vs baseline: bridge contract pins + session/falsification pins)mission-meet-person— full slice: Today → intro → diagnostic pass/fail → hinted retrieval → guided (modelAnswer) partial → clean retry → refresh → +25h → delayed → transfer → fresh assessment → summary. 31 evidence events asserted in Dexie.mission-falsification— refresh at prompt/feedback/summary, back/forward nav, double-submit idempotency, forged+garbage row injection → recovery, no credit.test-results/mission-*.png,mission-events.json,mission-served.txt.Falsification findings (all fixed in
8b540e8)resumedstate + foreign rows in selectionsyncEventsmirrors only the session'slearnerIdsupport:{}despite landedsupport_usesupport_usevia kernelunionSupportConstraintError) instead of dedupingappendre-reads on add failure: identical → dedupe, different → refuseKnown limitations
asr/ai_llmauthorities are correctly excluded).fdn:timeOffsetMsexists dev-only — production builds cannot fast-forward the kernel-owned retention lag.missionRunIdnot stamped (kernelbinddoesn't carry it).mission.meet_new_personis wired (fixture registry).executablePath) because CDN downloads are slow here.Draft — pending external review. Do not merge.