Repository navigation
Description
Source: nordiccare report (Slack #C0BS2FZ1YE7, 2026-11-05): "the app's token expires after an hour". Investigation shows the premise differs from what the entrypoint intends.
Not a regression, but a blocker for the hardening
Nothing changed recently. The header-only call has never matched what POST /runner-token/refresh expects (JSON body required since the endpoint was added on 2026-02-25; the runner block predates 2026-06-08, per git history, not re-run against old versions). It stays invisible because || true swallows the failure and the 365-day runner-refresh token stays in OSC_ACCESS_TOKEN.
This must be fixed before REJECT_RUNNER_REFRESH_TOKENS is enabled (token-service #116, default false, not set in infra-osaas). Once it is on, apps and sibling runners that rely on that token stop working. Blocks: enabling that flag in prod.
Findings (from code reading; the 400/401 was probed against dev and prod with a junk token)
- The
OSC_ACCESS_TOKENa python My App receives is a runner-refresh token (type: runner-refresh, scopeconfig-access, 365 days; osaas-lib-tokensrc/pat/token.ts:48-73). scripts/docker-entrypoint.sh:214-218tries to exchange it atPOST token.svc/runner-token/refreshfor a 1h PAT, but sends the token only in anx-pat-jwtheader. The endpoint requires a JSON body{"token": ...}(token-servicesrc/model.ts:29-31): header only gives400 body must be object.curl -sf ... || trueswallows the failure, so the 365-day token stays in the env var. Apps work today by accident; they depend onREJECT_RUNNER_REFRESH_TOKENSstaying false (osaas-deploy-managersrc/server.ts:219).- Sibling runners: wasm-runner (
:128-130) has the same bug; golang-runner (:131-133) and dotnet-runner (:137-139) send a Bearer header with no body and also fail; web-runner (:303-305) and php-runner (:116-118) are correct.
Change (contract change, needs birme approval before merge)
Fixing the body alone turns today's 365-day env token into a 1h PAT and breaks any app using it after an hour. The two parts must ship together:
- POST
{"token": $OSC_ACCESS_TOKEN}, as web-runner does. - Keep the original token available as
OSC_REFRESH_TOKENso the app can call/runner-token/refreshitself; document with a Python snippet. - Log a
[CONFIG]warning on a failed exchange instead of|| true.
Acceptance criteria
- Items 1-3 above, in one PR
- Tests for the success and failure paths
- Consumer audit for apps reading
OSC_ACCESS_TOKEN, andContract change approved by birme: <url>on this ticket before merge - Sibling tickets filed for wasm-, golang- and dotnet-runner (linked below)
What a human does next
Nothing.
Activity
birme commentedon Nov 6, 2026
Sibling added for python-job-runner: Eyevinn/python-job-runner#6 (the audit's seventh runner; wasm, golang, dotnet are #37, #32, #31).
birme commentedon Nov 8, 2026
Architect Triage
Classification: NEEDS_HUMAN (contract gate: the ticket's own item 1 changes what a python My App receives in
OSC_ACCESS_TOKEN; the ticket itself says "contract change, needs birme approval before merge" and carries noagent-actionablelabel)Necessity-test arm: treated
Premises verified (python-runner
1761ffb, osaas-token-servicedc067f6, osaas-lib-token3d507d6, osaas-deploy-managere9ad56e, web-runner3aaca7c, allmaintoday):scripts/docker-entrypoint.sh:229-233(the ticket cites 214-218, shifted by fix: redact decrypted config output from pod logs on config load failure #40) sends-H "x-pat-jwt: $OSC_ACCESS_TOKEN"and no body. Probed just now:POST https://token.svc.dev.osaas.io/runner-token/refreshcarrying that header alone answers400 {"code":"FST_ERR_VALIDATION","message":"body must be object"}. The route needs{token}(src/model.ts:29-31, handlersrc/api_service_token.ts:548-626) and answers{token, expiresIn: 3600}fromgeneratePat(tenantId, userId, undefined, undefined, 3600).OSC_ACCESS_TOKENof a python app is the runner-refresh token: deploy-managersrc/apps/python.ts:138-152storesPatToken.generateRunnerRefreshToken(...)asOscAccessToken(rebuild migration and rotation at:635-675); the token istype: runner-refresh,scope: ['config-access'], 365 days (osaas-lib-token src/pat/token.ts:48-73).REJECT_RUNNER_REFRESH_TOKENS=true,rejectIfRunnerRefreshToken(token-servicesrc/api_service_token.ts:77-93) answers 401pat_invalidon PAT routes, deploy-manager's verifiers do the same (src/security/runner-refresh.ts). Config load survives because/servicetokenexemptseyevinn-app-config-svc(:71,:167-174), and/runner-token/refreshstays open (api_service_token.test.ts:683).|| trueplus an unconditionalOSC_ACCESS_TOKEN=$(...)is the whole failure handling. Note the assignment (noexport) still reaches the app: an assignment to a variable imported from the environment keeps its export attribute, so on a 200 the app would inherit the 1h PAT.scripts/docker-entrypoint.sh:298-365) does the correct exchange and already exports the 1h PAT as the app'sOSC_ACCESS_TOKEN. It has noOSC_REFRESH_TOKEN, so web-runner apps have no way to renew in-process either. Failure movement there: 200 exports the fresh PAT; 401refresh_token_expired|revokedrunsexit 1; 401refresh_token_invalidkeeps the original silently; any other 401 and any non-200 after 3 tries warn and keep the original.OSC_REFRESH_TOKENname collision check: no code in deploy-managersrc, lib-token, token-service, web-runner or python-runner uses it, and an org code search finds it only in ADR-0005 (adr/0005-runner-refresh-tokens.md, which names this exact variable as the exchange input and says it is checked first). Naming follows ADR-0005; no new ADR needed.time_total): dev p50 36 ms, max 133 ms; prod p50 34 ms, max 38 ms. Thin sample, so a ceiling must be generous.The contract change, stated precisely (needs birme's approval, rejected here as a contract break)
Element: item 1 as written, i.e. the app-visible
OSC_ACCESS_TOKENbecomes the exchange result.OSC_ACCESS_TOKENin the app envrunner-refreshJWT, accepted by every PAT route while the flag is falseOSC_REFRESH_TOKEN[CONFIG]warning on failureThis is the only element that changes behaviour for existing apps, and it cannot be made contract-preserving because changing the meaning of
OSC_ACCESS_TOKENis exactly what unblocksREJECT_RUNNER_REFRESH_TOKENS. Consumer audit so far (gh search code OSC_ACCESS_TOKEN --owner Eyevinn): python hits areopen-videocore e2e/job/run_cycle.py(CI job env, not a My App),eng-nordic-care-web app/config.py:174(the reporting tenant: an optionalENV_OSC_ACCESS_TOKENconstant),eng-softbindparam_store.py,eng-nordic-care-agents. Unverified: howeng-nordic-care-webuses the value after startup. Coverage limit: tenant apps outside the Eyevinn org cannot be searched, a residual that is inherent to this change.Contract-preserving direction (what
agent-actionablealone releases)Per task 5.5a: if the label is added without a birme comment that approves item 1, implement this section alone. It does not by itself unblock the flag (apps still lean on the 365-day token); it makes the exchange real, gives apps the renewable credential before the swap, and leaves the swap a one-line change.
Checklist (the ticket's four acceptance criteria and three change items, none dropped; AC 1 and 3 rewritten as noted):
docker-entrypoint.sh:229-233: POST{"token": "<exchange input>"}withContent-Type: application/json, where the input is${OSC_REFRESH_TOKEN:-$OSC_ACCESS_TOKEN}. Put the body in a mode-600 temp file and pass--data @file, as web-runner does (:307-313), so the token never sits in curl's argv; read the HTTP status with-w. A--max-time 10is allowed (measurement above); on timeout the outcome is unknown, so fall back to the original token and continue, never fail. On 200 with a non-empty.token, use it asOSC_ACCESS_TOKENfor theconfig-to-envcommand, set inline on that command (config_env_output=$(OSC_ACCESS_TOKEN="$fresh" timeout 60s npx ...)). Never assign the shell'sOSC_ACCESS_TOKEN(see the export-attribute note above): that assignment is the contract change.export OSC_REFRESH_TOKEN="${OSC_REFRESH_TOKEN:-$OSC_ACCESS_TOKEN}". A tenant param-store key of the same name is loaded after this and wins; say so in the README.|| truewith a handler that prints[CONFIG] WARNING: runner token exchange failed (HTTP <status>, code=<.code>); using the original token, status and.codeonly, never the body or the token. Noexiton exchange failure: the config load stays the only fatal path, so no new failure mode appears. Do not copy web-runner'sexit 1onrefresh_token_expired|revoked.OSC_REFRESH_TOKENand the fresh token to the redaction loop inredact_config_log(:211-222, added by fix: redact decrypted config output from pod logs on config load failure #40; its test asserts literal-token redaction attests/test-entrypoint-config-load-failure.sh:88).OSC_REFRESH_TOKENnext toOSC_ACCESS_TOKEN(README.md:60) with a short Python snippet that POSTs{"token": os.environ["OSC_REFRESH_TOKEN"]}tohttps://token.svc.<env>.osaas.io/runner-token/refreshand reads.token.tests/test-entrypoint-config-load-failure.shor addtests/test-entrypoint-runner-token-refresh.shwith the sameawkextraction (the extracted block runs from# Load environment variables from config service if configuredto# Install Python dependencies, so it includes the refresh block; today'scurlstub isexit 22, so every existing case runs through the failure path and must stay green). Success path: stubcurlanswers 200 and{"token":"fresh","expiresIn":3600}; assertnpxsawOSC_ACCESS_TOKEN=fresh, the shell'sOSC_ACCESS_TOKENafter the block is still the original,OSC_REFRESH_TOKENequals the original, and the block reachesREACHED_PIP. Failure paths (401 expired, 401 invalid, 500, curl exit 22 and 28): warning with status, no token in stdout or stderr, original token used, block continues. A passing-path test is mandatory per CLAUDE.md.OSC_ACCESS_TOKENunchanged. Rewritten because item 1 as written replaces the app's token.Contract change approved by birme: <url>line is required for the swap below, not for this PR. The audit for this PR is the name-collision and redaction work in items 2 and 4.python-runner has no PR CI that runs tests (
.github/workflowsholdssync-fork-dev.ymlandsync-fork-prod.ymland nothing else), so the implementer runsfor t in tests/*.sh; do bash "$t"; donelocally and pastes the result in the PR body.If birme approves the swap (a comment
Contract change approved by birme: <url>stating item 1 as written): change item 1 toexport OSC_ACCESS_TOKEN="$fresh"before the config load (web-runner behaviour), keepOSC_REFRESH_TOKEN, flip the success test to assert the app-visible token is the fresh one. Same PR, same files. Say in the PR body that existing apps get the 1-hour token on their next restart.E2E Impact
Verdict: None
Grepped
python-runner|eyevinn-python-runner|OSC_ACCESS_TOKEN|runner-token|OSC_REFRESH_TOKENinosaas-e2e-teststests/andutils/(main, fast-forwarded). Hits:tests/test-service-creation-token.ts(creates a service withOscAccessToken: '{{secrets.oscaccesstoken}}'throughcreate-service-instanceand asserts the template survives in the listing; it never runs the python entrypoint),tests/account.teardown.ts,tests/account-personal.teardown.tsandtests/test-mcp-myapps-paramstore-large.ts(the test process passes its ownOSC_ACCESS_TOKENto the CLI). No spec boots a python runner pod, so none asserts the entrypoint's token behaviour. Dev verification is agent-doable after merge:.claude/scripts/dev-remake.sh https://github.com/Eyevinn/python-runner eyevinn-python-runner, then create a python My App with a parameter store on the dev test tenant and read the pod startup log for the exchange line (the GHCR digest check is not possible on this runner,ghcr_dev=denied; use the maker order status and the pod log).Existing test coverage: python-runner
tests/test-entrypoint-config-load-failure.sh(extracts and runs the refresh plus config block; satisfied by item 6). No e2e spec, see above.Guard tests lifted: None. Grepped
tests/forADR-(0 hits) and for text assertions on the entrypoint source (none; the harness runs the extracted block).Necessity test
Split decision: not split. One issue, 9 checklist items (4 of 4 acceptance criteria and 3 of 3 change items are checklist items 1 to 9; AC 1 and AC 3 are rewritten as stated in items 7 and 8, none dropped).
Scope reductions
OSC_ACCESS_TOKENwith the 1h PAT (item 1 as written) waits for approvalNeeded now: birme decides item 1. Either comment
Contract change approved by birme: <url>on this ticket and addagent-actionable(the ticket is then implemented as written, swap included), or addagent-actionablealone to release the contract-preserving direction above. Mention in the same comment which stage the four sibling tickets follow.Cause category: product decision
Prevent next time: the audit that filed the seven runner tickets should name the stage split up front when a fix changes what an env var means (a before/after row in the issue template for runner entrypoint tickets), so the approval is a one-line choice; proposed wording for
.claude/skills/daily-triage.mdtask 5.5a: "a runner entrypoint change that alters an env var an app reads is a contract change; list before and after".Owner of that change: birme (the audit that filed #39 came from his account; the CEO/PM team does not own runner entrypoints)
Add the
agent-actionablelabel once this decision is made and automation will pick it up.Automated triage by architect agent
birme commentedon Nov 8, 2026
Architect note:
jqis not in the runner image (found while triaging Eyevinn/wasm-runner#37)The Stage 1 directions in the triage comment above read the exchange response's
.tokenand.code. In this image that parsing cannot usejq: the entrypoint's onlyjqcall isdocker-entrypoint.sh:233, and the Dockerfile (python:3.12-slimplus the apt list at lines 4-17, then NodeSource Node) installs nojq; Debian'sawsclipackage does not depend on it either. Today the call never runs because curl fails first. Once the body is fixed it runs,jqis "command not found", and the currentOSC_ACCESS_TOKEN=$(echo "$REFRESH_RESULT" | jq -r '.token // empty')assigns an empty string (and so would any Stage 2 swap written the same way), after whichconfig-to-envruns without a token and the container exits through the fatal config path.Direction for the implementer on this ticket: parse the response with
node(already in the image, no new dependency), treat an empty parse result as an exchange failure (warning, original token kept), and add ajqstub that exits 127 to the success-path test, because the harness PATH includes/usr/binand a developer machine withjqwould hide the problem. Read from the Dockerfile; the built image was not inspected (ghcr.ioanswers 401 on this runner). The same check is needed for python-job-runner#6, golang-runner#32 and dotnet-runner#31 when they are triaged; wasm-runner's image has the same gap (see Eyevinn/wasm-runner#37).Automated triage by architect agent
birme commentedon Nov 8, 2026
Decision (birme, 2026-11-08)
Stage 1 now for all five runners. Stage 2 ships together with the
REJECT_RUNNER_REFRESH_TOKENSrollout, not before.This decision governs all five sibling tickets: python-runner#39, Eyevinn/dotnet-runner#31, Eyevinn/golang-runner#32, Eyevinn/wasm-runner#37 and Eyevinn/python-job-runner#6.
Stage 1 — do it now (no human decision left, nothing a tenant can observe)
Make the refresh exchange actually work, and have
config-to-envauthenticate with the fresh 1h PAT. The app keeps today's token and additionally gainsOSC_REFRESH_TOKEN.Stage 2 — gated, not now
The app-visible
OSC_ACCESS_TOKENbecomes the 1h PAT. This ships with theREJECT_RUNNER_REFRESH_TOKENSrollout. Shipping it before is a genuine regression for any My App that calls a platform API more than an hour after boot: today the 365-day token works, after Stage 2 it dies at 60 minutes with no in-process renewal unless the app has adoptedOSC_REFRESH_TOKEN. Shipping it after the flag is strictly an improvement, because the 365-day token is rejected on every route by then. Do not implement Stage 2 under these tickets; it belongs to the flag rollout.Why this is consistent with the decision already taken
osaas-token-service#109 (birme, 2026-11-03, option B) rejected option (C) — "fix the five runner entrypoints" — with: "(C) stays the better end state but needs runner image releases and restarts first; it would be a new ticket by whoever wants it." These five tickets are that new ticket. The same comment already records that "Apps on web-runner and php-runner hold a 1h PAT after the swap and are unaffected", so the swap is accepted existing platform behaviour, not a new proposal.
What is actually broken (re-probed on dev, not taken from the triage)
POST https://token.svc.<env>.osaas.io/runner-token/refreshrequires a JSON body{"token": "<jwt>"}(osaas-token-servicesrc/model.ts:29-31, handlersrc/api_service_token.ts:544-630) and answers{token, expiresIn: 3600}. All five runners send no body, so the exchange has never once succeeded:x-pat-jwtheader, no body (python, wasm, python-job)400 FST_ERR_VALIDATION "body must be object"Authorization: Bearer+Content-Type: application/json, no body (golang, dotnet)400 FST_ERR_CTP_EMPTY_JSON_BODY{"token": ...}bodytoken-service is correct and needs no change. This is five near-identical entrypoint patches.
web-runner(3aaca7c:303-336) andphp-runner(fe16600:114-126) are the reference implementations — both already send the body and both already do the swap.Two traps that the literal "just add the body" fix would hit
Both verified from the Dockerfiles; implementers must handle them:
jqis absent from the python-runner and wasm-runner images (python:3.12-slimandubuntu:22.04, neither apt-installs it;nodeis present in both). Todayjqnever runs because curl fails first. Fix only the body andOSC_ACCESS_TOKEN=$(... | jq ...)assigns empty,config-to-envruns tokenless, and the config path fails. Parse withnodein those two images, or addjqto the image — do not assume it exists. golang, dotnet, web and php images do havejq.grep -o ... | cutunderset -ewithoutpipefail, so the|| echo "$OSC_ACCESS_TOKEN"fallback is unreachable and a 200 without atokenkey silently yields an empty string. Replace withjq -r '.token // empty'and treat empty as a failure — otherwise fixing the body converts a silent no-op into a silent tokenless config load.Also replace the
|| trueon the config load with a[CONFIG]warning, so a future failure is visible rather than silent.Line numbers have drifted — re-verify before editing
Verified on current
main; the ticket bodies cite the older numbers:main1761ffbscripts/docker-entrypoint.sh:230-233178542d:127-13090b62fa:130-133142b9d4:136-142:85-88wasm-runner is exempt from Stage 2 entirely
wasm-runnerapi/server.js:16-18isspawn('/runner/bin/wasmedge', ['/usercontent/main.wasm'])— noenvoption, no--envflags, andgrep -rn OSC_ACCESS_TOKEN api/is empty. The WASM module cannot observeOSC_ACCESS_TOKENat all, so both stages only touch the runner's own Node process. Its AC2 was copied verbatim from #39 into a runtime where the premise is false and should be struck, not deferred.Consumer audit for Stage 2 (for when it ships, recorded now so it is not redone)
The originating tenant repo
eng-nordic-care-web(private) readsOSC_ACCESS_TOKENonly as a Bearer header for a boot-time parameter-store fetch (app/config.py,_maybe_fetch_parameter_store()), so it is Stage-2-safe.gh search code OSC_ACCESS_TOKEN --owner Eyevinnotherwise surfaces only catalog services (intercom-manager,open-live,strom,just-go-live), none runner-hosted. Go and C# searches return 0 runner-app hits. Coverage limit: tenant repos outside the Eyevinn org cannot be code-searched — that residual is inherent and accepted.Caveat on provenance — read this before treating #39 as the fix for the report
The originating Slack report could not be read (
slack-read.shreturnsinvalid_authand the Slack MCP connector is down with a 404). Since every runner's exchange 400s, the reporting tenant's app is holding the 365-day token — so their complaint cannot be aboutOSC_ACCESS_TOKENexpiring after an hour. #39 is a hardening finding the investigation surfaced, not the fix for the reported symptom, and the reported symptom may still be unexplained (most likely a 1h service access token minted downstream). Whoever closes these tickets must not treat the tenant's report as resolved by them.Cause category / Prevent next time
|| trueguaranteed silence.|| true. The reference implementation to copy isweb-runner's, not the nearest sibling's.docs/repo-patterns-backend.mdplus the per-runner tests in the Stage 1 PRs.For the implementer
Re-verify every line number above against current
mainbefore editing. Write the fresh token to a mode-600 temp file rather than an argv or env interpolation. Extend each repo's existing entrypoint test (e.g. wasm-runner'stests/test-entrypoint-config-load-failure.sh, which extracts the# BEGIN CONFIG LOADblock and stubscurl) with both a success case and ajq-exits-127 stub, so a dev machine that happens to havejqcannot mask the gap. These repos have no PR CI (onlysync-fork-*.yml), so runtests/*.shlocally. Dev verification afterwards is agent-doable via.claude/scripts/dev-remake.sh.Removing
Human Neededon all five; moving to Backlog.birme commentedon Nov 8, 2026
Moved back to Backlog by daily-review (Step 6c). PR #41 is merged but is
Part of #39(Stage 1 only); Stage 2 (app-visibleOSC_ACCESS_TOKENbecomes the 1h PAT, shipped with theREJECT_RUNNER_REFRESH_TOKENSrollout) is not shipped and no other open ticket owns it. dotnet-runner#32 and golang-runner#33 are in other repos. Needs re-spec by daily-triage.eyevinn-developer commentedon Nov 8, 2026
Spec Invalid
Attempted
Read the issue and all comments, then checked the repo state before writing code. PR #41 ("working runner token exchange + OSC_REFRESH_TOKEN (stage 1 of #39)") is MERGED (2026-11-08T11:52:35Z). No other PR or open issue exists in python-runner.
What the triage directions claim
The architect triage describes Stage 1 (body-correct exchange,
OSC_REFRESH_TOKEN,[CONFIG]warning, redaction, README, tests) and an optional swap (app-visibleOSC_ACCESS_TOKENbecomes the 1h PAT) that needsContract change approved by birme: <url>.What is actually true
REJECT_RUNNER_REFRESH_TOKENSrollout.Contract change approved by birme: <url>line exists on the ticket, and no ticket owns Stage 2 (daily-review's Step 6c comment says the same).Why this blocks implementation
Implementing Stage 2 now would contradict birme's explicit decision, and the app-visible token swap is a contract change that regresses any My App calling a platform API more than an hour after boot.
What a re-spec must resolve
REJECT_RUNNER_REFRESH_TOKENSrollout ticket in token-service / infra-osaas is in progress), with the approval line on it.Automated by backend-developer agent
birme commentedon Nov 8, 2026
Architect Triage
Classification: LARGE (decompose: one child that owns Stage 2; nothing is left for an implementer under #39 itself)
Necessity-test arm: treated
Re-spec: 1 prior
## Spec Invalid(eyevinn-developer, 2026-11-08T17:23Z). Its "What is actually true" verified below.Corrects the prior spec: the triage of 2026-11-08T07:01Z directed Stage 1 plus an optional swap under this ticket. Stage 1 has shipped (PR #41), and birme's decision (#39 (comment)) moved the swap to the
REJECT_RUNNER_REFRESH_TOKENSrollout, for which no ticket exists. Replaced with: this ticket gets one child that owns Stage 2 for every runner the decision covers, created in Triage withHuman Needed, and released by birme's rollout call. #39 goes to In Review withDecomposedand closes when that child closes. Nothing goes to Backlog, so no implementer is sent to find nothing to do (the cause of the Spec Invalid).Premises verified (python-runner
4e01bf2=main, osaas-deploy-manager0d7b430)main. PR fix: working runner token exchange + OSC_REFRESH_TOKEN (stage 1 of #39) #41 merged 2026-11-08T11:52:35Z (merge4e01bf2), bodyPart of #39. Inscripts/docker-entrypoint.sh:export OSC_REFRESH_TOKEN="${OSC_REFRESH_TOKEN:-$OSC_ACCESS_TOKEN}"at:236, a JSON body from a mode-600 file at:238-247, anodeparse at:248-251, a[CONFIG] WARNINGwith status and code only at:258, the fresh token passed inline at:278(OSC_ACCESS_TOKEN="$config_token" timeout 60s npx ...), andOSC_REFRESH_TOKENin theredact_config_logloop at:213. Tests are intests/test-entrypoint-runner-token-refresh.sh. No open PR or other open issue exists in this repo.main. The shell'sOSC_ACCESS_TOKENis never assigned, and the success test asserts that the app sees the original token (tests/test-entrypoint-runner-token-refresh.sh:66,APP_TOKEN=$OSC_ACCESS_TOKEN).OSC_ACCESS_TOKENandCONFIG_SVCat:223. deploy-manager setsOscAccessTokenonly insideif (params.configService)(src/apps/python.ts:131-161), so there is no python app that holds a runner-refresh token and skips the exchange. In python-runner, Stage 2 is theif [ -n "$fresh_token" ]branch at:253-254.gh search issues REJECT_RUNNER_REFRESH_TOKENS --owner Eyevinnfinds no open rollout ticket. The only open hits are this ticket, python-job-runner#6 and osaas-app#7052.Requirement map (every acceptance criterion and change item of #39, plus the Stage 2 work that birme's decision defers in the sibling tickets)
{"token": ...}(body)OSC_ACCESS_TOKENbecomes the 1h PAT (body; birme's decision: Stage 2 ships with theREJECT_RUNNER_REFRESH_TOKENSrollout, not before)OSC_REFRESH_TOKENplus docs (body)[CONFIG]warning instead of|| true(body)Contract change approved by birme: <url>" (body)Child S2 (created by the orchestrator after review)
Title:
Stage 2 of #39: app-visible OSC_ACCESS_TOKEN becomes the 1h PAT in the python, golang, dotnet and python-job runners, with the REJECT_RUNNER_REFRESH_TOKENS rollout. It is created in Triage withHuman Needed. The decision it waits for is birme's call to start the prod rollout of the flag.Directions it carries, re-verified against
mainwhen released:export OSC_ACCESS_TOKEN="$fresh_token"in the:253-254branch. Intests/test-entrypoint-runner-token-refresh.sh, flip the success case so thatAPP_TOKEN=freshandREFRESH=orig-token-secret. Keep the failure cases, which must still showAPP_TOKEN=orig-token-secret.OSC_ACCESS_TOKEN. If it cannot, record it as exempt, as birme's decision does for wasm-runner. web-runner and php-runner already swap.E2E Impact
Verdict: None
Same grep as the 2026-11-08T07:01Z pass, re-run with no new hits:
python-runner|eyevinn-python-runner|OSC_ACCESS_TOKEN|runner-token|OSC_REFRESH_TOKENinosaas-e2e-teststests/andutils/. No spec boots a runner pod, so none asserts which token the entrypoint hands to the app.Existing test coverage:
tests/test-entrypoint-runner-token-refresh.sh(Stage 1, 9 cases). Child S2 flips its success assertion.Guard tests lifted: None for #39. Child S2 flips
tests/test-entrypoint-runner-token-refresh.sh:66(the success case asserts the original token is visible to the app). It is not ADR-pinned: there are 0ADR-hits intests/. The flipped success case is its replacement protection.Necessity test
Split decision: split.
REJECT_RUNNER_REFRESH_TOKENSrollout, not before", and #109 says the rollout is "birme's call". Merged earlier, Stage 2 reaches prod at the next unrelated runner release and breaks long-running apps after one hour (the regression the decision names). Reason 2 also applies: it spans four runner repos and deploy units.10 of 10 requirements (R1-R10) are owned: 6 by merged PR #41 or existing tickets, and R2, R6 (Stage 2 part), R7 (approval line), R9 and R10 by S2.
Human steps
REJECT_RUNNER_REFRESH_TOKENS(reply on S2, addagent-actionable)Scope reductions
None. Stage 2 is sequenced into child S2, which contains it literally. The start condition (with the rollout, not before) is birme's own decision, not a cut.
Automated triage by architect agent
birme commentedon Nov 8, 2026
Architect Review (BLOCK)
Verdict: BLOCK (architect-reviewer, scope gate). Nothing was created or moved. All findings are
spec_fix; none needs a new decision from birme.tests/test-entrypoint-runner-refresh.sh:211-212(case 10, "entrypoint never assigns OSC_ACCESS_TOKEN= inside the refresh block (Stage 2 swap)") forbids. It is not ADR-pinned (0ADR-hits, noadr/reference). The guard scan reads only*.test.*files and misses.shguards. Needed: name this test and case 10 as lifted,not ADR-pinned; name the replacement protection (flipped success case asserting the app sees the fresh token) with its own AC; forbid moving the swap outside the markers to keep the guard green.OSC_ACCESS_TOKEN(exec python job.py) and PR Strip embedded credentials from GIT_HOST to prevent PAT leak #8's test reads it at:73. Needed: remove the exemption branch, cite the Scrub PAT from origin remote URL after clone (security fix) #6 evidence, require the swap.tests/test-entrypoint-runner-refresh.sh:131-137, dotnet-runner:125, python-job-runner PR Strip embedded credentials from GIT_HOST to prevent PAT leak #8:73; python-runner's assertion is at:75on4e01bf2, not:66. Needed: AC3 names each success assertion and says to flip it; failure-path and jq-127 "unchanged" assertions stay (e.g. dotnet:144).Blocked by: Eyevinn/python-job-runner#6on its own line (a leaf), explanation on the next line.[CONFIG] WARNINGnaming HTTP status and error code on every failure path, but merged golang/dotnet Stage 1 prints different text and leavesOSC_REFRESH_TOKENunset on 401. Needed: reword so each runner keeps its Stage 1 failure behaviour as pinned by its existing tests and the app sees the original token.Closes Eyevinn/python-runner#39without birme's caveat ("Whoever closes these tickets must not treat the tenant's report as resolved by them"). Needed: add to S2's closing statement that the nordiccare report (Slack, 2026-11-05) is not resolved by this work.README.md:61callsOSC_REFRESH_TOKEN"the original long-livedOSC_ACCESS_TOKEN". Needed: AC4 requires each runner's READMEOSC_ACCESS_TOKENrow to say it is a 1-hour PAT renewed withOSC_REFRESH_TOKEN.One revision cycle follows in the same run.
birme commentedon Nov 8, 2026
Architect Triage (revision after Architect Review BLOCK)
Classification: LARGE (unchanged), one child S2 in Triage with
Human Needed. This revises the proposal in #39 (comment) and applies all 7 findings of #39 (comment) in one pass. Delta only; everything else in the earlier triage stands.Changes to the S2 body:
config_access_token="$refresh_token",scripts/docker-entrypoint.sh:167-168at5d526be, inside# BEGIN runner-refresh..# END runner-refresh). It namestests/test-entrypoint-runner-refresh.shcase 10 (:211-215) as lifted,not ADR-pinned(noADR-reference in the file, noadr/file names it), and forbids moving the swap outside the markers. New AC6: case 10 is replaced by a case asserting the refresh block holds exactly oneexport OSC_ACCESS_TOKEN=line, plus the flipped case 1. dotnet-runner (:135-196atc5fbca0) has no such guard; scope item 3 says so.exec python job.py(scripts/docker-entrypoint.sh:158on PR fix: make runner refresh exchange work (Stage 1) python-job-runner#8 headc282c8e), PR Strip embedded credentials from GIT_HOST to prevent PAT leak #8's test reads the job's token at:73, and the Scrub PAT from origin remote URL after clone (security fix) #6 triage (Runner refresh exchange always fails (see python-runner#39) python-job-runner#6 (comment)) found the same. AC5 is now "swap applied, no exemption". R10's citation includes the Scrub PAT from origin remote URL after clone (security fix) #6 triage.:75(on4e01bf2,main), golang-runner case 1:133(SHELL_TOKEN;:134andFRESH_EXPORTED=0at:135stay), dotnet-runner:125(:126and:144stay), python-job-runner:73onc282c8e(:74stays). Every failure-path assertion stays.Blocked by: Eyevinn/python-job-runner#6on its own line, with the explanation on the next line.OSC_REFRESH_TOKENunset on a 401 withrefresh_token_expired,refresh_token_revokedorrefresh_token_invalid), and the app sees the original token.What a human does nextand the last PR's body state that the nordiccare report (Slack, 2026-11-05) is not resolved by this work, quoting birme's decision.OSC_ACCESS_TOKENrow to say it is a 1-hour PAT renewed withOSC_REFRESH_TOKEN(python-runner:60, golang-runner:22, dotnet-runner:20, python-job-runner:16) and corrects the lines that say the app keeps the original token (python-runner:61, golang-runner:98, dotnet-runner:26).Guard tests lifted: golang-runner
tests/test-entrypoint-runner-refresh.shcase 10,not ADR-pinned, replaced per AC6. Othertests/*.shin golang-runner, dotnet-runner and python-runner grepped forOSC_ACCESS_TOKENassertions: none other.Scope reductions
None.
scope-cut-lint.shon the revised proposal: 13 findings, the same count as the earlier proposal; the one phrase hit is the quoted closing text of golang-runner#32 ("deferred to that rollout"), and the pointer hits are context references to closed Stage 1 tickets and osaas-token-service#109.birme commentedon Nov 8, 2026
Decomposition (scope gate cleared)
architect-reviewer verdict: APPROVE on re-review (one BLOCK cycle before it). Stage 1 of this ticket is merged (python-runner PR #41,
4e01bf2; golang-runner#32, dotnet-runner#31, wasm-runner#37 closed). The only unowned remainder is Stage 2.OSC_ACCESS_TOKENbecomes the 1h PAT (python, golang, dotnet, python-job runners), released with theREJECT_RUNNER_REFRESH_TOKENSrolloutCriterion or pointer -> ticket: R1, R3, R4, R8 -> done (PR #41, sibling tickets); R2, R5-R7, R9-R13 -> #42; Stage 2 pointers in golang-runner#32, dotnet-runner#31, python-job-runner#6/PR #8 -> #42.
This parent stays OPEN and moves to In Review with the
Decomposedlabel; it closes when #42 closes.