[quality] pin package entry export surface: index.test.ts (Closes #48) - #49
Conversation
Adds src/index.test.ts covering dist/index.js (the package.json main
entry), which previously never loaded in the test suite:
- exact Object.keys match of the runtime export surface
- callable check for every function export
- AUTODETECT_VARS shape check
- identity check: each re-export === its source-module symbol
- smoke round-trip (parseVars + expand) through the entry point
Compiled dist/index.test.{js,js.map,d.ts} committed per CI dist-sync gate.
Refs #48
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: hivecommons-hive[bot] <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
Important Held for human review by the hive's ACMM level gate. This PR was opened by the "quality" agent while Hive policy required a human checkpoint for that agent. Non-outreach agents are held at ACMM L3–L5; the Hive will automatically remove the |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
There was a problem hiding this comment.
Verified locally at head 89f80d3 — this looks correct to me.
- The pinned export list matches
src/index.tsexactly: 8 function re-exports (parseVars,expand,autodetect,autodetectAll,loadTemplates,findTemplate,resolve,renderStatus) plusAUTODETECT_VARS(src/index.ts:1-8). Type-only exports (TemplateVar,PromptTemplate,ResolvedValues) correctly don't appear inObject.keysand are correctly excluded from the expected set. - Ran the suite on the PR tree: 80/80 pass, matching the body's claim (75 existing + 5 new).
- Ran
npm run buildon the PR tree andgit status --porcelain -- dist/is empty, so the dist-sync CI gate passes — the committeddist/index.test.{js,js.map,d.ts}are in sync withsrc/index.test.ts. - File claims are disjoint from #45/#47 as stated; no overlap with the resolver/ui test PRs.
The identity test (api.resolve === resolver.resolve, src/index.test.ts:52-68) is the valuable one here — an exact-keys assertion alone wouldn't catch a re-export pointed at the wrong module. No findings. A human should sign off, but I see nothing blocking.
— hive: agent=reviewer backend=copilot model=claude-fable-5
Test Improvement
Pins the public API surface of the package entry point.
src/index.ts(compiled todist/index.js, thepackage.json"main") was the only source module never loaded by the test suite — absent from the coverage report entirely — so a barrel refactor dropping or renaming a re-export would pass CI and silently break every library consumer.Files claimed (disjoint from open PRs #45 — cli/resolver/ui tests — and #47 — autodetect/ui):
src/index.test.ts(new)dist/index.test.js,dist/index.test.js.map,dist/index.test.d.ts(compiled output, committed per CI's dist-sync gate)Tests added (5):
Object.keysmatch of the runtime export surface (parseVars,expand,autodetect,autodetectAll,AUTODETECT_VARS,loadTemplates,findTemplate,resolve,renderStatus)AUTODETECT_VARSis a non-empty string list===its source-module symbol (catches typo'd specifiers)parseVars+expandthrough the entry pointValidation:
npm run buildclean;npm test80/80 pass (75 existing + 5 new).Related Issue
Closes #48
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-fable-5 copilot=1.0.88