Skip to content

feat(review): add proposed external gateway admission port - #1963

Draft
seonghobae wants to merge 6 commits into
mainfrom
codex/co-external-review-gateway
Draft

feat(review): add proposed external gateway admission port#1963
seonghobae wants to merge 6 commits into
mainfrom
codex/co-external-review-gateway

Conversation

@seonghobae

@seonghobae seonghobae commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

The existing review sidecar bootstraps provider credentials; an external inference-token-only gateway needs a separate admission path. This adds an explicit external mode to the existing composite action and a fail-closed owner adapter port. The released-adapter registry is empty, so all real external invocations stop at released_contract_unavailable before token access, network requests or readiness export.

The port validates an HTTPS origin and an absolute, owned, mode-0600 regular token file. Discovery and JSON object/schema/tool-call checks return validated typed receipts instead of booleans. Failures preserve bounded authentication, transport, invalid-response, policy or capability categories together with the exact failed probe and HTTP status. Main reconstructs an allowlisted projection even when exception evidence is mutated, missing or inaccessible. Successful evidence records only requested_model=orchestrator/free; no upstream model identifier, raw response body or bearer is published. Every failed probe prevents partial readiness.

Validation at final head 65765e8: 69 focused tests passed and were independently repeated by root and a second reviewer. The typed receipt tests failed on the old boolean interface; separate RED→GREEN cases cover malformed/extra/missing/inaccessible exception evidence and raw exception text. Ruff, documentation lint and diff checks passed. A related sidecar/action/runtime/unbounded-model-wait set passed 201 tests at earlier implementation head 45aa644; it is prior supporting evidence, not a claim that the full set ran at the final head.

This remains Draft and disabled by default. CO #1084 is a proposed contract, not a released adapter. No CO implementation or fixture is imported, no HTTP transport is implemented, and no credential or production configuration is changed. TLS verification, trusted-origin authorization, redirect rejection, secure token reopening, response-semantic validation and private-request ZDR propagation must be verified when a reviewed immutable adapter is adopted. These unit tests do not prove provider retention, live gateway availability or restored model-backed PR reviews. No paid fallback or model-duration timeout is introduced.

Keep provider-sidecar provisioning as default. External mode admits only a protected registered release adapter; the registry stays empty until the canonical CO contract is released. Test inference capability admission and secret-safe evidence with owner test doubles.

Signed-off-by: Seongho Bae <me@seonghobae.me>

Commit-Message-Assisted-by: Codex (OpenAI Codex)
Signed-off-by: Seongho Bae <me@seonghobae.me>

Commit-Message-Assisted-by: Codex (OpenAI Codex)
Signed-off-by: Seongho Bae <me@seonghobae.me>

Commit-Message-Assisted-by: Codex (OpenAI Codex)
@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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.

@seonghobae seonghobae left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Draft boundary is correctly fail-closed, but the adapter port currently loses the typed failure provenance that the released CO contract and required review gates need. Please keep this Draft blocked until the port can preserve bounded failure categories end-to-end.

Comment thread scripts/ci/external_review_gateway.py Outdated
Replace boolean discovery and capability results with validated typed receipts. Preserve the failed probe and closed category in main output while projecting mutable exception evidence through the same allowlist. Keep the released-adapter registry empty and retain the no-fallback boundary.

Signed-off-by: Seongho Bae <me@seonghobae.me>

Commit-Message-Assisted-by: Codex (OpenAI Codex desktop)
Name the internal error category, source evidence and probe receipt explicitly and document the exception constructor. No admission behavior changes.

Signed-off-by: Seongho Bae <me@seonghobae.me>

Commit-Message-Assisted-by: Codex (OpenAI Codex desktop)
Read only the exact owner exception dictionary before final evidence projection. Missing evidence and unsupported exception subclasses now fail closed without accessing hostile attributes or exposing chained exception text. Add reproductions for both cases.

Signed-off-by: Seongho Bae <me@seonghobae.me>

Commit-Message-Assisted-by: Codex (OpenAI Codex desktop)

@seonghobae seonghobae left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Re-review of exact head 65765e875040d78a8ab1b8ff564590137fd8675c: the prior typed-outcome P1 is addressed in source. InferenceProbePort now returns a validated ProbeReceipt; the closed enum preserves authentication, transport, invalid-response, policy/free-pool, and capability categories with fixed probe stage and bounded HTTP status. Unexpected exceptions and malformed/mutable evidence project to invalid_response without raw details, and readiness is never exported on failure. The added category×stage, malformed-receipt, and final-serialization tests exercise those boundaries. The registry remains empty, so this does not claim an immutable CO release, live adapter, external gateway GREEN, or restored consumer review. Keep Draft/fail-closed until that separate release/adoption evidence exists. This is a source-finding disposition, not an approval.

Copy link
Copy Markdown
Contributor Author

Fresh prerequisite read for the proposed adapter boundary (no CO source/ref or .github source changed): contextual-orchestrator#1084@c1741c5906850f9e879df275e94d2c771dc1750c is open/Ready against CO main@414f22973658c4ddc3d4320fcf7acd9b4e8ba991, but all four current-head workflows are queued and its CodeRabbit command-injection thread remains unresolved. The finding is in tests/test_review_inference_preflight_contract.py: PR-controlled README example text is passed to sh -c; the curl double and timeout do not confine arbitrary shell syntax. CO still has zero GitHub releases.

Therefore this PR's empty RELEASED_GATEWAY_ADAPTERS registry and Draft/fail-closed state remain required. Do not treat the typed-port source fix as immutable release acceptance, do not import the proposed fixture/source, and do not register an adapter until #1084 has a reviewed minimal fix, exact-head GREEN, normal merge, and an immutable released contract with provenance.

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