Repository navigation
Phase 3: HED backfill sweep + admin command - #876
Merged
neuromechanist merged 2 commits intoJun 30, 2026
Merged
neuromechanist merged 2 commits into
neuromechanist merged 2 commits into
Conversation
📦 Package PreviewYour package is ready to test! bun install -g nemar-cli@PR876Version: 🤖 Updated on each push. |
Contributor
Author
Review summary (3 agents: code, silent-failure, tests — Sonnet)Code review found no issues at confidence >=80 (candidate/remaining predicate consistency, Addressed
Confirmed sound (no change)
Local gates: 9 sweep tests + all HED suites green; Biome + backend |
neuromechanist
merged commit Jun 30, 2026
81e6a58
into
feature/issue-869-epic-hed-detection
1 check passed
This was referenced Jun 30, 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.
Summary
Adds the one-time backfill that seeds HED for datasets predating phase 2, mirroring the channel/montage sweep (#859) with two deliberate divergences.
Backend —
POST /admin/datasets/hed-sweep?limit=default 15, clamped [1,30]); run untilremainingreaches 0; idempotent viahed_checked_at IS NULL.*_events.{json,tsv}across eeg/meg/ieeg/beh/func, so every managed dataset is a candidate.latest_version, and the sweep callswriteVersionHedfor the published latest version sodataset_versionsstays consistent with the denormalizeddatasetsrow. Skipped for unpublished datasets (no version row -> no spurious 0-row error).updated_at/metadata_updated_atbump); marks every processed row checked soremainingconverges even on probe miss/error;?reset=1clears probed rows.{ processed, withHed, withoutHed, unknown, errors, remaining }.CLI —
nemar admin hed-sweepdo…while (remaining > 0)accumulating tallies;--limit,--reset,--verbose(per-batch[batch N]lines),--json.requireAuth()gate, ~1s pacing, a progress guard that bails ifremainingstops decreasing, non-zero exit on errors. API clienthedSweep/hedSweepResetmirrorreindexBulk.Docs
nemar admin hed-sweepadded to the AGENTS.md admin command list.Out of scope
?has_hed=1filter + CLI--hed.Closes #872
Part of epic #869
Test plan
test/hed-sweep.unit.test.ts(new, real bun:sqlite + migration 0056): asserts the modality-agnostic candidate scoping (meg-only + no-modality datasets ARE candidates; catalog/sandbox excluded), thelatest_versionsubquery, the no-updated_at-bump direct write, unknown-probe convergence, and?reset=1.writeVersionHeditself covered bybackend/test/hed-write.test.ts(phase 2). Handler GitHub I/O not unit-tested (matches the channel-montage sweep test = SQL contract).typecheck+ CLItypecheckclean.cli.test.tsfailures are pre-existing live-API integration tests (identical on the epic baseline), unrelated to this change.