Skip to content

Show the decision card on the approval page - #621

Merged
neuromechanist merged 7 commits into
stagingfrom
feat/p5-decision-card
Nov 28, 2026
Merged

neuromechanist merged 7 commits into
stagingfrom
feat/p5-decision-card

Conversation

@neuromechanist

Copy link
Copy Markdown
Contributor

Phase P5 of epic nemarOrg/nemar-cli#2449 (nemarOrg/nemar-cli#2456): the approval page shows the administrator's decision card.

What changed

  • The panel reads decision_card from the review detail it already fetches (GET /admin/publish/:id/review, the route nemar admin dataset publish show reads; production nemar-cli 0.10.57 serves it) and draws it first, in the order and with the labels of the terminal's renderer (src/lib/decision-card-display.ts): next action, license panel (cue, reason, Field, LICENSE fact, Matcher, review and fresher lineage with declared licenses, dropped DOIs, skipped relations, permission, other reasons), name panel (cue, line, upstream titles), the dataset's own words side by side (.nemar/metadata.json beside dataset_description.json, Version, anonymous note, the not-as-reviewed note), authors with placeholders flagged, per-question answer with its strongest finding (label only, as the terminal does; the model's note stays in the findings section under its label), the identifier screen line with its head line, and the automatic-denial line.
  • Each cue is a badge carrying its word (Green, Amber, Red) plus a colored bar, so it is never color alone; an unknown cue word reads amber, never green.
  • Nothing is decided on the page. next_action.command is never read. If the card suggests approve while this page does not offer Approve (ADR 0027's stricter rules), the suggestion is replaced by a page-owned sentence that says so.
  • A missing card, v other than 1, a card without its parts, or an out-of-step detail draws the panel exactly as before.
  • Every string reaches the DOM through textContent (the existing PanelNode tree); control and format characters (bidirectional overrides included) are removed, as the terminal's plain() does.
  • No new mutations; the approve, deny and start controls are unchanged.

Test plan

  • bun run test: 8941 passed, 20 skipped (new src/lib/decision-card.test.ts, 13 tests)
  • bun run lint and bun run typecheck: 0 errors
  • bun run build
  • Fixture test/fixtures/decision-card/cards.json: four cards built by nemar-cli's real buildDecisionCard at v0.10.57 (d1c777cc) from its own test inputs; the red one is the golden card of nemar-cli's test/decision-card-display.unit.test.ts, and the page's words are pinned in the same order
  • Mutation: removing the approve guard turns "shows approve only when this page offers Approve" red
  • Hostile depositor fields (markup, a right-to-left override) reach the tree only as plain text
  • Walk-through on test.nemar.org after merge (not run: staging only; would check the card on a real request against nemar-cli dev)

No screenshot: the page needs a signed-in admin session and the review route, and the repository has no local stand-in for them, so a screenshot would mean contacting a live service.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Deploying nemar-website with  Cloudflare Pages  Cloudflare Pages

Latest commit: 6ec8f81
Status: ✅  Deploy successful!
Preview URL: https://64bad602.nemar-website.pages.dev
Branch Preview URL: https://feat-p5-decision-card.nemar-website.pages.dev

View logs

@neuromechanist
neuromechanist merged commit edcd503 into staging Nov 28, 2026
4 checks passed
@neuromechanist
neuromechanist deleted the feat/p5-decision-card branch November 28, 2026 03:50
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