a97764c5f7
MavenHelpGrammar keeps "как отменить напоминание" on SourceSelf, where the answer names the command Maven accepts, instead of leaking to search. PublicCurrentVersionGrammar anchors an explicitly current release on SourceWorld and declines first-person ownership. AmbiguousFragmentGrammar refuses filler plus an unresolved demonstrative rather than letting a statistical head invent context. ImplicitElapsedQueryGrammar reads Russian question word order in "давно я не тренировался" as recall; the declarative order stays a statement. ReminderCancellationReportGrammar keeps "я отменил напоминание" in the non-mutating chat lane. CommandProhibitionGrammar routes a direct negative command to a sentinel fn that can never collide with an enabled tool. ActHasEntityTarget stops a bare verb or a demonstrative-only tail from crossing into Nexus. Praxis attention now accepts "что там с X" for the four service names only. taskstatus separates command mood from result words so a first-person report cannot mutate the board. question.go exports the open-question and locative shapes the recall gate reads. --no-verify: master is the working branch this session by the owner's call. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
44 lines
1.5 KiB
Go
44 lines
1.5 KiB
Go
package router
|
|
|
|
import "github.com/kami/maven/internal/lexicon"
|
|
|
|
// ActHasEntityTarget reports whether an act names something that Nexus may be
|
|
// asked to resolve. A local zero-argument tool may still be valid; this gate is
|
|
// only about crossing into the ecosystem, where an entity is mandatory.
|
|
//
|
|
// A matched function carries its target in Args. An unmatched entity act is
|
|
// the Hexis discovery lane, so it must at least contain a verb plus a subject.
|
|
// A bare verb and a demonstrative-only tail carry no target evidence and stay
|
|
// local/clarify instead of sending free ambiguity to Nexus.
|
|
func ActHasEntityTarget(decision Decision) bool {
|
|
if decision.Intent != IntentAct {
|
|
return false
|
|
}
|
|
if decision.Slots.HasFn {
|
|
if len(decision.Slots.Args) > 0 {
|
|
return hasNamedEntityToken(decision.Slots.Args)
|
|
}
|
|
// A resident-model act may name the accepted verb and its target in
|
|
// Text while leaving Args empty. HasFn establishes that the first token
|
|
// is the operation; only a meaningful tail can establish the entity.
|
|
tokens := planTokens(decision.Slots.Text)
|
|
return len(tokens) > 1 && hasNamedEntityToken(tokens[1:])
|
|
}
|
|
tokens := planTokens(decision.Slots.Text)
|
|
if len(tokens) < 2 {
|
|
return false
|
|
}
|
|
return hasNamedEntityToken(tokens[1:])
|
|
}
|
|
|
|
func hasNamedEntityToken(tokens []string) bool {
|
|
references := lexicon.UnresolvedReferences()
|
|
for _, token := range tokens {
|
|
if lexicon.IsFillerParticle(token) || hasExactWord(references, token) {
|
|
continue
|
|
}
|
|
return true
|
|
}
|
|
return false
|
|
}
|