Skip to content

A measured figure in a version is frozen prose, and nothing ties it to the run that produced it #69

Closed

Description

@max-sixty

A page reporting measurements carries a lot of numbers, and a version freezes them as prose. Nothing records where a figure came from, so nothing can tell that the measurement behind it has moved since.

The failure

Rerun the analysis, publish a version updating most of the figures, miss one. The page is now internally inconsistent and every check passes: version check validates markup, ids and widgets, and a stale number is well-formed markup.

Why $data does not cover it

$data looks like the home. Two things stop it.

There is no contract for the ordinary case, a measured scalar with the command and time that produced it. The kernel ships empty contracts, no shipped widget declares x-data, and the nearest built-in to one number, lf-metric, is authored-only and cannot stand inline in a sentence.

Source values also sit outside authored versions by design, as the registry says: source values remain outside authored versions and the event log. A reader pinned to v1 sees a value set five versions later. For a page whose job is to state what was true as of version N, that is the wrong way round. The number should be pinned, and the staleness check should be the live part.

leaf data set already writes an updated timestamp into the stored envelope, and nothing reads it.

What I would expect

An inline element for a measured value carrying its provenance:

<lf-num src="<command>" at="<timestamp>">NUMBER</lf-num>

version check then has something to check: warn where a version carries a figure whose source has a newer recorded run. That is structurally the advisory record_lag already runs against the event log, pointed at a second channel.

Seen on leaf 5db3e8f.

This was written by Claude Code on behalf of max-sixty

Activity

  1. added
    enhancement
    on Aug 27, 2026
  2. leaf-agent commented on Aug 27, 2026

    @leaf-agent
    Collaborator

    The premises hold as stated: $data.contracts is {} in the kernel (registry.json#L70-L72), no shipped widget declares x-data anywhere in packages/default/, lf-metric is pinned under x-parent: ["lf-metrics"] with no x-inline (default/registry.json#L408), and updated is written at data.py#L339, validated at #L62-L73, and read by nothing — watchData passes it through to modules, and no shipped module subscribes.

    Two things the code suggests about the shape.

    src as a free command string gives the check nothing to key on. The staleness comparison needs a live record of when the source last ran, and the only per-source timestamp the page holds is data.json's updated, keyed by source id. If the element instead binds an x-data input and carries the pinned value and at in markup, the two halves split exactly the way the issue asks: the number is authored text frozen in the version, and the live half is updated for the bound source. That also supplies the identity guarantee a cross-version comparison needs for free — x-data already holds one source to one contract for the page's lifetime, and page_data_bindings folds that across every immutable version, so v1's at and today's updated are provably about the same measurement rather than the same spelling. The human-readable command can ride along as a says attribute without being what the check keys on.

    The plumbing for the advisory is already at hand. check_page reads the store at checking.py#L152 for data_binding_errors, and prints the advisory register right after the ✓ line at #L283-L295. A sibling of record_lag in that same block needs no new reads.

    The part that wants your call is which declaration carries it. version check can't name lf-num — the widget belongs in packages/default/, and no content widget is named by core today — so this is one new x- key plus a package widget rather than a kernel tag. x-verbatim (authored data must agree with rendered words) and x-data are both adjacent, and neither states "pinned as of an instant".

    Worth flagging on scope: keyed on updated, the check catches "the source moved and this version didn't", not "this measurement is old". A figure whose source is never data set again reads as fresh forever. That's probably the right bound for an advisory, but it means the guarantee is about a channel being kept current rather than about the number itself.

    What I checked
    • $data in the kernel registry: {"description": …, "contracts": {}} — no contract for a measured scalar or anything else.
    • Every tag in packages/default/registry.json: none declares x-data. The only x-data references in the payload are the kernel's own $keys description, runtime/data.js, references/packages.md, and the Python validators.
    • lf-metric: x-parent: ["lf-metrics"], x-content: "prose", x-upgrade: false, no x-inline. The two inline widgets the default package ships are lf-gloss and lf-chip.
    • updated readers: grep across assets/, packages/, and scripts/ (excluding vendor/) returns only the write and the shape validation in data.py.
    • record_lag_entries at projection.py#L441-L471 — advice lines, one comparison rendered twice for version check and page state.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions