sprag-cli 3.90.4 → 3.92.0
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/NOTICE +0 -10
- package/README.ko.md +2 -2
- package/README.md +2 -2
- package/bin/cli.js +19 -3
- package/docs/TEAM.ko.md +2 -2
- package/docs/TEAM.md +2 -2
- package/package.json +1 -1
- package/presets/cohesion/cohesion-en.md +2 -2
- package/presets/korean-style/rules.md +117 -0
- package/src/brief.js +1 -1
- package/src/cell-width.js +40 -0
- package/src/codex/harness.js +9 -1
- package/src/codex/panel.js +2 -2
- package/src/cohesion.js +4 -4
- package/src/commands/cohesion.js +1 -1
- package/src/commands/install.js +10 -10
- package/src/commands/korean.js +4 -6
- package/src/commands/route-scan.js +16 -6
- package/src/delegation-agents.js +2 -2
- package/src/formatters/statusline.js +178 -29
- package/src/korean-lint.cjs +73 -21
- package/src/korean-style.js +18 -43
- package/src/model-rules.js +2 -2
- package/src/monthly-reset-offer.js +109 -0
- package/src/org-upgrade.js +6 -6
- package/src/route-follow.js +2 -2
- package/src/route-inject.js +6 -6
- package/src/team-prompts.js +60 -2
- package/src/update-notice.js +2 -2
- package/presets/korean-style/LICENSE-fluent-korean +0 -21
- package/presets/korean-style/fluent-korean.md +0 -52
- package/presets/korean-style/supplement.md +0 -97
package/NOTICE
CHANGED
|
@@ -17,16 +17,6 @@ Releases up to and including v3.47.0 were published under the MIT License.
|
|
|
17
17
|
Anyone who received a copy under those terms keeps them for that copy; this
|
|
18
18
|
change applies to later releases.
|
|
19
19
|
|
|
20
|
-
--------------------------------------------------------------------------------
|
|
21
|
-
Third-party content redistributed with this project
|
|
22
|
-
|
|
23
|
-
presets/korean-style/fluent-korean.md
|
|
24
|
-
fluent-korean, Copyright (c) 2026 snflkd, MIT License.
|
|
25
|
-
Vendored with only the output-style frontmatter removed; the guidance text
|
|
26
|
-
is unmodified. It stays under its own terms, which are reproduced in
|
|
27
|
-
presets/korean-style/LICENSE-fluent-korean.
|
|
28
|
-
Upstream: https://github.com/snflkd/fluent-korean
|
|
29
|
-
|
|
30
20
|
--------------------------------------------------------------------------------
|
|
31
21
|
Trademarks
|
|
32
22
|
|
package/README.ko.md
CHANGED
|
@@ -150,7 +150,7 @@ LLMRouterBench(Findings of ACL 2026)에서 오프라인으로 측정했습니다
|
|
|
150
150
|
| 🅷 **하네스 점수** | 다섯 가지 운영 원칙을 실시간으로 점검합니다. 검증 단계를 건너뛰면 `🅷 4/5`가 먼저 알려 줍니다. | [Harness](https://github.com/rootstudioyaml/sprag/blob/main/docs/HARNESS.ko.md) |
|
|
151
151
|
| 📊 **토큰 텔레메트리** | 캐시 적중률과 TTL, 컨텍스트 크기, 출력 급증, 두 가지 사용량 한도를 매 턴 표시합니다. | [statusline](https://github.com/rootstudioyaml/sprag/blob/main/docs/STATUSLINE.ko.md) |
|
|
152
152
|
| 📄 **doc2md** | pptx와 xlsx, pdf, docx, fig를 필요할 때 Markdown 으로 바꿔 읽습니다. | [doc2md](https://github.com/rootstudioyaml/sprag/blob/main/docs/DOC2MD.ko.md) |
|
|
153
|
-
| 🇰🇷 **문체 게이트** | 쓰는 시점에 hook으로 검사합니다.
|
|
153
|
+
| 🇰🇷 **문체 게이트** | 쓰는 시점에 hook으로 검사합니다. 연결어미 뒤 쉼표와 가운뎃점 나열, 번역투를 살피고 규칙마다 논문이나 실측 근거가 있습니다. | [문체 지침](https://github.com/rootstudioyaml/sprag/blob/main/docs/KOREAN-STYLE.ko.md) |
|
|
154
154
|
|
|
155
155
|
두 절감액은 한 숫자로 합치지 않습니다. 재는 대상이 다르기 때문입니다. 라우팅 원장은 위임된 실행의 단가 차액을 적고, 변환 원장은 문서가 쓰지 않게 된 토큰을 적습니다.
|
|
156
156
|
|
|
@@ -233,7 +233,7 @@ Codex에는 기본 훅과 `AGENTS.md` 하네스, 범위별 래칫 규칙, 한국
|
|
|
233
233
|
| [티어 판별 기준](https://github.com/rootstudioyaml/sprag/blob/main/docs/TIER_CRITERIA.md) | T0·T1·T2 를 가르는 근거와 연구 출처 |
|
|
234
234
|
| [벤치마크](https://github.com/rootstudioyaml/sprag/blob/main/docs/BENCHMARK.md) | LLMRouterBench 11,696문항 재현 결과 |
|
|
235
235
|
| [doc2md](https://github.com/rootstudioyaml/sprag/blob/main/docs/DOC2MD.ko.md) | 변환 대상 포맷, 절감 근거, 문서 수정 절차, DRM 문서 |
|
|
236
|
-
| [한국어 문체 지침](https://github.com/rootstudioyaml/sprag/blob/main/docs/KOREAN-STYLE.ko.md) |
|
|
236
|
+
| [한국어 문체 지침](https://github.com/rootstudioyaml/sprag/blob/main/docs/KOREAN-STYLE.ko.md) | 설계 개념, 쓰기 시점 검사, 적용 전후 비교, 참고 문헌 |
|
|
237
237
|
| [라우터가 아닌 이유](https://github.com/rootstudioyaml/sprag/blob/main/docs/NOT-A-ROUTER.ko.md) | 실시간 라우팅이 캐시를 깨서 비용을 키우는 구조 |
|
|
238
238
|
| [게이트웨이와 환경](https://github.com/rootstudioyaml/sprag/blob/main/docs/GATEWAYS.ko.md) | Bedrock·Vertex·LiteLLM, 가격표, FAQ, 동작 원리 |
|
|
239
239
|
| [클로드 코드 토큰 줄이는 법](https://sprag.io/docs/ko/reduce-claude-code-tokens/) | 압축·초기화 타이밍, 서브에이전트 탐색, 문서 변환, 캐시 TTL |
|
package/README.md
CHANGED
|
@@ -189,7 +189,7 @@ in Korean, is in [Tier criteria](https://github.com/rootstudioyaml/sprag/blob/ma
|
|
|
189
189
|
| 🅷 **Harness score** | Five operating principles checked live. Skip the verify step and `🅷 4/5` says so before you report done. | [harness](https://github.com/rootstudioyaml/sprag/blob/main/docs/HARNESS.md) |
|
|
190
190
|
| 📊 **Token telemetry** | Cache hit rate, TTL, context size, output spikes and both rate-limit windows, in the prompt every turn. | [statusline](https://github.com/rootstudioyaml/sprag/blob/main/docs/STATUSLINE.md) |
|
|
191
191
|
| 📄 **doc2md** | pptx, xlsx, pdf, docx and fig converted on demand, so a document costs one read instead of your whole context. | [doc2md](https://github.com/rootstudioyaml/sprag/blob/main/docs/DOC2MD.md) |
|
|
192
|
-
| 🇰🇷 **Style gates** | Write-time prose lint enforced by hook. Shipping today for Korean
|
|
192
|
+
| 🇰🇷 **Style gates** | Write-time prose lint enforced by hook. Shipping today for Korean: commas after connective endings, middle-dot lists, translationese, each rule backed by a cited study or a measurement. | [style](https://github.com/rootstudioyaml/sprag/blob/main/docs/KOREAN-STYLE.md) |
|
|
193
193
|
|
|
194
194
|
The two savings figures are never added together. They measure different things:
|
|
195
195
|
the routing ledger records the price difference on delegated runs, and the
|
|
@@ -287,7 +287,7 @@ Every subcommand, flag and the output-language setting: [command reference](http
|
|
|
287
287
|
| [Tier criteria](https://github.com/rootstudioyaml/sprag/blob/main/docs/TIER_CRITERIA.md) | Why T0/T1/T2 split where they do, with sources (Korean) |
|
|
288
288
|
| [Benchmark](https://github.com/rootstudioyaml/sprag/blob/main/docs/BENCHMARK.md) | The 11,696-instance LLMRouterBench run |
|
|
289
289
|
| [doc2md](https://github.com/rootstudioyaml/sprag/blob/main/docs/DOC2MD.md) ([한국어](https://github.com/rootstudioyaml/sprag/blob/main/docs/DOC2MD.ko.md)) | Supported formats, savings evidence, editing documents, DRM cases |
|
|
290
|
-
| [Korean style](https://github.com/rootstudioyaml/sprag/blob/main/docs/KOREAN-STYLE.md) |
|
|
290
|
+
| [Korean style](https://github.com/rootstudioyaml/sprag/blob/main/docs/KOREAN-STYLE.md) | Design, the write-time check, before/after, references |
|
|
291
291
|
| [Not a router](https://github.com/rootstudioyaml/sprag/blob/main/docs/NOT-A-ROUTER.md) | Why realtime routing breaks the cache and costs more |
|
|
292
292
|
| [Gateways & environment](https://github.com/rootstudioyaml/sprag/blob/main/docs/GATEWAYS.md) | Bedrock, Vertex, LiteLLM budgets, pricing table, FAQ, how it works |
|
|
293
293
|
| [Reduce Claude Code tokens](https://sprag.io/docs/reduce-claude-code-tokens/) | Compact/clear timing, subagent exploration, document conversion, cache TTL |
|
package/bin/cli.js
CHANGED
|
@@ -100,6 +100,19 @@ function segmentsFromArgs() {
|
|
|
100
100
|
return raw ? raw.split(',').map((s) => s.trim()).filter(Boolean) : null;
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
+
/**
|
|
104
|
+
* Terminal width for the statusline wrap: `--columns N`, else the COLUMNS that
|
|
105
|
+
* Claude Code exports to the statusline process, else 0 (no wrapping). The demo
|
|
106
|
+
* passes `useEnv: false` so recordings do not change with the shell they run in.
|
|
107
|
+
*/
|
|
108
|
+
function columnsFromArgs({ useEnv = true } = {}) {
|
|
109
|
+
const positive = (v) => {
|
|
110
|
+
const n = Number(v);
|
|
111
|
+
return Number.isInteger(n) && n > 0 ? n : 0;
|
|
112
|
+
};
|
|
113
|
+
return positive(getArg('--columns')) || (useEnv ? positive(process.env.COLUMNS) : 0);
|
|
114
|
+
}
|
|
115
|
+
|
|
103
116
|
const KNOWN_SUBCOMMANDS = new Set([
|
|
104
117
|
'last', 'brief', 'history', 'handoff', 'install', 'uninstall', 'mode', 'korean', 'cohesion',
|
|
105
118
|
'doc2md', 'delegate', 'harness', 'route-scan', 'compact-window', 'update-check', 'upgrade',
|
|
@@ -117,7 +130,7 @@ const KNOWN_SUBCOMMANDS = new Set([
|
|
|
117
130
|
const FLAG_SPECS = {
|
|
118
131
|
report: {
|
|
119
132
|
value: ['--format', '-f', '--project', '-p', '--days', '-d', '--hours', '--demo',
|
|
120
|
-
'--demo-cycle-sec', '--segments', '--exclude-session', '--threshold'],
|
|
133
|
+
'--demo-cycle-sec', '--segments', '--exclude-session', '--threshold', '--columns'],
|
|
121
134
|
bool: ['--statusline', '--verbose', '--no-verbose', '--compact', '--no-color', '--icon',
|
|
122
135
|
'--no-icon', '--text', '--narrow', '--no-timer', '--single-line', '--demo-label',
|
|
123
136
|
'--version', '-v', '--help', '-h', '--hook', '--hook-run', '--install-hook', '--uninstall-hook'],
|
|
@@ -216,6 +229,7 @@ Usage:
|
|
|
216
229
|
sprag --uninstall-hook remove that hook
|
|
217
230
|
sprag --statusline one-line output for Claude Code statusline
|
|
218
231
|
--verbose / --no-color / --icon / --no-timer / --single-line
|
|
232
|
+
--columns N wrap chips to N cells (default: $COLUMNS, which Claude Code sets)
|
|
219
233
|
|
|
220
234
|
Run any subcommand with --help for its own options where available.
|
|
221
235
|
Bug reports & feature requests: https://github.com/rootstudioyaml/sprag/issues
|
|
@@ -372,7 +386,7 @@ async function main() {
|
|
|
372
386
|
}
|
|
373
387
|
|
|
374
388
|
// Subcommand: cohesion — English sentence-connection guidance injected at
|
|
375
|
-
// session start; the language-neutral half of the Korean
|
|
389
|
+
// session start; the language-neutral half of the Korean rules.
|
|
376
390
|
// sprag cohesion on | off | status | show
|
|
377
391
|
if (args[0] === 'cohesion') {
|
|
378
392
|
return (await import('../src/commands/cohesion.js')).run({ args, hasFlag });
|
|
@@ -562,6 +576,7 @@ async function main() {
|
|
|
562
576
|
mode: labelMode,
|
|
563
577
|
segments,
|
|
564
578
|
singleLine: hasFlag('--single-line'),
|
|
579
|
+
columns: columnsFromArgs({ useEnv: false }),
|
|
565
580
|
});
|
|
566
581
|
// For `cycle` mode, prefix with the scenario label so the screen recorder
|
|
567
582
|
// shows what the viewer is looking at (only when explicitly requested).
|
|
@@ -688,7 +703,7 @@ async function main() {
|
|
|
688
703
|
const { withBaseStatusline } = await import('../src/statusline-base.js');
|
|
689
704
|
const noSessionOut = withBaseStatusline(formatNoSession(
|
|
690
705
|
{ caps, model, effort, windowLabel, version: PKG_VERSION, update: readUpdateChip(PKG_VERSION), team: (await import('../src/team-sync.js')).readTeamChip() },
|
|
691
|
-
{ color: colorOk, mode: labelMode, segments: segmentsFromArgs() },
|
|
706
|
+
{ color: colorOk, mode: labelMode, segments: segmentsFromArgs(), columns: columnsFromArgs() },
|
|
692
707
|
), { input: readStdinRaw() });
|
|
693
708
|
if (guard) guard.finish(noSessionOut);
|
|
694
709
|
console.log(noSessionOut);
|
|
@@ -1063,6 +1078,7 @@ async function main() {
|
|
|
1063
1078
|
// multi-line statusline in some versions (anthropics/claude-code#35176)
|
|
1064
1079
|
// — --single-line restores the legacy one-line layout in that case.
|
|
1065
1080
|
singleLine: hasFlag('--single-line'),
|
|
1081
|
+
columns: columnsFromArgs(),
|
|
1066
1082
|
});
|
|
1067
1083
|
} else {
|
|
1068
1084
|
// The first screen is the pitch: what share of recent work a cheaper model
|
package/docs/TEAM.ko.md
CHANGED
|
@@ -146,7 +146,7 @@ Sprag 운영자는 ops 콘솔(sprag.io/ops/)에서 조직마다 최소 Sprag 버
|
|
|
146
146
|
|
|
147
147
|
## 대시보드
|
|
148
148
|
|
|
149
|
-
https://sprag.io/team/ 에서 등록된 오너나 어드민이 이메일 코드로 로그인하고, 팀을 만들고, 초대 토큰을 받습니다. 새 조직은 support@sprag.io 로 문의합니다. 오너, 어드민, 초대 대기 중 어느 쪽에도 없는 이메일은 코드를 보내기 전에 거절하며, 조직 오너에게 추가를 요청하라고 안내합니다. 초대받은 사람은 처음 로그인할 때 자동으로 오너나 어드민이 됩니다. 여기서 구성원별 지출과 절감액을 보고, 규칙 탭에서 조직 룰과 팀 룰을 관리하고, 구성원을 내보낼 수 있습니다. 조직 패널에는 요금제, 한도 대비 사용 좌석, 어드민, 전체 팀이 보입니다. 슈퍼유저는 sprag.io/ops/ 에서 모든 조직을
|
|
149
|
+
https://sprag.io/team/ 에서 등록된 오너나 어드민이 이메일 코드로 로그인하고, 팀을 만들고, 초대 토큰을 받습니다. 새 조직은 support@sprag.io 로 문의합니다. 오너, 어드민, 초대 대기 중 어느 쪽에도 없는 이메일은 코드를 보내기 전에 거절하며, 조직 오너에게 추가를 요청하라고 안내합니다. 초대받은 사람은 처음 로그인할 때 자동으로 오너나 어드민이 됩니다. 여기서 구성원별 지출과 절감액을 보고, 규칙 탭에서 조직 룰과 팀 룰을 관리하고, 구성원을 내보낼 수 있습니다. 조직 패널에는 요금제, 한도 대비 사용 좌석, 어드민, 전체 팀이 보입니다. 슈퍼유저는 sprag.io/ops/ 에서 모든 조직을 보고, 조직의 개요 탭에서 어느 조직에든 팀을 만들 수 있습니다. 팀을 만들면 그 팀의 초대 토큰이 화면에 나옵니다. 오너와 어드민과 슈퍼유저는 팀을 삭제할 수 있습니다. 팀 화면에서 초대와 등록을 다루는 탭에 있는 '팀 삭제' 버튼을 쓰거나 /ops/ 조직 개요 탭의 팀 행에서 삭제 버튼을 누릅니다. 일시정지 멤버를 포함해 활동 멤버가 남아 있으면 거절하므로 먼저 멤버를 모두 제거해야 합니다. 팀을 삭제하면 과거 멤버의 사용 기록과 이전 활동 기록도 함께 지워지고 되돌릴 수 없습니다. 활동 로그에는 기계마다 '삭제됨' 항목이 하나씩 남습니다.
|
|
150
150
|
|
|
151
151
|
대시보드 맨 위의 기간 선택(7일, 30일, 90일, 이번 달, 지난 달, 직접 선택)이 멤버 표, 사용량 차트, 프롬프트 사용량 탭의 기간을 정합니다. 기본값은 최근 30일이고, 내 컴퓨터의 달력 날짜를 쓰며 종료일도 포함합니다. 최대 365일까지 고를 수 있습니다. 고른 기간은 주소(`?from=2026-10-01&to=2026-10-18`)에 남으므로 새로고침하거나 링크를 공유해도 같은 기간이 보입니다. sprag.io/ops/ 슈퍼유저 콘솔에도 같은 선택이 있어 조직 표, 조직 머리말, 조직의 프롬프트 사용량에 적용됩니다.
|
|
152
152
|
|
|
@@ -177,7 +177,7 @@ Free, 프로(좌석당 월 $5), 엔터프라이즈(좌석당 월 $10, 프롬프
|
|
|
177
177
|
|
|
178
178
|
**무엇을 수집하나.** 직접 입력한 프롬프트만 올라갑니다. 메인 Claude Code 세션(`~/.claude/projects/**/*.jsonl`)과 Codex 세션(`<CODEX_HOME 또는 ~/.codex>/sessions/**/*.jsonl`)이 대상입니다. 프롬프트마다 시각, 프로젝트 폴더 이름(경로의 마지막 부분이며 전체 경로는 아닙니다), 본문(최대 20,000자)이 올라갑니다. Claude 가 답하는 도중에 미리 입력해 둔 프롬프트도 대상이고, 프롬프트에 붙여 넣은 텍스트는 그 프롬프트와 함께 보냅니다. 어시스턴트 답변, 도구 출력, 파일 내용, 서브에이전트 기록, 슬래시 명령 래퍼, `!` 셸 명령과 그 출력, 백그라운드 작업 알림, 다른 에이전트가 보낸 메시지, 시스템 리마인더, 파일 경로는 수집하지 않습니다.
|
|
179
179
|
|
|
180
|
-
|
|
180
|
+
**비밀값과 개인정보 가림.** 가림 처리는 올리기 전에 이 컴퓨터에서 이루어집니다. 눈에 띄는 비밀값은 `[redacted]` 로 바꿉니다. API 키와 토큰(`sk-...`, `sk-ant-...`, `ghp_...`, `gho_...`, `github_pat_...`, `AKIA...`, `xox[abpr]-...`), `Bearer` 토큰, 개인 키 블록, `KEY=`, `TOKEN=`, `PASSWORD=`, `SECRET=` 형태의 대입이 대상입니다. 개인정보는 종류별 표지로 바꿉니다. 이메일 주소는 `[redacted:email]`, 한국 전화번호(휴대전화, `+82` 형태, 하이픈으로 이은 지역번호 유선전화. `1588-xxxx` 같은 대표번호는 그대로 둡니다)는 `[redacted:phone]`, 주민등록번호와 외국인등록번호(`YYMMDD-NNNNNNN`)는 `[redacted:rrn]`, Luhn 검사를 통과하는 카드번호는 `[redacted:card]` 로 바뀝니다. `git@github.com`, `react@18.3.1`, 13자리 타임스탬프처럼 모양만 비슷한 값은 건드리지 않습니다. 패턴 매칭이므로 흔한 형태만 잡을 뿐 보장하지는 않습니다. 이름, 주소, 자유 서술은 찾지 못하므로, 수집이 켜진 컴퓨터에서는 프롬프트에 비밀값이나 개인정보를 붙여 넣지 마십시오.
|
|
181
181
|
|
|
182
182
|
**과거분은 올리지 않습니다.** 컴퓨터가 프롬프트 수집이 켜진 것을 처음 보면 기존 기록의 끝에 표시를 하고 그 뒤에 입력한 것만 올립니다. 정책이 이 컴퓨터에 닿기 전에 쓴 내용은 전혀 나가지 않고, 수집이 꺼진 동안 입력한 내용도 나중에 올라가지 않습니다. 그 뒤에 새로 생긴 기록 파일은 처음부터 읽습니다. 정책이 꺼지면 컴퓨터가 읽던 위치(`prompts-offsets.json`)를 지우므로, 다시 켜면 모든 파일의 끝에서 새로 시작합니다.
|
|
183
183
|
|
package/docs/TEAM.md
CHANGED
|
@@ -147,7 +147,7 @@ If the upgrade fails, for example because the required version is not published
|
|
|
147
147
|
|
|
148
148
|
## The dashboard
|
|
149
149
|
|
|
150
|
-
https://sprag.io/team/ is where a registered owner or admin signs in with an email code, creates a team and gets the invite token. A new organization starts by writing to support@sprag.io. An email that is not an owner, an admin or a pending invite is refused before any code is sent, with a message to ask the organization's owner to add it. Invited people become owner or admin automatically on their first sign-in. From there they see per-member spend and savings, manage organization and team rules on the Rules tab, and remove members. The organization panel shows the plan, seats used against the limit, admins and every team. The superuser sees every organization at sprag.io/ops
|
|
150
|
+
https://sprag.io/team/ is where a registered owner or admin signs in with an email code, creates a team and gets the invite token. A new organization starts by writing to support@sprag.io. An email that is not an owner, an admin or a pending invite is refused before any code is sent, with a message to ask the organization's owner to add it. Invited people become owner or admin automatically on their first sign-in. From there they see per-member spend and savings, manage organization and team rules on the Rules tab, and remove members. The organization panel shows the plan, seats used against the limit, admins and every team. The superuser sees every organization at sprag.io/ops/ and can create a team in any of them from the organization's Overview tab, which shows the new team's invite token. Owners, admins and the superuser can delete a team (the "Delete team" button in the "Invite & enroll" tab of a team, or the Delete button on the team's row in the organization's Overview tab at /ops/). Sprag refuses while the team still has active members, including paused ones, so remove them first. Deleting a team also erases the usage history and earlier activity of its past members, and it cannot be undone; the activity log keeps one "deleted" entry per machine.
|
|
151
151
|
|
|
152
152
|
A date range control at the top of the dashboard (7d, 30d, 90d, This month, Last month or Custom) sets the period for the members table, the Usage chart and the prompt usage tab. It defaults to the last 30 days, uses your local calendar days with the end date included, and allows 365 days at most. The choice is kept in the page address (`?from=2026-10-01&to=2026-10-18`), so a reload or a shared link shows the same period. The superuser console at /ops/ has the same control for the organization table, the organization header and its prompt usage.
|
|
153
153
|
|
|
@@ -178,7 +178,7 @@ Owners and admins of an Enterprise organization get a Prompts tab on sprag.io/te
|
|
|
178
178
|
|
|
179
179
|
**What is captured.** Only the prompts you typed yourself, from your main Claude Code sessions (`~/.claude/projects/**/*.jsonl`) and Codex sessions (`<CODEX_HOME or ~/.codex>/sessions/**/*.jsonl`). Each prompt goes up as its time, the project folder's name (the last part of the path, never the full path) and its text, cut at 20,000 characters. A prompt you type while Claude is still working (a queued prompt) counts too. Text you paste into a prompt goes up as part of it. Not captured: assistant replies, tool output, file contents, subagent transcripts, slash-command wrappers, `!` shell commands and their output, background-task notifications, messages from other agents, system reminders, or any file path.
|
|
180
180
|
|
|
181
|
-
**Redaction.**
|
|
181
|
+
**Redaction.** Masking happens on your machine, before anything is uploaded. Obvious secrets are replaced with `[redacted]`: API keys and tokens (`sk-...`, `sk-ant-...`, `ghp_...`, `gho_...`, `github_pat_...`, `AKIA...`, `xox[abpr]-...`), `Bearer` tokens, private key blocks, and `KEY=`, `TOKEN=`, `PASSWORD=` and `SECRET=` assignments. Personal data is masked with typed markers: email addresses as `[redacted:email]`, Korean phone numbers (mobile, `+82` and hyphenated landline forms; business numbers such as `1588-xxxx` are left alone) as `[redacted:phone]`, resident and foreigner registration numbers (`YYMMDD-NNNNNNN`) as `[redacted:rrn]`, and card numbers that pass the Luhn check as `[redacted:card]`. Things that only look similar stay as they are, for example `git@github.com`, `react@18.3.1` and 13-digit timestamps. This is pattern matching: it catches common forms only and is not a guarantee. Names, addresses and free-form text are not detected, so do not paste secrets or personal data into prompts on a machine with capture on.
|
|
182
182
|
|
|
183
183
|
**No backfill.** The first time a machine sees prompt capture on, it marks the end of every existing transcript and uploads only what you type after that. Nothing written before the policy reached your machine is sent, and what you type while capture is off is never sent later. Transcripts created afterwards are read from their start. When the policy turns off, the machine forgets its place (`prompts-offsets.json`), so switching it on again starts fresh at the end of every file.
|
|
184
184
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sprag-cli",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.92.0",
|
|
4
4
|
"description": "Model-delegation router for Claude Code and Codex: lookups, checks and test runs go to cheaper models, documents go in as compact Markdown, and a live statusline shows spend and savings.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
English cohesion guidance — claude-token-saver's own text, distilled from the
|
|
3
|
-
same sources as the
|
|
3
|
+
same sources as the cohesion section of the Korean rules: the given-new
|
|
4
4
|
contract from text linguistics, and three studies on Korean learner writing
|
|
5
5
|
whose validated principles are language-neutral (surface connectives
|
|
6
6
|
correlate negatively or not at all with judged text quality; elaboration is
|
|
7
7
|
the only connection type with a positive correlation).
|
|
8
8
|
|
|
9
9
|
Injected at session start when `claude-token-saver cohesion on` is set and
|
|
10
|
-
the Korean guidance is off (the Korean
|
|
10
|
+
the Korean guidance is off (the Korean rules already carry these
|
|
11
11
|
rules, so injecting both would bill the same principles twice).
|
|
12
12
|
-->
|
|
13
13
|
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
sprag's own Korean style rules, written 2026-11-01. They replaced the
|
|
3
|
+
guidance shipped through v3.90 with one file whose clauses each rest on a
|
|
4
|
+
measurement or a cited source. The full reference list is in
|
|
5
|
+
docs/KOREAN-STYLE.md.
|
|
6
|
+
|
|
7
|
+
Evidence (full list with numbers in the 2026-11-01 research notes):
|
|
8
|
+
- KatFishNet, Park et al., ACL 2025 (arXiv 2503.00032): LLM Korean puts a
|
|
9
|
+
comma after a connective ending about 5x as often as human writing
|
|
10
|
+
(essays 19.83% vs 4.10%) and adds commas after 그리고/그러나.
|
|
11
|
+
- epoko77-ai/im-not-ai docs/en/evidence.md (MIT): "A가 아니라 B" 9.2x in
|
|
12
|
+
AI prose; "~를 통해" and "~것이다" are used MORE by humans, so they must
|
|
13
|
+
not be banned outright.
|
|
14
|
+
- Martin Fowler, "LLM Voice" (2026-10-29): readers react to smooth,
|
|
15
|
+
uniform prose; read the text aloud.
|
|
16
|
+
- DeepPulse narration and Claude Code transcripts measured 2026-11-01:
|
|
17
|
+
middle dot 7.3x and comma after connective ending 3.9x in assistant text
|
|
18
|
+
against user text; after the 2026-08-22 guidance the connective comma
|
|
19
|
+
rate in narration rose from 5.12 to 9.20 per 1,000 characters.
|
|
20
|
+
- Carried over from the 2026-09-13 supplement: translationese clauses
|
|
21
|
+
(국립국어원, 한글문화연대), cohesion clauses (KCI ART002501143,
|
|
22
|
+
ART002240473), over-correction guard (나무위키 「번역체 문장」).
|
|
23
|
+
-->
|
|
24
|
+
|
|
25
|
+
## 한국어 문체 규칙 (sprag)
|
|
26
|
+
|
|
27
|
+
메모리 파일이나 서브에이전트 프롬프트처럼 모델만 읽는 글에도 이 규칙을 적용합니다. 그런 글은 다음 세션의 문맥에 들어가고, 모델은 문맥에 있는 문체를 그대로 따라 씁니다.
|
|
28
|
+
|
|
29
|
+
규칙의 목표는 문장을 더 매끄럽게 다듬는 데 있지 않습니다. 독자는 지나치게 고르고 매끄러운 문장에서 오히려 기계의 말투를 알아챕니다. 구체적인 사실을 쓰고 정형화된 꼴을 깨는 것이 목표입니다.
|
|
30
|
+
|
|
31
|
+
### 1. 쉼표는 아껴 씁니다
|
|
32
|
+
|
|
33
|
+
LLM이 쓴 한국어를 판별하는 가장 강한 신호가 쉼표입니다.
|
|
34
|
+
|
|
35
|
+
1. 연결어미 뒤에는 쉼표를 찍지 않습니다. 맞춤법이 요구하지 않는 쉼표이고 사람은 거의 찍지 않습니다.
|
|
36
|
+
- ✗ 파일을 읽고, 결과를 확인하면, 다음 단계로 넘어갑니다.
|
|
37
|
+
- ○ 파일을 읽고 결과를 확인하면 다음 단계로 넘어갑니다.
|
|
38
|
+
2. '그리고', '그러나', '하지만', '그래서', '따라서' 같은 접속부사 뒤에도 쉼표를 찍지 않습니다.
|
|
39
|
+
- ✗ 그러나, 이 방법은 느립니다. → ○ 그러나 이 방법은 느립니다.
|
|
40
|
+
3. 쉼표 없이는 읽기 어려울 만큼 절이 많이 이어지면 쉼표를 더하지 말고 문장을 나눕니다. 한 문장에 절은 둘까지가 적당합니다.
|
|
41
|
+
|
|
42
|
+
### 2. 가운뎃점으로 나열하지 않습니다
|
|
43
|
+
|
|
44
|
+
산문에서 가운뎃점(·)으로 낱말을 묶는 것은 조사를 생략하는 압축입니다.
|
|
45
|
+
|
|
46
|
+
1. 명사 둘은 '와/과'나 '및'으로 잇고 셋 이상은 쉼표로 나열하다가 마지막을 '와/과'로 맺습니다.
|
|
47
|
+
- ✗ 직급·처우가 맞지 않습니다 → ○ 직급과 처우가 맞지 않습니다
|
|
48
|
+
- ✗ 제안·승인·제거 상태 → ○ 제안, 승인, 제거 상태
|
|
49
|
+
2. 동사를 가운뎃점으로 묶지 않습니다.
|
|
50
|
+
- ✗ 커밋·푸시했습니다 → ○ 커밋하고 푸시했습니다
|
|
51
|
+
3. 엠대시와 대시(-)도 문장 구분에 쓰지 않습니다. 대신 문장을 나누거나 쉼표를 쓰고 설명을 붙일 때는 콜론을 씁니다.
|
|
52
|
+
4. 예외는 표의 칸, 짧은 제목 라벨, 이미 굳은 표기('한·중 관계', '남·북')입니다.
|
|
53
|
+
|
|
54
|
+
### 3. 문장을 끝까지 씁니다
|
|
55
|
+
|
|
56
|
+
1. 의미를 담은 조사와 어미를 생략하지 않습니다. 명사구나 연결어미로 문장을 끝내지 말고 서술어로 맺습니다. 목록 항목과 제목은 예외입니다.
|
|
57
|
+
- ✗ STALE이면 재생성 안 해서 옛 자산으로 렌더 시도한 게 원인. → ○ STALE이면 스틸을 재생성하지 않아 옛 자산으로 렌더한 것이 원인입니다.
|
|
58
|
+
2. '의'를 연달아 쓰면 낱말 사이의 관계가 흐려집니다. 한 번은 동사나 형용사로 풀어 관계를 드러냅니다.
|
|
59
|
+
- ✗ 라우팅 규칙의 위임 대상의 모델의 이름 → ○ 라우팅 규칙이 위임하는 모델의 이름
|
|
60
|
+
3. 일반 어휘를 써야 할 곳에 비유어를 쓰지 않습니다. 분야에서 관용으로 굳은 표현은 그대로 둡니다.
|
|
61
|
+
- ✗ 옛 지침을 걷어내고 → ○ 옛 지침을 없애고
|
|
62
|
+
|
|
63
|
+
### 4. 정형화된 구성을 피합니다
|
|
64
|
+
|
|
65
|
+
아래 꼴은 한 번만 쓰면 문제가 없지만 반복되면 기계가 쓴 글로 읽힙니다.
|
|
66
|
+
|
|
67
|
+
1. 'A가 아니라 B' 대조는 한 글에 한 번까지만 씁니다. 대부분은 B만 말하면 충분합니다.
|
|
68
|
+
2. '~하는 건 X입니다'처럼 마지막에 명사를 터뜨리는 문장으로 문단을 끝내지 않습니다. 주어와 서술어를 바로 잇습니다.
|
|
69
|
+
- ✗ 결국 돌아오는 건 청구서 한 장입니다. → ○ 결국 청구서만 늘었습니다.
|
|
70
|
+
3. 수사적 질문을 던지고 곧바로 답하지 않습니다.
|
|
71
|
+
- ✗ 해답은 무엇일까요? 바로 캐시입니다. → ○ 해답은 캐시입니다.
|
|
72
|
+
4. 인용구처럼 들리는 경구나 극적인 반전으로 글을 맺지 않습니다. 마지막 문장에도 정보를 담습니다.
|
|
73
|
+
5. 근거 없이 긍정적으로 끝맺지 않습니다. '앞으로의 발전이 기대됩니다' 같은 마무리는 내용이 뒷받침할 때만 씁니다.
|
|
74
|
+
6. '지금부터 살펴보겠습니다' 같은 도입 문장과 '결론적으로' 같은 마무리 표지는 본문이 짧으면 빼고 바로 내용을 적습니다.
|
|
75
|
+
|
|
76
|
+
### 5. 구체적으로 씁니다
|
|
77
|
+
|
|
78
|
+
1. '다양한', '효과적으로', '성공적으로', '핵심적인' 같은 수식어는 구체적인 정보로 바꾸고 바꿀 정보가 없으면 지웁니다.
|
|
79
|
+
- ✗ 다양한 분야에서 활용됩니다 → ○ 금융과 의료 분야에서 활용됩니다
|
|
80
|
+
2. '영향이 큽니다'나 '구조적인 문제입니다' 같은 막연한 선언 대신 무엇이 얼마나 달라지는지 적습니다.
|
|
81
|
+
3. 판단이 있으면 판단을 적습니다. 장단점을 고르게 늘어놓고 결론을 독자에게 미루지 않습니다.
|
|
82
|
+
|
|
83
|
+
### 6. 번역투를 고칩니다
|
|
84
|
+
|
|
85
|
+
1. 이중 피동을 쓰지 않습니다.
|
|
86
|
+
- ✗ 보여집니다, 쓰여진, 되어지고 → ○ 보입니다, 쓰인, 되고
|
|
87
|
+
2. 행위자가 분명하면 능동으로 씁니다.
|
|
88
|
+
- ✗ 설정 파일이 훅에 의해 읽힌다 → ○ 훅이 설정 파일을 읽는다
|
|
89
|
+
3. 굳은 번역투는 바꿉니다.
|
|
90
|
+
- ✗ 노력하지 않으면 안 됩니다 → ○ 노력해야 합니다
|
|
91
|
+
- ✗ 모든 분야에 있어서 → ○ 모든 분야에서
|
|
92
|
+
4. 속성을 '가지다'로 서술하지 않습니다.
|
|
93
|
+
- ✗ 세 가지 장점을 가진다 → ○ 장점이 세 가지 있다
|
|
94
|
+
5. 영어 병기는 용어가 처음 나올 때 한 번만 합니다.
|
|
95
|
+
|
|
96
|
+
### 7. 문장을 잇습니다
|
|
97
|
+
|
|
98
|
+
1. 문장 앞부분에는 독자가 이미 아는 정보를, 뒷부분에는 새 정보를 놓습니다. 다음 문장은 앞 문장이 끝에 내놓은 정보를 받아 시작합니다.
|
|
99
|
+
2. '이', '그', '이러한'이 무엇을 가리키는지 바로 답할 수 없으면 그 명사를 다시 적습니다.
|
|
100
|
+
3. 한 문단 안에서는 주어를 유지합니다.
|
|
101
|
+
4. 접속어는 논리 관계가 실제로 있을 때만 씁니다. '또한'과 '그리고'가 되풀이되면 문장 순서부터 다시 잡습니다.
|
|
102
|
+
5. 뒤 문장이 전제하는 조건은 앞 문장이 미리 준비합니다.
|
|
103
|
+
6. 같은 대상을 되풀이하는 짧은 문장은 관형절로 합칩니다. 쉼표와 연결어미로 절을 계속 이어 붙이는 방식으로 합치지 않습니다.
|
|
104
|
+
- ✗ 토끼는 잠을 잤고, 거북이는 걸었고, 거북이가 이겼다.
|
|
105
|
+
- ○ 잠을 잔 토끼와 달리 거북이는 꾸준히 걸어 경주에서 이겼다.
|
|
106
|
+
7. 이어지는 두 문장을 같은 서술어로 끝내지 않습니다.
|
|
107
|
+
|
|
108
|
+
### 8. 고치지 말아야 할 것
|
|
109
|
+
|
|
110
|
+
1. '~를 통해'와 '~것이다'는 사람이 LLM보다 두 배쯤 더 쓰는 표현입니다. 일괄로 바꾸지 말고 한 문단에서 되풀이될 때만 고칩니다.
|
|
111
|
+
2. 전문 용어와 정착된 표기는 원형을 유지합니다.
|
|
112
|
+
3. 문어체는 오류가 아닙니다.
|
|
113
|
+
4. 검사 도구의 지적은 확인 요청입니다. 굳은 표현이라 판단해 유지할 때는 그 이유를 한 줄로 남깁니다.
|
|
114
|
+
|
|
115
|
+
### 9. 소리 내어 읽어 봅니다
|
|
116
|
+
|
|
117
|
+
사람이 읽을 글은 내기 전에 머릿속으로 소리 내어 읽어 봅니다. 숨이 차는 문장은 나누고 말로는 하지 않을 표현은 바꿉니다.
|
package/src/brief.js
CHANGED
|
@@ -266,7 +266,7 @@ export async function runBrief({ sessionId, transcriptPath, root = process.cwd()
|
|
|
266
266
|
|
|
267
267
|
if (items.length === 0) return null;
|
|
268
268
|
const lines = [
|
|
269
|
-
'[sprag 브리핑] 아래 상태 변화를 사용자에게 알려주세요. 진행 중인 답변 흐름을 끊지 말고, 답변 말미에
|
|
269
|
+
'✇ [sprag 브리핑] 아래 상태 변화를 사용자에게 알려주세요. 진행 중인 답변 흐름을 끊지 말고, 답변 말미에 `✇ [sprag]` 라벨을 달아 각 항목을 1~2줄로 요약해 전달하면 됩니다 (이 브리핑은 항목당 한 번만 주입됩니다):',
|
|
270
270
|
];
|
|
271
271
|
for (const it of items) lines.push(`- ${it}`);
|
|
272
272
|
return lines.join('\n');
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Terminal cell width of a string, for laying out lines that must not overflow.
|
|
3
|
+
*
|
|
4
|
+
* `String.length` is wrong for this twice over: emoji and Hangul take two cells
|
|
5
|
+
* while a variation selector or ZWJ takes none, and ANSI colour sequences take
|
|
6
|
+
* no cells at all. Characters are measured per grapheme cluster, because a
|
|
7
|
+
* terminal draws a cluster (a flag, `✍️`) as one glyph.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
// CSI and OSC (hyperlink) sequences; shared with the Codex panel's sanitizer.
|
|
11
|
+
const ANSI = /\x1b(?:\[[0-?]*[ -/]*[@-~]|\][^\x07\x1b]*(?:\x07|\x1b\\))/g;
|
|
12
|
+
const graphemes = new Intl.Segmenter('en', { granularity: 'grapheme' });
|
|
13
|
+
const MARKS_ONLY = /^[\p{Mark}\u200d]+$/u;
|
|
14
|
+
const EMOJI_PRESENTATION = /\p{Emoji_Presentation}/u;
|
|
15
|
+
|
|
16
|
+
// East Asian Wide ranges that matter for what sprag prints (Hangul, CJK, kana,
|
|
17
|
+
// fullwidth forms). Not the full UAX #11 table: a miss costs one cell of slack.
|
|
18
|
+
function isWide(cp) {
|
|
19
|
+
return (cp >= 0x1100 && cp <= 0x115f)
|
|
20
|
+
|| (cp >= 0x2e80 && cp <= 0xa4cf)
|
|
21
|
+
|| (cp >= 0xac00 && cp <= 0xd7a3)
|
|
22
|
+
|| (cp >= 0xf900 && cp <= 0xfaff)
|
|
23
|
+
|| (cp >= 0xfe30 && cp <= 0xfe4f)
|
|
24
|
+
|| (cp >= 0xff00 && cp <= 0xff60)
|
|
25
|
+
|| (cp >= 0xffe0 && cp <= 0xffe6)
|
|
26
|
+
|| (cp >= 0x20000 && cp <= 0x3fffd);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function cellWidth(text) {
|
|
30
|
+
const plain = String(text ?? '').replace(ANSI, '');
|
|
31
|
+
// ASCII fast path: the statusline renders every few seconds.
|
|
32
|
+
if (/^[\x20-\x7e]*$/.test(plain)) return plain.length;
|
|
33
|
+
let width = 0;
|
|
34
|
+
for (const { segment } of graphemes.segment(plain)) {
|
|
35
|
+
if (MARKS_ONLY.test(segment)) continue;
|
|
36
|
+
const cp = segment.codePointAt(0);
|
|
37
|
+
width += segment.includes('\ufe0f') || cp >= 0x1f000 || EMOJI_PRESENTATION.test(segment) || isWide(cp) ? 2 : 1;
|
|
38
|
+
}
|
|
39
|
+
return width;
|
|
40
|
+
}
|
package/src/codex/harness.js
CHANGED
|
@@ -227,11 +227,19 @@ export function codexErrorSignature(ev, { cwd, home = homedir() } = {}) {
|
|
|
227
227
|
return `${head}: ${text}`;
|
|
228
228
|
}
|
|
229
229
|
|
|
230
|
+
/**
|
|
231
|
+
* Whether tool output is Sprag's own feedback. Output left by older versions has no leading
|
|
232
|
+
* glyph (`[sprag ...`) or the old fitting-line glyph (`🔀 [sprag] ...`), so the prefix is optional.
|
|
233
|
+
*/
|
|
234
|
+
export function isSpragFeedback(output) {
|
|
235
|
+
return /^(?:(?:✇|🔀) )?\[(?:korean-style|claude-token-saver|sprag)/.test(String(output || '').trim());
|
|
236
|
+
}
|
|
237
|
+
|
|
230
238
|
/** Whether a failure is worth remembering, rather than a probe or Sprag's own feedback. */
|
|
231
239
|
function countable(ev) {
|
|
232
240
|
if (!ev.failed) return false;
|
|
233
241
|
// Sprag's write lint rewrites the tool output; that is feedback, not a mistake to learn from.
|
|
234
|
-
if (
|
|
242
|
+
if (isSpragFeedback(ev.output)) return false;
|
|
235
243
|
if (ev.kind === 'patch') return true;
|
|
236
244
|
// `rg` finding nothing and `ls` on an absent path are how exploration works.
|
|
237
245
|
const types = (ev.parsed || []).map((c) => c?.type);
|
package/src/codex/panel.js
CHANGED
|
@@ -24,6 +24,7 @@ import { codexRulesInReview, codexSharedRuleHealth } from './rule-health.js';
|
|
|
24
24
|
import { readCodexRouteScan, openCodexCandidates } from './route-scan.js';
|
|
25
25
|
import { codexBudgetProvider } from './budget.js';
|
|
26
26
|
import { readUpdateChip } from '../update-notice.js';
|
|
27
|
+
import { cellWidth } from '../cell-width.js';
|
|
27
28
|
|
|
28
29
|
const CODEX_SUPPORTED_SEGMENTS = new Set([
|
|
29
30
|
'cap-warn', 'spike', 'usage', 'ctx', 'ttl', 'model', 'effort',
|
|
@@ -223,8 +224,7 @@ function sessionLabel(data) {
|
|
|
223
224
|
// Labels from logs are ASCII-sanitized; only our known glyphs need wide cells.
|
|
224
225
|
const graphemes = new Intl.Segmenter('en', { granularity: 'grapheme' });
|
|
225
226
|
export function panelCellWidth(text) {
|
|
226
|
-
return
|
|
227
|
-
n + (/^[\p{Mark}\u200d]+$/u.test(segment) ? 0 : segment.includes('\ufe0f') || segment.codePointAt(0) >= 0x1f000 ? 2 : 1), 0);
|
|
227
|
+
return cellWidth(text);
|
|
228
228
|
}
|
|
229
229
|
|
|
230
230
|
function panelGroups(data, { now, version = '', full = false, mode = full ? 'text' : data.labelMode || 'icon' }) {
|
package/src/cohesion.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* cohesion — English sentence-connection guidance injected at session start.
|
|
3
3
|
*
|
|
4
|
-
* The
|
|
4
|
+
* The cohesion section of the Korean rules turned out to be language-neutral:
|
|
5
5
|
* given-before-new ordering, one referent per pronoun, subject consistency,
|
|
6
6
|
* bridging instead of leaping, merging choppy sentences. English-only users
|
|
7
7
|
* never run `korean on`, so those rules never reached them. This module ships
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* Enable with `sprag cohesion on`.
|
|
13
13
|
*
|
|
14
14
|
* When the Korean guidance is enabled, this block is NOT injected even if
|
|
15
|
-
* enabled: the Korean
|
|
15
|
+
* enabled: the Korean rules already carry the cohesion clauses, and
|
|
16
16
|
* injecting the same principles twice bills them twice.
|
|
17
17
|
*/
|
|
18
18
|
|
|
@@ -51,7 +51,7 @@ export function cohesionText() {
|
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
53
|
* Block to inject at session start, or null when disabled, unavailable, or
|
|
54
|
-
* redundant (Korean guidance on
|
|
54
|
+
* redundant (Korean guidance on: its rules already carry these clauses).
|
|
55
55
|
*/
|
|
56
56
|
export async function cohesionInjection({ cfg = loadConfig() } = {}) {
|
|
57
57
|
if (!cohesionEnabled(cfg)) return null;
|
|
@@ -62,7 +62,7 @@ export async function cohesionInjection({ cfg = loadConfig() } = {}) {
|
|
|
62
62
|
const text = cohesionText();
|
|
63
63
|
if (!text) return null;
|
|
64
64
|
return [
|
|
65
|
-
'[sprag cohesion] Follow this guidance for English prose in this session.',
|
|
65
|
+
'✇ [sprag cohesion] Follow this guidance for English prose in this session.',
|
|
66
66
|
'The user enabled it in sprag.',
|
|
67
67
|
'',
|
|
68
68
|
text,
|
package/src/commands/cohesion.js
CHANGED
|
@@ -27,7 +27,7 @@ export async function run({ args }) {
|
|
|
27
27
|
if (koreanStyleEnabled()) {
|
|
28
28
|
console.log(lang === 'ko'
|
|
29
29
|
? '참고: korean 지침이 켜져 있는 동안에는 같은 원칙이 이미 들어가므로 이 블록은 주입되지 않습니다.'
|
|
30
|
-
: 'Note: while the Korean guidance is on, its
|
|
30
|
+
: 'Note: while the Korean guidance is on, its rules already carry these clauses, so this block is not injected.');
|
|
31
31
|
}
|
|
32
32
|
} else {
|
|
33
33
|
console.log(lang === 'ko' ? 'cohesion off: 더 이상 주입하지 않습니다.' : 'cohesion off — no longer injected.');
|
package/src/commands/install.js
CHANGED
|
@@ -279,20 +279,20 @@ export async function run({ hasFlag }) {
|
|
|
279
279
|
const detected = ks.koreanLocaleDetected();
|
|
280
280
|
console.log('');
|
|
281
281
|
console.log(lang === 'ko'
|
|
282
|
-
? ' korean: 한국어 문체
|
|
283
|
-
: ' korean: Korean
|
|
282
|
+
? ' korean: 한국어 문체 규칙을 세션 시작 시 주입할 수 있습니다.'
|
|
283
|
+
: ' korean: Korean style rules can be injected at session start.');
|
|
284
284
|
console.log(lang === 'ko'
|
|
285
|
-
? ' 내용:
|
|
286
|
-
: ' what it does:
|
|
285
|
+
? ' 내용: 연결어미 뒤 쉼표와 가운뎃점 나열처럼 기계가 쓴 티가 나는 습관을 줄이고'
|
|
286
|
+
: ' what it does: curbs the habits that mark Korean as machine-written (commas after');
|
|
287
287
|
console.log(lang === 'ko'
|
|
288
|
-
? '
|
|
289
|
-
: '
|
|
288
|
+
? ' 문장을 끝까지 쓰며 번역투를 고치도록 지시합니다. 기본 범위는 코드 주석과 문자열까지 포함하고 `korean lint scope prose` 로 산문만 검사하도록 좁힐 수 있습니다.'
|
|
289
|
+
: ' connective endings, middle-dot lists), keeps sentences complete, and fixes translationese. The default scope includes code comments and strings; `korean lint scope prose` narrows it to prose.');
|
|
290
290
|
console.log(lang === 'ko'
|
|
291
|
-
? ' 비용: 세션당 약 1.
|
|
292
|
-
: ' cost: ~1.
|
|
291
|
+
? ' 비용: 세션당 약 1.8k 토큰(턴마다가 아니라 세션 시작 시 1회, 이후 프롬프트 캐시에 포함).'
|
|
292
|
+
: ' cost: ~1.8k tokens per session (once at session start, cached from the second request on).');
|
|
293
293
|
console.log(lang === 'ko'
|
|
294
|
-
? `
|
|
295
|
-
: `
|
|
294
|
+
? ` 근거: ${ks.KOREAN_STYLE_SOURCE}`
|
|
295
|
+
: ` evidence: ${ks.KOREAN_STYLE_SOURCE}`);
|
|
296
296
|
console.log(lang === 'ko'
|
|
297
297
|
? ` 감지된 환경: ${detected ? '한국어 (기본값 켬)' : '한국어 아님 (기본값 끔)'}`
|
|
298
298
|
: ` detected locale: ${detected ? 'Korean (default on)' : 'not Korean (default off)'}`);
|
package/src/commands/korean.js
CHANGED
|
@@ -240,8 +240,8 @@ export async function run({ args, hasFlag }) {
|
|
|
240
240
|
? ' 주입 시점: 세션 시작 1회 (매 턴이 아니므로 두 번째 요청부터는 캐시에 올라갑니다)'
|
|
241
241
|
: ' Injected once per session (not per turn), so it rides the prompt cache from the second request on.');
|
|
242
242
|
console.log(lang === 'ko'
|
|
243
|
-
? `
|
|
244
|
-
: `
|
|
243
|
+
? ` 근거와 참고 문헌: ${ks.KOREAN_STYLE_SOURCE}`
|
|
244
|
+
: ` Evidence and references: ${ks.KOREAN_STYLE_SOURCE}`);
|
|
245
245
|
if (hook.action === 'skipped') {
|
|
246
246
|
console.log(lang === 'ko'
|
|
247
247
|
? ` ⚠ 쓰기 시점 검사 훅을 못 걸었습니다: ${hook.reason}`
|
|
@@ -270,8 +270,7 @@ export async function run({ args, hasFlag }) {
|
|
|
270
270
|
console.log(` 비용: 세션당 약 ${tokens} 토큰 (세션 시작 1회 주입)`);
|
|
271
271
|
console.log(` 쓰기 시점 검사: ${koreanLintMode(loadConfig())}, 범위 ${koreanLintScope(loadConfig())} (바꾸려면 sprag korean lint block|warn|off, korean lint scope all|prose)`);
|
|
272
272
|
console.log(` 답변 언어 검사: ${koreanReplyCheckOn(loadConfig()) ? '켜짐' : '꺼짐'} (바꾸려면 sprag korean reply on|off)`);
|
|
273
|
-
console.log(`
|
|
274
|
-
console.log(` 라이선스 전문: ${ks.KOREAN_STYLE_LICENSE_PATH}`);
|
|
273
|
+
console.log(` 근거와 참고 문헌: ${ks.KOREAN_STYLE_SOURCE}`);
|
|
275
274
|
console.log(on
|
|
276
275
|
? ' 끄려면: sprag korean off'
|
|
277
276
|
: ' 켜려면: sprag korean on');
|
|
@@ -280,8 +279,7 @@ export async function run({ args, hasFlag }) {
|
|
|
280
279
|
console.log(` Cost: ~${tokens} tokens per session (injected once at session start)`);
|
|
281
280
|
console.log(` Write-time check: ${koreanLintMode(loadConfig())}, scope ${koreanLintScope(loadConfig())} (change with: sprag korean lint block|warn|off, korean lint scope all|prose)`);
|
|
282
281
|
console.log(` Reply-language check: ${koreanReplyCheckOn(loadConfig()) ? 'on' : 'off'} (change with: sprag korean reply on|off)`);
|
|
283
|
-
console.log(`
|
|
284
|
-
console.log(` License text: ${ks.KOREAN_STYLE_LICENSE_PATH}`);
|
|
282
|
+
console.log(` Evidence and references: ${ks.KOREAN_STYLE_SOURCE}`);
|
|
285
283
|
console.log(on
|
|
286
284
|
? ' Turn off with: sprag korean off'
|
|
287
285
|
: ' Turn on with: sprag korean on');
|
|
@@ -410,9 +410,18 @@ export async function run({ args, hasFlag, numArg }) {
|
|
|
410
410
|
if (pkgVersion) updateBlock = updateOffer(pkgVersion, { agent: 'claude', lang });
|
|
411
411
|
} catch (e) { debug('route-scan:update-check', e); /* the offer is optional */ }
|
|
412
412
|
|
|
413
|
+
// Once-a-month nudge to reset the saved counters; null unless they have
|
|
414
|
+
// gone a whole month without one and there is something to reset.
|
|
415
|
+
let monthlyResetBlock = null;
|
|
416
|
+
try {
|
|
417
|
+
const { monthlyResetOffer, offersOnSessionSource } = await import('../monthly-reset-offer.js');
|
|
418
|
+
if (offersOnSessionSource(hookCtx.source)) monthlyResetBlock = monthlyResetOffer({ lang });
|
|
419
|
+
} catch (e) { debug('route-scan:monthly-reset', e); /* the offer is optional */ }
|
|
420
|
+
|
|
413
421
|
if (open.length === 0 && reviewRules.length === 0) {
|
|
414
422
|
if (teamBlock) console.log(teamBlock);
|
|
415
423
|
if (updateBlock) console.log(updateBlock);
|
|
424
|
+
if (monthlyResetBlock) console.log(monthlyResetBlock);
|
|
416
425
|
if (driftBlock) console.log(driftBlock);
|
|
417
426
|
if (seedBlock) console.log(seedBlock);
|
|
418
427
|
if (doc2mdBlock) console.log(doc2mdBlock);
|
|
@@ -422,6 +431,7 @@ export async function run({ args, hasFlag, numArg }) {
|
|
|
422
431
|
}
|
|
423
432
|
if (teamBlock) console.log(teamBlock);
|
|
424
433
|
if (updateBlock) console.log(updateBlock);
|
|
434
|
+
if (monthlyResetBlock) console.log(monthlyResetBlock);
|
|
425
435
|
if (driftBlock) console.log(driftBlock);
|
|
426
436
|
if (seedBlock) console.log(seedBlock);
|
|
427
437
|
if (doc2mdBlock) console.log(doc2mdBlock);
|
|
@@ -431,10 +441,10 @@ export async function run({ args, hasFlag, numArg }) {
|
|
|
431
441
|
const lines = [];
|
|
432
442
|
if (open.length > 0) {
|
|
433
443
|
if (lang === 'ko') {
|
|
434
|
-
lines.push(
|
|
444
|
+
lines.push(`✇ [sprag route-scan] 최근 ${cache.days}일 세션에서 비싼 모델(opus/fable)이 반복 처리해 온, 더 싼 모델로 넘겨도 되는 작업이 감지되었습니다.`);
|
|
435
445
|
lines.push('(R<N>은 후보 번호, T2/T1/T1H는 난이도 등급입니다 — 사용자에게 전달할 때는 코드가 아니라 아래 풀어쓴 설명으로 브리핑하세요)');
|
|
436
446
|
} else {
|
|
437
|
-
lines.push(
|
|
447
|
+
lines.push(`✇ [sprag route-scan] Over the last ${cache.days} days, expensive models (opus/fable) repeatedly handled work that a cheaper model could take.`);
|
|
438
448
|
lines.push('(R<N> is the candidate id, T2/T1/T1H the difficulty tier — brief the user with the spelled-out wording below, not the codes.)');
|
|
439
449
|
}
|
|
440
450
|
for (const c of open) {
|
|
@@ -465,8 +475,8 @@ export async function run({ args, hasFlag, numArg }) {
|
|
|
465
475
|
}
|
|
466
476
|
if (reviewRules.length > 0) {
|
|
467
477
|
lines.push(lang === 'ko'
|
|
468
|
-
? '[sprag rule-health] 사용자가 승인한 위임 룰 중, 위임 대상 유형의 최근 에러율이 룰별 기준을 넘어 재검토가 필요한 룰이 있습니다. 사용자에게 브리핑하고 조건 좁히기/제거를 상의하세요:'
|
|
469
|
-
: '[sprag rule-health] Some user-approved delegation rules now exceed their error-rate threshold for the delegated category — brief the user and discuss narrowing or removing them:');
|
|
478
|
+
? '✇ [sprag rule-health] 사용자가 승인한 위임 룰 중, 위임 대상 유형의 최근 에러율이 룰별 기준을 넘어 재검토가 필요한 룰이 있습니다. 사용자에게 브리핑하고 조건 좁히기/제거를 상의하세요:'
|
|
479
|
+
: '✇ [sprag rule-health] Some user-approved delegation rules now exceed their error-rate threshold for the delegated category — brief the user and discuss narrowing or removing them:');
|
|
470
480
|
for (const r of reviewRules) {
|
|
471
481
|
// Say WHICH signal tripped: a measured delegation failure rate is a
|
|
472
482
|
// much stronger claim than the shape-based proxy, and the user's
|
|
@@ -487,8 +497,8 @@ export async function run({ args, hasFlag, numArg }) {
|
|
|
487
497
|
: ' remove with: sprag route-scan rules rm <N>');
|
|
488
498
|
}
|
|
489
499
|
lines.push(lang === 'ko'
|
|
490
|
-
? '위 내용은 사용자의 첫 메시지 주제와 무관하더라도(단순 인사여도) 첫 응답 말미에
|
|
491
|
-
: 'Summarize the above at the end of your first response under a
|
|
500
|
+
? '위 내용은 사용자의 첫 메시지 주제와 무관하더라도(단순 인사여도) 첫 응답 말미에 `✇ [sprag]` 라벨을 달아 요약 브리핑하세요 — 사용자가 물어볼 때까지 기다리지 말 것.'
|
|
501
|
+
: 'Summarize the above at the end of your first response under a `✇ [sprag]` label, even if the user\'s first message is unrelated (a bare greeting counts) — do not wait to be asked.');
|
|
492
502
|
// Style first, briefing second: the briefing is Korean prose too, so the
|
|
493
503
|
// guidance has to be in context before the model reads it.
|
|
494
504
|
if (koreanBlock) console.log(koreanBlock + '\n');
|
package/src/delegation-agents.js
CHANGED
|
@@ -205,8 +205,8 @@ export function takeAgentDriftNotice({ lang = 'ko' } = {}) {
|
|
|
205
205
|
const v = (x) => x || '-';
|
|
206
206
|
return [
|
|
207
207
|
ko
|
|
208
|
-
?
|
|
209
|
-
:
|
|
208
|
+
? `✇ [sprag agents] 프리셋 ${label}이 지정한 값과 다른 직접 만든 에이전트 파일이 있어서, sync가 이 파일들을 덮어쓰지 않았습니다.`
|
|
209
|
+
: `✇ [sprag agents] Some agent files you made yourself differ from what preset ${label} specifies, so sync did not overwrite them.`,
|
|
210
210
|
...drift.map((d) => ko
|
|
211
211
|
? `- ${d.name}: 파일 effort ${v(d.file.effort)} · 모델 ${v(d.file.model)}, 프리셋 effort ${v(d.preset.effort)} · 모델 ${v(d.preset.model)}`
|
|
212
212
|
: `- ${d.name}: file effort ${v(d.file.effort)} · model ${v(d.file.model)}, preset effort ${v(d.preset.effort)} · model ${v(d.preset.model)}`),
|