genesis-compiler 1.2.24 → 1.2.26
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 +37 -39
- package/docs/assurance-model.md +1 -2
- package/docs/prompt-integration.md +19 -20
- package/package.json +3 -3
- package/plugins/genesis/.codex-plugin/plugin.json +1 -1
- package/plugins/opencode/project-guidance.js +57 -0
- package/prompts/deslop.txt +11 -26
- package/prompts/work.txt +11 -8
- package/skills/genesis-deslop/SKILL.md +44 -16
- package/skills/genesis-deslop/agents/openai.yaml +2 -2
- package/skills/genesis-project/SKILL.md +10 -4
- package/src/cli.js +4 -37
- package/src/index/assets.js +0 -1
- package/src/index/codex-hooks.js +48 -639
- package/src/index/init.js +16 -5
- package/src/index/opencode-plugin.js +28 -0
- package/src/index/prompt.js +4 -1
- package/src/index/session-context.js +55 -0
- package/prompts/reconcile.txt +0 -13
package/README.md
CHANGED
|
@@ -21,7 +21,8 @@ genesis/
|
|
|
21
21
|
.agents/skills/
|
|
22
22
|
genesis-* Genesis workflow skills
|
|
23
23
|
<technology>/ authoritative skills installed by selected Stack pieces
|
|
24
|
-
.codex/hooks.json
|
|
24
|
+
.codex/hooks.json project-local Codex lifecycle integration
|
|
25
|
+
.opencode/plugins/ project-local OpenCode lifecycle integration
|
|
25
26
|
.genesis/
|
|
26
27
|
machine-city.json derived detailed source and function map
|
|
27
28
|
program-city.json derived simple subsystem and operation map
|
|
@@ -108,12 +109,13 @@ empty or already-adopted project.
|
|
|
108
109
|
|
|
109
110
|
`genesis init` creates an empty Blueprint, a focused engineering approach, an
|
|
110
111
|
empty optional Stack, the current `genesis/version`, three project Agent Skills,
|
|
111
|
-
and project-local Codex
|
|
112
|
+
and project-local guidance adapters for Codex and OpenCode. The skills are ordinary
|
|
112
113
|
[Agent Skills](https://agentskills.io): `genesis-project`, `genesis-program`,
|
|
113
114
|
and `genesis-deslop`, each with standard `SKILL.md` and `agents/openai.yaml`
|
|
114
|
-
metadata. Open `/hooks` once in Codex to review and trust the
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
metadata. Open `/hooks` once in Codex to review and trust the guidance hook;
|
|
116
|
+
OpenCode discovers its local project plugin automatically. Both use the same
|
|
117
|
+
Genesis-owned operating guide for new sessions and after compaction. No
|
|
118
|
+
technology is assumed until you explicitly select Stack components:
|
|
117
119
|
|
|
118
120
|
```bash
|
|
119
121
|
genesis stack add --stack-package genesis-stack nodejs
|
|
@@ -182,7 +184,7 @@ People may edit `## Project requirements` to name obligations the presets do
|
|
|
182
184
|
not capture, including a specific organizational, compliance, cryptographic,
|
|
183
185
|
or scale constraint. `genesis engineering set` changes only the profile and
|
|
184
186
|
preserves those requirements. Generated prompts, path-focused context, Codex
|
|
185
|
-
session guidance, Post-change work, and Deslop all receive the effective
|
|
187
|
+
session guidance, implementation Post-change work, and Deslop all receive the effective
|
|
186
188
|
approach. A project upgraded from an older Genesis release safely uses
|
|
187
189
|
`focused.v1` until `genesis init` or `genesis engineering set focused.v1`
|
|
188
190
|
records the file.
|
|
@@ -263,27 +265,20 @@ Python, Java, C#, C/C++, PHP, Go, Rust, Ruby, Kotlin, and Shell. A future techno
|
|
|
263
265
|
adds its adapter through its Stack piece rather than teaching Genesis prompts
|
|
264
266
|
to parse that language.
|
|
265
267
|
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
The hook never starts another Codex process. Its small per-session phase is
|
|
282
|
-
limited to `implementation -> optional post-change -> reconcile -> deslop ->
|
|
283
|
-
done`, so it cannot keep continuing recursively. The Stop after Deslop clears
|
|
284
|
-
the sequence rather than scheduling another model turn. Empty Post-change
|
|
285
|
-
content is skipped rather than producing an empty turn. Question, explanation,
|
|
286
|
-
review, diagnosis-only, and unchanged turns finish normally.
|
|
268
|
+
The project Codex hook and OpenCode plugin use the same short operating guide
|
|
269
|
+
for a new session and after compaction. They record no conversation message,
|
|
270
|
+
block no completion, and request no follow-up turn. Implementation prompts
|
|
271
|
+
compose selected Stack `Post-change` guidance into the original implementation
|
|
272
|
+
turn, and the project skill keeps intentional Blueprint and affected Program
|
|
273
|
+
changes aligned there.
|
|
274
|
+
|
|
275
|
+
Deslop runs only when explicitly requested. With no stated scope it reviews the
|
|
276
|
+
latest commit; “the last N commits” reviews the net surviving first-parent
|
|
277
|
+
range, and a named commit or range is honored exactly. It requires a clean
|
|
278
|
+
worktree and leaves ordinary uncommitted cleanup for review rather than
|
|
279
|
+
amending history. Genesis supplies the behavior-preserving boundary and Git
|
|
280
|
+
scope rules. Selected Stack components add technology-specific Deslop guidance
|
|
281
|
+
without weakening or broadening that contract.
|
|
287
282
|
|
|
288
283
|
Projects can customize a selected technology through its matching file, such
|
|
289
284
|
as `genesis/stack/jskit.md`:
|
|
@@ -303,7 +298,7 @@ Additional project-specific context about how JSKIT is used here.
|
|
|
303
298
|
|
|
304
299
|
### Post-change
|
|
305
300
|
|
|
306
|
-
- Additional project-specific work to perform
|
|
301
|
+
- Additional project-specific work to perform before the implementation turn completes.
|
|
307
302
|
|
|
308
303
|
### Deslop
|
|
309
304
|
|
|
@@ -321,7 +316,7 @@ A replacement for the installed JSKIT description.
|
|
|
321
316
|
|
|
322
317
|
### Post-change
|
|
323
318
|
|
|
324
|
-
- Replacement installed post-change work.
|
|
319
|
+
- Replacement installed post-change work for the implementation turn.
|
|
325
320
|
|
|
326
321
|
### Deslop
|
|
327
322
|
|
|
@@ -357,8 +352,9 @@ genesis prompt # implementation work
|
|
|
357
352
|
genesis prompt --task start # open a new or existing project conversation
|
|
358
353
|
genesis prompt --task adopt # import an existing project's complete contract
|
|
359
354
|
genesis prompt "Add filtering by note title"
|
|
360
|
-
genesis prompt --task deslop #
|
|
361
|
-
genesis prompt --task deslop "
|
|
355
|
+
genesis prompt --task deslop # clean up the latest commit
|
|
356
|
+
genesis prompt --task deslop "Deslop the last 5 commits"
|
|
357
|
+
genesis prompt --task deslop "Deslop commit a1b2c3d"
|
|
362
358
|
genesis prompt --task program # refresh explanation
|
|
363
359
|
genesis prompt --task blueprint "Start on notes" # update product intent
|
|
364
360
|
genesis prompt --task describe # create/refresh Blueprint and complete Program
|
|
@@ -377,8 +373,9 @@ The eight task types are deliberately explicit:
|
|
|
377
373
|
- `work` implements the Blueprint and optional request using current code,
|
|
378
374
|
Program, the selected engineering approach, selected Stack context, and
|
|
379
375
|
progressively loaded Agent Skills.
|
|
380
|
-
- `deslop` requests cleanup
|
|
381
|
-
|
|
376
|
+
- `deslop` requests behavior-preserving cleanup of committed work explicitly.
|
|
377
|
+
It defaults to the latest commit, accepts a first-parent commit count or exact
|
|
378
|
+
commit/range, requires a clean worktree, and leaves its result uncommitted.
|
|
382
379
|
- `program` edits only `genesis/program/` to explain the code that exists, with
|
|
383
380
|
selected Stack guidance available for technology-specific correctness.
|
|
384
381
|
- `blueprint` edits only `genesis/blueprint.md` from explicit user intent. It
|
|
@@ -418,19 +415,20 @@ Components may contribute:
|
|
|
418
415
|
|
|
419
416
|
- a concise description and supplemental Guidance used across relevant tasks;
|
|
420
417
|
- existing-project Adoption requirements used only while importing a codebase;
|
|
421
|
-
- optional Post-change work composed
|
|
418
|
+
- optional Post-change work composed into the original implementation turn;
|
|
422
419
|
- one authoritative Agent Skill directory when the component owns one;
|
|
423
420
|
- generic external-resource requirements;
|
|
424
|
-
- cleanup advice
|
|
421
|
+
- cleanup advice composed on top of the core explicit Deslop contract;
|
|
425
422
|
- structural code indexers used by Machine City and function lookup;
|
|
426
423
|
- default verification commands.
|
|
427
424
|
|
|
428
425
|
Technology-specific supplemental rules intentionally remain in Stack pieces.
|
|
429
426
|
General `Guidance` enriches implementation, review, Program, description, and
|
|
430
|
-
cleanup tasks; `Adoption` adds import-only requirements; `Post-change`
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
427
|
+
cleanup tasks; `Adoption` adds import-only requirements; `Post-change` adds
|
|
428
|
+
work to finish in the original implementation turn; `Deslop` adds
|
|
429
|
+
technology-specific cleanup rules to Genesis's invariant behavior-preserving
|
|
430
|
+
contract. None shadows an official generic technology skill or assumes that an
|
|
431
|
+
upstream skill contains every rule Genesis needs.
|
|
434
432
|
|
|
435
433
|
Genesis core contains no Stack pieces and no database, framework, language, or
|
|
436
434
|
platform dependency. See [Stack components](docs/stack-components.md).
|
package/docs/assurance-model.md
CHANGED
|
@@ -34,8 +34,7 @@ project. It creates ordinary project files with mode `0666`, directories and
|
|
|
34
34
|
executable skill files with mode `0777`, and lets the invoking process umask
|
|
35
35
|
and the destination directory's inherited ACL establish the effective mode and
|
|
36
36
|
group. Atomic replacements are created beside their destination so they inherit
|
|
37
|
-
the same filesystem policy before becoming visible.
|
|
38
|
-
state remains explicitly `0600`.
|
|
37
|
+
the same filesystem policy before becoming visible.
|
|
39
38
|
|
|
40
39
|
This keeps ordinary single-user projects conventional while allowing a managed
|
|
41
40
|
host to require shared-group writes and no access for other users. The host is
|
|
@@ -77,22 +77,22 @@ does not perform adoption automatically. If the user accepts, Codex runs the
|
|
|
77
77
|
command itself and follows its returned prompt in the same conversation. Other
|
|
78
78
|
hosts can call `adoptProject()` and send its `prompt` directly.
|
|
79
79
|
|
|
80
|
-
Codex can
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
`Post-change` contributions
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
80
|
+
Codex and OpenCode can use the project-local adapters installed by `genesis
|
|
81
|
+
init`. Both receive the same short operating guide for a new session and after
|
|
82
|
+
compaction. Codex uses `SessionStart` for startup, clear, and compact events.
|
|
83
|
+
OpenCode renders once per session, keeps that value active in its stateless
|
|
84
|
+
model requests, and rerenders after its `session.compacted` event. Neither
|
|
85
|
+
adapter records a user message, authorizes edits, intercepts completion, or
|
|
86
|
+
requests another model turn. Selected `Post-change` contributions are included
|
|
87
|
+
in the original implementation prompt, whose project skill also keeps
|
|
88
|
+
intentional Blueprint and affected Program changes aligned.
|
|
89
|
+
|
|
90
|
+
Deslop is an explicit prompt task available to any host or command-line user.
|
|
91
|
+
It resolves the latest commit by default, a requested first-parent count, or an
|
|
92
|
+
exact commit/range; requires a clean worktree; and leaves cleanup as ordinary
|
|
93
|
+
uncommitted work. Genesis owns that invariant contract. Selected Stack
|
|
94
|
+
`Deslop` prose and applicable technology skills enrich the cleanup without
|
|
95
|
+
changing its scope or behavior-preserving boundary.
|
|
96
96
|
|
|
97
97
|
Once Codex identifies relevant source, `genesis context <path...>` returns only
|
|
98
98
|
Program modules citing those paths plus the effective engineering approach and
|
|
@@ -113,7 +113,6 @@ user-installed generic technology skills independent.
|
|
|
113
113
|
Matching files under `genesis/stack/<component>.md` may add to or override that
|
|
114
114
|
selected component's Description, Guidance, Adoption, Post-change, and Deslop
|
|
115
115
|
fields. Effective Guidance is used by work, review, Program, describe, Deslop,
|
|
116
|
-
and path-context generation.
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
guidance is included only in the adoption workflow.
|
|
116
|
+
and path-context generation. Effective Post-change work is composed into the
|
|
117
|
+
implementation prompt, while Deslop guidance remains cleanup-only. Effective
|
|
118
|
+
Adoption guidance is included only in the adoption workflow.
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "genesis-compiler",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.26",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"description": "An agent-independent prompt, multi-language code-index, cleanup, and verification companion with
|
|
5
|
+
"description": "An agent-independent prompt, multi-language code-index, cleanup, and verification companion with project agent guidance.",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "git+https://github.com/mobily-enterprises/genesis-compiler.git"
|
|
@@ -32,11 +32,11 @@
|
|
|
32
32
|
"prompts/describe.txt",
|
|
33
33
|
"prompts/deslop.txt",
|
|
34
34
|
"prompts/program.txt",
|
|
35
|
-
"prompts/reconcile.txt",
|
|
36
35
|
"prompts/review.txt",
|
|
37
36
|
"prompts/start.txt",
|
|
38
37
|
"prompts/work.txt",
|
|
39
38
|
"plugins/genesis",
|
|
39
|
+
"plugins/opencode",
|
|
40
40
|
"profiles",
|
|
41
41
|
"skills",
|
|
42
42
|
"src"
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// Generated by Genesis. Run `genesis migrate` to refresh this project plugin.
|
|
2
|
+
import { execFile } from "node:child_process";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { promisify } from "node:util";
|
|
5
|
+
|
|
6
|
+
const execute = promisify(execFile);
|
|
7
|
+
|
|
8
|
+
async function renderProjectContext(projectRoot) {
|
|
9
|
+
const { stdout } = await execute(
|
|
10
|
+
"genesis",
|
|
11
|
+
["hook", "session", "--project-root", projectRoot],
|
|
12
|
+
{
|
|
13
|
+
cwd: projectRoot,
|
|
14
|
+
maxBuffer: 256 * 1024,
|
|
15
|
+
timeout: 5_000
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
return stdout.trimEnd();
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function eventSessionId(event = {}) {
|
|
22
|
+
return String(
|
|
23
|
+
event.properties?.sessionID || event.properties?.info?.id || ""
|
|
24
|
+
).trim();
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const GenesisProjectGuidance = async ({ directory, worktree } = {}) => {
|
|
28
|
+
const projectRoot = path.resolve(worktree || directory || process.cwd());
|
|
29
|
+
const contexts = new Map();
|
|
30
|
+
|
|
31
|
+
function contextForSession(sessionId) {
|
|
32
|
+
let context = contexts.get(sessionId);
|
|
33
|
+
if (!context) {
|
|
34
|
+
context = renderProjectContext(projectRoot);
|
|
35
|
+
contexts.set(sessionId, context);
|
|
36
|
+
context.catch(() => {
|
|
37
|
+
if (contexts.get(sessionId) === context) contexts.delete(sessionId);
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
return context;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return {
|
|
44
|
+
event: async ({ event } = {}) => {
|
|
45
|
+
if (!["session.compacted", "session.deleted"].includes(event?.type)) return;
|
|
46
|
+
const sessionId = eventSessionId(event);
|
|
47
|
+
if (sessionId) contexts.delete(sessionId);
|
|
48
|
+
},
|
|
49
|
+
"experimental.chat.system.transform": async (input = {}, output = {}) => {
|
|
50
|
+
const sessionId = String(input.sessionID || input.sessionId || "").trim();
|
|
51
|
+
if (!sessionId) return;
|
|
52
|
+
const context = await contextForSession(sessionId);
|
|
53
|
+
const system = Array.isArray(output.system) ? output.system : [];
|
|
54
|
+
if (!system.includes(context)) output.system = [...system, context];
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
};
|
package/prompts/deslop.txt
CHANGED
|
@@ -1,29 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
`.agents/skills/genesis-deslop/SKILL.md` completely. Review and clean every
|
|
3
|
-
listed repository before responding.
|
|
1
|
+
Read and follow `.agents/skills/genesis-deslop/SKILL.md` completely.
|
|
4
2
|
|
|
5
|
-
This is
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
language and framework context.
|
|
3
|
+
This is an explicitly requested behavior-preserving cleanup of committed work.
|
|
4
|
+
Resolve the commit or first-parent commit range from USER REQUEST exactly; when
|
|
5
|
+
no scope is stated, use the latest commit. Require a clean worktree before
|
|
6
|
+
editing and leave the cleanup as ordinary uncommitted work for review.
|
|
10
7
|
|
|
11
|
-
|
|
12
|
-
to
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
Apply the selected Stack cleanup guidance and applicable technology skills in
|
|
9
|
+
addition to the Genesis Deslop contract. Stack guidance may improve
|
|
10
|
+
technology-specific cleanup, but it cannot broaden the resolved Git scope,
|
|
11
|
+
weaken behavior preservation, or turn this into another implementation pass.
|
|
15
12
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
present; it may not complete, correct, or extend behavior. If review reveals a
|
|
19
|
-
defect, missing behavior, contract mismatch, or test gap, report it as a
|
|
20
|
-
follow-up finding and leave it unchanged in this pass, even when it is inside a
|
|
21
|
-
changed path or appears related to the preceding implementation.
|
|
22
|
-
|
|
23
|
-
Do not broaden the product change. Run focused checks when useful and summarize
|
|
24
|
-
what became simpler, files changed, and checks actually run.
|
|
25
|
-
|
|
26
|
-
Your response from this turn is the final user-facing answer for the original
|
|
27
|
-
request. Make it concise and self-contained. Lead with the outcome, include the
|
|
28
|
-
important implemented behavior and any genuine blocker or unfinished work, and
|
|
29
|
-
do not mention automatic phases, hooks, or these instructions.
|
|
13
|
+
Report the resolved range, what became simpler, files changed, checks actually
|
|
14
|
+
run, and any defect or gap deliberately left for follow-up.
|
package/prompts/work.txt
CHANGED
|
@@ -8,15 +8,18 @@ Before adding a helper or public operation, query the Genesis
|
|
|
8
8
|
`index <name-or-path>` operation and reuse an existing function when it already
|
|
9
9
|
owns the behavior.
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
missing resource
|
|
11
|
+
Keep the Blueprint and affected Program modules aligned in this turn when the
|
|
12
|
+
implementation intentionally changes observable product behavior. Private
|
|
13
|
+
restructuring may require only corrected source citations or no explanatory
|
|
14
|
+
edit. Keep applicable consumer-owned Stack sections aligned when implementation
|
|
15
|
+
changes facts governed by those contracts. Follow the selected technology skill
|
|
16
|
+
and the section's own schema; Genesis only transports the section and does not
|
|
17
|
+
interpret or execute it. Never put an environment value or secret in Stack.
|
|
18
|
+
Never invent missing external-resource values. Preserve useful work and report
|
|
19
|
+
a genuinely missing resource instead of constructing a parallel fallback.
|
|
19
20
|
|
|
21
|
+
Apply any supplied Stack Post-change guidance before reporting completion. It
|
|
22
|
+
belongs to this implementation turn and does not request a follow-up agent turn.
|
|
20
23
|
Run focused checks when useful. Summarize files changed, checks actually run,
|
|
21
24
|
and anything still requiring attention.
|
|
22
25
|
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: genesis-deslop
|
|
3
|
-
description:
|
|
3
|
+
description: Deslop committed work through an explicit behavior-preserving cleanup pass. Use when asked to Deslop a commit or recent commits, simplify completed work, remove repeated helpers, clarify ownership, or align changed code with established project and technology patterns.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Genesis Deslop
|
|
7
7
|
|
|
8
|
-
Review and simplify
|
|
9
|
-
|
|
10
|
-
and the code immediately around it.
|
|
8
|
+
Review and simplify committed work without changing product behavior. Deslop is
|
|
9
|
+
explicit: never run it merely because implementation finished.
|
|
11
10
|
|
|
12
11
|
When this repository is Genesis itself or has `genesis-compiler` installed
|
|
13
12
|
locally, invoke every Genesis CLI operation through the project-pinned package:
|
|
@@ -16,6 +15,28 @@ package. Otherwise use `genesis <arguments>` only when that executable is
|
|
|
16
15
|
already available on `PATH`. Never install or update Genesis merely to satisfy
|
|
17
16
|
a workflow instruction.
|
|
18
17
|
|
|
18
|
+
## Resolve the committed scope
|
|
19
|
+
|
|
20
|
+
Before reading or editing the selected change, require a clean worktree and
|
|
21
|
+
index with `git status --short`. Stop and report the existing paths when it is
|
|
22
|
+
not clean; do not stash, commit, discard, or mix them into Deslop.
|
|
23
|
+
|
|
24
|
+
Resolve the user's scope as follows:
|
|
25
|
+
|
|
26
|
+
- With no stated scope, use the latest commit.
|
|
27
|
+
- “The last N commits” means the net surviving change from the first parent
|
|
28
|
+
before those N commits through `HEAD`.
|
|
29
|
+
- A named commit means that commit against its first parent.
|
|
30
|
+
- An explicit commit range means exactly that range.
|
|
31
|
+
- A root commit uses Git's root-diff form because it has no parent.
|
|
32
|
+
|
|
33
|
+
Inspect the resolved commit identities and changed paths before editing. Review
|
|
34
|
+
the committed diff, current source, direct call sites, relevant tests, and the
|
|
35
|
+
affected Program and Stack context. Do not substitute the ordinary working-tree
|
|
36
|
+
diff for the selected committed scope.
|
|
37
|
+
|
|
38
|
+
## Apply the cleanup contract
|
|
39
|
+
|
|
19
40
|
Apply the engineering approach supplied with the task. If this skill is invoked
|
|
20
41
|
directly, read `genesis/engineering.md` as well as the relevant project context.
|
|
21
42
|
Cleanup must reduce or preserve complexity, never introduce unapproved
|
|
@@ -26,7 +47,7 @@ operation to find existing public and internal functions before introducing or
|
|
|
26
47
|
consolidating an abstraction. Confirm every apparent duplicate in source and
|
|
27
48
|
its call sites.
|
|
28
49
|
|
|
29
|
-
Within the
|
|
50
|
+
Within the selected commits' intended behavior and scope, leave no
|
|
30
51
|
repeated helpers, no code that is unclear or hard to reason about, and no code
|
|
31
52
|
that goes against established patterns in the codebase. Remove unnecessary
|
|
32
53
|
wrappers, abandoned scaffolding, parallel framework plumbing, and speculative
|
|
@@ -34,7 +55,7 @@ abstractions. Consolidate ownership where one clear module is enough. Do not
|
|
|
34
55
|
optimize for tiny files or indirection; optimize for a small, obvious design
|
|
35
56
|
that a junior programmer can follow.
|
|
36
57
|
|
|
37
|
-
Cleanup is not a second implementation pass. A
|
|
58
|
+
Cleanup is not a second implementation pass. A committed path limits where cleanup
|
|
38
59
|
may occur; it does not authorize different behavior in that file. Deslop may
|
|
39
60
|
reorganize behavior already present; it may not complete, correct, or extend
|
|
40
61
|
behavior. If review reveals a defect, missing behavior, contract mismatch, or
|
|
@@ -43,15 +64,22 @@ is inside a changed path or appears related to the preceding implementation. Do
|
|
|
43
64
|
not implement the finding or alter tests to accommodate it during Deslop.
|
|
44
65
|
|
|
45
66
|
Apply every technology-specific Deslop instruction supplied by the selected
|
|
46
|
-
Stack
|
|
47
|
-
|
|
67
|
+
Stack and load applicable official technology skills for framework and language
|
|
68
|
+
context. Stack guidance enriches this contract; it cannot weaken the
|
|
69
|
+
behavior-preserving boundary, change the selected Git scope, or authorize
|
|
70
|
+
unrelated implementation.
|
|
48
71
|
|
|
49
72
|
You may edit or delete implementation and test files when that is the clearest
|
|
50
|
-
behavior-preserving cleanup.
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
73
|
+
behavior-preserving cleanup. If moving or renaming selected source makes an
|
|
74
|
+
affected Program citation stale, update only that citation or informational
|
|
75
|
+
Implementation map. Do not change the Blueprint or a Program public contract to
|
|
76
|
+
excuse cleanup behavior. Do not edit `.genesis/`, Git metadata, dependency
|
|
77
|
+
directories, generated build output, retained migration history, or external
|
|
78
|
+
resources. Do not weaken tests, public behavior, or data guarantees. Do not
|
|
79
|
+
create a second architecture or perform unrelated rewrites.
|
|
80
|
+
|
|
81
|
+
Leave the cleanup as ordinary uncommitted work for review and a later normal
|
|
82
|
+
commit. Never amend or rewrite the selected commits. Run focused checks when
|
|
83
|
+
useful. Final declared checks remain available through the Genesis `verify`
|
|
84
|
+
operation. Summarize the resolved commit range, what became simpler, files
|
|
85
|
+
changed, checks actually run, and follow-up findings left unchanged.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
interface:
|
|
2
2
|
display_name: "Genesis Deslop"
|
|
3
|
-
short_description: "
|
|
4
|
-
default_prompt: "Use $genesis-deslop
|
|
3
|
+
short_description: "Clean up committed work without behavior drift"
|
|
4
|
+
default_prompt: "Use $genesis-deslop to Deslop the latest commit."
|
|
@@ -65,19 +65,25 @@ Neither is authority or proof; both may be regenerated with the Genesis
|
|
|
65
65
|
tradeoff. Never silently override the engineering approach.
|
|
66
66
|
- Work directly in the current Git tree and leave useful edits visible in the
|
|
67
67
|
ordinary diff.
|
|
68
|
-
-
|
|
69
|
-
|
|
68
|
+
- Keep the Blueprint and affected Program modules aligned in this same turn
|
|
69
|
+
when implementation intentionally changes observable product behavior.
|
|
70
|
+
Private restructuring may require only corrected Sources or an informational
|
|
71
|
+
Implementation map, and may require no explanatory edit. Keep exact
|
|
70
72
|
consumer-owned operation declarations, such as Vibe64 `## Outputs`, aligned
|
|
71
73
|
when implementation intentionally changes the corresponding commands or
|
|
72
74
|
capabilities. Record only capability metadata and environment-variable names
|
|
73
75
|
there, never values or secrets; do not infer or execute the section as
|
|
74
|
-
Genesis behavior.
|
|
76
|
+
Genesis behavior. Treat `.genesis/` as replaceable derived navigation data,
|
|
77
|
+
not authored product intent.
|
|
75
78
|
- Follow established project and technology seams instead of creating parallel
|
|
76
79
|
frameworks, persistence layers, transports, validators, or UI systems.
|
|
77
80
|
- Never invent unavailable external-resource values or pass literal
|
|
78
81
|
environment-variable names as data. Report the missing resource and preserve
|
|
79
82
|
useful work.
|
|
80
|
-
- Keep the implementation direct and cohesive.
|
|
83
|
+
- Keep the implementation direct and cohesive. Apply any supplied Stack
|
|
84
|
+
Post-change guidance before reporting completion; it is part of this
|
|
85
|
+
implementation turn, not a request for another agent turn. Run focused checks
|
|
86
|
+
when useful.
|
|
81
87
|
|
|
82
88
|
## Verify and report
|
|
83
89
|
|
package/src/cli.js
CHANGED
|
@@ -20,12 +20,7 @@ import {
|
|
|
20
20
|
verify,
|
|
21
21
|
} from './index.js';
|
|
22
22
|
import {
|
|
23
|
-
authorizeCodexTurn,
|
|
24
23
|
codexAdoptionRecommendation,
|
|
25
|
-
codexSessionContext,
|
|
26
|
-
completeCodexTurn,
|
|
27
|
-
discardCodexTurn,
|
|
28
|
-
recordCodexTurn,
|
|
29
24
|
} from './index/codex-hooks.js';
|
|
30
25
|
import { engineeringProfile, readEngineeringBaseline } from './index/engineering.js';
|
|
31
26
|
import { asDiagnostic, fail } from './index/errors.js';
|
|
@@ -33,6 +28,7 @@ import {
|
|
|
33
28
|
inspectProjectFormat,
|
|
34
29
|
projectFormatDiagnostic,
|
|
35
30
|
} from './index/project-format.js';
|
|
31
|
+
import { projectSessionContext } from './index/session-context.js';
|
|
36
32
|
|
|
37
33
|
const USAGE = `Usage:
|
|
38
34
|
genesis init
|
|
@@ -138,8 +134,8 @@ function parseCommand(argv) {
|
|
|
138
134
|
'Command inspect requires environment or section <name>.',
|
|
139
135
|
);
|
|
140
136
|
}
|
|
141
|
-
} else if (command === 'hook' && (operands.length !== 1 || !['
|
|
142
|
-
fail('CLI_HOOK_ACTION_REQUIRED', 'Command hook requires exactly one of: discover, session
|
|
137
|
+
} else if (command === 'hook' && (operands.length !== 1 || !['discover', 'session'].includes(operands[0]))) {
|
|
138
|
+
fail('CLI_HOOK_ACTION_REQUIRED', 'Command hook requires exactly one of: discover, session.');
|
|
143
139
|
} else if (!['adopt', 'context', 'hook', 'index', 'inspect', 'prompt'].includes(command) && operands.length > 0) {
|
|
144
140
|
fail('CLI_EXTRA_ARGUMENT', `Command ${command} accepts no arguments.`);
|
|
145
141
|
}
|
|
@@ -266,8 +262,6 @@ function writeResult(command, result) {
|
|
|
266
262
|
}
|
|
267
263
|
if (command === 'hook') {
|
|
268
264
|
if (['discover', 'session'].includes(result.kind) && result.output) line(process.stdout, result.output);
|
|
269
|
-
else if (result.kind === 'authorize') line(process.stdout, `authorize: ${result.status}`);
|
|
270
|
-
else if (result.kind === 'stop') line(process.stdout, JSON.stringify(result.output));
|
|
271
265
|
return;
|
|
272
266
|
}
|
|
273
267
|
if (command === 'stack' && Array.isArray(result.pieces)) {
|
|
@@ -292,20 +286,6 @@ function writeResult(command, result) {
|
|
|
292
286
|
line(process.stdout, `${command}: ${result.status}`);
|
|
293
287
|
}
|
|
294
288
|
|
|
295
|
-
async function hookInput() {
|
|
296
|
-
if (process.stdin.isTTY) fail('CODEX_HOOK_INPUT_INVALID', 'Codex hook input must be supplied on stdin.');
|
|
297
|
-
const chunks = [];
|
|
298
|
-
let bytes = 0;
|
|
299
|
-
for await (const chunk of process.stdin) {
|
|
300
|
-
bytes += chunk.length;
|
|
301
|
-
if (bytes > 1024 * 1024) fail('CODEX_HOOK_INPUT_INVALID', 'Codex hook input exceeds 1 MiB.');
|
|
302
|
-
chunks.push(chunk);
|
|
303
|
-
}
|
|
304
|
-
try { return JSON.parse(Buffer.concat(chunks).toString('utf8')); } catch (error) {
|
|
305
|
-
fail('CODEX_HOOK_INPUT_INVALID', `Codex hook input is invalid JSON: ${error.message}.`);
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
|
|
309
289
|
async function execute({ command, operands, options }, { signal } = {}) {
|
|
310
290
|
const projectRoot = options.projectRoot || process.cwd();
|
|
311
291
|
const stackPackages = options.stackPackages || [];
|
|
@@ -382,20 +362,7 @@ async function execute({ command, operands, options }, { signal } = {}) {
|
|
|
382
362
|
if (operands[0] === 'discover') {
|
|
383
363
|
return { kind: 'discover', ...await codexAdoptionRecommendation({ projectRoot }) };
|
|
384
364
|
}
|
|
385
|
-
|
|
386
|
-
return { kind: 'session', ...await codexSessionContext({ projectRoot }) };
|
|
387
|
-
}
|
|
388
|
-
if (operands[0] === 'authorize') {
|
|
389
|
-
return { kind: 'authorize', ...await authorizeCodexTurn({ projectRoot }) };
|
|
390
|
-
}
|
|
391
|
-
const input = await hookInput();
|
|
392
|
-
if (operands[0] === 'begin') {
|
|
393
|
-
return { kind: 'begin', ...await recordCodexTurn({ input, projectRoot }) };
|
|
394
|
-
}
|
|
395
|
-
if (operands[0] === 'end') {
|
|
396
|
-
return { kind: 'end', ...await discardCodexTurn({ input, projectRoot }) };
|
|
397
|
-
}
|
|
398
|
-
return { kind: 'stop', status: 'ready', output: await completeCodexTurn({ input, projectRoot }) };
|
|
365
|
+
return { kind: 'session', ...await projectSessionContext({ projectRoot }) };
|
|
399
366
|
}
|
|
400
367
|
if (command === 'verify') {
|
|
401
368
|
return verify({
|
package/src/index/assets.js
CHANGED
|
@@ -6,7 +6,6 @@ const assets = {
|
|
|
6
6
|
adopt: new URL('prompts/adopt.txt', root),
|
|
7
7
|
work: new URL('prompts/work.txt', root),
|
|
8
8
|
describe: new URL('prompts/describe.txt', root),
|
|
9
|
-
reconcile: new URL('prompts/reconcile.txt', root),
|
|
10
9
|
deslop: new URL('prompts/deslop.txt', root),
|
|
11
10
|
program: new URL('prompts/program.txt', root),
|
|
12
11
|
blueprint: new URL('prompts/blueprint.txt', root),
|