Repository navigation
Compute review fixes A: money loops and silent failures - #2070
Merged
neuromechanist merged 24 commits intoNov 7, 2026
Merged
neuromechanist merged 24 commits into
neuromechanist merged 24 commits into
Conversation
📦 Package PreviewYour package is ready to test! bun install -g nemar-cli@PR2070Version: 🤖 Updated on each push. |
…core' into fix/compute-review-money-failures
neuromechanist
merged commit Nov 7, 2026
f7ae5dd
into
feature/issue-2005-epic-compute-core
27 checks passed
8 of 9 tasks
This branch was previously deployed
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.
Review fixes of the three-reviewer review of #2063 (epic #2005): money loops and silent failures in the compute services (implementer A). One commit per item, a test per item through the entry point, a mutation run per behavior fix. The route, reporting, status, holds, CLI and contract files are the other implementer's and are not touched.
Items
result_upload_failed,result_verification_failed,tapis_record_lost, anyfailedjob withcharged_milli > 0) count toward the 7-day cooldown and 3-failure cap; early uncharged platform failures stay immediate candidates.fetchthrow that proves nothing left the Worker (the runtime's subrequest-limit message) retries on a later tick; every other throw staysoutcome_unknown. The runtime gives no code or class for the refusal, only its message, so the match is a closed message list and says so (comment and ADR); the tick stops claiming after one.needsPersoninlivemode only when the last page still held a live job (liveMayHide);weekunchanged.compute_gateway_users;no_gateway_useris now reachable for account-less partner jobs.records/andlogs/prefixes; tested with a hold placed by the bucket's own delete.driveCancelandretryOrphanCancelreturn an outcome; the sweep countscancel_failed, logs at error level, and carriescancel_pending_failed.unknown_status, logged shortened and stripped, ages tounreported.tapis_record_lost(owner decision 1): see below.copy_abandoned: rows past the 3-day retry window are flaggedmismatchonce and counted, error level;countCopyAbandonedis the running total.repairedvsrepair_attempted(repairTerminalreports the real outcome), pure tests for both builders.cancelOrphanclears only on 409 or a 404 confirmed by a read; 408 and 3xx map tounavailable(submit with 408 and 302 tested; 400, 405, 409 stayrejected).sync_laterandsync_failedcounted (later,erroredonSyncResult;synced_laterandsynced_erroredin the dispatch line). Kept separate fromfailedso that field still means "stamps ended failed"; the effect on the line is the same.policy_unavailable(503), a new refusal code, notcompute_disabled.mintResultLinkskeepsresults_expired(no distinct word is declared; noted in the ADR).legal_holdcolumn annotated; migration 0115 comment corrected (comment only;bun run migrations:d1-checkpasses).tapis_record_lost(owner decision 1)Declared once, in
PLATFORM_FAILURE_CODES(shared/compute-state.ts), soCOMPUTE_FAILURE_CODESandisPlatformFailurefollow; the unit test lists are updated. A live NEMAR row endsfailedwhen its last good read is more than 7 days old and a read fails again, or when a recorded cancel answers 404 and its read-back answers 404. The hold is released with no charge through the existing release statement and gate, the row is flaggedmismatch, the row leaves the live states, and a pipeline stamp fails with the same word (counted toward the cooldown). Recovery before 7 days, a second tick, and exactly-one release are tested.Fields for the CLI and status (other implementer)
cancel_failed,cancel_pending_failedon the cancel sweep result;countCancelPendingFailed(db)andCANCEL_PENDING_FAILED_SQLincompute-lifecycle.tsfor the status view.copy_abandonedon the tick result;countCopyAbandoned(db)andCOPY_ABANDONED_COUNT_SQL; abandoned rows carry themismatchflag.unknown_status,repair_attemptedon the tick result;synced_later,synced_erroredin the dispatch line.tapis_record_lostfailure word;policy_unavailablerefusal code.GET /admin/compute/pipeline/status(item 16): "This GET writes: it syncs the pipeline stamps before it reads, an idempotent write that touches only stamps, and read-only maintenance mode lets it through because it is a GET."Tests
Targeted, one file at a time, all green: compute-pipeline-queue (30), compute-pipeline (58), compute-pipeline-dispatch (45), compute-pipeline-verify (5), compute-lifecycle (116), compute-lifecycle-submit (35), compute-lifecycle-rotation (11), compute-sweep (43), compute-access-reporter (47), compute-access-reports (9), compute-retention (39), compute-job-callbacks (35), tapis-client (176), compute-advance-log-lines (9), compute-source-scan (4), cron-sweep-wiring (209), cron-dev-safety (70), compute-jobs-admin-routes (7), compute-e2e (3), compute-pipeline-routes (36), compute-reporting-routes (20), compute-results-routes (17), compute-end-callers (15), compute-full-path (3), compute-lifecycle-money (11), compute-release-cascade (20), compute-webhook (16), compute-status-route (21), compute-route-inventory (5), and
test/compute-state.unit.test.ts(59). The full suite was not run.bun run lint,bun run typecheckandbun run migrations:d1-checkpass on the head.Mutation checks
Each run replaces one expression in the source, runs the named test file, and restores it; the named test failed every time.
PLATFORM_FAILURE_CODES.filter(...)toPLATFORM_FAILURE_CODES) and the charged-job term (cj.state = 'failed' AND cj.charged_milli > 0to0):compute-pipeline-queue, 1 fail each.throwedBeforeSend(err) ? "not_sent" : nulltonull; stop-claiming condition withoutnot_sent:compute-access-reporter, 1 fail each.liveMayHide = false:compute-sweep, 1 fail each.closeRow, and the pseudonym subselect:compute-sweep, 1 fail each.isHeld:compute-retention, 1 fail.failedoutcome topending; level alwaysinfo; stop counting:compute-lifecycle, 1 fail each.markUnreportedIfStalecall; drop the strip; drop the slice:compute-lifecycle, 1 fail each.compute-lifecycle, 1 fail each.repair: "finished"always; dropunreachablefrom warn; drop error level; drop a counter; dropcancel_failedfrom loud:compute-advance-log-linesandcompute-lifecycle, fails each.rejectedornot_foundas settled; drop the read confirmation (compute-lifecycle-rotation); map 408 and 3xx torejected(compute-lifecycle): fail each.compute-pipelineandcompute-pipeline-dispatch, fail each.compute_disabled:compute-job-callbacks, 1 fail.Note for the run: when a test in
compute-access-reporterfails with the stand-ins up, the process can fail to exit, so a mutation run there needs a timeout.Not verified
Whether ACCESS ignores a duplicate report (so the unknown cases stay unknown), what the launcher does with
policy_unavailable, and whether Tapis ever answers 404 for a record that exists are unverified; each is stated in ADR 0118.