# Local editorial publication and rollback

This completes the local publication mechanism of M5. Live browser review, authenticated reviewers and community operations remain pending. No accepted contribution is currently supplied, so the wiki contains no published community notes from this workflow.

## Scope

Only the accepted revision's claim text is rendered as a **reviewed community note**, below the main move content. It does not replace extracted names/inputs or populate numerical combat metrics. Each note displays its reviewer, date, revision and publication-history link. Text is HTML-escaped.

The tool requires the most recent review decision to accept the latest submission revision for an editorial change. General-topic submissions without a command reference are not supported by this first publisher. Reviewer identities are self-reported: hashes are content links, not digital signatures or proof of independent verification. Review the evidence before choosing to publish.

## Use

From the workspace, after examining a real accepted review packet:

```powershell
node outputs/tools/publish_editorial.cjs publish PATH-TO-REVIEW.json "Publisher alias" "Reason for publication"
python outputs/tools/build_player_wiki.py
```

This writes the local `editorial-publications.json` journal, then derives `editorial-notes.json`. The wiki builder revalidates the journal before rendering; a modified projection alone cannot insert notes. It writes only workspace files and does not upload or host the site.

To reverse the current publication for one contribution ID:

```powershell
node outputs/tools/publish_editorial.cjs rollback CONTRIBUTION-ID "Publisher alias" "Reason for rollback"
python outputs/tools/build_player_wiki.py
```

Rollback appends an event. It restores the previous note revision, or removes the note if none preceded it. Earlier notes, review packets and rollback events stay in the journal. It never removes source evidence or edits `guide-data.json`.

Validation alone, also run by the builder:

```powershell
node outputs/tools/publish_editorial.cjs validate
```

The journal is the source of truth; the note projection can be regenerated. A failed page rebuild leaves the prior HTML in place until the build is repaired and run again. This local single-writer tool is not a concurrent server or tamper-proof audit store. Preserve backups; do not edit the journal by hand or run simultaneous publication commands.

## Checked behavior

Automated in-memory tests cover acceptance gates, exact claim matching, review hashes, revision updates, restoring a prior note, withdrawing an initial note, and retaining history. Fixtures are never published to the real journal. No live contribution has been judged by the assistant as part of those tests.

Browser presentation and reviewer usability checks remain pending. To verify rendering, a reviewer-approved test fixture should be used only in an isolated output copy, not in the community data.


## Isolated integration validation — 10 September 2026

`work/test_publication_integration.cjs` runs the real publisher and wiki builder against a temporary single-command fixture. It checks rendered text escaping, note replacement, rollback restoration, withdrawal with retained history, rejected publication preserving files, projection regeneration and invalid-journal build rejection. It caught and led to a fix for baseline-directory creation in fresh workspaces. Original guide, publication files and the sampled live move page were hash-checked as unchanged. See [integration results](wiki-publication-integration-validation.json). This checks generated HTML and file behavior, not browser rendering or usability.
