fix(codemap): fault-tolerant locator jumps — handle + path uncertainty from bot-written maps#244
Merged
Merged
Conversation
… 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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):<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). PluginINIT_SKELETON+ template seed regenerated byte-identical.@handlein a single-bot channel resolves to that bot (map is channel-local ⇒ intent unambiguous; the existence probe still gates). Multi-bot channels stay strict.2. Path root-basis uncertainty (
E_NOT_FOUNDforserver/src/api/workspace.rs— the bot's browse root and the repo root disagree):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).Tests
npm test74 passed ·npm run typecheckclean except pre-existingPdfViewer.tsx.🤖 Generated with Claude Code