Skip to content

fix: scope ORPHAN_GOAL detection to the goals: block - #384

Merged
bborbe merged 4 commits into
masterfrom
fix/lint-orphan-goal
Nov 17, 2026
Merged

bborbe merged 4 commits into
masterfrom
fix/lint-orphan-goal

Conversation

@bborbe

@bborbe bborbe commented Nov 17, 2026

Copy link
Copy Markdown
Owner

Summary

vault-cli task lint reported thousands of false ORPHAN_GOAL findings (4662 lines / 1450 distinct values on private-personal). goalsMultilineRegex used (?ms), so . matched newlines and its greedy .+ swallowed every frontmatter key after goals:; the per-line parser then reported list items from themes: / metrics_sessions: (and prose/paths) as missing goals.

Changes

  • pkg/ops/lint.go: bound both goals: regexes to the block — no dotall flag, [ \t] instead of \s, [^\n]* instead of .+. Stops at the next top-level key.
  • pkg/ops/lint.go: extractGoalName unescapes YAML single-quote doubling ('' -> ') so a goal whose filename contains an apostrophe resolves (132 such false rows on private-personal).
  • pkg/ops/lint_test.go: four regression contexts — goals followed by themes/metrics_sessions (0 findings), genuine block-list orphan (1), flow-list orphan (1, theme excluded), escaped-apostrophe name (0).
  • CHANGELOG.md: ## Unreleased bullet.

Verification

  • make test / make precommit green in the dark-factory container (prompt 283).
  • Positive control preserved: a genuine missing goals: entry still yields exactly 1 ORPHAN_GOAL.

Task: ad53acec-4ca2-45db-8243-e37f01f687e4

@bborbe
bborbe marked this pull request as ready for review November 17, 2026 21:48

@ben-s-pull-request-reviewer ben-s-pull-request-reviewer Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The scoping fix is correct and well-targeted: both goals regexes are now line-bounded, the multiline capture stops at the next top-level key, and the four new contexts pin the reported regression (no false ORPHAN_GOAL from themes/metrics_sessions, a genuine orphan still caught, doubled-apostrophe goal names resolved). No blocking defect found — the remaining items are a silent false-negative when a blank line or comment separates goals: from its list, a flow-list regression test that passes only because of a pre-existing lazy-] truncation, and two nits; judgment tier ran in selector mode (54 candidates, 11 applicable), the deterministic funnel ran (its single mechanical finding was dropped as a stdlib false positive per that rule's own enforcement note), precommit skipped (CI covers lint+test), 1 file excluded by .reviewignore, intent unavailable (gh not permitted).

@bborbe
bborbe merged commit 1f6d6ad into master Nov 17, 2026
9 checks passed
@bborbe
bborbe deleted the fix/lint-orphan-goal branch November 17, 2026 22:02
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