Skip to content

Turn on the publication review in production, cap 150 (shadow first) - #2370

Merged
neuromechanist merged 5 commits into
devfrom
chore/issue-1732-publication-review-prod
Nov 27, 2026
Merged

neuromechanist merged 5 commits into
devfrom
chore/issue-1732-publication-review-prod

Conversation

@neuromechanist

@neuromechanist neuromechanist commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds PUBLICATION_REVIEW_ENABLED = "1" to production [vars] so the existing publication review (ADR 0102) runs in production. This is the owner's decision of 2026-11-25 (epic #2182, plan step D0): shadow first, on a batch of 20 requests started by hand, before the rest of the queue. The review never approves or denies; it holds the admin mail until it reports and the approval gate reads its verdict. The guard test backend/test/publication-review-flag.test.ts now asserts the flag is on in production, and still asserts that it is in no other environment.

Part of #1732. Part of #2182.

Owner go, 2026-11-26

The owner asked to switch the review on, shadow first, starting with the fNIRS requests and then the rest of the queue. Status of the items from "Before it is switched on" (ADR 0102):

  • Item 4: run-publication-review.yml is deployed in nemarDatasets/.github (read 2026-11-25).
  • Item 7, workflow half: approve-publication.yml masks the dispatch token first, exports it only in the approve step's process, and releases the claim on failure (read 2026-11-25, lines 116-124, 359-363, 450-487).
  • Item 7, staging audit query, run 2026-11-26 as counts only: staging has 0 published requests with approval_requested_by set, so there is no web approval to compare. The check is vacuous on staging and is rerun on production after the first web approval. Original query: bunx cfman wrangler --account sccn d1 execute nemar-db-dev --env dev --remote --config backend/wrangler-sccn.toml --command "SELECT dataset_id, approval_requested_by, approved_by, approved_at FROM publication_requests WHERE status = 'published' AND approval_requested_by IS NOT NULL ORDER BY approved_at DESC LIMIT 50"
  • Item 7, the ADR 0105 open question: should a web click by someone who is no longer an active administrator publish at all? Today it falls back to the caller. This is still undecided and does not block shadow runs, because the review neither approves nor denies. The owner is the only active administrator.
  • Item 5, the soak on the dev Worker (Phase 5: Soak on dev, then release with the flag off in production #1732): waived by the owner's go. The fNIRS shadow batch serves as the soak.
  • Item 6, the review's statement on the policy pages: not yet written. It is needed before the review's verdicts reach depositors, not for shadow runs.
  • Item 8 (after deploy, owner): delete the PRESCREEN_ENABLED secret and disable run-prescreen.yml after this deploys.
  • The platform cap is raised from 50 to 150 model calls a day (PLATFORM_DAILY_CAP, owner decision 2026-11-25), recorded as a dated amendment to ADR 0102. The per-depositor cap stays 5 and an administrator's start still skips it. The cap tests now read the constant, and pass at both 150 and 50.

After the release (owner)

  1. nemar admin repo publish start <id> for the fNIRS requests first, then a batch across screen states, then nemar admin repo publish show <id> for each.
  2. Label each verdict agree or disagree in .context/plans/publication-queue/d0-shadow-labels.md on the evidence branch. Go for the rest only with zero pass verdicts where you would deny.
  3. Then nemar admin repo publish start for the remaining requests; at 150 a day the queue takes 2 to 3 days.

Test plan

  • bun test backend/test/publication-review-flag.test.ts backend/test/cron-sweep-wiring.test.ts backend/test/prescreen-handover.test.ts (246 pass, 0 fail).
  • bun test backend/test/publication-review-callbacks.test.ts backend/test/publication-review-d1.test.ts backend/test/publication-review-flow.test.ts backend/test/publication-review-flag.test.ts (193 pass, 0 fail), and the callbacks file again with the cap set back to 50 (112 pass, 0 fail).
  • bun test test/adr-index.unit.test.ts (11 pass).
  • Revert check: with the line absent, the production test fails (observed before the test was updated).
  • Not run: the full suite and the live tier; this changes one configuration value and its guard test.

@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

📦 Package Preview

Your package is ready to test!

bun install -g nemar-cli@PR2370

Version: 0.10.46-PR2370.d3c69d4
Commit: d3c69d4


🤖 Updated on each push.

@neuromechanist neuromechanist changed the title Turn on the publication review in production (shadow first) Turn on the publication review in production, cap 150 (shadow first) Nov 25, 2026
@neuromechanist

Copy link
Copy Markdown
Contributor Author

Review round 1 (one Sonnet reviewer, lenses code, tests, comments): no critical or important findings. Two suggestions, both fixed in the latest commit: the dev block comment in backend/wrangler-sccn.toml no longer says production must not be lit, and the cap test comments no longer name fifty-one. The reviewer also asked whether ADR 0139 exists: it is accepted on feature/issue-2182-epic-pq-decide and reaches dev with that epic. The flag and cap tests pass (118 pass, 0 fail). Still a draft until the owner confirms the open items above.

@neuromechanist
neuromechanist force-pushed the chore/issue-1732-publication-review-prod branch from ad7026e to 79d9d58 Compare November 27, 2026 04:47
@neuromechanist
neuromechanist marked this pull request as ready for review November 27, 2026 04:48
@neuromechanist
neuromechanist merged commit f1cfea9 into dev Nov 27, 2026
27 checks passed
@neuromechanist
neuromechanist deleted the chore/issue-1732-publication-review-prod branch November 27, 2026 05:19
This was referenced Nov 27, 2026
neuromechanist added a commit that referenced this pull request Nov 27, 2026
The publication review runs in production (#2370).

This branch was previously deployed

1 inactive deployment
npm — d3c69d42 Deployed Nov 27, 2026 by neuromechanist via publish #5057
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