idstack icon indicating copy to clipboard operation
idstack copied to clipboard

Test coverage gaps left by the closed May/June PR batch

Open savvides opened this issue 3 months ago • 2 comments

Four gaps found while triaging the Jules PRs. Each PR was closed for a specific defect, but the coverage they were reaching for is genuinely missing. Ordered by whether a regression would be caught today.

1. bin/idstack-gen-skills target isolation (from #52). Nothing asserts that --target claude leaves dist/codex/ and AGENTS.md untouched. If render_codex_assets escaped its guard at bin/idstack-gen-skills:212-214, AGENTS.md would still be a byte-identical copy of templates/agent-context.md, so both smoke-test.sh:362 and the :353 dry-run gate stay green. Silent regression today. Fix: two check lines near integration-test.sh:162, plus one for --target bogus exiting 2 (:50-53).

2. bin/idstack-slugify stdin (from #51). Both the implicit branch (:42) and explicit - (:35) are documented at :20 and untested. The emoji case is the only input reaching .encode("ascii","ignore") at :51. Re-land those assertions with #51's deadlocking pty test dropped.

3. bin/idstack-migrate:84 (from #53). The || { cat "$MANIFEST"; exit 0; } fallback on a malformed manifest is exercised by nothing. One assertion, folds into the existing block at smoke-test.sh:311-350.

4. Comment fix, bin/idstack-learnings-delete:4. Says "Exit 0 always" while :9, :12 and the sys.exit(1) at :38 all exit 1. Fix the comment, not the code — skills/learn/SKILL.md:389 depends on the nonzero exit to avoid reporting success on a no-op.

Larger coverage gaps (idstack-doctor, idstack-status --readiness) stay tracked on open PRs #55 and #54.

savvides avatar Aug 06 '26 00:08 savvides

Two of these are now closed by #65 (shipped in v3.3.0.4):

  • ~~bin/idstack-doctor execution coverage~~ — done, test/test-doctor.sh, 13 cases
  • ~~bin/idstack-status --readiness~~ — done, test/test-status.sh, 22 assertions including per-threshold boundaries and the WCAG Level-A override

The --readiness caveat noted when this was filed is resolved: the coverage now probes each threshold at its own boundary with the other two held passing, so a single wrong constant is caught, and the Level-A override is asserted in both places it's implemented.

Still open, all small:

  1. bin/idstack-gen-skills target isolation — nothing asserts --target claude leaves dist/codex/ and AGENTS.md untouched. Still a silent regression today.
  2. bin/idstack-slugify stdin — both the implicit branch (:42) and explicit - (:35), documented at :20, untested.
  3. bin/idstack-migrate:84 cat-fallback on a malformed manifest — one assertion.
  4. bin/idstack-learnings-delete:4 says "Exit 0 always" while :9, :12 and :38 exit 1. Fix the comment, not the code — skills/learn/SKILL.md:389 depends on the nonzero exit.

savvides avatar Aug 06 '26 11:08 savvides

All four items are done:

  1. gen-skills target isolation: no longer applies. 6bf1eeb removed --target, dist/ and AGENTS.md, and smoke-test asserts that neither exists. #127 adds a check that an unknown argument exits 2.
  2. slugify stdin and emoji: 907cd40.
  3. migrate malformed-manifest fallback: 907cd40.
  4. learnings-delete exit comment: fixed when 0606b11 folded the script into bin/idstack-learnings.

savvides avatar Nov 01 '26 18:11 savvides