macro-agent 0.1.8 → 0.1.11
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/CLAUDE.md +263 -33
- package/README.md +781 -131
- package/dist/acp/claude-code-replay.d.ts +11 -0
- package/dist/acp/claude-code-replay.d.ts.map +1 -0
- package/dist/acp/claude-code-replay.js +190 -0
- package/dist/acp/claude-code-replay.js.map +1 -0
- package/dist/acp/macro-agent.d.ts.map +1 -1
- package/dist/acp/macro-agent.js +192 -7
- package/dist/acp/macro-agent.js.map +1 -1
- package/dist/acp/types.d.ts +9 -0
- package/dist/acp/types.d.ts.map +1 -1
- package/dist/acp/types.js.map +1 -1
- package/dist/adapters/tasks-adapter.d.ts.map +1 -1
- package/dist/adapters/tasks-adapter.js +3 -0
- package/dist/adapters/tasks-adapter.js.map +1 -1
- package/dist/adapters/types.d.ts +1 -0
- package/dist/adapters/types.d.ts.map +1 -1
- package/dist/agent/agent-manager-v2.d.ts +21 -0
- package/dist/agent/agent-manager-v2.d.ts.map +1 -1
- package/dist/agent/agent-manager-v2.js +308 -54
- package/dist/agent/agent-manager-v2.js.map +1 -1
- package/dist/agent/agent-manager.d.ts +12 -0
- package/dist/agent/agent-manager.d.ts.map +1 -1
- package/dist/agent/agent-manager.js.map +1 -1
- package/dist/agent/agent-store.d.ts +10 -0
- package/dist/agent/agent-store.d.ts.map +1 -1
- package/dist/agent/agent-store.js +22 -0
- package/dist/agent/agent-store.js.map +1 -1
- package/dist/agent/types.d.ts +15 -2
- package/dist/agent/types.d.ts.map +1 -1
- package/dist/agent/types.js.map +1 -1
- package/dist/boot-v2.d.ts +129 -1
- package/dist/boot-v2.d.ts.map +1 -1
- package/dist/boot-v2.js +359 -8
- package/dist/boot-v2.js.map +1 -1
- package/dist/cli/acp.js +4 -0
- package/dist/cli/acp.js.map +1 -1
- package/dist/cli/index.js +56 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cognitive/macro-agent-backend.d.ts.map +1 -1
- package/dist/cognitive/macro-agent-backend.js +40 -22
- package/dist/cognitive/macro-agent-backend.js.map +1 -1
- package/dist/integrations/skilltree.d.ts.map +1 -1
- package/dist/integrations/skilltree.js +1 -0
- package/dist/integrations/skilltree.js.map +1 -1
- package/dist/lifecycle/cascade.d.ts +25 -2
- package/dist/lifecycle/cascade.d.ts.map +1 -1
- package/dist/lifecycle/cascade.js +70 -2
- package/dist/lifecycle/cascade.js.map +1 -1
- package/dist/lifecycle/cleanup.d.ts +33 -2
- package/dist/lifecycle/cleanup.d.ts.map +1 -1
- package/dist/lifecycle/cleanup.js +28 -6
- package/dist/lifecycle/cleanup.js.map +1 -1
- package/dist/lifecycle/handlers-v2.d.ts +7 -0
- package/dist/lifecycle/handlers-v2.d.ts.map +1 -1
- package/dist/lifecycle/handlers-v2.js +28 -2
- package/dist/lifecycle/handlers-v2.js.map +1 -1
- package/dist/lifecycle/types.d.ts +11 -0
- package/dist/lifecycle/types.d.ts.map +1 -1
- package/dist/lifecycle/types.js.map +1 -1
- package/dist/map/acp-bridge.d.ts +9 -0
- package/dist/map/acp-bridge.d.ts.map +1 -1
- package/dist/map/acp-bridge.js +15 -2
- package/dist/map/acp-bridge.js.map +1 -1
- package/dist/map/cascade-action-handler.d.ts +24 -0
- package/dist/map/cascade-action-handler.d.ts.map +1 -0
- package/dist/map/cascade-action-handler.js +170 -0
- package/dist/map/cascade-action-handler.js.map +1 -0
- package/dist/map/cascade-bridge.d.ts +44 -0
- package/dist/map/cascade-bridge.d.ts.map +1 -0
- package/dist/map/cascade-bridge.js +294 -0
- package/dist/map/cascade-bridge.js.map +1 -0
- package/dist/map/coordination-handler.d.ts.map +1 -1
- package/dist/map/coordination-handler.js +12 -1
- package/dist/map/coordination-handler.js.map +1 -1
- package/dist/map/lifecycle-bridge.d.ts +1 -1
- package/dist/map/lifecycle-bridge.d.ts.map +1 -1
- package/dist/map/lifecycle-bridge.js +58 -23
- package/dist/map/lifecycle-bridge.js.map +1 -1
- package/dist/map/server.d.ts.map +1 -1
- package/dist/map/server.js +219 -7
- package/dist/map/server.js.map +1 -1
- package/dist/map/sidecar.d.ts.map +1 -1
- package/dist/map/sidecar.js +49 -2
- package/dist/map/sidecar.js.map +1 -1
- package/dist/map/types.d.ts +22 -0
- package/dist/map/types.d.ts.map +1 -1
- package/dist/mcp/tools/done-v2.d.ts.map +1 -1
- package/dist/mcp/tools/done-v2.js +8 -0
- package/dist/mcp/tools/done-v2.js.map +1 -1
- package/dist/teams/team-manager-v2.d.ts.map +1 -1
- package/dist/teams/team-manager-v2.js +26 -0
- package/dist/teams/team-manager-v2.js.map +1 -1
- package/dist/teams/team-runtime-v2.d.ts.map +1 -1
- package/dist/teams/team-runtime-v2.js +16 -3
- package/dist/teams/team-runtime-v2.js.map +1 -1
- package/dist/workspace/config.d.ts +10 -10
- package/dist/workspace/config.d.ts.map +1 -1
- package/dist/workspace/config.js +4 -4
- package/dist/workspace/config.js.map +1 -1
- package/dist/workspace/git-cascade-adapter.d.ts +510 -0
- package/dist/workspace/git-cascade-adapter.d.ts.map +1 -0
- package/dist/workspace/git-cascade-adapter.js +934 -0
- package/dist/workspace/git-cascade-adapter.js.map +1 -0
- package/dist/workspace/index.d.ts +3 -3
- package/dist/workspace/index.d.ts.map +1 -1
- package/dist/workspace/index.js +4 -4
- package/dist/workspace/index.js.map +1 -1
- package/dist/workspace/landing/direct-push.d.ts +20 -0
- package/dist/workspace/landing/direct-push.d.ts.map +1 -0
- package/dist/workspace/landing/direct-push.js +74 -0
- package/dist/workspace/landing/direct-push.js.map +1 -0
- package/dist/workspace/landing/index.d.ts +29 -0
- package/dist/workspace/landing/index.d.ts.map +1 -0
- package/dist/workspace/landing/index.js +37 -0
- package/dist/workspace/landing/index.js.map +1 -0
- package/dist/workspace/landing/merge-to-parent.d.ts +41 -0
- package/dist/workspace/landing/merge-to-parent.d.ts.map +1 -0
- package/dist/workspace/landing/merge-to-parent.js +186 -0
- package/dist/workspace/landing/merge-to-parent.js.map +1 -0
- package/dist/workspace/landing/optimistic-push.d.ts +16 -0
- package/dist/workspace/landing/optimistic-push.d.ts.map +1 -0
- package/dist/workspace/landing/optimistic-push.js +27 -0
- package/dist/workspace/landing/optimistic-push.js.map +1 -0
- package/dist/workspace/landing/queue-to-branch.d.ts +24 -0
- package/dist/workspace/landing/queue-to-branch.d.ts.map +1 -0
- package/dist/workspace/landing/queue-to-branch.js +79 -0
- package/dist/workspace/landing/queue-to-branch.js.map +1 -0
- package/dist/workspace/merge-queue/merge-queue.d.ts +10 -0
- package/dist/workspace/merge-queue/merge-queue.d.ts.map +1 -1
- package/dist/workspace/merge-queue/merge-queue.js +10 -0
- package/dist/workspace/merge-queue/merge-queue.js.map +1 -1
- package/dist/workspace/merge-queue/types.d.ts +16 -2
- package/dist/workspace/merge-queue/types.d.ts.map +1 -1
- package/dist/workspace/merge-queue/types.js +9 -0
- package/dist/workspace/merge-queue/types.js.map +1 -1
- package/dist/workspace/pool/types.d.ts +1 -0
- package/dist/workspace/pool/types.d.ts.map +1 -1
- package/dist/workspace/pool/worktree-pool.d.ts.map +1 -1
- package/dist/workspace/pool/worktree-pool.js +1 -0
- package/dist/workspace/pool/worktree-pool.js.map +1 -1
- package/dist/workspace/recovery/abandon.d.ts +15 -0
- package/dist/workspace/recovery/abandon.d.ts.map +1 -0
- package/dist/workspace/recovery/abandon.js +45 -0
- package/dist/workspace/recovery/abandon.js.map +1 -0
- package/dist/workspace/recovery/auto-resolve.d.ts +27 -0
- package/dist/workspace/recovery/auto-resolve.d.ts.map +1 -0
- package/dist/workspace/recovery/auto-resolve.js +99 -0
- package/dist/workspace/recovery/auto-resolve.js.map +1 -0
- package/dist/workspace/recovery/defer.d.ts +15 -0
- package/dist/workspace/recovery/defer.d.ts.map +1 -0
- package/dist/workspace/recovery/defer.js +16 -0
- package/dist/workspace/recovery/defer.js.map +1 -0
- package/dist/workspace/recovery/escalate.d.ts +16 -0
- package/dist/workspace/recovery/escalate.d.ts.map +1 -0
- package/dist/workspace/recovery/escalate.js +24 -0
- package/dist/workspace/recovery/escalate.js.map +1 -0
- package/dist/workspace/recovery/index.d.ts +32 -0
- package/dist/workspace/recovery/index.d.ts.map +1 -0
- package/dist/workspace/recovery/index.js +45 -0
- package/dist/workspace/recovery/index.js.map +1 -0
- package/dist/workspace/recovery/spawn-resolver.d.ts +45 -0
- package/dist/workspace/recovery/spawn-resolver.d.ts.map +1 -0
- package/dist/workspace/recovery/spawn-resolver.js +118 -0
- package/dist/workspace/recovery/spawn-resolver.js.map +1 -0
- package/dist/workspace/recovery/types.d.ts +63 -0
- package/dist/workspace/recovery/types.d.ts.map +1 -0
- package/dist/workspace/recovery/types.js +12 -0
- package/dist/workspace/recovery/types.js.map +1 -0
- package/dist/workspace/topology/index.d.ts +9 -0
- package/dist/workspace/topology/index.d.ts.map +1 -0
- package/dist/workspace/topology/index.js +8 -0
- package/dist/workspace/topology/index.js.map +1 -0
- package/dist/workspace/topology/no-workspace.d.ts +18 -0
- package/dist/workspace/topology/no-workspace.d.ts.map +1 -0
- package/dist/workspace/topology/no-workspace.js +25 -0
- package/dist/workspace/topology/no-workspace.js.map +1 -0
- package/dist/workspace/topology/types.d.ts +97 -0
- package/dist/workspace/topology/types.d.ts.map +1 -0
- package/dist/workspace/topology/types.js +20 -0
- package/dist/workspace/topology/types.js.map +1 -0
- package/dist/workspace/topology/yaml-driven.d.ts +69 -0
- package/dist/workspace/topology/yaml-driven.d.ts.map +1 -0
- package/dist/workspace/topology/yaml-driven.js +273 -0
- package/dist/workspace/topology/yaml-driven.js.map +1 -0
- package/dist/workspace/types-v3.d.ts +117 -0
- package/dist/workspace/types-v3.d.ts.map +1 -0
- package/dist/workspace/types-v3.js +20 -0
- package/dist/workspace/types-v3.js.map +1 -0
- package/dist/workspace/types.d.ts +162 -17
- package/dist/workspace/types.d.ts.map +1 -1
- package/dist/workspace/workspace-manager.d.ts +101 -13
- package/dist/workspace/workspace-manager.d.ts.map +1 -1
- package/dist/workspace/workspace-manager.js +416 -13
- package/dist/workspace/workspace-manager.js.map +1 -1
- package/dist/workspace/yaml-schema.d.ts +254 -0
- package/dist/workspace/yaml-schema.d.ts.map +1 -0
- package/dist/workspace/yaml-schema.js +170 -0
- package/dist/workspace/yaml-schema.js.map +1 -0
- package/docs/conflict-recovery.md +472 -0
- package/docs/design/task-dispatcher.md +880 -0
- package/docs/git-cascade-integration-gaps.md +678 -0
- package/docs/workspace-interfaces.md +731 -0
- package/docs/workspace-redesign-plan.md +302 -0
- package/package.json +6 -5
- package/src/__tests__/boot-v2.test.ts +435 -0
- package/src/__tests__/e2e/acp-over-map.e2e.test.ts +92 -0
- package/src/__tests__/e2e/auto-sync.e2e.test.ts +257 -0
- package/src/__tests__/e2e/bootstrap.e2e.test.ts +319 -0
- package/src/__tests__/e2e/cascade-rebase.e2e.test.ts +254 -0
- package/src/__tests__/e2e/cli-run.e2e.test.ts +167 -0
- package/src/__tests__/e2e/dispatch-coordination.e2e.test.ts +495 -0
- package/src/__tests__/e2e/dispatch-live.e2e.test.ts +564 -0
- package/src/__tests__/e2e/dispatch-opentasks.e2e.test.ts +496 -0
- package/src/__tests__/e2e/dispatch-phase2-live.e2e.test.ts +456 -0
- package/src/__tests__/e2e/dispatch-phase2.e2e.test.ts +386 -0
- package/src/__tests__/e2e/dispatch.e2e.test.ts +376 -0
- package/src/__tests__/e2e/self-driving-v3.e2e.test.ts +197 -0
- package/src/__tests__/e2e/spawn-resolver.e2e.test.ts +200 -0
- package/src/__tests__/e2e/workspace-lifecycle.e2e.test.ts +30 -22
- package/src/__tests__/e2e/workspace-v3.e2e.test.ts +413 -0
- package/src/acp/__tests__/claude-code-replay.test.ts +225 -0
- package/src/acp/__tests__/macro-agent.test.ts +39 -1
- package/src/acp/claude-code-replay.ts +208 -0
- package/src/acp/macro-agent.ts +203 -10
- package/src/acp/types.ts +10 -0
- package/src/adapters/__tests__/tasks-adapter.test.ts +1 -0
- package/src/adapters/tasks-adapter.ts +3 -0
- package/src/adapters/types.ts +1 -0
- package/src/agent/__tests__/agent-manager-topology.test.ts +73 -0
- package/src/agent/__tests__/agent-manager-v2.test.ts +66 -0
- package/src/agent/__tests__/agent-store.test.ts +52 -0
- package/src/agent/__tests__/task-ref-resolution.test.ts +231 -0
- package/src/agent/agent-manager-v2.ts +372 -59
- package/src/agent/agent-manager.ts +14 -0
- package/src/agent/agent-store.ts +24 -0
- package/src/agent/types.ts +16 -2
- package/src/boot-v2.ts +589 -35
- package/src/cli/acp.ts +4 -0
- package/src/cli/index.ts +61 -0
- package/src/cognitive/macro-agent-backend.ts +45 -29
- package/src/integrations/skilltree.ts +1 -0
- package/src/lifecycle/__tests__/cascade-consolidation.test.ts +240 -0
- package/src/lifecycle/cascade.ts +77 -2
- package/src/lifecycle/cleanup.ts +52 -3
- package/src/lifecycle/handlers-v2.ts +40 -3
- package/src/lifecycle/types.ts +12 -0
- package/src/map/__tests__/cascade-bridge.test.ts +229 -0
- package/src/map/__tests__/emit-event.test.ts +71 -0
- package/src/map/__tests__/lifecycle-bridge.test.ts +86 -10
- package/src/map/acp-bridge.ts +26 -3
- package/src/map/cascade-action-handler.ts +205 -0
- package/src/map/cascade-bridge.ts +339 -0
- package/src/map/coordination-handler.ts +13 -1
- package/src/map/lifecycle-bridge.ts +52 -17
- package/src/map/server.ts +225 -7
- package/src/map/sidecar.ts +48 -1
- package/src/map/types.ts +23 -0
- package/src/mcp/tools/done-v2.ts +9 -0
- package/src/teams/team-manager-v2.ts +37 -0
- package/src/teams/team-runtime-v2.ts +23 -3
- package/src/workspace/__tests__/{dataplane-adapter.test.ts → git-cascade-adapter.test.ts} +209 -14
- package/src/workspace/__tests__/land-dispatch.test.ts +214 -0
- package/src/workspace/__tests__/self-driving-yaml.test.ts +114 -0
- package/src/workspace/__tests__/shared-worktree-refcount.test.ts +154 -0
- package/src/workspace/__tests__/standalone-mode.test.ts +118 -0
- package/src/workspace/__tests__/workspace-manager-v3.test.ts +245 -0
- package/src/workspace/__tests__/yaml-schema.test.ts +210 -0
- package/src/workspace/config.ts +11 -11
- package/src/workspace/git-cascade-adapter.ts +1213 -0
- package/src/workspace/index.ts +11 -11
- package/src/workspace/landing/__tests__/strategies.test.ts +184 -0
- package/src/workspace/landing/direct-push.ts +91 -0
- package/src/workspace/landing/index.ts +40 -0
- package/src/workspace/landing/merge-to-parent.ts +229 -0
- package/src/workspace/landing/optimistic-push.ts +36 -0
- package/src/workspace/landing/queue-to-branch.ts +108 -0
- package/src/workspace/merge-queue/merge-queue.ts +10 -0
- package/src/workspace/merge-queue/types.ts +16 -2
- package/src/workspace/pool/__tests__/worktree-pool.integration.test.ts +5 -5
- package/src/workspace/pool/types.ts +1 -0
- package/src/workspace/pool/worktree-pool.ts +1 -0
- package/src/workspace/recovery/__tests__/auto-resolve-integration.test.ts +127 -0
- package/src/workspace/recovery/__tests__/spawn-resolver.test.ts +139 -0
- package/src/workspace/recovery/__tests__/strategies.test.ts +145 -0
- package/src/workspace/recovery/abandon.ts +51 -0
- package/src/workspace/recovery/auto-resolve.ts +119 -0
- package/src/workspace/recovery/defer.ts +23 -0
- package/src/workspace/recovery/escalate.ts +30 -0
- package/src/workspace/recovery/index.ts +58 -0
- package/src/workspace/recovery/spawn-resolver.ts +152 -0
- package/src/workspace/recovery/types.ts +54 -0
- package/src/workspace/topology/__tests__/yaml-driven.test.ts +345 -0
- package/src/workspace/topology/index.ts +18 -0
- package/src/workspace/topology/no-workspace.ts +39 -0
- package/src/workspace/topology/types.ts +116 -0
- package/src/workspace/topology/yaml-driven.ts +316 -0
- package/src/workspace/types-v3.ts +162 -0
- package/src/workspace/types.ts +211 -20
- package/src/workspace/workspace-manager.ts +533 -19
- package/src/workspace/yaml-schema.ts +216 -0
- package/dist/workspace/dataplane-adapter.d.ts +0 -260
- package/dist/workspace/dataplane-adapter.d.ts.map +0 -1
- package/dist/workspace/dataplane-adapter.js +0 -416
- package/dist/workspace/dataplane-adapter.js.map +0 -1
- package/src/workspace/dataplane-adapter.ts +0 -546
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* YAML schema validation tests (Phase 2).
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { describe, it, expect } from 'vitest';
|
|
6
|
+
import {
|
|
7
|
+
parseTeamWorkspaceConfig,
|
|
8
|
+
extractWorkspaceConfig,
|
|
9
|
+
TeamWorkspaceConfigSchema,
|
|
10
|
+
RoleWorkspaceConfigSchema,
|
|
11
|
+
} from '../yaml-schema.js';
|
|
12
|
+
|
|
13
|
+
describe('YAML schema', () => {
|
|
14
|
+
describe('parseTeamWorkspaceConfig', () => {
|
|
15
|
+
it('returns null when input is undefined', () => {
|
|
16
|
+
expect(parseTeamWorkspaceConfig(undefined)).toBeNull();
|
|
17
|
+
expect(parseTeamWorkspaceConfig(null)).toBeNull();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('accepts a minimal peer-swarm-style config', () => {
|
|
21
|
+
const config = parseTeamWorkspaceConfig({
|
|
22
|
+
roles: {
|
|
23
|
+
peer: {
|
|
24
|
+
workspace: 'new_stream',
|
|
25
|
+
stream_lineage: 'fork_from_team_root',
|
|
26
|
+
landing: 'merge_to_parent_stream',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
expect(config).not.toBeNull();
|
|
31
|
+
expect(config!.on_team_complete).toBe('keep'); // default
|
|
32
|
+
expect(config!.roles.peer.workspace).toBe('new_stream');
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it('applies defaults for default_stream', () => {
|
|
36
|
+
const config = parseTeamWorkspaceConfig({
|
|
37
|
+
default_stream: {},
|
|
38
|
+
roles: { x: { workspace: 'none' } },
|
|
39
|
+
});
|
|
40
|
+
expect(config!.default_stream?.fork_from).toBe('main');
|
|
41
|
+
expect(config!.default_stream?.change_id_tracking).toBe(true);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it('requires share_with when workspace is share_with_agent', () => {
|
|
45
|
+
expect(() =>
|
|
46
|
+
parseTeamWorkspaceConfig({
|
|
47
|
+
roles: {
|
|
48
|
+
reviewer: { workspace: 'share_with_agent' },
|
|
49
|
+
},
|
|
50
|
+
})
|
|
51
|
+
).toThrow(/share_with is required/);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it('requires track_branch when stream_lineage is track_existing_branch', () => {
|
|
55
|
+
expect(() =>
|
|
56
|
+
parseTeamWorkspaceConfig({
|
|
57
|
+
roles: {
|
|
58
|
+
resolver: {
|
|
59
|
+
workspace: 'new_stream',
|
|
60
|
+
stream_lineage: 'track_existing_branch',
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
})
|
|
64
|
+
).toThrow(/track_branch is required/);
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
it('requires stream_lineage when workspace is new_stream', () => {
|
|
68
|
+
expect(() =>
|
|
69
|
+
parseTeamWorkspaceConfig({
|
|
70
|
+
roles: {
|
|
71
|
+
x: { workspace: 'new_stream' },
|
|
72
|
+
},
|
|
73
|
+
})
|
|
74
|
+
).toThrow(/stream_lineage is required/);
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it('accepts triad shape with queue_to_branch + merge_queue.drain', () => {
|
|
78
|
+
const config = parseTeamWorkspaceConfig({
|
|
79
|
+
on_team_complete: 'keep',
|
|
80
|
+
roles: {
|
|
81
|
+
coordinator: { workspace: 'attach_to_team_root' },
|
|
82
|
+
worker: {
|
|
83
|
+
workspace: 'new_stream',
|
|
84
|
+
stream_lineage: 'fork_from_parent',
|
|
85
|
+
landing: 'queue_to_branch',
|
|
86
|
+
landing_config: { target: 'team_root' },
|
|
87
|
+
capabilities: ['workspace.commit', 'workspace.land'],
|
|
88
|
+
},
|
|
89
|
+
integrator: {
|
|
90
|
+
workspace: 'attach_to_team_root',
|
|
91
|
+
capabilities: ['workspace.merge', 'merge_queue.drain'],
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
});
|
|
95
|
+
expect(config).not.toBeNull();
|
|
96
|
+
expect(config!.roles.worker.landing).toBe('queue_to_branch');
|
|
97
|
+
expect(config!.roles.integrator.capabilities).toContain('merge_queue.drain');
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
it('accepts pipeline shape with share_with_agent', () => {
|
|
101
|
+
const config = parseTeamWorkspaceConfig({
|
|
102
|
+
roles: {
|
|
103
|
+
planner: { workspace: 'none' },
|
|
104
|
+
coder: {
|
|
105
|
+
workspace: 'new_stream',
|
|
106
|
+
stream_lineage: 'fork_from_team_root',
|
|
107
|
+
landing: 'queue_to_branch',
|
|
108
|
+
},
|
|
109
|
+
reviewer: {
|
|
110
|
+
workspace: 'share_with_agent',
|
|
111
|
+
share_with: 'coder',
|
|
112
|
+
capabilities: ['workspace.read'],
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
});
|
|
116
|
+
expect(config!.roles.reviewer.share_with).toBe('coder');
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
it('accepts long-lived feature config with cascade + auto-sync', () => {
|
|
120
|
+
const config = parseTeamWorkspaceConfig({
|
|
121
|
+
roles: {
|
|
122
|
+
feature_owner: {
|
|
123
|
+
workspace: 'new_stream',
|
|
124
|
+
stream_lineage: 'fork_from_team_root',
|
|
125
|
+
landing: 'merge_to_parent_stream',
|
|
126
|
+
cascade_on_parent_update: true,
|
|
127
|
+
on_parent_advanced: 'sync_with_parent',
|
|
128
|
+
},
|
|
129
|
+
subtask: {
|
|
130
|
+
workspace: 'new_stream',
|
|
131
|
+
stream_lineage: 'fork_from_parent',
|
|
132
|
+
landing: 'merge_to_parent_stream',
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
});
|
|
136
|
+
expect(config!.roles.feature_owner.cascade_on_parent_update).toBe(true);
|
|
137
|
+
expect(config!.roles.feature_owner.on_parent_advanced).toBe('sync_with_parent');
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
it('accepts conflict_recovery team defaults', () => {
|
|
141
|
+
const config = parseTeamWorkspaceConfig({
|
|
142
|
+
roles: { peer: { workspace: 'none' } },
|
|
143
|
+
conflict_recovery: {
|
|
144
|
+
default_strategy: 'spawn-resolver',
|
|
145
|
+
default_config: { role: 'resolver', timeout_ms: 1200000 },
|
|
146
|
+
max_recovery_depth: 5,
|
|
147
|
+
},
|
|
148
|
+
});
|
|
149
|
+
expect(config!.conflict_recovery?.default_strategy).toBe('spawn-resolver');
|
|
150
|
+
expect(config!.conflict_recovery?.max_recovery_depth).toBe(5);
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
it('rejects unknown workspace kinds', () => {
|
|
154
|
+
expect(() =>
|
|
155
|
+
parseTeamWorkspaceConfig({
|
|
156
|
+
roles: { x: { workspace: 'made-up' } },
|
|
157
|
+
})
|
|
158
|
+
).toThrow();
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
it('rejects unknown landing strategy names', () => {
|
|
162
|
+
expect(() =>
|
|
163
|
+
parseTeamWorkspaceConfig({
|
|
164
|
+
roles: {
|
|
165
|
+
x: {
|
|
166
|
+
workspace: 'new_stream',
|
|
167
|
+
stream_lineage: 'fork_from_team_root',
|
|
168
|
+
landing: 'unknown-strategy',
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
})
|
|
172
|
+
).toThrow();
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
describe('extractWorkspaceConfig', () => {
|
|
177
|
+
it('extracts workspace block from a manifest with macro_agent.workspace', () => {
|
|
178
|
+
const manifest = {
|
|
179
|
+
macro_agent: {
|
|
180
|
+
workspace: {
|
|
181
|
+
roles: { x: { workspace: 'none' } },
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
};
|
|
185
|
+
const config = extractWorkspaceConfig(manifest);
|
|
186
|
+
expect(config).not.toBeNull();
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
it('returns null when macro_agent.workspace is absent', () => {
|
|
190
|
+
const manifest = { macro_agent: { integration: { strategy: 'trunk' } } };
|
|
191
|
+
expect(extractWorkspaceConfig(manifest)).toBeNull();
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
it('returns null when macro_agent is absent', () => {
|
|
195
|
+
expect(extractWorkspaceConfig({})).toBeNull();
|
|
196
|
+
});
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
describe('schema shape', () => {
|
|
200
|
+
it('TeamWorkspaceConfigSchema is a zod object', () => {
|
|
201
|
+
expect(TeamWorkspaceConfigSchema).toBeDefined();
|
|
202
|
+
expect(typeof TeamWorkspaceConfigSchema.safeParse).toBe('function');
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
it('RoleWorkspaceConfigSchema is a zod schema', () => {
|
|
206
|
+
expect(RoleWorkspaceConfigSchema).toBeDefined();
|
|
207
|
+
expect(typeof RoleWorkspaceConfigSchema.safeParse).toBe('function');
|
|
208
|
+
});
|
|
209
|
+
});
|
|
210
|
+
});
|
package/src/workspace/config.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Workspace Configuration Types
|
|
3
3
|
*
|
|
4
|
-
* Configuration for
|
|
4
|
+
* Configuration for git-cascade integration and workspace management.
|
|
5
5
|
*
|
|
6
6
|
* @module workspace/config
|
|
7
7
|
*/
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
import type Database from 'better-sqlite3';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
* Configuration for
|
|
12
|
+
* Configuration for git-cascade integration
|
|
13
13
|
*/
|
|
14
|
-
export interface
|
|
14
|
+
export interface GitCascadeConfig {
|
|
15
15
|
/**
|
|
16
|
-
* Whether
|
|
16
|
+
* Whether the git-cascade adapter is enabled.
|
|
17
17
|
* When disabled, workspace operations are no-ops.
|
|
18
18
|
*/
|
|
19
19
|
enabled: boolean;
|
|
@@ -25,21 +25,21 @@ export interface DataplaneConfig {
|
|
|
25
25
|
repoPath?: string;
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
|
-
* Table prefix for
|
|
29
|
-
* Defaults to '
|
|
28
|
+
* Table prefix for git-cascade tables in shared SQLite database.
|
|
29
|
+
* Defaults to 'git_cascade_'.
|
|
30
30
|
*/
|
|
31
31
|
tablePrefix?: string;
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* Path to SQLite database file.
|
|
35
35
|
* If not provided and db is not provided, creates database at
|
|
36
|
-
* `<repoPath>/.
|
|
36
|
+
* `<repoPath>/.git-cascade/tracker.db`.
|
|
37
37
|
*/
|
|
38
38
|
dbPath?: string;
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
41
|
* Existing database connection to share.
|
|
42
|
-
* If provided,
|
|
42
|
+
* If provided, the adapter will use this connection instead of creating its own.
|
|
43
43
|
* The caller is responsible for closing this connection.
|
|
44
44
|
*/
|
|
45
45
|
db?: Database.Database;
|
|
@@ -57,11 +57,11 @@ export interface DataplaneConfig {
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
|
-
* Default
|
|
60
|
+
* Default git-cascade configuration
|
|
61
61
|
*/
|
|
62
|
-
export const
|
|
62
|
+
export const DEFAULT_GIT_CASCADE_CONFIG: Partial<GitCascadeConfig> = {
|
|
63
63
|
enabled: true,
|
|
64
|
-
tablePrefix: '
|
|
64
|
+
tablePrefix: 'git_cascade_',
|
|
65
65
|
verbose: false,
|
|
66
66
|
skipRecovery: false,
|
|
67
67
|
};
|