karajan-code 4.20.0 → 4.20.1
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.
- package/package.json +1 -1
- package/src/commands/start.js +6 -2
- package/src/start/sweep.js +3 -0
package/package.json
CHANGED
package/src/commands/start.js
CHANGED
|
@@ -80,7 +80,11 @@ export async function startCommand({ task = "", config, logger, flags = {}, deps
|
|
|
80
80
|
const spawn = deps.spawnKj || spawnKj;
|
|
81
81
|
const makeWizard = deps.makeWizard || (() => createWizard());
|
|
82
82
|
|
|
83
|
-
|
|
83
|
+
// KJC-BUG-0145 (campo, #1471): loadConfig never sets projectDir — passing
|
|
84
|
+
// config.projectDir straight through handed `undefined` to the sweep, every
|
|
85
|
+
// collector failed silently and the project read as "new, no source code".
|
|
86
|
+
const projectDir = config.projectDir || process.cwd();
|
|
87
|
+
const bundle = await sweep(projectDir, { declared: flags.maturity || null });
|
|
84
88
|
const { text, summary } = assess(bundle);
|
|
85
89
|
let result = await decide({ task, text, config, logger, makeDecider });
|
|
86
90
|
|
|
@@ -111,7 +115,7 @@ export async function startCommand({ task = "", config, logger, flags = {}, deps
|
|
|
111
115
|
// Dispatch the chosen intent to its saved command, confirming first (it writes).
|
|
112
116
|
const toArgs = DISPATCH[result.intent];
|
|
113
117
|
if (interactive && toArgs && (await confirmApply(makeWizard))) {
|
|
114
|
-
await spawn(toArgs(goal), { cwd:
|
|
118
|
+
await spawn(toArgs(goal), { cwd: projectDir });
|
|
115
119
|
}
|
|
116
120
|
return { ok: true, intent: result.intent };
|
|
117
121
|
}
|
package/src/start/sweep.js
CHANGED
|
@@ -112,6 +112,9 @@ function readRagStatus(projectDir) {
|
|
|
112
112
|
* declared = user-declared maturity; deps = injected collaborators (defaults = real collectors).
|
|
113
113
|
*/
|
|
114
114
|
export async function runReadOnlySweep(projectDir, { declared = null, profile = "standard", deps = {} } = {}) {
|
|
115
|
+
// KJC-BUG-0145: a missing projectDir must fail LOUD — every collector is
|
|
116
|
+
// wrapped in safe(), so an undefined root used to read as an empty project.
|
|
117
|
+
if (!projectDir) throw new Error("runReadOnlySweep: projectDir is required (got " + String(projectDir) + ")");
|
|
115
118
|
const d = {
|
|
116
119
|
collectAll, detectTestFramework, checkHarden, compareHarden, sourceScan: deepSourceScan,
|
|
117
120
|
detectQmd, ragStatus: readRagStatus, gitAgeDays: lastCommitAgeDays, ...deps,
|