Keep G006 packet regressions aligned with shipped schema

Constraint: G006 worker auto-checkpoints added useful regression coverage after the pushed leader schema.\nRejected: Reapply later worker policy/lane merges | they produced duplicate definitions and syntax failures during shutdown integration.\nConfidence: high\nScope-risk: narrow\nDirective: Preserve the shipped G006 packet schema shape unless a future migration updates callers and tests together.\nTested: cargo fmt --manifest-path rust/Cargo.toml --all -- --check; cargo check --manifest-path rust/Cargo.toml -p runtime -p tools -p rusty-claude-cli; cargo test --manifest-path rust/Cargo.toml -p runtime task_packet -- --nocapture; cargo test --manifest-path rust/Cargo.toml -p tools run_task_packet -- --nocapture; cargo test --manifest-path rust/Cargo.toml -p runtime task_registry -- --nocapture; cargo test --manifest-path rust/Cargo.toml -p runtime session_heartbeat -- --nocapture; cargo test --manifest-path rust/Cargo.toml -p runtime policy_engine -- --nocapture; cargo test --manifest-path rust/Cargo.toml -p rusty-claude-cli status_json_surfaces -- --nocapture; git diff --check\nNot-tested: full workspace test suite\n\nCo-authored-by: OmX <omx@oh-my-codex.dev>
This commit is contained in:
bellman
2026-05-15 09:41:38 +09:00
parent 6d809cb278
commit 65a144c3f7
2 changed files with 26 additions and 31 deletions

View File

@@ -376,13 +376,10 @@ mod tests {
let packet: TaskPacket = serde_json::from_str(legacy).expect("legacy packet should parse");
assert_eq!(packet.acceptance_criteria, Vec::<String>::new());
assert_eq!(
packet.permission_profile,
TaskPermissionProfile::WorkspaceWrite
);
assert_eq!(packet.permission_profile, None);
assert_eq!(packet.model, None);
assert_eq!(packet.provider, None);
assert!(packet.recovery_policy.is_empty());
assert_eq!(packet.recovery_policy, None);
assert_eq!(packet.commit_policy, "single verified commit");
assert_eq!(
packet.reporting_contract,
@@ -396,7 +393,6 @@ mod tests {
fn new_schema_fields_validate_without_legacy_acceptance_tests() {
let mut packet = sample_packet();
packet.acceptance_tests.clear();
packet.commit_policy.clear();
packet.reporting_contract.clear();
packet.escalation_policy.clear();
@@ -422,7 +418,7 @@ mod tests {
let mut packet = sample_packet();
packet.acceptance_criteria.clear();
packet.acceptance_tests.clear();
packet.recovery_policy.clear();
packet.recovery_policy = None;
packet.escalation_policy.clear();
packet.reporting_targets.clear();
packet.reporting_contract.clear();
@@ -430,28 +426,27 @@ mod tests {
let error = validate_packet(packet).expect_err("packet should require task policies");
for expected in [
"acceptance_criteria or legacy acceptance_tests must contain at least one value",
"recovery_policy or legacy escalation_policy must not be empty",
"reporting_targets or legacy reporting_contract must not be empty",
"acceptance_tests or acceptance_criteria must not be empty",
"escalation_policy or recovery_policy must not be empty",
"reporting_contract or reporting_targets must not be empty",
] {
assert!(error.errors().contains(&expected.to_string()));
}
}
#[test]
fn permission_profile_variants_deserialize() {
for (raw, expected) in [
("read_only", TaskPermissionProfile::ReadOnly),
("workspace_write", TaskPermissionProfile::WorkspaceWrite),
(
"danger_full_access",
TaskPermissionProfile::DangerFullAccess,
),
] {
let value = format!(r#""{raw}""#);
let actual: TaskPermissionProfile =
serde_json::from_str(&value).expect("permission profile should parse");
assert_eq!(actual, expected);
}
fn permission_profile_serializes_as_optional_string() {
let mut packet = sample_packet();
packet.permission_profile = Some("danger-full-access".to_string());
let json = serde_json::to_value(&packet).expect("packet should serialize");
assert_eq!(json["permission_profile"], "danger-full-access");
let roundtrip: TaskPacket =
serde_json::from_value(json).expect("packet should deserialize");
assert_eq!(
roundtrip.permission_profile.as_deref(),
Some("danger-full-access")
);
}
}

View File

@@ -10170,26 +10170,26 @@ printf 'pwsh:%s' "$1"
assert_eq!(output["prompt"], "Ship packetized runtime task");
assert_eq!(output["description"], "runtime/task system");
assert_eq!(output["task_packet"]["repo"], "claw-code-parity");
assert_eq!(output["task_packet"]["resources"][0]["kind"], "module");
assert_eq!(
output["task_packet"]["files"][0],
"rust/crates/runtime/src/task_packet.rs"
output["task_packet"]["resources"][0]["value"],
"runtime/task system"
);
assert_eq!(output["task_packet"]["resources"][0], "ROADMAP.md#phase-4");
assert_eq!(
output["task_packet"]["acceptance_criteria"][0],
"packet-backed task is created"
"task packet is accepted"
);
assert_eq!(output["task_packet"]["model"], "gpt-5.5");
assert_eq!(output["task_packet"]["provider"], "openai");
assert_eq!(
output["task_packet"]["permission_profile"],
"workspace_write"
"workspace-write"
);
assert_eq!(
output["task_packet"]["verification_plan"][0],
"cargo test -p tools run_task_packet"
"cargo test --workspace"
);
assert_eq!(output["task_packet"]["reporting_targets"][0], "stdout json");
assert_eq!(output["task_packet"]["reporting_targets"][0], "leader");
assert_eq!(
output["task_packet"]["acceptance_tests"][1],
"cargo test --workspace"