Skip to content

fix(scripts): project_render.py SKELETON_NARRATIVES matches validator (#405)#413

Merged
MScottAdams merged 1 commit intophase2/vbrief-cutoverfrom
agent1/fix/405-skeleton-techstack
Apr 16, 2026
Merged

fix(scripts): project_render.py SKELETON_NARRATIVES matches validator (#405)#413
MScottAdams merged 1 commit intophase2/vbrief-cutoverfrom
agent1/fix/405-skeleton-techstack

Conversation

@MScottAdams
Copy link
Copy Markdown
Collaborator

Summary

Issue #405 reports that scripts/project_render.py SKELETON_NARRATIVES uses the TechStack camelCase key, but scripts/vbrief_validate.py PROJECT_DEF_EXPECTED_NARRATIVES requires tech stack (space-separated) after .lower(). As a result, the skeleton produced by task project:render immediately fails task vbrief:validate (part of task check).

This PR fixes the key so the skeleton passes the validator end-to-end, matching the convention already used by scripts/migrate_vbrief.py (which writes narratives["tech stack"]).

Changes

Why the camel-case splitter still works

_split_camel uses re.sub(r"([a-z])([A-Z])", r"\1 \2", name) and then splits on whitespace and lowercases, so _split_camel("tech stack") splits on the existing space and yields ['tech', 'stack']. Staleness flagging for the TechStack narrative is therefore unchanged by this rename.

Validation

  • task check — passed locally (1539 passed, 1 xfailed).
  • task project:render against this worktree emits "tech stack": "" as expected; task vbrief:validate passes on the fresh skeleton.

Scope & constraints

  • Scope fence respected — only the files enumerated in fix(scripts): project_render.py SKELETON_NARRATIVES TechStack key breaks vbrief:validate #405 are touched (scripts/project_render.py, tests/cli/test_project_render.py) plus the scope vBRIEF and CHANGELOG entry.
  • Other call sites that produce a TechStack narrative (run cmd_project at line 1161, documentation examples, other tests) are intentionally out of scope for this narrow fix; the cmd_project case is a downstream instance of the same bug and will be filed separately if it matters for the v0.20.0 merge gate.

Part of #402 pre-merge must-fix batch

This is PR 1 of 4 in the swarm-402 cascade on phase2/vbrief-cutover.

Closes #405
Refs #402

…#405)

- Rename `TechStack` skeleton key to `tech stack` so `task project:render`
  skeletons satisfy `vbrief_validate.py` PROJECT_DEF_EXPECTED_NARRATIVES
  (`tech stack` after `.lower()`) immediately, unblocking `task check`.
- Update `test_skeleton_has_empty_narratives` assertion to the new key.
- `_split_camel` still splits the new key into `['tech', 'stack']` so
  staleness flagging for the TechStack narrative is unchanged.
- Add scope vBRIEF `vbrief/active/2026-04-16-405-project-render-tech-stack-key.vbrief.json`
  with origin provenance to #405 and #402.

Closes #405
Part of #402
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 16, 2026

Greptile Summary

Fixes the bug where SKELETON_NARRATIVES[\"TechStack\"] in scripts/project_render.py failed vbrief_validate.py's case-folded check for \"tech stack\" (\"techstack\" != \"tech stack\"), causing every fresh task project:render skeleton to immediately break task check. The rename to \"tech stack\" is correct, the _split_camel staleness-flagging helper handles the space-separated key without change, and the companion test assertion is updated in kind.

Confidence Score: 5/5

Safe to merge — targeted one-line key rename with a correct test update; no logic changes.

All findings are P2 (a stale "TechStack" mention in a docstring comment). The fix itself is mechanically correct: the renamed key case-folds to exactly what the validator expects, staleness flagging via _split_camel is unaffected, and the test assertion is updated to match.

No files require special attention.

Important Files Changed

Filename Overview
scripts/project_render.py Renames SKELETON_NARRATIVES["TechStack"] to "tech stack" and adds a cross-reference comment; the fix is correct and the _split_camel staleness logic remains unaffected. One stale "TechStack" reference survives in the agent-workflow docstring.
tests/cli/test_project_render.py Updates test_skeleton_has_empty_narratives to assert "tech stack" instead of "TechStack"; all other test fixtures that use "TechStack" are testing existing-document preservation (not skeleton creation), so they remain correct.
vbrief/active/2026-04-16-405-project-render-tech-stack-key.vbrief.json New scope vBRIEF tracking this fix; schema is valid (v0.5, status "running" in active/), origin provenance references #405 and #402, no issues.
CHANGELOG.md Fixed entry added under [Unreleased] correctly describing the key rename, test update, and staleness-flagging continuity. No issues.

Sequence Diagram

sequenceDiagram
    participant U as User
    participant PR as project_render.py
    participant PD as PROJECT-DEFINITION.vbrief.json
    participant VV as vbrief_validate.py

    U->>PR: task project:render
    PR->>PD: create skeleton (SKELETON_NARRATIVES)
    Note over PD: narratives keys include<br/>"tech stack" (fixed)
    U->>VV: task vbrief:validate
    VV->>PD: read narratives keys
    VV->>VV: narrative_keys_lower = {k.lower() for k in narratives}<br/>check "tech stack" in narrative_keys_lower
    Note over VV: "tech stack".lower() == "tech stack" ✓<br/>(was "TechStack".lower() == "techstack" ✗)
    VV-->>U: PASS
Loading
Prompt To Fix All With AI
This is a comment left during a code review.
Path: scripts/project_render.py
Line: 25

Comment:
**Stale docstring references old key name**

The inline docstring on line 25 still says "update the `TechStack` narrative" — this should now read "`tech stack` narrative" to match the renamed key.

```suggestion
       the completed scopes (e.g. if a "tech stack" scope completed, update the
       tech stack narrative with the new technology choices).
```

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "fix(scripts): project_render.py SKELETON..." | Re-trigger Greptile

@MScottAdams
Copy link
Copy Markdown
Collaborator Author

Acknowledging the P2 finding on scripts/project_render.py line 22-23 (stale TechStack reference in the agent-assisted layer docstring).

Not fixing in this PR per the swarm-402 charter severity ladder — P2 items are non-blocking style/nit/opinion and reply-ack is permitted. The code-level behaviour is correct and task check is green. The docstring drift will be cleaned up either as part of #410's run cmd_project pass (which also generates a TechStack narrative that will be renamed to tech stack) or as a follow-up discovered-during-402 issue.

Confidence 5/5 + all CI green + no P0/P1 ⇒ proceeding to self-merge per the PO Pre-Approval gate on #402.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant