@delegance/claude-autopilot 5.0.5 → 5.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -52,11 +52,19 @@ function deriveTitleFromBranch(branch) {
52
52
  const cleaned = rest.replace(/[-_/]+/g, ' ').trim();
53
53
  return cleaned ? `${prefix}: ${cleaned}` : null;
54
54
  }
55
- }
56
- // Final fallback return null (not '') when the branch normalizes to an
57
- // empty string (e.g. `_`, `---`). The caller chains via `??`, which only
58
- // short-circuits on null/undefined; an empty string would skip the rest
59
- // of the fallback chain and produce an empty PR title.
55
+ // Unknown prefix that contains a slash — treat the segment after the
56
+ // first slash as the descriptive part and default the conventional
57
+ // type to `chore:`. Example: `autopilot-test/validate-weights`
58
+ // `chore: validate weights` rather than the prefix-less
59
+ // `autopilot test validate weights` (which fails commitlint and looks
60
+ // half-finished in PR titles).
61
+ const cleanedRest = rest.replace(/[-_/]+/g, ' ').trim();
62
+ if (cleanedRest)
63
+ return `chore: ${cleanedRest}`;
64
+ }
65
+ // No slash — return cleaned branch name, or null when it normalizes empty
66
+ // (e.g. `_`, `---`). The caller chains via `??`, which only short-circuits
67
+ // on null/undefined; an empty string would skip the rest of the fallback.
60
68
  const cleaned = branch.replace(/[-_/]+/g, ' ').trim();
61
69
  return cleaned || null;
62
70
  }
@@ -133,6 +133,19 @@ export async function runScan(options = {}) {
133
133
  cwd,
134
134
  gitSummary: focusHint,
135
135
  });
136
+ // Single-file scan fallback — when only one file was scanned, the LLM
137
+ // doesn't always repeat the file path in its findings (it knows the
138
+ // context). Backfill `<unspecified>` with the actual scan target so the
139
+ // `fix` command can match findings to real paths. Without this, a
140
+ // `claude-autopilot scan src/foo.ts` produces findings with file
141
+ // `<unspecified>` and `fix --severity all` reports "no fixable findings".
142
+ if (relFiles.length === 1) {
143
+ const onlyFile = relFiles[0];
144
+ for (const f of result.findings) {
145
+ if (!f.file || f.file === '<unspecified>')
146
+ f.file = onlyFile;
147
+ }
148
+ }
136
149
  // Apply ignore rules
137
150
  const ignoreRules = [...loadIgnoreRules(cwd), ...parseConfigIgnore(config.ignore)];
138
151
  const findings = applyIgnoreRules(result.findings, ignoreRules);
@@ -112,7 +112,15 @@ export async function runSetup(options = {}) {
112
112
  throw new Error(`Preset config not found for: ${detection.preset}. Looked in:\n ${presetSearchPaths(detection.preset, cwd).join('\n ')}`);
113
113
  }
114
114
  let presetContent = await fsAsync.readFile(presetConfigPath, 'utf8');
115
- presetContent = presetContent.trimEnd() + `\ntestCommand: "${detection.testCommand}"\n`;
115
+ // Only append testCommand if the preset doesn't already declare one — several
116
+ // presets (go, python, python-fastapi, rails-postgres) ship with their own
117
+ // testCommand line. Unconditionally appending produced duplicate YAML keys
118
+ // ("testCommand" twice in the same map), which yaml parsers reject. After
119
+ // 5.0.5 that broke `setup` on Python repos: every command after setup
120
+ // hard-failed until the user manually edited the file.
121
+ if (!/^testCommand\s*:/m.test(presetContent)) {
122
+ presetContent = presetContent.trimEnd() + `\ntestCommand: "${detection.testCommand}"\n`;
123
+ }
116
124
  // Apply profile overlay if specified
117
125
  if (options.profile) {
118
126
  const profile = PROFILES[options.profile];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@delegance/claude-autopilot",
3
- "version": "5.0.5",
3
+ "version": "5.0.6",
4
4
  "type": "module",
5
5
  "description": "Autonomous development pipeline for Claude Code: brainstorm → spec → plan → implement → migrate → validate → PR → review → merge. Multi-model, local-first, every phase a skill you can intervene in.",
6
6
  "keywords": [