Verifies plan citations against the files under root. The file list is
read once per verifier.
Checks the path:line citations of Markdown plans against the current code.
A plan written by an agent cites code as src/app/x.component.ts:120-140
or just x.component.ts:120, usually next to the symbol it means
(fetchGenericTypes(), ERROR_LOAD_STATES). Code moves; the citation does
not. For each citation the verifier resolves the file, checks the line
range and looks for an anchor inside the cited range. Anchors are the inline
code spans on the same line that are not paths: identifiers (Foo.bar() ->
bar), CSS selectors (.x -> x), prefixes (ERROR_*) and literal code,
which falls back to its longest identifier. Spans before the citation come
first, nearest first, then those after it. One anchor inside the range is
enough; otherwise the first anchor that occurs elsewhere in the file is
reported as moved, with the new line. Class names are no anchor for
templates and styles, which never contain them. Citations inside fenced
code blocks are skipped.
Remarks
Port of the claude-plugin script ngm-verify-citations/scripts/verify-citations.mjs;
both are held to the same statuses by a shared test fixture.
Verifies plan citations against the files under
root. The file list is read once per verifier.Checks the
path:linecitations of Markdown plans against the current code. A plan written by an agent cites code assrc/app/x.component.ts:120-140or justx.component.ts:120, usually next to the symbol it means (fetchGenericTypes(),ERROR_LOAD_STATES). Code moves; the citation does not. For each citation the verifier resolves the file, checks the line range and looks for an anchor inside the cited range. Anchors are the inline code spans on the same line that are not paths: identifiers (Foo.bar()->bar), CSS selectors (.x->x), prefixes (ERROR_*) and literal code, which falls back to its longest identifier. Spans before the citation come first, nearest first, then those after it. One anchor inside the range is enough; otherwise the first anchor that occurs elsewhere in the file is reported as moved, with the new line. Class names are no anchor for templates and styles, which never contain them. Citations inside fenced code blocks are skipped.Remarks
Port of the claude-plugin script
ngm-verify-citations/scripts/verify-citations.mjs; both are held to the same statuses by a shared test fixture.