@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.
Files changed (34) hide show
  1. package/conformance/README.md +15 -18
  2. package/conformance/examples/plan.extension.schema.example.json +25 -0
  3. package/conformance/lifecycle/README.md +1 -3
  4. package/conformance/lifecycle/agent-complete.json +2 -1
  5. package/conformance/lifecycle/agent-resume.json +2 -1
  6. package/conformance/lifecycle/agent-spawn.json +5 -8
  7. package/conformance/scenarios/full-plan-cycle.json +3 -3
  8. package/conformance/schema/fixture.schema.json +6 -6
  9. package/conformance/state-schemas/agent-tracker.schema.json +10 -5
  10. package/conformance/state-schemas/history.schema.json +11 -1
  11. package/conformance/state-schemas/plan.schema.json +5 -0
  12. package/conformance/state-schemas/tasks.schema.json +5 -0
  13. package/conformance/tools/plan-decide.json +7 -7
  14. package/conformance/tools/plan-start.json +1 -1
  15. package/conformance/tools/task-add.json +1 -1
  16. package/conformance/tools/task-close.json +2 -0
  17. package/docs/consumer-implementation-guide.md +7 -11
  18. package/docs/nexus-layout.md +0 -15
  19. package/docs/nexus-outputs-contract.md +15 -25
  20. package/docs/nexus-state-overview.md +0 -19
  21. package/docs/nexus-tools-contract.md +12 -2
  22. package/manifest.json +26 -26
  23. package/package.json +5 -1
  24. package/scripts/.gitkeep +0 -0
  25. package/scripts/conformance-coverage.ts +466 -0
  26. package/scripts/import-from-claude-nexus.ts +403 -0
  27. package/scripts/lib/frontmatter.ts +71 -0
  28. package/scripts/lib/lint.ts +216 -0
  29. package/scripts/lib/structure.ts +159 -0
  30. package/scripts/lib/validate.ts +668 -0
  31. package/scripts/validate.ts +90 -0
  32. package/conformance/lifecycle/session-end.json +0 -31
  33. package/conformance/lifecycle/session-start.json +0 -36
  34. package/conformance/state-schemas/runtime.schema.json +0 -25
@@ -18,7 +18,7 @@ Nexus 산출물은 생성 책임 주체에 따라 세 카테고리로 분류된
18
18
  | 카테고리 | 책임 주체 | 예시 파일 |
19
19
  |---|---|---|
20
20
  | Tool-produced | MCP tool 계약 (nexus-tools-contract.md 정의) | `plan.json`, `tasks.json`, `history.json` |
21
- | Harness-produced | Session hook (하네스 구현 책임) | `runtime.json`, `agent-tracker.json` |
21
+ | Harness-produced | Session hook (하네스 구현 책임) | `agent-tracker.json` |
22
22
  | Agent-produced (ephemeral) | `artifact_write` 도구 (에이전트가 호출) | `artifacts/*.md` (등 임의 파일명) |
23
23
 
24
24
  카테고리 간 경계는 "누가 파일을 만드는가"로 정의된다. MCP tool이 직접 write하면 Tool-produced, 하네스 hook이 세션 초기화·종료 시 관리하면 Harness-produced, 에이전트가 `artifact_write`를 통해 기록하면 Agent-produced다.
@@ -88,25 +88,6 @@ Nexus 산출물은 생성 책임 주체에 따라 세 카테고리로 분류된
88
88
 
89
89
  ## Harness-produced 산출물
90
90
 
91
- ### `runtime.json` — 세션 런타임 메타데이터
92
-
93
- **책임 주체**: Session hook (하네스 구현 책임). 어떤 MCP tool도 이 파일을 write해서는 안 된다.
94
-
95
- **생성 trigger**: 하네스는 세션 초기화 시 MUST `runtime.json`을 생성해야 한다. 이 파일은 MCP tool 호출이 시작되기 전에 존재해야 한다.
96
-
97
- **삭제 trigger**: 하네스는 세션 종료 시 MUST `runtime.json`을 삭제해야 한다.
98
-
99
- **Schema reference**: `conformance/state-schemas/runtime.schema.json`
100
-
101
- **Interop requirement**:
102
- - 하네스는 `runtime.json`을 기록할 때 MUST `conformance/state-schemas/runtime.schema.json`에 유효한 JSON을 기록해야 한다.
103
- - 다른 하네스의 session hook이 이 파일을 read할 경우 schema에 정의된 필드에만 의존해야 한다. MUST NOT schema 외부의 하네스 전용 필드에 의존해서는 안 된다.
104
- - `runtime.json`은 MUST NOT git-tracked 상태로 commit되어서는 안 된다.
105
-
106
- **Conformance fixture reference**: 해당 없음. `runtime.json`은 MCP tool behavioral fixture 범위 외에 있으며 하네스 session hook이 전적으로 책임진다.
107
-
108
- ---
109
-
110
91
  ### `agent-tracker.json` — 에이전트 인스턴스 추적
111
92
 
112
93
  **책임 주체**: Session hook (하네스 구현 책임). 어떤 MCP tool도 이 파일에 직접 write해서는 안 된다.
@@ -161,7 +142,7 @@ Nexus 산출물은 생성 책임 주체에 따라 세 카테고리로 분류된
161
142
 
162
143
  4. **append-only ledger 보전**: `history.json`은 모든 하네스 간에 MUST append-only로 처리되어야 한다. 기존 cycle 레코드를 수정하거나 삭제하는 하네스는 cross-harness 호환성 보장 대상에서 제외된다.
163
144
 
164
- 5. **session-scoped 파일 격리**: `plan.json`, `tasks.json`, `runtime.json`, `agent-tracker.json`, `artifacts/` 디렉토리는 MUST git-tracked 상태로 commit되어서는 안 된다. 이 파일들은 세션 범위에 속하며 프로젝트 영구 기록이 아니다. 하네스는 MUST `.gitignore`에 이 경로들을 포함해야 한다.
145
+ 5. **session-scoped 파일 격리**: `plan.json`, `tasks.json`, `agent-tracker.json`, `artifacts/` 디렉토리는 MUST git-tracked 상태로 commit되어서는 안 된다. 이 파일들은 세션 범위에 속하며 프로젝트 영구 기록이 아니다. 하네스는 MUST `.gitignore`에 이 경로들을 포함해야 한다.
165
146
 
166
147
  6. **Tool 이름 참조 금지**: 산출물 파일 내용 안에 harness-specific tool 이름(하네스별 MCP prefix, 하네스별 도구 식별자 등)을 MUST NOT 기록해서는 안 된다. 산출물은 harness-neutral해야 한다.
167
148
 
@@ -204,7 +185,7 @@ Nexus 산출물은 생성 책임 주체에 따라 세 카테고리로 분류된
204
185
  - **MUST**: 하네스 고유 파일(독립 파일 + extension)은 모두 `.nexus/state/{harness-id}/` 하위에만 배치한다.
205
186
  - **MUST NOT**: `.nexus/state/` 루트에 신규 하네스 파일을 추가한다.
206
187
  - **MUST NOT**: 다른 하네스의 namespace 디렉토리에 쓰거나 읽는다.
207
- - **MUST NOT**: `{harness-id}/` 하위에서 공통 schema 파일명(plan.json, tasks.json, history.json, runtime.json, agent-tracker.json)을 재사용한다. 예: `.nexus/state/claude-nexus/plan.json` 금지.
188
+ - **MUST NOT**: `{harness-id}/` 하위에서 공통 schema 파일명(plan.json, tasks.json, history.json, agent-tracker.json)을 재사용한다. 예: `.nexus/state/claude-nexus/plan.json` 금지.
208
189
  - **예외**: v0.3.x 이하에 루트 경로로 등록된 legacy 2종(`edit-tracker.json`, `reopen-tracker.json`)은 `task_close` tool 계약에 묶여 있어 backward-compat으로 루트 유지 허용한다. 신규 파일에는 예외 편승 금지.
209
190
 
210
191
  ### Archive 정책
@@ -224,7 +205,6 @@ Nexus 산출물은 생성 책임 주체에 따라 세 카테고리로 분류된
224
205
  .nexus/state/
225
206
  ├── plan.json ← 공통, strict
226
207
  ├── tasks.json
227
- ├── runtime.json
228
208
  ├── agent-tracker.json
229
209
  ├── artifacts/
230
210
  └── claude-nexus/ ← namespace 디렉토리
@@ -238,6 +218,16 @@ Nexus 산출물은 생성 책임 주체에 따라 세 카테고리로 분류된
238
218
 
239
219
  (루트 레벨 `edit-tracker.json`/`reopen-tracker.json`은 legacy carve-out으로 v0.3.x 이하 호환 유지)
240
220
 
221
+ ### Reference example
222
+
223
+ `conformance/examples/plan.extension.schema.example.json`에 non-normative 참조 예시가 있다. 이 파일은 다음 요소를 보여준다:
224
+
225
+ - `extends` 필드 (const: 부모 schema 경로)로 extension이 참조하는 common schema를 명시
226
+ - `additionalProperties: false` — 확장 schema에서도 엄격 적용
227
+ - `harness_id` 필드와 harness-specific field placeholder
228
+
229
+ consumer는 이 파일을 starting point로 삼아 자신의 실제 extension 필드로 교체한다.
230
+
241
231
  ---
242
232
 
243
233
  ## Conformance 의무와의 연결
@@ -250,7 +240,7 @@ fixture 통과 = schema field 100% coverage ≠ 산출물 제어 의무 이행.
250
240
 
251
241
  fixture는 도구 호출의 반환값과 state file postcondition을 검증하지만, 아래 항목은 fixture만으로 검증되지 않는다.
252
242
 
253
- - Harness-produced 산출물(`runtime.json`, `agent-tracker.json`)의 생성·삭제 타이밍
243
+ - Harness-produced 산출물(`agent-tracker.json`)의 생성·삭제 타이밍
254
244
  - Cross-harness interop 의무(다른 하네스가 생성한 파일을 읽을 수 있는가)
255
245
  - Forward-compatible schema 유지 의무
256
246
  - git-tracking 격리 의무
@@ -261,7 +251,7 @@ fixture는 도구 호출의 반환값과 state file postcondition을 검증하
261
251
 
262
252
  `conformance/README.md`가 정의하는 schema field coverage 의무: 모든 state-schema field는 최소 하나의 fixture의 `covers` 항목에 등장해야 한다. 이 의무는 fixture suite가 schema 전체를 검증함을 보장한다.
263
253
 
264
- 본 문서는 이 의무가 **Tool-produced 산출물에 대해서만** 적용됨을 명시한다. Harness-produced 산출물(`runtime.json`, `agent-tracker.json`)의 field coverage는 하네스 자체 테스트 suite의 책임이다.
254
+ 본 문서는 이 의무가 **Tool-produced 산출물에 대해서만** 적용됨을 명시한다. Harness-produced 산출물(`agent-tracker.json`)의 field coverage는 하네스 자체 테스트 suite의 책임이다.
265
255
 
266
256
  schema field가 신규 추가되었을 때, nexus-core 관리자는 MUST 해당 field를 cover하는 fixture를 추가하거나 기존 fixture를 갱신해야 한다. field를 schema에 추가하면서 fixture를 갱신하지 않는 것은 coverage 의무 위반이다.
267
257
 
@@ -91,25 +91,6 @@ The Nexus state layout is divided into two categories:
91
91
 
92
92
  ---
93
93
 
94
- ### `.nexus/state/runtime.json`
95
-
96
- | Attribute | Value |
97
- |-----------|-------|
98
- | Scope | Session |
99
- | Git-tracked | No |
100
- | Created by | Session start (harness hook) |
101
- | Deleted by | Session end (harness hook) |
102
-
103
- **Purpose.** Holds session-level runtime metadata established when the harness initializes (e.g., session identifiers, harness version, environment properties). This file is managed entirely by the harness layer; no Nexus MCP tool writes to it.
104
-
105
- **Creation trigger.** Written by the harness during session initialization before any tool is called.
106
-
107
- **Deletion trigger.** Removed by the harness upon session teardown.
108
-
109
- **Tool access.** Read-only by the harness infrastructure. No Nexus MCP tool listed in this specification reads or writes this file directly.
110
-
111
- ---
112
-
113
94
  ### `.nexus/state/agent-tracker.json`
114
95
 
115
96
  | Attribute | Value |
@@ -102,7 +102,17 @@ Mutates the issue list of the active planning session. Supports four discrete ac
102
102
 
103
103
  ### Return Value
104
104
 
105
- All responses include an `issue` field containing the affected `PlanIssue` object. The discriminating field varies by action:
105
+ All responses include an `issue` field containing the affected `PlanIssue` object.
106
+
107
+ The `issue` object contains:
108
+
109
+ | Field | Type | Presence |
110
+ |-------|------|----------|
111
+ | `id` | `number` | always |
112
+ | `title` | `string` | on `add`, `edit`, `reopen` |
113
+ | `status` | `"pending" \| "decided"` | on `add`, `reopen` |
114
+
115
+ The discriminating field varies by action:
106
116
 
107
117
  | Action | Discriminating Field | Value |
108
118
  |--------|----------------------|-------|
@@ -140,7 +150,7 @@ Records a decision for a specific issue and marks it as `"decided"`. Triggered b
140
150
  | Name | Type | Required | Description |
141
151
  |------|------|----------|-------------|
142
152
  | `issue_id` | `number` | yes | Identifier of the issue being decided |
143
- | `summary` | `string` | yes | Decision summary to record against the issue |
153
+ | `decision` | `string` | yes | Decision text to record against the issue |
144
154
  | `how_agents` | `string[]` | no | Names of HOW agents that contributed analysis |
145
155
  | `how_summary` | `Record<string, string>` | no | Per-agent key position summaries |
146
156
  | `how_agent_ids` | `Record<string, string>` | no | Agent name to agent-instance ID mapping for future resume |
package/manifest.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
- "nexus_core_version": "0.4.0",
3
- "nexus_core_commit": "2cc2402301c1f9b95ef0e9896c30e561357a7c35",
2
+ "nexus_core_version": "0.6.0",
3
+ "nexus_core_commit": "bcde383b56308b86006babe73f87fed9222c0761",
4
4
  "schema_contract_version": "2.0",
5
5
  "agents": [
6
6
  {
@@ -50,20 +50,6 @@
50
50
  "id": "designer",
51
51
  "body_hash": "sha256:88ac56147d0e5bdf23fa591ce570a9c2d0eb1338df4ec2219f6238ddfcb65df4"
52
52
  },
53
- {
54
- "name": "engineer",
55
- "description": "Implementation — writes code, debugs issues, follows specifications from Lead and architect",
56
- "task": "Code implementation, edits, debugging",
57
- "alias_ko": "엔지니어",
58
- "category": "do",
59
- "resume_tier": "bounded",
60
- "model_tier": "standard",
61
- "capabilities": [
62
- "no_task_create"
63
- ],
64
- "id": "engineer",
65
- "body_hash": "sha256:3d58b1b490c2f93cace2eedd0f04ec000f84514388eb086768cf53f8fa33db01"
66
- },
67
53
  {
68
54
  "name": "strategist",
69
55
  "description": "Business strategy — evaluates market positioning, competitive landscape, and business viability of decisions",
@@ -80,6 +66,20 @@
80
66
  "id": "strategist",
81
67
  "body_hash": "sha256:0254b4144a22c66209bd68119553d9057a4fb7f9b1ff7ebb9878687d99583465"
82
68
  },
69
+ {
70
+ "name": "engineer",
71
+ "description": "Implementation — writes code, debugs issues, follows specifications from Lead and architect",
72
+ "task": "Code implementation, edits, debugging",
73
+ "alias_ko": "엔지니어",
74
+ "category": "do",
75
+ "resume_tier": "bounded",
76
+ "model_tier": "standard",
77
+ "capabilities": [
78
+ "no_task_create"
79
+ ],
80
+ "id": "engineer",
81
+ "body_hash": "sha256:3d58b1b490c2f93cace2eedd0f04ec000f84514388eb086768cf53f8fa33db01"
82
+ },
83
83
  {
84
84
  "name": "researcher",
85
85
  "description": "Independent investigation — conducts web searches, gathers evidence, and reports findings with citations",
@@ -155,6 +155,16 @@
155
155
  "id": "nx-run",
156
156
  "body_hash": "sha256:6c8d1a36626d4034209ff83780dec6238297ec4710612441b2ef09daac714ca8"
157
157
  },
158
+ {
159
+ "name": "nx-sync",
160
+ "description": "Context knowledge synchronization — scans project state and updates .nexus/context/ design documents",
161
+ "summary": "Context knowledge synchronization",
162
+ "triggers": [
163
+ "sync"
164
+ ],
165
+ "id": "nx-sync",
166
+ "body_hash": "sha256:a7b0ae8f13ebcd10e52361d0ada1570ff0c47933f731deec07e95539c63e6946"
167
+ },
158
168
  {
159
169
  "name": "nx-init",
160
170
  "description": "Project onboarding — scan, mission, essentials, context generation",
@@ -166,16 +176,6 @@
166
176
  "id": "nx-init",
167
177
  "body_hash": "sha256:3c8230ecc0f87c541ec0ff80492a28f28bf173d0b9781901adadfae69a54b8ed"
168
178
  },
169
- {
170
- "name": "nx-sync",
171
- "description": "Context knowledge synchronization — scans project state and updates .nexus/context/ design documents",
172
- "summary": "Context knowledge synchronization",
173
- "triggers": [
174
- "sync"
175
- ],
176
- "id": "nx-sync",
177
- "body_hash": "sha256:a7b0ae8f13ebcd10e52361d0ada1570ff0c47933f731deec07e95539c63e6946"
178
- },
179
179
  {
180
180
  "name": "nx-plan",
181
181
  "description": "Structured multi-perspective analysis to decompose issues, align on decisions, and produce an enriched plan before execution. Plan only — does not execute.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moreih29/nexus-core",
3
- "version": "0.4.0",
3
+ "version": "0.6.0",
4
4
  "description": "Nexus ecosystem Authoring layer — canonical prompts, neutral metadata, and vocabulary shared by Nexus harnesses",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -28,8 +28,12 @@
28
28
  "schema",
29
29
  "conformance",
30
30
  "docs",
31
+ "scripts",
31
32
  "manifest.json"
32
33
  ],
34
+ "bin": {
35
+ "nexus-validate-conformance": "./scripts/conformance-coverage.ts"
36
+ },
33
37
  "engines": {
34
38
  "node": ">=20"
35
39
  },
File without changes