Skip to content

Add nemar dataset screen: reproduce the screen locally - #2389

Merged
neuromechanist merged 8 commits into
feature/issue-2182-epic-pq-evidencefrom
feature/issue-2184-dataset-screen
Nov 26, 2026
Merged

neuromechanist merged 8 commits into
feature/issue-2182-epic-pq-evidencefrom
feature/issue-2184-dataset-screen

Conversation

@neuromechanist

@neuromechanist neuromechanist commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds nemar dataset screen [path] [--json] [--committed]: the publication screen's report for the depositor's own copy of a dataset, with no login, no network, and no write to the dataset or its .git. Part of #2184. Part of #2182. Card A9.

The command builds its report with the same two calls the publication screen's CI path makes (scanDatasetFromManifest, then finalizeScanReport), with the same readers, limits and folds, and prints it with describeScreen, so a status, a per-format count, a finding kind, its remedy and docs link, and the scanner and reader versions read as they do on the server. The bytes come from a local file, a git blob through git cat-file, or the annex object store on this machine (indexed by listing it; git-annex is never run, because it can auto-initialize a repository).

  • Default reads the working tree; --committed reads the tree of HEAD, which is what the server screens. The first line says which was read and the commit.
  • In a repository the history is walked as the server walks it: every path that ever existed goes through the path rules, and a recording an earlier commit held is read when its content is on this machine, and otherwise counted and named in a "Not read" line.
  • An annexed recording whose content is not on this machine is partial with reason content-absent (declared by A1; its copy entry now says where the content is kept for a local run). It is not a failed read.
  • What the local run cannot see is printed under the verdict: the server's copy, the working tree versus the committed tree, no history outside a repository, and earlier recordings with no content here.
  • Exit status: 0 for clean, dates-only or no-recordings; 3 for direct identifiers; 2 for everything else, including a run that could not be made. --json prints the report (version 2) alone on stdout; the local gap lines go to stderr.

Deviations and notes for review

  • Accepted by the lead: src/index.ts (3 lines, outside the card's scope list): the root preAction hook sends GET /notices before every command, which would break "no network in the command". A command marked local-only (markLocalOnly, same pattern as isMovedCommandStub) skips it. The other startup network path, the daily update check, is global and is opted out with NEMAR_NO_UPDATE_CHECK=1 as in the other CLI suites.
  • The report's scanner is identifier-scan@<revision> of the checkout when the CLI runs from source, so the parity test compares it exactly; a packaged CLI has no checkout and is identifier-scan@nemar-cli-v<version>, the release tag, which names an exact commit (lead ruling). One output line says which kind of id it is. The report door's scanner pattern (shared/identifier-screen-report.ts) accepts that form beside a revision; the publication workflow still sends a revision.
  • With no git history the report's head is the null object id (the contract needs a 40-hex commit) and the dataset id is xx000000 (never allocated); neither is printed as if it were real.
  • The "one function" of the card is the existing pair above; scripts/identifier-screen-ci-lib.ts needed no edit. The CI path's own screenDataset is run on the same repository in the parity test.
  • The local-only sentences are declared once in LOCAL_COPY in shared/identifier-screen-copy.ts with docs anchor local-run; A10 needs a section for it.
  • screen is added to COMMON_COMMANDS in src/lib/help-groups.ts, so plain nemar dataset --help lists it (lead ruling).

Tests

  • test/dataset-screen.test.ts (pure tier): parity with screenDataset on three repositories in both modes, exit codes, working tree versus committed (both directions), no repository, content absent (locked, pointer, renamed, side file, dangling link), history present and absent, privacy, no writes, and a real git-annex repository (skipped locally only if git-annex is missing, an error under CI).
  • test/dataset-screen-spawn.test.ts (process tier, its own file): help, exit status through the real entry point, --json validated with parseScreenReport, two runs over a dataset leave every byte of it and its .git unchanged, and a counting proxy on every proxy variable sees zero connections, with a positive control from a command that does use the network.
  • Eleven mutants were run against these tests (notices hook removed, exit codes changed and widened, --committed reading the working tree, wrapper removed, history not read, absent history read, a git write added, limits changed, gap lines dropped); every one is killed.

@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

📦 Package Preview

Your package is ready to test!

bun install -g nemar-cli@PR2389

Version: 0.10.40-PR2389.9605a46
Commit: 9605a46


🤖 Updated on each push.

@neuromechanist

Copy link
Copy Markdown
Contributor Author

Merge gate (lead): head 9605a46. Every remote check passes after one rerun of e2e-sandbox, which failed on infrastructure (a 404 on the PR's npm tarball). Review: round 1 panel, 4 important findings (the update check reached the network and wrote files; unread history did not change the status; git failures read as no repository; copy outside the shared tables) and 4 more fixed; round 2 delta review resolved all eight; its test suggestion is fixed in 9605a46, and the over-conservative annex unreadable is accepted because it fails closed.

@neuromechanist
neuromechanist merged commit e3b69d6 into feature/issue-2182-epic-pq-evidence Nov 26, 2026
60 of 61 checks passed
@neuromechanist
neuromechanist deleted the feature/issue-2184-dataset-screen branch November 26, 2026 02:45

This branch was previously deployed

1 inactive deployment
npm — 9605a469 Deployed Nov 26, 2026 by neuromechanist via publish #4946
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