@moreih29/nexus-core 0.4.0 → 0.6.0
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/conformance/README.md +15 -18
- package/conformance/examples/plan.extension.schema.example.json +25 -0
- package/conformance/lifecycle/README.md +1 -3
- package/conformance/lifecycle/agent-complete.json +2 -1
- package/conformance/lifecycle/agent-resume.json +2 -1
- package/conformance/lifecycle/agent-spawn.json +5 -8
- package/conformance/scenarios/full-plan-cycle.json +3 -3
- package/conformance/schema/fixture.schema.json +6 -6
- package/conformance/state-schemas/agent-tracker.schema.json +10 -5
- package/conformance/state-schemas/history.schema.json +11 -1
- package/conformance/state-schemas/plan.schema.json +5 -0
- package/conformance/state-schemas/tasks.schema.json +5 -0
- package/conformance/tools/plan-decide.json +7 -7
- package/conformance/tools/plan-start.json +1 -1
- package/conformance/tools/task-add.json +1 -1
- package/conformance/tools/task-close.json +2 -0
- package/docs/consumer-implementation-guide.md +7 -11
- package/docs/nexus-layout.md +0 -15
- package/docs/nexus-outputs-contract.md +15 -25
- package/docs/nexus-state-overview.md +0 -19
- package/docs/nexus-tools-contract.md +12 -2
- package/manifest.json +26 -26
- package/package.json +5 -1
- package/scripts/.gitkeep +0 -0
- package/scripts/conformance-coverage.ts +466 -0
- package/scripts/import-from-claude-nexus.ts +403 -0
- package/scripts/lib/frontmatter.ts +71 -0
- package/scripts/lib/lint.ts +216 -0
- package/scripts/lib/structure.ts +159 -0
- package/scripts/lib/validate.ts +668 -0
- package/scripts/validate.ts +90 -0
- package/conformance/lifecycle/session-end.json +0 -31
- package/conformance/lifecycle/session-start.json +0 -36
- package/conformance/state-schemas/runtime.schema.json +0 -25
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import {
|
|
5
|
+
loadSchemas,
|
|
6
|
+
runAll as runSchemaAndIntegrity,
|
|
7
|
+
type ValidationResult,
|
|
8
|
+
} from './lib/validate.ts';
|
|
9
|
+
import {
|
|
10
|
+
checkHarnessSpecific,
|
|
11
|
+
checkConcreteModel,
|
|
12
|
+
checkPromptOnly,
|
|
13
|
+
checkTagTriggerConsistency,
|
|
14
|
+
} from './lib/lint.ts';
|
|
15
|
+
import {
|
|
16
|
+
checkDirectoryStrict,
|
|
17
|
+
checkIdMatch,
|
|
18
|
+
} from './lib/structure.ts';
|
|
19
|
+
|
|
20
|
+
const IS_GITHUB_ACTIONS = process.env.GITHUB_ACTIONS === 'true';
|
|
21
|
+
|
|
22
|
+
async function main(): Promise<void> {
|
|
23
|
+
const root = process.cwd();
|
|
24
|
+
const allResults: ValidationResult[] = [];
|
|
25
|
+
|
|
26
|
+
// Gate 1-5: schema + referential integrity + manifest generation
|
|
27
|
+
// (runAll internally does per-file fail-forward and generates manifest on success)
|
|
28
|
+
await loadSchemas(root);
|
|
29
|
+
const schemaResults = await runSchemaAndIntegrity(root);
|
|
30
|
+
allResults.push(...schemaResults);
|
|
31
|
+
|
|
32
|
+
// Gate 6: harness-specific tool names
|
|
33
|
+
const harnessResults = await checkHarnessSpecific(root);
|
|
34
|
+
allResults.push(...harnessResults);
|
|
35
|
+
|
|
36
|
+
// Gate 7: concrete model names
|
|
37
|
+
const modelResults = await checkConcreteModel(root);
|
|
38
|
+
allResults.push(...modelResults);
|
|
39
|
+
|
|
40
|
+
// Gate 8: prompt-only enforcement
|
|
41
|
+
const promptOnlyResults = await checkPromptOnly(root);
|
|
42
|
+
allResults.push(...promptOnlyResults);
|
|
43
|
+
|
|
44
|
+
// Gate 9: directory strict
|
|
45
|
+
const dirResults = await checkDirectoryStrict(root);
|
|
46
|
+
allResults.push(...dirResults);
|
|
47
|
+
|
|
48
|
+
// Gate 10: id ↔ directory name + kebab pattern
|
|
49
|
+
const idResults = await checkIdMatch(root);
|
|
50
|
+
allResults.push(...idResults);
|
|
51
|
+
|
|
52
|
+
// Gate 11: tag trigger consistency
|
|
53
|
+
const tagTriggerResults = await checkTagTriggerConsistency(root);
|
|
54
|
+
allResults.push(...tagTriggerResults);
|
|
55
|
+
|
|
56
|
+
// Report
|
|
57
|
+
const errors = allResults.filter((r) => r.severity === 'error');
|
|
58
|
+
const warnings = allResults.filter((r) => r.severity === 'warning');
|
|
59
|
+
|
|
60
|
+
if (allResults.length === 0) {
|
|
61
|
+
console.log('All 11 validation gates passed.');
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (IS_GITHUB_ACTIONS) {
|
|
66
|
+
// GitHub annotations format
|
|
67
|
+
for (const r of allResults) {
|
|
68
|
+
const level = r.severity === 'error' ? 'error' : 'warning';
|
|
69
|
+
const lineAttr = r.line ? `,line=${r.line}` : '';
|
|
70
|
+
console.log(`::${level} file=${r.file}${lineAttr}::[${r.gate}] ${r.message}`);
|
|
71
|
+
}
|
|
72
|
+
} else {
|
|
73
|
+
// Human-readable format
|
|
74
|
+
for (const r of allResults) {
|
|
75
|
+
const loc = r.line ? `${r.file}:${r.line}` : r.file;
|
|
76
|
+
console.log(`${loc} [${r.gate}] ${r.severity.toUpperCase()}: ${r.message}`);
|
|
77
|
+
}
|
|
78
|
+
console.log('');
|
|
79
|
+
console.log(`Summary: ${errors.length} error(s), ${warnings.length} warning(s)`);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (errors.length > 0) {
|
|
83
|
+
process.exit(1);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
main().catch((err) => {
|
|
88
|
+
console.error('Fatal error in validate.ts:', err);
|
|
89
|
+
process.exit(2);
|
|
90
|
+
});
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"test_id": "session_end",
|
|
3
|
-
"description": "Verifies that session_end removes runtime.json and agent-tracker.json, completing the full session lifecycle deletion",
|
|
4
|
-
"precondition": {
|
|
5
|
-
"state_files": {
|
|
6
|
-
".nexus/state/runtime.json": {
|
|
7
|
-
"teams_enabled": true,
|
|
8
|
-
"session_started_at": "2026-04-13T00:00:00.000Z",
|
|
9
|
-
"plugin_version": "0.4.0"
|
|
10
|
-
},
|
|
11
|
-
".nexus/state/agent-tracker.json": []
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
"event": {
|
|
15
|
-
"type": "session_end",
|
|
16
|
-
"description": "Harness session hook fires at shutdown, cleaning up all runtime state files"
|
|
17
|
-
},
|
|
18
|
-
"postcondition": {
|
|
19
|
-
"state_files": {
|
|
20
|
-
".nexus/state/runtime.json": null,
|
|
21
|
-
".nexus/state/agent-tracker.json": null
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
"covers": {
|
|
25
|
-
"state_schemas": {
|
|
26
|
-
"runtime.schema.json": ["teams_enabled", "session_started_at", "plugin_version"],
|
|
27
|
-
"agent-tracker.schema.json": []
|
|
28
|
-
},
|
|
29
|
-
"description": "Covers deletion aspect of the full runtime/agent-tracker lifecycle — absence of both files after session_end"
|
|
30
|
-
}
|
|
31
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"test_id": "session_start",
|
|
3
|
-
"description": "Verifies that session_start writes runtime.json with required fields and initializes agent-tracker.json as an empty array",
|
|
4
|
-
"precondition": {
|
|
5
|
-
"state_files": {
|
|
6
|
-
".nexus/state/runtime.json": null,
|
|
7
|
-
".nexus/state/agent-tracker.json": null
|
|
8
|
-
}
|
|
9
|
-
},
|
|
10
|
-
"event": {
|
|
11
|
-
"type": "session_start",
|
|
12
|
-
"params": {
|
|
13
|
-
"teams_enabled": true,
|
|
14
|
-
"plugin_version": "0.4.0"
|
|
15
|
-
},
|
|
16
|
-
"description": "Harness session hook fires at startup, injecting runtime configuration and initializing the agent registry"
|
|
17
|
-
},
|
|
18
|
-
"postcondition": {
|
|
19
|
-
"state_files": {
|
|
20
|
-
".nexus/state/runtime.json": {
|
|
21
|
-
"$.teams_enabled": true,
|
|
22
|
-
"$.session_started_at": { "type": "iso8601" },
|
|
23
|
-
"$.plugin_version": { "type": "string", "minLength": 1 }
|
|
24
|
-
},
|
|
25
|
-
".nexus/state/agent-tracker.json": {
|
|
26
|
-
"$.length": 0
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
"covers": {
|
|
31
|
-
"state_schemas": {
|
|
32
|
-
"runtime.schema.json": ["teams_enabled", "session_started_at", "plugin_version"],
|
|
33
|
-
"agent-tracker.schema.json": []
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"$id": "conformance/state-schemas/runtime.schema.json",
|
|
4
|
-
"title": "Nexus Runtime State",
|
|
5
|
-
"description": "Schema for .nexus/state/runtime.json — ephemeral runtime configuration written by the harness at session start",
|
|
6
|
-
"type": "object",
|
|
7
|
-
"additionalProperties": false,
|
|
8
|
-
"required": ["teams_enabled", "session_started_at", "plugin_version"],
|
|
9
|
-
"properties": {
|
|
10
|
-
"teams_enabled": {
|
|
11
|
-
"type": "boolean",
|
|
12
|
-
"description": "Whether multi-agent team orchestration is active in this session"
|
|
13
|
-
},
|
|
14
|
-
"session_started_at": {
|
|
15
|
-
"type": "string",
|
|
16
|
-
"format": "date-time",
|
|
17
|
-
"description": "ISO 8601 timestamp when the current harness session was started"
|
|
18
|
-
},
|
|
19
|
-
"plugin_version": {
|
|
20
|
-
"type": "string",
|
|
21
|
-
"minLength": 1,
|
|
22
|
-
"description": "Version string of the harness plugin that wrote this file"
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|