Skip to content

SCA-313: Scope-gate admin deploys and retarget omi-tv activation - #11709

Merged
Git-on-my-level merged 5 commits into
mainfrom
agent/m1-studio-cursor-grok-4-6/92b06945
Aug 16, 2026
Merged

Git-on-my-level merged 5 commits into
mainfrom
agent/m1-studio-cursor-grok-4-6/92b06945

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Aug 16, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Add an unprivileged scope job on gcp_admin.yml so generated-client-only and other non-runtime diffs skip green before environment: prod / GCP creds / image build. workflow_dispatch still always deploys. Lock group and cancel-in-progress: false are unchanged.
  • Check in the live Grafana uid omi-tv board, retarget the two activation panels to /api/omi/stats/activation?days=60 (rate, weeks[]), and add an apply script that no-ops when GRAFANA_TOKEN is unset.
  • One-release compat shim: when the Firestore activation cache exists, viral-metrics summary.activationRate and activation[] serve those figures so today's Infinity panels do not stay blank. Telemetry coverage stays a separate field.

Closes #11700
Closes #11701
Closes SCA-313

Failure-Class: none

Test plan

  • python3 .github/scripts/check_admin_deploy_scope_admission.py
  • python3 .github/scripts/test_check_admin_deploy_scope.py (11 tests: generated-client skip, runtime/public-build/workflow_dispatch deploy, lock/cancel-in-progress: false, dashboard selectors, apply skip)
  • python3 .github/scripts/check_public_build_contract.py
  • python3 .github/scripts/check-deployment-concurrency.py
  • npx tsc --noEmit in web/admin
  • npm test in web/admin (106 passed, including activation shim + Grafana selectors)
  • make preflight — 96 checks passed in 72.48s on 16658d74d9 (OMI_PR_BODY_FILE=pr-body.md)

