Skip to content
Merged
2 changes: 1 addition & 1 deletion .github/workflows/codex-review-gate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ jobs:
COMMENT_BODY: ${{ github.event.comment.body }}
GH_TOKEN: ${{ github.token }}
PR_NUMBER: ${{ github.event.issue.number }}
CLEAN_REVIEW_MARKER: '^Codex Review: Didn''t find any major issues\.([[:space:]]+Keep it up!|[[:space:]]+:\+1:)?[[:space:]]*$'
CLEAN_REVIEW_MARKER: '^Codex Review: Didn''t find any major issues\.'
Comment thread
myagentdojo marked this conversation as resolved.
Resolved
REVIEW_MARKER: '^\*\*Reviewed commit:\*\* `([0-9a-f]{10,40})`[[:space:]]*$'
steps:
- name: Mark the reviewed PR commit successful
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ jobs:
| jq -sc 'add | map({filename,status,sha}) | sort_by(.filename)')
printf '%s\n' "$projection" > repair-projection.json
base_parent=$(gh api "repos/${GITHUB_REPOSITORY}/commits/${candidate_sha}" --jq '.parents[0].sha')
# Re-run the immutable release's own admission policy. Current projection
# rules may legitimately remove generated paths after an older release.
git checkout --detach "$candidate_sha"
Comment thread
myagentdojo marked this conversation as resolved.
Resolved
projection_result=$(bun run scripts/release-projection.ts \
--base "$base_parent" \
--head "$candidate_sha" \
Expand Down
8 changes: 4 additions & 4 deletions scripts/codex-review-gate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ test("Codex review gate is opt-in and fail-closed after a request", async () =>
expect(source).not.toContain("actions/checkout")
})

test("clean Codex comment releases the gate only with the exact clean marker", async () => {
test("clean Codex comment releases the gate from its stable verdict sentence", async () => {
const calls = await runCleanReviewComment(
"Codex Review: Didn't find any major issues. Keep it up!\n\n**Reviewed commit:** `38d88841ee8`",
"Codex Review: Didn't find any major issues. Bravo.\n\n**Reviewed commit:** `38d88841ee8`",
)

expect(calls).toContain("--raw-field state=success")
Expand All @@ -108,9 +108,9 @@ test("Codex comment without a clean marker leaves the gate unchanged", async ()
expect(calls).toBe("")
})

test("Codex comment with an invalid clean marker leaves the gate unchanged", async () => {
test("Codex comment with a lookalike clean marker leaves the gate unchanged", async () => {
const calls = await runCleanReviewComment(
"Codex Review: Didn't find any major issues. Findings follow.\n\n**Reviewed commit:** `38d88841ee8`",
"Codex Review: Didn't find a major issue. Bravo.\n\n**Reviewed commit:** `38d88841ee8`",
)

expect(calls).toBe("")
Expand Down
11 changes: 11 additions & 0 deletions scripts/release-validate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,17 @@ test("release workflow is pinned and publishes proven assets after validation",
expect(workflow).toContain("admitted_automation_identity")
expect(workflow).toContain('--expected-automation-login "$admitted_automation_identity"')
expect(workflow).toContain("scripts/release-projection.ts")
const historicalPolicyCheckout = repairValidationStep.indexOf('git checkout --detach "$candidate_sha"')
const historicalPolicyExecution = repairValidationStep.indexOf("bun run scripts/release-projection.ts")
const provenanceGuard = repairValidationStep.indexOf('if [[ -z "$merged_at"')
const parentCountGuard = repairValidationStep.indexOf('if [[ "$parent_count" != "2" ]]')
expect(historicalPolicyCheckout).toBeGreaterThanOrEqual(0)
expect(historicalPolicyExecution).toBeGreaterThanOrEqual(0)
expect(provenanceGuard).toBeGreaterThanOrEqual(0)
expect(parentCountGuard).toBeGreaterThanOrEqual(0)
expect(historicalPolicyCheckout).toBeGreaterThan(provenanceGuard)
expect(historicalPolicyCheckout).toBeGreaterThan(parentCountGuard)
expect(historicalPolicyExecution).toBeGreaterThan(historicalPolicyCheckout)
expect(workflow).not.toContain("ALLOWED_RELEASE_PATHS")
expect(workflow).not.toContain("missing_paths")
expect(workflow).toContain("parent_count")
Expand Down
Loading