Repository navigation
feat: offline-auditability lines for window/metering/reconcile decisions (#2283) - #2423
Conversation
b7466be to
a0f82b7
Compare
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.2778-pr.2423.d437b75This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr2423.tgz
npm install -g packageInstall instructions are refreshed on each push. |
[bot] 🏷 上游冲突已解决 —— 分支已 rebase 到当前 master tip 并 force-push,本地定向门禁全绿。 处理过程:唤醒时分支基于旧 master(merge-base 结构化八问:
当前状态:API 确认 |
…cisions (#2283) Observation-plane only; no change to compression semantics, wire shape, or config surface. Closes the three sub-defects from the #2274 metering/window/reconcile auditability investigation: - fold-reconcile: expose defaultCountTokens of the re-entering unfolded mass (churnTokens / claimedChurnTokens on ReconciliationPlan) and append it to every drift variant's log line (#1921 growth contribution was id-counts only). - server: emit a per-session [window-change] event when the resolution triple (model/source/base) moves mid-session, placed pre output-headroom so the #2096 per-request max_tokens reservation can't read as a base change. - server: pair upstream-billed input with the same-payload estimateCoreMessages result on every request ([usage-vs-est], debug-gated) — the offline data source for the chars/4 deviation distribution behind the #2273 RC2 calibration. Fold-reconcile tests pinned for the two new plan fields. Fixes #2283
a9518e3 to
c5cef5f
Compare
[bot] 🏷 第二次上游冲突已解决 —— 分支已 rebase 到当前 master tip( 处理过程:这次 master 的位移比上次大得多——除若干 fix 合并外,还落了一轮结构性重构:
结构化八问:
当前状态:head |
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.212-master.9ab9d40 # this exact build
npm install -g billion-context@master # always the newest merged build
|
Closes #2283
Source: #2274 metering/window/reconcile auditability investigation (source-marked follow-up). Pure observation-plane additions — no change to compression semantics, wire shape, or config surface.
What each sub-defect gets
[window-change]info line fires when the resolution triple(model / windowSource / base-window)moves between requests (src/server.ts), placed pre output-headroom so the clampOutgoingOutput sizes max_tokens against the raw native window while preflight enforces the reserve-adjusted one — up to 25% of slack the clamp never sees #2096 per-requestmax_tokensreservation cannot masquerade as a base change. Fires only on an actual transition → ~0 default log volume. Directly replaces what the once-per-model[window]line could not show (a source/model switch or base rescale mid-session).[usage-vs-est]line inpreflightCompressIfNeededrecords, on every request (not only when preflight triggers), the upstream-billed input paired with the same-payloadestimateCoreMessagesresult, plus route / model / k̂ / baseline-grade. The call site is not pluginMode-gated, so it runs in both compression modes. This is the offline data source for the chars/4 deviation distribution behind the [决策请求] kernel nudge 双闸门 flat-50K 标定失配 <1M 窗口:慢增长会话永久饿死(#2110 RC2) #2273 RC2 calibration decision.defaultCountTokensestimate of the mass re-entering the wire unfolded (churnTokens/claimedChurnTokensonReconciliationPlan; repair mode nets out re-anchored mass). Quantifies Fold-state reconciliation: classify resent-history divergence (edit/fork/new/system-only) and make compression blocks re-anchorable chain units #1921's fold-rollback contribution to unbounded growth.Behavior changes (old → new)
Additive log lines only; no decision / threshold / wire / config change:
[window-change]info line — emitted only when the per-session resolution triple changes (rare; ~0 default volume).[usage-vs-est]debug line — emitted every request, but only while debug logging is on (default off).(~N tok unfolded in churn region)suffix appended to 4 existing log strings; same drift conditions as before, and only when N > 0. No new log line, no level change.No cache / retry / cursor / dedup-key invalidation touched. No config surface added — sub-defect 2 reuses the existing
debugswitch (no new env var or config field).Tests
tests/fold-reconcile.test.tspinning the two new plan fields (clean-resend unset; reanchored churn == claimed == single-candidate count; unmatched real edit → full churn / zero claimed).tests/fold-reconcile.test.ts28/28 ✓. Full suite + e2e deferred to CI (local-test discipline).