From d0a2451a3800d21ed9ce29512f7eae9a44cb40a2 Mon Sep 17 00:00:00 2001 From: Dave Date: Tue, 24 Feb 2026 16:06:32 +0000 Subject: [PATCH] story-kit: start 156_bug_onboarding_welcome_screen_triggers_on_already_configured_projects --- ...triggers_on_already_configured_projects.md | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .story_kit/work/2_current/156_bug_onboarding_welcome_screen_triggers_on_already_configured_projects.md diff --git a/.story_kit/work/2_current/156_bug_onboarding_welcome_screen_triggers_on_already_configured_projects.md b/.story_kit/work/2_current/156_bug_onboarding_welcome_screen_triggers_on_already_configured_projects.md new file mode 100644 index 0000000..2f0666d --- /dev/null +++ b/.story_kit/work/2_current/156_bug_onboarding_welcome_screen_triggers_on_already_configured_projects.md @@ -0,0 +1,49 @@ +--- +name: "Onboarding welcome screen triggers on already-configured projects" +--- + +# Bug 156: Onboarding welcome screen triggers on already-configured projects + +## Description + +The onboarding welcome screen ("Welcome to Story Kit — This project needs to be set up...") appears even when the project is fully configured and has been in use for a long time. + +## Root Cause + +`server/src/io/onboarding.rs` lines 6 and 9 define template markers: + +```rust +const TEMPLATE_MARKER_CONTEXT: &str = "Agentic AI Code Assistant"; +const TEMPLATE_MARKER_STACK: &str = "Agentic Code Assistant"; +``` + +These markers are phrases that appear in the scaffold templates (`server/src/io/fs.rs` lines 233 and 269). The detection logic (`is_template_or_missing` at line 59) checks if the file *contains* the marker string. But these phrases are generic enough that real project content can contain them too — especially when the project being managed IS an agentic code assistant (i.e. story-kit managing itself). + +## The Fix + +Replace the content-based marker detection with a dedicated sentinel comment that only exists in untouched scaffold templates. The sentinel should be something that would never appear in real content, like an HTML comment: + +``` + +``` + +Changes needed: + +1. **`server/src/io/onboarding.rs`**: Replace `TEMPLATE_MARKER_CONTEXT` and `TEMPLATE_MARKER_STACK` with a single `TEMPLATE_SENTINEL` constant set to `""`. Update `check_onboarding_status` to use it for both context and stack checks. + +2. **`server/src/io/fs.rs`**: Add `` as the first line of both `STORY_KIT_CONTEXT` and `STORY_KIT_STACK` template constants (lines 233 and 269). + +3. **`server/src/io/onboarding.rs` tests**: Update the test `needs_onboarding_true_when_specs_contain_scaffold_markers` to use the sentinel instead of the old marker phrases. Also add a test confirming that content containing "Agentic AI Code Assistant" WITHOUT the sentinel does NOT trigger onboarding. + +## Key Files + +- `server/src/io/onboarding.rs` — detection logic and markers +- `server/src/io/fs.rs` lines 233, 269 — scaffold template content + +## Acceptance Criteria + +- [ ] Scaffold templates contain the sentinel `` as first line +- [ ] `needs_onboarding()` returns false for projects whose specs contain "Agentic AI Code Assistant" but NOT the sentinel +- [ ] `needs_onboarding()` returns true for untouched scaffold content (which contains the sentinel) +- [ ] Existing tests updated and passing +- [ ] `cargo clippy` clean