Skip to content

DR-124: A reference item does not mint a synthetic source_documents row

DR-124 — A reference item does not mint a synthetic source_documents row

Section titled “DR-124 — A reference item does not mint a synthetic source_documents row”

This closes id-364 F1, which had been open across several sessions and was blocking concrete work in the cocoindex test lane.

The apparent conflict: S507 row 4.2 marked url-landing-set.integration.test.ts’s reference_items assertions “not ratified”, expecting reference_items.source_document_id to GO. id-370 RESEARCH §5 then ruled the FK live provenanceNOT NULL, ON DELETE RESTRICT, with reference_ingest() minting the source_documents row first in the same transaction explicitly for that FK, and reader count increasing.

The S528 census established the two are not contradictory — they answer different questions. id-370 answered “is the FK live?” (yes). S507 was asking “should the synthetic source_documents row exist at all?” — which id-370 explicitly routed to id-364 F1 and nobody had answered.

A reference item does NOT need, and does not conceptually require, a source_documents row. They are separate first-class entities.

The discriminator is lifecycle, not identity. Owner, S528:

“rf does not need an sd — different concepts, e.g. sd’s are walked, rf’s are not.”

Source documents are walked; reference items are not. This is visible in the schema itself: the keep_and_watch retention class means re-walked, and that clock is a source_documents concern. A reference item has no walk cadence to carry.

Consistent with the S511 board pivot already recorded in reference/platform-context.md: “reference_items ≠ source_documents — SEPARATE concepts”, which gave references their own nav surface and detail pages.

  • Keep the synthetic row as the provenance register working as designed. The strongest counter-argument, and it was put: corpus-reframe R5 makes source_documents “the permanent provenance register”, so a row per reference could be the register functioning correctly rather than residue. Rejected on the lifecycle discriminator — the register’s semantics are built around walked sources, and a row that is never walked is carrying register machinery it cannot use.
  • Leave id-364 F1 open and work around it. Rejected: it had already blocked one test assertion across three sessions and was being re-litigated each time it surfaced.
  • reference_items.source_document_id is a retirement candidate, along with reference_ingest()’s synthetic-row mint. The migration is NOT ratified here — this rules the concept, and the schema change needs its own task with a data-shape plan.
  • **url-landing-set.integration.test.ts:228** (expect(ri.source_document_id).toBe(sdId)) is now decidable. It was the S528 test census's one genuine UNDECIDABLE`, and id-415 was told to keep away from it; that block lifts.
  • ontology/33-reference-item.md documents the superseded position — it carries id-75 BI-15’s NOT NULL ON DELETE RESTRICT “provenance chain integrity” specification as settled. Correct it. Note that id-75 BI-15 is a task decision and this ruling outranks it per DR-123.
  • The “evidence pair” framing that grew around the sd+ri relationship has no basis in reference/entity-glossary.md or anywhere in reference/ (zero hits, S528) and should be retired from tests and production code alongside this.