Skip to content

docs: record how shared entities are stored and deleted - #83

Merged
johnf merged 1 commit into
mainfrom
worktree-adr-shared-entities
Nov 17, 2026
Merged

johnf merged 1 commit into
mainfrom
worktree-adr-shared-entities

Conversation

@johnf

@johnf johnf commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

Records the decision from "How shared entities are stored and deleted" (#72) on the indexer redesign map (#65). Docs only; no code changes.

 docs/adr/
+└── 0006-a-shared-entitys-row-is-one-crates-copy.md
 GLOSSARY.md
+  Crate: a collection, object or file belongs to exactly one crate
+  Shared entity: a person, organisation or software entity that more than one crate may describe

The rule the ADR records:

index(crate)
  for each entity the crate describes
    if collection, object or file
      if another crate holds it        -> refuse the entity, report an error on this crate
      else                             -> write the row, link crate to entity
    if person, organisation or software (shared entity)
      link crate to entity, keeping this crate's copy on the link
      row = copy of the winning crate  (open metadata licence first, then lowest crate id)
      rootCollection = null

delete(crate)
  remove the crate's links
  shared entity with links left        -> row = next winning copy
  entity with no links left            -> remove the row and search document

Evidence

Merge Danger

Door: two-way

Docs only. The decision itself is costly to reverse once built (a schema change and a full reindex), which is why it has an ADR.

Blast Radius: none

ADR 0005 is taken by #80 (draft), so this is 0006. GLOSSARY.md is also touched by #79 and #80; whichever merges later needs a rebase.

ADR 0006: crate links, one crate for collections, objects and files, and one winning copy

Adds Shared entity to the glossary.
@johnf
johnf marked this pull request as ready for review November 17, 2026 02:16
@johnf
johnf merged commit 92b4fc0 into main Nov 17, 2026
5 checks passed
@johnf
johnf deleted the worktree-adr-shared-entities branch November 17, 2026 02:16
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