feat(demo): wave-0 rename preflight — examples/nurture-pet → examples/product-demo#134
Conversation
…/product-demo Atomic delivery slice for the pre-v1 demo evolution increment (Tracks: #132). Renames the demo workspace, wires the new e2e entry point, encodes the design's DDD forbidden-import + determinism rules in a demo-scoped ESLint config, sweeps every doc reference, fixes the tracker references in the plan/spec/design (issue #132 supersedes the originating PR #129), archives the now-shipped rename plan, and runs the legacy localStorage purge from a new src/app/main.ts entry per spec STO-3. Highlights: - git mv examples/nurture-pet → examples/product-demo (history preserved). - Root npm scripts: demo:install / demo:dev / demo:build now shell into the new path; new top-level `e2e` proxies into the demo's Playwright entry. - New verify gate `lint:demo` enforces the design's forbidden-import + no-raw-time rules on the layered subpaths (components/, views/, demo-domain/, stores/) so downstream pillar PRs fail CI on a violation. Existing nurture-pet baseline stays exempt until pillar 5.2 refactors it. - examples/product-demo/playwright.config.ts + tests/e2e/ skeleton land here so all later pillar PRs can rely on `npm run e2e` from day 1; a trivial passing placeholder spec keeps the command exit 0 until the named pillar specs (tour-happy-path, replay-determinism, scenario-swap) ship. - examples/product-demo/src/app/main.ts purges legacy `nurture-pet.*` and un-prefixed `demo.*` localStorage keys on first load (spec STO-3); dev mode emits a one-line console notice. index.html now points at the new entry; the existing `src/main.ts` continues to drive the baseline boot via dynamic import. - GitHub Pages workflow + CI demo-build job + dependabot config all resolve `examples/product-demo/dist`. - Doc sweep across README / CLAUDE / PUBLISHING / planning / spec / design / six pillar plans / daily-reviews / branding / changeset; the shipped rename plan is moved under docs/archive/plans/ with the standard archived banner. - Tracker-table row for "Demo rename preflight" flipped to "in review" in the planning doc (will go ✅ once this PR merges). Verification: - `npm run verify` — green (format / lint / lint:demo / typecheck / test (523/523) / build / docs). - `npm run e2e` — exits 0 against the placeholder spec. - `npm run demo:build` — succeeds; artefacts at examples/product-demo/dist. - `git grep "examples/nurture-pet" -- ':(exclude).worktrees/**' ':(exclude)docs/archive/**'` — zero matches. Tracks: #132 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1e70dbbe07
ℹ️ 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".
|
|
||
| function purgeLegacyDemoKeys(): readonly string[] { | ||
| const purged: string[] = []; | ||
| const storage = globalThis.localStorage; |
There was a problem hiding this comment.
Guard localStorage access inside try/catch
Accessing globalThis.localStorage can itself throw a SecurityError in environments where storage is blocked (for example privacy-restricted browsers or sandboxed iframes). Here that access happens before the try block, so the intended fallback path is bypassed and the bootstrap can crash before src/main.ts is imported, preventing the demo from loading at all in those contexts.
Useful? React with 👍 / 👎.
Coverage report
Floors live in |
size-limit report 📦
|
Reading `globalThis.localStorage` itself can throw `SecurityError` in privacy-restricted browsers and sandboxed iframes. Move the access inside the existing try block so the bootstrap never crashes before `src/main.ts` loads in those contexts. Addresses Codex line-level P1 finding on examples/product-demo/src/app/main.ts:28. Tracks: #132 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 87fd27adca
ℹ️ 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".
| "demo:install": "npm install && npm run build && cd examples/product-demo && npm install", | ||
| "demo:dev": "cd examples/product-demo && npm run dev", | ||
| "demo:build": "npm run build && cd examples/product-demo && npm run build", | ||
| "e2e": "npm --prefix examples/product-demo run e2e", |
There was a problem hiding this comment.
Make root e2e command self-contained
The new root e2e script delegates to examples/product-demo, but it assumes that workspace’s dependencies are already installed; after a normal root install (npm ci at repo root, as used in CI jobs), npm run e2e fails with playwright: not found because examples/product-demo/node_modules is missing. That breaks the newly introduced top-level e2e entry point for anyone running it directly and will block future CI adoption unless the script (or its workflow) installs demo dependencies first.
Useful? React with 👍 / 👎.
After a fresh root `npm ci`, `examples/product-demo/node_modules` does not exist, so the previous root `e2e` script failed with `playwright: not found`. Chain a `--no-audit --no-fund` install of the demo workspace's deps before invoking Playwright so the entry point works after a clean root install (matches how CI jobs call it). Addresses Codex line-level P1 finding on package.json:76. Tracks: #132 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 41d82165d7
ℹ️ 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".
| @@ -57,7 +57,7 @@ const NEED_TO_SKILL_INDEX: ReadonlyArray<number> = [ | |||
|
|
|||
There was a problem hiding this comment.
Point seed script output to renamed demo path
This rename updates the script comments to examples/product-demo, but the write target is still hard-coded as resolve(..., 'examples', 'nurture-pet', 'src', 'cognition', 'learning.network.json'). Because this commit removes examples/nurture-pet/, running npm run seed:learning-network now fails with a missing-directory error instead of regenerating the baseline network.
Useful? React with 👍 / 👎.
…mo (Codex P1) The Wave-0 sweep updated the JSDoc comments at the top of `scripts/seed-learning-network.ts` but missed the hard-coded `resolve(...)` write target deeper in the file. Run-time effect: `npm run seed:learning-network` fails with `ENOENT` because `examples/nurture-pet/` no longer exists. Verified by re-running the script — it now writes to `examples/product-demo/src/cognition/learning.network.json` (regenerated weights reverted; the committed snapshot is the bundled baseline and is not regenerated as part of this fix). Addresses Codex line-level P1 finding on scripts/seed-learning-network.ts:57. Tracks: #132 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8744a40f88
ℹ️ 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".
| "release": "changeset publish", | ||
| "prepare": "husky", | ||
| "verify": "npm run format:check && npm run lint && npm run typecheck && npm run test && npm run build && npm run docs", | ||
| "verify": "npm run format:check && npm run lint && npm run lint:demo && npm run typecheck && npm run test && npm run build && npm run docs", |
There was a problem hiding this comment.
Align CI lint gate with new demo lint step
Adding npm run lint:demo to verify here does not enforce the new demo ESLint rules in pull requests, because CI does not run verify and the lint job in .github/workflows/ci.yml still executes only npm run lint. Since the root ESLint config ignores examples/, a PR can violate examples/product-demo/eslint.config.js (forbidden imports/determinism rules) and still pass CI, which undermines the main safety net this commit introduces.
Useful? React with 👍 / 👎.
The previous diff added `npm run lint:demo` to the local `verify` chain but CI calls `npm run lint` directly, so the demo workspace's forbidden-import + determinism rules were not enforced on PRs. Install the demo workspace's dev deps and run its ESLint config in the same `Lint (ESLint)` job so a violation now fails CI exactly like a violation in the root config. Addresses Codex line-level P2 finding on package.json:68 (about the verify-vs-CI gate misalignment introduced in the rename PR). Tracks: #132 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The Wave-0 PR (#134) shipped with the planning-doc tracker row at "in review" and the ✅ flip queued for a follow-up doc PR. That pattern pollutes git history with one-line `docs: flip row` commits. Adjustments in this PR (which now also serves as the demonstration of the corrected pattern — the row flip + the convention hardening + the issue-body wording all ride together): - `CLAUDE.md` — "Plan + doc updates ride with the PR that lands the work" tightened: tracker-row flip happens IN the merging PR, using the GH-assigned PR number (known the moment the PR is opened); no follow-up `docs: flip row` PR. - `.claude/memory/feedback_docs_alongside_pr.md` — added a dedicated bullet for tracker-table flips so a future agent can't talk themselves into a follow-up. - `docs/product/2026-04-26-pre-v1-demo-evolution-plan.md` — the downstream-PR contract now spells out the flip-in-same-PR technique. The "in review" intermediate state is no longer endorsed. - Each pillar plan's Definition of Done references the same rule so future Wave-A/B/C PRs can't replay the Wave-0 split. - Issue #132's "Downstream PR contract" body updated to mirror. Plus the actual tracker flip the original PR #137 was opened for: Wave-0 row → `✅ shipped` linking PR #134. Tracks: #132 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…llow-ups) (#137) ## Summary Two things, deliberately bundled in the same PR to demonstrate the corrected pattern: 1. **Wave-0 tracker-row flip** — `docs/product/2026-04-26-pre-v1-demo-evolution-plan.md` row 0 set to `✅ shipped` linking [PR #134](#134) (squashed as `c734d6a`). 2. **Convention hardening** — `CLAUDE.md`, the umbrella planning doc, the per-pillar plans, the auto-memory feedback file, and the umbrella issue body now all explicitly forbid the "land at 'in review' → chase with a `docs: flip row` follow-up" pattern that the Wave-0 PR accidentally introduced. The tracker-row flip rides with the merging PR, using the GH-assigned PR number (known the moment the PR is opened). The bundling is intentional: this PR itself would have been two PRs under the old habit (one for the row flip, one for the doc convention). Doing it in one diff shows the rule. ## Test plan - [x] No code change. - [x] `npm run format:check` clean on touched files. - [x] Issue #132 body updated to mirror the new wording. Tracks: #132 🤖 Generated with [Claude Code](https://claude.com/claude-code)
…h sweep (#138) Tracks: #131 ## What changed The dep-triage-bot prompt landed in #136 with a rolling-tracker pattern (`Dependency triage — develop`, append-comment-per-run, `Last triaged SHAs` mapping in the body). The daily code-review bot has since refactored to issue-per-run (#135) — this PR brings dep-triage-bot in line, and promotes the convention to the umbrella so every future cloud routine inherits it. ### Convention applied - **Dedicated GitHub label per routine.** No shared `automation` umbrella label. - **Issue per run.** Body holds the run's full punch list. Owner closes manually once everything in the body is resolved. - **Quiet runs leave no trace.** No-op runs do NOT open an issue. - **Per-object state on the artifact, not on a shared tracker.** For dep-triage that means an HTML comment marker `<!-- dep-triaged:<head-sha7>:<action> -->` on the Dependabot PR itself, read at the start of the next run for skip detection. ### Files - `docs/dep-triage-bot/PROMPT.md` — replaced rolling-tracker output, idempotency, and process-gate sections with issue-per-run + per-PR-comment-marker. Hard-rules + dry-run + failure-handling sections updated to match. - `docs/dep-triage-bot/README.md` — output sink description, setup checklist, tradeoffs, and a new "Bot label convention" table mapping each routine to its label. - `docs/plans/2026-04-26-quality-automation-routines.md` (umbrella) — added a new "Cloud-routine output convention" subsection under "Downstream PR contract" so rows 3+ inherit the rule. Updated row 3 + row 4 chunk plans inline so their PRs follow it: no-op leaves no trace, only failures open a labelled per-run issue. - `docs/plans/2026-04-26-quality-actions-bump-bot.md` — output / failure-handling sections rewritten to the new convention. - `docs/plans/2026-04-26-quality-plan-recon-bot.md` — same. ### Demo-path sweep (Wave 0 of #129 / merged as #134) The Wave-0 rename of `examples/nurture-pet/` → `examples/product-demo/` merged on 2026-04-26 (commit `c734d6a`). This PR sweeps the lingering `examples/nurture-pet/` references in the active quality plans + the dep-triage-bot prompt so the chunk plans + cloud routine all point at the post-rename path: - `docs/dep-triage-bot/PROMPT.md` — three references swapped; the now-stale Wave-0 sequencing conditional dropped. - `docs/plans/2026-04-26-quality-automation-routines.md` — "Coordination with PR #129" section condensed to a `RESOLVED` stub linking to #134; risk-register row updated. - `docs/plans/2026-04-26-quality-dep-triage-bot.md` — example-shape comment swapped. - `docs/plans/2026-04-26-quality-demo-smoke.md` — every path swapped; the "Step 0: Decide demo path" pre-flight + the "Rename-coordination follow-up" footer collapsed to a one-paragraph `RESOLVED` stub. Other lingering `nurture-pet` references live in archived plans, code JSDoc, and one test file — those are out of scope for this PR (separate cleanup-sweep follow-up if the owner wants the codebase fully aligned). ### Labels created in repo ``` gh label create dep-triage-bot --color FBCA04 --description "Per-run findings from the weekly dep-triage cloud routine" gh label create actions-bump-bot --color D93F0B --description "Failure issues from the weekly actions-bump cloud routine" gh label create plan-recon-bot --color 1D76DB --description "Failure issues from the monthly plan-recon cloud routine" ``` `review-bot` and `docs-review` were already in place. ## Verification - `npm run verify` — green locally. - Doc-only diff (no `src/**`, no changeset). - No `dep-triage-bot` issues exist yet, so there is no rolling-tracker issue to retire — this lands the convention for the routine's first real run. --------- Co-authored-by: Luis Mendez <hallo@luis-mendez.de>
## Summary Wave 0 (PR #134) renamed `examples/nurture-pet/` -> `examples/product-demo/` at the path level. This PR is the narrative cleanup pass: JSDoc, code comments, config comments, in-flight quality-automation chunk plans, and the vision spec are updated to match the post-rename naming. No behavioral or path changes. - Source-comment narrative `the MVP nurture-pet` -> `the MVP product demo` across `src/agent/`, `src/cognition/`, `src/needs/`, `src/persistence/`. - Demo-workspace JSDoc + config comments updated (`examples/product-demo/src/{cognition,species,ui}.ts`, `eslint.config.js`, `examples/product-demo/eslint.config.js`). - Quality-automation chunk plans (`docs/plans/2026-04-26-quality-{automation-routines,demo-smoke,dep-triage-bot}.md`) flipped from "rename in flight" coordination prose to post-rename truth, citing PR #134. - `docs/dep-triage-bot/PROMPT.md` paths point at `examples/product-demo/`. - `docs/specs/vision.md` and `docs/product/2026-04-26-pre-v1-demo-evolution-plan.md` narrative refs updated to `pet-care` / `product demo`. - `tests/integration/parallel-agent-determinism.test.ts` JSDoc updated; suite filename retained. ## Deliberate skips These nurture-pet references are intentionally preserved: - `.changeset/{autosave-pause-aware,modifier-visual-label,trace-deltas-candidates}.md` — historical descriptors that ride into the eventual 1.0 publish. - `docs/specs/2026-04-26-pre-v1-demo-evolution-design.md` and `docs/specs/2026-04-26-pre-v1-demo-evolution-spec.md` STO-2 / STO-3 entries — legitimate references to legacy localStorage keys that still exist in the wild. - `docs/plans/2026-04-26-pre-v1-demo-second-scenario.md` — refactor scope explicitly names the existing logic. - `examples/product-demo/src/app/main.ts` — the `'nurture-pet.'` literal in `LEGACY_KEY_PREFIXES` is the localStorage purge prefix (spec STO-3); JSDoc around it left as-is to keep the rationale visible. - `examples/product-demo/package.json` description (Phase A baseline descriptor) — historical. - `tests/integration/nurture-pet-deterministic.test.ts` — file name retained (renaming touches git history; separate decision). - `docs/archive/**` — frozen. - `CLAUDE.md` — separate decision. ## Test plan - [x] `npm run verify` green locally (format:check, lint, lint:demo, typecheck, 523 tests, build, docs). - [ ] Codex review approves. Closes #139 Tracks: #132 🤖 Generated with [Claude Code](https://claude.com/claude-code)
## Summary Resolves all 11 findings from the 2026-04-27 docs-review run (`d9b4b85`) tracked in #157: 5 MAJOR + 5 MINOR + 1 NIT. | ID | File | Severity | Fix | |----|------|----------|-----| | `d9b4b85.1` | `CLAUDE.md:53` | MAJOR | Add `lint:demo` + `docs` to `npm run verify` description | | `d9b4b85.2` | `CONTRIBUTING.md:144` | MAJOR | Same `npm run verify` alignment | | `d9b4b85.3` | `docs/PRODUCT_VISION.md:419` | MAJOR | Remove leaked `/root/.claude/plans/...` path | | `d9b4b85.4` | `examples/product-demo/README.md:109` | MAJOR | `src/main.ts` → `src/app/main.ts` (moved in #150) | | `d9b4b85.5` | `PUBLISHING.md:36-38` | MAJOR | Replace stale 5-job CI list with `CI gate (required check)` aggregator + current leaf-job reference | | `d9b4b85.6` | `docs/PRODUCT_VISION.md:3-4,~413,~415,~469` | MINOR | Remove dead `docs/specs/overview.md` + `docs/specs/roadmap.md` references (header, relationship section, review steps) | | `d9b4b85.7` | `docs/PRODUCT_VISION.md:417` | MINOR | Remove dead `docs/plans/review-remediation.md` link | | `d9b4b85.8` | `CONTRIBUTING.md:143` | MINOR | `R-XX` → `#NNN` (no R-XX scheme in this repo) | | `d9b4b85.9` | `CLAUDE.md:44` | MINOR | Drop hardcoded `D:\Projects\agent-library` path | | `d9b4b85.10` | `docs/plans/2026-04-26-pre-v1-demo-guided-walkthrough.md:20` | MINOR | Mark rename preflight as resolved (archived via #134) | | `d9b4b85.11` | `.claude/memory/project_pending_major_changesets.md:8` | NIT | Replace stale 4-changeset count with pointer to `.changeset/*.md` | ## Test plan - [x] `npm run verify` (format:check + lint + lint:demo + typecheck + test + build + docs) green - [x] No code changes — docs-only PR; behavior unchanged - [ ] Codex review on the PR is acknowledged or rebutted ## Notes - No changeset (docs-only). - Issue #157 uses the `docs-review` label and `<!-- d:... -->` markers, which the `review-fix-shipped` Action does not handle (it only matches `<!-- f:... -->` from the code-review bot). The owner ticks the boxes manually per `docs/docs-review-bot/README.md`. PR body therefore lists each finding ID for manual reconciliation rather than the `Refs # finding:` magic line. - Bundled all 11 findings into one PR per the "one PR per session" rule and the doc-only nature of the changes (each fix is a one-liner with no test surface). Refs #157 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Luis Mendez <hallo@luis-mendez.de> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
Wave-0 of the pre-v1 demo evolution increment. Atomic delivery slice: rename + scripts + workflow + ESLint rules + doc sweep + Playwright skeleton + legacy-key purge — all in one diff, splitting forbidden by the plan's own atomic delivery slice rule. Gates every downstream pillar PR.
examples/nurture-pet/→examples/product-demo/(history preserved viagit mv).npm run e2e(root + demo workspace) so all later pillar PRs can rely on it.examples/product-demo/eslint.config.js; newlint:demostep is part ofnpm run verify. Existing nurture-pet baseline stays exempt until pillar 5.2 refactors it.examples/nurture-petreference outside.worktrees/anddocs/archive/; archives the now-shipped rename plan.examples/product-demo/src/app/main.tsruns the legacynurture-pet.*+ un-prefixeddemo.*localStorage purge on first load (spec STO-3) before handing off to the existing baseline.Verification
npm run verify— green (format / lint / lint:demo / typecheck / 523 tests / build / docs).npm run e2e— exits 0 against placeholder spec.npm run demo:build— succeeds; artefacts atexamples/product-demo/dist.git grep "examples/nurture-pet" -- ':(exclude).worktrees/**' ':(exclude)docs/archive/**'— zero matches (R-AC-3 met).examples/product-demo/dist(R-FR-7).Out of scope
examples/product-demo/src/{components,views,demo-domain,stores}/stay empty; pillar PRs add files there).examples/nurture-petreferences insidedocs/archive/**or.worktrees/**(excluded from the verification grep per the plan).Test plan
npm run verifygreennpm run e2eexits 0npm run demo:buildsucceeds;dist/resolves atexamples/product-demo/distgit grep "examples/nurture-pet"returns zero outside the excluded pathspath:field resolves toexamples/product-demo/distdevelop-targeted PRTracks: #132
🤖 Generated with Claude Code