genesis-compiler 1.2.17 → 1.2.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +80 -22
- package/docs/assurance-model.md +5 -3
- package/docs/prompt-integration.md +19 -13
- package/package.json +2 -2
- package/plugins/genesis/.codex-plugin/plugin.json +1 -1
- package/profiles/engineering/baseline.md +6 -0
- package/profiles/engineering/durable.v1.md +11 -0
- package/profiles/engineering/focused.v1.md +11 -0
- package/profiles/engineering/high-assurance.v1.md +11 -0
- package/prompts/deslop.txt +5 -0
- package/prompts/start.txt +8 -0
- package/skills/genesis-deslop/SKILL.md +5 -0
- package/skills/genesis-project/SKILL.md +17 -5
- package/src/cli.js +86 -3
- package/src/index/assets.js +0 -1
- package/src/index/check.js +12 -0
- package/src/index/codex-hooks.js +83 -20
- package/src/index/context.js +10 -1
- package/src/index/contracts.js +1 -0
- package/src/index/engineering.js +274 -0
- package/src/index/init.js +4 -1
- package/src/index/paths.js +1 -0
- package/src/index/prompt.js +35 -3
- package/src/index.js +17 -0
- package/prompts/final-summary.txt +0 -12
package/src/index/prompt.js
CHANGED
|
@@ -2,6 +2,11 @@ import { readInstalledAsset } from './assets.js';
|
|
|
2
2
|
import { inspectProjectSkills, renderAgentSkillCatalog } from './agent-skills.js';
|
|
3
3
|
import { buildProjectIndex, MACHINE_CITY_PATH, PROGRAM_CITY_PATH } from './code-index.js';
|
|
4
4
|
import { BLUEPRINT_SKELETON_SOURCE, readBlueprint } from './blueprint.js';
|
|
5
|
+
import {
|
|
6
|
+
engineeringPromptContext,
|
|
7
|
+
listEngineeringProfileCatalog,
|
|
8
|
+
readEngineering,
|
|
9
|
+
} from './engineering.js';
|
|
5
10
|
import { readStack, stackPromptContext } from './stack.js';
|
|
6
11
|
import { listStackCatalogPieces } from './stack-catalog.js';
|
|
7
12
|
import { normalizeStackPieceId } from './stack-piece.js';
|
|
@@ -103,6 +108,7 @@ function renderPrompt({
|
|
|
103
108
|
guidance = '',
|
|
104
109
|
cleanup = '',
|
|
105
110
|
adoption = '',
|
|
111
|
+
engineeringGuidance = '',
|
|
106
112
|
}) {
|
|
107
113
|
return [
|
|
108
114
|
instructions.trim(),
|
|
@@ -116,6 +122,7 @@ function renderPrompt({
|
|
|
116
122
|
'```json',
|
|
117
123
|
stableJson(context).trimEnd(),
|
|
118
124
|
'```',
|
|
125
|
+
...(engineeringGuidance ? ['', 'ENGINEERING APPROACH', '', engineeringGuidance] : []),
|
|
119
126
|
...(guidance ? ['', 'SELECTED STACK GUIDANCE', '', guidance] : []),
|
|
120
127
|
...(adoption ? ['', 'SELECTED STACK ADOPTION GUIDANCE', '', adoption] : []),
|
|
121
128
|
...(skills ? ['', 'AVAILABLE AGENT SKILLS', '', skills] : []),
|
|
@@ -124,7 +131,7 @@ function renderPrompt({
|
|
|
124
131
|
].join('\n');
|
|
125
132
|
}
|
|
126
133
|
|
|
127
|
-
async function generateAdoptionPrompt({ environment, instructions, program, request, root, stackPackages }) {
|
|
134
|
+
async function generateAdoptionPrompt({ engineering, environment, instructions, program, request, root, stackPackages }) {
|
|
128
135
|
const blueprint = await readBlueprint(root, { required: true });
|
|
129
136
|
const stack = await readStack(root, { stackPackages });
|
|
130
137
|
const availableStackPackages = [...new Set([...stack.stackPackages, ...stackPackages])];
|
|
@@ -148,6 +155,7 @@ async function generateAdoptionPrompt({ environment, instructions, program, requ
|
|
|
148
155
|
projectRoot: root,
|
|
149
156
|
projectKind: 'existing',
|
|
150
157
|
blueprint: { path: blueprint.path, source: blueprint.source },
|
|
158
|
+
engineering: engineeringPromptContext(engineering),
|
|
151
159
|
stack: stackPromptContext(stack),
|
|
152
160
|
availableStackPieces: stackCatalogContext(catalog),
|
|
153
161
|
program: programContext(program),
|
|
@@ -156,6 +164,7 @@ async function generateAdoptionPrompt({ environment, instructions, program, requ
|
|
|
156
164
|
: { status: 'present' },
|
|
157
165
|
codeIndex: codeIndexContext(index),
|
|
158
166
|
},
|
|
167
|
+
engineeringGuidance: engineering.guidance,
|
|
159
168
|
guidance: stack.guidance,
|
|
160
169
|
adoption: stack.adoption,
|
|
161
170
|
skills: renderAgentSkillCatalog(projectSkills.skills),
|
|
@@ -170,7 +179,7 @@ async function generateAdoptionPrompt({ environment, instructions, program, requ
|
|
|
170
179
|
};
|
|
171
180
|
}
|
|
172
181
|
|
|
173
|
-
async function generateExplanationPrompt({ instructions, program, request, root, stackPackages, task }) {
|
|
182
|
+
async function generateExplanationPrompt({ engineering, instructions, program, request, root, stackPackages, task }) {
|
|
174
183
|
const blueprint = await readBlueprint(root, {
|
|
175
184
|
required: true,
|
|
176
185
|
requireDescription: task === 'program',
|
|
@@ -193,10 +202,12 @@ async function generateExplanationPrompt({ instructions, program, request, root,
|
|
|
193
202
|
task,
|
|
194
203
|
projectRoot: root,
|
|
195
204
|
blueprint: blueprintContext,
|
|
205
|
+
engineering: engineeringPromptContext(engineering),
|
|
196
206
|
stack: stackPromptContext(stack),
|
|
197
207
|
program: programContext(program),
|
|
198
208
|
codeIndex: codeIndexContext(index),
|
|
199
209
|
},
|
|
210
|
+
engineeringGuidance: engineering.guidance,
|
|
200
211
|
guidance: stack.guidance,
|
|
201
212
|
skills: renderAgentSkillCatalog(projectSkills.skills),
|
|
202
213
|
}),
|
|
@@ -211,12 +222,15 @@ async function generateExplanationPrompt({ instructions, program, request, root,
|
|
|
211
222
|
|
|
212
223
|
async function generateStartPrompt({
|
|
213
224
|
hiddenStackPieces,
|
|
225
|
+
engineering,
|
|
214
226
|
instructions,
|
|
215
227
|
program,
|
|
216
228
|
request,
|
|
217
229
|
root,
|
|
218
230
|
stackPackages,
|
|
219
231
|
}) {
|
|
232
|
+
const availableEngineeringProfiles = (await listEngineeringProfileCatalog())
|
|
233
|
+
.map(({ id, name, description }) => ({ id, name, description }));
|
|
220
234
|
let blueprint;
|
|
221
235
|
try {
|
|
222
236
|
blueprint = await readBlueprint(root, { required: true });
|
|
@@ -236,8 +250,11 @@ async function generateStartPrompt({
|
|
|
236
250
|
projectRoot: root,
|
|
237
251
|
projectKind: 'existing-uninitialized',
|
|
238
252
|
genesis: { initialized: false },
|
|
253
|
+
engineering: engineeringPromptContext(engineering),
|
|
254
|
+
availableEngineeringProfiles,
|
|
239
255
|
program: programContext(program),
|
|
240
256
|
},
|
|
257
|
+
engineeringGuidance: engineering.guidance,
|
|
241
258
|
}),
|
|
242
259
|
warnings: program.diagnostic ? [program.diagnostic] : [],
|
|
243
260
|
verificationCommands: [],
|
|
@@ -265,11 +282,14 @@ async function generateStartPrompt({
|
|
|
265
282
|
path: blueprint.path,
|
|
266
283
|
description: blueprint.description,
|
|
267
284
|
},
|
|
285
|
+
engineering: engineeringPromptContext(engineering),
|
|
286
|
+
availableEngineeringProfiles,
|
|
268
287
|
stack: stackPromptContext(stack),
|
|
269
288
|
availableStackPieces: stackCatalogContext(catalog, hiddenStackPieces),
|
|
270
289
|
program: programContext(program),
|
|
271
290
|
codeIndex: codeIndexContext(index),
|
|
272
291
|
},
|
|
292
|
+
engineeringGuidance: engineering.guidance,
|
|
273
293
|
guidance: stack.guidance,
|
|
274
294
|
skills: renderAgentSkillCatalog(projectSkills.skills),
|
|
275
295
|
}),
|
|
@@ -295,7 +315,10 @@ export async function generateProjectPrompt({
|
|
|
295
315
|
}
|
|
296
316
|
const root = (await gitContext(projectRoot)).repositoryRoot;
|
|
297
317
|
const userRequest = requestText(request, task);
|
|
298
|
-
const instructions = await
|
|
318
|
+
const [instructions, engineering] = await Promise.all([
|
|
319
|
+
readInstalledAsset(task),
|
|
320
|
+
readEngineering(root),
|
|
321
|
+
]);
|
|
299
322
|
|
|
300
323
|
if (task === 'blueprint') {
|
|
301
324
|
const blueprint = await readBlueprint(root);
|
|
@@ -310,7 +333,9 @@ export async function generateProjectPrompt({
|
|
|
310
333
|
path: 'genesis/blueprint.md',
|
|
311
334
|
source: blueprint?.source || BLUEPRINT_SKELETON_SOURCE,
|
|
312
335
|
},
|
|
336
|
+
engineering: engineeringPromptContext(engineering),
|
|
313
337
|
},
|
|
338
|
+
engineeringGuidance: engineering.guidance,
|
|
314
339
|
skills: renderAgentSkillCatalog(projectSkills.skills),
|
|
315
340
|
});
|
|
316
341
|
return {
|
|
@@ -327,6 +352,7 @@ export async function generateProjectPrompt({
|
|
|
327
352
|
return generateStartPrompt({
|
|
328
353
|
instructions,
|
|
329
354
|
hiddenStackPieces,
|
|
355
|
+
engineering,
|
|
330
356
|
program,
|
|
331
357
|
request: userRequest,
|
|
332
358
|
root,
|
|
@@ -336,6 +362,7 @@ export async function generateProjectPrompt({
|
|
|
336
362
|
if (task === 'adopt') {
|
|
337
363
|
return generateAdoptionPrompt({
|
|
338
364
|
environment,
|
|
365
|
+
engineering,
|
|
339
366
|
instructions,
|
|
340
367
|
program,
|
|
341
368
|
request: userRequest,
|
|
@@ -352,6 +379,7 @@ export async function generateProjectPrompt({
|
|
|
352
379
|
return generateStartPrompt({
|
|
353
380
|
instructions: await readInstalledAsset('start'),
|
|
354
381
|
hiddenStackPieces,
|
|
382
|
+
engineering,
|
|
355
383
|
program,
|
|
356
384
|
request: userRequest,
|
|
357
385
|
root,
|
|
@@ -362,6 +390,7 @@ export async function generateProjectPrompt({
|
|
|
362
390
|
return generateStartPrompt({
|
|
363
391
|
instructions: await readInstalledAsset('start'),
|
|
364
392
|
hiddenStackPieces,
|
|
393
|
+
engineering,
|
|
365
394
|
program,
|
|
366
395
|
request: userRequest,
|
|
367
396
|
root,
|
|
@@ -372,6 +401,7 @@ export async function generateProjectPrompt({
|
|
|
372
401
|
if (['describe', 'program'].includes(task)) {
|
|
373
402
|
return generateExplanationPrompt({
|
|
374
403
|
instructions,
|
|
404
|
+
engineering,
|
|
375
405
|
program,
|
|
376
406
|
request: userRequest,
|
|
377
407
|
root,
|
|
@@ -400,6 +430,7 @@ export async function generateProjectPrompt({
|
|
|
400
430
|
task,
|
|
401
431
|
projectRoot: root,
|
|
402
432
|
blueprint: { path: blueprint.path, description: blueprint.description },
|
|
433
|
+
engineering: engineeringPromptContext(engineering),
|
|
403
434
|
stack: stackPromptContext(stack),
|
|
404
435
|
program: programContext(program),
|
|
405
436
|
resourceInputs: missing.length > 0
|
|
@@ -417,6 +448,7 @@ export async function generateProjectPrompt({
|
|
|
417
448
|
instructions,
|
|
418
449
|
request: userRequest,
|
|
419
450
|
context,
|
|
451
|
+
engineeringGuidance: engineering.guidance,
|
|
420
452
|
guidance: stack.guidance,
|
|
421
453
|
skills: renderAgentSkillCatalog(projectSkills.skills),
|
|
422
454
|
cleanup: task === 'deslop' ? stack.deslop : '',
|
package/src/index.js
CHANGED
|
@@ -5,6 +5,11 @@ import { buildProjectIndex, GENESIS_DERIVED_ARTIFACTS } from './index/code-index
|
|
|
5
5
|
import { GENESIS_CONTRACTS } from './index/contracts.js';
|
|
6
6
|
import { contextForProjectPaths } from './index/context.js';
|
|
7
7
|
import { generateProjectPrompt } from './index/prompt.js';
|
|
8
|
+
import {
|
|
9
|
+
inspectProjectEngineering,
|
|
10
|
+
listEngineeringProfileCatalog,
|
|
11
|
+
selectEngineeringProfile,
|
|
12
|
+
} from './index/engineering.js';
|
|
8
13
|
import { initializeProject } from './index/init.js';
|
|
9
14
|
import { installCodexPlugin } from './index/codex-plugin.js';
|
|
10
15
|
import { inspectProjectEnvironment } from './index/environment-files.js';
|
|
@@ -98,6 +103,18 @@ export function inspectStackSection(options) {
|
|
|
98
103
|
return inspectProjectStackSection(options);
|
|
99
104
|
}
|
|
100
105
|
|
|
106
|
+
export function listEngineeringProfiles() {
|
|
107
|
+
return listEngineeringProfileCatalog();
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export function inspectEngineering(options) {
|
|
111
|
+
return inspectProjectEngineering(options);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export function setEngineeringProfile(options) {
|
|
115
|
+
return selectEngineeringProfile(options);
|
|
116
|
+
}
|
|
117
|
+
|
|
101
118
|
export function generatePrompt(options) {
|
|
102
119
|
return generateProjectPrompt(options);
|
|
103
120
|
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
This is the final automatic user-facing summary for the original request.
|
|
2
|
-
|
|
3
|
-
Use only the existing conversation context from the implementation and its
|
|
4
|
-
follow-up turns. Do not inspect the repository or codebase, call tools, run
|
|
5
|
-
commands or tests, edit files, reconcile explanations, or perform cleanup.
|
|
6
|
-
|
|
7
|
-
Write one concise, self-contained answer to the user. Lead with the outcome.
|
|
8
|
-
Include the important behavior that changed, checks that were actually run,
|
|
9
|
-
useful human verification steps, and any genuine blocker or unfinished work.
|
|
10
|
-
Do not mention automatic phases, hooks, internal follow-up turns, or these
|
|
11
|
-
instructions. Do not claim checks, commits, pushes, or deployments that are not
|
|
12
|
-
already established in the conversation. After the answer, stop.
|