Skip to content

plan-feature: verify-citations fails closed on no input - #77

Merged
jasperboerhof merged 1 commit into
mainfrom
lift/verify-citations-fail-closed
Oct 5, 2026
Merged

jasperboerhof merged 1 commit into
mainfrom
lift/verify-citations-fail-closed

Conversation

@bert-script

Copy link
Copy Markdown
Contributor

Why

verify-citations.sh printed All 0 citations resolve. and exited 0 on two inputs that verified nothing:

  • an unreadable file argument (a typo in the path), and
  • empty input, or input with only comments and blanks.

Phase 1.4 reads exit 0 as "every citation is real", so the gate passed having checked nothing. A consumer's reviewer caught it.

What

  • Both cases now exit 2 with a message on stderr. The header comment documents exit 2.
  • verify-citations.test.sh gains three cases for them (35 assertions).
  • Identical change in skills/plan-feature/scripts/ and plugins/core-skills/skills/plan-feature/scripts/.

Not in this PR: plugins/context-economy/lib/verify-citations.sh has the same fail-open behaviour (checked: empty stdin and a missing file both exit 0 with "All 0 citations resolve."). It is a separate plugin with its own release, so it is left for you to decide.

From Lokale Keuze's copy of this skill (LK-1305).

No plugin.json version bump. This is one of eight parallel PRs from the same consumer, and each bump would collide on the same line. Bump on merge as you prefer.

Test plan

  • Suite passes under bash 5 and /bin/bash 3.2; shellcheck --severity=warning clean.
  • CI green

🤖 Generated with Claude Code

Given an unreadable file argument or an empty list, the loop ran zero
times and the script printed "All 0 citations resolve." with exit 0.
Phase 1.4 treats exit 0 as "every citation is real", so a typo in the
file name passed the gate having checked nothing. Both cases now exit 2
with a message on stderr. The suite gains three cases for them.

Lifted from a consumer copy (Lokale Keuze, LK-1305).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@bjvle

bjvle commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator

SKILL.md should be updated alongside this fix. It still only explains MISSING and says "you may not proceed past Phase 1.4 with a non-zero exit". Exit 2 does block, correctly, but the agent isn't told what it means or what to do next.

E.g. on skills/plan-feature/SKILL.md:198 and plugins/core-skills/skills/plan-feature/SKILL.md:200 the bold sentence becomes:

A MISSING line is a fabricated citation — fix it or drop the claim. Exit 2 means nothing was verified — the input was empty or unreadable — not that a citation is fabricated: fix the pipeline so it feeds the citations you're about to make, and rerun. You may not proceed past Phase 1.4 with a non-zero exit.

@jasperboerhof
jasperboerhof merged commit 0777cbb into main Oct 5, 2026
3 checks passed
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