Skip to content

fix(codemap): fault-tolerant locator jumps — handle + path uncertainty from bot-written maps#244

Merged
haowei2000 merged 2 commits into
developfrom
claude/workbench-codemap-design-7f752f
Jul 17, 2026
Merged

fix(codemap): fault-tolerant locator jumps — handle + path uncertainty from bot-written maps#244
haowei2000 merged 2 commits into
developfrom
claude/workbench-codemap-design-7f752f

Conversation

@haowei2000

@haowei2000 haowei2000 commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

What

Two field reports from the first real bot-maintained map, one theme: bot-written locators carry uncertainty; the jump path must absorb it instead of dead-ending. Mirrors the chat ref-jump philosophy (resolveAndOpenRef): probe layer by layer, only commit to a jump the server confirms, degrade to a clear actionable error.

1. Handle uncertainty (No bot named "@backend" — the agent invented a handle; the dispatch prompt never tells a bot its own mention name):

  • map.yaml header guide pins <your-handle> to a discoverable source (the exact name this channel @-mentions you by), forbids guessing/copying from examples, and offers the honest out (omit loc rather than invent one). Plugin INIT_SKELETON + template seed regenerated byte-identical.
  • Resolver fallback: an unmatched @handle in a single-bot channel resolves to that bot (map is channel-local ⇒ intent unambiguous; the existence probe still gates). Multi-bot channels stay strict.
  • The no-match error lists the channel's actual bot names.

2. Path root-basis uncertainty (E_NOT_FOUND for server/src/api/workspace.rs — the bot's browse root and the repo root disagree):

  • New wsLocate.locateWorkspaceFile: exact path → strip a redundant leading repo dir (root IS the repo) → prefix each top-level dir of the browse root (root is the repo's PARENT; one tree listing + ≤12 probes, never a workspace scan).
  • Only when all layers miss: an error that tells the human to have the bot refresh its map. Non-NOT_FOUND failures (offline connector) keep their own messages.

Tests

npm test 74 passed · npm run typecheck clean except pre-existing PdfViewer.tsx.

🤖 Generated with Claude Code

haowei2000 and others added 2 commits July 17, 2026 10:26
… fallback

Field report: a bot wrote loc: cheers:ws/@backend/… — a handle it
guessed (the dispatch prompt never tells a bot its own mention name;
its only reliable source is the name people @-mention it by). Three
layers:

- map.yaml header guide: <your-handle> = the EXACT name this channel
  mentions you by; never guess, never copy from an example; omit loc
  rather than invent one (plugin INIT_SKELETON + template seed
  regenerated byte-identical).
- resolver fallback: an unmatched @handle in a single-bot channel
  resolves to that bot — the map is channel-local so the intent is
  unambiguous, and the existence probe still gates the jump. Existing
  wrong-handle maps become navigable immediately.
- the no-match error now lists the channel's actual bot names, so a
  human can tell the bot what to fix.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ections

Field report: a bot-written loc (server/src/api/workspace.rs) hit
E_NOT_FOUND because the bot's browse root and the repo root disagree —
the class of uncertainty every bot-written path carries. The ws jump
now mirrors the chat ref-jump philosophy (probe layer by layer, only
commit to a jump the server confirms):

- exact path first;
- strip a redundant leading repo dir (root IS the repo);
- prefix each top-level dir of the browse root (root is the repo's
  PARENT), one tree listing + <=12 probes, never a workspace scan;
- only when all layers miss: a clear error telling the human to have
  the bot refresh its map.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@haowei2000 haowei2000 changed the title fix(codemap): pin the ws handle source in the agent guide + single-bot resolver fallback fix(codemap): fault-tolerant locator jumps — handle + path uncertainty from bot-written maps Jul 17, 2026
@haowei2000
haowei2000 merged commit 3e8e4a4 into develop Jul 17, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant