Skip to content

test(gateway): re-enable 6 CI-excluded money-path suites (#322) - #246

Merged
LamaSu merged 2 commits into
masterfrom
test/reenable-ci-excluded-suites
Jul 11, 2026
Merged

LamaSu merged 2 commits into
masterfrom
test/reenable-ci-excluded-suites

Conversation

@LamaSu

@LamaSu LamaSu commented Jul 11, 2026

Copy link
Copy Markdown
Owner

Summary

packages/gateway/vitest.config.ts had excluded 6 test suites from CI since Apr 8 (commit 18db03fc, to unblock a Railway deploy) after a facade rewrite changed route behavior — including the money-path settlement.test.ts and paid-job-flow.test.ts. They no longer gated merges (coord #322). This PR un-excludes all 6 and gets them green.

Headline: the money-path suites are now SAFE to gate CI. Re-enabling surfaced NO money-path product bug — every failure was a stale test asserting the old pre-rewrite behavior. All 22 failures across the 6 suites were triaged; none was a settlement/escrow/tier defect. No money-path assertion was weakened — settlement txHash/settled/released/job=settled and escrow funded are asserted unchanged; the fixes ADD the now-required inputs and match new codes.

The one real (non-money-path) regression re-enablement caught is fixed in a separate, clearly-labeled fix(gateway): commit (not bundled into the test changes): a dropped kernel.capabilities DTO alias.

Commits

  1. fix(gateway): restore dropped kernel.capabilities backward-compat alias — populateKernelDTO() carried a comment documenting a capabilities field aliasing capabilityTypes ("dashboard + tests use kernel.capabilities"), but the field had been dropped in a prior edit (comment left pointing at reputation). GET /api/kernels + /api/kernels/:id stopped returning kernel.capabilities — a dashboard-facing regression. Restored + declared optional on KernelDTO. Non-money-path.
  2. test(gateway): re-enable 6 CI-excluded money-path suites (#322) — the un-exclude + stale-expectation updates below.

Per-suite triage (all TEST-SETUP unless noted)

settlement.test.ts (8) — Release now requires an oracle-signed OracleAttestation (a security hardening: SettlementService.releaseMilestone + POST /api/settlement/release re-verify it on-chain via PCCProtocol.collectFeeWithAttestation). Added the in-repo mkAttestation fixture (mirrors settlement-telemetry.test.ts); pass it on every release/auto-release; routed the release-route tests' workflow store to :memory:. Facade now returns structured 404 code SETTLEMENT_NOT_FOUND.

paid-job-flow.test.ts (4) — (a) fresh jobs are queued on a control-plane gateway with no local kernel (SEAM-1 remote-operator routing; escrow still funded); (b) negotiation now gates on the kernel actually offering the capability, so the test uses the seeded liquid-handler kernel; (c) scopes deliberately stay active after completion (revoked at expiry, not on complete — documented in paid-job-flow.ts); (d) job detail exposes evidence via the route's top-level evidence array. Suite testTimeout raised for the I/O-heavy /complete path.

job-submit.test.ts (5) — point the mock KernelService at the submit-target kernel so the local path runs and returns accepted+deviceId as intended (was external -> queued/null); per-test isolation for the now-live execution path; kernelId is schema-required -> generic 400 Bad Request.

routes.test.ts (4) — kernel.capabilities restored by commit 1; registry is legitimately empty without an agent-identity seed (assert shape, not seeded counts; averageReputation is server-side null by design); /api/auth/sessions is now caller-scoped -> 401 unauthenticated.

kernel-populator.test.ts (1) — green via commit 1's alias restore (no test change).

protocol-fixes.test.ts (0) — already green, no change.

Verification

  • All 6 suites green locally, individually and together: 132/132 (rebased onto current master 8ed80da9 / fix(gateway): settlement_failed session status + safe retry/cancel for stuck commits #245 — clean, no conflicts).
  • The full local gateway suite (2225 tests) showed 4 failures in untouched files (v2-settlement-wiring, capability-facade, csd, gateway-evidence-v2) — all timeouts / env-var-dependent from running the whole suite serially on a 16 GB machine; capability-facade + csd pass in isolation, v2 varies run-to-run. Master's own CI is green on all of them, confirming they're environmental, not from this PR (which doesn't touch those files or their code paths).

🤖 Generated with Claude Code

LamaSu and others added 2 commits July 11, 2026 14:34
populateKernelDTO() carried a comment documenting a `capabilities` field
aliasing `capabilityTypes` ("dashboard + tests use kernel.capabilities"),
but the field itself had been dropped in a prior edit — the comment was
left pointing at `reputation`. GET /api/kernels and /api/kernels/:id
therefore stopped returning `kernel.capabilities`, a dashboard-facing
regression. Restore the alias (and declare it optional on KernelDTO).

Surfaced by re-enabling the CI-excluded routes + kernel-populator suites
(#322). Non-money-path.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
vitest.config.ts had excluded 6 suites since Apr 8 (commit 18db03f) after a
facade rewrite changed route behavior — including the money-path settlement.ts
and paid-job-flow.ts. They no longer gated merges (coord #322). Un-exclude all
6 and update the stale expectations to the current (correct, hardened) behavior.
No money-path assertion was weakened — settlement/escrow/tier outcomes are
asserted unchanged; the fixes ADD the now-required inputs and match new codes.

settlement.test.ts (8): release now requires an oracle-signed OracleAttestation
  (SettlementService.releaseMilestone + POST /api/settlement/release re-verify it
  on-chain via PCCProtocol.collectFeeWithAttestation — a security hardening).
  Add the in-repo mkAttestation fixture; pass it on every release/auto-release;
  route the release-route tests' workflow store to :memory:. Facade now returns
  structured 404 codes (SETTLEMENT_NOT_FOUND) instead of "not_found".

job-submit.test.ts (5): point the mock KernelService at the submit-target kernel
  (kernel-nyc) so the local path runs and returns "accepted"+deviceId as intended
  (was external → queued/null); per-test isolation for the now-live execution
  path; kernelId is schema-required → generic 400 "Bad Request".

paid-job-flow.test.ts (4): fresh jobs are "queued" on a control-plane gateway
  with no local kernel (SEAM-1 remote-operator routing; escrow still funded);
  negotiation now gates on the kernel offering the capability (use the seeded
  liquid-handler kernel); scopes deliberately stay active after completion (not
  revoked until expiry); job detail exposes evidence via the top-level `evidence`
  array. Suite testTimeout raised for the I/O-heavy /complete path.

routes.test.ts (4): kernel.capabilities restored by the paired populator fix;
  registry is legitimately empty without an agent-identity seed (assert shape,
  not seeded counts; averageReputation is server-side null); /api/auth/sessions
  is now caller-scoped and returns 401 unauthenticated.

protocol-fixes.test.ts: already green, no changes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@LamaSu
LamaSu merged commit 79c7e09 into master Jul 11, 2026
5 checks passed
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.

1 participant