genesis-compiler 1.2.2 → 1.2.4

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
@@ -14,7 +14,7 @@ interaction.
14
14
  genesis/
15
15
  blueprint.md non-technical product intent
16
16
  stack.md selected technology guidance, checks, setup, launch, and deployment data
17
- stack/ optional per-component Description, Guidance, and Deslop customization
17
+ stack/ optional per-component Description, Guidance, Adoption, and Deslop customization
18
18
  program/ concise explanations grouped into conceptual subsystems
19
19
  .agents/skills/
20
20
  genesis-* Genesis workflow skills
@@ -60,11 +60,13 @@ genesis adopt "Optional product guidance"
60
60
  ```
61
61
 
62
62
  It preserves the implementation, initializes the Genesis files and local
63
- hooks, and prints the `describe` prompt that creates the first useful Blueprint
64
- and Program. Give that prompt to the agent already working in the repository.
65
- For a large codebase, the prompt explicitly lets that agent decide whether to
66
- delegate inspection to subagents and requires it to synthesize one coherent
67
- result. “Adopt” is intentional: Genesis neither imports nor moves the project.
63
+ hooks, and prints the `adopt` prompt. That prompt imports the existing
64
+ application's factual Stack contract—including setup, environment/resources,
65
+ database preparation and seed, Launch/readiness, Preview identity,
66
+ verification, and deployment—then creates the first useful Blueprint and
67
+ Program. Give it to the agent already working in the repository. Adoption edits
68
+ Genesis metadata only; implementation modernization remains a separate,
69
+ explicitly approved port. “Adopt” never moves the project.
68
70
 
69
71
  For a new or empty project, initialize first and write the product intent:
70
72
 
@@ -83,10 +85,12 @@ genesis codex install
83
85
  ```
84
86
 
85
87
  When Codex opens a nonempty Git project without `genesis/blueprint.md`, the
86
- plugin's `SessionStart` hook runs before the first user prompt and adds a strong
87
- instruction to recommend `genesis adopt`. Codex cannot display an ordinary
88
- assistant reply until the user speaks, so the recommendation appears in its
89
- first reply. It never runs adoption without approval and does nothing in an
88
+ plugin's `SessionStart` hook runs before the first user prompt and asks the
89
+ assistant to recommend preparing the existing project for guided editing in
90
+ product language. Codex cannot display an ordinary assistant reply until the
91
+ user speaks, so the recommendation appears in its first reply. If approved, the
92
+ assistant runs `genesis adopt`; the person need not know Genesis terminology or
93
+ type a command. It never runs adoption without approval and does nothing in an
90
94
  empty or already-adopted project.
91
95
 
92
96
  `genesis init` creates an empty Blueprint, an empty optional Stack, three
@@ -116,8 +120,13 @@ Genesis never overwrites an unmanaged skill and preserves locally modified
116
120
  managed skills. Run `genesis init` after manually editing `genesis/stack.md`,
117
121
  or use `genesis stack add`, to synchronize selected skills.
118
122
 
119
- Hosts that create dependency-empty workspaces can call the public
120
- `inspectWorkspaceSetup()` API. A concrete Stack piece may declare one exact,
123
+ Run `genesis prepare` to execute the selected Stack's exact workspace recipe
124
+ directly with the caller's environment and installed toolchain. It executes
125
+ argument arrays without a shell, honors declared project-relative working
126
+ directories and conditional paths, stops on the first failure, and never
127
+ returns environment values. Hosts that need their own runtime, permission, or
128
+ process policy can instead call the public `inspectWorkspaceSetup()` API and
129
+ execute the same normalized recipe themselves. A concrete Stack piece may declare one exact,
121
130
  ordered `## Workspace setup` recipe with labels, argument arrays expressed as
122
131
  backticked tokens, abstract runtimes, and optional project-relative working
123
132
  directories and readiness paths. A recipe whose declared project marker does
@@ -127,8 +136,9 @@ piece waits for `package.json` and then declares `npm install`; generic
127
136
  `genesis/stack.md` replaces all component defaults, including with
128
137
  `- Nothing.`. Without that override, exactly one component recipe is used;
129
138
  multiple component recipes are reported as ambiguous and never merged.
130
- Genesis does not run the recipe. Stack resources such as database variables do
131
- not gate dependency installation.
139
+ The standalone command does not provision declared resources: callers provide
140
+ their own database, credentials, compilers, and other infrastructure. Stack
141
+ resources such as database variables do not gate dependency installation.
132
142
 
133
143
  Hosts that manage project environments can call `inspectEnvironment()`.
134
144
  Concrete Stack integrations may declare public, non-secret Environment
@@ -137,6 +147,10 @@ host or user values take precedence. The built-in JSKIT MySQL and PostgreSQL
137
147
  pieces respectively declare `DB_CLIENT=mysql2` and `DB_CLIENT=pg`, so users
138
148
  provide connection values rather than restating a deterministic technology
139
149
  choice.
150
+ A project may instead declare complete `## Resources` and
151
+ `## Environment defaults` sections in `genesis/stack.md`; their presence
152
+ replaces component declarations so an imported C++, PHP, Python, or older
153
+ application keeps its own real names and public constants.
140
154
  An optional readable `## Environment files` section declares safe
141
155
  project-relative dotenv projections such as `.env`. A project declaration
142
156
  replaces component defaults, including with `- Nothing.`; otherwise component
@@ -176,6 +190,20 @@ or roll back. A deployment host owns all of those operational responsibilities,
176
190
  including the mapping from `mysql` or `postgresql` resources to its managed
177
191
  services.
178
192
 
193
+ Standalone and non-Node hosts can inspect these same normalized contracts
194
+ without importing the JavaScript API or parsing Markdown:
195
+
196
+ ```bash
197
+ genesis inspect workspace --json
198
+ genesis inspect environment --json
199
+ genesis inspect launch --json
200
+ genesis inspect deployment --json
201
+ ```
202
+
203
+ Without `--json`, the commands print concise human-readable summaries. They
204
+ never execute setup, start a process, probe a server, materialize environment
205
+ files, or deploy.
206
+
179
207
  At session start, Codex receives only a short explanation of how Genesis is
180
208
  organized. After it locates the source involved in a request, it can load the
181
209
  specific explanatory and technology context with:
@@ -284,6 +312,7 @@ genesis prompt "Add filtering by note title"
284
312
  ```bash
285
313
  genesis prompt # implementation work
286
314
  genesis prompt --task start # open a new or existing project conversation
315
+ genesis prompt --task adopt # import an existing project's complete contract
287
316
  genesis prompt "Add filtering by note title"
288
317
  genesis prompt --task deslop # explicit cleanup
289
318
  genesis prompt --task deslop "Only review billing"
@@ -293,12 +322,15 @@ genesis prompt --task describe # create/refresh Blueprint a
293
322
  genesis prompt --task review # compare intent, code, and explanation
294
323
  ```
295
324
 
296
- The seven task types are deliberately explicit:
325
+ The eight task types are deliberately explicit:
297
326
 
298
327
  - `start` opens the project conversation. For a new project it asks what the
299
328
  app is about, presents relevant choices from the live Stack catalog, and
300
329
  waits for the person to select technology. For an existing project it asks
301
330
  what the person wants to understand or change.
331
+ - `adopt` imports an existing application's factual operational and product
332
+ contracts into Genesis metadata. It composes technology-specific Adoption
333
+ requirements from the selected Stack and does not change application code.
302
334
  - `work` implements the Blueprint and optional request using current code,
303
335
  Program, selected Stack context, and progressively loaded Agent Skills.
304
336
  - `deslop` requests cleanup explicitly. Codex projects also receive a bounded
@@ -335,6 +367,7 @@ eleven common language families listed above, plus Vue, MySQL, PostgreSQL,
335
367
  JSKIT, and JSKIT database integrations. Components may contribute:
336
368
 
337
369
  - a concise description and supplemental Guidance used across relevant tasks;
370
+ - existing-project Adoption requirements used only while importing a codebase;
338
371
  - one authoritative Agent Skill directory when the component owns one;
339
372
  - generic external-resource requirements;
340
373
  - cleanup advice used by explicit and automatic Deslop prompts;
@@ -343,9 +376,9 @@ JSKIT, and JSKIT database integrations. Components may contribute:
343
376
 
344
377
  Technology-specific supplemental rules intentionally remain in Stack pieces.
345
378
  General `Guidance` enriches implementation, review, Program, description, and
346
- cleanup tasks; `Deslop` adds cleanup-only rules. Neither shadows an official
347
- generic technology skill nor assumes that an upstream skill contains every rule
348
- Genesis needs.
379
+ cleanup tasks; `Adoption` adds import-only requirements; `Deslop` adds
380
+ cleanup-only rules. None shadows an official generic technology skill or
381
+ assumes that an upstream skill contains every rule Genesis needs.
349
382
 
350
383
  Genesis core contains no database, framework, language, or platform-specific
351
384
  controller behavior. See [Stack components](docs/stack-components.md).
@@ -370,7 +403,7 @@ command without a shell. A complete successful run writes only
370
403
  - the commands that passed.
371
404
 
372
405
  The evidence becomes stale when code, selected components, declared resources,
373
- or verification commands change. Description, Guidance, Agent Skill, and Deslop
406
+ or verification commands change. Description, Guidance, Adoption, Agent Skill, and Deslop
374
407
  prose do not rewrite what an already-run command proved. A failed verification
375
408
  removes prior passing evidence before running. Verification does not claim
376
409
  whole-product correctness.
@@ -419,6 +452,7 @@ import {
419
452
  getContext,
420
453
  indexCodebase,
421
454
  initialize,
455
+ inspectDeployment,
422
456
  inspectEnvironment,
423
457
  inspectLaunch,
424
458
  inspectWorkspaceSetup,
@@ -430,7 +464,7 @@ import {
430
464
 
431
465
  `initialize()` installs the project files, Genesis workflow skills, selected
432
466
  Stack skills, and local Codex hooks.
433
- `adoptProject()` also returns the initial `describe` prompt for an existing
467
+ `adoptProject()` also returns the initial `adopt` prompt for an existing
434
468
  codebase. `installCodex()` installs the optional global discovery plugin.
435
469
  `getContext()` resolves source paths to the Program modules that cite them,
436
470
  the functions already declared there, selected Stack guidance, available Agent
@@ -447,6 +481,8 @@ projection paths without returning any supplied environment value.
447
481
  `inspectLaunch()` returns a validated, normalized Stack launch declaration for
448
482
  a host to execute with its own runtime, port, process, readiness probe, preview
449
483
  identity, secret, and browser policy.
484
+ `inspectDeployment()` returns the separate normalized production recipe without
485
+ executing or provisioning it.
450
486
 
451
487
  A host such as Vibe64 can send the generated prompt to its existing agent:
452
488
 
@@ -17,10 +17,25 @@ Genesis reports only facts it can establish mechanically:
17
17
  City projects the Program modules and source citations that exist. Neither
18
18
  proves semantic equivalence, complete dynamic dispatch, or true duplication.
19
19
 
20
- Prompt text, Stack Description/Guidance/Deslop prose, Program prose, Agent Skill
20
+ Prompt text, Stack Description/Guidance/Adoption/Deslop prose, Program prose, Agent Skill
21
21
  content, and agent output are not assurance evidence. Genesis does not claim
22
22
  that product intent and code have converged, that Program is complete or
23
23
  semantically current, or that passing checks prove the whole product correct.
24
24
 
25
25
  Git remains the review and recovery boundary. The host running the generated
26
26
  prompt owns the agent and its interaction.
27
+
28
+ ## Filesystem ownership
29
+
30
+ Genesis does not copy package-file ownership or broad source modes into a
31
+ project. It creates ordinary project files with mode `0666`, directories and
32
+ executable skill files with mode `0777`, and lets the invoking process umask
33
+ and the destination directory's inherited ACL establish the effective mode and
34
+ group. Atomic replacements are created beside their destination so they inherit
35
+ the same filesystem policy before becoming visible. Private hook continuation
36
+ state remains explicitly `0600`.
37
+
38
+ This keeps ordinary single-user projects conventional while allowing a managed
39
+ host to require shared-group writes and no access for other users. The host is
40
+ responsible for establishing and verifying that umask, setgid directory, ACL,
41
+ and cross-identity contract before Genesis or an agent starts.
@@ -0,0 +1,113 @@
1
+ # Preview identity command protocol
2
+
3
+ `genesis.preview-identity.command.v1` lets an application expose its ordinary
4
+ development sign-in and sign-out behavior to any preview host. It is language-
5
+ and framework-neutral: `tools/preview-identity` may be a native C/C++ binary, a
6
+ script, or another committed executable supported by the target's declared
7
+ runtimes.
8
+
9
+ Genesis only validates and reports the declaration. The preview host resolves
10
+ the command beneath the project root, rejects traversal and symlinks, supplies
11
+ the declared runtime and environment policy, enforces the declared timeout,
12
+ and controls the browser. The application owns user lookup and its normal
13
+ session cookies.
14
+
15
+ ## Invocation
16
+
17
+ The host runs the exact declared argv with the project root as the working
18
+ directory. Standard input contains exactly one UTF-8 JSON object followed by a
19
+ newline and EOF. Standard output contains exactly one JSON object; diagnostic
20
+ logs belong on standard error. There is no streaming or multi-message framing.
21
+
22
+ The host supplies a fresh opaque `requestId`. A sign-in request is:
23
+
24
+ ```json
25
+ {
26
+ "protocol": "genesis.preview-identity.command.v1",
27
+ "requestId": "opaque-request-id",
28
+ "operation": "login-as",
29
+ "subject": {
30
+ "kind": "selector",
31
+ "selector": {
32
+ "type": "email",
33
+ "value": "person@example.com"
34
+ }
35
+ },
36
+ "target": {
37
+ "href": "http://127.0.0.1:4100/home",
38
+ "origin": "http://127.0.0.1:4100"
39
+ }
40
+ }
41
+ ```
42
+
43
+ `subject.selector.type` must be one of the identity types advertised by the
44
+ Launch declaration: `email`, `login`, or `user-id`. The application treats the
45
+ selector as an existing application identity; a preview host does not create
46
+ users, memberships, roles, or seed data.
47
+
48
+ Sign-out uses the same envelope with `operation` set to `logout` and omits
49
+ `subject`.
50
+
51
+ ## Responses
52
+
53
+ Every protocol response repeats the exact `protocol` and `requestId` and exits
54
+ with status zero. A successful sign-in response is:
55
+
56
+ ```json
57
+ {
58
+ "protocol": "genesis.preview-identity.command.v1",
59
+ "requestId": "opaque-request-id",
60
+ "ok": true,
61
+ "signedOut": false,
62
+ "identity": {
63
+ "displayName": "Person",
64
+ "email": "person@example.com",
65
+ "userId": "42"
66
+ },
67
+ "setCookie": [
68
+ "app_session=opaque; Path=/; HttpOnly; SameSite=Lax"
69
+ ]
70
+ }
71
+ ```
72
+
73
+ `identity` contains at least one non-empty application identifier. Supported
74
+ descriptive fields are `displayName`, `email`, `login`, `userId`, and
75
+ `username`. `setCookie` contains the application's ordinary Set-Cookie header
76
+ values. Cookies must contain no CR/LF or `Domain` attribute; the host may reject
77
+ additional cookie names reserved by its own preview transport.
78
+
79
+ A successful logout sets `signedOut` to true, omits `identity`, and returns the
80
+ cookie expirations needed to clear the application's session. A structured
81
+ application rejection still exits zero and uses:
82
+
83
+ ```json
84
+ {
85
+ "protocol": "genesis.preview-identity.command.v1",
86
+ "requestId": "opaque-request-id",
87
+ "ok": false,
88
+ "code": "user_not_found",
89
+ "error": "User not found.",
90
+ "statusCode": 404,
91
+ "signedOut": true,
92
+ "setCookie": []
93
+ }
94
+ ```
95
+
96
+ `statusCode` is an integer from 400 through 599. A malformed request, command
97
+ crash, timeout, nonzero exit, invalid JSON, mismatched request ID, oversized
98
+ output, or invalid cookie is a command/transport failure rather than an
99
+ application rejection. Hosts should bound output to 512 KiB, at most 64
100
+ cookies, and at most 16 KiB per cookie.
101
+
102
+ ## Environment and safety
103
+
104
+ The optional Enabled and Secret environment entries in the Launch declaration
105
+ are application-owned variable names, never values. A host that offers identity
106
+ switching supplies `true` through the enabled name and a fresh launch-scoped
107
+ secret through the secret name. The helper and any private application endpoint
108
+ it calls must remain disabled unless those values are present and valid.
109
+
110
+ The command is a development-preview control, not a production sign-in API.
111
+ Genesis does not store selectors, generate credentials, materialize environment
112
+ files, execute the helper, or decide which identities a host is allowed to
113
+ offer.
@@ -15,7 +15,7 @@ const work = await generatePrompt({
15
15
  await currentAgent.send(work.prompt);
16
16
  ```
17
17
 
18
- Tasks are `start`, `work`, `deslop`, `program`, `blueprint`, `describe`, and `review`.
18
+ Tasks are `start`, `adopt`, `work`, `deslop`, `program`, `blueprint`, `describe`, and `review`.
19
19
  `start` is the host-independent first conversation: it classifies an initialized
20
20
  project from current Genesis facts, asks what a new app is about, exposes the
21
21
  live Stack catalog for an explicit user choice, or asks what the person wants
@@ -33,10 +33,10 @@ Genesis keeps each instruction at one useful level:
33
33
  - `skills/genesis-project/`, `skills/genesis-program/`, and
34
34
  `skills/genesis-deslop/` are the reusable workflow sources copied into each
35
35
  project's `.agents/skills/` directory.
36
- - `prompts/<task>.txt` is a short task launcher. It selects the relevant
36
+ - `prompts/<task>.txt` is a task launcher. It selects the relevant
37
37
  workflow skill and states only that turn's edit boundary.
38
38
  - `stacks/pieces/<component>.md` supplies concise Description, supplemental
39
- Guidance, Resources, Deslop overlays, structural Indexers, verification
39
+ Guidance, Adoption requirements, Resources, Deslop overlays, structural Indexers, verification
40
40
  Commands, 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.
@@ -51,19 +51,26 @@ colliding generic skill.
51
51
 
52
52
  `genesis adopt [product guidance...]` is the explicit starting point for a
53
53
  nonempty project. It preserves source, calls the same idempotent initialization
54
- used by `genesis init`, and prints a `describe` prompt for the current agent to
55
- follow. The description prompt may direct a large-project agent to use
56
- subagents at its discretion, but the primary agent must reconcile their work
57
- into one Blueprint and one subsystem-oriented Program.
54
+ used by `genesis init`, and prints an `adopt` prompt for the current agent to
55
+ follow. Adoption first records observed Stack components, regenerates itself so
56
+ their technology-specific `## Adoption` requirements are present, translates
57
+ the application's real operational contracts into project Stack sections, and
58
+ then creates one Blueprint and subsystem-oriented Program.
59
+
60
+ Adoption does not upgrade an application's technology foundation. Component
61
+ defaults apply only when direct source evidence matches. Older or otherwise
62
+ different applications receive complete project-owned declarations for setup,
63
+ environment/resources, Launch and Preview identity, verification, and
64
+ deployment as applicable, so a host never executes a newly selected
65
+ component's current command against source that does not provide it.
58
66
 
59
67
  Codex users can run `genesis codex install` once to install the packaged
60
68
  Genesis discovery plugin. Its `SessionStart` hook executes before the first
61
69
  user prompt. In a nonempty Git repository without `genesis/blueprint.md`, it
62
- injects an instruction that the first assistant reply strongly recommend
63
- `genesis adopt`. It does not perform adoption automatically. If the user
64
- accepts, Codex can run the command and follow its returned prompt in the same
65
- conversation. Other hosts can call `adoptProject()` and send its `prompt`
66
- directly.
70
+ asks the assistant to recommend project preparation in product language. It
71
+ does not perform adoption automatically. If the user accepts, Codex runs the
72
+ command itself and follows its returned prompt in the same conversation. Other
73
+ hosts can call `adoptProject()` and send its `prompt` directly.
67
74
 
68
75
  Codex can instead use the project-local hooks installed by `genesis init`.
69
76
  Those hooks inject a short operating guide, record whether the current turn
@@ -92,7 +99,8 @@ This follows Agent Skills progressive disclosure and keeps official or
92
99
  user-installed generic technology skills independent.
93
100
 
94
101
  Matching files under `genesis/stack/<component>.md` may add to or override that
95
- selected component's Description, Guidance, and Deslop fields. Effective
102
+ selected component's Description, Guidance, Adoption, and Deslop fields. Effective
96
103
  Guidance is used by work, review, Program, describe, Deslop, and path-context
97
104
  generation. The Codex continuation flow also carries it into reconciliation and
98
- cleanup; effective Deslop guidance remains cleanup-only.
105
+ cleanup; effective Deslop guidance remains cleanup-only. Effective Adoption
106
+ guidance is included only in the adoption workflow.
@@ -24,6 +24,17 @@ What this component contributes.
24
24
 
25
25
  - `javascript`
26
26
 
27
+ ## City regions
28
+
29
+ - Ignore `**/test/**`
30
+ - Ignore `**/tests/**`
31
+ - Ignore `**/__tests__/**`
32
+ - Ignore `**/*.test.*`
33
+ - Ignore `**/*.spec.*`
34
+ - Match `packages` as `Packages`: `packages/**`
35
+ - Match `source` as `Source`: `src/**`
36
+ - Fallback `everything-else` as `Everything else`
37
+
27
38
  ## Resources
28
39
 
29
40
  ```json genesis-resource
@@ -48,6 +59,11 @@ What this component contributes.
48
59
  - Concise supplemental guidance used during implementation, explanation,
49
60
  review, and cleanup.
50
61
 
62
+ ## Adoption
63
+
64
+ - Evidence and technology-specific contracts an agent must reconcile when
65
+ importing an existing application.
66
+
51
67
  ## Environment files
52
68
 
53
69
  - Dotenv `.env`
@@ -80,8 +96,8 @@ What this component contributes.
80
96
 
81
97
  #### Preview identity
82
98
 
83
- - Command: `.vibe64/bin/preview-identity`
84
- - Protocol: `vibe64.preview-identity.command.v1`
99
+ - Command: `tools/preview-identity`
100
+ - Protocol: `genesis.preview-identity.command.v1`
85
101
  - Identity types: `email` `login` `user-id`
86
102
  - Enabled environment: `APP_PREVIEW_IDENTITY_ENABLED`
87
103
  - Secret environment: `APP_PREVIEW_IDENTITY_SECRET`
@@ -101,12 +117,21 @@ before verification. `allowEmpty` may name a required variable whose empty
101
117
  string is valid. `Environment defaults` declares public non-secret constants
102
118
  owned by a concrete integration; explicit host values take precedence.
103
119
  `Guidance` is supplemental prose used by work, review, Program,
104
- description, and cleanup prompts, as well as path-focused context. `Deslop`
120
+ description, and cleanup prompts, as well as path-focused context. `Adoption`
121
+ adds technology-specific evidence and contract requirements to the dedicated
122
+ existing-application import prompt. `Deslop`
105
123
  adds cleanup-only prose to explicit cleanup and the automatic Codex cleanup
106
124
  continuation. With no selected component, only the `genesis-deslop` skill
107
125
  applies. `Commands` accepts only argument-safe `Verify` entries and runs only
108
126
  through `genesis verify`.
109
127
 
128
+ A project may own a complete `## Resources` section in `genesis/stack.md` using
129
+ the same fenced `json genesis-resource` objects, or `- Nothing.` to declare
130
+ none. Its presence replaces every selected component Resource declaration.
131
+ This lets an existing application preserve its real queue, database, mail,
132
+ object-storage, or service environment names rather than inherit a framework's
133
+ vocabulary. Without a project section, component Resources compose as before.
134
+
110
135
  `Workspace setup` is an optional exact, ordered recipe for a host preparing a
111
136
  fresh workspace. Each entry uses this readable, shell-free form:
112
137
 
@@ -149,6 +174,13 @@ their deterministic `DB_CLIENT` driver ids; generic database pieces do not.
149
174
  Secrets and deployment-specific connection values remain host inputs and must
150
175
  never be declared as defaults.
151
176
 
177
+ A project `## Environment defaults` section in `genesis/stack.md` likewise
178
+ replaces every component default and accepts `- Nothing.` as a complete empty
179
+ declaration. It is the complete declaration of public, non-secret constants
180
+ expected by the actual application; Genesis never keeps a framework default
181
+ beside it implicitly. `genesis stack add` preserves both project-owned sections
182
+ while changing component selection.
183
+
152
184
  `Environment files` optionally declares project-relative dotenv projections a
153
185
  host may materialize from its own resolved project environment. Genesis
154
186
  validates and returns only the format and path; it never reads environment
@@ -177,8 +209,8 @@ reserve a port, start a process, probe readiness, or control a browser. The host
177
209
  executes the declared predicate and owns its timeout and retry policy.
178
210
 
179
211
  The optional `#### Preview identity` block is specific to hosts that implement
180
- the declared `vibe64.preview-identity.command.v1` protocol. Its executable is a
181
- committed, application-owned file immediately below `.vibe64/bin`; the
212
+ the declared `genesis.preview-identity.command.v1` protocol. Its executable is
213
+ a committed, application-owned project-relative file; the
182
214
  normalized command is an argv array, not a shell program. Identity types may
183
215
  contain `email`, `login`, and `user-id`. Enabled environment and Secret
184
216
  environment are optional variable
@@ -187,7 +219,9 @@ never reads or returns their values. Runtimes lists opaque runtimes required
187
219
  to execute this command, independently of the server target requirements, and
188
220
  Timeout ms defaults to 10000 with a maximum of 30000. Genesis does not execute
189
221
  the command, select identities, provide secrets, authenticate users, or control
190
- the browser. Those remain host responsibilities.
222
+ the browser. Those remain host responsibilities. The complete transport
223
+ contract is defined in
224
+ [`preview-identity-command.md`](preview-identity-command.md).
191
225
 
192
226
  `runtimeRequirements` contains opaque technology ids. A host explicitly maps
193
227
  the ids it supports to its own pinned runtime packs; for example, it may map
@@ -239,11 +273,31 @@ may contribute indexers, and duplicates are collapsed. Index output is
239
273
  navigation data, not proof that every dynamic callable or framework edge was
240
274
  discovered.
241
275
 
276
+ `City regions` is an optional complete presentation contract for Machine City.
277
+ Leading `Ignore` entries are canonical project-relative glob patterns using
278
+ only `*` within a path segment and `**` across segments. Genesis excludes their
279
+ matching files before it emits Machine City buildings or functions. This keeps
280
+ test/spec source out of the product City without requiring a host-side filter.
281
+ Each subsequent ordered `Match` entry declares one canonical project-relative
282
+ `path/**` prefix, stable id, and human title. Exactly one final `Fallback` entry
283
+ owns every remaining indexed path. Ignore patterns, ids, and prefixes must be
284
+ unique, prefixes must not overlap, and no more than one selected component may
285
+ declare the contract. Genesis resolves every indexed file and structural
286
+ district to a region and a campus while generating
287
+ `.genesis/machine-city.json`; a City renderer consumes those emitted facts and
288
+ must not reclassify or filter paths. Under a matched prefix, the first directory
289
+ is a campus, while files directly below the prefix belong to the prefix campus.
290
+ Under the fallback, each top-level directory is a campus and project-root files
291
+ belong to the project-root campus. The built-in JSKIT piece excludes exact
292
+ `test`, `tests`, and `__tests__` path segments plus `*.test.*` and `*.spec.*`
293
+ files, then declares `Packages`, `Source`, and `Everything else`.
294
+
242
295
  Do not create a Genesis-owned generic skill merely because a component is
243
296
  named `nodejs`, `php`, or another common technology. Official, user, and host
244
297
  skills with those names must coexist normally. Use `## Skill` only for an
245
298
  authoritative directory this Stack component selects; put concise supplemental
246
- rules in `## Guidance` and cleanup-only additions in `## Deslop`.
299
+ rules in `## Guidance`, existing-project import requirements in `## Adoption`,
300
+ and cleanup-only additions in `## Deslop`.
247
301
 
248
302
  A selected component may have one project customization at
249
303
  `genesis/stack/<id>.md`:
@@ -261,6 +315,10 @@ Additional project context.
261
315
 
262
316
  - Additional implementation, explanation, review, and cleanup guidance.
263
317
 
318
+ ### Adoption
319
+
320
+ - Additional existing-project import requirements.
321
+
264
322
  ### Deslop
265
323
 
266
324
  - Additional cleanup guidance.
@@ -275,30 +333,35 @@ Replacement component description.
275
333
 
276
334
  - Replacement installed general guidance.
277
335
 
336
+ ### Adoption
337
+
338
+ - Replacement existing-project import requirements.
339
+
278
340
  ### Deslop
279
341
 
280
342
  - Replacement cleanup guidance.
281
343
  ```
282
344
 
283
345
  Each field is optional. `Override` replaces only that installed field; `Add`
284
- then follows the installed or overridden value. These files cannot alter
285
- dependencies, conflicts, Agent Skill source, indexers, resources, environment
286
- defaults, environment files, commands, Workspace setup, or Launch declarations.
346
+ then follows the installed or overridden value. These customization files
347
+ cannot alter dependencies, conflicts, Agent Skill source, indexers, resources,
348
+ environment defaults, environment files, commands, Workspace setup, or Launch declarations.
287
349
  `genesis stack add` preserves the files and composes their effective prose after
288
350
  dependency resolution.
289
351
 
290
- A project may select component ids in `genesis/stack.md`, replace component
291
- environment-file declarations, replace component Workspace setup defaults
292
- with one project recipe, replace component Verify defaults with its own
293
- `## Commands`, and replace every component Launch target with one project
294
- `## Launch` contract. With no project Launch section, selected component
295
- targets compose; duplicate ids or multiple defaults are rejected rather than
296
- guessed. `genesis stack add` preserves existing project Environment files,
297
- Workspace setup, and Launch sections. Adding another language, framework,
298
- database, or integration is therefore an isolated Stack/indexer contribution
299
- rather than a prompt or controller special case.
300
-
301
- Description, Guidance, Agent Skill, and Deslop prose are instructions, not
352
+ A project may select component ids in `genesis/stack.md`; replace component
353
+ Resources and Environment defaults with complete application-owned contracts;
354
+ replace component environment-file declarations; replace component Workspace
355
+ setup defaults with one project recipe; replace component Verify defaults with
356
+ its own `## Commands`; and replace every component Launch target with one
357
+ project `## Launch` contract. With no corresponding project section, selected
358
+ component declarations compose; conflicts are rejected rather than guessed.
359
+ `genesis stack add` preserves every existing project-owned contract section.
360
+ Adding another language, framework, database, or integration is therefore an
361
+ isolated Stack/indexer contribution rather than a prompt or controller special
362
+ case.
363
+
364
+ Description, Guidance, Adoption, Agent Skill, and Deslop prose are instructions, not
302
365
  verification evidence. Changes to them do not stale an exact successful
303
366
  verification record; selected component ids, resources, environment files,
304
367
  environment defaults, Workspace setup, launch targets, and verification
@@ -318,6 +381,19 @@ declared `resources`, value-free `diagnostics`, and normalized `files`. Each def
318
381
  `name`, `value`, and component `sources`; each file contains `format`, `path`,
319
382
  and `source`. Supplied environment values never cross this API boundary.
320
383
 
384
+ Shell and non-Node hosts can inspect the same normalized contracts without
385
+ importing the JavaScript API or parsing Markdown:
386
+
387
+ ```bash
388
+ genesis inspect environment --json
389
+ genesis inspect workspace --json
390
+ genesis inspect launch --json
391
+ genesis inspect deployment --json
392
+ ```
393
+
394
+ These are projections of the same public inspectors. They do not create a
395
+ second parser or take ownership of execution.
396
+
321
397
  Fresh-workspace hosts read setup from the package root:
322
398
 
323
399
  ```js
@@ -337,6 +413,20 @@ blocked result.
337
413
  The optional environment object is accepted for a consistent host inspection
338
414
  boundary, but Workspace setup v1 neither reads nor returns its values.
339
415
 
416
+ Standalone users may execute the same normalized recipe with their own
417
+ environment and installed toolchain:
418
+
419
+ ```bash
420
+ genesis prepare
421
+ ```
422
+
423
+ `genesis prepare` runs each declared argv directly without a shell, in order,
424
+ and stops at the first failure. It honors project-relative workdirs and
425
+ conditional paths. It does not provision databases, compilers, credentials,
426
+ runtimes, or other resources. Managed hosts remain free to consume
427
+ `inspectWorkspaceSetup()` and enforce their own execution, identity, runtime,
428
+ and permission policies.
429
+
340
430
  Preview hosts read the normalized Launch contract independently:
341
431
 
342
432
  ```js
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "genesis-compiler",
3
- "version": "1.2.2",
3
+ "version": "1.2.4",
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": {
@@ -25,9 +25,11 @@
25
25
  ".agents/plugins/marketplace.json",
26
26
  "bin",
27
27
  "docs/assurance-model.md",
28
+ "docs/preview-identity-command.md",
28
29
  "docs/stack-components.md",
29
30
  "docs/prompt-integration.md",
30
31
  "prompts/blueprint.txt",
32
+ "prompts/adopt.txt",
31
33
  "prompts/describe.txt",
32
34
  "prompts/deslop.txt",
33
35
  "prompts/program.txt",
@@ -56,7 +58,7 @@
56
58
  "@ast-grep/lang-ruby": "^0.0.7",
57
59
  "@ast-grep/lang-rust": "^0.0.7",
58
60
  "@ast-grep/napi": "^0.45.1",
59
- "@jskit-ai/agent-docs": "0.1.131",
61
+ "@jskit-ai/agent-docs": "0.1.132",
60
62
  "yaml": "^2.9.0"
61
63
  }
62
64
  }