diff --git a/policy/tells.yaml b/policy/tells.yaml index a25c117..8789229 100644 --- a/policy/tells.yaml +++ b/policy/tells.yaml @@ -38,6 +38,16 @@ tells: terminal: true phrases: ["running now", "currently deployed", "is deployed", "is it live", "it is live", "which version is live", "what version is deployed", "health endpoint", "is * responding", "responding now", "alive now", "live right now", "port * open", "is the * up"] + # ---- runtime: current/recorded-state qualifier co-occurring with a system/component noun ---- + # Issue #10: natural phrasings of the core "what is the current/recorded state?" question + # class were missed (precision>recall inventory). These are high-precision: each phrase only + # fires on a live/recorded-state qualifier tied to a system/component/connector noun, so it is + # almost never another family. Deterministic, local; no LLM in the hook loop. + - id: runtime-current-state + family: runtime + terminal: true + phrases: ["still * from", "still read", "still ingest", "still file-based", "dependent on", "is our ingest still", "does * still ", "are we dependent", "how does * ingest", "ingest * today", "read * from * today", "still * today", "alive right now", "any more", "currently * any way", "in any way"] + # Clause-scoped exclusions. When a clause contains an exclude phrase, the named family # is suppressed FOR THAT CLAUSE only — not a global abstention. # e.g. "tell me what we decided, but don't check whether it's deployed" → historical only. diff --git a/test/runtime-current-state.test.js b/test/runtime-current-state.test.js new file mode 100644 index 0000000..1fc9036 --- /dev/null +++ b/test/runtime-current-state.test.js @@ -0,0 +1,43 @@ +'use strict'; + +// Regression tests for issue #10 (router misses natural phrasings of the +// core "what is the current/recorded state?" question class). +// These reproduce the reported misses before the deterministic current-state +// tell family was added. Keep this file green — it encodes the receipt. + +const test = require('node:test'); +const assert = require('node:assert/strict'); +const path = require('node:path'); +const { loadPolicy, matchPrompt } = require('../src/matcher'); + +const policyPath = path.join(__dirname, '..', 'policy', 'tells.yaml'); + +function families(prompt) { + const policy = loadPolicy(policyPath); + return matchPrompt(prompt, policy).map((match) => match.family); +} + +test('routes "is still ing from ?" to runtime (issue #10 case 1)', () => { + const f = families('does the store still read sales from the vendor archive folder?'); + assert.ok(f.includes('runtime'), `expected runtime in ${JSON.stringify(f)}`); +}); + +test('routes "are we dependent on in any way?" to runtime (issue #10 case 2)', () => { + const f = families('are we dependent on the vendor in any way?'); + assert.ok(f.includes('runtime'), `expected runtime in ${JSON.stringify(f)}`); +}); + +test('routes "how does our connector ingest today?" to runtime (issue #10 case 3)', () => { + const f = families('how does our connector ingest sales data today?'); + assert.ok(f.includes('runtime'), `expected runtime in ${JSON.stringify(f)}`); +}); + +test('routes "is our ingest still file-based or register-direct?" to runtime (issue #10 case 4)', () => { + const f = families('is our ingest still file-based or register-direct?'); + assert.ok(f.includes('runtime'), `expected runtime in ${JSON.stringify(f)}`); +}); + +test('routes custom component noun "fleet-hub alive right now?" to runtime (issue #10 observation)', () => { + const f = families('is the fleet-hub alive right now?'); + assert.ok(f.includes('runtime'), `expected runtime in ${JSON.stringify(f)}`); +});