# What does google_docs.document.text_replaced prove?

> Prove that the document holds the text that the batch update promised. Version 1.0.0, certification Provisional.

Canonical: https://provely.sh/verify/google_docs/google_docs.document.text_replaced  
Last reviewed: 2026-09-05  
Skill version: 0.1.0  
Certification: provisional  

**Prove that the document holds the text that the batch update promised. A batch update that landed is not one that reached its promise. This level reads the text runs of every tab against the confirmed text.**

*Contract identity.*

| Fact | Value |
| --- | --- |
| Contract id | `google_docs.document.text_replaced` |
| Version | `1.0.0` |
| Hash | `56e7af577df900b0` |
| Completion level | `text_replaced` |
| Publisher | Built and signed by Provely. |
| Certification | Provisional |
| Skill | [Google Docs API 0.1.0](/verify/google_docs) |
| Valid for provider API versions | `v1.20260902` |

## What is the intent?

Replace the text in the document with the batch update.

## What is the subject and the action?

| Member | Value |
| --- | --- |
| Subject type | `google_docs.document` |
| Subject identity | document_id = `$action.result.documentId` |
| Canonical effect | `document.batch_update` |
| Provider operation | `POST /v1/documents/{documentId}:batchUpdate` |
| Idempotency | none, retry is not safe |

## How does the evidence correlate with this operation?

| Strategy | Assurance | Keys | Required |
| --- | --- | --- | --- |
| `resource_id` | strong | document_id from `$action.result.documentId` | yes |
| `resource_id` | strong | write_revision_id from `$action.result.writeControl.requiredRevisionId` | no |

## Which evidence does the contract require?

Minimum evidence level `E2`. An independent channel is required. Minimum channels: 1.

| Channel | Level | Independence | Verifier | Description |
| --- | --- | --- | --- | --- |
| `document_readback` | E2 | provider readback | `http` | Read the document from the provider. A condition path is $observed.document_readback.revisionId. The read states includeTabsContent, so the content sits under tabs and the legacy member body stays empty. |

## Which conditions must all hold for VERIFIED?

| Condition | Meaning | Path | Operator | Expected | Evidence |
| --- | --- | --- | --- | --- | --- |
| `document_is_the_subject` | The document that the read returned is the document that the intent named. The read names the document of the write answer. | `$observed.document_readback.documentId` | `eq` | `$input.document_id` | `document_readback` |
| `revision_is_the_revision_of_this_write` | The document holds the revision that this batch update produced. The published schema states that a required revision identifier inside a response is the revision of the document after the request was applied. | `$observed.document_readback.revisionId` | `eq` | `$action.result.writeControl.requiredRevisionId` | `document_readback` |
| `revision_moved_from_the_base` | The revision differs from the revision that the agent read before the write. The published sentence states that an unchanged revision identifier means an unchanged document. | `$observed.document_readback.revisionId` | `ne` | `$input.base_revision_id` | `document_readback` |
| `text_runs_match_the_intent` | The text runs of every tab equal the list that the person confirmed, in document order. The query steps over a section break, which holds no paragraph. A Docs text run carries the newline that ends its paragraph, so the comparison keeps it. | `$observed.document_readback` | `jsonpath` | `$input.expected_text_runs` | `document_readback` |

## Which conditions give CONTRADICTED?

| Condition | Class | Reason | Path | Operator | Expected |
| --- | --- | --- | --- | --- | --- |
| `document_subject_differs` | wrong subject | The agent changed a different document than the intent named. | `$observed.document_readback.documentId` | `ne` | `$input.document_id` |

## Which observed states map to a verdict before completion?

| Rule | Match | Verdict | Reason |
| --- | --- | --- | --- |
| `document_moved_past_this_write` | (`$observed.document_readback.revisionId` ne `"$action.result.writeControl.requiredRevisionId"`) and (`$observed.document_readback.revisionId` ne `"$input.base_revision_id"`) | CONTRADICTED | The document holds a revision that this write did not produce. A second batch update or another person wrote after it. The Docs API states no idempotency key, so do not write again. Ask a person. |
| `revision_not_published` | `$observed.document_readback.revisionId` absent `undefined` | PENDING | The read carries no revision identifier. The published description states that the member needs edit access. Check the credential of the verifier. |

## How long does the runtime observe?

| Timing member | Value |
| --- | --- |
| Initial delay | 1000 ms |
| Poll interval | 5000 ms |
| Backoff | exponential factor 2, max 60000 ms |
| Maximum attempts | 40 |
| Timeout | 600000 ms |
| Stale read window | 20000 ms |
| On timeout | UNVERIFIABLE (`evidence_unavailable_before_timeout`), escalated to a person |

## Where do these rules come from?

- `google_docs.openapi#/paths/~1v1~1documents~1{documentId}:batchUpdate/post/responses/200`: [google_docs.openapi](https://www.googleapis.com/discovery/v1/apis/docs/v1/rest), retrieved 2026-09-09
- `google_docs.openapi#/components/schemas/BatchUpdateDocumentResponse/properties/replies`: [google_docs.openapi](https://www.googleapis.com/discovery/v1/apis/docs/v1/rest), retrieved 2026-09-09
- `google_docs.docs.batch#batch-updates-of-a-document/a-reply-can-be-empty-and-an-empty-reply-is-not-a-failure`: [google_docs.docs.batch](https://developers.google.com/workspace/docs/api/how-tos/batch), retrieved 2026-09-09
- `google_docs.openapi#/components/schemas/TextRun/properties/content`: [google_docs.openapi](https://www.googleapis.com/discovery/v1/apis/docs/v1/rest), retrieved 2026-09-09
- `google_docs.openapi#/components/schemas/ReplaceAllTextResponse/properties/occurrencesChanged`: [google_docs.openapi](https://www.googleapis.com/discovery/v1/apis/docs/v1/rest), retrieved 2026-09-09
- `google_docs.openapi#/components/schemas/Document/properties/documentId`: [google_docs.openapi](https://www.googleapis.com/discovery/v1/apis/docs/v1/rest), retrieved 2026-09-09
- `google_docs.openapi#/components/schemas/BatchUpdateDocumentResponse/properties/documentId`: [google_docs.openapi](https://www.googleapis.com/discovery/v1/apis/docs/v1/rest), retrieved 2026-09-09
- `google_docs.openapi#/components/schemas/Document/properties/revisionId`: [google_docs.openapi](https://www.googleapis.com/discovery/v1/apis/docs/v1/rest), retrieved 2026-09-09
- `google_docs.openapi#/components/schemas/WriteControl/properties/requiredRevisionId`: [google_docs.openapi](https://www.googleapis.com/discovery/v1/apis/docs/v1/rest), retrieved 2026-09-09
- `google_docs.openapi#/components/schemas/BatchUpdateDocumentResponse/properties/writeControl`: [google_docs.openapi](https://www.googleapis.com/discovery/v1/apis/docs/v1/rest), retrieved 2026-09-09
- `google_docs.docs.write_control#state-consistency-and-the-revision-of-a-document/the-response-of-a-batch-update-carries-a-write-control`: [google_docs.docs.write_control](https://developers.google.com/workspace/docs/api/how-tos/best-practices), retrieved 2026-09-09
- `google_docs.docs.write_control#state-consistency-and-the-revision-of-a-document/the-published-schema-of-the-document-revision`: [google_docs.docs.write_control](https://developers.google.com/workspace/docs/api/how-tos/best-practices), retrieved 2026-09-09
- `google_docs.docs.write_control#state-consistency-and-the-revision-of-a-document/read-the-revision-then-write-against-it`: [google_docs.docs.write_control](https://developers.google.com/workspace/docs/api/how-tos/best-practices), retrieved 2026-09-09
- `google_docs.openapi#/components/schemas/Document/properties/tabs`: [google_docs.openapi](https://www.googleapis.com/discovery/v1/apis/docs/v1/rest), retrieved 2026-09-09
- `google_docs.openapi#/components/schemas/DocumentTab/properties/body`: [google_docs.openapi](https://www.googleapis.com/discovery/v1/apis/docs/v1/rest), retrieved 2026-09-09
- `google_docs.openapi#/components/schemas/Body/properties/content`: [google_docs.openapi](https://www.googleapis.com/discovery/v1/apis/docs/v1/rest), retrieved 2026-09-09
- `google_docs.openapi#/components/schemas/StructuralElement/properties/paragraph`: [google_docs.openapi](https://www.googleapis.com/discovery/v1/apis/docs/v1/rest), retrieved 2026-09-09
- `google_docs.openapi#/components/schemas/Paragraph/properties/elements`: [google_docs.openapi](https://www.googleapis.com/discovery/v1/apis/docs/v1/rest), retrieved 2026-09-09
- `google_docs.openapi#/components/schemas/ParagraphElement/properties/textRun`: [google_docs.openapi](https://www.googleapis.com/discovery/v1/apis/docs/v1/rest), retrieved 2026-09-09

### Can google_docs.document.text_replaced return VERIFIED from the action response alone?

No. The minimum evidence level is E2. The action response is E1. The completion conditions read `document_readback`.

### What happens after the timeout?

The verdict is UNVERIFIABLE with the reason `evidence_unavailable_before_timeout`. The operation goes to a person for review.

## Read next

- [Read the Google Docs API verification page](https://provely.sh/verify/google_docs)
- [Read the google_docs.document.update_applied contract](https://provely.sh/verify/google_docs/google_docs.document.update_applied)
- [Read what a completion contract contains](https://provely.sh/contracts)
- [Read what a receipt proves](https://provely.sh/docs/receipts)
