Skip to content

revert(ci): back out the GCP SA key ratchet, keep its setup-doc fix - #12183

Merged
undivisible merged 1 commit into
BasedHardware:mainfrom
aryanorastar:revert/11125-gcp-sa-key-ratchet
Aug 25, 2026
Merged

revert(ci): back out the GCP SA key ratchet, keep its setup-doc fix#12183
undivisible merged 1 commit into
BasedHardware:mainfrom
aryanorastar:revert/11125-gcp-sa-key-ratchet

Conversation

@aryanorastar

@aryanorastar aryanorastar commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Reverts #11125. Details and reproduction in #12182.

Why

The ratchet shipped with two defects that compound, and the first hides the second.

1. Dead trigger paths break manifest resolution for every PR. It declares backend/agent-proxy/main.py and backend/agent-proxy/Dockerfile; neither exists. run_checks.py:187 existence-checks any trigger without glob magic and fails the whole resolution when one is missing — before any check runs:

FAIL: could not resolve manifest checks: gcp-sa-key-ratchet: explicit trigger path does not exist: backend/agent-proxy/main.py; gcp-sa-key-ratchet: explicit trigger path does not exist: backend/agent-proxy/Dockerfile

So it breaks every consumer of the manifest, not the ratchet alone. #12181 touches three desktop Swift files and no backend, and lost Detect Desktop Swift Changes, Desktop Swift Build & Tests, Hygiene, and PR Metadata Preflight to it.

2. The ratchet has never passed its own baseline. Defect 1 masks this — the check cannot run, so nobody saw it fail. Fix the paths and it executes for the first time and fails on pristine main with 13 findings. Twelve are stale-shrink (baseline allows N, tree has 0), several of them for backend/agent-proxy/* — the same nonexistent paths, so the baseline was generated against a tree this repo does not have. One is not a shrink:

backend/database/google_credentials.py:service-account-json-env: found 6, baseline allows 1

That is the ratchet's real failure mode — new key paths — firing on a file main has not modified. The cap was wrong when written rather than something having regressed since.

This is why I am reverting rather than sending the one-line trigger-path fix: on its own it converts a broken-manifest error into a red credential check on every PR, which reads as a real security finding and is worse than the current state.

--write-baseline "never raises existing caps" and refuses to add keys or raise counts, so found 6, allows 1 cannot be corrected with the tool. It needs either removing the key paths from google_credentials.py (a real move toward ADC / Workload Identity, which is the ratchet's stated purpose) or a baseline edit under security review. Both belong to someone who owns that area.

What this costs

Nothing that currently works. The check has never executed, so no key path is protected by it today. Reverting restores green immediately.

Re-landing

Straightforward once the baseline question is settled: generate the baseline against this tree, and use backend/agent-proxy/** as the trigger — run_checks.py:187 exempts globs from the existence check, so the surface stays covered if agent-proxy ever lands, without asserting it exists now. Happy to do that re-land.

Deliberately kept

The docs/doc/developer/backend/Backend_Setup.mdx change is restored verbatim, not reverted. It replaces this:

cp ~/.config/gcloud/application_default_credentials.json ./google-credentials.json

with ADC guidance and an explicit "do not copy a service-account JSON key into the repo". That improvement has no CI dependency and stands on its own; reverting it would put the copy-a-key-into-the-repo instructions back in the setup guide.

Verification

  • Manifest audit on this branch: 0 broken explicit trigger paths, 0 missing command paths, 150 checks (was 152), 0 duplicate ids.
  • run_checks.py --lane ci --list resolves clean.
  • grep for gcp_sa_key_ratchet / gcp-sa-key-ratchet across the tree: 0 remaining references, so nothing dangles.
  • Diff is 4 files, deletions only; Backend_Setup.mdx is byte-identical to its post-fix(ci): ratchet long-lived GCP SA key paths (#6800) #11125 state.

Failure-Class: none

Review in cubic

Reverts BasedHardware#11125. The ratchet shipped with two defects that compound, and the
first hid the second (see BasedHardware#12182).

It declared backend/agent-proxy/main.py and backend/agent-proxy/Dockerfile as
trigger paths and neither exists. run_checks.py:187 existence-checks any
trigger without glob magic and fails the whole manifest resolution when one is
missing, before any check runs -- so this broke every consumer of the manifest,
not the ratchet alone. BasedHardware#12181 touches three desktop Swift files and no backend,
and lost Detect Desktop Swift Changes, Desktop Swift Build & Tests, Hygiene and
PR Metadata Preflight to it.

Making resolution succeed only moves the failure: the ratchet then runs for the
first time and does not pass its own baseline, on pristine main, with 13
findings. Twelve are stale-shrink entries -- several for backend/agent-proxy/*,
the same paths that do not exist. One is not:
backend/database/google_credentials.py:service-account-json-env reports found 6
against a cap of 1, on a file main has not modified, so the cap was miscounted
when written rather than something having regressed. --write-baseline never
raises caps by design, so that one cannot be corrected with the tool; it needs
either real key-path removal or a baseline edit under security review.

Reverting costs nothing that currently works: the check has never executed, so
no key path is being protected by it today. It can be re-landed with a baseline
generated against this tree and backend/agent-proxy/** as the trigger.

Deliberately kept: the Backend_Setup.mdx change, restored verbatim. It steers
local setup to ADC instead of copying application_default_credentials.json into
the repo as google-credentials.json. That improvement has no CI dependency, and
reverting it would put the copy-a-key-into-the-repo instructions back.

Failure-Class: none
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@aryanorastar

Copy link
Copy Markdown
Contributor Author

@undivisible five PRs are sitting with no approving review. Consolidating into one comment rather than pinging five threads.

Thanks for the pass on #11864 earlier — that's why I'm asking you rather than adding to the queue elsewhere.

Please look at this one first — it unblocks everything else

#12183 — reverts #11125, which is mine and merged broken this morning.

It declared two trigger paths that don't exist, and run_checks.py:187 fails the entire manifest resolution on a missing non-glob trigger, before any check runs. So it reddens every PR, not just its own check. Reproduces on a pristine main checkout with no branch involved.

Underneath that, the ratchet has never passed its own baseline — 13 findings on clean main, including google_credentials.py:service-account-json-env: found 6, baseline allows 1 on a file main hasn't modified. --write-baseline refuses to raise caps by design, so that one needs a real decision, not a patch. Full writeup in #12182.

Reverting costs nothing that works today: the check has never executed. The Backend_Setup.mdx fix is kept verbatim, since reverting it would put cp ~/.config/gcloud/application_default_credentials.json ./google-credentials.json back in the setup guide.

The other four

PR What it is State
#12181 on-device transcription closes a window on the speaker's pause instead of a fixed 10 s boundary — mean latency 4.97 s → 0.74 s, spread 6.6 s → 0.5 s, measured on a real mic red only from the #12183 bug above; verified locally, 18/18 tests, preflight 22/22
#11804 transcript-driven proactivity, dogfood-flagged hard-off on every shipped bundle green, zero outstanding technical items
#10960 fix(ci): retire superseded Windows release sync PRs green, open since Aug 1
#11183 feat(backend): split X connector sync into its own Cloud Run Job green, open since Aug 6

#10960 and #11183 both had a review that was later dismissed, so they've been sitting with nothing on them since.

On #11804 specifically — worth knowing before you open it: @Git-on-my-level has written "no blocking technical issues found" across five passes, but those were issue comments rather than submitted reviews, so none of them count toward the approving-review gate. The only formal review on it is a COMMENTED from Aug 18. It looks reviewed and isn't.

I'm not asking anyone to rubber-stamp. #11804 has a real product question attached — unprompted speech-triggered responses — that's genuinely a human call and I'd rather have a "no" on it than more silence. #12183 and #12181 are the ones where I think the path is clear.

#12183 has two long-running desktop compiles still in flight as I write this; nothing failing.

@undivisible
undivisible merged commit 7ebe8b1 into BasedHardware:main Aug 25, 2026
30 checks passed
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.

2 participants