Verification notes

  • Scope classifier skip cases: web/admin/**/*.generated.ts alone, or that file plus backend/desktop-only paths.
  • Scope classifier deploy cases: any other web/admin/** path, gcp_admin.yml, public-build deploy/prepare/promotion actions, preflight/smoke scripts, config/public-build-*.json, and workflow_dispatch.
  • Uncertain parent/diff → deploy (applies=true).
  • Live omi-tv JSON exported 2026-08-16 from GET /grafana/api/dashboards/uid/omi-tv; instance id/version stripped; uid omi-tv kept.
  • Apply is optional: gcp_admin.yml runs web/admin/grafana/apply_omi_tv_dashboard.py after a successful deploy and skips when secrets.GRAFANA_TOKEN is empty.

Review in cubic

Git-on-my-level and others added 3 commits August 16, 2026 15:49
Keep generated-client-only commits from taking the shared prod
environment slot, and make the Grafana activation panels sourceable
from the Firestore activation route.

Failure-Class: none
Co-authored-by: Cursor <[email protected]>
Co-authored-by: multica-agent <[email protected]>
The gcp_admin.yml scope job invokes the classifier at deploy time;
manifest contract and fixtures already own the CI surface.

Failure-Class: none
Co-authored-by: Cursor <[email protected]>
Co-authored-by: multica-agent <[email protected]>
Point at grafana/README.md instead of growing the component guide.

Failure-Class: none
Co-authored-by: Cursor <[email protected]>
Co-authored-by: multica-agent <[email protected]>

@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 14 files

Confidence score: 3/5

  • In .github/scripts/check_admin_deploy_scope.py, admin_deploy_applies can miss required deploy triggers when a generated-client change is combined with a public-build promotion helper change, which risks silently skipping admin deployment for changes that should ship—include all transitive public-build helper paths in the deploy-input set to close this gap.

Not reviewed (too large): web/admin/grafana/dashboards/omi-tv.json (~6,112 lines) - if these are generated or fixture files, add them to ignored paths to exclude them from future reviews.

You’re at about 91% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact [email protected].

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/scripts/check_admin_deploy_scope.py">

<violation number="1" location=".github/scripts/check_admin_deploy_scope.py:93">
P1: When a generated-client change is bundled with a public-build promotion helper change, `admin_deploy_applies` ignores the helper and skips deployment. Add all transitive public-build helper paths to the deploy-input set or fail closed on unknown co-changed paths.</violation>
</file>

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

Re-trigger cubic

return True
if changed_files is None:
return True
return any(path_can_affect_admin_deploy(path) for path in changed_files)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1: When a generated-client change is bundled with a public-build promotion helper change, admin_deploy_applies ignores the helper and skips deployment. Add all transitive public-build helper paths to the deploy-input set or fail closed on unknown co-changed paths.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/scripts/check_admin_deploy_scope.py, line 93:

<comment>When a generated-client change is bundled with a public-build promotion helper change, `admin_deploy_applies` ignores the helper and skips deployment. Add all transitive public-build helper paths to the deploy-input set or fail closed on unknown co-changed paths.</comment>

<file context>
@@ -0,0 +1,157 @@
+        return True
+    if changed_files is None:
+        return True
+    return any(path_can_affect_admin_deploy(path) for path in changed_files)
+
+
</file context>

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Declining this one — it is not valid on this head.

admin_deploy_applies is any(path_can_affect_admin_deploy). A generated-client path is out of scope, but a public-build helper path is in scope, so a bundle of the two already returns true and deploys. Changing the any() semantics would be the wrong fix.

Coverage for that case is in test_generated_client_plus_public_build_helper_still_deploys.

Comment thread .github/workflows/gcp_admin.yml Resolved
Comment thread web/admin/lib/activation-compat.ts Resolved
Comment thread web/admin/lib/activation-compat.ts Resolved
Comment thread .github/checks-manifest.yaml Resolved
Git-on-my-level and others added 2 commits August 16, 2026 16:36
… honest

Scope now diffs github.event.before...github.sha and fail-closes when before
is missing or zero. Admission requires live scope wiring, workflow_dispatch,
and uncommented deploy keys. Partial Firestore caches no longer overlay a
silent rate, and classic keeps the daily viral-metrics fallback.

Co-authored-by: Cursor <[email protected]>
Co-authored-by: multica-agent <[email protected]>
Pre-push exports GIT_DIR into child git commands, so the disposable
classifier repos must clear GIT_* and disable inherited hooks.

Co-authored-by: Cursor <[email protected]>
Co-authored-by: multica-agent <[email protected]>
@Git-on-my-level
Git-on-my-level merged commit 9846e1e into main Aug 16, 2026
40 checks passed
@Git-on-my-level
Git-on-my-level deleted the agent/m1-studio-cursor-grok-4-6/92b06945 branch August 16, 2026 21:29
kodjima33 pushed a commit that referenced this pull request Sep 15, 2026
…ren (#13850)

Git exports GIT_DIR to hooks; from a linked worktree it is the absolute path
of .git/worktrees/<name>. scripts/pre-push passed it to every check it ran, so
agents-md-lean's self-test `git init <fixture>` reinitialized the real
repository instead: git guessed it bare and wrote core.bare=true into the
config every worktree shares. With extensions.worktreeConfig on, that shared
value also applies to linked worktrees, so the fixture's ls-files failed and
the push of #11183 was refused with "ignored worktree copies must not be
discovered".

Four earlier fixes scrubbed the variable one caller at a time (#11413, #11709,
#11795, #12564). Clear it once at the top of the gate, after it changes to the
work tree root, and drop the two Flutter-phase copies it makes redundant.

test-pre-push-worktree-fallback.sh ran the gate with a bogus bare GIT_DIR and
relied on the gate still using it to fail at the base-ref lookup. The gate now
uses the work tree, which has origin/main, so the harness names a base branch
no repository has to keep failing fast at the same step.

Verification:
- Real `git push` from a disposable linked worktree, real pre-push hook, the
  checker from origin/main: hook env GIT_DIR=<sbx>/main/.git/worktrees/wt;
  shared core.bare false -> true; with extensions.worktreeConfig=true the
  exact #11183 AssertionError. A push from the main worktree exports no
  GIT_DIR and is unaffected.
- scripts/test-pre-push-git-env.sh passes with the fix and fails with the gate
  from origin/main and with only the new unset removed (core.bare=false ->
  core.bare=true in the fixture's shared config).
- All 13 manifest checks triggered by scripts/pre-push pass through
  run_checks.py --lane local; pre-push-worktree-fallback is Windows-only in
  the manifest and passes when run directly on macOS.

Failure-Class: new

Co-authored-by: Claude Opus 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant