Summary
Prompt templates emit 33 repo-relative .hive-manager/{session_id}/… paths. Session artifacts (plan, tools,
coordination log, prompts) live in the main checkout at <project_path>/.hive-manager/{session_id}/, but almost
every agent runs with its CWD set to a worktree. A relative path therefore resolves against the wrong root.
This is the sibling of #280 (which covers .ai-docs/). It was found while planning #280 and deliberately kept out of
that issue's scope.
The correct pattern already exists in the same file
build_queen_master_prompt resolves the session root and emits absolute paths:
// src-tauri/src/session/controller.rs:6313-6316
let session_root = Self::session_root_path(project_path, session_id);
let plan_path = Self::prompt_path(&session_root.join("plan.md"));
let tools_dir = Self::prompt_path(&session_root.join("tools"));
let coordination_log_path = Self::prompt_path(&session_root.join("coordination.log"));
Five builders already bind session_root: :5027, :5273, :6313, :6652, :7118.
The clearest defect: build_swarm_queen_prompt binds session_root at :7118 and then still prints relative
paths at :7175-7176 and :7194. The value is in scope and unused.
Other relative sites include :4856, :4879, :4917, :4963, :4977, :5105-5106, :5147, :5156, :5163,
:5546, :5616, :5674, :5879, :6145, :7033, :7049, :7216, :7251, :7296, :7319.
This is triage, not find-replace
Not all 33 are wrong. At least one is correctly worktree-relative:
controller.rs:7072
Each worker's own task file path inside its worktree is `.hive-manager/tasks/worker-N-task.md`.
That path is worktree-local and must stay relative. Any fix must first classify every one of the 33 as
main-checkout (must become absolute) or worktree-local (correctly relative). That classification has not been
done — sizing this issue is the first task, not an assumption.
Two more sites need a judgement call rather than a mechanical fix:
:6864 — .ai-docs/learnings.jsonl appears as a prohibition, and .hive-manager/{session_id}/learnings.pending.jsonl
as a fallback write target "in this workspace". Which root that means is exactly the ambiguity this issue is about.
:4237, :4251 — peer handoff files (milestone-ready.json, qa-verdict.json) that agents wait on. If the
reader and writer disagree about the root, the wait never resolves.
Acceptance criteria
Related
Provenance
Found during Master Planner reconnaissance for the #276-#283 wave (session f7ef70f5). Operator decision on
2026-09-06 was to file rather than fold into the #280 task, because the class is only partly understood and a
half-applied fix is worse than none.
Summary
Prompt templates emit 33 repo-relative
.hive-manager/{session_id}/…paths. Session artifacts (plan, tools,coordination log, prompts) live in the main checkout at
<project_path>/.hive-manager/{session_id}/, but almostevery agent runs with its CWD set to a worktree. A relative path therefore resolves against the wrong root.
This is the sibling of #280 (which covers
.ai-docs/). It was found while planning #280 and deliberately kept out ofthat issue's scope.
The correct pattern already exists in the same file
build_queen_master_promptresolves the session root and emits absolute paths:Five builders already bind
session_root::5027,:5273,:6313,:6652,:7118.The clearest defect:
build_swarm_queen_promptbindssession_rootat:7118and then still prints relativepaths at
:7175-7176and:7194. The value is in scope and unused.Other relative sites include
:4856,:4879,:4917,:4963,:4977,:5105-5106,:5147,:5156,:5163,:5546,:5616,:5674,:5879,:6145,:7033,:7049,:7216,:7251,:7296,:7319.This is triage, not find-replace
Not all 33 are wrong. At least one is correctly worktree-relative:
That path is worktree-local and must stay relative. Any fix must first classify every one of the 33 as
main-checkout (must become absolute) or worktree-local (correctly relative). That classification has not been
done — sizing this issue is the first task, not an assumption.
Two more sites need a judgement call rather than a mechanical fix:
:6864—.ai-docs/learnings.jsonlappears as a prohibition, and.hive-manager/{session_id}/learnings.pending.jsonlas a fallback write target "in this workspace". Which root that means is exactly the ambiguity this issue is about.
:4237,:4251— peer handoff files (milestone-ready.json,qa-verdict.json) that agents wait on. If thereader and writer disagree about the root, the wait never resolves.
Acceptance criteria
session_root_path+prompt_pathpattern at:6313:7072) remain relative, deliberately and with a comment saying whybuild_swarm_queen_promptuses thesession_rootit already binds at:7118:4237/:4251are confirmed consistent between the waiting reader and the writerRelated
.ai-docs/; fixed separately so its byte-exact prompt golden stays legiblebuild_debate_master_planner_prompt(:4928) has no knowledge-intake block at all. Adding one is a feature,not a regression fix, and is deliberately excluded here.
Provenance
Found during Master Planner reconnaissance for the #276-#283 wave (session
f7ef70f5). Operator decision on2026-09-06 was to file rather than fold into the #280 task, because the class is only partly understood and a
half-applied fix is worse than none.