Skip to content

[PR] timestamps: show when each message arrived and when a folded span covers - #5183

Closed
ranxianglei wants to merge 4 commits into
masterfrom
2026-10-30_4313-message-timestamps
Closed

ranxianglei wants to merge 4 commits into
masterfrom
2026-10-30_4313-message-timestamps

Conversation

@ranxianglei

@ranxianglei ranxianglei commented Oct 30, 2026 •

Copy link
Copy Markdown
Owner

Fixes #4313.

kernel-change: state gains timeSnapshot + rendering flag (per the issue's owner-discussed design)

Implements the design already converged in the issue (storage-layer analysis by ework, option B for legacy history adopted, kuviki's range footer adopted). Declaring here as the PR-level kernel-change record.

config surface

New field compress.timestamps (boolean, default unset = off):

What it does (in plain words)

The model gets spatial anchoring (message refs) but no temporal signal: a folded span reads as if it happened "now", and a days-old plan competes with a minutes-old instruction with nothing telling them apart. With the flag on:

  • every rendered ref tag carries the message's arrival time: <acp tokens="506" type="text" at="2026-10-22 06:14">m00026</acp> (UTC, minute precision, human-readable — no epoch arithmetic)
  • every rendered summary carrier ends with the covered span's range: [folded 2026-10-22 06:14 → 2026-10-22 18:03 UTC]

How it works

Tests & goldens

  • kernel/tests/issue4313-timestamps.test.ts: exact format, off-default byte-stability, frozen-time stability across renders, unmarked legacy history, freeze + retention through sync, footer on/off.
  • compress-settings mapping (set / unset-inherits / explicit-false); Web UI row compiles as plain JS (no TS-only syntax — caught by the web-routing guard).
  • storage-render goldens regenerated: state gains timeSnapshot (values canonicalize to __TS__, so only presence changes); corpus pins stay green thanks to absence-preserving hydration.
  • verif subset exception for the assign-refs Date.now freeze (same class as the existing block createdAt stamp).
  • kernel 0.0.170 → 0.0.171; kernel suite 1494/1494 + targeted host suites green.

The model gets spatial anchoring (message refs) but no temporal signal:
folded spans read as if they happened 'now', and a days-old plan competes
with a minutes-old instruction with nothing telling them apart (#4313).

- kernel: timeSnapshot — first-seen wall-clock frozen once per message
  ref at mint (assign-refs node), same discipline as tokenSnapshot. The
  freeze is unconditional; RENDERING is gated by Config.renderTimestamps
  (default off, byte-stable with every pre-#4313 wire).
- kernel: with the flag on, every rendered ref tag carries
  at="YYYY-MM-DD HH:mm" (UTC, minute precision) and each rendered
  summary carrier ends with the covered span's arrival-time range,
  [folded 2026-10-22 06:14 → 2026-10-22 18:03 UTC] (single point when the
  range collapses). History without a frozen time renders UNMARKED —
  never guessed at (the issue's adopted option B for legacy history).
- kernel: time retention is wider than the tokenSnapshot live-ref prune —
  folded messages keep their times (footers read them); entries are
  dropped only when neither live nor claimed by any block. The field is
  ABSENCE-PRESERVING everywhere (fresh states, sync clone, hydration) so
  pre-#4313 persisted states load to their pinned digests; the unified
  store round-trips it via kstate_json (COMPRESSION_STATE_FIELDS
  appendix) and the #4599 ledger-alignment remap moves it with the refs.
- host: compress.timestamps (config file + Web UI quick toggle, en/zh)
  maps to kernel renderTimestamps; CONFIGURATION.md / CONFIGURATION.zh-CN
  document it incl. the one-time prefix-cache flush on enable.
- storage-render goldens regenerated (state gains timeSnapshot entries;
  values are canonicalized to __TS__ so only presence changes). verif
  subset exception added for the assign-refs Date.now freeze (same class
  as the block createdAt stamp).
- kernel 0.0.170 → 0.0.171.

Tests: kernel/tests/issue4313-timestamps.test.ts (format, off-default
byte-stability, frozen-time stability across renders, unmarked legacy
history, freeze+retention, footer on/off); compress-settings mapping;
storage-state-fields mechanism updated for the optional appendix.
@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-30_4313-message-timestamps (6627036)

Latest build — install this exact version

npm install -g billion-context@0.0.7160-pr.5183.96b1cea

This exact version is immutable and reproducible. The rolling pr tag tracks the newest test build across all PRs.

Recent builds (commit → version)

commit version build
6627036 billion-context@0.0.7160-pr.5183.96b1cea build
241603f billion-context@0.0.6927-pr.5183.3495284 build
bc64573 billion-context@0.0.6920-pr.5183.790d7df build
65386c3 billion-context@0.0.6909-pr.5183.755539f build

Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr5183.tgz
npm install -g package

Install instructions are refreshed on each push.

@ranxianglei ranxianglei changed the title timestamps: show when each message arrived and when a folded span covers [PR] timestamps: show when each message arrived and when a folded span covers Oct 30, 2026
@ranxianglei

Copy link
Copy Markdown
Owner Author

重复 #5236

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant