Skip to content

Phase A8: Revocation cascade and ACCESS gateway attribution - #2046

Merged
neuromechanist merged 20 commits into
feature/issue-2005-epic-compute-corefrom
feature/issue-2013-phase8-revocation-cascade-and-access
Nov 5, 2026
Merged

neuromechanist merged 20 commits into
feature/issue-2005-epic-compute-corefrom
feature/issue-2013-phase8-revocation-cascade-and-access

Conversation

@neuromechanist

@neuromechanist neuromechanist commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Phase issue: #2013 (epic #2005). Base: the epic branch. Depends on A5 (#2010, merged). Opus checkpoint requested before merge.

What changed

Ending an account now ends its compute in the same batch as the other credential cascades, and ACCESS is told the pseudonymous gateway user of every Slurm job, once, from a production-only cron. Twenty commits: the four slices the brief names, a by-id revoke test, the ADR and notes and a records-copy test (round 0), nine commits for the Opus checkpoint's round 1, then four for the Sonnet delta's round 2 (both next).

  • Rename the provisional secret ACCESS_GATEWAY_API_KEY to the issue's ACCESS_GATEWAY_ATTRIBUTES_KEY everywhere (bindings, status view, pin tests, toml comment block, notes) and pin ACCESS_RESOURCE_NAME absent from every table of wrangler-sccn.toml. The status view still reports only presence.
  • Migration 0119_compute_access_reports.sql and the Slurm id hook: INSERT OR IGNORE INTO compute_access_reports is written in the batch of BOTH writers of slurm_job_id (the live transition and the terminal transition of applyTapisJob).
  • computeReleaseStatements(userId) in services/compute-release.ts, run by finalizeRevocation and tombstoneUserCascade (two callers; the issue's count).
  • services/access-attributes.ts (sendAccessReport, runAccessReportCron) wired into the 30-minute tick's production block.
  • ADR 0118 amendment (items 1 to 8), implementation notes section 11, owner-action line in the playbook.

Rebase

Rebased onto the epic branch at 405ec3b (the A2 follow-up, #2044) with one force-with-lease push of this branch, so every hash in this PR changed. Three conflicts, all in documents, none in code: the ADR index row (both clauses kept, the follow-up's first) at two of this PR's commits, and implementation-notes.md section 7 once (the follow-up's budget semantics kept word for word, with this PR's frozen sentence in place of the old "has no writer yet" line). The ADR 0118 file merged without conflict: the follow-up's inline superseded markers and amendment paragraph are untouched, this PR's amendment items are not renumbered and nothing was deleted. Re-run after the rebase: typecheck, biome on touched files, migrations:d1-check (pass again, 190 objects, 54 tables), the A8 suites, compute-end-callers, admin-credential-cascade, compute-lifecycle, every compute-ledger* suite, compute-lifecycle-money, compute-pool-routes, the status, CLI and contract suites, adr-index.unit, and two mutations (the compute statements removed from finalizeRevocation: 10 tests fail across the cascade and scan suites; the stop-claiming rule removed: 1 fails).

Round 1 (Opus checkpoint) fixes

One commit each, tests first and watched red, each guarded line mutated alone (table below).

  • Retry classification (Retry only answers that show no processing). Finding 1: a 500, 502 or 504 (a gateway in front of a server that already stored the request), every 3xx (303 is the usual reply to a POST that created something) and 409 (which may mean "already recorded") are no longer retried: they end failed with outcome_unknown and are never resent, like no answer. Only an answer that shows the request was not processed is retried: a 4xx other than 409 (refused), 408 and 429 (busy), 503 (unavailable). An exhaustive test over statuses 100 to 599 holds classifyAnswer to that table, and each class boundary was mutated. The file header, ADR item 5, the README clause and notes section 11 say it (the notes' "any non-2xx means nothing was recorded" was false and is gone). At-most-once for transport unknowns stays (ruling a). Owner action: ask ACCESS whether job_attributes stores one record per (job id, resource); if it does, classifyAnswer is the one function to switch to retry the unknowns.
  • Partner reservations, two commits (Leave partner reservations out of driveCancel, then Leave a partner reservation to its contract). Finding 2: "never reached Tapis" is vacuously true of a source = 'partner' job (NEMAR never writes a launch specification or takes a lease for one). The cascade's SQL cancel, release and stamp now carry source <> 'partner' and its intent statement skips a partner reservation with no Tapis job; A5's driveCancel returns before it can end one, and CANCEL_ROWS_SQL leaves such a row out (like CREATED_ROWS_SQL) so it cannot hold a sweep slot for ever. This is a small A5 change with its own tests in compute-lifecycle.test.ts. A partner job that HAS a Tapis job is still cancelled there. The cascade test covers a reservation, a bound partner job and two already-cancelled unsettled reservations (one with an open hold, one released), and the docblock says so.
  • Same batch (Pin compute to the credential batch). Finding 3: for each caller, a trigger makes one compute statement abort; the test asserts sessions, the mask (tombstone), compute and the pool freeze are all unchanged and the account is still approved, drops the trigger, retries, and asserts all ended. On bun:sqlite and on Miniflare's D1. Mutated: a second db.batch for compute in finalizeRevocation, and in tombstoneUserCascade.
  • Status and log (Report the ACCESS resource name and log waits). Finding 4: GET /admin/compute/status and nemar admin compute status report resource_name_configured beside key_configured (presence only; optional in the open schema so an older Worker still parses, and the CLI prints "unknown (this Worker does not report it)" then), the CLI says "ACCESS reports wait until both are set", and the tick logs one error-level line whenever any row waits for the key or the resource name. Route, CLI, contract and redaction tests updated.
  • Bounded wait (Bound the wait for a submission time). Finding 5: a row whose record has no scheduler submission time ends failed with no_submit_time seven days after the Slurm id first showed, so A7 lists it and it stops returning to the ten-row window every hour. Tested with time moved in SQL, and both boundaries mutated.
  • The two-caller scan (Hold the two callers to the code by a scan). Finding 6: COMPUTE_END_CALLERS and COMPUTE_END_EXCEPTIONS (the role demotion and the emailed key regeneration, each with a reason) in compute-release.ts, held to the code by compute-end-callers.test.ts on the syntax tree: through aliased and namespace imports, namespace element access, local aliases (including chains and aliases declared before what they copy), destructuring and value-passing uses; a dynamic import, a re-export and a module-level reference are refused as unfollowable; a function counts as satisfied when it runs the set or delegates, at any depth, to one that does; "ends every credential" is found by what the SQL does (including constants and helpers resolved by value), not by name. It does not depend on PR Phase B5: OIDC revocation cascades and back-channel logout #2045. Planted files show each rule fires. One sentence added to AGENTS.md's "Revocation cascades, always" rule, appended after the docs and private caller sentence so a conflict with B5's paragraph is trivial.
  • Tick budget (Stop claiming reports after the tick budget). Finding 7: the tick stops claiming new rows 20 seconds after it starts (ACCESS_REPORT_TICK_BUDGET_MS; injectable clock in the test); unclaimed rows stay pending for the next tick; the tick result and log line count skipped.
  • Docs (Record the round 1 decisions in ADR 0118): ADR items 1, 2, 3, 6, 7, 8, new item 9 and the open points; notes section 11. The key-revocation docblocks (compute-release.ts, docs-auth.ts) now say a stolen key's already-submitted jobs keep running until a cancel or an administrative revoke.

Round 2 (Sonnet delta) fixes

One commit each, tests first and watched red, each guarded line mutated alone.

  • Stop claiming after the first unknown outcome (Stop claiming after the first unknown outcome). Finding 1: the tick kept claiming rows after an outcome_unknown, so a bad minute at ACCESS (a deploy's 502, a 500, a 301 from a wrong address) permanently ended up to ten reports at once. The tick now stops claiming after the FIRST outcome_unknown and counts the rest as skipped (they stay pending, attempts 0, no lease), so a systematic fault loses one report per 30-minute tick and the error-level line has a margin to be noticed in. Tested with a 502, a 500, a 308 and a 409 on every request and with no answer at all (exactly one failed, five pending with attempts 0, and the next healthy tick sends the five); a refused/busy/unavailable retry outcome does NOT stop the tick (503, 429 and 400 each on four rows: all four are retried). ADR item 5 and notes section 11 say it.
  • Persistent refusal logging (Log persistent refusals at error level). Finding 3: a persistent 401, 403 or 404 showed only info-level retry lines for about 79 hours. The tick now counts pending rows with three or more attempts and a retry class (persistent=N, fixed words and counts only) and logs one error-level line on EVERY tick while any exists, whether or not a row is due (the count is taken at the end of every tick, due rows or none). Tested over three refused attempts (info, info, error, and the error line stays on a tick with nothing due), over what does and does not count (two attempts, a sent row, a failed row, no_submit_time, unconfigured), with no key, address or id in the line; mutated: threshold 2 and 4, the class filter, the state filter, the count skipped when nothing is due, the log ignoring it.
  • Widen and scope the credential scan (Widen the credential scan, scope its names). Finding 2. The token rule now accepts user_id equal to a placeholder (?, ?1), IN (...) or a subselect anywhere in the WHERE clause, in either order of the predicates, with the table double-quoted, backtick-quoted, bracketed, schema-qualified or OR-prefixed, in any case; a WHERE clause that also names one key (id, api_key_hash, api_key_prefix, qualified or not) is a one-key revocation and is NOT an end. The session rule also counts DELETE FROM web_sessions WHERE user_id ... (a delete of expired sessions or of one session by cookie is not an end). Every missed shape the reviewer planted, and each shape listed above, is planted and shown caught; the one-key shapes are shown not to be. A helper is now resolved in the module it is imported from (the file's own named, aliased and namespace imports, and its own top-level declarations, through resolveImport), never by its bare name: a helper called a, or one named like revokeDocsCredentials, in another file no longer makes an unrelated function an "end" (planted, and the real tree's result is unchanged). Known limit, documented in the scan's header: a name reached through a barrel file or an object's method is not followed, and SQL assembled from parts the scan cannot fold is not recognised. The three over-promising claims (AGENTS.md, the compute-release.ts header and the COMPUTE_END_CALLERS docblock, ADR item 9 and the notes) now say "through the statement shapes the scan recognises" and name them; the scan is described as a tripwire for the shapes the Worker uses, not a proof. (The mutation that drops the digits of ?\d* is an equivalent mutant: the pattern is a prefix match.)
  • Docs (Record the round 2 points in ADR 0118): the persistent-refusal sentence, the D4 reservation points and the two accepted residuals, in the ADR amendment and notes section 11.

Hook (the issue's "fill #2010's hook")

A5 left an after-commit function (noteSlurmJobId, empty) and not a place inside a batch, and the live write was a single .run(), so there was no batch to add to. I did what the brief allows: the live transition became a two-statement batch (the transition, then the report insert) when the record carries a Slurm id, and commitTerminal's batch gained the same insert. The empty hook and its caller callSlurmHook are removed. The insert reads the JOB ROW (SELECT id FROM compute_jobs WHERE id = ?1 AND slurm_job_id IS NOT NULL), so it is idempotent and a lost writer that runs it adds nothing a winner did not.

The guarantee towards ACCESS (decision for the Opus checkpoint)

At most once for every outcome the sender cannot judge. What it is: the row is claimed by ONE conditional UPDATE (pending to attempting, a lease stamp, the attempt counted) BEFORE the POST, so two overlapping ticks cannot both send; the POST is made between two statements and never inside a batch; the outcome is written only under the sender's own stamp. Only an answer that shows the request was NOT processed is retried: a 4xx other than 409, 408, 429 and 503, with an hour's delay doubling to a day and failed after 8 attempts. Every other outcome is treated as no answer and ends the row failed with outcome_unknown, which no code sends again: no answer at all (a timeout, a lost or refused connection), a 500, 502 or 504, any 3xx, a 409, and a sender that died holding its 10-minute lease.

What it is not: a promise that every job is reported. A report that may have been recorded and is not known to have been is LOST and never doubled. The unavoidable residual, stated plainly: (1) a request ACCESS recorded whose answer never arrived (or arrived as one of the unknown statuses) is failed for a person to resolve; (2) a Worker that dies between the claim and the POST also ends outcome_unknown though nothing left (the safe direction); (3) a duplicate can still happen only if ACCESS records a request and then answers with one of the statuses that read as "not processed" (a 4xx other than 409, 408, 429 or 503), which a server does not normally do; a 503 that a proxy answers after the upstream had processed the request (an upstream reset behind a gateway) would do it, which is rare and accepted; (4) if the runtime stops waitUntil work about 30 s after scheduled() returns, the 20 s budget plus a 15 s POST can exceed it, and the reaper then ends the claimed row outcome_unknown (lost, never doubled). I chose at-most-once because the design page says a second report double-counts a person and nothing about the interface (unverified) promises that a duplicate is ignored. The tick also stops claiming after the first unjudgeable outcome (round 2), so a systematic fault at ACCESS loses one report a tick, not ten. Owner action (ruling a): ask ACCESS whether job_attributes stores one record per (job id, resource); if it does, classifyAnswer is the one function to switch to retry the unknowns.

The issue's migration lists three states; the claim needs a fourth (attempting) and a lease column (claimed_at), as the driver's brief preferred. Two more CHECKs keep them honest (attempting if and only if a lease stamp; failed always has a word).

Every path that ends a credential today

Found by grep of the writers of tokens.revoked_at, web_sessions.revoked_at and users.deleted_at. "Compute" is computeReleaseStatements.

Path What it ends Compute Test that proves it
POST /admin/revoke/:username and POST /admin/revoke/by-id/:id (finalizeRevocation) IAM keys, API keys, every session of every scope, docs and private grants, support tickets and queue references (mailReleaseStatements, scope all) YES, in the batch admin-credential-cascade.test.ts (sessions and grants; compute: "ends the account's compute in the same batch"), compute-release-cascade.test.ts (both routes, the lifecycle, the sweep), mail-ticket-cascades.test.ts, private-site-cascade.test.ts
DELETE /admin/users/by-id/:id (owner soft delete, tombstoneUserCascade) PII mask, API keys, every session, docs and private grants, collaborators, S3 permissions, tickets, login codes YES, in the batch admin-credential-cascade.test.ts (tombstone block, compute), compute-release-cascade.test.ts, user-soft-delete.unit.test.ts, mail-ticket-cascades.test.ts, private-site-cascade.test.ts
sweepCiTestAccounts (non-production sweep of the live tests' accounts) the same function with onlyIfEmail: every statement is guarded by the mask YES, guarded: a false guard changes nothing of compute compute-release-cascade.test.ts ("scheduled sweep's call", and each release statement alone under a false guard), test-account-sweep.test.ts
POST /admin/users/:username/role (demotion) API keys, docs sessions and grants, tickets (all, or restricted for an owner demoted to admin); NOT app or private sessions NO, on purpose (compute is not an admin's standing) admin-credential-cascade.test.ts ("a demotion does NOT end compute", mutation: add it to the batch), compute-release-cascade.test.ts
DELETE /auth/keys/:id, DELETE /auth/keys/current, owner DELETE /admin/users/:username/keys/:id, emailed GET /auth/confirm-key-regeneration (revokeDocsCredentials) the key, docs sessions and grants NO, on purpose (a job's identity is the account's, not a key's) compute-release-cascade.test.ts (owner route leaves jobs and pools alone), admin-keys-routes.test.ts
POST /auth/logout the app session, docs and private sessions and grants NO (logout ends sessions only) private-site-cascade.test.ts, docs-auth-routes.test.ts
ORCID unlink and relink no key or session is revoked (OIDC grants are Epic B's) not a credential-ending path today none needed

The caller-count sentences are updated where they apply: ticket-assignment.ts (mailReleaseStatements keeps its three callers; the compute counterpart has two, and a demotion is not one) and docs-auth.ts (the revokeDocsCredentials docblock now says two of its three "end every credential" paths also run the compute statements). The DOCS_GRANTS_PURGE_SQL (five callers) and PRIVATE_GRANTS_PURGE_SQL (three callers) counts do not change: this phase adds no caller of either.

What to look at (Opus checkpoint)

  • Cascade completeness across both caller sites: finalizeRevocation (routes/admin/users.ts) and tombstoneUserCascade (db/user-tombstone.ts, through step, so the mask guard is appended). compute-release.ts is the whole of the logic.
  • The SQL-cancel rule. The issue says "for jobs not yet at Tapis, cancel and release the hold in SQL". I narrowed it to what driveCancel already proves safe (A5 amendment item 4): no Tapis job, no launch_spec_digest (a submit whose answer was lost writes it BEFORE the call, and a Tapis job may exist that no search can see) and no live submit lease. Ending any other job in SQL would release a hold for a job that then runs. Those jobs record account_ended and the intent, and the retried sweep ends them (tested with a real lost submit answer and with a revoke that lands while a submit is in flight).
  • Every release statement ends in a WHERE clause with plain ? placeholders; each is run alone under the real mask guard (MASK_APPLIED_SQL, now exported from user-tombstone.ts) and changes nothing.
  • The ledger release is the ledger's own conditional INSERT shape (a plain INSERT, the scan refuses a conflict clause) and writes only for an open hold: a hold closed behind the cascade's back does not make the revocation fail (tested; the mutation drops the open-hold check).
  • No Tapis or ACCESS call inside a batch: the cascade is text and binds; the reporter claims, posts and records in three separate steps; a source scan (compute-access-reporter.test.ts) asserts no function that runs .batch( also makes a network call in the lifecycle, the reporter, the release statements and the tombstone cascade, and was shown to fire on a planted fetch.
  • A report is never sent twice: the claim, the unknown-outcome rule, the reaper and the stamp guard (section above, each with a mutation below).

Decisions inside the issue's freedom

  • First recorded cancel reason and time stand (COALESCE), so a person's earlier cancel stays user.
  • Retention of a job the cascade ends in SQL: the current policy's retention.recordsYears read in SQL (default 7 when there is no policy row), as commitTerminal does.
  • The pool freeze is frozen = 1 on every pool whose holder is the account; the platform's and partners' pools are never reached; nothing unfreezes (hand-off to Epic D, ADR item 3).
  • Backoff: 1 h, 2 h, 4 h, 8 h, 16 h, then 24 h; 8 attempts; lease 10 minutes; ten rows a tick, oldest due first; the POST timeout is 15 seconds.
  • Fixed words: unconfigured, no_submit_time, no_gateway_user, refused, busy, unavailable, outcome_unknown (declared once in shared/compute-state.ts, compared by test).
  • A job with no pseudonym (a partner job that maps to no account) ends failed with no_gateway_user at once. A record with no scheduler submission time waits (no_submit_time), costs no attempt and goes to the back of the line for an hour.
  • submittime is sent as ISO 8601 UTC with a Z; debug: true is a body field outside production only. Both are UNVERIFIED (below).
  • The cron reads no switch: a job that ran is owed its report whether or not compute is on.

Deviations from the issue

  • The SQL-cancel rule is narrower than "jobs not yet at Tapis" (above).
  • A fourth state attempting and a claimed_at column in the migration, and two extra CHECKs (driver's brief).
  • The empty hook was removed instead of filled in place (above).
  • A partner reservation is left alone by the cascade AND by A5's driveCancel and the sweep's list (round 1, finding 2), a small change to merged A5 code with its own tests.
  • ACCESS_RESOURCE_NAME presence is now part of the status answer and the CLI output (round 1, finding 4), where the brief for the rename said to keep the status view's behaviour.
  • MASK_APPLIED_SQL is exported from user-tombstone.ts (a rename of a local constant; no behaviour change) so a test runs each statement under the real guard instead of copying it.
  • access-attributes.ts also holds the report row's insert, so compute-lifecycle.ts imports it; compute-release.ts imports SUBMIT_LEASE_MINUTES from compute-lifecycle.ts (no cycle: the Worker entry bundles, and a fresh process importing the tombstone module first loads).

Mutation evidence

Each run alone, the test file as its own argument, the mutation confirmed applied, then restored. Counts are the tests that failed when it was run; the two caller rows were re-run against the final test files, and a few test files gained cases afterwards, so the other counts are lower bounds.

Mutation Fails
ACCESS_RESOURCE_NAME set in a toml [vars] compute-switches-flag.test.ts 1
report insert: drop OR IGNORE compute-access-reports.test.ts 5 (replay throws on the primary key, on both engines)
report insert: removed from the live batch 2
report insert: removed from commitTerminal 2
report insert: drop the Slurm id predicate 1
migration: job_id nullable / attempting removed / sent_iff dropped / index no longer partial / failed_says_why dropped compute-access-reports-migration.test.ts 1 each
remove the compute statements from finalizeRevocation (final run) compute-release-cascade.test.ts 8 and admin-credential-cascade.test.ts 1
remove the compute statements from tombstoneUserCascade (final run) compute-release-cascade.test.ts 2 and admin-credential-cascade.test.ts 1
add the compute statements to the demotion batch admin-credential-cascade.test.ts 1
SQL cancel without the launch_spec_digest IS NULL term / without the lease term 2 / 1
drop the freeze / the account scope of the intent / the release insert / the settled stamp / the intent / the SQL cancel 6 / 4 / 5 / 2 / 7 / 7
intent without COALESCE / release without the open-hold check 1 / 1
reporter: ignore a lost claim / treat no answer as a retry / remove the reaper / drop the stamp from the outcome compute-access-reporter.test.ts 2 / 2 / 1 / 1
reporter: always debug / never debug 2 / 1
reporter: skip the pseudonym check / skip the submit-time wait / first delay 30 / follow redirects / key under another header 1 each (the delay: 3)
reporter: claim without state = 'pending' / newest due first / unconfigured not recorded / attempts not counted 2 / 1 / 1 / 7
reporter: key named in a log line / fetch planted in a batch function 1 / 1
cron: call removed from scheduled() / self-fence removed / wiring entry removed cron-sweep-wiring.test.ts 2 / cron-dev-safety.test.ts 2+ / cron-sweep-wiring.test.ts 2
Round 1. classifier: 503 widened to every 5xx / 409 retried / 3xx retried / 500 refused / 400 unknown / 408 and 429 dropped / 503 dropped / 2xx upper boundary (300 sent) / 2xx lower boundary (200 not sent) compute-access-reporter.test.ts 2 / 2 / 3 / 2 / 2 / 2 / 6 / 2 / 10
driveCancel without the partner return / sweep list without the partner term / the partner return moved above the Tapis-job check compute-lifecycle.test.ts 1 / 1 / 1
cascade: partner term dropped from the SQL cancel / the release / the stamp / the intent compute-release-cascade.test.ts 1 each
compute statements in a second db.batch after the credential batch, in finalizeRevocation / in tombstoneUserCascade compute-release-cascade.test.ts 1 / 1
status field dropped / name read from the key / log line ignores unconfigured / CLI wait line hidden / CLI shows unknown as no / schema field required compute-status-route.test.ts 4 / 1, compute-access-reporter.test.ts 1, admin-compute-status-cli.test.ts 2 / 1, compute-admin-contract.unit.test.ts 1
submission-time bound removed / a day later (9) / a day earlier (5) compute-access-reporter.test.ts 3 / 2 / 1
caller scan: statements removed from finalizeRevocation / from tombstoneUserCascade / a new function that revokes every key and session compute-end-callers.test.ts 4 / 4 / 1
scan rules: aliased import / namespace property / namespace element / local alias / destructuring / alias of an alias in one pass / dynamic import / module-level reference / delegation chain one level deep compute-end-callers.test.ts 1 each
tick budget: check removed / budget 60 s / skipped off by one / >= to > / >= to >= budget - 1 compute-access-reporter.test.ts 1 / 2 / 1 / 1 / 1
Round 2. claiming not stopped after an unknown outcome / stop on any non-sent outcome / skipped off by one / stop on a retry as well compute-access-reporter.test.ts 1 each
persistent refusals: threshold 4 / threshold 2 / class filter dropped / state filter dropped / count skipped when nothing is due / log ignores persistent compute-access-reporter.test.ts 2 / 2 / 1 / 1 / 2 / 1
scan: IN dropped / subselect dropped / one-key predicate dropped / qualified id not seen / hash predicate dropped / case sensitivity / quoted tables not seen compute-end-callers.test.ts 2 / 1 / 3 / 1 / 2 / 1 / 2
scan: a delete of sessions not an end / a delete needs no user predicate / bare-name resolution compute-end-callers.test.ts 1 / 1 / 3

Gates

Run in this worktree after round 2:

  • bun run typecheck: pass (also run by the pre-commit hook on every commit).
  • bun run migrations:d1-check: not re-run, the migration is unchanged since the one run in round 0 (pass: "All migrations applied on real D1", catalog matches bun:sqlite, 190 objects, 54 tables).
  • bunx biome check src shared backend/src: 5 errors and 1 warning, all in backend/src/services/zenodo.ts and doi-orcid-discovery.ts, which nothing here touches (baseline). Every .ts file this PR touches is clean (38 files, warnings only, all in older test code).
  • Tests, all green: compute-access-reports-migration 15, compute-access-reports 9, compute-access-reporter 45, compute-release-cascade 20, compute-end-callers 15, admin-credential-cascade 13, compute-lifecycle 107, cron-sweep-wiring 194, cron-dev-safety 70, compute-switches-flag 39, compute-status-route 21, admin-compute-status-cli 10, compute-admin-contract.unit 19, compute-state.unit 59, private-site-cascade 28, mail-ticket-cascades 10, compute-source-scan 4, compute-ledger 63, adr-index.unit 8. The round 1 run also covered test-account-sweep, admin-revoke-route, user-soft-delete.unit, the other compute-lifecycle-*, compute-jobs*, compute-webhook, compute-job-callbacks, compute-full-path, compute-route-inventory, admin-keys-routes and docs-auth-routes; round 2 changed none of what they read.
  • Not run, would check: the full bun test and CI, and test/account-copy-parity.test.ts stays a known baseline failure.

Unverified (nothing here has seen the real interface)

The header that carries the key (ACCESS_KEY_HEADER, set to XA-API-KEY, the one ACCESS accounting interfaces use; a guess), the body's field spelling and the time format (ACCESS_BODY_FIELDS, accessSubmitTime), whether debug is a body field, what the interface answers for a duplicate, whether it accepts the pseudonymous gateway user, and the resource name. Each is one constant, and the interface may want further headers (for example a resource header): the owner checks when the key is issued. The tests pin the issue's spelling and say so, and the ACCESS stand-in (helpers/access-standin.ts, a real Bun.serve) says no response was recorded from the real service.

Open points for later briefs (rulings of round 1, nothing to decide here)

  • Partner phase (D4) brief, in full (round 2): (a) who ends or expires an unlaunched partner reservation and releases its hold; (b) what a person's cancel of a reservation means: it now records the intent and reports success while the row stays created with its hold open, and a later partner bind is refused because BIND_TAPIS_JOB_SQL requires cancel_requested_at IS NULL; (c) a partner that launches under an ended account's reservation runs unchallenged under a frozen pool, because the cascade records no intent on a reservation (it fails open): consider recording the intent so the bind refuses (fail closed); (d) a way to list stuck reservations for A7 (the status view does not count them). Earlier text of this bullet: supply a pseudonym for account-less partner jobs (for example per client and Tapis owner), because such a job ends failed with no_gateway_user today (ruling b); and "a partner reservation of an ended account": the cascade and driveCancel now leave such a reservation as it is (hold open, row live), so the partner contract must say how it ends and who releases its hold.
  • Compute access phase (D1) brief: nothing unfreezes a frozen pool, and there will be two freezers (this cascade and the suspension of compute) sharing one bit: record the freeze cause or derive frozen from the access state, so that lifting one cause does not lift the other (ruling c).
  • Reporting phase (A7) brief: list failed report rows by word (outcome_unknown, no_gateway_user, no_submit_time, refused, busy, unavailable), and add an owner-only re-queue that requires an explicit "confirmed not recorded at ACCESS" acknowledgement (ruling d). Also open for A7, both pre-existing in A5: the cancel queue can stall because CANCEL_ROWS_SQL takes the oldest ten rows, and staging never cancels at Tapis.
  • Owner: ask ACCESS whether job_attributes stores one record per (job id, resource) (switches classifyAnswer to retry unknowns), and check the key's header name and any further headers when the key is issued.
  • Key revocation does not cancel jobs (they are NEMAR-owned and bound to the account, not minted from a key): kept, and the docblocks now say a stolen key's already-submitted jobs keep running until a cancel or an administrative revoke.

For the docs repo ("when merged")

Design section 7, cancellation and revocation, as shipped: "Revoking or deleting an account records the cancellation of every live job in the same batch as the other credential cascades: a job that provably never reached Tapis (no Tapis job, no launch specification written, no live submit lease) is cancelled there and its hold released; every other live job records the reason account_ended and the intent, and the retried sweep cancels it at Tapis and charges what it used; every pool of the account is frozen, and nothing unfreezes it but a later grant of compute access. A role demotion and a key revocation do not end compute." Design section 9, attribution: "The batch in which a job's record first shows a Slurm id inserts a pending report row. The 30-minute tick sends it (production only, ten rows a tick): the row is claimed by a conditional update before the POST, an answered refusal is retried with an hour's delay doubling to a day and the row is failed after 8 attempts, and a request with no answer, or a sender that died, ends failed for a person to resolve and is never sent again by code. The body carries the Slurm id, the scheduler's submission time, the resource name and the stored pseudonym, never a name or an email; debug is added outside production." Systems inventory runbook: "runAccessReportCron, every 30 minutes, production only, ten due rows, log prefix [access-report], secrets ACCESS_GATEWAY_ATTRIBUTES_KEY and ACCESS_RESOURCE_NAME; failed rows need a person."

@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

📦 Package Preview

Your package is ready to test!

bun install -g nemar-cli@PR2046

Version: 0.10.28-PR2046.297761f
Commit: 297761f


🤖 Updated on each push.

@neuromechanist
neuromechanist force-pushed the feature/issue-2013-phase8-revocation-cascade-and-access branch from aede7a0 to 297761f Compare November 5, 2026 05:39
@neuromechanist
neuromechanist merged commit cf34441 into feature/issue-2005-epic-compute-core Nov 5, 2026
17 of 19 checks passed
@neuromechanist
neuromechanist deleted the feature/issue-2013-phase8-revocation-cascade-and-access branch November 5, 2026 05:40

This branch was previously deployed

1 inactive deployment
npm — 297761f3 Deployed Nov 5, 2026 by neuromechanist via publish #4196
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