Skip to content

fix(validate): require marker punctuation after a leading TBD/TODO - #1912

Open
Tyagiquamar wants to merge 1 commit into
Fission-AI:mainfrom
Tyagiquamar:fix/purpose-marker-punctuation
Open

Tyagiquamar wants to merge 1 commit into
Fission-AI:mainfrom
Tyagiquamar:fix/purpose-marker-punctuation

Conversation

@Tyagiquamar

@Tyagiquamar Tyagiquamar commented Sep 18, 2026

Copy link
Copy Markdown

Closes #1897.

Root cause: LEADING_MARKER in src/core/validation/purpose-placeholder.ts was case-insensitive with a negative lookahead that a plain space satisfies, so the Spanish/Portuguese sentence opener Todo followed by prose matched the TODO placeholder marker and validate --strict failed an authored Purpose.

Fix: keep the existing word-boundary lookahead and add a second lookahead requiring end of Purpose, a line break, or marker punctuation after TBD/TODO. This is the issue's suggested option 2, refined so every existing pinned behaviour still holds: lowercase tbd - / todo - , TODO:, TODO(owner):, TBD. and bare TBD/TODO are still reported, while Todo el... / Todo o... prose is not.

Tests: added Spanish and Portuguese regression cases plus a marker-alone-on-its-line case to test/core/purpose-placeholder.test.ts. New test failed before the fix ({line: 4} instead of null) and passes after. Added .changeset/purpose-marker-punctuation.md (patch).

Validation in Docker (node:22-bookworm, pnpm 10.34.5): pnpm build exit 0; vitest test/core 117 files / 4441 passed / 1 skipped; tsc --noEmit exit 0; eslint exit 0. Full pnpm test was not run to completion: cli-e2e/prompts suites stall in this sandbox; all unit suites under test/core pass.

Assisted by Muse Spark; the change was verified with the Docker runs above.

Summary by CodeRabbit

  • Bug Fixes
    • Improved strict validation of Purpose text to avoid incorrectly flagging ordinary prose beginning with “Todo,” including Spanish and Portuguese sentences.
    • Placeholder markers such as TODO and TBD are now recognized only when followed by valid boundaries or marker punctuation.
    • Continued detection of standalone placeholder markers above placeholder content.

@Tyagiquamar
Tyagiquamar requested a review from a team as a code owner September 18, 2026 07:34
@Tyagiquamar
Tyagiquamar requested review from clay-good and removed request for a team September 18, 2026 07:34
@coderabbitai

coderabbitai Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 7a3cbbd5-19d6-4419-a643-045f378526ac

📥 Commits

Reviewing files that changed from the base of the PR and between bae58cf and 2a43341.

📒 Files selected for processing (3)
  • .changeset/purpose-marker-punctuation.md
  • src/core/validation/purpose-placeholder.ts
  • test/core/purpose-placeholder.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The purpose validator now avoids treating “Todo” followed by prose as a placeholder marker. It still detects standalone TODO or TBD markers and documented punctuation forms. Regression tests and a patch changeset were added.

Changes

Purpose validation

Layer / File(s) Summary
Leading marker validation
src/core/validation/purpose-placeholder.ts, test/core/purpose-placeholder.test.ts, .changeset/purpose-marker-punctuation.md
The leading marker pattern now requires valid marker termination or punctuation. Tests cover Spanish and Portuguese prose and standalone TODO markers. The changeset records the patch release.

Priority: ➖ Normal

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

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: alfred-openspec

Merge Risk: ⚪ Minimal · up to 2a433

The change addresses the stated false positives and no supported regression remains blocking merge.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main validation change: leading TBD/TODO markers must use valid termination, including marker punctuation. It is concise and directly related to the false-positive fix.
Linked Issues check ✅ Passed Issue #1897 requires authored Spanish and Portuguese prose that starts with Todo to avoid PURPOSE_IS_PLACEHOLDER, while genuine leading TBD and TODO markers remain detected. The updated `LEADI…
Out of Scope Changes check ✅ Passed The changeset, validator update, and regression tests directly support Issue #1897. No unrelated implementation or test changes appear in the reviewed pull-request diff.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

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.

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.

Purpose placeholder check: case-insensitive TODO false-positives on the Spanish word "Todo"

1 participant