{"record":{"id":"3e6914ad704a7da2","repo":"Hmbown/CodeWhale","slug":"legacy-dir","errorCode":null,"errorMessage":"legacy dir","messagePattern":"legacy dir","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/config/src/tests.rs","lineNumber":4374,"sourceCode":"\n    assert!(\n        diagnostic.contains(\"failed to parse config\"),\n        \"error should name the parse failure: {err:#}\"\n    );\n    assert!(!diagnostic.contains(secret), \"{diagnostic}\");\n    assert!(!diagnostic.contains(\"api_key\"), \"{diagnostic}\");\n    assert!(diagnostic.contains(\"file contents were omitted\"));\n    let body = fs::read_to_string(&config_path).expect(\"read config\");\n    assert_eq!(body, malformed, \"malformed config left untouched\");\n}\n\n#[test]\nfn config_store_rendered_body_preserves_comments_at_legacy_deepseek_path() {\n    // #3410 legacy case: a config still living under `.deepseek/` keeps its\n    // comments when written back through a transaction at the same path.\n    let dir = tempfile::tempdir().expect(\"tempdir\");\n    let legacy_dir = dir.path().join(\".deepseek\");\n    fs::create_dir_all(&legacy_dir).expect(\"legacy dir\");\n    let config_path = legacy_dir.join(CONFIG_FILE_NAME);\n    fs::write(\n        &config_path,\n        \"# legacy home config\\nmodel = \\\"deepseek-v4-flash\\\"\\n\",\n    )\n    .expect(\"write config\");\n\n    let mut store = ConfigStore::load(Some(config_path.clone())).expect(\"load config store\");\n    store.config.model = Some(\"deepseek-v4-pro\".to_string());\n\n    let mut transaction = persistence::SetupTransaction::new();\n    transaction.stage(\n        &config_path,\n        store.rendered_body().expect(\"rendered body\").into_bytes(),\n    );\n    transaction.commit().expect(\"commit\");\n\n    let body = fs::read_to_string(&config_path).expect(\"read config\");","sourceCodeStart":4356,"sourceCodeEnd":4392,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/433685b2024e7bc4c99e1e2e326bcad39b4d9d65/crates/config/src/tests.rs#L4356-L4392","documentation":"A test assertion message (\"legacy dir\") from the #3410 legacy-path tests: the scenario places a config under the legacy directory layout and asserts that rendered-body saves (with comment preservation and rollback) still work there. The label marks which layout the failing assertion was exercising, not a runtime error.","triggerScenarios":"Thrown at crates/config/src/tests.rs:4374 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reproduce with the legacy directory layout fixture to see which assertion failed","Ensure the save path handles the legacy location the same as the current one (same comment preservation and rollback)","Update or migrate the legacy fixture if the supported layout changed, keeping the test's intent"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"433685b2024e7bc4c99e1e2e326bcad39b4d9d65","analyzedAt":"2026-09-15T12:24:24.634Z","contentChangedAt":"2026-09-15T12:24:24.634Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}