Sync public tree to 8a8f27c

This commit is contained in:
Michel Paulissen 2026-07-04 12:40:30 +02:00
parent 65ccb17519
commit 4e04601794
4 changed files with 44 additions and 3 deletions

View file

@ -1,7 +1,7 @@
{
"kind": "disasmer-filtered-public-tree",
"source_commit": "cab9305958abb806fe12c27b3d7df0905c5d8e8d",
"release_name": "dryrun-cab9305958ab",
"source_commit": "8a8f27c7bdaed2573256af31204dd4142be3319d",
"release_name": "dryrun-8a8f27c7bdae",
"filtered_out": [
"private/**",
"experiments/**",

View file

@ -2238,6 +2238,8 @@ fn quota_status_report(args: QuotaStatusArgs, cwd: PathBuf) -> Result<Value> {
"attached_nodes": attached_nodes,
"task_events": task_events,
"next_blocked_action": quota_next_blocked_action(&current_usage),
"quota_tier": "community tier",
"community_tier_label": "community tier",
"community_tier_language": true,
"private_abuse_heuristics_exposed": false,
}))
@ -2474,6 +2476,7 @@ fn human_report(value: &Value) -> String {
push_string_field(&mut lines, value, "node", "node");
push_string_field(&mut lines, value, "artifact", "artifact");
push_string_field(&mut lines, value, "entry", "entry");
push_string_field(&mut lines, value, "quota_tier", "quota tier");
push_string_field(&mut lines, value, "config_file", "config");
push_string_field(&mut lines, value, "adapter", "adapter");
@ -2861,6 +2864,12 @@ fn push_machine_error_line(lines: &mut Vec<String>, machine_error: Option<&Value
.and_then(Value::as_i64)
.unwrap_or(1);
lines.push(format!("error category: {category} (exit {exit_code})"));
if let Some(tier) = machine_error
.get("community_tier_label")
.and_then(Value::as_str)
{
lines.push(format!("quota tier: {tier}"));
}
if let Some(next_actions) = machine_error.get("next_actions").and_then(Value::as_array) {
let actions = next_actions
.iter()
@ -2976,6 +2985,7 @@ fn cli_error_summary_for_category(category: &'static str, message: &str) -> Valu
),
);
object.insert("community_tier_language".to_owned(), json!(true));
object.insert("community_tier_label".to_owned(), json!("community tier"));
object.insert("private_abuse_heuristics_exposed".to_owned(), json!(false));
}
}
@ -6005,7 +6015,15 @@ mod tests {
if category == "quota" {
assert_eq!(summary["resource_category"], "api_calls");
assert_eq!(summary["community_tier_language"], true);
assert_eq!(summary["community_tier_label"], "community tier");
assert_eq!(summary["private_abuse_heuristics_exposed"], false);
let rendered = human_report(&json!({
"command": "run",
"machine_error": summary,
}));
assert!(rendered.contains("quota tier: community tier"));
let forbidden_tier = ["free", "tier"].join(" ");
assert!(!rendered.to_ascii_lowercase().contains(&forbidden_tier));
}
}
}
@ -8103,6 +8121,12 @@ mod tests {
assert_eq!(status["current_usage"]["attached_nodes"], 0);
assert_eq!(status["limits"]["artifact_download_bytes"], 268_435_456);
assert_eq!(status["community_tier_language"], true);
assert_eq!(status["quota_tier"], "community tier");
assert_eq!(status["community_tier_label"], "community tier");
let rendered = human_report(&status);
assert!(rendered.contains("quota tier: community tier"));
let forbidden_tier = ["free", "tier"].join(" ");
assert!(!rendered.to_ascii_lowercase().contains(&forbidden_tier));
assert_eq!(
status["next_blocked_action"]["action"],
"node_work_requires_online_attached_node"

View file

@ -102,6 +102,11 @@ async function main() {
assert.strictEqual(report.run_start.machine_error.category, "quota");
assert.strictEqual(report.run_start.machine_error.resource_category, "api_calls");
assert.strictEqual(report.run_start.machine_error.community_tier_language, true);
assert.strictEqual(
report.run_start.machine_error.community_tier_label,
"community tier"
);
assert.doesNotMatch(result.stdout, new RegExp(["free", "tier"].join(" "), "i"));
assert.strictEqual(
report.run_start.machine_error.private_abuse_heuristics_exposed,
false

View file

@ -127,6 +127,11 @@ expect(
"quota resource-category criteria",
/Hitting a quota produces a clear error[\s\S]*resource category[\s\S]*private abuse heuristics[\s\S]*quota machine errors now extract the resource category/
);
expect(
criteria,
"community tier CLI wording criteria",
/Community tier language is used instead of "free[ -]tier" in user-facing CLI output/
);
expect(
cliFirstAcceptance,
"CLI-first acceptance report",
@ -399,8 +404,14 @@ expect(
expect(
cli,
"CLI exposes quota machine-error posture",
/fn cli_error_summary_for_category[\s\S]*resource_category[\s\S]*quota_error_resource_category[\s\S]*community_tier_language[\s\S]*private_abuse_heuristics_exposed[\s\S]*fn quota_error_resource_category[\s\S]*resource limit exceeded for /
/fn cli_error_summary_for_category[\s\S]*resource_category[\s\S]*quota_error_resource_category[\s\S]*community_tier_language[\s\S]*community_tier_label[\s\S]*private_abuse_heuristics_exposed[\s\S]*fn quota_error_resource_category[\s\S]*resource limit exceeded for /
);
expect(
cli,
"CLI renders community tier wording",
/push_string_field\(&mut lines, value, "quota_tier", "quota tier"\)[\s\S]*community_tier_label[\s\S]*quota tier: \{tier\}/
);
assert.doesNotMatch(cli, /free[- ]tier/i, "CLI source should use community tier wording");
expect(
cli,
"CLI reports stable error-code contract",
@ -528,6 +539,7 @@ for (const [name, pattern] of [
["run uses JSON mode", /"run"[\s\S]*"--json"/],
["actual quota exit code", /assert\.strictEqual\(result\.code, 22/],
["actual quota resource-category assertion", /machine_error\.resource_category, "api_calls"/],
["actual quota community-tier label assertion", /machine_error\.community_tier_label,[\s\S]*"community tier"/],
["actual quota abuse-heuristics assertion", /machine_error\.private_abuse_heuristics_exposed,[\s\S]*false/],
["exit-code application in JSON", /process_exit_code_applied[\s\S]*true/],
]) {