@dzhechkov/keysarium 1.5.25 → 1.5.27
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": "@dzhechkov/keysarium",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.27",
|
|
4
4
|
"description": "AI Case Research Toolkit for Claude Code — full 7-phase pipeline with feature-adr, dream cycles, background workers, multi-platform support, reward learning, and Cloud.ru AI Factory mapping (--ai-factory flag)",
|
|
5
5
|
"main": "src/cli.js",
|
|
6
6
|
"bin": {
|
|
@@ -414,6 +414,30 @@ Codex on limit-exhaustion) stays a knob-only behavior; a direct `models.code='co
|
|
|
414
414
|
'L', models: { code: 'opus', qe: 'codex:gpt-5.6:high', architecture: 'opus', router: 'fable' } } })` —
|
|
415
415
|
Claude writes the code, Codex independently QEs it.
|
|
416
416
|
|
|
417
|
+
**Usage-adaptive routing (pre-emptive Codex switch under limit pressure).** When routing is opted into,
|
|
418
|
+
the workflow probes Claude SESSION (active 5h-block) and WEEKLY (rolling 7d) usage at EACH phase boundary
|
|
419
|
+
via a minimal `dz usage --json` agent. When either metric is `>= usageThreshold` (default `70`) BEFORE a
|
|
420
|
+
phase launches — OR the probe output is missing (agent-null, which often MEANS the limit was hit) — ALL
|
|
421
|
+
remaining stages switch to `codex:<top>` (design/code/plan at `xhigh`, router/qe/fleet at `high`). When a
|
|
422
|
+
later probe reads BOTH metrics below the threshold (positive numbers, not nulls), the normal Claude+Codex
|
|
423
|
+
mix is RESTORED. Null percentages (unconfigured limits) change NOTHING in either direction. Switched
|
|
424
|
+
stages are tagged ` (usage-switched)` in `modelsUsed`, and every flip is recorded in the result's
|
|
425
|
+
`usageEvents` array (the audit trail — never trust promiseTags for this). Args:
|
|
426
|
+
|
|
427
|
+
| `args.*` | Default | Effect |
|
|
428
|
+
|---|---|---|
|
|
429
|
+
| `usageAdaptive` | `true` when routing is requested (any `args.models` key or Codex knob); `false` otherwise | `true` forces it on even without other routing; `false` disables all probes (byte-identical to today) |
|
|
430
|
+
| `usageThreshold` | `70` | the `>=` percent (either metric) that triggers the pre-emptive switch |
|
|
431
|
+
| `usageReasoning` | the `OVERRIDE_REASONING` map | per-stage reasoning under the override (merge over the default: design/code/plan → `xhigh`, router/qe/fleet → `high`) |
|
|
432
|
+
|
|
433
|
+
Configure the limits the probe measures against in `.dz/config.json` — `memory.usage.sessionTokenLimit`
|
|
434
|
+
and `memory.usage.weeklyTokenLimit` (OPTIONAL; absent ⇒ `pct` is `null` and no switch fires). The
|
|
435
|
+
percentages are **ESTIMATES** from local transcript aggregation (there is no official usage API);
|
|
436
|
+
**calibrate** by scaling a limit by `X/100` when a real limit-hit lands at an estimated `X%`.
|
|
437
|
+
**Honest caveat (the wrapper lesson):** at TRUE exhaustion even the Codex dispatch dies because
|
|
438
|
+
`codex:codex-rescue` is a Claude wrapper subagent — so the switch MUST happen BEFORE, which is why the
|
|
439
|
+
70% pre-emptive probe (not just reactive null-detection) is the real defense.
|
|
440
|
+
|
|
417
441
|
### Pattern memory loop (self-learning — runs in ALL modes)
|
|
418
442
|
|
|
419
443
|
**Self-learning is MANDATORY on EVERY `/feature-adr` run — including plain `/feature-adr` without any
|