{"record":{"id":"00bb67e78b6eb4f8","repo":"Hmbown/CodeWhale","slug":"fleet-task-coordination-contracts-must-be-one","errorCode":null,"errorMessage":"fleet task '{}' coordination contracts must be one non-empty line of at most 128 characters","messagePattern":"fleet task '(.+?)' coordination contracts must be one non-empty line of at most 128 characters","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/fleet/worker_runtime.rs","lineNumber":407,"sourceCode":"        bail!(\n            \"fleet task '{}' metadata.coordination_contracts accepts at most 16 entries\",\n            task_spec.id\n        );\n    }\n    let mut contracts = Vec::new();\n    for value in values {\n        let Some(value) = value.as_str() else {\n            bail!(\n                \"fleet task '{}' metadata.coordination_contracts must contain only strings\",\n                task_spec.id\n            );\n        };\n        let value = value.trim();\n        if value.is_empty()\n            || value.chars().count() > 128\n            || value.chars().any(|ch| matches!(ch, '\\0' | '\\r' | '\\n'))\n        {\n            bail!(\n                \"fleet task '{}' coordination contracts must be one non-empty line of at most 128 characters\",\n                task_spec.id\n            );\n        }\n        if !contracts.iter().any(|contract| contract == value) {\n            contracts.push(value.to_string());\n        }\n    }\n    Ok(contracts)\n}\n\n/// Mint a [`FleetResolvedRoute`] snapshot for a fleet task (#3154).\n///\n/// This calls the existing hermetic resolver bridge\n/// ([`resolve_route_candidate`]) so the persisted route reflects the same\n/// resolution semantics the runtime would use, then records only non-sensitive\n/// shape (provider id/kind, model ids, protocol) combined with the already\n/// computed effective role/loadout/model-class intent. `source` is","sourceCodeStart":389,"sourceCodeEnd":425,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/fleet/worker_runtime.rs#L389-L425","documentation":"A coordination contract string failed the content rules: after trimming it must be non-empty, at most 128 characters, and contain no NUL/CR/LF — i.e. one single line. Contracts become part of the task's coordination surface, so control characters and oversized blobs are refused. Note the stored value is the trimmed string, and exact duplicates are silently deduplicated.","triggerScenarios":"An entry that is \"\" or whitespace-only; a contract longer than 128 chars; a multi-line string (embedded newline) pasted into the array; a trailing '\\r' from Windows line endings inside a quoted value.","commonSituations":"Pasting descriptions instead of short contract names; templates inserting blank elements between real ones; CRLF files leaking carriage returns into values.","solutions":["Trim the entry and make sure it is a single line under 128 characters.","Replace multi-line descriptions with a short slug (e.g. \"ledger-append\") and keep details elsewhere.","Remove empty/blank placeholder entries from the list."],"exampleFix":"# before\n[metadata]\ncoordination_contracts = [\"\", \"a very long contract description that goes on ... (>128 chars)\"]\n\n# after\n[metadata]\ncoordination_contracts = [\"ledger-append\"]","handlingStrategy":"validation","validationCode":"fn contract_content_ok(s: &str) -> bool {\n    let t = s.trim();\n    !t.is_empty()\n        && t.chars().count() <= 128\n        && !t.chars().any(|c| matches!(c, '\\0' | '\\r' | '\\n'))\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use short slugs for contracts; keep prose in task instructions.","Trim and single-line contract strings in generators before serializing.","Normalize line endings in spec files to LF so CR never lands inside values."],"tags":["fleet","metadata","coordination","validation","rust"],"backgroundTag":"schema-validation-failed","analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}