Wire plugin slash aliases and the intent declaration surface (G2-2) #122

Merged
weichen merged 2 commits from feature/g2-2-slash-intents into main 2026-10-10 00:20:13 +00:00
Owner

Why: plan G2-2 requires plugin commands reachable via slash aliases through the same bus and audit envelope (EXT-10②) and a natural-language routing entry. The lib carries a validated Slash field (Agent-Command PR #6, pin 4f583ca); the bus binds plugin-spec aliases into the shared slash table; intents are declared via extension.Registry.AddIntent and matched deterministically (normalized containment, longest phrase first); the system.intent builtin (/intent) dispatches matched intents through the bus at the chat entrance and returns candidates on miss.

Evidence: TestPluginSlashAliasBindsAndDispatches (bind + normalized resolve + slash/button same handler, committed receipts); TestIntentDeclareMatchRoute (validate/miss/normalized hit/bus dispatch/longest-phrase priority); server dual-entry pair registered; full go test ./... 32/32 green; CI gates.

Impact: cmdbus slash binding + IntentStore; extension AddIntent/IntentSpec (SurfaceVersion 2.7.0-experimental, surface.txt updated); pluginRegistry.AddIntent; builtin system.intent; command-pairs fixture.

Refs: plan G2-2 (line 366); EXT-10②; lib PR #6.

Why: plan G2-2 requires plugin commands reachable via slash aliases through the same bus and audit envelope (EXT-10②) and a natural-language routing entry. The lib carries a validated Slash field (Agent-Command PR #6, pin 4f583ca); the bus binds plugin-spec aliases into the shared slash table; intents are declared via extension.Registry.AddIntent and matched deterministically (normalized containment, longest phrase first); the system.intent builtin (/intent) dispatches matched intents through the bus at the chat entrance and returns candidates on miss. Evidence: TestPluginSlashAliasBindsAndDispatches (bind + normalized resolve + slash/button same handler, committed receipts); TestIntentDeclareMatchRoute (validate/miss/normalized hit/bus dispatch/longest-phrase priority); server dual-entry pair registered; full go test ./... 32/32 green; CI gates. Impact: cmdbus slash binding + IntentStore; extension AddIntent/IntentSpec (SurfaceVersion 2.7.0-experimental, surface.txt updated); pluginRegistry.AddIntent; builtin system.intent; command-pairs fixture. Refs: plan G2-2 (line 366); EXT-10②; lib PR #6.
weichen added 2 commits 2026-10-10 00:18:47 +00:00
Why: plan G2-2 requires plugin commands reachable via slash aliases
through the same bus and audit envelope (EXT-10②), and a natural-
language routing entry so '帮我写项目建议书' can reach the compile
flow. The agent-command lib now carries a validated Slash field
(lib PR #6, pin bumped to 4f583ca); the bus binds plugin-spec aliases
into the same slash table; intents are declared via the extension
registry and routed deterministically (normalized containment, longest
phrase first) to commands through the bus — the system.intent builtin
(/intent) is the chat-entrance dispatch point with a candidate list on
miss.

Evidence: TestPluginSlashAliasBindsAndDispatches — alias binds, case/
whitespace-normalized resolution, slash and button entrances hit the
same command handler with committed receipts; TestIntentDeclareMatch
Route — declare/validate, miss on unrelated text, normalized hit,
bus-dispatch through the chat entrance, longest-phrase priority;
server suite green with the dual-entry pair registered; full go test
./... 31/31 packages green.

Impact: cmdbus plugin-spec slash binding + IntentStore; extension
Registry.AddIntent + IntentSpec (SurfaceVersion 2.7.0-experimental);
pluginRegistry.AddIntent wires plugin-declared intents; server
builtin system.intent; command-pairs fixture extended.

Refs: plan G2-2 (line 366); EXT-10②; lib PR #6 (4f583ca).
Update the extension surface snapshot for AddIntent and IntentSpec
ci / vet-and-test (pull_request) Successful in 40s
9c4edc4dc9
Why: TestSurfaceSnapshot compares the exported-symbol list verbatim;
Registry.AddIntent and IntentSpec (SurfaceVersion 2.7.0-experimental)
are intentional additions.

Evidence: pkg/extension suite green; full go test ./... 32/32 packages
green.

Impact: surface.txt only.
weichen merged commit 9a531a61d9 into main 2026-10-10 00:20:13 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: weichen/Agent-System-Backend#122