Summary
codegraph check HEAD reports [FAIL] signatures when an exported function is newly added (not modified). The predicate help text says "Assert no exported function/method/class declaration lines were modified" — additions are not modifications, yet they are flagged, and the run exits 1. This blocks additive-extension work.
Minimal repro
- In a tracked JS file, append a new exported function (no existing lines touched):
export function brandNewThing(x) { return x; }
codegraph build . --no-incremental
codegraph check HEAD
[PASS] cycles
[FAIL] signatures
brandNewThing (function) at <file>:NNN
[PASS] boundaries
3 predicates | 2 passed | 1 failed (exit 1)
Observations (all reproduced)
- Inserting the function before an existing export and appending at EOF both fail → not a line-offset artifact.
- Declaring it as
export const brandNewThing = (x) => x; is also classified function and flagged → no syntax workaround.
codegraph check HEAD --json reports the symbol with "passed": false; the symbol is absent at HEAD (e.g. git show HEAD:<file> | grep -c brandNewThing → 0) and has 0 transitive callers (codegraph fn-impact brandNewThing → 0).
- Manifesto mode (
codegraph check, no ref) exits 0.
Version
@optave/codegraph 3.17.0 (native engine unavailable → wasm). Report pointer: dist/features/check.js:439 (checkNoSignatureChanges) flags any changed range covering an exported def line without distinguishing add from modify.
Requested
Discriminate additions from modifications: only flag a symbol whose declaration exists at the base ref and changed at the same line/signature; treat symbols that are new at HEAD as non-violations. (Or add an explicit opt-out flag for additive changes.)
Summary
codegraph check HEADreports[FAIL] signatureswhen an exported function is newly added (not modified). The predicate help text says "Assert no exported function/method/class declaration lines were modified" — additions are not modifications, yet they are flagged, and the run exits 1. This blocks additive-extension work.Minimal repro
codegraph build . --no-incrementalcodegraph check HEADObservations (all reproduced)
export const brandNewThing = (x) => x;is also classifiedfunctionand flagged → no syntax workaround.codegraph check HEAD --jsonreports the symbol with"passed": false; the symbol is absent at HEAD (e.g.git show HEAD:<file> | grep -c brandNewThing→ 0) and has 0 transitive callers (codegraph fn-impact brandNewThing→ 0).codegraph check, no ref) exits 0.Version
@optave/codegraph3.17.0 (native engine unavailable → wasm). Report pointer:dist/features/check.js:439(checkNoSignatureChanges) flags any changed range covering an exported def line without distinguishing add from modify.Requested
Discriminate additions from modifications: only flag a symbol whose declaration exists at the base ref and changed at the same line/signature; treat symbols that are new at HEAD as non-violations. (Or add an explicit opt-out flag for additive changes.)