Repository navigation
B6: license permission evidence workflow - #2393
neuromechanist merged 16 commits into
Conversation
Tested: migrations:d1-check, publication-review-migration.test.ts.
Tested: test/license-permission.unit.test.ts.
Tested: contract, cure-split, admin-routes, inputs tests.
Tested: backend/test/license-permission.test.ts.
Tested: backend/test/license-permission.test.ts, route inventory.
Tested: test/admin-publish-license-permission-cli.test.ts.
Tested: identifier-screen-stored, publish-request-ci-pending.
Tested: backend/test/license-permission.test.ts.
📦 Package PreviewYour package is ready to test! bun install -g nemar-cli@PR2393Version: 🤖 Updated on each push. |
Tested: backend/test/license-permission.test.ts.
Tested: backend/test/license-permission.test.ts, mutation-checked.
Review round 1 items 1 to 3. Tested: backend/test/license-permission.test.ts.
Review round 1 items 4, 6, 7, 8, 9. Tested: backend/test/license-permission.test.ts.
Review round 1 items 5, 9, 10. Tested: test/license-permission.unit.test.ts.
Mutation-checked: no unique index, conflict not refused, mail on conflict, unreadable as not_ready.
|
Merge gate (lead): head 21191a5; every remote check passes. Review: round 1 panel (code+tests; errors+comments+types), 6 important findings (concurrent records; mails sent without an insert; ticket binding, now trust-the-administrator but visible, with the subject and sender shown and audited and a warning when the sender is not the depositor; an unreadable review read as not_ready; mail failures hidden in the CLI; no_recipient) and 4 more fixed; round 2 delta review resolved all ten, and its two suggestions are rejected with reasons (the audit is admin-only and the ticket already holds the address; the warning is advisory). Implements the owner's license permission workflow of 2026-11-25. |
0826116
into
feature/issue-2182-epic-pq-decide
Part of #2391. Part of #2182.
Card B6 of the publication-queue plan: the license permission evidence workflow (ADR 0139 decision 7, owner decision of 2026-11-25).
What changes
LINEAGE_PERMISSION_REQUESTinshared/license-lineage.tsholds one sentence per outcome that needs action, worded from the owner's: send evidence from the original authors (forredistribution_prohibited, from the source repository such as PhysioNet) to [email protected], quoting the dataset id.unresolvedasks for a link to the license.licensePermissionRequest(shared/license-permission.ts) fills the placeholders from closed license words and identifiers of a known form only; a URL or free-text identifier is named generically and a malformed dataset id is not quoted.license_lineage_unconfirmedon a request still waiting, the requester gets one mail with that sentence (license_permission_notices, claimed before the send, once per request and outcome), through the dev mail fence.GET /datasets/:id/publish/statusreturns the same lines aslicense_permission_lines, andnemar dataset publish statusprints them.publication_reviews.lineage_basis: outcome, target license, the sources behind the outcome), which is what a permission is matched against.nemar admin dataset publish license-permission <dataset> --ticket <id> --evidence <text> [--apply](alias pathrepo, ADR 0135), backed byPOST /admin/publish/:id/license-permission. Dry run by default;--applywrites thelicense_permissionsrow and alicense_permission_recordedaudit row in one batch. The ticket must exist and be visible to the administrator (ADR 0112's predicate). The evidence (1 to 1,000 characters) is never echoed, audited, logged, shown to a depositor or sent to a model.license_lineage_unconfirmed, and only that, for the request and for later requests of the dataset with the same basis; the stored verdict is re-derived without that reason when the column still equals what its report derives (no model re-run). The admin show, the detail contract and the administrators' mail print "License permission recorded on (date) by (administrator), ticket (ticket)".lineage_basiscolumn and the two tables.Deviations from the card
license_permission_noticesholds the once-per-request-and-outcome claim.Tests
test/license-permission.unit.test.ts: each outcome's message; no free text interpolated; the basis; coverage; what the derivation clears.backend/test/license-permission.test.ts: basis stored on serve; notice once per request and outcome; fenced in dev; dry run records nothing; apply records with audit; unknown and hidden tickets refused; clears for the request and a later one with the same sources, not a different source or target license; never clearsquestion_failed; never reaches back to an earlier request; evidence absent from status, detail, audit and the next review's inputs; migration 0154 on Miniflare's D1.test/admin-publish-license-permission-cli.test.ts: the command end to end.question_failed; and 13 more (dry run, ticket check, target and outcome binding, own files, free-text id, reach-back, notice dedupe, fence state, basis store, verdict re-derivation, mail line, clearing at all).bun run typecheck,bun run lint, backend typecheck,bunx biome checkon touched files,bun run migrations:d1-check. Pure tier: 28194 pass, 5 fail on the first run; 3 were this branch's (a view-to-mail import and two key pins), fixed in the last commits; the other 2 (test/account-copy-parity.test.tsagainst the local website checkout,test/git-annex-remote.test.tslocal push) touch nothing in this diff.