Repository navigation
Enrichment: Sonnet 5.5 and stricter data-paper relation typing - #1550
Merged
Merged
Conversation
5 tasks done
📦 Package PreviewYour package is ready to test! bun install -g nemar-cli@PR1550Version: 🤖 Updated on each push. |
Contributor
Author
Review round 1: findings and resolutionA Sonnet review raised 14 findings. All 14 are addressed on this branch, in commits
A regression found in CI and fixed: Verification: typecheck is clean; Biome is clean on the changed files; the offline tier, integration tests, and mutation results are listed in the PR body. |
This was referenced Sep 29, 2026
neuromechanist
added a commit
that referenced
this pull request
Sep 29, 2026
dev took ADR 0075 (#1550), so the news images ADR is renumbered 0076, with the migration comment and the index updated. Typecheck, news suites (90), and migrations:d1-check pass after the merge.
This was referenced Sep 29, 2026
neuromechanist
added a commit
that referenced
this pull request
Sep 29, 2026
* docs: CHANGELOG entry for 0.10.10 Covers #1550 (Sonnet 5.5 enrichment, DOI lookups, relation guard) and #1552 (biosigio 1.2.10 case-only sidecar matches). Claims checked against the merged code. * docs: add #1556 to the 0.10.10 entry Failed-lookup warnings, the lookup-stage deadline, the over-cap marker, and the summary now printing warnings. Changelog format test passes.
This was referenced Sep 29, 2026
Merged
This was referenced Sep 29, 2026
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1549.
Why
The citation pipeline (
nemarOrg/nemar-citations) credits a dataset with the citations of the DOIs that.nemar/metadata.jsonmarks as describing the data. The enrichment LLM saw only README prose and bare DOI strings, so it got the label wrong in both directions:nm000275's own Scientific Data descriptor ended up asReferences, while MNE-BIDS, EEG-BIDS, and MEG-BIDS ended up asIsDescribedByon dozens of datasets.What changed
claude-sonnet-5-5($2 / $10 per MTok;estimateUsageCostUsdupdated). The request shape is unchanged:effort: "low", nothinkingfield, and no forcedtool_choice.doi-registry.ts):found;absent(HTTP 400, 404, or 410); orfailed(429, 5xx, timeout, network error).10.1016/S0006-3223(99)00000-0.enforceNeverDataPaper):References. It also demotes DOIs whose title matches the BIDS-spec rule.10.82901/nemar.<id>DOI, concept or version, under any relation (on008862 and on007655 carried their own DOI asIsSupplementTo).IsSupplementToon an unlisted DOI is left for nemar-citations' judge. URLIsDescribedByentries are untouched.normalize_doiandis_spec_title. The title rule's phrase form is anchored at the start of the title, so data papers that mention an extension no longer match.IsDerivedFromratchet:ReferencestoIsDerivedFrom, or add a newIsDerivedFrom, only for a DOI whose DataCiteresourceTypeGeneralisDataset. Otherwise the entry stays, or lands as,References.IsDerivedFrom, since the corrector and merge cannot act on them.doi_resolution: {resolved, unresolved, failed, skipped}, plusdemoted_doisandself_dois_droppedwhen non-empty.doi_resolution.nemar admin reindexprints it, and gains--json.The MIPDB resource paper (
10.1038/sdata.2017.40, Langer et al. 2017) is deliberately not blocked: it isnm000153's own data descriptor.Tests
bun run typecheck: cleanbun run lint, which coverssrc/, is clean)unit-puretier, same file classification astest.yml: 7299 pass, 26 skip, 0 fail across 416 files (local, at80ba196c)doi-metadata,doi-orcid-discovery): 18 pass, 0 fail295b86a0the source-level guard inbackend/test/enrich-doi-sync-skip.test.tsfails, because Biome wrapped the pinnedreturn { ok: false, error: subErrors.join(...) }line.80ba196crestores that exact line; the test is unchanged, and a skip-only body still returnsok: true.Parse tests run on recorded real DataCite and Crossref responses (
test/fixtures/doi-registry/), including a live Crossref record withauthor: nullanddate-parts: [[null]], and a title carrying<i>markup and line breaks. Malformed shapes are real responses with a single field broken.enrichDatasetitself is not driven end to end, for the same blockerbackend/test/enrich-doi-sync-skip.test.tsdocuments: a process-widemock.moduleof the github service returns an empty tree.backend/test/enrich-relation-guard-wiring.test.tsinstead pins, at the source level, that every guard call gets the context, that titles are in place before the first LLM merge, that the final guard runs before the commit, that both merges get the Dataset evidence, and that all three lookup stages share the cache.Post-deploy: re-enrichment sweep
Run this against production after the release that ships this PR. It needs the CLI from that release, for
--jsonanddoi_resolution.Scope.
reindex --allselects every dataset with agithub_repo, except thexxsandboxes; the live catalog reports 777..nemar/metadata.json(and possibly an auto-generatedparticipants.tsv);Drive it one dataset at a time. The bulk request runs sequentially inside one Worker request, so a full catalog would exceed the per-invocation subrequest limit, and it cannot resume.
The sweep runs for hours, so start it in
tmux. A dataset infailed.txthad an enrichment or sync error; its reason is on stderr, andnemar admin reindex <id>shows it again.Cost at $2 / $10 per MTok:
llm_usage.est_cost_usdin each--jsonresult gives the real figure, so measure the pilot and extrapolate.Deliberate differences from nemar-citations
normalizeDoiKeyrepeats the unmatched-)and trailing-punctuation trims until nothing changes. Python'snormalize_doitrims each once, so(10.1016/S0006-3223(99)00000-0).keeps a stray)there.https://doi.org/and the others case-sensitively.\win the name rule is ASCII-only.