@dsh-cc/input-budget 0.9.5 → 0.9.6-rc.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/README.i18n.yaml +2 -2
- package/README.md +18 -14
- package/README.zh.md +18 -14
- package/package.json +6 -6
package/README.i18n.yaml
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
3
|
# after editing either side, bring the other along and re-record with:
|
|
4
4
|
# pnpm check:readme --write
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: 00657e07ba81dceb766f245de19058d1900302d8
|
|
6
|
+
README.zh.md: ad67005fda09cfa1b7e1f8f8c6f2a987fbfd235a
|
package/README.md
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
English | [中文](README.zh.md)
|
|
4
4
|
|
|
5
|
-
Per-step input budget governor for the context-engineering input-governance program: one outermost gate over the final `agent/pre-step` enter batch, arbitrating producer content by class and byte budget
|
|
5
|
+
Per-step input budget governor for the context-engineering input-governance program: one outermost gate over the final `agent/pre-step` enter batch, arbitrating producer content by class and byte budget. Three layers ship together: the pure core (`govern()` — a function of its arguments, so the whole algorithm is testable without a runtime), the `agent/pre-step` listener the preset's `input-budget` row mounts, and the row emission that persists one `GovernorRow` per gate invocation through `@dsh-cc/input-ledger`. It ships observe-first: in observe mode the batch is returned untouched and only the decisions are recorded.
|
|
6
6
|
|
|
7
7
|
## Classes — explicit membership only
|
|
8
8
|
|
|
9
|
-
Membership is closed and explicit
|
|
9
|
+
Membership is closed and explicit. Anything unlisted — an unknown kind, a late plugin, an absent or empty `source.kind` — is `passthrough` **by construction**, so unenumerated producers are never trimmed and never deferred.
|
|
10
10
|
|
|
11
11
|
| class | kinds | policy |
|
|
12
12
|
|---|---|---|
|
|
@@ -16,23 +16,23 @@ Membership is closed and explicit 〔src:ws:docs/plans/2026-11-12-per-step-input
|
|
|
16
16
|
| `advisory` | `advisor`, `retry-attendant`, `compaction-micro`, `compaction-cost-gate` | trim/defer FIFO under `advisory-budget-bytes` |
|
|
17
17
|
| `passthrough` | `cc-shell-glue` (v1 hard rule), `command-preset`, `side-query`, `tool-web-fetch`, `tool-registry`, named harness kinds, everything else | never trim, never defer; counted |
|
|
18
18
|
|
|
19
|
-
`cc-shell-glue` sits in `passthrough` in v1 as an **algorithmic rule**, not an annotation: `mcpReadyNotice` commits its once-per-session latch *before* returning the notice, so any enforced trim, defer or oversize drop of a glue notice would be a silent one-shot miss
|
|
19
|
+
`cc-shell-glue` sits in `passthrough` in v1 as an **algorithmic rule**, not an annotation: `mcpReadyNotice` commits its once-per-session latch *before* returning the notice, so any enforced trim, defer or oversize drop of a glue notice would be a silent one-shot miss. `memory` and `advisory` are the only budgeted classes; a 12 KiB memory entry is judged against `memory-budget-bytes`, never against the advisory limit.
|
|
20
20
|
|
|
21
21
|
## Budget model (per enter batch)
|
|
22
22
|
|
|
23
|
-
1. Classify each message; compute per-class UTF-8 bytes (text blocks only — the same measurement `@dsh-cc/input-ledger` records, so the two row families agree byte for byte)
|
|
23
|
+
1. Classify each message; compute per-class UTF-8 bytes (text blocks only — the same measurement `@dsh-cc/input-ledger` records, so the two row families agree byte for byte).
|
|
24
24
|
2. `governance` / `task` / `passthrough`: never modified, never charged.
|
|
25
25
|
3. `memory`: while memory bytes exceed `memory-budget-bytes`, trim the oldest memory message (whole message, FIFO).
|
|
26
26
|
4. `advisory`: while advisory bytes exceed `advisory-budget-bytes`, trim the oldest advisory message.
|
|
27
|
-
5. Enter budget: if the batch total exceeds `enter-budget-bytes`, trim advisory (then memory) further. If the budget cannot be met within the trimmable classes, nothing further is trimmed, protected classes are untouched, and `hardOver` records the overflow
|
|
27
|
+
5. Enter budget: if the batch total exceeds `enter-budget-bytes`, trim advisory (then memory) further. If the budget cannot be met within the trimmable classes, nothing further is trimmed, protected classes are untouched, and `hardOver` records the overflow.
|
|
28
28
|
|
|
29
29
|
A trimmed message whose own bytes alone exceed its class budget is dropped `drop-oversize` immediately and never enqueued — defer-then-drop would record a deferral that could never succeed.
|
|
30
30
|
|
|
31
31
|
## Defer queue
|
|
32
32
|
|
|
33
|
-
Per-session backlog of `{ message, enqueuedAtSeq, lastOfferedSeq }`, all values in `gateSeq` units. `gateSeq` is a **monotonic per-session invocation counter** incremented on every gate call; `agent/pre-step`'s `step` is turn-local and is never used
|
|
33
|
+
Per-session backlog of `{ message, enqueuedAtSeq, lastOfferedSeq }`, all values in `gateSeq` units. `gateSeq` is a **monotonic per-session invocation counter** incremented on every gate call; `agent/pre-step`'s `step` is turn-local and is never used. `govern()` receives the counter and returns the next one; the listener owns it per session.
|
|
34
34
|
|
|
35
|
-
Each invocation, in order
|
|
35
|
+
Each invocation, in order:
|
|
36
36
|
|
|
37
37
|
1. **Age** — entries with `gateSeq - enqueuedAtSeq > defer-ttl-steps` drop `drop-expired`.
|
|
38
38
|
2. **Backlog admission** — walk the backlog FIFO and admit the head while the entry's **own** class budget has room (memory entries against `memory-budget-bytes`, advisory against `advisory-budget-bytes`, with this invocation's already-admitted bytes as `used`). Admitted entries lead this step's batch.
|
|
@@ -42,13 +42,17 @@ Each invocation, in order 〔src:ws:docs/plans/2026-11-12-per-step-input-budget-
|
|
|
42
42
|
|
|
43
43
|
## Observe mode
|
|
44
44
|
|
|
45
|
-
`mode: 'observe'` runs the identical fresh-batch computation and records the same rows under `mode: 'observe'`, but returns the incoming batch untouched, keeps no defer queue, simulates no backlog and emits no `drop-expired` rows. `drop-oversize` *is* possible in observe, because it is a fresh-batch computation
|
|
45
|
+
`mode: 'observe'` runs the identical fresh-batch computation and records the same rows under `mode: 'observe'`, but returns the incoming batch untouched, keeps no defer queue, simulates no backlog and emits no `drop-expired` rows. `drop-oversize` *is* possible in observe, because it is a fresh-batch computation. Because an observe invocation returns an empty backlog, an `observe → enforce` flip starts with an empty queue by construction — no cross-mode carryover.
|
|
46
46
|
|
|
47
47
|
## Wiring — listener, preset row, ledger emission
|
|
48
48
|
|
|
49
|
-
`registerGovernorListener(ctx)` registers one `agent/pre-step` listener with `{ prepend: true }`, so it runs **outermost** among the preset's pre-step rewriters and sees the final decision on the way back out; it is delegate-first (it awaits `next()` and then spreads the returned decision, replacing only the message batch) and it never throws into the waterfall
|
|
49
|
+
`registerGovernorListener(ctx)` registers one `agent/pre-step` listener with `{ prepend: true }`, so it runs **outermost** among the preset's pre-step rewriters and sees the final decision on the way back out; it is delegate-first (it awaits `next()` and then spreads the returned decision, replacing only the message batch) and it never throws into the waterfall. The preset row `input-budget` in the shared preset body mounts it through `apply()`, ordered after `tool-task` so the subagent strip-instructions/settled-notice pair stays inside the gate; the composition pin and the two live-fold ordering tests keep that boundary a tested property rather than an accident.
|
|
50
50
|
|
|
51
|
-
Rows leave through `createGovernorLedgerSink()`: one content-free `GovernorRow` per gate invocation, appended to `$DSH_HOME/input-ledger/<projectKey>/<sessionId>.jsonl`, the same sink and path convention the ledger's own observers use (the project bucket is the first 16 hex chars of `sha256(realpath(cwd))`, replicated locally because `@dsh-cc/input-ledger` keeps it private)
|
|
51
|
+
Rows leave through `createGovernorLedgerSink()`: one content-free `GovernorRow` per gate invocation, appended to `$DSH_HOME/input-ledger/<projectKey>/<sessionId>.jsonl`, the same sink and path convention the ledger's own observers use (the project bucket is the first 16 hex chars of `sha256(realpath(cwd))`, replicated locally because `@dsh-cc/input-ledger` keeps it private). The dependency is soft by design: with no dsh-home, no session cwd, or `cc-input-ledger.enabled: false` the governor still runs and rows are simply not persisted; an append failure is swallowed, debug-logged and counted in `getGovernorLedgerHealth().droppedRows` — never thrown into the waterfall and never awaited on the hot path. A governor exception returns the unmodified decision with an `{ error: true }` row, so a failing gate can never half-apply a batch.
|
|
52
|
+
|
|
53
|
+
## Governor pipeline
|
|
54
|
+
|
|
55
|
+
The exported pipeline seam fixes the stage order to `dedupe → caps → trim` and nothing else. `runGovernorPipeline(input, hooks?)` runs every `GovernorStageHook` of a stage over the batch the preceding stage produced, then hands the result to the trim stage, which is `govern()` itself. A hook sees the batch the listener received, namely the claimed enter batch after every inner `agent/pre-step` listener ran, and returns the batch the next stage evaluates. `GovernorStage` names the three stages and `GOVERNOR_STAGES` carries the frozen order as a runtime value. No dedupe or cap logic lives here yet, so both pre-trim stages take an empty hook list by default and the pipeline is the trim alone. A hook failure propagates to the listener, which returns the unmodified decision with `{ error: true }`, so a broken stage can never half-apply a batch.
|
|
52
56
|
|
|
53
57
|
## Arithmetic (pinned to the verified model)
|
|
54
58
|
|
|
@@ -56,13 +60,13 @@ Rows leave through `createGovernorLedgerSink()`: one content-free `GovernorRow`
|
|
|
56
60
|
|
|
57
61
|
## Row fields
|
|
58
62
|
|
|
59
|
-
`@dsh-cc/input-ledger` owns the row schema; this package supplies only `mode`, `bytesByClass`, `trimmed`, `offeredBacklog` and `hardOver
|
|
63
|
+
`@dsh-cc/input-ledger` owns the row schema; this package supplies only `mode`, `bytesByClass`, `trimmed`, `offeredBacklog` and `hardOver`. `trimmed` entries are `{ kind, bytes, action }` with `action` in `defer | drop-expired | drop-oversize`.
|
|
60
64
|
|
|
61
65
|
Conventions this package pins, because the design leaves them to the implementation: `bytesByClass` always carries all five class keys, in table order, measured over the **decision** batch (so observe and enforce agree); `offeredBacklog` is the backlog present when the invocation started (always 0 in observe mode); the decision batch is the admitted backlog entries first (they are older), then the surviving fresh messages in arrival order — no other reordering; and an entry whose bytes exceed its class budget is dropped `drop-oversize` during the backlog walk too, which is reachable only when the hot-read budgets shrank after enqueue.
|
|
62
66
|
|
|
63
67
|
## Settings — `cc-input-budget`
|
|
64
68
|
|
|
65
|
-
Kebab-key, user-layer settings, re-read per gate invocation so a toggle applies on the next step without a restart
|
|
69
|
+
Kebab-key, user-layer settings, re-read per gate invocation so a toggle applies on the next step without a restart.
|
|
66
70
|
|
|
67
71
|
| key | type | default | bounds |
|
|
68
72
|
|---|---|---|---|
|
|
@@ -93,7 +97,7 @@ const release = registerGovernorListener(ctx) // prepended agent/pre-step listen
|
|
|
93
97
|
|
|
94
98
|
## Caveats
|
|
95
99
|
|
|
96
|
-
- Observe mode is the ship default and the only mode exercised in production today; enforcement budgets are meant to be set from ledger data before flipping
|
|
100
|
+
- Observe mode is the ship default and the only mode exercised in production today; enforcement budgets are meant to be set from ledger data before flipping.
|
|
97
101
|
- Deferred messages re-enter only through the governor's own return value, never through `agent.inject`, so no extra claimed batches form.
|
|
98
|
-
- The two ordering defenses (live-fold producer-chain tests, the late-prepended-listener boundary) and the repo-wide kind enumeration scan are pinned in `tests/live-fold.spec.ts` and `tests/kinds-enumeration.spec.ts`; the enumeration hard-fails when the pinned harness checkout is missing
|
|
102
|
+
- The two ordering defenses (live-fold producer-chain tests, the late-prepended-listener boundary) and the repo-wide kind enumeration scan are pinned in `tests/live-fold.spec.ts` and `tests/kinds-enumeration.spec.ts`; the enumeration hard-fails when the pinned harness checkout is missing.
|
|
99
103
|
- Advisory starvation under sustained overload is bounded, not eliminated; per-kind caps are the sibling doc's job.
|
package/README.zh.md
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
[English](README.md) | 中文
|
|
4
4
|
|
|
5
|
-
上下文工程输入治理 program 的逐步输入预算 governor:对最终的 `agent/pre-step` enter
|
|
5
|
+
上下文工程输入治理 program 的逐步输入预算 governor:对最终的 `agent/pre-step` enter 批次施加唯一的最外层闸门,按类别与字节预算仲裁各生产者写入的内容。三层一并交付:纯核(`govern()`——只是其参数的函数,因此整个算法无需运行时即可单测)、预设 `input-budget` 行所挂载的 `agent/pre-step` 监听器,以及每次闸门调用写入一条 `GovernorRow` 的账本写入。出厂 observe 优先:observe 模式下批次原样返回,只记录决策。
|
|
6
6
|
|
|
7
7
|
## 类别——仅显式成员
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
成员集合封闭且显式。未列出的任何值——未知类别、后注册插件、缺失或空的 `source.kind`——由构造即归为 `passthrough`,因此未枚举的生产者永不被裁剪、永不被延迟。
|
|
10
10
|
|
|
11
11
|
| 类别 | 类别名(kind) | 策略 |
|
|
12
12
|
|---|---|---|
|
|
@@ -16,23 +16,23 @@
|
|
|
16
16
|
| `advisory` | `advisor`、`retry-attendant`、`compaction-micro`、`compaction-cost-gate` | 在 `advisory-budget-bytes` 下 FIFO 裁剪/延迟 |
|
|
17
17
|
| `passthrough` | `cc-shell-glue`(v1 硬规则)、`command-preset`、`side-query`、`tool-web-fetch`、`tool-registry`、已列名 harness kind、其余全部 | 永不裁剪、永不延迟;照常计量 |
|
|
18
18
|
|
|
19
|
-
`cc-shell-glue` 在 v1 落入 `passthrough` 是一条**算法规则**,不是注解:`mcpReadyNotice` 在返回通告**之前**就已提交其每会话一次闩锁,因此对 glue
|
|
19
|
+
`cc-shell-glue` 在 v1 落入 `passthrough` 是一条**算法规则**,不是注解:`mcpReadyNotice` 在返回通告**之前**就已提交其每会话一次闩锁,因此对 glue 通告的任何强制裁剪、延迟或超限丢弃都会变成静默的一次性丢失。`memory` 与 `advisory` 是唯二带预算的类别;一条 12 KiB 的 memory 记录按 `memory-budget-bytes` 判定,绝不以 advisory 限额判定。
|
|
20
20
|
|
|
21
21
|
## 预算模型(每个 enter 批次)
|
|
22
22
|
|
|
23
|
-
1. 逐条分类;计算各类 UTF-8 字节(仅文本块——与 `@dsh-cc/input-ledger`
|
|
23
|
+
1. 逐条分类;计算各类 UTF-8 字节(仅文本块——与 `@dsh-cc/input-ledger` 记录的口径相同,因此两族行逐字节一致)。
|
|
24
24
|
2. `governance` / `task` / `passthrough`:永不改动、永不计量入预算。
|
|
25
25
|
3. `memory`:只要 memory 字节超过 `memory-budget-bytes`,就裁剪最旧的 memory 消息(整条消息,FIFO)。
|
|
26
26
|
4. `advisory`:只要 advisory 字节超过 `advisory-budget-bytes`,就裁剪最旧的 advisory 消息。
|
|
27
|
-
5. Enter 预算:若批次总量超过 `enter-budget-bytes`,继续裁剪 advisory(其后 memory)。若在可裁剪类别内仍无法满足预算,则不再进一步裁剪、绝不触碰受保护类别,并由 `hardOver`
|
|
27
|
+
5. Enter 预算:若批次总量超过 `enter-budget-bytes`,继续裁剪 advisory(其后 memory)。若在可裁剪类别内仍无法满足预算,则不再进一步裁剪、绝不触碰受保护类别,并由 `hardOver` 记录溢出。
|
|
28
28
|
|
|
29
29
|
被裁剪消息若其自身字节单独就超过其类别预算,立即以 `drop-oversize` 丢弃且绝不入队——先延迟后丢弃会记录一次永远不可能成功的延迟。
|
|
30
30
|
|
|
31
31
|
## 延迟队列
|
|
32
32
|
|
|
33
|
-
每会话的 `{ message, enqueuedAtSeq, lastOfferedSeq }` backlog,全部取值以 `gateSeq` 为单位。`gateSeq` 是**单调的每会话调用计数**,每次闸门调用递增;`agent/pre-step` 的 `step`
|
|
33
|
+
每会话的 `{ message, enqueuedAtSeq, lastOfferedSeq }` backlog,全部取值以 `gateSeq` 为单位。`gateSeq` 是**单调的每会话调用计数**,每次闸门调用递增;`agent/pre-step` 的 `step` 是回合内局部量,永不使用。`govern()` 接收该计数并返回下一个;监听器按会话持有它。
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
每次调用按序执行:
|
|
36
36
|
|
|
37
37
|
1. **老化**——`gateSeq - enqueuedAtSeq > defer-ttl-steps` 的条目以 `drop-expired` 丢弃。
|
|
38
38
|
2. **backlog 准入**——按 FIFO 走查,只要**队头自身**类别预算尚有余量就准入(memory 条目按 `memory-budget-bytes`,advisory 按 `advisory-budget-bytes`,`used` 取本次调用已准入的字节)。被准入的条目排在这一步批次之首。
|
|
@@ -42,13 +42,17 @@
|
|
|
42
42
|
|
|
43
43
|
## Observe 模式
|
|
44
44
|
|
|
45
|
-
`mode: 'observe'` 执行完全相同的新批计算并以 `mode: 'observe'` 记录相同的行,但原样返回输入批次、不保留延迟队列、不模拟 backlog、不产生 `drop-expired` 行。observe 下**仍可能**出现 `drop-oversize
|
|
45
|
+
`mode: 'observe'` 执行完全相同的新批计算并以 `mode: 'observe'` 记录相同的行,但原样返回输入批次、不保留延迟队列、不模拟 backlog、不产生 `drop-expired` 行。observe 下**仍可能**出现 `drop-oversize`,因为它属于新批计算。由于 observe 调用返回空 backlog,`observe → enforce` 翻转由构造即从空队列开始——不存在跨模式遗留。
|
|
46
46
|
|
|
47
47
|
## 装配——监听器、预设行、账本写入
|
|
48
48
|
|
|
49
|
-
`registerGovernorListener(ctx)` 以一个 `{ prepend: true }` 的 `agent/pre-step` 监听器注册,因此它在预设的 pre-step 重写者中最外层运行,并在返回途中看到最终决策;它 delegate-first(先 await `next()
|
|
49
|
+
`registerGovernorListener(ctx)` 以一个 `{ prepend: true }` 的 `agent/pre-step` 监听器注册,因此它在预设的 pre-step 重写者中最外层运行,并在返回途中看到最终决策;它 delegate-first(先 await `next()`,再展开返回的决策、只替换消息批次),且绝不向瀑布抛错。共享预设体中的预设行 `input-budget` 经 `apply()` 挂载它,排序在 `tool-task` 之后,使 subagent 的 strip-instructions/settled-notice 组合留在闸门之内;组合 pin 与两项 live-fold 顺序测试让该边界是被测试的性质而非偶然。
|
|
50
50
|
|
|
51
|
-
行经 `createGovernorLedgerSink()` 落地:每次闸门调用一条无内容 `GovernorRow`,追加到 `$DSH_HOME/input-ledger/<projectKey>/<sessionId>.jsonl`,与账本自身观察者使用同一 sink 与路径约定(project 桶为 `sha256(realpath(cwd))` 的前 16 个十六进制字符;因 `@dsh-cc/input-ledger`
|
|
51
|
+
行经 `createGovernorLedgerSink()` 落地:每次闸门调用一条无内容 `GovernorRow`,追加到 `$DSH_HOME/input-ledger/<projectKey>/<sessionId>.jsonl`,与账本自身观察者使用同一 sink 与路径约定(project 桶为 `sha256(realpath(cwd))` 的前 16 个十六进制字符;因 `@dsh-cc/input-ledger` 不导出该函数,此处保有一份一致的本地副本)。该依赖按设计是软依赖:没有 dsh-home、没有会话 cwd,或 `cc-input-ledger.enabled: false` 时 governor 照常运行,行只是不落盘;追加失败被吞掉、记入调试日志并计入 `getGovernorLedgerHealth().droppedRows`——绝不抛入瀑布,也绝不在热路径上等待。governor 自身抛错时返回未改动的决策并记录 `{ error: true }` 行,因此失败的闸门绝不会半应用一个批次。
|
|
52
|
+
|
|
53
|
+
## Governor 管线
|
|
54
|
+
|
|
55
|
+
导出的管线接缝只固定阶段顺序 `dedupe → caps → trim`。`runGovernorPipeline(input, hooks?)` 让某个阶段的每个 `GovernorStageHook` 都在前一阶段产出的批次上运行,再把结果交给 trim 阶段,也就是 `govern()` 本身。hook 看到的是监听器收到的批次,即所有内层 `agent/pre-step` 监听器跑完之后的 claimed enter 批次,并返回下一阶段将要评估的批次。`GovernorStage` 命名三个阶段,`GOVERNOR_STAGES` 以运行时值承载冻结的顺序。此处目前不含任何去重或上限逻辑,因此两个 pre-trim 阶段默认接收空 hook 列表,管线就等于 trim 本身。hook 失败会传播给监听器,监听器返回未改动的决策并记录 `{ error: true }`,因此失败的阶段绝不会半应用一个批次。
|
|
52
56
|
|
|
53
57
|
## 算术(钉住已验证模型)
|
|
54
58
|
|
|
@@ -56,13 +60,13 @@
|
|
|
56
60
|
|
|
57
61
|
## 行字段
|
|
58
62
|
|
|
59
|
-
行 schema 归 `@dsh-cc/input-ledger` 所有;本包只提供 `mode`、`bytesByClass`、`trimmed`、`offeredBacklog` 与 `hardOver
|
|
63
|
+
行 schema 归 `@dsh-cc/input-ledger` 所有;本包只提供 `mode`、`bytesByClass`、`trimmed`、`offeredBacklog` 与 `hardOver`。`trimmed` 元素为 `{ kind, bytes, action }`,`action` 取 `defer | drop-expired | drop-oversize`。
|
|
60
64
|
|
|
61
65
|
以下约定由本包钉住,因为设计把细节留给实现:`bytesByClass` 恒含全部五个类别键、按表格顺序、以**决策**批次计量(因此 observe 与 enforce 一致);`offeredBacklog` 是调用开始时的 backlog 长度(observe 模式恒为 0);决策批次中被准入的 backlog 条目在前(它们更旧),随后是存活的新批消息按到达顺序——除此之外不重排;自身字节超过类别预算的条目在 backlog 走查中同样以 `drop-oversize` 丢弃,这一分支只有在热读预算于入队后收窄时才可达。
|
|
62
66
|
|
|
63
67
|
## 设置——`cc-input-budget`
|
|
64
68
|
|
|
65
|
-
kebab
|
|
69
|
+
kebab 键、用户层设置,每次闸门调用重读,因此热开关在下一步即生效、无需重启。
|
|
66
70
|
|
|
67
71
|
| 键 | 类型 | 默认 | 取值范围 |
|
|
68
72
|
|---|---|---|---|
|
|
@@ -93,7 +97,7 @@ const release = registerGovernorListener(ctx) // prepend 的 agent/pre-step 监
|
|
|
93
97
|
|
|
94
98
|
## 注意事项
|
|
95
99
|
|
|
96
|
-
- observe 模式是出厂默认,也是当前生产唯一启用的模式;enforce
|
|
100
|
+
- observe 模式是出厂默认,也是当前生产唯一启用的模式;enforce 预算应在翻转前依据账本数据设定。
|
|
97
101
|
- 被延迟的消息只通过 governor 自身的返回值回流,从不经 `agent.inject`,因此不会额外形成 claimed 批次。
|
|
98
|
-
- 两项顺序防御(生产者链 live-fold 测试、后注册 prepend 监听器边界)与全仓类别枚举扫描分别钉在 `tests/live-fold.spec.ts` 与 `tests/kinds-enumeration.spec.ts`;缺少 pinned harness
|
|
102
|
+
- 两项顺序防御(生产者链 live-fold 测试、后注册 prepend 监听器边界)与全仓类别枚举扫描分别钉在 `tests/live-fold.spec.ts` 与 `tests/kinds-enumeration.spec.ts`;缺少 pinned harness 检出时枚举硬失败。
|
|
99
103
|
- 持续过载下 advisory 的饥饿被限定而非消除;按类上限是姊妹文档的职责。
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dsh-cc/input-budget",
|
|
3
3
|
"description": "Per-step input budget governor: class-based byte budgets, FIFO trim, a deterministic defer backlog and observe-mode shadow state over the final agent/pre-step enter batch (docs/plans/2026-11-12-per-step-input-budget-governor.md)",
|
|
4
|
-
"version": "0.9.
|
|
4
|
+
"version": "0.9.6-rc.1",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/dsh-cc/dsh-cc.git",
|
|
@@ -23,18 +23,18 @@
|
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"@deepseek-ai/cordis": ">=0.2.0-rc.2",
|
|
25
25
|
"@deepseek-ai/schemastery": "^3.18.1",
|
|
26
|
-
"@dsh-cc/settings": "^0.9.
|
|
26
|
+
"@dsh-cc/settings": "^0.9.6-rc.1"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@dsh-cc/input-ledger": "^0.9.
|
|
30
|
-
"@dsh-cc/settings": "^0.9.
|
|
29
|
+
"@dsh-cc/input-ledger": "^0.9.6-rc.1",
|
|
30
|
+
"@dsh-cc/settings": "^0.9.6-rc.1"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@deepseek-ai/cordis": "link:../../../../deepseek-harness/vendor/cordis",
|
|
34
34
|
"@deepseek-ai/schemastery": "link:../../../../deepseek-harness/vendor/schemastery",
|
|
35
35
|
"vitest": "^4.1.8",
|
|
36
|
-
"@dsh-cc/input-ledger": "^0.9.
|
|
37
|
-
"@dsh-cc/settings": "^0.9.
|
|
36
|
+
"@dsh-cc/input-ledger": "^0.9.6-rc.1",
|
|
37
|
+
"@dsh-cc/settings": "^0.9.6-rc.1"
|
|
38
38
|
},
|
|
39
39
|
"publishConfig": {
|
|
40
40
|
"access": "public"
|