story-kit: queue 156_bug_onboarding_welcome_screen_triggers_on_already_configured_projects for merge

This commit is contained in:
Dave
2026-02-24 16:13:26 +00:00
parent e617d39aa5
commit 125b77a592

View File

@@ -1,49 +0,0 @@
---
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:
```
<!-- story-kit:scaffold-template -->
```
Changes needed:
1. **`server/src/io/onboarding.rs`**: Replace `TEMPLATE_MARKER_CONTEXT` and `TEMPLATE_MARKER_STACK` with a single `TEMPLATE_SENTINEL` constant set to `"<!-- story-kit:scaffold-template -->"`. Update `check_onboarding_status` to use it for both context and stack checks.
2. **`server/src/io/fs.rs`**: Add `<!-- story-kit:scaffold-template -->` 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 `<!-- story-kit:scaffold-template -->` 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