@alex.botez/elaborate 1.0.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/LICENSE +21 -0
- package/README.md +114 -0
- package/dist/durable/index.d.ts +10 -0
- package/dist/durable/index.d.ts.map +1 -0
- package/dist/durable/index.js +9 -0
- package/dist/durable/index.js.map +1 -0
- package/dist/durable/workflow.d.ts +165 -0
- package/dist/durable/workflow.d.ts.map +1 -0
- package/dist/durable/workflow.js +224 -0
- package/dist/durable/workflow.js.map +1 -0
- package/dist/interview/classification.d.ts +16 -0
- package/dist/interview/classification.d.ts.map +1 -0
- package/dist/interview/classification.js +25 -0
- package/dist/interview/classification.js.map +1 -0
- package/dist/interview/composition.d.ts +12 -0
- package/dist/interview/composition.d.ts.map +1 -0
- package/dist/interview/composition.js +19 -0
- package/dist/interview/composition.js.map +1 -0
- package/dist/interview/describe.d.ts +41 -0
- package/dist/interview/describe.d.ts.map +1 -0
- package/dist/interview/describe.js +80 -0
- package/dist/interview/describe.js.map +1 -0
- package/dist/interview/deviation.d.ts +91 -0
- package/dist/interview/deviation.d.ts.map +1 -0
- package/dist/interview/deviation.js +137 -0
- package/dist/interview/deviation.js.map +1 -0
- package/dist/interview/extraction.d.ts +32 -0
- package/dist/interview/extraction.d.ts.map +1 -0
- package/dist/interview/extraction.js +102 -0
- package/dist/interview/extraction.js.map +1 -0
- package/dist/interview/index.d.ts +25 -0
- package/dist/interview/index.d.ts.map +1 -0
- package/dist/interview/index.js +22 -0
- package/dist/interview/index.js.map +1 -0
- package/dist/interview/macros.d.ts +91 -0
- package/dist/interview/macros.d.ts.map +1 -0
- package/dist/interview/macros.js +138 -0
- package/dist/interview/macros.js.map +1 -0
- package/dist/interview/preambles.d.ts +18 -0
- package/dist/interview/preambles.d.ts.map +1 -0
- package/dist/interview/preambles.js +93 -0
- package/dist/interview/preambles.js.map +1 -0
- package/dist/interview/progress.d.ts +31 -0
- package/dist/interview/progress.d.ts.map +1 -0
- package/dist/interview/progress.js +51 -0
- package/dist/interview/progress.js.map +1 -0
- package/dist/interview/prompt.d.ts +20 -0
- package/dist/interview/prompt.d.ts.map +1 -0
- package/dist/interview/prompt.js +58 -0
- package/dist/interview/prompt.js.map +1 -0
- package/dist/phases/aggregate/assumptions.d.ts +14 -0
- package/dist/phases/aggregate/assumptions.d.ts.map +1 -0
- package/dist/phases/aggregate/assumptions.js +33 -0
- package/dist/phases/aggregate/assumptions.js.map +1 -0
- package/dist/phases/aggregate/findings.d.ts +10 -0
- package/dist/phases/aggregate/findings.d.ts.map +1 -0
- package/dist/phases/aggregate/findings.js +20 -0
- package/dist/phases/aggregate/findings.js.map +1 -0
- package/dist/phases/aggregate/goals.d.ts +28 -0
- package/dist/phases/aggregate/goals.d.ts.map +1 -0
- package/dist/phases/aggregate/goals.js +74 -0
- package/dist/phases/aggregate/goals.js.map +1 -0
- package/dist/phases/aggregate/index.d.ts +128 -0
- package/dist/phases/aggregate/index.d.ts.map +1 -0
- package/dist/phases/aggregate/index.js +165 -0
- package/dist/phases/aggregate/index.js.map +1 -0
- package/dist/phases/aggregate/pam.d.ts +19 -0
- package/dist/phases/aggregate/pam.d.ts.map +1 -0
- package/dist/phases/aggregate/pam.js +37 -0
- package/dist/phases/aggregate/pam.js.map +1 -0
- package/dist/phases/aggregate/scope.d.ts +24 -0
- package/dist/phases/aggregate/scope.d.ts.map +1 -0
- package/dist/phases/aggregate/scope.js +67 -0
- package/dist/phases/aggregate/scope.js.map +1 -0
- package/dist/phases/aggregate/shared.d.ts +16 -0
- package/dist/phases/aggregate/shared.d.ts.map +1 -0
- package/dist/phases/aggregate/shared.js +26 -0
- package/dist/phases/aggregate/shared.js.map +1 -0
- package/dist/phases/aggregate/stakeholders.d.ts +27 -0
- package/dist/phases/aggregate/stakeholders.d.ts.map +1 -0
- package/dist/phases/aggregate/stakeholders.js +90 -0
- package/dist/phases/aggregate/stakeholders.js.map +1 -0
- package/dist/phases/aggregate/waitingRoom.d.ts +16 -0
- package/dist/phases/aggregate/waitingRoom.d.ts.map +1 -0
- package/dist/phases/aggregate/waitingRoom.js +32 -0
- package/dist/phases/aggregate/waitingRoom.js.map +1 -0
- package/dist/phases/assumptions.d.ts +19 -0
- package/dist/phases/assumptions.d.ts.map +1 -0
- package/dist/phases/assumptions.js +224 -0
- package/dist/phases/assumptions.js.map +1 -0
- package/dist/phases/configuration.d.ts +8 -0
- package/dist/phases/configuration.d.ts.map +1 -0
- package/dist/phases/configuration.js +14 -0
- package/dist/phases/configuration.js.map +1 -0
- package/dist/phases/goals.d.ts +15 -0
- package/dist/phases/goals.d.ts.map +1 -0
- package/dist/phases/goals.js +297 -0
- package/dist/phases/goals.js.map +1 -0
- package/dist/phases/index.d.ts +21 -0
- package/dist/phases/index.d.ts.map +1 -0
- package/dist/phases/index.js +56 -0
- package/dist/phases/index.js.map +1 -0
- package/dist/phases/opening.d.ts +12 -0
- package/dist/phases/opening.d.ts.map +1 -0
- package/dist/phases/opening.js +99 -0
- package/dist/phases/opening.js.map +1 -0
- package/dist/phases/purpose.d.ts +17 -0
- package/dist/phases/purpose.d.ts.map +1 -0
- package/dist/phases/purpose.js +207 -0
- package/dist/phases/purpose.js.map +1 -0
- package/dist/phases/schema.d.ts +861 -0
- package/dist/phases/schema.d.ts.map +1 -0
- package/dist/phases/schema.js +157 -0
- package/dist/phases/schema.js.map +1 -0
- package/dist/phases/scope.d.ts +18 -0
- package/dist/phases/scope.d.ts.map +1 -0
- package/dist/phases/scope.js +440 -0
- package/dist/phases/scope.js.map +1 -0
- package/dist/phases/session/archive.d.ts +19 -0
- package/dist/phases/session/archive.d.ts.map +1 -0
- package/dist/phases/session/archive.js +49 -0
- package/dist/phases/session/archive.js.map +1 -0
- package/dist/phases/session/file.d.ts +31 -0
- package/dist/phases/session/file.d.ts.map +1 -0
- package/dist/phases/session/file.js +113 -0
- package/dist/phases/session/file.js.map +1 -0
- package/dist/phases/session/index.d.ts +8 -0
- package/dist/phases/session/index.d.ts.map +1 -0
- package/dist/phases/session/index.js +8 -0
- package/dist/phases/session/index.js.map +1 -0
- package/dist/phases/session/persistence.d.ts +30 -0
- package/dist/phases/session/persistence.d.ts.map +1 -0
- package/dist/phases/session/persistence.js +91 -0
- package/dist/phases/session/persistence.js.map +1 -0
- package/dist/phases/shared.d.ts +64 -0
- package/dist/phases/shared.d.ts.map +1 -0
- package/dist/phases/shared.js +100 -0
- package/dist/phases/shared.js.map +1 -0
- package/dist/phases/stakeholders.d.ts +17 -0
- package/dist/phases/stakeholders.d.ts.map +1 -0
- package/dist/phases/stakeholders.js +370 -0
- package/dist/phases/stakeholders.js.map +1 -0
- package/dist/phases/validation.d.ts +13 -0
- package/dist/phases/validation.d.ts.map +1 -0
- package/dist/phases/validation.js +130 -0
- package/dist/phases/validation.js.map +1 -0
- package/dist/skill/adapter.d.ts +16 -0
- package/dist/skill/adapter.d.ts.map +1 -0
- package/dist/skill/adapter.js +278 -0
- package/dist/skill/adapter.js.map +1 -0
- package/dist/skill/index.d.ts +12 -0
- package/dist/skill/index.d.ts.map +1 -0
- package/dist/skill/index.js +11 -0
- package/dist/skill/index.js.map +1 -0
- package/dist/skill/log.d.ts +18 -0
- package/dist/skill/log.d.ts.map +1 -0
- package/dist/skill/log.js +53 -0
- package/dist/skill/log.js.map +1 -0
- package/package.json +83 -0
- package/skills/elaborate/SKILL.md +97 -0
- package/skills/elaborate/scripts/elaborate.cjs +589 -0
- package/skills/project-brief/SKILL.md +45 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Findings aggregate mutations — observations surfaced during any phase
|
|
3
|
+
* (typically validation / contradiction checks), tagged with their originating
|
|
4
|
+
* phase for later display.
|
|
5
|
+
*/
|
|
6
|
+
import { nextId } from "./shared.js";
|
|
7
|
+
export function addDomainHints(data, hints) {
|
|
8
|
+
data.domainHints.push(...hints);
|
|
9
|
+
}
|
|
10
|
+
export function addFinding(data, content, phase) {
|
|
11
|
+
data.findings.push({
|
|
12
|
+
id: nextId("finding", data.findings),
|
|
13
|
+
content,
|
|
14
|
+
phase,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
export function findingsByPhase(data, phase) {
|
|
18
|
+
return data.findings.filter((f) => f.phase === phase);
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=findings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findings.js","sourceRoot":"","sources":["../../../src/phases/aggregate/findings.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,MAAM,UAAU,cAAc,CAAC,IAAe,EAAE,KAAe;IAC7D,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC;AAClC,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,IAAe,EAAE,OAAe,EAAE,KAAa;IACxE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;QACjB,EAAE,EAAE,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC;QACpC,OAAO;QACP,KAAK;KACN,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,IAAe,EAAE,KAAa;IAC5D,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,KAAK,CAAC,CAAC;AACxD,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Goal aggregate mutations — fuzzy → elaborated → confirmed progression with
|
|
3
|
+
* status-driven confidence.
|
|
4
|
+
*/
|
|
5
|
+
import type { Artifacts, Goal, GoalStatus, Source } from "../schema.js";
|
|
6
|
+
export declare function addFuzzyGoals(data: Artifacts, raws: Array<{
|
|
7
|
+
title: string;
|
|
8
|
+
description: string;
|
|
9
|
+
rationale?: string;
|
|
10
|
+
}>, source?: Source): string[];
|
|
11
|
+
export declare function updateGoal(data: Artifacts, goalId: string, fields: {
|
|
12
|
+
title?: string | null;
|
|
13
|
+
description?: string | null;
|
|
14
|
+
rationale?: string | null;
|
|
15
|
+
}): boolean;
|
|
16
|
+
export declare function setGoalStatus(data: Artifacts, goalId: string, status: GoalStatus): void;
|
|
17
|
+
export declare function removeGoals(data: Artifacts, ids: Set<string>): void;
|
|
18
|
+
export declare function confirmElaboratedGoals(data: Artifacts): void;
|
|
19
|
+
export declare function applyGoalExtraction(data: Artifacts, goalId: string, ext: {
|
|
20
|
+
title?: string | null;
|
|
21
|
+
description?: string | null;
|
|
22
|
+
rationale?: string | null;
|
|
23
|
+
waitingRoomItems?: Array<{
|
|
24
|
+
content: string;
|
|
25
|
+
}>;
|
|
26
|
+
}): boolean;
|
|
27
|
+
export declare function findGoal(data: Artifacts, id: string): Goal | undefined;
|
|
28
|
+
//# sourceMappingURL=goals.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"goals.d.ts","sourceRoot":"","sources":["../../../src/phases/aggregate/goals.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAKxE,wBAAgB,aAAa,CAC3B,IAAI,EAAE,SAAS,EACf,IAAI,EAAE,KAAK,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,EACvE,MAAM,CAAC,EAAE,MAAM,GACd,MAAM,EAAE,CAgBV;AAED,wBAAgB,UAAU,CACxB,IAAI,EAAE,SAAS,EACf,MAAM,EAAE,MAAM,EACd,MAAM,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GACxF,OAAO,CAQT;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,IAAI,CAKvF;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,CAEnE;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,CAO5D;AAED,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,SAAS,EACf,MAAM,EAAE,MAAM,EACd,GAAG,EAAE;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,gBAAgB,CAAC,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC/C,GACA,OAAO,CAQT;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAEtE"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Goal aggregate mutations — fuzzy → elaborated → confirmed progression with
|
|
3
|
+
* status-driven confidence.
|
|
4
|
+
*/
|
|
5
|
+
import { GOAL_CONFIDENCE } from "../schema.js";
|
|
6
|
+
import { nextId } from "./shared.js";
|
|
7
|
+
import { addWaitingRoomItems } from "./waitingRoom.js";
|
|
8
|
+
export function addFuzzyGoals(data, raws, source) {
|
|
9
|
+
const ids = [];
|
|
10
|
+
for (const raw of raws) {
|
|
11
|
+
const id = nextId("goal", data.goals);
|
|
12
|
+
data.goals.push({
|
|
13
|
+
id,
|
|
14
|
+
title: raw.title,
|
|
15
|
+
description: raw.description,
|
|
16
|
+
rationale: raw.rationale,
|
|
17
|
+
status: "fuzzy",
|
|
18
|
+
confidence: GOAL_CONFIDENCE.fuzzy,
|
|
19
|
+
...(source && { source }),
|
|
20
|
+
});
|
|
21
|
+
ids.push(id);
|
|
22
|
+
}
|
|
23
|
+
return ids;
|
|
24
|
+
}
|
|
25
|
+
export function updateGoal(data, goalId, fields) {
|
|
26
|
+
const goal = findGoal(data, goalId);
|
|
27
|
+
if (!goal)
|
|
28
|
+
return false;
|
|
29
|
+
let changed = false;
|
|
30
|
+
if (fields.title) {
|
|
31
|
+
goal.title = fields.title;
|
|
32
|
+
changed = true;
|
|
33
|
+
}
|
|
34
|
+
if (fields.description) {
|
|
35
|
+
goal.description = fields.description;
|
|
36
|
+
changed = true;
|
|
37
|
+
}
|
|
38
|
+
if (fields.rationale) {
|
|
39
|
+
goal.rationale = fields.rationale;
|
|
40
|
+
changed = true;
|
|
41
|
+
}
|
|
42
|
+
return changed;
|
|
43
|
+
}
|
|
44
|
+
export function setGoalStatus(data, goalId, status) {
|
|
45
|
+
const goal = findGoal(data, goalId);
|
|
46
|
+
if (!goal)
|
|
47
|
+
return;
|
|
48
|
+
goal.status = status;
|
|
49
|
+
goal.confidence = GOAL_CONFIDENCE[status];
|
|
50
|
+
}
|
|
51
|
+
export function removeGoals(data, ids) {
|
|
52
|
+
data.goals = data.goals.filter((g) => !ids.has(g.id));
|
|
53
|
+
}
|
|
54
|
+
export function confirmElaboratedGoals(data) {
|
|
55
|
+
for (const g of data.goals) {
|
|
56
|
+
if (g.status === "elaborated") {
|
|
57
|
+
g.status = "confirmed";
|
|
58
|
+
g.confidence = GOAL_CONFIDENCE.confirmed;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
export function applyGoalExtraction(data, goalId, ext) {
|
|
63
|
+
const advanced = updateGoal(data, goalId, {
|
|
64
|
+
title: ext.title,
|
|
65
|
+
description: ext.description,
|
|
66
|
+
rationale: ext.rationale,
|
|
67
|
+
});
|
|
68
|
+
addWaitingRoomItems(data, ext.waitingRoomItems ?? []);
|
|
69
|
+
return advanced;
|
|
70
|
+
}
|
|
71
|
+
export function findGoal(data, id) {
|
|
72
|
+
return data.goals.find((g) => g.id === id);
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=goals.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"goals.js","sourceRoot":"","sources":["../../../src/phases/aggregate/goals.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEvD,MAAM,UAAU,aAAa,CAC3B,IAAe,EACf,IAAuE,EACvE,MAAe;IAEf,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;QACtC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;YACd,EAAE;YACF,KAAK,EAAE,GAAG,CAAC,KAAK;YAChB,WAAW,EAAE,GAAG,CAAC,WAAW;YAC5B,SAAS,EAAE,GAAG,CAAC,SAAS;YACxB,MAAM,EAAE,OAAO;YACf,UAAU,EAAE,eAAe,CAAC,KAAK;YACjC,GAAG,CAAC,MAAM,IAAI,EAAE,MAAM,EAAE,CAAC;SAC1B,CAAC,CAAC;QACH,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,UAAU,UAAU,CACxB,IAAe,EACf,MAAc,EACd,MAAyF;IAEzF,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACpC,IAAI,CAAC,IAAI;QAAE,OAAO,KAAK,CAAC;IACxB,IAAI,OA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3C,CAAC;IACH,CAAC;AACH,CAAC;AAED,MAAM,UAAU,mBAAmB,CACjC,IAAe,EACf,MAAc,EACd,GAKC;IAED,MAAM,QAAQ,GAAG,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE;QACxC,KAAK,EAAE,GAAG,CAAC,KAAK;QAChB,WAAW,EAAE,GAAG,CAAC,WAAW;QAC5B,SAAS,EAAE,GAAG,CAAC,SAAS;KACzB,CAAC,CAAC;IACH,mBAAmB,CAAC,IAAI,EAAE,GAAG,CAAC,gBAAgB,IAAI,EAAE,CAAC,CAAC;IACtD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,IAAe,EAAE,EAAU;IAClD,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;AAC7C,CAAC"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ArtifactAggregate — facade over per-domain free functions.
|
|
3
|
+
*
|
|
4
|
+
* Phases own workflow orchestration (loops, async, LLM calls).
|
|
5
|
+
* The aggregate owns domain operations (ID generation, defaults,
|
|
6
|
+
* status+confidence pairing, deduplication), delegated to domain modules.
|
|
7
|
+
*
|
|
8
|
+
* Read access: use `.data` to get the plain Artifacts object.
|
|
9
|
+
* Write access: use typed methods only.
|
|
10
|
+
*/
|
|
11
|
+
import type { Artifacts, Goal, Stakeholder, Assumption, Finding, GoalStatus, StakeholderType, StakeholderStatus, AssumptionType, AssumptionStatus, Source } from "../schema.js";
|
|
12
|
+
/** Lightweight artifact summary for re-orientation on resume. */
|
|
13
|
+
export interface ContextSummary {
|
|
14
|
+
purpose?: string;
|
|
15
|
+
advantage?: string;
|
|
16
|
+
measurement?: string;
|
|
17
|
+
goals: Array<{
|
|
18
|
+
id: string;
|
|
19
|
+
title: string;
|
|
20
|
+
status: string;
|
|
21
|
+
}>;
|
|
22
|
+
stakeholders: Array<{
|
|
23
|
+
id: string;
|
|
24
|
+
name: string;
|
|
25
|
+
type: string;
|
|
26
|
+
}>;
|
|
27
|
+
inScope: string[];
|
|
28
|
+
outOfScope: string[];
|
|
29
|
+
constraints: string[];
|
|
30
|
+
assumptionCount: number;
|
|
31
|
+
findingCount: number;
|
|
32
|
+
}
|
|
33
|
+
export declare class ArtifactAggregate {
|
|
34
|
+
readonly data: Artifacts;
|
|
35
|
+
constructor();
|
|
36
|
+
setPurpose(statement: string, confidence: number, source?: Source): void;
|
|
37
|
+
setAdvantage(statement: string, confidence: number, source?: Source): void;
|
|
38
|
+
setMeasurement(statement: string, confidence: number, source?: Source): void;
|
|
39
|
+
confirmPam(confidence?: number): void;
|
|
40
|
+
applyPamExtraction(ext: {
|
|
41
|
+
purpose?: string | null;
|
|
42
|
+
advantage?: string | null;
|
|
43
|
+
measurement?: string | null;
|
|
44
|
+
}, source?: Source): void;
|
|
45
|
+
addFuzzyGoals(raws: Array<{
|
|
46
|
+
title: string;
|
|
47
|
+
description: string;
|
|
48
|
+
rationale?: string;
|
|
49
|
+
}>, source?: Source): string[];
|
|
50
|
+
updateGoal(goalId: string, fields: {
|
|
51
|
+
title?: string | null;
|
|
52
|
+
description?: string | null;
|
|
53
|
+
rationale?: string | null;
|
|
54
|
+
}): boolean;
|
|
55
|
+
setGoalStatus(goalId: string, status: GoalStatus): void;
|
|
56
|
+
removeGoals(ids: Set<string>): void;
|
|
57
|
+
confirmElaboratedGoals(): void;
|
|
58
|
+
applyGoalExtraction(goalId: string, ext: {
|
|
59
|
+
title?: string | null;
|
|
60
|
+
description?: string | null;
|
|
61
|
+
rationale?: string | null;
|
|
62
|
+
waitingRoomItems?: Array<{
|
|
63
|
+
content: string;
|
|
64
|
+
}>;
|
|
65
|
+
}): boolean;
|
|
66
|
+
goal(id: string): Goal | undefined;
|
|
67
|
+
addIdentifiedStakeholders(raws: Array<{
|
|
68
|
+
name: string;
|
|
69
|
+
type: StakeholderType;
|
|
70
|
+
}>, source?: Source): void;
|
|
71
|
+
updateStakeholder(id: string, fields: {
|
|
72
|
+
role?: string | null;
|
|
73
|
+
type?: StakeholderType | null;
|
|
74
|
+
}): boolean;
|
|
75
|
+
addConcerns(id: string, concerns: string[]): number;
|
|
76
|
+
setRespondent(id: string): void;
|
|
77
|
+
setStakeholderStatus(id: string, status: StakeholderStatus): void;
|
|
78
|
+
removeStakeholders(ids: Set<string>): void;
|
|
79
|
+
confirmElaboratedStakeholders(): void;
|
|
80
|
+
applyStakeholderElaboration(id: string, ext: {
|
|
81
|
+
role?: string | null;
|
|
82
|
+
concerns?: string[];
|
|
83
|
+
waitingRoomItems?: Array<{
|
|
84
|
+
content: string;
|
|
85
|
+
}>;
|
|
86
|
+
}): boolean;
|
|
87
|
+
stakeholder(id: string): Stakeholder | undefined;
|
|
88
|
+
addInScopeItems(items: Array<{
|
|
89
|
+
description: string;
|
|
90
|
+
relatedGoals?: string[];
|
|
91
|
+
}>, confidence?: number, source?: Source): void;
|
|
92
|
+
addOutOfScopeItems(items: Array<{
|
|
93
|
+
description: string;
|
|
94
|
+
reason?: string;
|
|
95
|
+
relatedGoals?: string[];
|
|
96
|
+
}>, confidence?: number, source?: Source): void;
|
|
97
|
+
addConstraints(items: Array<{
|
|
98
|
+
description: string;
|
|
99
|
+
}>, source?: Source): void;
|
|
100
|
+
removeScopeItems(ids: Set<string>): void;
|
|
101
|
+
confirmScope(): void;
|
|
102
|
+
addAssumptions(items: Array<{
|
|
103
|
+
statement: string;
|
|
104
|
+
type?: AssumptionType;
|
|
105
|
+
relatedGoals?: string[];
|
|
106
|
+
}>, confidence?: number, status?: AssumptionStatus, source?: Source): void;
|
|
107
|
+
setAssumptionStatus(id: string, status: AssumptionStatus): void;
|
|
108
|
+
removeAssumptions(ids: Set<string>): void;
|
|
109
|
+
assumption(id: string): Assumption | undefined;
|
|
110
|
+
addDomainHints(hints: string[]): void;
|
|
111
|
+
addFinding(content: string, phase: string): void;
|
|
112
|
+
findingsByPhase(phase: string): Finding[];
|
|
113
|
+
addWaitingRoomItems(items: Array<{
|
|
114
|
+
content: string;
|
|
115
|
+
}>): void;
|
|
116
|
+
drainWaitingRoom(ids: Set<string>): void;
|
|
117
|
+
addResidualItems(items: Array<{
|
|
118
|
+
content: string;
|
|
119
|
+
reason: string;
|
|
120
|
+
}>): void;
|
|
121
|
+
drainAllWaitingRoom(): void;
|
|
122
|
+
/** Lightweight projection for re-orientation on resume. */
|
|
123
|
+
summarize(): ContextSummary;
|
|
124
|
+
/** User's concern from validation — absent means endorsed. */
|
|
125
|
+
userConcern?: string;
|
|
126
|
+
setUserConcern(concern: string): void;
|
|
127
|
+
}
|
|
128
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/phases/aggregate/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EACV,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,EACjD,UAAU,EAAE,eAAe,EAAE,iBAAiB,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,EACzF,MAAM,cAAc,CAAC;AAUtB,iEAAiE;AACjE,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC5D,YAAY,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAChE,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,UAAU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AAC,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI;IAIzC,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS;IAM9C,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI;IAIrC,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAIhD,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,EAAE;IAMzC,mBAAmB,CAAC,KAAK,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG,IAAI;IAI5D,gBAAgB,CAAC,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI;IAIxC,gBAAgB,CAAC,KAAK,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG,IAAI;IAIzE,mBAAmB,IAAI,IAAI;IAM3B,2DAA2D;IAC3D,SAAS,IAAI,cAAc;IAiB3B,8DAA8D;IAC9D,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;CAGtC"}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ArtifactAggregate — facade over per-domain free functions.
|
|
3
|
+
*
|
|
4
|
+
* Phases own workflow orchestration (loops, async, LLM calls).
|
|
5
|
+
* The aggregate owns domain operations (ID generation, defaults,
|
|
6
|
+
* status+confidence pairing, deduplication), delegated to domain modules.
|
|
7
|
+
*
|
|
8
|
+
* Read access: use `.data` to get the plain Artifacts object.
|
|
9
|
+
* Write access: use typed methods only.
|
|
10
|
+
*/
|
|
11
|
+
import { createEmptyArtifacts } from "../schema.js";
|
|
12
|
+
import * as pam from "./pam.js";
|
|
13
|
+
import * as goals from "./goals.js";
|
|
14
|
+
import * as stakeholders from "./stakeholders.js";
|
|
15
|
+
import * as scope from "./scope.js";
|
|
16
|
+
import * as assumptions from "./assumptions.js";
|
|
17
|
+
import * as waitingRoom from "./waitingRoom.js";
|
|
18
|
+
import * as findings from "./findings.js";
|
|
19
|
+
export class ArtifactAggregate {
|
|
20
|
+
data;
|
|
21
|
+
constructor() {
|
|
22
|
+
this.data = createEmptyArtifacts();
|
|
23
|
+
}
|
|
24
|
+
// PAM singletons
|
|
25
|
+
setPurpose(statement, confidence, source) {
|
|
26
|
+
pam.setPurpose(this.data, statement, confidence, source);
|
|
27
|
+
}
|
|
28
|
+
setAdvantage(statement, confidence, source) {
|
|
29
|
+
pam.setAdvantage(this.data, statement, confidence, source);
|
|
30
|
+
}
|
|
31
|
+
setMeasurement(statement, confidence, source) {
|
|
32
|
+
pam.setMeasurement(this.data, statement, confidence, source);
|
|
33
|
+
}
|
|
34
|
+
confirmPam(confidence = 0.9) {
|
|
35
|
+
pam.confirmPam(this.data, confidence);
|
|
36
|
+
}
|
|
37
|
+
applyPamExtraction(ext, source) {
|
|
38
|
+
pam.applyPamExtraction(this.data, ext, source);
|
|
39
|
+
}
|
|
40
|
+
// Goals
|
|
41
|
+
addFuzzyGoals(raws, source) {
|
|
42
|
+
return goals.addFuzzyGoals(this.data, raws, source);
|
|
43
|
+
}
|
|
44
|
+
updateGoal(goalId, fields) {
|
|
45
|
+
return goals.updateGoal(this.data, goalId, fields);
|
|
46
|
+
}
|
|
47
|
+
setGoalStatus(goalId, status) {
|
|
48
|
+
goals.setGoalStatus(this.data, goalId, status);
|
|
49
|
+
}
|
|
50
|
+
removeGoals(ids) {
|
|
51
|
+
goals.removeGoals(this.data, ids);
|
|
52
|
+
}
|
|
53
|
+
confirmElaboratedGoals() {
|
|
54
|
+
goals.confirmElaboratedGoals(this.data);
|
|
55
|
+
}
|
|
56
|
+
applyGoalExtraction(goalId, ext) {
|
|
57
|
+
return goals.applyGoalExtraction(this.data, goalId, ext);
|
|
58
|
+
}
|
|
59
|
+
goal(id) {
|
|
60
|
+
return goals.findGoal(this.data, id);
|
|
61
|
+
}
|
|
62
|
+
// Stakeholders
|
|
63
|
+
addIdentifiedStakeholders(raws, source) {
|
|
64
|
+
stakeholders.addIdentifiedStakeholders(this.data, raws, source);
|
|
65
|
+
}
|
|
66
|
+
updateStakeholder(id, fields) {
|
|
67
|
+
return stakeholders.updateStakeholder(this.data, id, fields);
|
|
68
|
+
}
|
|
69
|
+
addConcerns(id, concerns) {
|
|
70
|
+
return stakeholders.addConcerns(this.data, id, concerns);
|
|
71
|
+
}
|
|
72
|
+
setRespondent(id) {
|
|
73
|
+
stakeholders.setRespondent(this.data, id);
|
|
74
|
+
}
|
|
75
|
+
setStakeholderStatus(id, status) {
|
|
76
|
+
stakeholders.setStakeholderStatus(this.data, id, status);
|
|
77
|
+
}
|
|
78
|
+
removeStakeholders(ids) {
|
|
79
|
+
stakeholders.removeStakeholders(this.data, ids);
|
|
80
|
+
}
|
|
81
|
+
confirmElaboratedStakeholders() {
|
|
82
|
+
stakeholders.confirmElaboratedStakeholders(this.data);
|
|
83
|
+
}
|
|
84
|
+
applyStakeholderElaboration(id, ext) {
|
|
85
|
+
return stakeholders.applyStakeholderElaboration(this.data, id, ext);
|
|
86
|
+
}
|
|
87
|
+
stakeholder(id) {
|
|
88
|
+
return stakeholders.findStakeholder(this.data, id);
|
|
89
|
+
}
|
|
90
|
+
// Scope
|
|
91
|
+
addInScopeItems(items, confidence, source) {
|
|
92
|
+
scope.addInScopeItems(this.data, items, confidence, source);
|
|
93
|
+
}
|
|
94
|
+
addOutOfScopeItems(items, confidence, source) {
|
|
95
|
+
scope.addOutOfScopeItems(this.data, items, confidence, source);
|
|
96
|
+
}
|
|
97
|
+
addConstraints(items, source) {
|
|
98
|
+
scope.addConstraints(this.data, items, source);
|
|
99
|
+
}
|
|
100
|
+
removeScopeItems(ids) {
|
|
101
|
+
scope.removeScopeItems(this.data, ids);
|
|
102
|
+
}
|
|
103
|
+
confirmScope() {
|
|
104
|
+
scope.confirmScope(this.data);
|
|
105
|
+
}
|
|
106
|
+
// Assumptions
|
|
107
|
+
addAssumptions(items, confidence, status, source) {
|
|
108
|
+
assumptions.addAssumptions(this.data, items, confidence, status, source);
|
|
109
|
+
}
|
|
110
|
+
setAssumptionStatus(id, status) {
|
|
111
|
+
assumptions.setAssumptionStatus(this.data, id, status);
|
|
112
|
+
}
|
|
113
|
+
removeAssumptions(ids) {
|
|
114
|
+
assumptions.removeAssumptions(this.data, ids);
|
|
115
|
+
}
|
|
116
|
+
assumption(id) {
|
|
117
|
+
return assumptions.findAssumption(this.data, id);
|
|
118
|
+
}
|
|
119
|
+
// Domain Hints / Findings
|
|
120
|
+
addDomainHints(hints) {
|
|
121
|
+
findings.addDomainHints(this.data, hints);
|
|
122
|
+
}
|
|
123
|
+
addFinding(content, phase) {
|
|
124
|
+
findings.addFinding(this.data, content, phase);
|
|
125
|
+
}
|
|
126
|
+
findingsByPhase(phase) {
|
|
127
|
+
return findings.findingsByPhase(this.data, phase);
|
|
128
|
+
}
|
|
129
|
+
// Waiting Room
|
|
130
|
+
addWaitingRoomItems(items) {
|
|
131
|
+
waitingRoom.addWaitingRoomItems(this.data, items);
|
|
132
|
+
}
|
|
133
|
+
drainWaitingRoom(ids) {
|
|
134
|
+
waitingRoom.drainWaitingRoom(this.data, ids);
|
|
135
|
+
}
|
|
136
|
+
addResidualItems(items) {
|
|
137
|
+
waitingRoom.addResidualItems(this.data, items);
|
|
138
|
+
}
|
|
139
|
+
drainAllWaitingRoom() {
|
|
140
|
+
waitingRoom.drainAllWaitingRoom(this.data);
|
|
141
|
+
}
|
|
142
|
+
// Summary
|
|
143
|
+
/** Lightweight projection for re-orientation on resume. */
|
|
144
|
+
summarize() {
|
|
145
|
+
return {
|
|
146
|
+
...(this.data.purpose && { purpose: this.data.purpose.statement }),
|
|
147
|
+
...(this.data.advantage && { advantage: this.data.advantage.statement }),
|
|
148
|
+
...(this.data.measurement && { measurement: this.data.measurement.statement }),
|
|
149
|
+
goals: this.data.goals.map((g) => ({ id: g.id, title: g.title, status: g.status })),
|
|
150
|
+
stakeholders: this.data.stakeholders.map((s) => ({ id: s.id, name: s.name, type: s.type })),
|
|
151
|
+
inScope: this.data.inScope.map((s) => s.description),
|
|
152
|
+
outOfScope: this.data.outOfScope.map((s) => s.description),
|
|
153
|
+
constraints: this.data.constraints.map((c) => c.description),
|
|
154
|
+
assumptionCount: this.data.assumptions.length,
|
|
155
|
+
findingCount: this.data.findings.length,
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
// Session
|
|
159
|
+
/** User's concern from validation — absent means endorsed. */
|
|
160
|
+
userConcern;
|
|
161
|
+
setUserConcern(concern) {
|
|
162
|
+
this.userConcern = concern;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/phases/aggregate/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAChC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAC;AAChD,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAC;AAChD,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAgB1C,MAAM,OAAO,iBAAiB;IACZ,IAAI,CAAY;IAEhC;QACE,IAAI,CAAC,IAAI,GAAG,oBAAoB,EAAE,CAAC;IACrC,CAAC;IAED,iBAAiB;IAEjB,UAAU,CAAC,SAAiB,EAAE,UAAkB,EAAE,MAAe;QAC/D,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,UAAU,EAA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,OAAO,CAAC;IAC7B,CAAC;CACF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PAM aggregate mutations — Purpose, Advantage, Measurement singletons.
|
|
3
|
+
*
|
|
4
|
+
* The three slots share identical structure ({statement, confidence, source?}
|
|
5
|
+
* with first-fill → update → confirm confidence progression), so the
|
|
6
|
+
* implementation is a single `setPamSlot` helper; the facade exposes three
|
|
7
|
+
* distinct methods for caller clarity.
|
|
8
|
+
*/
|
|
9
|
+
import type { Artifacts, Source } from "../schema.js";
|
|
10
|
+
export declare function setPurpose(data: Artifacts, statement: string, confidence: number, source?: Source): void;
|
|
11
|
+
export declare function setAdvantage(data: Artifacts, statement: string, confidence: number, source?: Source): void;
|
|
12
|
+
export declare function setMeasurement(data: Artifacts, statement: string, confidence: number, source?: Source): void;
|
|
13
|
+
export declare function confirmPam(data: Artifacts, confidence?: number): void;
|
|
14
|
+
export declare function applyPamExtraction(data: Artifacts, ext: {
|
|
15
|
+
purpose?: string | null;
|
|
16
|
+
advantage?: string | null;
|
|
17
|
+
measurement?: string | null;
|
|
18
|
+
}, source?: Source): void;
|
|
19
|
+
//# sourceMappingURL=pam.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pam.d.ts","sourceRoot":"","sources":["../../../src/phases/aggregate/pam.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAUtD,wBAAgB,UAAU,CAAC,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAExG;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAE1G;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAE5G;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,SAAS,EAAE,UAAU,SAAM,GAAG,IAAI,CAKlE;AAED,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,SAAS,EACf,GAAG,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,EACxF,MAAM,CAAC,EAAE,MAAM,GACd,IAAI,CAKN"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PAM aggregate mutations — Purpose, Advantage, Measurement singletons.
|
|
3
|
+
*
|
|
4
|
+
* The three slots share identical structure ({statement, confidence, source?}
|
|
5
|
+
* with first-fill → update → confirm confidence progression), so the
|
|
6
|
+
* implementation is a single `setPamSlot` helper; the facade exposes three
|
|
7
|
+
* distinct methods for caller clarity.
|
|
8
|
+
*/
|
|
9
|
+
import { nextPamConfidence } from "./shared.js";
|
|
10
|
+
function setPamSlot(data, slot, statement, confidence, source) {
|
|
11
|
+
const effectiveSource = data[slot]?.source ?? source;
|
|
12
|
+
data[slot] = { statement, confidence, ...(effectiveSource && { source: effectiveSource }) };
|
|
13
|
+
}
|
|
14
|
+
export function setPurpose(data, statement, confidence, source) {
|
|
15
|
+
setPamSlot(data, "purpose", statement, confidence, source);
|
|
16
|
+
}
|
|
17
|
+
export function setAdvantage(data, statement, confidence, source) {
|
|
18
|
+
setPamSlot(data, "advantage", statement, confidence, source);
|
|
19
|
+
}
|
|
20
|
+
export function setMeasurement(data, statement, confidence, source) {
|
|
21
|
+
setPamSlot(data, "measurement", statement, confidence, source);
|
|
22
|
+
}
|
|
23
|
+
export function confirmPam(data, confidence = 0.9) {
|
|
24
|
+
for (const slot of ["purpose", "advantage", "measurement"]) {
|
|
25
|
+
const current = data[slot];
|
|
26
|
+
if (current)
|
|
27
|
+
data[slot] = { ...current, confidence };
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export function applyPamExtraction(data, ext, source) {
|
|
31
|
+
for (const slot of ["purpose", "advantage", "measurement"]) {
|
|
32
|
+
const value = ext[slot];
|
|
33
|
+
if (value)
|
|
34
|
+
setPamSlot(data, slot, value, nextPamConfidence(data[slot]?.confidence), source);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=pam.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pam.js","sourceRoot":"","sources":["../../../src/phases/aggregate/pam.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAIhD,SAAS,UAAU,CAAC,IAAe,EAAE,IAAa,EAAE,SAAiB,EAAE,UAAkB,EAAE,MAAe;IACxG,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,MAAM,IAAI,MAAM,CAAC;IACrD,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,CAAC,eAAe,IAAI,EAAE,MAAM,EAAE,eAAe,EAAE,CAAC,EAAE,CAAC;AAC9F,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,IAAe,EAAE,SAAiB,EAAE,UAAkB,EAAE,MAAe;IAChG,UAAU,CAAC,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;AAC7D,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,IAAe,EAAE,SAAiB,EAAE,UAAkB,EAAE,MAAe;IAClG,UAAU,CAAC,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;AAC/D,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,IAAe,EAAE,SAAiB,EAAE,UAAkB,EAAE,MAAe;IACpG,UAAU,CAAC,IAAI,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;AACjE,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,IAAe,EAAE,UAAU,GAAG,GAAG;IAC1D,KAAK,MAAM,IAAI,IAAI,CAAC,SAAS,EAAE,WAAW,EAAE,aAAa,CAAU,EAAE,CAAC;QACpE,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3B,IAAI,OAAO;YAAE,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO,EAAE,UAAU,EAAE,CAAC;IACvD,CAAC;AACH,CAAC;AAED,MAAM,UAAU,kBAAkB,CAChC,IAAe,EACf,GAAwF,EACxF,MAAe;IAEf,KAAK,MAAM,IAAI,IAAI,CAAC,SAAS,EAAE,WAAW,EAAE,aAAa,CAAU,EAAE,CAAC;QACpE,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC;QACxB,IAAI,KAAK;YAAE,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,CAAC;IAC9F,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scope aggregate mutations — in-scope/out-of-scope items and constraints.
|
|
3
|
+
*
|
|
4
|
+
* In-scope and out-of-scope items share a single `scope_NNN` namespace (numbered
|
|
5
|
+
* across both lists). Constraints have their own `constraint_NNN` namespace.
|
|
6
|
+
* The shared scope namespace is load-bearing: removal by ID filters both lists
|
|
7
|
+
* via a single set check.
|
|
8
|
+
*/
|
|
9
|
+
import type { Artifacts, Source } from "../schema.js";
|
|
10
|
+
export declare function addInScopeItems(data: Artifacts, items: Array<{
|
|
11
|
+
description: string;
|
|
12
|
+
relatedGoals?: string[];
|
|
13
|
+
}>, confidence?: number, source?: Source): void;
|
|
14
|
+
export declare function addOutOfScopeItems(data: Artifacts, items: Array<{
|
|
15
|
+
description: string;
|
|
16
|
+
reason?: string;
|
|
17
|
+
relatedGoals?: string[];
|
|
18
|
+
}>, confidence?: number, source?: Source): void;
|
|
19
|
+
export declare function addConstraints(data: Artifacts, items: Array<{
|
|
20
|
+
description: string;
|
|
21
|
+
}>, source?: Source): void;
|
|
22
|
+
export declare function removeScopeItems(data: Artifacts, ids: Set<string>): void;
|
|
23
|
+
export declare function confirmScope(data: Artifacts): void;
|
|
24
|
+
//# sourceMappingURL=scope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scope.d.ts","sourceRoot":"","sources":["../../../src/phases/aggregate/scope.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAiBtD,wBAAgB,eAAe,CAC7B,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,KAAK,CAAC;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,EAC9D,UAAU,SAA2B,EACrC,MAAM,CAAC,EAAE,MAAM,GACd,IAAI,CAWN;AAED,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,KAAK,CAAC;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,EAC/E,UAAU,SAA2B,EACrC,MAAM,CAAC,EAAE,MAAM,GACd,IAAI,CAYN;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,CAAC;IAAE,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAQ5G;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,CAGxE;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,CAGlD"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scope aggregate mutations — in-scope/out-of-scope items and constraints.
|
|
3
|
+
*
|
|
4
|
+
* In-scope and out-of-scope items share a single `scope_NNN` namespace (numbered
|
|
5
|
+
* across both lists). Constraints have their own `constraint_NNN` namespace.
|
|
6
|
+
* The shared scope namespace is load-bearing: removal by ID filters both lists
|
|
7
|
+
* via a single set check.
|
|
8
|
+
*/
|
|
9
|
+
import { nextId, SCOPE_DEFAULT_CONFIDENCE, CONFIRMED_CONFIDENCE } from "./shared.js";
|
|
10
|
+
function nextScopeId(data) {
|
|
11
|
+
return nextId("scope", [...data.inScope, ...data.outOfScope]);
|
|
12
|
+
}
|
|
13
|
+
function normalizeDescription(desc) {
|
|
14
|
+
return desc.toLowerCase().trim().replace(/\s+/g, " ");
|
|
15
|
+
}
|
|
16
|
+
function hasDuplicateDescription(data, description) {
|
|
17
|
+
const normalized = normalizeDescription(description);
|
|
18
|
+
return data.inScope.some((s) => normalizeDescription(s.description) === normalized)
|
|
19
|
+
|| data.outOfScope.some((s) => normalizeDescription(s.description) === normalized);
|
|
20
|
+
}
|
|
21
|
+
export function addInScopeItems(data, items, confidence = SCOPE_DEFAULT_CONFIDENCE, source) {
|
|
22
|
+
for (const item of items) {
|
|
23
|
+
if (hasDuplicateDescription(data, item.description))
|
|
24
|
+
continue;
|
|
25
|
+
data.inScope.push({
|
|
26
|
+
id: nextScopeId(data),
|
|
27
|
+
description: item.description,
|
|
28
|
+
relatedGoals: item.relatedGoals ?? [],
|
|
29
|
+
confidence,
|
|
30
|
+
...(source && { source }),
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
export function addOutOfScopeItems(data, items, confidence = SCOPE_DEFAULT_CONFIDENCE, source) {
|
|
35
|
+
for (const item of items) {
|
|
36
|
+
if (hasDuplicateDescription(data, item.description))
|
|
37
|
+
continue;
|
|
38
|
+
data.outOfScope.push({
|
|
39
|
+
id: nextScopeId(data),
|
|
40
|
+
description: item.description,
|
|
41
|
+
reason: item.reason ?? "",
|
|
42
|
+
relatedGoals: item.relatedGoals ?? [],
|
|
43
|
+
confidence,
|
|
44
|
+
...(source && { source }),
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
export function addConstraints(data, items, source) {
|
|
49
|
+
for (const item of items) {
|
|
50
|
+
data.constraints.push({
|
|
51
|
+
id: nextId("constraint", data.constraints),
|
|
52
|
+
description: item.description,
|
|
53
|
+
...(source && { source }),
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
export function removeScopeItems(data, ids) {
|
|
58
|
+
data.inScope = data.inScope.filter((s) => !ids.has(s.id));
|
|
59
|
+
data.outOfScope = data.outOfScope.filter((s) => !ids.has(s.id));
|
|
60
|
+
}
|
|
61
|
+
export function confirmScope(data) {
|
|
62
|
+
for (const s of data.inScope)
|
|
63
|
+
s.confidence = CONFIRMED_CONFIDENCE;
|
|
64
|
+
for (const s of data.outOfScope)
|
|
65
|
+
s.confidence = CONFIRMED_CONFIDENCE;
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=scope.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scope.js","sourceRoot":"","sources":["../../../src/phases/aggregate/scope.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,MAAM,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAErF,SAAS,WAAW,CAAC,IAAe;IAClC,OAAO,MAAM,CAAC,OAAO,EAAE,C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;QAAE,CAAC,CAAC,UAAU,GAAG,oBAAoB,CAAC;IAClE,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,UAAU;QAAE,CAAC,CAAC,UAAU,GAAG,oBAAoB,CAAC;AACvE,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cross-domain helpers shared by the aggregate modules: ID generation,
|
|
3
|
+
* PAM confidence promotion, and scope/confirmed confidence constants.
|
|
4
|
+
*/
|
|
5
|
+
export declare const SCOPE_DEFAULT_CONFIDENCE = 0.7;
|
|
6
|
+
export declare const CONFIRMED_CONFIDENCE = 0.9;
|
|
7
|
+
export declare function nextPamConfidence(current: number | undefined): number;
|
|
8
|
+
/**
|
|
9
|
+
* Generate the next ID in a prefix_NNN sequence.
|
|
10
|
+
* Scans existing entries for the max numeric suffix so removals are safe —
|
|
11
|
+
* new IDs always exceed any previously used one.
|
|
12
|
+
*/
|
|
13
|
+
export declare function nextId(prefix: string, existing: Array<{
|
|
14
|
+
id: string;
|
|
15
|
+
}>): string;
|
|
16
|
+
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/phases/aggregate/shared.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,wBAAwB,MAAM,CAAC;AAC5C,eAAO,MAAM,oBAAoB,MAAM,CAAC;AAExC,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAIrE;AAED;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,MAAM,CAM9E"}
|