Skip to content

ci(strict21): add canonical policy + preflight gate#96

Closed
Prekzursil wants to merge 1 commit intomainfrom
codex/strict-21-100-swfoc-mod-menu
Closed

ci(strict21): add canonical policy + preflight gate#96
Prekzursil wants to merge 1 commit intomainfrom
codex/strict-21-100-swfoc-mod-menu

Conversation

@Prekzursil
Copy link
Owner

Problem / Outcome

Start strict-21 rollout (Vercel-free) with canonical context policy and preflight gate.

Scope and Success Criteria

  • Canonical required-check policy file committed.
  • PR preflight checks canonical contexts against branch protection and emitted checks.
  • No Vercel contexts included.

Risk Classification

risk:medium

Rollback Plan

Revert this branch if strict preflight blocks valid PRs unexpectedly.

Evidence Paths

  • .github/branch-protection-policy.json
  • .github/workflows/strict21-preflight.yml
  • scripts/strict21_preflight.py

Co-authored-by: Codex <noreply@openai.com>
@devloai
Copy link

devloai bot commented Mar 2, 2026

Unable to trigger custom agent "Code Reviewer". You have run out of credits 😔
Please upgrade your plan or buy additional credits from the subscription page.

@chatgpt-codex-connector
Copy link

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

@coderabbitai
Copy link

coderabbitai bot commented Mar 2, 2026

Warning

Rate limit exceeded

@Prekzursil has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 8 minutes and 27 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between e114f29 and be28788.

📒 Files selected for processing (3)
  • .github/branch-protection-policy.json
  • .github/workflows/strict21-preflight.yml
  • scripts/strict21_preflight.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch codex/strict-21-100-swfoc-mod-menu

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@qodo-code-review
Copy link

Review Summary by Qodo

Add strict-21 preflight validation with canonical policy

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Add strict-21 preflight validation script comparing canonical contexts
• Define canonical branch protection policy with 24 required status checks
• Implement GitHub Actions workflow for automated preflight checks on PRs
• Validate branch protection and emitted check-runs against canonical contexts
Diagram
flowchart LR
  A["Canonical Contexts List"] -->|"Compare"| B["Branch Protection Policy"]
  A -->|"Compare"| C["Emitted Check-Runs"]
  B -->|"Evaluate"| D["Preflight Script"]
  C -->|"Evaluate"| D
  D -->|"Generate"| E["JSON Report"]
  D -->|"Generate"| F["Markdown Report"]
  G["GitHub Actions Workflow"] -->|"Trigger"| D
Loading

Grey Divider

File Changes

1. scripts/strict21_preflight.py ✨ Enhancement +301/-0

Strict-21 preflight validation script implementation

• Implements preflight validation script with 301 lines of Python code
• Compares canonical contexts against branch protection required checks and emitted check-runs
• Handles GitHub API interactions with error handling for HTTP and network failures
• Generates JSON and markdown reports with compliance status and findings
• Supports custom canonical contexts via CLI argument with built-in strict-21 defaults

scripts/strict21_preflight.py


2. .github/branch-protection-policy.json ⚙️ Configuration changes +30/-0

Canonical branch protection policy definition

• Defines canonical branch protection policy for main branch
• Specifies 24 required status checks including backend, frontend, and analysis tools
• Enforces strict mode, linear history, and single approval requirement
• Serves as source of truth for canonical context validation

.github/branch-protection-policy.json


3. .github/workflows/strict21-preflight.yml ⚙️ Configuration changes +39/-0

GitHub Actions workflow for preflight checks

• Creates GitHub Actions workflow triggered on PRs and manual dispatch
• Runs preflight script with repository and branch context
• Generates and uploads preflight reports as workflow artifacts
• Outputs markdown report to workflow logs for visibility

.github/workflows/strict21-preflight.yml


Grey Divider

Qodo Logo

@qodo-code-review
Copy link

qodo-code-review bot commented Mar 2, 2026

Code Review by Qodo

🐞 Bugs (4) 📘 Rule violations (2) 📎 Requirement gaps (0)

