Repository navigation
refactor(go)!: one lease lifecycle, pack and refusals from core, framework OWNERS (XWING-2234) - #46
Merged
Merged
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: smith-xyz The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
…rom core; Prow OWNERS for the framework
smith-xyz
force-pushed
the
refactor/ops-lanes
branch
from
October 29, 2026 20:37
89353d5 to
15d5042
Compare
smith-xyz
marked this pull request as ready for review
October 29, 2026 20:38
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.
What
Fix-forward on #44 / #45 (queued fleet runner) and #38, toward the SDK as one framework with clear lanes. Draft for Shaun's review.
flowchart LR subgraph ops["v1/ops"] RU[Runner<br/>claim · pinned pack · command] --> L[lease<br/>heartbeat · lease loss · complete] RR[RecordingRun<br/>start · prepare · record] --> L P[Pack<br/>schema from core · digest · command] RU --> P end L -->|api.Decode| API[v1/api<br/>generated client] RU -->|GetOrderManifest| APIRunnerbuilt throwawayRecordingRuns to call their privateheartbeat/superviseLease/completelease.go: onelease(hold,renew,run,complete) and a genericsuperviseboth runs use; nothing else heartbeats or completes. #45's supervised manifest read keeps working through itGetOrderManifest(traust-core#295); exactly onepack:<name>entry with this pack's digestPACK_SCHEMA_REFmake api-generatefrom the contracts core itself validates packs with, atCORE_REF; one pin for everything coreNewRunnerPack.command(asset)owns "fleet-wide,{run_id}only";command.resolve(runID)*stringwith free text ("pack version mismatch"was not in the vocabulary, and core stored it)*api.RunOrderReason, core's closed vocabulary, namespaced constants (api.RunOrderReasonBadRequest)ops.nativeResponseduplicatedapi.problemFromResponse;CheckResponsewrappedcheckResponseapi.CheckResponseand one genericapi.Decode(resp.HTTPResponse, resp.Body, resp.JSON200)EachProduct/EachRepositorycopy-pastedeache2e-runnercopied the server boot, wasn't in CI, seeded withseed_order.pyimporting core's Python servicesmake e2e(already in CI): a person submits overPOST /v1/orderswith the pack digest, the runner claims, checks the manifest, runs the command, completesAGENTS.mdpack.schema.jsontraust-admins, soCODEOWNERSwas bypassed by the merge botOWNERSapprovers =sdk-framework(@smith-xyz, @chubirka); team approves frozen packages, the regenerated client, tests inv1/api, andgo/README.md/CHANGELOG.md/VERSIONStacked
CORE_REFpins traust-core#295 (d06d3af). Merge that first; re-pin if it changes.Behaviour changes
ops.RecordingRuncompletes failed without recording when the executor returns an unknown outcome (before: recorded, then core rejected the outcome at complete).bad_request(was free text"pack version mismatch"). A dedicatedpack-mismatchvalue would be a contracts change.Open, for review
Runnercompletes an executor failure withrunner-crashed;RecordingRuncompletes it with no reason (its tests require that). One rule for both?ops.ProcessExecutor(argv, no shell, process-group kill) would save every consumer writing the e2e test's executor; not added here.enforce_adminsondevelopment(feat(api): regenerate clients from core development (onboarding door) #38 merged with no review by an admin).Changed tests
Rebased on #45; its tests are the base and all pass against the new lease (slow manifest read renews, lease loss cancels the read, pre-execution heartbeat failure keeps the order, 204 and typed 503 manifest failures, descendant kill).
go/v1/ops/runner_test.gofake server/v1/artifacts/{id}/contentwith{"artifact":"run-manifest","config":[…]}→/v1/orders/{id}/manifestwithapi.OrderManifest; added amanifestoverride fieldTestQueuedRunnerDoesNotExecuteMalformedManifest{"artifact":"wrong"}→{"config":(truncated JSON)artifactfield; malformed now means undecodablerunner_e2e_test.go::TestE2ERunnerLedgerAuditTRAUST_E2E_PACK/_PYTHON/_CONFIG_HOME, which nothing sets, so it never ranrunner_e2e_test.go::TestE2ERunnerLocalCommand→TestE2ERunnerRunsASubmittedPackCommandseed_order.pyviamake e2e-runner→ submitted by a person over REST inmake e2e, executorprocessExecutoron #45'sprocessGroupCommandrunner_e2e_test.go::TestE2ERunnerLocalCommandStopsDescendantsOnLeaseLossmake e2e(CI)e2e-runnerwasn't in CIgo/v1/api/e2e_test.gocheckResponse(...)→Decode(...)New:
TestDecode,TestPackCommandRunsOnlyFleetWideAssets,TestCommandResolvesRunID,TestQueuedRunnerRefusesAnOrderNotPinnedToExactlyItsPack,TestUnknownExecutorOutcomeCompletesFailedWithoutRecording. Every existingrecording_test.gotest passes unchanged.Checks
make lint test security guardrails,go test -race ./v1/ops ./v1/apimake -C go check-driftmake e2e(6 tests against cored06d3af)go test -race -count=3 ./v1/ops