Repository navigation
hints: a host named by its tail matches; each hint line says why; route a decision as a heads-up (0186) - #1035
Merged
Merged
Conversation
…te a decision as a heads-up (0186)
The session hint stopped naming the session on a fleet's GPU alerts. Each
alert names its host in full ("gpuhost-4090-7-12"). The focus summarizer is
told never to quote hostnames, so the session on that host's fault wrote "node
-7-12": a bare number pair, which is no term. An alert named the session only
while something else it carried (a rack name, a tool name) was also in the
session's focus, and once the focus moved on to the next fault, no alert named
it. Replayed through MatchHistory over the stored messages and focus rows, the
base code reproduces the observed hint counts exactly, and this change names
that session on most of the alerts that had an empty hint.
1. Tail keys (internal/focus/terms.go). A host whose last two hyphen parts
are numbers also carries its tail ("~7-12"). A history row's bare pair
("-7-12", "52-110") carries it too. A message's bare pair stays no term, so
a sender cannot name a session by writing numbers. A tail is at least four
characters long. A host and its own tail count once.
2. Every hint line says why. focus.Match.Keys gives the message's identifiers
the focus carries, in the message's spelling ("7-12 (of
gpuhost-4090-7-12)"). The hint renders them as "its focus mentions …",
fenced, at most three, cut to 240 bytes. The repo line reads "listed by its
repo <repo>". A block that keeps only its first session over the byte cap
now still says how many it left out.
3. A heads-up route of a message that can be answered. A two-way route's
answer becomes the reply, and for an allowlisted sender it is sent at once.
So a chief handed a DM that asks the owner to decide raised an ask and
never routed. route_to_session now takes heads_up: true, with message_id
only. It makes a one-way route marked heads_up (migration 0186, CHECK NOT
heads_up OR one_way). Every one-way rule holds: the answer goes to the
chief, never as a draft. The paste says "A HEADS-UP, NOT A REQUEST TO
REPLY". The answer, the hand-back and the owner's push say the reply is
still the chief's to draft once the owner decides. A timed-out heads-up
comes back with reply_draft offered.
The hint preface, the replyable routing sentence and the chief's
instructions give the rule: a session whose focus mentions a specific
identifier of the message, or one listed by its pull request, is on it, so
route the message to it. If the message also asks the owner to decide,
route it with heads_up and raise the ask too. This is guidance, not a
route muster makes itself; docs/plugins.md says why the automatic route
was not taken.
Tests: TestAHostTheFocusNamesByItsTailGetsAHint and
TestABareNumberPairInAMessageNamesNothing (its control) are red at the base
and green here; TestAHostNamedInFullOnBothSidesIsOneTerm is an invariant guard
at the base. TestAHostCarriesItsNumberedTail, the hint pins, and the heads-up
pg tests (TestAHeadsUpOfAReplyableMessageNeverAnswersTheSender,
TestAHeadsUpIsOnlyForAMessage, red at the base;
TestATimedOutHeadsUpComesBackAsAMessageToAnswer). A 14-mutant sweep found
every mutant killed.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
ZacxDev
force-pushed
the
hints-why-and-heads-up
branch
from
November 24, 2026 02:16
3f7c28b to
9481093
Compare
…-up is sticky, tails tightened, bound pins
1. A relayed heads-up is not the chief acting on the message (retry.go
liveRoute: a relayed route counts only when it is not heads_up). Its relay
only told the chief, so the "not acted on" ask is raised and one already
raised stays open until the chief drafts, settles or routes again. I took
this option, a predicate change, over muster raising the ask itself on
every heads-up: the predicate is the one every reader shares (the sweep,
the closer, Retry).
2. A heads-up is sticky. The chief's later route of a message that had a
heads-up route is a heads-up too. It is coerced, not refused, so the
hand-back's re-route still works, and route_to_session's next says so. A
heads-up's hand-back offers reply_draft (once the owner has decided) and a
re-route that says it stays a heads-up. The owner's own door is not
coerced.
3. Tail keys, tightened:
- A history row's FULL host name carries no tail (a full name matches in
full), so another host with the same tail names nothing.
- A row's pair that reads as a date carries none: a year before it
(2000-11-23), or a bare calendar month and day (11-23, 7-12; February up
to 29). The fleet's -2-31 still counts, since there is no 31 February.
- A message token mints a tail only when it is host-shaped: a first part
with two letters, a numeric part, then the pair. a-7-12, gpu-x-7-12,
ab-52-23 and a-4090-52-23 mint none.
The docs and comments now say it is a structural floor, not a defence.
4. Exact pins for MaxHintKeys (four short keys, three shown) and for the
"(1 more not shown)" line when the first session is alone over the cap.
Docs and comments: the why line shows normalised, lower-cased keys; 0186's
header quotes the paste's real words and names the two new readers;
routed_card's OneWay comment covers a heads-up. 0186's CHECK is added NOT
VALID, then VALIDATEd.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
ZacxDev
force-pushed
the
hints-why-and-heads-up
branch
from
November 24, 2026 02:16
9481093 to
0018187
Compare
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.
Why
Plugin messages from a chat plugin had stopped reaching the sessions they were about without being told to. Two separate causes:
1. Empty hints on fleet-alert posts. A fleet alert names its host in full (
gpuhost-4090-7-12). The focus summarizer is told never to quote hostnames (SummaryInstructions), so the session working on that host's fault writesnode -7-12. That bare number pair was no term, so the alert shared no identifier with the session. It was matched only while something else the alert carried (a rack name, a tool name) also happened to be in the session's focus, and that stopped once the focus moved on to the next fault.The step that should have matched is
distinctiveTermson both sides offocus.MatchHistory. I replayedMatchHistory(real SQL) over the stored messages and focus rows, each message against the rows written before it. The base code reproduces the observed per-day hint counts exactly. With this change, the session on the alerts gets named on most of the alert posts whose hint was empty.2. A correct hint and no route. A hint line showed only the session's title, which names its larger job. A chief handed a DM that named exactly that session's service and version raised an ask and never routed it. Routing it would also have been unsafe: a two-way route's answer becomes the reply, and for an allowlisted sender it is sent at once, so the decision would have been answered before the owner made it.
What
internal/focus/terms.go). A host whose last two hyphen-separated parts are numbers also carries its tail (~7-12). A history row's bare pair (-7-12,52-110) carries it too. A message's bare pair does not, so a sender cannot name a session by writing numbers. A tail is at least four characters long, and a host and its own tail count once.focus.Match.Keysis wired toSessionHint.Matchedand rendered asits focus mentions 7-12 (of gpuhost-4090-7-12), v0.0.42. It is fenced, holds at most 3 identifiers, and is cut to 240 bytes. The repo line now readslisted by its repo <repo>. A block that keeps only its first session over the byte cap now still says how many it left out.0186,session_routes.heads_up, withCHECK (NOT heads_up OR one_way)).route_to_session(message_id, subject, heads_up: true)sends a replyable message one-way:next, the answer note and preface, the hand-back and the push all say the reply is still the chief's to draft once the owner has decided. A timed-out heads-up comes back withreply_draftoffered.heads_upwithtask_idortextis refused as bad arguments. On ano_replymessage it changes nothing.RoutingSentenceand both chief-instruction variants carry the same rule. A session whose focus mentions a specific identifier of the message (a host, a version, a pull request, a file), or one listed by its pull request, is on it: route the message to it. If the message also asks the owner to decide, route it withheads_up: trueand raise the ask too. The supervisor-prompt digests are re-recorded; I read the diff and it adds no private detail.Prose, not a deterministic auto-route. muster does not route a heads-up copy by itself on a match, for three reasons:
v1, a domain name) matched several unrelated sessions.What muster now does structurally is say why each session is listed and offer a heads-up that cannot answer the sender. docs/plugins.md explains this.
Tests
TestAHostTheFocusNamesByItsTailGetsAHint(pg; a realistic fleet-alert body)TestABareNumberPairInAMessageNamesNothing(its control: the full host names the session)TestAHostNamedInFullOnBothSidesIsOneTermTestAHostCarriesItsNumberedTail(unit)rowTermsdoes not exist)TestAHeadsUpOfAReplyableMessageNeverAnswersTheSender(pg)heads_upis ignored and the route is two-wayTestAHeadsUpIsOnlyForAMessage(pg)TestATimedOutHeadsUpComesBackAsAMessageToAnswer(pg)hints_test,hints_meta_test,hints_pr_test,render_test), plus aMatchedseam assertion inTestTheHintListsOnlyTheLiveSessionOnTheJobThe pg tests at base were run with their
Keysassertions removed, since that field does not exist there.Mutation sweep: 14 of 14 killed. Mutants:
no_replymessage, hand-back as plain one-way, no argument checkMatchedwiring, paste not heads-upLocal runs:
internal/focusandinternal/agentspec: green.internal/plugins: green exceptTestSearchDraftCardsTextIsOwnIdIsWhatTheCallerCanOpen, which also fails on origin/main against the same local database.internal/api: the route, hint and one-way subsets are green. The full package timed out at 30 minutes locally, with failures in chief, opencode and budget fixtures (the agent labelled chief is not user 1's chief) that look like state in my reused database. CI on a fresh database is the authority.Audit round 1 (no 🔴; the 🟡 and 🟢 findings fixed)
A relayed heads-up still gets the "not acted on" ask.
liveRouteinretry.gonow counts a relayed route only when it is not a heads-up. I chose this deterministic predicate change over muster raising an ask itself on every heads-up. It is the one predicate the sweep, the closer and Retry all share.A heads-up is sticky. The chief's later route of a message that had a heads-up route is coerced to a heads-up, and both
route_to_session'snextand the hand-back say so. A heads-up's hand-back now offersreply_draftonce the owner decides, plus a re-route that is noted to stay a heads-up. The owner's ownplugin_message_routeis not coerced.Tighter tail keys:
2000-11-23), or a bare calendar month and day (11-23,7-12; February up to 29).a-7-12,gpu-x-7-12,ab-52-23anda-4090-52-23mint none.The date conflict, resolved: the fleet's real short form
-2-31is not a calendar date (there is no 31 February), so it still counts.52-23,52-110and52-4are not month-day pairs either. The cost: a host whose tail is a valid month and day (…-7-12) matches only when the focus writes more of its name (4090-7-12, or in full). The docs now call this a structural floor, not a defence.Exact pins for
MaxHintKeys(4 keys, 3 shown) and for(1 more not shown)when the first session is alone over the cap.Doc and comment fixes: the why line's keys are normalised and lower-cased; 0186's header quotes the paste's real wording and names the two new readers;
routed_card.go'sOneWaycomment covers a heads-up. 0186's CHECK is nowNOT VALIDfollowed byVALIDATE.Production replay, re-run. Every chat-plugin message since the 17th, through the real
MatchHistorySQL: non-empty hints / the alerts session named, per day.The tightening removed no false positives on this data. Every tail the first head matched was
2-31,20-2,52-4,52-5,52-23,52-50,52-53or52-110, of the message's own host; none is a date and none came from a row's full host. The focus rows do hold ISO dates (23 rows) and other full hostnames, but none lined up with a message's host tail inside the window. The same instrument does register change: from base to the first head, 26 more messages get a non-empty hint (the per-day increases summed).Matrix for this round. Each mutant below undoes one fix on the current tree; all were killed:
TestARelayedHeadsUpStillRaisesTheNotActedOnAskTestAHeadsUpIsStickyTestATimedOutHeadsUpComesBackAsAMessageToAnswerTestAHostTheFocusNamesByItsTailGetsAHint,TestAHostCarriesItsNumberedTailTestAHostCarriesItsNumberedTailTestTheWhyLineNamesAtMostThreeKeysTestAFirstSessionAloneOverTheCapStillSaysWhatWasLeftOutOne guard is unreachable and reported as such, not as coverage: the host branch's
len(parts) < 3bound. Only tokens with a letter reach that branch, so the bound only prevents an index panic.Check live after it ships
its focus mentions <tail> (of <host>).route_to_sessionwithheads_up: trueand also raises an attention ask. Thesession_routesrow hasone_wayandheads_upset, no draft appears, and the owner's push reads "(a heads-up: the reply is still yours)".SELECT count(*) FROM session_routes WHERE heads_upgrows, androuted_totraffic for the chat plugin resumes.🤖 Generated with Claude Code