Skip to content

Production-ready release candidate: exact-head integration R1 - #407

Open
thebtf wants to merge 11 commits into
review/release-integration-r1from
work/prc-release-ci-r1-sol
Open

Production-ready release candidate: exact-head integration R1#407
thebtf wants to merge 11 commits into
review/release-integration-r1from
work/prc-release-ci-r1-sol

Conversation

@thebtf

@thebtf thebtf commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Exact candidate

Head: 8230a3941fa54dac928a71ac79661b8fc072d1ec
Base: review/release-integration-r1

This is the combined production-readiness review surface for four previously isolated batches:

  • R7 fail-closed governance authority repair
  • macOS worker cwd identity portability
  • fresh-runner release prerequisites
  • single-writer registry scanner plus hostile bypass closure

Acceptance evidence so far

  • governance selftest PASS
  • R12 plan governance PASS
  • Git-backed active authority PASS: 9 candidates, 118 paths, 0 errors
  • isolated authority simulation PASS: 24 scenarios (4 allow / 20 reject), 0 errors
  • focused scanner hostile matrix PASS before rebase; exact-head full image gate is running

Required before integration

  • exact-head three-image build/scan manifest PASS
  • exact-head database-backed critical suite and dev-stand replay PASS
  • CodeRabbit, Codex, and Gemini independent review of this exact combined head
  • remote CI conclusions classified by actual failure class, not status color alone

Do not infer correctness from green tests. Review wrong-type acceptance, raw-vs-normalized values, line continuations, Docker command variants, credential aliases, single-writer sentinel cardinality, and interaction across all four batches.

Summary by CodeRabbit

  • Новые возможности

    • Добавлена проверка trusted authority guard для pull request с публикацией JSON-артефакта с результатами.
    • Обновлены релизные gates для R12: усилены контракты статусов/путей и логика сопоставления путей при выборе релиз-кандидатов.
    • Добавлены дополнительные evidence/отчёты для сценариев CI и maintenance-валидации.
  • Исправления

    • Улучшена обработка macOS для каноникализации CWD (сравнение по идентичности файловой сущности вместо строк).
    • Уточнены Unix-права для директорий через файловый API.
  • Тесты

    • Расширены self-test и негативные сценарии для R12, включая security/hostile проверки и валидации переходов.

@thebtf

thebtf commented Jul 13, 2026

Copy link
Copy Markdown
Owner Author

Exact combined candidate is 8230a39. Please perform a blind full-delta review across governance, macOS cwd identity, fresh-runner release prerequisites, and the single-writer registry scanner. Do not infer correctness from green tests. Probe wrong types, raw-vs-normalized values, PowerShell/shell continuations, docker --context/image/compose/docker.exe variants, packages spacing/quoting, PAT_TOKEN/GHCR_TOKEN/CR_PAT aliases, canonical sentinel cardinality, and cross-batch interactions. Exact-head image/critical/dev-stand evidence is being produced independently. @coderabbitai review @codex review @gemini-code-assist review

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

@thebtf Understood — I'll perform a full-delta review of the exact combined head 8230a3941f, treating this as a fresh, blind pass across all four batches (governance authority repair, macOS worker cwd identity, fresh-runner release prerequisites, single-writer registry scanner) rather than relying on prior isolated-batch review state or green-test status.

I'll specifically probe:

  • Wrong-type acceptance and raw-vs-normalized value handling in governance/authority checks
  • PowerShell vs POSIX shell line-continuation correctness in any cross-platform scripts
  • Docker invocation variants: --context, image references, compose vs docker.exe, and quoting/spacing around package lists
  • Credential alias handling: PAT_TOKEN, GHCR_TOKEN, CR_PAT and any inconsistent precedence/fallback logic
  • Canonical sentinel cardinality in the single-writer registry scanner (ensuring exactly one writer sentinel is recognized, not zero or multiple)
  • Interaction/regression risk where these four batches intersect (e.g., governance checks touching the scanner's sentinel logic, or fresh-runner prerequisites affecting macOS cwd resolution)

Note: Codex and Gemini reviews are handled by their respective bots outside my scope — I can only trigger my own review here.

✅ Action performed

Full review finished.

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ef3a24d0-7e2b-422c-8a41-d99ad192f932

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

В PR добавлены R12-контракты и trusted authority-валидаторы, обновлены GitHub Actions для release-gates и self-тестов, добавлены evidence-отчёты, а также исправлены проверки Unix-режимов, CWD на macOS и registry-writer sentinel.

Changes

R12 authority и release-gates

Layer / File(s) Summary
R12-контракты и аудит
.agent/plans/..., scripts/production-gates/assert-active-candidate-path-authority.ps1, scripts/production-gates/assert-plan-path-ownership.ps1
Добавлены pending-классы и prefix-контракты R12, аудит active-diff, pending-probe и поддержка replacement transition.
Trusted authority-валидаторы
scripts/production-gates/assert-pr-authority-guard.ps1, scripts/production-gates/assert-pr-authority-maintenance.ps1
Реализованы проверки trusted base, Git ancestry, blob-инвентаря, workflow safety, maintenance manifest и JSON-артефактов.
CI authority и R12 conformance
.github/workflows/authority-guard.yml, .github/workflows/test.yml
Workflow-и переведены на R12, pinned actions, authority guard, image scan, successor self-test и обновлённые conformance-проверки.
Maintenance-сценарии и runtime-проверки
.agent/specs/release-gates-r12/evidence/release-gates/test-r12-authority-maintenance.ps1, tests/critical/runtime/image_runtime_contract_test.go
Добавлены 24 сценария maintenance-валидации и проверки registry-writer sentinel.
Evidence и кроссплатформенные исправления
.agent/specs/**/evidence/*, scripts/production-gates/compose-secret-access.ps1, internal/handlers/loom/production_readiness_coverage_test.go
Зафиксированы результаты прогонов, обновлены security evidence, исправлены Unix mode API и сравнение CWD через os.SameFile.

Estimated code review effort: 5 (Critical) | ~120 minutes

Suggested labels: ai-review:passed

Poem

Я, кролик, скачу по веткам R12,
Контракты проверяю — раз, два, три.
Пины блестят, evidence растёт,
Пусть каждый gate зелёным живёт!
Морковкой отмечу удачный проход.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Заголовок кратко и точно отражает основной фокус PR: production-ready exact-head интеграция R1.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch work/prc-release-ci-r1-sol

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

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces the R12/B17 trusted authority maintenance framework, which includes comprehensive validation scripts, test suites, and security reviews. Key changes include fixing a macOS path comparison issue in production_readiness_coverage_test.go using os.SameFile, correcting invalid .NET directory Unix file mode API calls across several scripts, and adding robust PowerShell-based PR authority guards and maintenance validators. Additionally, the critical test suite was refactored to enforce single-writer registry constraints more strictly. Feedback on the changes suggests improving the robustness of the exact_prefixes validation in assert-active-candidate-path-authority.ps1 to prevent malformed /**** suffixes when the input already contains the canonical suffix.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +103 to +109
$pathToken = if ($PathKind -eq 'directory-prefix') { $member + '**' } else { $member }
$normalized = Normalize-AuthorityPath $pathToken
$isCanonical = if ($PathKind -eq 'exact') {
$normalized.kind -eq 'exact' -and $normalized.display -ceq $member
} else {
$normalized.kind -eq 'prefix' -and ($normalized.path + '/') -ceq $member
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The exact_prefixes field in exact_r12_overrides is validated using directory-prefix path kind, which appends ** to the path token. However, if the input already contains the canonical /** suffix (consistent with the top-level exact_prefixes field), this results in an invalid /**** suffix and a validation failure. Updating the logic to check if the member already ends with ** and allowing matching against $normalized.display ensures consistency and robustness across all prefix fields.

                $pathToken = if ($PathKind -eq 'directory-prefix' -and -not $member.EndsWith('**')) { $member + '**' } else { $member }
                $normalized = Normalize-AuthorityPath $pathToken
                $isCanonical = if ($PathKind -eq 'exact') {
                    $normalized.kind -eq 'exact' -and $normalized.display -ceq $member
                } else {
                    $normalized.kind -eq 'prefix' -and ($normalized.display -ceq $member -or ($normalized.path + '/') -ceq $member)
                }

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8230a3941f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +176 to +180
$allCovered = $true
foreach ($entry in $DiffEntries) {
if (@($prefixBases | Where-Object { ([string]$entry.path).StartsWith($_, [System.StringComparison]::Ordinal) }).Count -eq 0) { $allCovered = $false; break }
}
if ($allCovered) { return [pscustomobject][ordered]@{ kind='pending-prefix-envelope'; slice=[string]$pending.slice; status_class=[string]$pending.status_class } }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Handle mixed exact/prefix pending diffs

When a pending namespace declares both fixed files and a prefix, the current guard can only approve an exact-path-only diff or a prefix-only diff. The updated contract now uses this mixed shape for IMAGE-REMEDIATION-R2, so a valid PR that changes the declared product files plus evidence under the declared prefix fails exact equality first and then fails here because the product files are not prefix-covered. The authorization check should treat exact_paths and exact_prefixes as a union for the same pending envelope.

Useful? React with 👍 / 👎.

}

func repositorySingleWriterViolations(repo, allowedWorkflow, allowedScript string) ([]string, error) {
writePattern := regexp.MustCompile(`(?i)packages\s*:\s*["']?write\b["']?|docker/login-action|\b(?:PERSONAL_ACCESS_TOKEN|PAT_TOKEN|GHCR_TOKEN|CR_PAT)\b|\bdocker(?:\.exe)?\b[^\r\n]*(?:\bpush\b|--push\b)`)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Match quoted packages permission keys

A second workflow can spell the package permission with a quoted YAML key such as "packages": write or 'packages': write; that is still a package-write grant, but this scanner only matches an unquoted packages token immediately before the colon. In that scenario the single-writer check returns no violation for another package-writing workflow, bypassing the intended sole registry writer guard.

Useful? React with 👍 / 👎.

Comment on lines +495 to +496
[string[]]$exactPaths = @(Get-OptionalStringArray $pending 'exact_paths')
[string[]]$exactPrefixes = @(Get-OptionalStringArray $pending 'exact_prefixes')

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reject scalar pending path declarations

For non-macro R12 pending namespaces, these fields are read through Get-OptionalStringArray, which wraps a scalar string as a one-element array. If the contract accidentally commits exact_prefixes or exact_paths as a JSON string instead of an array, the audit still passes and the PR guard consumes it as valid authority, so wrong-type governance data is not fail-closed. Use the strict array validation path for ordinary pending declarations as well.

Useful? React with 👍 / 👎.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces the R12/B17 trusted authority maintenance framework and addresses several cross-platform and API compatibility issues. Key changes include fixing a macOS-specific test failure in Loom handler tests by using os.SameFile to resolve /var and /private/var path discrepancies, and correcting a critical .NET API compatibility bug in PowerShell scripts by replacing non-existent [System.IO.Directory]::SetUnixFileMode calls with [System.IO.File]::SetUnixFileMode. Additionally, it implements the R12 authority maintenance guard and transition validation scripts (assert-pr-authority-guard.ps1 and assert-pr-authority-maintenance.ps1), enhances path authority and plan ownership audits to support R12 contract schemas and case-sensitive SHA checks, and refactors single-writer registry checks in the critical runtime tests. No review comments were provided, so there is no feedback to evaluate.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🧹 Nitpick comments (2)
tests/critical/runtime/image_runtime_contract_test.go (1)

722-723: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Опционально: задокументировать семантику составного regex.

writePattern/continuationPattern — единственная линия защиты fail-closed проверки single-writer. Небольшой inline-комментарий, поясняющий каждую альтернативу (packages: write, docker/login-action, токены, docker ... push), снизит риск случайной регрессии при будущих правках этого regex без соответствующего изменения тестовой матрицы.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/critical/runtime/image_runtime_contract_test.go` around lines 722 -
723, Добавьте краткий inline-комментарий рядом с writePattern, документирующий
назначение каждой альтернативы regex: packages: write, docker/login-action,
токены PERSONAL_ACCESS_TOKEN/PAT_TOKEN/GHCR_TOKEN/CR_PAT и команды docker
push/--push; также поясните, что continuationPattern нормализует продолжения
строк для fail-closed проверки single-writer.
.agent/specs/macos-cwd-canonical/evidence/MACOS-CWD-CANONICAL.tdd.json (1)

4-4: 🩺 Stability & Availability | 🔵 Trivial

Верификация на macOS CI ещё не закрыта.

Артефакт сам фиксирует "verdict": "PASS_LOCAL_PENDING_MACOS_CI" и "status": "LOCAL_PROXY_GREEN_PENDING_REMOTE_MACOS" — фактическое поведение подтверждено только через Linux TMPDIR-symlink proxy и Windows-прогон, а не реальным macOS-раннером. Учитывая явный запрос автора PR не делать выводы о корректности по «зелёным» тестам и требование exact-head интеграционных доказательств, стоит дождаться и приложить реальный успешный прогон TestCliWorker_ProductionReadinessStructuredArgsAndCWD на macos-14 перед тем, как считать этот батч закрытым.

Also applies to: 39-43

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.agent/specs/macos-cwd-canonical/evidence/MACOS-CWD-CANONICAL.tdd.json at
line 4, Обновите артефакт вокруг verdict и status, чтобы не считать батч
закрытым до реального успешного macOS CI-прогона
TestCliWorker_ProductionReadinessStructuredArgsAndCWD на macos-14. После
получения exact-head доказательства замените pending-статусы на отражающие
подтверждённый результат и приложите ссылку или идентификатор прогона, сохранив
текущие локальные доказательства отдельно.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
@.agent/specs/release-gates-r12/evidence/release-gates/test-r12-authority-maintenance.ps1:
- Line 355: Исправьте вызовы [regex]::Replace в сценарии, включая участки вокруг
$workflowText и строки 360, 475, 485 и 495: передайте регулярное выражение как
экземпляр [regex] и используйте его метод Replace с аргументом count = 1.
Сохраните текущие шаблоны и замены, чтобы каждый вызов изменял ровно одно
совпадение.

---

Nitpick comments:
In @.agent/specs/macos-cwd-canonical/evidence/MACOS-CWD-CANONICAL.tdd.json:
- Line 4: Обновите артефакт вокруг verdict и status, чтобы не считать батч
закрытым до реального успешного macOS CI-прогона
TestCliWorker_ProductionReadinessStructuredArgsAndCWD на macos-14. После
получения exact-head доказательства замените pending-статусы на отражающие
подтверждённый результат и приложите ссылку или идентификатор прогона, сохранив
текущие локальные доказательства отдельно.

In `@tests/critical/runtime/image_runtime_contract_test.go`:
- Around line 722-723: Добавьте краткий inline-комментарий рядом с writePattern,
документирующий назначение каждой альтернативы regex: packages: write,
docker/login-action, токены PERSONAL_ACCESS_TOKEN/PAT_TOKEN/GHCR_TOKEN/CR_PAT и
команды docker push/--push; также поясните, что continuationPattern нормализует
продолжения строк для fail-closed проверки single-writer.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b0c9df7f-2126-4d48-9f2a-e384651e4a26

📥 Commits

Reviewing files that changed from the base of the PR and between 8279d22 and 8230a39.

📒 Files selected for processing (26)
  • .agent/plans/2026-07-10-engram-production-ready-active-diff-contracts.json
  • .agent/specs/macos-cwd-canonical/evidence/MACOS-CWD-CANONICAL.red.json
  • .agent/specs/macos-cwd-canonical/evidence/MACOS-CWD-CANONICAL.tdd.json
  • .agent/specs/release-ci-r1/evidence/RELEASE-CI-R1.red.json
  • .agent/specs/release-ci-r1/evidence/RELEASE-CI-R1.tdd.json
  • .agent/specs/release-ci-r1/evidence/authority-run1.json
  • .agent/specs/release-ci-r1/evidence/authority-run2.json
  • .agent/specs/release-gates-r12/evidence/plan-governance/gates-summary.json
  • .agent/specs/release-gates-r12/evidence/plan-governance/test-r12-plan-governance.ps1
  • .agent/specs/release-gates-r12/evidence/plan-governance/verification-summary.json
  • .agent/specs/release-gates-r12/evidence/release-gates/R12-AUTHORITY-MAINTENANCE.tdd.json
  • .agent/specs/release-gates-r12/evidence/release-gates/maintenance-simulation.json
  • .agent/specs/release-gates-r12/evidence/release-gates/security-review.md
  • .agent/specs/release-gates-r12/evidence/release-gates/test-r12-authority-maintenance.ps1
  • .agent/specs/release-gates-r12/evidence/release-gates/windows-harness.json
  • .github/workflows/authority-guard.yml
  • .github/workflows/test.yml
  • internal/handlers/loom/production_readiness_coverage_test.go
  • scripts/production-gates/assert-active-candidate-path-authority.ps1
  • scripts/production-gates/assert-plan-path-ownership.ps1
  • scripts/production-gates/assert-pr-authority-guard.ps1
  • scripts/production-gates/assert-pr-authority-maintenance.ps1
  • scripts/production-gates/compose-secret-access.ps1
  • scripts/production-gates/test-compose-secret-access.ps1
  • scripts/recovery/verify-postgres-backup-restore.ps1
  • tests/critical/runtime/image_runtime_contract_test.go

foreach ($workflowPath in @('.github/workflows/authority-guard.yml', '.github/workflows/test.yml')) {
$workflowFile = Join-Path $fixture $workflowPath
$workflowText = [System.IO.File]::ReadAllText($workflowFile)
$workflowText = [regex]::Replace($workflowText, '(?m)^on:\s*$', 'on: # parser fixture root-key comment', 1)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

[regex]::Replace(..., 1) здесь не ограничивает число замен — 1 приводится к RegexOptions.IgnoreCase.
У статического Regex.Replace 4-й аргумент — это RegexOptions, а не count; если нужен ровно один матч, используйте инстанс-метод ([regex]'...').Replace(..., ..., 1). То же относится к строкам 360, 475, 485 и 495.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
@.agent/specs/release-gates-r12/evidence/release-gates/test-r12-authority-maintenance.ps1
at line 355, Исправьте вызовы [regex]::Replace в сценарии, включая участки
вокруг $workflowText и строки 360, 475, 485 и 495: передайте регулярное
выражение как экземпляр [regex] и используйте его метод Replace с аргументом
count = 1. Сохраните текущие шаблоны и замены, чтобы каждый вызов изменял ровно
одно совпадение.

@thebtf

thebtf commented Jul 13, 2026

Copy link
Copy Markdown
Owner Author

Remote release-gate root cause repaired at exact head 70783ae. GitHub run 29258547103 proved Ubuntu/Windows/macOS PASS but failed before image build because mutable docker ps --filter ancestor=... returned no service container. The workflow now binds POSTGRES_CONTAINER to the official job.services.postgres.id context, verifies that exact ID with docker inspect, forbids image/tag rediscovery, and adds a 72nd hostile conformance mutation. Local actionlint and full inline conformance PASS. Parent image tree 8230a39 has full three-image manifest PASS with exact IDs, zero HIGH/CRITICAL, 203.922s critical runtime, compose recreation, and cleanup; the new remote run must independently rebuild/replay at 70783ae. Please review this exact new delta. @coderabbitai review @codex review @gemini-code-assist review

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail
cd /tmp
git clone --quiet https://github.com/thebtf/engram.git repo 2>&1 | tail -5 || true
cd repo
git fetch --quiet origin 70783aeca6bda80f8740d510486a02f0ce2488c0 2>&1 | tail -20 || true
git log --oneline -5 70783aeca6bda80f8740d510486a02f0ce2488c0 2>&1 || true
echo "---diff stat against parent 8230a394---"
git diff --stat 8230a3941fa54dac928a71ac79661b8fc072d1ec 70783aeca6bda80f8740d510486a02f0ce2488c0 2>&1 || true

Length of output: 1164


🏁 Script executed:

#!/bin/bash
cd /tmp/repo
git diff 8230a3941fa54dac928a71ac79661b8fc072d1ec 70783aeca6bda80f8740d510486a02f0ce2488c0 -- .github/workflows/test.yml
echo "=====RELEASE-CI-R1.tdd.json====="
git diff 8230a3941fa54dac928a71ac79661b8fc072d1ec 70783aeca6bda80f8740d510486a02f0ce2488c0 -- .agent/specs/release-ci-r1/evidence/RELEASE-CI-R1.tdd.json

Length of output: 11089


🏁 Script executed:

#!/bin/bash
cd /tmp/repo
sed -n '1,60p' .github/workflows/test.yml | grep -n "services:" -A 20
echo "---search for services: postgres definition---"
grep -n "postgres:" .github/workflows/test.yml | head -20
grep -n "services:" .github/workflows/test.yml

Length of output: 1142


🤖 web_search executed:

GitHub Actions job context job.services.<service_id>.id container ID format documentation

Length of output: 9318


🤖 web_search executed:

GitHub Actions contexts allowed in step level env jobs.<job_id>.steps.<step_id>.env.<env_id> job context available

Length of output: 15429


🏁 Script executed:

#!/bin/bash
cd /tmp/repo
sed -n '1,25p' .github/workflows/test.yml
echo "---job name context---"
grep -n "runs-on" .github/workflows/test.yml

Length of output: 1223


🏁 Script executed:

#!/bin/bash
cd /tmp/repo
grep -n "^  [a-zA-Z_-]*:$" .github/workflows/test.yml
echo "---context around Resolve PostgreSQL service identity---"
grep -n "Resolve PostgreSQL service identity" .github/workflows/test.yml
sed -n '1,1p' .github/workflows/test.yml
awk '/^  [a-zA-Z_-]+:$/{print NR": "$0}' .github/workflows/test.yml

Length of output: 647


🏁 Script executed:

#!/bin/bash
cd /tmp/repo
grep -n "^  [a-zA-Z0-9_-]*:$" .github/workflows/test.yml
wc -l .github/workflows/test.yml
grep -n "Resolve PostgreSQL" .github/workflows/test.yml

Length of output: 565


🏁 Script executed:

#!/bin/bash
cd /tmp/repo
git rev-parse HEAD
git status
git checkout 70783aeca6bda80f8740d510486a02f0ce2488c0 --quiet
wc -l .github/workflows/test.yml
grep -n "Resolve PostgreSQL service identity" .github/workflows/test.yml
grep -n "^  [a-zA-Z0-9_-]*:$" .github/workflows/test.yml

Length of output: 855


🏁 Script executed:

#!/bin/bash
cd /tmp/repo
sed -n '17,30p' .github/workflows/test.yml
echo "---step---"
sed -n '860,900p' .github/workflows/test.yml

Length of output: 5239


Good, confirmed: this job (release-gates-foundation) runs on ubuntu-latest, so Docker/service-container semantics apply directly (no macOS/Windows cross-batch concern here — that job only uses the docker.exe/matrix concerns elsewhere).

@thebtf Reviewed this exact new delta (8230a3970783ae, .github/workflows/test.yml +21/-13, plus the corresponding RELEASE-CI-R1.tdd.json evidence update). Findings:

Root-cause fix looks correct:

  • Confirmed job.services.postgres.id is the official GitHub Actions context for the service container ID (returns the full 64-char container ID), and it's an allowed context in step-level env: (jobs.<job_id>.steps.env context list includes job) — so binding POSTGRES_CONTAINER via env: POSTGRES_CONTAINER: ${{ job.services.postgres.id }} is syntactically and semantically valid.
  • The service block is named postgres in release-gates-foundation (runs-on: ubuntu-latest), matching job.services.postgres.id exactly.
  • Replacing mutable docker ps --filter ancestor=pgvector/pgvector:pg17 with the authoritative job context + a docker inspect --type container --format "{{.Id}}" $container cross-check is the right fix for the observed failure mode (image/ancestor-filter discovery returning empty on that remote runner).
  • Format guard -cnotmatch '^[0-9a-f]{64}$' correctly enforces the full lowercase-hex container ID shape, and the identity comparison uses case-sensitive -cne, consistent with the rest of the codebase's case-sensitivity discipline.
  • This step only runs in the Linux-only release-gates-foundation job, so there's no cross-batch interaction with the macOS cwd-identity work or the Windows/docker.exe matrix path.

Hostile-mutation coverage: the new mutation #72 (replace official PostgreSQL service identity → empty string) correctly guards against silently dropping the env binding, and the count bump (71→72) and updated Write-Output message are consistent.

Evidence file (RELEASE-CI-R1.tdd.json): correctly reflects the current honest state — exact_head_build_and_scan at 8230a39 is marked PASS with artifact hash/metrics, while critical_suite, dev_stand, and remote_release_job are explicitly marked PENDING_EXACT_HEAD_AFTER_SERVICE_ID_REPAIR / ROOT_CAUSE_REPAIRED_PENDING_EXACT_HEAD_REPLAY rather than prematurely claiming green — good discipline, no inference of correctness from partial results.

No defects found in this delta. I don't see anything blocking here; the remaining open item, as you noted, is the independent rebuild/replay at 70783ae itself.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request implements the R12/B17 trusted authority maintenance system, introducing new validation scripts (assert-pr-authority-guard.ps1 and assert-pr-authority-maintenance.ps1), updated contract audits, and extensive test simulations. It also resolves cross-platform compatibility issues, notably fixing a macOS temporary directory path mismatch in production_readiness_coverage_test.go by using os.SameFile instead of exact string equality, and correcting invalid .NET Directory.SetUnixFileMode calls to use File.SetUnixFileMode across several PowerShell scripts. Feedback on the changes suggests adding directory existence checks before walking .github/workflows and scripts in image_runtime_contract_test.go to prevent test failures in minimal or sparse checkout environments.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +727 to +728
for _, root := range []string{filepath.Join(repo, ".github", "workflows"), filepath.Join(repo, "scripts")} {
err := filepath.Walk(root, func(path string, info os.FileInfo, err error) error {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

If the .github/workflows or scripts directory does not exist in the target repository (e.g., in minimal test environments or sparse checkouts), filepath.Walk will return an error immediately and fail the test. It is safer to check if the directory exists before walking it.

Suggested change
for _, root := range []string{filepath.Join(repo, ".github", "workflows"), filepath.Join(repo, "scripts")} {
err := filepath.Walk(root, func(path string, info os.FileInfo, err error) error {
for _, root := range []string{filepath.Join(repo, ".github", "workflows"), filepath.Join(repo, "scripts")} {
if _, err := os.Stat(root); os.IsNotExist(err) {
continue
}
err := filepath.Walk(root, func(path string, info os.FileInfo, err error) error {

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: 70783aeca6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@coderabbitai coderabbitai 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.

🧹 Nitpick comments (1)
.github/workflows/test.yml (1)

690-694: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Пробел в mutation-тестах: не проверяется экспорт в GITHUB_ENV.

Ассерты на шаге Resolve PostgreSQL service identity проверяют наличие привязки к job.services.postgres.id, вызов docker inspect и отсутствие docker ps --filter, но не проверяют, что строка "POSTGRES_CONTAINER=$container" | Out-File -FilePath $env:GITHUB_ENV (строка 893) осталась в шаге. Если эту строку случайно удалят в будущем PR, $env:POSTGRES_CONTAINER не будет распространён на последующие шаги (в частности, на -PostgresContainer $env:POSTGRES_CONTAINER на строке 916), а текущий hostile-mutation harness (72 отклонённые мутации) этого не поймает — именно та категория регрессии, которую эта PR закрывает для mutable-обнаружения контейнера.

Предложение: добавить проверку экспорта в GITHUB_ENV
             if ($postgresIdentityStep.Contains('docker ps --filter')) { throw 'PostgreSQL service identity must not be rediscovered by mutable image/tag filters' }
+            if (-not $postgresIdentityStep.Contains('Out-File -FilePath $env:GITHUB_ENV')) { throw 'PostgreSQL service identity must be republished to GITHUB_ENV for downstream steps' }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/test.yml around lines 690 - 694, Extend the mutation
assertions for the “Resolve PostgreSQL service identity” step to require
preservation of the POSTGRES_CONTAINER export to $env:GITHUB_ENV using
$container. Keep the existing service-context, docker inspect, and docker ps
--filter checks unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In @.github/workflows/test.yml:
- Around line 690-694: Extend the mutation assertions for the “Resolve
PostgreSQL service identity” step to require preservation of the
POSTGRES_CONTAINER export to $env:GITHUB_ENV using $container. Keep the existing
service-context, docker inspect, and docker ps --filter checks unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 28233da7-09f1-4546-97f2-1adf4ff8be03

📥 Commits

Reviewing files that changed from the base of the PR and between 8230a39 and 70783ae.

📒 Files selected for processing (2)
  • .agent/specs/release-ci-r1/evidence/RELEASE-CI-R1.tdd.json
  • .github/workflows/test.yml

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant