ci: gate paybot-sdk on npm test (closes #4)#35
Conversation
Wire vitest run into the build matrix between type-check and build, across Node 18 + 20. paybot-sdk auto-publishes to npm on every push to main; before this change CI never ran the test suite, so code could ship to customers without its own tests ever executing. Test suite: 102 tests / 7 files in tests/, vitest.config.ts scoped to tests/**/*.test.ts. Local: 102/102 pass in 1.72s. Not in this PR (deliberately split per Orion routing during Phase 1 discovery): - Task #14: dual-mode dead-code bug in src/x402-v2.ts:251 (no-dupe-else-if surfaces it; requires semantic decision on what dual-mode should emit — separate @dev story) - Task #15: coverage gate at 80% threshold + tests for x402-v2.ts and payment-engine.ts (currently 0% covered, 805 LOC combined) - Task #16: coverage/ gitignore hygiene No change to required_status_checks contexts: the new step runs inside the existing build (18) + build (20) matrix entries, adding substance without adding new context names. 5th application of automated-pr-merge-authority.md.
|
Note Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe CI workflow adds a test execution step to the ChangesCI Test Execution
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Merge authorization per .claude/rules/automated-pr-merge-authority.md (5th application, paybot-sdk track):
Closes Task #4. Out-of-scope discoveries split:
Precedent chain (today, 2026-05-22):
This is the 7th merged PR in the paybot ecosystem in a single day. |
Summary
Gap: paybot-sdk auto-publishes to npm on every push to
main, but CI runs onlynpm ci→npm run type-check→npm run build. The test suite never executes in CI, so code can ship to consumers without its own tests ever running.Fix: Wire
npm test(vitest) into the existingbuildmatrix as a new step betweentype-checkandbuild, across the Node 18 + Node 20 matrix entries. Three-line additive change in.github/workflows/ci.yml.Tasks closed
npm testto paybot-sdk CIDiscovered during Phase 1, split into separate tasks
Phase 1 discovery revealed that wiring
npm run lintin the same PR is not viable today: lint surfaces a real pre-existing semantic bug insrc/x402-v2.ts:251(no-dupe-else-if). The fix is not a chore — it requires deciding whatdual-mode insignPaymentV2should actually emit. Routing this through@devopsas part of a CI-wiring PR violates scope discipline. Coverage gate is a third, separable concern. Filed as:no-dupe-else-ifinsrc/x402-v2.ts:251(dual-mode dead branch). Theprotocol === 'dual'clause is unreachable because line 163'sif (protocol === 'x402' || protocol === 'dual')catchesdualfirst. The line-251 block intended a distinct dual-signature path. Semantic decision required → separate@devstory.vitest.config.tsbut only fires onnpm run coverage). Requires writing tests forsrc/x402-v2.ts(0% / 457 LOC) andsrc/payment-engine.ts(0% / 348 LOC). Currently 54.25 % vs 80 % threshold.coverage/gitignore hygiene (defer to a future bundle).Local verification
vitest.config.tsis scoped toinclude: ['tests/**/*.test.ts']— no risk of picking up stray*.test.tsfiles undernode_modules/. Coverage thresholds (80/80/70/80) are configured but fire only under--coverage, not undernpm test, so this PR does NOT introduce a coverage gate. Coverage gating is Task #15.Required status checks impact
None. The new step runs INSIDE the existing
build (18)+build (20)matrix entries, so context names stay identical:build (18),build (20),Analyze (javascript-typescript),scan / osv-scanbuild (18)+build (20)now have substance (test execution) beyond compile-only validation.required_status_checks.contextsin branch protection requires no change. The check names emitted by GitHub Actions are matrix-derived and do not include step names.Chain governance
5th application of
automated-pr-merge-authority.md. Pre-approval pattern in effect: this PR was routed by@aiox-master(Orion) after a Phase 1 discovery escalation where Branch B was hit (tests pass, lint fails on bug). Orion's Option 1 ruling: ship test-only now, lint deferred to Task #14.Chain composition for this PR (chore CI carve-out, paybot-core PR #3 precedent):
@sm,@po,@dev— SKIP (no story, no AC, operator-routed Phase 1 by Orion)@aiox-master(Orion) — ROUTED (this comment is the routing artefact; full Phase 1 discovery report lives in.aios/handoffs/andaios-devopsmemory)@qa(Quinn) — pending PASS on adapted 12-check matrix@devops(Gage) — pending merge after@qaPASSPer the pre-approval pattern,
@qaPASS will route directly to@devopsfor merge without re-confirming with operator.Anti-patterns avoided
N/A — clean additive 3-line change. No new actions introduced, no new permissions required, no new contexts emitted, no SHA-pinning needed (no new
uses:directives). No coverage gate snuck in. No bundled lint wire-up that would have failed on the unrelated pre-existing bug.Phase 1 escalation transparency
The lint failure could have been silently ignored or masked with
continue-on-error: true. Both are anti-patterns: the first hides the gap, the second adds noise to CI without enforcement. Escalating to Orion with options and accepting the split into three tasks is the disciplined path. Audit trail of that escalation is preserved inaios-devopsmemory atproject_paybot_sdk_task4_phase1_20260522.mdin AIOX-Enterprise.Summary by CodeRabbit