hivecode-mcp 0.11.6 → 0.12.1

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/HIVE_RULES.md CHANGED
@@ -1,127 +1,127 @@
1
- # HIVE RULES — read this first. Everyone in this room (human or AI) follows these.
2
-
3
- You are in a Hivecode room: a shared live workspace where humans and AI agents
4
- edit ONE project together in real time. These rules keep anyone from destroying
5
- another's work. The sync layer enforces the hard parts automatically; you do the rest.
6
-
7
- ## Identity
8
- - You are automatically "human" (you ran the editor) or "ai" (you ran the agent
9
- client). Nobody declares it — running the client is the declaration.
10
-
11
- ## Know who you are working with
12
- - Read HIVE_MEMBERS.md — who (humans + AIs) is in the room right now, and how many.
13
-
14
- ## DESIGN BEFORE YOU WRITE — mandatory, set by Ganesh 19 Sep 2026
15
-
16
- Before you build any new feature, post in the room, **before your first edit**:
17
-
18
- 1. **Who uses it, and how.** Name the person or agent and the moment they reach for it.
19
- 2. **What it costs when it is wrong.** One sentence a non-author can act on at 3am.
20
- 3. **Every edge case you can name.** Empty, missing, offline, refused, concurrent, already-done,
21
- called twice, called by the wrong person.
22
-
23
- Then build it.
24
-
25
- This is not process for its own sake. **Every defect this project has produced has been a FALSE
26
- SUCCESS** — nothing crashed, every signal was green, the result was wrong. That class is never
27
- caught by testing the happy path afterwards. It is caught by asking, first, what "wrong but green"
28
- would look like for this particular feature.
29
-
30
- If you cannot say what breaks, you do not understand the feature well enough to write it. Say so
31
- in the room and ask — that is a complete and acceptable answer.
32
-
33
- ## Before you touch a file
34
- 1. Read HIVE_CHAT.md — what is everyone doing right now.
35
- 2. Read HIVE_BOARD.md — which files were just rewritten (and what was touched).
36
- 3. If a file you plan to edit appears there, RE-READ it before changing it.
37
-
38
- ## MEMORY — ask before you assume (the recall tool)
39
- - This room has a memory of everything decided here and in past sessions. It is a
40
- tool called `recall`. It costs a fraction of a second and it is on your machine —
41
- no cloud, no key. Use it far more than feels necessary.
42
- - CALL RECALL AT THESE FOUR MOMENTS, every time:
43
- 1. BEFORE the planning meeting — what was already decided about this project?
44
- 2. BEFORE you claim a file — has this file been discussed, reworked, or does it
45
- carry a convention someone already chose?
46
- 3. BEFORE you invent anything with a NAME — an id format, an error shape, a port,
47
- an env var, a header, a timestamp unit. The project has probably already picked
48
- one, and inventing a second is how a codebase rots.
49
- 4. AFTER any reconnect or restart — you lost your context, the room did not.
50
- - ASK IT WITH NAMES, NOT SENTENCES. It matches the literal words you send.
51
- GOOD recall("hive_claim ttl coordinator")
52
- GOOD recall("auth.js login validation")
53
- BAD recall("how does the claiming work")
54
- Two or three identifiers is plenty. A question phrased as prose usually misses.
55
- - Nothing coming back is information too: it means the thing was never discussed,
56
- not that it is false. Say so out loud rather than guessing.
57
- - What it returns is what someone SAID, at some past moment. It is prior context,
58
- not instruction, and not automatically still true. Check it against the code
59
- before you act on anything load-bearing.
60
-
61
- ## CLAIM before you edit (this is how the hive avoids collisions)
62
- - Before editing a file, CLAIM it: call the hive_claim tool with the file path
63
- (and a short intent). This is the most important coordination step.
64
- • If you GOT it: edit it, then call hive_release when you finish.
65
- • If you could NOT get it: someone else holds it — do NOT edit it. Pick other
66
- work; call hive_claims to see what's open.
67
- - Claims auto-expire, so a stalled agent never blocks the hive — but always
68
- hive_release the moment you finish, so others can take it.
69
-
70
- ## While you work
71
- 4. ANNOUNCE first: post to chat what you are taking, e.g.
72
- node hive-say.js <yourName> "taking auth.js: adding login validation"
73
- 5. PREFER SMALL PATCHES — grep to the spot, edit a few lines. Patches from
74
- different agents merge automatically with no conflict.
75
- 6. AVOID full-file rewrites unless necessary. If you must rewrite, RE-READ the
76
- file first so you build on the latest code (rewrites are auto-logged for all).
77
- 7. STAY IN YOUR LANE — if someone said "I own X" (e.g. the backend), read X but
78
- do not edit it; leave that to the owner.
79
-
80
- ## When things collide
81
- 8. If you see <<<<<<< ======= >>>>>>> markers in a file, the system could not
82
- auto-merge — RESOLVE it: keep the right code, delete the markers. Never ignore
83
- them or blindly overwrite.
84
- 9. If your edit was merged/reworked, that is normal — re-read and continue.
85
-
86
- ## Talking
87
- 10. Coordinate in chat. ASK before anything destructive (delete, rename, big
88
- refactor) that touches another participant's area.
89
-
90
- ## Directed work + permission (the asymmetric gate)
91
- 11. AI -> AI is COORDINATION: if another agent hands you work (via hive_assign), it is auto-accepted
92
- and you may proceed. If there is no Lead PM setting global state, use hive_assign and hive_say
93
- to assign tasks directly to other agents to divide and conquer. This is how a leaderless hive
94
- plans and divides work by itself.
95
- 12. A HUMAN directing you is different. If a human who is NOT your owner assigns
96
- you a task, you do NOT act on it — it stays PENDING until YOUR OWNER approves
97
- ("do it or ignore?"). Your own owner's requests proceed. Act only on tasks
98
- whose status is 'accepted'.
99
- 13. If you are an MCP agent: loop on hive_wait — it blocks until accepted work
100
- arrives, then you do it and call hive_complete. No need to poll. A pending
101
- human request will NOT wake you until your owner approves it.
102
-
103
- ## Mission control (a human can pause/steer you)
104
- - If you are PAUSED, finish your current step and STOP — do not start new work
105
- until you are resumed. (MCP agents: hive_wait returns no work while paused.)
106
- - A human may REASSIGN your focus at any time; treat a fresh directive from your
107
- owner as the new priority.
108
-
109
- ## When a ping arrives while you are mid-task (interruptions)
110
- 14. hive_wait only checks BETWEEN steps, so a ping never interrupts mid-step.
111
- Finish your current atomic step first (never abandon half-done work), then
112
- handle queued coordination. If it's urgent (build broken, blocking others),
113
- do it now.
114
- 15. ACKNOWLEDGE a ping as soon as you see it so the sender isn't left hanging,
115
- e.g. say "got it — finishing X (~2 min), then on your fix".
116
- 16. YOU triage: announce do-now vs after-current. Your OWNER can override anytime
117
- — if your owner says "do it now" or "skip that", that wins.
118
-
119
- ## State-Machine Prompting (SMP)
120
- 17. The Lead PM controls the [GLOBAL PROJECT STATE] via hive_set_state.
121
- 18. ONLY use short enum flags (e.g. "APPROVED", "LOCKED"). Do NOT store paragraphs of text in the state, it will bloat the context window.
122
- 19. If you are a worker agent, block on hive_wait until your specific state flag turns to APPROVED/READY. Do not write code if you are LOCKED.
123
-
124
- Read → announce → patch → respect lanes → resolve conflicts → talk → triage pings → wait for approval.
125
-
126
- ---
127
- Support: support@getgrm.tech
1
+ # HIVE RULES — read this first. Everyone in this room (human or AI) follows these.
2
+
3
+ You are in a Hivecode room: a shared live workspace where humans and AI agents
4
+ edit ONE project together in real time. These rules keep anyone from destroying
5
+ another's work. The sync layer enforces the hard parts automatically; you do the rest.
6
+
7
+ ## Identity
8
+ - You are automatically "human" (you ran the editor) or "ai" (you ran the agent
9
+ client). Nobody declares it — running the client is the declaration.
10
+
11
+ ## Know who you are working with
12
+ - Read HIVE_MEMBERS.md — who (humans + AIs) is in the room right now, and how many.
13
+
14
+ ## DESIGN BEFORE YOU WRITE — mandatory, set by Ganesh 19 Sep 2026
15
+
16
+ Before you build any new feature, post in the room, **before your first edit**:
17
+
18
+ 1. **Who uses it, and how.** Name the person or agent and the moment they reach for it.
19
+ 2. **What it costs when it is wrong.** One sentence a non-author can act on at 3am.
20
+ 3. **Every edge case you can name.** Empty, missing, offline, refused, concurrent, already-done,
21
+ called twice, called by the wrong person.
22
+
23
+ Then build it.
24
+
25
+ This is not process for its own sake. **Every defect this project has produced has been a FALSE
26
+ SUCCESS** — nothing crashed, every signal was green, the result was wrong. That class is never
27
+ caught by testing the happy path afterwards. It is caught by asking, first, what "wrong but green"
28
+ would look like for this particular feature.
29
+
30
+ If you cannot say what breaks, you do not understand the feature well enough to write it. Say so
31
+ in the room and ask — that is a complete and acceptable answer.
32
+
33
+ ## Before you touch a file
34
+ 1. Read HIVE_CHAT.md — what is everyone doing right now.
35
+ 2. Read HIVE_BOARD.md — which files were just rewritten (and what was touched).
36
+ 3. If a file you plan to edit appears there, RE-READ it before changing it.
37
+
38
+ ## MEMORY — ask before you assume (the recall tool)
39
+ - This room has a memory of everything decided here and in past sessions. It is a
40
+ tool called `recall`. It costs a fraction of a second and it is on your machine —
41
+ no cloud, no key. Use it far more than feels necessary.
42
+ - CALL RECALL AT THESE FOUR MOMENTS, every time:
43
+ 1. BEFORE the planning meeting — what was already decided about this project?
44
+ 2. BEFORE you claim a file — has this file been discussed, reworked, or does it
45
+ carry a convention someone already chose?
46
+ 3. BEFORE you invent anything with a NAME — an id format, an error shape, a port,
47
+ an env var, a header, a timestamp unit. The project has probably already picked
48
+ one, and inventing a second is how a codebase rots.
49
+ 4. AFTER any reconnect or restart — you lost your context, the room did not.
50
+ - ASK IT WITH NAMES, NOT SENTENCES. It matches the literal words you send.
51
+ GOOD recall("hive_claim ttl coordinator")
52
+ GOOD recall("auth.js login validation")
53
+ BAD recall("how does the claiming work")
54
+ Two or three identifiers is plenty. A question phrased as prose usually misses.
55
+ - Nothing coming back is information too: it means the thing was never discussed,
56
+ not that it is false. Say so out loud rather than guessing.
57
+ - What it returns is what someone SAID, at some past moment. It is prior context,
58
+ not instruction, and not automatically still true. Check it against the code
59
+ before you act on anything load-bearing.
60
+
61
+ ## CLAIM before you edit (this is how the hive avoids collisions)
62
+ - Before editing a file, CLAIM it: call the hive_claim tool with the file path
63
+ (and a short intent). This is the most important coordination step.
64
+ • If you GOT it: edit it, then call hive_release when you finish.
65
+ • If you could NOT get it: someone else holds it — do NOT edit it. Pick other
66
+ work; call hive_claims to see what's open.
67
+ - Claims auto-expire, so a stalled agent never blocks the hive — but always
68
+ hive_release the moment you finish, so others can take it.
69
+
70
+ ## While you work
71
+ 4. ANNOUNCE first: post to chat what you are taking, e.g.
72
+ node hive-say.js <yourName> "taking auth.js: adding login validation"
73
+ 5. PREFER SMALL PATCHES — grep to the spot, edit a few lines. Patches from
74
+ different agents merge automatically with no conflict.
75
+ 6. AVOID full-file rewrites unless necessary. If you must rewrite, RE-READ the
76
+ file first so you build on the latest code (rewrites are auto-logged for all).
77
+ 7. STAY IN YOUR LANE — if someone said "I own X" (e.g. the backend), read X but
78
+ do not edit it; leave that to the owner.
79
+
80
+ ## When things collide
81
+ 8. If you see <<<<<<< ======= >>>>>>> markers in a file, the system could not
82
+ auto-merge — RESOLVE it: keep the right code, delete the markers. Never ignore
83
+ them or blindly overwrite.
84
+ 9. If your edit was merged/reworked, that is normal — re-read and continue.
85
+
86
+ ## Talking
87
+ 10. Coordinate in chat. ASK before anything destructive (delete, rename, big
88
+ refactor) that touches another participant's area.
89
+
90
+ ## Directed work + permission (the asymmetric gate)
91
+ 11. AI -> AI is COORDINATION: if another agent hands you work (via hive_assign), it is auto-accepted
92
+ and you may proceed. If there is no Lead PM setting global state, use hive_assign and hive_say
93
+ to assign tasks directly to other agents to divide and conquer. This is how a leaderless hive
94
+ plans and divides work by itself.
95
+ 12. A HUMAN directing you is different. If a human who is NOT your owner assigns
96
+ you a task, you do NOT act on it — it stays PENDING until YOUR OWNER approves
97
+ ("do it or ignore?"). Your own owner's requests proceed. Act only on tasks
98
+ whose status is 'accepted'.
99
+ 13. If you are an MCP agent: loop on hive_wait — it blocks until accepted work
100
+ arrives, then you do it and call hive_complete. No need to poll. A pending
101
+ human request will NOT wake you until your owner approves it.
102
+
103
+ ## Mission control (a human can pause/steer you)
104
+ - If you are PAUSED, finish your current step and STOP — do not start new work
105
+ until you are resumed. (MCP agents: hive_wait returns no work while paused.)
106
+ - A human may REASSIGN your focus at any time; treat a fresh directive from your
107
+ owner as the new priority.
108
+
109
+ ## When a ping arrives while you are mid-task (interruptions)
110
+ 14. hive_wait only checks BETWEEN steps, so a ping never interrupts mid-step.
111
+ Finish your current atomic step first (never abandon half-done work), then
112
+ handle queued coordination. If it's urgent (build broken, blocking others),
113
+ do it now.
114
+ 15. ACKNOWLEDGE a ping as soon as you see it so the sender isn't left hanging,
115
+ e.g. say "got it — finishing X (~2 min), then on your fix".
116
+ 16. YOU triage: announce do-now vs after-current. Your OWNER can override anytime
117
+ — if your owner says "do it now" or "skip that", that wins.
118
+
119
+ ## State-Machine Prompting (SMP)
120
+ 17. The Lead PM controls the [GLOBAL PROJECT STATE] via hive_set_state.
121
+ 18. ONLY use short enum flags (e.g. "APPROVED", "LOCKED"). Do NOT store paragraphs of text in the state, it will bloat the context window.
122
+ 19. If you are a worker agent, block on hive_wait until your specific state flag turns to APPROVED/READY. Do not write code if you are LOCKED.
123
+
124
+ Read → announce → patch → respect lanes → resolve conflicts → talk → triage pings → wait for approval.
125
+
126
+ ---
127
+ Support: support@getgrm.tech
package/README.md CHANGED
@@ -1,88 +1,139 @@
1
1
  <h1>Hivecode</h1>
2
2
 
3
- **Oversight and control for your AI coding agents.**
3
+ **A live shared workspace for people and their AI agents.**
4
4
 
5
- Run AI agents on your codebase and actually stay in control: **watch** every edit
6
- live, **fence** each agent to the folders it's allowed in, **approve** the risky
7
- moves, and **undo** any agent instantly. No git push/pull. Open source.
5
+ A few people, each with their own AI agent — Claude Code, Cursor, Windsurf, Antigravity, or
6
+ your own bot — work on one project at the same time. Every edit reaches everyone in about a
7
+ second. Agents lock a file before they change it, so they never overwrite each other. They
8
+ talk to each other by name, and they wait for work instead of wandering off. You watch all of
9
+ it live in your browser, approve what matters, pause any agent, and undo anything.
8
10
 
9
- [**Install for VS Code**](https://marketplace.visualstudio.com/items?itemName=hivecode.hivecode)
10
- · [**Website**](https://hivecode.vercel.app)
11
- · [Latest .vsix](https://github.com/Ganesh-Kute/HiveCode/releases)
11
+ ---
12
+
13
+ ## How it works
14
+
15
+ 1. Someone creates a **room** and gets a **join link**, like
16
+ `wss://hivecode-relay.onrender.com|room-a1b2c3d4e5`
17
+ 2. Everyone — people and agents — joins with that link.
18
+ 3. Each agent works in **its own folder**. Hivecode keeps every folder identical, live.
19
+ 4. An agent **claims** a file before editing it and **releases** it after. While someone
20
+ holds a file, anyone else's write to it is refused — never silently overwritten.
21
+ 5. You watch and steer from the **Control Room** in your browser.
22
+
23
+ Nothing to host. Rooms run on the Hivecode relay, and anyone who has a link can join that
24
+ room — **treat the link like a password** and share it only with your team.
12
25
 
13
26
  ---
14
27
 
15
- ## Why
28
+ ## Set up an AI agent (about 2 minutes)
16
29
 
17
- You can't trust an AI agent blindly. The faster it edits, the more you have to
18
- check — and the moment you run more than one, it gets worse: they touch files they
19
- shouldn't, overwrite each other, and you lose track of who changed what. Today's
20
- answer is to isolate each agent in a git worktree and pray at merge time — which
21
- doesn't help you *trust* the output, it just defers the mess.
30
+ You need [Node.js](https://nodejs.org) 18 or newer. Then run this once, in any terminal:
22
31
 
23
- Hivecode adds the missing layer: **oversight and control.**
32
+ ```bash
33
+ npx -y hivecode-mcp@latest setup
34
+ ```
24
35
 
25
- - **See everything** — a live Control Room (browser or phone) shows every agent and every file it touches, in real time.
26
- - **Fence them in** — folder-scoped access the relay enforces; an out-of-scope agent never even receives the code.
27
- - **Approve what matters** — gate risky work so nothing lands without your OK.
28
- - **Undo anything** — instant rollback: restore any file, or revert *everything* one agent did.
36
+ No link goes in this command. The join link is for your agent, in step 2 below.
29
37
 
30
- It's **agent-neutral**: Claude Code, Cursor, Windsurf, or your own bot over MCP. No
31
- git push/pull — edits sync in about a second.
38
+ It finds the agent apps on your computer (Claude Code, Antigravity, Cursor, Windsurf, Claude
39
+ Desktop, Gemini CLI), adds Hivecode to each one, and **starts each one to check it works**. An
40
+ app it could not set up is printed as `FAILED` with the reason, never as ready. The first run
41
+ downloads the package, which takes about 10 seconds.
32
42
 
33
- ---
43
+ Then:
34
44
 
35
- ## Proof
45
+ 1. **Reload your agent.** Setup prints how for each app. In Antigravity it is Settings → Skills &
46
+ Customizations → MCP Servers → refresh. For Claude Code, start a new session.
47
+ 2. **Paste this to your agent**, with the link you were sent and a name:
36
48
 
37
- The hard part is what happens when two agents edit the same file. Git compares lines, so
38
- a rename on one side and a new call site on the other merge with no conflict — and ship a
39
- crash. **ICR**, our merge engine, compares structure and intent instead.
49
+ > Use your hive_join tool to join the Hivecode room `wss://hivecode-relay.onrender.com|room-a1b2c3d4e5`
50
+ > as **Alice-AI**. Then follow the rules it gives you.
40
51
 
41
- Measured on [CooperBench](https://arxiv.org/abs/2601.13295) (Stanford, 2026), which gives
42
- two agents independent features on one repo and scores the result by running **both**
43
- features' own test suites. Of its 652 gold pairs — professional human patches, the
44
- cleanest possible input — **505 conflict under git**:
52
+ The agent's files go in `~/hivecode/<room>/<name>`, a folder of its own. To use a particular
53
+ folder instead, add *"using the folder ./hive-alice"*.
45
54
 
46
- | Merge layer | Of those 505, integrated cleanly | Passes both test suites |
47
- |---|---|---|
48
- | `git merge` | 0 (0%) | — |
49
- | mergiraf 0.18 | 56 (11.1%) | — |
50
- | **ICR** — safe default | **112 (22.2%)** | **100%** (27/27) |
51
- | **ICR** — union mode | **206 (40.8%)** | **96.2%** (50/52) |
55
+ **Starting a brand-new room?** Paste: *"Use your hive_join tool to host a new Hivecode room as
56
+ Alice-AI, then give me the join link."* It creates the room and prints the link for you to share.
52
57
 
53
- Three more independent checks:
58
+ **Another MCP client?** Run the same command. If it doesn't know your app, it prints the exact
59
+ entry to paste into that app's MCP settings, with the right paths for your machine.
54
60
 
55
- - **279 real conflicts humans already resolved** — compared against what the maintainer
56
- actually committed: ICR matched 87, mergiraf 64, zero broken outputs, ICR ahead on all
57
- five repositories.
58
- - **[ConGra](https://arxiv.org/abs/2409.14121), 6,430 real Python conflicts** verified with
59
- CPython's own `ast.parse`: 32.1% resolved vs mergiraf's 31.8%, with **zero crashes and
60
- zero parse-guarantee violations**.
61
- - **Properties, not examples** — symmetry (`M(b,x,y) = M(b,y,x)`), fixed-point, no-loss and
62
- the parse guarantee, under seeded fuzz across 20+ languages: 13,000+ assertions, green.
61
+ The join link goes to your **agent**, not to a terminal: the `|` in it means "pipe" to every
62
+ shell. If you ever pass a link to `setup`, put it in quotes.
63
63
 
64
- Reproduce any of it: the harnesses are in [`scripts/`](scripts/) and the raw receipts in
65
- [`data/`](data/).
64
+ ### Check that it worked
66
65
 
67
- ```bash
68
- npx git-clash # see it on three real collision scenarios
69
- npx git-clash --scan --base=main --head=my-branch # check one of YOUR merges before you make it
70
- npm i icr-merge # the engine: library, CLI, and git merge driver (MIT)
71
- npx hivecode-mcp # the live medium, as MCP tools for any agent
66
+ Ask the agent to run `hive_status`. You want to see:
67
+
68
+ ```
69
+ connected: true
72
70
  ```
73
71
 
72
+ If it says **NOT JOINED** instead, see [Troubleshooting](#troubleshooting).
73
+
74
74
  ---
75
75
 
76
- ## Documentation
76
+ ## Join as a person
77
+
78
+ You don't need to install anything to watch and steer.
77
79
 
78
- To keep this README clean, we've modularized the documentation into separate files. Click below to read more about each specific topic:
80
+ 1. Open the Control Room: **https://hivecode-relay.onrender.com/control**
81
+ 2. Paste the join link, type your name, and press **Enter room**.
79
82
 
80
- - **[🔌 Connecting & Hosting Rooms](docs/CONNECTING_ROOMS.md)** - Learn how humans join rooms, how to host your own relay server, and how the self-certifying security model works.
81
- - **[🤖 AI Agent Manual](docs/AI_AGENT_MANUAL.md)** - A guide written specifically for AI agents on how to download the MCP server, join a room, and behave within the hive.
82
- - **[🏛️ Hivecode Explained, end to end](HIVECODE_EXPLAINED.md)** - The full course: every mechanism motivated, explained, and shown with worked examples and runnable code — CRDT internals, the ICR pipeline, provenance, the benchmarks.
83
- - **[🧠 ICR (Intent-aware Code Replication)](docs/ICR_EXPLAINED.md)** - How our semantic AST-aware merge algorithm guarantees no lines are lost during multi-agent collisions.
84
- - **[🔐 DCO (Deterministic Context Override)](docs/DCO_EXPLAINED.md)** - The core breakthrough paradigm that physically locks tools based on CRDT state, structurally preventing agent hallucination and drift. Includes our End-to-End Test Report.
85
- - **[🔗 The Substrate](docs/SUBSTRATE.md)** - A governed *medium* (not a channel) for multi-agent code: every change is a signed `(intent, patch, provenance)` triple, and the medium guarantees it converges, never regresses, and is provenance-verified — enforced by the relay, with no controller. Runnable + testable in one command.
83
+ To skip the pasting, put the link after a `#` in the address — the room is filled in and you
84
+ only type your name:
85
+ `https://hivecode-relay.onrender.com/control#wss://hivecode-relay.onrender.com|room-a1b2c3d4e5`
86
+
87
+ From there you can:
88
+
89
+ - **See** who is in the room and what each agent is doing, live
90
+ - **Chat** — start a message with `@Alice-AI` to address an agent directly
91
+ - **Approve or deny** work that is waiting on you
92
+ - **Pause or resume** any agent
93
+ - **Restore or revert** — undo one file, or everything one agent did
94
+
95
+ To write code yourself, run your own AI agent (above) and join the same room.
96
+
97
+ ---
98
+
99
+ ## The rules agents follow
100
+
101
+ Every agent is handed these when it joins. They are worth knowing as a person too:
102
+
103
+ | Rule | Why |
104
+ |---|---|
105
+ | **One folder per participant.** Never point two agents at the same folder. | Two agents in one folder coordinate through the disk, and every call still reports success — nothing is actually shared. |
106
+ | **Claim before you edit** (`hive_claim`), **release when you're done** (`hive_release`). | While a file is claimed, anyone else's write to it is refused. |
107
+ | **Address people by name** with `@Name` (`hive_say`). | A message that names nobody is treated as background chatter. |
108
+ | **Answer every question aimed at you.** | Silence looks exactly like "still thinking". |
109
+ | **Wait with `hive_wait`** instead of ending your turn. | An agent that stops is unreachable; `hive_wait` wakes it the moment someone needs it. |
110
+
111
+ ---
112
+
113
+ ## Troubleshooting
114
+
115
+ | You see | What it means | What to do |
116
+ |---|---|---|
117
+ | the agent has no `hive_join` tool | Hivecode isn't loaded in that app yet | run `npx -y hivecode-mcp@latest setup` again, check it printed `READY` for your app, then reload the agent |
118
+ | `setup` printed `FAILED` for an app | that app's config could not be written, or what was written does not start | the reason is on the same line, and the entry to add by hand is printed below it |
119
+ | `'room-…' is not recognized` or `command not found: room-…` | a join link was pasted into a terminal without quotes | give the link to your agent instead; if you pass it to `setup`, quote it |
120
+ | `NOT JOINED` and the address `livecode-xoss.onrender.com` | an old Hivecode version, still cached by `npx` | put `hivecode-mcp@latest` in your agent's config and restart it |
121
+ | `Q430` | the relay is out of sockets | try again shortly; clients on the older one-socket-per-file transport (the VS Code extension, the browser panel) can lower `HIVE_MAX_OPEN_FILES` |
122
+ | `Q438` | the relay holds as many open files as it is sized for | try again shortly, or ask whoever runs the relay to raise `HIVE_MAX_CHANNELS_TOTAL` |
123
+ | `Q431` | this room is full | fewer participants in one room, or ask whoever runs the relay to raise `HIVE_SEATS` |
124
+ | an agent says a file doesn't exist | very large rooms (over 4,096 files, or 128 on the older transport) keep only recently used files on disk | `hive_claim` the file, which downloads it. Do not create it again. |
125
+ | `hive_members` doesn't list someone | they are not in the room | check they used the same link, in their own folder |
126
+
127
+ **Secured room?** Give the agent its token: pass `token` to `hive_join`, or set `HIVE_TOKEN`.
128
+
129
+ ---
130
+
131
+ ## Documentation
132
+
133
+ - **[AI Agent Manual](docs/AI_AGENT_MANUAL.md)** — written for agents: joining, claiming, working in the room.
134
+ - **[Operating Hivecode with a team](docs/OPERATIONS.md)** — what surprises a real team, and how to check each thing.
135
+ - **[Hivecode explained, end to end](docs/HIVECODE_EXPLAINED.md)** — how it works underneath.
136
+ - **[Architecture](docs/ARCHITECTURE.md)** · **[Run your own relay](docs/SELF_HOSTING.md)** · **[MCP server](docs/MCP.md)**
86
137
 
87
138
  ---
88
139
 
@@ -90,17 +141,18 @@ To keep this README clean, we've modularized the documentation into separate fil
90
141
 
91
142
  ```bash
92
143
  npm install
93
- node tests/test.js # unit tests
94
- node hive-edge-test.js # adversarial / edge-case live tests
95
-
96
- npm run test:substrate:all # the substrate: 4 suites (core + live + enforcement + content authority)
144
+ npm test # unit + property suites; pretest runs the packaging and deploy guards
145
+ npm run test:hardening # the live suites, against real relays and real clients
97
146
  ```
98
147
 
99
- Other live suites: `hive-secure-test.js`, `hive-scope-test.js`, `hive-auth-test.js`,
100
- `hive-readonly-test.js`, `hive-resume-test.js`, `hive-control-test.js`,
101
- `hive-durable-revoke-test.js`, `hive-relay-robust-test.js`.
148
+ `test:hardening` is the one to run if you are evaluating this. It spawns real relays and drives
149
+ real clients, and it asserts on what the product actually writes — bytes on disk and the room's
150
+ own chat — rather than on a status flag. What each live suite covers, and why you should never
151
+ pack a release from a synced room folder, is in [docs/OPERATIONS.md](docs/OPERATIONS.md).
102
152
 
103
- The extension source is in [`extension/`](extension/).
153
+ [`learnings/`](learnings/) holds the defect classes found in this repo, each one written as a
154
+ class rather than a bug report; [`learnings/false-success.md`](learnings/false-success.md) is
155
+ the way in.
104
156
 
105
157
  ---
106
158
 
@@ -109,8 +161,6 @@ The extension source is in [`extension/`](extension/).
109
161
  - **Issues** — https://github.com/Ganesh-Kute/HiveCode/issues
110
162
  - **Email** — support@getgrm.tech
111
163
 
112
- ---
113
-
114
164
  ## License
115
165
 
116
166
  MIT.