router/semantic: slice 21 deterministic execution-frame guard engine, fixtures, runner and emit step
The guard answers one question — may this utterance become an executable action — as a three-way policy gate (permissive / blocked / ambiguous) and never decides what the utterance is. Rules are the encoding of the measured slice-20 dev-pool discriminators: 126 capability-question rows are 42/42/42 addressed / bare-ability / bare-future; 127 bare можешь+пожалуйста rows are 100% action; can-you-please is 100% action. Reuses the shipped prohibition parser, morph finiteness and lexicon fillers; reason vocabulary is closed. Slice 21 (task/725, brief after the accepted slice 20).
This commit is contained in:
@@ -0,0 +1,95 @@
|
||||
package main
|
||||
|
||||
// Fixture is one brief-specified utterance and the eligibility it must earn.
|
||||
// Fixtures are EXACTLY the slice-21 brief examples plus the corpus-verified
|
||||
// structural discriminators. They are eval material, not corpus additions:
|
||||
// nothing here is inserted into any pool file (brief §2, §18).
|
||||
type Fixture struct {
|
||||
Utterance string
|
||||
Want Eligibility
|
||||
Family string
|
||||
Note string
|
||||
}
|
||||
|
||||
// Fixtures covers every family the brief's §15 list exercises, including the
|
||||
// four that have no dev-pool rows at all (negation, reported_speech,
|
||||
// quotation, hypothetical):
|
||||
//
|
||||
// direct imperative already plural in dev; fixtures pin the canonical
|
||||
// cases together with the politeness-negative modal.
|
||||
// polite request polite imperative + bare "можешь …, пожалуйста".
|
||||
// modal request "можно …", English "can you …, please".
|
||||
// first-person request "я хочу …", "мне нужно …", "надо …".
|
||||
// reordered target "свет выключи, пожалуйста" (target-first command).
|
||||
// capability question ты/умеешь/сможешь/способна + "… ли" permission.
|
||||
// ordinary question "что запущено" — no execution pressure.
|
||||
// negation "не выключай свет" (parser-covered); advisory "не
|
||||
// надо выключать свет".
|
||||
// reported speech past/third-person report verbs over a command.
|
||||
// quotation quoted command, with and without a reporting frame.
|
||||
// hypothetical если-scopes that are not real condition→command.
|
||||
var Fixtures = []Fixture{
|
||||
// negation — direct commands the prosecutor forbids
|
||||
{"не выключай свет", Blocked, "negation", "direct prohibition"},
|
||||
{"не перезапускай сервер", Blocked, "negation", "direct prohibition"},
|
||||
{"не включай nginx", Blocked, "negation", "direct prohibition"},
|
||||
{"не надо выключать свет", Blocked, "negation", "advisory negative"},
|
||||
{"не стоит перезапускать nginx", Blocked, "negation", "advisory negative"},
|
||||
{"не забудь напомнить про свет", Permissive, "negation", "prohibition-parser reminder exemption"},
|
||||
|
||||
// reported speech — reports an order, does not issue one
|
||||
{"он сказал выключить свет", Blocked, "reported_speech", "past report verb + infinitive"},
|
||||
{"она попросила перезапустить nginx", Blocked, "reported_speech", "past report verb + infinitive"},
|
||||
{"мне сказали включить свет", Blocked, "reported_speech", "passive report + infinitive"},
|
||||
{"он написал: «перезапусти nginx»", Blocked, "reported_speech", "report verb + quoted imperative"},
|
||||
{"скажи мне, что он сказал про свет", Permissive, "reported_speech", "request to report, no commanded clause"},
|
||||
{"расскажи про свет", Permissive, "reported_speech", "narrative request, not a reported order"},
|
||||
|
||||
// quotation — quoted text is referenced, not issued
|
||||
{"фраза «выключи свет»", Blocked, "quotation", "reporting noun + quoted imperative"},
|
||||
{"он сказал «выключи свет»", Blocked, "quotation", "report verb + quoted imperative"},
|
||||
{"«выключи свет»", Ambiguous, "quotation", "bare quoted command, no frame"},
|
||||
{"выключи свет", Permissive, "quotation", "unquoted imperative is a live command"},
|
||||
|
||||
// hypothetical
|
||||
{"если выключить свет...", Blocked, "hypothetical", "conditional + infinitive + ellipsis"},
|
||||
{"если бы перезапустить nginx...", Blocked, "hypothetical", "conditional + бы + infinitive"},
|
||||
{"что будет если выключить свет", Blocked, "hypothetical", "question-scoped conditional"},
|
||||
{"если будет дождь, выключи полив", Permissive, "hypothetical", "real condition → imperative"},
|
||||
{"выключи свет если будет дождь", Permissive, "hypothetical", "imperative → real condition"},
|
||||
|
||||
// capability question — blocked even polite
|
||||
{"ты можешь выключить свет?", Blocked, "capability_question", "ты + можешь + ?"},
|
||||
{"ты можешь выключить свет", Blocked, "capability_question", "ты + можешь, no ?"},
|
||||
{"ты можешь выключить свет, пожалуйста", Blocked, "capability_question", "ты + можешь + politeness (42/42 non-action)"},
|
||||
{"умеешь ли ты выключить свет", Blocked, "capability_question", "ability form + ли"},
|
||||
{"сможешь открыть окно, пожалуйста", Blocked, "capability_question", "bare future + politeness (7/7 non-action)"},
|
||||
{"ты способна выключить свет", Blocked, "capability_question", "ты + способна"},
|
||||
{"могу ли я выключить свет", Blocked, "capability_question", "first-person can + ли"},
|
||||
{"можно ли выключить свет", Blocked, "capability_question", "можно + ли permission question"},
|
||||
{"ты выключишь свет?", Ambiguous, "capability_question", "future tense + ? without can-form"},
|
||||
|
||||
// modal / polite requests — permissive
|
||||
{"можешь выключить свет, пожалуйста", Permissive, "modal_request", "bare можешь + politeness (127/127 action)"},
|
||||
{"пожалуйста, выключи свет", Permissive, "polite_request", "leading politeness + imperative"},
|
||||
{"выключи свет, пожалуйста", Permissive, "polite_request", "imperative + trailing politeness"},
|
||||
{"выключи свет", Permissive, "direct_imperative", "plain imperative"},
|
||||
{"свет выключи, пожалуйста", Permissive, "reordered_target", "target-first imperative"},
|
||||
{"can you выключи свет, please", Permissive, "modal_request", "English frame + Russian imperative + please (96/96 action)"},
|
||||
{"can you выключи свет", Ambiguous, "modal_request", "English can without politeness"},
|
||||
{"не мог бы ты выключить свет", Permissive, "polite_request", "conditional politeness, prohibition-parser exemption"},
|
||||
{"можно выключить свет", Permissive, "modal_request", "можно + infinitive permission-implicature request"},
|
||||
|
||||
// first-person requests
|
||||
{"я хочу выключить свет", Permissive, "first_person_request", "first-person + illocution"},
|
||||
{"я хочу чтобы ты выключил свет", Permissive, "first_person_request", "first-person + embedded ya-you wish"},
|
||||
{"надо выключить свет", Permissive, "first_person_request", "impersonal need"},
|
||||
{"мне нужно включить свет", Permissive, "first_person_request", "first-person oblique + need"},
|
||||
|
||||
// ordinary questions — no execution pressure even when answerable
|
||||
{"что запущено", Ambiguous, "question", "status question, no request evidence"},
|
||||
{"какие службы работают", Ambiguous, "question", "question, no request evidence"},
|
||||
{"сколько ламп включено", Ambiguous, "question", "question, no request evidence"},
|
||||
{"что ты можешь включить", Blocked, "capability_question", "open question with ты + можешь"},
|
||||
{"покажи что запущено", Permissive, "first_person_request", "imperative lead over a status question"},
|
||||
}
|
||||
Reference in New Issue
Block a user