Skip to content

ci(af01): add posture proof and main enforcement - #45

Merged
TheHalfMoon merged 62 commits into
mainfrom
feat/af01-stack-c-posture-enforcement
Aug 27, 2026
Merged

ci(af01): add posture proof and main enforcement#45
TheHalfMoon merged 62 commits into
mainfrom
feat/af01-stack-c-posture-enforcement

Conversation

@TheHalfMoon

@TheHalfMoon TheHalfMoon commented Aug 27, 2026

Copy link
Copy Markdown
Owner

AF-01 Stack C — posture evidence, deterministic assurance, and main enforcement

Canonical Stack B base:

main: 301aa5e66089859e938145870dc4a9300a25692a
tree: d8557e6992ea82c0d2bb36178cf85961243e0691
Stack B PR: #44

This PR is the implementation carrier for AF-01 Phase 3 / Stack C (T030–T043). It MUST NOT merge until the exact final head is qualified, independently reviewed, and the complete live main governance ruleset set has been applied and read back.

Implemented posture and evidence controls

  • Runs the official OpenSSF Scorecard v5.5.0 Linux binary after verifying the published archive SHA-256; no mutable Scorecard Docker tag is trusted at runtime.
  • Runs separate local exact-tree and repository-aware Scorecard scans with contents: read only and retains raw JSON evidence for seven days.
  • Adds SECURITY.md with private vulnerability-reporting guidance.
  • Adds weekly Dependabot coverage for Cargo, the HL7 oracle Maven project, and GitHub Actions with a 7-day version-update cooldown and bounded open PR count.
  • Adds a deterministic AF-01 assurance workflow that binds workflow-trust, exact Cargo graph, cargo-deny, RustSec/cargo-audit, and zizmor evidence to one source SHA/tree.
  • Runs deterministic summary generation twice and requires byte-identical output.
  • Includes fail-closed counterexamples for SHA/tree mismatch, missing/malformed evidence, incomplete Action metadata coverage, trust-policy failure, dirty source state, and scanner/config identity mismatch.
  • Defines the universal required-check topology in .github/required-checks.json: rust, assurance-proof, and scorecard, each bound to GitHub Actions integration 15368.
  • Establishes .github/CODEOWNERS as the base-branch trust boundary for .github/.
  • Splits live-governance intent into two independently active rulesets so the sole-administrator repository does not deadlock while required checks remain unbypassable:
    • .github/main-ruleset.json — deletion, non-fast-forward, and strict integration-bound required checks with bypass_actors=[];
    • .github/main-review-ruleset.json — PR review policy with one approval, Code Owner review, stale-review dismissal, latest-push approval, resolved threads, and a repository-admin-role (actor_id=5) bypass limited to bypass_mode=pull_request.
  • Adds regressions proving the review-layer escape hatch cannot bypass required checks, deletion protection, or non-fast-forward protection.
  • Documents the threat model and GitHub rule-layering semantics in specs/015-af-01-trusted-development-baseline/stack-c-governance-layering.md.

Current evidence disposition

The Stack C local Scorecard posture shows least-privilege workflow controls, dependency-update automation, pinned Actions, and the security policy as present. RustSec for the locked Cargo graph is clean. Two Scorecard vulnerability warnings remain bounded to the Java/HL7-oracle dependency surface and are not being silently waived or used to mutate the frozen oracle dependency graph without separate qualification.

The repository-aware Scorecard scan has reported Branch-Protection=0 on canonical main. That remains an intentional blocking condition for T038, not a PASS. The checked-in ruleset payloads are configuration intent only until an authorized GitHub administrator mutation applies both rulesets and T039/T040 live read-back/negative proofs succeed.

Freeze boundary

This PR changes governance/security workflow surfaces only. Product Rust semantics, CF-06 oracle identity, CF-10 corpus authority, and frozen product behavior remain unchanged.

No PASS, approval, ruleset enforcement, merge, or CLOSED_CANONICAL state may be inferred from stale runs, aggregate Scorecard score, checked-in configuration, or earlier heads. All qualification and review evidence must bind to the exact final PR head.

@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown

Review Change Stack

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 5cabddf8-1e05-4c7d-8b64-1e39d4851979

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/af01-stack-c-posture-enforcement

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.

@qodo-code-review

Copy link
Copy Markdown

ⓘ Your Qodo trial ends soon. Ask your workspace admin to set up billing to keep reviews running after the trial. Manage billing

Copy link
Copy Markdown
Owner Author

@coderabbitai review

Please review exact head 20e66e5dba940040d137a97f807f33c62a4bcedc for AF-01 Stack C. Focus on workflow trust, least privilege, supply-chain pinning, deterministic assurance evidence, required-check topology, fail-closed behavior, and the intended no-bypass main ruleset contract. Product semantics are frozen and unchanged. Please report substantive security/correctness/governance findings; do not infer live ruleset enforcement from the checked-in payload.

Copy link
Copy Markdown
Owner Author

@qodo review

Please independently review exact head 20e66e5dba940040d137a97f807f33c62a4bcedc for AF-01 Stack C. Focus on security/correctness of the deterministic assurance builder and counterexamples, workflow permissions/action identities, required-check universality, ruleset contract consistency, and any gap that could permit a false PASS or unprotected merge. The live main ruleset is not yet applied.

@greptile-apps greptile-apps 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.

Your trial has ended. Reactivate Greptile to resume code reviews.

Copy link
Copy Markdown
Owner Author

@qodo review

Fresh exact-head re-review required for 0491b964a6a8844bb9b356fac9a24914c7cf16a0; every earlier review result is stale.

Please specifically re-check the two High false-PASS findings raised by the latest CodeRabbit full review:

  1. Required scanner steps now fail closed on any extra/unsupported top-level step field, including if: and continue-on-error:. cargo-deny and zizmor steps are constrained to exact {name, uses, with} shapes and exact refs/inputs. cargo-audit install is constrained to the exact inline command, and the audit block is constrained to the exact fail-closed shell sequence after heredoc normalization. Counterexamples cover if, continue-on-error, shell-control drift, and quoted scanner keys.
  2. Required-check topology now rejects quoted/dynamic/unsupported job IDs and top-level job fields, rejects quoted "if": false and quoted dynamic "name": ${{ 'rust' }}, canonicalizes YAML-commented literal names so name: rust # comment remains detectable, and also rejects required jobs with needs or continue-on-error.

All five exact-head workflows are SUCCESS. Final artifact: AF01_ASSURANCE_SHA256=e2f84f1a1fe0309f933d04632f3e0024c4decf8986a730fb38a37593efbf69ea; source tree 70e98be1a0d180e4d32a221cf5a537dd078307f8; scanner invocation digest cf396eb9cd2909452f89c31922c69e65043d73869ea94817e37b825e98287d77; 131/131 crates.io archives verified; RustSec found=false,count=0,list=[]; source-status clean. Live main ruleset T038-T040 remains separate and is not claimed complete.

Report any remaining substantive false-PASS/security/correctness/governance finding.

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

Perform a complete review from scratch of exact final head 0491b964a6a8844bb9b356fac9a24914c7cf16a0 against base 301aa5e66089859e938145870dc4a9300a25692a; do not reuse stale conclusions from earlier heads.

Please verify remediation of your two High findings from exact head 66b27d68703a6dea165a704b88869a8de21482c8:

  • scanner execution cannot be skipped or failure-tolerated without terminal assurance failing: required cargo-deny/zizmor steps now accept only exact static step shapes, cargo-audit install/run are bound to their exact enclosing steps, the audit block shell sequence is fail-closed, and counterexamples reject if:, continue-on-error:, quoted scanner keys, and shell-control drift;
  • required-check topology now fail-closes on quoted/dynamic/unsupported job IDs and top-level job keys, including "if": false and "name": ${{ 'rust' }}, and treats name: rust # comment as context rust, while also rejecting required jobs with needs or failure tolerance.

All five exact-head workflow gates are SUCCESS. Final AF01_ASSURANCE_SHA256=e2f84f1a1fe0309f933d04632f3e0024c4decf8986a730fb38a37593efbf69ea; source tree 70e98be1a0d180e4d32a221cf5a537dd078307f8; scanner invocation digest cf396eb9cd2909452f89c31922c69e65043d73869ea94817e37b825e98287d77; 131/131 fetched crates.io archives verified; RustSec zero vulnerabilities; clean source status. Live main ruleset deployment/read-back remains a separate T038-T040 blocker and must not be inferred from the checked-in payload.

@qodo-code-review

Copy link
Copy Markdown

review

Fresh exact-head re-review required for 0491b964a6a8844bb9b356fac9a24914c7cf16a0; every earlier review result is stale.

Please specifically re-check the two High false-PASS findings raised by the latest CodeRabbit full review:

  1. Required scanner steps now fail closed on any extra/unsupported top-level step field, including if: and continue-on-error:. cargo-deny and zizmor steps are constrained to exact {name, uses, with} shapes and exact refs/inputs. cargo-audit install is constrained to the exact inline command, and the audit block is constrained to the exact fail-closed shell sequence after heredoc normalization. Counterexamples cover if, continue-on-error, shell-control drift, and quoted scanner keys.
  2. Required-check topology now rejects quoted/dynamic/unsupported job IDs and top-level job fields, rejects quoted "if": false and quoted dynamic "name": ${{ 'rust' }}, canonicalizes YAML-commented literal names so name: rust # comment remains detectable, and also rejects required jobs with needs or continue-on-error.

All five exact-head workflows are SUCCESS. Final artifact: AF01_ASSURANCE_SHA256=e2f84f1a1fe0309f933d04632f3e0024c4decf8986a730fb38a37593efbf69ea; source tree 70e98be1a0d180e4d32a221cf5a537dd078307f8; scanner invocation digest cf396eb9cd2909452f89c31922c69e65043d73869ea94817e37b825e98287d77; 131/131 crates.io archives verified; RustSec found=false,count=0,list=[]; source-status clean. Live main ruleset T038-T040 remains separate and is not claimed complete.

Report any remaining substantive false-PASS/security/correctness/governance finding.

Fresh exact-head review: I do not see a remaining substantive false-PASS, security, correctness, or governance issue in the two challenged areas.

  • finding 1 — addressed in the current code. The verified builder now parses and validates the actual assurance workflow via validate_scanner_binding() (.github/scripts/build_af01_assurance_summary_verified.py:89-134) before adding the scanner contract and digest to the final summary. The workflow invokes that verified builder twice (.github/workflows/af01-assurance-proof.yml:198-220), so the self-declared proof records cannot independently establish a passing result.
  • The scanner contract enforces exact action refs and inputs, exact cargo-audit install/run commands, and the fail-closed shell sequence (.github/scripts/validate_af01_scanner_invocations.py:274-319). The added negative tests cover the stated if, continue-on-error, quoted-key, and shell-drift cases.
  • The required-check topology tests reject unsupported or quoted job syntax, conditional/tolerant required jobs, filtered pull requests, and duplicate/spoofed contexts (.github/scripts/test_required_check_topology.py:123-145, :248-355). YAML-commented literal names are normalized before producer matching (:27-33, :155-181).
  • The workflow also performs exact-head/tree and clean-worktree validation before producing the artifact (.github/workflows/af01-assurance-proof.yml:201-222).

Based on the supplied exact-head results and the inspected binding path, I would not report any additional substantive finding. The live main-ruleset T038–T040 status remains appropriately out of scope rather than being claimed complete.

@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

base='301aa5e66089859e938145870dc4a9300a25692a'
head='0491b964a6a8844bb9b356fac9a24914c7cf16a0'

printf '%s\n' '== Commit identity =='
printf 'checked_out='; git rev-parse HEAD
printf 'requested='; git rev-parse "${head}^{commit}"
git show -s --format='commit=%H%nparents=%P%nsubject=%s' "$head"

printf '%s\n' '== Complete base-to-head delta =='
git diff --name-status "$base" "$head"

printf '%s\n' '== Final head delta =='
git diff --no-ext-diff --unified=100 "${head}^" "$head" -- .github Cargo.lock SECURITY.md

printf '%s\n' '== Relevant exact-head file map =='
git ls-tree -r --name-only "$head" |
  rg '^(?:\.github/(?:workflows/|scripts/|.*(?:required-checks|main-ruleset|workflow-trust-policy))|SECURITY\.md|Cargo\.lock)$' |
  sort

printf '%s\n' '== Candidate outlines =='
git ls-tree -r --name-only "$head" |
  rg '^(?:\.github/(?:workflows/|scripts/|.*(?:required-checks|main-ruleset|workflow-trust-policy))|SECURITY\.md)$' |
  sort |
  while IFS= read -r file; do
    printf '\n--- %s\n' "$file"
    ast-grep outline "$file" --items all 2>/dev/null || true
  done

printf '%s\n' '== Required-check topology, scanner validation, and workflows =='
for file in \
  .github/scripts/test_required_check_topology.py \
  .github/scripts/validate_af01_scanner_invocations.py \
  .github/workflows/af01-assurance-proof.yml \
  .github/workflows/ci.yml \
  .github/workflows/af01-scorecard.yml \
  .github/workflows/af01-security.yml \
  .github/required-checks.json \
  .github/main-ruleset.json \
  .github/workflow-trust-policy.json
do
  if [ -f "$file" ]; then
    printf '\n--- %s\n' "$file"
    nl -ba "$file"
  fi
done

Length of output: 20121


🏁 Script executed:

#!/bin/bash
set -euo pipefail

head='0491b964a6a8844bb9b356fac9a24914c7cf16a0'
show_numbered() {
  file="$1"
  printf '\n--- %s\n' "$file"
  git show "${head}:${file}" | awk '{ printf "%6d  %s\n", NR, $0 }'
}

printf '%s\n' '== Exact final commit changes =='
git diff --name-status "${head}^" "$head"

printf '%s\n' '== Scanner workflow and validator sources =='
for file in \
  .github/workflows/af01-assurance-proof.yml \
  .github/scripts/validate_af01_scanner_invocations.py \
  .github/scripts/test_validate_af01_scanner_invocations.py \
  .github/scripts/test_audit_workflow_trust_scanner_invocations.py \
  .github/scripts/build_af01_assurance_summary_verified.py \
  .github/scripts/test_build_af01_assurance_summary_verified.py
do
  show_numbered "$file"
done

printf '%s\n' '== Checksum, audit, inventory, and assurance sources =='
for file in \
  .github/scripts/verify_crate_checksums.py \
  .github/scripts/test_verify_crate_checksums.py \
  .github/scripts/build_af01_assurance_summary.py \
  .github/scripts/test_build_af01_assurance_summary.py \
  .github/scripts/summarize_cargo_metadata.py \
  .github/scripts/test_summarize_cargo_metadata.py \
  .github/scripts/test_required_check_topology.py
do
  show_numbered "$file"
done

printf '%s\n' '== Workflow trust and governance contracts =='
for file in \
  .github/scripts/audit_workflow_trust.py \
  .github/scripts/audit_workflow_trust_surface.py \
  .github/scripts/audit_workflow_trust_environment_channels.py \
  .github/scripts/test_audit_workflow_trust_required_check_topology.py \
  .github/required-checks.json \
  .github/main-ruleset.json \
  .github/workflow-trust-policy.json \
  .github/workflows/ci.yml \
  .github/workflows/af01-scorecard.yml \
  .github/workflows/af01-security.yml
do
  show_numbered "$file"
done

printf '%s\n' '== Security-sensitive syntax across all exact-head workflows =='
git ls-tree -r --name-only "$head" .github/workflows |
  while IFS= read -r file; do
    git show "${head}:${file}" |
      awk -v f="$file" '
        /^[[:space:]]*(if|continue-on-error|permissions|uses|run|name|needs)[[:space:]]*:/ {
          printf "%s:%d:%s\n", f, NR, $0
        }'
  done

Length of output: 118267


🏁 Script executed:

#!/bin/bash
set -euo pipefail

head='0491b964a6a8844bb9b356fac9a24914c7cf16a0'
show_numbered() {
  file="$1"
  printf '\n--- %s\n' "$file"
  git show "${head}:${file}" | awk '{ printf "%6d  %s\n", NR, $0 }'
}

printf '%s\n' '== Terminal scanner execution contract =='
for file in \
  .github/workflows/af01-assurance-proof.yml \
  .github/scripts/validate_af01_scanner_invocations.py \
  .github/scripts/test_validate_af01_scanner_invocations.py \
  .github/scripts/build_af01_assurance_summary_verified.py \
  .github/scripts/test_build_af01_assurance_summary_verified.py
do
  show_numbered "$file"
done

printf '%s\n' '== Scanner-specific test names and assertions =='
for file in \
  .github/scripts/test_validate_af01_scanner_invocations.py \
  .github/scripts/test_audit_workflow_trust_scanner_invocations.py
do
  printf '\n--- %s\n' "$file"
  git show "${head}:${file}" |
    grep -nE '^( *def test_| *class |.*(continue-on-error|quoted|unsupported|cargo-deny|zizmor|cargo-audit|if:))' || true
done

Length of output: 60662


🏁 Script executed:

#!/bin/bash
set -euo pipefail

head='0491b964a6a8844bb9b356fac9a24914c7cf16a0'
show_numbered() {
  file="$1"
  printf '\n--- %s\n' "$file"
  git show "${head}:${file}" | awk '{ printf "%6d  %s\n", NR, $0 }'
}

printf '%s\n' '== Core assurance validation =='
for file in \
  .github/scripts/build_af01_assurance_summary.py \
  .github/scripts/test_build_af01_assurance_summary.py \
  .github/scripts/verify_crate_checksums.py \
  .github/scripts/test_verify_crate_checksums.py
do
  show_numbered "$file"
done

printf '%s\n' '== Cargo inventory and required-check topology =='
for file in \
  .github/scripts/summarize_cargo_metadata.py \
  .github/scripts/test_summarize_cargo_metadata.py \
  .github/scripts/test_required_check_topology.py \
  .github/scripts/test_main_ruleset_contract.py
do
  show_numbered "$file"
done

Length of output: 97894


@TheHalfMoon, I reviewed exact head 0491b964a6a8844bb9b356fac9a24914c7cf16a0 against base 301aa5e66089859e938145870dc4a9300a25692a.

I found one substantive governance and false-PASS risk.

  • High — The required checks validate untrusted PR-controlled workflow definitions.
    The required contexts run on pull_request. The workflow files are part of the pull request. A contributor can modify .github/workflows/ci.yml, .github/workflows/af01-assurance-proof.yml, or .github/workflows/af01-scorecard.yml in the same pull request. The modified workflow can retain the protected job name and produce a successful rust, assurance-proof, or scorecard context from GitHub Actions integration ID 15368.

    The repository-contained topology test and assurance validators do not prevent this case. The contributor can modify or omit these steps in the same workflow change. The required-check ruleset matches only the context and integration ID. It does not bind a trusted workflow revision.

    The exact source checks, static scanner-step shapes, Cargo checksum evidence, RustSec schema checks, and duplicate-context checks protect the workflow revision that executes. They do not make that revision trusted when the pull request supplies it.

    Run the protected checks from a trusted workflow definition outside the pull request authority. For example, use a separately protected repository or an immutable reusable workflow with the workflow revision controlled by trusted maintainers. Make the trusted workflow check out the PR head as data. It must then run the validators against that checked-out head. Keep the required contexts on the trusted workflow.

The requested remediations are present in this head:

  • .github/scripts/validate_af01_scanner_invocations.py requires exact scanner step shapes. It rejects if:, continue-on-error:, quoted keys, and other extra step fields for cargo-deny, cargo-audit, and zizmor.
  • The cargo-audit step requires the exact normalized shell sequence and requires a zero exit status.
  • .github/scripts/test_required_check_topology.py rejects quoted and unsupported job IDs and top-level job fields. It rejects required jobs with if, needs, or continue-on-error. It also detects name: rust # comment as the rust context.
  • The final assurance builder independently re-verifies fetched crate archives against Cargo.lock. It binds the checksum evidence and scanner contract into the final summary.
  • Cargo-audit validation requires found: false, count: 0, list: [], the exact dependency count, and advisory database commit consistency.
  • The checked-in required-check and main ruleset contracts are internally consistent.

I did not infer live main ruleset deployment or enforcement from .github/main-ruleset.json.

You are interacting with an AI system.

@greptile-apps greptile-apps 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.

Your trial has ended. Reactivate Greptile to resume code reviews.

@greptile-apps greptile-apps 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.

Your trial has ended. Reactivate Greptile to resume code reviews.

@greptile-apps greptile-apps 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.

Your trial has ended. Reactivate Greptile to resume code reviews.

@greptile-apps greptile-apps 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.

Your trial has ended. Reactivate Greptile to resume code reviews.

@greptile-apps greptile-apps 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.

Your trial has ended. Reactivate Greptile to resume code reviews.

Copy link
Copy Markdown
Owner Author

@qodo review

Fresh exact-head review required for 8955425270ee7931f98e9b3777d2e6ac8d4a341a; all earlier review results are stale.

Please re-check the remaining CodeRabbit High finding that required checks execute PR-controlled workflow definitions. The remediation establishes an explicit human governance trust root for the user-owned repository:

  • .github/CODEOWNERS contains one unambiguous rule: /.github/ @TheHalfMoon, covering workflows, assurance scripts, required-check topology, ruleset intent, and CODEOWNERS itself with no narrower overrides;
  • GitHub evaluates CODEOWNERS from the PR base branch, so after this Stack C change becomes canonical, a later PR cannot weaken .github/ ownership in the same PR to bypass review;
  • .github/main-ruleset.json now requires require_code_owner_review=true, one approval, stale-review dismissal, latest-push approval, resolved threads, exact GitHub Actions integration-bound checks, and no bypass actors;
  • universal CI includes fail-closed regressions proving the CODEOWNERS boundary and ruleset code-owner requirement.

This is deliberately not a pull_request_target solution and does not execute untrusted PR code in a privileged trusted-context workflow. This current bootstrap PR itself cannot claim base-branch CODEOWNERS protection before merge, so it still requires exact-head independent review and T038-T040 live admin enforcement/read-back before T043.

Exact-head evidence: all five workflows SUCCESS; artifact 9645172853, GitHub artifact digest sha256:6f97f4bcb4e5914a83ba36e08e442ab4983e69b3d5ec11765f8cd580fdff8430; AF01_ASSURANCE_SHA256=2bd412ad605c5988ad08f73c2bcb2cb9ca17e66a9791ff21aa96e17b3d7b5db1; source tree 7819628be16fcbf2ce13696b934d9c51fe5c860b; 131/131 crate archives verified; RustSec zero vulnerabilities. Required check contexts each have exactly one SUCCESS producer from GitHub Actions app 15368.

Live rulesets remain []; do not infer deployment completion. Report any remaining substantive false-PASS/security/correctness/governance finding.

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

Perform a complete review from scratch of exact head 8955425270ee7931f98e9b3777d2e6ac8d4a341a against base 301aa5e66089859e938145870dc4a9300a25692a; earlier conclusions are stale.

Please specifically re-evaluate your remaining High finding: PR-controlled workflow definitions could retain required check names and GitHub Actions integration identity while weakening the checks. The remediation now establishes a base-branch Code Owner trust boundary:

  • .github/CODEOWNERS has exactly /.github/ @TheHalfMoon, so all workflows, assurance scripts, topology/ruleset files, and CODEOWNERS itself are owner-controlled with no narrower override;
  • the intended main ruleset now has require_code_owner_review=true, one approval, stale reviews dismissed, latest-push approval required, conversations resolved, no bypass actors, and the three exact integration-bound required checks;
  • universal trust-suite regressions require that CODEOWNERS boundary and code-owner-review ruleset setting.

GitHub's CODEOWNERS model uses the base-branch CODEOWNERS file for PR review requirements, so once this Stack C change is canonical, a malicious PR cannot weaken its own workflow ownership rule and have that head version govern the same PR. This PR is the bootstrap: it does NOT claim existing base-branch CODEOWNERS protection and still must receive exact-head independent review plus T038-T040 live ruleset deployment/read-back before merge. We intentionally did not use pull_request_target to run untrusted PR code.

Exact-head qualification is complete: ci, cf06-oracle, af01-security, af01-scorecard, af01-assurance-proof all SUCCESS. Artifact 9645172853, digest sha256:6f97f4bcb4e5914a83ba36e08e442ab4983e69b3d5ec11765f8cd580fdff8430, AF01_ASSURANCE_SHA256=2bd412ad605c5988ad08f73c2bcb2cb9ca17e66a9791ff21aa96e17b3d7b5db1, tree 7819628be16fcbf2ce13696b934d9c51fe5c860b, RustSec zero vulnerabilities, clean source. rust, assurance-proof, and scorecard each have exactly one SUCCESS check run from GitHub Actions app 15368.

Live repository rulesets are still [], so deployment governance remains a separate hard blocker. Please report any remaining substantive false-PASS/security/correctness/governance issue in the implementation/design.

@qodo-code-review

Copy link
Copy Markdown

review

Fresh exact-head review required for 8955425270ee7931f98e9b3777d2e6ac8d4a341a; all earlier review results are stale.

Please re-check the remaining CodeRabbit High finding that required checks execute PR-controlled workflow definitions. The remediation establishes an explicit human governance trust root for the user-owned repository:

  • .github/CODEOWNERS contains one unambiguous rule: /.github/ @TheHalfMoon, covering workflows, assurance scripts, required-check topology, ruleset intent, and CODEOWNERS itself with no narrower overrides;
  • GitHub evaluates CODEOWNERS from the PR base branch, so after this Stack C change becomes canonical, a later PR cannot weaken .github/ ownership in the same PR to bypass review;
  • .github/main-ruleset.json now requires require_code_owner_review=true, one approval, stale-review dismissal, latest-push approval, resolved threads, exact GitHub Actions integration-bound checks, and no bypass actors;
  • universal CI includes fail-closed regressions proving the CODEOWNERS boundary and ruleset code-owner requirement.

This is deliberately not a pull_request_target solution and does not execute untrusted PR code in a privileged trusted-context workflow. This current bootstrap PR itself cannot claim base-branch CODEOWNERS protection before merge, so it still requires exact-head independent review and T038-T040 live admin enforcement/read-back before T043.

Exact-head evidence: all five workflows SUCCESS; artifact 9645172853, GitHub artifact digest sha256:6f97f4bcb4e5914a83ba36e08e442ab4983e69b3d5ec11765f8cd580fdff8430; AF01_ASSURANCE_SHA256=2bd412ad605c5988ad08f73c2bcb2cb9ca17e66a9791ff21aa96e17b3d7b5db1; source tree 7819628be16fcbf2ce13696b934d9c51fe5c860b; 131/131 crate archives verified; RustSec zero vulnerabilities. Required check contexts each have exactly one SUCCESS producer from GitHub Actions app 15368.

Live rulesets remain []; do not infer deployment completion. Report any remaining substantive false-PASS/security/correctness/governance finding.

Fresh exact-head review

I find no remaining substantive false-PASS, security, correctness, or governance defect in the reviewed remediation.

  • finding 1 — Scanner proof is self-declared: Remediated in this head. The assurance workflow now runs build_af01_assurance_summary_verified.py (.github/workflows/af01-assurance-proof.yml:198-220), which parses and validates the actual workflow’s scanner invocations through validate_af01_scanner_invocations.py.
    • It requires the exact cargo-deny and zizmor commit refs and inputs, plus the exact cargo-audit install/run sequence.
    • It compares those parsed invocations against the generated proof evidence (build_af01_assurance_summary_verified.py:89-134), so changing the executed scanner or weakening its arguments causes the summary to fail rather than producing a false PASS.
    • The verified summary is the artifact-producing path; the unverified core builder is not used by the workflow.
  • The governance trust boundary is coherently represented by the single /.github/ @TheHalfMoon rule in .github/CODEOWNERS, and .github/main-ruleset.json requires code-owner approval, latest-push approval, stale-review dismissal, resolved threads, exact GitHub Actions checks, and no bypass actors.
  • The bootstrap limitation remains correctly stated: the repository cannot rely on this PR’s new base-branch CODEOWNERS/ruleset protection until merge. Therefore independent exact-head review and the T038–T040 live enforcement/read-back remain prerequisites; the checked-in ruleset is intent, not proof of deployment, especially while live rulesets are [].

I did not dismiss finding 1 because you requested a review, not a finding-status change. Based on the code and supplied exact-head evidence, it is ready for closure once the governance prerequisites are independently confirmed.

@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

base='301aa5e66089859e938145870dc4a9300a25692a'
head='8955425270ee7931f98e9b3777d2e6ac8d4a341a'

echo '== Commit identity =='
printf 'checked_out='; git rev-parse HEAD
printf 'requested='; git rev-parse "${head}^{commit}"
git show -s --format='commit=%H%nparents=%P%nsubject=%s' "$head"

echo '== Complete base-to-head delta =='
git diff --name-status "$base" "$head"

echo '== Exact-head files relevant to AF-01 =='
git ls-tree -r --name-only "$head" |
  rg '^(?:\.github/(?:CODEOWNERS|workflows/|scripts/|.*(?:required-checks|main-ruleset|workflow-trust-policy))|SECURITY\.md|Cargo\.lock)$' |
  sort

echo '== Final commit delta =='
git diff --no-ext-diff --unified=100 "${head}^" "$head" -- .github Cargo.lock SECURITY.md

echo '== Candidate file outlines =='
git ls-tree -r --name-only "$head" |
  rg '^(?:\.github/(?:CODEOWNERS|workflows/|scripts/|.*(?:required-checks|main-ruleset|workflow-trust-policy))|SECURITY\.md)$' |
  sort |
  while IFS= read -r file; do
    echo "--- $file"
    ast-grep outline "$file" --items all 2>/dev/null || true
  done

Length of output: 3815


🏁 Script executed:

#!/bin/bash
set -euo pipefail

head='8955425270ee7931f98e9b3777d2e6ac8d4a341a'

show_numbered() {
  file="$1"
  echo
  echo "--- $file"
  git show "${head}:${file}" | nl -ba
}

echo '== Governance contracts and CODEOWNERS =='
for file in \
  .github/CODEOWNERS \
  .github/main-ruleset.json \
  .github/required-checks.json \
  .github/workflow-trust-policy.json \
  .github/scripts/test_codeowners_trust_boundary.py \
  .github/scripts/test_main_ruleset_contract.py \
  .github/scripts/test_required_check_topology.py \
  .github/scripts/test_audit_workflow_trust_codeowners_boundary.py \
  .github/scripts/test_audit_workflow_trust_main_ruleset_contract.py \
  .github/scripts/test_audit_workflow_trust_required_check_topology.py
do
  show_numbered "$file"
done

echo '== Required workflows =='
for file in \
  .github/workflows/ci.yml \
  .github/workflows/af01-assurance-proof.yml \
  .github/workflows/af01-scorecard.yml \
  .github/workflows/af01-security.yml
do
  show_numbered "$file"
done

echo '== Scanner and assurance validation =='
for file in \
  .github/scripts/validate_af01_scanner_invocations.py \
  .github/scripts/test_validate_af01_scanner_invocations.py \
  .github/scripts/verify_crate_checksums.py \
  .github/scripts/build_af01_assurance_summary.py \
  .github/scripts/build_af01_assurance_summary_verified.py \
  .github/scripts/summarize_cargo_metadata.py
do
  show_numbered "$file"
done

echo '== Universal trust-suite wiring and security-sensitive workflow syntax =='
git show "${head}:.github/workflows/ci.yml" |
  nl -ba | sed -n '1,420p'

git ls-tree -r --name-only "$head" .github/workflows |
  while IFS= read -r file; do
    git show "${head}:${file}" |
      awk -v file="$file" '
        /^[[:space:]]*(if|continue-on-error|needs|permissions|uses|run|name)[[:space:]]*:/ {
          printf "%s:%d:%s\n", file, NR, $0
        }'
  done

Length of output: 2284


🏁 Script executed:

#!/bin/bash
set -euo pipefail

head='8955425270ee7931f98e9b3777d2e6ac8d4a341a'

show_numbered() {
  file="$1"
  printf '\n--- %s\n' "$file"
  git show "${head}:${file}" | awk '{ printf "%6d  %s\n", NR, $0 }'
}

echo '== Governance contracts and CODEOWNERS =='
for file in \
  .github/CODEOWNERS \
  .github/main-ruleset.json \
  .github/required-checks.json \
  .github/workflow-trust-policy.json \
  .github/scripts/test_codeowners_trust_boundary.py \
  .github/scripts/test_main_ruleset_contract.py \
  .github/scripts/test_required_check_topology.py \
  .github/scripts/test_audit_workflow_trust_codeowners_boundary.py \
  .github/scripts/test_audit_workflow_trust_main_ruleset_contract.py \
  .github/scripts/test_audit_workflow_trust_required_check_topology.py
do
  show_numbered "$file"
done

echo '== Required workflows =='
for file in \
  .github/workflows/ci.yml \
  .github/workflows/af01-assurance-proof.yml \
  .github/workflows/af01-scorecard.yml \
  .github/workflows/af01-security.yml
do
  show_numbered "$file"
done

echo '== Scanner and assurance validation =='
for file in \
  .github/scripts/validate_af01_scanner_invocations.py \
  .github/scripts/test_validate_af01_scanner_invocations.py \
  .github/scripts/verify_crate_checksums.py \
  .github/scripts/build_af01_assurance_summary.py \
  .github/scripts/build_af01_assurance_summary_verified.py \
  .github/scripts/summarize_cargo_metadata.py
do
  show_numbered "$file"
done

echo '== Universal trust-suite wiring =='
git show "${head}:.github/workflows/ci.yml" |
  awk '{ printf "%6d  %s\n", NR, $0 }' | sed -n '1,420p'

echo '== Workflow execution modifiers =='
git ls-tree -r --name-only "$head" .github/workflows |
  while IFS= read -r file; do
    git show "${head}:${file}" |
      awk -v file="$file" '
        /^[[:space:]]*(if|continue-on-error|needs|permissions|uses|run|name)[[:space:]]*:/ {
          printf "%s:%d:%s\n", file, NR, $0
        }'
  done

Length of output: 177817


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '== Pull request author and target branch =='
gh pr view 45 --repo TheHalfMoon/commandF \
  --json number,author,baseRefName,headRefOid,isDraft \
  --jq '{number, author: .author.login, baseRefName, headRefOid, isDraft}'

echo '== Current live repository rulesets (read-only) =='
gh api repos/TheHalfMoon/commandF/rulesets --jq '.[] | {id, name, enforcement, target}' || true

echo '== Exact-head ownership and no-bypass contract references =='
rg -n -C 3 \
  'EXPECTED_OWNER|EXPECTED_PATTERN|ownership_entries|require_code_owner_review|bypass_actors|require_last_push_approval' \
  .github/CODEOWNERS \
  .github/main-ruleset.json \
  .github/scripts/test_codeowners_trust_boundary.py \
  .github/scripts/test_main_ruleset_contract.py

Length of output: 8552


🤖 web_search executed:

GitHub Docs can a pull request author approve their own pull request code owner review required code owner approval

Length of output: 14344


@TheHalfMoon I reviewed exact head 8955425270ee7931f98e9b3777d2e6ac8d4a341a against base 301aa5e66089859e938145870dc4a9300a25692a.

I found one substantive governance risk.

  • High — The single Code Owner can deadlock all future .github maintenance.
    .github/CODEOWNERS assigns /.github/ only to @TheHalfMoon. Pull request #45 is also authored by TheHalfMoon. The intended .github/main-ruleset.json requires a Code Owner approval and has no bypass actors.

    After deployment, a PR authored by TheHalfMoon that changes any .github file cannot meet the Code Owner requirement. GitHub does not permit a pull request author to approve their own pull request. The same PR also requires an approval after the latest push. This blocks security workflow updates, ruleset-contract updates, Dependabot configuration updates, and recovery changes to CODEOWNERS itself.

    Add at least one independent, continuously available Code Owner for /.github/. Use a second trusted collaborator or a maintained team. Update .github/scripts/test_codeowners_trust_boundary.py so it verifies the intended multi-owner boundary rather than requiring exactly one owner. Keep the empty bypass_actors list.

    References: GitHub required-review documentation states that PR authors cannot approve their own PRs. GitHub CODEOWNERS documentation confirms that any listed Code Owner can satisfy required Code Owner review.

The base-branch CODEOWNERS model addresses the previous PR-controlled workflow-definition finding once the intended ruleset is deployed. The required-check integration bindings, required-context topology checks, scanner-step contract, fetched-crate checksum verification, Cargo.lock reconciliation, and cargo-audit zero-vulnerability validation are present on this exact head.

I confirmed that live repository rulesets currently read empty. I did not infer live main enforcement from .github/main-ruleset.json.

You are interacting with an AI system.

Copy link
Copy Markdown
Owner Author

AF-01 Stack C live blocker checkpoint

Exact candidate head remains:

8955425270ee7931f98e9b3777d2e6ac8d4a341a

No head mutation was made while evaluating the latest CodeRabbit review.

Exact-head qualification still observed

The five path-applicable workflows remain terminal SUCCESS on this exact head:

  • ci — run 33069267960
  • cf06-oracle — run 33069267884
  • af01-security — run 33069267942
  • af01-scorecard — run 33069267877
  • af01-assurance-proof — run 33069267904

The selected required contexts each have exactly one exact-head GitHub Actions producer bound to application id 15368:

  • rust
  • assurance-proof
  • scorecard

Prior Qodo scanner-binding thread

The older Qodo scanner self-declaration thread was re-verified against the current implementation and counterexample suite, answered with exact-head evidence, and resolved. That disposition is limited to the scanner-binding finding.

Current substantive CodeRabbit governance finding — OPEN

The latest exact-head CodeRabbit review correctly identifies a separate High governance/availability defect in the proposed trust root: .github/CODEOWNERS currently has only @TheHalfMoon, while the intended ruleset requires Code Owner review, at least one approval, stale-review dismissal, latest-push approval, resolved conversations, and no bypass actors.

Because PR authors cannot approve their own PRs, a future .github/ PR authored by the sole Code Owner can deadlock maintenance. A correct code-only remediation requires at least one real, independent, continuously available GitHub principal with repository write authority (trusted collaborator, or an eligible maintained team in an organization-owned repository). No such principal may be invented or represented by a bot merely to satisfy the contract.

The currently available repository tooling exposes collaborator-permission lookup only for a known username; it does not expose collaborator listing/invitation, and no second trusted write-capable human principal is established by repository evidence. Therefore I am not modifying CODEOWNERS, weakening require_code_owner_review, lowering review requirements, or adding a bypass actor.

Live ruleset deployment remains independently blocked

Live read-back still returns:

[]

for GET /repos/TheHalfMoon/commandF/rulesets.

The available GitHub connector exposes ruleset reads but no create/update mutation. Therefore:

T038 NOT COMPLETE
T039 NOT COMPLETE
T040 NOT COMPLETE
T042 NOT COMPLETE (current CodeRabbit High remains substantive)
T043 MUST NOT MERGE

This is the furthest truthful Stack C boundary with the currently authorized tooling and established repository identities. Do not infer live enforcement from .github/main-ruleset.json, and do not merge this candidate until both external governance prerequisites are genuinely satisfied and the resulting exact head is requalified/re-reviewed.

@greptile-apps greptile-apps 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.

Your trial has ended. Reactivate Greptile to resume code reviews.

Copy link
Copy Markdown
Owner Author

@qodo review

Fresh exact-head review required for c82ef6e6f137805074cc5e0c453d47e0d2799839; all earlier review results are stale.

Please re-evaluate the prior Code Owner deadlock finding against the new layered-ruleset design:

  • .github/main-ruleset.json is now the unbypassable assurance layer: bypass_actors=[], deletion blocked, non-fast-forward blocked, and strict required checks rust, assurance-proof, and scorecard, each bound to GitHub Actions integration 15368;
  • .github/main-review-ruleset.json contains only the pull-request review rule: one approval, Code Owner review, stale-review dismissal, latest-push approval, resolved threads, merge-only;
  • the review layer alone has repository admin role actor_id=5 with bypass_mode=pull_request, which GitHub documents as requiring a PR rather than permitting direct push;
  • regression tests fail unless the admin bypass remains confined to the review ruleset and cannot cover required checks, deletion, or non-fast-forward rules;
  • .github/CODEOWNERS remains /.github/ @TheHalfMoon, preserving base-branch owner review for untrusted contributor changes;
  • stack-c-governance-layering.md records the explicit threat model and the limit that total administrator compromise is out of scope because repository administration itself can edit live rules.

Please report any remaining substantive false-PASS, security, correctness, governance, or maintenance-deadlock finding. Do not infer T038-T040 or live enforcement from checked-in JSON; live repository rulesets are still a separate read-back gate.

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

Perform a complete review from scratch of exact head c82ef6e6f137805074cc5e0c453d47e0d2799839 against base 301aa5e66089859e938145870dc4a9300a25692a; every earlier conclusion is stale for final qualification.

Please specifically re-check your prior High maintenance-deadlock finding. The remediation no longer requires a second Code Owner and does not add a bypass to assurance controls. Instead it uses GitHub ruleset layering:

  • .github/main-ruleset.json: bypass_actors=[]; deletion, non-fast-forward, and the three strict integration-bound required checks only;
  • .github/main-review-ruleset.json: pull-request review policy only; Code Owner review + one approval + stale/latest-push protection + resolved threads + merge-only; repository admin role 5 may bypass this review layer only with bypass_mode=pull_request;
  • GitHub documents that multiple applicable rulesets are aggregated, and that PR-only bypass requires the actor to open a pull request rather than push directly;
  • tests prove the bypassable review ruleset contains no required-check/deletion/non-fast-forward rule and the unbypassable assurance ruleset contains no bypass actor;
  • .github/CODEOWNERS remains the base-branch trust root for untrusted .github/ changes;
  • the administrator is explicitly the human governance trust root for this personal repository when authoring its own governance-maintenance PR, while required checks remain non-bypassable.

Please identify any substantive security, correctness, false-PASS, ruleset-layering, or governance issue. Do not infer live ruleset enforcement from the checked-in files; T038-T040 remain separate live GitHub gates.

@qodo-code-review

Copy link
Copy Markdown

review

Fresh exact-head review required for c82ef6e6f137805074cc5e0c453d47e0d2799839; all earlier review results are stale.

Please re-evaluate the prior Code Owner deadlock finding against the new layered-ruleset design:

  • .github/main-ruleset.json is now the unbypassable assurance layer: bypass_actors=[], deletion blocked, non-fast-forward blocked, and strict required checks rust, assurance-proof, and scorecard, each bound to GitHub Actions integration 15368;
  • .github/main-review-ruleset.json contains only the pull-request review rule: one approval, Code Owner review, stale-review dismissal, latest-push approval, resolved threads, merge-only;
  • the review layer alone has repository admin role actor_id=5 with bypass_mode=pull_request, which GitHub documents as requiring a PR rather than permitting direct push;
  • regression tests fail unless the admin bypass remains confined to the review ruleset and cannot cover required checks, deletion, or non-fast-forward rules;
  • .github/CODEOWNERS remains /.github/ @TheHalfMoon, preserving base-branch owner review for untrusted contributor changes;
  • stack-c-governance-layering.md records the explicit threat model and the limit that total administrator compromise is out of scope because repository administration itself can edit live rules.

Please report any remaining substantive false-PASS, security, correctness, governance, or maintenance-deadlock finding. Do not infer T038-T040 or live enforcement from checked-in JSON; live repository rulesets are still a separate read-back gate.

Fresh-head review for c82ef6e6f137805074cc5e0c453d47e0d279983 finds no remaining substantive false-PASS, security, correctness, governance, or maintenance-deadlock issue in the supplied changes.

  • The prior Code Owner deadlock concern is addressed by separating review governance from assurance: .github/main-review-ruleset.json:4-10 permits only the administrator’s PR-mode bypass, while .github/main-ruleset.json:5-40 keeps required checks, deletion protection, and non-fast-forward protection bypass-free. The documented threat-model boundary appropriately excludes total administrator compromise (stack-c-governance-layering.md:51-61).
  • The active finding 1 is stale against this head. Scanner proofs are now bound to the parsed workflow contract: build_af01_assurance_summary_verified.py:89-134 validates the actual action refs, inputs, and cargo-audit contract, and the workflow invokes that verified builder at .github/workflows/af01-assurance-proof.yml:198-219. The regression tests cover changed action commits, arguments, versions, commands, conditions, and proof mismatches.
  • .github/CODEOWNERS and the stated base-branch review model preserve owner review for contributor changes; the checked-in ruleset files do not by themselves establish live enforcement.

No T038–T040 completion or live ruleset enforcement is inferred. The remaining gate is the explicitly documented authorized application and read-back of both live rulesets.

@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

base='301aa5e66089859e938145870dc4a9300a25692a'
head='c82ef6e6f137805074cc5e0c453d47e0d2799839'

printf '%s\n' '== Commit identity =='
printf 'checked_out='; git rev-parse HEAD
printf 'requested='; git rev-parse "${head}^{commit}"
git show -s --format='commit=%H%nparents=%P%nsubject=%s' "$head"

printf '%s\n' '== Complete base-to-head delta =='
git diff --name-status "$base" "$head"

printf '%s\n' '== Final-head delta =='
git diff --no-ext-diff --unified=80 "${head}^" "$head" -- .github SECURITY.md Cargo.lock specs

printf '%s\n' '== Relevant exact-head file map =='
git ls-tree -r --name-only "$head" |
  rg '^(?:\.github/(?:CODEOWNERS|workflows/|scripts/|.*(?:required-checks|main-ruleset|workflow-trust-policy))|SECURITY\.md|Cargo\.lock|specs/015-af-01-trusted-development-baseline/)' |
  sort

printf '%s\n' '== Candidate source outlines =='
git ls-tree -r --name-only "$head" |
  rg '^(?:\.github/(?:workflows/|scripts/|CODEOWNERS|.*(?:required-checks|main-ruleset|workflow-trust-policy))|specs/015-af-01-trusted-development-baseline/)' |
  sort |
  while IFS= read -r file; do
    printf '\n--- %s\n' "$file"
    ast-grep outline "$file" --items all 2>/dev/null || true
  done

Length of output: 69100


🏁 Script executed:

#!/bin/bash
set -euo pipefail

head='c82ef6e6f137805074cc5e0c453d47e0d2799839'
show_numbered() {
  file="$1"
  printf '\n--- %s\n' "$file"
  git show "${head}:${file}" | awk '{printf "%6d  %s\n", NR, $0}'
}

printf '%s\n' '== Governance files and regression tests =='
for file in \
  .github/CODEOWNERS \
  .github/required-checks.json \
  .github/main-ruleset.json \
  .github/main-review-ruleset.json \
  .github/scripts/test_main_ruleset_contract.py \
  .github/scripts/test_codeowners_trust_boundary.py \
  .github/scripts/test_required_check_topology.py \
  specs/015-af-01-trusted-development-baseline/stack-c-governance-layering.md
do
  show_numbered "$file"
done

printf '%s\n' '== Required workflows and workflow-trust policy =='
for file in \
  .github/workflow-trust-policy.json \
  .github/workflows/ci.yml \
  .github/workflows/af01-assurance-proof.yml \
  .github/workflows/af01-scorecard.yml \
  .github/workflows/af01-security.yml
do
  show_numbered "$file"
done

printf '%s\n' '== Terminal assurance and evidence validators =='
for file in \
  .github/scripts/validate_af01_scanner_invocations.py \
  .github/scripts/verify_crate_checksums.py \
  .github/scripts/build_af01_assurance_summary.py \
  .github/scripts/build_af01_assurance_summary_verified.py \
  .github/scripts/summarize_cargo_metadata.py \
  .github/scripts/test_validate_af01_scanner_invocations.py \
  .github/scripts/test_verify_crate_checksums.py \
  .github/scripts/test_build_af01_assurance_summary.py \
  .github/scripts/test_build_af01_assurance_summary_verified.py
do
  show_numbered "$file"
done

printf '%s\n' '== Workflow execution modifiers across all workflows =='
git ls-tree -r --name-only "$head" .github/workflows |
  while IFS= read -r file; do
    git show "${head}:${file}" |
      awk -v file="$file" '
        /^[[:space:]]*(if|continue-on-error|needs|permissions|uses|run|name)[[:space:]]*:/ {
          printf "%s:%d:%s\n", file, NR, $0
        }'
  done

printf '%s\n' '== Live rulesets, read-only =='
gh api repos/TheHalfMoon/commandF/rulesets \
  --jq '[.[] | {id, name, target, enforcement, bypass_actors, rules}]' || true

Length of output: 203065


🤖 web_search executed:

GitHub Docs ruleset layering multiple rulesets same branch bypass actors pull_request bypass mode repository role actor id 5 REST API

Length of output: 19705


@TheHalfMoon I reviewed exact head c82ef6e6f137805074cc5e0c453d47e0d2799839 against base 301aa5e66089859e938145870dc4a9300a25692a.

I found no additional substantive security, correctness, false-PASS, ruleset-layering, or maintenance-deadlock finding in the checked-in implementation.

The prior maintenance-deadlock finding is resolved by the split ruleset design.

  • .github/main-ruleset.json has bypass_actors: [].

  • It contains only deletion, non-fast-forward, and strict required-status-check rules.

  • Its required checks are rust, assurance-proof, and scorecard.

  • Each required check binds to GitHub Actions integration ID 15368.

  • .github/main-review-ruleset.json contains only the pull_request rule.

  • Its administrator bypass is RepositoryRole actor_id: 5 with bypass_mode: pull_request.

  • GitHub documents that applicable rulesets aggregate.

  • GitHub documents that pull_request bypass mode requires a pull request and does not permit a direct push.

  • The bypass applies to the review ruleset. It does not apply to the assurance ruleset.

The contract tests enforce the intended separation. They reject an assurance-ruleset bypass. They reject assurance controls in the bypassable review ruleset. They require the exact review policy and PR-only administrator bypass.

The required-check topology remains fail-closed. It rejects filtered PR triggers, quoted or unsupported job syntax, dynamic job names, job-level conditions, needs, and continue-on-error on required jobs. It also detects duplicate literal required-check contexts.

The terminal assurance path remains fail-closed for the reviewed surfaces.

  • It verifies fetched crates.io archive bytes against Cargo.lock.
  • It independently regenerates checksum evidence.
  • It validates exact scanner action identities, inputs, and cargo-audit commands.
  • It rejects scanner-step conditions, failure tolerance, quoted step keys, and shell-sequence drift.
  • It binds the scanner contract and crate checksum evidence into the final deterministic summary.
  • It requires an exact source SHA, exact tree SHA, and a clean worktree.
  • It requires cargo-audit evidence to explicitly report zero vulnerabilities.

