Summary
The pass/fail exit code for plain ghost compare uses a hardcoded distance > 0.5 cutoff, inlined twice in packages/ghost/src/cli.ts (the pairwise and --temporal paths). The value is undocumented, untested, and was introduced as a bare literal in the founding commit (618f275) with no rationale in the message or code.
Evidence
- Inline literal at
cli.ts (pairwise exit + temporal exit), no named constant, no comment.
- No test pins the cutoff —
gate.test.ts/sync.test.ts only use 0.5 as input data, not as a gate assertion. Changing the cutoff breaks zero tests.
- The only place
0.5 is given meaning is docs/ideas/guided-migration.md (">0.5 = different design languages"), but that's an ideas doc and is not referenced by the code. The alignment is coincidental, not wired.
Why it matters
Users meet bare compare first and assume it's the drift gate. The real governance path is compare --gate (baseline-relative, per-dimension, acked via .ghost-sync.json). The arbitrary-looking 0.5 erodes trust in the number and obscures --gate.
Proposed fix (non-breaking)
- Promote
0.5 to a named, commented constant in cli.ts describing it as a heuristic and pointing to --gate for real gating.
- Add one line to
compare --help steering serious CI users to --gate.
- (Optional, separate) consider a
--threshold <n> flag only if there's real demand.
Related
The WEIGHTS constants in embedding/compare.ts have the same "taste captured once, undocumented" smell (1f8decb).
Summary
The pass/fail exit code for plain
ghost compareuses a hardcodeddistance > 0.5cutoff, inlined twice inpackages/ghost/src/cli.ts(the pairwise and--temporalpaths). The value is undocumented, untested, and was introduced as a bare literal in the founding commit (618f275) with no rationale in the message or code.Evidence
cli.ts(pairwise exit + temporal exit), no named constant, no comment.gate.test.ts/sync.test.tsonly use0.5as input data, not as a gate assertion. Changing the cutoff breaks zero tests.0.5is given meaning isdocs/ideas/guided-migration.md(">0.5 = different design languages"), but that's an ideas doc and is not referenced by the code. The alignment is coincidental, not wired.Why it matters
Users meet bare
comparefirst and assume it's the drift gate. The real governance path iscompare --gate(baseline-relative, per-dimension, acked via.ghost-sync.json). The arbitrary-looking0.5erodes trust in the number and obscures--gate.Proposed fix (non-breaking)
0.5to a named, commented constant incli.tsdescribing it as a heuristic and pointing to--gatefor real gating.compare --helpsteering serious CI users to--gate.--threshold <n>flag only if there's real demand.Related
The
WEIGHTSconstants inembedding/compare.tshave the same "taste captured once, undocumented" smell (1f8decb).