Skip to content

[ROB] [MA] Do Not Merge Yet: UM-1676 ios-ship Producer Service-Token Transition - #2086

Open
jaywedgeworth22 wants to merge 3 commits into
mainfrom
Muse-Assist/um-1676-ios-ship-service-tokens
Open

jaywedgeworth22 wants to merge 3 commits into
mainfrom
Muse-Assist/um-1676-ios-ship-service-tokens

Conversation

@jaywedgeworth22

@jaywedgeworth22 jaywedgeworth22 commented Nov 23, 2026 •

Copy link
Copy Markdown
Member
  1. Un-draft [CODEX:   EE.1.S] Do Not Merge: Use Synced ASC Credentials #2083 and merge it; its consumer scripts already read only the synced environment tuples this step provides.
    Refs UM-1676

Summary

Do Not Merge Yet — UM-1676: transitions the ios-ship producer to qualified finite read-only service tokens in place of the shared Universal Auth machine identity. Behavior is otherwise unchanged and remains unverified in a live run.

Changes

  • Replaced INFISICAL_UNIVERSAL_AUTH_CLIENT_ID/SECRET and legacy INFISICAL_CLIENT_ID/SECRET inputs with INFISICAL_UM_ASC_READ_TOKEN and INFISICAL_UM_DIST_READ_TOKEN.
  • Removed infisical login --method=universal-auth token exchange; workflow now validates and masks the two provided single-line service tokens directly.
  • Scoped secret reads: ASC credentials (ASC_KEY_ID, ASC_ISSUER_ID, ASC_KEY_P8) use the ASC token against Fleet-OPS prod /asc, and distribution certificate material (IOS_DIST_P12_BASE64, IOS_DIST_P12_PASSWORD) uses the DIST token against this app’s prod /.
  • Updated cleanup to unset the service-token variables.

Operational impact

  • Requires INFISICAL_UM_ASC_READ_TOKEN and INFISICAL_UM_DIST_READ_TOKEN GitHub secrets to be staged; missing bindings now fail with an explicit UM-1676 error. Least-privilege access is intended, with no change to shipped artifacts when tokens are correctly provisioned.

Verification and risks

  • Automated code review reported no issues. No test evidence, runtime verification, approval, or deployment is claimed from the patch. Merge remains blocked pending provisioning of the staged service tokens and an unverified end-to-end ship run.

@linear-code

linear-code Bot commented Nov 23, 2026

Copy link
Copy Markdown

UM-1676

@kody-ai

kody-ai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Kody Review Complete

Great news! 🎉
No issues were found that match your current review configurations.

Keep up the excellent work! 🚀

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Validate Business Logic: Ask Kody to validate your code against business rules by adding a comment with the @kody -v business-logic command.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ✅

Access your configuration settings here.

​

@kody-ai

kody-ai Bot commented Nov 23, 2026

Copy link
Copy Markdown

Automatic approval held

Kody's assessment:

Risk was identified in this PR.

@swu-rob

swu-rob Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

CI status note (MA, 2026-11-22): the verify job at head 8385985 fails in its final step, in scripts/test-ios-stage-asc-key.sh.  That test exercises this workflow's signing run block with a fake Infisical CLI and pins the retired design: its fake CLI answers a Universal Auth login call and its harness exports the machine-identity client id/secret.  Under this PR's service-token step the run block fails closed, as designed, so the outdated test fails.

An updated test exists and is locally verified: green against this PR's workflow ("synthetic ASC key-file and workflow handoff passed") and red against the old workflow.  It drops the fake login case (any non-secrets subcommand now fails), asserts each read arrives under its own scoped token (ASC names under INFISICAL_UM_ASC_READ_TOKEN, certificate names under INFISICAL_UM_DIST_READ_TOKEN), and exports synthetic service tokens in the harness instead of the machine-identity pair.

The updated test file cannot be pushed from here: the git relay refused the write as credential-shaped (refused_secret, assigned_credential).  Per the standing scanner rule, that packet stops here without retry or rerouting; landing it needs Jay's decision on the packet.  Everything else in verify passed, and every other check on this PR is green (CodeQL, build, smoke, gitleaks, check-pin, scheduled backstop gate, Kody Code Review, auto-merge).  The one script ordered after the failing test in that CI step (test-ios-fleet-appupdate-pin.sh) did not run; it is independent of this workflow change.

This PR stays draft with its Do Not Merge Yet title regardless: the repo-secret binding step still comes first, as described in the body.

@swu-rob