Grey Divider


Action required

1. strict21_preflight.py lacks tests 📘 Rule violation ⛯ Reliability
Description
This PR introduces new CI/tooling behavior (strict-21 preflight gate) but does not add deterministic
automated tests or commit deterministic evidence artifacts to verify the change. Reviewers cannot
reproducibly validate that the new preflight logic behaves as intended from repository artifacts
alone.
Code

.github/workflows/strict21-preflight.yml[R20-39]

+      - name: Run strict-21 preflight
+        env:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+          STAMP: ${{ github.event.pull_request.number || github.run_id }}
+        run: |
+          set -euo pipefail
+          mkdir -p .tmp/strict21-preflight
+          python3 scripts/strict21_preflight.py \
+            --repo "${GITHUB_REPOSITORY}" \
+            --branch main \
+            --ref "${GITHUB_SHA}" \
+            --out-json ".tmp/strict21-preflight/preflight.json" \
+            --out-md ".tmp/strict21-preflight/preflight.md"
+          cat .tmp/strict21-preflight/preflight.md
+
+      - name: Upload strict-21 artifact
+        uses: actions/upload-artifact@v4
+        with:
+          name: strict21-preflight
+          path: .tmp/strict21-preflight
Evidence
Compliance ID 1 requires deterministic test evidence or deterministic test coverage when
tooling/tests are changed. The diff adds a new workflow that runs a new preflight script and uploads
only a transient workflow artifact, but no deterministic repository test coverage/evidence is added
in the PR diff.

AGENTS.md
.github/workflows/strict21-preflight.yml[20-39]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
New strict-21 CI/tooling behavior is added, but the PR does not include deterministic automated test coverage or deterministic, committed evidence artifacts verifying the change.

## Issue Context
The compliance requirement expects tooling/test-impacting changes to be reproducibly verifiable from repository artifacts (tests or committed evidence). The workflow currently uploads only a transient Actions artifact from `.tmp/strict21-preflight`.

## Fix Focus Areas
- .github/workflows/strict21-preflight.yml[20-39]
- scripts/strict21_preflight.py[99-129]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Preflight passes without token 📘 Rule violation ⛯ Reliability
Description
When GITHUB_TOKEN/GH_TOKEN is missing or the API returns permission-related errors, the
preflight sets status to inconclusive_permissions but still exits with code 0. This can produce
a green required check even though required inputs/queries were unavailable, masking missing
required artifacts/diagnostics.
Code

scripts/strict21_preflight.py[R262-297]

+    token = (os.environ.get("GITHUB_TOKEN") or "").strip() or (os.environ.get("GH_TOKEN") or "").strip()
+    now = datetime.now(timezone.utc).isoformat()
+    if not token:
+        result, branch_required_checks, emitted_contexts = _missing_token_result()
+    else:
+        result, branch_required_checks, emitted_contexts = _run_preflight(
+            args=args,
+            canonical=canonical,
+            token=token,
+        )
+
+    payload = {
+        "status": result.status,
+        "repo": args.repo,
+        "branch": args.branch,
+        "ref": args.ref,
+        "ref_sha": result.ref_sha,
+        "timestamp_utc": now,
+        "canonical_contexts": canonical,
+        "branch_protection_required_checks": branch_required_checks,
+        "emitted_contexts": emitted_contexts,
+        "missing_in_branch_protection": result.missing_in_branch_protection,
+        "missing_in_check_runs": result.missing_in_check_runs,
+        "findings": result.findings,
+        "http_status": result.http_status,
+        "http_error": result.http_error,
+    }
+
+    out_json.parent.mkdir(parents=True, exist_ok=True)
+    out_md.parent.mkdir(parents=True, exist_ok=True)
+    out_json.write_text(json.dumps(payload, indent=2, sort_keys=True) + "\n", encoding="utf-8")
+    out_md.write_text(_render_markdown(payload), encoding="utf-8")
+
+    if result.status in {"non_compliant", "api_error"}:
+        return 1
+    return 0
Evidence
Compliance ID 4 requires failing loudly (or explicitly failing) when required artifacts/inputs are
missing rather than reporting success. The code explicitly marks missing token as
inconclusive_permissions, but main() only returns non-zero for non_compliant/api_error, so
missing token/permission can still report success.

AGENTS.md
scripts/strict21_preflight.py[189-197]
scripts/strict21_preflight.py[262-297]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The preflight returns exit code 0 for `inconclusive_permissions` (e.g., missing token or 401/403/404), which can silently pass a required check even though required inputs/queries were unavailable.

## Issue Context
Compliance requires failing loudly or explicitly indicating missing required artifacts/inputs instead of reporting success. The script already sets `status=&quot;inconclusive_permissions&quot;`, but `main()` does not treat it as a failing status.

## Fix Focus Areas
- scripts/strict21_preflight.py[189-197]
- scripts/strict21_preflight.py[262-297]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Wrong ref for checks 🐞 Bug ⛯ Reliability
Description
The workflow inventories emitted checks using GITHUB_SHA, which on PR events can differ from the
head SHA and can be queried before other check-runs exist, causing flaky false non_compliant
failures. Use the PR head SHA (and/or wait/retry for expected contexts) before concluding missing
emitted checks.
Code

.github/workflows/strict21-preflight.yml[R27-32]

+          python3 scripts/strict21_preflight.py \
+            --repo "${GITHUB_REPOSITORY}" \
+            --branch main \
+            --ref "${GITHUB_SHA}" \
+            --out-json ".tmp/strict21-preflight/preflight.json" \
+            --out-md ".tmp/strict21-preflight/preflight.md"
Evidence
The workflow passes GITHUB_SHA as the ref to inventory, and the script immediately queries
check-runs/status for the resolved SHA once (no retry), so results can be incomplete or refer to a
different commit than the PR head.

.github/workflows/strict21-preflight.yml[20-32]
scripts/strict21_preflight.py[233-243]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The preflight workflow uses `GITHUB_SHA` as the `--ref` for emitted-check inventory. On PR runs this can point at a merge SHA and/or be queried before other checks are created, producing flaky false failures.

### Issue Context
The checker currently queries check-runs/status once for the resolved SHA and immediately compares against canonical contexts.

### Fix Focus Areas
- .github/workflows/strict21-preflight.yml[20-32]
- scripts/strict21_preflight.py[226-249]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View more (2)
4. Branch checks field ignored 🐞 Bug ✓ Correctness
Description
Branch protection required checks are read only from required_status_checks.contexts; if the repo
uses the newer required_status_checks.checks field, the script may treat the required list as empty
and misreport compliance. Parse both contexts and checks to avoid false results.
Code

scripts/strict21_preflight.py[R233-242]

+        protection = _api_get(args.api_base, args.repo, f"branches/{args.branch}/protection", token)
+        ref_payload = _api_get(args.api_base, args.repo, f"commits/{args.ref}", token)
+        ref_sha = str(ref_payload.get("sha") or "").strip() or None
+        if ref_sha is None:
+            raise RuntimeError(f"Unable to resolve SHA for ref {args.ref!r}")
+        check_runs = _api_get(args.api_base, args.repo, f"commits/{ref_sha}/check-runs?per_page=100", token)
+        status_payload = _api_get(args.api_base, args.repo, f"commits/{ref_sha}/status", token)
+
+        branch_required_checks = sorted((protection.get("required_status_checks") or {}).get("contexts") or [])
+        emitted_contexts = _collect_emitted_contexts(check_runs, status_payload)
Evidence
The script derives branch_required_checks exclusively from the contexts array, so any branch
protection configuration represented via another field will be ignored by this implementation.

scripts/strict21_preflight.py[233-242]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The preflight only reads `required_status_checks.contexts` from the branch protection API response, which can miss required checks if the branch protection config is represented differently.

### Issue Context
A missing/empty `branch_required_checks` list will cause false non-compliance for every canonical context.

### Fix Focus Areas
- scripts/strict21_preflight.py[233-243]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


5. Policy conflicts repo baseline 🐞 Bug ✓ Correctness
Description
The new canonical required_status_checks list omits repo-documented required checks (build-test,
validate-policy-contracts) and sets require_conversation_resolution=false, conflicting with the
existing branch protection baseline documented in the repo. This will either cause unexpected
strict21 preflight failures or weaken protections unless docs/branch protection are updated in
lockstep.
Code

.github/branch-protection-policy.json[R4-29]

+  "required_status_checks": [
+    "applitools-core",
+    "pr-agent",
+    "deep-agent",
+    "audit-pr-evidence",
+    "backend",
+    "backend-postgres",
+    "coverage",
+    "CodeQL",
+    "codecov-analytics",
+    "Analyze (actions)",
+    "Analyze (javascript-typescript)",
+    "Analyze (python)",
+    "CodeRabbit",
+    "dependency-review",
+    "compose-smoke",
+    "frontend",
+    "label",
+    "codacy-equivalent-zero",
+    "sonar-branch-zero",
+    "Seer Code Review",
+    "SonarCloud Code Analysis"
+  ],
+  "strict": true,
+  "require_linear_history": true,
+  "require_conversation_resolution": false
Evidence
The repo’s baseline documentation explicitly requires build-test and validate-policy-contracts and
conversation resolution, but the new policy file defines a different required check set and disables
conversation resolution.

docs/KPI_BASELINE.md[54-76]
.github/workflows/ci.yml[14-23]
.github/workflows/policy-contract.yml[10-24]
.github/branch-protection-policy.json[1-30]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The committed canonical policy conflicts with repo documentation and existing workflow check names, which risks breaking preflight or weakening protections.

### Issue Context
`docs/KPI_BASELINE.md` defines the currently expected required checks for `main` and requires conversation resolution.

### Fix Focus Areas
- .github/branch-protection-policy.json[1-30]
- scripts/strict21_preflight.py[15-38]
- docs/KPI_BASELINE.md[54-76]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

6. Policy not authoritative 🐞 Bug ⛯ Reliability
Description
The canonical contexts are duplicated in code (DEFAULT_CANONICAL_CONTEXTS) and the new
branch-protection-policy.json is not enforced by existing policy-contract validation, making drift
likely. Either load the JSON as the single source of truth (and validate it) or remove it to avoid
misleading “canonical policy” semantics.
Code

scripts/strict21_preflight.py[R15-38]

+PERMISSION_HTTP_CODES = {401, 403, 404}
+DEFAULT_CANONICAL_CONTEXTS = [
+    "applitools-core",
+    "pr-agent",
+    "deep-agent",
+    "audit-pr-evidence",
+    "backend",
+    "backend-postgres",
+    "coverage",
+    "CodeQL",
+    "codecov-analytics",
+    "Analyze (actions)",
+    "Analyze (javascript-typescript)",
+    "Analyze (python)",
+    "CodeRabbit",
+    "dependency-review",
+    "compose-smoke",
+    "frontend",
+    "label",
+    "codacy-equivalent-zero",
+    "sonar-branch-zero",
+    "Seer Code Review",
+    "SonarCloud Code Analysis",
+]
Evidence
The preflight uses a hard-coded list by default, while the policy-contract validation’s required
file set does not include the new policy JSON—so the JSON can change without any CI signal and the
script won’t pick it up anyway.

scripts/strict21_preflight.py[15-38]
scripts/strict21_preflight.py[93-97]
tools/validate-policy-contracts.ps1[40-88]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
Canonical required checks are duplicated (JSON + hard-coded list) and the JSON isn’t validated by existing policy-contract checks, so it can drift silently.

### Issue Context
The script currently defaults to `DEFAULT_CANONICAL_CONTEXTS` unless a CLI override is provided.

### Fix Focus Areas
- scripts/strict21_preflight.py[15-97]
- tools/validate-policy-contracts.ps1[40-92]
- .github/branch-protection-policy.json[1-30]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 2, 2026

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

Comment on lines +20 to +39
- name: Run strict-21 preflight
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
STAMP: ${{ github.event.pull_request.number || github.run_id }}
run: |
set -euo pipefail
mkdir -p .tmp/strict21-preflight
python3 scripts/strict21_preflight.py \
--repo "${GITHUB_REPOSITORY}" \
--branch main \
--ref "${GITHUB_SHA}" \
--out-json ".tmp/strict21-preflight/preflight.json" \
--out-md ".tmp/strict21-preflight/preflight.md"
cat .tmp/strict21-preflight/preflight.md

- name: Upload strict-21 artifact
uses: actions/upload-artifact@v4
with:
name: strict21-preflight
path: .tmp/strict21-preflight

Choose a reason for hiding this comment

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

Action required

1. strict21_preflight.py lacks tests 📘 Rule violation ⛯ Reliability

This PR introduces new CI/tooling behavior (strict-21 preflight gate) but does not add deterministic
automated tests or commit deterministic evidence artifacts to verify the change. Reviewers cannot
reproducibly validate that the new preflight logic behaves as intended from repository artifacts
alone.
Agent Prompt
## Issue description
New strict-21 CI/tooling behavior is added, but the PR does not include deterministic automated test coverage or deterministic, committed evidence artifacts verifying the change.

## Issue Context
The compliance requirement expects tooling/test-impacting changes to be reproducibly verifiable from repository artifacts (tests or committed evidence). The workflow currently uploads only a transient Actions artifact from `.tmp/strict21-preflight`.

## Fix Focus Areas
- .github/workflows/strict21-preflight.yml[20-39]
- scripts/strict21_preflight.py[99-129]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +262 to +297
token = (os.environ.get("GITHUB_TOKEN") or "").strip() or (os.environ.get("GH_TOKEN") or "").strip()
now = datetime.now(timezone.utc).isoformat()
if not token:
result, branch_required_checks, emitted_contexts = _missing_token_result()
else:
result, branch_required_checks, emitted_contexts = _run_preflight(
args=args,
canonical=canonical,
token=token,
)

payload = {
"status": result.status,
"repo": args.repo,
"branch": args.branch,
"ref": args.ref,
"ref_sha": result.ref_sha,
"timestamp_utc": now,
"canonical_contexts": canonical,
"branch_protection_required_checks": branch_required_checks,
"emitted_contexts": emitted_contexts,
"missing_in_branch_protection": result.missing_in_branch_protection,
"missing_in_check_runs": result.missing_in_check_runs,
"findings": result.findings,
"http_status": result.http_status,
"http_error": result.http_error,
}

out_json.parent.mkdir(parents=True, exist_ok=True)
out_md.parent.mkdir(parents=True, exist_ok=True)
out_json.write_text(json.dumps(payload, indent=2, sort_keys=True) + "\n", encoding="utf-8")
out_md.write_text(_render_markdown(payload), encoding="utf-8")

if result.status in {"non_compliant", "api_error"}:
return 1
return 0

Choose a reason for hiding this comment

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

Action required

2. Preflight passes without token 📘 Rule violation ⛯ Reliability

When GITHUB_TOKEN/GH_TOKEN is missing or the API returns permission-related errors, the
preflight sets status to inconclusive_permissions but still exits with code 0. This can produce
a green required check even though required inputs/queries were unavailable, masking missing
required artifacts/diagnostics.
Agent Prompt
## Issue description
The preflight returns exit code 0 for `inconclusive_permissions` (e.g., missing token or 401/403/404), which can silently pass a required check even though required inputs/queries were unavailable.

## Issue Context
Compliance requires failing loudly or explicitly indicating missing required artifacts/inputs instead of reporting success. The script already sets `status="inconclusive_permissions"`, but `main()` does not treat it as a failing status.

## Fix Focus Areas
- scripts/strict21_preflight.py[189-197]
- scripts/strict21_preflight.py[262-297]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +27 to +32
python3 scripts/strict21_preflight.py \
--repo "${GITHUB_REPOSITORY}" \
--branch main \
--ref "${GITHUB_SHA}" \
--out-json ".tmp/strict21-preflight/preflight.json" \
--out-md ".tmp/strict21-preflight/preflight.md"

Choose a reason for hiding this comment

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

Action required

3. Wrong ref for checks 🐞 Bug ⛯ Reliability

The workflow inventories emitted checks using GITHUB_SHA, which on PR events can differ from the
head SHA and can be queried before other check-runs exist, causing flaky false non_compliant
failures. Use the PR head SHA (and/or wait/retry for expected contexts) before concluding missing
emitted checks.
Agent Prompt
### Issue description
The preflight workflow uses `GITHUB_SHA` as the `--ref` for emitted-check inventory. On PR runs this can point at a merge SHA and/or be queried before other checks are created, producing flaky false failures.

### Issue Context
The checker currently queries check-runs/status once for the resolved SHA and immediately compares against canonical contexts.

### Fix Focus Areas
- .github/workflows/strict21-preflight.yml[20-32]
- scripts/strict21_preflight.py[226-249]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +233 to +242
protection = _api_get(args.api_base, args.repo, f"branches/{args.branch}/protection", token)
ref_payload = _api_get(args.api_base, args.repo, f"commits/{args.ref}", token)
ref_sha = str(ref_payload.get("sha") or "").strip() or None
if ref_sha is None:
raise RuntimeError(f"Unable to resolve SHA for ref {args.ref!r}")
check_runs = _api_get(args.api_base, args.repo, f"commits/{ref_sha}/check-runs?per_page=100", token)
status_payload = _api_get(args.api_base, args.repo, f"commits/{ref_sha}/status", token)

branch_required_checks = sorted((protection.get("required_status_checks") or {}).get("contexts") or [])
emitted_contexts = _collect_emitted_contexts(check_runs, status_payload)

Choose a reason for hiding this comment

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

Action required

4. Branch checks field ignored 🐞 Bug ✓ Correctness

Branch protection required checks are read only from required_status_checks.contexts; if the repo
uses the newer required_status_checks.checks field, the script may treat the required list as empty
and misreport compliance. Parse both contexts and checks to avoid false results.
Agent Prompt
### Issue description
The preflight only reads `required_status_checks.contexts` from the branch protection API response, which can miss required checks if the branch protection config is represented differently.

### Issue Context
A missing/empty `branch_required_checks` list will cause false non-compliance for every canonical context.

### Fix Focus Areas
- scripts/strict21_preflight.py[233-243]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +4 to +29
"required_status_checks": [
"applitools-core",
"pr-agent",
"deep-agent",
"audit-pr-evidence",
"backend",
"backend-postgres",
"coverage",
"CodeQL",
"codecov-analytics",
"Analyze (actions)",
"Analyze (javascript-typescript)",
"Analyze (python)",
"CodeRabbit",
"dependency-review",
"compose-smoke",
"frontend",
"label",
"codacy-equivalent-zero",
"sonar-branch-zero",
"Seer Code Review",
"SonarCloud Code Analysis"
],
"strict": true,
"require_linear_history": true,
"require_conversation_resolution": false

Choose a reason for hiding this comment

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

Action required

5. Policy conflicts repo baseline 🐞 Bug ✓ Correctness

The new canonical required_status_checks list omits repo-documented required checks (build-test,
validate-policy-contracts) and sets require_conversation_resolution=false, conflicting with the
existing branch protection baseline documented in the repo. This will either cause unexpected
strict21 preflight failures or weaken protections unless docs/branch protection are updated in
lockstep.
Agent Prompt
### Issue description
The committed canonical policy conflicts with repo documentation and existing workflow check names, which risks breaking preflight or weakening protections.

### Issue Context
`docs/KPI_BASELINE.md` defines the currently expected required checks for `main` and requires conversation resolution.

### Fix Focus Areas
- .github/branch-protection-policy.json[1-30]
- scripts/strict21_preflight.py[15-38]
- docs/KPI_BASELINE.md[54-76]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant