feat(log): system commits carry their origin; the attested per-id reconcile door
Two consumer-driven cures sharing one stamp. (1) TX-LOG ORIGIN: engine-
originated commits stamp an optional origin on their tx-log entry AND the
commit fact's meta — 'system:embed-landing' (the deferred vector landing),
'system:adoption-backfill' (baseline re-commits), 'system:reconcile'. A
downstream activity feed showed a double tick because the landing commit was
indistinguishable from a user save, and the consumer rightly refused a
time-window collapse as a quiet loss; feeds now filter on fact. User writes
stay unstamped — absent origin is the user shape, every existing consumer
unchanged. (2) reconcileLogDivergence(id, {attest}): the human's door for
log-live-canonical-absent, the one class adoption refuses by design because
a lost-tombstone deletion is indistinguishable from canonical loss.
'deleted' mints the missing tombstone (history keeps the earlier live
record); 'restore' folds the log's only copy back into canonical; wrong-
class calls refuse typed with nothing written. Loud, narrated, single-row,
origin-stamped. From a production adoption's one surviving divergence.
This commit is contained in:
parent
f4653e47c9
commit
9ac9e70686
4 changed files with 308 additions and 7 deletions
|
|
@ -412,6 +412,17 @@ export interface TxLogEntry {
|
|||
timestamp: number
|
||||
/** Transaction metadata, when supplied to `transact()`. */
|
||||
meta?: Record<string, unknown>
|
||||
/**
|
||||
* WHO committed. Absent = a user write (every pre-existing consumer's
|
||||
* reading stays exact). Engine-originated commits stamp themselves —
|
||||
* `'system:embed-landing'` (the deferred vector landing),
|
||||
* `'system:adoption-backfill'` (baseline re-commits), `'system:reconcile'`
|
||||
* (the attested per-id divergence door) — so activity feeds can filter on
|
||||
* fact instead of collapsing near-in-time entries (a consumer refused that
|
||||
* heuristic as a quiet loss, correctly; this field is the honest cure).
|
||||
* The same stamp rides the commit fact's meta, so log and tx-log agree.
|
||||
*/
|
||||
origin?: string
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue