Repository navigation
v0.10.0
Added
token_norm_statusreportspolicy.current,policy.peakand
policy.driver.currentis severity at this instant and may fall;
peakis the session high-water mark and never does;drivernames the axis
(calls,budget,context) behindcurrent. Additive: the top-level
statefield remains, now documented as a deprecated alias ofpolicy.peak,
andrecommendationis still derived from the peak. The snapshot enforces
peak >= currentitself, so a stale stored level cannot produce an
inconsistent payload.- Executable invariants for the policy machine. Idempotence,
BLOCKEDonly
underblockmode with a hard limit exceeded (and always, then),
HANDOFF_RECOMMENDEDonly underhandoffmode with pressure and an armed
pause (and always, then), observe/warn measuring identically, state never
below the axis max, and at most one rendered block with exactly one header for
every subset of due sections — each checked over the whole reachable input
space rather than on hand-picked examples.
Fixed
- The driver axis at
HEALTHYis no longer reported ascontext. The
most-specific-first rule matched every axis when nothing was wrong, so a
healthy session — including one whose context window could not be resolved at
all — named context as its driver. It now attributes to the calls axis, which
always exists.
Documentation
- README leads with the positioning, the checkpoint ladder, and a
before/after; adds an enforcement-mode table, a Node/OpenCode/plugin
compatibility row, and splits evidence into observed / benchmark / hypothesis
(including the retracted wall-time finding: +2.6 s, p = 0.83). docs/how-it-works.mddocuments the status payload field by field, the
currentvspeakdistinction, weighted vs raw call counts (why
calls 37andbudget.toolCalls: 52are both right), the
measurement → policy → rendering pipeline, and a call-by-call session
walkthrough.- Process-local state is stated as an explicit guarantee in the README, and
effective fresh tokensis called out as cost-weighted input rather than a
provider token total.
Provenance
Built from ef2f9b1dfe865c2c4be06964848694c4a3287791.
| artifact | sha256 |
|---|---|
dist/plugin.js |
4bb0bf8057f0f70622143119549cf026f973f32ef898a1a8c08e6396e9d1f7c0 |
scripts/usage-audit.py |
ad5d1c4e18eac2c73dfc7267ff6c8a1f553783d7f62cd9d32d54f25f2ffa0c73 |
Verify an installed copy:
shasum -a 256 ~/.config/opencode/plugins/opencode-token-norm.js
shasum -a 256 ~/.config/opencode/scripts/usage-audit.py