@cleocode/core 2026.6.15 → 2026.6.18

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 (55) hide show
  1. package/dist/docs/export-document.js +41 -0
  2. package/dist/docs/export-document.js.map +1 -1
  3. package/dist/gc/janitor.d.ts +149 -0
  4. package/dist/gc/janitor.d.ts.map +1 -0
  5. package/dist/gc/janitor.js +760 -0
  6. package/dist/gc/janitor.js.map +1 -0
  7. package/dist/internal.d.ts +1 -0
  8. package/dist/internal.d.ts.map +1 -1
  9. package/dist/internal.js +3 -0
  10. package/dist/internal.js.map +1 -1
  11. package/dist/llm/cli-ops.d.ts +15 -4
  12. package/dist/llm/cli-ops.d.ts.map +1 -1
  13. package/dist/llm/cli-ops.js +78 -21
  14. package/dist/llm/cli-ops.js.map +1 -1
  15. package/dist/llm/credential-pool.d.ts +62 -0
  16. package/dist/llm/credential-pool.d.ts.map +1 -1
  17. package/dist/llm/credential-pool.js +161 -0
  18. package/dist/llm/credential-pool.js.map +1 -1
  19. package/dist/llm/cross-provider-selector.d.ts +8 -3
  20. package/dist/llm/cross-provider-selector.d.ts.map +1 -1
  21. package/dist/llm/cross-provider-selector.js +71 -8
  22. package/dist/llm/cross-provider-selector.js.map +1 -1
  23. package/dist/llm/plugin-facade.js +122 -1
  24. package/dist/llm/plugin-facade.js.map +1 -1
  25. package/dist/selfimprove/fix-gen-context.d.ts +172 -0
  26. package/dist/selfimprove/fix-gen-context.d.ts.map +1 -0
  27. package/dist/selfimprove/fix-gen-context.js +218 -0
  28. package/dist/selfimprove/fix-gen-context.js.map +1 -0
  29. package/dist/selfimprove/fix-gen.d.ts +60 -4
  30. package/dist/selfimprove/fix-gen.d.ts.map +1 -1
  31. package/dist/selfimprove/fix-gen.js +76631 -256
  32. package/dist/selfimprove/fix-gen.js.map +6 -1
  33. package/dist/selfimprove/op-source-map.d.ts +92 -0
  34. package/dist/selfimprove/op-source-map.d.ts.map +1 -0
  35. package/dist/selfimprove/op-source-map.js +187 -0
  36. package/dist/selfimprove/op-source-map.js.map +1 -0
  37. package/dist/selfimprove/probe-helper.d.ts +61 -0
  38. package/dist/selfimprove/probe-helper.d.ts.map +1 -0
  39. package/dist/selfimprove/probe-helper.js +64 -0
  40. package/dist/selfimprove/probe-helper.js.map +1 -0
  41. package/dist/selfimprove/scenarios/seeded-code-regression/golden.json +18 -0
  42. package/dist/selfimprove/scenarios/seeded-code-regression/scenario.json +12 -0
  43. package/dist/setup/index.d.ts +1 -0
  44. package/dist/setup/index.d.ts.map +1 -1
  45. package/dist/setup/index.js +1 -0
  46. package/dist/setup/index.js.map +1 -1
  47. package/dist/setup/sections/models-roles.d.ts +32 -1
  48. package/dist/setup/sections/models-roles.d.ts.map +1 -1
  49. package/dist/setup/sections/models-roles.js +118 -19
  50. package/dist/setup/sections/models-roles.js.map +1 -1
  51. package/dist/setup/whoami-summary.d.ts +34 -0
  52. package/dist/setup/whoami-summary.d.ts.map +1 -0
  53. package/dist/setup/whoami-summary.js +106 -0
  54. package/dist/setup/whoami-summary.js.map +1 -0
  55. package/package.json +12 -12
@@ -0,0 +1,172 @@
1
+ /**
2
+ * Bounded file-content loader for the fix-gen stage (T11988).
3
+ *
4
+ * The self-improvement fix-gen stage builds a prompt for the LLM
5
+ * ({@link "./fix-gen.js".buildFixGenPrompt}). Without file context the model
6
+ * can only see the regression diff entries (e.g.
7
+ * `op tasks.show (#0) at data/task/status: actual="pending" expected="active"`)
8
+ * and rationally responds `NO_PATCH` because it cannot locate the responsible code.
9
+ *
10
+ * This module resolves the relevant source files for each regressing op-coordinate
11
+ * via the static map ({@link "./op-source-map.js"}) and reads their content with a
12
+ * **hard context budget** so the prompt stays bounded regardless of file size.
13
+ *
14
+ * ## Budget model
15
+ *
16
+ * Two independent byte-level caps:
17
+ *
18
+ * - `perFileBudget` (default {@link DEFAULT_PER_FILE_BUDGET}): the maximum bytes
19
+ * read from any single file. Files larger than this are truncated at a
20
+ * newline boundary and a `<… TRUNCATED …>` marker is appended.
21
+ * - `totalBudget` (default {@link DEFAULT_TOTAL_BUDGET}): the maximum total bytes
22
+ * across ALL included files. Files are added in order (handler files first, then
23
+ * core files); once the total would be exceeded the remaining files are
24
+ * summarised as a path-only `<file listed but not loaded — budget exhausted>` stub.
25
+ *
26
+ * The caller embeds the resolved {@link LoadedFileContext} into the prompt. The LLM
27
+ * prompt builder ({@link "./fix-gen.js".buildFixGenPrompt}) inserts the file blocks
28
+ * between the regression description and the "produce the diff" instruction, giving
29
+ * the model concrete code to work from.
30
+ *
31
+ * Import-time side-effect-free: no logger init, no native handles.
32
+ *
33
+ * @module @cleocode/core/selfimprove/fix-gen-context
34
+ * @epic T11889
35
+ * @task T11988
36
+ */
37
+ /**
38
+ * Per-file byte cap (default): any single file is truncated to at most 24 KB
39
+ * before being included in the prompt. Chosen to comfortably fit a large-ish
40
+ * handler or core module without overwhelming the model context.
41
+ */
42
+ export declare const DEFAULT_PER_FILE_BUDGET = 24576;
43
+ /**
44
+ * Total byte cap (default): the combined content of all included files must not
45
+ * exceed 65 KB. Keeps the combined code context section to a model-digestible
46
+ * slice of the context window even when multiple files are included.
47
+ */
48
+ export declare const DEFAULT_TOTAL_BUDGET = 65536;
49
+ /** Options for {@link loadFileContext}. */
50
+ export interface LoadFileContextOptions {
51
+ /**
52
+ * Absolute project root. Source files are resolved relative to this path.
53
+ * Must be set to the actual repo root for the paths from the op-source-map
54
+ * to resolve correctly.
55
+ */
56
+ readonly projectRoot: string;
57
+ /**
58
+ * The op-coordinates whose source files should be loaded (e.g. `['tasks.show']`).
59
+ * Resolved via {@link collectOpSourceFiles}.
60
+ */
61
+ readonly opCoords: readonly string[];
62
+ /**
63
+ * Per-file byte budget (defaults to {@link DEFAULT_PER_FILE_BUDGET}).
64
+ * Files exceeding this are truncated with a `<… TRUNCATED …>` marker.
65
+ */
66
+ readonly perFileBudget?: number;
67
+ /**
68
+ * Total byte budget for all files combined
69
+ * (defaults to {@link DEFAULT_TOTAL_BUDGET}).
70
+ * Files whose content would push the total over budget are listed but not
71
+ * loaded (their path is emitted as a stub).
72
+ */
73
+ readonly totalBudget?: number;
74
+ }
75
+ /** A single file included in the context (content loaded or stubbed). */
76
+ export interface FileContextEntry {
77
+ /** Repo-relative path (as returned by the op-source-map). */
78
+ readonly repoRelativePath: string;
79
+ /**
80
+ * File content (possibly truncated if `truncated` is `true`). `null` when the
81
+ * file was skipped due to the total budget being exhausted or a read error.
82
+ */
83
+ readonly content: string | null;
84
+ /**
85
+ * `true` when the file was truncated at the per-file budget; the loaded
86
+ * `content` ends with a `<… TRUNCATED …>` marker.
87
+ */
88
+ readonly truncated: boolean;
89
+ /**
90
+ * `true` when the total budget was exhausted before this file was loaded. The
91
+ * file appears in the context list but its `content` is `null`.
92
+ */
93
+ readonly budgetExhausted: boolean;
94
+ /**
95
+ * `true` when the file could not be read (missing, permission error, etc.).
96
+ * The file appears in the context list with `content: null`.
97
+ */
98
+ readonly readError: boolean;
99
+ }
100
+ /** Resolved file context for a set of op-coordinates. */
101
+ export interface LoadedFileContext {
102
+ /** The resolved file entries (handler files first, then core files). */
103
+ readonly entries: readonly FileContextEntry[];
104
+ /** Total bytes of loaded content (across all non-skipped entries). */
105
+ readonly totalBytes: number;
106
+ /** Number of files that were truncated due to the per-file budget. */
107
+ readonly truncatedCount: number;
108
+ /** Number of files that were skipped due to the total budget. */
109
+ readonly budgetSkippedCount: number;
110
+ /** Number of files that could not be read. */
111
+ readonly errorCount: number;
112
+ }
113
+ /**
114
+ * Truncate `content` to at most `maxBytes` bytes, cutting at a newline boundary
115
+ * wherever possible, and appending a marker.
116
+ *
117
+ * Operates on raw bytes via `Buffer` so multi-byte characters don't produce
118
+ * partial surrogate pairs in the truncated output.
119
+ *
120
+ * @param content - The full file content string.
121
+ * @param maxBytes - The per-file byte cap.
122
+ * @returns `{ text, truncated }` — the (possibly shortened) string and a flag.
123
+ * @internal
124
+ */
125
+ export declare function truncateToByteLimit(content: string, maxBytes: number): {
126
+ text: string;
127
+ truncated: boolean;
128
+ };
129
+ /**
130
+ * Load bounded file content for the op-coordinates in a fix-gen request.
131
+ *
132
+ * Resolves the handler + core files for each `opCoord` via
133
+ * {@link collectOpSourceFiles}, reads them against `projectRoot`, applies the
134
+ * per-file and total byte budgets, and returns a structured
135
+ * {@link LoadedFileContext} describing every entry (loaded, truncated, skipped, or
136
+ * errored). NEVER throws — read errors produce `{ content: null, readError: true }`.
137
+ *
138
+ * @param opts - See {@link LoadFileContextOptions}.
139
+ * @returns The resolved {@link LoadedFileContext}.
140
+ *
141
+ * @example
142
+ * ```ts
143
+ * const ctx = loadFileContext({
144
+ * projectRoot: '/repo',
145
+ * opCoords: ['tasks.show'],
146
+ * });
147
+ * // ctx.entries[0].repoRelativePath === 'packages/cleo/src/dispatch/domains/tasks.ts'
148
+ * // ctx.entries[1].repoRelativePath === 'packages/core/src/tasks/show.ts'
149
+ * // ctx.totalBytes <= DEFAULT_TOTAL_BUDGET
150
+ * ```
151
+ */
152
+ export declare function loadFileContext(opts: LoadFileContextOptions): LoadedFileContext;
153
+ /**
154
+ * Render a {@link LoadedFileContext} as the file-context section of a fix-gen
155
+ * prompt.
156
+ *
157
+ * Produces a human-readable block listing each file with its content (or a stub
158
+ * explaining why the content was omitted). Suitable for direct embedding in the
159
+ * LLM user-turn after the regression description.
160
+ *
161
+ * @param ctx - The loaded file context.
162
+ * @returns A string ready for embedding in the prompt (empty string when no files).
163
+ *
164
+ * @example
165
+ * ```ts
166
+ * const section = renderFileContextSection(ctx);
167
+ * // --- packages/core/src/tasks/show.ts ---
168
+ * // <content or stub>
169
+ * ```
170
+ */
171
+ export declare function renderFileContextSection(ctx: LoadedFileContext): string;
172
+ //# sourceMappingURL=fix-gen-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fix-gen-context.d.ts","sourceRoot":"","sources":["../../src/selfimprove/fix-gen-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAm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EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,CAatC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,sBAAsB,GAAG,iBAAiB,CAmF/E;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,iBAAiB,GAAG,MAAM,CAgBvE"}
@@ -0,0 +1,218 @@
1
+ /**
2
+ * Bounded file-content loader for the fix-gen stage (T11988).
3
+ *
4
+ * The self-improvement fix-gen stage builds a prompt for the LLM
5
+ * ({@link "./fix-gen.js".buildFixGenPrompt}). Without file context the model
6
+ * can only see the regression diff entries (e.g.
7
+ * `op tasks.show (#0) at data/task/status: actual="pending" expected="active"`)
8
+ * and rationally responds `NO_PATCH` because it cannot locate the responsible code.
9
+ *
10
+ * This module resolves the relevant source files for each regressing op-coordinate
11
+ * via the static map ({@link "./op-source-map.js"}) and reads their content with a
12
+ * **hard context budget** so the prompt stays bounded regardless of file size.
13
+ *
14
+ * ## Budget model
15
+ *
16
+ * Two independent byte-level caps:
17
+ *
18
+ * - `perFileBudget` (default {@link DEFAULT_PER_FILE_BUDGET}): the maximum bytes
19
+ * read from any single file. Files larger than this are truncated at a
20
+ * newline boundary and a `<… TRUNCATED …>` marker is appended.
21
+ * - `totalBudget` (default {@link DEFAULT_TOTAL_BUDGET}): the maximum total bytes
22
+ * across ALL included files. Files are added in order (handler files first, then
23
+ * core files); once the total would be exceeded the remaining files are
24
+ * summarised as a path-only `<file listed but not loaded — budget exhausted>` stub.
25
+ *
26
+ * The caller embeds the resolved {@link LoadedFileContext} into the prompt. The LLM
27
+ * prompt builder ({@link "./fix-gen.js".buildFixGenPrompt}) inserts the file blocks
28
+ * between the regression description and the "produce the diff" instruction, giving
29
+ * the model concrete code to work from.
30
+ *
31
+ * Import-time side-effect-free: no logger init, no native handles.
32
+ *
33
+ * @module @cleocode/core/selfimprove/fix-gen-context
34
+ * @epic T11889
35
+ * @task T11988
36
+ */
37
+ import { readFileSync } from 'node:fs';
38
+ import { join } from 'node:path';
39
+ import { collectOpSourceFiles } from './op-source-map.js';
40
+ // ── Budget constants ────────────────────────────────────────────────────────
41
+ /**
42
+ * Per-file byte cap (default): any single file is truncated to at most 24 KB
43
+ * before being included in the prompt. Chosen to comfortably fit a large-ish
44
+ * handler or core module without overwhelming the model context.
45
+ */
46
+ export const DEFAULT_PER_FILE_BUDGET = 24_576; // 24 KB
47
+ /**
48
+ * Total byte cap (default): the combined content of all included files must not
49
+ * exceed 65 KB. Keeps the combined code context section to a model-digestible
50
+ * slice of the context window even when multiple files are included.
51
+ */
52
+ export const DEFAULT_TOTAL_BUDGET = 65_536; // 64 KB
53
+ // ── Implementation ───────────────────────────────────────────────────────────
54
+ /**
55
+ * Truncate `content` to at most `maxBytes` bytes, cutting at a newline boundary
56
+ * wherever possible, and appending a marker.
57
+ *
58
+ * Operates on raw bytes via `Buffer` so multi-byte characters don't produce
59
+ * partial surrogate pairs in the truncated output.
60
+ *
61
+ * @param content - The full file content string.
62
+ * @param maxBytes - The per-file byte cap.
63
+ * @returns `{ text, truncated }` — the (possibly shortened) string and a flag.
64
+ * @internal
65
+ */
66
+ export function truncateToByteLimit(content, maxBytes) {
67
+ const buf = Buffer.from(content, 'utf8');
68
+ if (buf.length <= maxBytes) {
69
+ return { text: content, truncated: false };
70
+ }
71
+ // Cut at a newline boundary within the budget to avoid broken lines.
72
+ let cutAt = maxBytes;
73
+ while (cutAt > 0 && buf[cutAt] !== 0x0a /* '\n' */) {
74
+ cutAt--;
75
+ }
76
+ if (cutAt === 0)
77
+ cutAt = maxBytes; // no newline found — hard cut
78
+ const truncated = buf.slice(0, cutAt).toString('utf8');
79
+ return { text: `${truncated}\n<… TRUNCATED at ${maxBytes} bytes …>`, truncated: true };
80
+ }
81
+ /**
82
+ * Load bounded file content for the op-coordinates in a fix-gen request.
83
+ *
84
+ * Resolves the handler + core files for each `opCoord` via
85
+ * {@link collectOpSourceFiles}, reads them against `projectRoot`, applies the
86
+ * per-file and total byte budgets, and returns a structured
87
+ * {@link LoadedFileContext} describing every entry (loaded, truncated, skipped, or
88
+ * errored). NEVER throws — read errors produce `{ content: null, readError: true }`.
89
+ *
90
+ * @param opts - See {@link LoadFileContextOptions}.
91
+ * @returns The resolved {@link LoadedFileContext}.
92
+ *
93
+ * @example
94
+ * ```ts
95
+ * const ctx = loadFileContext({
96
+ * projectRoot: '/repo',
97
+ * opCoords: ['tasks.show'],
98
+ * });
99
+ * // ctx.entries[0].repoRelativePath === 'packages/cleo/src/dispatch/domains/tasks.ts'
100
+ * // ctx.entries[1].repoRelativePath === 'packages/core/src/tasks/show.ts'
101
+ * // ctx.totalBytes <= DEFAULT_TOTAL_BUDGET
102
+ * ```
103
+ */
104
+ export function loadFileContext(opts) {
105
+ const perFileBudget = opts.perFileBudget ?? DEFAULT_PER_FILE_BUDGET;
106
+ const totalBudget = opts.totalBudget ?? DEFAULT_TOTAL_BUDGET;
107
+ // Resolve the unique set of source files for all op-coords.
108
+ const { handlerFiles, coreFiles } = collectOpSourceFiles(opts.opCoords);
109
+ // Handler files first (they contain the dispatch glue the model needs to locate
110
+ // where to apply the fix); core modules follow (they contain the business logic).
111
+ const allRelPaths = [...handlerFiles, ...coreFiles];
112
+ const entries = [];
113
+ let totalBytes = 0;
114
+ let truncatedCount = 0;
115
+ let budgetSkippedCount = 0;
116
+ let errorCount = 0;
117
+ for (const relPath of allRelPaths) {
118
+ const absPath = join(opts.projectRoot, relPath);
119
+ // Total budget exhausted — list the file but do not load it.
120
+ if (totalBytes >= totalBudget) {
121
+ entries.push({
122
+ repoRelativePath: relPath,
123
+ content: null,
124
+ truncated: false,
125
+ budgetExhausted: true,
126
+ readError: false,
127
+ });
128
+ budgetSkippedCount++;
129
+ continue;
130
+ }
131
+ // Read the file, gracefully handling any IO error.
132
+ let raw;
133
+ try {
134
+ raw = readFileSync(absPath, 'utf8');
135
+ }
136
+ catch {
137
+ entries.push({
138
+ repoRelativePath: relPath,
139
+ content: null,
140
+ truncated: false,
141
+ budgetExhausted: false,
142
+ readError: true,
143
+ });
144
+ errorCount++;
145
+ continue;
146
+ }
147
+ // Apply per-file budget.
148
+ const { text, truncated } = truncateToByteLimit(raw, perFileBudget);
149
+ const textBytes = Buffer.byteLength(text, 'utf8');
150
+ // If adding this file would bust the total budget, use a shorter slice that
151
+ // fits, then mark the file as budget-exhausted.
152
+ const remaining = totalBudget - totalBytes;
153
+ if (textBytes > remaining) {
154
+ const { text: fitted, truncated: fTrunc } = truncateToByteLimit(raw, remaining);
155
+ const fittedBytes = Buffer.byteLength(fitted, 'utf8');
156
+ entries.push({
157
+ repoRelativePath: relPath,
158
+ content: fittedBytes > 0 ? fitted : null,
159
+ truncated: fTrunc || truncated,
160
+ budgetExhausted: true,
161
+ readError: false,
162
+ });
163
+ totalBytes += fittedBytes;
164
+ truncatedCount += fTrunc || truncated ? 1 : 0;
165
+ budgetSkippedCount++;
166
+ continue;
167
+ }
168
+ entries.push({
169
+ repoRelativePath: relPath,
170
+ content: text,
171
+ truncated,
172
+ budgetExhausted: false,
173
+ readError: false,
174
+ });
175
+ totalBytes += textBytes;
176
+ if (truncated)
177
+ truncatedCount++;
178
+ }
179
+ return { entries, totalBytes, truncatedCount, budgetSkippedCount, errorCount };
180
+ }
181
+ /**
182
+ * Render a {@link LoadedFileContext} as the file-context section of a fix-gen
183
+ * prompt.
184
+ *
185
+ * Produces a human-readable block listing each file with its content (or a stub
186
+ * explaining why the content was omitted). Suitable for direct embedding in the
187
+ * LLM user-turn after the regression description.
188
+ *
189
+ * @param ctx - The loaded file context.
190
+ * @returns A string ready for embedding in the prompt (empty string when no files).
191
+ *
192
+ * @example
193
+ * ```ts
194
+ * const section = renderFileContextSection(ctx);
195
+ * // --- packages/core/src/tasks/show.ts ---
196
+ * // <content or stub>
197
+ * ```
198
+ */
199
+ export function renderFileContextSection(ctx) {
200
+ if (ctx.entries.length === 0)
201
+ return '';
202
+ const lines = ['Relevant source files (bounded — apply the diff against these):'];
203
+ for (const entry of ctx.entries) {
204
+ lines.push('');
205
+ lines.push(`--- ${entry.repoRelativePath} ---`);
206
+ if (entry.readError) {
207
+ lines.push('<file not readable — patch by path only>');
208
+ }
209
+ else if (entry.budgetExhausted && entry.content === null) {
210
+ lines.push('<file listed but not loaded — context budget exhausted>');
211
+ }
212
+ else if (entry.content !== null) {
213
+ lines.push(entry.content);
214
+ }
215
+ }
216
+ return lines.join('\n');
217
+ }
218
+ //# sourceMappingURL=fix-gen-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fix-gen-context.js","sourceRoot":"","sources":["../../src/selfimprove/fix-gen-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE1D,+EAA+E;AAE/E;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,CAAC,QAAQ;AAEvD;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,CAAC,QAAQ;AAuEpD,gFAAgF;AAEhF;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,mBAAmB,CACjC,OAAe,EACf,QAAgB;IAEhB,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACzC,IAAI,GAAG,CAAC,MAAM,IAAI,QAAQ,EAAE,CAAC;QAC3B,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;IAC7C,CAAC;IACD,qEAAqE;IACrE,IAAI,KAAK,GAAG,QAAQ,CAAC;IACrB,OAAO,KAAK,GAAG,CAAC,IAAI,GAAG,CAAC,KA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K,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
@@ -39,6 +39,7 @@
39
39
  */
40
40
  import type { Logger } from 'pino';
41
41
  import type { DiffEntry } from './envelope-diff.js';
42
+ import { type LoadedFileContext, type LoadFileContextOptions } from './fix-gen-context.js';
42
43
  /**
43
44
  * The structured request handed to a {@link FixGenerator}. Carries only what the
44
45
  * generator needs to draft a patch: the DHQ identity, the scenario, the
@@ -66,6 +67,19 @@ export interface FixGenRepoContext {
66
67
  readonly projectRoot: string;
67
68
  /** Optional one-line summary of what the scenario exercises. */
68
69
  readonly summary?: string;
70
+ /**
71
+ * Optional override for the file-context loading options (per-file budget,
72
+ * total budget). When absent the defaults from {@link "./fix-gen-context.js"}
73
+ * apply ({@link DEFAULT_PER_FILE_BUDGET} / {@link DEFAULT_TOTAL_BUDGET}).
74
+ *
75
+ * Setting `perFileBudget: 0` and `totalBudget: 0` effectively disables file
76
+ * context injection (the prompt degrades to the regression-only view — the model
77
+ * may still produce NO_PATCH, which is the honest outcome when context is
78
+ * insufficient).
79
+ *
80
+ * @task T11988
81
+ */
82
+ readonly contextBudget?: Pick<LoadFileContextOptions, 'perFileBudget' | 'totalBudget'>;
69
83
  }
