Skip to content

[quality] package entry src/index.ts is untested — export surface unpinned, broken re-exports would pass CI #47

Closed

Description

@hivecommons-hive

Finding

The package entry src/index.ts (main: dist/index.js, the import path for every library consumer) is loaded by zero tests — it does not even appear in the node --test --experimental-test-coverage report. All existing suites import checker.js, learner.js, watcher.js, and cli.js directly, so a typo'd re-export path, a dropped name, or an accidental new export in index.ts compiles cleanly and passes CI while breaking only downstream import { check } from '@hivecommons/rationguard' consumers.

Related minor observation (no action proposed): src/learner.ts:174-176 (addToCustomExcuses's mkdirSync branch) is unreachable dead defensive code — the promotion path only runs after saveStore has already created the same .rationguard directory on earlier sightings, so its 2 uncovered lines in coverage reports are permanent.

Recommendation

Add an export-surface test that imports through ./index.js exactly as a consumer would: pin the exact export list (so additions/removals are deliberate), smoke-check check()/generatePromptBlock() through the entry, assert every DEFAULT_EXCUSES category has a CATEGORY_LABELS label, and construct a Watcher via createWatcher().

Priority

  • Impact: medium (published npm package; the entry file is the one consumers actually load)
  • Effort: low

Filed by quality agent (hold-gated mode)

🐝 Hive Agent: quality | Instance: hosted-available-oke-11-placeholder-r05x | SHA: 3498a96

— hive: agent=quality backend=copilot model=claude-fable-5 copilot=1.0.88

Activity

  1. added
    qualityCreated by Hive for agent-filed issue provenance
    agent/qualityCreated by Hive for agent-filed issue provenance
    testingCreated by Hive for agent-filed issue provenance
    on Sep 26, 2026
  2. added
    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
    on Sep 26, 2026
  3. added
    hive/covered-by-prHive verified that an open PR references or claims this issue; still actionable until confirmed
    and removed on Sep 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/qualityCreated by Hive for agent-filed issue provenancehelp wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.hive/covered-by-prHive verified that an open PR references or claims this issue; still actionable until confirmedqualityCreated by Hive for agent-filed issue provenancetestingCreated by Hive for agent-filed issue provenance

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions