> For the complete documentation index, see [llms.txt](https://stemma.sh/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://stemma.sh/docs/guides/review-and-resolve.md). Agents can also search and read this documentation through its [MCP server](https://stemma.sh/docs/~gitbook/mcp).

# Review and resolve changes

Use this guide when a document already contains tracked changes and you need to inspect, accept, or reject them from the CLI.

## Inspect pending revisions

```bash
stemma extract redline.docx --format json
```

The JSON contains a `revisions` array. Each row includes its current `revision_id`, kind, author, date (where the source carries one), block id, and excerpt.

Revision ids are the engine's content-derived identities: a revision whose own content is untouched keeps its id across save/reopen and across a `resolve` of *other* revisions, so ids read here remain valid against the resolved output. Among changes that look exactly alike (same kind, author, date and text), that holds for Stemma's own save, reopen and resolutions; after another editor changes the file, lookalikes are numbered again by document order, so re-read ids after any edit made outside Stemma. Never take ids from raw XML (`w:id` is not the same value; the one exception is a change inside a textbox, kind `opaque_interior`, whose id is its own `w:id`), and re-extract if an operation may have altered a surviving revision's content; see [id durability](https://stemma.sh/docs/reference/cli.md#extract).

## Resolve changes

Accept every pending change:

```bash
stemma resolve redline.docx -o accepted.docx --accept-all
```

Reject every pending change:

```bash
stemma resolve redline.docx -o rejected.docx --reject-all
```

Resolve one author's changes:

```bash
stemma resolve redline.docx \
  -o reviewer-accepted.docx \
  --accept-author "L. Marsh"
```

Resolve selected revision ids:

```bash
stemma resolve redline.docx \
  -o selected.docx \
  --reject-ids 3,4
```

Exactly one disposition is required. A selector that matches nothing is an error and creates no output. While a table carries a pending tracked cell merge (kind `cell_merge`, id `0` in the extract), every resolution refuses, `--accept-all` and `--reject-all` included: resolving merge changes is not supported. Resolve that merge in Word first.

A revision whose author is the empty string (Word anonymization writes `w:author=""`) is selectable as its own group: `--accept-author ""` / `--reject-author ""`.

## Mixed outcomes in one call

To accept one party's changes and reject everyone else's, give `resolve` a resolution plan:

```bash
cat > plan.json <<'PLAN'
{ "schema": "stemma.resolution_plan.v0",
  "accept": { "authors": ["L. Marsh"] },
  "rest": "reject" }
PLAN
stemma resolve redline.docx -o final.docx --plan plan.json
stemma validate final.docx     # expect: OK, 0 pending revisions
```

Add `--dry-run --format json` first to preview the receipt's `accepted`/`rejected`/`remaining` partition without writing anything. Chaining single-disposition passes through an intermediate file still works (see [CLI reference: resolve](https://stemma.sh/docs/reference/cli.md#resolve)).

## Verify by content

Accepting and rejecting both remove revision markers, so marker absence does not prove which action occurred. Inspect the resulting content:

```bash
stemma extract accepted.docx --format text
stemma validate accepted.docx
```

Accept keeps the proposed state. Reject restores the prior state. Outputs are create-new, and Stemma will not replace an existing path.

For all selectors and failure behavior, see [CLI reference: resolve](https://stemma.sh/docs/reference/cli.md#resolve).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://stemma.sh/docs/guides/review-and-resolve.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
