agent-nuvira 3.1.3 → 3.2.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 (146) hide show
  1. package/dist/agents/agents/reasoner.d.ts +8 -0
  2. package/dist/agents/agents/reasoner.d.ts.map +1 -1
  3. package/dist/agents/agents/reasoner.js +53 -2
  4. package/dist/agents/agents/reasoner.js.map +1 -1
  5. package/dist/agents/agents/writer.d.ts +24 -0
  6. package/dist/agents/agents/writer.d.ts.map +1 -1
  7. package/dist/agents/agents/writer.js +194 -0
  8. package/dist/agents/agents/writer.js.map +1 -1
  9. package/dist/agents/composite-plan.d.ts +143 -0
  10. package/dist/agents/composite-plan.d.ts.map +1 -0
  11. package/dist/agents/composite-plan.js +399 -0
  12. package/dist/agents/composite-plan.js.map +1 -0
  13. package/dist/agents/long-form-plan.d.ts +156 -0
  14. package/dist/agents/long-form-plan.d.ts.map +1 -0
  15. package/dist/agents/long-form-plan.js +274 -0
  16. package/dist/agents/long-form-plan.js.map +1 -0
  17. package/dist/agents/orchestrator.d.ts +107 -0
  18. package/dist/agents/orchestrator.d.ts.map +1 -1
  19. package/dist/agents/orchestrator.js +501 -35
  20. package/dist/agents/orchestrator.js.map +1 -1
  21. package/dist/agents/prompt-assembly.d.ts +8 -0
  22. package/dist/agents/prompt-assembly.d.ts.map +1 -1
  23. package/dist/agents/prompt-assembly.js +17 -0
  24. package/dist/agents/prompt-assembly.js.map +1 -1
  25. package/dist/cli/chat.d.ts +27 -0
  26. package/dist/cli/chat.d.ts.map +1 -1
  27. package/dist/cli/chat.js +116 -6
  28. package/dist/cli/chat.js.map +1 -1
  29. package/dist/cli/execute.d.ts +12 -0
  30. package/dist/cli/execute.d.ts.map +1 -1
  31. package/dist/cli/execute.js +105 -2
  32. package/dist/cli/execute.js.map +1 -1
  33. package/dist/cli/models.d.ts.map +1 -1
  34. package/dist/cli/models.js +10 -0
  35. package/dist/cli/models.js.map +1 -1
  36. package/dist/cli/trace.d.ts.map +1 -1
  37. package/dist/cli/trace.js +27 -0
  38. package/dist/cli/trace.js.map +1 -1
  39. package/dist/gateway/registry.d.ts +31 -0
  40. package/dist/gateway/registry.d.ts.map +1 -1
  41. package/dist/gateway/registry.js +143 -13
  42. package/dist/gateway/registry.js.map +1 -1
  43. package/dist/inference/model-entitlement.d.ts +46 -0
  44. package/dist/inference/model-entitlement.d.ts.map +1 -0
  45. package/dist/inference/model-entitlement.js +98 -0
  46. package/dist/inference/model-entitlement.js.map +1 -0
  47. package/dist/learning/autonomy-policy.d.ts +334 -0
  48. package/dist/learning/autonomy-policy.d.ts.map +1 -0
  49. package/dist/learning/autonomy-policy.js +500 -0
  50. package/dist/learning/autonomy-policy.js.map +1 -0
  51. package/dist/learning/credential-fingerprint.d.ts +58 -0
  52. package/dist/learning/credential-fingerprint.d.ts.map +1 -0
  53. package/dist/learning/credential-fingerprint.js +126 -0
  54. package/dist/learning/credential-fingerprint.js.map +1 -0
  55. package/dist/learning/deliverable-class.d.ts +130 -0
  56. package/dist/learning/deliverable-class.d.ts.map +1 -0
  57. package/dist/learning/deliverable-class.js +432 -0
  58. package/dist/learning/deliverable-class.js.map +1 -0
  59. package/dist/learning/long-form.d.ts +252 -0
  60. package/dist/learning/long-form.d.ts.map +1 -0
  61. package/dist/learning/long-form.js +510 -0
  62. package/dist/learning/long-form.js.map +1 -0
  63. package/dist/learning/model-first-router.d.ts +17 -0
  64. package/dist/learning/model-first-router.d.ts.map +1 -1
  65. package/dist/learning/model-first-router.js +27 -0
  66. package/dist/learning/model-first-router.js.map +1 -1
  67. package/dist/learning/model-registry.d.ts +66 -4
  68. package/dist/learning/model-registry.d.ts.map +1 -1
  69. package/dist/learning/model-registry.js +67 -6
  70. package/dist/learning/model-registry.js.map +1 -1
  71. package/dist/learning/model-warmup.d.ts +97 -2
  72. package/dist/learning/model-warmup.d.ts.map +1 -1
  73. package/dist/learning/model-warmup.js +165 -60
  74. package/dist/learning/model-warmup.js.map +1 -1
  75. package/dist/learning/prompt-layers.d.ts +61 -0
  76. package/dist/learning/prompt-layers.d.ts.map +1 -0
  77. package/dist/learning/prompt-layers.js +140 -0
  78. package/dist/learning/prompt-layers.js.map +1 -0
  79. package/dist/learning/provider-limits.d.ts +66 -0
  80. package/dist/learning/provider-limits.d.ts.map +1 -0
  81. package/dist/learning/provider-limits.js +184 -0
  82. package/dist/learning/provider-limits.js.map +1 -0
  83. package/dist/learning/reasoning-trace.d.ts +36 -1
  84. package/dist/learning/reasoning-trace.d.ts.map +1 -1
  85. package/dist/learning/reasoning-trace.js +36 -2
  86. package/dist/learning/reasoning-trace.js.map +1 -1
  87. package/dist/learning/resilient-call.d.ts +36 -1
  88. package/dist/learning/resilient-call.d.ts.map +1 -1
  89. package/dist/learning/resilient-call.js +80 -5
  90. package/dist/learning/resilient-call.js.map +1 -1
  91. package/dist/learning/unattended-job.d.ts +293 -0
  92. package/dist/learning/unattended-job.d.ts.map +1 -0
  93. package/dist/learning/unattended-job.js +544 -0
  94. package/dist/learning/unattended-job.js.map +1 -0
  95. package/dist/learning/unattended-progress.d.ts +95 -0
  96. package/dist/learning/unattended-progress.d.ts.map +1 -0
  97. package/dist/learning/unattended-progress.js +147 -0
  98. package/dist/learning/unattended-progress.js.map +1 -0
  99. package/dist/learning/working-state.d.ts +109 -0
  100. package/dist/learning/working-state.d.ts.map +1 -0
  101. package/dist/learning/working-state.js +244 -0
  102. package/dist/learning/working-state.js.map +1 -0
  103. package/dist/nlu/conversation-gate.d.ts +24 -0
  104. package/dist/nlu/conversation-gate.d.ts.map +1 -1
  105. package/dist/nlu/conversation-gate.js +47 -3
  106. package/dist/nlu/conversation-gate.js.map +1 -1
  107. package/dist/tools/coding-tools.d.ts.map +1 -1
  108. package/dist/tools/coding-tools.js +95 -19
  109. package/dist/tools/coding-tools.js.map +1 -1
  110. package/dist/tools/edit-verification.d.ts +125 -0
  111. package/dist/tools/edit-verification.d.ts.map +1 -0
  112. package/dist/tools/edit-verification.js +237 -0
  113. package/dist/tools/edit-verification.js.map +1 -0
  114. package/dist/tools/git-tool.d.ts.map +1 -1
  115. package/dist/tools/git-tool.js +37 -4
  116. package/dist/tools/git-tool.js.map +1 -1
  117. package/dist/tools/registry.d.ts +30 -2
  118. package/dist/tools/registry.d.ts.map +1 -1
  119. package/dist/tools/registry.js +40 -11
  120. package/dist/tools/registry.js.map +1 -1
  121. package/dist/tools/run-cli.d.ts.map +1 -1
  122. package/dist/tools/run-cli.js +40 -13
  123. package/dist/tools/run-cli.js.map +1 -1
  124. package/dist/tools/run-terminal.d.ts +6 -1
  125. package/dist/tools/run-terminal.d.ts.map +1 -1
  126. package/dist/tools/run-terminal.js +158 -18
  127. package/dist/tools/run-terminal.js.map +1 -1
  128. package/dist/tools/tool-loop.d.ts +35 -0
  129. package/dist/tools/tool-loop.d.ts.map +1 -1
  130. package/dist/tools/tool-loop.js +141 -1
  131. package/dist/tools/tool-loop.js.map +1 -1
  132. package/dist/web-dashboard/chat-console.d.ts +6 -0
  133. package/dist/web-dashboard/chat-console.d.ts.map +1 -1
  134. package/dist/web-dashboard/chat-console.js.map +1 -1
  135. package/dist/web-dashboard/chat-retry.d.ts.map +1 -1
  136. package/dist/web-dashboard/chat-retry.js +10 -2
  137. package/dist/web-dashboard/chat-retry.js.map +1 -1
  138. package/dist/web-dashboard/server.d.ts.map +1 -1
  139. package/dist/web-dashboard/server.js +80 -8
  140. package/dist/web-dashboard/server.js.map +1 -1
  141. package/dist/web-dashboard/src/types.d.ts +81 -4
  142. package/dist/web-dashboard/src/types.d.ts.map +1 -1
  143. package/package.json +1 -1
  144. package/src/web-dashboard/public/assets/{index-Co7Hk2FT.js → index-kCUkORm7.js} +2 -2
  145. package/src/web-dashboard/public/assets/{index-Co7Hk2FT.js.map → index-kCUkORm7.js.map} +1 -1
  146. package/src/web-dashboard/public/index.html +1 -1
@@ -0,0 +1,432 @@
1
+ /**
2
+ * Deliverable classification — what KIND of thing did the user actually ask
3
+ * for? (enterprise-grade hardening, G7.)
4
+ *
5
+ * WHY THIS EXISTS (the WhatsApp story audit):
6
+ * A user asked, over WhatsApp, for a 100-page Harry-Potter-style story as a
7
+ * PDF. Six orchestrator runs over 32 minutes ALL failed, and the reason was
8
+ * not model availability (507 models were eligible). The reasoner — the
9
+ * technical-decision layer that runs BEFORE the planner — read "write a story"
10
+ * and emitted:
11
+ *
12
+ * {"language":"python","framework":"none","deliverable":"markdown_file",
13
+ * "reasoning":"…a Python script is the most efficient way to read existing
14
+ * chapters, process the outline, and update the target file…"}
15
+ *
16
+ * The planner then produced ZERO prose steps: step-02 was "Create a Python
17
+ * script to append the story continuation", step-03 "Run the Python script".
18
+ * The agent built a TOOL to write the story instead of writing the story, and
19
+ * because the tool-creation step itself failed, nothing was written at all —
20
+ * the target directory did not exist afterwards.
21
+ *
22
+ * The decision layer had no vocabulary for authored work: every branch of its
23
+ * taxonomy (language/framework/buildCommand/architecture/deliverable) assumes
24
+ * the deliverable is a PROGRAM. So a creative ask could only ever be expressed
25
+ * as a program that emits the creative artifact.
26
+ *
27
+ * This module is the missing vocabulary. It is deliberately DETERMINISTIC and
28
+ * LLM-free — the classifier is a safety net that the LLM's own decision is
29
+ * checked against, so a weak model cannot reintroduce the category error. It
30
+ * runs on the raw goal before planning, and for `document`/`creative` the
31
+ * orchestrator plans SECTIONS instead of a program.
32
+ */
33
+ /**
34
+ * Below this the verdict is a hint, not a ruling: the caller keeps the LLM's
35
+ * own decision. Set high enough that a passing mention ("write a report about
36
+ * the API I built") cannot hijack a genuine engineering task.
37
+ */
38
+ export const AUTHORED_CONFIDENCE_FLOOR = 0.55;
39
+ // ─── Signal tables ──────────────────────────────────────────────────────────
40
+ /**
41
+ * Creative-authoring signals. These are nouns that name an authored artifact
42
+ * or its parts. Deliberately includes Hindi/Hinglish spellings — the failing
43
+ * session was conducted in Hindi over WhatsApp (कहानी / उपन्यास), and an
44
+ * English-only detector would have missed the entire task.
45
+ */
46
+ const CREATIVE_SIGNALS = [
47
+ [/\b(short\s+story|story|stories|kahani|kahaani)\b/i, 3],
48
+ [/\b(novel|novella|fiction|fictional|tale|fairy\s+tale|saga|legend|myth)\b/i, 3],
49
+ [/\b(book|pustak|पुस्तक|किताब)\b/i, 3],
50
+ [/\b(chapter|chapters|prologue|epilogue|verse|stanza)\b/i, 3],
51
+ [/\b(poem|poetry|poem|song|lyrics|sonnet|haiku|ghazal)\b/i, 3],
52
+ [/\b(screenplay|teleplay|script\s+for\s+a|short\s+film\s+script|narrative)\b/i, 3],
53
+ [/\b(protagonist|antagonist|plot|storyline|character\s+arc|world[- ]building)\b/i, 2],
54
+ [/कहानी|उपन्यास|कविता|कथा|पात्र|अध्याय/, 3],
55
+ [/\b(write|writes|writing|draft|author|compose|continue|expand)\b[^.]{0,40}\b(story|novel|book|chapter|poem|poetry|tale|saga|screenplay|कहानी|उपन्यास)\b/i, 2],
56
+ [/\b(harry\s+potter|fantasy|magical|magic\s+and\s+suspense)\b/i, 1],
57
+ ];
58
+ /** Long-form document signals (authored, but non-fiction). */
59
+ const DOCUMENT_SIGNALS = [
60
+ [/\b(report|whitepaper|white\s+paper|thesis|dissertation|essay|article|blog\s+post)\b/i, 3],
61
+ [/\b(proposal|business\s+plan|case\s+study|literature\s+review|user\s+manual|handbook)\b/i, 3],
62
+ [/\b(letter|cover\s+letter|resume|cv|memo|minutes|newsletter|speech|presentation\s+notes)\b/i, 3],
63
+ [/\b(document|documentation|guide|tutorial|readme)\b[^.]{0,30}\b(write|draft|author|create|prepare|compose)\b/i, 3],
64
+ [/\b(write|writes|writing|draft|author|compose|prepare)\b[^.]{0,30}\b(document|documentation|guide|tutorial|report|essay|article|blog\s+post|letter|chapter)\b/i, 2],
65
+ [/\b(रिपोर्ट|निबंध|लेख|पत्र)\b/, 3],
66
+ ];
67
+ /** Data-analysis signals. */
68
+ const DATA_SIGNALS = [
69
+ [/\b(csv|xlsx|spreadsheet|dataset|dataframe|data\s+set)\b/i, 2],
70
+ [/\b(analy[sz]e|aggregate|pivot|visuali[sz]e|plot|chart|dashboard)\b[^.]{0,30}\b(data|csv|numbers|sales|metrics)\b/i, 3],
71
+ [/\b(correlation|regression|statistics|statistical|trend\s+analysis|forecast)\b/i, 3],
72
+ ];
73
+ /** Research signals — a question to be answered, not an artifact to be built. */
74
+ const RESEARCH_SIGNALS = [
75
+ [/\b(research|survey|investigate|literature|state\s+of\s+the\s+art|compare|comparison)\b/i, 2],
76
+ [/\b(compare|comparison|pros\s+and\s+cons|trade[- ]offs?)\b[^.]{0,60}\b(options|providers|tools|frameworks|libraries|approaches)\b/i, 3],
77
+ [/\b(competitive\s+analysis|market\s+analysis|feasibility\s+study)\b/i, 3],
78
+ ];
79
+ /**
80
+ * Software signals. These are the strongest evidence available, because the
81
+ * overwhelming majority of goals are engineering asks and a false positive
82
+ * here would be a regression. Note the deliberate absence of bare "create" or
83
+ * "build" — those are verbs that appear in EVERY goal ("build me a story") and
84
+ * carry no class information on their own.
85
+ */
86
+ const CODE_SIGNALS = [
87
+ [/\b(app|application|web\s?app|website|web\s+site|landing\s+page|frontend|front[- ]end)\b/i, 3],
88
+ [/\b(api|endpoint|backend|back[- ]end|microservice|server|graphql|rest\s+api)\b/i, 3],
89
+ // NOTE: bare `class` is deliberately NOT a signal — it is ordinary English
90
+ // ("a book for a class 4 student") and reading it as a software noun flipped
91
+ // an authored ask onto the code path. Real class declarations arrive with
92
+ // language/file signals alongside them.
93
+ [/\b(script|program|function|module|package|library|framework|sdk|cli|command[- ]line)\b/i, 3],
94
+ [/\b(component|react|vue|angular|svelte|next\.?js|node|express|django|flask|fastapi|spring)\b/i, 3],
95
+ [/\b(unit\s+test|test\s+suite|integration\s+test|e2e\s+test)\b/i, 3],
96
+ [/\b(refactor|debug|fix\s+(the\s+)?(bug|error|issue|crash)|migrate|optimize\s+performance)\b/i, 3],
97
+ [/\b(database|schema|sql|postgres|mysql|mongodb|query\s+optimization|dockerfile|kubernetes|terraform)\b/i, 3],
98
+ [/\b(repo|repository|codebase|pull\s+request|commit|deploy|ci\/cd|pipeline)\b/i, 2],
99
+ [/\b(\.ts|\.js|\.py|\.go|\.rs|\.java|\.cs|\.rb|\.html|\.css)\b/, 2],
100
+ [/\b(python|typescript|javascript|golang|rust|c\+\+|c#|java|kotlin|swift|php|ruby|scala)\b/i, 3],
101
+ ];
102
+ /**
103
+ * Web/experience signals: the deliverable must be USED in a browser.
104
+ *
105
+ * Deliberately excludes the bare word "page" — the verbatim 100-page story
106
+ * request says "page" and nothing about a site, and reading that as `web` would
107
+ * have turned a book into a web app. "web page" is matched; "page" is not.
108
+ */
109
+ const WEB_SIGNALS = [
110
+ /\b(web[- ]?based|web\s?app|website|web\s+site|webpage|web\s+page|inline\s+site|static\s+site)\b/i,
111
+ /\b(interactive|interactivity|browser|in\s+the\s+browser|clickable|navigable|flip\s?book)\b/i,
112
+ /\b(html|css|javascript|typescript|react|vue|svelte|next\.?js|frontend|front[- ]end|ui|reader|player)\b/i,
113
+ ];
114
+ /** Signals that the ask wants a runtime/service layer (a script, a server). */
115
+ const PYTHON_SIGNALS = [
116
+ /\b(python|flask|fastapi|django|streamlit|jupyter|pip|venv)\b/i,
117
+ /\b(text[- ]to[- ]speech|tts|speech\s+synthesis|narration|narrate|voice[- ]?over|audiobook|read\s+aloud)\b/i,
118
+ /\b(gtts|pyttsx|elevenlabs|whisper|edge[- ]?tts|openai\s+tts|amazon\s+polly)\b/i,
119
+ ];
120
+ /** Media the deliverable ships with (audio, illustrations, cover art). */
121
+ const ASSET_SIGNALS = [
122
+ /\b(audio|mp3|wav|narration|voice|sound|music|listen)\b/i,
123
+ /\b(illustration|illustrations|image|images|artwork|cover\s+art|diagram|chart|infographic)\b/i,
124
+ ];
125
+ // NOTE: `pdf|epub|docx` were REMOVED from this table on purpose. A PDF export is
126
+ // a FORMAT the same content is emitted in, not a second thing to build — and
127
+ // reading it as a substrate made the verbatim 100-page request ("…appreciate if
128
+ // a pdf is created…") classify as a composite deliverable, which would have
129
+ // planned a shell around a book that had not been written yet.
130
+ /**
131
+ * Phrases that invert the class of the words around them: the goal is about a
132
+ * program that MANIPULATES the named artifact, not the artifact itself.
133
+ * e.g. "convert this PDF to text", "parse the story file", "a script that
134
+ * writes PDFs". Without this, "create a PDF exporter" would read as authored.
135
+ */
136
+ const CODE_INTENT_OVERRIDES = [
137
+ /\b(convert|parse|extract|scrape|index|upload|download|render|export|import)\b[^.]{0,40}\b(pdf|docx|csv|md|markdown|story|document)\b/i,
138
+ /\b(pdf|docx|markdown|document)\b[^.]{0,30}\b(generator|exporter|parser|converter|to\s+(text|html|markdown))\b/i,
139
+ /\b(script|program|tool|utility|function|pipeline)\b[^.]{0,30}\b(that|which|to)\b[^.]{0,30}\b(generat|writ|convert|parse|extract)/i,
140
+ ];
141
+ // ─── Classification ─────────────────────────────────────────────────────────
142
+ /** Score one table against the goal, collecting the matched signals. */
143
+ function scoreTable(goal, table, label, signals) {
144
+ let score = 0;
145
+ for (const [re, weight] of table) {
146
+ const m = goal.match(re);
147
+ if (m) {
148
+ score += weight;
149
+ signals.push(`${label}:${m[0].trim().slice(0, 40)}`);
150
+ }
151
+ }
152
+ return score;
153
+ }
154
+ /**
155
+ * Classify a goal into a deliverable class.
156
+ *
157
+ * Scoring is additive with per-signal weights rather than first-match, so a
158
+ * goal that mixes signals ("write a story AND package it as a CLI") resolves
159
+ * on the balance of evidence. Confidence is derived from the winning margin,
160
+ * so a clear call scores high and a coin-flip stays low — which is exactly
161
+ * what the caller needs to decide whether to override the LLM.
162
+ *
163
+ * Defaults to `code` when nothing matches: that preserves today's behaviour
164
+ * for every goal this module does not understand.
165
+ */
166
+ export function classifyDeliverable(goal) {
167
+ const g = (goal || '').trim();
168
+ if (!g)
169
+ return emptyVerdict();
170
+ const signals = [];
171
+ const scores = {
172
+ creative: scoreTable(g, CREATIVE_SIGNALS, 'creative', signals),
173
+ document: scoreTable(g, DOCUMENT_SIGNALS, 'document', signals),
174
+ data: scoreTable(g, DATA_SIGNALS, 'data', signals),
175
+ research: scoreTable(g, RESEARCH_SIGNALS, 'research', signals),
176
+ code: scoreTable(g, CODE_SIGNALS, 'code', signals),
177
+ };
178
+ // A code-intent phrase means the software signal describes TOOLING around an
179
+ // artifact, not an authored deliverable: strengthen `code` accordingly.
180
+ const override = CODE_INTENT_OVERRIDES.find((re) => re.test(g));
181
+ if (override) {
182
+ scores.code += 4;
183
+ signals.push(`code-intent-override:${override.source.slice(0, 30)}`);
184
+ }
185
+ // Authored content is ONE deliverable, so the two authored tables reinforce
186
+ // each other rather than competing: a goal that says "story ... chapters"
187
+ // scores creative 6+, and "report ... write" scores document 5+.
188
+ const authoredScore = scores.creative + scores.document;
189
+ // Ordered by score, then by a fixed priority so ties are deterministic.
190
+ const priority = ['code', 'creative', 'document', 'data', 'research'];
191
+ let winner = 'code';
192
+ let best = -1;
193
+ for (const cls of priority) {
194
+ if (scores[cls] > best) {
195
+ best = scores[cls];
196
+ winner = cls;
197
+ }
198
+ }
199
+ const total = Object.values(scores).reduce((a, b) => a + b, 0);
200
+ if (best <= 0 || total === 0) {
201
+ return { ...emptyVerdict(), signals };
202
+ }
203
+ // Margin-based confidence: a dominant winner approaches 1, a tie sits near
204
+ // 0.5. The authored bonus nudges a strongly-authored goal over the floor.
205
+ const second = Math.max(...priority.filter((c) => c !== winner).map((c) => scores[c]), 0);
206
+ const margin = (best - second) / Math.max(best, 1);
207
+ let confidence = 0.5 + margin / 2;
208
+ if (authoredScore >= 5 && (winner === 'creative' || winner === 'document')) {
209
+ confidence = Math.max(confidence, 0.7);
210
+ }
211
+ confidence = Math.min(1, Math.round(confidence * 100) / 100);
212
+ // Two independent ways to be an authored deliverable:
213
+ //
214
+ // 1. the CLASS is authored (strong authored margin, confidence over the
215
+ // floor);
216
+ // 2. the ARTIFACT is named and the ask wants a presentation layer for it.
217
+ // This second path exists because a hybrid ask scores on BOTH tables —
218
+ // "an interactive website with a 50-page story and a python narration
219
+ // script" scores creative 8 and code 9 (website 3 + script 3 + python 3),
220
+ // so the class lands on `code` even though the user named a story as the
221
+ // deliverable. A named authored artifact outranks generic implementation
222
+ // nouns; the presentation layer is HOW they want it delivered.
223
+ const authoredByClass = (winner === 'creative' || winner === 'document') &&
224
+ authoredScore >= 3 &&
225
+ confidence >= AUTHORED_CONFIDENCE_FLOOR;
226
+ const flags = substrateFlags(g);
227
+ const hybridArtifact = authoredScore >= 6 && (flags.web || flags.python) && !override && winner === 'code';
228
+ const authored = authoredByClass || hybridArtifact;
229
+ const { substrates, composite, interactive } = classifySubstrates(g, {
230
+ authored,
231
+ winner,
232
+ codeIntent: !!override,
233
+ flags,
234
+ });
235
+ if (composite)
236
+ signals.push(`composite:${substrates.join('+')}`);
237
+ if (interactive)
238
+ signals.push('interactive');
239
+ return { class: winner, confidence, signals, authored, substrates, composite, interactive };
240
+ }
241
+ /** The "nothing matched" verdict — one shape, built in one place. */
242
+ function emptyVerdict() {
243
+ return { class: 'code', confidence: 0, signals: [], authored: false, substrates: ['web'], composite: false, interactive: false };
244
+ }
245
+ /** Which secondary materials the ask names (computed once, reused). */
246
+ function substrateFlags(goal) {
247
+ return {
248
+ web: WEB_SIGNALS.some((re) => re.test(goal)),
249
+ python: PYTHON_SIGNALS.some((re) => re.test(goal)),
250
+ asset: ASSET_SIGNALS.some((re) => re.test(goal)),
251
+ };
252
+ }
253
+ /**
254
+ * Work out WHAT the deliverable is made of, and whether that is plural.
255
+ *
256
+ * The rules, in order, because the ordering is the whole design:
257
+ *
258
+ * 1. The class verdict is the spine. Authored work is `prose`; software is
259
+ * reported by what it runs on (`web` for anything browser-facing, else
260
+ * `python` when the ask names a Python runtime, else `web` as the neutral
261
+ * default for a program with no stated runtime).
262
+ * 2. Authored work ADDS substrates rather than replacing them: a goal that is
263
+ * both prose and web is `['web', 'prose']`. This is what makes "a web-based
264
+ * book" a hybrid instead of a coin flip.
265
+ * 3. `python` is recorded as its own substrate when a runtime/service was
266
+ * named, so the plan can create the script AND check that the site still
267
+ * works without it. A Python narration service must never be the only path
268
+ * to listening — a page that needs `pip install` before it does anything is
269
+ * not an enterprise deliverable.
270
+ * 4. A CODE-INTENT override means the code signals describe tooling AROUND an
271
+ * artifact ("a script that writes PDFs"): the artifacts are inputs, not
272
+ * substrates, so no authored substrate is added.
273
+ */
274
+ function classifySubstrates(goal, ctx) {
275
+ const wantsWeb = ctx.flags.web;
276
+ const wantsPython = ctx.flags.python;
277
+ const wantsAsset = ctx.flags.asset;
278
+ const wantsData = ctx.winner === 'data';
279
+ const substrates = [];
280
+ const push = (s) => {
281
+ if (!substrates.includes(s))
282
+ substrates.push(s);
283
+ };
284
+ // The primary substrate, from the class verdict.
285
+ if (ctx.authored)
286
+ push('prose');
287
+ else if (wantsData)
288
+ push('data');
289
+ else if (ctx.winner === 'research')
290
+ push('web');
291
+ else if (wantsPython && !wantsWeb)
292
+ push('python');
293
+ else
294
+ push('web');
295
+ // Secondary materials. Only authored work gets these as ADDITIONS — for a
296
+ // pure software ask they merely refine the single primary substrate.
297
+ if (ctx.authored && !ctx.codeIntent) {
298
+ if (wantsWeb)
299
+ push('web');
300
+ if (wantsPython)
301
+ push('python');
302
+ if (wantsAsset)
303
+ push('asset');
304
+ }
305
+ else if (!ctx.authored) {
306
+ if (wantsWeb)
307
+ push('web');
308
+ if (wantsPython)
309
+ push('python');
310
+ }
311
+ if (substrates.length === 0)
312
+ substrates.push('web');
313
+ // COMPOSITE means "authored content AND a way to experience it" — NOT merely
314
+ // "two runtimes". A React front-end over a Python API is multi-substrate but
315
+ // it is an application, and the ordinary code planner plans those correctly;
316
+ // treating it as composite would route it into the phase planner, which is
317
+ // only there for content-plus-presentation work.
318
+ const composite = ctx.authored && substrates.length > 1;
319
+ // "Experienced, not just read": a site to navigate or narration to play.
320
+ // MERELY shipping a PDF is not interactive — it is a document.
321
+ const audioAsked = /\b(audio|mp3|wav|narration|narrate|voice[- ]?over|listen|read\s+aloud|text[- ]to[- ]speech|tts)\b/i.test(goal);
322
+ const interactive = substrates.includes('web') || audioAsked;
323
+ return { substrates, composite, interactive };
324
+ }
325
+ /**
326
+ * Convenience: is this goal asking for authored content (prose) rather than a
327
+ * program? The orchestrator uses this one predicate to switch planning modes.
328
+ */
329
+ export function isAuthoredGoal(goal) {
330
+ return classifyDeliverable(goal).authored;
331
+ }
332
+ /**
333
+ * Is this a HYBRID deliverable — content plus a way to experience it?
334
+ *
335
+ * The orchestrator uses this one predicate to switch from "plan the content" to
336
+ * "plan the phases" (scaffold → content → experience → assets → verify). Kept
337
+ * here rather than in the planner so the intent vocabulary lives in one place.
338
+ */
339
+ export function isCompositeGoal(goal) {
340
+ return classifyDeliverable(goal).composite;
341
+ }
342
+ /** Human-readable substrate list, for logs, traces and prompts. */
343
+ export function describeSubstrates(verdict) {
344
+ return verdict.substrates.join(' + ');
345
+ }
346
+ /** Human-readable label for logs, traces and prompts. */
347
+ export function deliverableClassLabel(cls) {
348
+ switch (cls) {
349
+ case 'creative':
350
+ return 'creative writing (an authored work)';
351
+ case 'document':
352
+ return 'an authored document (non-fiction)';
353
+ case 'data':
354
+ return 'data analysis';
355
+ case 'research':
356
+ return 'research / comparison';
357
+ default:
358
+ return 'software';
359
+ }
360
+ }
361
+ /**
362
+ * The instruction handed to the reasoner so its technical-decision document
363
+ * stops pretending an authored ask is a program.
364
+ *
365
+ * This is the fix for the exact reasoning string the audit captured
366
+ * ("a Python script is the most efficient way to…"): the reasoner is told, in
367
+ * its own JSON vocabulary, that `language` must NOT be a programming language
368
+ * for these classes, and that building a generator is the wrong deliverable.
369
+ */
370
+ export function authoredDeliverableGuidance(cls, substrates) {
371
+ if (cls !== 'creative' && cls !== 'document')
372
+ return '';
373
+ const noun = cls === 'creative' ? 'story/novel/poem' : 'report/essay/document';
374
+ return [
375
+ '',
376
+ `## ⚠️ DELIVERABLE CLASS: ${deliverableClassLabel(cls)}`,
377
+ `The user is asking for the CONTENT ITSELF — a ${noun} — not a program that`,
378
+ 'produces it. This is already decided and is NOT yours to renegotiate.',
379
+ '',
380
+ 'Consequences for your JSON decision:',
381
+ '- `language`: "none" (there is no programming language involved)',
382
+ '- `framework`: "none"',
383
+ '- `platform`: "document"',
384
+ '- `architecture`: "sections"',
385
+ '- `dependencies`: []',
386
+ '- `buildCommand`: omit it',
387
+ '- `deliverable`: the artifact the user named (e.g. "markdown_file", "pdf")',
388
+ '',
389
+ 'You MUST NOT plan a script, tool, or generator that would write the content.',
390
+ 'Writing the content IS the task. A script that calls an LLM to write it is a',
391
+ 'non-delivery: the user asked for the work, not for a machine that could do it.',
392
+ '',
393
+ 'Constraints should cover: target length (pages/words/chapters), continuity',
394
+ 'with any existing content, and the destination path.',
395
+ ...(substrates && substrates.length > 1 ? compositeGuidance(substrates) : []),
396
+ ].join('\n');
397
+ }
398
+ /**
399
+ * The extra instructions for a HYBRID authored ask.
400
+ *
401
+ * The two failure modes this closes are opposites, and both were live:
402
+ * - building the PRESENTATION and forgetting the CONTENT (a beautiful empty
403
+ * reader — the same non-delivery as the Python script, one layer up);
404
+ * - shipping the content with no way to experience it (a markdown file for an
405
+ * ask that said "web-based" and "interactive").
406
+ * The guidance therefore names BOTH, and pins the ordering: content first.
407
+ */
408
+ function compositeGuidance(substrates) {
409
+ const lines = [
410
+ '',
411
+ '## ⚠️ THIS IS A HYBRID DELIVERABLE',
412
+ `It is made of MORE THAN ONE thing: ${substrates.join(' + ')}. All of it is`,
413
+ 'required. A site with no content, or content with no site, is a NON-DELIVERY.',
414
+ '',
415
+ 'How the pieces relate (do not invert this):',
416
+ ];
417
+ if (substrates.includes('prose')) {
418
+ lines.push('- The WRITTEN WORK is the deliverable. Everything else presents it.');
419
+ }
420
+ if (substrates.includes('web')) {
421
+ lines.push('- The web layer must work by opening a local file — no install, no build', ' step, no server required. Anything that needs `npm install` before it', ' shows a single word is not the deliverable the user asked for.');
422
+ }
423
+ if (substrates.includes('python')) {
424
+ lines.push('- A Python/service component is an OPTIONAL ENHANCEMENT, never the only', ' path. The deliverable must be complete and usable without it (e.g. a', ' browser-based speech path alongside an optional high-quality TTS script).');
425
+ }
426
+ if (substrates.includes('asset')) {
427
+ lines.push('- Any media the ask names must be generated or produced, not merely referenced.');
428
+ }
429
+ lines.push('', 'Plan the phases in dependency order: shape first, content second, the', 'experience layer third, optional services last, a verification step at the end.');
430
+ return lines;
431
+ }
432
+ //# sourceMappingURL=deliverable-class.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deliverable-class.js","sourceRoot":"","sources":["../../src/learning/deliverable-class.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AA0DH;;;;GAIG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,IAAI,CAAC;AAE9C,+EAA+E;AAE/E;;;;;GAKG;AACH,MAAM,gBAAgB,GAA4B;IAChD,CAAC,mDAAmD,EAAE,CAAC,CAAC;IACxD,CAAC,2EAA2E,EAAE,CAAC,CAAC;IAChF,CAAC,iCAAiC,EAAE,CAAC,CAAC;IACtC,CAAC,wDAAwD,EAAE,CAAC,CAAC;IAC7D,CAAC,yDAAyD,EAAE,CAAC,CAAC;IAC9D,CAAC,6EAA6E,EAAE,CAAC,CAAC;IAClF,CAAC,gFAAgF,EAAE,CAAC,CAAC;IACrF,CAAC,sCAAsC,EAAE,CAAC,CAAC;IAC3C,CAAC,yJAAyJ,EAAE,CAAC,CAAC;IAC9J,CAAC,8DAA8D,EAAE,CAAC,CAAC;CACpE,CAAC;AAEF,8DAA8D;AAC9D,MAAM,gBAAgB,GAA4B;IAChD,CAAC,sFAAsF,EAAE,CAAC,CAAC;IAC3F,CAAC,yFAAyF,EAAE,CAAC,CAAC;IAC9F,CAAC,4FAA4F,EAAE,CAAC,CAAC;IACjG,CAAC,8GAA8G,EAAE,CAAC,CAAC;IACnH,CAAC,+JAA+J,EAAE,CAAC,CAAC;IACpK,CAAC,8BAA8B,EAAE,CAAC,CAAC;CACpC,CAAC;AAEF,6BAA6B;AAC7B,MAAM,YAAY,GAA4B;IAC5C,CAAC,0DAA0D,EAAE,CAAC,CAAC;IAC/D,CAAC,mHAAmH,EAAE,CAAC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