70
84
  /** A generated patch, or an explicit "no usable patch" signal. */
71
85
  export type FixGenOutput = {
@@ -80,6 +94,13 @@ export type FixGenOutput = {
80
94
  readonly kind: 'none';
81
95
  /** Machine-stable reason for the absence. */
82
96
  readonly reason: string;
97
+ /**
98
+ * Credential-redacted, byte-bounded excerpt of the raw model reply (when the
99
+ * reason is `'model-declined'`). Absent for failure modes that have no reply
100
+ * (e.g. `'no-credential-resolved'`). Callers that log or persist this field
101
+ * MUST NOT additionally redact — it is pre-sanitized by the generator.
102
+ */
103
+ readonly rawReply?: string;
83
104
  };
84
105
  /**
85
106
  * The injectable fix-generation port (the LLM seam).
@@ -112,6 +133,14 @@ export type FixGenResult = {
112
133
  readonly kind: 'skipped';
113
134
  /** Machine-stable reason recorded on the DHQ evidence. */
114
135
  readonly reason: string;
136
+ /**
137
+ * Credential-redacted, byte-bounded excerpt of the raw model reply for
138
+ * `'model-declined'` and `'fixgen-not-a-diff'` outcomes. Absent for
139
+ * generator errors and other failure modes that have no usable reply text.
140
+ * Persisted on the DHQ evidence row so the loop operator can diagnose the
141
+ * model's actual output without re-running.
142
+ */
143
+ readonly replyExcerpt?: string;
115
144
  };
116
145
  /**
117
146
  * Options for {@link generateFixPatch}.
@@ -158,17 +187,44 @@ export declare function fixPatchPath(scenario: string, cwd?: string): string;
158
187
  export declare function looksLikeUnifiedDiff(text: string): boolean;
159
188
  /**
160
189
  * Build the system + user prompt the real generator sends to the LLM. Pure
161
- * (no IO) so it is unit-testable in isolation. The prompt is deliberately strict:
162
- * "respond with ONLY a unified diff" — anything else fails
163
- * {@link looksLikeUnifiedDiff} downstream and degrades to "no patch".
190
+ * (no IO) so it is unit-testable in isolation when an explicit `fileContext` is
191
+ * passed; the default path calls {@link loadFileContext} to resolve the relevant
192
+ * source files for each regressing op-coordinate (IO-bearing path used in
193
+ * production).
194
+ *
195
+ * The prompt is deliberately strict: "respond with ONLY a unified diff" — anything
196
+ * else fails {@link looksLikeUnifiedDiff} downstream and degrades to "no patch".
197
+ * When file context is available it is embedded between the regression description
198
+ * and the "produce the diff" instruction so the model can locate the responsible
199
+ * code. When context is absent (unmapped op or budget exhausted) the model is
200
+ * explicitly told it may respond `NO_PATCH` — this keeps the prompt honest.
164
201
  *
165
202
  * @param request - The fix-generation request.
203
+ * @param fileContext - Optional pre-loaded file context (injected for pure unit
204
+ * tests). When absent, {@link loadFileContext} is called with the request's
205
+ * `repoContext.projectRoot` and the op-coordinates from `regressions`.
166
206
  * @returns The `{ system, user }` prompt pair.
207
+ *
208
+ * @task T11988
167
209
  */
168
- export declare function buildFixGenPrompt(request: FixGenRequest): {
210
+ export declare function buildFixGenPrompt(request: FixGenRequest, fileContext?: LoadedFileContext): {
169
211
  system: string;
170
212
  user: string;
171
213
  };
214
+ /**
215
+ * Produce a credential-redacted, byte-bounded excerpt of a raw model reply for
216
+ * safe logging and DHQ evidence attachment.
217
+ *
218
+ * The excerpt is at most {@link REPLY_EXCERPT_MAX_BYTES} UTF-8 bytes. When the
219
+ * reply is longer a `…[truncated <N> bytes]` marker replaces the tail so the
220
+ * caller can distinguish a genuinely-short reply from a truncated one. The
221
+ * returned string is already passed through {@link redact} so no downstream
222
+ * scrubbing is needed.
223
+ *
224
+ * @param reply - The raw model reply text.
225
+ * @returns A scrubbed, bounded excerpt string.
226
+ */
227
+ export declare function truncateReply(reply: string): string;
172
228
  /**
173
229
  * Run the fix-generation stage: ask the injected {@link FixGenerator} for a patch,
174
230
  * validate it as a unified diff, and write it to the egress-expected patch path.
@@ -1 +1 @@
1
- {"version":3,"file":"fix-gen.d.ts","sourceRoot":"","sources":["../../src/selfimprove/fix-gen.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAKH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAYpD;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,4DAA4D;IAC5D,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,0DAA0D;IAC1D,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,mEAAmE;IACnE,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,+EAA+E;IAC/E,QAAQ,CAAC,WAAW,EAAE,SAAS,SAAS,EAAE,CAAC;IAC3C;;;;OAIG;IACH,QAAQ,CAAC,WAAW,EAAE,iBAAiB,CAAC;CACzC;AAED,+DAA+D;AAC/D,MAAM,WAAW,iBAAiB;IAChC,4DAA4D;IAC5D,QAAQ,CAA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