Repository navigation
ci: harden Actions supply-chain and PR CI reliability - #11301
undivisible wants to merge 18 commits into
Conversation
Git-on-my-level
left a comment
There was a problem hiding this comment.
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-selectedgithub.event.inputs.branch, but the new image tag is derived fromGITHUB_SHA(echo "tag=${GITHUB_SHA::7}"). Onworkflow_dispatch,GITHUB_SHAidentifies the workflow run ref, not necessarily the commit that was just checked out from thebranchinput. 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, nestedbackend/.github/workflows, andgithub.run_idbuildrunner 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 bothgithub-actions-hygieneand 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.ymland.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 viatoolchain: stable..github/workflows/mobile-app-checks.yml: removinggithub.run_idfrom 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, andbackend/.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 passedpython3 .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.
|
Fixed the blocking
Verification: |
Bugbot couldn't run - usage limit reachedBugbot 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) |
There was a problem hiding this comment.
💡 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".
| NESTED_WORKFLOW_DIRS = ( | ||
| "backend/.github/workflows", | ||
| ) |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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).
| 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("#"): |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
1 issue found across 21 files
Confidence score: 4/5
- In
.github/workflows/firmware_release.yml, therestore-keysprefix 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
| restore-keys: | | ||
| ncs-v2.9.0-${{ runner.os }}- |
There was a problem hiding this comment.
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>
| restore-keys: | | |
| ncs-v2.9.0-${{ runner.os }}- | |
| restore-keys: | | |
| ncs-v2.9.0-${{ runner.os }}- | |
| ncs-v2.9.0-${{ runner.os }} |
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
left a comment
There was a problem hiding this comment.
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 newUSES_REcheck captures surrounding quotes as part of theuses:token. A valid workflow line likeuses: 'some-org/tool@main'currently returns no hygiene error, so quoted@main/@masterthird-party refs bypass the branch-ref guard despite the new.github/AGENTS.mdguidance 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.pyfor 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; afterkill -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 asiand test that value.
Other reviewed pieces look directionally good:
.github/checks-manifest.yamlwires both the hygiene check and its fixtures into the local/CI manifest..github/AGENTS.mddocuments 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.ymland the nestedbackend/.github/workflows/*deploy templates are removed, which reduces stale workflow/supply-chain surface..github/workflows/sdk-rust.ymland.github/workflows/publish_omi_cli.ymlreplace risky moving release/channel refs with reviewed commit pins..github/workflows/mobile-app-checks.ymlremovesgithub.run_idfrom 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.
d18888a to
4214d61
Compare
Bugbot couldn't run - usage limit reachedBugbot 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) |
There was a problem hiding this comment.
💡 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".
| restore-keys: | | ||
| ncs-v2.9.0-${{ runner.os }}- |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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\.") |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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.
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
4214d61 to
a719ffb
Compare
Bugbot couldn't run - usage limit reachedBugbot 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) |
There was a problem hiding this comment.
💡 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".
| if uses.startswith(("actions/", "./")): | ||
| pass | ||
| elif uses.endswith(("@master", "@main")) and not SHA_REF_RE.search(uses): |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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.
| 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') }} |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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_REstill captures the raw token afteruses:without normalizing YAML quotes. A workflow line such asuses: '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.mdnow 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 usesfor _ in $(seq 1 30)and then tests$_. In Bash,$_is the last-argument special parameter; afterkill -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 examplei) and compare that value.
Other reviewed pieces look directionally good:
.github/checks-manifest.yamlwires the newgithub-actions-hygienecheck and fixture test into local/CI lanes..github/workflows/gcp_plugins.ymlnow 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.ymlandbackend/.github/workflows/google-cloudrun-docker.yml/backend/.github/workflows/push_replicate.ymlare removed, reducing stale workflow and supply-chain surface..github/workflows/publish_omi_cli.ymland.github/workflows/sdk-rust.ymlreplace risky moving release/channel refs with reviewed commit pins while preserving the Rust toolchain channel throughtoolchain: stable..github/workflows/mobile-app-checks.ymlremovesgithub.run_idfrom 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, andweb-checks.ymladd read-only default permissions and/or bounded concurrency/timeouts, which is the right reliability direction for PR CI..github/workflows/firmware_release.ymlbounds 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 passedpython3 .github/scripts/check_actions_hygiene.py— passed locally- A targeted quoted-ref probe against
validate()returned[]foruses: '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
Bugbot couldn't run - usage limit reachedBugbot 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) |
There was a problem hiding this comment.
💡 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\.") |
There was a problem hiding this comment.
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 👍 / 👎.
|
Verification: the Desktop Swift failures are main-owned, not PR-owned. None of the failing test files ( |
aryanorastar
left a comment
There was a problem hiding this comment.
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:
- 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. - Confirm the hygiene checker does not false-positive legitimate
github.shausage in jobs that only check out the PR head (sibling-job acceptance is tested — keep that regression locked). - 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.
|
Update: the main-side regression (#11519 and adjacent desktop work) is now fixed on main by #11604 ( |
Failure-Class: none
Bugbot couldn't run - usage limit reachedBugbot 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) |
There was a problem hiding this comment.
💡 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".
Failure-Class: none
|
Addressed in c3f2bba (pushed as the live PR head):
Focused hygiene suite: 23/23; normal verified pre-push gate: passed. Leaving |
There was a problem hiding this comment.
💡 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".
Failure-Class: none
|
Implemented and pushed 7e2e21028a7. Addressed and resolved:
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. |
There was a problem hiding this comment.
💡 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".
Failure-Class: none
|
Implemented and pushed 91971d4. Addressed and resolved:
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. |
There was a problem hiding this comment.
💡 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*\])" |
There was a problem hiding this comment.
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 👍 / 👎.
|
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:
The current |
Git-on-my-level
left a comment
There was a problem hiding this comment.
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, withtoolchain: stablemade explicit insdk-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), anddocker://…:latestrejection are all sound.gcp_plugins.yml— the tree-derived image tag (git rev-parse --short=7 HEAD) is the right provenance fix, and droppingid-token: writeis safe there because auth iscredentials_json(WIF unused on that path).mobile-app-checks.yml— buildrunner keys withoutgithub.run_idcorrectly fix the parallel-job exact-hit race.firmware_release.yml— hashingbuild-cv1.shinto the NCS cache key, deliberately without restore-keys, matches the.west-skips-west inithazard the comment describes.- The removals (
entelligence-pr-reviewer.yml, backend nested deploy templates) are dead-surface wins.
Two things block merge on this head:
-
Required Hygiene gate is red on
agents-md-lean: the merged.github/AGENTS.mdmeasures 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 todocs/agents/<topic>.md(the ratchet's own guidance) rather than raising the budget. -
I reproduced @aryanorastar's guard concern.
OPERATOR_REF_CHECKOUT_RE(.github/scripts/check_actions_hygiene.py:17) only fires when theinputs.*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 toinputs./github.event.inputs.anywhere afterref: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.
…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
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Review pass complete — all 13 open threads addressedBranch updated to
Follow-on work forced by the SHA pins ( Merge-notes: main's AGENTS.md growth initially broke the agents-md-lean budget — resolved by moving the hygiene bullet to 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 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
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Since my last review: addressed (agents-md-lean budget — the PR no longer edits 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:
Agent-guidance note: the new Security: net positive — this closes real mutable-tag exposure on prod deploy paths rather than adding any. Cost: the added Still wanted (non-blocking): keep an eye on Formal sign-off stays with a human maintainer: the org-wide pinning of by AI on behalf of David — org-wide action-pin policy decision routed via |
Git-on-my-level
left a comment
There was a problem hiding this comment.
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-levelpermissions: contents: read(line 34-35) leaves noid-tokengrant anywhere in the file. Yet both Google Auth steps useworkload_identity_provider(prod ~line 70, dev ~line 78), and google-github-actions/auth cannot mint the GitHub OIDC token withoutid-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: restoreid-token: writeon the deploy job (keepcontents: 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
stablehead; 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: writeis 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.
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
github-actions-hygiene(.github/scripts/check_actions_hygiene.py) that rejects@latest, PyPIrelease/v*branch pins,dtolnay/rust-toolchainchannel refs, nested component-local workflow templates outside the repo-root.github/workflows/tree, and flutter-buildrunner cache keys embeddinggithub.run_id.pypa/gh-action-pypi-publishtodc37677…(v1.14.2) anddtolnay/rust-toolchain/Swatinem/rust-cacheto reviewed SHAs (with explicittoolchain: stable).Entelligence-AI/entelligence-pr-reviewer@latestworkflow and stale nested Cloud Run / Replicate deploy templates under the backend tree.Reliability / cost
cancel-in-progress+ jobtimeout-minuteson expensive lanes:desktop-windows-ci,runtime_image_contracts,python-cli-ci,desktop-backend-contracts; timeouts on Android compile smoke and firmware CV1 build.omi/firmware/scripts/ci/build-cv1.sh..github/AGENTS.md); dropped unusedid-token: writeon the JSON-key auth path in that workflow.permissions: contents: readon PR CI workflows that previously relied on repo defaults;persist-credentials: falseon those checkouts.Explicitly deferred
Org-wide SHA-pin of— 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 (google-github-actions/*/docker/*@vNtags included).-shellcheck ""today; ~156 findings).Product invariants affected
(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.ymlderived its immutable image tag fromGITHUB_SHA(the workflow-dispatch ref) while checking out the operator-selectedbranchinput, 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 checkgithub-actions-hygiene) that rejectsGITHUB_SHA/github.shaprovenance in any workflow checking out agithub.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.pyactionlint -shellcheck ""on all touched workflows (clean)python3 .github/scripts/check-deployment-concurrency.py(+--self-test)python3 .github/scripts/run_checks.py --lane localselectinggithub-actions-hygiene*, runner-cost, deployment-secret-boundaryscripts/pr-preflight --pr-body-file …(88 checks passed)python3 .github/scripts/check_agents_md_lean.pyPRE_PUSH_SKIP_FLUTTER_GENERATED=1(workflow-only change; no Flutter toolchain on this Linux VM)