Skip to content

fix(scope): quote mission name in NOTES.md frontmatter - #768

Merged
mvschwarz merged 1 commit into
mvschwarz:mainfrom
adampog:linux/notes-title-quoting
Oct 5, 2026
Merged

mvschwarz merged 1 commit into
mvschwarz:mainfrom
adampog:linux/notes-title-quoting

Conversation

@adampog

@adampog adampog commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

What a user gets

Before: a mission whose title contains : (or #, quotes, or a leading -) was written unquoted into NOTES.md frontmatter, which is invalid YAML, so rig workspace validate rejected the new mission. After: the name is written quoted (via JSON.stringify, as {{mission_name_yaml}}, matching how {{intent_yaml}} is already written). The heading keeps the raw title.

How you verified it

On b5a9deaf (current main) plus this commit, Node 24.21.0, Linux:

  • npx vitest run test/scope-commands.test.ts test/scope-convention-scaffold.test.ts in packages/cli: 2 files, 105 tests passed, including a new case with a colon in the title.
  • npm run lint: passed.

Not run: the full npm test and npm run test:ui.

Anything you were unsure about

Nothing in particular.

  • One concern per PR; no version bump; no CHANGELOG.md edit
  • Tests added or updated where the change is testable
  • I listed the checks I ran, their results, and any checks I could not run

Made with an agent team (Claude Code and Codex), with an independent QA pass before submission.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Mission names containing punctuation are now correctly quoted in generated notes, preserving their exact values in frontmatter.
    • Generated frontmatter passes workspace validation for mission names with colons, quotation marks, and hash symbols.

A mission title containing ": " (or #, quotes, a leading -) was written
unquoted into NOTES.md, producing invalid YAML that `rig workspace
validate` rejected. Write it via JSON.stringify as {{mission_name_yaml}},
matching how {{intent_yaml}} is written; the heading keeps the raw title.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 8764bf1)
@coderabbitai

coderabbitai Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 428dbc77-33e8-47dc-b1f0-a13342bbd9ca
📥 Commits

Reviewing files that changed from the base of the PR and between b5a9dea and c6d38bb.

📒 Files selected for processing (4)
  • packages/cli/src/lib/scope-templates/notes.md
  • packages/cli/src/lib/scope/templates.ts
  • packages/cli/test/scope-commands.test.ts
  • packages/cli/test/scope-convention-scaffold.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The NOTES frontmatter template now uses a YAML-specific mission-name placeholder. The placeholder substitution JSON-stringifies the mission name. Tests check quoted output and frontmatter validation for a title containing YAML-special characters.

Changes

NOTES frontmatter

Layer / File(s) Summary
Quote mission names in frontmatter
packages/cli/src/lib/scope-templates/notes.md, packages/cli/src/lib/scope/templates.ts, packages/cli/test/scope-commands.test.ts, packages/cli/test/scope-convention-scaffold.test.ts
The NOTES template uses a YAML-specific placeholder, and substitution JSON-stringifies the mission name. Tests check quoted output and validate generated frontmatter for a title containing YAML-special characters.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: rudycelekli

Merge Risk: ⚪ Minimal · up to c6d38

This change quotes mission names in generated NOTES frontmatter, and targeted test success is reported. No material merge risk is identified.

Architecture Summary

Architecture risk: 🔵 Low · up to c6d38

The change affects 1 system.

Changed systems: packages/cli

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — packages/cli (library) was modified; 4 changed files map to changed impact.

Before / after behavior

  • observed — Modified behavior in packages/cli/src/lib/scope-templates/notes.md: The front matter’s name template changes from {{mission_name}} to {{mission_name_yaml}}.
  • observed — Modified behavior in packages/cli/src/lib/scope/templates.ts: applyNotesPlaceholders now substitutes {{mission_name_yaml}} with JSON.stringify(opts.mission_name).
  • observed — Modified behavior in packages/cli/test/scope-commands.test.ts: The expected NOTES content now requires the mission name 0.6.0 to be quoted; the previous expectation accepted the unquoted value.
  • observed — Modified behavior in packages/cli/test/scope-convention-scaffold.test.ts: Added an import of validateWorkspaceFrontmatter for validating generated workspace frontmatter.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 3 files. (1 skipped: 1 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: quoting mission names in NOTES.md frontmatter.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 3 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mvschwarz

Copy link
Copy Markdown
Owner

Thanks, @adampog. On current main, the NOTES.md template does write the mission name unquoted (name: {{mission_name}}). We've approved the CI runs, and it's with the team for review.

@openrig-review openrig-review left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved at c6d38bb. A mission name containing : , #, quotes or a leading - no longer produces NOTES.md frontmatter that rig workspace validate rejects: the template's name: is now written with JSON.stringify, a valid YAML double-quoted scalar. Plain names read back the same through both YAML parsers, existing NOTES.md files are untouched (they're only rendered when none exists), and the # Notes — heading keeps the raw name. It also fixes the same problem when a mission's intent sentence becomes the name. All 8 required checks pass. Thank you.

— dev60-planner@v-openrig-build

@mvschwarz
mvschwarz merged commit c36c983 into mvschwarz:main Oct 5, 2026
10 checks passed
@mvschwarz

Copy link
Copy Markdown
Owner

Merged, thanks @adampog. Mission names containing : or quotes now produce valid NOTES.md frontmatter. It's on main and isn't in a release yet.

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.

3 participants