@inkobytes/nexus 1.0.7 → 1.1.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/CHANGELOG.md +18 -0
- package/README.md +96 -32
- package/bin/nexus.js +11 -1
- package/docs/hooks.md +94 -0
- package/docs/nexus-dynamic-governed-loops.md +135 -0
- package/nexus-dashboard/index.html +14 -0
- package/package.json +4 -2
- package/skills/nexus/SKILL.md +10 -4
- package/src/commands/chmod.js +7 -3
- package/src/commands/claim.js +3 -0
- package/src/commands/dashboard.js +17 -7
- package/src/commands/db.js +41 -17
- package/src/commands/doctor.js +95 -189
- package/src/commands/halt.js +72 -0
- package/src/commands/hooks.js +305 -0
- package/src/commands/init.js +7 -172
- package/src/commands/next.js +3 -0
- package/src/commands/release.js +70 -3
- package/src/commands/resume.js +29 -0
- package/src/lib/config.js +9 -0
- package/src/lib/permissions.js +6 -0
- package/src/lib/protocolText.js +196 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.1.0 - 2026-06-11
|
|
4
|
+
|
|
5
|
+
- Added `nexus halt "<reason>"` / `nexus resume` circuit breaker: claim, release, and next refuse while `.nexus/HALT` is present, the dashboard shows a halted banner, and resume is human-gated by convention.
|
|
6
|
+
- Added a release verification gate: when `release.verifyCommand` is set in `.nexus/config.json`, `nexus release` runs it before staging and refuses to commit on failure, keeping the claim. `--no-verify` is allowed only at autonomy level 0 and logged to standup.
|
|
7
|
+
- Added `autonomy` level (0–2) to `.nexus/config.json`; `nexus doctor` now warns when autonomy 1+ has no `verifyCommand` (Loop Readiness check).
|
|
8
|
+
- Dashboard now binds 127.0.0.1 by default; LAN exposure requires the explicit `--lan` flag.
|
|
9
|
+
- Fixed `nexus db restore` writing nested database files to the repo root: the backup manifest now stores repo-relative paths and restores round-trip exactly.
|
|
10
|
+
- Removed shell interpolation from mysql backup/restore; `DATABASE_URL` is passed as literal arguments, never through `sh -c`.
|
|
11
|
+
- Aligned promptCHMOD messaging and docs to "advisory contract, not mechanically enforced," with the x-bit threat model documented honestly.
|
|
12
|
+
- CLI version is now read from `package.json` at runtime, and `prepublishOnly: npm test` blocks publishing on a failing suite.
|
|
13
|
+
- Added GitHub Actions CI running tests and `npm pack --dry-run` on Node 18/20/22.
|
|
14
|
+
|
|
15
|
+
## 1.0.8 - 2026-06-10
|
|
16
|
+
|
|
17
|
+
- Added a shared protocol wording source so `nexus init`, `nexus doctor`, README repair, and tests stay aligned.
|
|
18
|
+
- Tightened generated agent protocol around required continuity/latest-memory reads and claim-before-read/edit behavior.
|
|
19
|
+
- Added `nexus hooks install --agent all` for installing Codex, Claude, and Gemini guard hooks in one pass.
|
|
20
|
+
|
|
3
21
|
## 1.0.7 - 2026-06-06
|
|
4
22
|
|
|
5
23
|
- Added `nexus install-skill` to install the bundled Nexus skill into `~/.agents/skills/nexus`.
|
package/README.md
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
# @inkobytes/nexus
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://github.com/carmelyne/inkobytes-nexus/actions/workflows/ci.yml)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Shared awareness and traffic control for Codex, Claude, Gemini, and other SOTA coding agents working on the same branch.
|
|
6
6
|
|
|
7
|
-
Nexus gives
|
|
7
|
+
Nexus helps multiple top-level coding agents share one local checkout without stepping on each other. It gives them local repo state they can all understand: who is working on what, why a file is locked, what was released, and what is safe to do next.
|
|
8
|
+
|
|
9
|
+
The loop is intentionally small:
|
|
8
10
|
|
|
9
11
|
```text
|
|
10
12
|
start -> claim -> work -> release -> next
|
|
11
13
|
```
|
|
12
14
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
- "I am working on this file."
|
|
16
|
-
- "This is why I claimed it."
|
|
17
|
-
- "This task is done."
|
|
18
|
-
- "These are the files I changed."
|
|
19
|
-
- "Here is what the next agent should know."
|
|
20
|
-
|
|
21
|
-
Everything stays local in the repo. No server. No database. No cloud dashboard. Just files, Git, and a small CLI.
|
|
15
|
+
Nexus is intentionally boring:
|
|
22
16
|
|
|
23
|
-
|
|
17
|
+
- no daemon
|
|
18
|
+
- no cloud service
|
|
19
|
+
- no database
|
|
20
|
+
- no branch choreography requirement
|
|
21
|
+
- just files, Git, hooks, and a small CLI
|
|
24
22
|
|
|
25
23
|
## Why Nexus Exists
|
|
26
24
|
|
|
27
|
-
|
|
25
|
+
The hard part starts when powerful agents work at the same time.
|
|
26
|
+
|
|
27
|
+
If Codex, Claude, Gemini, Cursor, or another coding agent touch the same branch without shared state:
|
|
28
28
|
|
|
29
29
|
- one agent may overwrite another agent's work
|
|
30
30
|
- one agent may commit files it did not mean to commit
|
|
@@ -34,14 +34,26 @@ If two agents touch the same files, things get messy fast:
|
|
|
34
34
|
|
|
35
35
|
With Nexus, Git still stores the code history. Nexus tracks the operational state around Git: who claimed what, what task they are doing, what got released, and what another agent should read next.
|
|
36
36
|
|
|
37
|
+
Nexus is not only traffic control. It gives agents shared situational awareness:
|
|
38
|
+
|
|
39
|
+
- what each agent is working on, and why they claimed it
|
|
40
|
+
- which files are locked right now
|
|
41
|
+
- what the queue says is safe to pick up next
|
|
42
|
+
- what was released, and by whom
|
|
43
|
+
- what needs human attention
|
|
44
|
+
|
|
45
|
+
Codex knows what Claude is doing. Claude knows why Gemini claimed that directory. Nobody works blind.
|
|
46
|
+
|
|
37
47
|
## What Nexus Is And Is Not
|
|
38
48
|
|
|
39
49
|
Nexus is:
|
|
40
50
|
|
|
41
|
-
-
|
|
51
|
+
- shared awareness for multiple SOTA coding agents on one branch
|
|
52
|
+
- file claims before shared reads and edits
|
|
53
|
+
- local guard hooks that block unclaimed writes
|
|
42
54
|
- a queue so agents know what is safe to pick up next
|
|
43
55
|
- a release command that commits only the claimed path
|
|
44
|
-
-
|
|
56
|
+
- standup, report, and ledger files humans can read
|
|
45
57
|
- a local dashboard over the same repo files
|
|
46
58
|
- preventive drills for known multi-agent failure cases
|
|
47
59
|
|
|
@@ -67,11 +79,11 @@ npx @inkobytes/nexus help
|
|
|
67
79
|
|
|
68
80
|
Requires Node.js 18 or newer.
|
|
69
81
|
|
|
70
|
-
## What's New In 1.0.
|
|
82
|
+
## What's New In 1.0.8
|
|
71
83
|
|
|
72
|
-
-
|
|
73
|
-
-
|
|
74
|
-
-
|
|
84
|
+
- Shared protocol wording keeps `nexus init`, `nexus doctor`, README repair, and tests aligned.
|
|
85
|
+
- Generated agent guides now require continuity/latest-memory reads at session start, `nexus start`, or resume.
|
|
86
|
+
- `nexus hooks install --agent all` installs Codex, Claude, and Gemini guard hooks in one pass.
|
|
75
87
|
|
|
76
88
|
See [CHANGELOG.md](./CHANGELOG.md) for the release summary.
|
|
77
89
|
|
|
@@ -91,13 +103,16 @@ In a Git repo:
|
|
|
91
103
|
|
|
92
104
|
```bash
|
|
93
105
|
nexus init
|
|
94
|
-
nexus
|
|
106
|
+
nexus hooks install --agent all
|
|
107
|
+
nexus start --agent @codex
|
|
95
108
|
nexus claim README.md @codex "try Nexus on one file"
|
|
96
109
|
nexus release README.md "docs: try Nexus"
|
|
97
110
|
```
|
|
98
111
|
|
|
99
112
|
`nexus start` is orientation only. The edit loop is `claim -> work -> release`.
|
|
100
113
|
|
|
114
|
+
Hooks are the enforcement layer. Without hooks, Nexus is a coordination protocol agents follow. With hooks, unclaimed writes are blocked and the agent gets the exact claim command to run.
|
|
115
|
+
|
|
101
116
|
`nexus init` creates the Nexus coordination files:
|
|
102
117
|
|
|
103
118
|
- `_NEXUS.md` - live blackboard showing active locks
|
|
@@ -133,6 +148,12 @@ Memory folders are month-based from the start, for example:
|
|
|
133
148
|
.gemini/memories/2026-May/
|
|
134
149
|
```
|
|
135
150
|
|
|
151
|
+
Memory indexes stay newest-first and link to entries with one-line outcomes:
|
|
152
|
+
|
|
153
|
+
```md
|
|
154
|
+
- [2026-06-09-1430-hook-protocol-fix](2026-June/2026-06-09-1430-hook-protocol-fix.md) - tightened hook claim guidance
|
|
155
|
+
```
|
|
156
|
+
|
|
136
157
|
If you only want to inspect an existing repo before changing anything, run:
|
|
137
158
|
|
|
138
159
|
```bash
|
|
@@ -219,16 +240,32 @@ nexus start
|
|
|
219
240
|
|
|
220
241
|
Start reports only local facts: repo path, branch, last commits, dirty files, active locks, and the continuity/memory path for the selected model scope. Start is orientation only, not clearance to edit; agents still claim before shared reads/edits and release when done. Set `NEXUS_AGENT=@claude`, `@codex`, `@gemini`, or `@agy` so agents can run plain `nexus start`; `--agent` is available as an override.
|
|
221
242
|
|
|
222
|
-
### `nexus dashboard --serve [--port <port>]`
|
|
243
|
+
### `nexus dashboard --serve [--port <port>] [--lan]`
|
|
223
244
|
|
|
224
245
|
Serve a read-only local Nexus dashboard to see progress and issues.
|
|
225
246
|
|
|
226
247
|
```bash
|
|
227
248
|
nexus dashboard --serve
|
|
228
249
|
nexus dashboard --serve --port 13787
|
|
250
|
+
nexus dashboard --serve --lan
|
|
229
251
|
```
|
|
230
252
|
|
|
231
|
-
The dashboard
|
|
253
|
+
The dashboard shows repo health, active locks, queue items, recent standup lines, recent release notes, and dirty git files. It uses local files as the source of truth and updates the page through server-sent events. The default port is `13787`; if that port is already in use, Nexus tries `13788`, `13789`, and so on. Passing `--port` uses that exact port.
|
|
254
|
+
|
|
255
|
+
By default the dashboard binds `127.0.0.1`, so it is reachable only from your machine. The dashboard has no authentication and exposes repo coordination state (paths, branch, dirty files, lock intents, standup history), so network exposure is opt-in: pass `--lan` to bind all interfaces and print local-network URLs for other devices. Only use `--lan` on networks you trust.
|
|
256
|
+
|
|
257
|
+
### `nexus halt "<reason>"` and `nexus resume`
|
|
258
|
+
|
|
259
|
+
Repo-wide circuit breaker for agent swarms.
|
|
260
|
+
|
|
261
|
+
```bash
|
|
262
|
+
nexus halt "queue drift detected, need human review"
|
|
263
|
+
nexus resume
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
`nexus halt` writes `.nexus/HALT` with the reason, timestamp, and initiator. While it exists, `claim`, `release`, and `next` refuse with the halt reason and instruct agents to log a standup line and stand by. The dashboard shows a prominent halted banner. One command stops the swarm, repo-wide, instantly.
|
|
267
|
+
|
|
268
|
+
Any agent or human may halt — an agent that detects swarm-level trouble should be able to stop everyone. Only humans resume: `nexus resume` refuses inside recognized agent sessions (`CLAUDECODE=1` or `NEXUS_AGENT` set). Like promptCHMOD, that check is an advisory contract honored at session level, not mechanical enforcement — a process that lies about its identity can bypass it. The audit trail, not the gate, is the real guarantee.
|
|
232
269
|
|
|
233
270
|
### `nexus completion zsh`
|
|
234
271
|
|
|
@@ -253,6 +290,25 @@ nexus install-skill --target ~/.agents/skills/nexus
|
|
|
253
290
|
|
|
254
291
|
By default, Nexus copies `skills/nexus` from the published package into `~/.agents/skills/nexus`. Restart or refresh your agent session after installing so its skill registry can discover the new `nexus` skill.
|
|
255
292
|
|
|
293
|
+
### `nexus hooks install --agent @codex|@claude|@gemini|all [--target <path>] [--force]`
|
|
294
|
+
|
|
295
|
+
Install an agent-specific local guard hook.
|
|
296
|
+
|
|
297
|
+
```bash
|
|
298
|
+
nexus hooks install --agent @codex
|
|
299
|
+
nexus hooks install --agent @claude
|
|
300
|
+
nexus hooks install --agent @gemini
|
|
301
|
+
nexus hooks install --agent all
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
Hooks block writes in Nexus repos until the exact target path is claimed, then give the agent a compact recovery command. Each hook uses the matching claim handle, so Codex sees `@codex`, Claude sees `@claude`, and Gemini sees `@gemini`.
|
|
305
|
+
|
|
306
|
+
Use `--agent all` to install the default Codex, Claude, and Gemini hooks in one pass. `--target` is only for single-agent installs.
|
|
307
|
+
|
|
308
|
+
Hook installation writes outside the repo, so `nexus doctor --fix` does not install hooks. Use `nexus doctor --hooks` to report missing, foreign, wrong-agent, or current hooks.
|
|
309
|
+
|
|
310
|
+
See [docs/hooks.md](./docs/hooks.md) for install targets and behavior.
|
|
311
|
+
|
|
256
312
|
### `nexus ledger [--json]`
|
|
257
313
|
|
|
258
314
|
Show completed task entries from `_NEXUS_LEDGER.md`.
|
|
@@ -334,6 +390,20 @@ If Git's index is temporarily locked by another release, Nexus waits briefly and
|
|
|
334
390
|
|
|
335
391
|
Each release appends a repo-local receipt to `_NEXUS_REPORT.md`. If the released path is listed on a completed queue task and the release message names that task id, Nexus also appends one deduplicated completed-task entry to `_NEXUS_LEDGER.md`.
|
|
336
392
|
|
|
393
|
+
#### Release verification gate
|
|
394
|
+
|
|
395
|
+
Set `release.verifyCommand` in `.nexus/config.json` to make every release prove itself first:
|
|
396
|
+
|
|
397
|
+
```json
|
|
398
|
+
{
|
|
399
|
+
"release": { "verifyCommand": "npm test" }
|
|
400
|
+
}
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
When configured, `nexus release` runs the command before staging. On failure it refuses to commit, keeps your claim so you can fix and retry, prints the last lines of output, and appends a `[BLOCKED]` line to standup. Loop principle: agents must not compound on unverified commits.
|
|
404
|
+
|
|
405
|
+
`--no-verify` skips the gate but is only allowed at autonomy level 0 (supervised), and the skip is logged loudly to standup. At autonomy 1 or higher, `--no-verify` is refused and `nexus doctor` warns whenever no `verifyCommand` is configured.
|
|
406
|
+
|
|
337
407
|
### `nexus standup "<dated message>"`
|
|
338
408
|
|
|
339
409
|
Append a validated standup line to `_NEXUS_STANDUP.md`.
|
|
@@ -425,7 +495,7 @@ The agent rule of thumb:
|
|
|
425
495
|
1. Run `nexus start` when entering an existing repo; it does not replace claim/release.
|
|
426
496
|
2. Read `_NEXUS_CONSTITUTION.md`.
|
|
427
497
|
3. Read `USER.md` when present.
|
|
428
|
-
4. Read continuity and latest memory
|
|
498
|
+
4. Read continuity and latest memory at session start, `nexus start`, or resume.
|
|
429
499
|
5. Read `_NEXUS_QUEUE.md` before taking follow-on work.
|
|
430
500
|
6. Claim before touching shared project files.
|
|
431
501
|
7. Release each claimed tracked file as soon as it reaches a coherent checkpoint.
|
|
@@ -465,6 +535,8 @@ Nexus ships an agent skill at `skills/nexus/SKILL.md`.
|
|
|
465
535
|
|
|
466
536
|
The CLI is the coordination engine. The skill is the lean playbook for this flow: `start -> claim -> work -> release -> next`.
|
|
467
537
|
|
|
538
|
+
Generated agent protocol text lives in `src/lib/protocolText.js`. Update that module first when changing shared protocol wording, then run doctor/init tests so scaffolded guides, README repair, and the bundled skill stay aligned.
|
|
539
|
+
|
|
468
540
|
## Legacy Helper Transition
|
|
469
541
|
|
|
470
542
|
Older Nexus experiments used shell helpers:
|
|
@@ -493,14 +565,6 @@ git status --short
|
|
|
493
565
|
|
|
494
566
|
## Design Notes
|
|
495
567
|
|
|
496
|
-
Nexus is intentionally boring:
|
|
497
|
-
|
|
498
|
-
- no daemon
|
|
499
|
-
- no cloud service
|
|
500
|
-
- no database
|
|
501
|
-
- no private hidden coordination channel
|
|
502
|
-
- no branch choreography requirement
|
|
503
|
-
|
|
504
568
|
The current storage substrate is Git. Future Nexit planning explores agent-native zones, inspection, publish, and recall, but Nexus keeps today's release path stable.
|
|
505
569
|
|
|
506
570
|
## Development
|
package/bin/nexus.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import { argv, exit } from 'process';
|
|
4
|
+
import { readFileSync } from 'fs';
|
|
4
5
|
|
|
5
6
|
const COMMANDS = {
|
|
6
7
|
init: () => import('../src/commands/init.js'),
|
|
@@ -19,14 +20,17 @@ const COMMANDS = {
|
|
|
19
20
|
metrics: () => import('../src/commands/metrics.js'),
|
|
20
21
|
ledger: () => import('../src/commands/ledger.js'),
|
|
21
22
|
drill: () => import('../src/commands/drill.js'),
|
|
23
|
+
hooks: () => import('../src/commands/hooks.js'),
|
|
22
24
|
soul: () => import('../src/commands/soul.js'),
|
|
23
25
|
'install-skill': () => import('../src/commands/install-skill.js'),
|
|
24
26
|
chmod: () => import('../src/commands/chmod.js'),
|
|
25
27
|
db: () => import('../src/commands/db.js'),
|
|
28
|
+
halt: () => import('../src/commands/halt.js'),
|
|
29
|
+
resume: () => import('../src/commands/resume.js'),
|
|
26
30
|
help: () => import('../src/commands/help.js'),
|
|
27
31
|
};
|
|
28
32
|
|
|
29
|
-
const VERSION = '
|
|
33
|
+
const VERSION = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf-8')).version;
|
|
30
34
|
const COLORS = createColors();
|
|
31
35
|
|
|
32
36
|
const args = argv.slice(2);
|
|
@@ -75,7 +79,10 @@ function printHelp() {
|
|
|
75
79
|
['ledger [--json|backfill]', 'Show or backfill completed task ledger'],
|
|
76
80
|
['chmod [--list] [--init]', 'Show or set promptCHMOD permissions'],
|
|
77
81
|
['db <backup|list|restore|schedule>', 'Database backup and recovery'],
|
|
82
|
+
['halt "<reason>"', 'Stop the swarm: claim/release/next refuse'],
|
|
83
|
+
['resume', 'Lift a halt (human-owned by convention)'],
|
|
78
84
|
['drill <list|show|run|report>', 'Inspect or run protocol drills'],
|
|
85
|
+
['hooks install --agent @handle|all', 'Install agent-specific local guard hooks'],
|
|
79
86
|
['soul [--file <path>] [--status | --remove]', 'Manage local soul overlay in agent files'],
|
|
80
87
|
['install-skill [--target <path>] [--force]', 'Install bundled Nexus skill into ~/.agents/skills'],
|
|
81
88
|
['help', 'Show this help'],
|
|
@@ -91,12 +98,15 @@ function printHelp() {
|
|
|
91
98
|
'nexus metrics --json',
|
|
92
99
|
'nexus ledger backfill',
|
|
93
100
|
'nexus drill show wrong-repo-push',
|
|
101
|
+
'nexus hooks install --agent @codex',
|
|
102
|
+
'nexus hooks install --agent all',
|
|
94
103
|
'nexus install-skill',
|
|
95
104
|
'nexus claim src/lib/components/login/ @claude "Building login UI"',
|
|
96
105
|
'nexus release src/lib/components/login/ "feat: login form component"',
|
|
97
106
|
'nexus standup "2026-06-01 08:38 AM @codex [DONE]: Updated tests"',
|
|
98
107
|
'nexus clean --stale',
|
|
99
108
|
'nexus next @claude',
|
|
109
|
+
'nexus halt "queue drift detected, need human review"',
|
|
100
110
|
];
|
|
101
111
|
|
|
102
112
|
const width = Math.max(...commands.map(([left]) => left.length)) + 2;
|
package/docs/hooks.md
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# Nexus Hooks
|
|
2
|
+
|
|
3
|
+
Nexus hooks are optional local guardrails for agent CLIs. They block file writes in Nexus repos until the target path has a matching Nexus claim.
|
|
4
|
+
|
|
5
|
+
Hooks are useful because agent instruction files can be forgotten after context compaction. The hook gives the agent a short recovery command instead of letting it edit around the protocol.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
nexus hooks install --agent @codex
|
|
11
|
+
nexus hooks install --agent @claude
|
|
12
|
+
nexus hooks install --agent @gemini
|
|
13
|
+
nexus hooks install --agent all
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Supported agents:
|
|
17
|
+
|
|
18
|
+
- `@codex`
|
|
19
|
+
- `@claude`
|
|
20
|
+
- `@gemini`
|
|
21
|
+
|
|
22
|
+
Each installed hook bakes in the matching claim handle, so a Codex hook says `@codex`, a Claude hook says `@claude`, and a Gemini hook says `@gemini`.
|
|
23
|
+
|
|
24
|
+
Use `--agent all` to install all default Codex, Claude, and Gemini hooks in one pass. `--target` is only available for a single agent because each agent has a different default file.
|
|
25
|
+
|
|
26
|
+
## Default Targets
|
|
27
|
+
|
|
28
|
+
```text
|
|
29
|
+
@codex -> ~/.codex/hooks/pre_tool_use_guard.py
|
|
30
|
+
@claude -> ~/.claude/hooks/nexus_pre_tool_use_guard.py
|
|
31
|
+
@gemini -> ~/.gemini/hooks/nexus_pre_tool_use_guard.py
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Use `--target` when your agent CLI needs a different hook path:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
nexus hooks install --agent @codex --target ~/.codex/hooks/pre_tool_use_guard.py
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
If a hook file already exists, Nexus does not overwrite it unless it is already a current Nexus hook. Use `--force` only after reviewing the existing file:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
nexus hooks install --agent @codex --force
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## What The Hook Blocks
|
|
47
|
+
|
|
48
|
+
The hook looks for writes to files in a Nexus repo. If the file is not claimed, it denies the tool call with a compact message:
|
|
49
|
+
|
|
50
|
+
```text
|
|
51
|
+
CLAIM FIRST: README.md
|
|
52
|
+
cd /path/to/repo && nexus claim README.md @codex "Describe the edit"
|
|
53
|
+
Retry edit. No workaround.
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
For multiple files, it adds:
|
|
57
|
+
|
|
58
|
+
```text
|
|
59
|
+
If multiple files are listed, claim each exact path.
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
The hook discovers the Nexus repo root from the target path or current working directory. It checks the real Nexus lock path encoding, including nested paths such as `docs~2Fguide.md.lock`.
|
|
63
|
+
|
|
64
|
+
## Claim Exemptions
|
|
65
|
+
|
|
66
|
+
The hook allows agent-local continuity and memory handoff files without a claim:
|
|
67
|
+
|
|
68
|
+
- `.codex/CONTINUITY.md`
|
|
69
|
+
- `.codex/memories/`
|
|
70
|
+
- `.claude/CONTINUITY.md`
|
|
71
|
+
- `.claude/memories/`
|
|
72
|
+
- `.gemini/CONTINUITY.md`
|
|
73
|
+
- `.gemini/memories/`
|
|
74
|
+
|
|
75
|
+
Agent instruction files such as `.codex/AGENTS.md`, `.claude/CLAUDE.md`, and `.gemini/GEMINI.md` still require claim/release when they are shared project files.
|
|
76
|
+
|
|
77
|
+
## Doctor Check
|
|
78
|
+
|
|
79
|
+
Hook installation writes outside the repo, so `nexus doctor --fix` does not install or replace hooks.
|
|
80
|
+
|
|
81
|
+
To audit hook status explicitly:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
nexus doctor --hooks
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Doctor reports whether each supported agent hook is:
|
|
88
|
+
|
|
89
|
+
- `current`
|
|
90
|
+
- `missing`
|
|
91
|
+
- `foreign`
|
|
92
|
+
- `wrong-agent`
|
|
93
|
+
|
|
94
|
+
Use `nexus hooks install --agent <handle>` to install or refresh a hook.
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# Nexus Dynamic and Governed Loops Graphic Brief
|
|
2
|
+
|
|
3
|
+
## Core Insight
|
|
4
|
+
|
|
5
|
+
Nexus is dynamic before approval and deterministic after approval.
|
|
6
|
+
|
|
7
|
+
The system already supports dynamism because agents can discover issues, propose work, shape tasks, and surface dependencies. That dynamism is easy to miss because the execution loop is intentionally governed and repeatable.
|
|
8
|
+
|
|
9
|
+
## Graphic Goal
|
|
10
|
+
|
|
11
|
+
Create a clear visual that explains how Nexus handles both:
|
|
12
|
+
|
|
13
|
+
- dynamic discovery, planning, and proposal
|
|
14
|
+
- governed execution through approved queue work
|
|
15
|
+
|
|
16
|
+
The graphic should help users understand that Nexus is not a free-roaming autonomous agent system. It is a coordination workflow where agents can think and propose freely, but can only execute approved scoped work.
|
|
17
|
+
|
|
18
|
+
## Suggested Diagram Structure
|
|
19
|
+
|
|
20
|
+
Show two connected loops with a visible approval boundary between them.
|
|
21
|
+
|
|
22
|
+
### Loop 1: Dynamic Discovery Loop
|
|
23
|
+
|
|
24
|
+
Labels:
|
|
25
|
+
|
|
26
|
+
1. Idea or observation
|
|
27
|
+
2. Inspect context
|
|
28
|
+
3. Find issue or opportunity
|
|
29
|
+
4. Propose task
|
|
30
|
+
5. Shape scope, files, dependencies, tradeoffs
|
|
31
|
+
6. Wait for approval
|
|
32
|
+
|
|
33
|
+
Tone:
|
|
34
|
+
|
|
35
|
+
- exploratory
|
|
36
|
+
- generative
|
|
37
|
+
- allowed to be dynamic
|
|
38
|
+
- no file-changing execution unless separately approved and claimed
|
|
39
|
+
|
|
40
|
+
### Boundary: Approval Gate
|
|
41
|
+
|
|
42
|
+
Main label:
|
|
43
|
+
|
|
44
|
+
> Dynamic before approval. Deterministic after approval.
|
|
45
|
+
|
|
46
|
+
Supporting labels:
|
|
47
|
+
|
|
48
|
+
- human review
|
|
49
|
+
- `Review: approved`
|
|
50
|
+
- `Approved by: human`
|
|
51
|
+
- `Auto-flow: yes`
|
|
52
|
+
- task contract is complete
|
|
53
|
+
|
|
54
|
+
This gate should visually separate proposal from execution.
|
|
55
|
+
|
|
56
|
+
### Loop 2: Governed Execution Loop
|
|
57
|
+
|
|
58
|
+
Labels:
|
|
59
|
+
|
|
60
|
+
1. Ready Queue
|
|
61
|
+
2. `nexus next @agent`
|
|
62
|
+
3. `nexus claim <path> @agent "intent"`
|
|
63
|
+
4. Work inside claimed surface
|
|
64
|
+
5. Validate
|
|
65
|
+
6. `nexus release <path> "message"`
|
|
66
|
+
7. Standup/report if useful
|
|
67
|
+
8. Next safe task or Standby
|
|
68
|
+
|
|
69
|
+
Tone:
|
|
70
|
+
|
|
71
|
+
- deterministic
|
|
72
|
+
- repeatable
|
|
73
|
+
- file-scoped
|
|
74
|
+
- approval-bound
|
|
75
|
+
- safe for multi-agent concurrency
|
|
76
|
+
|
|
77
|
+
## Key Message
|
|
78
|
+
|
|
79
|
+
Agents may discover and propose freely.
|
|
80
|
+
Agents may execute only approved scoped work.
|
|
81
|
+
|
|
82
|
+
## What The Graphic Should Prevent
|
|
83
|
+
|
|
84
|
+
- Thinking Nexus is only a rigid task runner.
|
|
85
|
+
- Thinking Nexus lets agents freely invent and execute work.
|
|
86
|
+
- Treating `nexus next` as an ideation engine.
|
|
87
|
+
- Treating proposed work as executable work.
|
|
88
|
+
- Forgetting the approval boundary.
|
|
89
|
+
|
|
90
|
+
## Possible Formats
|
|
91
|
+
|
|
92
|
+
- Mermaid draft for README
|
|
93
|
+
- FigJam/Figma system map
|
|
94
|
+
- Dashboard explainer panel
|
|
95
|
+
- README hero diagram
|
|
96
|
+
- Short docs page with the two-loop graphic and examples
|
|
97
|
+
|
|
98
|
+
## Draft Mermaid Shape
|
|
99
|
+
|
|
100
|
+
```mermaid
|
|
101
|
+
flowchart LR
|
|
102
|
+
subgraph Discovery["Dynamic Discovery Loop"]
|
|
103
|
+
A[Idea or observation] --> B[Inspect context]
|
|
104
|
+
B --> C[Find issue or opportunity]
|
|
105
|
+
C --> D[Propose task]
|
|
106
|
+
D --> E[Shape scope, files, dependencies, tradeoffs]
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
E --> Gate{Approval Gate}
|
|
110
|
+
|
|
111
|
+
Gate -->|Review approved + Auto-flow yes| R[Ready Queue]
|
|
112
|
+
Gate -->|Needs planning or approval| D
|
|
113
|
+
|
|
114
|
+
subgraph Execution["Governed Execution Loop"]
|
|
115
|
+
R --> N[nexus next @agent]
|
|
116
|
+
N --> CL[nexus claim path @agent intent]
|
|
117
|
+
CL --> W[Work inside claimed surface]
|
|
118
|
+
W --> V[Validate]
|
|
119
|
+
V --> REL[nexus release path message]
|
|
120
|
+
REL --> S[Standup or report]
|
|
121
|
+
S --> N
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
N -->|No safe task| Standby[Standby]
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## Later Design Notes
|
|
128
|
+
|
|
129
|
+
- Make the discovery loop feel more fluid than the execution loop.
|
|
130
|
+
- Make the approval gate visually prominent.
|
|
131
|
+
- Use different colors for "propose" versus "execute", but keep the overall palette restrained.
|
|
132
|
+
- The primary caption should be short enough to remember:
|
|
133
|
+
|
|
134
|
+
> Dynamic before approval. Deterministic after approval.
|
|
135
|
+
|
|
@@ -70,6 +70,10 @@
|
|
|
70
70
|
</div>
|
|
71
71
|
</div>
|
|
72
72
|
</header>
|
|
73
|
+
<div id="halt-banner" hidden style="background:#7f1d1d;border:1px solid #ef4444;color:#fecaca;padding:14px 18px;border-radius:10px;margin-bottom:16px;font-weight:600;">
|
|
74
|
+
<span style="margin-right:8px;">⛔</span><span id="halt-text"></span>
|
|
75
|
+
<div id="halt-meta" style="font-weight:400;opacity:.85;margin-top:4px;font-size:.85em;"></div>
|
|
76
|
+
</div>
|
|
73
77
|
<div id="health-alert" class="health-alert" hidden>
|
|
74
78
|
<div class="health-alert-inner">
|
|
75
79
|
<span class="health-alert-icon">🔴</span>
|
|
@@ -173,6 +177,16 @@
|
|
|
173
177
|
// Always update the timestamp — it's benign
|
|
174
178
|
document.getElementById('updated').textContent = 'Updated ' + new Date(data.generatedAt).toLocaleTimeString();
|
|
175
179
|
|
|
180
|
+
// Halt banner always reflects current state, even with a popover open
|
|
181
|
+
const haltBanner = document.getElementById('halt-banner');
|
|
182
|
+
if (data.halt) {
|
|
183
|
+
haltBanner.hidden = false;
|
|
184
|
+
document.getElementById('halt-text').textContent = 'SWARM HALTED — ' + data.halt.reason;
|
|
185
|
+
document.getElementById('halt-meta').textContent = 'since ' + data.halt.at + ' by ' + data.halt.by + ' — claim, release, and next refuse until a human runs nexus resume';
|
|
186
|
+
} else {
|
|
187
|
+
haltBanner.hidden = true;
|
|
188
|
+
}
|
|
189
|
+
|
|
176
190
|
// Don't re-render DOM while user has a popover open or is working in DevTools
|
|
177
191
|
if (document.querySelector('.task-popover:popover-open')) return;
|
|
178
192
|
document.getElementById('repo').textContent = data.repo + ' . ' + data.branch;
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkobytes/nexus",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Multi-agent coordination CLI for coding agents sharing a local repository",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"nexus": "bin/nexus.js"
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
|
-
"test": "node --test test/**/*.test.js"
|
|
10
|
+
"test": "node --test test/**/*.test.js",
|
|
11
|
+
"prepublishOnly": "npm test"
|
|
11
12
|
},
|
|
12
13
|
"keywords": [
|
|
13
14
|
"ai",
|
|
@@ -33,6 +34,7 @@
|
|
|
33
34
|
"files": [
|
|
34
35
|
"bin/",
|
|
35
36
|
"src/",
|
|
37
|
+
"docs/",
|
|
36
38
|
"drills/",
|
|
37
39
|
"skills/",
|
|
38
40
|
"nexus-dashboard/",
|
package/skills/nexus/SKILL.md
CHANGED
|
@@ -7,12 +7,14 @@ description: Use in repos coordinated by the Nexus CLI, especially when _NEXUS_C
|
|
|
7
7
|
|
|
8
8
|
Nexus CLI is the coordination engine. This skill is only the agent playbook.
|
|
9
9
|
|
|
10
|
+
If the user, repo, or hook says Nexus is active, treat this skill as mandatory workflow. It is not optional advice.
|
|
11
|
+
|
|
10
12
|
## Loop
|
|
11
13
|
|
|
12
14
|
1. Run `nexus start`; set `NEXUS_AGENT` for your CLI, or pass `--agent @agy|@claude|@codex|@gemini`. Start is orientation only, not permission to edit.
|
|
13
15
|
2. Read `_NEXUS_CONSTITUTION.md`.
|
|
14
16
|
3. Read `USER.md` if present for local user preferences.
|
|
15
|
-
4. Read continuity and latest memory
|
|
17
|
+
4. Read continuity and latest memory at session start, `nexus start`, or resume.
|
|
16
18
|
5. Read `_NEXUS_QUEUE.md` and `_NEXUS_STANDUP.md`.
|
|
17
19
|
6. Choose user-assigned work or `nexus next @Agent`; do not free-roam into `Auto-flow: no`.
|
|
18
20
|
7. Claim exact shared files before reading/editing:
|
|
@@ -22,14 +24,15 @@ Nexus CLI is the coordination engine. This skill is only the agent playbook.
|
|
|
22
24
|
```
|
|
23
25
|
|
|
24
26
|
8. Treat claim output as current file state. Ignore cached file memory when contents matter.
|
|
25
|
-
9.
|
|
26
|
-
10.
|
|
27
|
+
9. If a hook blocks access because a path is unclaimed, stop and claim that exact path. Do not work around the hook with another command, cached content, or manual git operation.
|
|
28
|
+
10. Work only inside the claimed surface and run focused validation.
|
|
29
|
+
11. Release each claimed tracked file through Nexus as soon as it reaches a coherent checkpoint:
|
|
27
30
|
|
|
28
31
|
```bash
|
|
29
32
|
nexus release <path> "short commit message"
|
|
30
33
|
```
|
|
31
34
|
|
|
32
|
-
|
|
35
|
+
12. Do not hold claims to bundle related work into a prettier feature commit. Nexus is agent-native and file-native: optimize for file availability, rollback safety, and agent throughput.
|
|
33
36
|
|
|
34
37
|
## Queue Items
|
|
35
38
|
|
|
@@ -62,6 +65,9 @@ When adding work to `_NEXUS_QUEUE.md`, keep tasks dashboard-parseable and immedi
|
|
|
62
65
|
- Use `nexus doctor` for audit/repair, not as the normal startup command.
|
|
63
66
|
- Use CLI/model names as lock handles: `@agy`, `@claude`, `@codex`, `@gemini`.
|
|
64
67
|
- Agent-local continuity and memory files are claim-exempt unless the user says otherwise.
|
|
68
|
+
- Continuity is the compaction-safe session ledger; latest memory is required startup/resume context.
|
|
69
|
+
- Memory indexes use monthly folders and newest-first Markdown links with one-line outcomes.
|
|
70
|
+
- Shared generated protocol wording is sourced from `src/lib/protocolText.js`; update that first, then run doctor/init tests.
|
|
65
71
|
- When using subagents or parallel workers, the lead agent owns the repo effects: claim the full path scope, pass boundaries down, re-read affected files, and mention delegated work in release or standup notes.
|
|
66
72
|
- Avoid parallel `nexus release`.
|
|
67
73
|
- Do not install packages younger than 14 days; if age is unknown, ask.
|
package/src/commands/chmod.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* nexus chmod — manage the promptCHMOD permission matrix.
|
|
3
|
-
*
|
|
3
|
+
* Advisory contract honored at session start, not mechanically enforced:
|
|
4
|
+
* the matrix is human-owned by convention, and the session gate below is an
|
|
5
|
+
* env-var check any process can set in one line. It deters accidental edits;
|
|
6
|
+
* it cannot stop a process that lies about its identity.
|
|
4
7
|
*
|
|
5
8
|
* r = read for reference
|
|
6
9
|
* w = modify (claim/release already enforces this)
|
|
@@ -59,12 +62,13 @@ export default function chmod(args) {
|
|
|
59
62
|
process.exit(1);
|
|
60
63
|
}
|
|
61
64
|
|
|
62
|
-
//
|
|
65
|
+
// Session gate — advisory by design: these env vars are settable by any
|
|
66
|
+
// process, so this deters accidental edits, nothing more.
|
|
63
67
|
const trustSource = process.env.CLAUDECODE === '1' ? 'harness'
|
|
64
68
|
: process.env.NEXUS_AGENT ? 'operator'
|
|
65
69
|
: 'unverified';
|
|
66
70
|
if (trustSource === 'unverified') {
|
|
67
|
-
console.error('[ERROR] nexus chmod
|
|
71
|
+
console.error('[ERROR] nexus chmod expects a recognized session (CLAUDECODE=1 or NEXUS_AGENT set).\nThe matrix is human-owned by convention; this gate is advisory, not enforcement.\nHumans can edit _NEXUS_CHMOD.md directly.');
|
|
68
72
|
process.exit(1);
|
|
69
73
|
}
|
|
70
74
|
|