Skip to content

fix(demo): share seed storage key between PlayView and useAgentSession#159

Merged
Luis85 merged 1 commit into
developfrom
fix/review-bot-minor-hardcoded-seed-storage-key-d9b4b85-1
Apr 27, 2026
Merged

fix(demo): share seed storage key between PlayView and useAgentSession#159
Luis85 merged 1 commit into
developfrom
fix/review-bot-minor-hardcoded-seed-storage-key-d9b4b85-1

Conversation

@Luis85
Copy link
Copy Markdown
Owner

@Luis85 Luis85 commented Apr 27, 2026

Summary

  • Export readPersistedSeed(scenarioId) + DEFAULT_SCENARIO_ID from useAgentSession.ts and drop PlayView's hardcoded 'demo.v2.session.lastSeed.petCare' duplicate.
  • Add a regression test in PlayView.test.ts that pre-persists a seed under the store-owned key and asserts the mounted session adopts it.

Why

PlayView.vue carried its own SEED_PERSIST_KEY literal that mirrored ${SEED_STORAGE_KEY_PREFIX}${scenarioId} inside the store. If either side drifted, the read silently missed the persisted seed and a fresh seed was generated on every mount — review-bot finding d9b4b85.1 from #155.

Test plan

  • npm run verify (format:check + lint + lint:demo + typecheck + test + build) — all green, 674 tests pass
  • New PlayView.test.ts case asserts persisted seed is honoured
  • No library-behavior change — no changeset

Refs #155 finding:d9b4b85.1

@codex review

#155 d9b4b85.1)

PlayView used a hardcoded `'demo.v2.session.lastSeed.petCare'` literal
that duplicated `${SEED_STORAGE_KEY_PREFIX}${scenarioId}` in the store.
If either constant drifted, the read silently missed the persisted
seed and a fresh seed was generated on every load.

Export `readPersistedSeed(scenarioId)` and `DEFAULT_SCENARIO_ID` from
`useAgentSession.ts`; PlayView calls them instead of carrying its own
copy. Adds a regression test that mounts PlayView with a seed
pre-persisted under the store-owned key and asserts the session
adopts it.

Refs #155 finding:d9b4b85.1

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@github-actions
Copy link
Copy Markdown

Coverage report

Metric This PR vs base Floor Status
statements 87.12% ➖ 0.00pp 74% ⚠️ 13.1pp above floor — consider re-baselining
branches 77.25% ➖ 0.00pp 64% ⚠️ 13.3pp above floor — consider re-baselining
functions 91.05% ➖ 0.00pp 83% ⚠️ 8.0pp above floor — consider re-baselining
lines 89.53% ➖ 0.00pp 75% ⚠️ 14.5pp above floor — consider re-baselining

Floors live in scripts/coverageThresholds.mjs (drift envelope 5pp). Re-baseline by editing that file when ⚠️ appears above; cite the new measured value + commit SHA.

@github-actions
Copy link
Copy Markdown

size-limit report 📦

Path Size
dist/index.js (gzip) 37.86 KB (0%)
dist/integrations/excalibur/index.js (gzip) 1.4 KB (0%)
dist/cognition/adapters/mistreevous/index.js (gzip) 1.14 KB (0%)
dist/cognition/adapters/js-son/index.js (gzip) 1.36 KB (0%)
dist/cognition/adapters/tfjs/index.js (gzip) 8.74 KB (0%)

@Luis85 Luis85 merged commit f9eb889 into develop Apr 27, 2026
26 checks passed
@Luis85 Luis85 deleted the fix/review-bot-minor-hardcoded-seed-storage-key-d9b4b85-1 branch April 27, 2026 19:13
@Luis85 Luis85 mentioned this pull request Apr 27, 2026
4 tasks
@Luis85 Luis85 added the roadmap:v1-demo Pre-v1 product-demo evolution: walkthrough, cognition diff, fingerprint, editor, second scenario label May 5, 2026
@Luis85 Luis85 mentioned this pull request May 11, 2026
15 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

roadmap:v1-demo Pre-v1 product-demo evolution: walkthrough, cognition diff, fingerprint, editor, second scenario

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants