Skip to content

Add an optional stable_id to every extraction entity - #39

Merged
jdkent merged 1 commit into
mainfrom
feat/stable-id
Oct 16, 2026
Merged

jdkent merged 1 commit into
mainfrom
feat/stable-id

Conversation

@jdkent

@jdkent jdkent commented Oct 16, 2026

Copy link
Copy Markdown
Member

Adds an optional stable_id slot to every extraction entity: the 18 classes that have a local_id.

Why

A local_id is unique only within one record. Renaming an entity, or re-running a pipeline, would split its claims across ids. neurostore's review app will mint a UUID the first time it sees an entity, keep it, and write it back on export, so a re-import or a later extraction of the same paper is matched to the same entity. Extractors never set it.

What changes

  • The slot: stable_id is a lowercase UUID string, and optional. It is declared in extraction-deviations.yaml under required_additions, so pondie.schema.generate keeps it. The generated extraction YAML, the JSON Schema and the pydantic models are regenerated.
  • Storage: storage's id is unchanged, and the extraction-to-storage map does not map stable_id onto it.
  • Example record: the example record carries "stable_id": null, as the writer emits it for other optional slots.
  • Docs: extraction-readme.md has a short section on who sets the slot and what it is for.

Checks

  • pytest tests: 132 passed, 2 skipped. The skips already existed: pyarrow, and the wheel build.
  • New tests cover a record with the slot, one without, malformed ids (including uppercase), and the slot on every entity class's JSON Schema.
  • tools/generate_models.py --check: passes.
  • Current pondie (d722f69), run on this branch and on main, reports the same three files out of date on both: analysis.yaml, analysis_enums.yaml and the root schema. That drift already exists on main. Every stable_id attribute parses identically to pondie's output.

🤖 Generated with Claude Code

A store mints stable_id, a lowercase UUID, the first time it sees an
entity, and keeps it across re-runs, so a later extraction of the same
paper matches the same entity. A local_id is unique only within one
record. Extractors never set it.

It is declared in extraction-deviations.yaml's required_additions, so
pondie's generator keeps it. Storage's `id` is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@jdkent jdkent left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jdkent
jdkent merged commit 8e15224 into main Oct 16, 2026
4 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