fix(query): thread workstream through all query handlers

All 18+ query handlers accepted _workstream but never forwarded it to
planningPaths/loadConfig/getMilestoneInfo. Remove _ prefix and pass
workstream to all internal helper calls so --ws flag actually scopes
path resolution.

Affected handlers: initNewProject, initProgress, initManager, configGet,
configPath, configSet, configSetModelProfile, configNewProject,
configEnsureSection, validateHealth, commit, checkCommit, commitToSubrepo.

Also fixes validate.ts to use paths.* fields from planningPaths instead
of hardcoded join(projectDir, '.planning') paths.

Closes #2731
This commit is contained in:
Tom Boucher
2026-04-26 10:53:17 -04:00
parent f6cddc5b2f
commit 3a623b1117
5 changed files with 37 additions and 37 deletions

View File

@@ -79,13 +79,13 @@ export function getAgentToModelMapForProfile(normalizedProfile: string): Record<
* @returns QueryResult with the config value at the given path
* @throws GSDError with Validation classification if key missing or not found
*/
export const configGet: QueryHandler = async (args, projectDir, _workstream) => {
export const configGet: QueryHandler = async (args, projectDir, workstream) => {
const keyPath = args[0];
if (!keyPath) {
throw new GSDError('Usage: config-get <key.path>', ErrorClassification.Validation);
}
const paths = planningPaths(projectDir);
const paths = planningPaths(projectDir, workstream);
let raw: string;
try {
raw = await readFile(paths.config, 'utf-8');
@@ -129,8 +129,8 @@ export const configGet: QueryHandler = async (args, projectDir, _workstream) =>
* @param projectDir - Project root directory
* @returns QueryResult with `{ path: string }` absolute or project-relative resolution via planningPaths
*/
export const configPath: QueryHandler = async (_args, projectDir, _workstream) => {
const paths = planningPaths(projectDir);
export const configPath: QueryHandler = async (_args, projectDir, workstream) => {
const paths = planningPaths(projectDir, workstream);
return { data: { path: paths.config } };
};