Repository navigation
FieldSourceRecord
github-actions[bot] edited this page Sep 27, 2026
·
2 revisions
tags: [domain-model] store: field_sources keyPath: "id" db: wodwiki-db (v23) role: relationship-table
[!info] Current vs Future State This document distinguishes the current implementation in code from proposed/future-state enhancements.
-
Store:
field_sources -
Key path:
id -
Type source:
packages/core/src/types/storage.ts -
Database version:
wodwiki-db(v23)
Relationship table — the reversal record making re-saves idempotent and deletes reversible: the field-identity contribution set of one stable source record (Note or Session).
| Field | Type | Notes |
|---|---|---|
id |
string |
${entityKind}:${recordId} — e.g. result:r1, note:n1
|
contributions |
Array<FieldContribution & { rowId: string }> | fieldId, path, kind, unit?, spelling?, value? per contribution |
[!info] This store is a relationship table.
-
id→ Note — polymorphic —note:<id> -
id→ Session — polymorphic —result:<id> -
contributions[].fieldId→ FieldCatalogEntry
- Keep field contributions derived from their owning note/result. Type descriptors and reusable widgets do not become extra independently writable catalog sources.
- A note re-key must reconcile the
note:<id>source and contributions, not just change the note row. Current legacy UUID re-key omitsfield_sources; see BlockIndexRow#Recommended projection contract.
Feedback case: a note is re-keyed or deleted after contributing frontmatter fields. Search/typeahead must not retain a duplicate or orphan contribution. Define transaction/rebuild recovery before reporting the operation successful.
These are review proposals, not implemented fixes. The session-prefix change below is a separate proposal.
In the proposed future state:
- Source records originating from recorded workouts update their prefix from
result:<id>tosession:<id>pointing to Session. - Note-level contributions remain
note:<id>.
!