genesis-compiler 1.10.13 → 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
|
@@ -1078,7 +1078,10 @@ and diagnostics for missing, invalid, outdated, customized, or unmanaged skills.
|
|
|
1078
1078
|
Synchronization returns changed paths, preservation diagnostics, and the resulting
|
|
1079
1079
|
`inspection`. Hosts own source-write exclusion and assistant context lifecycle.
|
|
1080
1080
|
`projectSessionContext()` composes stable project guidance with one explicitly
|
|
1081
|
-
supplied host-driver result.
|
|
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
|
|
1082
1085
|
driver for the separate untrusted turn lane without accepting user-message
|
|
1083
1086
|
text.
|
|
1084
1087
|
`getContext()` resolves source paths to the Program modules that cite them,
|
package/package.json
CHANGED
|
@@ -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
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}))
|
|
75
|
-
|
|
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(
|
|
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((
|
|
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';
|