swu-rob Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Secret binding status (MA, 2026-11-22 night, per Jay's directive): the two GitHub secrets for this transition are NOT set yet.  Route attempted in order: (1) Fleet Tools relay - verified against the full 470-tool catalog (snapshot and live list) that no relay verb can set GitHub Actions secrets at org or repo level; the nearest verbs (gr_wf_repo_variable_*) are explicitly non-secret variables.  The deficiency is logged as a new row in the Fleet GitOPS document "gr_ Fleet Tool Deficiencies + gh Fallback Log", and a complaint was posted to Echo and Wise in Zulip #Side-Chats (message 642779085).  (2) gh fallback on the VM - blocked: gh auth status reports "You are not logged into any GitHub hosts", so gh holds no identity here; per the standing rules I did not borrow another seat's credential and the PAT route is closed.  Planned binding once a route exists: org secret INFISICAL_ASC_READ_TOKEN on Simple-With-Us (fleet-wide ASC read; Jay's ruling tonight) and repo secret INFISICAL_UM_DIST_READ_TOKEN on this repo.  This workflow still references secrets.INFISICAL_UM_ASC_READ_TOKEN; I did not rename that reference to the org name because the org secret does not exist yet - the rename lands with the binding.  State at this head (8385985): draft, checks 9/10 (verify fails on the scanner-fenced test-ios-stage-asc-key.sh, awaiting Jay's ruling), 0 review threads.

@swu-zc

swu-zc Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

[ZC:   OO.3.M]

In step "Test the scheduled iOS ship gate" (run 45113454641) the suite prints passed=27 failed=0 and "all tests passed", then a later sub-command in the same step exits 1 with no diagnostic output, so the failure itself is silent.  The step runs several sub-commands back to back and, without tracing, the exiting one is not named; the likely candidates are test-ios-stage-asc-key.sh or the appupdate-pin test.  Running the step with set -x, or splitting the sub-commands so each is its own named step, would name the exiting command on the next run.

@swu-rob

swu-rob Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Fleet PR drive update (MA, 2026-11-24): the owner approved the prepared test-file packet tonight and one byte-exact attempt was made to land the updated scripts/test-ios-stage-asc-key.sh (prepared file verified byte-identical to the branch file plus the prepared edits).  The relay refused it again with refused_secret / assigned_credential; per the standing scanner rule the packet is stopped with no retry, peel, or reroute.  This PR remains unmerged for two independent reasons: the verify check stays red until that test lands, and the GitHub secrets INFISICAL_UM_ASC_READ_TOKEN and INFISICAL_UM_DIST_READ_TOKEN do not exist yet, so merging would break the ios-ship signing step by its fail-closed design.  Next step is the secret binding (owner-side), then this test packet decision, then merge.

@swu-rob

swu-rob Bot commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Packet reconciliation record (MA, 2026-11-25, worked with Echo in Zulip #Side-Chats, topic "Relay gap: no GitHub Actions secret verb"):

Canonical packet of record for this PR — the updated scripts/test-ios-stage-asc-key.sh prepared for this branch on 2026-11-22.  The prepared file was located in MA's working records today and re-verified byte-for-byte: 9,132 bytes, sha256 ecd4441bf976a4224d85ae2fcbfdc44539ba550cd98f4ba193258453ea7e07fb, git blob 0b708ebc1f4258c2861a99547f4ba122030c4541, against base blob 046c9f88ac50c4253231bde294f665599bf73410 (8,585 bytes), which still matches the file at this PR's current head 7ca6d1338f3ac5115ff0b261660a89e8f2ea4870.  Its full change from base is two hunks: the fake Infisical CLI loses its Universal Auth login case and instead asserts each secrets read arrived under its own scoped token (ASC names under the ASC read token, certificate names under the distribution read token), and both harness invocations pass INFISICAL_UM_ASC_READ_TOKEN / INFISICAL_UM_DIST_READ_TOKEN instead of the Universal Auth client id/secret.  It was locally verified green against this PR's workflow and red against the old workflow.  This is the packet refused in comments 7091993214 and 7123676199.

Second variant on the fleet record — Echo cited a different result for the same file and base blob in Zulip message 643452866: 9,487 bytes, sha256 573d3ee344712b58d69704eb2b5c81eee27524ffe7356742ae8d198c06ed205b.  That content is not on this PR and was not retrievable from any record MA can read; MA has asked Echo for its diff against the base (Zulip message 643482640) so the two can be reconciled line by line.  Until Echo supplies it, the variant above is the only packet of record for this PR, and Echo's variant stands as an unreconciled separate version — not merged into this PR's record and not the version any future publication attempt would use without a fresh reconciliation.

Status, unchanged — the canonical packet remains blocked by the relay scanner (refused_secret / assigned_credential, retryable false).  No publication, retry, split, or transform was attempted in this reconciliation.  The packet can land only under an owner decision creating a publication route for it.  Separately, the owner released both PR holds on 2026-11-25 and ordered UM#2083 merged first, then this PR.

@swu-rob

swu-rob Bot commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

[MA] Owner release and merge order (Jay, 2026-11-25): "Don't wait for codex" — "Merge that PR if ready then merge yours".

The Do Not Merge Yet hold on this PR is released by the owner.  #2083 has merged first, as ordered (squash 19dc3aa, verified on main), so this PR is next.

Consequence, stated plainly: the GitHub secrets INFISICAL_UM_ASC_READ_TOKEN and INFISICAL_UM_DIST_READ_TOKEN are still not bound on this repo, and no relay verb can set them.  Merging this PR changes only .github/workflows/ios-ship.yml.  That workflow runs on pushes to main touching ios/, the workflow file, or scripts/ios-fleet/, and on its twice-hourly schedule; its signing step fails closed with the explicit UM-1676 error while the bindings are missing, so no ship can sign until the secrets are set.  The binding step remains outstanding after this merge.

Gate state at this head: every check is green except verify, whose only failure is the outdated scripts/test-ios-stage-asc-key.sh documented in comment 7091993214 — the updated test is the scanner-refused packet of record (comment 7155341316) and cannot be landed through the relay.  On ZC's note (comment 7121517675): the silently exiting sub-command in that step is the same test-ios-stage-asc-key.sh failure identified in comment 7091993214; the step-splitting suggestion is a CI visibility improvement, not a blocker for this diff.

Under the owner's direct order, MA is marking this PR ready and attempting the guarded merge at this head; the merge gate's answer will be recorded here.

@swu-rob
swu-rob Bot marked this pull request as ready for review November 25, 2026 07:03
@swu-rob

swu-rob Bot commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

[MA] Merge attempt result (2026-11-25): the guarded squash merge at head 7ca6d13 was attempted once under the owner's order and GitHub refused it — HTTP 405, a merge block (relay result: relay_refused / github_refused, retryable false).  That is the branch-protection gate doing its job: verify is red at this head for the one fenced reason documented above, so the merge does not pass.

Nothing was bypassed: no check was disabled, no protection was changed, and the refused test packet was not retried, split, or transformed.  This PR is now marked ready and stays open, gate-blocked solely on the red verify.  It merges as soon as the canonical updated test (comment 7155341316) lands through an owner-created publication route, or verify otherwise goes green without touching that packet.  The repo-secret binding (INFISICAL_UM_ASC_READ_TOKEN / INFISICAL_UM_DIST_READ_TOKEN) remains the separate ship-time remainder.

@swu-rob

swu-rob Bot commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

[MA] Correction and org-secret binding (2026-11-25, per the owner's ruling that these credentials are not UM-specific and must be org secrets without the UM label):

Correction of my earlier claim.  My statement on this PR (comment 7092928915 and the UM-1676 close-out records) that no relay verb can set GitHub secrets was wrong.  It was based on a stale 470-tool snapshot of the Fleet Tools catalog.  The current catalog (537 tools) includes full GitHub secret management — gr_wf_secret_put_org_actions, gr_wf_secret_key_org_actions, gr_wf_secret_repos_set_org_actions, plus the repo and environment equivalents.  Echo was right; the relay does allow org secret management.

Bindings now in place (verified by listing org secrets after the puts).  Simple-With-Us organization, Actions scope, visibility "all":

  • INFISICAL_ASC_READ_TOKEN — the asc-read service token (Infisical token um-ci-asc-read, id a90e03c8-f92d-43ce-bfe3-f572a3b6fca1, read-only, expires 2027-02-21).  Its actual scope, verified from Infisical: Fleet-OPS prod /asc only — ASC_KEY_ID, ASC_ISSUER_ID, ASC_KEY_P8, the shared App Store Connect credentials every app's ship pipeline uses.
  • INFISICAL_DIST_READ_TOKEN — the dist-read service token (um-ios-ship-dist-read, id 95294e07-702d-4ba6-99e1-aefacd2ffa9f, read-only, expires 2027-02-21).  Its scope: Usage-Monitor prod / (root), which holds IOS_DIST_P12_BASE64 and IOS_DIST_P12_PASSWORD.  The P12 is the team keychain bundle; it contains the Apple Distribution certificate for team CC8UTF7ATG (Jay Wedgeworth, LLC) — the team distribution cert, not an app-specific cert.

Values were fetched from Infisical in-process, sealed with the org Actions public key (libsodium sealed box, key_id 3380204578043523366), and put through the relay; no value was written to any file, log, or command line.  Visibility "all" matches the fleet's existing org-secret pattern (for example INFISICAL_CLUTCH_ASC_READ_TOKEN) and covers every iOS-shipping repo in the org: Usage-Monitor, Congress.Trade, Socratic-Trade, CodeCaps, HogHunter, Clutch, DealDex, ContactLogo.  Two relay deficiencies were hit and are being logged to the Fleet GitOPS deficiency document: (1) gr_wf_secret_repos_set_org_actions returns invalid_argument for any selected_repository_ids payload (reproduced on the variable repos-set verb as well), so per-repo selected visibility could not be set through the relay; (2) see the rename note below.  Proven so far: both secrets exist at org level with visibility "all".  Unproven until a workflow run resolves them: workflow-time visibility.  All eight consumer repos are public, so the historical Free-plan limitation (org secrets do not reach private repos) does not apply to this set.

Rename status — blocked on a relay permission, content ready.  The workflow rename (INFISICAL_UM_ASC_READ_TOKEN → INFISICAL_ASC_READ_TOKEN, INFISICAL_UM_DIST_READ_TOKEN → INFISICAL_DIST_READ_TOKEN in .github/workflows/ios-ship.yml) is prepared and staged on GitHub as blob 60d3c67f4cc4600fe615794f7a65c465f69cb568 (30,103 bytes), but no relay route available to MA can commit it: gr_wf_file_patch refuses with bad_request_workflow_path_permission (this seat's GitHub App does not hold the workflows permission), gr_wf_git_tree_create refuses workflow paths (workflow_request_refused, with inline text and with a blob reference), and gr_wf_file_put / gr_wf_files_put return GitHub 404 for the workflow path.  The branch therefore still references the old names at head 7ca6d13; committing the staged blob is the one remaining step, and it needs the workflows permission on the relay App (or an equivalent grant).  Checks at the current head: 13 runs, the only failure is verify, on the fenced test file — unchanged.  This PR still must not merge.

@swu-rob

swu-rob Bot commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

[MA] Canonical test packet superseded by the org-secret rename (2026-11-25):

The packet recorded in comment 7155341316 (9,132 bytes, sha256 ecd4441bf976a4224d85ae2fcbfdc44539ba550cd98f4ba193258453ea7e07fb, git blob 0b708ebc1f4258c2861a99547f4ba122030c4541) asserted the retired names INFISICAL_UM_ASC_READ_TOKEN and INFISICAL_UM_DIST_READ_TOKEN and is superseded.

Superseding canonical packet for scripts/test-ios-stage-asc-key.sh, regenerated against the branch's current test file (base blob 046c9f88ac50c4253231bde294f665599bf73410, 8,585 bytes, unchanged): 9,114 bytes, sha256 5582ab48b93e4c988b1bdaf480f84a19970ef1bbad0b40c0a45b4c3343c436fb, git blob 13675a0007f60abae1e6fc80f095dcb30c9cfc9e.  The only difference from the superseded packet is the six token-name references, updated to the org names INFISICAL_ASC_READ_TOKEN and INFISICAL_DIST_READ_TOKEN (three each — the fake CLI's per-read token assertions and both harness invocations).  The regenerated file passes a bash syntax check.

Publication status is unchanged: the packet remains scanner-refused (refused_secret / assigned_credential), and no publication, retry, split, or transform was attempted in this pass.

@jaywedgeworth22
jaywedgeworth22 enabled auto-merge (squash) November 25, 2026 15:15
@github-actions
github-actions Bot disabled auto-merge November 25, 2026 15:15
@jaywedgeworth22
jaywedgeworth22 enabled auto-merge (squash) November 26, 2026 02:58
@github-actions
github-actions Bot disabled auto-merge November 26, 2026 02:59
@jaywedgeworth22
jaywedgeworth22 enabled auto-merge (squash) November 26, 2026 03:03
@github-actions
github-actions Bot disabled auto-merge November 26, 2026 03:03
@swu-rob

swu-rob Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

[MA] Merge criteria re-check (2026-11-25 evening, at the owner's statement that criteria to merge are met):

Live state at head 3f56876: PR open, not draft, mergeable true, mergeable_state blocked, 0 unresolved review threads.  Checks: 9 of 10 green; verify is still FAILURE on this head.

A guarded squash merge was attempted once at this head and GitHub refused it — HTTP 405, a merge block (relay: relay_refused / github_refused, retryable false).  The PR remains open and unmerged.  Nothing was bypassed.

The two known blockers are unchanged at this head: scripts/test-ios-stage-asc-key.sh is still the base blob 046c9f88 (the superseding org-name packet, comment 7156105724, has not landed), and .github/workflows/ios-ship.yml still references the repo secret names INFISICAL_UM_ASC_READ_TOKEN / INFISICAL_UM_DIST_READ_TOKEN rather than the bound org secrets INFISICAL_ASC_READ_TOKEN / INFISICAL_DIST_READ_TOKEN (the staged rename blob 60d3c67f has not landed).  This PR merges as soon as verify goes green; the workflow rename remains blocked on the relay GitHub App's workflows permission.

This branch has not been deployed

No deployments
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