Skip to content

feat(routing): weigh what you use and where you already are - #82

Merged
tanglearncode merged 1 commit into
mainfrom
routing-priors
Aug 8, 2026
Merged

tanglearncode merged 1 commit into
mainfrom
routing-priors

Conversation

@tanglearncode

Copy link
Copy Markdown
Contributor

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.

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.
@tanglearncode
tanglearncode merged commit feb7643 into main Aug 8, 2026
11 checks passed
@tanglearncode tanglearncode mentioned this pull request Aug 9, 2026
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