Skip to content

fix: show reviewers why an action was refused and stop setup editors overwriting each other - #164

Merged
snowopsdev merged 15 commits into
mainfrom
fix/review-editors-runbar
Nov 10, 2026
Merged

snowopsdev merged 15 commits into
mainfrom
fix/review-editors-runbar

Conversation

@snowopsdev

Copy link
Copy Markdown
Owner

In production, Next hides the message of an error thrown from a server action, so reviewers saw a generic failure instead of "this brief changed since you opened it". Setup editors could also silently overwrite a colleague's save, and the run bar sometimes showed the wrong run. This PR addresses the open audit findings for the review page, the setup editors, the run bar and the reports.

Review page. Expected refusals come back as { ok: false, error } so the real reason reaches the reviewer; unexpected failures are logged. Archived articles leave the public site. Publish and "revisit brief" ask for confirmation first. Revisit is limited to review statuses, refused during an active run, and clears the schedule, notes, QA and scoring. Reset refuses researched. A brief save refuses a stale version.

Setup editors (ICP, positioning, evidence bank, workspace, source review):

  • A whole-document save is refused when someone else saved after the form was opened.
  • A failed save says why. Only one save runs at a time, and the leave dialog stays disabled while any save, including save-and-activate, is in flight.
  • The ICP step is kept in ?step=. A refused activation keeps the stored version, so the next save is not wrongly refused as stale.
  • Source review is queried per tab and shows true counts.
  • Suggestion accepts refuse a changed bank or voice. Demo-workspace audit rows name the operator. Positioning is capped at three core claims.

Run bar and reports. The bar follows the executing run, counts runs queued behind it, and takes totals from SQL. Both reports count the evidence check, label every cost stage, apply QA's qualitative rule, and leave archived pieces out of their waiting lists.

Proof: typecheck and lint clean; pipeline 887/887; CMS integration 960/960 after rebasing on main. Each fix has a test that failed before it.

Reviewed with sol-loop: 2 rounds with GPT-6.1 Sol. Sol verdict: approved

Created with Claude Opus 5.5 (implementer subagents Claude Sonnet 5.5) in Claude Code.

🤖 Generated with Claude Code

snowopsdev and others added 15 commits November 10, 2026 01:41
…ws them

Next redacts the message of an error thrown from a server action in a
production build, so gate refusals reached the reviewer as a generic error.
The actions in actions.ts, brandVoiceActions.ts and saveTemplateConfigAction
now answer { ok: true, ... } | { ok: false, error }; the editors rethrow the
message in the browser. Also narrows article reads in actions.ts to the
fields they use, refuses resetting an article that is still at researched,
and purges the public page when a published article is archived or
unarchived.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… ask first

- findPublishedArticle and the home list skip archived articles.
- Approve & publish, Publish now and Revisit brief use the armed confirm.
- The published panel's Archive says it takes the piece off the site.
- revisitBriefAction only runs from needs_revision/needs_review/blocked,
  refuses during an active run, and clears the schedule, revision notes,
  QA results and information-gain decision.
- saveBriefAction refuses when someone saved the brief since it was opened.
- 'board' wording becomes 'content list' in the review panels.
- Template tabs/list and the brand voice confirms are accessible: aria
  state on the current item, focus moves with the confirm buttons.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… the real database

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…xactly

`attempt()` now logs a failure that is not a gate's own refusal, since Next
no longer logs an error the action did not throw. The brief save refuses any
version but the stored one, not only an older one. The revisit audit row
records what it clears, and the refusal tests assert the real messages for
brand-voice delete and template save.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Matches the editor's limit and the completeness rule. Validation only: payload-types.ts and the database are unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… page the source queue

- useDirtyGuard: onError for a rejected save, submit() returns the in-flight save, leave dialog disabled while saving
- editors: transitions show a rejected server action instead of reaching the error boundary
- ICP: step carried in ?step=, activation toast, activation error carried across the first-save remount
- workspace: fetch site pages disabled while dirty, success names the domain
- source review: pending, approved and dismissed queried separately with totals
- tenantActions/suggestionActions: updatedAt checks on whole-document saves; demo workspace audit rows name the operator
- accessibility: pressed tabs, aria-current step, TextRows names, fieldset for cleared surfaces

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…source queue and accessible names

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Save-and-activate writes the content before the activation gate can refuse
it, which moved `updatedAt` while the editor kept the old version, so the
next Save was refused as stale against the editor's own write. The failure
result now carries the stored content and version and the editor adopts
them. Version checks compare for equality, the activation failure travels
as a flag rather than free text in the URL, and `persist` uses the version
the guard passes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…waits for sign-in

- latestRunAction prefers the running run, then the oldest queued, then the
  newest settled one, and reports every active run id; the bar says how many
  more are queued and refreshes when any tracked run settles.
- Activity totals come from the loadReportCosts aggregate instead of the
  newest 500 cost-log rows; only the newest row is read for the last call.
- RuntimeBanner checks when a user is signed in, keyed on their id.
- "board" becomes "content list" in the user-facing strings; the article
  reads in boardActions pass select.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…itative rule

pipeline:report now has an evidenceCheck pass rate (overall and per template)
and a failure-digest line, and decides qualitativeReview with
decideQualitative so a review that quoted a not-trait breach no longer counts
as a pass.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… readably

- The reports page adds an evidence-check pass-rate row and names it in
  failure details, which now come from qaFailures and CHECK_LABEL instead of
  raw keys and violation codes.
- Cost-log stages use the run bar's CALL_LABELS table; the stages it lacked
  (brandVoiceExtract, setupAssist, topicRelevance) gain labels.
- Archived pieces drop out of the waiting and review-queue lists; spend totals
  and the status mix are unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The bar now follows the executing run, so an announcement for a run queued
behind it marked the running one stale and showed "Queued — waiting to
start" for up to 20 seconds. An announcement is met once its run is among the
active ones. The CMS report also counts the qualitative check by QA's own
rule (a quoted not-trait breach fails it), and two comments now match the code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The brand-voice save now answers a refusal as a value, so the suggestion
was marked accepted with the word never written. Pass the refusal on and
leave the suggestion open. A bank that was never saved has no version, so a
first save landing between the read and the write went unnoticed; treat
"never saved" as a version of its own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… save-and-activate; report skips archived

- The workspace profile save refuses to overwrite a profile saved after the
  form was opened, like the other setup editors.
- The leave dialog keeps its buttons off while an asset editor's own write
  (save and activate) is running.
- The CLI report leaves archived articles out of the review queue and the
  failure digest, matching the reports panel.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-10T06:47:27.606995Z c34e6ec PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 10, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d0eb512d-8392-4659-abc3-355b364cb8ac
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@snowopsdev
snowopsdev merged commit cdfac3e into main Nov 10, 2026
13 checks passed
@snowopsdev
snowopsdev deleted the fix/review-editors-runbar branch November 10, 2026 06:52
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