genesis-compiler 1.10.12 → 1.10.14

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
@@ -736,9 +736,13 @@ The eight task types are deliberately explicit:
736
736
  - `describe` creates or refreshes both the non-technical Blueprint and the
737
737
  complete useful Program from the current codebase, optional user guidance,
738
738
  and selected Stack guidance where it affects accurate explanation.
739
- - `review` is read-only. It asks the agent to compare Blueprint, code, Program,
740
- and tests, identify contradictions and gaps, and distinguish evidence from
741
- inference.
739
+ - `review` asks the agent to compare Blueprint, code, Program, and tests,
740
+ identify contradictions and gaps, and distinguish evidence from inference.
741
+ It judges the tests too: the relevant ones run and pass, with what ran and
742
+ what was not verified reported; changed behavior has tests; no test was
743
+ weakened, skipped, deleted or loosened to pass; and the changed tests stay
744
+ fast against coarse sanity limits. It edits only tests, writing the missing
745
+ ones or reporting those it cannot.
742
746
 
743
747
  Prompt generation is read-only. Missing external resources are reported in
744
748
  the prompt but do not prevent its generation. Genesis never invents values.
@@ -1074,7 +1078,10 @@ and diagnostics for missing, invalid, outdated, customized, or unmanaged skills.
1074
1078
  Synchronization returns changed paths, preservation diagnostics, and the resulting
1075
1079
  `inspection`. Hosts own source-write exclusion and assistant context lifecycle.
1076
1080
  `projectSessionContext()` composes stable project guidance with one explicitly
1077
- supplied host-driver result. `projectTurnContext()` invokes that same optional
1081
+ supplied host-driver result. A project file Genesis cannot read does not stop
1082
+ it: the context names the file, the line and the text Genesis found there, so
1083
+ the agent can repair it. That includes an Agent Skill source and an agent
1084
+ integration file such as `.claude/settings.json`. `projectTurnContext()` invokes that same optional
1078
1085
  driver for the separate untrusted turn lane without accepting user-message
1079
1086
  text.
1080
1087
  `getContext()` resolves source paths to the Program modules that cite them,
@@ -161,8 +161,18 @@ before selection. For an existing uninitialized codebase it owns
161
161
  the adoption recommendation as part of the same portable prompt. A host sends this prompt on the
162
162
  first chat turn; it does not recreate the questions or Stack catalog.
163
163
  `describe` creates or refreshes the complete Blueprint and useful Program in one
164
- agent task. The host owns the agent and its interaction. Genesis owns only
165
- transparent prompt construction and deterministic project operations.
164
+ agent task. `review` is the generic review contract a host gives an agent after
165
+ a piece of work. Besides comparing Blueprint, code, Program and tests, it has
166
+ the agent judge the tests: the relevant ones run and pass, with what ran and
167
+ what was not verified reported; changed behavior has new or updated tests,
168
+ written in the review or reported when they cannot be; a test weakened,
169
+ skipped, deleted or loosened to pass is a finding; and the changed tests stay
170
+ fast against coarse sanity limits (a suite never runs for hours, a test needing
171
+ minutes is a smell, a test database is ready in seconds), never per-test
172
+ budgets. It points at the project skill's verification section and the sanity
173
+ checks guide rather than restating them, and edits only tests. The host owns
174
+ the agent and its interaction. Genesis owns only transparent prompt
175
+ construction and deterministic project operations.
166
176
 
167
177
  ## Instruction sources
168
178
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "genesis-compiler",
3
- "version": "1.10.12",
3
+ "version": "1.10.14",
4
4
  "type": "module",
5
5
  "description": "An agent-independent prompt, multi-language code-index, cleanup, and verification companion with project agent guidance.",
6
6
  "repository": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "genesis",
3
- "version": "1.10.12",
3
+ "version": "1.10.14",
4
4
  "description": "Makes Codex aware of optional Genesis adoption for existing projects.",
5
5
  "author": {
6
6
  "name": "Mobily Enterprises"
@@ -1,6 +1,5 @@
1
1
  Read `.agents/skills/genesis-project/SKILL.md` and
2
- `.agents/skills/genesis-program/SKILL.md` completely, then perform a read-only
3
- review.
2
+ `.agents/skills/genesis-program/SKILL.md` completely, then review the work.
4
3
 
5
4
  Compare Blueprint intent, observable implementation, tests, Program public
6
5
  contracts, informational implementation maps, and recorded verification in both
@@ -8,6 +7,21 @@ directions. Identify missing or contradictory behavior, misleading explanation,
8
7
  unnecessarily difficult public shape, and verification gaps. Distinguish direct
9
8
  evidence from inference and state questions that require human intent.
10
9
 
10
+ Judge the tests as part of the work, with the project skill's "Verify and
11
+ report" section and the test sections of the sanity checks guide:
12
+ - Run the tests relevant to the change, through the Stack's verification
13
+ commands or focused checks; a failure is a finding. Report what actually ran
14
+ and anything not verified; never report an unrun check as passing.
15
+ - Changed behavior has tests, new or updated, that would fail without it. Write
16
+ the missing ones as part of this review; when that is not possible, report
17
+ each with the behavior it should prove.
18
+ - A test weakened, skipped, deleted or loosened just to make things pass is a
19
+ finding, reported like a product defect.
20
+ - Tests stay fast. Look at what the changed tests cost and where their time
21
+ goes. Coarse sanity limits, never per-test budgets: a whole suite never runs
22
+ for hours, one test that needs minutes is a smell, and a test database is
23
+ ready in seconds.
24
+
11
25
  Report what makes requests or tests slower than their work, citing a count or
12
26
  timing where one exists and the code path otherwise: a list or batch whose
13
27
  query count grows with its rows, an access check whose cost grows with stored
@@ -21,7 +35,9 @@ access decided from ids the client sends rather than the trusted context.
21
35
  Judge each against the matching section and outer limit of
22
36
  `.agents/skills/genesis-project/references/sanity-checks.md`.
23
37
 
24
- Do not edit any file. Return a concise report ordered by impact with exact file
25
- references, the evidence inspected, and the smallest sensible correction.
38
+ Edit only tests: add or update the tests the changed behavior lacks, and change
39
+ no product code, Blueprint, Program, Stack or other file. Return a concise
40
+ report ordered by impact with exact file references, the evidence inspected,
41
+ the tests run and written, and the smallest sensible correction.
26
42
 
27
43
  Review `genesis/subsystems.md` responsibilities, Program membership, and data ownership/use against source and schema. Report missing, stale, or conflicting associations without editing them.
@@ -71,14 +71,14 @@ Program module.
71
71
  ## Task boundaries
72
72
 
73
73
  The caller determines whether this is initial description, complete Program
74
- refresh, focused post-change reconciliation, Blueprint-only work, or read-only
75
- review. Respect the caller's edit boundary. Report ambiguity rather than
74
+ refresh, focused post-change reconciliation, Blueprint-only work, or review.
75
+ Respect the caller's edit boundary. Report ambiguity rather than
76
76
  inventing intent.
77
77
 
78
78
  ## Subsystems
79
79
 
80
80
  Maintain `genesis/subsystems.md` alongside Program in description and refresh
81
- work. Blueprint-only work does not change the map; review remains read-only.
81
+ work. Blueprint-only work and review do not change the map.
82
82
  The map is the authored association authority, but responsibilities and table
83
83
  references remain fallible explanations of application source and schema.
84
84
 
@@ -315,6 +315,12 @@ export async function projectSkillPlan(stack, { projectRoot } = {}) {
315
315
  if (projectRoot) {
316
316
  let manifest;
317
317
  try { manifest = JSON.parse(await readFile(path.join(projectRoot, 'package.json'), 'utf8')); } catch (error) {
318
+ // The manifest says whether the project declares its own genesis-compiler skills.
319
+ if (error instanceof SyntaxError) {
320
+ throw new GenesisError('AGENT_SKILL_SOURCE_INVALID',
321
+ `package.json is not valid JSON, so the project's genesis-compiler skills cannot be located: ${error.message}.`,
322
+ { path: 'package.json' });
323
+ }
318
324
  if (!['ENOENT', 'ENOTDIR'].includes(error?.code)) throw error;
319
325
  }
320
326
  if (manifest?.name === 'genesis-compiler') {
@@ -1,14 +1,30 @@
1
1
  import { readCollaboration } from './collaboration.js';
2
+ import { inspectAgentIntegrations } from './agent-integrations.js';
2
3
  import { inspectProjectSkills, renderAgentSkillCatalog } from './agent-skills.js';
3
4
  import { GENESIS_CONTRACTS } from './contracts.js';
4
5
  import { readEngineering, readEngineeringBaseline } from './engineering.js';
5
6
  import { asDiagnostic } from './errors.js';
6
7
  import { gitContext } from './git.js';
8
+ import { STACK_PATH } from './paths.js';
7
9
  import { inspectProjectAtRoot } from './project-inspection.js';
8
10
  import { readStack } from './stack.js';
9
11
  import { listStackCatalogPieces } from './stack-catalog.js';
10
12
  import { composedContext, hostContextContribution } from './host-context.js';
11
13
 
14
+ /**
15
+ * A diagnostic as the agent needs it to repair the file: the file, the line and the text found there,
16
+ * when Genesis knows them. Stack section parsers number lines within their section.
17
+ */
18
+ function diagnosticText({ message, details }) {
19
+ const file = typeof details?.path === 'string' ? details.path : '';
20
+ const line = Number.isSafeInteger(details?.line)
21
+ ? ` (line ${details.line}${file === STACK_PATH ? ' of its section' : ''})`
22
+ : '';
23
+ const where = file && (line || !message.includes(file)) ? `${file}${line}: ` : '';
24
+ const found = typeof details?.observed === 'string' ? ` Found: ${JSON.stringify(details.observed)}.` : '';
25
+ return `${where}${message}${found}`;
26
+ }
27
+
12
28
  async function optionalStack(projectRoot, stackPackages) {
13
29
  try { return await readStack(projectRoot, { stackPackages }); } catch { return null; }
14
30
  }
@@ -68,11 +84,16 @@ export async function projectSessionContext({
68
84
  inspectProjectAtRoot(root, { stackPackages, count: false }),
69
85
  ]);
70
86
  const availableComponents = await optionalStackComponentIds(root, stack, stackPackages);
71
- const skills = stack && inspection.projectFormat.status === 'current'
72
- ? await inspectProjectSkills({ projectRoot: root, stack }).catch((error) => ({
73
- diagnostics: [asDiagnostic(error)],
74
- }))
75
- : { diagnostics: [] };
87
+ const current = inspection.projectFormat.status === 'current';
88
+ const [skills, integrations] = await Promise.all([
89
+ stack && current
90
+ ? inspectProjectSkills({ projectRoot: root, stack }).catch((error) => ({
91
+ diagnostics: [asDiagnostic(error)],
92
+ }))
93
+ : { diagnostics: [] },
94
+ // Only an integration file Genesis cannot read is reported; a missing or outdated one is synchronization work.
95
+ current ? inspectAgentIntegrations({ projectRoot: root }).then(() => [], (error) => [asDiagnostic(error)]) : [],
96
+ ]);
76
97
  const selected = stack?.components.map(({ id }) => id) || [];
77
98
  const stackStatus = stack
78
99
  ? (selected.length > 0 ? selected.join(', ') : 'none')
@@ -85,7 +106,7 @@ export async function projectSessionContext({
85
106
  ] : inspection.state === 'adoption' ? [
86
107
  '- Existing project content needs description and configuration. Ask what this project does and what the user wants to run, using answers already supplied. Inspect its implementation to work backwards into Blueprint, Stack and Program. Do not offer seeds or replace existing source/history. Run `genesis adopt` and follow its prompt; initialized Genesis files already express the user’s decision to use Genesis.',
87
108
  ] : inspection.state === 'attention' ? [
88
- `- Genesis needs attention: ${inspection.diagnostics.map(({ message }) => message).join(' ')} Next action: ${inspection.nextAction}. Preserve source and explain the specific issue before the relevant migration or repair. Do not offer seeds.`,
109
+ `- Genesis needs attention: ${inspection.diagnostics.map(diagnosticText).join(' ')} Next action: ${inspection.nextAction}. Preserve source and explain the specific issue before the relevant migration or repair. Do not offer seeds.`,
89
110
  ] : []),
90
111
  '- Opening or resuming a session only reads project metadata and content paths. Do not run verification, tests, builds, dependency installation, or database preparation just because a session started. Run relevant checks when the requested work calls for them.',
91
112
  '- Read `genesis/blueprint.md`, `genesis/collaboration.md`, `genesis/engineering.md`, and `genesis/stack.md` for product intent, collaboration approach, engineering approach, and selected technology.',
@@ -95,8 +116,9 @@ export async function projectSessionContext({
95
116
  '- When the user names an unselected technology that exactly matches this catalog, run `genesis stack list`, ask whether to add and prepare it, and wait for confirmation. If confirmed, run `genesis stack add <piece...>` and follow its returned preparation prompt in the same task; then use `genesis context` and any installed technology skill. Never infer dependency commands from a component id. If declined or unmatched, continue through authoritative technology documentation without inventing a component.',
96
117
  '- Project-owned operation sections in `genesis/stack.md` are the durable application contract. Make the implementation satisfy them or update a complete section to match evidenced reality; Genesis executes only Verification.',
97
118
  '- Use the relevant project Agent Skills below `.agents/skills/`.',
98
- ...skills.diagnostics.map(({ message }) => `- Agent Skill maintenance: ${message}`),
119
+ ...skills.diagnostics.map((diagnostic) => `- Agent Skill maintenance: ${diagnosticText(diagnostic)}`),
99
120
  ...(skills.diagnostics.length > 0 ? ['- Skill inspection is read-only. Synchronization is an explicit source change; follow the current task authorization and host write boundary before running it.'] : []),
121
+ ...integrations.map((diagnostic) => `- Agent integration maintenance: ${diagnosticText(diagnostic)}`),
100
122
  '- After locating source, run `genesis context <path...>`; before adding a helper or public operation, run `genesis index <name-or-path...>` and reuse an existing owner.',
101
123
  '- If genesis/subsystems.md is missing or empty in an existing explained application, author it from source, schema and existing Program before implementation. This is ordinary explanatory adoption, not a startup blocker; do not run tests or application commands merely to create the map.',
102
124
  '- Read genesis/subsystems.md for declared subsystem responsibilities, Program membership, and data ownership/use. Maintain it in the same implementation turn when those facts change; reuse existing boundaries, verify source/schema, and require one Source Directory per subsystem and assign each Program module once; Program folder names do not assign ownership.',
@@ -118,7 +140,7 @@ export async function projectSessionContext({
118
140
  ...(skills.skills?.length ? ['', 'PROJECT AGENT SKILLS', '', renderAgentSkillCatalog(skills.skills)] : []),
119
141
  ...(hostContext ? ['', 'HOST CONTEXT', '', hostContext] : []),
120
142
  ].join('\n');
121
- return { ...composedContext(GENESIS_CONTRACTS.sessionContext, output), warnings: skills.diagnostics };
143
+ return { ...composedContext(GENESIS_CONTRACTS.sessionContext, output), warnings: [...skills.diagnostics, ...integrations] };
122
144
  }
123
145
 
124
146
  export { projectTurnContext } from './host-context.js';