Skip to content

ci: harden Actions supply-chain and PR CI reliability - #11301

Open
undivisible wants to merge 18 commits into
mainfrom
cursor/devops-ci-pipeline-audit-437e
Open

undivisible wants to merge 18 commits into
mainfrom
cursor/devops-ci-pipeline-audit-437e

Conversation

@undivisible

@undivisible undivisible commented Aug 10, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

DevOps/CI audit of BasedHardware/omi with high-confidence, evidence-backed hardening only—no speculative refactors (re-enabling actionlint shellcheck remains deferred; it currently reports ~156 existing findings).

Supply chain

  • Added manifest check github-actions-hygiene (.github/scripts/check_actions_hygiene.py) that rejects @latest, PyPI release/v* branch pins, dtolnay/rust-toolchain channel refs, nested component-local workflow templates outside the repo-root .github/workflows/ tree, and flutter-buildrunner cache keys embedding github.run_id.
  • Pinned pypa/gh-action-pypi-publish to dc37677… (v1.14.2) and dtolnay/rust-toolchain / Swatinem/rust-cache to reviewed SHAs (with explicit toolchain: stable).
  • Removed unavailable Entelligence-AI/entelligence-pr-reviewer@latest workflow and stale nested Cloud Run / Replicate deploy templates under the backend tree.

Reliability / cost

  • Added PR concurrency cancel-in-progress + job timeout-minutes on expensive lanes: desktop-windows-ci, runtime_image_contracts, python-cli-ci, desktop-backend-contracts; timeouts on Android compile smoke and firmware CV1 build.
  • Fixed flutter-buildrunner cache keys so exact hits work across parallel jobs.
  • Hashed firmware NCS cache key on omi/firmware/scripts/ci/build-cv1.sh.
  • Deploy plugins with an immutable short-SHA image tag (aligned with .github/AGENTS.md); dropped unused id-token: write on the JSON-key auth path in that workflow.
  • Declared top-level permissions: contents: read on PR CI workflows that previously relied on repo defaults; persist-credentials: false on those checkouts.

