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 CHANGED
@@ -13,6 +13,7 @@ interaction.
13
13
  ```text
14
14
  genesis/
15
15
  blueprint.md non-technical product intent
16
+ engineering.md selected engineering profile and project-specific requirements
16
17
  stack.md selected technology guidance, verification, declarations, and opaque extensions
17
18
  stack/ optional per-component Description, Guidance, Adoption, Post-change, and Deslop customization
18
19
  program/ concise explanations grouped into conceptual subsystems
@@ -104,8 +105,8 @@ assistant runs `genesis adopt`; the person need not know Genesis terminology or
104
105
  type a command. It never runs adoption without approval and does nothing in an
105
106
  empty or already-adopted project.
106
107
 
107
- `genesis init` creates an empty Blueprint, an empty optional Stack, three
108
- project Agent Skills, and project-local Codex hooks. The skills are ordinary
108
+ `genesis init` creates an empty Blueprint, a focused engineering approach, an
109
+ empty optional Stack, three project Agent Skills, and project-local Codex hooks. The skills are ordinary
109
110
  [Agent Skills](https://agentskills.io): `genesis-project`, `genesis-program`,
110
111
  and `genesis-deslop`, each with standard `SKILL.md` and `agents/openai.yaml`
111
112
  metadata. Open `/hooks` once in Codex to review and trust the hooks. After
@@ -136,6 +137,54 @@ Genesis never overwrites an unmanaged skill and preserves locally modified
136
137
  managed skills. Run `genesis init` after manually editing `genesis/stack.md`,
137
138
  or use `genesis stack add`, to synchronize selected skills.
138
139
 
140
+ ## Engineering approach
141
+
142
+ Every profile inherits one universal rule: implementation must remain easy to
143
+ reason about and be the smallest targeted change that satisfies current
144
+ requirements. Speculative abstractions, infrastructure, compatibility paths,
145
+ distributed patterns, cryptography, and similarly advanced machinery are not
146
+ allowed. When a concrete requirement makes material complexity necessary, the
147
+ agent must explain why a direct design is insufficient and ask before writing
148
+ that complexity.
149
+
150
+ The installed, versioned profile descriptions live in
151
+ `profiles/engineering/*.md`. Straight Genesis users can inspect and select them
152
+ without editing Markdown grammar:
153
+
154
+ ```bash
155
+ genesis engineering list
156
+ genesis engineering show focused.v1
157
+ genesis engineering set durable.v1
158
+ ```
159
+
160
+ `focused.v1` is the default for small direct product work. `durable.v1` adds
161
+ explicit compatibility and operational care for long-lived products.
162
+ `high-assurance.v1` adds risk-driven security and reliability discipline. None
163
+ of them mandates complexity without a concrete need.
164
+
165
+ The selection and any explicit project overrides are portable source:
166
+
167
+ ```markdown
168
+ # Engineering approach
169
+
170
+ ## Profile
171
+
172
+ - `focused.v1`
173
+
174
+ ## Project requirements
175
+
176
+ - Nothing.
177
+ ```
178
+
179
+ People may edit `## Project requirements` to name obligations the presets do
180
+ not capture, including a specific organizational, compliance, cryptographic,
181
+ or scale constraint. `genesis engineering set` changes only the profile and
182
+ preserves those requirements. Generated prompts, path-focused context, Codex
183
+ session guidance, Post-change work, and Deslop all receive the effective
184
+ approach. A project upgraded from an older Genesis release safely uses
185
+ `focused.v1` until `genesis init` or `genesis engineering set focused.v1`
186
+ records the file.
187
+
139
188
  Hosts that manage project environments can call `inspectEnvironment()`.
140
189
  Concrete Stack integrations may declare public, non-secret Environment
141
190
  defaults such as the database driver selected by that integration. Explicit
@@ -212,26 +261,27 @@ Python, Java, C#, C/C++, PHP, Go, Rust, Ruby, Kotlin, and Shell. A future techno
212
261
  adds its adapter through its Stack piece rather than teaching Genesis prompts
213
262
  to parse that language.
214
263
 
215
- At the end of a turn that changed Git-visible project files, the Stop hook asks
216
- Codex for bounded follow-up turns. When the selected Stack contributes
217
- `Post-change` work, all contributions compose deterministically into one
218
- optional code-changing turn. Genesis then reconciles the Blueprint and affected
219
- Program explanations from the complete changed-path set and actual Git diff,
220
- and refreshes both City projections. A focused, behavior-preserving Deslop pass
221
- runs before both Cities are refreshed again. Genesis then requests one concise
222
- user-facing summary using conversation context only; that final phase is not
223
- Stack-configurable and cannot schedule more cleanup. A project with no selected
224
- Stack uses only the `genesis-deslop` skill. Selected Stack components enrich
225
- Post-change work, reconciliation, and cleanup with general Guidance, and enrich
226
- cleanup further with technology-specific Deslop guidance.
264
+ Before changing project files for a user-requested implementation, Codex runs
265
+ `genesis hook authorize`. At the end of an authorized turn that changed
266
+ Git-visible project files, the Stop hook asks Codex for bounded follow-up turns.
267
+ Unmarked turns finish normally even if another process changes the same
268
+ checkout. When the selected Stack contributes `Post-change` work, all
269
+ contributions compose deterministically into one optional code-changing turn.
270
+ Genesis then reconciles the Blueprint and affected Program explanations from
271
+ the complete changed-path set and actual Git diff, and refreshes both City
272
+ projections. A focused, behavior-preserving Deslop pass runs before both Cities
273
+ are refreshed again; its response is the concise user-facing completion. A
274
+ project with no selected Stack uses only the `genesis-deslop` skill. Selected
275
+ Stack components enrich Post-change work, reconciliation, and cleanup with
276
+ general Guidance, and enrich cleanup further with technology-specific Deslop
277
+ guidance.
227
278
 
228
279
  The hook never starts another Codex process. Its small per-session phase is
229
280
  limited to `implementation -> optional post-change -> reconcile -> deslop ->
230
- summary -> done`, so it cannot keep continuing recursively. The summary prompt
231
- forbids repository inspection, tools, commands, tests, and edits, and the next
232
- Stop always clears the sequence rather than scheduling more work. Empty
233
- Post-change content is skipped rather than producing an empty turn.
234
- Question-only and unchanged turns finish normally.
281
+ done`, so it cannot keep continuing recursively. The Stop after Deslop clears
282
+ the sequence rather than scheduling another model turn. Empty Post-change
283
+ content is skipped rather than producing an empty turn. Question, explanation,
284
+ review, diagnosis-only, and unchanged turns finish normally.
235
285
 
236
286
  Projects can customize a selected technology through its matching file, such
237
287
  as `genesis/stack/jskit.md`:
@@ -323,7 +373,8 @@ The eight task types are deliberately explicit:
323
373
  contracts into Genesis metadata. It composes technology-specific Adoption
324
374
  requirements from the selected Stack and does not change application code.
325
375
  - `work` implements the Blueprint and optional request using current code,
326
- Program, selected Stack context, and progressively loaded Agent Skills.
376
+ Program, the selected engineering approach, selected Stack context, and
377
+ progressively loaded Agent Skills.
327
378
  - `deslop` requests cleanup explicitly. Codex projects also receive a bounded
328
379
  automatic Deslop turn after their separate explanatory reconciliation turn.
329
380
  - `program` edits only `genesis/program/` to explain the code that exists, with
@@ -422,7 +473,7 @@ genesis check
422
473
 
423
474
  `check` is read-only. It reports only structural or recorded facts:
424
475
 
425
- - Blueprint and Stack validity;
476
+ - Blueprint, engineering approach, and Stack validity;
426
477
  - selected Agent Skill presence and structural validity;
427
478
  - Program presence and structural validity;
428
479
  - environment declarations and consumer-owned Stack extensions as `ready`,
@@ -451,10 +502,13 @@ import {
451
502
  getContext,
452
503
  indexCodebase,
453
504
  initialize,
505
+ inspectEngineering,
454
506
  inspectEnvironment,
455
507
  inspectStackSection,
456
508
  installCodex,
509
+ listEngineeringProfiles,
457
510
  listStackPieces,
511
+ setEngineeringProfile,
458
512
  verify,
459
513
  } from 'genesis-compiler';
460
514
  ```
@@ -463,6 +517,9 @@ import {
463
517
  Stack skills, and local Codex hooks.
464
518
  `adoptProject()` also returns the initial `adopt` prompt for an existing
465
519
  codebase. `installCodex()` installs the optional global discovery plugin.
520
+ `listEngineeringProfiles()`, `inspectEngineering()`, and
521
+ `setEngineeringProfile()` expose the same built-in catalog and portable
522
+ project selection used by the CLI and hosts.
466
523
  `getContext()` resolves source paths to the Program modules that cite them,
467
524
  the functions already declared there, selected Stack guidance, available Agent
468
525
  Skills, and verification commands. `indexCodebase()` regenerates or returns the
@@ -474,7 +531,8 @@ projection paths without returning any supplied environment value.
474
531
  interpreting or executing its contents.
475
532
 
476
533
  Normalized results identify their stable public contract in the `contract`
477
- field: `genesis.environment.v1`, `genesis.stack-section.v1`, or
534
+ field: `genesis.engineering.v1`, `genesis.environment.v2`,
535
+ `genesis.stack-section.v1`, or
478
536
  `genesis.verification.v1`. A consumer defines any schema embedded inside the
479
537
  opaque section body.
480
538
 
@@ -2,7 +2,9 @@
2
2
 
3
3
  Genesis reports only facts it can establish mechanically:
4
4
 
5
- 1. Blueprint, Stack, and Program files satisfy their small structural formats.
5
+ 1. Blueprint, Engineering approach, Stack, and Program files satisfy their
6
+ small structural formats, and the selected engineering profile exists in
7
+ the installed versioned catalog.
6
8
  2. Program operations live in conceptual subsystem directories and cite real
7
9
  source files. Optional helper maps are not mechanically certified.
8
10
  3. Stack-declared environment inputs are present and non-placeholder. This does
@@ -17,8 +19,8 @@ Genesis reports only facts it can establish mechanically:
17
19
  City projects the Program modules and source citations that exist. Neither
18
20
  proves semantic equivalence, complete dynamic dispatch, or true duplication.
19
21
 
20
- Prompt text, Stack Description/Guidance/Adoption/Post-change/Deslop prose, Program prose, Agent Skill
21
- content, and agent output are not assurance evidence. Genesis does not claim
22
+ Prompt text, engineering guidance, Stack Description/Guidance/Adoption/Post-change/Deslop prose,
23
+ Program prose, Agent Skill content, and agent output are not assurance evidence. Genesis does not claim
22
24
  that product intent and code have converged, that Program is complete or
23
25
  semantically current, or that passing checks prove the whole product correct.
24
26
 
@@ -40,6 +40,10 @@ Genesis keeps each instruction at one useful level:
40
40
  commands, opaque consumer sections, and an optional authoritative Agent Skill source.
41
41
  - `genesis/blueprint.md`, `genesis/program/`, and `genesis/stack.md` are the
42
42
  project's own intent, explanation, and selected technical composition.
43
+ - `profiles/engineering/*.md` owns the installed versioned engineering
44
+ profiles. `genesis/engineering.md` selects one profile and records explicit
45
+ project requirements. A universal complexity gate is composed ahead of the
46
+ selected profile in every implementation and cleanup path.
43
47
  - The generated JSON block contains current structural facts and warnings.
44
48
 
45
49
  Detailed technology manuals belong in the technology skill's `references/`
@@ -73,23 +77,25 @@ command itself and follows its returned prompt in the same conversation. Other
73
77
  hosts can call `adoptProject()` and send its `prompt` directly.
74
78
 
75
79
  Codex can instead use the project-local hooks installed by `genesis init`.
76
- Those hooks inject a short operating guide, record whether the current turn
77
- changed project files, then request bounded continuations. Selected
80
+ Those hooks inject a short operating guide and record the Git-visible state when
81
+ each user prompt begins. Before editing for an explicit user implementation
82
+ request, Codex marks that turn with `genesis hook authorize`. Only an authorized
83
+ turn whose project files changed can request bounded continuations; unmarked
84
+ turns finish normally even if another process changes the checkout. Selected
78
85
  `Post-change` contributions compose into one optional code-changing turn;
79
86
  Genesis then reconciles Blueprint and affected Program explanations from the
80
- complete Git-visible change set and Deslops the implementation. One final
81
- summary prompt then asks for a concise user-facing account from conversation
82
- context only, forbids tools and edits, and cannot schedule more cleanup. The
83
- hooks invoke the same Genesis project operations and never start another agent
84
- process. A per-session phase permits only `implementation -> optional
85
- post-change -> reconcile -> deslop -> summary -> done`. Empty Post-change
86
- content skips that phase. Genesis refreshes both City projections after
87
- reconciliation so Deslop sees the current explanation and function inventory,
88
- then refreshes them again after Deslop in case cleanup changed the
89
- implementation map.
87
+ complete Git-visible change set and Deslops the implementation. The Deslop
88
+ response is the concise user-facing completion. The hooks invoke the same
89
+ Genesis project operations and never start another agent process. A per-session
90
+ phase permits only `implementation -> optional post-change -> reconcile ->
91
+ deslop -> done`. Empty Post-change content skips that phase. Genesis refreshes
92
+ both City projections after reconciliation so Deslop sees the current
93
+ explanation and function inventory, then refreshes them again after Deslop in
94
+ case cleanup changed the implementation map.
90
95
 
91
96
  Once Codex identifies relevant source, `genesis context <path...>` returns only
92
- Program modules citing those paths plus concise selected Stack context, the
97
+ Program modules citing those paths plus the effective engineering approach and
98
+ concise selected Stack context, the
93
99
  functions structurally indexed in those paths, available Agent Skill catalog,
94
100
  and verification commands. `genesis index <name-or-path>` searches the complete
95
101
  current function inventory and refreshes `.genesis/machine-city.json` and
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "genesis-compiler",
3
- "version": "1.2.17",
3
+ "version": "1.2.19",
4
4
  "type": "module",
5
5
  "description": "An agent-independent prompt, multi-language code-index, cleanup, and verification companion with optional Codex hooks.",
6
6
  "repository": {
@@ -31,13 +31,13 @@
31
31
  "prompts/adopt.txt",
32
32
  "prompts/describe.txt",
33
33
  "prompts/deslop.txt",
34
- "prompts/final-summary.txt",
35
34
  "prompts/program.txt",
36
35
  "prompts/reconcile.txt",
37
36
  "prompts/review.txt",
38
37
  "prompts/start.txt",
39
38
  "prompts/work.txt",
40
39
  "plugins/genesis",
40
+ "profiles",
41
41
  "skills",
42
42
  "src"
43
43
  ],
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "genesis",
3
- "version": "1.2.17",
3
+ "version": "1.2.19",
4
4
  "description": "Makes Codex aware of optional Genesis adoption for existing projects.",
5
5
  "author": {
6
6
  "name": "Mobily Enterprises"
@@ -0,0 +1,6 @@
1
+ # Engineering baseline
2
+
3
+ - Every implementation must be easy to reason about and be the smallest targeted change that fully satisfies the known requirements.
4
+ - Prefer direct control flow, existing ownership boundaries, and established project or technology seams.
5
+ - Do not overengineer or overcomplicate the solution. Do not add speculative abstractions, layers, dependencies, infrastructure, compatibility paths, distributed patterns, cryptography, enterprise patterns, or other advanced machinery unless an explicit requirement or a concrete constraint makes it necessary.
6
+ - If good software requires material complexity beyond these rules, stop before writing it. Explain the requirement, why the direct design is insufficient, and the smallest added complexity proposed, then ask the user to approve or clarify the tradeoff.
@@ -0,0 +1,11 @@
1
+ # Durable product
2
+
3
+ ## Description
4
+
5
+ Long-lived product work with explicit compatibility and operational care.
6
+
7
+ ## Guidance
8
+
9
+ - Treat affected public contracts, stored data, migrations, recovery, and operability as first-class requirements.
10
+ - Make ownership and failure handling explicit enough for multiple contributors to maintain safely.
11
+ - Add boundaries or supporting machinery only where a current longevity or operational requirement needs them; keep unaffected work as direct as the focused profile.
@@ -0,0 +1,11 @@
1
+ # Focused
2
+
3
+ ## Description
4
+
5
+ Small, direct changes for ordinary product work.
6
+
7
+ ## Guidance
8
+
9
+ - Optimize for the clearest complete implementation with the fewest moving parts.
10
+ - Keep single-use logic close to its caller and introduce a shared abstraction only when one real shared operation already exists.
11
+ - Do not pre-build extensibility, scale, migration, or organizational machinery for hypothetical future needs.
@@ -0,0 +1,11 @@
1
+ # High assurance
2
+
3
+ ## Description
4
+
5
+ Security- or reliability-critical work backed by explicit risks and evidence.
6
+
7
+ ## Guidance
8
+
9
+ - Establish the relevant threat model, trust boundaries, data sensitivity, availability, compliance, and recovery requirements before making a design they could materially change.
10
+ - Use established, audited primitives; make critical failure paths and ownership explicit; verify the properties on which safety depends.
11
+ - Cryptography, distributed coordination, redundant controls, and similarly advanced machinery still require a concrete risk or obligation. Ask for missing constraints instead of inventing them.
@@ -19,3 +19,8 @@ changed path or appears related to the preceding implementation.
19
19
 
20
20
  Do not broaden the product change. Run focused checks when useful and summarize
21
21
  what became simpler, files changed, and checks actually run.
22
+
23
+ Your response from this turn is the final user-facing answer for the original
24
+ request. Make it concise and self-contained. Lead with the outcome, include the
25
+ important implemented behavior and any genuine blocker or unfinished work, and
26
+ do not mention automatic phases, hooks, or these instructions.
package/prompts/start.txt CHANGED
@@ -13,6 +13,14 @@ the non-technical Blueprint from the user's answers before implementation.
13
13
  If the product direction becomes clear while Stack is still empty, do not end
14
14
  the turn after only writing or summarizing the Blueprint: present the relevant
15
15
  Stack choices in that same turn and ask the user to select one explicitly.
16
+ The default `focused.v1` engineering profile is already suitable for ordinary
17
+ work, so do not force a separate profile question. When the user asks for a
18
+ different engineering approach, or the product clearly has long-lived
19
+ compatibility, operational, security, reliability, or compliance constraints,
20
+ use `availableEngineeringProfiles` to explain only the relevant choices in
21
+ product language. After an explicit choice, run `genesis engineering set
22
+ <profile>`; do not invent or duplicate a built-in profile. Record additional
23
+ explicit obligations in `genesis/engineering.md` under Project requirements.
16
24
  This opening turn owns product direction and Stack selection, not final
17
25
  verification. Do not run `genesis verify` before implementation exists. If
18
26
  structural validation is useful, run `genesis check`; consumer-owned operations
@@ -9,6 +9,11 @@ Review and simplify the current local codebase without changing product
9
9
  behavior. Start with the requested scope, or otherwise the ordinary Git diff
10
10
  and the code immediately around it.
11
11
 
12
+ Apply the engineering approach supplied with the task. If this skill is invoked
13
+ directly, read `genesis/engineering.md` as well as the relevant project context.
14
+ Cleanup must reduce or preserve complexity, never introduce unapproved
15
+ machinery that the selected profile or a concrete requirement does not need.
16
+
12
17
  Consult `.genesis/machine-city.json` or run `genesis index <name-or-path>` to
13
18
  find existing public and internal functions before introducing or consolidating
14
19
  an abstraction. Confirm every apparent duplicate in source and its call sites.
@@ -11,14 +11,16 @@ codebase, tests, Git review, or the coding agent.
11
11
  ## Establish context
12
12
 
13
13
  1. Read `genesis/blueprint.md` for non-technical product intent.
14
- 2. Read `genesis/stack.md` for the selected technical composition, resources,
14
+ 2. Read `genesis/engineering.md` for the selected engineering profile and any
15
+ project-specific requirements.
16
+ 3. Read `genesis/stack.md` for the selected technical composition, resources,
15
17
  and verification commands.
16
- 3. Locate the source involved in the request.
17
- 4. Run `genesis index <name-or-path>` before adding a helper or public operation.
18
+ 4. Locate the source involved in the request.
19
+ 5. Run `genesis index <name-or-path>` before adding a helper or public operation.
18
20
  Reuse an existing function when it already owns the behavior.
19
- 5. Run `genesis context <path...>` for the relevant Program explanations and
21
+ 6. Run `genesis context <path...>` for the relevant Program explanations and
20
22
  selected Stack context.
21
- 6. Load applicable technology skills from `.agents/skills/` or from the
23
+ 7. Load applicable technology skills from `.agents/skills/` or from the
22
24
  agent's own installed skill catalog.
23
25
 
24
26
  For an existing application's first Stack selection, inspect its real setup,
@@ -40,6 +42,16 @@ Neither is authority or proof; both may be regenerated with `genesis index`.
40
42
 
41
43
  ## Implement ordinary local work
42
44
 
45
+ - Apply the effective engineering approach supplied by Genesis. Every change
46
+ must be easy to reason about and be the smallest targeted implementation that
47
+ fully meets known requirements. Do not overengineer or overcomplicate it, and
48
+ do not add speculative abstractions, layers,
49
+ dependencies, infrastructure, compatibility paths, distributed patterns,
50
+ cryptography, or other advanced machinery.
51
+ - When a concrete requirement makes material complexity necessary, stop before
52
+ writing it. Explain why the direct design is insufficient and the smallest
53
+ added complexity proposed, then ask the user to approve or clarify the
54
+ tradeoff. Never silently override the engineering approach.
43
55
  - Work directly in the current Git tree and leave useful edits visible in the
44
56
  ordinary diff.
45
57
  - Do not edit the Blueprint, Program, or `.genesis/` during implementation; the
package/src/cli.js CHANGED
@@ -9,25 +9,33 @@ import {
9
9
  getContext,
10
10
  indexCodebase,
11
11
  initialize,
12
+ inspectEngineering,
12
13
  inspectEnvironment,
13
14
  inspectStackSection,
14
15
  installCodex,
16
+ listEngineeringProfiles,
15
17
  listStackPieces,
18
+ setEngineeringProfile,
16
19
  verify,
17
20
  } from './index.js';
18
21
  import {
22
+ authorizeCodexTurn,
19
23
  codexAdoptionRecommendation,
20
24
  codexSessionContext,
21
25
  completeCodexTurn,
22
26
  discardCodexTurn,
23
27
  recordCodexTurn,
24
28
  } from './index/codex-hooks.js';
29
+ import { engineeringProfile, readEngineeringBaseline } from './index/engineering.js';
25
30
  import { asDiagnostic, fail } from './index/errors.js';
26
31
 
27
32
  const USAGE = `Usage:
28
33
  genesis init
29
34
  genesis adopt [product guidance...]
30
35
  genesis codex install
36
+ genesis engineering list
37
+ genesis engineering show [profile]
38
+ genesis engineering set <profile>
31
39
  genesis stack list
32
40
  genesis stack add <piece...>
33
41
  genesis context <path...>
@@ -51,7 +59,7 @@ prompt to the agent you already use. Review all edits through the ordinary Git
51
59
  diff, then run genesis verify for the Stack's concrete checks.
52
60
  `;
53
61
 
54
- const COMMANDS = new Set(['adopt', 'check', 'codex', 'context', 'hook', 'index', 'init', 'inspect', 'prompt', 'stack', 'verify']);
62
+ const COMMANDS = new Set(['adopt', 'check', 'codex', 'context', 'engineering', 'hook', 'index', 'init', 'inspect', 'prompt', 'stack', 'verify']);
55
63
 
56
64
  function parseCommand(argv) {
57
65
  if (argv.length === 0 || argv.includes('--help') || argv.includes('-h') || argv[0] === 'help') {
@@ -95,6 +103,20 @@ function parseCommand(argv) {
95
103
  if (operands[0] === 'list' && operands.length !== 1) {
96
104
  fail('CLI_EXTRA_ARGUMENT', 'Command stack list accepts no extra arguments.');
97
105
  }
106
+ } else if (command === 'engineering') {
107
+ const [action] = operands;
108
+ if (!['list', 'show', 'set'].includes(action)) {
109
+ fail('CLI_ENGINEERING_ACTION_REQUIRED', 'Command engineering requires list, show, or set.');
110
+ }
111
+ if (action === 'list' && operands.length !== 1) {
112
+ fail('CLI_EXTRA_ARGUMENT', 'Command engineering list accepts no extra arguments.');
113
+ }
114
+ if (action === 'show' && operands.length > 2) {
115
+ fail('CLI_EXTRA_ARGUMENT', 'Command engineering show accepts at most one profile.');
116
+ }
117
+ if (action === 'set' && operands.length !== 2) {
118
+ fail('CLI_ENGINEERING_PROFILE_REQUIRED', 'Command engineering set requires exactly one profile.');
119
+ }
98
120
  } else if (command === 'codex') {
99
121
  if (operands.length !== 1 || operands[0] !== 'install') {
100
122
  fail('CLI_CODEX_ACTION_REQUIRED', 'Command codex requires exactly: install.');
@@ -110,8 +132,8 @@ function parseCommand(argv) {
110
132
  'Command inspect requires environment or section <name>.',
111
133
  );
112
134
  }
113
- } else if (command === 'hook' && (operands.length !== 1 || !['begin', 'discover', 'end', 'session', 'stop'].includes(operands[0]))) {
114
- fail('CLI_HOOK_ACTION_REQUIRED', 'Command hook requires exactly one of: discover, session, begin, stop, end.');
135
+ } else if (command === 'hook' && (operands.length !== 1 || !['authorize', 'begin', 'discover', 'end', 'session', 'stop'].includes(operands[0]))) {
136
+ fail('CLI_HOOK_ACTION_REQUIRED', 'Command hook requires exactly one of: discover, session, begin, authorize, stop, end.');
115
137
  } else if (!['adopt', 'context', 'hook', 'index', 'inspect', 'prompt'].includes(command) && operands.length > 0) {
116
138
  fail('CLI_EXTRA_ARGUMENT', `Command ${command} accepts no arguments.`);
117
139
  }
@@ -130,6 +152,7 @@ function namedItems(label, values) {
130
152
 
131
153
  function writeCheck(result) {
132
154
  line(process.stdout, `Blueprint: ${result.blueprint}`);
155
+ line(process.stdout, `Engineering approach: ${result.engineering}`);
133
156
  line(process.stdout, `Stack: ${result.stack}`);
134
157
  line(process.stdout, `Agent Skills: ${result.skills}`);
135
158
  line(process.stdout, `Program: ${result.program}`);
@@ -144,6 +167,29 @@ function writeCheck(result) {
144
167
  line(process.stdout, `Check: ${result.status}`);
145
168
  }
146
169
 
170
+ function writeEngineering(result) {
171
+ if (result.action === 'list') {
172
+ for (const profile of result.profiles) {
173
+ line(process.stdout, `${profile.id}: ${profile.name} — ${profile.description}`);
174
+ }
175
+ return;
176
+ }
177
+ if (result.profile) {
178
+ line(process.stdout, `${result.profile.name} (${result.profile.id})`);
179
+ line(process.stdout, result.profile.description);
180
+ }
181
+ if (result.guidance) {
182
+ line(process.stdout, '');
183
+ line(process.stdout, result.guidance);
184
+ }
185
+ if (result.action === 'set') {
186
+ namedItems('Changed files', result.changedFiles);
187
+ line(process.stdout, `engineering: ${result.status}`);
188
+ } else if (result.status) {
189
+ line(process.stdout, `Engineering approach: ${result.status}`);
190
+ }
191
+ }
192
+
147
193
  function writeInspection(result) {
148
194
  const title = result.inspection[0].toUpperCase() + result.inspection.slice(1);
149
195
  line(process.stdout, `${title}: ${result.status}`);
@@ -179,6 +225,10 @@ function writeResult(command, result) {
179
225
  writeCheck(result);
180
226
  return;
181
227
  }
228
+ if (command === 'engineering') {
229
+ writeEngineering(result);
230
+ return;
231
+ }
182
232
  if (command === 'context') {
183
233
  process.stdout.write(result.context.endsWith('\n') ? result.context : `${result.context}\n`);
184
234
  return;
@@ -254,6 +304,36 @@ async function execute({ command, operands, options }, { signal } = {}) {
254
304
  return adoptProject({ projectRoot, request: operands.join(' '), stackPackages });
255
305
  }
256
306
  if (command === 'codex') return installCodex();
307
+ if (command === 'engineering') {
308
+ if (operands[0] === 'list') {
309
+ return { action: 'list', status: 'ok', profiles: await listEngineeringProfiles() };
310
+ }
311
+ if (operands[0] === 'show') {
312
+ if (!operands[1]) return { action: 'show', ...await inspectEngineering({ projectRoot }) };
313
+ const [baseline, profile] = await Promise.all([
314
+ readEngineeringBaseline(),
315
+ engineeringProfile(operands[1]),
316
+ ]);
317
+ return {
318
+ action: 'show',
319
+ status: 'ready',
320
+ profile,
321
+ guidance: [
322
+ '## Universal complexity gate',
323
+ '',
324
+ baseline,
325
+ '',
326
+ '## Profile guidance',
327
+ '',
328
+ profile.guidance,
329
+ ].join('\n'),
330
+ };
331
+ }
332
+ return {
333
+ action: 'set',
334
+ ...await setEngineeringProfile({ profile: operands[1], projectRoot }),
335
+ };
336
+ }
257
337
  if (command === 'stack') {
258
338
  if (operands[0] === 'list') {
259
339
  return { status: 'ok', pieces: await listStackPieces({ projectRoot, stackPackages }) };
@@ -294,6 +374,9 @@ async function execute({ command, operands, options }, { signal } = {}) {
294
374
  if (operands[0] === 'session') {
295
375
  return { kind: 'session', ...await codexSessionContext({ projectRoot }) };
296
376
  }
377
+ if (operands[0] === 'authorize') {
378
+ return { kind: 'authorize', ...await authorizeCodexTurn({ projectRoot }) };
379
+ }
297
380
  const input = await hookInput();
298
381
  if (operands[0] === 'begin') {
299
382
  return { kind: 'begin', ...await recordCodexTurn({ input, projectRoot }) };
@@ -8,7 +8,6 @@ const assets = {
8
8
  describe: new URL('prompts/describe.txt', root),
9
9
  reconcile: new URL('prompts/reconcile.txt', root),
10
10
  deslop: new URL('prompts/deslop.txt', root),
11
- finalSummary: new URL('prompts/final-summary.txt', root),
12
11
  program: new URL('prompts/program.txt', root),
13
12
  blueprint: new URL('prompts/blueprint.txt', root),
14
13
  review: new URL('prompts/review.txt', root),
@@ -8,11 +8,13 @@ import { inspectVerification } from './project-state.js';
8
8
  import { missingStackResources } from './stack-preflight.js';
9
9
  import { withStackEnvironmentDefaults } from './stack-environment-defaults.js';
10
10
  import { inspectProjectEnvironment } from './environment-files.js';
11
+ import { readEngineering } from './engineering.js';
11
12
 
12
13
  function invalidResult(area, error) {
13
14
  return {
14
15
  status: 'invalid',
15
16
  blueprint: area === 'blueprint' ? 'invalid' : 'valid',
17
+ engineering: area === 'engineering' ? 'invalid' : 'unknown',
16
18
  stack: area === 'stack' ? 'invalid' : 'unknown',
17
19
  skills: area === 'skills' ? 'invalid' : 'unknown',
18
20
  program: 'unknown',
@@ -40,6 +42,13 @@ export async function checkProject({
40
42
  }
41
43
 
42
44
  let stack;
45
+ let engineering;
46
+ try {
47
+ engineering = await readEngineering(root);
48
+ } catch (error) {
49
+ return invalidResult('engineering', error);
50
+ }
51
+
43
52
  try {
44
53
  stack = await readStack(root, { stackPackages });
45
54
  } catch (error) {
@@ -87,6 +96,7 @@ export async function checkProject({
87
96
 
88
97
  const guidance = [];
89
98
  if (program.status === 'missing') guidance.push('Generate an explanatory Program prompt with genesis prompt --task program.');
99
+ if (engineering.status === 'defaulted') guidance.push('Run genesis init or genesis engineering set focused.v1 to record the default engineering approach.');
90
100
  if (program.status === 'invalid') guidance.push('Repair the Program with genesis prompt --task program.');
91
101
  if (skills.status === 'missing') guidance.push('Run genesis init to install selected project Agent Skills.');
92
102
  if (skills.status === 'invalid') guidance.push('Repair the reported Agent Skill or managed-skill manifest.');
@@ -99,6 +109,7 @@ export async function checkProject({
99
109
  guidance.push('Use genesis prompt --task review for a semantic, evidence-based comparison.');
100
110
 
101
111
  const needsAttention = program.status === 'missing'
112
+ || engineering.status === 'defaulted'
102
113
  || skills.status === 'missing'
103
114
  || missingResources.length > 0
104
115
  || extensionDiagnostics.length > 0
@@ -109,6 +120,7 @@ export async function checkProject({
109
120
  ? 'invalid'
110
121
  : needsAttention ? 'attention' : 'ok',
111
122
  blueprint: 'valid',
123
+ engineering: engineering.status,
112
124
  stack: 'valid',
113
125
  skills: skills.status,
114
126
  program: program.status,