Skip to content

Compute review fixes A: money loops and silent failures - #2070

Merged
neuromechanist merged 24 commits into
feature/issue-2005-epic-compute-corefrom
fix/compute-review-money-failures
Nov 7, 2026
Merged

neuromechanist merged 24 commits into
feature/issue-2005-epic-compute-corefrom
fix/compute-review-money-failures

Conversation

@neuromechanist

Copy link
Copy Markdown
Contributor

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

  • 1 Pipeline queue: failures after consumed units (result_upload_failed, result_verification_failed, tapis_record_lost, any failed job with charged_milli > 0) count toward the 7-day cooldown and 3-failure cap; early uncharged platform failures stay immediate candidates.
  • 2 ACCESS report: a fetch throw that proves nothing left the Worker (the runtime's subrequest-limit message) retries on a later tick; every other throw stays outcome_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.
  • 3 Tenant sweep: a cut listing raises needsPerson in live mode only when the last page still held a live job (liveMayHide); week unchanged.
  • 4 Tenant sweep owes the ACCESS report: batch enqueue at the index write and at the close, pseudonym copied from compute_gateway_users; no_gateway_user is now reachable for account-less partner jobs.
  • 5 Observer run spent before rows stored: documented (ADR) with the manual re-mint path. No signal added: the observer-runs listing is in a file the other implementer owns.
  • 6 Retention stage 1 reads the hold between the records/ and logs/ prefixes; tested with a hold placed by the bucket's own delete.
  • 7 driveCancel and retryOrphanCancel return an outcome; the sweep counts cancel_failed, logs at error level, and carries cancel_pending_failed.
  • 8 Unknown Tapis status: counted as unknown_status, logged shortened and stripped, ages to unreported.
  • 9 tapis_record_lost (owner decision 1): see below.
  • 10 copy_abandoned: rows past the 3-day retry window are flagged mismatch once and counted, error level; countCopyAbandoned is the running total.
  • 11 Tick and cancel log lines: warn on unreachable, repaired vs repair_attempted (repairTerminal reports the real outcome), pure tests for both builders.
  • 12 cancelOrphan clears only on 409 or a 404 confirmed by a read; 408 and 3xx map to unavailable (submit with 408 and 302 tested; 400, 405, 409 stay rejected).
  • 13 sync_later and sync_failed counted (later, errored on SyncResult; synced_later and synced_errored in the dispatch line). Kept separate from failed so that field still means "stamps ended failed"; the effect on the line is the same.
  • 14 Policy read fault on the outputs route is policy_unavailable (503), a new refusal code, not compute_disabled. mintResultLinks keeps results_expired (no distinct word is declared; noted in the ADR).
  • 15 Unwired code and the unused legal_hold column annotated; migration 0115 comment corrected (comment only; bun run migrations:d1-check passes).
  • 16 Documented in ADR 0118 only; the route header is in a file the other implementer owns.
  • Owner decision 2 (10,000 subrequest limit, no restructuring) recorded in ADR 0118.

tapis_record_lost (owner decision 1)

Declared once, in PLATFORM_FAILURE_CODES (shared/compute-state.ts), so COMPUTE_FAILURE_CODES and isPlatformFailure follow; the unit test lists are updated. A live NEMAR row ends failed when 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 flagged mismatch, 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_failed on the cancel sweep result; countCancelPendingFailed(db) and CANCEL_PENDING_FAILED_SQL in compute-lifecycle.ts for the status view.
  • copy_abandoned on the tick result; countCopyAbandoned(db) and COPY_ABANDONED_COUNT_SQL; abandoned rows carry the mismatch flag.
  • unknown_status, repair_attempted on the tick result; synced_later, synced_errored in the dispatch line.
  • tapis_record_lost failure word; policy_unavailable refusal code.
  • Route header sentence for 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 typecheck and bun run migrations:d1-check pass 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.

  • 1: drop the filter of consumed words (PLATFORM_FAILURE_CODES.filter(...) to PLATFORM_FAILURE_CODES) and the charged-job term (cj.state = 'failed' AND cj.charged_milli > 0 to 0): compute-pipeline-queue, 1 fail each.
  • 2: throwedBeforeSend(err) ? "not_sent" : null to null; stop-claiming condition without not_sent: compute-access-reporter, 1 fail each.
  • 3: raise on every cut; liveMayHide = false: compute-sweep, 1 fail each.
  • 4: remove the enqueue from the index batch, from closeRow, and the pseudonym subselect: compute-sweep, 1 fail each.
  • 6: remove the second isHeld: compute-retention, 1 fail.
  • 7: failed outcome to pending; level always info; stop counting: compute-lifecycle, 1 fail each.
  • 8: drop the markUnreportedIfStale call; drop the strip; drop the slice: compute-lifecycle, 1 fail each.
  • 9: disable the week rule; disable the double-404 rule; charge instead of release; drop the word from the consumed list: lifecycle and queue tests, 1 fail each.
  • 10: move the boundary a day; drop copy_abandoned from the error condition: compute-lifecycle, 1 fail each.
  • 11: repair: "finished" always; drop unreachable from warn; drop error level; drop a counter; drop cancel_failed from loud: compute-advance-log-lines and compute-lifecycle, fails each.
  • 12: restore rejected or not_found as settled; drop the read confirmation (compute-lifecycle-rotation); map 408 and 3xx to rejected (compute-lifecycle): fail each.
  • 13: drop either counter; drop the errored error level: compute-pipeline and compute-pipeline-dispatch, fail each.
  • 14: answer compute_disabled: compute-job-callbacks, 1 fail.

Note for the run: when a test in compute-access-reporter fails 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.

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

📦 Package Preview

Your package is ready to test!

bun install -g nemar-cli@PR2070

Version: 0.10.28-PR2070.f38b240
Commit: f38b240


🤖 Updated on each push.

@neuromechanist
neuromechanist merged commit f7ae5dd into feature/issue-2005-epic-compute-core Nov 7, 2026
27 checks passed
@neuromechanist
neuromechanist deleted the fix/compute-review-money-failures branch November 7, 2026 04:34

This branch was previously deployed

1 inactive deployment
npm — f38b2408 Deployed Nov 7, 2026 by neuromechanist via publish #4299
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