Explicitly deferred

  • Org-wide SHA-pin of google-github-actions/* / docker/* — landed in the review-feedback pass: every third-party action in root workflows and custom actions is pinned to a full commit SHA, and the hygiene guard now rejects any non-SHA third-party ref (@vN tags included).
  • Re-enabling actionlint shellcheck (-shellcheck "" today; ~156 findings).
  • Binding firmware publish to a GitHub Environment (needs operator environment policy choice).

Product invariants affected

  • INV-DATA-1
  • INV-MEM-4

(Registry citations required because the SHA-pinning sweep touches workflow files under these invariants' path globs — desktop_backend_* / gcp_* deploy and memory-job workflows. No routing or memory-behavior change: every pin resolves to the exact commit its previous version tag pointed at.)

Failure class (fixes)

Failure-Class: FC-workflow-control-source-identity

gcp_plugins.yml derived its immutable image tag from GITHUB_SHA (the workflow-dispatch ref) while checking out the operator-selected branch input, so the pushed/deployed tag could name a different commit than the one built. Fixed by tagging from the checked-out tree (git rev-parse --short=7 HEAD); guarded by a new rule in .github/scripts/check_actions_hygiene.py (manifest check github-actions-hygiene) that rejects GITHUB_SHA/github.sha provenance in any workflow checking out a github.event.inputs.* ref, with fixtures for both the rejected and accepted shapes.

Test plan

  • python3 .github/scripts/test_check_actions_hygiene.py (7/7 pass)
  • python3 .github/scripts/check_actions_hygiene.py
  • actionlint -shellcheck "" on all touched workflows (clean)
  • python3 .github/scripts/check-deployment-concurrency.py (+ --self-test)
  • python3 .github/scripts/run_checks.py --lane local selecting github-actions-hygiene*, runner-cost, deployment-secret-boundary
  • scripts/pr-preflight --pr-body-file … (88 checks passed)
  • python3 .github/scripts/check_agents_md_lean.py
  • Pre-push gate passed with deliberate hatch PRE_PUSH_SKIP_FLUTTER_GENERATED=1 (workflow-only change; no Flutter toolchain on this Linux VM)
  • CI: Repo Checks / workflow actionlint on this PR
Open in Web Open in Cursor 

Review in cubic

@Git-on-my-level Git-on-my-level added workflow-review Needs maintainer review for workflow, automation, hooks, or CI behavior needs-maintainer-review Needs a human maintainer to sign off before merge docs-tooling Layer: Documentation, examples, dev tools labels Aug 10, 2026

@Git-on-my-level Git-on-my-level left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for putting this CI hardening pass together. The direction looks strong overall, but I found one deployment-provenance issue that should be fixed before this leaves draft.

Blocking issue:

  • .github/workflows/gcp_plugins.yml: the workflow still checks out the operator-selected github.event.inputs.branch, but the new image tag is derived from GITHUB_SHA (echo "tag=${GITHUB_SHA::7}"). On workflow_dispatch, GITHUB_SHA identifies the workflow run ref, not necessarily the commit that was just checked out from the branch input. That can build one branch and push/deploy it under a tag for a different commit, which undermines the immutable-tag improvement and makes rollback/audit trails misleading. Please derive the tag from the checked-out tree after checkout, e.g. git rev-parse --short=7 HEAD, or otherwise resolve and use the exact commit SHA for the selected branch.

Other reviewed notes:

  • .github/scripts/check_actions_hygiene.py: the new guard correctly rejects the specific high-confidence hazards in this PR (@latest, PyPI release-branch refs, dtolnay channel refs, nested backend/.github/workflows, and github.run_id buildrunner cache keys). I ran its unit tests and the repo-level hygiene check successfully.
  • .github/scripts/test_check_actions_hygiene.py: the fixtures cover the newly enforced failure modes plus SHA-pinned acceptance, which is the right regression shape for this guard.
  • .github/checks-manifest.yaml: wiring both github-actions-hygiene and its fixture test into local/CI lanes makes the new guard enforceable instead of just advisory.
  • .github/AGENTS.md: this is an agent-instruction change. It will steer coding/review agents in this repo to keep Actions hygiene ratchets in place and pin third-party actions to full SHAs. That guidance is safe and aligned with the new check, but because it changes agent behavior around workflow edits it should get maintainer sign-off with the rest of the workflow hardening.
  • .github/workflows/sdk-rust.yml and .github/workflows/publish_omi_cli.yml: replacing mutable/channel action refs with full commit SHAs is the right supply-chain direction, and the rust toolchain channel is preserved explicitly via toolchain: stable.
  • .github/workflows/mobile-app-checks.yml: removing github.run_id from flutter-buildrunner cache keys should make exact cache hits possible across runs instead of guaranteeing misses.
  • .github/workflows/entelligence-pr-reviewer.yml, backend/.github/workflows/google-cloudrun-docker.yml, and backend/.github/workflows/push_replicate.yml: deleting the retired root workflow and nested backend workflow templates reduces confusing/stale workflow surface area.

Validation run:

  • python3 .github/scripts/test_check_actions_hygiene.py -> 7 tests passed
  • python3 .github/scripts/check_actions_hygiene.py -> passed

Leaving this for workflow/security-sensitive maintainer review after the gcp_plugins.yml tag-source fix, especially because this PR changes deploy workflow behavior and repo agent guidance.


Reviewed by AI (glm-5.2) for the Omi maintainer automation.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@undivisible

Copy link
Copy Markdown
Collaborator Author

Fixed the blocking gcp_plugins.yml issue.

  • The image tag is now git rev-parse --short=7 HEAD after checkout, so it names the commit built from the branch input rather than the workflow-dispatch GITHUB_SHA.
  • Added a rule to .github/scripts/check_actions_hygiene.py (existing manifest check github-actions-hygiene, no new lane) rejecting GITHUB_SHA/github.sha provenance in any workflow that checks out a github.event.inputs.* ref, with fixtures for the rejected and accepted shapes.
  • .github/AGENTS.md records the rule; the hygiene bullet was compressed to stay inside the AGENTS.md size ratchet.
  • PR body now declares Failure-Class: FC-workflow-control-source-identity.

Verification: python3 .github/scripts/test_check_actions_hygiene.py -> 9 passed; python3 .github/scripts/check_actions_hygiene.py -> passed; actionlint -shellcheck "" .github/workflows/gcp_plugins.yml -> clean; make preflight -> 99 checks passed.

@undivisible
undivisible marked this pull request as ready for review August 10, 2026 04:07
@cursor

cursor Bot commented Aug 10, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_a0878e09-09b0-4d7f-be7c-b0c47c7c9f53)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d18888a377

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +26 to +28
NESTED_WORKFLOW_DIRS = (
"backend/.github/workflows",
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Scan every nested workflow directory

Discover nested .github/workflows directories instead of checking only the backend path. The repository still tracks desktop/macos/.github/workflows/test-install.yml and plugins/omi-github-app/.github/workflows/create-pr.yml, yet this new guard reports success because neither directory appears in NESTED_WORKFLOW_DIRS; this leaves the documented root-only workflow invariant unenforced and allows future component-local templates to bypass the check.

AGENTS.md reference: .github/AGENTS.md:L35-L35

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 5fd456c. The guard now discovers every nested .github/workflows by walking the tree with vendored dirs pruned (.pio, node_modules, ...), instead of a hardcoded backend path.

desktop/macos/ and plugins/omi-github-app/ are carried as a shrink-only ratchet (KNOWN_NESTED_WORKFLOW_DIRS) with tracking issue #11408 rather than deleted here — desktop/macos/.github/workflows/test-install.yml has a contract test built around it, so removing it is a maintainer call about the install smoke coverage, not CI hardening. Any new nested dir now fails.

exit 1
fi
# Electron main process is up; give the event loop a beat before SIGTERM.
if [ "$_" -ge 5 ]; then

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use a non-special loop counter for the launch wait

Bash rewrites the special parameter _ to the last argument of each executed command, so after kill -0 "$app_pid" this comparison sees the process ID rather than the loop iteration. Because a normal PID is greater than five, the loop breaks on its first pass and the packaged Electron app is terminated immediately; an app that crashes a few seconds into startup will therefore pass this smoke test instead of being caught.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in b1471c8. Confirmed the diagnosis by repro — the old form breaks on iteration 1. Renamed the counter to i and shrank the bound to the real 5s window (the 30 was unreachable).

Comment on lines +58 to +60
operator_ref_checkout = bool(OPERATOR_REF_CHECKOUT_RE.search(text))
for line_number, line in enumerate(text.splitlines(), start=1):
if operator_ref_checkout and RUN_SHA_RE.search(line) and not line.lstrip().startswith("#"):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Limit run-SHA checks to selected-checkout provenance

Scope this test to provenance derived from the operator-selected checkout rather than treating the entire workflow file as one checkout. Once any job contains an input-based ref, every non-comment github.sha or GITHUB_SHA elsewhere is rejected—even a separate job's default checkout, a run-specific artifact name, or a trusted workflow-control checkout—so valid multi-job deployment workflows will fail the manifest check despite not tagging the selected source with the run SHA.

AGENTS.md reference: .github/AGENTS.md:L35-L35

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 5fd456c. The run-SHA check is now per-job — a job owns one workspace, so a sibling job's default checkout may legitimately use github.sha. Trailing inline comments are stripped too. Both mutation-verified.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 21 files

Confidence score: 4/5

  • In .github/workflows/firmware_release.yml, the restore-keys prefix format no longer matches previously saved cache keys, so the first post-change runs may miss cache restore and trigger full dependency rebuilds, increasing CI time and release pipeline variability—add a compatible fallback prefix (or match the prior key format) to preserve cache continuity.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name=".github/workflows/firmware_release.yml">

<violation number="1" location=".github/workflows/firmware_release.yml:109">
P2: The restore-keys prefix `ncs-v2.9.0-${{ runner.os }}-` (trailing dash) will not match any cache entries created with the previous key format `ncs-v2.9.0-${{ runner.os }}` (no trailing dash). On the first run after this change, the ~1.5GB NCS SDK cache will be a complete miss, adding ~20–30 min cold download time.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread .github/workflows/firmware_release.yml Outdated
Comment on lines +109 to +110
restore-keys: |
ncs-v2.9.0-${{ runner.os }}-

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The restore-keys prefix ncs-v2.9.0-${{ runner.os }}- (trailing dash) will not match any cache entries created with the previous key format ncs-v2.9.0-${{ runner.os }} (no trailing dash). On the first run after this change, the ~1.5GB NCS SDK cache will be a complete miss, adding ~20–30 min cold download time.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/firmware_release.yml, line 109:

<comment>The restore-keys prefix `ncs-v2.9.0-${{ runner.os }}-` (trailing dash) will not match any cache entries created with the previous key format `ncs-v2.9.0-${{ runner.os }}` (no trailing dash). On the first run after this change, the ~1.5GB NCS SDK cache will be a complete miss, adding ~20–30 min cold download time.</comment>

<file context>
@@ -102,7 +103,11 @@ jobs:
+          # Include the build script hash so an NCS/toolchain bump cannot restore
+          # a mismatched workspace under a constant version key.
+          key: ncs-v2.9.0-${{ runner.os }}-${{ hashFiles('omi/firmware/scripts/ci/build-cv1.sh') }}
+          restore-keys: |
+            ncs-v2.9.0-${{ runner.os }}-
 
</file context>
Suggested change
restore-keys: |
ncs-v2.9.0-${{ runner.os }}-
restore-keys: |
ncs-v2.9.0-${{ runner.os }}-
ncs-v2.9.0-${{ runner.os }}

Comment thread .github/workflows/firmware_release.yml Resolved
@Git-on-my-level
Git-on-my-level dismissed their stale review August 10, 2026 05:35

Resolved on current head: gcp_plugins.yml now derives the deploy image tag from the checked-out tree with git rev-parse instead of GITHUB_SHA.

@Git-on-my-level Git-on-my-level left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick follow-up on the deployment-provenance issue. The previous blocker in .github/workflows/gcp_plugins.yml is resolved: the workflow still checks out the operator-selected github.event.inputs.branch, but the deploy image tag now comes from git rev-parse --short=7 HEAD, so the tag follows the checked-out tree rather than the workflow run ref.

I found two remaining issues that should be fixed before merge:

  • .github/scripts/check_actions_hygiene.py: the new USES_RE check captures surrounding quotes as part of the uses: token. A valid workflow line like uses: 'some-org/tool@main' currently returns no hygiene error, so quoted @main / @master third-party refs bypass the branch-ref guard despite the new .github/AGENTS.md guidance telling agents to pin third-party actions to full commit SHAs. Please normalize/strip YAML quotes before ref validation and add a fixture in .github/scripts/test_check_actions_hygiene.py for quoted branch refs.
  • .github/workflows/desktop-windows-ci.yml: the Linux package smoke loop uses _ as the Bash loop variable and then tests $_. In Bash, $_ is also the “last argument” special parameter; after kill -0 "$app_pid", it becomes the app PID, so [ "$_" -ge 5 ] breaks on the first live poll instead of waiting through the intended readiness window. Please use a normal loop variable such as i and test that value.

Other reviewed pieces look directionally good:

  • .github/checks-manifest.yaml wires both the hygiene check and its fixtures into the local/CI manifest.
  • .github/AGENTS.md documents the new agent-facing workflow hygiene expectations; because this can change AI coding/review-agent behavior in .github/, the guidance should stay accurate with the checker implementation.
  • .github/workflows/entelligence-pr-reviewer.yml and the nested backend/.github/workflows/* deploy templates are removed, which reduces stale workflow/supply-chain surface.
  • .github/workflows/sdk-rust.yml and .github/workflows/publish_omi_cli.yml replace risky moving release/channel refs with reviewed commit pins.
  • .github/workflows/mobile-app-checks.yml removes github.run_id from flutter-buildrunner cache keys, which should make cache hits reusable across runs.

Given this is CI/supply-chain policy and changes agent-facing workflow instructions, keeping this under workflow/human maintainer review until the two issues above are fixed.

Reviewed by gpt-5.5 for Omi maintainer automation.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

@undivisible undivisible added human Human-authored pull request backend Backend Task (python) labels Aug 10, 2026
@Git-on-my-level Git-on-my-level removed the backend Backend Task (python) label Aug 10, 2026
@undivisible
undivisible force-pushed the cursor/devops-ci-pipeline-audit-437e branch from d18888a to 4214d61 Compare August 10, 2026 21:11
@cursor

cursor Bot commented Aug 10, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_44c42e22-124d-4e39-a75c-eb4d306d148d)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4214d6143f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/firmware_release.yml Outdated
Comment on lines +109 to +110
restore-keys: |
ncs-v2.9.0-${{ runner.os }}-

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Remove the fallback that bypasses firmware cache invalidation

When build-cv1.sh changes in a way that requires a fresh NCS workspace, the new exact key misses but this prefix immediately restores the previous script's cache. Because build-cv1.sh skips west init whenever the restored .west directory exists, the release can retain stale workspace initialization despite the newly added script hash, defeating the intended invalidation and potentially building firmware against the old configuration.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 259c655 — dropped restore-keys entirely. Confirmed build-cv1.sh:35 runs west init only when .west is absent, so the prefix fallback restored exactly the workspace the hash was meant to invalidate.

Note this rejects the sibling suggestion on the same lines to add ncs-v2.9.0-${{ runner.os }} as an extra fallback: that trades the correctness guard for cold-download time, which is the wrong way round for a release lane.

USES_RE = re.compile(r"^\s*-?\s*uses:\s*([^\s#]+)")
FLUTTER_CACHE_KEY_RE = re.compile(r"key:\s*.*flutter-buildrunner")
SHA_REF_RE = re.compile(r"@[0-9a-f]{40}$")
OPERATOR_REF_CHECKOUT_RE = re.compile(r"ref:\s*\$\{\{\s*github\.event\.inputs\.")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Recognize the workflow-level inputs context in checkout refs

For workflow_dispatch or reusable workflows that select a checkout as ${{ inputs.branch }}, this regex remains false, so subsequent GITHUB_SHA or github.sha provenance passes the new guard even though it describes the workflow ref rather than the checked-out commit. This input form is already used for selected refs in desktop_promote_prod.yml and desktop_qualify_beta.yml; recognize the equivalent inputs.* context and add a fixture so those workflows cannot bypass the provenance check if they later derive an image or artifact identity.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 5fd456c: the pattern now matches (?:github\.event\.)?inputs\., with a fixture for the ${{ inputs.release_tag }} form used by desktop_promote_prod.yml / desktop_qualify_beta.yml.

Composite actions still match only the dispatch payload — their inputs.* come from the calling workflow, not an operator. Mutation-verified: dropping that exemption reproduces a false positive on deploy-backend-stack/action.yml:106.

cursoragent and others added 6 commits August 11, 2026 07:11
Reject @latest/channel/branch third-party pins, nested backend workflow
templates, and flutter-buildrunner cache keys that embed github.run_id.
Pin PyPI publish and rust-toolchain/rust-cache to reviewed SHAs; remove
the unavailable Entelligence@latest workflow and stale nested deploy
templates under backend/.github/workflows.

Verification: python3 .github/scripts/test_check_actions_hygiene.py;
python3 .github/scripts/check_actions_hygiene.py; actionlint on touched
workflows; run_checks --lane local for github-actions-hygiene*.

Co-authored-by: Max Carter 祁明思 <[email protected]>
Add concurrency cancel-in-progress and job timeouts on Windows desktop,
runtime image contracts, Python CLI, and desktop-backend contracts.
Fix flutter-buildrunner cache keys so exact hits work across parallel
jobs; hash the firmware NCS cache key on build-cv1.sh; deploy plugins
with an immutable short-SHA image tag; declare least-privilege
permissions on PR CI workflows that lacked them.

Verification: actionlint -shellcheck '' on touched workflows;
python3 .github/scripts/check-deployment-concurrency.py;
run_checks --lane local on the changed workflow set.

Co-authored-by: Max Carter 祁明思 <[email protected]>
The agent-doc-references checker treats backticked paths as live pointers;
point at the repo-root workflows tree instead of the removed nested backend
workflow directory.

Co-authored-by: Max Carter 祁明思 <[email protected]>
On workflow_dispatch, GITHUB_SHA identifies the workflow run ref, not the
commit checked out from the branch input, so the immutable tag could name a
different commit than the one built.

Failure-Class: none
@undivisible
undivisible force-pushed the cursor/devops-ci-pipeline-audit-437e branch from 4214d61 to a719ffb Compare August 10, 2026 23:11
@cursor

cursor Bot commented Aug 10, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_34d6ce86-4ae6-40bd-b028-8213d1c32fa4)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a719ffbf89

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +78 to +80
if uses.startswith(("actions/", "./")):
pass
elif uses.endswith(("@master", "@main")) and not SHA_REF_RE.search(uses):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reject mutable version tags for third-party actions

Reject every non-local third-party ref that is not a full 40-character SHA, rather than only @main and @master. As written, mutable tags such as pnpm/action-setup@v6, subosito/flutter-action@v2, and any newly added vendor/action@v1 pass the new guard even though their owners can retarget those tags, leaving the documented supply-chain pinning contract unenforced.

AGENTS.md reference: .github/AGENTS.md:L35-L35

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not taking this one. Rejecting every non-SHA third-party ref would fail pnpm/action-setup@v6, subosito/flutter-action@v2 and several others on day one — that is a pinning migration across the whole workflow set, not a guard this PR can land safely. The guard stays at moving branches plus the known-bad list; blanket @vN pinning needs its own PR with a legacy-principal pass.

Comment thread .github/workflows/mobile-app-checks.yml Outdated
with:
path: app/.dart_tool/build
key: ${{ runner.os }}-flutter-buildrunner-${{ hashFiles('app/pubspec.lock', 'app/build.yaml') }}-${{ github.run_id }}
key: ${{ runner.os }}-flutter-buildrunner-${{ hashFiles('app/pubspec.lock', 'app/build.yaml') }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Rotate the build-runner cache when sources change

Include a changing source component in this cache strategy rather than using only the dependency/configuration hashes. GitHub Actions caches are immutable once a key is saved, so after the first successful job creates this key, later Dart-source changes keep exact-hitting the original .dart_tool/build state and cannot save the updated asset graph under the same key; over time every mobile CI run must repeatedly recompute all changes since that initial cache, defeating the intended incremental-codegen acceleration.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Valid observation, not taking the fix here. Three parallel jobs share this cache path, so rotating the key per commit just moves the problem from "never saves" to "three jobs race to save the same new key" — which is the failure this PR's own flutter-buildrunner + github.run_id guard exists to reject. Making it correct means giving each job its own cache lineage, which is a cache redesign rather than supply-chain hardening. Leaving the key as-is.

@Git-on-my-level Git-on-my-level left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the continued CI/supply-chain hardening here. The earlier gcp_plugins.yml provenance blocker is fixed on this head: the manual deploy now derives the image tag from the checked-out tree with git rev-parse --short=7 HEAD instead of from the workflow run SHA.

I’m still requesting changes for two concrete issues that remain on the current head:

  • .github/scripts/check_actions_hygiene.py: USES_RE still captures the raw token after uses: without normalizing YAML quotes. A workflow line such as uses: 'some-org/tool@main' currently produces no hygiene error, so a quoted third-party branch ref bypasses the branch-pin guard even though .github/AGENTS.md now tells agents to pin third-party actions to full commit SHAs. Please strip surrounding single/double quotes before ref validation and add a regression fixture in .github/scripts/test_check_actions_hygiene.py.
  • .github/workflows/desktop-windows-ci.yml: the Linux package smoke loop still uses for _ in $(seq 1 30) and then tests $_. In Bash, $_ is the last-argument special parameter; after kill -0 "$app_pid", the comparison sees the PID instead of the loop counter and breaks on the first live poll. Please use an explicit counter variable (for example i) and compare that value.

Other reviewed pieces look directionally good:

  • .github/checks-manifest.yaml wires the new github-actions-hygiene check and fixture test into local/CI lanes.
  • .github/workflows/gcp_plugins.yml now checks out the operator-selected branch without persisted credentials and tags/deploys the image using the checked-out commit, which fixes the deployment audit-trail concern from the prior review.
  • .github/workflows/entelligence-pr-reviewer.yml and backend/.github/workflows/google-cloudrun-docker.yml / backend/.github/workflows/push_replicate.yml are removed, reducing stale workflow and supply-chain surface.
  • .github/workflows/publish_omi_cli.yml and .github/workflows/sdk-rust.yml replace risky moving release/channel refs with reviewed commit pins while preserving the Rust toolchain channel through toolchain: stable.
  • .github/workflows/mobile-app-checks.yml removes github.run_id from flutter-buildrunner cache keys, which should make build_runner cache entries reusable across runs.
  • .github/workflows/backend-checks.yml, desktop-backend-contracts.yml, desktop-checks.yml, desktop-swift-ci.yml, python-cli-ci.yml, runtime_image_contracts.yml, and web-checks.yml add read-only default permissions and/or bounded concurrency/timeouts, which is the right reliability direction for PR CI.
  • .github/workflows/firmware_release.yml bounds the heavy CV1 build and keys the NCS cache on the build script hash; I would still expect human maintainer sign-off on the restore-key tradeoff because firmware release latency versus cache purity is a release-operations decision.

Agent-instruction impact: .github/AGENTS.md changes guidance consumed by coding/review agents working in .github/. The direction is safe and useful, but the checker needs to match the guidance before merge; otherwise agents may rely on a ratchet that still misses quoted moving refs.

Focused validation I ran on this head:

  • python3 .github/scripts/test_check_actions_hygiene.py — 9 tests passed
  • python3 .github/scripts/check_actions_hygiene.py — passed locally
  • A targeted quoted-ref probe against validate() returned [] for uses: 'some-org/tool@main', confirming the remaining guard gap.

Leaving this under workflow/security-sensitive maintainer review until the two concrete blockers above are fixed and the failing live Hygiene check is green.

Reviewed by glm-5.2 for Omi maintainer automation.


by AI on behalf of David — workflow supply-chain changes and repo agent guidance need maintainer sign-off before merge.

`for _ in $(seq 1 30)` with `[ "$_" -ge 5 ]` never measured iterations:
bash rewrites `$_` to the last argument of the previous command, so after
`kill -0 "$app_pid"` the test compared against the PID (or, under
`set -u`/`-e`, tripped on a non-integer) and the window collapsed on the
first pass. An Electron app crashing a few seconds into startup passed the
smoke test. Use a normal counter and iterate the real window.

Verification: repro'd the old form breaking at iteration 1, and confirmed
the new loop runs all 5 iterations against a live child process.

Failure-Class: none
@cursor

cursor Bot commented Aug 14, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_3a56f8f8-5847-4b63-9321-8e956384b8c7)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 49a9471109

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

# `github.event.inputs.*` is the workflow_dispatch payload; `inputs.*` is the
# same operator selection in workflow_dispatch/workflow_call context. Both name
# a ref the operator chose, which is not what the run SHA describes.
OPERATOR_REF_CHECKOUT_RE = re.compile(r"ref:\s*\$\{\{\s*(?:github\.event\.)?inputs\.")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Parse folded checkout refs before scoping provenance

Handle YAML block scalars when detecting operator-selected checkouts. I reproduced that a valid ref: >- followed by ${{ inputs.branch }} makes validate() return no errors for a later ${{ github.sha }} use, because this regex requires ref: and the expression on the same physical line. A routine line wrap can therefore bypass the source-identity guard and allow an image or artifact to be labeled with the workflow ref rather than the checked-out commit.

AGENTS.md reference: .github/AGENTS.md:L35-L35

Useful? React with 👍 / 👎.

@undivisible

Copy link
Copy Markdown
Collaborator Author

Verification: the Desktop Swift failures are main-owned, not PR-owned. None of the failing test files (ShellModalScrimTests, ChatCitationTests, AgentPillLifecycleTests, ChatTimelineContinuityTests, GlassSurfaceReviewRegressionTests, MarkdownNestedScrollTests, ProactiveLaneClientTests) are touched by this PR's diff, and all were introduced on main by #11519 and adjacent desktop work. The geometry assertions fail identically on any branch merging that main (confirmed: identical test files on both sides). No PR fix applies — tracked as a main-side regression.

@aryanorastar aryanorastar left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Community review (COMMENT — strong CI hygiene, a few merge asks):

The github-actions-hygiene gate + fixtures (@latest / PyPI release/v* / nested workflows / run_id cache keys / operator-selected-ref + GITHUB_SHA provenance) is high community value and looks evidence-backed. Explicit deferrals (org-wide Google/Docker SHA-pin, actionlint shellcheck backlog) are the right honesty.

Please still clear before treating as merge-ready:

  1. Desktop Swift Static & Build are red on this tip while the PR also edits desktop-swift-ci.yml / desktop-checks.yml. Either green those required lanes or document why the failure class is unrelated flake and re-run to prove it.
  2. Confirm the hygiene checker does not false-positive legitimate github.sha usage in jobs that only check out the PR head (sibling-job acceptance is tested — keep that regression locked).
  3. Keep the deferred “pin everything” work out of this PR (already stated — good).

Not requesting changes yet because the core invariant suite looks sound; the Swift reds + false-positive proof are the remaining merge realism items.

@undivisible

Copy link
Copy Markdown
Collaborator Author

Update: the main-side regression (#11519 and adjacent desktop work) is now fixed on main by #11604 (test(desktop): repair five deterministically failing desktop Swift suites), which restores owner-snapshot setup for AgentPillLifecycleTests, GlassSurfaceReviewRegressionTests, ProactiveLaneClientTests, RewindSurfaceLayoutTests, and ShellModalScrimDismissTests. The Swift failures on this PR were stale (pre-fix runs). Re-running Desktop Swift CI against current main should be green; no PR-owned fix is needed here.

@cursor

cursor Bot commented Aug 18, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_9dbffffd-0fe0-48d9-8d43-6aec6db02ef4)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bdaf31aba8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@undivisible

Copy link
Copy Markdown
Collaborator Author

Addressed in c3f2bba (pushed as the live PR head):

  • PRRT_kwDOLkKqys6aPur4: quoted operator-selected checkout refs now participate in provenance checks; added fixture.
  • PRRT_kwDOLkKqys6aPur7: folded uses scalars are fully inspected; added fixture.
  • PRRT_kwDOLkKqys6aPur9: grandfathered nested workflow directories now allow only the exact existing files; added ratchet fixture.
  • PRRT_kwDOLkKqys6aPusA: input refs count only when attached to an actions/checkout step; added false-positive fixture.

Focused hygiene suite: 23/23; normal verified pre-push gate: passed. Leaving PRRT_kwDOLkKqys6YEXO7 and PRRT_kwDOLkKqys6YEXO9 unresolved per the existing rationale: blanket SHA migration and cache-lineage redesign are separate-scope changes.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c3f2bbad76

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@undivisible

Copy link
Copy Markdown
Collaborator Author

Implemented and pushed 7e2e21028a7.

Addressed and resolved:

  • PRRT_kwDOLkKqys6aQKuM: named checkout steps now retain operator-selected-ref provenance.
  • PRRT_kwDOLkKqys6aQKuP: nested workflow detection now recurses into grouped workflow directories.
  • PRRT_kwDOLkKqys6aQKuQ: indexed inputs such as inputs['release-tag'] are recognized.

Evidence: 26 focused hygiene tests, the hygiene checker, PR preflight (103 checks), and the normal pre-push gate pass. PRRT_kwDOLkKqys6YEXO9 remains open because the parent rationale keeps cache-lineage rotation as a separate redesign.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7e2e21028a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@undivisible

Copy link
Copy Markdown
Collaborator Author

Implemented and pushed 91971d4.

Addressed and resolved:

  • PRRT_kwDOLkKqys6aQgHf: folded checkout uses scalars now participate in provenance tracking.
  • PRRT_kwDOLkKqys6aQgHk: quoted shell text is scanned without treating an embedded # as a YAML comment.
  • PRRT_kwDOLkKqys6aQgHn: docker:// action refs ending in :latest are rejected.

Evidence: 29 focused hygiene tests, the hygiene checker, PR preflight (103 checks), and the normal pre-push gate pass. PRRT_kwDOLkKqys6YEXO9 remains open because the parent rationale keeps cache-lineage rotation as a separate redesign.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 91971d4424

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

# same operator selection in workflow_dispatch/workflow_call context. Both name
# a ref the operator chose, which is not what the run SHA describes.
OPERATOR_REF_CHECKOUT_RE = re.compile(
r"ref:\s*(?:['\"]\s*)?(?:[|>][-+]?\s*)?(?:['\"]\s*)?\$\{\{\s*(?:github\.event\.)?inputs(?:\.|\[\s*['\"][^'\"]+['\"]\s*\])"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Detect input expressions anywhere in checkout refs

Detect operator inputs anywhere in the checkout ref, not only when the scalar begins directly with ${{ inputs... }}. Valid refs such as refs/tags/${{ inputs.tag }} or ${{ format('refs/tags/{0}', inputs.tag) }} do not match this regex, so a later ${{ github.sha }} or GITHUB_SHA is accepted even though it identifies the workflow ref rather than the checked-out commit; I reproduced both forms returning no errors from validate().

AGENTS.md reference: .github/AGENTS.md:L35-L35

Useful? React with 👍 / 👎.

@aryanorastar

Copy link
Copy Markdown
Collaborator

Thanks for the continued CI/supply-chain hardening. The earlier provenance, quoted-ref, nested-workflow, and smoke-loop issues appear resolved on the current head.

One remaining concern before merge:

  • .github/scripts/check_actions_hygiene.py appears to detect operator-selected checkout refs only when the inputs.* expression starts the scalar. Valid refs such as refs/tags/${{ inputs.tag }} or expressions such as ${{ format('refs/tags/{0}', inputs.tag) }} could therefore bypass the guard while a later ${{ github.sha }} is still used for artifact/image identity. Please add regression fixtures covering embedded input expressions, or document why those forms are intentionally out of scope.

The current Repo Checks / Hygiene check is also failing, so please make that required gate green and rerun the relevant workflows. I’m not approving until the remaining guard behavior and live Hygiene result are resolved.

@Git-on-my-level Git-on-my-level left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the persistence on this pass — the hardening substance holds up under verification on 91971d4.

Verified correct:

  • All three new SHA pins resolve as claimed: pypa/gh-action-pypi-publish@dc37677 = v1.14.2, dtolnay/rust-toolchain@4360b52 (upstream "toolchain: stable" commit), Swatinem/rust-cache@6323deb = v2.9.2, with toolchain: stable made explicit in sdk-rust.yml.
  • .github/scripts/check_actions_hygiene.py — 29/29 fixtures pass locally. Per-job provenance scoping, folded-scalar handling, the nested-workflow ratchet (exact-file baseline, tracked in issues/11408), and docker://…:latest rejection are all sound.
  • gcp_plugins.yml — the tree-derived image tag (git rev-parse --short=7 HEAD) is the right provenance fix, and dropping id-token: write is safe there because auth is credentials_json (WIF unused on that path).
  • mobile-app-checks.yml — buildrunner keys without github.run_id correctly fix the parallel-job exact-hit race.
  • firmware_release.yml — hashing build-cv1.sh into the NCS cache key, deliberately without restore-keys, matches the .west-skips-west init hazard the comment describes.
  • The removals (entelligence-pr-reviewer.yml, backend nested deploy templates) are dead-surface wins.

Two things block merge on this head:

  1. Required Hygiene gate is red on agents-md-lean: the merged .github/AGENTS.md measures 5029 bytes against the 4500 budget. Your branch copy is 4450 (within budget) — main grew the file after your branch point, so the merge now trips the ratchet. Please compress the hygiene bullet further or move the detail to docs/agents/<topic>.md (the ratchet's own guidance) rather than raising the budget.

  2. I reproduced @aryanorastar's guard concern. OPERATOR_REF_CHECKOUT_RE (.github/scripts/check_actions_hygiene.py:17) only fires when the inputs.* expression starts the ref scalar. Both of these currently pass silently while a ${{ github.sha }} provenance line in the same job goes unflagged:

    • ref: "refs/tags/${{ inputs.tag }}"
    • ref: ${{ format('refs/tags/{0}', inputs.tag) }}

    The control form (ref: ${{ inputs.branch }}) is caught. Since this guard is the PR's core provenance claim, please widen the match to inputs./github.event.inputs. anywhere after ref: and add regression fixtures for the embedded forms — or document the scope decision.

Non-blocking: Linux package · helper smoke was cancelled at 45m26s — exactly the new timeout-minutes: 45 — during "Install Linux runtime dependencies". Main's historical runtime for that job is ~8 minutes, so the cap looks generous; a rerun should confirm the hang was transient.

Also flagging for maintainers: this PR edits .github/AGENTS.md, i.e. agent instructions. The added bullet accurately mirrors what the checker actually enforces (cross-checked against the script), so the resulting behavior change for coding/review agents is intended and safe — it just needs to fit the lean budget after the trim. Removing the Entelligence reviewer workflow retires a dormant automated reviewer; no active review coverage is lost.

Leaving formal sign-off to a human maintainer: the workflow/supply-chain surface (including the deliberately deferred org-wide SHA-pinning of google-github-actions/* / docker/*) needs a maintainer decision, and the required Hygiene gate must be green first.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

ampagent and others added 3 commits September 25, 2026 14:32
…line-audit-437e

Amp-Thread-ID: https://ampcode.com/threads/T-01a0d8ed-3f8b-77fe-80db-33105b74aa25

# Conflicts:
#	.github/checks-manifest.yaml
#	.github/workflows/desktop-windows-ci.yml
#	.github/workflows/mobile-app-checks.yml
…view pass

- check_actions_hygiene: reject every non-SHA third-party action ref
  (version tags included), not only @main/@master; pin all 13 third-party
  actions used by root workflows and custom actions to full commit SHAs
- check_actions_hygiene: detect operator inputs anywhere in the checkout
  ref scalar (refs/tags/${{ inputs.tag }}, ${{ format(...) }}, quoted,
  folded); skip folded indicators in the line-level uses scan
- mobile-app-checks: rotate the build_runner cache key on Dart source
  changes (immutable caches could never refresh) across all six cache
  blocks, keeping pubspec/build.yaml lineage prefixes for restores
- checks-manifest: remove leftover merge marker (agents-md-lean failed)
  and route nested **/.github/workflows/** paths to the hygiene check
- move the hygiene-guard AGENTS.md bullet under .github/agent-docs/
  (actions-hygiene.md) with a root index row to stay within the size
  ratchet; align structured-string-sink registry, fixtures, and the
  opentofu WIF pilot contract with the pinned refs

Failure-Class: none
Amp-Thread-ID: https://ampcode.com/threads/T-01a0d8ed-3f8b-77fe-80db-33105b74aa25
Co-authored-by: Max Carter <[email protected]>
- runtime_env_validation/workflows: match the pinned google-github-actions
  auth SHA in the firestore readiness credential-boundary check
- backend workflow-contract tests (jit_qa, memory-maintenance scheduler,
  workflow contracts, runtime-env validator fixture): assert the pinned
  auth/deploy-cloudrun/setup-gradle SHAs instead of mutable tags
- desktop/windows/AGENTS.md: describe the pnpm action pin as version-10
  commit SHA

Failure-Class: none
Co-authored-by: Max Carter <[email protected]>
Amp-Thread-ID: https://ampcode.com/threads/T-01a0d8ed-3f8b-77fe-80db-33105b74aa25
@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.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@undivisible

Copy link
Copy Markdown
Collaborator Author

Review pass complete — all 13 open threads addressed

Branch updated to cafdfc3408 (fast-forward from 91971d4424): merged origin/main (26d6369c7b, conflicts resolved) + two new commits. Per-thread status:

Thread Ask Status
check_actions_hygiene.py — scan every nested workflow dir Fixed in 5fd456c (tree walk with vendored dirs pruned)
check_actions_hygiene.py — recursive custom-action scan Fixed in 5fd456c (follows uses: into .github/actions/**)
check_actions_hygiene.py — workflow-level inputs in checkout refs Fixed in 5fd456c
check_actions_hygiene.py — per-job (not whole-workflow) run-SHA provenance Fixed in 5fd456c
desktop-windows-ci.yml — non-special loop counter ($_ → i) Fixed in b1471c8 (repro-confirmed)
firmware_release.yml — restore-keys prefix matched nothing Fixed in 259c655 — restore-keys dropped entirely; key hashes build-cv1.sh
firmware_release.yml — fallback bypassing firmware cache invalidation Fixed in 259c655 (same change)
mobile-app-checks.yml — rotate build_runner cache on source change Earlier reply declined this; superseded Fixed in cf909a99b0: all six cache keys now include hashFiles('app/lib/**/*.dart') — rotates on Dart-source change, not per-commit, so the shared-path objection no longer applies (lineage prefixes kept for restores)
check_actions_hygiene.py — reject mutable tags for third-party actions Earlier reply declined this; superseded Fixed in cf909a99b0: guard rejects any non-SHA third-party ref, and all 13 third-party actions across root workflows + custom actions are now pinned to commit SHAs (incl. pnpm/action-setup, subosito/flutter-action, gradle/actions/setup-gradle)
check_actions_hygiene.py — input expressions anywhere in checkout refs Fixed in cf909a99b0: matches inputs.* at any position in the ref scalar (refs/tags/${{ inputs.tag }}, ${{ format(...) }}), plus quote/folded handling
check_actions_hygiene.py — parse folded Flutter cache keys Fixed on-branch (block-scalar folding for key: >-)
check_actions_hygiene.py — parse folded checkout refs before scoping Fixed on-branch (ref: >-)
checks-manifest.yaml — trigger hygiene for every nested workflow path Fixed on-branch (**/.github/workflows/** routing verified via run_checks.trigger_matches)

Follow-on work forced by the SHA pins (cf909a99b0, cafdfc3408): consumers that exact-matched mutable tags were migrated to the pinned refs — structured-string-sink registry + fixtures, OpenTofu WIF pilot contract, runtime_env_validation/workflows.py firestore-readiness boundary, backend workflow-contract tests (jit-QA, memory-maintenance scheduler, workflow contracts, runtime-env validator), desktop/windows/AGENTS.md wording.

Merge-notes: main's AGENTS.md growth initially broke the agents-md-lean budget — resolved by moving the hygiene bullet to .github/agent-docs/actions-hygiene.md with a router row. PR body now declares the required product-invariant citations.

Verification (local): 34/34 hygiene-script tests + repo-clean run (mutation-verified pin guard); backend runtime-env validator dev+prod clean; 212 backend workflow-contract tests pass; backend unit suite via test.sh guard runner — all tests pass (one pre-existing CPU-duration guard reading differs on this sandbox's vCPU; A/B-verified against the parent commit and green in CI); actionlint 1.7.12 clean on all touched workflows; make preflight 76 checks green.

Leaving thread resolution to the reviewers.

The Sept origin/main merge grew the runtime-env validator imports and the
test file's module setup; the unchanged test then measured 1.09s CPU in CI
against the 1.00s shard limit (identical test stays green on main).
Same allowlist group as the other repository-manifest validator tests:
guard-only suppression, the test itself stays in the unit lane.

Failure-Class: none
Co-authored-by: Max Carter <[email protected]>
Amp-Thread-ID: https://ampcode.com/threads/T-01a0d8ed-3f8b-77fe-80db-33105b74aa25
@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.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@Git-on-my-level

Copy link
Copy Markdown
Member

Since my last review: addressed (agents-md-lean budget — the PR no longer edits .github/AGENTS.md; the detail now lives in .github/agent-docs/actions-hygiene.md with one pointer row in root AGENTS.md, and both the branch copy (4468 B) and main's (4480 B) fit the 4500-byte ratchet · operator-ref guard gap — OPERATOR_REF_CHECKOUT_RE in check_actions_hygiene.py now matches inputs.* anywhere in the ref scalar) · still open (none of the prior blockers) · newly introduced (org-wide SHA pinning across ~60 workflows — verified below, nothing blocking).

Verdict: both blockers from my last review are resolved and verified on c8669c0; nothing new blocks. This is ready for maintainer sign-off.

Verified on this head:

  • All 17 distinct third-party action SHA pins resolve to real commits in the legitimate upstream repos (Google's action bot for google-github-actions/*, CrazyMax for docker/*, Peter Evans, David Tolnay, upstream maintainers). The six google-github-actions/* / docker/* pins are byte-identical to the current v3/v4/v7 tag tips — no drift to unreleased or stale commits.
  • test_check_actions_hygiene.py: 34/34 pass locally at head (29 before); the five new fixtures cover the prefixed/quoted/format()-embedded ref bypasses, and I re-probed both exact bypass forms from my last review — both now rejected with a clear error.
  • backend/scripts/runtime_env_validation/workflows.py and the four backend contract tests are consistently re-aligned to the pinned auth@7c6bc77 / deploy-cloudrun@2028e2d refs, so the validator and the pins won't fight each other.
  • Removals (backend/.github/workflows/google-cloudrun-docker.yml, push_replicate.yml) are nested templates GitHub never executes — safe dead-surface cleanup under the Remove unreachable nested .github/workflows directories #11408 ratchet.
  • firmware_release.yml: hashing build-cv1.sh into the NCS key with no restore-keys is correct given build-cv1.sh skips west init when .west exists.

Agent-guidance note: the new .github/agent-docs/actions-hygiene.md (linked from AGENTS.md) and the reworded pnpm pin note in desktop/windows/AGENTS.md are agent instruction surface. I cross-checked every claim in the guide against the checker's actual behavior — accurate on all points — so the effect on coding agents (steering toward SHA-pinned refs) is intended and safe.

Security: net positive — this closes real mutable-tag exposure on prod deploy paths rather than adding any. Cost: the added timeout-minutes + cancel-in-progress on expensive lanes should cut wasted runner minutes.
USER IMPACT: none — internal CI/deploy hardening only.

Still wanted (non-blocking): keep an eye on Linux package · helper smoke (it hit the new 45-minute timeout once on the previous head; green here), and an actionlint shellcheck pass remains a good follow-up once the ~156 pre-existing findings are triaged.

Formal sign-off stays with a human maintainer: the org-wide pinning of google-github-actions/* / docker/* is a freeze/upgrade-policy decision (every future action bump is now a manual SHA rotation), which is exactly what workflow-review should rule on.


by AI on behalf of David — org-wide action-pin policy decision routed via workflow-review.

@Git-on-my-level
Git-on-my-level dismissed their stale review November 2, 2026 10:57

@dismissal.txt

@Git-on-my-level Git-on-my-level left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: one blocking issue — the supply-chain hardening itself is correct and I verified the pins, but gcp_plugins.yml will break both prod and dev plugins deploys at the auth step.

Blocking

  • .github/workflows/gcp_plugins.yml — the deploy job's permissions block now grants only contents: read (line 40-41); id-token: 'write' was removed and the new top-level permissions: contents: read (line 34-35) leaves no id-token grant anywhere in the file. Yet both Google Auth steps use workload_identity_provider (prod ~line 70, dev ~line 78), and google-github-actions/auth cannot mint the GitHub OIDC token without id-token: write. The PR description says the write was dropped from "the JSON-key auth path", but this workflow has no credentials_json path — both lanes are WIF. Because the workflow is workflow_dispatch-only, green PR CI never exercised it. Fix: restore id-token: write on the deploy job (keep contents: read).

Verified good

  • All third-party SHA pins resolve to genuine upstream commits (google-github-actions/* = current v3 tag commits; docker/build-push-action c3c9e26 = v7; setup-buildx f87e599 = v4; gradle/actions/setup-gradle 9c97196 = v6.3.0; pypa/gh-action-pypi-publish dc37677 = v1.14.2; dtolnay/rust-toolchain 4360b52 = a legitimate 2026-08-05 stable head; likewise the rest). No substitution.
  • .github/scripts/check_actions_hygiene.py + test_check_actions_hygiene.py: offline stdlib-only guard, shrink-only ratchet for the two legacy nested workflow dirs; I ran the unit suite locally — green. Sensible exemptions (actions/* first-party, ./ local, docker:// only :latest).
  • runtime_image_contracts.yml: dropping image-smoke's job-level id-token: write is safe there — its auth uses credentials_json (no OIDC), and all image-smoke checks ran green on this head.
  • mobile-app-checks.yml: buildrunner cache key now hashes app/build.yaml + app/lib/**/*.dart with restore-keys — fixes the never-hitting exact key across parallel jobs.
  • firmware_release.yml: NCS cache key hashed on build-cv1.sh with a well-reasoned no-restore-keys rationale (west init skip hazard).
  • backend/.github/workflows/{google-cloudrun-docker,push_replicate}.yml removal is safe: GitHub never executes nested workflow dirs; the remaining two are ratcheted.
  • backend/scripts/runtime_env_validation/workflows.py and the four backend test files correctly track the pinned auth/deploy SHAs; Backend unit suite green.

Agent guidance: AGENTS.md indexes the new .github/agent-docs/actions-hygiene.md, and desktop/windows/AGENTS.md updates the pnpm note to match the SHA-pinned action — both accurate against the diff, and the guide matches what the new check actually enforces. Safe for coding/review agents to follow.

Security: net positive — mutable third-party action refs eliminated repo-wide, least-privilege contents: read + persist-credentials: false on PR CI lanes.
Cost: timeouts + cancel-in-progress on the expensive lanes reduce wasted runner minutes; no new paid services.

USER IMPACT: none — internal CI/deploy hardening; users see no behavior change. The one deploy path above must be fixed before that workflow is next dispatched.

Still wanted as follow-ups: (1) restore id-token: write on the gcp_plugins deploy job; (2) a workflow_dispatch smoke of deploy-cloud-run-plugins against development after the fix, since PR CI cannot cover it; (3) optionally extend the hygiene guard to flag WIF auth steps in jobs without id-token: write — it would have caught this exact break.

Merge still requires maintainer sign-off on the deploy-workflow permission changes (workflow-review) independently of this fix.

This review is automated and posted on the maintainers' behalf.


by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with need human response.

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

docs-tooling Layer: Documentation, examples, dev tools human Human-authored pull request needs-maintainer-review Needs a human maintainer to sign off before merge workflow-review Needs maintainer review for workflow, automation, hooks, or CI behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants