@aithr-ai/mcp-server 1.1.7 → 1.2.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/index.js +528 -0
- package/package.json +1 -1
- package/skills/orchestra/SKILL.md +354 -1
package/index.js
CHANGED
|
@@ -61,6 +61,12 @@
|
|
|
61
61
|
* - aether_orchestra_resume: Resume execution
|
|
62
62
|
* - aether_complete_orchestra: Mark complete, generate summary
|
|
63
63
|
* - aether_edit_orchestra: Edit plan without restarting (add/remove/split tasks)
|
|
64
|
+
* - aether_create_contract: Generate Source of Truth contract before coding
|
|
65
|
+
*
|
|
66
|
+
* Workflow Enforcement (v1.2.0):
|
|
67
|
+
* - aether_orchestra_validate: Check workflow state, prevent skipped steps
|
|
68
|
+
* - aether_orchestra_checkpoint: Quality gate between phases
|
|
69
|
+
* - aether_orchestra_guide: Smart guidance on next action to take
|
|
64
70
|
*/
|
|
65
71
|
|
|
66
72
|
const readline = require('readline');
|
|
@@ -1099,6 +1105,85 @@ class MCPServer {
|
|
|
1099
1105
|
required: ['sessionId', 'action'],
|
|
1100
1106
|
},
|
|
1101
1107
|
},
|
|
1108
|
+
{
|
|
1109
|
+
name: 'aether_create_contract',
|
|
1110
|
+
description: 'Generate a Source of Truth contract for the orchestra session. This defines ALL types, schemas, API endpoints, and components BEFORE any code is written. CRITICAL: Run this AFTER setting the plan but BEFORE executing tasks. The contract ensures all agents work from the same definitions and prevents inconsistencies.',
|
|
1111
|
+
inputSchema: {
|
|
1112
|
+
type: 'object',
|
|
1113
|
+
properties: {
|
|
1114
|
+
sessionId: {
|
|
1115
|
+
type: 'string',
|
|
1116
|
+
description: 'Orchestra session ID',
|
|
1117
|
+
},
|
|
1118
|
+
requirements: {
|
|
1119
|
+
type: 'string',
|
|
1120
|
+
description: 'Full project requirements (PRD, feature description, etc.). Be comprehensive - the contract will define everything upfront.',
|
|
1121
|
+
},
|
|
1122
|
+
existingCodeSummary: {
|
|
1123
|
+
type: 'string',
|
|
1124
|
+
description: 'Optional: Summary of existing codebase patterns (auth system, ORM, styling framework) if brownfield project.',
|
|
1125
|
+
},
|
|
1126
|
+
},
|
|
1127
|
+
required: ['sessionId', 'requirements'],
|
|
1128
|
+
},
|
|
1129
|
+
},
|
|
1130
|
+
{
|
|
1131
|
+
name: 'aether_orchestra_validate',
|
|
1132
|
+
description: 'Validate orchestra session state and return required next steps. CALL THIS BEFORE taking any action to ensure you are following the correct workflow. Returns errors if prerequisites are missing and provides the exact tool to call next.',
|
|
1133
|
+
inputSchema: {
|
|
1134
|
+
type: 'object',
|
|
1135
|
+
properties: {
|
|
1136
|
+
sessionId: {
|
|
1137
|
+
type: 'string',
|
|
1138
|
+
description: 'Orchestra session ID (optional - uses latest if not provided)',
|
|
1139
|
+
},
|
|
1140
|
+
intendedAction: {
|
|
1141
|
+
type: 'string',
|
|
1142
|
+
enum: ['execute_task', 'approve', 'complete', 'any'],
|
|
1143
|
+
description: 'What you intend to do next. Validation will check if prerequisites are met.',
|
|
1144
|
+
},
|
|
1145
|
+
},
|
|
1146
|
+
},
|
|
1147
|
+
},
|
|
1148
|
+
{
|
|
1149
|
+
name: 'aether_orchestra_checkpoint',
|
|
1150
|
+
description: 'Create a quality checkpoint to validate phase completion before proceeding. Checks that all tasks in the phase are complete, artifacts exist, and contract compliance is verified. Returns blockers if validation fails.',
|
|
1151
|
+
inputSchema: {
|
|
1152
|
+
type: 'object',
|
|
1153
|
+
properties: {
|
|
1154
|
+
sessionId: {
|
|
1155
|
+
type: 'string',
|
|
1156
|
+
description: 'Orchestra session ID',
|
|
1157
|
+
},
|
|
1158
|
+
phaseNumber: {
|
|
1159
|
+
type: 'number',
|
|
1160
|
+
description: 'Phase number to validate (optional - validates current phase if not provided)',
|
|
1161
|
+
},
|
|
1162
|
+
validateContract: {
|
|
1163
|
+
type: 'boolean',
|
|
1164
|
+
description: 'Check artifacts for contract compliance (default: true)',
|
|
1165
|
+
},
|
|
1166
|
+
autoAdvance: {
|
|
1167
|
+
type: 'boolean',
|
|
1168
|
+
description: 'Automatically advance to next phase if checkpoint passes (default: false)',
|
|
1169
|
+
},
|
|
1170
|
+
},
|
|
1171
|
+
required: ['sessionId'],
|
|
1172
|
+
},
|
|
1173
|
+
},
|
|
1174
|
+
{
|
|
1175
|
+
name: 'aether_orchestra_guide',
|
|
1176
|
+
description: 'Get intelligent guidance on what to do next in the orchestra workflow. Returns the exact tool to call, required parameters, and explanation. USE THIS when you are unsure what step comes next.',
|
|
1177
|
+
inputSchema: {
|
|
1178
|
+
type: 'object',
|
|
1179
|
+
properties: {
|
|
1180
|
+
sessionId: {
|
|
1181
|
+
type: 'string',
|
|
1182
|
+
description: 'Orchestra session ID (optional - uses latest if not provided)',
|
|
1183
|
+
},
|
|
1184
|
+
},
|
|
1185
|
+
},
|
|
1186
|
+
},
|
|
1102
1187
|
];
|
|
1103
1188
|
}
|
|
1104
1189
|
|
|
@@ -1277,6 +1362,18 @@ class MCPServer {
|
|
|
1277
1362
|
case 'aether_edit_orchestra':
|
|
1278
1363
|
result = await this.editOrchestra(args);
|
|
1279
1364
|
break;
|
|
1365
|
+
case 'aether_create_contract':
|
|
1366
|
+
result = await this.createContract(args);
|
|
1367
|
+
break;
|
|
1368
|
+
case 'aether_orchestra_validate':
|
|
1369
|
+
result = await this.orchestraValidate(args);
|
|
1370
|
+
break;
|
|
1371
|
+
case 'aether_orchestra_checkpoint':
|
|
1372
|
+
result = await this.orchestraCheckpoint(args);
|
|
1373
|
+
break;
|
|
1374
|
+
case 'aether_orchestra_guide':
|
|
1375
|
+
result = await this.orchestraGuide(args);
|
|
1376
|
+
break;
|
|
1280
1377
|
default:
|
|
1281
1378
|
return this.errorResponse(id, -32602, `Unknown tool: ${name}`);
|
|
1282
1379
|
}
|
|
@@ -3467,6 +3564,63 @@ class MCPServer {
|
|
|
3467
3564
|
}
|
|
3468
3565
|
}
|
|
3469
3566
|
|
|
3567
|
+
async createContract(args) {
|
|
3568
|
+
const projectId = config.projectId;
|
|
3569
|
+
|
|
3570
|
+
if (!projectId) {
|
|
3571
|
+
return { error: 'No project ID configured. Set AETHER_PROJECT_ID environment variable.' };
|
|
3572
|
+
}
|
|
3573
|
+
|
|
3574
|
+
const { sessionId, requirements, existingCodeSummary } = args;
|
|
3575
|
+
|
|
3576
|
+
if (!sessionId || !requirements) {
|
|
3577
|
+
return { error: 'sessionId and requirements are required' };
|
|
3578
|
+
}
|
|
3579
|
+
|
|
3580
|
+
try {
|
|
3581
|
+
const data = await this.mcpApiCall(
|
|
3582
|
+
`/mcp/projects/${projectId}/orchestra/contract`,
|
|
3583
|
+
'POST',
|
|
3584
|
+
{
|
|
3585
|
+
sessionId,
|
|
3586
|
+
requirements,
|
|
3587
|
+
existingCodeSummary,
|
|
3588
|
+
}
|
|
3589
|
+
);
|
|
3590
|
+
|
|
3591
|
+
if (!data.success) {
|
|
3592
|
+
return {
|
|
3593
|
+
success: false,
|
|
3594
|
+
error: data.error || 'Failed to generate contract',
|
|
3595
|
+
};
|
|
3596
|
+
}
|
|
3597
|
+
|
|
3598
|
+
// Summarize what was generated
|
|
3599
|
+
const contract = data.contract || {};
|
|
3600
|
+
const summary = {
|
|
3601
|
+
types: Object.keys(contract.types?.entities || {}).length,
|
|
3602
|
+
tables: Object.keys(contract.schema?.tables || {}).length,
|
|
3603
|
+
endpoints: Object.keys(contract.api?.endpoints || {}).length,
|
|
3604
|
+
components: Object.keys(contract.components?.components || {}).length,
|
|
3605
|
+
};
|
|
3606
|
+
|
|
3607
|
+
return {
|
|
3608
|
+
success: true,
|
|
3609
|
+
sessionId,
|
|
3610
|
+
contractVersion: data.contractVersion || 1,
|
|
3611
|
+
summary: {
|
|
3612
|
+
...summary,
|
|
3613
|
+
total: summary.types + summary.tables + summary.endpoints + summary.components,
|
|
3614
|
+
},
|
|
3615
|
+
tokensUsed: data.tokensUsed || 0,
|
|
3616
|
+
message: `Contract generated with ${summary.types} types, ${summary.tables} tables, ${summary.endpoints} endpoints, ${summary.components} components`,
|
|
3617
|
+
hint: 'The contract is now stored in the session. All agents will receive relevant contract sections when executing tasks. Use aether_orchestra_approve to begin execution.',
|
|
3618
|
+
};
|
|
3619
|
+
} catch (e) {
|
|
3620
|
+
return { success: false, error: e.message };
|
|
3621
|
+
}
|
|
3622
|
+
}
|
|
3623
|
+
|
|
3470
3624
|
async editOrchestra(args) {
|
|
3471
3625
|
const projectId = config.projectId;
|
|
3472
3626
|
|
|
@@ -3575,6 +3729,380 @@ class MCPServer {
|
|
|
3575
3729
|
}
|
|
3576
3730
|
}
|
|
3577
3731
|
|
|
3732
|
+
/**
|
|
3733
|
+
* Validate orchestra session state and ensure correct workflow
|
|
3734
|
+
*/
|
|
3735
|
+
async orchestraValidate(args) {
|
|
3736
|
+
const projectId = config.projectId;
|
|
3737
|
+
|
|
3738
|
+
if (!projectId) {
|
|
3739
|
+
return { error: 'No project ID configured. Set AETHER_PROJECT_ID environment variable.' };
|
|
3740
|
+
}
|
|
3741
|
+
|
|
3742
|
+
const { sessionId, intendedAction } = args;
|
|
3743
|
+
|
|
3744
|
+
try {
|
|
3745
|
+
// Get current session status
|
|
3746
|
+
const data = await this.mcpApiCall(
|
|
3747
|
+
`/mcp/projects/${projectId}/orchestra`,
|
|
3748
|
+
'POST',
|
|
3749
|
+
{
|
|
3750
|
+
action: 'status',
|
|
3751
|
+
sessionId: sessionId || undefined,
|
|
3752
|
+
}
|
|
3753
|
+
);
|
|
3754
|
+
|
|
3755
|
+
if (!data || data.error) {
|
|
3756
|
+
return {
|
|
3757
|
+
valid: false,
|
|
3758
|
+
error: data?.error || 'No orchestra session found',
|
|
3759
|
+
nextStep: {
|
|
3760
|
+
tool: 'aether_start_orchestra',
|
|
3761
|
+
reason: 'Start a new orchestra session first',
|
|
3762
|
+
},
|
|
3763
|
+
};
|
|
3764
|
+
}
|
|
3765
|
+
|
|
3766
|
+
const session = data;
|
|
3767
|
+
const status = session.status;
|
|
3768
|
+
const hasContract = !!session.contract || session.contractVersion > 0;
|
|
3769
|
+
const hasPlan = session.totalTasks > 0;
|
|
3770
|
+
|
|
3771
|
+
// Define the workflow state machine
|
|
3772
|
+
const workflow = {
|
|
3773
|
+
planning: {
|
|
3774
|
+
required: [],
|
|
3775
|
+
missing: !hasPlan ? ['Plan not set'] : [],
|
|
3776
|
+
nextTool: !hasPlan ? 'aether_set_orchestra_plan' : 'aether_create_contract',
|
|
3777
|
+
nextReason: !hasPlan
|
|
3778
|
+
? 'Set the development plan with phases and tasks'
|
|
3779
|
+
: 'Generate Source of Truth contract before executing',
|
|
3780
|
+
},
|
|
3781
|
+
awaiting_approval: {
|
|
3782
|
+
required: ['plan'],
|
|
3783
|
+
missing: !hasContract ? ['Contract not generated (RECOMMENDED)'] : [],
|
|
3784
|
+
nextTool: hasContract ? 'aether_orchestra_approve' : 'aether_create_contract',
|
|
3785
|
+
nextReason: hasContract
|
|
3786
|
+
? 'Approve the plan to begin execution'
|
|
3787
|
+
: 'Generate contract for consistent types/schemas across agents (recommended but optional)',
|
|
3788
|
+
canSkipContract: true,
|
|
3789
|
+
},
|
|
3790
|
+
running: {
|
|
3791
|
+
required: ['plan', 'approval'],
|
|
3792
|
+
missing: [],
|
|
3793
|
+
nextTool: 'aether_orchestra_next',
|
|
3794
|
+
nextReason: 'Get next ready tasks to execute',
|
|
3795
|
+
},
|
|
3796
|
+
paused: {
|
|
3797
|
+
required: [],
|
|
3798
|
+
missing: [],
|
|
3799
|
+
nextTool: 'aether_orchestra_resume',
|
|
3800
|
+
nextReason: 'Resume execution to continue',
|
|
3801
|
+
},
|
|
3802
|
+
completed: {
|
|
3803
|
+
required: [],
|
|
3804
|
+
missing: [],
|
|
3805
|
+
nextTool: 'aether_start_orchestra',
|
|
3806
|
+
nextReason: 'Session complete. Start a new session if needed.',
|
|
3807
|
+
},
|
|
3808
|
+
};
|
|
3809
|
+
|
|
3810
|
+
const currentState = workflow[status] || workflow.planning;
|
|
3811
|
+
|
|
3812
|
+
// Validate intended action
|
|
3813
|
+
let actionValid = true;
|
|
3814
|
+
let actionError = null;
|
|
3815
|
+
|
|
3816
|
+
if (intendedAction) {
|
|
3817
|
+
switch (intendedAction) {
|
|
3818
|
+
case 'execute_task':
|
|
3819
|
+
if (status !== 'running') {
|
|
3820
|
+
actionValid = false;
|
|
3821
|
+
actionError = `Cannot execute tasks in "${status}" state. Session must be "running".`;
|
|
3822
|
+
}
|
|
3823
|
+
break;
|
|
3824
|
+
case 'approve':
|
|
3825
|
+
if (status !== 'awaiting_approval' && status !== 'planning') {
|
|
3826
|
+
actionValid = false;
|
|
3827
|
+
actionError = `Cannot approve in "${status}" state. Session must be "awaiting_approval".`;
|
|
3828
|
+
}
|
|
3829
|
+
if (!hasPlan) {
|
|
3830
|
+
actionValid = false;
|
|
3831
|
+
actionError = 'Cannot approve without a plan. Call aether_set_orchestra_plan first.';
|
|
3832
|
+
}
|
|
3833
|
+
break;
|
|
3834
|
+
case 'complete':
|
|
3835
|
+
if (status === 'completed') {
|
|
3836
|
+
actionValid = false;
|
|
3837
|
+
actionError = 'Session is already completed.';
|
|
3838
|
+
}
|
|
3839
|
+
break;
|
|
3840
|
+
}
|
|
3841
|
+
}
|
|
3842
|
+
|
|
3843
|
+
return {
|
|
3844
|
+
valid: actionValid && currentState.missing.length === 0,
|
|
3845
|
+
sessionId: session.sessionId,
|
|
3846
|
+
status,
|
|
3847
|
+
hasPlan,
|
|
3848
|
+
hasContract,
|
|
3849
|
+
totalTasks: session.totalTasks || 0,
|
|
3850
|
+
completedTasks: session.completedTasks || 0,
|
|
3851
|
+
warnings: currentState.missing,
|
|
3852
|
+
intendedAction: intendedAction || 'any',
|
|
3853
|
+
actionValid,
|
|
3854
|
+
actionError,
|
|
3855
|
+
nextStep: {
|
|
3856
|
+
tool: currentState.nextTool,
|
|
3857
|
+
reason: currentState.nextReason,
|
|
3858
|
+
canSkip: currentState.canSkipContract || false,
|
|
3859
|
+
},
|
|
3860
|
+
workflow: `
|
|
3861
|
+
📋 ORCHESTRA WORKFLOW:
|
|
3862
|
+
1. aether_start_orchestra → Creates session (status: planning)
|
|
3863
|
+
2. aether_set_orchestra_plan → Defines phases/tasks (status: awaiting_approval)
|
|
3864
|
+
3. aether_create_contract → Generates type contracts [RECOMMENDED]
|
|
3865
|
+
4. aether_orchestra_approve → Begins execution (status: running)
|
|
3866
|
+
5. aether_orchestra_next → Get ready tasks
|
|
3867
|
+
6. aether_trigger_generation → Execute task
|
|
3868
|
+
7. aether_report_to_orchestrator → Report completion
|
|
3869
|
+
8. Repeat 5-7 until done
|
|
3870
|
+
9. aether_complete_orchestra → Finalize session
|
|
3871
|
+
|
|
3872
|
+
Current position: Step ${this.getWorkflowStep(status, hasPlan, hasContract)}
|
|
3873
|
+
`.trim(),
|
|
3874
|
+
};
|
|
3875
|
+
} catch (e) {
|
|
3876
|
+
return { valid: false, error: e.message };
|
|
3877
|
+
}
|
|
3878
|
+
}
|
|
3879
|
+
|
|
3880
|
+
getWorkflowStep(status, hasPlan, hasContract) {
|
|
3881
|
+
if (status === 'planning' && !hasPlan) return '1-2 (need plan)';
|
|
3882
|
+
if (status === 'planning' && hasPlan) return '2-3 (plan set, need contract)';
|
|
3883
|
+
if (status === 'awaiting_approval' && !hasContract) return '3 (awaiting contract)';
|
|
3884
|
+
if (status === 'awaiting_approval' && hasContract) return '4 (ready to approve)';
|
|
3885
|
+
if (status === 'running') return '5-8 (executing tasks)';
|
|
3886
|
+
if (status === 'paused') return '5-8 (paused)';
|
|
3887
|
+
if (status === 'completed') return '9 (done)';
|
|
3888
|
+
return '?';
|
|
3889
|
+
}
|
|
3890
|
+
|
|
3891
|
+
/**
|
|
3892
|
+
* Quality checkpoint between phases
|
|
3893
|
+
*/
|
|
3894
|
+
async orchestraCheckpoint(args) {
|
|
3895
|
+
const projectId = config.projectId;
|
|
3896
|
+
|
|
3897
|
+
if (!projectId) {
|
|
3898
|
+
return { error: 'No project ID configured. Set AETHER_PROJECT_ID environment variable.' };
|
|
3899
|
+
}
|
|
3900
|
+
|
|
3901
|
+
const { sessionId, phaseNumber, validateContract, autoAdvance } = args;
|
|
3902
|
+
|
|
3903
|
+
if (!sessionId) {
|
|
3904
|
+
return { error: 'sessionId is required' };
|
|
3905
|
+
}
|
|
3906
|
+
|
|
3907
|
+
try {
|
|
3908
|
+
const data = await this.mcpApiCall(
|
|
3909
|
+
`/mcp/projects/${projectId}/orchestra/checkpoint`,
|
|
3910
|
+
'POST',
|
|
3911
|
+
{
|
|
3912
|
+
sessionId,
|
|
3913
|
+
phaseNumber,
|
|
3914
|
+
validateContract: validateContract !== false,
|
|
3915
|
+
autoAdvance: autoAdvance || false,
|
|
3916
|
+
}
|
|
3917
|
+
);
|
|
3918
|
+
|
|
3919
|
+
return data;
|
|
3920
|
+
} catch (e) {
|
|
3921
|
+
return { success: false, error: e.message };
|
|
3922
|
+
}
|
|
3923
|
+
}
|
|
3924
|
+
|
|
3925
|
+
/**
|
|
3926
|
+
* Smart guidance on what to do next
|
|
3927
|
+
*/
|
|
3928
|
+
async orchestraGuide(args) {
|
|
3929
|
+
const projectId = config.projectId;
|
|
3930
|
+
|
|
3931
|
+
if (!projectId) {
|
|
3932
|
+
return { error: 'No project ID configured. Set AETHER_PROJECT_ID environment variable.' };
|
|
3933
|
+
}
|
|
3934
|
+
|
|
3935
|
+
const { sessionId } = args;
|
|
3936
|
+
|
|
3937
|
+
try {
|
|
3938
|
+
// Get session status first
|
|
3939
|
+
const status = await this.mcpApiCall(
|
|
3940
|
+
`/mcp/projects/${projectId}/orchestra`,
|
|
3941
|
+
'POST',
|
|
3942
|
+
{
|
|
3943
|
+
action: 'status',
|
|
3944
|
+
sessionId: sessionId || undefined,
|
|
3945
|
+
}
|
|
3946
|
+
);
|
|
3947
|
+
|
|
3948
|
+
if (!status || status.error) {
|
|
3949
|
+
return {
|
|
3950
|
+
nextTool: 'aether_start_orchestra',
|
|
3951
|
+
parameters: {},
|
|
3952
|
+
explanation: 'No active orchestra session found. Start a new session to begin autonomous development.',
|
|
3953
|
+
example: `aether_start_orchestra({ maxIterations: 100, timeoutMinutes: 480 })`,
|
|
3954
|
+
};
|
|
3955
|
+
}
|
|
3956
|
+
|
|
3957
|
+
const session = status;
|
|
3958
|
+
const sessionStatus = session.status;
|
|
3959
|
+
const hasContract = !!session.contract || session.contractVersion > 0;
|
|
3960
|
+
const hasPlan = session.totalTasks > 0;
|
|
3961
|
+
|
|
3962
|
+
// Determine next action based on state
|
|
3963
|
+
switch (sessionStatus) {
|
|
3964
|
+
case 'planning':
|
|
3965
|
+
if (!hasPlan) {
|
|
3966
|
+
return {
|
|
3967
|
+
nextTool: 'aether_set_orchestra_plan',
|
|
3968
|
+
parameters: {
|
|
3969
|
+
sessionId: session.sessionId,
|
|
3970
|
+
planContent: '<DEVELOPMENT_PLAN.md content>',
|
|
3971
|
+
phases: '<Array of phases with tasks>',
|
|
3972
|
+
},
|
|
3973
|
+
explanation: 'Session created but no plan set. Define the development plan with phases and tasks.',
|
|
3974
|
+
example: `aether_set_orchestra_plan({
|
|
3975
|
+
sessionId: "${session.sessionId}",
|
|
3976
|
+
planContent: "# Development Plan\\n...",
|
|
3977
|
+
phases: [{
|
|
3978
|
+
phaseNumber: 1,
|
|
3979
|
+
title: "Phase 1: Foundation",
|
|
3980
|
+
tasks: [{
|
|
3981
|
+
title: "Create data models",
|
|
3982
|
+
agentId: "architect",
|
|
3983
|
+
contextPrompt: "Design the database schema...",
|
|
3984
|
+
expectedOutput: "Database schema and Drizzle migrations"
|
|
3985
|
+
}]
|
|
3986
|
+
}]
|
|
3987
|
+
})`,
|
|
3988
|
+
};
|
|
3989
|
+
}
|
|
3990
|
+
// Has plan but still planning - should set contract
|
|
3991
|
+
return {
|
|
3992
|
+
nextTool: 'aether_create_contract',
|
|
3993
|
+
parameters: {
|
|
3994
|
+
sessionId: session.sessionId,
|
|
3995
|
+
requirements: '<Full project requirements>',
|
|
3996
|
+
},
|
|
3997
|
+
explanation: 'Plan is set. Now generate the Source of Truth contract to ensure consistency across all agents.',
|
|
3998
|
+
example: `aether_create_contract({
|
|
3999
|
+
sessionId: "${session.sessionId}",
|
|
4000
|
+
requirements: "Build a task management app with user auth, projects, and real-time updates..."
|
|
4001
|
+
})`,
|
|
4002
|
+
note: 'This step is RECOMMENDED but optional. You can skip to aether_orchestra_approve if needed.',
|
|
4003
|
+
};
|
|
4004
|
+
|
|
4005
|
+
case 'awaiting_approval':
|
|
4006
|
+
if (!hasContract) {
|
|
4007
|
+
return {
|
|
4008
|
+
nextTool: 'aether_create_contract',
|
|
4009
|
+
parameters: {
|
|
4010
|
+
sessionId: session.sessionId,
|
|
4011
|
+
requirements: '<Full project requirements>',
|
|
4012
|
+
},
|
|
4013
|
+
explanation: 'Plan awaiting approval. RECOMMENDED: Generate contract first for type consistency.',
|
|
4014
|
+
alternative: {
|
|
4015
|
+
tool: 'aether_orchestra_approve',
|
|
4016
|
+
note: 'Skip contract and approve directly (not recommended for complex projects)',
|
|
4017
|
+
},
|
|
4018
|
+
};
|
|
4019
|
+
}
|
|
4020
|
+
return {
|
|
4021
|
+
nextTool: 'aether_orchestra_approve',
|
|
4022
|
+
parameters: { sessionId: session.sessionId },
|
|
4023
|
+
explanation: 'Plan and contract ready. Approve to begin autonomous execution.',
|
|
4024
|
+
example: `aether_orchestra_approve({ sessionId: "${session.sessionId}" })`,
|
|
4025
|
+
warning: 'After approval, tasks will execute. Review the plan carefully first.',
|
|
4026
|
+
};
|
|
4027
|
+
|
|
4028
|
+
case 'running':
|
|
4029
|
+
// Check if there are ready tasks
|
|
4030
|
+
if (session.readyTasks > 0) {
|
|
4031
|
+
return {
|
|
4032
|
+
nextTool: 'aether_orchestra_next',
|
|
4033
|
+
parameters: { sessionId: session.sessionId },
|
|
4034
|
+
explanation: `${session.readyTasks} task(s) ready to execute. Get them and trigger generation.`,
|
|
4035
|
+
example: `aether_orchestra_next({ sessionId: "${session.sessionId}", maxTasks: 3 })`,
|
|
4036
|
+
followUp: 'After getting tasks, use aether_trigger_generation with the orchestraContext from each task.',
|
|
4037
|
+
};
|
|
4038
|
+
}
|
|
4039
|
+
// Check for running tasks
|
|
4040
|
+
if (session.runningTasks > 0) {
|
|
4041
|
+
return {
|
|
4042
|
+
nextTool: 'aether_orchestra_status',
|
|
4043
|
+
parameters: { sessionId: session.sessionId, includeReports: true },
|
|
4044
|
+
explanation: `${session.runningTasks} task(s) currently running. Check status and handle any reports.`,
|
|
4045
|
+
example: `aether_orchestra_status({ sessionId: "${session.sessionId}", includeReports: true })`,
|
|
4046
|
+
};
|
|
4047
|
+
}
|
|
4048
|
+
// Check for blocked tasks
|
|
4049
|
+
if (session.blockedTasks > 0) {
|
|
4050
|
+
return {
|
|
4051
|
+
nextTool: 'aether_orchestra_status',
|
|
4052
|
+
parameters: { sessionId: session.sessionId, includeReports: true },
|
|
4053
|
+
explanation: `${session.blockedTasks} task(s) blocked. Review blockers and resolve or edit the plan.`,
|
|
4054
|
+
alternative: {
|
|
4055
|
+
tool: 'aether_edit_orchestra',
|
|
4056
|
+
note: 'Use to modify blocked tasks or add workaround tasks',
|
|
4057
|
+
},
|
|
4058
|
+
};
|
|
4059
|
+
}
|
|
4060
|
+
// All tasks might be complete
|
|
4061
|
+
return {
|
|
4062
|
+
nextTool: 'aether_orchestra_status',
|
|
4063
|
+
parameters: { sessionId: session.sessionId },
|
|
4064
|
+
explanation: 'Check if all tasks are complete. May be ready to finalize.',
|
|
4065
|
+
possibleActions: [
|
|
4066
|
+
{ tool: 'aether_complete_orchestra', when: 'All tasks done' },
|
|
4067
|
+
{ tool: 'aether_edit_orchestra', when: 'Need to add more tasks' },
|
|
4068
|
+
{ tool: 'aether_orchestra_checkpoint', when: 'Validate phase completion' },
|
|
4069
|
+
],
|
|
4070
|
+
};
|
|
4071
|
+
|
|
4072
|
+
case 'paused':
|
|
4073
|
+
return {
|
|
4074
|
+
nextTool: 'aether_orchestra_resume',
|
|
4075
|
+
parameters: { sessionId: session.sessionId },
|
|
4076
|
+
explanation: 'Session is paused. Resume to continue execution.',
|
|
4077
|
+
alternative: {
|
|
4078
|
+
tool: 'aether_orchestra_status',
|
|
4079
|
+
note: 'Review status before resuming',
|
|
4080
|
+
},
|
|
4081
|
+
};
|
|
4082
|
+
|
|
4083
|
+
case 'completed':
|
|
4084
|
+
return {
|
|
4085
|
+
nextTool: 'aether_start_orchestra',
|
|
4086
|
+
parameters: {},
|
|
4087
|
+
explanation: 'Session completed. Start a new session for more development work.',
|
|
4088
|
+
summary: {
|
|
4089
|
+
completedTasks: session.completedTasks,
|
|
4090
|
+
completedAt: session.completedAt,
|
|
4091
|
+
},
|
|
4092
|
+
};
|
|
4093
|
+
|
|
4094
|
+
default:
|
|
4095
|
+
return {
|
|
4096
|
+
nextTool: 'aether_orchestra_status',
|
|
4097
|
+
parameters: { sessionId: session.sessionId },
|
|
4098
|
+
explanation: `Unknown session status: ${sessionStatus}. Check status for details.`,
|
|
4099
|
+
};
|
|
4100
|
+
}
|
|
4101
|
+
} catch (e) {
|
|
4102
|
+
return { error: e.message };
|
|
4103
|
+
}
|
|
4104
|
+
}
|
|
4105
|
+
|
|
3578
4106
|
async run() {
|
|
3579
4107
|
const rl = readline.createInterface({
|
|
3580
4108
|
input: process.stdin,
|
package/package.json
CHANGED
|
@@ -646,6 +646,7 @@ aether_complete_orchestra(
|
|
|
646
646
|
|------|---------|
|
|
647
647
|
| `aether_start_orchestra(maxIterations?, maxAgents?, timeoutMinutes?, completionCriteria?)` | Start session |
|
|
648
648
|
| `aether_set_orchestra_plan(sessionId, planContent, phases, completionCriteria?)` | Set development plan |
|
|
649
|
+
| `aether_create_contract(sessionId, requirements, existingCodeSummary?)` | Generate Source of Truth contract |
|
|
649
650
|
| `aether_orchestra_approve(sessionId)` | Approve and start execution |
|
|
650
651
|
| `aether_orchestra_status(sessionId?, includeReports?, includeLogs?)` | Get full status |
|
|
651
652
|
| `aether_orchestra_next(sessionId, maxTasks?)` | Get ready tasks |
|
|
@@ -654,6 +655,14 @@ aether_complete_orchestra(
|
|
|
654
655
|
| `aether_orchestra_pause(sessionId)` | Pause execution |
|
|
655
656
|
| `aether_orchestra_resume(sessionId)` | Resume execution |
|
|
656
657
|
| `aether_complete_orchestra(sessionId, completionReason, summary?)` | Complete session |
|
|
658
|
+
| `aether_edit_orchestra(sessionId, action, ...)` | Edit plan without restarting |
|
|
659
|
+
|
|
660
|
+
### Workflow Enforcement Tools (v7)
|
|
661
|
+
| Tool | Purpose |
|
|
662
|
+
|------|---------|
|
|
663
|
+
| `aether_orchestra_guide(sessionId?)` | Get intelligent guidance on next action |
|
|
664
|
+
| `aether_orchestra_validate(sessionId?, intendedAction?)` | Pre-flight check before major actions |
|
|
665
|
+
| `aether_orchestra_checkpoint(sessionId, phaseNumber?, validateContract?, autoAdvance?)` | Quality gate between phases |
|
|
657
666
|
|
|
658
667
|
---
|
|
659
668
|
|
|
@@ -2018,6 +2027,280 @@ The session automatically pauses when:
|
|
|
2018
2027
|
|
|
2019
2028
|
---
|
|
2020
2029
|
|
|
2030
|
+
## Workflow Enforcement (Orchestra v7)
|
|
2031
|
+
|
|
2032
|
+
Orchestra v7 introduces workflow enforcement tools to prevent skipped steps and ensure proper execution order.
|
|
2033
|
+
|
|
2034
|
+
### The Problem
|
|
2035
|
+
|
|
2036
|
+
Without enforcement, Claude Code might:
|
|
2037
|
+
- Skip contract generation (causing type inconsistencies)
|
|
2038
|
+
- Try to execute tasks before plan approval
|
|
2039
|
+
- Miss phase checkpoints
|
|
2040
|
+
- Not know what step comes next
|
|
2041
|
+
|
|
2042
|
+
### Workflow Enforcement Tools
|
|
2043
|
+
|
|
2044
|
+
| Tool | Purpose | When to Use |
|
|
2045
|
+
|------|---------|-------------|
|
|
2046
|
+
| `aether_orchestra_guide` | Get intelligent guidance on next action | When unsure what to do next |
|
|
2047
|
+
| `aether_orchestra_validate` | Pre-flight check before actions | Before approving, executing, or completing |
|
|
2048
|
+
| `aether_orchestra_checkpoint` | Quality gate between phases | After completing a phase |
|
|
2049
|
+
|
|
2050
|
+
### The Correct Workflow
|
|
2051
|
+
|
|
2052
|
+
```
|
|
2053
|
+
📋 ORCHESTRA WORKFLOW (MANDATORY ORDER):
|
|
2054
|
+
|
|
2055
|
+
1. aether_start_orchestra → Creates session (status: planning)
|
|
2056
|
+
2. aether_set_orchestra_plan → Defines phases/tasks (status: awaiting_approval)
|
|
2057
|
+
3. aether_create_contract → Generates type contracts [RECOMMENDED]
|
|
2058
|
+
4. aether_orchestra_approve → Begins execution (status: running)
|
|
2059
|
+
5. aether_orchestra_next → Get ready tasks
|
|
2060
|
+
6. aether_trigger_generation → Execute task with orchestraContext
|
|
2061
|
+
7. aether_report_to_orchestrator → Report completion/blockers
|
|
2062
|
+
8. Repeat 5-7 until phase complete
|
|
2063
|
+
9. aether_orchestra_checkpoint → Validate phase before advancing
|
|
2064
|
+
10. Repeat 5-9 until all phases done
|
|
2065
|
+
11. aether_complete_orchestra → Finalize session
|
|
2066
|
+
```
|
|
2067
|
+
|
|
2068
|
+
### Using aether_orchestra_guide
|
|
2069
|
+
|
|
2070
|
+
**RECOMMENDED**: Call this when starting or when unsure what to do:
|
|
2071
|
+
|
|
2072
|
+
```javascript
|
|
2073
|
+
// Get intelligent guidance
|
|
2074
|
+
aether_orchestra_guide({})
|
|
2075
|
+
|
|
2076
|
+
// Returns (example when no session exists):
|
|
2077
|
+
{
|
|
2078
|
+
nextTool: "aether_start_orchestra",
|
|
2079
|
+
parameters: {},
|
|
2080
|
+
explanation: "No active orchestra session found. Start a new session to begin.",
|
|
2081
|
+
example: "aether_start_orchestra({ maxIterations: 100, timeoutMinutes: 480 })"
|
|
2082
|
+
}
|
|
2083
|
+
|
|
2084
|
+
// Returns (example when plan set but no contract):
|
|
2085
|
+
{
|
|
2086
|
+
nextTool: "aether_create_contract",
|
|
2087
|
+
parameters: { sessionId: "abc-123", requirements: "<Full project requirements>" },
|
|
2088
|
+
explanation: "Plan is set. Now generate the Source of Truth contract.",
|
|
2089
|
+
note: "This step is RECOMMENDED but optional. You can skip to aether_orchestra_approve."
|
|
2090
|
+
}
|
|
2091
|
+
|
|
2092
|
+
// Returns (example when tasks ready):
|
|
2093
|
+
{
|
|
2094
|
+
nextTool: "aether_orchestra_next",
|
|
2095
|
+
parameters: { sessionId: "abc-123" },
|
|
2096
|
+
explanation: "3 task(s) ready to execute. Get them and trigger generation.",
|
|
2097
|
+
followUp: "After getting tasks, use aether_trigger_generation with orchestraContext."
|
|
2098
|
+
}
|
|
2099
|
+
```
|
|
2100
|
+
|
|
2101
|
+
### Using aether_orchestra_validate
|
|
2102
|
+
|
|
2103
|
+
**Pre-flight check** before taking any major action:
|
|
2104
|
+
|
|
2105
|
+
```javascript
|
|
2106
|
+
// Validate before approving
|
|
2107
|
+
aether_orchestra_validate({
|
|
2108
|
+
sessionId: "abc-123",
|
|
2109
|
+
intendedAction: "approve"
|
|
2110
|
+
})
|
|
2111
|
+
|
|
2112
|
+
// Returns (if prerequisites missing):
|
|
2113
|
+
{
|
|
2114
|
+
valid: false,
|
|
2115
|
+
status: "planning",
|
|
2116
|
+
hasPlan: true,
|
|
2117
|
+
hasContract: false,
|
|
2118
|
+
warnings: ["Contract not generated (RECOMMENDED)"],
|
|
2119
|
+
actionValid: true,
|
|
2120
|
+
nextStep: {
|
|
2121
|
+
tool: "aether_create_contract",
|
|
2122
|
+
reason: "Generate contract for consistent types/schemas across agents",
|
|
2123
|
+
canSkip: true
|
|
2124
|
+
},
|
|
2125
|
+
workflow: "📋 ORCHESTRA WORKFLOW: ... Current position: Step 3 (awaiting contract)"
|
|
2126
|
+
}
|
|
2127
|
+
|
|
2128
|
+
// Returns (if ready to proceed):
|
|
2129
|
+
{
|
|
2130
|
+
valid: true,
|
|
2131
|
+
status: "awaiting_approval",
|
|
2132
|
+
hasPlan: true,
|
|
2133
|
+
hasContract: true,
|
|
2134
|
+
warnings: [],
|
|
2135
|
+
actionValid: true,
|
|
2136
|
+
nextStep: {
|
|
2137
|
+
tool: "aether_orchestra_approve",
|
|
2138
|
+
reason: "Approve the plan to begin execution"
|
|
2139
|
+
}
|
|
2140
|
+
}
|
|
2141
|
+
```
|
|
2142
|
+
|
|
2143
|
+
**Intended Actions:**
|
|
2144
|
+
- `execute_task` - Checks if session is running
|
|
2145
|
+
- `approve` - Checks if plan exists
|
|
2146
|
+
- `complete` - Checks if session isn't already complete
|
|
2147
|
+
- `any` - General validation
|
|
2148
|
+
|
|
2149
|
+
### Using aether_orchestra_checkpoint
|
|
2150
|
+
|
|
2151
|
+
**Quality gate** between phases:
|
|
2152
|
+
|
|
2153
|
+
```javascript
|
|
2154
|
+
// Validate phase completion
|
|
2155
|
+
aether_orchestra_checkpoint({
|
|
2156
|
+
sessionId: "abc-123",
|
|
2157
|
+
phaseNumber: 1, // Optional, uses current phase if not provided
|
|
2158
|
+
validateContract: true, // Check contract compliance
|
|
2159
|
+
autoAdvance: true // Automatically advance to next phase if passed
|
|
2160
|
+
})
|
|
2161
|
+
|
|
2162
|
+
// Returns (if phase incomplete):
|
|
2163
|
+
{
|
|
2164
|
+
success: false,
|
|
2165
|
+
checkpointPassed: false,
|
|
2166
|
+
phase: { number: 1, title: "Foundation", status: "in_progress" },
|
|
2167
|
+
tasks: { total: 5, completed: 3, running: 1, pending: 1 },
|
|
2168
|
+
blockers: [
|
|
2169
|
+
"1 task(s) still running",
|
|
2170
|
+
"1 task(s) still pending"
|
|
2171
|
+
],
|
|
2172
|
+
message: "❌ Phase 1 checkpoint FAILED - 2 blocker(s)"
|
|
2173
|
+
}
|
|
2174
|
+
|
|
2175
|
+
// Returns (if phase complete and auto-advancing):
|
|
2176
|
+
{
|
|
2177
|
+
success: true,
|
|
2178
|
+
checkpointPassed: true,
|
|
2179
|
+
phase: { number: 1, title: "Foundation", status: "completed" },
|
|
2180
|
+
tasks: { total: 5, completed: 5, running: 0, pending: 0 },
|
|
2181
|
+
artifacts: { expected: 5, found: 5, missing: [] },
|
|
2182
|
+
contract: { checked: true, hasContract: true, warnings: [] },
|
|
2183
|
+
blockers: [],
|
|
2184
|
+
autoAdvanced: true,
|
|
2185
|
+
advancedToPhase: 2,
|
|
2186
|
+
message: "✅ Phase 1 checkpoint PASSED - Advanced to Phase 2"
|
|
2187
|
+
}
|
|
2188
|
+
```
|
|
2189
|
+
|
|
2190
|
+
### Best Practices for Workflow Enforcement
|
|
2191
|
+
|
|
2192
|
+
#### 1. Start with Guide
|
|
2193
|
+
|
|
2194
|
+
When beginning or resuming a session:
|
|
2195
|
+
|
|
2196
|
+
```javascript
|
|
2197
|
+
// First call - get guidance
|
|
2198
|
+
const guidance = await aether_orchestra_guide({});
|
|
2199
|
+
console.log(`Next: ${guidance.nextTool}`);
|
|
2200
|
+
console.log(`Why: ${guidance.explanation}`);
|
|
2201
|
+
|
|
2202
|
+
// Then follow the recommendation
|
|
2203
|
+
await callTool(guidance.nextTool, guidance.parameters);
|
|
2204
|
+
```
|
|
2205
|
+
|
|
2206
|
+
#### 2. Validate Before Major Actions
|
|
2207
|
+
|
|
2208
|
+
Before approving or completing:
|
|
2209
|
+
|
|
2210
|
+
```javascript
|
|
2211
|
+
// Check if ready to approve
|
|
2212
|
+
const validation = await aether_orchestra_validate({
|
|
2213
|
+
sessionId,
|
|
2214
|
+
intendedAction: "approve"
|
|
2215
|
+
});
|
|
2216
|
+
|
|
2217
|
+
if (!validation.valid) {
|
|
2218
|
+
console.log(`Not ready: ${validation.warnings.join(', ')}`);
|
|
2219
|
+
console.log(`Next step: ${validation.nextStep.tool}`);
|
|
2220
|
+
return;
|
|
2221
|
+
}
|
|
2222
|
+
|
|
2223
|
+
// Safe to proceed
|
|
2224
|
+
await aether_orchestra_approve({ sessionId });
|
|
2225
|
+
```
|
|
2226
|
+
|
|
2227
|
+
#### 3. Checkpoint Between Phases
|
|
2228
|
+
|
|
2229
|
+
After completing all tasks in a phase:
|
|
2230
|
+
|
|
2231
|
+
```javascript
|
|
2232
|
+
// Validate phase before advancing
|
|
2233
|
+
const checkpoint = await aether_orchestra_checkpoint({
|
|
2234
|
+
sessionId,
|
|
2235
|
+
autoAdvance: true
|
|
2236
|
+
});
|
|
2237
|
+
|
|
2238
|
+
if (!checkpoint.checkpointPassed) {
|
|
2239
|
+
console.log(`Phase blocked: ${checkpoint.blockers.join('\n')}`);
|
|
2240
|
+
// Handle blockers before continuing
|
|
2241
|
+
return;
|
|
2242
|
+
}
|
|
2243
|
+
|
|
2244
|
+
// Phase validated, proceeding to next
|
|
2245
|
+
console.log(`Advanced to Phase ${checkpoint.advancedToPhase}`);
|
|
2246
|
+
```
|
|
2247
|
+
|
|
2248
|
+
#### 4. Never Skip the Contract Step
|
|
2249
|
+
|
|
2250
|
+
The contract ensures type consistency:
|
|
2251
|
+
|
|
2252
|
+
```javascript
|
|
2253
|
+
// Always check for contract before executing tasks
|
|
2254
|
+
const validation = await aether_orchestra_validate({ sessionId });
|
|
2255
|
+
|
|
2256
|
+
if (!validation.hasContract) {
|
|
2257
|
+
// Generate contract first
|
|
2258
|
+
await aether_create_contract({
|
|
2259
|
+
sessionId,
|
|
2260
|
+
requirements: fullProjectRequirements
|
|
2261
|
+
});
|
|
2262
|
+
}
|
|
2263
|
+
```
|
|
2264
|
+
|
|
2265
|
+
### Workflow Enforcement Decision Tree
|
|
2266
|
+
|
|
2267
|
+
```
|
|
2268
|
+
START
|
|
2269
|
+
│
|
|
2270
|
+
▼
|
|
2271
|
+
aether_orchestra_guide({})
|
|
2272
|
+
│
|
|
2273
|
+
├─ No session? ──────────────▶ aether_start_orchestra
|
|
2274
|
+
│
|
|
2275
|
+
├─ No plan? ─────────────────▶ aether_set_orchestra_plan
|
|
2276
|
+
│
|
|
2277
|
+
├─ No contract? ─────────────▶ aether_create_contract (recommended)
|
|
2278
|
+
│ or
|
|
2279
|
+
│ aether_orchestra_approve (skip)
|
|
2280
|
+
│
|
|
2281
|
+
├─ Awaiting approval? ───────▶ aether_orchestra_validate({ intendedAction: "approve" })
|
|
2282
|
+
│ │
|
|
2283
|
+
│ ├─ valid=true ──▶ aether_orchestra_approve
|
|
2284
|
+
│ └─ valid=false ─▶ Fix warnings first
|
|
2285
|
+
│
|
|
2286
|
+
├─ Running + tasks ready? ───▶ aether_orchestra_next
|
|
2287
|
+
│ │
|
|
2288
|
+
│ ▼
|
|
2289
|
+
│ aether_trigger_generation (with orchestraContext)
|
|
2290
|
+
│ │
|
|
2291
|
+
│ ▼
|
|
2292
|
+
│ aether_report_to_orchestrator
|
|
2293
|
+
│
|
|
2294
|
+
├─ Phase complete? ──────────▶ aether_orchestra_checkpoint({ autoAdvance: true })
|
|
2295
|
+
│ │
|
|
2296
|
+
│ ├─ passed ──▶ Continue to next phase
|
|
2297
|
+
│ └─ failed ──▶ Fix blockers
|
|
2298
|
+
│
|
|
2299
|
+
└─ All phases done? ─────────▶ aether_complete_orchestra
|
|
2300
|
+
```
|
|
2301
|
+
|
|
2302
|
+
---
|
|
2303
|
+
|
|
2021
2304
|
## Audit Trail
|
|
2022
2305
|
|
|
2023
2306
|
Every action in Orchestra is logged for full auditability.
|
|
@@ -2320,6 +2603,52 @@ aether_complete_orchestra({
|
|
|
2320
2603
|
completionReason: 'all_criteria_met' | 'all_phases_complete' | 'manual_stop' | 'timeout' | 'max_iterations',
|
|
2321
2604
|
summary?: string
|
|
2322
2605
|
})
|
|
2606
|
+
|
|
2607
|
+
// Edit Orchestra (modify plan without restarting)
|
|
2608
|
+
aether_edit_orchestra({
|
|
2609
|
+
sessionId: string,
|
|
2610
|
+
action: 'add_task' | 'remove_task' | 'update_task' | 'split_task' | 'add_phase' | 'update_phase',
|
|
2611
|
+
phaseId?: string, // For add_task
|
|
2612
|
+
taskId?: string, // For remove_task, update_task, split_task
|
|
2613
|
+
task?: object, // Task definition for add_task/update_task
|
|
2614
|
+
splitInto?: object[], // Sub-tasks for split_task
|
|
2615
|
+
phase?: object, // Phase definition for add_phase
|
|
2616
|
+
phaseUpdates?: object // Updates for update_phase
|
|
2617
|
+
})
|
|
2618
|
+
|
|
2619
|
+
// Create Contract (Source of Truth)
|
|
2620
|
+
aether_create_contract({
|
|
2621
|
+
sessionId: string,
|
|
2622
|
+
requirements: string, // Full project requirements
|
|
2623
|
+
existingCodeSummary?: string // For brownfield projects
|
|
2624
|
+
})
|
|
2625
|
+
// Returns: { success: boolean, contract: object, contractVersion: number }
|
|
2626
|
+
```
|
|
2627
|
+
|
|
2628
|
+
### Workflow Enforcement (v7)
|
|
2629
|
+
|
|
2630
|
+
```typescript
|
|
2631
|
+
// Get Intelligent Guidance
|
|
2632
|
+
aether_orchestra_guide({
|
|
2633
|
+
sessionId?: string // Uses latest if not provided
|
|
2634
|
+
})
|
|
2635
|
+
// Returns: { nextTool: string, parameters: object, explanation: string, example?: string }
|
|
2636
|
+
|
|
2637
|
+
// Pre-flight Validation
|
|
2638
|
+
aether_orchestra_validate({
|
|
2639
|
+
sessionId?: string,
|
|
2640
|
+
intendedAction?: 'execute_task' | 'approve' | 'complete' | 'any'
|
|
2641
|
+
})
|
|
2642
|
+
// Returns: { valid: boolean, status: string, hasPlan: boolean, hasContract: boolean, warnings: string[], nextStep: object }
|
|
2643
|
+
|
|
2644
|
+
// Phase Checkpoint
|
|
2645
|
+
aether_orchestra_checkpoint({
|
|
2646
|
+
sessionId: string,
|
|
2647
|
+
phaseNumber?: number, // Uses current phase if not provided
|
|
2648
|
+
validateContract?: boolean, // Default: true
|
|
2649
|
+
autoAdvance?: boolean // Default: false - advance to next phase if passed
|
|
2650
|
+
})
|
|
2651
|
+
// Returns: { checkpointPassed: boolean, blockers: string[], autoAdvanced: boolean, advancedToPhase?: number }
|
|
2323
2652
|
```
|
|
2324
2653
|
|
|
2325
2654
|
### Generation
|
|
@@ -2428,6 +2757,7 @@ aether_push_local({
|
|
|
2428
2757
|
|
|
2429
2758
|
| Version | Date | Changes |
|
|
2430
2759
|
|---------|------|---------|
|
|
2760
|
+
| v7.0 | 2025-01 | Workflow enforcement: validate, checkpoint, guide tools |
|
|
2431
2761
|
| v6.0 | 2025-01 | File collision prevention, file lock manager |
|
|
2432
2762
|
| v5.0 | 2025-01 | Contract-first development, validation protocol |
|
|
2433
2763
|
| v4.0 | 2024-12 | Orchestrator Brain, dynamic decisions |
|
|
@@ -2441,17 +2771,22 @@ aether_push_local({
|
|
|
2441
2771
|
|
|
2442
2772
|
### Starting an Orchestra Session
|
|
2443
2773
|
|
|
2774
|
+
- [ ] `aether_orchestra_guide({})` - Get guidance on what to do
|
|
2444
2775
|
- [ ] `/orchestra` - Create session and plan
|
|
2445
2776
|
- [ ] Review generated DEVELOPMENT_PLAN.md
|
|
2446
2777
|
- [ ] Verify local project path for validation
|
|
2778
|
+
- [ ] `aether_create_contract()` - Generate Source of Truth [RECOMMENDED]
|
|
2779
|
+
- [ ] `aether_orchestra_validate({ intendedAction: "approve" })` - Pre-flight check
|
|
2447
2780
|
- [ ] `/orchestra approve` - Start execution
|
|
2448
2781
|
|
|
2449
2782
|
### During Execution
|
|
2450
2783
|
|
|
2784
|
+
- [ ] Use `aether_orchestra_guide` when unsure what to do next
|
|
2451
2785
|
- [ ] Monitor `aether_orchestra_status` regularly
|
|
2452
2786
|
- [ ] Check `safeguards` for approaching limits
|
|
2453
2787
|
- [ ] Validate after each code-generating task
|
|
2454
2788
|
- [ ] Full validation after each phase (typecheck + lint + test)
|
|
2789
|
+
- [ ] `aether_orchestra_checkpoint({ autoAdvance: true })` - Gate between phases
|
|
2455
2790
|
- [ ] Handle blockers promptly
|
|
2456
2791
|
|
|
2457
2792
|
### On Completion
|
|
@@ -2465,12 +2800,30 @@ aether_push_local({
|
|
|
2465
2800
|
### If Issues Occur
|
|
2466
2801
|
|
|
2467
2802
|
- [ ] Check `aether_orchestra_status` with logs
|
|
2803
|
+
- [ ] Use `aether_orchestra_guide` to get next step
|
|
2468
2804
|
- [ ] Review `tasksBlockedByFiles` for v6 conflicts
|
|
2469
2805
|
- [ ] Check `lastValidationErrors`
|
|
2806
|
+
- [ ] Use `aether_edit_orchestra` to modify plan mid-flight
|
|
2470
2807
|
- [ ] Use `aether_orchestra_pause` if needed
|
|
2471
2808
|
- [ ] Create fix tasks or manually resolve
|
|
2472
2809
|
- [ ] `aether_orchestra_resume` to continue
|
|
2473
2810
|
|
|
2811
|
+
### Workflow Enforcement Quick Commands
|
|
2812
|
+
|
|
2813
|
+
```javascript
|
|
2814
|
+
// When unsure what to do next:
|
|
2815
|
+
aether_orchestra_guide({})
|
|
2816
|
+
|
|
2817
|
+
// Before approving a plan:
|
|
2818
|
+
aether_orchestra_validate({ intendedAction: "approve" })
|
|
2819
|
+
|
|
2820
|
+
// After completing a phase:
|
|
2821
|
+
aether_orchestra_checkpoint({ sessionId, autoAdvance: true })
|
|
2822
|
+
|
|
2823
|
+
// To modify plan without restarting:
|
|
2824
|
+
aether_edit_orchestra({ sessionId, action: "add_task", ... })
|
|
2825
|
+
```
|
|
2826
|
+
|
|
2474
2827
|
---
|
|
2475
2828
|
|
|
2476
|
-
*Orchestra
|
|
2829
|
+
*Orchestra v7 - Autonomous AI Development Orchestration with Workflow Enforcement, Contract-First Development, Dynamic Agent Switching, and File Collision Prevention. The trust of millions of codebases depends on this system working reliably.*
|