fix(b-19): writer-env-fix uses PAT-implicit projectToken.project (replaces null-returning project(id))#161
Merged
Merged
Conversation
…urning project(id))
B-19 root cause (R5-verified from run 25848523618 jq error 'Cannot iterate over null'):
The PAT-scoped GraphQL query 'query env($projectId){ project(id:$projectId){ ... } }'
returns {data:{project:null}} because PAT tokens bind to ONE project implicitly,
and the explicit id arg selects a different project the token cannot read.
Fix (mirrors wave-a-massive.yml line 28, last good run 25754312720 @ 2026-05-12 18:31Z):
Replace project(id:$x) with PAT-implicit projectToken.project query — no id arg,
no variables, the token's bound project is returned directly.
Also corrects project_ids (now informational-only since query is PAT-implicit):
IGLA_PROJECT_ID: e4fe33bb (WRONG, PAT had no access) -> f29aa9dd (IGLA RACE, ACC1 PAT)
ACC2_PROJECT_ID: 12c508c7 (WRONG, PAT had no access) -> ad0f8f04 (IGLA, ACC2 PAT)
Verified by token-classify.yml run 25846091578.
Closes #160 (B-19). Cross-links #156 (B-17 misdiag).
This was referenced May 14, 2026
This was referenced May 16, 2026
gHashTag
added a commit
that referenced
this pull request
May 16, 2026
…carab:v4 (#216) - Add docs/DEPLOY_SOVEREIGN_SCARAB_V4.md: NASA-style Russian deploy guide for 27 sovereign-scarab services on Railway - Add railway.toml.template: per-service config stub with env stubs, healthcheck NONE (heartbeat via DB), image reference - Covers: env vars, Railway UI path, Railway CLI steps, 3-account distribution (9 per ACC1/ACC2/ACC3), smoke-test SQL, acceptance criteria G-SS-04 / G-SS-05, rollback via ssot.pause_scarab() - Notes: mass-deploy workflows deprecated (PR #214 merged); post-deploy management via queen-hive-mcp (L-SS3, PR #161) - Anchor: phi^2 + phi^-2 = 3 Closes #210 Co-authored-by: Queen Hive Bot <queen-hive@trinity.local>
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.
B-19 —
writer-env-fix.ymlresolve_envreturns null under PATCloses #160.
Cross-references #156 (B-17 misdiag).
Successor of #159 (B-18 Bearer→PAT, merged 07:47:19Z).
Root cause (R5-verified)
Dispatch run 25848523618 failed with
jq: error (at <stdin>:1): Cannot iterate over null (null)at stepresolve_env— the GraphQL response was{"data":{"project":null}}.The query was:
Under a Project-Access-Token (PAT), Railway's
project(id:$x)returns null when$xreferences a project the PAT does not control — and PATs are scoped to exactly one project (verified by token-classify.yml run 25846091578).The previous
IGLA_PROJECT_ID/ACC2_PROJECT_IDenv vars (e4fe33bb/12c508c7) referenced different projects than whatTOKEN_ACC1/TOKEN_ACC2are bound to.Fix (mirrors working sibling wave-a-massive.yml#L28)
Replace the explicit-id form with the PAT-implicit form:
{ projectToken { project { environments { ... } } } }No
$projectIdvariable, noidargument — the token's bound project is returned directly. This is the canonical pattern used bywave-a-massive.yml(last good run 25754312720 @ 2026-05-12 18:31Z).Both
resolve_env()andfetch_services()helpers are migrated.Secondary fix — informational project IDs
For audit-trail clarity (the env vars now have no functional effect, since the query is PAT-implicit), the values are also corrected to match what each PAT actually controls:
IGLA_PROJECT_IDe4fe33bb-3b09-4842-9782-7d2dea1abc9bf29aa9dd-ca0b-460f-ad24-c7680c6717fb(IGLA RACE, ACC1)ACC2_PROJECT_ID12c508c7-1196-468d-b06d-d8de8cb77e93ad0f8f04-c56d-4b11-9350-cc0c2700b9db(IGLA, ACC2)Acceptance
After merge:
gh workflow run writer-env-fix.yml --repo gHashTag/trios-railway -f confirm=PHIsuccess(no exit 4, no exit 5).SELECT EXTRACT(EPOCH FROM (NOW()-MAX(ts)))::int AS stale_sec FROM ssot.bpb_samples WHERE canon_name LIKE 'IGLA-SHORT-WAVE-MATRIX-%';returns < 600 within T+10 min.Anchor
φ² + φ⁻² = 3 · TRINITY · NEVER STOP · DOI 10.5281/zenodo.19227877