sprag-cli 3.50.0 → 3.50.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sprag-cli",
3
- "version": "3.50.0",
3
+ "version": "3.50.1",
4
4
  "description": "Sprag - a quality ratchet harness for AI coding agents: model-fitting delegation, ratchet rules, doc2md, Korean style gate. Same tool as claude-token-saver, under its new name.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -19,11 +19,13 @@
19
19
  * there are no tool calls yet)
20
20
  * - the text trips ESCALATE_RE (design, analysis, deploy, merge …), where the
21
21
  * top tier is the right answer and a nudge downward would be wrong
22
+ * - the text trips EDIT_RE (implement, add, fix …): editing is not delegable
23
+ * however much the sentence also says "install" or "check"
22
24
  * - no registered rule covers that category
23
25
  * A hint that fires on the wrong request costs more than one that stays quiet.
24
26
  */
25
27
 
26
- import { categorize, ESCALATE_RE } from './route-scan.js';
28
+ import { categorize, ESCALATE_RE, EDIT_RE } from './route-scan.js';
27
29
  import { loadModelRules, budgetCapPhrase } from './model-rules.js';
28
30
  import { agentPhrase, agentPhraseEn } from './agents.js';
29
31
  import { userLanguage } from './config.js';
@@ -48,6 +50,9 @@ export function routeHint(text, { rules, lang = userLanguage(), root } = {}) {
48
50
  // before classification because such a request often looks like a light
49
51
  // "run" or "check" in its wording.
50
52
  if (ESCALATE_RE.test(t)) return null;
53
+ // Same for implementation work dressed as a run or a check: an edit is not
54
+ // delegable, and with no tool calls yet only the wording can say so.
55
+ if (EDIT_RE.test(t)) return null;
51
56
 
52
57
  const cat = categorize(t, null);
53
58
  if (!cat) return null;
package/src/route-scan.js CHANGED
@@ -51,7 +51,18 @@ export const MIN_DELEGABLE_OUT = 100;
51
51
  // Irreversible/external actions (store submission, deploy, release, merge)
52
52
  // are included — they may look like light "run" episodes in the logs, but
53
53
  // delegating them defeats the harness's default-safe-path rule.
54
- export const ESCALATE_RE = /설계|아키텍처|리팩토링|원인 분석|개선할|검토해보|비교|왜 |제출|배포|출시|analyze|compare|evaluate|architect|refactor|submit|deploy|release|publish|merge/i;
54
+ // Measured 2026-09-20 on 1,276 local prompts: '퍼블리시' (npm publish, 15 hits)
55
+ // and '이유' (root-cause asks) were slipping through as run/translate, and a
56
+ // bare '머지' matched inside '나머지' ("나머지 진행하자" ×7) — hence the lookbehind.
57
+ export const ESCALATE_RE = /설계|아키텍처|리팩토링|원인 분석|개선할|검토해보|비교|왜 |이유|제출|배포|출시|퍼블리시|릴리스|릴리즈|(?<!나)머지|analyze|compare|evaluate|architect|refactor|submit|deploy|release|publish|merge/i;
58
+
59
+ // Implementation asks phrased around a run/check verb ("설치와 동시에 설정되도록
60
+ // 하자", "피드백 확인해주고 아이콘도 만들자"). Editing is not delegable, and at
61
+ // prompt time there is no tool mix to reveal it, so the wording has to. Offline
62
+ // classification does not use this: a write-dominant tool mix already excludes
63
+ // such episodes in behaviorPool(). Same corpus: 21 of 1,276 prompts gated, all
64
+ // but two of them implementation requests that had been read as run/check.
65
+ export const EDIT_RE = /구현|추가하자|만들자|넣자|넣어줘|수정해|고쳐|바꿔|되도록|되게|리팩/;
55
66
  // A pattern must recur this often before we nag about it.
56
67
  export const MIN_RECURRENCE = 3;
57
68