Repository navigation
feat(router)!: add a versioned JSON Schema for routing tables at version 1 #10129
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 1 commit
Commits
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
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
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 |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| { | ||
| "schema_version": 5, | ||
| "schema_version": 1, | ||
| "profile": { | ||
| "goal": "cost", | ||
| "mode": "balanced" | ||
|
|
||
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 |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| { | ||
| "schema_version": 5, | ||
| "schema_version": 1, | ||
| "profile": { | ||
| "goal": "cost", | ||
| "mode": "economy" | ||
|
|
||
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 |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| { | ||
| "schema_version": 5, | ||
| "schema_version": 1, | ||
| "profile": { | ||
| "goal": "cost", | ||
| "mode": "robust" | ||
|
|
||
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 |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| { | ||
| "schema_version": 5, | ||
| "schema_version": 1, | ||
| "profile": { | ||
| "goal": "cost-speed", | ||
| "mode": "balanced" | ||
|
|
||
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 |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| { | ||
| "schema_version": 5, | ||
| "schema_version": 1, | ||
| "profile": { | ||
| "goal": "cost-speed", | ||
| "mode": "economy" | ||
|
|
||
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 |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| { | ||
| "schema_version": 5, | ||
| "schema_version": 1, | ||
| "profile": { | ||
| "goal": "cost-speed", | ||
| "mode": "robust" | ||
|
|
||
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,75 @@ | ||
| { | ||
| "$schema": "https://json-schema.org/draft/2020-12/schema", | ||
| "$id": "https://raw.githubusercontent.com/github/gh-aw-firewall/main/containers/router/schemas/routing-table.v1.schema.json", | ||
| "title": "gh-aw-router routing table, schema version 1", | ||
| "description": "One routing table file for one fixed profile. A document that validates against this schema can still be rejected by the router, which also enforces these cross-reference rules: (1) every label cell, 210 in total, appears in exactly one ranking group's applies_to; (2) the first ranking group's choices define the model catalogue, and every other group's choices and classification_choices are permutations of it; (3) no two ranking groups have the same choices, so cells with the same ranking share one group; (4) a model listed with an explicit effort is not also listed without one. Tables loaded together must also share the same repository, catalogue and classification_choices, and serve each profile at most once. This file is frozen once published: a format change adds a new schema file and a new schema_version.", | ||
| "$comment": "Every pattern ends with $(?!\\n) so that validators using Python regular expressions, where $ also matches before a final newline, behave like ECMA-262.", | ||
| "type": "object", | ||
| "additionalProperties": false, | ||
| "required": ["schema_version", "profile", "repository", "classification_choices", "rankings"], | ||
| "properties": { | ||
| "schema_version": { | ||
| "description": "Table format version. Every table includes it.", | ||
| "const": 1 | ||
| }, | ||
| "profile": { | ||
| "description": "The fixed goal and mode this table serves. The request mode auto is not a table profile.", | ||
| "type": "object", | ||
| "additionalProperties": false, | ||
| "required": ["goal", "mode"], | ||
| "properties": { | ||
| "goal": {"enum": ["cost", "cost-speed"]}, | ||
| "mode": {"enum": ["economy", "balanced", "robust"]} | ||
| } | ||
| }, | ||
| "repository": { | ||
| "description": "The repository the rankings were generated for, or global. No leading or trailing whitespace.", | ||
| "type": "string", | ||
| "minLength": 1, | ||
| "pattern": "^(?!\\s)[\\s\\S]*(?<!\\s)$(?!\\n)" | ||
| }, | ||
| "classification_choices": { | ||
| "description": "Model identities in the order to try for the classifier call.", | ||
| "$ref": "#/$defs/modelIdentities" | ||
| }, | ||
| "rankings": { | ||
| "description": "Ranking groups. Each assigns one ranked list of model identities to a set of label cells.", | ||
| "type": "array", | ||
| "minItems": 1, | ||
| "uniqueItems": true, | ||
| "items": {"$ref": "#/$defs/rankingGroup"} | ||
| } | ||
| }, | ||
| "$defs": { | ||
| "rankingGroup": { | ||
| "type": "object", | ||
| "additionalProperties": false, | ||
| "required": ["applies_to", "choices"], | ||
| "properties": { | ||
| "applies_to": { | ||
| "type": "array", | ||
| "minItems": 1, | ||
| "uniqueItems": true, | ||
| "items": {"$ref": "#/$defs/labelKey"} | ||
| }, | ||
| "choices": {"$ref": "#/$defs/modelIdentities"} | ||
| } | ||
| }, | ||
| "modelIdentities": { | ||
| "type": "array", | ||
| "minItems": 1, | ||
| "uniqueItems": true, | ||
| "items": {"$ref": "#/$defs/modelIdentity"} | ||
| }, | ||
| "labelKey": { | ||
| "description": "A label cell as task_type/scope/task_complexity.", | ||
| "type": "string", | ||
| "pattern": "^(explain|plan|fix|refactor|chore|implement|unknown)/(local|multi_file|subsystem|cross_system|unknown)/(trivial|easy|medium|hard|expert|unknown)$(?!\\n)" | ||
| }, | ||
| "modelIdentity": { | ||
| "description": "A provider-qualified model, provider/model, optionally followed by :effort. The model part has exactly one slash, no colon, and no leading or trailing whitespace.", | ||
| "type": "string", | ||
| "pattern": "^[^/:\\s][^/:]*/[^/:]*[^/:\\s](:(none|minimal|low|medium|high|xhigh|max))?$(?!\\n)" | ||
| } | ||
| } | ||
| } | ||
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
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.