tryassay 0.20.3 → 0.21.0
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/dist/api/server.d.ts +1 -0
- package/dist/api/server.js +104 -4
- package/dist/api/server.js.map +1 -1
- package/dist/cli.js +3 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/create.d.ts +2 -0
- package/dist/commands/create.js +74 -0
- package/dist/commands/create.js.map +1 -1
- package/dist/runtime/app-create-orchestrator.d.ts +8 -1
- package/dist/runtime/app-create-orchestrator.js +112 -6
- package/dist/runtime/app-create-orchestrator.js.map +1 -1
- package/dist/runtime/functional-tester.d.ts +39 -0
- package/dist/runtime/functional-tester.js +545 -0
- package/dist/runtime/functional-tester.js.map +1 -0
- package/dist/runtime/plan-refiner.d.ts +14 -0
- package/dist/runtime/plan-refiner.js +160 -0
- package/dist/runtime/plan-refiner.js.map +1 -0
- package/dist/runtime/types.d.ts +86 -0
- package/package.json +1 -1
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
// ============================================================
|
|
2
|
+
// Plan Refiner — Requirements refinement + plan validation
|
|
3
|
+
// Generates human-readable summaries, validates architecture plans,
|
|
4
|
+
// and applies modifications before code generation begins.
|
|
5
|
+
// ============================================================
|
|
6
|
+
export class PlanRefiner {
|
|
7
|
+
description;
|
|
8
|
+
constructor(description) {
|
|
9
|
+
this.description = description;
|
|
10
|
+
}
|
|
11
|
+
/** Generate a human-readable summary of the architecture plan. */
|
|
12
|
+
generateSummary(plan) {
|
|
13
|
+
const warnings = [];
|
|
14
|
+
// Check for features with empty descriptions
|
|
15
|
+
for (const feature of plan.features) {
|
|
16
|
+
if (!feature.name || feature.name.trim().length === 0) {
|
|
17
|
+
warnings.push(`Feature "${feature.id}" has no name`);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
// Check for orphaned schema entities (not referenced by any feature)
|
|
21
|
+
for (const entity of plan.schema) {
|
|
22
|
+
const referenced = plan.features.some(f => f.schemaEntities.includes(entity.name));
|
|
23
|
+
if (!referenced) {
|
|
24
|
+
warnings.push(`Schema entity "${entity.name}" is not referenced by any feature`);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
// Check for features with no routes and no pages
|
|
28
|
+
for (const feature of plan.features) {
|
|
29
|
+
const hasRoutes = plan.apiRoutes.some(r => r.featureId === feature.id);
|
|
30
|
+
const hasPages = plan.pages.some(p => p.featureId === feature.id);
|
|
31
|
+
const hasIpc = (plan.ipcChannels ?? []).some(ch => ch.featureId === feature.id);
|
|
32
|
+
if (!hasRoutes && !hasPages && !hasIpc) {
|
|
33
|
+
warnings.push(`Feature "${feature.name}" has no routes, pages, or IPC channels`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
// Check feature count heuristic
|
|
37
|
+
if (plan.features.length > 8) {
|
|
38
|
+
warnings.push(`High feature count (${plan.features.length}) — consider consolidating related features`);
|
|
39
|
+
}
|
|
40
|
+
if (plan.features.length === 0) {
|
|
41
|
+
warnings.push('Plan has no features');
|
|
42
|
+
}
|
|
43
|
+
const features = plan.features.map(f => ({
|
|
44
|
+
id: f.id,
|
|
45
|
+
name: f.name,
|
|
46
|
+
complexity: f.complexityEstimate,
|
|
47
|
+
dependsOn: f.dependsOn,
|
|
48
|
+
routeCount: plan.apiRoutes.filter(r => r.featureId === f.id).length
|
|
49
|
+
+ (plan.ipcChannels ?? []).filter(ch => ch.featureId === f.id).length,
|
|
50
|
+
pageCount: plan.pages.filter(p => p.featureId === f.id).length,
|
|
51
|
+
}));
|
|
52
|
+
const totalRoutes = plan.apiRoutes.length + (plan.ipcChannels ?? []).length;
|
|
53
|
+
const totalPages = plan.pages.length;
|
|
54
|
+
const complexity = plan.features.length <= 2 && totalRoutes <= 5 ? 'small'
|
|
55
|
+
: plan.features.length <= 5 && totalRoutes <= 15 ? 'medium'
|
|
56
|
+
: 'large';
|
|
57
|
+
return {
|
|
58
|
+
appName: this.description.name,
|
|
59
|
+
description: this.description.description,
|
|
60
|
+
techStack: `${this.description.techStack.framework} + ${this.description.techStack.database}`,
|
|
61
|
+
featureCount: plan.features.length,
|
|
62
|
+
features,
|
|
63
|
+
schemaEntities: plan.schema.length,
|
|
64
|
+
apiRouteCount: totalRoutes,
|
|
65
|
+
pageCount: totalPages,
|
|
66
|
+
estimatedComplexity: complexity,
|
|
67
|
+
warnings,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
/** Validate plan against heuristics. Returns warnings that should block auto-approval. */
|
|
71
|
+
validatePlan(plan) {
|
|
72
|
+
const warnings = [];
|
|
73
|
+
// Every feature must have at least one route, page, or IPC channel
|
|
74
|
+
for (const feature of plan.features) {
|
|
75
|
+
const hasRoutes = plan.apiRoutes.some(r => r.featureId === feature.id);
|
|
76
|
+
const hasPages = plan.pages.some(p => p.featureId === feature.id);
|
|
77
|
+
const hasIpc = (plan.ipcChannels ?? []).some(ch => ch.featureId === feature.id);
|
|
78
|
+
if (!hasRoutes && !hasPages && !hasIpc) {
|
|
79
|
+
warnings.push(`Feature "${feature.name}" has no routes, pages, or IPC channels — may produce no output`);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
// No orphaned schema entities
|
|
83
|
+
for (const entity of plan.schema) {
|
|
84
|
+
const referenced = plan.features.some(f => f.schemaEntities.includes(entity.name));
|
|
85
|
+
if (!referenced) {
|
|
86
|
+
warnings.push(`Schema entity "${entity.name}" is orphaned — no feature references it`);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
// Feature count within reasonable range
|
|
90
|
+
if (plan.features.length > 10) {
|
|
91
|
+
warnings.push(`Too many features (${plan.features.length}) — consider consolidating`);
|
|
92
|
+
}
|
|
93
|
+
// Feature descriptions non-empty
|
|
94
|
+
for (const feature of plan.features) {
|
|
95
|
+
if (!feature.name || feature.name.trim().length === 0) {
|
|
96
|
+
warnings.push(`Feature "${feature.id}" has empty name`);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
// All dependency order entries refer to existing features
|
|
100
|
+
for (const id of plan.dependencyOrder) {
|
|
101
|
+
if (!plan.features.find(f => f.id === id)) {
|
|
102
|
+
warnings.push(`Dependency order references unknown feature "${id}"`);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return {
|
|
106
|
+
valid: warnings.length === 0,
|
|
107
|
+
warnings,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
/** Apply modifications to a plan (e.g., remove features). Returns a new plan object. */
|
|
111
|
+
applyModifications(plan, modifications) {
|
|
112
|
+
// Work with mutable copies
|
|
113
|
+
let features = [...plan.features];
|
|
114
|
+
let apiRoutes = [...plan.apiRoutes];
|
|
115
|
+
let pages = [...plan.pages];
|
|
116
|
+
let ipcChannels = plan.ipcChannels ? [...plan.ipcChannels] : undefined;
|
|
117
|
+
let dependencyOrder = [...plan.dependencyOrder];
|
|
118
|
+
let schema = [...plan.schema];
|
|
119
|
+
for (const mod of modifications) {
|
|
120
|
+
if (mod.type === 'remove_feature') {
|
|
121
|
+
const featureId = mod.featureId;
|
|
122
|
+
// Remove the feature itself
|
|
123
|
+
features = features.filter(f => f.id !== featureId);
|
|
124
|
+
// Remove associated routes, pages, IPC channels
|
|
125
|
+
apiRoutes = apiRoutes.filter(r => r.featureId !== featureId);
|
|
126
|
+
pages = pages.filter(p => p.featureId !== featureId);
|
|
127
|
+
if (ipcChannels) {
|
|
128
|
+
ipcChannels = ipcChannels.filter(ch => ch.featureId !== featureId);
|
|
129
|
+
}
|
|
130
|
+
// Remove from dependency order
|
|
131
|
+
dependencyOrder = dependencyOrder.filter(id => id !== featureId);
|
|
132
|
+
// Clean up dependsOn references in remaining features
|
|
133
|
+
features = features.map(f => {
|
|
134
|
+
if (f.dependsOn.includes(featureId)) {
|
|
135
|
+
return {
|
|
136
|
+
...f,
|
|
137
|
+
dependsOn: f.dependsOn.filter(dep => dep !== featureId),
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
return f;
|
|
141
|
+
});
|
|
142
|
+
// Remove orphaned schema entities (only if no remaining feature references them)
|
|
143
|
+
schema = schema.filter(entity => {
|
|
144
|
+
return features.some(f => f.schemaEntities.includes(entity.name));
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
// add_feature and modify_feature can be implemented later
|
|
148
|
+
}
|
|
149
|
+
return {
|
|
150
|
+
...plan,
|
|
151
|
+
features,
|
|
152
|
+
apiRoutes,
|
|
153
|
+
pages,
|
|
154
|
+
ipcChannels,
|
|
155
|
+
dependencyOrder,
|
|
156
|
+
schema,
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
//# sourceMappingURL=plan-refiner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan-refiner.js","sourceRoot":"","sources":["../../src/runtime/plan-refiner.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,2DAA2D;AAC3D,oEAAoE;AACpE,2DAA2D;AAC3D,+DAA+D;AAW/D,MAAM,OAAO,WAAW;IACd,WAAW,CAAiB;IAEpC,YAAY,WAA2B;QACrC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;IAED,kEAAkE;IAClE,eAAe,CAAC,IAAsB;QACpC,MAAM,QAAQ,GAAa,EAAE,CAAC;QAE9B,6CAA6C;QAC7C,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YACpC,IAAI,CAAC,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACtD,QAAQ,CAAC,IAAI,CAAC,YAAY,OAAO,CAAC,EAAE,eAAe,CAAC,CAAC;YACvD,CAAC;QACH,CAAC;QAED,qEAAqE;QACrE,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YACjC,MAAM,UAAU,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CACxC,C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GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;oBAC1B,IAAI,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;wBACpC,OAAO;4BACL,GAAG,CAAC;4BACJ,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,SAAS,CAAC;yBACxD,CAAC;oBACJ,CAAC;oBACD,OAAO,CAAC,CAAC;gBACX,CAAC,CAAC,CAAC;gBAEH,iFAAiF;gBACjF,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE;oBAC9B,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;gBACpE,CAAC,CAAC,CAAC;YACL,CAAC;YACD,0DAA0D;QAC5D,CAAC;QAED,OAAO;YACL,GAAG,IAAI;YACP,QAAQ;YACR,SAAS;YACT,KAAK;YACL,WAAW;YACX,eAAe;YACf,MAAM;SACP,CAAC;IACJ,CAAC;CACF"}
|
package/dist/runtime/types.d.ts
CHANGED
|
@@ -1357,6 +1357,11 @@ export type AppCreatePhase = {
|
|
|
1357
1357
|
readonly phase: 'planning';
|
|
1358
1358
|
} | {
|
|
1359
1359
|
readonly phase: 'verifying_plan';
|
|
1360
|
+
} | {
|
|
1361
|
+
readonly phase: 'requirements_refining';
|
|
1362
|
+
} | {
|
|
1363
|
+
readonly phase: 'awaiting_approval';
|
|
1364
|
+
readonly planSummary: PlanSummary;
|
|
1360
1365
|
} | {
|
|
1361
1366
|
readonly phase: 'scaffolding';
|
|
1362
1367
|
} | {
|
|
@@ -1380,6 +1385,15 @@ export type AppCreatePhase = {
|
|
|
1380
1385
|
readonly errorCount: number;
|
|
1381
1386
|
} | {
|
|
1382
1387
|
readonly phase: 'integration_verifying';
|
|
1388
|
+
} | {
|
|
1389
|
+
readonly phase: 'functional_testing';
|
|
1390
|
+
readonly attempt: number;
|
|
1391
|
+
readonly maxAttempts: number;
|
|
1392
|
+
} | {
|
|
1393
|
+
readonly phase: 'functional_repairing';
|
|
1394
|
+
readonly attempt: number;
|
|
1395
|
+
readonly maxAttempts: number;
|
|
1396
|
+
readonly failureCount: number;
|
|
1383
1397
|
} | {
|
|
1384
1398
|
readonly phase: 'cross_verifying';
|
|
1385
1399
|
} | {
|
|
@@ -1406,6 +1420,7 @@ export interface AppCreateResult {
|
|
|
1406
1420
|
readonly buildVerification: BuildVerificationResult | null;
|
|
1407
1421
|
readonly integrationVerification: IntegrationVerificationResult | null;
|
|
1408
1422
|
readonly crossVerification: CrossFeatureVerification | null;
|
|
1423
|
+
readonly functionalTestResult: FunctionalTestResult | null;
|
|
1409
1424
|
readonly totalDurationMs: number;
|
|
1410
1425
|
readonly auditTrail: readonly AuditEntry[];
|
|
1411
1426
|
}
|
|
@@ -1495,6 +1510,77 @@ export interface AppCreateOptions {
|
|
|
1495
1510
|
readonly fullVerification?: boolean;
|
|
1496
1511
|
readonly maxBuildRepairAttempts?: number;
|
|
1497
1512
|
readonly skipBuildVerification?: boolean;
|
|
1513
|
+
readonly autoApprove?: boolean;
|
|
1514
|
+
readonly skipFunctionalTesting?: boolean;
|
|
1515
|
+
}
|
|
1516
|
+
export interface PlanSummary {
|
|
1517
|
+
readonly appName: string;
|
|
1518
|
+
readonly description: string;
|
|
1519
|
+
readonly techStack: string;
|
|
1520
|
+
readonly featureCount: number;
|
|
1521
|
+
readonly features: readonly PlanSummaryFeature[];
|
|
1522
|
+
readonly schemaEntities: number;
|
|
1523
|
+
readonly apiRouteCount: number;
|
|
1524
|
+
readonly pageCount: number;
|
|
1525
|
+
readonly estimatedComplexity: 'small' | 'medium' | 'large';
|
|
1526
|
+
readonly warnings: readonly string[];
|
|
1527
|
+
}
|
|
1528
|
+
export interface PlanSummaryFeature {
|
|
1529
|
+
readonly id: string;
|
|
1530
|
+
readonly name: string;
|
|
1531
|
+
readonly complexity: string;
|
|
1532
|
+
readonly dependsOn: readonly string[];
|
|
1533
|
+
readonly routeCount: number;
|
|
1534
|
+
readonly pageCount: number;
|
|
1535
|
+
}
|
|
1536
|
+
export type PlanApprovalResult = {
|
|
1537
|
+
readonly decision: 'approved';
|
|
1538
|
+
} | {
|
|
1539
|
+
readonly decision: 'approved_with_modifications';
|
|
1540
|
+
readonly modifications: readonly PlanModification[];
|
|
1541
|
+
} | {
|
|
1542
|
+
readonly decision: 'rejected';
|
|
1543
|
+
readonly reason: string;
|
|
1544
|
+
};
|
|
1545
|
+
export interface PlanModification {
|
|
1546
|
+
readonly type: 'remove_feature' | 'add_feature' | 'modify_feature';
|
|
1547
|
+
readonly featureId: string;
|
|
1548
|
+
readonly details?: string;
|
|
1549
|
+
}
|
|
1550
|
+
export interface FunctionalTest {
|
|
1551
|
+
readonly id: string;
|
|
1552
|
+
readonly type: 'api_route' | 'page_load' | 'auth_flow';
|
|
1553
|
+
readonly name: string;
|
|
1554
|
+
readonly method?: string;
|
|
1555
|
+
readonly path: string;
|
|
1556
|
+
readonly body?: unknown;
|
|
1557
|
+
readonly expectedStatusRange: [number, number];
|
|
1558
|
+
readonly errorPatterns: readonly string[];
|
|
1559
|
+
readonly featureId?: string;
|
|
1560
|
+
}
|
|
1561
|
+
export interface FunctionalTestExecution {
|
|
1562
|
+
readonly test: FunctionalTest;
|
|
1563
|
+
readonly status: 'pass' | 'fail' | 'error' | 'timeout';
|
|
1564
|
+
readonly statusCode: number | null;
|
|
1565
|
+
readonly responseBody: string;
|
|
1566
|
+
readonly errorMatch?: string;
|
|
1567
|
+
readonly durationMs: number;
|
|
1568
|
+
}
|
|
1569
|
+
export interface FunctionalTestRepairAttempt {
|
|
1570
|
+
readonly attempt: number;
|
|
1571
|
+
readonly failures: readonly FunctionalTestExecution[];
|
|
1572
|
+
readonly filesModified: readonly string[];
|
|
1573
|
+
readonly repairSucceeded: boolean;
|
|
1574
|
+
readonly durationMs: number;
|
|
1575
|
+
}
|
|
1576
|
+
export interface FunctionalTestResult {
|
|
1577
|
+
readonly status: 'pass' | 'fail' | 'repaired' | 'skipped';
|
|
1578
|
+
readonly tests: readonly FunctionalTestExecution[];
|
|
1579
|
+
readonly passedCount: number;
|
|
1580
|
+
readonly failedCount: number;
|
|
1581
|
+
readonly repairAttempts: readonly FunctionalTestRepairAttempt[];
|
|
1582
|
+
readonly serverPort: number | null;
|
|
1583
|
+
readonly totalDurationMs: number;
|
|
1498
1584
|
}
|
|
1499
1585
|
export type CheckStrategyType = 'pattern_presence' | 'pattern_absence' | 'cross_reference' | 'import_reachability' | 'response_shape' | 'conditional_presence' | 'file_reference' | 'ordering';
|
|
1500
1586
|
export interface PatternPresenceStrategy {
|