fix(scripts): implement /sop-n/a N/A declarations + ci-drift polling sentinel #1192

Closed
core-devops wants to merge 1 commits from infra/sop-n-a-plus-drift-fix into staging

1 Commits

Author SHA1 Message Date
core-devops 9562126fff fix(scripts): implement /sop-n/a N/A declarations + ci-drift polling sentinel
lint-mask-pr-atomicity / lint-mask-pr-atomicity (pull_request) Failing after 1m14s
CI / Canvas Deploy Reminder (pull_request) Blocked by required conditions
E2E API Smoke Test / E2E API Smoke Test (pull_request) Blocked by required conditions
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Blocked by required conditions
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Blocked by required conditions
Runtime PR-Built Compatibility / PR-built wheel + import smoke (pull_request) Blocked by required conditions
CI / Canvas (Next.js) (pull_request) Successful in 13m55s
CI / Platform (Go) (pull_request) Successful in 14m46s
CI / all-required (pull_request) Successful in 14m52s
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 11s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 17s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 26s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 22s
CI / Detect changes (pull_request) Successful in 50s
qa-review / approved (pull_request) Failing after 22s
E2E API Smoke Test / detect-changes (pull_request) Successful in 54s
security-review / approved (pull_request) Failing after 19s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 56s
Runtime PR-Built Compatibility / detect-changes (pull_request) Successful in 54s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 1m25s
Ops Scripts Tests / Ops scripts (unittest) (pull_request) Successful in 1m27s
gate-check-v3 / gate-check (pull_request) Successful in 4s
sop-checklist / all-items-acked (pull_request) Successful in 5s
sop-tier-check / tier-check (pull_request) Successful in 6s
CI / Python Lint & Test (pull_request) Successful in 7m20s
audit-force-merge / audit (pull_request) Has been skipped
Two independent fixes shipped together since both affect the CI gate stack:

**sop-checklist.py — N/A handling (mc#1111)**

`sop-checklist.yml` already fires on `/sop-n/a` comments from
core-qa-agent and core-security-agent, but sop-checklist.py was
ignoring them ("na_directives is reserved for future N/A handling
(always [] for now)"). review-check.sh looks for the
`sop-checklist / na-declarations (pull_request)` status and exits 0
when it finds a matching N/A gate in the description — but that
status was never posted. Agents posting /sop-n/a had no effect.

Fix: parse /sop-n/a <gate> [reason] from comments, validate that
the declarer is in the gate's required_teams and is not the PR
author, then POST a success status to
`sop-checklist / na-declarations (pull_request)` with description
"N/A: qa-review, security-review" (matching the grep pattern in
review-check.sh).

Also fix: _load_config_minimal now uses rpartition(':') so keys
containing '/' (n/a_gates) parse correctly instead of being split
at the wrong colon.

**ci-required-drift.py — polling sentinel false positive**

`sentinel_needs()` now returns (needs_set, is_polling). The
detect_drift() F1/F1b checks are skipped when is_polling=True
(no `needs:` key in the sentinel). Main uses a polling-based
sentinel (no needs:, steps poll /statuses/{sha} directly) which
intentionally gates all CI jobs without listing them in needs:.
F1 was a false positive on main. The script now adds a NOTE
finding (not an error) to explain the polling architecture and
instructs operators to close the issue.

[core-devops-agent]
2026-05-15 14:18:20 +00:00