Skip to content

fix(board): unify node freshness stamp so agent notes show Created/Edited - #258

Merged
winlp4ever merged 2 commits into
mainfrom
fix/node-updatedat-stamp
Aug 28, 2026
Merged

fix(board): unify node freshness stamp so agent notes show Created/Edited#258
winlp4ever merged 2 commits into
mainfrom
fix/node-updatedat-stamp

Conversation

@winlp4ever

Copy link
Copy Markdown
Contributor

What

Agent-created notes never showed a "Created"/"Edited" stamp, and human-edited notes never flipped to "Edited". Two disjoint representations of a node's timestamps were the cause:

  • canonical data.meta (SyncMeta, ms numbers) — what the agent / StoreMutator write;
  • legacy top-level data.createdAt / updatedAt (ISO strings) — older local boards + the REST convert layer.

The sheet card and list view read only the legacy strings, so agent notes (which carry only meta) showed nothing. The mutator also stamped a fresh meta on every rewrite, resetting createdAt, so an edited note never read as "Edited".

How

New webui/src/features/board/utils/node-meta.ts:

  • freshMeta() — create stamp (createdAt == updatedAt, v:1).
  • bumpMeta(prev) — edit stamp: preserve createdAt, advance updatedAt, increment v.
  • nodeStamp(data) — read the display stamp from meta first, falling back to the legacy strings; returns { iso, edited }.

StoreMutator now routes create → freshMeta, rewrite/patch → bumpMeta, link → freshMeta. The sheet view and list view read through nodeStamp.

meta.updatedAt is display-only — sync conflict resolution uses server-sequenced per-field LWW, not this field — so the blast radius is the two readers touched here.

Follow-up

Human edits made through the harness UI (e.g. the sheet inline editor's handleSave) still write via store.updateNode without bumping meta; wiring those handlers through bumpMeta is a separate change in the harness layer.

Test plan

  • node-meta.test.ts covers freshMeta / bumpMeta / nodeStamp (meta-first, legacy fallback, edited detection, unknown/unparseable).
  • board-mutator.test.ts adds: createNote stamps fresh meta; rewriteNote preserves createdAt and bumps v; patchNote bumps meta on a content-only edit.
  • npm run check-all passes.

…ited

Agent-created notes only carry the canonical `meta` (ms numbers), but the
sheet card and list view read the legacy top-level `createdAt`/`updatedAt`
ISO strings, so agent notes showed no stamp. The mutator also reset
`createdAt` on every rewrite, so an edited note never read as "Edited".

Add `node-meta` helpers: `freshMeta` (create), `bumpMeta` (edit — preserve
createdAt, advance updatedAt, bump version), and `nodeStamp` (read meta
first, fall back to the legacy strings). Route the mutator's create/rewrite/
patch/link through them and switch the sheet + list readers to `nodeStamp`.
update_note with neither content nor label was flipping the note to
'Edited' and pushing a needless store/sync op. Skip the write when
there is nothing to change.
@winlp4ever
winlp4ever merged commit 22eecf8 into main Aug 28, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant