ci(af01): establish workflow trust baseline - #43
Conversation
|
ⓘ Your Qodo trial ends soon. Ask your workspace admin to set up billing to keep reviews running after the trial. Manage billing |
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
|
@qodo review Please review exact current head |
|
@coderabbitai review Please perform a fresh review of exact current head |
PR Summary by QodoEstablish machine-checkable GitHub Actions trust baseline
AI Description
Diagram
High-Level Assessment
Files changed (7)
|
🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '== HEAD =='
git rev-parse HEAD
printf '%s\n' '== STATUS =='
git status --short
printf '%s\n' '== MERGE BASE =='
git merge-base HEAD main || true
printf '%s\n' '== CHANGED FILES VS MAIN =='
git diff --name-status "$(git merge-base HEAD main)" HEAD
printf '%s\n' '== AF-01 CANDIDATE FILES =='
fd -HI -t f . .github | sort
printf '%s\n' '== PYTHON OUTLINE =='
ast-grep outline .github/scripts/audit_workflow_trust.py --items all 2>/dev/null || true
printf '%s\n' '== TEST OUTLINES =='
fd -HI -t f -e py .github | while IFS= read -r f; do
case "$f" in
*test*|*Test*) printf '%s\n' "--- $f"; ast-grep outline "$f" --items all 2>/dev/null || true ;;
esac
done
printf '%s\n' '== WORKFLOW DIFF STAT =='
git diff --stat "$(git merge-base HEAD main)" HEAD -- .githubLength of output: 4380 🏁 Script executed: #!/bin/bash
set -euo pipefail
base="$(git merge-base HEAD main)"
printf '%s\n' '== AUDIT IMPLEMENTATION: 1-230 =='
sed -n '1,230p' .github/scripts/audit_workflow_trust.py
printf '%s\n' '== AUDIT IMPLEMENTATION: 230-430 =='
sed -n '230,430p' .github/scripts/audit_workflow_trust.py
printf '%s\n' '== POLICY =='
cat .github/workflow-trust-policy.json
printf '%s\n' '== TEST FILE =='
cat .github/scripts/test_audit_workflow_trust.py
printf '%s\n' '== INVENTORY =='
cat specs/015-af-01-trusted-development-baseline/stack-a-inventory.md
printf '%s\n' '== WORKFLOW DIFFS =='
git diff --find-renames --find-copies "$base" HEAD -- \
.github/workflows/cf06-oracle.yml \
.github/workflows/ci.yml \
.github/workflows/registry-download-smoke.yml
printf '%s\n' '== CURRENT WORKFLOWS =='
for f in .github/workflows/*.yml .github/workflows/*.yaml; do
[ -f "$f" ] || continue
printf '\n--- %s ---\n' "$f"
cat "$f"
doneLength of output: 82811 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '== AUDIT LINE NUMBERS: USES, CARGO, YAML ERROR HANDLING =='
nl -ba .github/scripts/audit_workflow_trust.py | sed -n '145,185p;230,335p'
printf '%s\n' '== TEST LINE NUMBERS =='
nl -ba .github/scripts/test_audit_workflow_trust.py | sed -n '100,245p'
printf '%s\n' '== ROOT ACTION METADATA =='
if [ -f action.yml ]; then
nl -ba action.yml
fi
if [ -f action.yaml ]; then
nl -ba action.yaml
fi
printf '%s\n' '== YAML SPECIAL-FORM SEARCH =='
rg -n --glob '*.yml' --glob '*.yaml' \
'^\s*(["'\''](?:uses|runs-on|timeout-minutes|permissions|image)["'\'']|<<:|[^#]*&[A-Za-z0-9_-]+|[^#]*\*[A-Za-z0-9_-]+)' \
.github action.yml action.yaml 2>/dev/null || true
printf '%s\n' '== CARGO LINE-CONTINUATION/GLOBAL-OPTION SEARCH =='
rg -n -U --glob '*.yml' --glob '*.yaml' \
'cargo\s*(\\\s*\n|(?:--[A-Za-z0-9-]+(?:[ =][^[:space:]]+)?\s+|\+[A-Za-z0-9_.-]+\s+))' \
.github action.yml action.yaml 2>/dev/null || true
printf '%s\n' '== DIFF WHITESPACE =='
git diff --check "$(git merge-base HEAD main)" HEAD
printf '%s\n' '== ALL CHANGES OUTSIDE AF-01 =='
git diff --name-only "$(git merge-base HEAD main)" HEAD -- . ':(exclude).github' ':(exclude)specs/015-af-01-trusted-development-baseline'Length of output: 1634 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '== AUDIT LINE NUMBERS: USES, CARGO, YAML ERROR HANDLING =='
cat -n .github/scripts/audit_workflow_trust.py | sed -n '145,185p;230,335p'
printf '%s\n' '== TEST LINE NUMBERS =='
cat -n .github/scripts/test_audit_workflow_trust.py | sed -n '100,245p'
printf '%s\n' '== ROOT ACTION METADATA =='
if [ -f action.yml ]; then
cat -n action.yml
fi
if [ -f action.yaml ]; then
cat -n action.yaml
fi
printf '%s\n' '== YAML SPECIAL-FORM SEARCH =='
rg -n --glob '*.yml' --glob '*.yaml' \
'^\s*(["'\''](?:uses|runs-on|timeout-minutes|permissions|image)["'\'']|<<:|[^#]*&[A-Za-z0-9_-]+|[^#]*\*[A-Za-z0-9_-]+)' \
.github action.yml action.yaml 2>/dev/null || true
printf '%s\n' '== CARGO LINE-CONTINUATION/GLOBAL-OPTION SEARCH =='
rg -n -U --glob '*.yml' --glob '*.yaml' \
'cargo\s*(\\\s*\n|(?:--[A-Za-z0-9-]+(?:[ =][^[:space:]]+)?\s+|\+[A-Za-z0-9_.-]+\s+))' \
.github action.yml action.yaml 2>/dev/null || true
printf '%s\n' '== DIFF WHITESPACE =='
git diff --check "$(git merge-base HEAD main)" HEAD
printf '%s\n' '== ALL CHANGES OUTSIDE AF-01 =='
git diff --name-only "$(git merge-base HEAD main)" HEAD -- . ':(exclude).github' ':(exclude)specs/015-af-01-trusted-development-baseline'Length of output: 21294
I found two substantive AF-01 Stack A findings.
The workflow diff preserves the existing CF-06 commands and registry smoke commands. The CI changes add the audit gates before Rust gates. The aggregation-only I verified that the requested commit and canonical merge base match. I also verified that no changed paths exist outside
|
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: Warning Your free Security trial is over. An organization admin can activate billing to continue. 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. Comment |
I reviewed the supplied Findings
Areas that look correct
Counterexample coverageThe tests cover the main happy path and several direct mutations, but they do not cover malformed policy shapes, unknown permission keys, multiple checkout steps, ambiguous/chained Cargo commands, quoted/commented Cargo text, or whether timeout equality versus maximum semantics is intended. These should be added before treating the audit as a complete fail-closed control. |
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
|
@qodo review Fresh exact-head review required after self-review hardening. Review current head |
|
@coderabbitai review Fresh exact-head review required after self-review hardening. Review current head |
Code Review by Qodo
1.
|
Review findingsThe requested invariants are enforced for the currently tracked workflows: all runners and timeouts are explicit, checkout steps use However, I would not mark this fully passing yet:
The narrowed container discovery itself correctly limits checks to job |
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
|
@qodo review Final fresh review request for current exact head |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
expected='0be4766d3f2631f1dba24f03706da8ffe81f3279'
actual="$(git rev-parse HEAD)"
printf 'HEAD=%s\nEXPECTED=%s\n' "$actual" "$expected"
if [ "$actual" != "$expected" ]; then
printf 'ERROR: checkout is not the requested exact head\n' >&2
exit 2
fi
base="$(git merge-base HEAD main)"
printf 'MERGE_BASE=%s\n' "$base"
printf '\n== changed files ==\n'
git diff --name-status "$base" HEAD
printf '\n== changed AF-01 stat ==\n'
git diff --stat "$base" HEAD -- .github specs/015-af-01-trusted-development-baseline
printf '\n== audit outline ==\n'
ast-grep outline .github/scripts/audit_workflow_trust.py --items all 2>/dev/null || true
printf '\n== test outline ==\n'
ast-grep outline .github/scripts/test_audit_workflow_trust.py --items all 2>/dev/null || true
printf '\n== implementation ==\n'
cat -n .github/scripts/audit_workflow_trust.py
printf '\n== tests ==\n'
cat -n .github/scripts/test_audit_workflow_trust.py
printf '\n== policy ==\n'
cat -n .github/workflow-trust-policy.json
printf '\n== workflow diffs ==\n'
git diff --find-renames "$base" HEAD -- .github/workflows
printf '\n== current workflow/action metadata files ==\n'
fd -HI -t f -e yml -e yaml .github action.yml action.yaml 2>/dev/null | sort | while IFS= read -r f; do
printf '\n--- %s ---\n' "$f"
cat -n "$f"
done
printf '\n== static source checks ==\n'
python3 -m py_compile .github/scripts/audit_workflow_trust.py .github/scripts/test_audit_workflow_trust.py
python3 -m json.tool .github/workflow-trust-policy.json >/dev/null
git diff --check "$base" HEAD
printf 'STATIC_CHECKS=OK\n'Length of output: 48470 🏁 Script executed: #!/bin/bash
set -euo pipefail
previous='e844f5b306cbf201cc31fa893539d2ed0875486c'
current='0be4766d3f2631f1dba24f03706da8ffe81f3279'
printf '%s\n' '== incremental diff from prior reviewed head =='
git diff --find-renames "$previous" "$current" -- \
.github/scripts/audit_workflow_trust.py \
.github/scripts/test_audit_workflow_trust.py \
.github/workflow-trust-policy.json \
.github/workflows \
specs/015-af-01-trusted-development-baseline/stack-a-inventory.md
printf '%s\n' '== tracked security files =='
git ls-files -z | python3 -c '
import sys
from pathlib import PurePosixPath
for path in sorted(p for p in sys.stdin.buffer.read().decode().split("\0") if p):
name = PurePosixPath(path).name
if (path.startswith(".github/workflows/") and name.endswith((".yml", ".yaml"))) or name in {"action.yml", "action.yaml"}:
print(path)
'
printf '%s\n' '== full current workflow source =='
while IFS= read -r f; do
printf '\n--- %s ---\n' "$f"
cat -n "$f"
done < <(git ls-files | awk '($0 ~ /^\.github\/workflows\/.*\.(yml|yaml)$/) || ($0 ~ /(^|\/)action\.ya?ml$/)')
printf '%s\n' '== parser-relevant implementation and test locations =='
rg -n -C 4 \
'USES_RE|STEP_USES_RE|CARGO_RE|def _container_images|def _job_ranges|def _parse_permissions|def _policy_errors|quoted|continuation|toolchain|container|persist-credentials' \
.github/scripts/audit_workflow_trust.py .github/scripts/test_audit_workflow_trust.py
printf '%s\n' '== static checks =='
python3 -m py_compile .github/scripts/audit_workflow_trust.py .github/scripts/test_audit_workflow_trust.py
python3 -m json.tool .github/workflow-trust-policy.json >/dev/null
git diff --check "$(git merge-base HEAD main)" HEAD
printf '%s\n' 'STATIC_CHECKS=OK'Length of output: 20520
I found three substantive AF-01 findings.
The incremental hardening correctly moves normal checkout credential checks into shared workflow and Action metadata handling. It also narrows the container scan to job and service containers. These changes do not resolve the parser bypasses above. I verified the requested exact head and canonical merge base. I did not execute repository code or tests. The read-only inspection commands terminated before their final static-check section, so compilation and full file enumeration remain unverified. You are interacting with an AI system. |
|
@coderabbitai review Final fresh review request for current exact head |
Fresh review of
Verified requested regressions:
Finding 5 is already implemented in the current control flow: |
🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
expected='95a2b4829c7b1a832b1460a4a97aada107e23877'
actual="$(git rev-parse HEAD)"
printf 'HEAD=%s\nEXPECTED=%s\n' "$actual" "$expected"
if [ "$actual" != "$expected" ]; then
printf '%s\n' 'ERROR: checkout is not the requested exact head' >&2
exit 2
fi
base="$(git merge-base HEAD main)"
printf 'MERGE_BASE=%s\n' "$base"
printf '\n== changed files ==\n'
git diff --name-status "$base" HEAD
printf '\n== incremental changes from prior head ==\n'
git diff --find-renames 0be4766d3f2631f1dba24f03706da8ffe81f3279 HEAD -- \
.github/scripts/audit_workflow_trust.py \
.github/scripts/test_audit_workflow_trust.py \
.github/workflow-trust-policy.json \
.github/workflows \
specs/015-af-01-trusted-development-baseline/stack-a-inventory.md
printf '\n== audit outline ==\n'
ast-grep outline .github/scripts/audit_workflow_trust.py --items all 2>/dev/null || true
printf '\n== audit implementation ==\n'
cat -n .github/scripts/audit_workflow_trust.py
printf '\n== audit tests ==\n'
cat -n .github/scripts/test_audit_workflow_trust.py
printf '\n== policy ==\n'
cat -n .github/workflow-trust-policy.json
printf '\n== inventory ==\n'
cat -n specs/015-af-01-trusted-development-baseline/stack-a-inventory.md
printf '\n== workflow diffs ==\n'
git diff --find-renames "$base" HEAD -- .github/workflows
printf '\n== tracked workflow and Action metadata ==\n'
while IFS= read -r f; do
printf '\n--- %s ---\n' "$f"
cat -n "$f"
done < <(git ls-files | awk '($0 ~ /^\.github\/workflows\/.*\.(yml|yaml)$/) || ($0 ~ /(^|\/)action\.ya?ml$/)')
printf '\n== parser and policy focus locations ==\n'
rg -n -C 5 \
'USES|uses|CARGO|cargo|persist-credentials|container|service|image|policy|permissions|runs-on|timeout|exception|yaml|YAML' \
.github/scripts/audit_workflow_trust.py \
.github/scripts/test_audit_workflow_trust.py \
.github/workflow-trust-policy.json
printf '\n== whitespace errors ==\n'
git diff --check "$base" HEADLength of output: 57473 🏁 Script executed: #!/bin/bash
set -euo pipefail
expected='95a2b4829c7b1a832b1460a4a97aada107e23877'
test "$(git rev-parse HEAD)" = "$expected"
base="$(git merge-base HEAD main)"
printf '%s\n' '== tracked workflow and Action metadata paths =='
git ls-files | awk '($0 ~ /^\.github\/workflows\/.*\.(yml|yaml)$/) || ($0 ~ /(^|\/)action\.ya?ml$/)' | sort
printf '%s\n' '== current workflow and Action metadata source =='
git ls-files | awk '($0 ~ /^\.github\/workflows\/.*\.(yml|yaml)$/) || ($0 ~ /(^|\/)action\.ya?ml$/)' | sort | while IFS= read -r f; do
printf '\n--- %s ---\n' "$f"
cat -n "$f"
done
printf '%s\n' '== full changes outside AF-01 configuration and inventory =='
git diff --name-only "$base" HEAD -- . ':(exclude).github' ':(exclude)specs/015-af-01-trusted-development-baseline'
printf '%s\n' '== workflow changes with function-context =='
git diff --unified=12 "$base" HEAD -- .github/workflows
printf '%s\n' '== parser function regions =='
sed -n '15,240p;270,475p' .github/scripts/audit_workflow_trust.py | cat -n
printf '%s\n' '== test cases that cover parser exceptions and policies =='
sed -n '120,310p' .github/scripts/test_audit_workflow_trust.py | cat -n
printf '%s\n' '== changed file end-of-line checks =='
git diff --check "$base" HEADLength of output: 91075
I found three material AF-01 Stack A findings.
The new Action metadata checkout tests and the non-container I verified the workflow changes preserve the existing CF-06 oracle commands, CI product smoke commands, and registry smoke commands. The changes only add the AF-01 audit gates, pin runners and Actions, add timeouts, disable checkout credential persistence, and reduce the aggregation-only I confirmed the requested exact head and canonical merge base. I did not execute repository code or tests because the review sandbox prohibits executing repository files. I do not approve this head while these fail-open paths remain.
|
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
|
@qodo review Fresh exact-head AF-01 Stack A review for Exact-head qualification is terminal green:
Please review the full current diff and re-check all prior remediations. Latest fixes close both prior findings:
Also re-check PATH/builtin writers/nameref, command-resolution mutation, wrapper heredocs, direct/path-like execution, exact Report any remaining substantive finding; no PASS is inferred. |
|
@coderabbitai review Fresh exact-head AF-01 Stack A review for Exact-head gates are terminal green: Please review the full current diff. Re-check your prior P1: the cross-step environment-channel auditor is now invoked as an independent CI step before Rust gates, in addition to its unit/counterexample suite. Re-check the adjacent Qodo remediation: exact Also re-check all earlier authority classes: PATH assignments/builtin writers/nameref, hash/alias/enable resolution mutation, wrapper heredocs, direct/path-like execution, exact Report any remaining material issue; no PASS is assumed. |
I found no remaining substantive findings in the current diff. Re-checked the trust-audit policy and implementation, including:
The prior remediations represented by findings 1–7 appear incorporated; no new actionable finding is warranted from this head. |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
expected='0fc0607dc5b3057f59e26c3c583a28747a20c036'
actual="$(git rev-parse HEAD)"
printf 'HEAD=%s\nEXPECTED=%s\n' "$actual" "$expected"
test "$actual" = "$expected"
base="$(git merge-base HEAD main)"
printf 'MERGE_BASE=%s\n' "$base"
printf '\n== CHANGED FILES ==\n'
git diff --name-status "$base" HEAD
printf '\n== LATEST DIFF ==\n'
git diff --find-renames --unified=18 \
99a7ab666fdde94766505039b4c9933c4fb5089b HEAD -- \
.github/scripts .github/workflows .github/workflow-trust-policy.json \
action.yml action.yaml scripts
printf '\n== OUTLINES ==\n'
for f 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.py \
.github/scripts/test_audit_workflow_trust_surface.py \
.github/scripts/test_audit_workflow_trust_environment_channels.py \
.github/scripts/test_audit_workflow_trust_syntax.py
do
if [ -f "$f" ]; then
printf '\n--- %s ---\n' "$f"
ast-grep outline "$f" --items all 2>/dev/null || true
fi
done
printf '\n== CI AND POLICY ==\n'
cat -n .github/workflows/ci.yml
cat -n .github/workflow-trust-policy.json
printf '\n== ENVIRONMENT-CHANNEL AUDITOR AND TESTS ==\n'
cat -n .github/scripts/audit_workflow_trust_environment_channels.py
cat -n .github/scripts/test_audit_workflow_trust_environment_channels.py
printf '\n== SURFACE AUTHORITY REGIONS ==\n'
sed -n '1,180p;180,430p;430,720p' \
.github/scripts/audit_workflow_trust_surface.py | cat -n
printf '\n== CORE AUTHORITY REGIONS ==\n'
sed -n '1,250p;430,760p;760,1200p' \
.github/scripts/audit_workflow_trust.py | cat -n
printf '\n== ENVIRONMENT / SHELL / ACTION SOURCES ==\n'
git ls-files | awk \
'($0 ~ /^\.github\/workflows\/.*\.(yml|yaml)$/) || ($0 ~ /(^|\/)action\.ya?ml$/) || ($0 ~ /\.sh$/)' |
sort |
while IFS= read -r f; do
printf '\n--- %s ---\n' "$f"
cat -n "$f"
done
printf '\n== ENVIRONMENT-CHANNEL AND EXECUTION-AUTHORITY REGRESSIONS ==\n'
rg -n -A45 -B5 \
'^ def test_.*(github|environment|channel|path|hash|alias|enable|heredoc|wrapper|deleg|source|dot|direct|cargo|variable|cycle|bash_env)' \
.github/scripts/test_audit_workflow_trust*.py
printf '\n== ALL TRACKED CHANNEL REFERENCES ==\n'
git grep -n -E '\$\{?GITHUB_(PATH|ENV|OUTPUT)\}?|GITHUB_(PATH|ENV|OUTPUT)|BASH_ENV|ENV=' -- \
':!target' || true
printf '\n== WORKFLOW/ACTION DIFF AND STATIC VALIDATION ==\n'
git diff --find-renames --unified=16 "$base" HEAD -- \
.github/workflows action.yml action.yaml scripts
git diff --check "$base" HEADLength of output: 181395 🏁 Script executed: #!/bin/bash
set -euo pipefail
expected='0fc0607dc5b3057f59e26c3c583a28747a20c036'
test "$(git rev-parse HEAD)" = "$expected"
printf '%s\n' '== ENVIRONMENT-CHANNEL AUDITOR =='
cat -n .github/scripts/audit_workflow_trust_environment_channels.py
printf '%s\n' '== ENVIRONMENT-CHANNEL TESTS =='
cat -n .github/scripts/test_audit_workflow_trust_environment_channels.py
printf '%s\n' '== SURFACE PARSING AND ACTION ENVIRONMENT HANDLING =='
rg -n -A90 -B12 \
'^def (_scripts|_shell_heredoc_findings|_direct_cargo_findings|_action_local_targets|_path_search_mutation_is_unsupported|audit_action_text|audit_repository_surface)|shlex\.split|except ValueError|BASH_ENV|env' \
.github/scripts/audit_workflow_trust_surface.py
printf '%s\n' '== CORE YAML PARSING, DISCOVERY, AND POLICY VALIDATION =='
rg -n -A90 -B12 \
'^def (_tracked_files|_load_yaml|_all_uses|_run_scripts|audit_action_metadata|audit_workflow|audit_repository|load_policy|_validate)|yaml|safe_load|action\.ya?ml|persist-credentials|container|permissions' \
.github/scripts/audit_workflow_trust.py
printf '%s\n' '== YAML PARSER DEPENDENCIES =='
rg -n -C2 'PyYAML|yaml|ruamel' requirements.txt pyproject.toml Cargo.toml .github 2>/dev/null || true
printf '%s\n' '== SOURCE FILE EXECUTABLE AUTHORITY FORMS =='
rg -n -U -C2 \
'(^|[;&|[:space:]])(eval|exec|source|\.|command|builtin|hash|alias|unalias|enable|env|bash|dash|ksh|sh|zsh|read|mapfile|readarray|getopts|printf|declare|typeset|local|readonly|export|unset)[[:space:]]|BASH_ENV|ENV=|PATH=|GITHUB_(PATH|ENV)' \
action.yml scripts .github/workflows --glob '*.sh' --glob '*.yml' --glob '*.yaml' 2>/dev/null || true
printf '%s\n' '== DISCOVERY TESTS =='
rg -n -A38 -B4 \
'def test_.*(discover|tracked|nested|action_yaml|workflow|quoted|flow|checkout|permission|container|timeout|uses|policy|malformed)' \
.github/scripts/test_audit_workflow_trust.py \
.github/scripts/test_audit_workflow_trust_syntax.py
printf '%s\n' '== VERIFY REPORTED RUN HEADS =='
for run in 33041605113 33041605065 33041605078; do
gh run view "$run" --repo TheHalfMoon/commandF \
--json databaseId,headSha,status,conclusion,name 2>/dev/null || true
doneLength of output: 139187
I found one material AF-01 Stack A finding.
The independent cross-step environment-channel gate is present in I confirmed that The current workflow changes preserve the CF-06 commands, registry retry behavior, and CI product smoke commands. I used static inspection only. You are interacting with an AI system. |
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
|
@qodo review Fresh exact-head AF-01 Stack A review for Exact-head qualification is terminal green:
Please review the full current diff and re-check all prior remediations. Latest CodeRabbit P1 is closed conservatively: tracked workflow/Action/shell authority now rejects shell startup-file authority through exact Also re-check GITHUB_PATH/GITHUB_ENV direct/indirect authority, PATH/builtin writers/nameref, command-resolution mutation, wrapper heredocs, direct/path-like execution, exact Report any remaining substantive finding; no PASS is inferred. |
|
@coderabbitai review Fresh exact-head AF-01 Stack A review for Exact-head gates are terminal green: Please review the full current diff. Re-check your prior P1: hidden shell startup-file authority is now fail-closed in the same independent environment-authority gate. Exact Also re-check all earlier classes: GITHUB_PATH/GITHUB_ENV direct/indirect authority, PATH assignments/builtin writers/nameref, hash/alias/enable resolution mutation, wrapper heredocs, direct/path-like execution, exact Report any remaining material issue; no PASS is assumed. |
I found no remaining substantive issues in the current diff. Re-checked the implemented remediations and current repository wiring, including:
The findings index contains no active findings; findings 1–7 are already implemented. |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
expected='7fd664af6a77989dda8b5d79095671b564fb9c2a'
actual="$(git rev-parse HEAD)"
printf 'HEAD=%s\nEXPECTED=%s\n' "$actual" "$expected"
test "$actual" = "$expected"
base="$(git merge-base HEAD main)"
printf 'MERGE_BASE=%s\n' "$base"
printf '\n== CHANGED FILES ==\n'
git diff --name-status "$base" HEAD
printf '\n== OUTLINES ==\n'
for f 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.py \
.github/scripts/test_audit_workflow_trust_surface.py \
.github/scripts/test_audit_workflow_trust_environment_channels.py \
.github/scripts/test_audit_workflow_trust_syntax.py
do
if [ -f "$f" ]; then
printf '\n--- %s ---\n' "$f"
ast-grep outline "$f" --items all 2>/dev/null || true
fi
done
printf '\n== CI AND POLICY ==\n'
cat -n .github/workflows/ci.yml
cat -n .github/workflow-trust-policy.json
printf '\n== ENVIRONMENT/STARTUP AUTHORITY AUDITOR ==\n'
cat -n .github/scripts/audit_workflow_trust_environment_channels.py
printf '\n== ENVIRONMENT/STARTUP AUTHORITY REGRESSIONS ==\n'
cat -n .github/scripts/test_audit_workflow_trust_environment_channels.py
printf '\n== CORE AUDITOR: DISCOVERY, YAML, POLICY, EXECUTION ==\n'
sed -n '1,360p;430,760p;760,1220p' .github/scripts/audit_workflow_trust.py | cat -n
printf '\n== SURFACE AUDITOR: EXECUTION AND DELEGATION ==\n'
cat -n .github/scripts/audit_workflow_trust_surface.py
printf '\n== CURRENT WORKFLOWS, ACTIONS, AND SHELL SOURCES ==\n'
git ls-files | awk \
'($0 ~ /^\.github\/workflows\/.*\.(yml|yaml)$/) || ($0 ~ /(^|\/)action\.ya?ml$/) || ($0 ~ /\.sh$/)' |
sort |
while IFS= read -r f; do
printf '\n--- %s ---\n' "$f"
cat -n "$f"
done
printf '\n== LATEST ENVIRONMENT/STARTUP AUTHORITY DIFF ==\n'
git diff --find-renames --unified=20 \
0fc0607dc5b3057f59e26c3c583a28747a20c036 HEAD -- \
.github/scripts .github/workflows .github/workflow-trust-policy.json \
action.yml action.yaml scripts
printf '\n== AUTHORITY CONSTRUCTION / SHELL FEATURE SEARCH ==\n'
rg -n -U -C3 \
'GITHUB_(PATH|ENV)|BASH_ENV|ZDOTDIR|(^|[^[:alnum:]_])ENV([^[:alnum:]_]|$)|GITHUB_|BASH_|ZDOT|\
\$\{!|\$\{[^}]*\}|\$\(|`|(^|[;&|[:space:]])(?:eval|exec|source|\.|command|builtin|hash|alias|unalias|enable|env|bash|dash|ksh|sh|zsh|read|mapfile|readarray|getopts|printf|declare|typeset|local|readonly|export|unset)[[:space:]]|PATH=' \
.github action.yml action.yaml scripts --glob '*.py' --glob '*.sh' --glob '*.yml' --glob '*.yaml' 2>/dev/null || true
printf '\n== WORKFLOW/ACTION DIFF VS BASE ==\n'
git diff --find-renames --unified=16 "$base" HEAD -- \
.github/workflows action.yml action.yaml scripts
printf '\n== SCOPE AND WHITESPACE ==\n'
git diff --name-only "$base" HEAD -- . \
':(exclude).github' \
':(exclude)action.yml' \
':(exclude)action.yaml' \
':(exclude)scripts' \
':(exclude)specs/015-af-01-trusted-development-baseline'
git diff --check "$base" HEAD
printf '\n== REPORTED RUNS ==\n'
for run in 33042082554 33042082675 33042082530; do
gh run view "$run" --repo TheHalfMoon/commandF \
--json databaseId,headSha,status,conclusion,name,jobs 2>/dev/null || true
doneLength of output: 182607 🏁 Script executed: #!/bin/bash
set -euo pipefail
expected='7fd664af6a77989dda8b5d79095671b564fb9c2a'
test "$(git rev-parse HEAD)" = "$expected"
printf '%s\n' '== ENVIRONMENT AUTHORITY AUDITOR: COMPLETE =='
cat -n .github/scripts/audit_workflow_trust_environment_channels.py
printf '%s\n' '== SURFACE: VARIABLE, WRAPPER, AND SHELL EXECUTION PATHS =='
sed -n '1,180p;185,345p;345,570p;570,720p' \
.github/scripts/audit_workflow_trust_surface.py | cat -n
printf '%s\n' '== CORE: TOKEN RESOLUTION AND CARGO SHELL SEGMENTS =='
sed -n '430,650p' .github/scripts/audit_workflow_trust.py | cat -n
printf '%s\n' '== STARTUP AUTHORITY REGRESSION SEARCH =='
rg -n -A35 -B6 \
'BASH_ENV|ZDOTDIR|(^|[^A-Za-z0-9_])ENV([^A-Za-z0-9_]|$)|BASH_|ZDOT|startup|environment.*fragment|fragment.*environment|export.*\$\{|declare.*\$\{|typeset.*\$\{' \
.github/scripts/test_audit_workflow_trust*.py \
.github/scripts/audit_workflow_trust*.py
printf '%s\n' '== VARIABLE-CONSTRUCTION FORMS IN CURRENT AUTHORITY SOURCES =='
rg -n -U -C3 \
'(export|declare|typeset|readonly|local|env)[[:space:]].*(\$\{[^}]+\}|[A-Za-z_][A-Za-z0-9_]*=)|\
[A-Za-z_][A-Za-z0-9_]*=.*(\$\{[^}]+\}|"\$[A-Za-z_][A-Za-z0-9_]*")|\
(bash|sh|dash|ksh|zsh)[[:space:]]+(-c|--command)' \
action.yml scripts .github/workflows .github/scripts --glob '*.sh' --glob '*.yml' --glob '*.yaml' --glob '*.py' 2>/dev/null || true
printf '%s\n' '== AUDITOR TEST FIXTURE HELPERS =='
sed -n '1,220p' .github/scripts/test_audit_workflow_trust_environment_channels.py | cat -n
sed -n '1,200p' .github/scripts/test_audit_workflow_trust_surface_precision.py | cat -n
printf '%s\n' '== WORKFLOW TRUST POLICY RULES =='
cat -n .github/workflow-trust-policy.jsonLength of output: 131490
I found one material AF-01 Stack A finding.
The independent environment/startup-authority CI gate is present and runs before Rust gates. The reported You are interacting with an AI system. |
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
|
@qodo review Fresh exact-head AF-01 Stack A review for Exact-head qualification is terminal green:
Please review the full current diff. Re-check all prior remediations and especially the latest CodeRabbit P1 closure: shell variable-writing builtins now fail closed on dynamically constructed variable names/targets ( The dynamic-writer parser is now quote-aware: quoted semicolons remain data while real shell separators still expose subsequent dynamic writers. A permanent regression covers the exact existing CF-09 quoted-semicolon path that previously produced a false positive. Also re-check PATH/builtin writers/nameref, command-resolution mutation, wrapper heredocs, direct/path-like execution, exact Report any remaining substantive finding; no PASS is inferred. |
|
@coderabbitai review Fresh exact-head AF-01 Stack A review for Exact-head gates are terminal green: Please re-check your prior P1 and the full current diff. The dynamic startup-variable construction bypass is now closed by a general fail-closed dynamic variable-writer boundary: variable-expanding targets/names are rejected for assignment builtins, The parser used by this boundary is now quote-aware, so a quoted semicolon such as Also re-check all earlier authority classes: direct/indirect GITHUB_PATH/GITHUB_ENV and shell-startup authority, PATH assignments/builtin writers/nameref, hash/alias/enable resolution mutation, wrapper heredocs, direct/path-like execution, exact Report any remaining material issue; no PASS is assumed. |
I found no remaining substantive finding in the current AF-01 Stack A diff.
The prior seven Qodo findings are already marked implemented, and I have no new finding to report from this head. This is a review result, not an independent confirmation of the cited CI run statuses. |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
expected='28d9e39da1bc1bc6059a8b9f9c46327fe47ad99f'
actual="$(git rev-parse HEAD)"
printf 'HEAD=%s\nEXPECTED=%s\n' "$actual" "$expected"
test "$actual" = "$expected"
base="$(git merge-base HEAD main)"
printf 'MERGE_BASE=%s\n' "$base"
printf '\n== CHANGED FILES VS MERGE BASE ==\n'
git diff --name-status "$base" HEAD
printf '\n== AUDITOR AND TEST OUTLINES ==\n'
for f 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.py \
.github/scripts/test_audit_workflow_trust_surface.py \
.github/scripts/test_audit_workflow_trust_surface_precision.py \
.github/scripts/test_audit_workflow_trust_environment_channels.py \
.github/scripts/test_audit_workflow_trust_syntax.py
do
if [ -f "$f" ]; then
printf '\n--- %s ---\n' "$f"
ast-grep outline "$f" --items all 2>/dev/null || true
fi
done
printf '\n== ENVIRONMENT/STARTUP AUTHORITY AUDITOR ==\n'
cat -n .github/scripts/audit_workflow_trust_environment_channels.py
printf '\n== DYNAMIC VARIABLE-WRITER IMPLEMENTATION ==\n'
rg -n -A85 -B15 \
'dynamic|variable.writer|variable.*target|assignment.*builtin|printf|mapfile|readarray|getopts|nameref|BASH_ENV|ZDOTDIR|GITHUB_(PATH|ENV)|env' \
.github/scripts/audit_workflow_trust_environment_channels.py \
.github/scripts/audit_workflow_trust_surface.py \
.github/scripts/audit_workflow_trust.py
printf '\n== ENVIRONMENT AND PRECISION REGRESSIONS ==\n'
rg -n -A55 -B6 \
'^ def test_.*(dynamic|startup|bash_env|zdotdir|github_(path|env)|printf|env|read|mapfile|readarray|getopts|semicolon|precision|live|determin)' \
.github/scripts/test_audit_workflow_trust_environment_channels.py \
.github/scripts/test_audit_workflow_trust_surface.py \
.github/scripts/test_audit_workflow_trust_surface_precision.py \
.github/scripts/test_audit_workflow_trust_syntax.py \
.github/scripts/test_audit_workflow_trust.py
printf '\n== CORE AND SURFACE AUTHORITY IMPLEMENTATION ==\n'
sed -n '1,260p;430,760p;760,1220p' .github/scripts/audit_workflow_trust.py | cat -n
sed -n '1,220p;220,500p;500,760p' .github/scripts/audit_workflow_trust_surface.py | cat -n
printf '\n== CI AND POLICY ==\n'
cat -n .github/workflows/ci.yml
cat -n .github/workflow-trust-policy.json
printf '\n== CURRENT WORKFLOWS, ACTION METADATA, AND SHELL SOURCES ==\n'
git ls-files | awk \
'($0 ~ /^\.github\/workflows\/.*\.(yml|yaml)$/) || ($0 ~ /(^|\/)action\.ya?ml$/) || ($0 ~ /\.sh$/)' |
sort |
while IFS= read -r f; do
printf '\n--- %s ---\n' "$f"
cat -n "$f"
done
printf '\n== FULL WORKFLOW/ACTION/SHELL DIFF ==\n'
git diff --find-renames --unified=18 "$base" HEAD -- \
.github/workflows action.yml action.yaml scripts .github/scripts \
.github/workflow-trust-policy.json \
specs/015-af-01-trusted-development-baseline/stack-a-inventory.md
printf '\n== AUTHORITY-SENSITIVE SOURCE FORMS ==\n'
rg -n -U -C3 \
'GITHUB_(PATH|ENV)|BASH_ENV|ZDOTDIR|(^|[^[:alnum:]_])ENV([^[:alnum:]_]|$)|GITHUB_|BASH_|ZDOT|\
\$\{!|(^|[;&|[:space:]])(?:eval|exec|source|\.|command|builtin|hash|alias|unalias|enable|env|bash|dash|ksh|sh|zsh|read|mapfile|readarray|getopts|printf|declare|typeset|local|readonly|export|unset)[[:space:]]|PATH=|<<-?[[:space:]]*|(^|[;&|[:space:]])cargo([[:space:];|&]|$)' \
.github action.yml action.yaml scripts --glob '*.py' --glob '*.sh' --glob '*.yml' --glob '*.yaml' 2>/dev/null || true
printf '\n== SCOPE, WHITESPACE, AND REPORTED RUNS ==\n'
git diff --name-only "$base" HEAD -- . \
':(exclude).github' \
':(exclude)action.yml' \
':(exclude)action.yaml' \
':(exclude)scripts' \
':(exclude)specs/015-af-01-trusted-development-baseline'
git diff --check "$base" HEAD
for run in 33043285246 33043285220 33043285224; do
gh run view "$run" --repo TheHalfMoon/commandF \
--json databaseId,headSha,status,conclusion,name 2>/dev/null || true
doneLength of output: 186267 🏁 Script executed: #!/bin/bash
set -euo pipefail
expected='28d9e39da1bc1bc6059a8b9f9c46327fe47ad99f'
test "$(git rev-parse HEAD)" = "$expected"
printf '%s\n' '== ENVIRONMENT AUTHORITY AUDITOR: COMPLETE =='
cat -n .github/scripts/audit_workflow_trust_environment_channels.py
printf '%s\n' '== SURFACE: EVALUATION, SHELL SYNTAX, AND ACTION-SCRIPT DELEGATION =='
rg -n -A100 -B15 \
'eval|command substitution|_logical_shell_segments|shlex\.split|ValueError|unsupported_.*(shell|action|cargo)|_action_local_targets|audit_action_text|audit_repository_surface' \
.github/scripts/audit_workflow_trust_surface.py \
.github/scripts/audit_workflow_trust.py
printf '%s\n' '== ENVIRONMENT-AUTHORITY TESTS: EVALUATION AND DYNAMIC NAMES =='
rg -n -A55 -B8 \
'def test_.*(eval|dynamic|substitution|startup|bash_env|zdotdir|environment|fragment|indirect|shell_syntax)|eval|BASH_ENV|ZDOTDIR|GITHUB_(PATH|ENV)' \
.github/scripts/test_audit_workflow_trust_environment_channels.py \
.github/scripts/test_audit_workflow_trust_environment_channels_precision.py \
.github/scripts/test_audit_workflow_trust_surface.py \
.github/scripts/test_audit_workflow_trust_surface_precision.py \
.github/scripts/test_audit_workflow_trust_syntax.py
printf '%s\n' '== CURRENT EXECUTION-EVALUATION FORMS =='
rg -n -U -C3 \
'(^|[;&|[:space:]])(?:eval|source|\.|bash|dash|ksh|sh|zsh)[[:space:]]|\$\(|`|\$\{!|BASH_ENV|ZDOTDIR|GITHUB_(PATH|ENV)' \
action.yml scripts .github/workflows .github/scripts \
--glob '*.sh' --glob '*.py' --glob '*.yml' --glob '*.yaml' 2>/dev/null || trueLength of output: 244684
I found no material AF-01 Stack A issue. The dynamic startup-variable writer boundary closes the prior P1. The environment-authority audit rejects dynamically constructed variable names for assignment builtins, The quote-aware tokenizer keeps quoted semicolons as data. It still splits real command separators. The dedicated precision regression covers the CF-09 I also checked adjacent authority paths. The implementation rejects indirect parameter expansion, The CI workflow invokes the environment/startup-authority audit as an independent step. It runs after the core and surface gates and before Rust gates. All reported required workflow runs completed successfully on the reviewed head. The workflow diff preserves the CF-06 oracle commands and the registry retry behavior. The source-backed Action now executes only I used static source inspection. I did not execute repository code or tests. You are interacting with an AI system. |
AF-01 Stack A — workflow trust baseline
Canonical base at PR creation:
This PR implements AF-01 Phase 1 / Stack A only. It does not change commandF product semantics, CF-06 oracle identity, CF-10 corpus authority, package/diff/terminology/impact rules, or dependency policy.
T010 — inventory
Adds
stack-a-inventory.mdcovering every tracked workflow and Action metadata file, externaluses:authority, job runners, effective permissions, timeouts, proof containers, checkout credentials, and lockfile-consuming Cargo commands at the canonical planning base.T011/T012 — machine-checkable policy + deterministic audit
Adds:
.github/workflow-trust-policy.json.github/scripts/audit_workflow_trust.pyThe audit discovers all tracked
.github/workflows/*.yml|*.yamland every trackedaction.yml|action.yamlat any depth, rejects unplanned workflows/jobs, mutable externaluses:references, mutable latest runner labels, missing/excessive timeouts, unresolved/default or overbroad token permissions, checkout credentials left enabled, mutable job/service container identities, and configured lockfile-consuming Cargo commands without--locked. Local./actions remain allowed.Output is deterministic JSON and exceptions require explicit rule/path/reason/revisit evidence.
T013/T016 — counterexamples and future-file coverage
Adds a repository-owned test suite covering:
action.yamlmutable uses;persist-credentials: false;*-latestrunner labels;T014/T015 — current workflow hardening
ci.ymlnow uses full-SHA checkout/rust-toolchain references, credentialless checkout,ubuntu-24.04, explicit 30-minute timeout, and executes the AF-01 audit tests plus live repository audit before Rust gates.cf06-oracle.ymlpreserves all existing oracle commands/evidence while fixing runners toubuntu-24.04, bounding all three jobs, and reducing the aggregation-onlyoracle-proofjob topermissions: {}.registry-download-smoke.ymlmoves its runner fromubuntu-latesttoubuntu-24.04; existing timeout, pinned actions, credentials, and semantic smoke behavior remain unchanged.The CF-11/CF-11G/CF-12/CF-13 proof workflows already satisfied the selected Stack A baseline and are not semantically rewritten.
Qualification required before merge
ci;No PASS is assumed from queue state or review launch.
Summary by cubic
Establishes AF-01 Stack A's deterministic workflow trust baseline so CI rejects mutable runners, unpinned action references, unlocked Cargo commands, and untrusted executable shell surfaces before Rust gates run. Every tracked workflow must match the checked-in policy or the audit fails closed.
Changes
GITHUB_PATH/GITHUB_ENVwrites that can alter later-step command resolution.BASH_ENV/ENV/ZDOTDIR) writes, direct relative action script paths, unresolved action env wrappers, Action PATH mutation including builtin and dynamic variable-name writers, and wrapper heredocs or hash commands at the execution boundary; scopes Cargo detection so unrelated substitution text is not flagged.CARGO_TARGET_DIRinstead of an externally supplied executable.Written for commit 28d9e39. Summary will update on new commits.