Skip to content

Fix CLI --version to read from package.json#2

Merged
klappy merged 2 commits intomainfrom
claude/test-oddkit-v0.9.0-jKaRv
Feb 2, 2026
Merged

Fix CLI --version to read from package.json#2
klappy merged 2 commits intomainfrom
claude/test-oddkit-v0.9.0-jKaRv

Conversation

@klappy
Copy link
Copy Markdown
Owner

@klappy klappy commented Feb 2, 2026

The version was hardcoded as 0.1.0, now dynamically reads from package.json
so --version correctly shows 0.9.0.

https://claude.ai/code/session_014FSYqtokXmcQADW4tTsgci


Note

Low Risk
Low risk: small, localized change to CLI version reporting plus a patch version bump with no behavior changes beyond --version output.

Overview
Updates the CLI to source its --version output from package.json (removing the previously hardcoded 0.1.0) by loading the package version at runtime.

Bumps the npm package version to 0.9.1 (including package-lock.json) and records the fix in CHANGELOG.md.

Written by Cursor Bugbot for commit 15b8ed2. This will update automatically on new commits. Configure here.

The version was hardcoded as 0.1.0, now dynamically reads from package.json
so --version correctly shows 0.9.0.

https://claude.ai/code/session_014FSYqtokXmcQADW4tTsgci
- CLI --version now reads from package.json dynamically
- Was hardcoded as 0.1.0, now correctly shows actual version

https://claude.ai/code/session_014FSYqtokXmcQADW4tTsgci
@klappy klappy merged commit 7590f8c into main Feb 2, 2026
1 check passed
@klappy klappy deleted the claude/test-oddkit-v0.9.0-jKaRv branch February 2, 2026 01:37
klappy added a commit that referenced this pull request Apr 20, 2026
….21.1)

Two fixes from Cursor Bugbot findings on PR #120 / #121 that should have
blocked the 0.21.0 ship and didn't because the orchestrator treated
Bugbot's in_progress state as non-blocking. The findings are real and
the medium-severity one is a prod regression vs pre-refactor behavior.

Bug #1 (medium) — Stop-word filtering silently drops canon vocab keywords:
- parseCheckColumn called tokenize(m[1]) with default STOP_WORDS filter.
  Canon vocab includes 'from' (in source-named) and 'to' (inside
  'according to'); STOP_WORDS includes both. Result: 'from' is dropped
  from stemmedTokens; the runtime call site applied the same filter to
  inputStems so 'from' is dropped there too.
- Pre-refactor regex evaluator matched 'from' literally as
  new RegExp('\\bfrom\\b', 'i') against raw input. Inputs like
  'I learned this from my colleague' passed source-named pre-refactor
  and fail post-refactor — the strictly-additive invariant the 0.21.0
  CHANGELOG and PR description claimed is broken.
- Latent landmine: any prereq whose canon vocab is entirely stop-words
  would have stemmedTokens.size === 0 and trigger the conservative
  length>=20 fallback inappropriately (false positive). Not currently
  exploited by canon but the structural risk is there.
- Fix: pass new Set() (empty stop-words) to both tokenize() calls so
  canon keywords survive on both sides and shape matches.

Bug #2 (low) — DRY violation in BasePrerequisite:
- 0.21.0 introduced PrereqMatchVocab interface to share shape between
  BasePrerequisite and ChallengeTypeDef.prerequisiteOverlays[]. The
  inline type on prerequisiteOverlays uses '& PrereqMatchVocab'
  intersection; BasePrerequisite re-listed all five fields manually.
  Future PrereqMatchVocab additions would not propagate to
  BasePrerequisite — defeats the DRY purpose.
- Fix: split into BasePrerequisiteCore (3 core fields) and
  type BasePrerequisite = BasePrerequisiteCore & PrereqMatchVocab.

Verification:
- Typecheck clean
- governance-parser.test.mjs 105/105 pass
- 2 new regression assertions in canon-tool-envelope.smoke.mjs:
  (10) source-named via 'from'-only canon keyword
  (11) source-named via 'according to' multi-word phrase
- Bugbot Autofix preview diff for PR #121 used as the basis for the
  Bug #1 fix (cherry-picked the change locally rather than applying
  via Autofix UI to keep the audit trail in this branch).

Process post-mortem to follow in P1.3.3 closeout ledger.
klappy added a commit that referenced this pull request Apr 20, 2026
….21.1) (#122)

Two fixes from Cursor Bugbot findings on PR #120 / #121 that should have
blocked the 0.21.0 ship and didn't because the orchestrator treated
Bugbot's in_progress state as non-blocking. The findings are real and
the medium-severity one is a prod regression vs pre-refactor behavior.

Bug #1 (medium) — Stop-word filtering silently drops canon vocab keywords:
- parseCheckColumn called tokenize(m[1]) with default STOP_WORDS filter.
  Canon vocab includes 'from' (in source-named) and 'to' (inside
  'according to'); STOP_WORDS includes both. Result: 'from' is dropped
  from stemmedTokens; the runtime call site applied the same filter to
  inputStems so 'from' is dropped there too.
- Pre-refactor regex evaluator matched 'from' literally as
  new RegExp('\\bfrom\\b', 'i') against raw input. Inputs like
  'I learned this from my colleague' passed source-named pre-refactor
  and fail post-refactor — the strictly-additive invariant the 0.21.0
  CHANGELOG and PR description claimed is broken.
- Latent landmine: any prereq whose canon vocab is entirely stop-words
  would have stemmedTokens.size === 0 and trigger the conservative
  length>=20 fallback inappropriately (false positive). Not currently
  exploited by canon but the structural risk is there.
- Fix: pass new Set() (empty stop-words) to both tokenize() calls so
  canon keywords survive on both sides and shape matches.

Bug #2 (low) — DRY violation in BasePrerequisite:
- 0.21.0 introduced PrereqMatchVocab interface to share shape between
  BasePrerequisite and ChallengeTypeDef.prerequisiteOverlays[]. The
  inline type on prerequisiteOverlays uses '& PrereqMatchVocab'
  intersection; BasePrerequisite re-listed all five fields manually.
  Future PrereqMatchVocab additions would not propagate to
  BasePrerequisite — defeats the DRY purpose.
- Fix: split into BasePrerequisiteCore (3 core fields) and
  type BasePrerequisite = BasePrerequisiteCore & PrereqMatchVocab.

Verification:
- Typecheck clean
- governance-parser.test.mjs 105/105 pass
- 2 new regression assertions in canon-tool-envelope.smoke.mjs:
  (10) source-named via 'from'-only canon keyword
  (11) source-named via 'according to' multi-word phrase
- Bugbot Autofix preview diff for PR #121 used as the basis for the
  Bug #1 fix (cherry-picked the change locally rather than applying
  via Autofix UI to keep the audit trail in this branch).

Process post-mortem to follow in P1.3.3 closeout ledger.
klappy added a commit that referenced this pull request Apr 26, 2026
The three Cursor Agent fix commits on this PR addressed all three
Bugbot findings correctly, but only the count() collision (Bug #1)
got dedicated test coverage. Bugs #2 and #3 — both about literal
handling — landed without regression tests, so a future refactor
that reverts the literal-skip logic would not be caught by CI.

This commit closes the gap.

Test 1: rewriteSqlToRaw — semantic names inside single-quoted literals
  - 'klappy://sources/scientific-method' must not have method → blob2
  - SQL doubled-quote escape ''  must keep word inside literal preserved
  - Mixed case: column ref outside literal still rewrites; same word
    inside a literal stays untouched

Test 2: detectRawSlotNames — raw slot names inside literals do not
        trigger rejection
  - 'https://example.com/blob1/readme' must not be falsely rejected
  - 'klappy://reports/double5-summary' likewise
  - Sanity guard: bare blob1 outside any literal STILL gets rejected
  - Mixed case: raw slot outside a literal is rejected even when
    another raw slot appears inside a literal in the same query

All 17 tests pass locally:
  17 passed, 0 failed
  (was 15 — added 2)

This addresses the test-coverage gap I noted in the PR review, not
a code defect — the fixes themselves are correct and these tests
verify they hold.
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.

2 participants