@moreih29/nexus-core 0.3.0 → 0.5.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 +208 -16
- package/conformance/examples/plan.extension.schema.example.json +25 -0
- package/conformance/lifecycle/README.md +17 -0
- package/conformance/lifecycle/agent-complete.json +44 -0
- package/conformance/lifecycle/agent-resume.json +43 -0
- package/conformance/lifecycle/agent-spawn.json +42 -0
- package/conformance/lifecycle/session-end.json +32 -0
- package/conformance/lifecycle/session-start.json +38 -0
- package/conformance/scenarios/full-plan-cycle.json +17 -2
- package/conformance/scenarios/task-deps-ordering.json +12 -0
- package/conformance/schema/fixture.schema.json +139 -9
- 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/runtime.schema.json +13 -4
- package/conformance/state-schemas/tasks.schema.json +5 -0
- package/conformance/tools/artifact-write.json +97 -0
- package/conformance/tools/context.json +172 -0
- package/conformance/tools/history-search.json +219 -0
- package/conformance/tools/plan-decide.json +72 -3
- package/conformance/tools/plan-start.json +14 -0
- package/conformance/tools/plan-status.json +127 -0
- package/conformance/tools/plan-update.json +341 -0
- package/conformance/tools/task-add.json +89 -6
- package/conformance/tools/task-close.json +67 -4
- package/conformance/tools/task-list.json +20 -0
- package/conformance/tools/task-update.json +28 -0
- package/docs/consumer-implementation-guide.md +1 -1
- package/docs/nexus-outputs-contract.md +287 -0
- package/docs/nexus-tools-contract.md +12 -2
- package/manifest.json +54 -54
- package/package.json +6 -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
|
@@ -555,7 +555,7 @@ Identify the equivalent events in your harness's plugin system and implement the
|
|
|
555
555
|
**When it fires:** Lead spawns a subagent to execute a task.
|
|
556
556
|
|
|
557
557
|
**Expected consumer behavior:**
|
|
558
|
-
- Record the new agent entry in `agent-tracker.json`: `{
|
|
558
|
+
- Record the new agent entry in `agent-tracker.json`: `{ harness_id, agent_name, agent_id, task_id, started_at }`.
|
|
559
559
|
- Inject the knowledge index into the subagent's initial context: the list of files in `.nexus/memory/`, `.nexus/context/`, and `.nexus/rules/` so the agent knows what project knowledge is available.
|
|
560
560
|
- Apply capability restrictions: resolve `effective_capabilities` for this agent type and configure the subagent's tool access accordingly (see §6).
|
|
561
561
|
- Apply the resume evaluation: check `owner_reuse_policy` on the task and the agent's `resume_tier` to determine whether to spawn fresh or resume a prior session (see §10).
|
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
# Nexus 산출물 제어 계약
|
|
2
|
+
|
|
3
|
+
이 문서는 nexus-core를 소비하는 하네스(claude-nexus, opencode-nexus, nexus-code)가 준수해야 할 **산출물 제어 normative 계약**이다. 산출물이란 Nexus 세션 또는 프로젝트 사이클에서 생성·수정·삭제되는 모든 파일을 의미하며, 그 책임 주체·생성 조건·삭제 조건·상호운용 의무를 선언적으로 기술한다.
|
|
4
|
+
|
|
5
|
+
이 문서는 `docs/nexus-state-overview.md`와 역할을 명확히 분담한다.
|
|
6
|
+
|
|
7
|
+
- `docs/nexus-state-overview.md` — **기술적 사실**: 각 state 파일의 schema, field 정의, lifecycle facts, tool 접근 매핑.
|
|
8
|
+
- `docs/nexus-outputs-contract.md` (본 문서) — **의무 선언**: 하네스가 MUST / MUST NOT / SHOULD로 지켜야 할 normative 조항. 기술 사실이 아니라 준수 의무를 다룬다.
|
|
9
|
+
|
|
10
|
+
두 문서는 서로를 전제하며 상호 대체하지 않는다. 기술 상세는 state-overview를 참조하고, 준수 여부 판단은 본 문서를 기준으로 한다.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## 산출물 3 카테고리
|
|
15
|
+
|
|
16
|
+
Nexus 산출물은 생성 책임 주체에 따라 세 카테고리로 분류된다.
|
|
17
|
+
|
|
18
|
+
| 카테고리 | 책임 주체 | 예시 파일 |
|
|
19
|
+
|---|---|---|
|
|
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` |
|
|
22
|
+
| Agent-produced (ephemeral) | `artifact_write` 도구 (에이전트가 호출) | `artifacts/*.md` (등 임의 파일명) |
|
|
23
|
+
|
|
24
|
+
카테고리 간 경계는 "누가 파일을 만드는가"로 정의된다. MCP tool이 직접 write하면 Tool-produced, 하네스 hook이 세션 초기화·종료 시 관리하면 Harness-produced, 에이전트가 `artifact_write`를 통해 기록하면 Agent-produced다.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Tool-produced 산출물
|
|
29
|
+
|
|
30
|
+
### `plan.json` — 활성 계획 세션
|
|
31
|
+
|
|
32
|
+
**책임 주체**: MCP tool (`plan_start`, `plan_status`, `plan_update`, `plan_decide`, `task_close`). `plan_status`는 read-only이며 `docs/nexus-tools-contract.md`의 tool 열거 순서와 일치한다.
|
|
33
|
+
|
|
34
|
+
**생성 trigger**: `plan_start` 호출 시 MUST 생성한다. 이전 세션이 존재할 경우 반드시 `history.json`에 아카이브한 뒤 덮어쓴다.
|
|
35
|
+
|
|
36
|
+
**삭제 trigger**: `task_close` 호출 시 MUST `history.json`에 아카이브 후 삭제한다. `plan_start` 재호출 시에도 동일한 순서(아카이브 → 삭제 → 신규 생성)로 처리해야 한다.
|
|
37
|
+
|
|
38
|
+
**Schema reference**: `conformance/state-schemas/plan.schema.json`
|
|
39
|
+
|
|
40
|
+
**Interop requirement**:
|
|
41
|
+
- 하네스는 `plan.json`을 생성할 때 MUST `conformance/state-schemas/plan.schema.json`에 유효한 JSON을 기록해야 한다.
|
|
42
|
+
- 다른 하네스가 이 파일을 읽어 parse·편집할 수 있어야 한다. MUST NOT 하네스 고유 확장 필드를 schema 외부에 추가해서는 안 된다.
|
|
43
|
+
- `created_at` 필드는 MUST ISO 8601 형식을 사용해야 한다.
|
|
44
|
+
|
|
45
|
+
**Conformance fixture reference**: `conformance/tools/plan-start.json`, `conformance/tools/plan-decide.json`
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
### `tasks.json` — 활성 태스크 목록
|
|
50
|
+
|
|
51
|
+
**책임 주체**: MCP tool (`task_add`, `task_update`, `task_close`).
|
|
52
|
+
|
|
53
|
+
**생성 trigger**: `task_add` 최초 호출 시 MUST `{ goal: "", decisions: [], tasks: [] }` 구조로 초기화한 뒤 첫 태스크를 추가한다.
|
|
54
|
+
|
|
55
|
+
**삭제 trigger**: `task_close` 호출 시 MUST `history.json`에 아카이브 후 삭제한다.
|
|
56
|
+
|
|
57
|
+
**Schema reference**: `conformance/state-schemas/tasks.schema.json`
|
|
58
|
+
|
|
59
|
+
**Interop requirement**:
|
|
60
|
+
- 하네스는 `tasks.json`을 기록할 때 MUST `conformance/state-schemas/tasks.schema.json`에 유효한 JSON을 기록해야 한다.
|
|
61
|
+
- `created_at` 필드는 MUST ISO 8601 형식을 사용해야 한다.
|
|
62
|
+
- `status` 값은 MUST `"pending"`, `"in_progress"`, `"completed"` 중 하나여야 한다. 하네스 고유 status 값은 MUST NOT 사용해서는 안 된다.
|
|
63
|
+
- `owner_reuse_policy` 값은 MUST `"fresh"`, `"resume_if_same_artifact"`, `"resume"` 중 하나 또는 absent여야 한다.
|
|
64
|
+
|
|
65
|
+
**Conformance fixture reference**: `conformance/tools/task-add.json`, `conformance/tools/task-update.json`, `conformance/tools/task-list.json`, `conformance/tools/task-close.json`
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
### `history.json` — 완료된 사이클 ledger
|
|
70
|
+
|
|
71
|
+
**책임 주체**: MCP tool (`plan_start`, `task_close`).
|
|
72
|
+
|
|
73
|
+
**생성 trigger**: `plan_start` 또는 `task_close`가 최초 아카이브를 수행할 때 파일이 없으면 MUST 생성한다. 이후 호출은 기존 파일의 `cycles` 배열에 append한다.
|
|
74
|
+
|
|
75
|
+
**삭제 trigger**: MUST NOT 삭제해서는 안 된다. `history.json`은 프로젝트 영구 기록이며 어떤 도구도 이 파일을 삭제해서는 안 된다.
|
|
76
|
+
|
|
77
|
+
**Schema reference**: `conformance/state-schemas/history.schema.json`
|
|
78
|
+
|
|
79
|
+
**Interop requirement**:
|
|
80
|
+
- 하네스는 cycle 레코드를 append할 때 MUST `conformance/state-schemas/history.schema.json`에 유효한 구조를 기록해야 한다.
|
|
81
|
+
- `completed_at` 및 각 태스크의 `created_at` 필드는 MUST ISO 8601 형식을 사용해야 한다.
|
|
82
|
+
- 새 cycle 레코드는 MUST append-only 방식으로 추가해야 한다. 기존 cycle 레코드의 수정은 MUST NOT 허용되어서는 안 된다.
|
|
83
|
+
- `history.json`은 git-tracked 파일이다. 하네스는 SHOULD 세션 종료 후 이 파일을 commit 대상에 포함할 것을 권장한다.
|
|
84
|
+
|
|
85
|
+
**Conformance fixture reference**: `conformance/tools/task-close.json` (archive 동작 포함)
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Harness-produced 산출물
|
|
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
|
+
### `agent-tracker.json` — 에이전트 인스턴스 추적
|
|
111
|
+
|
|
112
|
+
**책임 주체**: Session hook (하네스 구현 책임). 어떤 MCP tool도 이 파일에 직접 write해서는 안 된다.
|
|
113
|
+
|
|
114
|
+
**생성 trigger**: 하네스는 세션 초기화 시 MUST `agent-tracker.json`을 생성해야 한다. 파일 구조는 세션 중 에이전트 인스턴스 spawn 정보를 기록할 수 있어야 한다.
|
|
115
|
+
|
|
116
|
+
**삭제 trigger**: 하네스는 세션 종료 시 MUST `agent-tracker.json`을 삭제해야 한다.
|
|
117
|
+
|
|
118
|
+
**Schema reference**: `conformance/state-schemas/agent-tracker.schema.json`
|
|
119
|
+
|
|
120
|
+
**Interop requirement**:
|
|
121
|
+
- 하네스는 `agent-tracker.json`을 기록할 때 MUST `conformance/state-schemas/agent-tracker.schema.json`에 유효한 JSON을 기록해야 한다.
|
|
122
|
+
- `task_add` 도구가 `owner_agent_id` 필드를 읽어 harness에 전달하는 방식으로 간접 연계된다. 하네스는 이 연계가 동작하도록 MUST `owner_agent_id` 기반 agent 재개 로직을 구현해야 한다.
|
|
123
|
+
- `agent-tracker.json`은 MUST NOT git-tracked 상태로 commit되어서는 안 된다.
|
|
124
|
+
|
|
125
|
+
**Conformance fixture reference**: 해당 없음. `agent-tracker.json`은 MCP tool behavioral fixture 범위 외에 있으며 하네스 session hook이 전적으로 책임진다.
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## Agent-produced 산출물 (ephemeral)
|
|
130
|
+
|
|
131
|
+
### `artifacts/` 디렉토리 — 에이전트 생성 파일
|
|
132
|
+
|
|
133
|
+
**책임 주체**: `artifact_write` 도구. 에이전트가 이 도구를 호출하여 산출물을 기록한다. 디렉토리 자체는 첫 `artifact_write` 호출 시 자동 생성된다.
|
|
134
|
+
|
|
135
|
+
**생성 trigger**: 에이전트가 `artifact_write`를 호출할 때 MUST `.nexus/state/artifacts/<filename>` 경로에 파일을 기록해야 한다. 디렉토리가 없으면 MUST 자동 생성해야 한다.
|
|
136
|
+
|
|
137
|
+
**삭제 trigger**: `task_close`는 `artifacts/` 디렉토리를 아카이브하지 않는다. 세션 종료 시 하네스가 이 디렉토리를 정리하거나 유지하는 것은 하네스의 구현 결정이다. 에이전트 또는 사용자가 artifact를 세션 이후에도 보존하려면 MUST `task_close` 이전에 명시적으로 다른 경로로 복사하거나 git-commit해야 한다.
|
|
138
|
+
|
|
139
|
+
**Schema reference**: `artifact_write` 산출물 파일 자체에 대한 schema 제약은 없다. 내용 형식은 도구 호출자가 결정한다.
|
|
140
|
+
|
|
141
|
+
**Interop requirement**:
|
|
142
|
+
- `artifact_write`는 MUST 동일 `filename`으로 반복 호출 시 파일을 덮어써야 한다. 이 덮어쓰기 동작은 하네스 간에 일관되어야 한다.
|
|
143
|
+
- 다른 하네스가 동일 세션 내 `artifacts/` 파일을 읽을 경우, 파일이 존재하면 MUST 읽을 수 있어야 한다. 특정 하네스만 읽을 수 있는 인코딩이나 잠금은 MUST NOT 사용해서는 안 된다.
|
|
144
|
+
- `artifact_write`의 반환값 중 `path` 필드는 MUST 실제 기록된 파일의 절대 경로를 포함해야 한다.
|
|
145
|
+
|
|
146
|
+
**Conformance fixture reference**: 해당 없음. `artifact_write`의 파일 내용 형식에 대한 fixture는 정의되지 않는다. 도구 동작(디렉토리 생성, 파일 write, 반환값)은 `docs/nexus-tools-contract.md`의 `artifact_write` 섹션이 normative source다.
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## Cross-harness Interop 원칙
|
|
151
|
+
|
|
152
|
+
이 섹션은 하네스 간 상호운용성을 보장하기 위한 최소 의무 조항을 정의한다. 하네스 A가 생성한 산출물을 하네스 B가 읽고 처리할 수 있어야 한다는 원칙에서 도출된다.
|
|
153
|
+
|
|
154
|
+
### MUST 조항
|
|
155
|
+
|
|
156
|
+
1. **Schema 기반 parse 가능성**: 하네스 A가 생성한 `plan.json`은 하네스 B가 `conformance/state-schemas/plan.schema.json`을 기준으로 parse하여 편집·아카이브할 수 있어야 한다. 마찬가지로 `tasks.json`, `history.json`에 대해서도 동일 원칙이 적용된다. 하네스는 MUST schema에 정의된 필드 집합만 기록해야 하며, schema 외부 필드를 추가해서는 안 된다.
|
|
157
|
+
|
|
158
|
+
2. **Forward-compatible schema**: 모든 산출물의 schema는 forward-compatible이어야 한다. 기존 field 제거 또는 type 변경은 MUST semver major bump 대상이며, `CHANGELOG.md`에 "Consumer Action Required" 섹션을 포함해야 한다. 하네스는 MUST 새 minor version의 schema에서 추가된 optional field를 unknown field로 거부해서는 안 된다.
|
|
159
|
+
|
|
160
|
+
3. **ISO 8601 timestamp**: 모든 산출물에 포함되는 timestamp 필드(`created_at`, `completed_at` 등)는 MUST ISO 8601 형식을 사용해야 한다. 하네스별 locale timestamp, Unix epoch, 비표준 포맷은 MUST NOT 사용해서는 안 된다.
|
|
161
|
+
|
|
162
|
+
4. **append-only ledger 보전**: `history.json`은 모든 하네스 간에 MUST append-only로 처리되어야 한다. 기존 cycle 레코드를 수정하거나 삭제하는 하네스는 cross-harness 호환성 보장 대상에서 제외된다.
|
|
163
|
+
|
|
164
|
+
5. **session-scoped 파일 격리**: `plan.json`, `tasks.json`, `runtime.json`, `agent-tracker.json`, `artifacts/` 디렉토리는 MUST git-tracked 상태로 commit되어서는 안 된다. 이 파일들은 세션 범위에 속하며 프로젝트 영구 기록이 아니다. 하네스는 MUST `.gitignore`에 이 경로들을 포함해야 한다.
|
|
165
|
+
|
|
166
|
+
6. **Tool 이름 참조 금지**: 산출물 파일 내용 안에 harness-specific tool 이름(하네스별 MCP prefix, 하네스별 도구 식별자 등)을 MUST NOT 기록해서는 안 된다. 산출물은 harness-neutral해야 한다.
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## Harness-local State Extension
|
|
171
|
+
|
|
172
|
+
하네스가 nexus-core 공통 schema로 수렴되지 않는 자체 state 파일을 필요로 할 때의 normative 규약이다.
|
|
173
|
+
|
|
174
|
+
### 3 파일 유형 분류
|
|
175
|
+
|
|
176
|
+
| 유형 | 경로 패턴 | Schema 소유 | Lifecycle 책임 |
|
|
177
|
+
|---|---|---|---|
|
|
178
|
+
| 공통 state | `.nexus/state/{name}.json` | nexus-core `conformance/state-schemas/` | nexus-core MCP tool |
|
|
179
|
+
| 하네스 extension | `.nexus/state/{harness-id}/{base}.extension.json` | 하네스 repo `state-schemas/` | 하네스 session hook |
|
|
180
|
+
| 하네스 독립 파일 | `.nexus/state/{harness-id}/{any}.json` | 하네스 repo `state-schemas/` | 하네스 session hook |
|
|
181
|
+
|
|
182
|
+
### Harness-id 식별 규약
|
|
183
|
+
|
|
184
|
+
- **MUST**: `{harness-id}`는 하네스 npm package name의 마지막 segment를 사용한다.
|
|
185
|
+
- `@moreih29/claude-nexus` → `claude-nexus`
|
|
186
|
+
- `@moreih29/opencode-nexus` → `opencode-nexus`
|
|
187
|
+
- `@moreih29/nexus-code` → `nexus-code`
|
|
188
|
+
- **MUST NOT**: nexus-core는 하네스 id 레지스트리를 소유하지 않는다. 규약은 각 하네스 `CONSUMING.md` / `README.md`에서 자기 id를 선언한다.
|
|
189
|
+
|
|
190
|
+
### Extension 파일 의무
|
|
191
|
+
|
|
192
|
+
- **MUST**: 파일명은 `{공통-base}.extension.json` 형식이다. 예: `plan.extension.json`, `tasks.extension.json`, `history.extension.json`.
|
|
193
|
+
- **MUST**: 최상위 `extends` 필드로 참조 대상 공통 schema를 명시한다. 예: `"extends": "plan.schema.json"`.
|
|
194
|
+
- **MUST**: 공통 파일의 레코드와 연결되는 join 필드를 명시한다. 권장 표준:
|
|
195
|
+
- plan extension: `extension_for_plan_id: N` + `issue_extensions: { "<issue_id>": { ... } }`
|
|
196
|
+
- tasks extension: `task_extensions: { "<task_id>": { ... } }`
|
|
197
|
+
- history extension: `cycle_extensions: [ { completed_at, ... } ]`
|
|
198
|
+
- **MUST**: 하네스 repo의 자체 `state-schemas/{base}.extension.schema.json` 파일에 JSON Schema(draft 2020-12, `additionalProperties: false`)를 정의한다.
|
|
199
|
+
- **MUST NOT**: 공통 schema의 필드(id/title/status/created_at 등)를 extension에서 재선언한다.
|
|
200
|
+
- **MUST NOT**: nexus-core MCP tool이 extension 파일을 직접 참조한다고 가정한다. extension은 하네스 session hook이 전담한다.
|
|
201
|
+
|
|
202
|
+
### Namespace 디렉토리 규약
|
|
203
|
+
|
|
204
|
+
- **MUST**: 하네스 고유 파일(독립 파일 + extension)은 모두 `.nexus/state/{harness-id}/` 하위에만 배치한다.
|
|
205
|
+
- **MUST NOT**: `.nexus/state/` 루트에 신규 하네스 파일을 추가한다.
|
|
206
|
+
- **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` 금지.
|
|
208
|
+
- **예외**: v0.3.x 이하에 루트 경로로 등록된 legacy 2종(`edit-tracker.json`, `reopen-tracker.json`)은 `task_close` tool 계약에 묶여 있어 backward-compat으로 루트 유지 허용한다. 신규 파일에는 예외 편승 금지.
|
|
209
|
+
|
|
210
|
+
### Archive 정책
|
|
211
|
+
|
|
212
|
+
- **MUST NOT**: nexus-core의 `history.json`에 하네스 extension을 포함한다.
|
|
213
|
+
- **SHOULD**: 하네스가 archive가 필요한 경우 자체 `.nexus/state/{harness-id}/history.extension.json`을 운영한다. git-tracking 여부는 하네스 결정.
|
|
214
|
+
- **MUST**: `plan_start` 재호출 또는 `task_close` 시 공통 파일이 archive/삭제되면, 하네스 session hook은 대응 extension 파일도 함께 archive/삭제하여 stale 상태를 방지한다.
|
|
215
|
+
|
|
216
|
+
### Atomicity
|
|
217
|
+
|
|
218
|
+
- **MUST**: 공통 파일 쓰기와 대응 extension 쓰기는 하네스 session hook의 책임 하에 함께 성공하거나 함께 실패하도록 처리한다.
|
|
219
|
+
- **SHOULD**: consumer가 extension 파일 부재를 "이 하네스는 해당 공통 파일에 확장 정보 없음"으로 해석한다. 공통 파일은 extension 없이도 valid해야 한다.
|
|
220
|
+
|
|
221
|
+
### 예시 디렉토리 구조
|
|
222
|
+
|
|
223
|
+
```
|
|
224
|
+
.nexus/state/
|
|
225
|
+
├── plan.json ← 공통, strict
|
|
226
|
+
├── tasks.json
|
|
227
|
+
├── runtime.json
|
|
228
|
+
├── agent-tracker.json
|
|
229
|
+
├── artifacts/
|
|
230
|
+
└── claude-nexus/ ← namespace 디렉토리
|
|
231
|
+
├── plan.extension.json ← plan.json의 확장 (priority, estimated_effort 등)
|
|
232
|
+
├── tasks.extension.json
|
|
233
|
+
├── history.extension.json ← 하네스 자체 archive
|
|
234
|
+
├── edit-tracker.json ← 독립 파일
|
|
235
|
+
├── reopen-tracker.json ← 독립 파일
|
|
236
|
+
└── tool-log.jsonl
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
(루트 레벨 `edit-tracker.json`/`reopen-tracker.json`은 legacy carve-out으로 v0.3.x 이하 호환 유지)
|
|
240
|
+
|
|
241
|
+
### Reference example
|
|
242
|
+
|
|
243
|
+
`conformance/examples/plan.extension.schema.example.json`에 non-normative 참조 예시가 있다. 이 파일은 다음 요소를 보여준다:
|
|
244
|
+
|
|
245
|
+
- `extends` 필드 (const: 부모 schema 경로)로 extension이 참조하는 common schema를 명시
|
|
246
|
+
- `additionalProperties: false` — 확장 schema에서도 엄격 적용
|
|
247
|
+
- `harness_id` 필드와 harness-specific field placeholder
|
|
248
|
+
|
|
249
|
+
consumer는 이 파일을 starting point로 삼아 자신의 실제 extension 필드로 교체한다.
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
## Conformance 의무와의 연결
|
|
254
|
+
|
|
255
|
+
### CONSUMING.md §Conformance Obligation
|
|
256
|
+
|
|
257
|
+
`CONSUMING.md`의 §Conformance Obligation은 하네스가 `conformance/tools/*.json` 및 `conformance/scenarios/*.json`의 모든 fixture를 통과해야 함을 명시한다. 본 문서는 그 의무의 **의미를 확장**한다.
|
|
258
|
+
|
|
259
|
+
fixture 통과 = schema field 100% coverage ≠ 산출물 제어 의무 이행.
|
|
260
|
+
|
|
261
|
+
fixture는 도구 호출의 반환값과 state file postcondition을 검증하지만, 아래 항목은 fixture만으로 검증되지 않는다.
|
|
262
|
+
|
|
263
|
+
- Harness-produced 산출물(`runtime.json`, `agent-tracker.json`)의 생성·삭제 타이밍
|
|
264
|
+
- Cross-harness interop 의무(다른 하네스가 생성한 파일을 읽을 수 있는가)
|
|
265
|
+
- Forward-compatible schema 유지 의무
|
|
266
|
+
- git-tracking 격리 의무
|
|
267
|
+
|
|
268
|
+
하네스는 fixture 통과를 필요조건으로 충족한 뒤, 본 문서의 MUST 조항을 추가 의무로 준수해야 한다.
|
|
269
|
+
|
|
270
|
+
### conformance/README.md Schema Field Coverage Obligation
|
|
271
|
+
|
|
272
|
+
`conformance/README.md`가 정의하는 schema field coverage 의무: 모든 state-schema field는 최소 하나의 fixture의 `covers` 항목에 등장해야 한다. 이 의무는 fixture suite가 schema 전체를 검증함을 보장한다.
|
|
273
|
+
|
|
274
|
+
본 문서는 이 의무가 **Tool-produced 산출물에 대해서만** 적용됨을 명시한다. Harness-produced 산출물(`runtime.json`, `agent-tracker.json`)의 field coverage는 하네스 자체 테스트 suite의 책임이다.
|
|
275
|
+
|
|
276
|
+
schema field가 신규 추가되었을 때, nexus-core 관리자는 MUST 해당 field를 cover하는 fixture를 추가하거나 기존 fixture를 갱신해야 한다. field를 schema에 추가하면서 fixture를 갱신하지 않는 것은 coverage 의무 위반이다.
|
|
277
|
+
|
|
278
|
+
---
|
|
279
|
+
|
|
280
|
+
## 관련 문서
|
|
281
|
+
|
|
282
|
+
- `docs/nexus-state-overview.md` — state 파일별 schema, field 정의, tool 접근 매핑 (기술적 사실)
|
|
283
|
+
- `docs/nexus-tools-contract.md` — 11 MCP tool의 parameter, return value, side effect, error condition normative 명세
|
|
284
|
+
- `docs/nexus-layout.md` — `.nexus/` 디렉토리 canonical 구조
|
|
285
|
+
- `docs/behavioral-contracts.md` — task/plan state machine, resume tier, permission model
|
|
286
|
+
- `conformance/README.md` — conformance fixture 형식 및 test runner 작성 가이드
|
|
287
|
+
- `.nexus/rules/neutral-principles.md` — harness-neutral 원칙 enforceable 규칙 (6개 규칙)
|
|
@@ -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.
|
|
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
|
-
| `
|
|
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,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
|
-
"nexus_core_version": "0.
|
|
3
|
-
"nexus_core_commit": "
|
|
2
|
+
"nexus_core_version": "0.5.0",
|
|
3
|
+
"nexus_core_commit": "4da9b345dce867d9b7b60f8b04076a1a3dc3818a",
|
|
4
4
|
"schema_contract_version": "2.0",
|
|
5
5
|
"agents": [
|
|
6
6
|
{
|
|
7
|
-
"name": "
|
|
8
|
-
"description": "
|
|
9
|
-
"task": "
|
|
10
|
-
"alias_ko": "
|
|
7
|
+
"name": "designer",
|
|
8
|
+
"description": "UX/UI design — evaluates user experience, interaction patterns, and how users will experience the product",
|
|
9
|
+
"task": "UI/UX design, interaction patterns, user experience",
|
|
10
|
+
"alias_ko": "디자이너",
|
|
11
11
|
"category": "how",
|
|
12
12
|
"resume_tier": "persistent",
|
|
13
13
|
"model_tier": "high",
|
|
@@ -16,14 +16,14 @@
|
|
|
16
16
|
"no_task_create",
|
|
17
17
|
"no_task_update"
|
|
18
18
|
],
|
|
19
|
-
"id": "
|
|
20
|
-
"body_hash": "sha256:
|
|
19
|
+
"id": "designer",
|
|
20
|
+
"body_hash": "sha256:88ac56147d0e5bdf23fa591ce570a9c2d0eb1338df4ec2219f6238ddfcb65df4"
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
|
-
"name": "
|
|
24
|
-
"description": "
|
|
25
|
-
"task": "
|
|
26
|
-
"alias_ko": "
|
|
23
|
+
"name": "architect",
|
|
24
|
+
"description": "Technical design — evaluates How, reviews architecture, advises on implementation approach",
|
|
25
|
+
"task": "Architecture, technical design, code review",
|
|
26
|
+
"alias_ko": "아키텍트",
|
|
27
27
|
"category": "how",
|
|
28
28
|
"resume_tier": "persistent",
|
|
29
29
|
"model_tier": "high",
|
|
@@ -32,22 +32,23 @@
|
|
|
32
32
|
"no_task_create",
|
|
33
33
|
"no_task_update"
|
|
34
34
|
],
|
|
35
|
-
"id": "
|
|
36
|
-
"body_hash": "sha256:
|
|
35
|
+
"id": "architect",
|
|
36
|
+
"body_hash": "sha256:85f9a3de419f32cdae284436eb1d902bff19a2230c50fe3068ffc642949a63b7"
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
|
-
"name": "
|
|
40
|
-
"description": "
|
|
41
|
-
"task": "
|
|
42
|
-
"alias_ko": "
|
|
43
|
-
"category": "
|
|
44
|
-
"resume_tier": "
|
|
39
|
+
"name": "reviewer",
|
|
40
|
+
"description": "Content verification — validates accuracy, checks facts, confirms grammar and format of non-code deliverables",
|
|
41
|
+
"task": "Content verification, fact-checking, grammar review",
|
|
42
|
+
"alias_ko": "리뷰어",
|
|
43
|
+
"category": "check",
|
|
44
|
+
"resume_tier": "ephemeral",
|
|
45
45
|
"model_tier": "standard",
|
|
46
46
|
"capabilities": [
|
|
47
|
+
"no_file_edit",
|
|
47
48
|
"no_task_create"
|
|
48
49
|
],
|
|
49
|
-
"id": "
|
|
50
|
-
"body_hash": "sha256:
|
|
50
|
+
"id": "reviewer",
|
|
51
|
+
"body_hash": "sha256:f04d15249601b14046e7e40a4475defb289436c4474afbd89986964f8c3e7c2f"
|
|
51
52
|
},
|
|
52
53
|
{
|
|
53
54
|
"name": "strategist",
|
|
@@ -66,19 +67,18 @@
|
|
|
66
67
|
"body_hash": "sha256:0254b4144a22c66209bd68119553d9057a4fb7f9b1ff7ebb9878687d99583465"
|
|
67
68
|
},
|
|
68
69
|
{
|
|
69
|
-
"name": "
|
|
70
|
-
"description": "
|
|
71
|
-
"task": "
|
|
72
|
-
"alias_ko": "
|
|
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": "엔지니어",
|
|
73
74
|
"category": "do",
|
|
74
|
-
"resume_tier": "
|
|
75
|
+
"resume_tier": "bounded",
|
|
75
76
|
"model_tier": "standard",
|
|
76
77
|
"capabilities": [
|
|
77
|
-
"no_file_edit",
|
|
78
78
|
"no_task_create"
|
|
79
79
|
],
|
|
80
|
-
"id": "
|
|
81
|
-
"body_hash": "sha256:
|
|
80
|
+
"id": "engineer",
|
|
81
|
+
"body_hash": "sha256:3d58b1b490c2f93cace2eedd0f04ec000f84514388eb086768cf53f8fa33db01"
|
|
82
82
|
},
|
|
83
83
|
{
|
|
84
84
|
"name": "postdoc",
|
|
@@ -97,10 +97,10 @@
|
|
|
97
97
|
"body_hash": "sha256:da9b8c2568b8b5812abed6d6324139f814379d48dc63cdc5d0b5b263f5407814"
|
|
98
98
|
},
|
|
99
99
|
{
|
|
100
|
-
"name": "
|
|
101
|
-
"description": "
|
|
102
|
-
"task": "
|
|
103
|
-
"alias_ko": "
|
|
100
|
+
"name": "tester",
|
|
101
|
+
"description": "Testing and verification — tests, verifies, validates stability and security of implementations",
|
|
102
|
+
"task": "Testing, verification, security review",
|
|
103
|
+
"alias_ko": "테스터",
|
|
104
104
|
"category": "check",
|
|
105
105
|
"resume_tier": "ephemeral",
|
|
106
106
|
"model_tier": "standard",
|
|
@@ -108,23 +108,23 @@
|
|
|
108
108
|
"no_file_edit",
|
|
109
109
|
"no_task_create"
|
|
110
110
|
],
|
|
111
|
-
"id": "
|
|
112
|
-
"body_hash": "sha256:
|
|
111
|
+
"id": "tester",
|
|
112
|
+
"body_hash": "sha256:4dd04e1c93ff9c0c9fa6aebb60ece3f9719e82f9714b13feea01b6163633caec"
|
|
113
113
|
},
|
|
114
114
|
{
|
|
115
|
-
"name": "
|
|
116
|
-
"description": "
|
|
117
|
-
"task": "
|
|
118
|
-
"alias_ko": "
|
|
119
|
-
"category": "
|
|
120
|
-
"resume_tier": "
|
|
115
|
+
"name": "researcher",
|
|
116
|
+
"description": "Independent investigation — conducts web searches, gathers evidence, and reports findings with citations",
|
|
117
|
+
"task": "Web search, independent investigation",
|
|
118
|
+
"alias_ko": "리서처",
|
|
119
|
+
"category": "do",
|
|
120
|
+
"resume_tier": "persistent",
|
|
121
121
|
"model_tier": "standard",
|
|
122
122
|
"capabilities": [
|
|
123
123
|
"no_file_edit",
|
|
124
124
|
"no_task_create"
|
|
125
125
|
],
|
|
126
|
-
"id": "
|
|
127
|
-
"body_hash": "sha256:
|
|
126
|
+
"id": "researcher",
|
|
127
|
+
"body_hash": "sha256:fc79bafec05503327bd51a0b84b6e642d304bd79c45b78db6448b112793c143e"
|
|
128
128
|
},
|
|
129
129
|
{
|
|
130
130
|
"name": "writer",
|
|
@@ -168,6 +168,16 @@
|
|
|
168
168
|
"id": "nx-plan",
|
|
169
169
|
"body_hash": "sha256:85b858089bd3dc276be61baa3f5265bc107a85470f169983e710fecb404bb4b1"
|
|
170
170
|
},
|
|
171
|
+
{
|
|
172
|
+
"name": "nx-sync",
|
|
173
|
+
"description": "Context knowledge synchronization — scans project state and updates .nexus/context/ design documents",
|
|
174
|
+
"summary": "Context knowledge synchronization",
|
|
175
|
+
"triggers": [
|
|
176
|
+
"sync"
|
|
177
|
+
],
|
|
178
|
+
"id": "nx-sync",
|
|
179
|
+
"body_hash": "sha256:a7b0ae8f13ebcd10e52361d0ada1570ff0c47933f731deec07e95539c63e6946"
|
|
180
|
+
},
|
|
171
181
|
{
|
|
172
182
|
"name": "nx-init",
|
|
173
183
|
"description": "Project onboarding — scan, mission, essentials, context generation",
|
|
@@ -178,16 +188,6 @@
|
|
|
178
188
|
],
|
|
179
189
|
"id": "nx-init",
|
|
180
190
|
"body_hash": "sha256:3c8230ecc0f87c541ec0ff80492a28f28bf173d0b9781901adadfae69a54b8ed"
|
|
181
|
-
},
|
|
182
|
-
{
|
|
183
|
-
"name": "nx-sync",
|
|
184
|
-
"description": "Context knowledge synchronization — scans project state and updates .nexus/context/ design documents",
|
|
185
|
-
"summary": "Context knowledge synchronization",
|
|
186
|
-
"triggers": [
|
|
187
|
-
"sync"
|
|
188
|
-
],
|
|
189
|
-
"id": "nx-sync",
|
|
190
|
-
"body_hash": "sha256:a7b0ae8f13ebcd10e52361d0ada1570ff0c47933f731deec07e95539c63e6946"
|
|
191
191
|
}
|
|
192
192
|
],
|
|
193
193
|
"vocabulary": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moreih29/nexus-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.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
|
},
|
|
@@ -39,6 +43,7 @@
|
|
|
39
43
|
"packageManager": "bun@1.3.12",
|
|
40
44
|
"scripts": {
|
|
41
45
|
"validate": "bun run scripts/validate.ts",
|
|
46
|
+
"validate:conformance": "bun run scripts/conformance-coverage.ts",
|
|
42
47
|
"typecheck": "tsc --noEmit",
|
|
43
48
|
"prepublishOnly": "bun run validate"
|
|
44
49
|
},
|
package/scripts/.gitkeep
ADDED
|
File without changes
|