feat(questionnaires): F9.1 production hardening — concurrency smoke + flag matrix#56
Merged
Merged
Conversation
… flag matrix Pre-ship verification pass over P0–P8. Adds no runtime capability; proves what already shipped holds under concurrency and that every flag gates its own surface. - Concurrency + happy-path smoke (scripts/smoke/concurrent-sessions.ts, npm run smoke:concurrent-sessions): 24 sessions × 4 turns through the live persistence seams (createAnonymousSession → persistTurn → markSessionCompleted) against the real DB; asserts no deadlocks / orphan turns / missed audit writes. --single runs the verbose happy path + an F8.2 results-export read. LLM stubbed by construction (feeds persistTurn the extraction intents directly). - Feature-flag inventory doc (.context/app/questionnaire/feature-flags.md): the master + 10 sub-flag matrix — dependency chains, gated surfaces, the three off-behaviour shapes (route-404 / degrade / behaviour-inside-route), and the DB-rows-not-env-vars rule. - Per-sub-flag verification suite: extends feature-flag.test.ts from master-only to all eleven resolvers — truth tables, independence, the live-sessions cascade, master transitive close, and the ensure*/with* gate contracts. - F9.1 tracker + plan/README wiring. No CHANGELOG entry: app-owned smoke/test/docs only, no Sunrise platform surface. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Summary
F9.1 is the final hardening pass of P9 — the pre-ship verification gate before ConQuest is demo-grade and fork-ready. It adds no new runtime capability. Its job is to prove what P0–P8 built:
Scope is held strictly to the plan's four indicative tasks (concurrency smoke, flag inventory, per-flag verification, happy-path pass). Gaps surfaced during exploration are documented as follow-ups, not built.
What's in here
Concurrency + happy-path smoke —
scripts/smoke/concurrent-sessions.ts(npm run smoke:concurrent-sessions). Seeds one launched anonymous-mode version, creates 24 sessions concurrently, runs 4 turns each through the live persistence seams (createAnonymousSession→persistTurn→markSessionCompleted) against the real DB, and asserts: no rejected promise / deadlock (40P01); contiguous per-session ordinals (no orphan/dropped turns); every answered slot back-stamped with a real turn id; exactly onecreated+ onecompletedaudit event per session.--singleruns the verbose happy path plus an F8.2 results-export read. Idempotent; cleanup cascades the whole graph. LLM is stubbed by construction — the smoke feedspersistTurnthe extraction intents the orchestrator would emit, so there's no provider to mock.Feature-flag inventory doc —
.context/app/questionnaire/feature-flags.md. The authoritative master + 10 sub-flag matrix: each flag'sfeature_flagname, resolver, required parents, gated surface, and off-behaviour. Names the two design rules (disabled surface 404s not 401s; a sub-flag requires its parents) and the three off-behaviour shapes (route-404 / degrade / behaviour-inside-route). Flags are DB rows, not env vars.Per-sub-flag verification suite —
tests/unit/lib/app/questionnaire/feature-flag.test.ts, extended from master-only to all eleven resolvers. Data-driven truth tables, sub-flag independence (one off suppresses only its own surface), the live-sessions cascade (parent off closes the voice/attachment/cost-cap trio), the master transitive close, and theensure*/with*gate contracts. 61 tests, green.Tracker + wiring —
.context/app/planning/features/f9.1.md, plan + namespace README updates.Out of scope (documented follow-ups)
Deliberately deferred to keep F9.1 a clean verification gate:
costBudgetUsdexists today)Verification
npm run smoke:concurrent-sessions— 24 sessions · 96 turns · invariants reconciled; idempotentnpm run smoke:concurrent-sessions -- --single— completed session + non-empty results exportnpx vitest run tests/unit/lib/app/questionnaire/feature-flag.test.ts— 61 passnpm run validateclean; type-check passed in pre-pushCHANGELOG
No entry — app-owned smoke/test/docs only, no Sunrise platform surface (platform-scoped CHANGELOG policy).
🤖 Generated with Claude Code