Repository navigation
test(gateway): re-enable 6 CI-excluded money-path suites (#322) - #246
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
packages/gateway/vitest.config.tshad excluded 6 test suites from CI since Apr 8 (commit18db03fc, to unblock a Railway deploy) after a facade rewrite changed route behavior — including the money-pathsettlement.test.tsandpaid-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=settledand escrowfundedare 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 droppedkernel.capabilitiesDTO alias.Commits
fix(gateway): restore dropped kernel.capabilities backward-compat alias—populateKernelDTO()carried a comment documenting acapabilitiesfield aliasingcapabilityTypes("dashboard + tests use kernel.capabilities"), but the field had been dropped in a prior edit (comment left pointing atreputation).GET /api/kernels+/api/kernels/:idstopped returningkernel.capabilities— a dashboard-facing regression. Restored + declared optional onKernelDTO. Non-money-path.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/releasere-verify it on-chain viaPCCProtocol.collectFeeWithAttestation). Added the in-repomkAttestationfixture (mirrorssettlement-telemetry.test.ts); pass it on every release/auto-release; routed the release-route tests' workflow store to:memory:. Facade now returns structured 404 codeSETTLEMENT_NOT_FOUND.paid-job-flow.test.ts (4) — (a) fresh jobs are
queuedon a control-plane gateway with no local kernel (SEAM-1 remote-operator routing; escrow stillfunded); (b) negotiation now gates on the kernel actually offering the capability, so the test uses the seeded liquid-handler kernel; (c) scopes deliberately stayactiveafter completion (revoked at expiry, not on complete — documented inpaid-job-flow.ts); (d) job detail exposes evidence via the route's top-levelevidencearray. SuitetestTimeoutraised for the I/O-heavy/completepath.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;kernelIdis schema-required -> generic 400Bad Request.routes.test.ts (4) —
kernel.capabilitiesrestored by commit 1; registry is legitimately empty without an agent-identity seed (assert shape, not seeded counts;averageReputationis server-sidenullby design);/api/auth/sessionsis 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
8ed80da9/ fix(gateway): settlement_failed session status + safe retry/cancel for stuck commits #245 — clean, no conflicts).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+csdpass in isolation,v2varies 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