queen-colony-debug
Skill11k starsChanged 4 months agoApache-2.0View on GitHub
SOP for live debugging of queen sessions, colony forks, worker spawns, and tracker DB plumbing without touching the user's production Hive Desktop. Use this when something is wrong in the create_colony → tracker → run_parallel_workers → worker pipeline. User asks you to debug, reproduce, or verify behavior in: - Queen DM sessions, colony sessions, fork_session_into_colony - ColonyBinding propagation (queen exec context, worker input_data) - tracker_sql / tracker_register_writable / tracker_upsert / tracker_query - run_parallel_workers preflight - Phantom colonies/session_<uuid>/ shadow folders (the…
- Deletes or force-pushes
- Sends data out
Trending
Quiet since October.about the whole repository
Who's talking about aden-hive/hive
- SeCuReDmE-main-dev/aden_case_study“Phase 2: Neutrosophic worker report integration”GitHub · May 8, 2026 · 1 reactions
- SeCuReDmE-main-dev/aden_case_study“Phase 1: Neutrosophic scoring core”GitHub · May 7, 2026 · 1 reactions
- midnghtsapphire/revvel-standards“Anything worth using in our test harness or the whole thing?”GitHub · Apr 20, 2026 · 1 reactions
- sudosubin/agents.nix“agent-skills.github.aden-hive.hive: v0.11.0 → refs/tags/v0.11.0”GitHub · Oct 3, 2026
- ProSkillsMD/proskills“[Candidate] aden-hive/hive/core/framework/skills/_default_skills/note-taking - hive.note-taking”GitHub · Sep 27, 2026
The biggest 5 of 26 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 26
Talked about on GitHub (26 times).
On GitHub · 26
- May 8, 2026Phase 2: Neutrosophic worker report integration — SeCuReDmE-main-dev/aden_case_study1 reaction · 2 comments
- May 7, 2026Phase 1: Neutrosophic scoring core — SeCuReDmE-main-dev/aden_case_study1 reaction · 2 comments
- Apr 20, 2026Anything worth using in our test harness or the whole thing? — midnghtsapphire/revvel-standards1 reaction · 1 comment
- Oct 3, 2026agent-skills.github.aden-hive.hive: v0.11.0 → refs/tags/v0.11.0 — sudosubin/agents.nix0 reactions
- Sep 27, 2026[Candidate] aden-hive/hive/core/framework/skills/_default_skills/note-taking - hive.note-taking — ProSkillsMD/proskills0 reactions · 2 comments
21 more on GitHub
- Sep 27, 2026[Candidate] aden-hive/hive/core/framework/skills/_default_skills/image-generation - hive.image-generation — ProSkillsMD/proskills0 reactions · 2 comments
- Sep 27, 2026[Candidate] aden-hive/hive/core/framework/skills/_default_skills/error-recovery - hive.error-recovery — ProSkillsMD/proskills0 reactions · 2 comments
- Sep 26, 2026[Candidate] aden-hive/hive/core/framework/skills/_default_skills/context-preservation - hive.context-preservation — ProSkillsMD/proskills0 reactions · 2 comments
- Sep 26, 2026[Candidate] aden-hive/hive/core/framework/skills/_default_skills/colony-progress-tracker - hive.colony-progress-tracker — ProSkillsMD/proskills0 reactions · 2 comments
- Sep 26, 2026[Candidate] aden-hive/hive/core/framework/skills/_default_skills/browser-automation - hive.browser-automation — ProSkillsMD/proskills0 reactions · 2 comments
- Sep 26, 2026[Candidate] aden-hive/hive/.claude/skills/triage-issue - triage-issue — ProSkillsMD/proskills0 reactions · 1 comment
- Sep 26, 2026[Candidate] aden-hive/hive/.claude/skills/test-reporting - test-reporting — ProSkillsMD/proskills0 reactions · 1 comment
- Sep 26, 2026[Candidate] aden-hive/hive/.claude/skills/browser-edge-cases - browser-edge-cases — ProSkillsMD/proskills0 reactions · 1 comment
- Sep 24, 2026agent-skills.github.aden-hive.hive: init at 0.11.0 — sudosubin/agents.nix0 reactions
- Sep 24, 2026Suggest: aden-hive/hive — haggaishachar/awesomemap0 reactions · 1 comment
- Sep 22, 2026Track 0: Sujit Nirmal - track record entry — neugence/whipscribe-buildathon0 reactions · 4 comments
- Jun 3, 2026[Add] Hive (aden-hive/hive) — PyTorchKR/landscape0 reactions
- May 19, 2026Harden token budget enforcement and deterministic retry behavior — PauloBoaventura/hivee0 reactions · 1 comment
- Apr 24, 2026Vouch setup — triggerdotdev/trigger.dev0 reactions · 1 comment
- Apr 1, 2026Issue 6885 — Saurabh1374/hive0 reactions · 1 comment
- Mar 27, 2026fix: harden Codex backend parity across runtime and validation — VasuBansal7576/hive0 reactions · 2 comments
- Mar 27, 2026fix: harden Codex backend parity across runtime and validation — VasuBansal7576/hive0 reactions · 1 comment
- Mar 27, 2026fix: harden Codex backend parity across runtime and validation — VasuBansal7576/hive0 reactions · 1 comment
- Mar 15, 2026Found a possible duplicate of #2996: Both issues propose QuickBooks integration with detailed specifications for the same financial management and reporting features. While this issue provides a higher-level scope focused on nine core functions and complementary analytics integration, #2996 (assigne — Palace999945/markdoc-starter0 reactions
- Mar 13, 2026Add Hive to Open-Source AI Models & Frameworks — best-of-ai/best-of-ai0 reactions · 1 comment
- Mar 12, 2026docs: add Microsoft Graph tool README — sachinbabuantony/hive0 reactions
In this repository5 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- browser-edge-casesSkill
- test-reportingSkill
- triage-issueSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 3 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 65
Verify Commercial extensions loaded appears in the startup log.
- Very specific: line 124
If you see tracker_db_path or colony_id keys here, worker_definition.build_input_data or routes_execution.fork_session_into_colony is …
- Distinctive: line 128
Only use when (b) isn't enough.
- Distinctive: line 143
When background command exits, grep the log for what actually happened:
- Very specific: line 162
Verify queen_phase: "colony" in the response — that's when tracker tools are exposed.
- Very specific: line 285
If both asserts pass: binding plumbing intact.
- Very specific: line 295
If you used HIVE_HOME=/tmp/hive_e2e, optionally rm -rf /tmp/hive_e2e when done.
- Very specific: line 297
If you used the real HIVE_HOME: do not auto-clean.
- Distinctive: line 312
When investigating, these are the load-bearing files:
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Queen / Colony Debug Skill
SOP for live debugging of queen sessions, colony forks, worker spawns, and tracker DB plumbing without touching the user's production Hive Desktop. Use this when something is wrong in the create_colony → tracker → run_parallel_workers → worker pipeline.
Trigger
User asks you to debug, reproduce, or verify behavior in:
- Queen DM sessions, colony sessions,
fork_session_into_colony ColonyBindingpropagation (queen exec context, workerinput_data)tracker_sql/tracker_register_writable/tracker_upsert/tracker_queryrun_parallel_workerspreflight- Phantom
colonies/session_<uuid>/shadow folders (the original split-brain bug) - Session resume from disk, queen phase transitions (independent → incubating → colony)
Examples: "queen says no such table", "workers can't see what queen wrote", "phantom colony folder appeared", "verify my colony refactor didn't break anything".
Hard rules
- Never run against the user's real Hive Desktop runtime by default. Use an isolated
HIVE_HOME=/tmp/hive_e2efirst. Only switch to the realHIVE_HOME(~/Library/Application Support/Hive/users/<hash>) when the user has explicitly asked for live LLM verification or when an offline repro is impossible. - Never read the real
secrets/,credentials/, orconfiguration.jsondirectories. The auto-mode classifier will block credential exploration. You don't need their contents — the server reads them itself. - Pick a non-default port (
--port 8901/8902/8903) so you don't collide with a running Hive Desktop on8787. - Background the server, don't foreground it.
&redirects the log to a file you cantail/grepwhile you make HTTP calls in parallel. - For "wait for thing X" patterns: use
Bash run_in_background:truewith anuntil grep -q ...loop — never chainsleep N. The harness blocks long leading sleeps. - LLM-driven turns cost real credits. Budget your queen prompts: prefer terse, deterministic instructions ("just call create_colony with these exact args") over open-ended questions.
What "correct" looks like (key invariants)
These are the invariants the refactor enforces; verifying them is most of the job:
- A DM queen session must not create
colonies/<session_uuid>/(the phantom-folder bug). Only on-disk colony names live undercolonies/. worker.jsoninput_datacarries exactly one key:{"binding": {"name", "dir", "tracker_db"}}. Notracker_db_path, nocolony_id(those are legacy and get stripped by_patch_worker_configson every server boot).- The queen and her workers in a given colony share one
tracker.db— the one insidecolonies/<name>/data/. - Tools refuse with
"no colony context — this tool only works inside a colony"when called without a binding. They never synthesize paths. run_parallel_workersemits the log linerun_parallel_workers: attached binding to N spawn(s) (colony=<name>). If that line is missing, the binding plumbing is broken.
Authoritative source for the binding model: core/framework/host/colony_binding.py.
SOP
Step 1 — Pick a runtime
Default to isolated:
mkdir -p /tmp/hive_e2e/colonies /tmp/hive_e2e/agents/queens
PORT=8901
HIVE_HOME=/tmp/hive_e2e uv run hive serve --port $PORT --verbose 2>&1 > /tmp/hive_e2e/server.log &
echo "pid: $!"Confirm it's up:
until curl -sf http://127.0.0.1:$PORT/api/health >/dev/null 2>&1; do sleep 1; done
curl -s http://127.0.0.1:$PORT/api/healthFor real-runtime verification (only when explicitly requested):
REAL="/Users/aden/Library/Application Support/Hive/users/<the-user-hash>" # find via: ls ~/Library/Application\ Support/Hive/users/
HIVE_HOME="$REAL" uv run hive serve --port 8903 --verbose 2>&1 > /tmp/hive_real.log &Verify Commercial extensions loaded appears in the startup log; that's the green light.
Step 2 — Snapshot the starting state
echo "=== colonies dir ==="; ls "$HIVE_HOME/colonies/"
echo "=== queens ==="; ls "$HIVE_HOME/agents/queens/" 2>&1 | head -10
echo "=== existing sessions ==="; curl -s http://127.0.0.1:$PORT/api/sessions | uv run python -m json.toolAnything session_* under colonies/ BEFORE you do anything is an existing phantom-folder issue.
Step 3 — Drive the failing flow
(a) Create a DM session (queen-only, no LLM-side actions)
RESP=$(curl -s -X POST http://127.0.0.1:$PORT/api/sessions -H 'Content-Type: application/json' \
-d '{"queen_name": "queen_technology"}')
SESSION_ID=$(echo "$RESP" | uv run python -c "import json,sys; print(json.load(sys.stdin)['session_id'])")
echo "$SESSION_ID"Invariant check: colonies/ should still be empty. If colonies/session_$SESSION_ID/ appeared, the phantom-folder bug is back. Suspect: ColonyRuntime.__init__ re-introduced an unconditional ensure_task_list(colony:<colony_id>) call.
(b) Fork DM into a colony — non-LLM path
This drives fork_session_into_colony without burning credits on a queen turn:
curl -s -X POST "http://127.0.0.1:$PORT/api/sessions/$SESSION_ID/colony-spawn" \
-H 'Content-Type: application/json' \
-d '{"colony_name":"debug_test","task":"debug"}' | uv run python -m json.toolExpected response shape: {colony_path, colony_name, queen_session_id, is_new, compaction_status}. No tracker_db_path field — if it's there, the cleanup regressed.
Then verify the on-disk binding:
uv run python -c "
import json
cfg = json.load(open('$HIVE_HOME/colonies/debug_test/worker.json'))
print(json.dumps(cfg.get('input_data'), indent=2))
"Expected:
{
"binding": {
"name": "debug_test",
"dir": "/.../colonies/debug_test",
"tracker_db": "/.../colonies/debug_test/data/tracker.db"
}
}If you see tracker_db_path or colony_id keys here, worker_definition.build_input_data or routes_execution.fork_session_into_colony is writing the legacy shape.
(c) LLM-driven path (talk to the queen)
Only use when (b) isn't enough. Send a tight, deterministic prompt:
curl -s -X POST "http://127.0.0.1:$PORT/api/sessions/$SESSION_ID/chat" \
-H 'Content-Type: application/json' \
-d '{"message": "Just call create_colony(colony_name=\"debug_e2e\", task=\"debug\"). Do nothing else."}'Then watch for the actual tool call (this is the right way to wait — no sleep chains):
# In Bash with run_in_background:true
until grep -qE "tool_call: create_colony|Forked queen to colony|colony fork failed" /tmp/hive_e2e/server.log; do sleep 5; doneWhen background command exits, grep the log for what actually happened:
grep -E "tool_call: create_colony|Forked queen to colony|colony fork failed|fork_session" /tmp/hive_e2e/server.log | tail -10(d) Activate the colony's queen session (post-fork, for tracker work)
fork_session_into_colony creates a separate colony-queen session on disk (returned as queen_session_id) that isn't loaded into the SessionManager until you ask. To talk to it:
COLONY_SESSION="<queen_session_id from fork response>"
COLONY_PATH="$HIVE_HOME/colonies/debug_e2e"
curl -s -X POST http://127.0.0.1:$PORT/api/sessions \
-H 'Content-Type: application/json' \
-d "{\"agent_path\":\"$COLONY_PATH\", \"queen_resume_from\":\"$COLONY_SESSION\", \"queen_name\":\"queen_technology\"}" \
| uv run python -m json.toolVerify queen_phase: "colony" in the response — that's when tracker tools are exposed. If she's still "independent", she lost her binding on resume; check queen_orchestrator.py:_queen_loop — it should call ColonyBinding.for_name(session.colony_name) and stamp the exec context.
(e) Drive the queen→worker tracker flow
curl -s -X POST "http://127.0.0.1:$PORT/api/sessions/$COLONY_SESSION/chat" \
-H 'Content-Type: application/json' \
-d '{"message": "Run tracker_sql to CREATE TABLE x (id INTEGER PRIMARY KEY, body TEXT). Then CREATE UNIQUE INDEX x_id ON x(id). Then tracker_register_writable(table=x, write_columns=[body], key_columns=[id]). Then INSERT INTO x VALUES (1, \"seed\"). Then run_parallel_workers with one task that calls tracker_upsert to set body=\"worker wrote\" on id=1, then report_to_parent."}'(Note: INTEGER PRIMARY KEY does NOT register as a unique index in SQLite's PRAGMA index_list — you need an explicit CREATE UNIQUE INDEX. This is pre-existing validator behavior in tracker_tools, not a refactor regression.)
Then wait for the marker line:
# Bash run_in_background:true
until grep -q "attached binding to" /tmp/hive_e2e/server.log; do sleep 3; done
grep "attached binding to" /tmp/hive_e2e/server.logExpected line: run_parallel_workers: attached binding to N spawn(s) (colony=debug_e2e). Missing → binding plumbing broken in queen_lifecycle_tools.py::run_parallel_workers.
Step 4 — Verify with sqlite3 directly
Cut out the HTTP layer and look at the raw tracker DB:
sqlite3 "$HIVE_HOME/colonies/debug_e2e/data/tracker.db" ".schema"
sqlite3 "$HIVE_HOME/colonies/debug_e2e/data/tracker.db" "SELECT * FROM _tracker_registry"
sqlite3 "$HIVE_HOME/colonies/debug_e2e/data/tracker.db" "SELECT * FROM x" # or whatever tableConfirm there is no second DB at a session-id-named path:
ls "$HIVE_HOME/colonies/" | grep "^session_" && echo "PHANTOM FOLDER PRESENT (BUG)" || echo "clean ✓"
find "$HIVE_HOME/colonies" -name "tracker.db" -type fThere should be exactly one tracker.db per real colony. Multiple means split-brain.
Step 5 — Test refusal behavior without an LLM
Cheap Python repro of "tools refuse without binding":
HIVE_HOME=/tmp/hive_e2e uv run python -c "
import asyncio
from framework.tools.tracker_tools import _make_tracker_sql_executor, _make_tracker_query_executor, _make_tracker_upsert_executor, _make_tracker_register_executor
async def main():
for name, mk in [
('tracker_sql', _make_tracker_sql_executor),
('tracker_query', _make_tracker_query_executor),
('tracker_upsert', _make_tracker_upsert_executor),
('tracker_register', _make_tracker_register_executor),
]:
r = await mk()({'sql': 'SELECT 1', 'table': 'x', 'row': {'a': 1}, 'write_columns': ['a'], 'key_columns': ['a']})
ok = r.get('success') is False and 'no colony context' in r.get('error', '')
print(f' {name}: {\"REFUSED ✓\" if ok else \"UNEXPECTED ✗\"} → {r}')
asyncio.run(main())
"Step 6 — Test queen↔worker tracker sharing (offline)
Exercises the entire binding flow in-process, no LLM cost:
HIVE_HOME=/tmp/hive_e2e uv run python -c "
import asyncio
from framework.host.colony_binding import ColonyBinding
from framework.host.tracker_db import ensure_tracker_db
from framework.loader.tool_registry import ToolRegistry
from framework.tools.tracker_tools import (
_make_tracker_sql_executor,
_make_tracker_register_executor,
_make_tracker_upsert_executor,
_make_tracker_query_executor,
)
async def main():
binding = ColonyBinding.for_name('offline_test')
ensure_tracker_db(binding.dir)
# Queen: DDL + register + seed
tok = ToolRegistry.set_execution_context(binding=binding)
try:
sql = _make_tracker_sql_executor()
await sql({'sql': 'CREATE TABLE t (k TEXT PRIMARY KEY, v TEXT)'})
await sql({'sql': 'CREATE UNIQUE INDEX t_k ON t(k)'})
await _make_tracker_register_executor()({'table': 't', 'write_columns': ['v'], 'key_columns': ['k']})
await sql({'sql': \"INSERT INTO t VALUES ('a', 'queen')\"})
finally:
ToolRegistry.reset_execution_context(tok)
# Worker: read + upsert from a SEPARATE exec context (binding comes via input_data)
binding_from_input = ColonyBinding.from_dict(binding.to_dict())
tok = ToolRegistry.set_execution_context(binding=binding_from_input)
try:
r = await _make_tracker_query_executor()({'sql': 'SELECT * FROM t'})
print('worker SELECT:', r.get('rows'))
assert r.get('rows') == [['a', 'queen']], 'split-brain: worker saw a different DB!'
await _make_tracker_upsert_executor()({'table': 't', 'row': {'k': 'a', 'v': 'worker'}})
finally:
ToolRegistry.reset_execution_context(tok)
# Queen: confirm worker's write is visible
tok = ToolRegistry.set_execution_context(binding=binding)
try:
r = await _make_tracker_sql_executor()({'sql': 'SELECT * FROM t'})
assert r.get('rows') == [['a', 'worker']], 'split-brain: queen lost worker write!'
print('queen SELECT:', r.get('rows'))
finally:
ToolRegistry.reset_execution_context(tok)
print('✓ queen+worker share the same tracker.db')
asyncio.run(main())
"If both asserts pass: binding plumbing intact. If either fails: the split-brain bug is back; check _resolve_tracker_db_path-equivalents weren't reintroduced in tracker_tools.py.
Step 7 — Shut down cleanly
pkill -f "hive serve --port $PORT"
sleep 2
ps aux | grep "hive serve" | grep -v grep || echo "(clean)"If you used HIVE_HOME=/tmp/hive_e2e, optionally rm -rf /tmp/hive_e2e when done.
If you used the real HIVE_HOME: do not auto-clean. Tell the user which colonies you created (debug_test, debug_e2e, etc.) and which orphan queen sessions exist under agents/queens/<queen_id>/sessions/, and let them decide.
Common failure patterns
| Symptom | First place to look |
colonies/session_<uuid>/ directory exists after a DM session | ColonyRuntime.__init__ — check the ensure_task_list call is guarded by if self._binding: |
Worker gets sqlite error: no such table even though queen registered it | Two tracker.db files exist; queen and worker have different binding paths. grep "attached binding" log — colony name should match the on-disk dir. |
| Tools refuse with "no colony context" mid-session | Queen lost her exec context. After fork_session_into_colony, ToolRegistry.set_execution_context(binding=...) must run in the queen's task (the tool path), or session.binding must be set so _queen_loop re-stamps on next iteration. |
worker.json input_data has tracker_db_path instead of binding | Either build_input_data regressed, or _patch_worker_configs didn't run on startup. Logs show tracker_db: patched N worker config(s) ... with fresh binding if the migration fired. |
run_parallel_workers returns "no colony binding in the execution context" | The queen's tool runs inside the queen's asyncio task. If you got there via HTTP /colony-spawn instead of the queen calling create_colony herself, her contextvar wasn't updated. Drive it through the queen's chat instead. |
Colony queen session opens in independent phase, missing tracker tools | session.colony_name was None when _queen_loop started. Check _load_worker_core / create_session path is setting both colony_name and binding. |
Key file index
When investigating, these are the load-bearing files:
- core/framework/host/colony_binding.py — the dataclass +
current_binding()accessor. - core/framework/host/colony_runtime.py —
ColonyRuntime(constructor invariants,stream_idvsbindingseparation). - core/framework/host/worker.py — worker reads
input_data.bindingand stamps it on its own exec context. - core/framework/host/tracker_db.py —
ensure_tracker_db,_patch_worker_configs(startup migration). - core/framework/tools/tracker_tools.py —
_require_binding()gate, executor implementations. - core/framework/tools/queen_lifecycle_tools.py —
run_parallel_workerspreflight,create_colonytool. - core/framework/server/routes_execution.py —
fork_session_into_colony,handle_colony_spawn. - core/framework/server/queen_orchestrator.py —
_queen_loopinitial exec-context stamp. - core/framework/server/session_manager.py —
Sessiondataclass,_start_queen,_load_worker_core. - core/framework/agents/queen/worker_definition.py —
build_input_dataserialization.
Anti-patterns
- ❌ Long leading
sleep Nto wait for an LLM turn → use Bashrun_in_background:truewithuntil grep -q ...; do sleep N; done. - ❌
catthe realsecrets//credentials//configuration.json→ the classifier blocks it and you don't need it. - ❌ Open-ended prompts like "please test the colony stuff for me" → the queen will spend 5+ turns researching. Always say exactly which tool to call with which args.
- ❌ Asserting success purely from the JSON response — always cross-check
sqlite3andls colonies/for invariants. - ❌ Running against the user's real Hive port (default 8787) if their desktop app is up → port-conflict crash. Use 8901+.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

