Skip to content

Commit 113f3e4

Browse files
committed
fix: restore the canonical ctx_reduce advertised schema (authorizer contract)
Commit 1fba421's accept-don't-advertise batch loosened ALL five ctx_ tool schemas to additionalProperties:true. For ctx_reduce that crossed a consumer contract: Thalamus's authorizer exact-matches the canonical closed schema and fails closed on any deviation, which silently disabled the entire CC tagging surface (tool_present=false: no tags, no reclaim, models confabulating queued acks). Prod carried the drift from the Jul 24 deploy onward, hidden because CC had no traffic; the ckdev rig surfaced it on the first seed turn. Unknown-args tolerance for imitated fields stays where it belongs: the execution-side unwrap. The advertised schema returns to byte-canonical {drop, required:[drop], additionalProperties:false}, and the manifest test now pins those exact bytes for ctx_reduce (mutation-proven: restoring the drift turns it red) while the other four tools keep the open posture their executor-side validators expect.
1 parent 51b99b9 commit 113f3e4

1 file changed

Lines changed: 34 additions & 6 deletions

File tree

crates/mc-module/src/lib.rs

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11008,12 +11008,22 @@ pub fn manifest(module_id: &str) -> ModuleManifest {
1100811008
"Acknowledge a tagged reduction request for asynchronous delivery".to_string(),
1100911009
),
1101011010
execution_mode: ExecutionMode::Pure,
11011+
// The ADVERTISED schema must stay byte-canonical: Thalamus's
11012+
// authorizer (authorized_ctx_reduce_tool) exact-matches this shape
11013+
// and fails closed on ANY deviation, silently disabling the whole
11014+
// tagging surface (tool_present=false → no tags, no reclaim). The
11015+
// accept-don't-advertise posture for imitated args (reduced/summary)
11016+
// lives in the EXECUTION unwrap, never here — loosening this schema
11017+
// to "tolerate unknown args" killed CC-leg ctx_reduce fleet-wide for
11018+
// two days (drift authored 2026-07-23, caught on first rig traffic
11019+
// 2026-07-25 because prod CC was dark the whole window).
1101111020
schema: json!({
1101211021
"type": "object",
1101311022
"properties": {
1101411023
"drop": { "type": "string" }
1101511024
},
11016-
"additionalProperties": true
11025+
"required": ["drop"],
11026+
"additionalProperties": false
1101711027
}),
1101811028
},
1101911029
Tool {
@@ -14885,15 +14895,33 @@ mod tests {
1488514895
),
1488614896
];
1488714897

14898+
// ctx_reduce is the one AUTHORIZER-PINNED schema: Thalamus exact-matches
14899+
// the canonical closed shape and fails closed on any deviation, silently
14900+
// disabling the tagging surface. Its imitated-args tolerance lives in the
14901+
// execution unwrap, not the advertised schema. Every other ctx_ tool keeps
14902+
// the open accept-unknown-args posture.
14903+
assert_eq!(
14904+
by_name["ctx_reduce"].schema,
14905+
json!({
14906+
"type": "object",
14907+
"properties": { "drop": { "type": "string" } },
14908+
"required": ["drop"],
14909+
"additionalProperties": false
14910+
}),
14911+
"ctx_reduce advertised schema must stay byte-canonical (authorizer contract)"
14912+
);
14913+
1488814914
for (name, expected) in expected_fields {
1488914915
let tool = by_name
1489014916
.get(name)
1489114917
.unwrap_or_else(|| panic!("missing {name} manifest entry"));
14892-
assert_ne!(
14893-
tool.schema.get("additionalProperties"),
14894-
Some(&json!(false)),
14895-
"{name} must preserve compatibility arguments"
14896-
);
14918+
if name != "ctx_reduce" {
14919+
assert_ne!(
14920+
tool.schema.get("additionalProperties"),
14921+
Some(&json!(false)),
14922+
"{name} must preserve compatibility arguments"
14923+
);
14924+
}
1489714925
let properties = tool.schema["properties"]
1489814926
.as_object()
1489914927
.unwrap_or_else(|| panic!("{name} schema properties"));

0 commit comments

Comments
 (0)