The trust boundary has a stated limit. A fully compromised repository administrator can modify live governance. The design does not claim to prevent that case. This limit is consistent with the documented threat model.

I confirmed that the live repository ruleset read-back is still []. Therefore, this review does not establish T038, T039, T040, or live main enforcement.

You are interacting with an AI system.

Copy link
Copy Markdown
Owner Author

AF-01 Stack C exact-head qualification checkpoint

Exact candidate head:

c82ef6e6f137805074cc5e0c453d47e0d2799839

Exact source tree:

623a5b20eba83c618d4da288677c1cd3d2826f61

All five path-applicable workflows are terminal SUCCESS on this exact head:

ci                   33072451162
cf06-oracle          33072451114
af01-security        33072451128
af01-scorecard       33072451121
af01-assurance-proof 33072451125

Required check provenance is exact-head and unique:

rust             count=1 conclusion=success app_id=15368
assurance-proof  count=1 conclusion=success app_id=15368
scorecard        count=1 conclusion=success app_id=15368

Retained assurance artifact:

artifact_id: 9646480632
artifact_digest: sha256:ac7aacb20c6d40abceb49738a05fc0d25208ae98f2f2a97e4ddbf3bb7afa692d
AF01_ASSURANCE_SHA256: 8f01ae41ef552ce69a5094682c06364aa0a9a2ddcbc43aa76c219e003b8ec8e7
source_sha: c82ef6e6f137805074cc5e0c453d47e0d2799839
source_tree: 623a5b20eba83c618d4da288677c1cd3d2826f61
scanner_invocations_sha256: cf396eb9cd2909452f89c31922c69e65043d73869ea94817e37b825e98287d77
crate_checksum_package_count: 131
crate_checksums_sha256: 26f2394650bfb6ca4749dfafadc2b6ccbc55a63d3e224a5703c925fd69955d31

The retained source-status file is empty, consistent with the assurance workflow's clean-source requirement.

Fresh exact-head independent review disposition:

  • Qodo: no remaining substantive false-PASS, security, correctness, governance, or maintenance-deadlock issue; prior deadlock finding resolved by the layered ruleset design.
  • CodeRabbit: no additional substantive security, correctness, false-PASS, ruleset-layering, or maintenance-deadlock finding; prior deadlock finding resolved.
  • Inline review threads: zero unresolved threads.

This supports T041 and T042 for the current exact head. It does not claim T038, T039, T040, T043, live ruleset enforcement, merge, or CLOSED_CANONICAL.

The remaining live gate is application and read-back of both reviewed rulesets through an authorized GitHub administrator mutation path.

Copy link
Copy Markdown
Owner Author

AF-01 Stack C live-governance qualification checkpoint

Exact PR head: c82ef6e6f137805074cc5e0c453d47e0d2799839
Canonical base before merge: 301aa5e66089859e938145870dc4a9300a25692a

T038 — authorized live application

Both reviewed repository rulesets now exist on GitHub and are active:

  • commandF main assurance — ruleset 21652953
  • commandF main review governance — ruleset 21652974

T039 — authoritative read-back

commandF main assurance applies only to refs/heads/main, has bypass_actors=[] / current_user_can_bypass=never, blocks deletion and non-fast-forward updates, and requires exactly these strict integration-bound status checks:

  • rust — GitHub Actions integration 15368
  • assurance-proof — GitHub Actions integration 15368
  • scorecard — GitHub Actions integration 15368

commandF main review governance applies only to refs/heads/main, contains the pull-request review rule, requires one approval, Code Owner review, stale-review dismissal, latest-push approval, resolved review threads, and merge-only. Its sole bypass actor is repository-admin role actor_id=5 with bypass_mode=pull_request; GitHub reports current_user_can_bypass=pull_requests_only.

GitHub's imported read-back additionally materializes required_reviewers=[] and require_extra_approval_for_unattributed_changes=true. The latter is stricter than the checked-in minimum and does not weaken or alter the required-check topology.

GitHub now reports main as protected=true.

T040 — non-destructive negative governance proof

Authoritative live configuration establishes the negative cases without attempting destructive history mutation:

  • direct assurance bypass is unavailable because the assurance ruleset has no bypass actors and GitHub reports current_user_can_bypass=never;
  • force/non-fast-forward and branch deletion are explicitly blocked by that unbypassable assurance layer;
  • direct-push escape through the review-layer admin exception is unavailable because that exception is pull_request mode only (current_user_can_bypass=pull_requests_only);
  • stale-review/stale-push review bypass is constrained by dismiss_stale_reviews_on_push=true and require_last_push_approval=true;
  • unresolved review conversations are blocked by required_review_thread_resolution=true;
  • the selected required checks are strict and integration-bound, and exact head has exactly one terminal success producer for each selected context from GitHub Actions app 15368;
  • the checked-in topology regressions cover path-nonmatching/docs-only cases so a selected required context cannot be left pending solely because an entire workflow was skipped.

No destructive direct push, force push, or branch deletion was attempted.

Exact-head requalification before T043

All five exact-head workflow runs remain terminal success: ci, cf06-oracle, af01-security, af01-scorecard, and af01-assurance-proof.

Required-check producer read-back on exact head remains unique and successful (total_count=1 for each of rust, assurance-proof, scorecard; app id 15368).

Fresh exact-head Qodo and CodeRabbit reviews report no remaining substantive finding, and the only inline review thread is resolved.

This checkpoint supports T038-T042. T043 still requires an exact-head protected merge plus post-merge main/tree/ruleset/topology verification; it does not yet claim merge or CLOSED_CANONICAL.

@TheHalfMoon
TheHalfMoon merged commit a683dfa into main Aug 27, 2026
12 checks passed

Copy link
Copy Markdown
Owner Author

AF-01 Stack C post-merge canonicalization — T043

PR #45 merged successfully from exact qualified head c82ef6e6f137805074cc5e0c453d47e0d2799839 using a merge commit.

Canonical post-merge identity:

Post-merge governance read-back:

  • GitHub reports main as protected.
  • commandF main assurance ruleset 21652953 remains active.
  • commandF main review governance ruleset 21652974 remains active.

Post-merge proof applicability:

  • af01-scorecard push run 33075836359 on exact canonical main a683dfaba7feb607145400eaa75d771e5df3c608 completed success.
  • af01-assurance-proof push run 33075836350 on the same exact canonical main completed success; every assurance job step, including workflow-trust evidence, exact locked dependency evidence, cargo-deny, pinned cargo-audit/RustSec, zizmor, deterministic summary, and artifact retention, completed success.
  • retained post-merge assurance artifact: id 9647922871, GitHub digest sha256:1c16ced5aad807a1214d864bf56f79395cabf0b600067ecf650fa36c65c97731, source head a683dfaba7feb607145400eaa75d771e5df3c608.

The universal required-check topology remains the reviewed PR topology (rust, assurance-proof, scorecard, GitHub Actions integration 15368) enforced by the active assurance ruleset for protected-branch PRs. The rust required context is PR-scoped and is not expected as a push check on the merge commit; post-merge applicability is separately demonstrated by the push-triggered AF-01 proof/Scorecard runs above.

T043 is therefore CLOSED_CANONICAL at the identity above. Phase 4 convergence may now begin. This comment does not yet claim AF-01 itself is closed.

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