Skip to content

server(823): detect matching team skill after send, advise in claim payload - #843

Merged
xiechimon merged 1 commit into
mainfrom
hp/pacman/t-0160-823-skill
Oct 4, 2026
Merged

xiechimon merged 1 commit into
mainfrom
hp/pacman/t-0160-823-skill

Conversation

@xiechimon

@xiechimon xiechimon commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner

Implements #823 as corrected: detect the matching team skill after the user sends
(chief claim time = worker pre-start routing point), not while typing.
The reverted #834 ghost-hint direction stays reverted; the composer is untouched,
so there are no key conflicts with / or @.

What changes

  • New pure matcher packages/shared/src/skill-route.ts (first batch of two rules):
    explicit mention of an installed skill name (highest precision, wins), and
    reminder intent (time expression and reminder verb, both required).
    Anything else returns null = no hint.
  • buildChiefClaim appends an advisory-only section to chief.systemPrompt
    on user-triggered rounds only (wake/system rounds skipped, plus a wake-marker prefix guard in the matcher). step.prompt (user text) is never rewritten,
    so a misfire costs one ignorable paragraph and ordinary chat is never hijacked.
  • The skills inventory line in the chief system prompt now carries descriptions,
    so the agent can verify a candidate's fit itself via the skills tool.

Evidence

Live isolated-stack probe docs/verify/823/probe-chief-skill-route.mjs: 11/11 PASS
(result.json). Claim payload carries the routing section naming
morning-reminder with set_wake fallback while instruction stays verbatim;
ordinary chat gets no section; SQLite step.prompt matches verbatim; drawer
send lands in stream and claims with the section.

send flow
drawer sent state

Checks

  • pnpm lint: 0 errors; pnpm typecheck: all workspaces pass.
  • packages/shared: 262/262 (incl. 15 new matcher tests).
  • Server affected surface (chief, m4a-chief-loop, machine-wire,
    skills-local, skill-write, chief-skill-route): 124/124.
  • Web e2e:affected: token-gate.spec.ts 4/4 (automatic server-surface fallback).

Boundary (honest)

The stack has no live model: this PR proves detection fires and the agent context
is in place, not that a model actually invoked a skill. The "verify before use"
agent side is covered by unit/claim tests plus the standing convention line.
Merging is left to the coordinator.

…ayload

Route post-send user messages to matching team skills at chief claim
time (worker pre-start routing point): a deterministic matcher
(time-expression plus reminder-verb, explicit skill mention; first
batch of two rules) appends an advisory-only section to
chief.systemPrompt. step.prompt (user text) is never rewritten;
ordinary chat and wake rounds get no section, so a misfire costs one
ignorable paragraph. The skills inventory in the system prompt now
carries descriptions so the agent can verify fit itself. No composer
changes: no key conflicts with quoted slash commands or mentions.

Evidence: docs/verify/823/ (live-stack probe 11/11 plus send-flow GIF).

closes #823
@xiechimon
xiechimon merged commit 750cff4 into main Oct 4, 2026
9 of 11 checks passed
@xiechimon
xiechimon deleted the hp/pacman/t-0160-823-skill branch October 4, 2026 14:11
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