fix: resolve integration issues after phase branch merges
- Register errandProcedures in appRouter (was defined but never spread) - Fix nullable projectId guard in errand delete/abandon procedures - Add sendUserMessage stub to MockAgentManager in headquarters and radar-procedures tests (AgentManager interface gained this method) - Add missing qualityReview field to Initiative fixture in file-io test (schema gained this column from the quality-review phase) - Cast conflictFiles access in CLI errand resolve command Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -52,6 +52,7 @@ describe('writeInputFiles', () => {
|
|||||||
status: 'active',
|
status: 'active',
|
||||||
branch: 'cw/test-initiative',
|
branch: 'cw/test-initiative',
|
||||||
executionMode: 'review_per_phase',
|
executionMode: 'review_per_phase',
|
||||||
|
qualityReview: false,
|
||||||
createdAt: new Date('2026-01-01'),
|
createdAt: new Date('2026-01-01'),
|
||||||
updatedAt: new Date('2026-01-02'),
|
updatedAt: new Date('2026-01-02'),
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1878,7 +1878,7 @@ See the Codewalkers documentation for .cw-preview.yml format and options.`;
|
|||||||
: `.cw-worktrees/${id}`;
|
: `.cw-worktrees/${id}`;
|
||||||
console.log(`Resolve conflicts in worktree: ${worktreePath}`);
|
console.log(`Resolve conflicts in worktree: ${worktreePath}`);
|
||||||
console.log('Conflicting files:');
|
console.log('Conflicting files:');
|
||||||
for (const f of errand.conflictFiles ?? []) {
|
for (const f of (errand as any).conflictFiles ?? []) {
|
||||||
console.log(` ${f}`);
|
console.log(` ${f}`);
|
||||||
}
|
}
|
||||||
console.log('After resolving: stage and commit changes in the worktree, then run:');
|
console.log('After resolving: stage and commit changes in the worktree, then run:');
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ class MockAgentManager implements AgentManager {
|
|||||||
async delete(): Promise<void> { throw new Error('Not implemented'); }
|
async delete(): Promise<void> { throw new Error('Not implemented'); }
|
||||||
async dismiss(): Promise<void> { throw new Error('Not implemented'); }
|
async dismiss(): Promise<void> { throw new Error('Not implemented'); }
|
||||||
async resumeForConversation(): Promise<boolean> { return false; }
|
async resumeForConversation(): Promise<boolean> { return false; }
|
||||||
|
async sendUserMessage(): Promise<void> { throw new Error('Not implemented'); }
|
||||||
}
|
}
|
||||||
|
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ class MockAgentManager implements AgentManager {
|
|||||||
async delete(): Promise<void> { throw new Error('Not implemented'); }
|
async delete(): Promise<void> { throw new Error('Not implemented'); }
|
||||||
async dismiss(): Promise<void> { throw new Error('Not implemented'); }
|
async dismiss(): Promise<void> { throw new Error('Not implemented'); }
|
||||||
async resumeForConversation(): Promise<boolean> { return false; }
|
async resumeForConversation(): Promise<boolean> { return false; }
|
||||||
|
async sendUserMessage(): Promise<void> { throw new Error('Not implemented'); }
|
||||||
}
|
}
|
||||||
|
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import { previewProcedures } from './routers/preview.js';
|
|||||||
import { conversationProcedures } from './routers/conversation.js';
|
import { conversationProcedures } from './routers/conversation.js';
|
||||||
import { chatSessionProcedures } from './routers/chat-session.js';
|
import { chatSessionProcedures } from './routers/chat-session.js';
|
||||||
import { headquartersProcedures } from './routers/headquarters.js';
|
import { headquartersProcedures } from './routers/headquarters.js';
|
||||||
|
import { errandProcedures } from './routers/errand.js';
|
||||||
|
|
||||||
// Re-export tRPC primitives (preserves existing import paths)
|
// Re-export tRPC primitives (preserves existing import paths)
|
||||||
export { router, publicProcedure, middleware, createCallerFactory } from './trpc.js';
|
export { router, publicProcedure, middleware, createCallerFactory } from './trpc.js';
|
||||||
@@ -65,6 +66,7 @@ export const appRouter = router({
|
|||||||
...conversationProcedures(publicProcedure),
|
...conversationProcedures(publicProcedure),
|
||||||
...chatSessionProcedures(publicProcedure),
|
...chatSessionProcedures(publicProcedure),
|
||||||
...headquartersProcedures(publicProcedure),
|
...headquartersProcedures(publicProcedure),
|
||||||
|
...errandProcedures(publicProcedure),
|
||||||
});
|
});
|
||||||
|
|
||||||
export type AppRouter = typeof appRouter;
|
export type AppRouter = typeof appRouter;
|
||||||
|
|||||||
@@ -350,6 +350,7 @@ export function errandProcedures(publicProcedure: ProcedureBuilder) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Remove worktree and branch (best-effort)
|
// Remove worktree and branch (best-effort)
|
||||||
|
if (errand.projectId) {
|
||||||
const project = await requireProjectRepository(ctx).findById(errand.projectId);
|
const project = await requireProjectRepository(ctx).findById(errand.projectId);
|
||||||
if (project) {
|
if (project) {
|
||||||
const clonePath = await resolveClonePath(project, ctx);
|
const clonePath = await resolveClonePath(project, ctx);
|
||||||
@@ -357,6 +358,7 @@ export function errandProcedures(publicProcedure: ProcedureBuilder) {
|
|||||||
try { await worktreeManager.remove(errand.id); } catch { /* no-op if already gone */ }
|
try { await worktreeManager.remove(errand.id); } catch { /* no-op if already gone */ }
|
||||||
try { await requireBranchManager(ctx).deleteBranch(clonePath, errand.branch); } catch { /* no-op */ }
|
try { await requireBranchManager(ctx).deleteBranch(clonePath, errand.branch); } catch { /* no-op */ }
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
await repo.delete(errand.id);
|
await repo.delete(errand.id);
|
||||||
return { success: true };
|
return { success: true };
|
||||||
@@ -426,6 +428,7 @@ export function errandProcedures(publicProcedure: ProcedureBuilder) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Remove worktree and branch (best-effort)
|
// Remove worktree and branch (best-effort)
|
||||||
|
if (errand.projectId) {
|
||||||
const project = await requireProjectRepository(ctx).findById(errand.projectId);
|
const project = await requireProjectRepository(ctx).findById(errand.projectId);
|
||||||
if (project) {
|
if (project) {
|
||||||
const clonePath = await resolveClonePath(project, ctx);
|
const clonePath = await resolveClonePath(project, ctx);
|
||||||
@@ -433,6 +436,7 @@ export function errandProcedures(publicProcedure: ProcedureBuilder) {
|
|||||||
try { await worktreeManager.remove(errand.id); } catch { /* no-op if already gone */ }
|
try { await worktreeManager.remove(errand.id); } catch { /* no-op if already gone */ }
|
||||||
try { await branchManager.deleteBranch(clonePath, errand.branch); } catch { /* no-op */ }
|
try { await branchManager.deleteBranch(clonePath, errand.branch); } catch { /* no-op */ }
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const updated = await repo.update(input.id, { status: 'abandoned' });
|
const updated = await repo.update(input.id, { status: 'abandoned' });
|
||||||
return updated;
|
return updated;
|
||||||
|
|||||||
Reference in New Issue
Block a user