Repository navigation
feat: add contextual review gateway bootstrap #790
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 90 commits
Commits
Show all changes
100 commits
Select commit
Hold shift + click to select a range
7e3b65e
test: reproduce embedding deployment selected for chat synthesis
seonghobae 817eaec
fix: isolate chat discovery from embedding endpoints
seonghobae c765ce4
test: cover chat capability isolation defenses
seonghobae 6c2d263
docs: record embedding-to-chat incident boundary
seonghobae 35c7bef
docs: normalize incident references to APA 7
seonghobae f01da9f
test: reproduce stale embedding agent runtime selection
seonghobae 266561c
fix: enforce chat capability at runtime boundaries
seonghobae 4b50126
refactor: share chat capability classifier
seonghobae bc004d0
fix: activate runtime chat capability guards
seonghobae 8bf5db1
test: tighten runtime guard coverage surface
seonghobae d33d1d5
test: cover runtime guard installation idempotence
seonghobae 7ae2d4d
docs: record stale-agent runtime containment
seonghobae db7b209
fix: integrate chat capability checks explicitly
seonghobae 7739ca0
docs: normalize capability incident formatting
seonghobae 3571869
ci: repair chat capability guards with source integration
seonghobae 14571a5
ci: remove completed one-shot repair workflow
seonghobae c41aedb
Merge protected main into chat capability isolation
seonghobae 480d6ef
test: reproduce embedding deployment selected for chat synthesis
seonghobae 54b4403
fix: isolate chat discovery from embedding endpoints
seonghobae e557400
test: cover chat capability isolation defenses
seonghobae be2f191
docs: record embedding-to-chat incident boundary
seonghobae c1fc1ca
docs: normalize incident references to APA 7
seonghobae 392ce6c
test: reproduce stale embedding agent runtime selection
seonghobae 99f5c41
fix: enforce chat capability at runtime boundaries
seonghobae 136426d
refactor: share chat capability classifier
seonghobae 050b514
fix: activate runtime chat capability guards
seonghobae fa980bc
test: tighten runtime guard coverage surface
seonghobae 3998ad1
test: cover runtime guard installation idempotence
seonghobae feeac9e
docs: record stale-agent runtime containment
seonghobae 668cf86
fix: integrate chat capability checks explicitly
seonghobae 64b4e70
docs: normalize capability incident formatting
seonghobae 543cdc7
ci: verify final chat capability guards
seonghobae 95a2649
fix: complete explicit chat capability guards
seonghobae 92efe38
refactor: keep ModelClient internal to orchestrator module
seonghobae df20c19
test: separate chat transport from general synthesis roles
seonghobae 8e86976
ci: verify transport and synthesis capability separation
seonghobae 4fb286f
chore: remove superseded transport-role repair workflow
seonghobae ea2ca8d
test: remove out-of-scope transport-role experiment
seonghobae a30c390
test: define honest provider-diverse discovery bootstrap
seonghobae 6578dc5
test: bind NIM keys to one provider family
seonghobae 3f15912
test: reproduce chat transport and role boundary conflation
seonghobae 1ca4015
fix: rank unknown prices honestly and diversify bootstrap providers
seonghobae 33185ad
ci: verify chat transport and role boundaries safely
seonghobae a5a3840
chore: remove branch-mutating repair workflow
seonghobae cabb1b0
test: remove discarded transport-role experiment
seonghobae 3e75b1e
test: reproduce transport and agent-role capability conflation
seonghobae 104ba94
ci: verify transport and ordinary-agent capability boundaries
seonghobae 9984ad2
chore: remove branch-mutating capability workflow
seonghobae 0ec353d
fix: separate chat transport from synthesis roles
seonghobae 67b4341
test: reproduce non-chat passthrough and batch bypasses
seonghobae 06da0c0
fix(discovery): wire provider-diverse bootstrap into CLI
seonghobae 50b879b
ci: verify passthrough and batch chat capability guards
seonghobae a806e39
fix: replace chat capability repair workflow with reviewed source
seonghobae a424c9d
test: preserve unknown model identifiers without capability fabrication
seonghobae d71762d
fix: avoid inferring guard roles from unrelated suffixes
seonghobae f03d226
Merge protected main into chat capability isolation
seonghobae 6bd4e0c
ci: verify final chat capability contract
seonghobae 290838c
chore: remove completed capability repair workflow
seonghobae a063113
test(discovery): expose ambiguous price and duplicate pool gaps
seonghobae 2539ad5
fix(discovery): reject untrusted duplicate price evidence
seonghobae a78d3a6
fix(discovery): keep duplicate evidence comparison total
seonghobae 75e15af
test(discovery): expose overflow, corrupt-row, and currency gaps
seonghobae 183e7a8
fix(discovery): fail closed on malformed and incomparable price evidence
seonghobae c01733b
fix(cost): reject corrupt persisted price rows
seonghobae 669d97f
ci: finalize chat transport and role capability boundaries
seonghobae c08a8a6
ci: finalize endpoint transport and agent role separation
seonghobae 70757f6
chore: remove superseded capability repair workflow v2
seonghobae 8c06c74
chore: remove superseded capability repair workflow v3
seonghobae 8885ef2
ci: finalize chat capability boundaries on exact branch
seonghobae d1e06d5
fix: close chat capability review gaps
seonghobae 22a3270
test: make unknown-identifier regression directly runnable
seonghobae 60be2e4
test: make transport-role regression directly runnable
seonghobae e91a108
test: cover legacy completions and direct execution
seonghobae a4aef39
test: make chat-capability regression directly runnable
seonghobae f13ee66
docs: register chat capability regression checks
seonghobae 88fee97
fix: exclude shieldgemma from general chat roles
seonghobae 0777e14
test(cost): reject persisted partial price rows
seonghobae 386c9a0
fix: reject incomplete persisted price rows
seonghobae 5d989c6
feat: add contextual review gateway bootstrap
seonghobae 04761e4
fix: preserve priced discovery and review routing
seonghobae 3a0e9f4
fix: isolate review gateway chat candidates
seonghobae 84a8999
fix: keep partial discovery prices unknown
seonghobae 9041e78
fix: resolve review gateway auth through KV
seonghobae 0071751
fix: keep auth outside provider bootstrap gate
seonghobae 6c10b49
Merge embedding capability isolation into discovery stack
seonghobae 6b603ef
docs: ground provider-diverse routing in research
seonghobae 172a890
test: cover model discovery rejection paths
seonghobae bfdcdd0
fix: reject gte embedding models from chat roles
seonghobae d3a27db
fix: keep foreign currency prices out of ranking
seonghobae 8d31fa5
merge: preserve provider-diverse gateway discovery
seonghobae 17a5e42
Merge main into contextual review gateway
seonghobae e2ac971
Merge remote-tracking branch 'origin/main' into local-790
seonghobae 9f848a8
Merge remote-tracking branch 'origin/main' into feat-opencode-review-…
seonghobae c649cdb
fix: preserve non-chat capability routing and price integrity
seonghobae b826099
Merge remote-tracking branch 'origin/main' into codex/pr790-review
seonghobae 1c3b52a
Merge branch 'feat/opencode-review-gateway' of https://github.com/Con…
seonghobae ee216d0
fix: keep one canonical price parser
seonghobae 26c8f31
Merge remote-tracking branch 'origin/main' into codex/pr790-review
seonghobae 13bc939
docs: list chat capability check
seonghobae 6acd0fb
fix: validate review gateway agent limit at CLI
seonghobae File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| """Classify chat transport compatibility and ordinary agent-role eligibility. | ||
|
|
||
| Provider catalogs mix endpoint-only models with models served through an | ||
| OpenAI-compatible chat transport. Transport compatibility is not the same as | ||
| fitness for an ordinary thinker, worker, verifier, or synthesizer role: audio | ||
| and policy-classification models can use chat transport, while embedding, | ||
| reranking, transcription, moderation-endpoint, image-generation, realtime, and | ||
| speech-only models cannot. | ||
| """ | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| import re | ||
|
|
||
| _MODEL_TOKEN_RE = re.compile(r"[a-z0-9]+") | ||
| _TRANSPORT_INCOMPATIBLE_EXACT_TOKENS = frozenset( | ||
| { | ||
| "bge", | ||
| "clip", | ||
| "dall", | ||
| "e5", | ||
| "embed", | ||
| "embedding", | ||
| "embeddings", | ||
| "gte", | ||
| "image", | ||
| "images", | ||
| "moderation", | ||
| "realtime", | ||
| "rerank", | ||
| "reranker", | ||
| "siglip", | ||
| "sora", | ||
| "speech", | ||
| "transcribe", | ||
| "transcription", | ||
| "tts", | ||
| "whisper", | ||
| } | ||
| ) | ||
| _TRANSPORT_INCOMPATIBLE_PREFIXES = ( | ||
| "embed", | ||
| "moderat", | ||
| "rerank", | ||
| "transcrib", | ||
| ) | ||
|
|
||
|
|
||
| def is_chat_compatible_model_id(model_id: str) -> bool: | ||
| """Return whether an identifier can use the ordinary chat transport. | ||
|
|
||
| The classifier rejects only identifiers that clearly advertise an endpoint | ||
| family incompatible with chat messages. Audio-capable and safety-classifier | ||
| models remain transport-compatible because providers serve some of them over | ||
| ``/chat/completions``. | ||
| """ | ||
| tokens = _model_tokens(model_id) | ||
| return _is_transport_compatible_tokens(tokens) | ||
|
|
||
|
|
||
| def _is_transport_compatible_tokens(tokens: tuple[str, ...]) -> bool: | ||
| """Judge transport compatibility from already-normalized model tokens.""" | ||
| if not tokens: | ||
| return False | ||
| for token in tokens: | ||
| if token in _TRANSPORT_INCOMPATIBLE_EXACT_TOKENS: | ||
| return False | ||
| if token.startswith(_TRANSPORT_INCOMPATIBLE_PREFIXES): | ||
| return False | ||
| return True | ||
|
|
||
|
|
||
| def _model_tokens(model_id: str) -> tuple[str, ...]: | ||
| """Normalize one provider-prefixed model identifier into lowercase tokens.""" | ||
| if not isinstance(model_id, str): | ||
| return () | ||
| return tuple(_MODEL_TOKEN_RE.findall(model_id.casefold())) | ||
|
|
||
|
|
||
| def is_general_chat_agent_model_id(model_id: str) -> bool: | ||
| """Return whether a chat model may enter ordinary orchestration roles. | ||
|
|
||
| Explicit guard and safety models can use chat transport but are specialized | ||
| policy classifiers, not general answer synthesizers. This negative role gate | ||
| does not infer reasoning, coding, vision, or verification capabilities. | ||
| """ | ||
| tokens = _model_tokens(model_id) | ||
| if not tokens or not _is_transport_compatible_tokens(tokens): | ||
| return False | ||
| return not any( | ||
| token == "safety" | ||
| or token == "guard" | ||
| or token == "shieldgemma" | ||
| or token.startswith("nemoguard") | ||
| for token in tokens | ||
| ) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.