@schnick371/devsteps-shared 0.8.5 → 1.0.0-next.2
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/README.md +8 -3
- package/dist/constants/index.d.ts +26 -0
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/index.js +26 -0
- package/dist/constants/index.js.map +1 -1
- package/dist/core/add.d.ts +7 -0
- package/dist/core/add.d.ts.map +1 -1
- package/dist/core/add.js +9 -2
- package/dist/core/add.js.map +1 -1
- package/dist/core/archive.d.ts +7 -0
- package/dist/core/archive.d.ts.map +1 -1
- package/dist/core/archive.js +30 -20
- package/dist/core/archive.js.map +1 -1
- package/dist/core/auto-migrate-detect.d.ts +61 -0
- package/dist/core/auto-migrate-detect.d.ts.map +1 -0
- package/dist/core/auto-migrate-detect.js +68 -0
- package/dist/core/auto-migrate-detect.js.map +1 -0
- package/dist/core/auto-migrate-impl.d.ts +32 -0
- package/dist/core/auto-migrate-impl.d.ts.map +1 -0
- package/dist/core/auto-migrate-impl.js +120 -0
- package/dist/core/auto-migrate-impl.js.map +1 -0
- package/dist/core/auto-migrate.d.ts +16 -131
- package/dist/core/auto-migrate.d.ts.map +1 -1
- package/dist/core/auto-migrate.js +25 -318
- package/dist/core/auto-migrate.js.map +1 -1
- package/dist/core/auto-migrate.test.js +11 -7
- package/dist/core/auto-migrate.test.js.map +1 -1
- package/dist/core/bulk-update.d.ts +7 -0
- package/dist/core/bulk-update.d.ts.map +1 -1
- package/dist/core/bulk-update.js +8 -1
- package/dist/core/bulk-update.js.map +1 -1
- package/dist/core/config.d.ts +7 -0
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +7 -0
- package/dist/core/config.js.map +1 -1
- package/dist/core/context.d.ts +9 -0
- package/dist/core/context.d.ts.map +1 -1
- package/dist/core/context.js +9 -0
- package/dist/core/context.js.map +1 -1
- package/dist/core/get.d.ts +7 -0
- package/dist/core/get.d.ts.map +1 -1
- package/dist/core/get.js +8 -1
- package/dist/core/get.js.map +1 -1
- package/dist/core/index-rebuild.d.ts +3 -0
- package/dist/core/index-rebuild.d.ts.map +1 -1
- package/dist/core/index-rebuild.js +11 -8
- package/dist/core/index-rebuild.js.map +1 -1
- package/dist/core/index-rebuild.test.js +6 -15
- package/dist/core/index-rebuild.test.js.map +1 -1
- package/dist/core/index-refs-core.d.ts +114 -0
- package/dist/core/index-refs-core.d.ts.map +1 -0
- package/dist/core/index-refs-core.js +306 -0
- package/dist/core/index-refs-core.js.map +1 -0
- package/dist/core/index-refs.d.ts +9 -124
- package/dist/core/index-refs.d.ts.map +1 -1
- package/dist/core/index-refs.js +19 -345
- package/dist/core/index-refs.js.map +1 -1
- package/dist/core/index-refs.test.js +3 -3
- package/dist/core/index-refs.test.js.map +1 -1
- package/dist/core/index.d.ts +19 -10
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +19 -10
- package/dist/core/index.js.map +1 -1
- package/dist/core/link.d.ts +33 -0
- package/dist/core/link.d.ts.map +1 -0
- package/dist/core/link.js +102 -0
- package/dist/core/link.js.map +1 -0
- package/dist/core/list.d.ts +8 -0
- package/dist/core/list.d.ts.map +1 -1
- package/dist/core/list.js +82 -5
- package/dist/core/list.js.map +1 -1
- package/dist/core/unlink.d.ts +26 -0
- package/dist/core/unlink.d.ts.map +1 -0
- package/dist/core/unlink.js +78 -0
- package/dist/core/unlink.js.map +1 -0
- package/dist/core/update.d.ts +7 -0
- package/dist/core/update.d.ts.map +1 -1
- package/dist/core/update.js +16 -8
- package/dist/core/update.js.map +1 -1
- package/dist/core/validation.d.ts +26 -1
- package/dist/core/validation.d.ts.map +1 -1
- package/dist/core/validation.js +65 -4
- package/dist/core/validation.js.map +1 -1
- package/dist/index.d.ts +11 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -4
- package/dist/index.js.map +1 -1
- package/dist/schemas/analysis.d.ts +206 -0
- package/dist/schemas/analysis.d.ts.map +1 -0
- package/dist/schemas/analysis.js +138 -0
- package/dist/schemas/analysis.js.map +1 -0
- package/dist/schemas/cbp-loops.d.ts +154 -0
- package/dist/schemas/cbp-loops.d.ts.map +1 -0
- package/dist/schemas/cbp-loops.js +160 -0
- package/dist/schemas/cbp-loops.js.map +1 -0
- package/dist/schemas/cbp-loops.test.d.ts +10 -0
- package/dist/schemas/cbp-loops.test.d.ts.map +1 -0
- package/dist/schemas/cbp-loops.test.js +268 -0
- package/dist/schemas/cbp-loops.test.js.map +1 -0
- package/dist/schemas/cbp-mandate.d.ts +107 -0
- package/dist/schemas/cbp-mandate.d.ts.map +1 -0
- package/dist/schemas/cbp-mandate.js +107 -0
- package/dist/schemas/cbp-mandate.js.map +1 -0
- package/dist/schemas/cbp-mandate.test.d.ts +10 -0
- package/dist/schemas/cbp-mandate.test.d.ts.map +1 -0
- package/dist/schemas/cbp-mandate.test.js +188 -0
- package/dist/schemas/cbp-mandate.test.js.map +1 -0
- package/dist/schemas/index-refs.schema.d.ts +4 -1
- package/dist/schemas/index-refs.schema.d.ts.map +1 -1
- package/dist/schemas/index-refs.schema.js +24 -3
- package/dist/schemas/index-refs.schema.js.map +1 -1
- package/dist/schemas/index.d.ts +17 -7
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +14 -1
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/project.d.ts +7 -0
- package/dist/schemas/project.d.ts.map +1 -1
- package/dist/schemas/project.js +7 -0
- package/dist/schemas/project.js.map +1 -1
- package/dist/schemas/relationships.d.ts +3 -0
- package/dist/schemas/relationships.d.ts.map +1 -1
- package/dist/schemas/relationships.js +3 -0
- package/dist/schemas/relationships.js.map +1 -1
- package/dist/types/commands.d.ts +7 -0
- package/dist/types/commands.d.ts.map +1 -1
- package/dist/types/commands.js +7 -0
- package/dist/types/commands.js.map +1 -1
- package/dist/types/index-refs.types.d.ts +3 -0
- package/dist/types/index-refs.types.d.ts.map +1 -1
- package/dist/types/index-refs.types.js +3 -0
- package/dist/types/index-refs.types.js.map +1 -1
- package/dist/types/index.d.ts +9 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +7 -0
- package/dist/types/index.js.map +1 -1
- package/dist/utils/cache.d.ts +7 -0
- package/dist/utils/cache.d.ts.map +1 -1
- package/dist/utils/cache.js +7 -0
- package/dist/utils/cache.js.map +1 -1
- package/dist/utils/index.d.ts +9 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +26 -3
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/init-helpers.d.ts +30 -0
- package/dist/utils/init-helpers.d.ts.map +1 -0
- package/dist/utils/init-helpers.js +134 -0
- package/dist/utils/init-helpers.js.map +1 -0
- package/package.json +1 -1
package/dist/core/update.js
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright © 2025 Thomas Hertel (the@devsteps.dev)
|
|
3
|
+
* Licensed under the Apache License, Version 2.0
|
|
4
|
+
*
|
|
5
|
+
* Core update-item operation
|
|
6
|
+
* Patches item metadata fields and synchronizes the distributed index.
|
|
7
|
+
*/
|
|
1
8
|
import { existsSync, readFileSync, writeFileSync } from 'node:fs';
|
|
2
9
|
import { join } from 'node:path';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { updateItemInIndex } from './index-refs.js';
|
|
10
|
+
import { RELATIONSHIP_TYPE, STATUS } from '../constants/index.js';
|
|
11
|
+
import { getCurrentTimestamp, parseItemId, TYPE_TO_DIRECTORY } from '../utils/index.js';
|
|
6
12
|
import { getItem } from './get.js';
|
|
13
|
+
import { updateItemInIndex } from './index-refs.js';
|
|
7
14
|
/**
|
|
8
15
|
* Core business logic for updating an item
|
|
9
16
|
*/
|
|
@@ -28,7 +35,8 @@ export async function updateItem(devstepsDir, args) {
|
|
|
28
35
|
if (args.status === STATUS.DONE) {
|
|
29
36
|
// Helper function to validate children are complete
|
|
30
37
|
const validateChildren = async (relationshipType) => {
|
|
31
|
-
|
|
38
|
+
// Guard: old-format items may lack linked_items or specific relation keys
|
|
39
|
+
const children = metadata.linked_items?.[relationshipType] ?? [];
|
|
32
40
|
if (children.length > 0) {
|
|
33
41
|
const openChildren = [];
|
|
34
42
|
for (const childId of children) {
|
|
@@ -36,7 +44,9 @@ export async function updateItem(devstepsDir, args) {
|
|
|
36
44
|
if (childParsed) {
|
|
37
45
|
try {
|
|
38
46
|
const { metadata: childMeta } = await getItem(devstepsDir, childId);
|
|
39
|
-
if (childMeta.status !== STATUS.DONE &&
|
|
47
|
+
if (childMeta.status !== STATUS.DONE &&
|
|
48
|
+
childMeta.status !== STATUS.CANCELLED &&
|
|
49
|
+
childMeta.status !== STATUS.OBSOLETE) {
|
|
40
50
|
openChildren.push(childId);
|
|
41
51
|
}
|
|
42
52
|
}
|
|
@@ -86,9 +96,7 @@ export async function updateItem(devstepsDir, args) {
|
|
|
86
96
|
}
|
|
87
97
|
else if (args.append_description) {
|
|
88
98
|
// Append to existing (or create new if doesn't exist)
|
|
89
|
-
const existing = existsSync(descriptionPath)
|
|
90
|
-
? readFileSync(descriptionPath, 'utf-8')
|
|
91
|
-
: '';
|
|
99
|
+
const existing = existsSync(descriptionPath) ? readFileSync(descriptionPath, 'utf-8') : '';
|
|
92
100
|
writeFileSync(descriptionPath, existing + args.append_description);
|
|
93
101
|
}
|
|
94
102
|
// Update index (auto-migration ensures refs-style always available)
|
package/dist/core/update.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../src/core/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../src/core/update.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAA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,CAAC,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAE/D,qBAAqB;IACrB,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAChD,MAAM,IAAI,KAAK,CAAC,mEAAmE,CAAC,CAAC;IACvF,CAAC;IAED,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;QACrB,6BAA6B;QAC7B,aAAa,CAAC,eAAe,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IACnD,CAAC;SAAM,IAAI,IAAI,CAAC,kBAAkB,EAAE,CAAC;QACnC,sDAAsD;QACtD,MAAM,QAAQ,GAAG,UAAU,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC3F,aAAa,CAAC,eAAe,EAAE,QAAQ,GAAG,IAAI,CAAC,kBAAkB,CAAC,CAAC;IACrE,CAAC;IAED,oEAAoE;IACpE,qEAAqE;IACrE,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;QACnC,iBAAiB,CACf,WAAW,EACX,IAAI,CAAC,EAAE,EACP,SAAS,EACT,IAAI,CAAC,MAAM,EACX,SAAS,EAAE,yCAAyC;QACpD,IAAI,CAAC,UAAU,CAChB,CAAC;IACJ,CAAC;IAED,OAAO;QACL,QAAQ;QACR,SAAS;KACV,CAAC;AACJ,CAAC"}
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright © 2025 Thomas Hertel (the@devsteps.dev)
|
|
3
|
+
* Licensed under the Apache License, Version 2.0
|
|
4
|
+
*
|
|
5
|
+
* Relationship validation
|
|
6
|
+
* Enforces hierarchy rules and flexible relationship constraints
|
|
7
|
+
* based on the active project methodology.
|
|
8
|
+
*/
|
|
9
|
+
import type { ItemType, LinkedItems, Methodology } from '../schemas/index.js';
|
|
2
10
|
/**
|
|
3
11
|
* Validation result with detailed error messaging
|
|
4
12
|
*/
|
|
@@ -25,4 +33,21 @@ export interface WorkItem {
|
|
|
25
33
|
* @returns ValidationResult with valid flag and optional error/suggestion
|
|
26
34
|
*/
|
|
27
35
|
export declare function validateRelationship(source: WorkItem, target: WorkItem, relationType: string, methodology: Methodology): ValidationResult;
|
|
36
|
+
/**
|
|
37
|
+
* Validate that no conflicting relation types exist between the same source and target.
|
|
38
|
+
*
|
|
39
|
+
* Blocks:
|
|
40
|
+
* - hierarchy + any other type to same target
|
|
41
|
+
* - multiple hierarchy types to same target
|
|
42
|
+
*
|
|
43
|
+
* Allows:
|
|
44
|
+
* - bidirectional symmetric flexible relations (e.g. relates-to)
|
|
45
|
+
* - multiple flexible types to same target (e.g. depends-on + relates-to)
|
|
46
|
+
*
|
|
47
|
+
* @param targetId - The target item ID being linked
|
|
48
|
+
* @param newRelationType - The new relation type being added
|
|
49
|
+
* @param existingLinks - Current linked_items of the source item
|
|
50
|
+
* @returns ValidationResult indicating conflict or success
|
|
51
|
+
*/
|
|
52
|
+
export declare function validateRelationConflict(targetId: string, newRelationType: string, existingLinks: LinkedItems): ValidationResult;
|
|
28
53
|
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/core/validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/core/validation.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAG9E;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,QAAQ,CAAC;CAChB;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,QAAQ,EAChB,MAAM,EAAE,QAAQ,EAChB,YAAY,EAAE,MAAM,EACpB,WAAW,EAAE,WAAW,GACvB,gBAAgB,CA2DlB;AAmLD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,MAAM,EAChB,eAAe,EAAE,MAAM,EACvB,aAAa,EAAE,WAAW,GACzB,gBAAgB,CAoClB"}
|
package/dist/core/validation.js
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright © 2025 Thomas Hertel (the@devsteps.dev)
|
|
3
|
+
* Licensed under the Apache License, Version 2.0
|
|
4
|
+
*
|
|
5
|
+
* Relationship validation
|
|
6
|
+
* Enforces hierarchy rules and flexible relationship constraints
|
|
7
|
+
* based on the active project methodology.
|
|
8
|
+
*/
|
|
9
|
+
import { ITEM_TYPE, METHODOLOGY, RELATIONSHIP_TYPE } from '../constants/index.js';
|
|
1
10
|
import { isFlexibleRelation, isHierarchyRelation } from '../schemas/relationships.js';
|
|
2
|
-
import { ITEM_TYPE, RELATIONSHIP_TYPE, METHODOLOGY } from '../constants/index.js';
|
|
3
11
|
/**
|
|
4
12
|
* Validate relationship between two items based on methodology
|
|
5
13
|
* Only validates "implements" relationships - all other relations are flexible
|
|
@@ -29,7 +37,8 @@ export function validateRelationship(source, target, relationType, methodology)
|
|
|
29
37
|
// Bug blocks: validate as hierarchy below
|
|
30
38
|
}
|
|
31
39
|
// Only validate "implements" direction (implemented-by, blocked-by are automatic reverse)
|
|
32
|
-
if (relationType === RELATIONSHIP_TYPE.IMPLEMENTED_BY ||
|
|
40
|
+
if (relationType === RELATIONSHIP_TYPE.IMPLEMENTED_BY ||
|
|
41
|
+
relationType === RELATIONSHIP_TYPE.BLOCKED_BY) {
|
|
33
42
|
return { valid: true }; // Reverse relationships auto-created, no validation needed
|
|
34
43
|
}
|
|
35
44
|
// Validate based on methodology
|
|
@@ -68,7 +77,9 @@ function validateScrumHierarchy(source, target) {
|
|
|
68
77
|
const { type: targetType } = target;
|
|
69
78
|
// Task → Story, Spike, or Bug
|
|
70
79
|
if (sourceType === ITEM_TYPE.TASK) {
|
|
71
|
-
if (targetType === ITEM_TYPE.STORY ||
|
|
80
|
+
if (targetType === ITEM_TYPE.STORY ||
|
|
81
|
+
targetType === ITEM_TYPE.SPIKE ||
|
|
82
|
+
targetType === ITEM_TYPE.BUG) {
|
|
72
83
|
return { valid: true };
|
|
73
84
|
}
|
|
74
85
|
return {
|
|
@@ -145,7 +156,9 @@ function validateWaterfallHierarchy(source, target) {
|
|
|
145
156
|
const { type: targetType } = target;
|
|
146
157
|
// Task → Feature, Spike, or Bug
|
|
147
158
|
if (sourceType === ITEM_TYPE.TASK) {
|
|
148
|
-
if (targetType === ITEM_TYPE.FEATURE ||
|
|
159
|
+
if (targetType === ITEM_TYPE.FEATURE ||
|
|
160
|
+
targetType === ITEM_TYPE.SPIKE ||
|
|
161
|
+
targetType === ITEM_TYPE.BUG) {
|
|
149
162
|
return { valid: true };
|
|
150
163
|
}
|
|
151
164
|
return {
|
|
@@ -212,4 +225,52 @@ function validateWaterfallHierarchy(source, target) {
|
|
|
212
225
|
suggestion: 'Check Waterfall hierarchy: Requirement → Feature|Spike → Task',
|
|
213
226
|
};
|
|
214
227
|
}
|
|
228
|
+
/**
|
|
229
|
+
* Validate that no conflicting relation types exist between the same source and target.
|
|
230
|
+
*
|
|
231
|
+
* Blocks:
|
|
232
|
+
* - hierarchy + any other type to same target
|
|
233
|
+
* - multiple hierarchy types to same target
|
|
234
|
+
*
|
|
235
|
+
* Allows:
|
|
236
|
+
* - bidirectional symmetric flexible relations (e.g. relates-to)
|
|
237
|
+
* - multiple flexible types to same target (e.g. depends-on + relates-to)
|
|
238
|
+
*
|
|
239
|
+
* @param targetId - The target item ID being linked
|
|
240
|
+
* @param newRelationType - The new relation type being added
|
|
241
|
+
* @param existingLinks - Current linked_items of the source item
|
|
242
|
+
* @returns ValidationResult indicating conflict or success
|
|
243
|
+
*/
|
|
244
|
+
export function validateRelationConflict(targetId, newRelationType, existingLinks) {
|
|
245
|
+
const newIsHierarchy = isHierarchyRelation(newRelationType);
|
|
246
|
+
for (const [existingType, targetIds] of Object.entries(existingLinks)) {
|
|
247
|
+
// Skip same type — duplicate check is handled separately
|
|
248
|
+
if (existingType === newRelationType)
|
|
249
|
+
continue;
|
|
250
|
+
// Skip if target not in this relation list
|
|
251
|
+
if (!Array.isArray(targetIds) || !targetIds.includes(targetId))
|
|
252
|
+
continue;
|
|
253
|
+
const existingIsHierarchy = isHierarchyRelation(existingType);
|
|
254
|
+
// Block: both hierarchy types to same target
|
|
255
|
+
if (newIsHierarchy && existingIsHierarchy) {
|
|
256
|
+
return {
|
|
257
|
+
valid: false,
|
|
258
|
+
error: `Cannot add "${newRelationType}" to ${targetId} — already has hierarchy relation "${existingType}" to same target`,
|
|
259
|
+
suggestion: `Remove the existing "${existingType}" link first, or use a different target`,
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
// Block: hierarchy mixed with any flexible type to same target
|
|
263
|
+
if (newIsHierarchy || existingIsHierarchy) {
|
|
264
|
+
const hierarchyType = newIsHierarchy ? newRelationType : existingType;
|
|
265
|
+
const flexibleType = newIsHierarchy ? existingType : newRelationType;
|
|
266
|
+
return {
|
|
267
|
+
valid: false,
|
|
268
|
+
error: `Cannot mix hierarchy relation "${hierarchyType}" with flexible relation "${flexibleType}" to same target ${targetId}`,
|
|
269
|
+
suggestion: `Use only "${hierarchyType}" (hierarchy takes precedence) and remove "${flexibleType}", or use a different target`,
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
// Multiple flexible types to same target: allowed
|
|
273
|
+
}
|
|
274
|
+
return { valid: true };
|
|
275
|
+
}
|
|
215
276
|
//# sourceMappingURL=validation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../src/core/validation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../src/core/validation.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAElF,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAmBtF;;;;;;;;;GASG;AACH,MAAM,UAAU,oBAAoB,CAClC,MAAgB,EAChB,MAAgB,EAChB,YAAoB,EACpB,WAAwB;IAExB,wCAAwC;IACxC,IAAI,kBAAkB,CAAC,YAAY,CAAC,EAAE,CAAC;QACrC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IACzB,CAAC;IAED,wCAAwC;IACxC,IAAI,CAAC,mBAAmB,CAAC,YAAY,CAAC,EAAE,CAAC;QACvC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,8BAA8B,YAAY,EAAE,EAAE,CAAC;IAC/E,CAAC;IAED,wEAAwE;IACxE,4DAA4D;IAC5D,6EAA6E;IAC7E,IAAI,YAAY,KAAK,iBAAiB,CAAC,MAAM,EAAE,CAAC;QAC9C,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS,CAAC,GAAG,EAAE,CAAC;YAClC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,6BAA6B;QACvD,CAAC;QACD,0CAA0C;IAC5C,CAAC;IAED,0FAA0F;IAC1F,IACE,YAAY,KAAK,iBAAiB,CAAC,cAAc;QACjD,YAAY,KAAK,iBAAiB,CAAC,UAAU,EAC7C,CAAC;QACD,OAAO,EA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AAkC,aAAa,6BAA6B,YAAY,oBAAoB,QAAQ,EAAE;gBAC7H,UAAU,EAAE,aAAa,aAAa,8CAA8C,YAAY,8BAA8B;aAC/H,CAAC;QACJ,CAAC;QAED,kDAAkD;IACpD,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AACzB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright © 2025 Thomas Hertel (the@devsteps.dev)
|
|
3
|
+
* Licensed under the Apache License, Version 2.0
|
|
4
|
+
*
|
|
5
|
+
* Shared package public API
|
|
6
|
+
* Single entry point re-exporting all public types, schemas, and core functions.
|
|
7
|
+
*/
|
|
8
|
+
export * from './constants/index.js';
|
|
9
|
+
export { HIERARCHY_TYPE, ITEM_TYPE, METHODOLOGY, RELATIONSHIP_TYPE, STATUS, } from './constants/index.js';
|
|
10
|
+
export * from './core/index.js';
|
|
2
11
|
export * from './schemas/index.js';
|
|
12
|
+
export * from './types/index.js';
|
|
3
13
|
export * from './utils/index.js';
|
|
4
|
-
export * from './core/index.js';
|
|
5
|
-
export * from './constants/index.js';
|
|
6
|
-
export { ITEM_TYPE, STATUS, RELATIONSHIP_TYPE, METHODOLOGY, HIERARCHY_TYPE, } from './constants/index.js';
|
|
7
14
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,sBAAsB,CAAC;AACrC,OAAO,EACL,cAAc,EACd,SAAS,EACT,WAAW,EACX,iBAAiB,EACjB,MAAM,GACP,MAAM,sBAAsB,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright © 2025 Thomas Hertel (the@devsteps.dev)
|
|
3
|
+
* Licensed under the Apache License, Version 2.0
|
|
4
|
+
*
|
|
5
|
+
* Shared package public API
|
|
6
|
+
* Single entry point re-exporting all public types, schemas, and core functions.
|
|
7
|
+
*/
|
|
8
|
+
export * from './constants/index.js';
|
|
9
|
+
export { HIERARCHY_TYPE, ITEM_TYPE, METHODOLOGY, RELATIONSHIP_TYPE, STATUS, } from './constants/index.js';
|
|
10
|
+
export * from './core/index.js';
|
|
2
11
|
export * from './schemas/index.js';
|
|
12
|
+
export * from './types/index.js';
|
|
3
13
|
export * from './utils/index.js';
|
|
4
|
-
export * from './core/index.js';
|
|
5
|
-
export * from './constants/index.js';
|
|
6
|
-
export { ITEM_TYPE, STATUS, RELATIONSHIP_TYPE, METHODOLOGY, HIERARCHY_TYPE, } from './constants/index.js';
|
|
7
14
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,sBAAsB,CAAC;AACrC,OAAO,EACL,cAAc,EACd,SAAS,EACT,WAAW,EACX,iBAAiB,EACjB,MAAM,GACP,MAAM,sBAAsB,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright © 2025 Thomas Hertel (the@devsteps.dev)
|
|
3
|
+
* Licensed under the Apache License, Version 2.0
|
|
4
|
+
*
|
|
5
|
+
* Context Budget Protocol (CBP) — Analysis Schemas
|
|
6
|
+
* Zod schemas for T3 archaeology and analysis envelope files.
|
|
7
|
+
*
|
|
8
|
+
* @see EPIC-027 CBP Tier-3 Analysis Tools
|
|
9
|
+
*/
|
|
10
|
+
import { z } from 'zod';
|
|
11
|
+
/**
|
|
12
|
+
* Context Budget Protocol (CBP) — Analysis Schemas
|
|
13
|
+
*
|
|
14
|
+
* Defines structured JSON envelopes for AI agent-to-agent handoffs.
|
|
15
|
+
* Aspect agents write AnalysisBriefing to disk (.devsteps/analysis/[ID]/)
|
|
16
|
+
* and return CompressedVerdict envelopes (~150 tokens) in-memory to the coordinator.
|
|
17
|
+
*
|
|
18
|
+
* @see EPIC-027 Context Budget Protocol Infrastructure
|
|
19
|
+
*/
|
|
20
|
+
export declare const AnalysisAspect: z.ZodEnum<{
|
|
21
|
+
impact: "impact";
|
|
22
|
+
constraints: "constraints";
|
|
23
|
+
quality: "quality";
|
|
24
|
+
staleness: "staleness";
|
|
25
|
+
integration: "integration";
|
|
26
|
+
internal: "internal";
|
|
27
|
+
web: "web";
|
|
28
|
+
meta: "meta";
|
|
29
|
+
}>;
|
|
30
|
+
export type AnalysisAspect = z.infer<typeof AnalysisAspect>;
|
|
31
|
+
export declare const AspectVerdict: z.ZodEnum<{
|
|
32
|
+
PROCEED: "PROCEED";
|
|
33
|
+
"PROCEED-WITH-CAUTION": "PROCEED-WITH-CAUTION";
|
|
34
|
+
STOP: "STOP";
|
|
35
|
+
CURRENT: "CURRENT";
|
|
36
|
+
"STALE-PARTIAL": "STALE-PARTIAL";
|
|
37
|
+
"STALE-OBSOLETE": "STALE-OBSOLETE";
|
|
38
|
+
"STALE-CONFLICT": "STALE-CONFLICT";
|
|
39
|
+
}>;
|
|
40
|
+
export type AspectVerdict = z.infer<typeof AspectVerdict>;
|
|
41
|
+
/**
|
|
42
|
+
* Compressed envelope returned IN-MEMORY by aspect agents to the coordinator.
|
|
43
|
+
* Max ~150 tokens — coordinator reads only this, never the full report.
|
|
44
|
+
*/
|
|
45
|
+
export declare const CompressedVerdictSchema: z.ZodObject<{
|
|
46
|
+
aspect: z.ZodEnum<{
|
|
47
|
+
impact: "impact";
|
|
48
|
+
constraints: "constraints";
|
|
49
|
+
quality: "quality";
|
|
50
|
+
staleness: "staleness";
|
|
51
|
+
integration: "integration";
|
|
52
|
+
internal: "internal";
|
|
53
|
+
web: "web";
|
|
54
|
+
meta: "meta";
|
|
55
|
+
}>;
|
|
56
|
+
verdict: z.ZodEnum<{
|
|
57
|
+
PROCEED: "PROCEED";
|
|
58
|
+
"PROCEED-WITH-CAUTION": "PROCEED-WITH-CAUTION";
|
|
59
|
+
STOP: "STOP";
|
|
60
|
+
CURRENT: "CURRENT";
|
|
61
|
+
"STALE-PARTIAL": "STALE-PARTIAL";
|
|
62
|
+
"STALE-OBSOLETE": "STALE-OBSOLETE";
|
|
63
|
+
"STALE-CONFLICT": "STALE-CONFLICT";
|
|
64
|
+
}>;
|
|
65
|
+
confidence: z.ZodNumber;
|
|
66
|
+
top3_findings: z.ZodArray<z.ZodString>;
|
|
67
|
+
report_path: z.ZodString;
|
|
68
|
+
timestamp: z.ZodString;
|
|
69
|
+
winner: z.ZodOptional<z.ZodString>;
|
|
70
|
+
rule_applied: z.ZodOptional<z.ZodString>;
|
|
71
|
+
implementation_briefing: z.ZodOptional<z.ZodString>;
|
|
72
|
+
internet_advantage_claim: z.ZodOptional<z.ZodString>;
|
|
73
|
+
metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
74
|
+
}, z.core.$strip>;
|
|
75
|
+
export type CompressedVerdict = z.infer<typeof CompressedVerdictSchema>;
|
|
76
|
+
/**
|
|
77
|
+
* Full analysis report written to disk by aspect agents.
|
|
78
|
+
* Path: `.devsteps/analysis/[TASK-ID]/[aspect]-report.json`
|
|
79
|
+
* Contains the CompressedVerdict envelope + full markdown analysis text.
|
|
80
|
+
* Impl-subagent reads this for implementation context.
|
|
81
|
+
*/
|
|
82
|
+
export declare const AnalysisBriefingSchema: z.ZodObject<{
|
|
83
|
+
task_id: z.ZodString;
|
|
84
|
+
aspect: z.ZodEnum<{
|
|
85
|
+
impact: "impact";
|
|
86
|
+
constraints: "constraints";
|
|
87
|
+
quality: "quality";
|
|
88
|
+
staleness: "staleness";
|
|
89
|
+
integration: "integration";
|
|
90
|
+
internal: "internal";
|
|
91
|
+
web: "web";
|
|
92
|
+
meta: "meta";
|
|
93
|
+
}>;
|
|
94
|
+
analyst: z.ZodString;
|
|
95
|
+
created: z.ZodString;
|
|
96
|
+
envelope: z.ZodObject<{
|
|
97
|
+
aspect: z.ZodEnum<{
|
|
98
|
+
impact: "impact";
|
|
99
|
+
constraints: "constraints";
|
|
100
|
+
quality: "quality";
|
|
101
|
+
staleness: "staleness";
|
|
102
|
+
integration: "integration";
|
|
103
|
+
internal: "internal";
|
|
104
|
+
web: "web";
|
|
105
|
+
meta: "meta";
|
|
106
|
+
}>;
|
|
107
|
+
verdict: z.ZodEnum<{
|
|
108
|
+
PROCEED: "PROCEED";
|
|
109
|
+
"PROCEED-WITH-CAUTION": "PROCEED-WITH-CAUTION";
|
|
110
|
+
STOP: "STOP";
|
|
111
|
+
CURRENT: "CURRENT";
|
|
112
|
+
"STALE-PARTIAL": "STALE-PARTIAL";
|
|
113
|
+
"STALE-OBSOLETE": "STALE-OBSOLETE";
|
|
114
|
+
"STALE-CONFLICT": "STALE-CONFLICT";
|
|
115
|
+
}>;
|
|
116
|
+
confidence: z.ZodNumber;
|
|
117
|
+
top3_findings: z.ZodArray<z.ZodString>;
|
|
118
|
+
report_path: z.ZodString;
|
|
119
|
+
timestamp: z.ZodString;
|
|
120
|
+
winner: z.ZodOptional<z.ZodString>;
|
|
121
|
+
rule_applied: z.ZodOptional<z.ZodString>;
|
|
122
|
+
implementation_briefing: z.ZodOptional<z.ZodString>;
|
|
123
|
+
internet_advantage_claim: z.ZodOptional<z.ZodString>;
|
|
124
|
+
metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
125
|
+
}, z.core.$strip>;
|
|
126
|
+
full_analysis: z.ZodString;
|
|
127
|
+
affected_files: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
128
|
+
recommendations: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
129
|
+
schema_version: z.ZodDefault<z.ZodLiteral<"1.0">>;
|
|
130
|
+
}, z.core.$strip>;
|
|
131
|
+
export type AnalysisBriefing = z.infer<typeof AnalysisBriefingSchema>;
|
|
132
|
+
/**
|
|
133
|
+
* Meta-verdict written by the coordinator judge in Competitive Mode.
|
|
134
|
+
* Path: `.devsteps/analysis/[TASK-ID]/meta.json`
|
|
135
|
+
*/
|
|
136
|
+
export declare const SprintVerdictSchema: z.ZodObject<{
|
|
137
|
+
task_id: z.ZodString;
|
|
138
|
+
mode: z.ZodLiteral<"competitive">;
|
|
139
|
+
winner: z.ZodEnum<{
|
|
140
|
+
"devsteps-analyst-internal-subagent": "devsteps-analyst-internal-subagent";
|
|
141
|
+
"devsteps-analyst-web-subagent": "devsteps-analyst-web-subagent";
|
|
142
|
+
}>;
|
|
143
|
+
rule_applied: z.ZodEnum<{
|
|
144
|
+
"RULE 1": "RULE 1";
|
|
145
|
+
"RULE 2": "RULE 2";
|
|
146
|
+
"RULE 3": "RULE 3";
|
|
147
|
+
"RULE 4": "RULE 4";
|
|
148
|
+
"RULE 5": "RULE 5";
|
|
149
|
+
}>;
|
|
150
|
+
implementation_briefing: z.ZodString;
|
|
151
|
+
flags: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
152
|
+
created: z.ZodString;
|
|
153
|
+
schema_version: z.ZodDefault<z.ZodLiteral<"1.0">>;
|
|
154
|
+
}, z.core.$strip>;
|
|
155
|
+
export type SprintVerdict = z.infer<typeof SprintVerdictSchema>;
|
|
156
|
+
/**
|
|
157
|
+
* Produced by devsteps-planner at sprint start from global archaeology + backlog.
|
|
158
|
+
* Path: `.devsteps/analysis/sprint-[DATE]/enriched-sprint-brief.json`
|
|
159
|
+
*/
|
|
160
|
+
export declare const SprintItemRisk: z.ZodEnum<{
|
|
161
|
+
QUICK: "QUICK";
|
|
162
|
+
STANDARD: "STANDARD";
|
|
163
|
+
FULL: "FULL";
|
|
164
|
+
COMPETITIVE: "COMPETITIVE";
|
|
165
|
+
}>;
|
|
166
|
+
export type SprintItemRisk = z.infer<typeof SprintItemRisk>;
|
|
167
|
+
export declare const EnrichedSprintItemSchema: z.ZodObject<{
|
|
168
|
+
item_id: z.ZodString;
|
|
169
|
+
title: z.ZodString;
|
|
170
|
+
risk: z.ZodEnum<{
|
|
171
|
+
QUICK: "QUICK";
|
|
172
|
+
STANDARD: "STANDARD";
|
|
173
|
+
FULL: "FULL";
|
|
174
|
+
COMPETITIVE: "COMPETITIVE";
|
|
175
|
+
}>;
|
|
176
|
+
estimated_minutes: z.ZodOptional<z.ZodNumber>;
|
|
177
|
+
affected_files: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
178
|
+
depends_on: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
179
|
+
shared_file_conflicts: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
180
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
181
|
+
}, z.core.$strip>;
|
|
182
|
+
export type EnrichedSprintItem = z.infer<typeof EnrichedSprintItemSchema>;
|
|
183
|
+
export declare const EnrichedSprintBriefSchema: z.ZodObject<{
|
|
184
|
+
sprint_date: z.ZodString;
|
|
185
|
+
global_context_path: z.ZodString;
|
|
186
|
+
ordered_items: z.ZodArray<z.ZodObject<{
|
|
187
|
+
item_id: z.ZodString;
|
|
188
|
+
title: z.ZodString;
|
|
189
|
+
risk: z.ZodEnum<{
|
|
190
|
+
QUICK: "QUICK";
|
|
191
|
+
STANDARD: "STANDARD";
|
|
192
|
+
FULL: "FULL";
|
|
193
|
+
COMPETITIVE: "COMPETITIVE";
|
|
194
|
+
}>;
|
|
195
|
+
estimated_minutes: z.ZodOptional<z.ZodNumber>;
|
|
196
|
+
affected_files: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
197
|
+
depends_on: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
198
|
+
shared_file_conflicts: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
199
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
200
|
+
}, z.core.$strip>>;
|
|
201
|
+
invalidation_cache: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
202
|
+
created: z.ZodString;
|
|
203
|
+
schema_version: z.ZodDefault<z.ZodLiteral<"1.0">>;
|
|
204
|
+
}, z.core.$strip>;
|
|
205
|
+
export type EnrichedSprintBrief = z.infer<typeof EnrichedSprintBriefSchema>;
|
|
206
|
+
//# sourceMappingURL=analysis.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analysis.d.ts","sourceRoot":"","sources":["../../src/schemas/analysis.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;GAQG;AAIH,eAAO,MAAM,cAAc;;;;;;;;;EASzB,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAI5D,eAAO,MAAM,aAAa;;;;;;;;EASxB,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAI1D;;;GAGG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAwBlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAIxE;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAmBjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAItE;;;GAGG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;iBAS9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAIhE;;;GAGG;AACH,eAAO,MAAM,cAAc;;;;;EAAuD,CAAC;AACnF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAE5D,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;iBASnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;iBAOpC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright © 2025 Thomas Hertel (the@devsteps.dev)
|
|
3
|
+
* Licensed under the Apache License, Version 2.0
|
|
4
|
+
*
|
|
5
|
+
* Context Budget Protocol (CBP) — Analysis Schemas
|
|
6
|
+
* Zod schemas for T3 archaeology and analysis envelope files.
|
|
7
|
+
*
|
|
8
|
+
* @see EPIC-027 CBP Tier-3 Analysis Tools
|
|
9
|
+
*/
|
|
10
|
+
import { z } from 'zod';
|
|
11
|
+
/**
|
|
12
|
+
* Context Budget Protocol (CBP) — Analysis Schemas
|
|
13
|
+
*
|
|
14
|
+
* Defines structured JSON envelopes for AI agent-to-agent handoffs.
|
|
15
|
+
* Aspect agents write AnalysisBriefing to disk (.devsteps/analysis/[ID]/)
|
|
16
|
+
* and return CompressedVerdict envelopes (~150 tokens) in-memory to the coordinator.
|
|
17
|
+
*
|
|
18
|
+
* @see EPIC-027 Context Budget Protocol Infrastructure
|
|
19
|
+
*/
|
|
20
|
+
// ─── Aspect types ────────────────────────────────────────────────────────────
|
|
21
|
+
export const AnalysisAspect = z.enum([
|
|
22
|
+
'impact',
|
|
23
|
+
'constraints',
|
|
24
|
+
'quality',
|
|
25
|
+
'staleness',
|
|
26
|
+
'integration',
|
|
27
|
+
'internal', // competitive analyst: codebase
|
|
28
|
+
'web', // competitive analyst: internet
|
|
29
|
+
'meta', // coordinator judge verdict
|
|
30
|
+
]);
|
|
31
|
+
// ─── Verdict types ───────────────────────────────────────────────────────────
|
|
32
|
+
export const AspectVerdict = z.enum([
|
|
33
|
+
'PROCEED',
|
|
34
|
+
'PROCEED-WITH-CAUTION',
|
|
35
|
+
'STOP',
|
|
36
|
+
// staleness-specific
|
|
37
|
+
'CURRENT',
|
|
38
|
+
'STALE-PARTIAL',
|
|
39
|
+
'STALE-OBSOLETE',
|
|
40
|
+
'STALE-CONFLICT',
|
|
41
|
+
]);
|
|
42
|
+
// ─── CompressedVerdict ───────────────────────────────────────────────────────
|
|
43
|
+
/**
|
|
44
|
+
* Compressed envelope returned IN-MEMORY by aspect agents to the coordinator.
|
|
45
|
+
* Max ~150 tokens — coordinator reads only this, never the full report.
|
|
46
|
+
*/
|
|
47
|
+
export const CompressedVerdictSchema = z.object({
|
|
48
|
+
/** Which aspect produced this envelope */
|
|
49
|
+
aspect: AnalysisAspect,
|
|
50
|
+
/** Proceed / stop / caution signal */
|
|
51
|
+
verdict: AspectVerdict,
|
|
52
|
+
/** 0.0–1.0 confidence in the verdict */
|
|
53
|
+
confidence: z.number().min(0).max(1),
|
|
54
|
+
/** Max 3, max 100 chars each — the coordinator reads these */
|
|
55
|
+
top3_findings: z.array(z.string().max(200)).max(3),
|
|
56
|
+
/** Relative path to the full AnalysisBriefing JSON on disk */
|
|
57
|
+
report_path: z.string(),
|
|
58
|
+
/** ISO 8601 timestamp */
|
|
59
|
+
timestamp: z.string().datetime(),
|
|
60
|
+
// ── Competitive mode fields (aspect = 'internal' | 'web' | 'meta') ───────
|
|
61
|
+
/** Winner agent name (meta verdict only) */
|
|
62
|
+
winner: z.string().optional(),
|
|
63
|
+
/** Rule applied by the judge (meta verdict only) */
|
|
64
|
+
rule_applied: z.string().optional(),
|
|
65
|
+
/** Path to winning implementation briefing (meta verdict only) */
|
|
66
|
+
implementation_briefing: z.string().optional(),
|
|
67
|
+
/** Internet advantage claim (web analyst only) */
|
|
68
|
+
internet_advantage_claim: z.string().optional(),
|
|
69
|
+
/** Arbitrary aspect-specific scalar fields (kept minimal) */
|
|
70
|
+
metadata: z.record(z.string(), z.unknown()).default({}),
|
|
71
|
+
});
|
|
72
|
+
// ─── AnalysisBriefing ────────────────────────────────────────────────────────
|
|
73
|
+
/**
|
|
74
|
+
* Full analysis report written to disk by aspect agents.
|
|
75
|
+
* Path: `.devsteps/analysis/[TASK-ID]/[aspect]-report.json`
|
|
76
|
+
* Contains the CompressedVerdict envelope + full markdown analysis text.
|
|
77
|
+
* Impl-subagent reads this for implementation context.
|
|
78
|
+
*/
|
|
79
|
+
export const AnalysisBriefingSchema = z.object({
|
|
80
|
+
/** DevSteps item ID this analysis belongs to */
|
|
81
|
+
task_id: z.string().regex(/^(EPIC|STORY|TASK|REQ|FEAT|BUG|SPIKE|TEST)-\d{3,}$/),
|
|
82
|
+
/** Which aspect this briefing covers */
|
|
83
|
+
aspect: AnalysisAspect,
|
|
84
|
+
/** Name of the agent that produced this briefing */
|
|
85
|
+
analyst: z.string(),
|
|
86
|
+
/** When the briefing was created */
|
|
87
|
+
created: z.string().datetime(),
|
|
88
|
+
/** The compressed envelope (also returned in-memory to coordinator) */
|
|
89
|
+
envelope: CompressedVerdictSchema,
|
|
90
|
+
/** Full markdown analysis text for implementation agents to read */
|
|
91
|
+
full_analysis: z.string(),
|
|
92
|
+
/** Files identified as affected by this analysis */
|
|
93
|
+
affected_files: z.array(z.string()).default([]),
|
|
94
|
+
/** Prioritized action recommendations */
|
|
95
|
+
recommendations: z.array(z.string()).default([]),
|
|
96
|
+
/** Schema version for forward compatibility */
|
|
97
|
+
schema_version: z.literal('1.0').default('1.0'),
|
|
98
|
+
});
|
|
99
|
+
// ─── SprintVerdict ───────────────────────────────────────────────────────────
|
|
100
|
+
/**
|
|
101
|
+
* Meta-verdict written by the coordinator judge in Competitive Mode.
|
|
102
|
+
* Path: `.devsteps/analysis/[TASK-ID]/meta.json`
|
|
103
|
+
*/
|
|
104
|
+
export const SprintVerdictSchema = z.object({
|
|
105
|
+
task_id: z.string(),
|
|
106
|
+
mode: z.literal('competitive'),
|
|
107
|
+
winner: z.enum(['devsteps-analyst-internal-subagent', 'devsteps-analyst-web-subagent']),
|
|
108
|
+
rule_applied: z.enum(['RULE 1', 'RULE 2', 'RULE 3', 'RULE 4', 'RULE 5']),
|
|
109
|
+
implementation_briefing: z.string(),
|
|
110
|
+
flags: z.array(z.string()).default([]),
|
|
111
|
+
created: z.string().datetime(),
|
|
112
|
+
schema_version: z.literal('1.0').default('1.0'),
|
|
113
|
+
});
|
|
114
|
+
// ─── EnrichedSprintBrief ─────────────────────────────────────────────────────
|
|
115
|
+
/**
|
|
116
|
+
* Produced by devsteps-planner at sprint start from global archaeology + backlog.
|
|
117
|
+
* Path: `.devsteps/analysis/sprint-[DATE]/enriched-sprint-brief.json`
|
|
118
|
+
*/
|
|
119
|
+
export const SprintItemRisk = z.enum(['QUICK', 'STANDARD', 'FULL', 'COMPETITIVE']);
|
|
120
|
+
export const EnrichedSprintItemSchema = z.object({
|
|
121
|
+
item_id: z.string(),
|
|
122
|
+
title: z.string(),
|
|
123
|
+
risk: SprintItemRisk,
|
|
124
|
+
estimated_minutes: z.number().optional(),
|
|
125
|
+
affected_files: z.array(z.string()).default([]),
|
|
126
|
+
depends_on: z.array(z.string()).default([]),
|
|
127
|
+
shared_file_conflicts: z.array(z.string()).default([]),
|
|
128
|
+
notes: z.string().optional(),
|
|
129
|
+
});
|
|
130
|
+
export const EnrichedSprintBriefSchema = z.object({
|
|
131
|
+
sprint_date: z.string(),
|
|
132
|
+
global_context_path: z.string(),
|
|
133
|
+
ordered_items: z.array(EnrichedSprintItemSchema),
|
|
134
|
+
invalidation_cache: z.array(z.string()).default([]),
|
|
135
|
+
created: z.string().datetime(),
|
|
136
|
+
schema_version: z.literal('1.0').default('1.0'),
|
|
137
|
+
});
|
|
138
|
+
//# sourceMappingURL=analysis.js.map
|