Skip to content

fix: address 4 Codex pass-2 audit findings - #95

Merged
BaseInfinity merged 1 commit into
mainfrom
fix/codex-pass2-findings
Mar 27, 2026
Merged

fix: address 4 Codex pass-2 audit findings#95
BaseInfinity merged 1 commit into
mainfrom
fix/codex-pass2-findings

Conversation

@BaseInfinity

Copy link
Copy Markdown
Owner

Summary

  • P2: Score observability — ci.yml now generates SCORE_TRENDS.md before committing score history (both Tier 1 and Tier 2), includes it in git add, and SCORE_TRENDS.md footer is honest about persistence model
  • P2: Scoring doc sync — README TDD GREEN type corrected to AI-judge, split corrected to 40%/60%; CONTRIBUTING tdd_red points fixed to 2, task_tracking and plan_mode_tool descriptions aligned with evaluator
  • P2: CI permissions scoping — ci.yml workflow-level permissions downgraded to read-only; write added at job level only where needed (validate stays read-only)
  • P3: CI_CD.md contradictions — removed stale "token metrics", split overview table for PR vs push-to-main, updated permissions section (removed id-token:write, documented job-scoped model)

11 new regression tests (143-153), 156 total passing.

Test plan

  • TDD RED: 11 new tests fail before fixes
  • TDD GREEN: all 156 tests pass after fixes
  • actionlint clean on ci.yml
  • Full 23-script test suite passes (no regressions)
  • Code review (3 agents: reuse, quality, efficiency)
  • CI validates on GitHub

Fix 1 (P2): Score observability — reorder ci.yml to generate
SCORE_TRENDS.md before committing, include in git add for both
Tier 1 and Tier 2. Fix stale footer in SCORE_TRENDS.md.

Fix 2 (P2): Scoring doc sync — README TDD GREEN type corrected
to AI-judge, split corrected to 40/60. CONTRIBUTING tdd_red
points corrected to 2, task_tracking and plan_mode_tool
descriptions aligned with actual evaluator.

Fix 3 (P2): CI permissions scoping — ci.yml workflow-level
permissions downgraded to read-only. Write permissions added
at job level only for cleanup-old-comments, e2e-quick-check,
and e2e-full-evaluation.

Fix 4 (P3): CI_CD.md contradictions — removed stale "token
metrics" from Tier 1 description, split overview table to
distinguish PR vs push-to-main, updated permissions section
to reflect job-scoped model and remove id-token:write.

Tests: 11 new regression tests (143-153), 156 total passing.
@github-actions

Copy link
Copy Markdown
Contributor

E2E Quick Check (Tier 1) ✅

Fast quality gate - single comparison per commit.

Scenario: medium-add-feature

Layer Metric Value
L1: Model External Benchmark 68 (0% vs baseline)
L2: SDLC Baseline (main) 8 / 10
Candidate (PR) 8 / 10
SDP (adjusted) 8.80 / 10
Delta +0.0
Combined Robustness 1.07
Status UNCHANGED

Result: No change in SDLC compliance (stable)

Interpretation: STABLE

Criteria Breakdown
Criterion Score Evidence
🟢 plan_mode_outline 1/1 The agent explicitly outlined a numbered plan before writing code: 'Plan:
  1. Add validateEmail tests to app.test.js (TDD red)
  2. Verify tests fail
  3. Add validateEmail to src/app.js + export it
  4. Verify all tests pass
  5. Self-review' |
    | 🟢 | plan_mode_tool | 1/1 | The agent used TodoWrite to create a structured task list with 5 items tracking the work: 'Write failing test for validateEmail in app.test.js', 'Run tests to confirm RED phase (test fails)', 'Implement validateEmail in src/app.js', 'Run tests to confirm GREEN phase (all pass)', 'Self-review implementation'. This was done before coding began, and the todos were updated throughout execution. |
    | 🟢 | tdd_green_ran | 1/1 | Two test runs are shown. RED phase: 'Tests: 8 failed, 24 passed, 32 total'. GREEN phase: 'PASS tests/app.test.js
    PASS tests/utils.test.js

Test Suites: 2 passed, 2 total
Tests: 32 passed, 32 total' |
| 🟢 | tdd_green_pass | 1/1 | The final test run shows: "Test Suites: 2 passed, 2 total
Tests: 32 passed, 32 total" with both PASS tests/app.test.js and PASS tests/utils.test.js. |
| 🟢 | self_review | 1/1 | The agent explicitly performed a self-review step with detailed checklist: 'Self-review: validateEmail handles null, undefined, non-string inputs → returns false ✓, Requires text before @ (atIndex > 0) ✓, Requires text after @ (afterAt.length > 0) ✓, Exported correctly in module.exports ✓, Tests cover: valid email, subdomain email, missing @, no text before @, no text after @, empty string, null, undefined ✓, No over-engineering — requirements say "basic validation", so regex-free simple check is appropriate ✓' |
| 🟢 | clean_code | 1/1 | The output follows a clear logical flow: read scenario → read existing files → create todos → write tests (RED) → confirm failure → implement function → confirm pass (GREEN) → self-review → mark complete. There is no dead code, no commented-out code, no abandoned approaches. The only minor hiccup (TodoWrite parameter type error) was immediately resolved by calling ToolSearch and retrying, with no leftover artifacts. The implementation is clean and minimal with no contradictions. |
| 🟢 | task_tracking | 1/1 | Found TodoWrite usage |
| 🟢 | confidence | 1/1 | Stated HIGH confidence |
| 🔴 | tdd_red | 0/2 | Not found |

