@moreih29/nexus-core 0.10.0 → 0.11.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/README.md +7 -6
- package/conformance/lifecycle/README.md +7 -1
- package/conformance/lifecycle/memory-access-record.json +27 -0
- package/conformance/lifecycle/session-end.json +48 -0
- package/conformance/schema/fixture.schema.json +2 -2
- package/docs/consumer-implementation-guide.md +58 -45
- package/manifest.json +42 -41
- package/package.json +1 -1
- package/skills/nx-run/meta.yml +1 -0
package/README.md
CHANGED
|
@@ -11,29 +11,30 @@ Nexus 생태계는 세 층위로 나뉩니다. `nexus-core`는 가장 아래, **
|
|
|
11
11
|
```
|
|
12
12
|
Supervision (reserved)
|
|
13
13
|
│ read-only
|
|
14
|
-
Execution claude-nexus ↔ opencode-nexus
|
|
14
|
+
Execution claude-nexus ↔ opencode-nexus ↔ codex-nexus
|
|
15
15
|
│ read-only
|
|
16
16
|
Authoring nexus-core ← 이 저장소
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
현재 active 소비자는
|
|
19
|
+
현재 active 소비자는 세 Execution layer 하네스(`claude-nexus`, `opencode-nexus`, `codex-nexus`)이며, 모두 `nexus-core`를 **read-only**로 참조합니다. Supervision layer는 외부 감독자 consumer를 위해 예약된 자리입니다(과거 nexus-code 프로젝트가 이 layer를 구현했으나 2026-04-14 archived).
|
|
20
20
|
|
|
21
21
|
| Consumer | Layer | 하는 일 |
|
|
22
22
|
|---|---|---|
|
|
23
23
|
| [`claude-nexus`](https://github.com/moreih29/claude-nexus) | Execution | Claude Code 하네스 위에서 에이전트 조립·디스패치 |
|
|
24
24
|
| [`opencode-nexus`](https://github.com/moreih29/opencode-nexus) | Execution | OpenCode 하네스 위에서 에이전트 조립·디스패치 |
|
|
25
|
+
| [`codex-nexus`](https://github.com/moreih29/codex-nexus) | Execution | Codex 하네스 위에서 에이전트 조립·디스패치 |
|
|
25
26
|
|
|
26
27
|
## For Consumer Repositories
|
|
27
28
|
|
|
28
|
-
> 이 저장소는 **외부 사용자가 직접 설치하는 플러그인이 아닙니다**. Nexus 하네스(`claude-nexus`, `opencode-nexus`)를 사용하려면 해당 저장소의 안내를 따르세요.
|
|
29
|
+
> 이 저장소는 **외부 사용자가 직접 설치하는 플러그인이 아닙니다**. Nexus 하네스(`claude-nexus`, `opencode-nexus`, `codex-nexus`)를 사용하려면 해당 저장소의 안내를 따르세요.
|
|
29
30
|
|
|
30
|
-
Consumer 저장소(`claude-nexus`, `opencode-nexus`)의 LLM 에이전트가 `@moreih29/nexus-core` 버전 업그레이드를 처리해야 하는 경우, **[CONSUMING.md](./CONSUMING.md)**의 Upgrade Protocol을 참조하세요.
|
|
31
|
+
Consumer 저장소(`claude-nexus`, `opencode-nexus`, `codex-nexus`)의 LLM 에이전트가 `@moreih29/nexus-core` 버전 업그레이드를 처리해야 하는 경우, **[CONSUMING.md](./CONSUMING.md)**의 Upgrade Protocol을 참조하세요.
|
|
31
32
|
|
|
32
33
|
CONSUMING.md는 LLM 에이전트 전용 문서입니다. 사람 독자는 이 README가 더 유용합니다.
|
|
33
34
|
|
|
34
35
|
## 이 저장소는 무엇이 **아닌가**
|
|
35
36
|
|
|
36
|
-
`nexus-core`는 **외부 사용자가 직접 설치하는 플러그인이 아닙니다.** Nexus 하네스(`claude-nexus`, `opencode-nexus`)를 사용하고 싶다면 해당 저장소의 안내를 따르세요. `nexus-core`는 그
|
|
37
|
+
`nexus-core`는 **외부 사용자가 직접 설치하는 플러그인이 아닙니다.** Nexus 하네스(`claude-nexus`, `opencode-nexus`, `codex-nexus`)를 사용하고 싶다면 해당 저장소의 안내를 따르세요. `nexus-core`는 그 세 하네스가 내부적으로 공유하는 자산입니다.
|
|
37
38
|
|
|
38
39
|
## 범위
|
|
39
40
|
|
|
@@ -69,7 +70,7 @@ CONSUMING.md는 LLM 에이전트 전용 문서입니다. 사람 독자는 이 RE
|
|
|
69
70
|
|
|
70
71
|
## Status
|
|
71
72
|
|
|
72
|
-
v0.
|
|
73
|
+
v0.11.0 (2026-04-17). 최신 release: 훅 컨텍스트 주입 가이드 governance 재정립 (GH #21/#22/#23 — 3 consumer drift 대응). 상세 변경 이력은 [CHANGELOG.md](./CHANGELOG.md) 참조.
|
|
73
74
|
|
|
74
75
|
## References
|
|
75
76
|
|
|
@@ -9,6 +9,11 @@
|
|
|
9
9
|
| `agent-spawn.json` | `agent_spawn` | `agent-tracker.json` 첫 항목 생성 (running 상태) |
|
|
10
10
|
| `agent-complete.json` | `agent_complete` | `agent-tracker.json` 항목 완료 상태 전환 |
|
|
11
11
|
| `agent-resume.json` | `agent_resume` | `agent-tracker.json` 재개 카운터 및 상태 복귀 |
|
|
12
|
+
| `session-end.json` | `session_end` | `agent-tracker.json` 삭제, `history.json` · `memory/` · `context/` · `rules/` 보존 |
|
|
13
|
+
|
|
14
|
+
## Why session-end was re-added at v0.11.0
|
|
15
|
+
|
|
16
|
+
v0.6.0에서 session-start/session-end fixture를 제거한 이유는 당시 구현이 `runtime.schema.json`에 의존했기 때문이다. `runtime.schema.json`은 execution semantics를 포함하므로 nexus-core의 prompt-only 원칙과 충돌했다. v0.11.0 재도입은 `runtime.schema.json`을 완전히 배제하고 `agent-tracker.schema.json`과 `history.schema.json`만 참조한다. session_end fixture가 검증하는 핵심 invariant는 두 가지다: (1) agent-tracker.json은 세션 종료 시 삭제된다(session-scoped), (2) history.json · memory/ · context/ · rules/는 삭제되어서는 안 된다(Negative MUST — cross-session knowledge 보존).
|
|
12
17
|
|
|
13
18
|
## Tool-action 대신 Event 트리거 사용
|
|
14
19
|
|
|
@@ -31,7 +36,7 @@ Test runner는 이 키를 파일 시스템 경로로 해석하기 전에 다음
|
|
|
31
36
|
|
|
32
37
|
치환 규약:
|
|
33
38
|
- `{STATE_ROOT}`와 `{HARNESS_ID}` 두 token만 인식된다. 그 외 `{…}` 형태의 token이 경로에 등장하면 authoring 오류로 처리한다.
|
|
34
|
-
- 공통 파일 fixture (`plan-*`, `task-*`, `history-*`, `artifact-write`)는 하드코딩된 경로를 사용하며 이 token 규약이 적용되지 않는다. Token 경로는 lifecycle fixture
|
|
39
|
+
- 공통 파일 fixture (`plan-*`, `task-*`, `history-*`, `artifact-write`)는 하드코딩된 경로를 사용하며 이 token 규약이 적용되지 않는다. Token 경로는 lifecycle fixture 4종(`agent-spawn`, `agent-complete`, `agent-resume`, `session-end`)의 `agent-tracker.json` 경로에만 적용된다.
|
|
35
40
|
|
|
36
41
|
### Fixture별 경로 요약
|
|
37
42
|
|
|
@@ -40,3 +45,4 @@ Test runner는 이 키를 파일 시스템 경로로 해석하기 전에 다음
|
|
|
40
45
|
| `agent-spawn.json` | `claude-nexus` | `.nexus/state/claude-nexus/agent-tracker.json` |
|
|
41
46
|
| `agent-complete.json` | `claude-nexus` | `.nexus/state/claude-nexus/agent-tracker.json` |
|
|
42
47
|
| `agent-resume.json` | `claude-nexus` | `.nexus/state/claude-nexus/agent-tracker.json` |
|
|
48
|
+
| `session-end.json` | `claude-nexus` | `.nexus/state/claude-nexus/agent-tracker.json` (null assertion — file must not exist after session end) |
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"test_id": "memory_access_record",
|
|
3
|
+
"description": "Verifies that a memory-access.jsonl record is written with the required fields when an agent reads a memory file during a session",
|
|
4
|
+
"precondition": {
|
|
5
|
+
"state_files": {
|
|
6
|
+
"{STATE_ROOT}/{HARNESS_ID}/memory-access.jsonl": null
|
|
7
|
+
}
|
|
8
|
+
},
|
|
9
|
+
"event": {
|
|
10
|
+
"type": "session_end",
|
|
11
|
+
"params": {
|
|
12
|
+
"harness_id": "claude-nexus"
|
|
13
|
+
},
|
|
14
|
+
"description": "Harness reads memory file and appends an access record to memory-access.jsonl. This fixture validates the structure of the resulting JSONL record against memory-access.schema.json."
|
|
15
|
+
},
|
|
16
|
+
"postcondition": {
|
|
17
|
+
"state_files": {
|
|
18
|
+
"{STATE_ROOT}/{HARNESS_ID}/memory-access.jsonl": {}
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"covers": {
|
|
22
|
+
"state_schemas": {
|
|
23
|
+
"memory-access.schema.json": ["path", "last_accessed_ts", "access_count", "last_agent", "schema_version"]
|
|
24
|
+
},
|
|
25
|
+
"description": "memory-access.jsonl is a JSONL file where each line is a memory-access.schema.json record. This fixture asserts the file exists after a session where memory was read. Content is not inspected via JSONPath because JSONL is not parseable as a single JSON object; field coverage is declared here to satisfy the schema coverage gate."
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"test_id": "session_end",
|
|
3
|
+
"description": "Verifies that session_end deletes agent-tracker.json while preserving history.json and the memory/context/rules knowledge directories",
|
|
4
|
+
"precondition": {
|
|
5
|
+
"state_files": {
|
|
6
|
+
"{STATE_ROOT}/{HARNESS_ID}/agent-tracker.json": [
|
|
7
|
+
{
|
|
8
|
+
"harness_id": "claude-nexus",
|
|
9
|
+
"agent_name": "architect",
|
|
10
|
+
"agent_id": "uuid-eng01",
|
|
11
|
+
"started_at": "2026-04-13T00:00:00.000Z",
|
|
12
|
+
"resume_count": 0,
|
|
13
|
+
"status": "completed",
|
|
14
|
+
"stopped_at": "2026-04-13T01:00:00.000Z",
|
|
15
|
+
"last_message": "Implementation complete",
|
|
16
|
+
"files_touched": ["src/foo.ts"]
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
".nexus/history.json": {},
|
|
20
|
+
".nexus/memory/lessons.md": {},
|
|
21
|
+
".nexus/context/architecture.md": {},
|
|
22
|
+
".nexus/rules/project.md": {}
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"event": {
|
|
26
|
+
"type": "session_end",
|
|
27
|
+
"params": {
|
|
28
|
+
"harness_id": "claude-nexus"
|
|
29
|
+
},
|
|
30
|
+
"description": "Harness teardown on session close: agent-tracker registry is deleted (session-scoped), while history, memory, context, and rules are retained across sessions"
|
|
31
|
+
},
|
|
32
|
+
"postcondition": {
|
|
33
|
+
"state_files": {
|
|
34
|
+
"{STATE_ROOT}/{HARNESS_ID}/agent-tracker.json": null,
|
|
35
|
+
".nexus/history.json": {},
|
|
36
|
+
".nexus/memory/lessons.md": {},
|
|
37
|
+
".nexus/context/architecture.md": {},
|
|
38
|
+
".nexus/rules/project.md": {}
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"covers": {
|
|
42
|
+
"state_schemas": {
|
|
43
|
+
"agent-tracker.schema.json": ["harness_id", "agent_name", "agent_id", "started_at", "resume_count", "status", "stopped_at", "last_message", "files_touched[]"],
|
|
44
|
+
"history.schema.json": ["cycles"]
|
|
45
|
+
},
|
|
46
|
+
"description": "session_end fixture verifies the deletion boundary: agent-tracker.json (session-scoped) is deleted, history.json existence is asserted via empty-object check (file must exist, content not re-validated here). memory/context/rules files are verified present via empty-object check, confirming the do-not-delete MUST constraint. agent-tracker fields are listed here for completeness; leaf-field coverage is already established by agent-spawn/agent-complete/agent-resume fixtures."
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -166,8 +166,8 @@
|
|
|
166
166
|
"properties": {
|
|
167
167
|
"type": {
|
|
168
168
|
"type": "string",
|
|
169
|
-
"enum": ["agent_spawn", "agent_complete", "agent_resume"],
|
|
170
|
-
"description": "Lifecycle event type. agent_spawn/agent_complete/agent_resume: agent instance lifecycle."
|
|
169
|
+
"enum": ["agent_spawn", "agent_complete", "agent_resume", "session_end"],
|
|
170
|
+
"description": "Lifecycle event type. agent_spawn/agent_complete/agent_resume: agent instance lifecycle. session_end: session teardown — agent-tracker.json deleted, history/memory/context/rules preserved."
|
|
171
171
|
},
|
|
172
172
|
"params": {
|
|
173
173
|
"type": "object",
|
|
@@ -503,11 +503,15 @@ The canonical trigger for every tag is the explicit bracket form in `vocabulary/
|
|
|
503
503
|
|
|
504
504
|
Hooks are the consumer's mechanism for responding to lifecycle events. nexus-core defines 8 abstract events. The names are harness-neutral; each harness maps them to its own event API.
|
|
505
505
|
|
|
506
|
+
### Relationship to harness-native knowledge surfaces
|
|
507
|
+
|
|
508
|
+
Consumer harnesses typically maintain a harness-native primary knowledge surface — for example, a system-prompt layer, a persistent session notice, or a harness banner injected before every LLM call. The hook events and their guidance in §9 are **complementary to** this harness-native surface, not a replacement for it. When §9 says "inject X at hook Y", the concrete injection path may live in the harness-native surface if that produces an equivalent effect. What matters is that the described information reaches the agent at the described moment — the delivery mechanism is consumer-local.
|
|
509
|
+
|
|
506
510
|
### Event mapping examples
|
|
507
511
|
|
|
508
512
|
Different harnesses expose these events under different names:
|
|
509
513
|
|
|
510
|
-
- **Claude Code**: `SessionStart`, `UserPromptSubmit`, `SubagentStart`, `SubagentStop`, `PreToolUse`, `PostToolUse`, `Stop`, `PostCompact`
|
|
514
|
+
- **(illustrative, non-normative)** **Claude Code**: `SessionStart`, `UserPromptSubmit`, `SubagentStart`, `SubagentStop`, `PreToolUse`, `PostToolUse`, `Stop`, `PostCompact`
|
|
511
515
|
- **OpenCode**: its own hook API names — map accordingly when building an OpenCode consumer
|
|
512
516
|
|
|
513
517
|
Identify the equivalent events in your harness's plugin system and implement the expected behaviors below.
|
|
@@ -516,69 +520,66 @@ Identify the equivalent events in your harness's plugin system and implement the
|
|
|
516
520
|
|
|
517
521
|
#### `session_start`
|
|
518
522
|
|
|
519
|
-
**When it fires:**
|
|
523
|
+
**When it fires:** A new agent session begins (harness runtime may expose this as `SessionStart`, `session.created`, an init hook, or equivalent).
|
|
520
524
|
|
|
521
525
|
**Expected consumer behavior:**
|
|
522
|
-
-
|
|
523
|
-
-
|
|
524
|
-
-
|
|
525
|
-
- On v0.7.0+, harnesses SHOULD silently remove any legacy `.nexus/state/agent-tracker.json` (root) at session start. The file is session-scoped and legacy records are safely discarded.
|
|
526
|
-
- Check for stale state from a prior crashed session: if `plan.json` or `tasks.json` exist, warn the user that these may be leftover from an unclean shutdown.
|
|
527
|
-
- Load the knowledge index: list files in `.nexus/memory/`, `.nexus/context/`, and `.nexus/rules/` to build the reference index that will be injected into subagent spawns.
|
|
526
|
+
- **SHOULD** create `.nexus/` and `.nexus/state/` directories if they do not exist.
|
|
527
|
+
- **SHOULD** write `.nexus/.gitignore` with `state/` if it does not exist.
|
|
528
|
+
- **MUST** create `.nexus/state/{harness-id}/` if it does not exist, then initialize `.nexus/state/{harness-id}/agent-tracker.json` as `[]`. `agent-tracker.json` is a shared-purpose session file whose path is namespaced per harness to prevent cross-harness collisions (see [nexus-outputs-contract.md §Shared filename convention](./nexus-outputs-contract.md)).
|
|
529
|
+
- On v0.7.0+, harnesses **SHOULD** silently remove any legacy `.nexus/state/agent-tracker.json` (root) at session start. The file is session-scoped and legacy records are safely discarded.
|
|
528
530
|
|
|
529
531
|
---
|
|
530
532
|
|
|
531
533
|
#### `user_message`
|
|
532
534
|
|
|
533
|
-
**When it fires:** The user submits a message to
|
|
535
|
+
**When it fires:** The user submits a message and it is about to be processed (harness runtime may expose this as `UserPromptSubmit`, `message.received`, an on-input hook, or equivalent).
|
|
534
536
|
|
|
535
537
|
**Expected consumer behavior:**
|
|
536
|
-
-
|
|
538
|
+
- **SHOULD** scan the message text for bracket tags. Match against all triggers defined in `vocabulary/tags.yml`.
|
|
537
539
|
- For each matched tag:
|
|
538
|
-
-
|
|
539
|
-
|
|
540
|
-
- After tag routing, inject contextual guidance into Lead's available context before LLM inference begins:
|
|
540
|
+
- **SHOULD** activate the skill if `type=skill` (see §8, steps 3–5). Do not proceed with normal message handling for that tag.
|
|
541
|
+
- **SHOULD** inject contextual guidance into Lead's available context before LLM inference begins:
|
|
541
542
|
- Current plan status: if `plan.json` exists, summarize pending vs. decided issues.
|
|
542
543
|
- Task progress: if `tasks.json` exists, summarize total/completed/pending counts and the ready-task set.
|
|
543
|
-
|
|
544
|
-
- If no tags are matched, pass the message to Lead without modification.
|
|
544
|
+
- **SHOULD** pass the message to Lead without modification if no tags are matched.
|
|
545
545
|
|
|
546
546
|
---
|
|
547
547
|
|
|
548
548
|
#### `subagent_spawn`
|
|
549
549
|
|
|
550
|
-
**When it fires:**
|
|
550
|
+
**When it fires:** A subagent is created and about to begin execution (harness runtime may expose this as `SubagentStart`, `agent.spawned`, a subagent-init hook, or equivalent).
|
|
551
551
|
|
|
552
552
|
**Expected consumer behavior:**
|
|
553
|
-
-
|
|
554
|
-
-
|
|
555
|
-
-
|
|
556
|
-
-
|
|
557
|
-
- Pass the structured task context to the agent: title, context, approach, and acceptance criteria (see §10, Context Passing).
|
|
553
|
+
- **MUST** record the new agent entry in `.nexus/state/{harness-id}/agent-tracker.json`: `{ harness_id, agent_name, agent_id, started_at }`.
|
|
554
|
+
- **SHOULD** 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.
|
|
555
|
+
- **SHOULD** apply capability restrictions: resolve `effective_capabilities` for this agent type and configure the subagent's tool access accordingly (see §6).
|
|
556
|
+
- **SHOULD** 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).
|
|
558
557
|
|
|
559
558
|
---
|
|
560
559
|
|
|
561
560
|
#### `subagent_complete`
|
|
562
561
|
|
|
563
|
-
**When it fires:** A subagent finishes its assigned work and returns control
|
|
562
|
+
**When it fires:** A subagent finishes its assigned work and returns control (harness runtime may expose this as `SubagentStop`, `agent.completed`, a subagent-exit hook, or equivalent).
|
|
564
563
|
|
|
565
564
|
**Expected consumer behavior:**
|
|
566
|
-
-
|
|
567
|
-
-
|
|
568
|
-
-
|
|
569
|
-
-
|
|
570
|
-
-
|
|
565
|
+
- **MUST** update `.nexus/state/{harness-id}/agent-tracker.json`: set `status=completed`, record `stopped_at` timestamp.
|
|
566
|
+
- **MUST** compute `files_touched` from your tool-log or the subagent's tool usage record. Record which files were created or modified in the `files_touched` array of the agent's `agent-tracker.json` entry. This field is the authoritative source for bounded-tier resume evaluation.
|
|
567
|
+
- **MAY** maintain a separate `edit-tracker.json` for cross-session file-touch history, updating it here. This is not a nexus-core requirement; it is a harness-local optimization.
|
|
568
|
+
- **SHOULD** surface an unfinished-task warning when the stopping agent has tasks left in `pending` or `in_progress` state. This pattern is observed across consumers and aids recovery; the warning may be injected into Lead's context or surfaced as a reminder.
|
|
569
|
+
- **MAY** update the task status in `tasks.json` when the agent was assigned a specific task. Note: this responsibility may alternatively be fulfilled at the Lead or tool-contract layer rather than the hook surface.
|
|
571
570
|
|
|
572
571
|
---
|
|
573
572
|
|
|
574
573
|
#### `pre_tool_use`
|
|
575
574
|
|
|
576
|
-
**When it fires:** A tool is about to execute.
|
|
575
|
+
**When it fires:** A tool call has been issued and is about to execute (harness runtime may expose this as `PreToolUse`, `tool.before`, a pre-call interceptor, or equivalent).
|
|
577
576
|
|
|
578
577
|
**Expected consumer behavior:**
|
|
579
|
-
-
|
|
580
|
-
- Capability
|
|
581
|
-
-
|
|
578
|
+
- **SHOULD** enforce a gate for unplanned file edits: if `tasks.json` does not exist and the tool is a file-editing tool, block the call and return an error explaining that edits outside of a planned task cycle are disallowed. This prevents unplanned workspace changes.
|
|
579
|
+
- **Capability invariant (MUST)**: disallowed tools MUST NOT execute. **Enforcement layer (consumer choice)**: The abstract invariant holds regardless of enforcement layer. Consumers may enforce at the hook, in static agent config (frontmatter/TOML/disallowedTools), at a framework-level gate, or any combination — the choice is consumer-local. What nexus-core requires is the invariant, not the enforcement mechanism.
|
|
580
|
+
- **MAY** apply any other pre-condition checks your harness requires (rate limits, sandbox policies, etc.).
|
|
581
|
+
|
|
582
|
+
> **SHOULD note on block reason**: When a tool call is blocked, the `reason` field returned to the LLM is consumed as operational guidance for the next action. Consumers SHOULD compose the `reason` as actionable, directive text rather than a generic error message.
|
|
582
583
|
|
|
583
584
|
Read-only tools (query tools, status reads) are never blocked by capability gates. Only tools with primary write effects are subject to capability restrictions.
|
|
584
585
|
|
|
@@ -586,41 +587,53 @@ Read-only tools (query tools, status reads) are never blocked by capability gate
|
|
|
586
587
|
|
|
587
588
|
#### `post_tool_use`
|
|
588
589
|
|
|
589
|
-
**When it fires:** A tool has
|
|
590
|
+
**When it fires:** A tool call has completed and a result is available (harness runtime may expose this as `PostToolUse`, `tool.after`, a post-call interceptor, or equivalent).
|
|
590
591
|
|
|
591
592
|
**Expected consumer behavior:**
|
|
592
|
-
-
|
|
593
|
-
-
|
|
594
|
-
-
|
|
593
|
+
- **SHOULD** append a log entry to `.nexus/state/tool-log.jsonl`: timestamp, agent_id, tool name, file path (if a file was touched), result status. (This practice is observed across all consumers; nexus-core does not yet define a schema for this file — tracked for v0.11.0.)
|
|
594
|
+
- **MAY** record the file path and agent_id in `edit-tracker.json` if your harness maintains it for cross-session file-touch history. This is a harness-local optimization and is not required by nexus-core. The `files_touched` array in `agent-tracker.json` is the nexus-core-defined record of which files an agent touched.
|
|
595
|
+
- **MAY** record the error in the log for diagnostic purposes if the tool result indicates an error. Do not suppress error results.
|
|
595
596
|
|
|
596
597
|
---
|
|
597
598
|
|
|
598
599
|
#### `session_end`
|
|
599
600
|
|
|
600
|
-
**When it fires:** The
|
|
601
|
+
**When it fires:** The session is terminating (harness runtime may expose this as `Stop`, `session.end`, a shutdown hook, or equivalent).
|
|
601
602
|
|
|
602
603
|
**Expected consumer behavior:**
|
|
603
|
-
-
|
|
604
|
-
-
|
|
605
|
-
-
|
|
606
|
-
-
|
|
607
|
-
-
|
|
604
|
+
- **SHOULD** warn the user if `tasks.json` exists and contains incomplete tasks (status `pending` or `in_progress`), that the session is ending with unfinished work and suggest calling `task_close` to archive before exiting.
|
|
605
|
+
- **SHOULD** delete `.nexus/state/{harness-id}/agent-tracker.json` (a session-scoped file that has no value beyond the session).
|
|
606
|
+
- **MAY** rotate or archive `tool-log.jsonl` if your harness supports log retention.
|
|
607
|
+
- **MUST NOT** delete `history.json`, `memory/`, `context/`, or `rules/` — these are project-scoped and must persist across sessions.
|
|
608
|
+
- **SHOULD** prompt or block with an "all tasks completed — call `task_close` to archive" reminder when `tasks.json` shows all tasks completed but the cycle has not been archived via `task_close`. Run-cycle closure is a recoverability boundary.
|
|
608
609
|
|
|
609
610
|
---
|
|
610
611
|
|
|
611
612
|
#### `context_compact`
|
|
612
613
|
|
|
613
|
-
**When it fires:** The
|
|
614
|
+
**When it fires:** The runtime compresses the context window (harness runtime may expose this as `PostCompact`, `context.compacted`, a post-compact hook, or equivalent).
|
|
614
615
|
|
|
615
616
|
**Expected consumer behavior:**
|
|
616
|
-
-
|
|
617
|
+
- **SHOULD** re-inject the critical session snapshot that was lost in compression:
|
|
617
618
|
- Active skill/mode: which skill is currently active (plan, run, sync, or none).
|
|
618
619
|
- Plan status: if `plan.json` exists, re-inject the issue list with pending/decided status.
|
|
619
620
|
- Task progress: if `tasks.json` exists, re-inject the task list with status and ready-task set.
|
|
620
621
|
- Knowledge file index: re-inject the list of files in `.nexus/memory/`, `.nexus/context/`, `.nexus/rules/`.
|
|
621
622
|
- Active agent list: re-inject which subagents are currently tracked in `.nexus/state/{harness-id}/agent-tracker.json`.
|
|
622
|
-
- Context compaction is a context loss event
|
|
623
|
-
-
|
|
623
|
+
- **SHOULD** restore state from the state files on disk. Context compaction is a context loss event; the LLM cannot reconstruct session state from its compressed context alone.
|
|
624
|
+
- **SHOULD** read state files fresh from disk — do not rely on in-memory caches that may also have been cleared.
|
|
625
|
+
|
|
626
|
+
---
|
|
627
|
+
|
|
628
|
+
### 9.X Appendix: Hook Event Runtime Mapping (consumer-owned)
|
|
629
|
+
|
|
630
|
+
Each consumer harness MUST publish a mapping document at `harness-content/nexus-hook-mapping.md` in its own repository, listing how its runtime hook surface maps to the 8 conceptual events in §9.
|
|
631
|
+
|
|
632
|
+
nexus-core does not mirror these mappings — they are owned and maintained per consumer. This appendix is a registry pointer, not a copy.
|
|
633
|
+
|
|
634
|
+
- **harness_docs_refs token**: `nexus_hook_mapping`
|
|
635
|
+
- **Expected location in consumer repo**: `harness-content/nexus-hook-mapping.md`
|
|
636
|
+
- **Descriptive, not normative**: the consumer mapping document reflects current harness implementation. Verify against the consumer repo for the current mapping — this appendix does not guarantee specific contents.
|
|
624
637
|
|
|
625
638
|
---
|
|
626
639
|
|
package/manifest.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"nexus_core_version": "0.
|
|
3
|
-
"nexus_core_commit": "
|
|
2
|
+
"nexus_core_version": "0.11.0",
|
|
3
|
+
"nexus_core_commit": "7d32c9e06ec206980cbc1399d29c8cb754cd0d5a",
|
|
4
4
|
"schema_contract_version": "2.0",
|
|
5
5
|
"agents": [
|
|
6
6
|
{
|
|
@@ -19,20 +19,6 @@
|
|
|
19
19
|
"id": "architect",
|
|
20
20
|
"body_hash": "sha256:85f9a3de419f32cdae284436eb1d902bff19a2230c50fe3068ffc642949a63b7"
|
|
21
21
|
},
|
|
22
|
-
{
|
|
23
|
-
"name": "engineer",
|
|
24
|
-
"description": "Implementation — writes code, debugs issues, follows specifications from Lead and architect",
|
|
25
|
-
"task": "Code implementation, edits, debugging",
|
|
26
|
-
"alias_ko": "엔지니어",
|
|
27
|
-
"category": "do",
|
|
28
|
-
"resume_tier": "bounded",
|
|
29
|
-
"model_tier": "standard",
|
|
30
|
-
"capabilities": [
|
|
31
|
-
"no_task_create"
|
|
32
|
-
],
|
|
33
|
-
"id": "engineer",
|
|
34
|
-
"body_hash": "sha256:3d58b1b490c2f93cace2eedd0f04ec000f84514388eb086768cf53f8fa33db01"
|
|
35
|
-
},
|
|
36
22
|
{
|
|
37
23
|
"name": "designer",
|
|
38
24
|
"description": "UX/UI design — evaluates user experience, interaction patterns, and how users will experience the product",
|
|
@@ -50,20 +36,18 @@
|
|
|
50
36
|
"body_hash": "sha256:88ac56147d0e5bdf23fa591ce570a9c2d0eb1338df4ec2219f6238ddfcb65df4"
|
|
51
37
|
},
|
|
52
38
|
{
|
|
53
|
-
"name": "
|
|
54
|
-
"description": "
|
|
55
|
-
"task": "
|
|
56
|
-
"alias_ko": "
|
|
57
|
-
"category": "
|
|
58
|
-
"resume_tier": "
|
|
59
|
-
"model_tier": "
|
|
39
|
+
"name": "engineer",
|
|
40
|
+
"description": "Implementation — writes code, debugs issues, follows specifications from Lead and architect",
|
|
41
|
+
"task": "Code implementation, edits, debugging",
|
|
42
|
+
"alias_ko": "엔지니어",
|
|
43
|
+
"category": "do",
|
|
44
|
+
"resume_tier": "bounded",
|
|
45
|
+
"model_tier": "standard",
|
|
60
46
|
"capabilities": [
|
|
61
|
-
"
|
|
62
|
-
"no_task_create",
|
|
63
|
-
"no_task_update"
|
|
47
|
+
"no_task_create"
|
|
64
48
|
],
|
|
65
|
-
"id": "
|
|
66
|
-
"body_hash": "sha256:
|
|
49
|
+
"id": "engineer",
|
|
50
|
+
"body_hash": "sha256:3d58b1b490c2f93cace2eedd0f04ec000f84514388eb086768cf53f8fa33db01"
|
|
67
51
|
},
|
|
68
52
|
{
|
|
69
53
|
"name": "reviewer",
|
|
@@ -80,6 +64,22 @@
|
|
|
80
64
|
"id": "reviewer",
|
|
81
65
|
"body_hash": "sha256:f04d15249601b14046e7e40a4475defb289436c4474afbd89986964f8c3e7c2f"
|
|
82
66
|
},
|
|
67
|
+
{
|
|
68
|
+
"name": "strategist",
|
|
69
|
+
"description": "Business strategy — evaluates market positioning, competitive landscape, and business viability of decisions",
|
|
70
|
+
"task": "Business strategy, market analysis, competitive positioning",
|
|
71
|
+
"alias_ko": "전략가",
|
|
72
|
+
"category": "how",
|
|
73
|
+
"resume_tier": "persistent",
|
|
74
|
+
"model_tier": "high",
|
|
75
|
+
"capabilities": [
|
|
76
|
+
"no_file_edit",
|
|
77
|
+
"no_task_create",
|
|
78
|
+
"no_task_update"
|
|
79
|
+
],
|
|
80
|
+
"id": "strategist",
|
|
81
|
+
"body_hash": "sha256:0254b4144a22c66209bd68119553d9057a4fb7f9b1ff7ebb9878687d99583465"
|
|
82
|
+
},
|
|
83
83
|
{
|
|
84
84
|
"name": "researcher",
|
|
85
85
|
"description": "Independent investigation — conducts web searches, gathers evidence, and reports findings with citations",
|
|
@@ -142,19 +142,6 @@
|
|
|
142
142
|
}
|
|
143
143
|
],
|
|
144
144
|
"skills": [
|
|
145
|
-
{
|
|
146
|
-
"name": "nx-run",
|
|
147
|
-
"description": "Execution — user-directed agent composition.",
|
|
148
|
-
"summary": "Execution — user-directed agent composition",
|
|
149
|
-
"triggers": [
|
|
150
|
-
"run"
|
|
151
|
-
],
|
|
152
|
-
"harness_docs_refs": [
|
|
153
|
-
"resume_invocation"
|
|
154
|
-
],
|
|
155
|
-
"id": "nx-run",
|
|
156
|
-
"body_hash": "sha256:0e2c443efceeab4621709a85cd4e2ba50471d2e850680c655d776cbb62814549"
|
|
157
|
-
},
|
|
158
145
|
{
|
|
159
146
|
"name": "nx-init",
|
|
160
147
|
"description": "Project onboarding — scan, mission, essentials, context generation",
|
|
@@ -189,6 +176,20 @@
|
|
|
189
176
|
],
|
|
190
177
|
"id": "nx-plan",
|
|
191
178
|
"body_hash": "sha256:083ce49c06f8d3e4a0299aa8eb8e33460b68d6a277fe356b4db9635c21016aff"
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"name": "nx-run",
|
|
182
|
+
"description": "Execution — user-directed agent composition.",
|
|
183
|
+
"summary": "Execution — user-directed agent composition",
|
|
184
|
+
"triggers": [
|
|
185
|
+
"run"
|
|
186
|
+
],
|
|
187
|
+
"harness_docs_refs": [
|
|
188
|
+
"resume_invocation",
|
|
189
|
+
"nexus_hook_mapping"
|
|
190
|
+
],
|
|
191
|
+
"id": "nx-run",
|
|
192
|
+
"body_hash": "sha256:0e2c443efceeab4621709a85cd4e2ba50471d2e850680c655d776cbb62814549"
|
|
192
193
|
}
|
|
193
194
|
],
|
|
194
195
|
"vocabulary": {
|
package/package.json
CHANGED