@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.
Files changed (162) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +114 -0
  3. package/dist/durable/index.d.ts +10 -0
  4. package/dist/durable/index.d.ts.map +1 -0
  5. package/dist/durable/index.js +9 -0
  6. package/dist/durable/index.js.map +1 -0
  7. package/dist/durable/workflow.d.ts +165 -0
  8. package/dist/durable/workflow.d.ts.map +1 -0
  9. package/dist/durable/workflow.js +224 -0
  10. package/dist/durable/workflow.js.map +1 -0
  11. package/dist/interview/classification.d.ts +16 -0
  12. package/dist/interview/classification.d.ts.map +1 -0
  13. package/dist/interview/classification.js +25 -0
  14. package/dist/interview/classification.js.map +1 -0
  15. package/dist/interview/composition.d.ts +12 -0
  16. package/dist/interview/composition.d.ts.map +1 -0
  17. package/dist/interview/composition.js +19 -0
  18. package/dist/interview/composition.js.map +1 -0
  19. package/dist/interview/describe.d.ts +41 -0
  20. package/dist/interview/describe.d.ts.map +1 -0
  21. package/dist/interview/describe.js +80 -0
  22. package/dist/interview/describe.js.map +1 -0
  23. package/dist/interview/deviation.d.ts +91 -0
  24. package/dist/interview/deviation.d.ts.map +1 -0
  25. package/dist/interview/deviation.js +137 -0
  26. package/dist/interview/deviation.js.map +1 -0
  27. package/dist/interview/extraction.d.ts +32 -0
  28. package/dist/interview/extraction.d.ts.map +1 -0
  29. package/dist/interview/extraction.js +102 -0
  30. package/dist/interview/extraction.js.map +1 -0
  31. package/dist/interview/index.d.ts +25 -0
  32. package/dist/interview/index.d.ts.map +1 -0
  33. package/dist/interview/index.js +22 -0
  34. package/dist/interview/index.js.map +1 -0
  35. package/dist/interview/macros.d.ts +91 -0
  36. package/dist/interview/macros.d.ts.map +1 -0
  37. package/dist/interview/macros.js +138 -0
  38. package/dist/interview/macros.js.map +1 -0
  39. package/dist/interview/preambles.d.ts +18 -0
  40. package/dist/interview/preambles.d.ts.map +1 -0
  41. package/dist/interview/preambles.js +93 -0
  42. package/dist/interview/preambles.js.map +1 -0
  43. package/dist/interview/progress.d.ts +31 -0
  44. package/dist/interview/progress.d.ts.map +1 -0
  45. package/dist/interview/progress.js +51 -0
  46. package/dist/interview/progress.js.map +1 -0
  47. package/dist/interview/prompt.d.ts +20 -0
  48. package/dist/interview/prompt.d.ts.map +1 -0
  49. package/dist/interview/prompt.js +58 -0
  50. package/dist/interview/prompt.js.map +1 -0
  51. package/dist/phases/aggregate/assumptions.d.ts +14 -0
  52. package/dist/phases/aggregate/assumptions.d.ts.map +1 -0
  53. package/dist/phases/aggregate/assumptions.js +33 -0
  54. package/dist/phases/aggregate/assumptions.js.map +1 -0
  55. package/dist/phases/aggregate/findings.d.ts +10 -0
  56. package/dist/phases/aggregate/findings.d.ts.map +1 -0
  57. package/dist/phases/aggregate/findings.js +20 -0
  58. package/dist/phases/aggregate/findings.js.map +1 -0
  59. package/dist/phases/aggregate/goals.d.ts +28 -0
  60. package/dist/phases/aggregate/goals.d.ts.map +1 -0
  61. package/dist/phases/aggregate/goals.js +74 -0
  62. package/dist/phases/aggregate/goals.js.map +1 -0
  63. package/dist/phases/aggregate/index.d.ts +128 -0
  64. package/dist/phases/aggregate/index.d.ts.map +1 -0
  65. package/dist/phases/aggregate/index.js +165 -0
  66. package/dist/phases/aggregate/index.js.map +1 -0
  67. package/dist/phases/aggregate/pam.d.ts +19 -0
  68. package/dist/phases/aggregate/pam.d.ts.map +1 -0
  69. package/dist/phases/aggregate/pam.js +37 -0
  70. package/dist/phases/aggregate/pam.js.map +1 -0
  71. package/dist/phases/aggregate/scope.d.ts +24 -0
  72. package/dist/phases/aggregate/scope.d.ts.map +1 -0
  73. package/dist/phases/aggregate/scope.js +67 -0
  74. package/dist/phases/aggregate/scope.js.map +1 -0
  75. package/dist/phases/aggregate/shared.d.ts +16 -0
  76. package/dist/phases/aggregate/shared.d.ts.map +1 -0
  77. package/dist/phases/aggregate/shared.js +26 -0
  78. package/dist/phases/aggregate/shared.js.map +1 -0
  79. package/dist/phases/aggregate/stakeholders.d.ts +27 -0
  80. package/dist/phases/aggregate/stakeholders.d.ts.map +1 -0
  81. package/dist/phases/aggregate/stakeholders.js +90 -0
  82. package/dist/phases/aggregate/stakeholders.js.map +1 -0
  83. package/dist/phases/aggregate/waitingRoom.d.ts +16 -0
  84. package/dist/phases/aggregate/waitingRoom.d.ts.map +1 -0
  85. package/dist/phases/aggregate/waitingRoom.js +32 -0
  86. package/dist/phases/aggregate/waitingRoom.js.map +1 -0
  87. package/dist/phases/assumptions.d.ts +19 -0
  88. package/dist/phases/assumptions.d.ts.map +1 -0
  89. package/dist/phases/assumptions.js +224 -0
  90. package/dist/phases/assumptions.js.map +1 -0
  91. package/dist/phases/configuration.d.ts +8 -0
  92. package/dist/phases/configuration.d.ts.map +1 -0
  93. package/dist/phases/configuration.js +14 -0
  94. package/dist/phases/configuration.js.map +1 -0
  95. package/dist/phases/goals.d.ts +15 -0
  96. package/dist/phases/goals.d.ts.map +1 -0
  97. package/dist/phases/goals.js +297 -0
  98. package/dist/phases/goals.js.map +1 -0
  99. package/dist/phases/index.d.ts +21 -0
  100. package/dist/phases/index.d.ts.map +1 -0
  101. package/dist/phases/index.js +56 -0
  102. package/dist/phases/index.js.map +1 -0
  103. package/dist/phases/opening.d.ts +12 -0
  104. package/dist/phases/opening.d.ts.map +1 -0
  105. package/dist/phases/opening.js +99 -0
  106. package/dist/phases/opening.js.map +1 -0
  107. package/dist/phases/purpose.d.ts +17 -0
  108. package/dist/phases/purpose.d.ts.map +1 -0
  109. package/dist/phases/purpose.js +207 -0
  110. package/dist/phases/purpose.js.map +1 -0
  111. package/dist/phases/schema.d.ts +861 -0
  112. package/dist/phases/schema.d.ts.map +1 -0
  113. package/dist/phases/schema.js +157 -0
  114. package/dist/phases/schema.js.map +1 -0
  115. package/dist/phases/scope.d.ts +18 -0
  116. package/dist/phases/scope.d.ts.map +1 -0
  117. package/dist/phases/scope.js +440 -0
  118. package/dist/phases/scope.js.map +1 -0
  119. package/dist/phases/session/archive.d.ts +19 -0
  120. package/dist/phases/session/archive.d.ts.map +1 -0
  121. package/dist/phases/session/archive.js +49 -0
  122. package/dist/phases/session/archive.js.map +1 -0
  123. package/dist/phases/session/file.d.ts +31 -0
  124. package/dist/phases/session/file.d.ts.map +1 -0
  125. package/dist/phases/session/file.js +113 -0
  126. package/dist/phases/session/file.js.map +1 -0
  127. package/dist/phases/session/index.d.ts +8 -0
  128. package/dist/phases/session/index.d.ts.map +1 -0
  129. package/dist/phases/session/index.js +8 -0
  130. package/dist/phases/session/index.js.map +1 -0
  131. package/dist/phases/session/persistence.d.ts +30 -0
  132. package/dist/phases/session/persistence.d.ts.map +1 -0
  133. package/dist/phases/session/persistence.js +91 -0
  134. package/dist/phases/session/persistence.js.map +1 -0
  135. package/dist/phases/shared.d.ts +64 -0
  136. package/dist/phases/shared.d.ts.map +1 -0
  137. package/dist/phases/shared.js +100 -0
  138. package/dist/phases/shared.js.map +1 -0
  139. package/dist/phases/stakeholders.d.ts +17 -0
  140. package/dist/phases/stakeholders.d.ts.map +1 -0
  141. package/dist/phases/stakeholders.js +370 -0
  142. package/dist/phases/stakeholders.js.map +1 -0
  143. package/dist/phases/validation.d.ts +13 -0
  144. package/dist/phases/validation.d.ts.map +1 -0
  145. package/dist/phases/validation.js +130 -0
  146. package/dist/phases/validation.js.map +1 -0
  147. package/dist/skill/adapter.d.ts +16 -0
  148. package/dist/skill/adapter.d.ts.map +1 -0
  149. package/dist/skill/adapter.js +278 -0
  150. package/dist/skill/adapter.js.map +1 -0
  151. package/dist/skill/index.d.ts +12 -0
  152. package/dist/skill/index.d.ts.map +1 -0
  153. package/dist/skill/index.js +11 -0
  154. package/dist/skill/index.js.map +1 -0
  155. package/dist/skill/log.d.ts +18 -0
  156. package/dist/skill/log.d.ts.map +1 -0
  157. package/dist/skill/log.js +53 -0
  158. package/dist/skill/log.js.map +1 -0
  159. package/package.json +83 -0
  160. package/skills/elaborate/SKILL.md +97 -0
  161. package/skills/elaborate/scripts/elaborate.cjs +589 -0
  162. package/skills/project-brief/SKILL.md +45 -0
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Interview macros — compose-prompt-extract orchestration with deviation resilience.
3
+ *
4
+ * Each macro wraps a common interview cycle around `retryOnDeviation`:
5
+ * - `composePromptExtract` — full compose → prompt → extract with rephrase on clarification.
6
+ * - `promptExtract` — prompt → extract.
7
+ * - `promptConfirm` — prompt → classifier thunk. Public-facing wrapper lives here;
8
+ * the RE-coupled bits are wrapped by `confirmPhase` in phases/shared.ts.
9
+ * - `promptReview` — prompt → review classification.
10
+ * - `promptReextract` — contradiction prompt → reextraction.
11
+ *
12
+ * `promptExtractWithRetry` is the file-private shared backing function for
13
+ * the prompt-then-extract family (promptExtract, promptConfirm, promptReview).
14
+ *
15
+ * ## Call-site convention: prompt-via-factory, infer-inline
16
+ *
17
+ * Phase code uses two visually different patterns at these macros' call sites,
18
+ * by deliberate convention — don't unify them:
19
+ *
20
+ * - **Prompt macros** (`promptExtract`, `promptConfirm`, `promptReview`) take
21
+ * their `prompt` argument from a named factory call:
22
+ * `confirmation(artifacts, round)`, `summary(agg)`, `greeting()`,
23
+ * `seedPresent(items)`, `nudge()`, `respondentPresent(...)`, etc.
24
+ *
25
+ * - **Compose/extract macros** (and direct `ctx.extract` / `ctx.seed` calls)
26
+ * take their extraction params as an inline object literal:
27
+ * `{ artifactsContext, schema, guidance? }`.
28
+ *
29
+ * Rationale: prompt args carry multi-line user-facing English (greetings,
30
+ * summaries, confirmation statements). Factoring into a named helper gives
31
+ * the wording a discoverable, testable home and keeps phase control flow
32
+ * uncluttered. Infer args carry mechanical plumbing — no user-facing wording;
33
+ * the wording lives in Zod `.describe()` annotations and the extraction
34
+ * preamble, both centralized. A factory for infer args would rename "object
35
+ * literal" with no readability or DRY win.
36
+ *
37
+ * Rejected alternatives: **unify on functions** — forces `extract(() => ({...}))`
38
+ * everywhere, pure noise; **unify on data** — inlines prompt-wording factories
39
+ * into phase files, losing the discoverable-wording property.
40
+ */
41
+ import { z } from "zod";
42
+ import type { ComposeParams } from "./describe.js";
43
+ import type { ExtractParams } from "./extraction.js";
44
+ /** Options for ctx.composePromptExtract(). */
45
+ export interface ComposePromptExtractOptions<S extends z.ZodObject<any>> {
46
+ /** Called with items to park when divergence carries content. */
47
+ park?: (items: Array<{
48
+ content: string;
49
+ }>) => void;
50
+ /** Maximum deviation retries. Default: 2. */
51
+ maxRetries?: number;
52
+ /** Returned when all retries are exhausted. If absent, last error re-throws. */
53
+ defaults?: z.infer<S>;
54
+ }
55
+ /** Options for prompt-extract macros (promptExtract, promptReview). */
56
+ export interface PromptExtractOptions<S extends z.ZodObject<any>> {
57
+ park?: (items: Array<{
58
+ content: string;
59
+ }>) => void;
60
+ maxRetries?: number;
61
+ defaults?: z.infer<S>;
62
+ }
63
+ /** Options for promptConfirm and promptReextract. */
64
+ export interface PromptConfirmOptions {
65
+ park?: (items: Array<{
66
+ content: string;
67
+ }>) => void;
68
+ maxRetries?: number;
69
+ defaults?: Record<string, unknown>;
70
+ }
71
+ declare module "../durable/workflow.js" {
72
+ interface WorkflowContext {
73
+ composePromptExtract<S extends z.ZodObject<any>>(baseId: string, compose: () => ComposeParams, extractionParams: Omit<ExtractParams<S>, 'id' | 'response' | 'asked'>, options?: ComposePromptExtractOptions<S>): Promise<z.infer<S>>;
74
+ promptExtract<S extends z.ZodObject<any>>(prompt: {
75
+ id: string;
76
+ message: string;
77
+ }, extractionParams: Omit<ExtractParams<S>, 'id' | 'response'>, options?: PromptExtractOptions<S>): Promise<z.infer<S>>;
78
+ promptConfirm<T>(prompt: {
79
+ id: string;
80
+ message: string;
81
+ }, classifier: (response: string, ri: number) => Promise<T>, options?: PromptConfirmOptions): Promise<T & {
82
+ response: string;
83
+ }>;
84
+ promptReview<S extends z.ZodObject<any>>(prompt: {
85
+ id: string;
86
+ message: string;
87
+ }, reviewId: string, itemRef: string, artifactsContext: string, schema: S, options?: PromptExtractOptions<S>): Promise<z.infer<S>>;
88
+ promptReextract<S extends z.ZodObject<any>>(contradictionId: string, contradictions: string[], artifactsContext: string, schema: S, options?: PromptConfirmOptions): Promise<z.infer<S>>;
89
+ }
90
+ }
91
+ //# sourceMappingURL=macros.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"macros.d.ts","sourceRoot":"","sources":["../../src/interview/macros.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,8CAA8C;AAC9C,MAAM,WAAW,2BAA2B,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC;IACrE,iEAAiE;IACjE,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,KAAK,IAAI,CAAC;IACnD,6CAA6C;IAC7C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gFAAgF;IAChF,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;CACvB;AAED,uEAAuE;AACvE,MAAM,WAAW,oBAAoB,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC;IAC9D,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,KAAK,IAAI,CAAC;IACnD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;CACvB;AAED,qDAAqD;AACrD,MAAM,WAAW,oBAAoB;IACnC,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE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,CAAC,CAAC;QACrC,YAAY,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,EACrC,MAAM,EAAE;YAAE,EAAE,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAA;SAAE,EACvC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,gBAAgB,EAAE,MAAM,EACxB,MAAM,EAAE,CAAC,EACT,OAAO,CAAC,EAAE,oBAAoB,CAAC,CAAC,CAAC,GAChC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QACvB,eAAe,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,EACxC,eAAe,EAAE,MAAM,EACvB,cAAc,EAAE,MAAM,EAAE,EACxB,gBAAgB,EAAE,MAAM,EACxB,MAAM,EAAE,CAAC,EACT,OAAO,CAAC,EAAE,oBAAoB,GAC7B,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;KACxB;CACF"}
@@ -0,0 +1,138 @@
1
+ /**
2
+ * Interview macros — compose-prompt-extract orchestration with deviation resilience.
3
+ *
4
+ * Each macro wraps a common interview cycle around `retryOnDeviation`:
5
+ * - `composePromptExtract` — full compose → prompt → extract with rephrase on clarification.
6
+ * - `promptExtract` — prompt → extract.
7
+ * - `promptConfirm` — prompt → classifier thunk. Public-facing wrapper lives here;
8
+ * the RE-coupled bits are wrapped by `confirmPhase` in phases/shared.ts.
9
+ * - `promptReview` — prompt → review classification.
10
+ * - `promptReextract` — contradiction prompt → reextraction.
11
+ *
12
+ * `promptExtractWithRetry` is the file-private shared backing function for
13
+ * the prompt-then-extract family (promptExtract, promptConfirm, promptReview).
14
+ *
15
+ * ## Call-site convention: prompt-via-factory, infer-inline
16
+ *
17
+ * Phase code uses two visually different patterns at these macros' call sites,
18
+ * by deliberate convention — don't unify them:
19
+ *
20
+ * - **Prompt macros** (`promptExtract`, `promptConfirm`, `promptReview`) take
21
+ * their `prompt` argument from a named factory call:
22
+ * `confirmation(artifacts, round)`, `summary(agg)`, `greeting()`,
23
+ * `seedPresent(items)`, `nudge()`, `respondentPresent(...)`, etc.
24
+ *
25
+ * - **Compose/extract macros** (and direct `ctx.extract` / `ctx.seed` calls)
26
+ * take their extraction params as an inline object literal:
27
+ * `{ artifactsContext, schema, guidance? }`.
28
+ *
29
+ * Rationale: prompt args carry multi-line user-facing English (greetings,
30
+ * summaries, confirmation statements). Factoring into a named helper gives
31
+ * the wording a discoverable, testable home and keeps phase control flow
32
+ * uncluttered. Infer args carry mechanical plumbing — no user-facing wording;
33
+ * the wording lives in Zod `.describe()` annotations and the extraction
34
+ * preamble, both centralized. A factory for infer args would rename "object
35
+ * literal" with no readability or DRY win.
36
+ *
37
+ * Rejected alternatives: **unify on functions** — forces `extract(() => ({...}))`
38
+ * everywhere, pure noise; **unify on data** — inlines prompt-wording factories
39
+ * into phase files, losing the discoverable-wording property.
40
+ */
41
+ import { WorkflowContext } from "../durable/index.js";
42
+ import { Confusion, deviationMessage } from "./deviation.js";
43
+ /** Rephrase hint prepended to composition message on clarification retry. */
44
+ function rephraseHint() {
45
+ return "The respondent asked for clarification. Rephrase the question using simpler language, a concrete example, or a different angle.\n\n";
46
+ }
47
+ /**
48
+ * Compose → prompt → extract with deviation resilience.
49
+ */
50
+ WorkflowContext.prototype.composePromptExtract = async function (baseId, compose, extractionParams, options) {
51
+ return this.retryOnDeviation(async (ri, error) => {
52
+ if (error && !(error instanceof Confusion) && "parkedItems" in error && error.parkedItems.length > 0) {
53
+ options?.park?.(error.parkedItems);
54
+ }
55
+ const step = compose();
56
+ const message = error instanceof Confusion
57
+ ? rephraseHint() + step.message
58
+ : step.message;
59
+ const ask = await this.compose({ ...step, message, id: `${baseId}-composition-r${ri}` });
60
+ const question = error && !(error instanceof Confusion)
61
+ ? deviationMessage(error) + "\n\n" + ask.question
62
+ : ask.question;
63
+ const response = await this.promptQuestion(`${baseId}-question-r${ri}`, { ...ask, question });
64
+ return this.extract({
65
+ ...extractionParams,
66
+ id: `${baseId}-extraction-r${ri}`,
67
+ response,
68
+ asked: ask,
69
+ });
70
+ }, {
71
+ maxRetries: options?.maxRetries ?? 2,
72
+ ...(options && "defaults" in options ? { defaults: options.defaults } : {}),
73
+ });
74
+ };
75
+ /**
76
+ * Generic prompt → extract with deviation resilience.
77
+ *
78
+ * Shared backing function for promptExtract, promptConfirm, and promptReview.
79
+ * File-private — prevents the classifier callback shape leaking to callers.
80
+ */
81
+ async function promptExtractWithRetry(ctx, prompt, extract, options) {
82
+ return ctx.retryOnDeviation(async (ri, error) => {
83
+ if (error && !(error instanceof Confusion) && "parkedItems" in error && error.parkedItems.length > 0) {
84
+ options?.park?.(error.parkedItems);
85
+ }
86
+ const message = error ? deviationMessage(error) + "\n\n" + prompt.message : prompt.message;
87
+ const response = await ctx.promptStep({ ...prompt, id: `${prompt.id}-r${ri}`, message });
88
+ return extract(response, ri);
89
+ }, {
90
+ maxRetries: options?.maxRetries ?? 1,
91
+ ...(options?.defaults !== undefined ? { defaults: options.defaults } : {}),
92
+ });
93
+ }
94
+ /** Prompt → extract with deviation resilience. */
95
+ WorkflowContext.prototype.promptExtract = async function (prompt, extractionParams, options) {
96
+ return promptExtractWithRetry(this, prompt, (response, ri) => this.extract({ ...extractionParams, id: `${prompt.id}-extraction-r${ri}`, response }), options);
97
+ };
98
+ /**
99
+ * Prompt → classify with deviation resilience. The classifier thunk receives
100
+ * the raw response + retry index and returns the classification payload.
101
+ * Result is the classifier's return merged with `{ response }`.
102
+ *
103
+ * RE-agnostic: keeps the `Artifacts`/`Phase` coupling on the caller's side.
104
+ * Phase code typically goes through the `confirmPhase` helper in `phases/shared.ts`.
105
+ */
106
+ WorkflowContext.prototype.promptConfirm = async function (prompt, classifier, options) {
107
+ const wrappedOptions = options?.defaults
108
+ ? { ...options, defaults: { ...options.defaults, response: "" } }
109
+ : options;
110
+ return promptExtractWithRetry(this, prompt, async (response, ri) => {
111
+ const result = await classifier(response, ri);
112
+ return { ...result, response };
113
+ }, wrappedOptions);
114
+ };
115
+ /** Prompt → review classification with deviation resilience. */
116
+ WorkflowContext.prototype.promptReview = async function (prompt, reviewId, itemRef, artifactsContext, schema, options) {
117
+ return promptExtractWithRetry(this, prompt, (response, ri) => this.review(reviewId, response, itemRef, artifactsContext, schema, ri), options);
118
+ };
119
+ /** Contradiction prompt → reextraction with deviation resilience. */
120
+ WorkflowContext.prototype.promptReextract = async function (contradictionId, contradictions, artifactsContext, schema, options) {
121
+ return this.retryOnDeviation(async (ri, error) => {
122
+ if (error && !(error instanceof Confusion) && "parkedItems" in error && error.parkedItems.length > 0) {
123
+ options?.park?.(error.parkedItems);
124
+ }
125
+ const clarification = await this.promptContradiction(`${contradictionId}-r${ri}`, contradictions);
126
+ return this.reextract(`${contradictionId}-reextraction-r${ri}`, clarification, artifactsContext, schema);
127
+ }, {
128
+ maxRetries: options?.maxRetries ?? 1,
129
+ ...(options?.defaults !== undefined ? { defaults: options.defaults } : {}),
130
+ });
131
+ };
132
+ const REQUIRED_PROTOTYPE_METHODS = ["composePromptExtract", "promptExtract", "promptConfirm", "promptReview", "promptReextract"];
133
+ for (const method of REQUIRED_PROTOTYPE_METHODS) {
134
+ if (typeof WorkflowContext.prototype[method] !== "function") {
135
+ throw new Error(`interview/macros.ts self-check failed: WorkflowContext.prototype.${method} is not a function.`);
136
+ }
137
+ }
138
+ //# sourceMappingURL=macros.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"macros.js","sourceRoot":"","sources":["../../src/interview/macros.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,OAAO,EAAE,SAAS,EAAuB,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AA+DlF,6EAA6E;AAC7E,SAAS,YAAY;IACnB,OAAO,qIAAqI,CAAC;A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C;IAChD,IAAI,OAAQ,eAAe,CAAC,SAAgD,CAAC,MAAM,CAAC,KAAK,UAAU,EAAE,CAAC;QACpG,MAAM,IAAI,KAAK,CAAC,oEAAoE,MAAM,qBAAqB,CAAC,CAAC;IACnH,CAAC;AACH,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Authored LLM instruction content — quality preambles and closers.
3
+ *
4
+ * This module holds prompt *content* only. Injection happens inside each
5
+ * extension method's body in its own concern file (composition, extraction,
6
+ * classification, prompt). See ADR: composition-quality.
7
+ */
8
+ /** Prepended to every ctx.compose call. */
9
+ export declare function compositionPreamble(): string;
10
+ /** Prepended to confirmation classification guidance. */
11
+ export declare function classificationPreamble(): string;
12
+ /** Prepended to every ctx.extract call. */
13
+ export declare function extractionPreamble(): string;
14
+ /** Appended after suggestion list in promptQuestion. */
15
+ export declare function suggestionCloser(): string;
16
+ /** Correction-inviting closer for phase confirmation prompts (not validation). */
17
+ export declare function confirmationCloser(): string;
18
+ //# sourceMappingURL=preambles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preambles.d.ts","sourceRoot":"","sources":["../../src/interview/preambles.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,2CAA2C;AAC3C,wBAAgB,mBAAmB,IAAI,MAAM,CA0C5C;AAED,yDAAyD;AACzD,wBAAgB,sBAAsB,IAAI,MAAM,CAe/C;AAED,2CAA2C;AAC3C,wBAAgB,kBAAkB,IAAI,MAAM,CAgB3C;AAED,wDAAwD;AACxD,wBAAgB,gBAAgB,IAAI,MAAM,CAAwH;AAElK,kFAAkF;AAClF,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C"}
@@ -0,0 +1,93 @@
1
+ /**
2
+ * Authored LLM instruction content — quality preambles and closers.
3
+ *
4
+ * This module holds prompt *content* only. Injection happens inside each
5
+ * extension method's body in its own concern file (composition, extraction,
6
+ * classification, prompt). See ADR: composition-quality.
7
+ */
8
+ /** Prepended to every ctx.compose call. */
9
+ export function compositionPreamble() {
10
+ return `
11
+ <composition_rules>
12
+ You are composing a single interview question with optional suggested answers. Format output as markdown.
13
+
14
+ <questioning>
15
+ 1. Question stem under 20 words. One sentence, SVO structure, no embedded clauses.
16
+ 2. Compose context as a separate preceding statement — keep it out of the question.
17
+ 3. Keep total message concise — prefer 3-4 sentences.
18
+ 4. Use affirmative question stems ("Which of these are goals?" not "Which are NOT goals?").
19
+ 5. Attach a concrete handle to "why" questions ("What led you to…?" not bare "Why?").
20
+ 6. Prefer experience-grounded questions ("Tell me about a time…") over hypotheticals, except for negative probing.
21
+ 7. When rephrasing, change the approach and angle — offer a concrete example or scaffold when the respondent signals confusion.
22
+ 8. Ask exactly one question per message — never include two or more question marks.
23
+ </questioning>
24
+
25
+ <formatting>
26
+ 1. Bold the key noun phrase (2-4 words) in each question: "What **safety equipment** do you currently use?"
27
+ 2. Keep bolding under ~30% of text.
28
+ 3. Leave suggestions unbolded.
29
+ </formatting>
30
+
31
+ <bias>
32
+ 1. Use neutral language — no evaluative adjectives, no positive/negative framing preambles.
33
+ 2. Ask existence-checking questions before assuming specifics ("Walk me through your current process" before "What features do you want?").
34
+ 3. Frame for openness ("How do you feel about…?" not "Do you agree that…?").
35
+ 4. Normalize uncertainty when appropriate ("It's completely fine if you're not sure").
36
+ 5. Reflect the respondent's own words without upgrading their certainty or specificity.
37
+ 6. Present the question only — do not offer your own interpretation or answer within it.
38
+ 7. Vary suggested answers across different angles or specificity levels when the topic allows — avoid clustering all suggestions around the same type.
39
+ </bias>
40
+
41
+ <register>
42
+ 1. Approachable, clear tone — "knowledgeable friend." Not overly formal, not buddy-like.
43
+ 2. Mirror the respondent's vocabulary level.
44
+ 3. Gloss jargon only when the respondent hasn't used the term themselves.
45
+ 4. Frame questions from the respondent's perspective — use the name and role of the stakeholder marked isRespondent in the context. Do not frame questions for other stakeholders' perspectives.
46
+ </register>
47
+
48
+ Keep questions focused and unbiased. The respondent's words are the source of truth.
49
+ </composition_rules>
50
+ `;
51
+ }
52
+ /** Prepended to confirmation classification guidance. */
53
+ export function classificationPreamble() {
54
+ return `
55
+ <classification_rules>
56
+ You are classifying whether the respondent approved a summary or requested a revision.
57
+
58
+ <bias_correction>
59
+ 1. Weight correction signals generously — if the respondent mentions anything to change, classify as revision even if they also express general approval.
60
+ 2. Treat ambiguous responses as revision requests, not approvals.
61
+ 3. Treat hedging language ("I guess it's fine", "mostly", "probably ok") as revision signals.
62
+ 4. Only classify as approved when the respondent clearly and unambiguously endorses the summary.
63
+ </bias_correction>
64
+
65
+ When in doubt, classify as revision. A false revision is cheaper than a missed correction.
66
+ </classification_rules>
67
+ `;
68
+ }
69
+ /** Prepended to every ctx.extract call. */
70
+ export function extractionPreamble() {
71
+ return `
72
+ <extraction_rules>
73
+ You are extracting structured data from the respondent's words.
74
+
75
+ <fidelity>
76
+ 1. Extract the respondent's words faithfully — preserve their language, don't interpret or rephrase.
77
+ 2. Record what they said, not what you think they meant. "Mentioned mobile" stays "mentioned mobile", not "mobile-first requirement".
78
+ 3. Do not upgrade certainty — "might need" stays tentative, not "needs".
79
+ 4. Do not add evaluative framing ("key", "main", "critical") unless the respondent used those words.
80
+ 5. Do not infer fields the respondent did not mention — leave them empty.
81
+ </fidelity>
82
+
83
+ The respondent is the authority on their own intent. Extract, don't interpret.
84
+ </extraction_rules>
85
+ `;
86
+ }
87
+ /** Appended after suggestion list in promptQuestion. */
88
+ export function suggestionCloser() { return "...or better yet, describe in your own words — your phrasing captures nuances that pre-made options can't"; }
89
+ /** Correction-inviting closer for phase confirmation prompts (not validation). */
90
+ export function confirmationCloser() {
91
+ return "What would you change or add? If this looks right as-is, let me know and we'll move on.";
92
+ }
93
+ //# sourceMappingURL=preambles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preambles.js","sourceRoot":"","sources":["../../src/interview/preambles.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,2CAA2C;AAC3C,MAAM,UAAU,mBAAmB;IACjC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCN,CAAC;AACJ,CAAC;AAED,yDAAyD;AACzD,MAAM,UAAU,sBAAsB;IACpC,OAAO;;;;;;;;;;;;;GAaN,CAAC;AACJ,CAAC;AAED,2CAA2C;AAC3C,MAAM,UAAU,kBAAkB;IAChC,OAAO;;;;;;;;;;;;;;GAcN,CAAC;AACJ,CAAC;AAED,wDAAwD;AACxD,MAAM,UAAU,gBAAgB,KAAa,OAAO,2GAA2G,CAAC,CAAC,CAAC;AAElK,kFAAkF;AAClF,MAAM,UAAU,kBAAkB;IAChC,OAAO,yFAAyF,CAAC;AACnG,CAAC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Progress tracking — step/total/label state on WorkflowContext, a sublabel
3
+ * formatter for human-readable progress prefixes, and a transition-message
4
+ * slot consumed by the next user-facing prompt.
5
+ */
6
+ /** Progress state for the current phase. */
7
+ export interface ProgressState {
8
+ step: number;
9
+ total: number;
10
+ label: string;
11
+ }
12
+ /**
13
+ * Derive a human-readable sublabel from a prompt id.
14
+ * "goal-refinement-question-goal_001-clarify-0" → "refining goal #1"
15
+ * "purpose-confirmation-0" → "confirmation"
16
+ * "scope-constraint-question" → "constraints"
17
+ */
18
+ export declare function formatSublabel(id: string): string;
19
+ /** Build a progress prefix string from state and prompt id. */
20
+ export declare function progressPrefix(progress: ProgressState | null, id: string): string;
21
+ declare module "../durable/workflow.js" {
22
+ interface WorkflowContext {
23
+ /** Progress state for the current phase. */
24
+ progress: ProgressState | null;
25
+ /** Transition message to prepend to the next user-facing prompt (consumed once). */
26
+ pendingTransition: string | null;
27
+ setProgress(step: number, total: number, label: string): void;
28
+ setTransition(message: string | undefined): void;
29
+ }
30
+ }
31
+ //# sourceMappingURL=progress.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../src/interview/progress.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,4CAA4C;AAC5C,MAAM,WAAW,aAAa;IAAG,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE;AAE7E;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAcjD;AAED,+DAA+D;AAC/D,wBAAgB,cAAc,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAKjF;AAED,OAAO,QAAQ,wBAAwB,CAAC;IACtC,UAAU,eAAe;QACvB,4CAA4C;QAC5C,QAAQ,EAAE,aAAa,GAAG,IAAI,CAAC;QAC/B,oFAAoF;QACpF,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;QACjC,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;QAC9D,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;KAClD;CACF"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Progress tracking — step/total/label state on WorkflowContext, a sublabel
3
+ * formatter for human-readable progress prefixes, and a transition-message
4
+ * slot consumed by the next user-facing prompt.
5
+ */
6
+ import { WorkflowContext } from "../durable/index.js";
7
+ /**
8
+ * Derive a human-readable sublabel from a prompt id.
9
+ * "goal-refinement-question-goal_001-clarify-0" → "refining goal #1"
10
+ * "purpose-confirmation-0" → "confirmation"
11
+ * "scope-constraint-question" → "constraints"
12
+ */
13
+ export function formatSublabel(id) {
14
+ const phases = ["opening", "purpose", "goal", "goals", "stakeholder", "stakeholders", "scope", "assumption", "assumptions", "validation"];
15
+ let rest = id;
16
+ for (const p of phases) {
17
+ if (rest.startsWith(p + "-")) {
18
+ rest = rest.slice(p.length + 1);
19
+ break;
20
+ }
21
+ }
22
+ rest = rest.replace(/_0*(\d+)/g, " #$1");
23
+ rest = rest.replace(/-r\d+$/, "").replace(/-\d+$/, "");
24
+ rest = rest.replace(/-?question-?/g, "-").replace(/-?extraction-?/g, "-").replace(/-?composition-?/g, "-");
25
+ rest = rest.replace(/-+/g, " ").trim();
26
+ rest = rest.replace(/\s+\d+$/, "");
27
+ return rest;
28
+ }
29
+ /** Build a progress prefix string from state and prompt id. */
30
+ export function progressPrefix(progress, id) {
31
+ if (!progress)
32
+ return "";
33
+ const { step, total, label } = progress;
34
+ const sub = formatSublabel(id);
35
+ return sub ? `[${step}/${total} ${label} · ${sub}]` : `[${step}/${total} ${label}]`;
36
+ }
37
+ WorkflowContext.prototype.progress = null;
38
+ WorkflowContext.prototype.pendingTransition = null;
39
+ WorkflowContext.prototype.setProgress = function (step, total, label) {
40
+ this.progress = { step, total, label };
41
+ };
42
+ WorkflowContext.prototype.setTransition = function (message) {
43
+ this.pendingTransition = message ?? null;
44
+ };
45
+ const REQUIRED_PROTOTYPE_METHODS = ["setProgress", "setTransition"];
46
+ for (const method of REQUIRED_PROTOTYPE_METHODS) {
47
+ if (typeof WorkflowContext.prototype[method] !== "function") {
48
+ throw new Error(`interview/progress.ts self-check failed: WorkflowContext.prototype.${method} is not a function.`);
49
+ }
50
+ }
51
+ //# sourceMappingURL=progress.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"progress.js","sourceRoot":"","sources":["../../src/interview/progress.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAKtD;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,EAAU;IACvC,MAAM,MAAM,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,CAAC,CAAC;IAC1I,IAAI,IAAI,GAAG,EAAE,CAAC;IACd,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE,CAAC;QACvB,IAAI,IAAI,CAAC,UAAU,CAAC,CAA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eAAe,CAAC,SAAS,CAAC,WAAW,GAAG,UAAU,IAAI,EAAE,KAAK,EAAE,KAAK;IAClE,IAAI,CAAC,QAAQ,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;AACzC,CAAC,CAAC;AAEF,eAAe,CAAC,SAAS,CAAC,aAAa,GAAG,UAAU,OAAO;IACzD,IAAI,CAAC,iBAAiB,GAAG,OAAO,IAAI,IAAI,CAAC;AAC3C,CAAC,CAAC;AAEF,MAAM,0BAA0B,GAAG,CAAC,aAAa,EAAE,eAAe,CAAU,CAAC;AAC7E,KAAK,MAAM,MAAM,IAAI,0BAA0B,EAAE,CAAC;IAChD,IAAI,OAAQ,eAAe,CAAC,SAAgD,CAAC,MAAM,CAAC,KAAK,UAAU,EAAE,CAAC;QACpG,MAAM,IAAI,KAAK,CAAC,sEAAsE,MAAM,qBAAqB,CAAC,CAAC;IACrH,CAAC;AACH,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Prompt formatters — wrap ctx.prompt() with progress prefix, pending transition,
3
+ * suggestion lists, and contradiction formatting.
4
+ */
5
+ /** Agent-composed question with optional suggested answers. */
6
+ export type QuestionContext = {
7
+ question: string;
8
+ suggestions?: string[];
9
+ };
10
+ declare module "../durable/workflow.js" {
11
+ interface WorkflowContext {
12
+ promptStep(step: {
13
+ id: string;
14
+ message: string;
15
+ }): Promise<string>;
16
+ promptQuestion(id: string, ask: QuestionContext): Promise<string>;
17
+ promptContradiction(id: string, contradictions: string[]): Promise<string>;
18
+ }
19
+ }
20
+ //# sourceMappingURL=prompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../src/interview/prompt.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,+DAA+D;AAC/D,MAAM,MAAM,eAAe,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAE3E,OAAO,QAAQ,wBAAwB,CAAC;IACtC,UAAU,eAAe;QACvB,UAAU,CAAC,IAAI,EAAE;YAAE,EAAE,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAA;SAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;QACnE,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;QAClE,mBAAmB,CAAC,EAAE,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;KAC5E;CACF"}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Prompt formatters — wrap ctx.prompt() with progress prefix, pending transition,
3
+ * suggestion lists, and contradiction formatting.
4
+ */
5
+ import { WorkflowContext } from "../durable/index.js";
6
+ import { progressPrefix } from "./progress.js";
7
+ import { suggestionCloser } from "./preambles.js";
8
+ /** Prompt with a PromptStep, auto-applying progress prefix and pending transition. */
9
+ WorkflowContext.prototype.promptStep = async function (step) {
10
+ let message = step.message;
11
+ if (this.pendingTransition) {
12
+ message = this.pendingTransition + "\n\n" + message;
13
+ this.pendingTransition = null;
14
+ }
15
+ const prefix = progressPrefix(this.progress, step.id);
16
+ return this.prompt({ ...step, message: prefix ? `${prefix}\n${message}` : message });
17
+ };
18
+ /** Format a QuestionContext with lettered suggestions and prompt the respondent. */
19
+ WorkflowContext.prototype.promptQuestion = async function (id, ask) {
20
+ let message = ask.question;
21
+ if (ask.suggestions && ask.suggestions.length > 0) {
22
+ const letters = "abcdefghijklmnopqrstuvwxyz";
23
+ message += "\n\nFor example:";
24
+ for (let i = 0; i < ask.suggestions.length; i++) {
25
+ message += `\n${letters[i]}) ${ask.suggestions[i]}`;
26
+ }
27
+ if (suggestionCloser())
28
+ message += `\n${suggestionCloser()}`;
29
+ }
30
+ if (this.pendingTransition) {
31
+ message = this.pendingTransition + "\n\n" + message;
32
+ this.pendingTransition = null;
33
+ }
34
+ const prefix = progressPrefix(this.progress, id);
35
+ return this.prompt({ id, message: prefix ? `${prefix}\n${message}` : message, suggestions: ask.suggestions });
36
+ };
37
+ /** Present detected contradictions to the respondent and ask for clarification. */
38
+ WorkflowContext.prototype.promptContradiction = async function (id, contradictions) {
39
+ const parts = ["I noticed something that might be inconsistent with what you said earlier:"];
40
+ for (const c of contradictions) {
41
+ parts.push(`\n- ${c}`);
42
+ }
43
+ parts.push("\n\nCould you help me understand what changed?");
44
+ let message = parts.join("");
45
+ if (this.pendingTransition) {
46
+ message = this.pendingTransition + "\n\n" + message;
47
+ this.pendingTransition = null;
48
+ }
49
+ const prefix = progressPrefix(this.progress, id);
50
+ return this.prompt({ id, message: prefix ? `${prefix}\n${message}` : message });
51
+ };
52
+ const REQUIRED_PROTOTYPE_METHODS = ["promptStep", "promptQuestion", "promptContradiction"];
53
+ for (const method of REQUIRED_PROTOTYPE_METHODS) {
54
+ if (typeof WorkflowContext.prototype[method] !== "function") {
55
+ throw new Error(`interview/prompt.ts self-check failed: WorkflowContext.prototype.${method} is not a function.`);
56
+ }
57
+ }
58
+ //# sourceMappingURL=prompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../src/interview/prompt.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAalD,sFAAsF;AACtF,eAAe,CAAC,SAAS,CAAC,UAAU,GAAG,KAAK,WAAW,IAAI;IACzD,IAAI,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;IAC3B,IAAI,IAAI,CAAC,iBAAiB,EAAE,CAAC;QAC3B,OAAO,GAAG,IAAI,CAAC,iBAAiB,GAAG,MAAM,GAAG,OAAO,CAAC;QACpD,IAAI,CAAC,iBA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AAqB,CAAC,CAAC;IACnH,CAAC;AACH,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Assumption aggregate mutations — unvalidated / validated / flagged states
3
+ * with status-driven confidence.
4
+ */
5
+ import type { Artifacts, Assumption, AssumptionType, AssumptionStatus, Source } from "../schema.js";
6
+ export declare function addAssumptions(data: Artifacts, items: Array<{
7
+ statement: string;
8
+ type?: AssumptionType;
9
+ relatedGoals?: string[];
10
+ }>, confidence?: number, status?: AssumptionStatus, source?: Source): void;
11
+ export declare function setAssumptionStatus(data: Artifacts, id: string, status: AssumptionStatus): void;
12
+ export declare function removeAssumptions(data: Artifacts, ids: Set<string>): void;
13
+ export declare function findAssumption(data: Artifacts, id: string): Assumption | undefined;
14
+ //# sourceMappingURL=assumptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assumptions.d.ts","sourceRoot":"","sources":["../../../src/phases/aggregate/assumptions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAIpG,wBAAgB,cAAc,CAC5B,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,KAAK,CAAC;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,cAAc,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,EACnF,UAAU,SAAoC,EAC9C,MAAM,GAAE,gBAAgC,EACxC,MAAM,CAAC,EAAE,MAAM,GACd,IAAI,CAYN;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAK/F;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,CAEzE;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAElF"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Assumption aggregate mutations — unvalidated / validated / flagged states
3
+ * with status-driven confidence.
4
+ */
5
+ import { ASSUMPTION_CONFIDENCE } from "../schema.js";
6
+ import { nextId } from "./shared.js";
7
+ export function addAssumptions(data, items, confidence = ASSUMPTION_CONFIDENCE.unvalidated, status = "unvalidated", source) {
8
+ for (const item of items) {
9
+ data.assumptions.push({
10
+ id: nextId("assumption", data.assumptions),
11
+ statement: item.statement,
12
+ type: item.type ?? "hypothesis",
13
+ status,
14
+ relatedGoals: item.relatedGoals ?? [],
15
+ confidence,
16
+ ...(source && { source }),
17
+ });
18
+ }
19
+ }
20
+ export function setAssumptionStatus(data, id, status) {
21
+ const a = findAssumption(data, id);
22
+ if (!a)
23
+ return;
24
+ a.status = status;
25
+ a.confidence = ASSUMPTION_CONFIDENCE[status];
26
+ }
27
+ export function removeAssumptions(data, ids) {
28
+ data.assumptions = data.assumptions.filter((a) => !ids.has(a.id));
29
+ }
30
+ export function findAssumption(data, id) {
31
+ return data.assumptions.find((a) => a.id === id);
32
+ }
33
+ //# sourceMappingURL=assumptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assumptions.js","sourceRoot":"","sources":["../../../src/phases/aggregate/assumptions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,MAAM,UAAU,cAAc,CAC5B,IAAe,EACf,KAAmF,EACnF,UAAU,GAAG,qBAAqB,CAAC,WAAW,EAC9C,SAA2B,aAAa,EACxC,MAAe;IAEf,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;YACpB,EAAE,EAAE,MAAM,CAAC,YAAY,EAAE,IAAI,CAAC,WAAW,CAAC;YAC1C,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,YAAY;YAC/B,MAAM;YACN,YAAY,EAAE,IAAI,CAAC,YAAY,IAAI,EAAE;YACrC,UAAU;YACV,GAAG,CAAC,MAAM,IAAI,EAAE,MAAM,EAAE,CAAC;SAC1B,CAAC,CAAC;IACL,CAAC;AACH,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,IAAe,EAAE,EAAU,EAAE,MAAwB;IACvF,MAAM,CAAC,GAAG,cAAc,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACnC,IAAI,CAAC,CAAC;QAAE,OAAO;IACf,CAAC,CAAC,MAAM,GAAG,MAAM,CAAC;IAClB,CAAC,CAAC,UAAU,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,IAAe,EAAE,GAAgB;IACjE,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACpE,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,IAAe,EAAE,EAAU;IACxD,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;AACnD,CAAC"}
@@ -0,0 +1,10 @@
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 type { Artifacts, Finding } from "../schema.js";
7
+ export declare function addDomainHints(data: Artifacts, hints: string[]): void;
8
+ export declare function addFinding(data: Artifacts, content: string, phase: string): void;
9
+ export declare function findingsByPhase(data: Artifacts, phase: string): Finding[];
10
+ //# sourceMappingURL=findings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"findings.d.ts","sourceRoot":"","sources":["../../../src/phases/aggregate/findings.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAGvD,wBAAgB,cAAc,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAErE;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAMhF;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,EAAE,CAEzE"}