@ramplab/generator 0.1.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 (75) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +23 -0
  3. package/dist/agentSdkRunner.d.ts +64 -0
  4. package/dist/agentSdkRunner.d.ts.map +1 -0
  5. package/dist/agentSdkRunner.js +158 -0
  6. package/dist/agentSdkRunner.js.map +1 -0
  7. package/dist/assembleStage.d.ts +41 -0
  8. package/dist/assembleStage.d.ts.map +1 -0
  9. package/dist/assembleStage.js +33 -0
  10. package/dist/assembleStage.js.map +1 -0
  11. package/dist/authorStage.d.ts +123 -0
  12. package/dist/authorStage.d.ts.map +1 -0
  13. package/dist/authorStage.js +284 -0
  14. package/dist/authorStage.js.map +1 -0
  15. package/dist/cloneRepo.d.ts +72 -0
  16. package/dist/cloneRepo.d.ts.map +1 -0
  17. package/dist/cloneRepo.js +104 -0
  18. package/dist/cloneRepo.js.map +1 -0
  19. package/dist/flagship.d.ts +62 -0
  20. package/dist/flagship.d.ts.map +1 -0
  21. package/dist/flagship.js +216 -0
  22. package/dist/flagship.js.map +1 -0
  23. package/dist/generateLab.d.ts +151 -0
  24. package/dist/generateLab.d.ts.map +1 -0
  25. package/dist/generateLab.js +291 -0
  26. package/dist/generateLab.js.map +1 -0
  27. package/dist/index.d.ts +22 -0
  28. package/dist/index.d.ts.map +1 -0
  29. package/dist/index.js +21 -0
  30. package/dist/index.js.map +1 -0
  31. package/dist/intake.d.ts +31 -0
  32. package/dist/intake.d.ts.map +1 -0
  33. package/dist/intake.js +45 -0
  34. package/dist/intake.js.map +1 -0
  35. package/dist/live.d.ts +2 -0
  36. package/dist/live.d.ts.map +1 -0
  37. package/dist/live.js +213 -0
  38. package/dist/live.js.map +1 -0
  39. package/dist/mapStage.d.ts +84 -0
  40. package/dist/mapStage.d.ts.map +1 -0
  41. package/dist/mapStage.js +241 -0
  42. package/dist/mapStage.js.map +1 -0
  43. package/dist/pass1.d.ts +85 -0
  44. package/dist/pass1.d.ts.map +1 -0
  45. package/dist/pass1.js +81 -0
  46. package/dist/pass1.js.map +1 -0
  47. package/dist/pipeline.d.ts +73 -0
  48. package/dist/pipeline.d.ts.map +1 -0
  49. package/dist/pipeline.js +70 -0
  50. package/dist/pipeline.js.map +1 -0
  51. package/dist/planStage.d.ts +141 -0
  52. package/dist/planStage.d.ts.map +1 -0
  53. package/dist/planStage.js +275 -0
  54. package/dist/planStage.js.map +1 -0
  55. package/dist/progress.d.ts +45 -0
  56. package/dist/progress.d.ts.map +1 -0
  57. package/dist/progress.js +2 -0
  58. package/dist/progress.js.map +1 -0
  59. package/dist/repoCommit.d.ts +41 -0
  60. package/dist/repoCommit.d.ts.map +1 -0
  61. package/dist/repoCommit.js +84 -0
  62. package/dist/repoCommit.js.map +1 -0
  63. package/dist/repoSize.d.ts +23 -0
  64. package/dist/repoSize.d.ts.map +1 -0
  65. package/dist/repoSize.js +74 -0
  66. package/dist/repoSize.js.map +1 -0
  67. package/dist/resolveAnchors.d.ts +142 -0
  68. package/dist/resolveAnchors.d.ts.map +1 -0
  69. package/dist/resolveAnchors.js +242 -0
  70. package/dist/resolveAnchors.js.map +1 -0
  71. package/dist/verifyStage.d.ts +150 -0
  72. package/dist/verifyStage.d.ts.map +1 -0
  73. package/dist/verifyStage.js +461 -0
  74. package/dist/verifyStage.js.map +1 -0
  75. package/package.json +47 -0
@@ -0,0 +1,291 @@
1
+ import { statSync } from 'node:fs';
2
+ import { createAgentSdkRunner } from './agentSdkRunner.js';
3
+ import { assembleLab } from './assembleStage.js';
4
+ import { DEEP_WIDGET_RANGE, runAuthorStage } from './authorStage.js';
5
+ import { selectTraceFlagship } from './flagship.js';
6
+ import { runMapStage } from './mapStage.js';
7
+ import { resolveStageModels, } from './pipeline.js';
8
+ import { runPlanStage, } from './planStage.js';
9
+ import { measureRepo, plannedModulesFor } from './repoSize.js';
10
+ import { resolveAnchors, } from './resolveAnchors.js';
11
+ import { runVerifyStage } from './verifyStage.js';
12
+ export async function generateLab(repoDir, config = {}) {
13
+ assertDirectory(repoDir);
14
+ const models = resolveStageModels(config.models);
15
+ const runner = config.runner ?? createAgentSdkRunner();
16
+ const policy = config.resolutionPolicy ?? 'drop';
17
+ // The tracer predates the two-pass runtime and emits no events; only the
18
+ // full pipeline is "pass 2".
19
+ const emit = config.full === true ? config.onProgress : undefined;
20
+ const mapReused = config.mapResult !== undefined;
21
+ let mapResult;
22
+ if (config.mapResult !== undefined) {
23
+ mapResult = config.mapResult;
24
+ }
25
+ else {
26
+ emit?.({ type: 'stage-started', pass: 'pass2', stage: 'map' });
27
+ mapResult = await runMapStage(runner, repoDir, {
28
+ model: models.map,
29
+ ...(config.labId !== undefined ? { labId: config.labId } : {}),
30
+ ...(config.maxRetries !== undefined ? { maxRetries: config.maxRetries } : {}),
31
+ });
32
+ emit?.({ type: 'stage-completed', pass: 'pass2', stage: 'map' });
33
+ }
34
+ if (config.full !== true) {
35
+ const { spec, report } = resolveAnchors(mapResult.spec, repoDir, { policy });
36
+ return {
37
+ spec,
38
+ resolution: report,
39
+ models,
40
+ costUsd: mapResult.costUsd,
41
+ attempts: mapResult.attempts,
42
+ };
43
+ }
44
+ // First renderable snapshot: the overview module alone, anchor-resolved.
45
+ emit?.({
46
+ type: 'spec-updated',
47
+ pass: 'pass2',
48
+ spec: resolveAnchors(mapResult.spec, repoDir, { policy }).spec,
49
+ });
50
+ // The same mechanical trace selection pass 1 makes (see flagship.ts): the
51
+ // plan's module 1 is pinned to it, so pass 2's re-authoring of the trace
52
+ // stays canonical. Undefined when the map proposed no usable candidates
53
+ // (including old-shape reused map results) — the planner then picks its
54
+ // own front-door action.
55
+ const traceFlagship = selectTraceFlagship(mapResult.traceCandidates, config.intake);
56
+ // Right-size the plan to the repository unless the caller pinned a cap:
57
+ // a budget reads as a quota to the planner, so the cap must carry the
58
+ // size signal itself (5 to 8 chapters once the overview joins).
59
+ const budget = config.budget?.maxModules !== undefined
60
+ ? config.budget
61
+ : { ...config.budget, maxModules: plannedModulesFor(measureRepo(repoDir)) };
62
+ emit?.({ type: 'stage-started', pass: 'pass2', stage: 'plan' });
63
+ const planResult = await runPlanStage(runner, repoDir, {
64
+ model: models.plan,
65
+ mapSpec: mapResult.spec,
66
+ ...(traceFlagship !== undefined ? { traceModule: traceFlagship.plannedModule } : {}),
67
+ budget,
68
+ ...(config.intake !== undefined ? { intake: config.intake } : {}),
69
+ ...(config.maxRetries !== undefined ? { maxRetries: config.maxRetries } : {}),
70
+ });
71
+ emit?.({ type: 'stage-completed', pass: 'pass2', stage: 'plan' });
72
+ emit?.({ type: 'stage-started', pass: 'pass2', stage: 'author' });
73
+ // Live preview between the pass-boundary snapshots: after each authored
74
+ // module, assemble what exists so far and emit it. Authoring is the longest
75
+ // stretch of a pressing (15 of localsend's 31 minutes) and used to render
76
+ // nothing at all. Best-effort by design: a partial set that cannot
77
+ // assemble validly skips its snapshot, never the pressing.
78
+ const authoredSoFar = [];
79
+ const planOrder = new Map(planResult.plan.modules.map((m, i) => [m.id, i]));
80
+ // Bigger repos earn deeper chapters, not only more of them.
81
+ const widgetRange = budget.maxModules !== undefined && budget.maxModules >= 7 ? DEEP_WIDGET_RANGE : undefined;
82
+ const authorResult = await runAuthorStage(runner, repoDir, {
83
+ model: models.author,
84
+ plan: planResult.plan,
85
+ ...(widgetRange !== undefined ? { widgetRange } : {}),
86
+ ...(config.concurrency !== undefined ? { concurrency: config.concurrency } : {}),
87
+ ...(config.maxRetries !== undefined ? { maxRetries: config.maxRetries } : {}),
88
+ ...(emit !== undefined
89
+ ? {
90
+ onModuleAuthored: (authored) => {
91
+ emit({
92
+ type: 'module-authored',
93
+ pass: 'pass2',
94
+ moduleId: authored.module.id,
95
+ attempts: authored.attempts,
96
+ });
97
+ authoredSoFar.push(authored);
98
+ try {
99
+ const partial = assembleLab(mapResult.spec, [...authoredSoFar]
100
+ .sort((a, b) => (planOrder.get(a.module.id) ?? Number.MAX_SAFE_INTEGER) -
101
+ (planOrder.get(b.module.id) ?? Number.MAX_SAFE_INTEGER))
102
+ .map((m) => m.module), repoDir, { policy, leadModuleId: planResult.plan.modules[0]?.id });
103
+ emit({ type: 'spec-updated', pass: 'pass2', spec: partial.spec });
104
+ }
105
+ catch {
106
+ // an unassemblable partial set waits for the next module
107
+ }
108
+ },
109
+ }
110
+ : {}),
111
+ });
112
+ emit?.({ type: 'stage-completed', pass: 'pass2', stage: 'author' });
113
+ // The zoom-out chapter, re-authored (founder, 2026-07-26). The map stage
114
+ // assembles `repo-overview` mechanically — a system map plus callouts —
115
+ // before the flagship trace even exists, so it is the one chapter with no
116
+ // learner ledger, no capability callout and no quiz. Sitting at position 2,
117
+ // immediately after the trace, that broke the chain: the pedagogy judge
118
+ // docked BOTH of the criteria that have never scored 5, naming this module
119
+ // each time ("a generic, non-referential architecture overview that
120
+ // restates concepts at the same abstract altitude"; "Module 2 has no such
121
+ // statement, breaking the pattern"). Re-authoring it through the same stage
122
+ // as every other chapter gives it the ledger, the contracts, and the close.
123
+ const overviewSpec = await reauthorOverview(runner, repoDir, {
124
+ mapSpec: mapResult.spec,
125
+ plan: planResult.plan,
126
+ model: models.author,
127
+ ...(widgetRange !== undefined ? { widgetRange } : {}),
128
+ ...(config.maxRetries !== undefined ? { maxRetries: config.maxRetries } : {}),
129
+ ...(emit !== undefined
130
+ ? {
131
+ onAuthored: (authored) => emit({
132
+ type: 'module-authored',
133
+ pass: 'pass2',
134
+ moduleId: authored.module.id,
135
+ attempts: authored.attempts,
136
+ }),
137
+ }
138
+ : {}),
139
+ });
140
+ emit?.({ type: 'stage-started', pass: 'pass2', stage: 'assemble' });
141
+ // The plan's head is the opening trace by the plan-stage contract, so it
142
+ // leads the assembled lab; the overview follows as the zoom-out.
143
+ const { spec, report } = assembleLab(overviewSpec.spec, authorResult.modules.map((m) => m.module), repoDir, { policy, leadModuleId: planResult.plan.modules[0]?.id });
144
+ emit?.({ type: 'stage-completed', pass: 'pass2', stage: 'assemble' });
145
+ emit?.({ type: 'spec-updated', pass: 'pass2', spec });
146
+ // Adversarial verification: every claim that survived anchor resolution is
147
+ // checked against its anchored code; unverified claims are dropped. Units
148
+ // the `flag` policy deliberately kept for human review are skipped.
149
+ emit?.({ type: 'stage-started', pass: 'pass2', stage: 'verify' });
150
+ const verifyResult = await runVerifyStage(runner, repoDir, {
151
+ model: models.verify,
152
+ spec,
153
+ flaggedUnits: report.units
154
+ .filter((unit) => unit.outcome === 'flagged')
155
+ .map((unit) => ({ moduleId: unit.moduleId, widgetId: unit.widgetId })),
156
+ ...(config.concurrency !== undefined ? { concurrency: config.concurrency } : {}),
157
+ ...(config.maxRetries !== undefined ? { maxRetries: config.maxRetries } : {}),
158
+ });
159
+ emit?.({ type: 'stage-completed', pass: 'pass2', stage: 'verify' });
160
+ emit?.({ type: 'spec-updated', pass: 'pass2', spec: verifyResult.spec });
161
+ return {
162
+ spec: verifyResult.spec,
163
+ resolution: report,
164
+ models,
165
+ costUsd: sumCosts(
166
+ // A reused map's cost was paid (and reported) by the pass that ran it.
167
+ mapReused ? undefined : mapResult.costUsd, planResult.costUsd, authorResult.costUsd, overviewSpec.costUsd, verifyResult.costUsd),
168
+ attempts: mapResult.attempts,
169
+ plan: planResult.plan,
170
+ authorAttempts: Object.fromEntries([
171
+ ...authorResult.modules.map((m) => [m.module.id, m.attempts]),
172
+ ...(overviewSpec.attempts !== undefined
173
+ ? [[OVERVIEW_MODULE_ID, overviewSpec.attempts]]
174
+ : []),
175
+ ]),
176
+ verification: verifyResult.report,
177
+ verifyAttempts: verifyResult.attempts,
178
+ };
179
+ }
180
+ /** The map stage's zoom-out chapter — a stable id learner progress keys off. */
181
+ export const OVERVIEW_MODULE_ID = 'repo-overview';
182
+ /**
183
+ * Build the planned-module brief for the zoom-out chapter: what the reader
184
+ * already walked (the flagship trace's `teaches`), and what this chapter owes
185
+ * them. Exported for tests — the brief IS the fix, so it is worth pinning.
186
+ */
187
+ export function plannedOverviewModule(mapSpec, plan) {
188
+ const overview = mapSpec.base.modules.find((m) => m.id === OVERVIEW_MODULE_ID);
189
+ const trace = plan.modules[0];
190
+ if (overview === undefined || trace === undefined)
191
+ return undefined;
192
+ // Teach from what the map already found worth mapping: the files its system
193
+ // map anchors. No second exploration budget needed to know where to look.
194
+ const keyFiles = new Set();
195
+ for (const widget of overview.widgets) {
196
+ if (widget.type !== 'system-map')
197
+ continue;
198
+ for (const node of widget.nodes) {
199
+ for (const anchor of node.anchors ?? [])
200
+ keyFiles.add(anchor.file);
201
+ }
202
+ }
203
+ return {
204
+ id: OVERVIEW_MODULE_ID,
205
+ title: overview.title,
206
+ focus: 'The zoom-out. The reader has just walked ONE path end to end; this chapter shows ' +
207
+ 'them the whole tree that path moved through — the subsystems, what each one owns, ' +
208
+ 'and how they connect. Open by placing the trace they just followed ON that map, by ' +
209
+ 'name, so the wider picture arrives as an expansion of something concrete they ' +
210
+ 'already hold rather than a fresh set of abstractions. Carry a system-map of the ' +
211
+ 'whole codebase. Every subsystem you name is somewhere a later chapter will go, so ' +
212
+ 'say what it is FOR, not merely what it is called.',
213
+ keyFiles: [...keyFiles],
214
+ assumes: trace.teaches,
215
+ teaches: [
216
+ 'the whole-system map: the major subsystems and what each owns',
217
+ 'where the path they already traced sits inside that map',
218
+ 'which subsystem to look in first for a given kind of change',
219
+ ],
220
+ };
221
+ }
222
+ /**
223
+ * Re-author the overview chapter through the ordinary author stage so it is
224
+ * held to the same contracts as every other chapter.
225
+ *
226
+ * Best-effort by design: a pressing must not die because the zoom-out failed
227
+ * to validate. On any failure the map stage's original overview is kept — the
228
+ * lab is then exactly what it would have been before this step existed.
229
+ */
230
+ async function reauthorOverview(runner, repoDir, options) {
231
+ const { mapSpec, plan } = options;
232
+ const planned = plannedOverviewModule(mapSpec, plan);
233
+ const traceTitle = plan.modules[0]?.title;
234
+ if (planned === undefined || traceTitle === undefined) {
235
+ return { spec: mapSpec, costUsd: undefined, attempts: undefined };
236
+ }
237
+ try {
238
+ const result = await runAuthorStage(runner, repoDir, {
239
+ model: options.model,
240
+ plan: { modules: [planned] },
241
+ concurrency: 1,
242
+ // The reader meets the trace first, so the overview is never the
243
+ // opening chapter — without this it would be briefed as the flagship.
244
+ precedingTitles: [traceTitle],
245
+ ...(options.widgetRange !== undefined ? { widgetRange: options.widgetRange } : {}),
246
+ ...(options.maxRetries !== undefined ? { maxRetries: options.maxRetries } : {}),
247
+ ...(options.onAuthored !== undefined ? { onModuleAuthored: options.onAuthored } : {}),
248
+ });
249
+ const authored = result.modules[0];
250
+ if (authored === undefined) {
251
+ return { spec: mapSpec, costUsd: result.costUsd, attempts: undefined };
252
+ }
253
+ return {
254
+ spec: {
255
+ ...mapSpec,
256
+ base: {
257
+ ...mapSpec.base,
258
+ modules: mapSpec.base.modules.map((m) => m.id === OVERVIEW_MODULE_ID ? authored.module : m),
259
+ },
260
+ },
261
+ costUsd: result.costUsd,
262
+ attempts: authored.attempts,
263
+ };
264
+ }
265
+ catch {
266
+ // Keep the map's own overview; the lab is still whole.
267
+ return { spec: mapSpec, costUsd: undefined, attempts: undefined };
268
+ }
269
+ }
270
+ export function sumCosts(...costs) {
271
+ let total;
272
+ for (const cost of costs) {
273
+ if (cost !== undefined) {
274
+ total = (total ?? 0) + cost;
275
+ }
276
+ }
277
+ return total;
278
+ }
279
+ export function assertDirectory(repoDir) {
280
+ let isDirectory = false;
281
+ try {
282
+ isDirectory = statSync(repoDir).isDirectory();
283
+ }
284
+ catch {
285
+ // fall through to the error below
286
+ }
287
+ if (!isDirectory) {
288
+ throw new Error(`generateLab: repoDir "${repoDir}" is not an existing directory.`);
289
+ }
290
+ }
291
+ //# sourceMappingURL=generateLab.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generateLab.js","sourceRoot":"","sources":["../src/generateLab.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEnC,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,WAAW,EA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vB,QAAQ,EAAE,QAAQ,CAAC,QAAQ;SAC5B,CAAC;IACJ,CAAC;IAAC,MAAM,CAAC;QACP,uDAAuD;QACvD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IACpE,CAAC;AACH,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,GAAG,KAA6B;IACvD,IAAI,KAAyB,CAAC;IAC9B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACvB,KAAK,GAAG,CAAC,KAAK,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC;QAC9B,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,OAAe;IAC7C,IAAI,WAAW,GAAG,KAAK,CAAC;IACxB,IAAI,CAAC;QACH,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC;IAChD,CAAC;IAAC,MAAM,CAAC;QACP,kCAAkC;IACpC,CAAC;IACD,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,yBAAyB,OAAO,iCAAiC,CAAC,CAAC;IACrF,CAAC;AACH,CAAC"}
@@ -0,0 +1,22 @@
1
+ export { generateLab, type GenerateLabConfig, type GenerateLabResult, } from './generateLab.js';
2
+ export { generateLabPass1, type GenerateLabPass1Config, type GenerateLabPass1Result, type Pass1Timing, type StageTiming, } from './pass1.js';
3
+ export { FlagshipSelectionError, selectFlagshipModule, selectTraceFlagship, type FlagshipBasis, type FlagshipSelection, } from './flagship.js';
4
+ export { hasIntakeAnswers, renderIntakeSection, type LeadIntake } from './intake.js';
5
+ export type { GenerationPass, GenerationProgressEvent, ProgressCallback, } from './progress.js';
6
+ export { DEFAULT_STAGE_MODEL, GENERATION_STAGES, MAP_STAGE_MODEL, mapWithConcurrency, resolveStageModels, type GenerationStageName, type ModelRunner, type StageModelConfig, type StageRequest, type StageResponse, } from './pipeline.js';
7
+ export { MapStageError, extractJson, parseTraceCandidates, runMapStage, traceCandidateSchema, type MapStageOptions, type MapStageResult, type TraceCandidate, } from './mapStage.js';
8
+ export { DEFAULT_MAX_MODULES, LANDING_MODULE_ID, PlanStageError, curriculumPlanSchema, parsePlan, plannedModuleSchema, runPlanStage, type CurriculumBudget, type CurriculumPlan, type PlanStageOptions, type PlanStageResult, type PlannedModule, } from './planStage.js';
9
+ export { AuthorStageError, DEFAULT_AUTHOR_CONCURRENCY, runAuthorStage, type AuthorModuleFailure, type AuthorStageOptions, type AuthorStageResult, type AuthoredModule, } from './authorStage.js';
10
+ export { assembleLab, type AssembleOptions, type AssembleResult, } from './assembleStage.js';
11
+ export { DEFAULT_VERIFY_CONCURRENCY, VerifyStageError, collectModuleClaims, runVerifyStage, type ClaimVerdict, type ClaimVerdictValue, type VerificationClaim, type VerificationDroppedQuestion, type VerificationDroppedWidget, type VerificationDrops, type VerificationReport, type VerificationSummary, type VerifyBatchFailure, type VerifyStageOptions, type VerifyStageResult, } from './verifyStage.js';
12
+ export { createAgentSdkRunner, createStallWatchdog, describeAuth, DEFAULT_STALL_TIMEOUT_MS, type AgentSdkRunnerOptions, type AuthDescription, type AuthMode, type StallWatchdog, } from './agentSdkRunner.js';
13
+ export { createAnchorFileCache, readAnchorRegion, resolveAnchors, type AnchorFileCache, type AnchorRegion, type AnchorResolution, type AnchorStatus, type LoadedFile, type ResolutionPolicy, type ResolutionReport, type ResolutionSummary, type ResolveAnchorsOptions, type ResolveAnchorsResult, type UnitOutcome, type UnitResolution, } from './resolveAnchors.js';
14
+ export { isRepoDirty, readRepoCommit, readRepoRemote } from './repoCommit.js';
15
+ /**
16
+ * Cloning a repository, shared by the worker (which clones untrusted URLs on
17
+ * our own infrastructure) and the CLI (which clones onto the reader's machine
18
+ * at their request). One validated implementation rather than two, because URL
19
+ * validation is the last thing to have two versions of.
20
+ */
21
+ export { cloneRepo, validateRepoUrl, type CloneOptions, type CloneResult, type ExecFn, type ExecResult, type UrlCheck, } from './cloneRepo.js';
22
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,GACvB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,gBAAgB,EAChB,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,WAAW,EAChB,KAAK,WAAW,GACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,KAAK,aAAa,EAClB,KAAK,iBAAiB,GACvB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AACrF,YAAY,EACV,cAAc,EACd,uBAAuB,EACvB,gBAAgB,GACjB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAClB,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,aAAa,GACnB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,aAAa,EACb,WAAW,EACX,oBAAoB,EACpB,WAAW,EACX,oBAAoB,EACpB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,cAAc,GACpB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,oBAAoB,EACpB,SAAS,EACT,mBAAmB,EACnB,YAAY,EACZ,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACp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AK,WAAW,EAChB,KAAK,MAAM,EACX,KAAK,UAAU,EACf,KAAK,QAAQ,GACd,MAAM,gBAAgB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,21 @@
1
+ export { generateLab, } from './generateLab.js';
2
+ export { generateLabPass1, } from './pass1.js';
3
+ export { FlagshipSelectionError, selectFlagshipModule, selectTraceFlagship, } from './flagship.js';
4
+ export { hasIntakeAnswers, renderIntakeSection } from './intake.js';
5
+ export { DEFAULT_STAGE_MODEL, GENERATION_STAGES, MAP_STAGE_MODEL, mapWithConcurrency, resolveStageModels, } from './pipeline.js';
6
+ export { MapStageError, extractJson, parseTraceCandidates, runMapStage, traceCandidateSchema, } from './mapStage.js';
7
+ export { DEFAULT_MAX_MODULES, LANDING_MODULE_ID, PlanStageError, curriculumPlanSchema, parsePlan, plannedModuleSchema, runPlanStage, } from './planStage.js';
8
+ export { AuthorStageError, DEFAULT_AUTHOR_CONCURRENCY, runAuthorStage, } from './authorStage.js';
9
+ export { assembleLab, } from './assembleStage.js';
10
+ export { DEFAULT_VERIFY_CONCURRENCY, VerifyStageError, collectModuleClaims, runVerifyStage, } from './verifyStage.js';
11
+ export { createAgentSdkRunner, createStallWatchdog, describeAuth, DEFAULT_STALL_TIMEOUT_MS, } from './agentSdkRunner.js';
12
+ export { createAnchorFileCache, readAnchorRegion, resolveAnchors, } from './resolveAnchors.js';
13
+ export { isRepoDirty, readRepoCommit, readRepoRemote } from './repoCommit.js';
14
+ /**
15
+ * Cloning a repository, shared by the worker (which clones untrusted URLs on
16
+ * our own infrastructure) and the CLI (which clones onto the reader's machine
17
+ * at their request). One validated implementation rather than two, because URL
18
+ * validation is the last thing to have two versions of.
19
+ */
20
+ export { cloneRepo, validateRepoUrl, } from './cloneRepo.js';
21
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,GAGZ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,gBAAgB,GAKjB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,GAGpB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAmB,MAAM,aAAa,CAAC;AAMrF,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,kBAAkB,GAMnB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,aAAa,EACb,WAAW,EACX,oBAAoB,EACpB,WAAW,EACX,oBAAoB,GAIrB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,oBAAoB,EACpB,SAAS,EACT,mBAAmB,EACnB,YAAY,GAMb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,gBAAgB,EAChB,0BAA0B,EAC1B,cAAc,GAKf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,WAAW,GAGZ,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,0BAA0B,EAC1B,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,GAYf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,YAAY,EACZ,wBAAwB,GAKzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,cAAc,GAaf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC9E;;;;;GAKG;AACH,OAAO,EACL,SAAS,EACT,eAAe,GAMhB,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Lead intake (PLAN.md §4, curation loop step 1): the optional 2-minute
3
+ * questionnaire an onboarding lead fills in before generation. Three
4
+ * questions, three string lists — deliberately free-form, because the lead
5
+ * types answers, not configuration.
6
+ *
7
+ * The intake steers generation in two places:
8
+ * - the **curriculum-plan prompt** (module selection and ordering), and
9
+ * - the **pass-1 flagship pick** (an intake hint that matches a system-map
10
+ * node overrides the pure-centrality choice — see `flagship.ts`).
11
+ *
12
+ * It is prompt/heuristic *input* only: nothing from the intake is copied
13
+ * into the lab spec, so `@ramplab/spec` is untouched.
14
+ */
15
+ export interface LeadIntake {
16
+ /** "What must a week-one hire master?" */
17
+ weekOneMastery?: string[];
18
+ /** "What is under active development?" */
19
+ activeDevelopment?: string[];
20
+ /** "What trips people up?" */
21
+ gotchas?: string[];
22
+ }
23
+ /** True when at least one intake question has at least one answer. */
24
+ export declare function hasIntakeAnswers(intake: LeadIntake | undefined): intake is LeadIntake;
25
+ /**
26
+ * Render the intake as a prompt section for the curriculum planner (and the
27
+ * flagship author's brief). Returns `''` when there is nothing to say, so
28
+ * callers can interpolate unconditionally.
29
+ */
30
+ export declare function renderIntakeSection(intake: LeadIntake | undefined): string;
31
+ //# sourceMappingURL=intake.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intake.d.ts","sourceRoot":"","sources":["../src/intake.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,MAAM,WAAW,UAAU;IACzB,0CAA0C;IAC1C,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,0CAA0C;IAC1C,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,8BAA8B;IAC9B,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,sEAAsE;AACtE,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,UAAU,GAAG,SAAS,GAAG,MAAM,IAAI,UAAU,CAOrF;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,UAAU,GAAG,SAAS,GAAG,MAAM,CAqB1E"}
package/dist/intake.js ADDED
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Lead intake (PLAN.md §4, curation loop step 1): the optional 2-minute
3
+ * questionnaire an onboarding lead fills in before generation. Three
4
+ * questions, three string lists — deliberately free-form, because the lead
5
+ * types answers, not configuration.
6
+ *
7
+ * The intake steers generation in two places:
8
+ * - the **curriculum-plan prompt** (module selection and ordering), and
9
+ * - the **pass-1 flagship pick** (an intake hint that matches a system-map
10
+ * node overrides the pure-centrality choice — see `flagship.ts`).
11
+ *
12
+ * It is prompt/heuristic *input* only: nothing from the intake is copied
13
+ * into the lab spec, so `@ramplab/spec` is untouched.
14
+ */
15
+ /** True when at least one intake question has at least one answer. */
16
+ export function hasIntakeAnswers(intake) {
17
+ if (intake === undefined)
18
+ return false;
19
+ return ((intake.weekOneMastery?.length ?? 0) > 0 ||
20
+ (intake.activeDevelopment?.length ?? 0) > 0 ||
21
+ (intake.gotchas?.length ?? 0) > 0);
22
+ }
23
+ /**
24
+ * Render the intake as a prompt section for the curriculum planner (and the
25
+ * flagship author's brief). Returns `''` when there is nothing to say, so
26
+ * callers can interpolate unconditionally.
27
+ */
28
+ export function renderIntakeSection(intake) {
29
+ if (!hasIntakeAnswers(intake))
30
+ return '';
31
+ const blocks = [
32
+ 'The onboarding lead completed a 2-minute intake. Let these answers steer ' +
33
+ 'which modules you choose, how you order them, and what you emphasize:',
34
+ ];
35
+ const question = (label, answers) => {
36
+ if (answers === undefined || answers.length === 0)
37
+ return;
38
+ blocks.push(`${label}\n${answers.map((a) => `- ${a}`).join('\n')}`);
39
+ };
40
+ question('What must a week-one hire master? (teach these first)', intake.weekOneMastery);
41
+ question('What is under active development? (favor the current code paths)', intake.activeDevelopment);
42
+ question('What trips people up? (call these out in the modules that touch them)', intake.gotchas);
43
+ return `\n${blocks.join('\n\n')}\n`;
44
+ }
45
+ //# sourceMappingURL=intake.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intake.js","sourceRoot":"","sources":["../src/intake.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAWH,sEAAsE;AACtE,MAAM,U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,"file":"live.d.ts","sourceRoot":"","sources":["../src/live.ts"],"names":[],"mappings":""}