config(pi): execute pinned native schema and composer oracles

Evaluate raw Pi documents with the vendored upstream TypeBox schema and replay composer/transport expectations captured by actually executing Pi ab366ebe94cacd419d986be454f12b1b9913aaca.

Bind all 252 canonical fields to successful raw and own-layer composer evidence (70 provider, 92 model, 90 override), fail closed where pinned runtime context is unavailable, expose structured inspection, and enforce module/write/restore boundaries with negative fixtures.
This commit is contained in:
SaladDay
2026-07-31 17:59:35 +00:00
parent 4f78451405
commit 10f2dacbe4
18 changed files with 13595 additions and 1 deletions
+13
View File
@@ -0,0 +1,13 @@
{
"manifestVersion": 1,
"codeAuthority": "src-tauri/src/architecture_tests.rs",
"edges": [
"composer->raw_schema",
"gateway->composer",
"native->composer",
"native->document",
"native->gateway",
"native->model",
"native->raw_schema"
]
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+96
View File
@@ -0,0 +1,96 @@
{
"version": 1,
"pi": {
"repository": "https://github.com/earendil-works/pi.git",
"commit": "ab366ebe94cacd419d986be454f12b1b9913aaca"
},
"typeboxVersion": "1.3.7",
"sources": {
"modelConfig": {
"path": "packages/coding-agent/src/core/model-config.ts",
"sha256": "62141770d675ad6357a72e07354355f0eda29281c0e5be1b48d2360f341c7360"
},
"providerComposer": {
"path": "packages/coding-agent/src/core/provider-composer.ts",
"sha256": "17308a4179b330526eabf6c917fa13e9dbd9ece90d1555b870e87d39b5b60d9d"
},
"resolveConfigValue": {
"path": "packages/coding-agent/src/core/resolve-config-value.ts",
"sha256": "0f53dad47fe5d5d8837c022b7951ccd3bd5a9b577bd662f0986272110e83bcc7"
}
},
"artifacts": {
"provider-schema.snapshot.json": "e498c9f1b344eee1bd3c3ba74d1b648dcb835378cfad92800ec80078b825745c",
"raw-oracle-v1.json": "5aaa37160f96a0fe50867d900ca38c73f13aba769e156a883324368d9dbeeb9a",
"composer-oracle-v1.json": "f7e54bb84e5fd6d50e5762dc304834410fa73ef608c2f9c42475c5983f8e0cf5",
"transport-oracle-v1.json": "b2c816e53b60da5cd6352d2c23934939e9f6dd0077971488fe9dd36fa723e855",
"field-coverage-v1.json": "b8b85e611cf1dbef86c611df185ba8ac2d64160087d0c6e47747f838a0fafe42"
},
"harness": {
"path": "scripts/generate-pi-native-oracle.mjs",
"sha256": "f7a138831284b48ef655ef500a63313f0fc89cf08d319094895027ba4777cc20",
"upstreamEntry": "packages/coding-agent/src/core/provider-composer.ts",
"entryFunctions": [
"composeModelProvider",
"Provider.getModels",
"resolveCompatibilityRequestConfig",
"Provider.auth.apiKey.resolve"
],
"bundler": "esbuild@0.28.1",
"transportShims": {
"pi-ai": "debdf80a40ad2086467c7c3ed6fe43d6167caa85e5bff86e10f28cc36d8fcc53",
"pi-ai/compat": "533cd8f8a242bb25b42db8249abcb539daf30889ea748b5114c177e44c3849d2"
},
"assertion": "expected composer outputs were captured by executing the pinned upstream entry functions; transport shims are unreachable during credential-blind model composition",
"transportResolver": {
"upstreamEntry": "packages/coding-agent/src/core/resolve-config-value.ts",
"entryFunctions": [
"resolveConfigValueOrThrow",
"resolveHeadersOrThrow"
],
"bundler": "esbuild@0.28.1",
"platform": "linux"
}
},
"uncoveredSemantics": [
{
"id": "builtin-overlay-without-pinned-base-catalog",
"unavailableContext": "pinned built-in Provider instance and model catalog",
"rustExpectedStatus": "unknown",
"reasonCode": "catalog_required"
},
{
"id": "extension-overlay-without-extension-registration",
"unavailableContext": "extension ProviderConfigInput and registered model catalog",
"rustExpectedStatus": "unknown",
"reasonCode": "catalog_required"
},
{
"id": "radius-oauth-credential-lifecycle",
"unavailableContext": "interactive Radius login, refresh credentials, and network exchange",
"rustExpectedStatus": "direct_only",
"reasonCode": "missing_gateway_credential"
}
],
"schemaOperatorInventory": [
"anyOf",
"const",
"items",
"minLength",
"patternProperties",
"properties",
"required",
"type"
],
"evaluatorOperatorAllowlist": [
"additionalProperties",
"anyOf",
"const",
"items",
"minLength",
"patternProperties",
"properties",
"required",
"type"
]
}
File diff suppressed because it is too large Load Diff
+723
View File
@@ -0,0 +1,723 @@
{
"version": 1,
"execution": {
"engine": "typebox Value.Check",
"typeboxVersion": "1.3.7",
"schemaTarget": "ModelsConfigSchema.properties.providers.patternProperties['^.*$']"
},
"cases": [
{
"id": "all-schema-fields-valid",
"input": {
"name": "All Fields Provider",
"baseUrl": "https://all-fields.example/v1",
"apiKey": "literal-all-fields-key",
"api": "openai-responses",
"oauth": "radius",
"headers": {
"x-provider-field": "provider-value"
},
"compat": {
"supportsStore": true,
"supportsDeveloperRole": true,
"supportsReasoningEffort": true,
"supportsUsageInStreaming": true,
"maxTokensField": "max_completion_tokens",
"requiresToolResultName": true,
"requiresAssistantAfterToolResult": true,
"requiresThinkingAsText": true,
"requiresReasoningContentOnAssistantMessages": true,
"thinkingFormat": "chat-template",
"chatTemplateKwargs": {
"stringValue": "literal",
"numberValue": 1.25,
"booleanValue": true,
"nullValue": null,
"variableValue": {
"$var": "thinking.effort",
"omitWhenOff": true
}
},
"cacheControlFormat": "anthropic",
"openRouterRouting": {
"allow_fallbacks": true,
"require_parameters": true,
"data_collection": "deny",
"zdr": true,
"enforce_distillable_text": true,
"order": [
"provider-a",
"provider-b"
],
"only": [
"provider-a"
],
"ignore": [
"provider-z"
],
"quantizations": [
"fp8"
],
"sort": {
"by": "price",
"partition": null
},
"max_price": {
"prompt": 1.1,
"completion": "2.2",
"image": 3.3,
"audio": "4.4",
"request": 5.5
},
"preferred_min_throughput": {
"p50": 10.5,
"p75": 9.5,
"p90": 8.5,
"p99": 7.5
},
"preferred_max_latency": {
"p50": 100.5,
"p75": 200.5,
"p90": 300.5,
"p99": 400.5
}
},
"vercelGatewayRouting": {
"only": [
"provider-a"
],
"order": [
"provider-a",
"provider-b"
]
},
"supportsOpenAIGrammarTools": true,
"supportsStrictMode": true,
"sendSessionAffinityHeaders": true,
"deferredToolsMode": "kimi",
"sessionAffinityFormat": "openrouter",
"supportsLongCacheRetention": true,
"supportsToolSearch": true,
"supportsEagerToolInputStreaming": true,
"supportsCacheControlOnTools": true,
"supportsTemperature": true,
"forceAdaptiveThinking": true,
"allowEmptySignature": true,
"supportsStrictTools": true,
"supportsToolReferences": true
},
"authHeader": true,
"models": [
{
"id": "all-fields-model",
"name": "All Fields Model",
"api": "anthropic-messages",
"baseUrl": "https://all-fields-model.example/v1",
"reasoning": true,
"thinkingLevelMap": {
"off": null,
"minimal": "minimal-effort",
"low": "low-effort",
"medium": "medium-effort",
"high": "high-effort",
"xhigh": "xhigh-effort",
"max": "max-effort"
},
"input": [
"text",
"image"
],
"cost": {
"input": 0.11,
"output": 0.22,
"cacheRead": 0.033,
"cacheWrite": 0.044,
"tiers": [
{
"inputTokensAbove": 1000.5,
"input": 0.55,
"output": 0.66,
"cacheRead": 0.077,
"cacheWrite": 0.088
}
]
},
"contextWindow": 128000.5,
"maxTokens": 16384.25,
"headers": {
"x-model-field": "model-value"
},
"compat": {
"supportsStore": true,
"supportsDeveloperRole": true,
"supportsReasoningEffort": true,
"supportsUsageInStreaming": true,
"maxTokensField": "max_completion_tokens",
"requiresToolResultName": true,
"requiresAssistantAfterToolResult": true,
"requiresThinkingAsText": true,
"requiresReasoningContentOnAssistantMessages": true,
"thinkingFormat": "chat-template",
"chatTemplateKwargs": {
"stringValue": "literal",
"numberValue": 1.25,
"booleanValue": true,
"nullValue": null,
"variableValue": {
"$var": "thinking.effort",
"omitWhenOff": true
}
},
"cacheControlFormat": "anthropic",
"openRouterRouting": {
"allow_fallbacks": true,
"require_parameters": true,
"data_collection": "deny",
"zdr": true,
"enforce_distillable_text": true,
"order": [
"provider-a",
"provider-b"
],
"only": [
"provider-a"
],
"ignore": [
"provider-z"
],
"quantizations": [
"fp8"
],
"sort": {
"by": "price",
"partition": null
},
"max_price": {
"prompt": 1.1,
"completion": "2.2",
"image": 3.3,
"audio": "4.4",
"request": 5.5
},
"preferred_min_throughput": {
"p50": 10.5,
"p75": 9.5,
"p90": 8.5,
"p99": 7.5
},
"preferred_max_latency": {
"p50": 100.5,
"p75": 200.5,
"p90": 300.5,
"p99": 400.5
}
},
"vercelGatewayRouting": {
"only": [
"provider-a"
],
"order": [
"provider-a",
"provider-b"
]
},
"supportsOpenAIGrammarTools": true,
"supportsStrictMode": true,
"sendSessionAffinityHeaders": true,
"deferredToolsMode": "kimi",
"sessionAffinityFormat": "openrouter",
"supportsLongCacheRetention": true,
"supportsToolSearch": true,
"supportsEagerToolInputStreaming": true,
"supportsCacheControlOnTools": true,
"supportsTemperature": true,
"forceAdaptiveThinking": true,
"allowEmptySignature": true,
"supportsStrictTools": true,
"supportsToolReferences": true
}
}
],
"modelOverrides": {
"all-fields-model": {
"name": "All Fields Override",
"reasoning": false,
"thinkingLevelMap": {
"off": null,
"minimal": "minimal-effort",
"low": "low-effort",
"medium": "medium-effort",
"high": "high-effort",
"xhigh": "xhigh-effort",
"max": "max-effort"
},
"input": [
"image",
"text"
],
"cost": {
"input": 0.11,
"output": 0.22,
"cacheRead": 0.033,
"cacheWrite": 0.044,
"tiers": [
{
"inputTokensAbove": 1000.5,
"input": 0.55,
"output": 0.66,
"cacheRead": 0.077,
"cacheWrite": 0.088
}
]
},
"contextWindow": 256000.75,
"maxTokens": 32768.5,
"headers": {
"x-override-field": "override-value"
},
"compat": {
"supportsStore": true,
"supportsDeveloperRole": true,
"supportsReasoningEffort": true,
"supportsUsageInStreaming": true,
"maxTokensField": "max_completion_tokens",
"requiresToolResultName": true,
"requiresAssistantAfterToolResult": true,
"requiresThinkingAsText": true,
"requiresReasoningContentOnAssistantMessages": true,
"thinkingFormat": "chat-template",
"chatTemplateKwargs": {
"stringValue": "literal",
"numberValue": 1.25,
"booleanValue": true,
"nullValue": null,
"variableValue": {
"$var": "thinking.effort",
"omitWhenOff": true
}
},
"cacheControlFormat": "anthropic",
"openRouterRouting": {
"allow_fallbacks": true,
"require_parameters": true,
"data_collection": "deny",
"zdr": true,
"enforce_distillable_text": true,
"order": [
"provider-a",
"provider-b"
],
"only": [
"provider-a"
],
"ignore": [
"provider-z"
],
"quantizations": [
"fp8"
],
"sort": {
"by": "price",
"partition": null
},
"max_price": {
"prompt": 1.1,
"completion": "2.2",
"image": 3.3,
"audio": "4.4",
"request": 5.5
},
"preferred_min_throughput": {
"p50": 10.5,
"p75": 9.5,
"p90": 8.5,
"p99": 7.5
},
"preferred_max_latency": {
"p50": 100.5,
"p75": 200.5,
"p90": 300.5,
"p99": 400.5
}
},
"vercelGatewayRouting": {
"only": [
"provider-a"
],
"order": [
"provider-a",
"provider-b"
]
},
"supportsOpenAIGrammarTools": true,
"supportsStrictMode": true,
"sendSessionAffinityHeaders": true,
"deferredToolsMode": "kimi",
"sessionAffinityFormat": "openrouter",
"supportsLongCacheRetention": true,
"supportsToolSearch": true,
"supportsEagerToolInputStreaming": true,
"supportsCacheControlOnTools": true,
"supportsTemperature": true,
"forceAdaptiveThinking": true,
"allowEmptySignature": true,
"supportsStrictTools": true,
"supportsToolReferences": true
}
}
}
},
"expectedValid": true
},
{
"id": "empty-provider-object",
"input": {},
"expectedValid": true
},
{
"id": "null-provider",
"input": null,
"expectedValid": false
},
{
"id": "additional-provider-property",
"input": {
"futureProviderField": {
"nested": true
}
},
"expectedValid": true
},
{
"id": "empty-present-base-url",
"input": {
"baseUrl": ""
},
"expectedValid": false
},
{
"id": "non-url-base-url-is-raw-string",
"input": {
"baseUrl": "not a URL"
},
"expectedValid": true
},
{
"id": "radius-oauth",
"input": {
"oauth": "radius"
},
"expectedValid": true
},
{
"id": "unknown-oauth-literal",
"input": {
"oauth": "other"
},
"expectedValid": false
},
{
"id": "models-null",
"input": {
"models": null
},
"expectedValid": false
},
{
"id": "model-missing-id",
"input": {
"models": [
{
"api": "openai-responses"
}
]
},
"expectedValid": false
},
{
"id": "model-empty-id",
"input": {
"models": [
{
"id": ""
}
]
},
"expectedValid": false
},
{
"id": "integer-model-numbers",
"input": {
"models": [
{
"id": "integer",
"contextWindow": 128000,
"maxTokens": 16384
}
]
},
"expectedValid": true
},
{
"id": "fractional-model-numbers",
"input": {
"models": [
{
"id": "fractional",
"contextWindow": 128000.5,
"maxTokens": 16384.25
}
]
},
"expectedValid": true
},
{
"id": "negative-number-is-still-typebox-number",
"input": {
"models": [
{
"id": "negative",
"maxTokens": -1.5
}
]
},
"expectedValid": true
},
{
"id": "string-is-not-number",
"input": {
"models": [
{
"id": "string-limit",
"maxTokens": "16384"
}
]
},
"expectedValid": false
},
{
"id": "complete-cost-with-fractions",
"input": {
"models": [
{
"id": "priced",
"cost": {
"input": 0.1,
"output": 0.2,
"cacheRead": 0.03,
"cacheWrite": 0.04,
"tiers": [
{
"inputTokensAbove": 1000.5,
"input": 0.5,
"output": 0.6,
"cacheRead": 0.07,
"cacheWrite": 0.08
}
]
}
}
]
},
"expectedValid": true
},
{
"id": "incomplete-model-cost",
"input": {
"models": [
{
"id": "priced",
"cost": {
"input": 0.1,
"output": 0.2,
"cacheRead": 0.03
}
}
]
},
"expectedValid": false
},
{
"id": "compat-openrouter-recursive-valid",
"input": {
"compat": {
"thinkingFormat": "chat-template",
"chatTemplateKwargs": {
"temperature": 0.25,
"thinking": {
"$var": "thinking.effort",
"omitWhenOff": true
},
"nullable": null
},
"openRouterRouting": {
"data_collection": "deny",
"sort": {
"by": "price",
"partition": null
},
"max_price": {
"prompt": 1.5,
"completion": "2.0"
},
"preferred_min_throughput": {
"p50": 10.5,
"p99": 2
}
}
}
},
"expectedValid": true
},
{
"id": "compat-nested-union-invalid-in-every-branch",
"input": {
"compat": {
"openRouterRouting": {
"preferred_min_throughput": {
"p50": "fast"
}
},
"supportsToolSearch": "yes",
"supportsTemperature": 1
}
},
"expectedValid": false
},
{
"id": "compat-union-additional-field",
"input": {
"compat": {
"futureCompatField": [
1,
2,
3
]
}
},
"expectedValid": true
},
{
"id": "compat-null",
"input": {
"compat": null
},
"expectedValid": false
},
{
"id": "thinking-map-unknown-key-and-string-value",
"input": {
"models": [
{
"id": "thinking",
"thinkingLevelMap": {
"low": null,
"max": "future-effort",
"future": {
"nested": true
}
}
}
]
},
"expectedValid": true
},
{
"id": "thinking-map-known-key-invalid-value",
"input": {
"models": [
{
"id": "thinking",
"thinkingLevelMap": {
"low": 2
}
}
]
},
"expectedValid": false
},
{
"id": "compat-sort-string-union-branch",
"input": {
"compat": {
"openRouterRouting": {
"sort": "price"
}
}
},
"expectedValid": true
},
{
"id": "compat-sort-object-union-branch",
"input": {
"compat": {
"openRouterRouting": {
"sort": {
"by": "price",
"partition": null
}
}
}
},
"expectedValid": true
},
{
"id": "compat-sort-invalid-union-boundary",
"input": {
"compat": {
"openRouterRouting": {
"sort": false
}
}
},
"expectedValid": true
},
{
"id": "headers-record-valid",
"input": {
"headers": {
"Authorization": "Bearer literal",
"x-count": "2"
}
},
"expectedValid": true
},
{
"id": "headers-record-invalid-value",
"input": {
"headers": {
"x-count": 2
}
},
"expectedValid": false
},
{
"id": "model-override-fractional-and-extra",
"input": {
"modelOverrides": {
"model/a": {
"contextWindow": 10.5,
"maxTokens": 2.25,
"futureOverrideField": true
}
}
},
"expectedValid": true
},
{
"id": "input-union-invalid",
"input": {
"models": [
{
"id": "input",
"input": [
"text",
"audio"
]
}
]
},
"expectedValid": false
}
]
}
@@ -0,0 +1,82 @@
{
"version": 1,
"piCommit": "ab366ebe94cacd419d986be454f12b1b9913aaca",
"engine": "pinned upstream TypeScript",
"bundler": "esbuild@0.28.1",
"upstreamEntry": "packages/coding-agent/src/core/resolve-config-value.ts",
"platform": "linux",
"cases": [
{
"id": "literal-value",
"input": "literal-secret",
"environment": {},
"execution": {
"status": "success",
"entryFunction": "resolveConfigValueOrThrow"
},
"expected": "literal-secret"
},
{
"id": "environment-template",
"input": "prefix-${PI_ORACLE_VALUE}-suffix",
"environment": {
"PI_ORACLE_VALUE": "environment-secret"
},
"execution": {
"status": "success",
"entryFunction": "resolveConfigValueOrThrow"
},
"expected": "prefix-environment-secret-suffix"
},
{
"id": "escaped-dollar-and-bang",
"input": "$$literal-$!bang",
"environment": {},
"execution": {
"status": "success",
"entryFunction": "resolveConfigValueOrThrow"
},
"expected": "$literal-!bang"
},
{
"id": "shell-command",
"input": "!printf pi-command-value",
"environment": {},
"execution": {
"status": "success",
"entryFunction": "resolveConfigValueOrThrow"
},
"expected": "pi-command-value"
},
{
"id": "missing-environment",
"input": "${PI_ORACLE_MISSING}",
"environment": {},
"execution": {
"status": "error",
"entryFunction": "resolveConfigValueOrThrow"
},
"expectedError": "Failed to resolve oracle missing-environment from environment variable: PI_ORACLE_MISSING"
}
],
"headerCase": {
"id": "provider-header-materialization",
"input": {
"x-literal": "literal-header",
"x-environment": "${PI_ORACLE_HEADER}",
"x-command": "!printf pi-command-header"
},
"environment": {
"PI_ORACLE_HEADER": "environment-header"
},
"execution": {
"status": "success",
"entryFunction": "resolveHeadersOrThrow"
},
"expected": {
"x-literal": "literal-header",
"x-environment": "environment-header",
"x-command": "pi-command-header"
}
}
}