Skip to content

Release v0.6.0 - #158

Closed
neuromechanist wants to merge 14 commits into
mainfrom
dev
Closed

neuromechanist wants to merge 14 commits into
mainfrom
dev

Conversation

@neuromechanist

Copy link
Copy Markdown
Contributor

Summary

Release v0.6.0 merging dev to main. Major changes since last release (v0.3.7):

  • Staged metadata pipeline (seed -> enrich -> validate) with MeSH validation
  • EZID DOI integration with deterministic DOI naming
  • STS credential-based uploads via AWS CLI
  • Upload resume capability
  • Dataset deletion cascade with scheduled cleanup
  • Role-based access control (owner > admin > member)
  • BIDS validation on push to main (not just PRs)
  • Admin CI override (--skip-ci-check) for publication
  • Bot committer identity (nemarAdmin) for backend commits
  • Multi-account switching support
  • Streaming archive generation to S3

Test plan

  • All CI checks passing on dev
  • Backend already deployed and tested
  • BIDS validation verified on nm000108
  • Bot committer identity verified

Track per-file S3 upload progress in .nemar/upload-progress.json so
interrupted uploads can resume without re-uploading completed files.
Wrap post-S3 steps with completion guards for full idempotent resume.

- New module: src/lib/upload-progress.ts (progress tracking)
- Add --restart flag to clear progress and force re-upload
- Exclude .nemar/ from file manifest and auto-add to .gitignore
- Add onBatchComplete callback for periodic progress persistence
- Skip ORCID re-collection when nemar_metadata.json exists
- Validate dataset_id on resume to discard stale progress
- Strengthen progress file validation (file entries + step values)
- Add console.warn on read/write/clear failures (no silent swallowing)
- 29 unit tests (real filesystem, no mocks)

Closes #147
- Adaptive presigned URL batching: probe upload speed, then
  request URLs in chunks that fit within 45-min safety window
  (presigned URLs expire at 60 min). Eliminates stalling at
  400-500 files for large datasets.
- Bypass user_s3_permissions check for admin/owner roles in the
  presigned URL endpoint (they have full bucket IAM access).
- Write nemar_metadata.json immediately after ORCID collection
  so resumed uploads don't re-prompt for author info.
Replace fixed Promise.all batches with a concurrent pool that
keeps all job slots busy at all times. Previously a slow file
would block an entire batch; now the next file starts as soon
as any slot frees up.
Use Bun.file() as fetch body instead of reading entire file
into an ArrayBuffer. With -j 16 and 65MB files, the old
approach buffered ~1GB in memory causing GC pressure and
throughput loss. Streaming reads directly from disk.
* Add STS credential-based upload via AWS CLI

Adds an alternative upload path using `aws s3 sync` with temporary
STS credentials for higher throughput than presigned URLs. Falls
back to presigned URLs when AWS CLI is unavailable.

Closes #150

* Fix biome formatting after merge
collectFileManifest used `find -type f` which skips symlinks.
Git-annex replaces data files with symlinks to .git/annex/objects/,
so all data files were classified as missing (0 data files detected).

- Add `-type l` to find command to include symlinks
- Switch to unlocked mode after git annex init so data files
  remain as regular files instead of symlinks
D1 Workers returned wrong results for the gap-finding query that
used indexed parameters (?1, ?2, ?3) in a complex subquery with
NOT IN. Replaced with a two-step approach: simple queries to fetch
candidates and existing IDs, then JS logic to find the minimum
unused number. Also fixes biome formatting in git-annex.ts.
Per-file --include patterns cause aws s3 sync to stall during
pattern compilation when there are hundreds of files. For large
file lists (>100), switch to directory-level --exclude patterns
instead (.git, .datalad, .nemar).
Read both stdout and stderr for progress lines since aws s3 sync
may write to either stream. Display file count, percentage, and
current filename in the spinner.
* Align DataCite pipeline with kernel-4.6 and neuroschema v0.3.0

Bug fixes:
- Fix modality detection using DatasetType ("raw") instead of BIDS dirs
- Add ODC-By, ODbL license variants to mapLicense()
- Handle URL-type refs in ReferencesAndLinks (previously dropped)
- Parse BIDS SourceDatasets into IsDerivedFrom relations
- Add missing collectionDates/geoLocation to enrichment Zod schema

Schema alignment (NemarMetadata v2.0):
- Add NemarMetadataV2 with snake_case fields (neuroschema v0.3.0)
- Discriminated union on version field for v1.0/v2.0 parsing
- Structured types: keywords, related_identifiers, funding_references,
  contributors, dates, geo_locations
- Read .nemar/metadata.json first, fall back to nemar_metadata.json

Enhanced DataCite XML:
- Publisher identifier attributes (ROR)
- Structured subjects with scheme/URI attributes
- GeoLocation coordinates (lat/lon)
- resourceTypeGeneral on relatedIdentifiers
- awardURI on funding references
- dateInformation on dates

Enum updates (kernel-4.6):
- ResourceTypeGeneral: +Award, Instrument, Project, StudyRegistration
- DateType: +Coverage
- ContributorType: +Translator
- RelationTypes: +6 (IsDerivedFrom, IsSourceOf, etc.)

* Address PR review findings

Critical fixes:
- Validate v2 author entries per-field instead of unsafe cast
- Fix admin.ts DOI update route to read .nemar/metadata.json
- Add func->fMRI and other BIDS datatype mappings

Important fixes:
- Write v2 enrichment to .nemar/metadata.json, v1 to old path
- Validate geo_locations require place or valid point
- Warn on unrecognized metadata version instead of silent skip
- Fix comment counts (38 relation types, 32 resource types)
- Update file header to reference kernel-4.6

Tests:
- Add tests for detectModalitiesFromTree (5 tests)
- Add tests for mapModalityToResourceType func mapping (5 tests)
- Add tests for parseNemarMetadata v2 (5 tests)
- Add tests for nemarMetadataToEnrichment v2 (6 tests)

* Add LLM enrichment CI, retire v1 metadata, gate DOIs

- Add backend LLM enrichment service (backend/src/services/llm-enrich.ts)
  with v2 output format and author ORCID preservation
- Add POST /webhooks/llm-enrich endpoint for CI-triggered enrichment
- Add llm-enrichment.yml workflow to deployWorkflows (triggers on
  README.md or dataset_description.json changes)
- Gate concept DOI creation on enrichment_json presence (422 if
  missing, skip_enrichment_check override available)
- Add enrichment_check step to publication orchestrator (warn-only)
- Update CLI llm-enrich.ts to v2 output (snake_case, structured
  keywords, typed related identifiers)
- Update CLI dataset upload to write .nemar/metadata.json (v2)
- Update CLI doi enrich to produce v2 format with affiliations[]
- Add OPENROUTER_API_KEY to Bindings and Workers secrets
- Update WORKFLOW_FILES to include all 5 deployed workflows
- Add tests for validateLlmResultV2 and mergeWithExisting

Closes #153

* Address PR review findings

- createOrUpdateFile now throws on failure instead of returning false
- Remove -f flag from curl in llm-enrichment workflow (was preventing
  graceful error handling due to bash -e)
- Separate getBlobContent from JSON.parse in webhook to let infra
  errors propagate while catching parse errors
- Add explicit warnings for corrupt metadata files in CLI upload
- Log warning when OPENROUTER_API_KEY is missing in CLI enrichment
- Remove unused AuthorEnrichmentV2 import from backend llm-enrich
- Improve error logging in enrichment_check and metadata parse paths

* Fix OpenRouter model ID for Claude Haiku 4.5

* Document metadata pipeline architecture (issue #154)

Add staged enrichment pipeline design (seed -> enrich -> validate)
to plan.md and ideas.md. DOI minting gated on validated stage.

* Add LLM validation prompt design to ideas.md

Draft system prompt for Stage 3 metadata validation, modeled after
pr-review-toolkit structured criteria with confidence scoring.

* Implement 3-stage metadata pipeline (seed, enrich, validate)

- Add pipeline_stage field to NemarMetadataV2 type system
- seedFromBids(): extract all authors, SourceDatasets, Funding,
  ReferencesAndLinks from BIDS deterministically (no LLM)
- mergeWithExisting(): additive merge for related_identifiers and
  funding_references (preserves BIDS-seeded IsDerivedFrom entries)
- validateMetadata(): LLM judge reviews metadata quality with
  structured criteria and confidence scoring
- Webhook runs all 3 stages: seed -> enrich -> validate
- DOI gating requires pipeline_stage === "validated"
- Tests for seedFromBids, additive merge, validation parsing,
  pipeline_stage in parseNemarMetadataV2

* Fix merge: BIDS-seeded IDs take priority, funding dedup

- Related identifiers: BIDS-seeded entries (e.g. IsDerivedFrom from
  SourceDatasets) take priority; LLM entries for the same DOI are
  dropped to prevent conflicting relation types
- Funding: LLM-parsed entries replace raw BIDS strings when the
  award number from the LLM entry appears inside the raw string
- Updated tests to verify both behaviors

* Fix seed: clean stale relation types for SourceDataset DOIs

When re-seeding, remove conflicting entries (e.g. IsVersionOf) for
DOIs that BIDS SourceDatasets declares as IsDerivedFrom. Prevents
stale LLM misclassifications from persisting across pipeline runs.

* Fix funding dedup: match by award_number when both have one

When LLM returns funding entries with a different funder_name but
the same award_number as an existing entry, treat as duplicate.
Prevents near-duplicate funding entries from accumulating.

* Fix seed: start fresh from BIDS Funding on re-seed

Start funding_references from BIDS Funding strings only during seed
stage, not from existing metadata (which may contain stale LLM-parsed
duplicates from prior runs). LLM will re-parse in stage 2.

* Fix funding seed and apply lint formatting

- Start funding_references fresh from BIDS on re-seed
- Apply biome formatting to all changed files

* Fix DOI target to resolve to NEMAR website

The EZID _target was pointing to the GitHub repo instead of the
NEMAR landing page. Now DOIs resolve to
nemar.org/dataexplorer/detail?dataset_id=nm000XXX. Both the GitHub
repo URL and NEMAR landing page URL are added as related identifiers
(IsDescribedBy) in the seed stage.

* Add title, license, modalities, dataset_type to seed

seedFromBids() now captures all deterministic BIDS fields:
title (Name), license (License), dataset_type (DatasetType),
modalities (detected from repo tree), and resource_type_specific
(mapped from modality, e.g. "EMG Dataset"). These fields are
set in the seed stage so the LLM validator can review them.

* Add validation feedback loop with auto-correction

When validation fails, blocking issues are fed back to the LLM
for correction (up to 3 attempts). If still failing after all
attempts, a GitHub issue is created on the dataset repo to notify
admins. Also updated the validation prompt to accept IsDescribedBy
for GitHub/NEMAR URLs.

* Add MeSH term validation via NLM API

New pipeline stage 2b validates keywords tagged with subject_scheme
"MeSH" against the NLM MeSH Lookup API. Valid terms get a value_uri,
invalid terms get corrected to the closest MeSH match or have their
scheme stripped. Runs after LLM enrichment, before LLM validation.

* Restrict keyword schemes to MeSH only

Updated LLM prompt to only use MeSH (not LCSH or others). The
LLM result parser now strips any non-MeSH subject_scheme. The
MeSH validation step also removes non-MeSH schemes from existing
keywords.

* Address PR review findings

- Add error logging to MeSH API calls (catch blocks, non-OK responses)
- Check GitHub issue creation response, deduplicate on re-trigger
- Throw on unknown doi_provider (not silent fallback for permanent DOIs)
- Halt pipeline on invalid dataset_description.json (return 422)
- Wrap end-of-pipeline commits individually (non-fatal after LLM work)
- Log when Zenodo backup skipped, warn on missing bucket URL
- Replace magic string "10.5072" with TEST_SHOULDER constant
- Require populated criteria before defaulting validation to "valid"
- Fix seedFromBids JSDoc (URLs -> IsDescribedBy, not References)
- Expand webhook JSDoc to cover .bidsignore and D1 caching
- Extract callOpenRouter, truncateReadme, queryMesh helpers (~80 lines dedup)
- Simplify funding dedup, correction loop, MeSH logging
- Remove conditional assertion pattern in tests (if version === 2.0)
- Add validateMeshTerms live tests (NLM API), URL fallback tests
- Update plan.md and ideas.md with implemented pipeline status

* Fix pre-existing lint issues blocking CI

- iam.ts: Avoid assignment in while expression
- datasets.ts: Add type annotation to queryResult
- datacite.test.ts: Biome format fixes

* Fix biome lint/format issues in CLI source
- BIDS validation now triggers on push to main and workflow_dispatch
- Admin can skip CI check during publication with --skip-ci-check
- All backend commits/tags authored as nemarAdmin <[email protected]>
- Fix parseDoiProvider tests to match throw-on-invalid behavior
- Use timing-safe comparison for webhook token validation
- Add logging to empty catch blocks (enrichment_json parse, workflow deploy)
- Update CLI publish display: 14 steps -> 15 (add enrichment_check)
- Align CLI LLM prompt to MeSH-only policy, strip non-MeSH schemes
- Standardize MeSH scheme_uri to id.nlm.nih.gov/mesh/
- Validate funder_identifier_type before casting in LLM validator
- Surface issue_creation_error in llm-enrich webhook response
- Remove dead code (unused offset, dead initialUrls assignment)
- Remove fragile inline comment (hardcoded sandbox prefix value)
@neuromechanist

Copy link
Copy Markdown
Contributor Author

Merged manually via squash merge (commit 255087f). PR interface was stuck.

neuromechanist added a commit that referenced this pull request Feb 19, 2026
* Add upload resume capability (#148)

Track per-file S3 upload progress in .nemar/upload-progress.json so
interrupted uploads can resume without re-uploading completed files.
Wrap post-S3 steps with completion guards for full idempotent resume.

- New module: src/lib/upload-progress.ts (progress tracking)
- Add --restart flag to clear progress and force re-upload
- Exclude .nemar/ from file manifest and auto-add to .gitignore
- Add onBatchComplete callback for periodic progress persistence
- Skip ORCID re-collection when nemar_metadata.json exists
- Validate dataset_id on resume to discard stale progress
- Strengthen progress file validation (file entries + step values)
- Add console.warn on read/write/clear failures (no silent swallowing)
- 29 unit tests (real filesystem, no mocks)

Closes #147

* Fix upload stalling and S3 permission for admin/owner

- Adaptive presigned URL batching: probe upload speed, then
  request URLs in chunks that fit within 45-min safety window
  (presigned URLs expire at 60 min). Eliminates stalling at
  400-500 files for large datasets.
- Bypass user_s3_permissions check for admin/owner roles in the
  presigned URL endpoint (they have full bucket IAM access).
- Write nemar_metadata.json immediately after ORCID collection
  so resumed uploads don't re-prompt for author info.

* Use semaphore pool for parallel uploads

Replace fixed Promise.all batches with a concurrent pool that
keeps all job slots busy at all times. Previously a slow file
would block an entire batch; now the next file starts as soon
as any slot frees up.

* Stream file uploads instead of buffering in memory

Use Bun.file() as fetch body instead of reading entire file
into an ArrayBuffer. With -j 16 and 65MB files, the old
approach buffered ~1GB in memory causing GC pressure and
throughput loss. Streaming reads directly from disk.

* chore: bump version to 0.5.3

* Add STS credential-based upload via AWS CLI (#151)

* Add STS credential-based upload via AWS CLI

Adds an alternative upload path using `aws s3 sync` with temporary
STS credentials for higher throughput than presigned URLs. Falls
back to presigned URLs when AWS CLI is unavailable.

Closes #150

* Fix biome formatting after merge

* Fix manifest missing git-annex symlinked data files

collectFileManifest used `find -type f` which skips symlinks.
Git-annex replaces data files with symlinks to .git/annex/objects/,
so all data files were classified as missing (0 data files detected).

- Add `-type l` to find command to include symlinks
- Switch to unlocked mode after git annex init so data files
  remain as regular files instead of symlinks

* Fix dataset ID generation failing due to D1 parameter binding bug

D1 Workers returned wrong results for the gap-finding query that
used indexed parameters (?1, ?2, ?3) in a complex subquery with
NOT IN. Replaced with a two-step approach: simple queries to fetch
candidates and existing IDs, then JS logic to find the minimum
unused number. Also fixes biome formatting in git-annex.ts.

* Fix aws s3 sync stalling with many include patterns

Per-file --include patterns cause aws s3 sync to stall during
pattern compilation when there are hundreds of files. For large
file lists (>100), switch to directory-level --exclude patterns
instead (.git, .datalad, .nemar).

* Show upload progress for AWS CLI sync

Read both stdout and stderr for progress lines since aws s3 sync
may write to either stream. Display file count, percentage, and
current filename in the spinner.

* Align DataCite pipeline with kernel-4.6 (#152)

* Align DataCite pipeline with kernel-4.6 and neuroschema v0.3.0

Bug fixes:
- Fix modality detection using DatasetType ("raw") instead of BIDS dirs
- Add ODC-By, ODbL license variants to mapLicense()
- Handle URL-type refs in ReferencesAndLinks (previously dropped)
- Parse BIDS SourceDatasets into IsDerivedFrom relations
- Add missing collectionDates/geoLocation to enrichment Zod schema

Schema alignment (NemarMetadata v2.0):
- Add NemarMetadataV2 with snake_case fields (neuroschema v0.3.0)
- Discriminated union on version field for v1.0/v2.0 parsing
- Structured types: keywords, related_identifiers, funding_references,
  contributors, dates, geo_locations
- Read .nemar/metadata.json first, fall back to nemar_metadata.json

Enhanced DataCite XML:
- Publisher identifier attributes (ROR)
- Structured subjects with scheme/URI attributes
- GeoLocation coordinates (lat/lon)
- resourceTypeGeneral on relatedIdentifiers
- awardURI on funding references
- dateInformation on dates

Enum updates (kernel-4.6):
- ResourceTypeGeneral: +Award, Instrument, Project, StudyRegistration
- DateType: +Coverage
- ContributorType: +Translator
- RelationTypes: +6 (IsDerivedFrom, IsSourceOf, etc.)

* Address PR review findings

Critical fixes:
- Validate v2 author entries per-field instead of unsafe cast
- Fix admin.ts DOI update route to read .nemar/metadata.json
- Add func->fMRI and other BIDS datatype mappings

Important fixes:
- Write v2 enrichment to .nemar/metadata.json, v1 to old path
- Validate geo_locations require place or valid point
- Warn on unrecognized metadata version instead of silent skip
- Fix comment counts (38 relation types, 32 resource types)
- Update file header to reference kernel-4.6

Tests:
- Add tests for detectModalitiesFromTree (5 tests)
- Add tests for mapModalityToResourceType func mapping (5 tests)
- Add tests for parseNemarMetadata v2 (5 tests)
- Add tests for nemarMetadataToEnrichment v2 (6 tests)

* Add LLM enrichment CI, retire v1 metadata, gate DOIs

- Add backend LLM enrichment service (backend/src/services/llm-enrich.ts)
  with v2 output format and author ORCID preservation
- Add POST /webhooks/llm-enrich endpoint for CI-triggered enrichment
- Add llm-enrichment.yml workflow to deployWorkflows (triggers on
  README.md or dataset_description.json changes)
- Gate concept DOI creation on enrichment_json presence (422 if
  missing, skip_enrichment_check override available)
- Add enrichment_check step to publication orchestrator (warn-only)
- Update CLI llm-enrich.ts to v2 output (snake_case, structured
  keywords, typed related identifiers)
- Update CLI dataset upload to write .nemar/metadata.json (v2)
- Update CLI doi enrich to produce v2 format with affiliations[]
- Add OPENROUTER_API_KEY to Bindings and Workers secrets
- Update WORKFLOW_FILES to include all 5 deployed workflows
- Add tests for validateLlmResultV2 and mergeWithExisting

Closes #153

* Address PR review findings

- createOrUpdateFile now throws on failure instead of returning false
- Remove -f flag from curl in llm-enrichment workflow (was preventing
  graceful error handling due to bash -e)
- Separate getBlobContent from JSON.parse in webhook to let infra
  errors propagate while catching parse errors
- Add explicit warnings for corrupt metadata files in CLI upload
- Log warning when OPENROUTER_API_KEY is missing in CLI enrichment
- Remove unused AuthorEnrichmentV2 import from backend llm-enrich
- Improve error logging in enrichment_check and metadata parse paths

* Fix OpenRouter model ID for Claude Haiku 4.5

* Document metadata pipeline architecture (issue #154)

Add staged enrichment pipeline design (seed -> enrich -> validate)
to plan.md and ideas.md. DOI minting gated on validated stage.

* Add LLM validation prompt design to ideas.md

Draft system prompt for Stage 3 metadata validation, modeled after
pr-review-toolkit structured criteria with confidence scoring.

* Implement 3-stage metadata pipeline (seed, enrich, validate)

- Add pipeline_stage field to NemarMetadataV2 type system
- seedFromBids(): extract all authors, SourceDatasets, Funding,
  ReferencesAndLinks from BIDS deterministically (no LLM)
- mergeWithExisting(): additive merge for related_identifiers and
  funding_references (preserves BIDS-seeded IsDerivedFrom entries)
- validateMetadata(): LLM judge reviews metadata quality with
  structured criteria and confidence scoring
- Webhook runs all 3 stages: seed -> enrich -> validate
- DOI gating requires pipeline_stage === "validated"
- Tests for seedFromBids, additive merge, validation parsing,
  pipeline_stage in parseNemarMetadataV2

* Fix merge: BIDS-seeded IDs take priority, funding dedup

- Related identifiers: BIDS-seeded entries (e.g. IsDerivedFrom from
  SourceDatasets) take priority; LLM entries for the same DOI are
  dropped to prevent conflicting relation types
- Funding: LLM-parsed entries replace raw BIDS strings when the
  award number from the LLM entry appears inside the raw string
- Updated tests to verify both behaviors

* Fix seed: clean stale relation types for SourceDataset DOIs

When re-seeding, remove conflicting entries (e.g. IsVersionOf) for
DOIs that BIDS SourceDatasets declares as IsDerivedFrom. Prevents
stale LLM misclassifications from persisting across pipeline runs.

* Fix funding dedup: match by award_number when both have one

When LLM returns funding entries with a different funder_name but
the same award_number as an existing entry, treat as duplicate.
Prevents near-duplicate funding entries from accumulating.

* Fix seed: start fresh from BIDS Funding on re-seed

Start funding_references from BIDS Funding strings only during seed
stage, not from existing metadata (which may contain stale LLM-parsed
duplicates from prior runs). LLM will re-parse in stage 2.

* Fix funding seed and apply lint formatting

- Start funding_references fresh from BIDS on re-seed
- Apply biome formatting to all changed files

* Fix DOI target to resolve to NEMAR website

The EZID _target was pointing to the GitHub repo instead of the
NEMAR landing page. Now DOIs resolve to
nemar.org/dataexplorer/detail?dataset_id=nm000XXX. Both the GitHub
repo URL and NEMAR landing page URL are added as related identifiers
(IsDescribedBy) in the seed stage.

* Add title, license, modalities, dataset_type to seed

seedFromBids() now captures all deterministic BIDS fields:
title (Name), license (License), dataset_type (DatasetType),
modalities (detected from repo tree), and resource_type_specific
(mapped from modality, e.g. "EMG Dataset"). These fields are
set in the seed stage so the LLM validator can review them.

* Add validation feedback loop with auto-correction

When validation fails, blocking issues are fed back to the LLM
for correction (up to 3 attempts). If still failing after all
attempts, a GitHub issue is created on the dataset repo to notify
admins. Also updated the validation prompt to accept IsDescribedBy
for GitHub/NEMAR URLs.

* Add MeSH term validation via NLM API

New pipeline stage 2b validates keywords tagged with subject_scheme
"MeSH" against the NLM MeSH Lookup API. Valid terms get a value_uri,
invalid terms get corrected to the closest MeSH match or have their
scheme stripped. Runs after LLM enrichment, before LLM validation.

* Restrict keyword schemes to MeSH only

Updated LLM prompt to only use MeSH (not LCSH or others). The
LLM result parser now strips any non-MeSH subject_scheme. The
MeSH validation step also removes non-MeSH schemes from existing
keywords.

* Address PR review findings

- Add error logging to MeSH API calls (catch blocks, non-OK responses)
- Check GitHub issue creation response, deduplicate on re-trigger
- Throw on unknown doi_provider (not silent fallback for permanent DOIs)
- Halt pipeline on invalid dataset_description.json (return 422)
- Wrap end-of-pipeline commits individually (non-fatal after LLM work)
- Log when Zenodo backup skipped, warn on missing bucket URL
- Replace magic string "10.5072" with TEST_SHOULDER constant
- Require populated criteria before defaulting validation to "valid"
- Fix seedFromBids JSDoc (URLs -> IsDescribedBy, not References)
- Expand webhook JSDoc to cover .bidsignore and D1 caching
- Extract callOpenRouter, truncateReadme, queryMesh helpers (~80 lines dedup)
- Simplify funding dedup, correction loop, MeSH logging
- Remove conditional assertion pattern in tests (if version === 2.0)
- Add validateMeshTerms live tests (NLM API), URL fallback tests
- Update plan.md and ideas.md with implemented pipeline status

* Fix pre-existing lint issues blocking CI

- iam.ts: Avoid assignment in while expression
- datasets.ts: Add type annotation to queryResult
- datacite.test.ts: Biome format fixes

* Fix biome lint/format issues in CLI source

* Add BIDS push trigger, admin CI override, bot committer (#157)

- BIDS validation now triggers on push to main and workflow_dispatch
- Admin can skip CI check during publication with --skip-ci-check
- All backend commits/tags authored as nemarAdmin <[email protected]>
- Fix parseDoiProvider tests to match throw-on-invalid behavior

* chore: bump version to 0.6.0

* Fix review findings from PR #158

- Use timing-safe comparison for webhook token validation
- Add logging to empty catch blocks (enrichment_json parse, workflow deploy)
- Update CLI publish display: 14 steps -> 15 (add enrichment_check)
- Align CLI LLM prompt to MeSH-only policy, strip non-MeSH schemes
- Standardize MeSH scheme_uri to id.nlm.nih.gov/mesh/
- Validate funder_identifier_type before casting in LLM validator
- Surface issue_creation_error in llm-enrich webhook response
- Remove dead code (unused offset, dead initialUrls assignment)
- Remove fragile inline comment (hardcoded sandbox prefix value)

* Auto-set Version 1.0.0 when missing in publish orchestrator

* Fix DOI metadata pipeline and add enrichment guard

- Concept DOI creation now reads .nemar/metadata.json via
  readRepoMetadata() for full enrichment (descriptions, ORCIDs,
  affiliations, keywords, methods)
- Preserve MeSH keyword scheme info through DataCiteEnrichment
  (keywords changed from string[] to DataCiteSubject[])
- Fix related identifier type detection (URLs no longer typed as DOI)
- Add DOI normalization to prevent duplicates (doi:, https://doi.org/)
- Fix _target URL to always resolve to nemar.org (not GitHub)
- Add enrichment guard: skip re-enrichment when metadata is already
  validated and source content unchanged (SHA-256 hash comparison)
- Accept force param in llm-enrich webhook; workflow_dispatch passes
  force=true for manual re-runs

Fixes #161, #162

* Address PR review: fix dedup, add tests

- Remove dead cross-format dedup code in addRelatedId
- Add empty identifier guard (normalizeDoi can return "")
- Make normalizeIdentifierKey case-insensitive
- Fix V2 enrichment: use normalized id for dedup key
- Avoid array mutation via spread copies
- Validate force param type in webhook
- Distinguish missing source_hash in log message
- Add 17 new tests: normalizeDoi, detectIdentifierType,
  cross-format dedup, MeSH scheme e2e, identifierType

* Fix RelationType type in addRelatedId parameter
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