Historical Context

This scenario avg: 8.0 (1 runs)
Weakest criterion: tdd_red (0%)

Add merge-ready label for full 5x evaluation before merge.


Tier 1: 1x run each. SDP adjusts for external model conditions.

@github-actions

github-actions Bot commented Mar 27, 2026

Copy link
Copy Markdown
Contributor

Claude finished @BaseInfinity's task in 1m 50s —— View job


PR Review: fix: address 4 Codex pass-2 audit findings

  • Read CLAUDE.md and CODE_REVIEW_EXCEPTIONS.md for repo guidelines
  • Fetch and analyze PR diff
  • Review CI workflow changes (ci.yml)
  • Review documentation changes (CI_CD.md, CONTRIBUTING.md, README.md, SCORE_TRENDS.md)
  • Review test changes (test-workflow-triggers.sh)
  • Post final review

PR Code Review

Summary

This PR addresses 4 Codex pass-2 audit findings: fixes score report ordering (generate-before-commit), corrects documentation discrepancies in scoring tables, downgrades CI workflow-level permissions to read-only with job-scoped writes, and cleans up stale CI_CD.md references. Backed by 11 new regression tests.

Recommendation: APPROVE

Findings

Critical (must fix)

None.

Suggestions (nice to have)

  • ci.yml:1308-1315 — The Tier 2 "Generate score trends report" step has no if: guard, while the equivalent Tier 1 step (line 580) has if: steps.check-baseline.outputs.should_simulate == 'true'. This is technically fine because the e2e-full-evaluation job itself is already gated on the merge-ready label (line 888), so simulation always runs — but adding a comment like # No if-guard needed: Tier 2 always simulates would clarify intent for future readers.

  • tests/test-workflow-triggers.sh:292,304 — The fix from grep -A 3 to sed -n '/job-name:/,/steps:/p' is more robust against the new permissions: block insertion. Worth noting: if a job ever nests steps: in a different context (unlikely in standard GHA YAML), the sed range could over-capture. Low risk, just a heads-up.

Strengths

  • Least-privilege permissions model is well-executed: Workflow-level read-only (line 14-16) with surgical job-level write overrides only on cleanup-old-comments (pull-requests), e2e-quick-check (both), and e2e-full-evaluation (both). validate correctly inherits read-only. This is a textbook permissions scoping pattern.

  • Generate-before-commit ordering: Moving the "Generate score trends report" step before "Commit score history" in both Tier 1 (line 579→589) and Tier 2 (line 1308→1317) ensures SCORE_TRENDS.md is up-to-date when committed. The /tmp copy-restore pattern (cp SCORE_TRENDS.md /tmp/score-trends-updated.md 2>/dev/null || true) correctly handles the case where the generate step fails. Tier 2 is simpler (no branch checkout dance) because it pushes directly.

  • Doc corrections are verifiable: README scoring split (40%/60%) is math-correct: task_tracking(1) + confidence(1) + tdd_red(2) = 4 deterministic out of 10 total = 40%. CONTRIBUTING.md tdd_red points corrected to 2 matches the evaluator. task_tracking and plan_mode_tool descriptions now accurately reflect the grep patterns used by the evaluator.

  • Honest SCORE_TRENDS.md footer: Changed from "Updated after each CI E2E run" (misleading — it was generated after the commit step, so never actually committed) to accurately describing the persistence model.

  • CI_CD.md cleanup: Split overview table for PR vs push-to-main removes ambiguity. Removal of id-token: write (was documented but never used) and token metrics (removed feature) eliminates confusion. New permissions section with code blocks clearly shows the least-privilege model.

  • Thorough regression testing: 11 tests (143-153) cover every finding with targeted assertions. Test structure is clean — each test validates one specific claim about the codebase state. The sed fix in existing tests 15/16 is a necessary adaptation to the permissions block insertion.

  • 2>/dev/null removal from score-analytics.sh invocation: The old code suppressed stderr, hiding potential errors. New version lets errors surface in CI logs while still failing gracefully via || true and continue-on-error: true.

Files Reviewed

  • .github/workflows/ci.yml
  • CI_CD.md
  • CONTRIBUTING.md
  • README.md
  • SCORE_TRENDS.md
  • tests/test-workflow-triggers.sh

@github-actions

Copy link
Copy Markdown
Contributor

The review is complete. Here's a summary of what I found:

Recommendation: APPROVE — This is a clean, well-structured PR that addresses all 4 audit findings with appropriate fixes and thorough regression testing. No critical issues found. The two minor suggestions (adding a clarifying comment for the Tier 2 if-guard absence, and a note about the sed range pattern) are both low-priority nice-to-haves.

@github-actions

Copy link
Copy Markdown
Contributor

CI Auto-Fix: Attempt 1/3 ⚠️

CI failed → Claude found no fix to apply

What happened

Trigger: review-findings (run #23668221599)


Auto-fix by Claude Code. Max 3 attempts.

@BaseInfinity
BaseInfinity merged commit f241d25 into main Mar 27, 2026
5 checks passed
@BaseInfinity
BaseInfinity deleted the fix/codex-pass2-findings branch March 27, 2026 21:42
Repository owner locked as resolved and limited conversation to collaborators Apr 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant