feat(routing): weigh what you use and where you already are - #82
Merged
Merged
Conversation
Routing has judged a request purely on words. Two things about the session itself are worth a little weight beside them. A context you keep coming back to gets a small lift, decaying over about two weeks — the idea a browser address bar runs on, and the same problem: many items, a short vague request, one chance to be right. It saturates, so fifty uses cannot let a context run away with the ranking. The context already connected gets a head start too, because most requests continue the last one and leaving should need more evidence than staying. That is hysteresis, and it needs no new machinery: inflating the incumbent means a challenger has to clear it by a real margin, and one that only just clears it lands inside the near-tie rule and becomes a question rather than a switch. Both stay hints. Neither can outrank a request that plainly names another context, and both are capped well below what the words decide. Nothing ties a context to a folder or a repository, deliberately. A context is not about the directory someone happened to be sitting in, and anchoring it to one would make the same shared context behave differently for teammates with different layouts. These two signals read only what this machine has done and write nothing to a bundle, so a context stays exactly as portable as it was.
Merged
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.
Routing has judged a request purely on words. Two things about the session itself deserve a little weight beside them.
What this adds
A context you keep coming back to gets a small lift, decaying over about two weeks. It is the idea a browser address bar runs on, solving the same problem: many items, a short vague request, one chance to be right. It saturates, so fifty uses cannot let a context run away with the ranking.
The context you are already on gets a head start, because most requests continue the last one and leaving should need more evidence than staying.
That second one is hysteresis, and it needed no new machinery. Inflating the incumbent's score means a challenger has to clear it by a real margin — and a challenger that only just clears it lands inside the near-tie rule from #76 and becomes a question rather than a switch.
Both stay hints
Neither can outrank a request that plainly names another context, and both are capped well below what the words decide. There is a test for exactly that: connected to one context, a request naming the other by its own words still wins.
What is deliberately absent
Nothing ties a context to a folder or a repository. An earlier draft of this work would have matched the directory you are sitting in against a context's stored words. It is out, on the reasoning that a context is not about a directory — an incident context least of all — and anchoring one to a folder would make the same shared context behave differently for teammates with different layouts. Portability wins.
The two signals that remain read only what this machine has already recorded and write nothing to a bundle, so a context stays exactly as portable as it was. Two people will reach it in a slightly different order, which is the honest answer when one of them lives in it and the other has never opened it.
Tests
13 new: the decay curve, the saturation cap, crediting only the context actually chosen, unreadable log entries, a state with no history, and the head start going to the connected context alone.
The four on a real shortlist are the ones that matter — two identically-described contexts where nothing but history can separate them. With no history the tie breaks by id; with history the used one leads; connected, the incumbent holds a tie; and named by the request, the other one takes it anyway.
Diff coverage: 98 changed lines across all five hosts, 0 uncovered. Full suite 436 passing.