From ee3ac1b5acb09242d421ebddbe9c8c010a9f92c0 Mon Sep 17 00:00:00 2001 From: Postil Maintainer Date: Thu, 19 Nov 2026 11:23:03 +0000 Subject: [PATCH 1/8] fix: review metadata changes with GPT-6 Luna defaults --- Cargo.lock | 2 +- Cargo.toml | 2 +- bench/src/scorer-eval.test.ts | 4 +- bench/src/verify-admission.test.ts | 14 ++-- config.toml | 6 +- docs/model-providers.md | 2 +- provisional-models-eu.json | 8 +-- provisional-models-us.json | 8 +-- provisional-models.json | 8 +-- qualified-models.json | 2 +- src/config.rs | 20 +++--- src/diff.rs | 29 +++++++- src/forge/azure.rs | 103 +++++++++++++++++++++++++++++ src/llm.rs | 4 ++ tests/e2e.rs | 26 ++++---- 15 files changed, 186 insertions(+), 52 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c012401..e233e4a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1358,7 +1358,7 @@ checksum = "05c8b63e8d9609db387f0324918f81d68fe27748f084ef092fb35954d0539a85" [[package]] name = "postil-cli" -version = "0.9.21" +version = "0.9.22" dependencies = [ "aho-corasick", "anyhow", diff --git a/Cargo.toml b/Cargo.toml index 2d26b48..d80463b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "postil-cli" -version = "0.9.21" +version = "0.9.22" edition = "2024" description = "Postil: a low-noise AI review gate. Silent on clean PRs, hard gate on real risk." license = "Apache-2.0" diff --git a/bench/src/scorer-eval.test.ts b/bench/src/scorer-eval.test.ts index 7be962f..31a34a3 100644 --- a/bench/src/scorer-eval.test.ts +++ b/bench/src/scorer-eval.test.ts @@ -431,8 +431,8 @@ describe("parseModels", () => { test("uses the embedded Luna scorer qualification candidate", async () => { const defaults = await loadEmbeddedScorerDefaults(); expect(defaults.enabled).toBe(true); - expect(defaults.qualification_candidates).toEqual(["openai/gpt-5.6-luna"]); - expect(parseModels(undefined, defaults.qualification_candidates)).toEqual(["openai/gpt-5.6-luna"]); + expect(defaults.qualification_candidates).toEqual(["openai/gpt-6-luna"]); + expect(parseModels(undefined, defaults.qualification_candidates)).toEqual(["openai/gpt-6-luna"]); }); }); diff --git a/bench/src/verify-admission.test.ts b/bench/src/verify-admission.test.ts index c97436f..5ba6b88 100644 --- a/bench/src/verify-admission.test.ts +++ b/bench/src/verify-admission.test.ts @@ -52,12 +52,12 @@ describe("admission attestation verification", () => { providerGenerationModels: Record; modelPriceBounds: Array<{ model: string }>; }; - expect(profile.generatorChain).toEqual(["openai/gpt-5.6-luna"]); - expect(profile.scorerChain).toEqual(["openai/gpt-5.6-luna"]); + expect(profile.generatorChain).toEqual(["openai/gpt-6-luna"]); + expect(profile.scorerChain).toEqual(["openai/gpt-6-luna"]); expect(profile.providerGenerationModels).toEqual({ - "openai/gpt-5.6-luna": "openai/gpt-5.6-luna-20260709", + "openai/gpt-6-luna": "openai/gpt-6-luna-20260922", }); - expect(profile.modelPriceBounds.map((bound) => bound.model)).toEqual(["openai/gpt-5.6-luna"]); + expect(profile.modelPriceBounds.map((bound) => bound.model)).toEqual(["openai/gpt-6-luna"]); expect(await verifyProvisionalRelease( join(repositoryRoot, "qualified-models.json"), join(repositoryRoot, "config.toml"), @@ -108,7 +108,7 @@ describe("admission attestation verification", () => { ["scorerChain", "scorer chain must not repeat models"], ] as const) { const profile = structuredClone(baseline); - profile[field] = ["openai/gpt-5.6-luna", "openai/gpt-5.6-luna"]; + profile[field] = ["openai/gpt-6-luna", "openai/gpt-6-luna"]; await writeFile(profilePath, JSON.stringify(profile)); await expect(verifyProvisionalRelease(manifest, config, profilePath)).rejects.toThrow(message); } @@ -145,7 +145,7 @@ describe("admission attestation verification", () => { await readFile(join(repositoryRoot, "provisional-models.json"), "utf8"), ) as { providerGenerationModels: Record }; - profile.providerGenerationModels["openai/gpt-5.6-luna"] = "openai/gpt-5.6-luna"; + profile.providerGenerationModels["openai/gpt-6-luna"] = "openai/gpt-6-luna"; await writeFile(profilePath, JSON.stringify(profile)); await expect(verifyProvisionalRelease(manifest, config, profilePath)).rejects.toThrow( "generation identities must be distinct from logical model IDs", @@ -205,7 +205,7 @@ describe("admission attestation verification", () => { // embedded-default comparison instead of failing an earlier bound check. altered.modelPriceBounds.push({ ...altered.modelPriceBounds[0]!, model: "other/model" }); expect(altered.modelPriceBounds.map((bound) => bound.model)).toEqual([ - "openai/gpt-5.6-luna", + "openai/gpt-6-luna", "other/model", ]); await writeFile(profile, JSON.stringify(altered)); diff --git a/config.toml b/config.toml index 2e26e05..23b88b7 100644 --- a/config.toml +++ b/config.toml @@ -1,5 +1,5 @@ version = 3 -default_model = "openai/gpt-5.6-luna" +default_model = "openai/gpt-6-luna" reasoning_effort = "low" cascade = [] consensus = 1 @@ -8,7 +8,7 @@ api_format = "openai-compatible" [scorer] enabled = true -default_model = "openai/gpt-5.6-luna" +default_model = "openai/gpt-6-luna" reasoning_effort = "low" fallback = "" -qualification_candidates = ["openai/gpt-5.6-luna"] +qualification_candidates = ["openai/gpt-6-luna"] diff --git a/docs/model-providers.md b/docs/model-providers.md index 8fc5dc7..42be864 100644 --- a/docs/model-providers.md +++ b/docs/model-providers.md @@ -4,7 +4,7 @@ Postil speaks either an OpenAI-compatible chat-completions interface or the nati ## Model admission -Local review defaults to the embedded `openai/gpt-5.6-luna` reviewer with no fallback chain or scorer, so no model setting is required. Reviewer requests use `low` reasoning effort. Local scoring is disabled unless `REVIEW_SCORER_MODEL` names a scorer. The embedded hosted scorer candidate is `openai/gpt-5.6-luna` at `low` effort. `postil models` reports these roles, the accepted endpoint model-ID contracts, embedded qualification status, accepted effort values, and exact `postil doctor` and override commands without reading credentials or contacting a provider. Local use has no fixed model-ID allowlist: Postil passes a non-empty model ID unchanged to the configured OpenAI-compatible or native Anthropic endpoint. Endpoint protocol compatibility does not imply hosted qualification. Hosted deployments admit only complete qualified profiles. `REVIEW_SCORER_MODEL_CASCADE` accepts one qualified scorer fallback. +Local review defaults to the embedded `openai/gpt-6-luna` reviewer with no fallback chain or scorer, so no model setting is required. Reviewer requests use `low` reasoning effort. Local scoring is disabled unless `REVIEW_SCORER_MODEL` names a scorer. The embedded hosted scorer candidate is `openai/gpt-6-luna` at `low` effort. `postil models` reports these roles, the accepted endpoint model-ID contracts, embedded qualification status, accepted effort values, and exact `postil doctor` and override commands without reading credentials or contacting a provider. Local use has no fixed model-ID allowlist: Postil passes a non-empty model ID unchanged to the configured OpenAI-compatible or native Anthropic endpoint. Endpoint protocol compatibility does not imply hosted qualification. Hosted deployments admit only complete qualified profiles. `REVIEW_SCORER_MODEL_CASCADE` accepts one qualified scorer fallback. With local scoring disabled, adjudication can exclude an unchanged defect unrelated to the reviewed changes; that exclusion has no independent scorer assessment. With scoring enabled, such an exclusion also requires a complete independent score below `minConfidence`. A conflicting score or incomplete scoring fails the review instead of excluding the finding. Setting `minConfidence` to zero prevents this scored exclusion. diff --git a/provisional-models-eu.json b/provisional-models-eu.json index f1fa9fc..e1f2f15 100644 --- a/provisional-models-eu.json +++ b/provisional-models-eu.json @@ -4,15 +4,15 @@ "upstreamProviderRoute": "azure/eu", "apiBase": "https://openrouter.ai:443/api/v1", "apiFormat": "openai-compatible", - "generatorChain": ["openai/gpt-5.6-luna"], + "generatorChain": ["openai/gpt-6-luna"], "consensus": 1, - "scorerChain": ["openai/gpt-5.6-luna"], + "scorerChain": ["openai/gpt-6-luna"], "providerGenerationModels": { - "openai/gpt-5.6-luna": "openai/gpt-5.6-luna-20260709" + "openai/gpt-6-luna": "openai/gpt-6-luna-20260922" }, "modelPriceBounds": [ { - "model": "openai/gpt-5.6-luna", + "model": "openai/gpt-6-luna", "inputMicrosPerMillionTokens": 220000, "outputMicrosPerMillionTokens": 1320000 } diff --git a/provisional-models-us.json b/provisional-models-us.json index ae5ed97..a1dc7a7 100644 --- a/provisional-models-us.json +++ b/provisional-models-us.json @@ -4,15 +4,15 @@ "upstreamProviderRoute": "azure/us", "apiBase": "https://openrouter.ai:443/api/v1", "apiFormat": "openai-compatible", - "generatorChain": ["openai/gpt-5.6-luna"], + "generatorChain": ["openai/gpt-6-luna"], "consensus": 1, - "scorerChain": ["openai/gpt-5.6-luna"], + "scorerChain": ["openai/gpt-6-luna"], "providerGenerationModels": { - "openai/gpt-5.6-luna": "openai/gpt-5.6-luna-20260709" + "openai/gpt-6-luna": "openai/gpt-6-luna-20260922" }, "modelPriceBounds": [ { - "model": "openai/gpt-5.6-luna", + "model": "openai/gpt-6-luna", "inputMicrosPerMillionTokens": 220000, "outputMicrosPerMillionTokens": 1320000 } diff --git a/provisional-models.json b/provisional-models.json index f1fa9fc..e1f2f15 100644 --- a/provisional-models.json +++ b/provisional-models.json @@ -4,15 +4,15 @@ "upstreamProviderRoute": "azure/eu", "apiBase": "https://openrouter.ai:443/api/v1", "apiFormat": "openai-compatible", - "generatorChain": ["openai/gpt-5.6-luna"], + "generatorChain": ["openai/gpt-6-luna"], "consensus": 1, - "scorerChain": ["openai/gpt-5.6-luna"], + "scorerChain": ["openai/gpt-6-luna"], "providerGenerationModels": { - "openai/gpt-5.6-luna": "openai/gpt-5.6-luna-20260709" + "openai/gpt-6-luna": "openai/gpt-6-luna-20260922" }, "modelPriceBounds": [ { - "model": "openai/gpt-5.6-luna", + "model": "openai/gpt-6-luna", "inputMicrosPerMillionTokens": 220000, "outputMicrosPerMillionTokens": 1320000 } diff --git a/qualified-models.json b/qualified-models.json index e6c6cf7..22ff7f8 100644 --- a/qualified-models.json +++ b/qualified-models.json @@ -4,6 +4,6 @@ "qualificationIssuedAtUnixSeconds": null, "qualificationExpiresAtUnixSeconds": null, "qualificationMaxAgeDays": null, - "modelDefaultsSha256": "535d68cf62ce90c0fa11451a5411f7f358ba73b989c1559a1374357c1384697f", + "modelDefaultsSha256": "964e8fc8b26729d22d500584e4a27811ac6d189101d27e6dc282732ff9a5e810", "profiles": [] } diff --git a/src/config.rs b/src/config.rs index 09aa5fa..69be88a 100644 --- a/src/config.rs +++ b/src/config.rs @@ -2716,7 +2716,7 @@ scorer = { enabled = true, default_model = "provider/scorer", reasoning_effort = let readme = include_str!("../README.md"); assert!(readme.contains("docs/model-providers.md")); let provider_guide = include_str!("../docs/model-providers.md"); - assert!(provider_guide.contains("openai/gpt-5.6-luna")); + assert!(provider_guide.contains("openai/gpt-6-luna")); assert!(provider_guide.contains("postil models")); assert!(provider_guide.contains("reasoning.effort")); assert!(provider_guide.contains("`minimal`")); @@ -3921,15 +3921,15 @@ scorer = { enabled = true, default_model = "provider/scorer", reasoning_effort = #[test] fn hosted_candidate_matches_the_qualification_profile() { let defaults = model_defaults(); - assert_eq!(defaults.default_model, "openai/gpt-5.6-luna"); + assert_eq!(defaults.default_model, "openai/gpt-6-luna"); assert!(defaults.cascade.is_empty()); assert!(defaults.scorer_enabled); - assert_eq!(defaults.scorer_model, "openai/gpt-5.6-luna"); + assert_eq!(defaults.scorer_model, "openai/gpt-6-luna"); assert_eq!(defaults.scorer_reasoning_effort, ReasoningEffort::Low); assert!(defaults.scorer_fallback.is_empty()); assert_eq!( defaults.scorer_qualification_candidates, - vec!["openai/gpt-5.6-luna"] + vec!["openai/gpt-6-luna"] ); } @@ -3979,13 +3979,13 @@ scorer = { enabled = true, default_model = "provider/scorer", reasoning_effort = .all(|byte| byte.is_ascii_digit() || (b'a'..=b'f').contains(&byte)) ); assert_eq!(profile.upstream_provider_route, "azure/eu"); - assert_eq!(profile.generator_chain, vec!["openai/gpt-5.6-luna"]); - assert_eq!(profile.scorer_chain, vec!["openai/gpt-5.6-luna"]); + assert_eq!(profile.generator_chain, vec!["openai/gpt-6-luna"]); + assert_eq!(profile.scorer_chain, vec!["openai/gpt-6-luna"]); assert_eq!( profile.provider_generation_models, std::collections::BTreeMap::from([( - "openai/gpt-5.6-luna".to_string(), - "openai/gpt-5.6-luna-20260709".to_string(), + "openai/gpt-6-luna".to_string(), + "openai/gpt-6-luna-20260922".to_string(), )]) ); let drifted = Config { @@ -3997,7 +3997,7 @@ scorer = { enabled = true, default_model = "provider/scorer", reasoning_effort = assert_eq!( profile.model_price_bounds, vec![ModelPriceBound { - model: "openai/gpt-5.6-luna".to_string(), + model: "openai/gpt-6-luna".to_string(), input_micros_per_million_tokens: 220_000, output_micros_per_million_tokens: 1_320_000, }] @@ -4149,7 +4149,7 @@ scorer = { enabled = true, default_model = "provider/scorer", reasoning_effort = fn provisional_hosted_profile_rejects_logical_provider_generation_aliases() { let mut profile: serde_json::Value = serde_json::from_str(PROVISIONAL_MODELS_JSON).unwrap(); profile["providerGenerationModels"] = serde_json::json!({ - "openai/gpt-5.6-luna": "openai/gpt-5.6-luna" + "openai/gpt-6-luna": "openai/gpt-6-luna" }); assert!( parse_provisional_hosted_profile(&profile.to_string()) diff --git a/src/diff.rs b/src/diff.rs index 519dfdf..aa1e2d8 100644 --- a/src/diff.rs +++ b/src/diff.rs @@ -4116,12 +4116,23 @@ fn section_paths(section: &str, require_complete_hunks: bool) -> Result {} _ => anyhow::bail!("diff section has an incomplete file path marker pair"), } + if require_complete_hunks { + let marker_change = match (&old_marker, &new_marker) { + (Some(DiffMarkerPath::Null), Some(DiffMarkerPath::Path(_))) + | (Some(DiffMarkerPath::Path(_)), Some(DiffMarkerPath::Null)) => true, + (Some(DiffMarkerPath::Path(old)), Some(DiffMarkerPath::Path(new))) => old != new, + _ => false, + }; + anyhow::ensure!( + saw_change || marker_change, + "diff section has no complete change evidence" + ); + } match (&rename_from, &rename_to) { (None, None) | (Some(_), Some(_)) => {} _ => anyhow::bail!("diff section has an incomplete rename path pair"), @@ -7337,6 +7348,22 @@ diff --git a/src/multi.rs b/src/multi.rs } } + #[test] + fn marker_only_evidence_keeps_incomplete_or_conflicting_sections_closed() { + let cases = [ + "diff --git a/src/a.rs b/src/a.rs\n", + "diff --git a/src/a.rs b/src/a.rs\n--- a/src/a.rs\n+++ b/src/a.rs\n", + "diff --git a/src/a.rs b/src/a.rs\n--- /dev/null\n+++ /dev/null\n", + "diff --git a/src/a.rs b/src/b.rs\n--- a/src/other.rs\n+++ b/src/b.rs\n", + "diff --git a/src/a.rs b/src/b.rs\n--- a/src/a.rs\n+++ b/src/b.rs\n@@ -1 +1 @@\n-old\n", + ]; + for source in cases { + let snapshot = DiffSnapshot::from_bytes(source.as_bytes()).unwrap(); + assert!(prepare_review(&snapshot).is_err(), "accepted {source}"); + assert!(!parse(source).complete, "parsed {source}"); + } + } + #[test] fn rename_is_ignored_only_when_both_paths_match() { let source = "diff --git a/src/auth/permission.ts b/generated/permission.ts\nsimilarity index 100%\nrename from src/auth/permission.ts\nrename to generated/permission.ts\n"; diff --git a/src/forge/azure.rs b/src/forge/azure.rs index 8aa2cee..85a698b 100644 --- a/src/forge/azure.rs +++ b/src/forge/azure.rs @@ -891,6 +891,109 @@ mod tests { assert!(index.contains("src/a.rs", 2)); } + #[test] + fn shared_writer_metadata_only_sections_prepare_with_all_paths() { + let cases = [ + ("src/added.rs", "src/added.rs", "", "", true, false), + ("src/deleted.rs", "src/deleted.rs", "", "", false, true), + ( + "src/old.rs", + "src/new.rs", + "unchanged\n", + "unchanged\n", + false, + false, + ), + ]; + let mut source = String::new(); + for (old_path, new_path, old, new, is_add, is_delete) in cases { + let section = diff_section(old_path, new_path, old, new, is_add, is_delete); + assert!(!section.contains("@@"), "expected marker-only section"); + source.push_str(§ion); + } + let snapshot = diff::DiffSnapshot::from_bytes(source.as_bytes()).unwrap(); + let mut prepared = diff::prepare_review(&snapshot).unwrap(); + assert!(prepared.index.is_complete()); + assert!(prepared.has_source); + assert_eq!( + prepared.next_window().unwrap().as_deref(), + Some(source.as_str()) + ); + assert!(prepared.next_window().unwrap().is_none()); + let parsed = diff::parse(&source); + assert!(parsed.complete); + assert_eq!(parsed.files.len(), cases.len()); + for (file, (old_path, new_path, ..)) in parsed.files.iter().zip(cases) { + assert_eq!(file.old_path, old_path); + assert_eq!(file.path, new_path); + } + } + + #[test] + fn generated_marker_sections_preserve_paths_and_reject_partial_reviews() { + let mut sections = Vec::new(); + for path in ["src/plain.rs", "src/sp ace.rs", "src/quo\"te.rs"] { + for (old_path, new_path, old, new, add, delete) in [ + (path, path, "", "", true, false), + (path, path, "", "", false, true), + (path, "src/new.rs", "same\n", "same\n", false, false), + ] { + let section = diff_section(old_path, new_path, old, new, add, delete); + assert!(!section.contains("@@")); + sections.push((section, old_path, new_path)); + } + } + sections.push(( + "diff --git a/src/old b/name.rs b/src/new b/name.rs\n--- a/src/old b/name.rs\n+++ b/src/new b/name.rs\n".to_string(), + "src/old b/name.rs", + "src/new b/name.rs", + )); + for shift in [0, 1, sections.len() - 1] { + let ordered = (0..sections.len()) + .map(|i| §ions[(i + shift) % sections.len()]) + .collect::>(); + let source = ordered + .iter() + .map(|entry| entry.0.as_str()) + .collect::(); + let snapshot = diff::DiffSnapshot::from_bytes(source.as_bytes()).unwrap(); + let mut prepared = diff::prepare_review(&snapshot).unwrap(); + assert!(prepared.index.is_complete() && prepared.has_source); + assert_eq!( + prepared.next_window().unwrap().as_deref(), + Some(source.as_str()) + ); + let parsed = diff::parse(&source); + assert!(parsed.complete); + for (file, (_, old, new)) in parsed.files.iter().zip(ordered) { + assert_eq!((&*file.old_path, &*file.path), (*old, *new)); + } + assert_eq!(parsed.files.len(), sections.len()); + } + + let prefix = diff_section("src/valid.rs", "src/valid.rs", "", "", true, false); + for path in ["src/plain.rs", "src/sp ace.rs", "src/quo\"te.rs"] { + let valid = diff_section(path, path, "", "", true, false); + let marker = format!("+++ {}", diff::display_path(&format!("b/{path}"))); + for invalid in [ + diff_section(path, path, "same\n", "same\n", false, false), + valid.replace(&marker, "+++ /dev/null"), + valid.replace(&marker, "+++ b/src/other.rs"), + valid.replace(&format!("{marker}\n"), ""), + format!("{valid}@@ -1 +1 @@\n-old\n"), + ] { + for source in [invalid.clone(), format!("{prefix}{invalid}")] { + let snapshot = diff::DiffSnapshot::from_bytes(source.as_bytes()).unwrap(); + assert!( + diff::prepare_review(&snapshot).is_err(), + "accepted {source}" + ); + assert!(!diff::parse(&source).complete, "parsed {source}"); + } + } + } + } + #[test] fn added_file_uses_dev_null_base() { let section = unified_file_diff("new.rs", "new.rs", "", "a\nb\n", true, false); diff --git a/src/llm.rs b/src/llm.rs index 5a67ed9..b7c2229 100644 --- a/src/llm.rs +++ b/src/llm.rs @@ -693,6 +693,7 @@ pub(crate) fn conservative_context_tokens(model: &str) -> usize { | "moonshotai/kimi-k2.7-code" | "openai/gpt-5-mini" | "openai/gpt-5.6-luna" + | "openai/gpt-6-luna" | "mistralai/mistral-small-3.2-24b-instruct" => 128_000, // Unknown BYOK endpoints get a conservative floor rather than an // optimistic provider-specific assumption. @@ -7201,6 +7202,9 @@ mod tests { 128_000 ); assert_eq!(conservative_context_tokens("openai/gpt-5-mini"), 128_000); + assert_eq!(conservative_context_tokens("openai/gpt-6-luna"), 128_000); + assert_eq!(conservative_context_tokens(" OPENAI/GPT-6-LUNA "), 128_000); + assert_eq!(conservative_context_tokens("openai/gpt-6-luna-spoof"), 32_000); assert_eq!( conservative_context_tokens("mistralai/mistral-small-3.2-24b-instruct"), 128_000 diff --git a/tests/e2e.rs b/tests/e2e.rs index dfa187e..0aeeb94 100644 --- a/tests/e2e.rs +++ b/tests/e2e.rs @@ -2566,7 +2566,7 @@ async fn routed_http_200_errors_log_each_attempt_without_exposing_response_conte .await; if recover { let mut response = llm_content(json!([])); - response["model"] = json!("openai/gpt-5.6-luna"); + response["model"] = json!("openai/gpt-6-luna"); response["provider"] = json!("Azure"); Mock::given(method("POST")) .and(path("/chat/completions")) @@ -2881,7 +2881,7 @@ async fn hosted_source_coverage_extends_beyond_three_waves_without_raising_hard_ .and(path("/chat/completions")) .respond_with(|_: &Request| { let mut response = llm_content(json!([])); - response["model"] = json!("openai/gpt-5.6-luna"); + response["model"] = json!("openai/gpt-6-luna"); response["provider"] = json!("Azure"); ResponseTemplate::new(200).set_body_json(response) }) @@ -4147,7 +4147,7 @@ async fn hosted_pending_refutation_failure_preserves_the_strict_blocker() { "title": "Validate query input", "body": "The query executes unvalidated input.", "evidence": "exec_query(&token);" }])) }; - response["model"] = json!("openai/gpt-5.6-luna"); + response["model"] = json!("openai/gpt-6-luna"); response["provider"] = json!("Azure"); ResponseTemplate::new(200).set_body_json(response) }).with_priority(1).mount(&server).await; @@ -7168,7 +7168,7 @@ fn hosted_config_ignores_repository_model_provider_and_scorer() { assert!(stdout.contains("model.name: ")); assert!(stdout.contains("model.cascade: []")); assert!(stdout.contains("model.scorer: ")); - assert!(!stdout.contains("model.scorer: openai/gpt-5.6-luna")); + assert!(!stdout.contains("model.scorer: openai/gpt-6-luna")); assert!(stdout.contains("model.reasoningEffort: low")); assert!(stdout.contains("model.scorerReasoningEffort: low")); assert!(stdout.contains("model.apiBase: https://openrouter.ai/api/v1")); @@ -7200,9 +7200,9 @@ fn provisional_hosted_config_uses_only_the_baked_roster() { .success(); let stdout = String::from_utf8(out.get_output().stdout.clone()).unwrap(); - assert!(stdout.contains("model.name: openai/gpt-5.6-luna")); + assert!(stdout.contains("model.name: openai/gpt-6-luna")); assert!(stdout.contains("model.cascade: []")); - assert!(stdout.contains("model.scorer: openai/gpt-5.6-luna")); + assert!(stdout.contains("model.scorer: openai/gpt-6-luna")); assert!(stdout.contains("model.reasoningEffort: low")); assert!(stdout.contains("model.scorerReasoningEffort: low")); assert!(stdout.contains("model.apiBase: https://openrouter.ai:443/api/v1")); @@ -7294,7 +7294,7 @@ async fn bare_review_selects_a_nonempty_local_change_and_reaches_the_provider() .success(); let envelope: Value = serde_json::from_slice(&output.get_output().stdout).unwrap(); assert_eq!(envelope["silent"], true); - assert_eq!(envelope["modelUsed"], "openai/gpt-5.6-luna"); + assert_eq!(envelope["modelUsed"], "openai/gpt-6-luna"); let requests = server.received_requests().await.unwrap(); assert_eq!(requests.len(), 1); @@ -7320,7 +7320,7 @@ fn review_with_the_embedded_model_reports_a_missing_provider_credential() { let stderr = String::from_utf8_lossy(&out.get_output().stderr); assert!(stderr.contains("no API key")); - assert!(stderr.contains("openai/gpt-5.6-luna")); + assert!(stderr.contains("openai/gpt-6-luna")); assert!(stderr.contains("postil models")); } @@ -7820,16 +7820,16 @@ fn models_and_config_explain_the_embedded_default() { let models = String::from_utf8(models).unwrap(); assert!(models.contains("Postil model support (offline)")); assert!(models.contains("No model setting is required")); - assert!(models.contains("Embedded local reviewer (Luna): openai/gpt-5.6-luna")); + assert!(models.contains("Embedded local reviewer (Luna): openai/gpt-6-luna")); assert!(models.contains("Reviewer source: embedded default")); assert!(models.contains("Reviewer reasoning effort: low")); assert!(models.contains("Local scorer: disabled")); - assert!(models.contains("Hosted scorer candidate: openai/gpt-5.6-luna")); + assert!(models.contains("Hosted scorer candidate: openai/gpt-6-luna")); assert!(models.contains("Hosted scorer reasoning effort: low")); assert!(models.contains("does not maintain a fixed local model-ID allowlist")); assert!(models.contains("OpenAI-compatible endpoints accept any non-empty endpoint model ID")); assert!(models.contains("OpenRouter commonly uses provider/model")); - assert!(models.contains("Recommended OpenRouter starting point: openai/gpt-5.6-luna")); + assert!(models.contains("Recommended OpenRouter starting point: openai/gpt-6-luna")); assert!(models.contains("postil doctor` verifies current provider availability")); assert!( models.contains( @@ -7856,7 +7856,7 @@ fn models_and_config_explain_the_embedded_default() { .clone(); let config = String::from_utf8(config).unwrap(); assert!(config.contains("model.source: embedded default")); - assert!(config.contains("model.name: openai/gpt-5.6-luna")); + assert!(config.contains("model.name: openai/gpt-6-luna")); assert!(config.contains("model.reasoningEffort: low")); assert!(config.contains("model.reasoningEffort.source: embedded default")); assert!(config.contains("model.scorer.enabled: false")); @@ -16501,7 +16501,7 @@ async fn causal_scope_contract_prevents_context_relabeling_before_scoring() { llm_content(if carried { json!([]) } else { json!([generated]) }) }; if mode == "pre-existing-hosted-failed" { - response["model"] = json!("openai/gpt-5.6-luna"); + response["model"] = json!("openai/gpt-6-luna"); response["provider"] = json!("Azure"); } ResponseTemplate::new(200).set_body_json(response) From 6c41a1a0f82af1607de9a044362360be6eb5b14f Mon Sep 17 00:00:00 2001 From: Postil Maintainer Date: Thu, 19 Nov 2026 11:24:24 +0000 Subject: [PATCH 2/8] test: keep metadata change cases independent --- src/forge/azure.rs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/forge/azure.rs b/src/forge/azure.rs index 85a698b..cdad1a3 100644 --- a/src/forge/azure.rs +++ b/src/forge/azure.rs @@ -933,20 +933,21 @@ mod tests { fn generated_marker_sections_preserve_paths_and_reject_partial_reviews() { let mut sections = Vec::new(); for path in ["src/plain.rs", "src/sp ace.rs", "src/quo\"te.rs"] { - for (old_path, new_path, old, new, add, delete) in [ - (path, path, "", "", true, false), - (path, path, "", "", false, true), - (path, "src/new.rs", "same\n", "same\n", false, false), + for (old_path, new_path, add, delete) in [ + (format!("{path}.add"), format!("{path}.add"), true, false), + (format!("{path}.del"), format!("{path}.del"), false, true), + (format!("{path}.old"), format!("{path}.new"), false, false), ] { - let section = diff_section(old_path, new_path, old, new, add, delete); + let content = if add || delete { "" } else { "same\n" }; + let section = diff_section(&old_path, &new_path, content, content, add, delete); assert!(!section.contains("@@")); sections.push((section, old_path, new_path)); } } sections.push(( "diff --git a/src/old b/name.rs b/src/new b/name.rs\n--- a/src/old b/name.rs\n+++ b/src/new b/name.rs\n".to_string(), - "src/old b/name.rs", - "src/new b/name.rs", + "src/old b/name.rs".to_string(), + "src/new b/name.rs".to_string(), )); for shift in [0, 1, sections.len() - 1] { let ordered = (0..sections.len()) @@ -966,7 +967,7 @@ mod tests { let parsed = diff::parse(&source); assert!(parsed.complete); for (file, (_, old, new)) in parsed.files.iter().zip(ordered) { - assert_eq!((&*file.old_path, &*file.path), (*old, *new)); + assert_eq!((&*file.old_path, &*file.path), (old.as_str(), new.as_str())); } assert_eq!(parsed.files.len(), sections.len()); } From c4702129b8347f6ccdfe9f8007de08229d69f535 Mon Sep 17 00:00:00 2001 From: Postil Maintainer Date: Thu, 19 Nov 2026 11:24:33 +0000 Subject: [PATCH 3/8] style: format the Luna context assertion --- src/llm.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/llm.rs b/src/llm.rs index b7c2229..68db8f4 100644 --- a/src/llm.rs +++ b/src/llm.rs @@ -7204,7 +7204,10 @@ mod tests { assert_eq!(conservative_context_tokens("openai/gpt-5-mini"), 128_000); assert_eq!(conservative_context_tokens("openai/gpt-6-luna"), 128_000); assert_eq!(conservative_context_tokens(" OPENAI/GPT-6-LUNA "), 128_000); - assert_eq!(conservative_context_tokens("openai/gpt-6-luna-spoof"), 32_000); + assert_eq!( + conservative_context_tokens("openai/gpt-6-luna-spoof"), + 32_000 + ); assert_eq!( conservative_context_tokens("mistralai/mistral-small-3.2-24b-instruct"), 128_000 From 25d66e219e1ab34d74e4baafa500cf5a2d27c32c Mon Sep 17 00:00:00 2001 From: Postil Maintainer Date: Thu, 19 Nov 2026 11:31:54 +0000 Subject: [PATCH 4/8] test: align screening fixture with the Luna roster --- src/llm.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/llm.rs b/src/llm.rs index 68db8f4..1387293 100644 --- a/src/llm.rs +++ b/src/llm.rs @@ -12805,11 +12805,11 @@ mod tests { } let config = Config { - model: "openai/gpt-5.6-luna".into(), + model: "openai/gpt-6-luna".into(), cascade: Vec::new(), consensus: 1, scorer_enabled: true, - scorer: "openai/gpt-5.6-luna".into(), + scorer: "openai/gpt-6-luna".into(), scorer_fallback: String::new(), api_base: "https://openrouter.ai:443/api/v1".into(), api_format: ApiFormat::OpenaiCompatible, @@ -12825,7 +12825,7 @@ mod tests { ) .unwrap(); let body = client.request_body( - "openai/gpt-5.6-luna", + "openai/gpt-6-luna", "system", "user", 100, From 820911fd4c5e8a295755af72a26016184982566c Mon Sep 17 00:00:00 2001 From: Postil Maintainer Date: Thu, 19 Nov 2026 11:54:14 +0000 Subject: [PATCH 5/8] Update networking dependencies to patched versions Upgrade Hickory to 0.26.2 and Quinn protocol/UDP patches for current audit findings. Advisories: https://rustsec.org/advisories/RUSTSEC-2026-0514, https://rustsec.org/advisories/RUSTSEC-2026-0523, https://rustsec.org/advisories/RUSTSEC-2026-0538. --- Cargo.lock | 20 ++++++++++---------- Cargo.toml | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e233e4a..72e0326 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -730,9 +730,9 @@ checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" [[package]] name = "hickory-net" -version = "0.26.1" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2295ed2f9c31e471e1428a8f88a3f0e1f4b27c15049592138d1eebe9c35b183" +checksum = "084e7bd6a377435d568f652153e571b50970d7ccc1d1eeec0519f834632287e1" dependencies = [ "async-trait", "cfg-if", @@ -754,9 +754,9 @@ dependencies = [ [[package]] name = "hickory-proto" -version = "0.26.1" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bab31817bfb44672a252e97fe81cd0c18d1b2cf892108922f6818820df8c643" +checksum = "7e2da0694c15b44c6f68a6b05e0233617008c54080e31d6eb848d858a9c5b38d" dependencies = [ "data-encoding", "idna", @@ -774,9 +774,9 @@ dependencies = [ [[package]] name = "hickory-resolver" -version = "0.26.1" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0d58d28879ceecde6607729660c2667a081ccdc082e082675042793960f178c" +checksum = "0e4f9f4603319422d482738f3f6fe5aac03157fdbfed1cd85a3ff45adb09072f" dependencies = [ "cfg-if", "futures-util", @@ -1477,9 +1477,9 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.11.18" +version = "0.11.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9746dbde176634f4f2f1faf2404e30a31b2bc1e9cafb5329c95d8177a18c9fc" +checksum = "0e750cca55fe4f0439a15d0bb529da9651e79993e8e72c61a899a36d462befbe" dependencies = [ "aws-lc-rs", "bytes", @@ -1500,9 +1500,9 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.5.14" +version = "0.5.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd" +checksum = "af66907df18639dcf4db56ca65490cabc4b27a97dbadd96f2926cca73298f016" dependencies = [ "cfg_aliases", "libc", diff --git a/Cargo.toml b/Cargo.toml index d80463b..60e0df8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,7 +29,7 @@ dirs = "6.0.0" fs2 = "0.4.3" futures = "0.3.32" globset = "0.4.18" -hickory-resolver = "0.26.1" +hickory-resolver = "0.26.2" httpdate = "1.0.3" libc = "0.2.186" memmap2 = "0.9.11" From 058b9bdaf06a4a86f651109c15cb4f373f252da9 Mon Sep 17 00:00:00 2001 From: Postil Maintainer Date: Thu, 19 Nov 2026 12:01:45 +0000 Subject: [PATCH 6/8] Use the Hickory regression fix release Hickory 0.26.3 also fixes regressions in the initial security update. See https://github.com/hickory-dns/hickory-dns/releases/tag/v0.26.3. --- Cargo.lock | 12 ++++++------ Cargo.toml | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 72e0326..556193a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -730,9 +730,9 @@ checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" [[package]] name = "hickory-net" -version = "0.26.2" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "084e7bd6a377435d568f652153e571b50970d7ccc1d1eeec0519f834632287e1" +checksum = "c480823ed7c2c5d0f09c41020cb6b7c28029ce60ec42dc942158dcf22f8e0a4d" dependencies = [ "async-trait", "cfg-if", @@ -754,9 +754,9 @@ dependencies = [ [[package]] name = "hickory-proto" -version = "0.26.2" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e2da0694c15b44c6f68a6b05e0233617008c54080e31d6eb848d858a9c5b38d" +checksum = "12b92608f679a6fa515dd1d15c1ff89443026e391200a2c840c7afcba482893d" dependencies = [ "data-encoding", "idna", @@ -774,9 +774,9 @@ dependencies = [ [[package]] name = "hickory-resolver" -version = "0.26.2" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4f9f4603319422d482738f3f6fe5aac03157fdbfed1cd85a3ff45adb09072f" +checksum = "3f3da5255c95d5a716857d54b5b8f4e8d67c3484d3beaaaae2ce25063b3ba981" dependencies = [ "cfg-if", "futures-util", diff --git a/Cargo.toml b/Cargo.toml index 60e0df8..038d30d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,7 +29,7 @@ dirs = "6.0.0" fs2 = "0.4.3" futures = "0.3.32" globset = "0.4.18" -hickory-resolver = "0.26.2" +hickory-resolver = "0.26.3" httpdate = "1.0.3" libc = "0.2.186" memmap2 = "0.9.11" From 67c52b9a9bcf6bfa571118605e497d0ce3d1ac36 Mon Sep 17 00:00:00 2001 From: Postil Maintainer Date: Thu, 19 Nov 2026 12:10:00 +0000 Subject: [PATCH 7/8] Keep GPT-6 calibration separate from historical baselines --- .github/workflows/benchmark-calibration.yml | 22 +++++++-------- .github/workflows/release.yml | 12 ++++---- bench/baseline-gpt6-us.json | 13 +++++++++ bench/src/compare-baseline.test.ts | 31 +++++++++++++++------ bench/src/livemodels.test.ts | 16 ++++++----- bench/src/verify-calibration.test.ts | 23 +++++++++------ 6 files changed, 76 insertions(+), 41 deletions(-) create mode 100644 bench/baseline-gpt6-us.json diff --git a/.github/workflows/benchmark-calibration.yml b/.github/workflows/benchmark-calibration.yml index d12defb..7a1e697 100644 --- a/.github/workflows/benchmark-calibration.yml +++ b/.github/workflows/benchmark-calibration.yml @@ -52,18 +52,18 @@ jobs: CURRENT_EVALUATOR_SHA256: ${{ steps.evaluator.outputs.sha256 }} run: | set -euo pipefail - profile="openai/gpt-5.6-luna" - populated="$(jq -er --arg profile "$profile" '.profiles[$profile].populated | if type == "boolean" then tostring else error("Calibration populated state must be boolean") end' bench/baseline-us.json)" + profile="openai/gpt-6-luna" + populated="$(jq -er --arg profile "$profile" '.profiles[$profile].populated | if type == "boolean" then tostring else error("Calibration populated state must be boolean") end' bench/baseline-gpt6-us.json)" case "$populated" in false) exit 0 ;; true) ;; *) echo "::error::Calibration baseline must declare a boolean populated state."; exit 1 ;; esac - test -s bench/baseline-us.attestation.json || { + test -s bench/baseline-gpt6-us.attestation.json || { echo "::error::Populated recalibration requires the retained baseline attestation." exit 1 } - source_sha="$(jq -er --arg profile "$profile" '.profiles[$profile].calibration.sourceSha' bench/baseline-us.json)" + source_sha="$(jq -er --arg profile "$profile" '.profiles[$profile].calibration.sourceSha' bench/baseline-gpt6-us.json)" [[ "$source_sha" =~ ^[0-9a-f]{40,64}$ ]] || { echo "::error::Prior calibration source digest is invalid." exit 1 @@ -72,7 +72,7 @@ jobs: echo "::error::Recalibration requires a new main source commit." exit 1 } - prior_evaluator="$(jq -er '.corpus.evaluatorSha256' bench/baseline-us.json)" + prior_evaluator="$(jq -er '.corpus.evaluatorSha256' bench/baseline-gpt6-us.json)" [[ "$prior_evaluator" =~ ^[0-9a-f]{64}$ && "$CURRENT_EVALUATOR_SHA256" =~ ^[0-9a-f]{64}$ ]] || { echo "::error::Calibration evaluator digest is invalid." exit 1 @@ -86,8 +86,8 @@ jobs: echo "::error::Prior calibration registry source mismatch." exit 1 } - gh attestation verify bench/baseline-us.json \ - --bundle bench/baseline-us.attestation.json \ + gh attestation verify bench/baseline-gpt6-us.json \ + --bundle bench/baseline-gpt6-us.attestation.json \ --repo postil-dev/postil-cli \ --signer-workflow postil-dev/postil-cli/.github/workflows/benchmark-calibration.yml \ --signer-digest "$source_sha" \ @@ -459,7 +459,7 @@ jobs: run: | set -euo pipefail bun run bench:compare -- \ - --baseline baseline-us.json \ + --baseline baseline-gpt6-us.json \ --binary "${RUNNER_TEMP}/prepared/postil" \ --screen-profile ../provisional-models-us.json \ --cohort-manifest "${RUNNER_TEMP}/prepared/cohort.json" \ @@ -498,13 +498,13 @@ jobs: id: attest-baseline uses: actions/attest@1e69f48acb82d1966a394da916b4c1698aa569d6 # v4 with: - subject-path: ${{ github.workspace }}/bench/baseline-us.json + subject-path: ${{ github.workspace }}/bench/baseline-gpt6-us.json - name: Stage populated baseline evidence run: | mkdir -p "${RUNNER_TEMP}/populated-baseline" - cp bench/baseline-us.json "${RUNNER_TEMP}/populated-baseline/baseline-us.json" + cp bench/baseline-gpt6-us.json "${RUNNER_TEMP}/populated-baseline/baseline-gpt6-us.json" cp "${{ steps.attest-baseline.outputs.bundle-path }}" \ - "${RUNNER_TEMP}/populated-baseline/baseline-us.attestation.json" + "${RUNNER_TEMP}/populated-baseline/baseline-gpt6-us.attestation.json" - name: Upload populated baseline uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index df78f4b..46f0e92 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -70,15 +70,15 @@ jobs: GH_TOKEN: ${{ github.token }} run: | set -euo pipefail - profile="openai/gpt-5.6-luna" + profile="openai/gpt-6-luna" jq -e --arg profile "$profile" '.profiles[$profile].populated == true' \ - bench/baseline-us.json >/dev/null && test -s bench/baseline-us.attestation.json || { + bench/baseline-gpt6-us.json >/dev/null && test -s bench/baseline-gpt6-us.attestation.json || { echo "::error::New releases require the populated Azure/US baseline and its main-branch first-attempt calibration attestation." exit 1 } source_sha="$(jq -er --arg profile "$profile" \ '.profiles[$profile] | select(.populated == true) | .calibration.sourceSha' \ - bench/baseline-us.json)" + bench/baseline-gpt6-us.json)" [[ "$source_sha" =~ ^[0-9a-f]{40,64}$ ]] || { echo "::error::The Luna baseline has an invalid calibration source digest." exit 1 @@ -90,8 +90,8 @@ jobs: echo "::error::The Luna baseline source is not protected by the calibration registry." exit 1 } - gh attestation verify bench/baseline-us.json \ - --bundle bench/baseline-us.attestation.json \ + gh attestation verify bench/baseline-gpt6-us.json \ + --bundle bench/baseline-gpt6-us.attestation.json \ --repo postil-dev/postil-cli \ --signer-workflow postil-dev/postil-cli/.github/workflows/benchmark-calibration.yml \ --signer-digest "$source_sha" \ @@ -531,7 +531,7 @@ jobs: set -euo pipefail comparison=0 bun run bench:compare -- \ - --baseline baseline-us.json \ + --baseline baseline-gpt6-us.json \ --binary "${{ github.workspace }}/target/release/postil" \ --screen-profile ../provisional-models-us.json \ --cohort-manifest "${{ runner.temp }}/bench-live-cohort.json" \ diff --git a/bench/baseline-gpt6-us.json b/bench/baseline-gpt6-us.json new file mode 100644 index 0000000..c94afcf --- /dev/null +++ b/bench/baseline-gpt6-us.json @@ -0,0 +1,13 @@ +{ + "schemaVersion": 2, + "corpus": { + "fixtureCorpusSha256": "3a53ed4b0967c275cd47eb7633a4b56c94be1fdd2bd69bde0fc3eb77562c4924", + "evaluatorSha256": "d92d1824de9c10fccd27b948e4e45b35d4406d5d219894cacdbd21ea4a9eee0b" + }, + "profiles": { + "openai/gpt-6-luna": { + "populated": false, + "instructions": "Run the existing benchmark-calibration workflow from current main on its first attempt. Import its attested, predeclared ten-slot calibration baseline and bundle in a later change before release." + } + } +} diff --git a/bench/src/compare-baseline.test.ts b/bench/src/compare-baseline.test.ts index c768422..0f2e527 100644 --- a/bench/src/compare-baseline.test.ts +++ b/bench/src/compare-baseline.test.ts @@ -44,6 +44,7 @@ import { import { formatCanonicalDecimal, parseCanonicalDecimal, + providerContractEvidence, providerContractSha256, sumCanonicalDecimals, type ProviderContractEvidence, @@ -101,22 +102,22 @@ test("release prerequisite rejects an unpopulated US baseline before attestation try { await mkdir(resolve(directory, "bench")); const check = async (): Promise<{ code: number; output: string }> => { - const child = Bun.spawn(["bash", "-c", 'set -euo pipefail\nprofile="openai/gpt-5.6-luna"\n' + prerequisite], { + const child = Bun.spawn(["bash", "-c", 'set -euo pipefail\nprofile="openai/gpt-6-luna"\n' + prerequisite], { cwd: directory, stdout: "pipe", stderr: "pipe", timeout: 10_000, }); const [code, stdout, stderr] = await Promise.all([child.exited, new Response(child.stdout).text(), new Response(child.stderr).text()]); return { code, output: stdout + stderr }; }; - const baseline = (populated: boolean) => JSON.stringify({ profiles: { "openai/gpt-5.6-luna": { populated } } }); - await writeFile(resolve(directory, "bench/baseline-us.json"), baseline(false)); + const baseline = (populated: boolean) => JSON.stringify({ profiles: { "openai/gpt-6-luna": { populated } } }); + await writeFile(resolve(directory, "bench/baseline-gpt6-us.json"), baseline(false)); const missing = await check(); expect(missing.code).toBe(1); expect(missing.output).toContain("New releases require the populated Azure/US baseline"); - await writeFile(resolve(directory, "bench/baseline-us.attestation.json"), JSON.stringify({ fixture: true })); + await writeFile(resolve(directory, "bench/baseline-gpt6-us.attestation.json"), JSON.stringify({ fixture: true })); expect((await check()).code).toBe(1); - await writeFile(resolve(directory, "bench/baseline-us.json"), baseline(true)); + await writeFile(resolve(directory, "bench/baseline-gpt6-us.json"), baseline(true)); expect((await check()).code).toBe(0); - await writeFile(resolve(directory, "bench/baseline-us.attestation.json"), ""); + await writeFile(resolve(directory, "bench/baseline-gpt6-us.attestation.json"), ""); expect((await check()).code).toBe(1); expect(workflow.indexOf("gh attestation verify", end)).toBeGreaterThan(end); } finally { @@ -146,8 +147,20 @@ test("retained attested US calibration binds its source and route while the embe expect(usBaselineProfile.calibration.reportCount).toBe(10); expect(() => assertBaselineCalibrationIntegrity(usBaselineProfile)).not.toThrow(); expect(usBaselineProfile.calibration.sourceSha).toMatch(/^[0-9a-f]{40}(?:[0-9a-f]{24})?$/u); - expect(usBaselineProfile.screeningProfileSha256).toBe(us.sha256); - expect(usBaselineProfile.calibration.providerContractSha256).toBe(us.providerContractSha256); + const historicalProfileBytes = historicalArtifact("provisional-models-us.json"); + const historicalProfile = JSON.parse(historicalProfileBytes); + const historicalContract = providerContractEvidence( + historicalProfile.upstreamProviderIdentity, + historicalProfile.upstreamProviderRoute, + new Map(historicalProfile.modelPriceBounds.map((bound: { + model: string; inputMicrosPerMillionTokens: number; outputMicrosPerMillionTokens: number; + }) => [bound.model, bound])), + historicalProfile.generatorChain, + historicalProfile.scorerChain, + ); + expect(usBaselineProfile.screeningProfileSha256).toBe(createHash("sha256").update(historicalProfileBytes).digest("hex")); + expect(usBaselineProfile.calibration.providerContractSha256).toBe(providerContractSha256(historicalContract)); + expect(usBaselineProfile.screeningProfileSha256).not.toBe(us.sha256); expect(usBaselineProfile.upstreamProviderIdentity).toBe("Azure"); const attestation = JSON.parse(attestationBytes); expect(attestation.mediaType).toBe("application/vnd.dev.sigstore.bundle.v0.3+json"); @@ -361,6 +374,7 @@ async function inputBoundReport(screeningProfilePath = resolve(import.meta.dir, screeningProfileMetadata(screeningProfilePath), ]); Object.assign(report.summary, { + model: profile.providerContract.modelPriceBounds.find(bound => bound.roles.includes("generator"))!.model, binarySha256: createHash("sha256").update(binary).digest("hex"), fixtureCorpusSha256: createHash("sha256") .update(JSON.stringify(parsedCases)) @@ -1126,6 +1140,7 @@ describe("three-report aggregation compatibility", () => { const reports = Array.from({ length: 5 }, () => { const report = fakeReport(); Object.assign(report.summary, { + model: us.providerContract.modelPriceBounds.find(bound => bound.roles.includes("generator"))!.model, screeningProfileSha256: us.sha256, upstreamProviderRoute: us.upstreamProviderRoute, providerContract: us.providerContract, diff --git a/bench/src/livemodels.test.ts b/bench/src/livemodels.test.ts index 1b80999..bbeed77 100644 --- a/bench/src/livemodels.test.ts +++ b/bench/src/livemodels.test.ts @@ -1395,17 +1395,19 @@ describe("managed admission workflow", () => { expect(calibration).toContain("--record"); expect(calibration).not.toContain("bench/baseline.json"); expect(calibration.match(/--screen-profile \.\.\/provisional-models-us\.json/gu)).toHaveLength(5); - expect(calibration).toContain("--baseline baseline-us.json"); - expect(calibration).toContain("subject-path: ${{ github.workspace }}/bench/baseline-us.json"); - expect(calibration).toContain('cp bench/baseline-us.json "${RUNNER_TEMP}/populated-baseline/baseline-us.json"'); - expect(calibration).toContain("/populated-baseline/baseline-us.attestation.json"); + expect(calibration).toContain('profile="openai/gpt-6-luna"'); + expect(calibration).toContain("--baseline baseline-gpt6-us.json"); + expect(calibration).toContain("subject-path: ${{ github.workspace }}/bench/baseline-gpt6-us.json"); + expect(calibration).toContain('cp bench/baseline-gpt6-us.json "${RUNNER_TEMP}/populated-baseline/baseline-gpt6-us.json"'); + expect(calibration).toContain("/populated-baseline/baseline-gpt6-us.attestation.json"); expect(calibration).toContain("name: benchmark-calibration-us-baseline-${{ github.run_id }}"); expect(release).toContain("New releases require the populated Azure/US baseline and its main-branch first-attempt calibration attestation."); expect(release).not.toContain("provisional-models.json"); expect(release).toContain("--screen-profile ../provisional-models-us.json"); expect(release).not.toContain("bench/baseline.json"); - expect(release).toContain("--baseline baseline-us.json"); - expect(release).toContain("--bundle bench/baseline-us.attestation.json"); + expect(release).toContain('profile="openai/gpt-6-luna"'); + expect(release).toContain("--baseline baseline-gpt6-us.json"); + expect(release).toContain("--bundle bench/baseline-gpt6-us.attestation.json"); expect(release).toContain("--signer-workflow postil-dev/postil-cli/.github/workflows/benchmark-calibration.yml"); expect(release).not.toContain("workflow_dispatch"); expect(release).toContain("name: Require the unique first release run for this tag"); @@ -1415,7 +1417,7 @@ describe("managed admission workflow", () => { expect(release).toContain("group: release-${{ github.ref_name }}"); expect(release).toContain('gh release view "${GITHUB_REF_NAME}"'); expect(release).toContain("name: Verify the attested Azure/US Luna calibration baseline"); - expect(release).toContain("bench/baseline-us.attestation.json"); + expect(release).toContain("bench/baseline-gpt6-us.attestation.json"); expect(release).toContain('git/ref/tags/postil-calibration-${source_sha}'); expect(release).toContain( "--signer-workflow postil-dev/postil-cli/.github/workflows/benchmark-calibration.yml", diff --git a/bench/src/verify-calibration.test.ts b/bench/src/verify-calibration.test.ts index c021f93..dfbbbd1 100644 --- a/bench/src/verify-calibration.test.ts +++ b/bench/src/verify-calibration.test.ts @@ -134,10 +134,16 @@ test("calibration workflow verifies retained provenance before reserving a chang steps.findIndex(step => step.name === "Reserve the current main calibration source"), ); const directory = await fixture(); - const baselinePath = resolve(directory, "bench/baseline-us.json"); + const baselinePath = resolve(directory, "bench/baseline-gpt6-us.json"); + const source = randomBytes(20).toString("hex"); + const currentEvaluator = await evaluatorSourceSha256(); + const baseline = { + corpus: { evaluatorSha256: randomBytes(32).toString("hex") }, + profiles: { "openai/gpt-6-luna": { populated: true, calibration: { sourceSha: source } } }, + }; + await writeFile(baselinePath, JSON.stringify(baseline)); const baselineBytes = await readFile(baselinePath); - const baseline = JSON.parse(baselineBytes.toString()); - const source = baseline.profiles["openai/gpt-5.6-luna"].calibration.sourceSha; + await writeFile(resolve(directory, "bench/baseline-gpt6-us.attestation.json"), JSON.stringify({ synthetic: true })); const bin = resolve(directory, "bin"); await mkdir(bin); const callsPath = resolve(directory, "calls"); @@ -157,7 +163,6 @@ else fi `); await chmod(shim, 0o700); - const currentEvaluator = await evaluatorSourceSha256(); const run = async (options: Record = {}) => { await writeFile(callsPath, ""); const child = Bun.spawn(["bash", "-c", initial + "\n(\n" + validation + "\n)\n" + reservation], { @@ -180,7 +185,7 @@ fi expect(accepted.code).toBe(0); const verification = accepted.calls.find(args => args[0] === "attestation")!; expect(verification).toEqual([ - "attestation", "verify", "bench/baseline-us.json", "--bundle", "bench/baseline-us.attestation.json", + "attestation", "verify", "bench/baseline-gpt6-us.json", "--bundle", "bench/baseline-gpt6-us.attestation.json", "--repo", "postil-dev/postil-cli", "--signer-workflow", "postil-dev/postil-cli/.github/workflows/benchmark-calibration.yml", "--signer-digest", source, "--source-digest", source, "--source-ref", "refs/heads/main", "--cert-oidc-issuer", "https://token.actions.githubusercontent.com", "--predicate-type", "https://slsa.dev/provenance/v1", @@ -205,8 +210,8 @@ fi expect((await run({ RESERVATION_EXIT: "1" })).code).not.toBe(0); for (const update of [ { profiles: {} }, - { profiles: { "openai/gpt-5.6-luna": { populated: "false" } } }, - { profiles: { "openai/gpt-5.6-luna": { populated: true, calibration: { sourceSha: "invalid" } } } }, + { profiles: { "openai/gpt-6-luna": { populated: "false" } } }, + { profiles: { "openai/gpt-6-luna": { populated: true, calibration: { sourceSha: "invalid" } } } }, { ...baseline, corpus: { evaluatorSha256: "invalid" } }, ]) { await writeFile(baselinePath, JSON.stringify(update)); @@ -215,11 +220,11 @@ fi expect(refused.calls.some(args => args.includes("POST"))).toBe(false); } await writeFile(baselinePath, baselineBytes); - await writeFile(resolve(directory, "bench/baseline-us.attestation.json"), ""); + await writeFile(resolve(directory, "bench/baseline-gpt6-us.attestation.json"), ""); const missingBundle = await run(); expect(missingBundle.output).toContain("requires the retained baseline attestation"); expect(missingBundle.calls.some(args => args.includes("POST"))).toBe(false); - await writeFile(baselinePath, JSON.stringify({ profiles: { "openai/gpt-5.6-luna": { populated: false } } })); + await writeFile(baselinePath, JSON.stringify({ profiles: { "openai/gpt-6-luna": { populated: false } } })); const bootstrap = await run(); expect(bootstrap.code).toBe(0); expect(bootstrap.calls.some(args => args[0] === "attestation")).toBe(false); From a04e2459607ad579dcf9a5148fe3b6fa9e8f7d1d Mon Sep 17 00:00:00 2001 From: Postil Maintainer Date: Thu, 19 Nov 2026 12:31:17 +0000 Subject: [PATCH 8/8] Price the configured scorer in diagnostic test fixtures --- bench/src/scorer-eval.test.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bench/src/scorer-eval.test.ts b/bench/src/scorer-eval.test.ts index 31a34a3..75f6f02 100644 --- a/bench/src/scorer-eval.test.ts +++ b/bench/src/scorer-eval.test.ts @@ -2607,6 +2607,7 @@ test("diagnostic custody rejects dirty, stale and mismatched inputs before gener const binary = postilBinaryPath(); const cliBinarySha256 = createHash("sha256").update(await readFile(binary)).digest("hex"); const input = { binary, sourceSha, evaluatorSha256, cliBinarySha256, keyName: "POSTIL_API_KEY" }; + const pricedModels = [...new Set([GENERATOR_MODEL, ...(await loadEmbeddedScorerDefaults()).qualification_candidates])]; const keyPrevious = process.env.POSTIL_API_KEY; process.env.POSTIL_API_KEY = crypto.randomUUID(); const dirty = await mkdtemp(join(tmpdir(), "postil-diagnostic-dirty-")); @@ -2629,7 +2630,7 @@ test("diagnostic custody rejects dirty, stale and mismatched inputs before gener identityMode === "missingRecovered" && adjudicationCalls === 1); if (omitIdentity) identityFailures++; res.writeHead(200, { "content-type": "application/json" }); - res.end(JSON.stringify({ ...(omitIdentity ? {} : { model: GENERATOR_MODEL, provider: "Azure" }), + res.end(JSON.stringify({ ...(omitIdentity ? {} : { model: JSON.parse(body).model, provider: "Azure" }), choices: [{ finish_reason: "stop", message: { content: adjudication ?? JSON.stringify({ scores: [{ confidence: 0.2, kind: "uncertainty", reason: "The claimed runtime break is unsupported by the change." }], }) } }], usage: { prompt_tokens: 30, completion_tokens: 10, cost: 0.000045 } })); @@ -2639,9 +2640,9 @@ test("diagnostic custody rejects dirty, stale and mismatched inputs before gener const target = String(url); if (new URL(target).origin === "https://openrouter.ai" && new URL(target).pathname === "/api/v1/endpoints/zdr") { calls++; pricingCalls++; - return Response.json({ data: [{ model_id: GENERATOR_MODEL, provider_name: "Azure", tag: "azure/us", status: 0, + return Response.json({ data: pricedModels.map(model_id => ({ model_id, provider_name: "Azure", tag: "azure/us", status: 0, supported_parameters: ["max_tokens", "max_completion_tokens", "reasoning", "reasoning_effort", "temperature", "response_format", "structured_outputs"], - pricing: { prompt: "0.000001", completion: "0.000002" } }] }); + pricing: { prompt: "0.000001", completion: "0.000002" } })) }); } if (new URL(target).origin === "https://openrouter.ai" && new URL(target).pathname === "/api/v1/chat/completions") { calls++;