@ansonlai/docx-redline-js 0.5.4 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +78 -697
- package/ARCHITECTURE.md +13 -1
- package/CHANGELOG.md +5 -0
- package/README.md +140 -30
- package/core/paragraph-targeting.js +14 -2
- package/dist/docx-redline-js.esm.js +113 -33
- package/dist/docx-redline-js.esm.js.map +3 -3
- package/dist/docx-redline-js.esm.min.js +75 -75
- package/dist/docx-redline-js.esm.min.js.map +4 -4
- package/docs/AGENT_FAST_START.md +59 -0
- package/docs/AGENT_KNOWLEDGE_BASE.md +868 -0
- package/docs/TESTING.md +20 -1
- package/docs/schemas/document-operations.schema.json +5 -1
- package/docs/validation-reports/2026-09-12-agent-protocol-rollout.md +82 -0
- package/engine/oxml-engine.js +80 -13
- package/engine/run-builders.js +5 -15
- package/index.d.ts +17 -1
- package/node/cli.js +111 -27
- package/node/docx-document.js +120 -69
- package/node/index.d.ts +6 -2
- package/package.json +10 -3
- package/scripts/generate-cross-author-slicing-fixtures.ps1 +25 -25
- package/services/batch-operation-orchestrator.js +215 -120
- package/services/document-inspection.js +5 -3
- package/services/document-operation-applier.js +52 -34
- package/services/document-operation-contract.js +10 -6
- package/services/document-operation-mutations.js +51 -5
- package/services/document-operation-session.js +4 -0
- package/services/error-recovery.js +174 -0
- package/services/operation-batch-compiler.js +394 -0
- package/services/operation-preflight.js +91 -72
- package/services/standalone-operation-runner.d.ts +17 -1
- package/docs/plans/2026-09-05-structural-revisions-and-fidelity-oracles.md +0 -1669
- package/docs/plans/2026-09-08-cross-author-revision-slicing.md +0 -1399
- package/docs/plans/completed/2026-03-01-release-0.1.4-design.md +0 -33
- package/docs/plans/completed/2026-03-01-release-0.1.4.md +0 -110
- package/docs/plans/completed/2026-05-31-architectural changes.md +0 -593
- package/docs/plans/completed/2026-08-02-reliability-improvements.md +0 -1155
- package/docs/plans/completed/2026-08-30-reliability-testing-improvements.md +0 -488
- package/docs/plans/completed/2026-09-01-performance-and-complexity-reduction.md +0 -669
- package/docs/plans/completed/2026-09-03-agent-friendly-document-workflows.md +0 -427
- package/docs/plans/completed/2026-09-04-comment-anchor-and-cli-reliability.md +0 -519
- package/docs/plans/completed/PERFORMANCE-CONSOLIDATION.md +0 -69
- package/docs/plans/completed/structural-revision-capability-matrix.md +0 -115
- package/docs/test-comparison-dashboard.html +0 -4338
- package/docs/validation-reports/2026-08-30-phase-1-word-visual-preflight.md +0 -22
- package/docs/validation-reports/2026-08-30-phase-2-word-visual-preflight.md +0 -24
- package/docs/validation-reports/2026-08-30-phase-3-coverage.md +0 -73
- package/docs/validation-reports/2026-09-02-multilevel-bullets-visual-review.md +0 -82
- package/docs/validation-reports/2026-09-02-multimodal-visual-samples.md +0 -114
- package/docs/validation-reports/2026-09-02-visual-failures-preflight.md +0 -79
|
@@ -1,427 +0,0 @@
|
|
|
1
|
-
# Agent-Friendly Document Workflow Plan
|
|
2
|
-
|
|
3
|
-
**Status:** Implementation complete — external release validation noted below
|
|
4
|
-
**Date:** 2026-09-03
|
|
5
|
-
|
|
6
|
-
This plan turns integration lessons from a real `docx-redline-js` skill into a
|
|
7
|
-
supported product surface. The skill successfully uses the engine, but it also
|
|
8
|
-
has to reimplement document inspection, comment reading, package transactions,
|
|
9
|
-
visible provision references, per-operation authorship, and safe command-line
|
|
10
|
-
workflows. Those are recurring integration responsibilities rather than
|
|
11
|
-
skill-specific business logic.
|
|
12
|
-
|
|
13
|
-
The core reconciliation engine should remain host-independent and focused on
|
|
14
|
-
OOXML. Agent-facing `.docx` file handling should be added as a separate adapter
|
|
15
|
-
or companion CLI so the core does not acquire a mandatory ZIP implementation.
|
|
16
|
-
|
|
17
|
-
## Baseline
|
|
18
|
-
|
|
19
|
-
As of 2026-09-03:
|
|
20
|
-
|
|
21
|
-
- Paragraph/range reconciliation is available through `applyRedlineToOxml`.
|
|
22
|
-
- Full `word/document.xml` operations are available through the
|
|
23
|
-
`@ansonlai/docx-redline-js/standalone-runner` export.
|
|
24
|
-
- Atomic batches reorder comments ahead of text edits, but accept one author
|
|
25
|
-
for the entire batch.
|
|
26
|
-
- The public declarations do not define discriminated operation types or the
|
|
27
|
-
standalone runner functions, and comment request arrays are typed as
|
|
28
|
-
`unknown[]`.
|
|
29
|
-
- Targeting supports transient paragraph references and text heuristics, but
|
|
30
|
-
text-only duplicate matches can resolve to the first candidate.
|
|
31
|
-
- There is no supported structured document-inspection or comment-reading API.
|
|
32
|
-
- Package callers must merge comments and numbering, allocate identifiers, and
|
|
33
|
-
invoke validation correctly themselves.
|
|
34
|
-
- `ensureNumberingArtifactsInZip` replaces existing numbering unless the caller
|
|
35
|
-
supplies `mergeNumberingXmlBySchemaOrder`.
|
|
36
|
-
- Revision-safe cloning work for comment/highlight run splitting is in progress
|
|
37
|
-
separately and is not re-scoped by this plan.
|
|
38
|
-
|
|
39
|
-
This plan overlaps with
|
|
40
|
-
`2026-09-01-performance-and-complexity-reduction.md`. Implement the operation
|
|
41
|
-
schema and batch facade against the modularized/in-memory runner from that plan
|
|
42
|
-
where practical; do not create a second batch engine.
|
|
43
|
-
|
|
44
|
-
## Compatibility strategy
|
|
45
|
-
|
|
46
|
-
| Phase | Expected impact |
|
|
47
|
-
|---|---|
|
|
48
|
-
| 1. Public contracts | Additive. Existing operation objects and runner signatures remain supported. |
|
|
49
|
-
| 2. Targeting and preflight | Additive by default. Strict ambiguity handling is opt-in until the next major version. |
|
|
50
|
-
| 3. Structured inspection | Additive. New read-only APIs. |
|
|
51
|
-
| 4. Transactional package facade | Additive companion surface. Core keeps no mandatory ZIP dependency. |
|
|
52
|
-
| 5. Safe defaults and CLI | Mostly additive. Changing numbering replacement behavior requires a deprecation period or major release. |
|
|
53
|
-
|
|
54
|
-
---
|
|
55
|
-
|
|
56
|
-
## Phase 1 — Typed operations and per-operation attribution
|
|
57
|
-
|
|
58
|
-
**Status:** Complete (2026-09-03)
|
|
59
|
-
|
|
60
|
-
### Problem
|
|
61
|
-
|
|
62
|
-
The runner's operation field names are discoverable mainly from implementation
|
|
63
|
-
code. Its batch author applies to every operation, forcing consumers that need
|
|
64
|
-
different redline and comment authors to rebuild scheduling and atomicity.
|
|
65
|
-
|
|
66
|
-
### Work
|
|
67
|
-
|
|
68
|
-
1. Define and export discriminated types for redline, comment, and highlight
|
|
69
|
-
operations, runner options, per-operation results, and batch results.
|
|
70
|
-
2. Export runner declarations from the stable `./standalone-runner` package
|
|
71
|
-
subpath and consider re-exporting the primary runner functions at the root.
|
|
72
|
-
3. Add optional `author` to each operation. Resolution order should be explicit:
|
|
73
|
-
operation author, batch default author, configured legacy fallback.
|
|
74
|
-
4. Include `authorUsed`, `resolvedBy`, and resolved target metadata in every
|
|
75
|
-
operation result.
|
|
76
|
-
5. Add runtime operation validation with stable `INVALID_OPERATION` diagnostics
|
|
77
|
-
for missing or incompatible fields.
|
|
78
|
-
6. Keep the existing operation names (`modified`, `textToComment`, and
|
|
79
|
-
`commentContent`) compatible. If ergonomic aliases are introduced, normalize
|
|
80
|
-
them once at the API boundary and document one canonical representation.
|
|
81
|
-
|
|
82
|
-
### Acceptance
|
|
83
|
-
|
|
84
|
-
- TypeScript catches a comment using redline-only fields and vice versa.
|
|
85
|
-
- One atomic batch can emit revisions and comments under different authors.
|
|
86
|
-
- Existing JavaScript callers using the batch-level author continue to work.
|
|
87
|
-
- Every result identifies the author and target actually used.
|
|
88
|
-
|
|
89
|
-
### Implementation notes
|
|
90
|
-
|
|
91
|
-
- Added discriminated operation/result declarations at the stable
|
|
92
|
-
`./standalone-runner` package subpath and exported the reusable types from the
|
|
93
|
-
root declaration file.
|
|
94
|
-
- Added runtime `INVALID_OPERATION` validation while retaining `replace`,
|
|
95
|
-
`format`, `list-change`, `table-reconciliation`, `insert`, and `delete` as
|
|
96
|
-
compatibility labels for redline operations.
|
|
97
|
-
- Added per-operation author resolution, `authorUsed`, `authorsUsed`, canonical
|
|
98
|
-
`operationType`, `resolvedBy`, and resolved target metadata.
|
|
99
|
-
- Preserved the batch-level author as the fallback for existing callers.
|
|
100
|
-
- Verified with `tests/agent_operation_contract_tests.mjs`, the existing
|
|
101
|
-
standalone runner tests, and `npm run check:types`.
|
|
102
|
-
|
|
103
|
-
---
|
|
104
|
-
|
|
105
|
-
## Phase 2 — Safe target descriptors and preflight
|
|
106
|
-
|
|
107
|
-
**Status:** Complete (2026-09-03)
|
|
108
|
-
|
|
109
|
-
### Problem
|
|
110
|
-
|
|
111
|
-
Text-only targeting is convenient but unsafe when boilerplate paragraphs repeat.
|
|
112
|
-
Agents also need to discover existing-revision conflicts and invalid anchors
|
|
113
|
-
before mutating a document.
|
|
114
|
-
|
|
115
|
-
### Work
|
|
116
|
-
|
|
117
|
-
1. Introduce a target descriptor supporting exact text, paragraph ID, transient
|
|
118
|
-
index, table/list context, occurrence, and an optional source fingerprint.
|
|
119
|
-
2. Add `AMBIGUOUS_TARGET` with candidate metadata. Provide a strict targeting
|
|
120
|
-
option immediately and make strict behavior the default in the next major
|
|
121
|
-
version.
|
|
122
|
-
3. Return normalization diagnostics when the matched text differs from the
|
|
123
|
-
supplied target in whitespace or punctuation.
|
|
124
|
-
4. Add `preflightOperations(documentParts, operations, options)` that performs no
|
|
125
|
-
mutation and reports:
|
|
126
|
-
- missing and ambiguous targets;
|
|
127
|
-
- anchor presence and candidate ranges;
|
|
128
|
-
- existing revisions on affected paragraphs;
|
|
129
|
-
- incompatible operations against the same target;
|
|
130
|
-
- authors that will be written;
|
|
131
|
-
- required comments and numbering artifacts.
|
|
132
|
-
5. Define ordering/conflict behavior for comment, highlight, and replacement
|
|
133
|
-
operations aimed at the same paragraph. Do not rely only on global type
|
|
134
|
-
priority when one operation changes another operation's target or revision
|
|
135
|
-
policy.
|
|
136
|
-
|
|
137
|
-
### Acceptance
|
|
138
|
-
|
|
139
|
-
- Strict mode never silently edits the first of multiple exact matches.
|
|
140
|
-
- Preflight results are deterministic, serializable JSON and map one-to-one to
|
|
141
|
-
original operation indexes.
|
|
142
|
-
- A consumer can resolve all target and author questions before applying edits.
|
|
143
|
-
|
|
144
|
-
### Implementation notes
|
|
145
|
-
|
|
146
|
-
- Added target descriptors for exact text, paragraph ID, index, occurrence,
|
|
147
|
-
table context, and deterministic source fingerprint.
|
|
148
|
-
- Added opt-in `strictTargets` application behavior with `AMBIGUOUS_TARGET` and
|
|
149
|
-
no fuzzy fallback. Legacy application remains permissive by default.
|
|
150
|
-
- Added read-only `preflightOperations`, strict by default, with target and
|
|
151
|
-
anchor diagnostics, existing-revision policy checks, author reporting,
|
|
152
|
-
artifact requirements, and same-paragraph operation conflicts.
|
|
153
|
-
- Added candidate metadata to ambiguity errors so callers can choose a stable
|
|
154
|
-
disambiguator and retry.
|
|
155
|
-
- Added focused coverage for duplicate exact text, occurrence and fingerprint
|
|
156
|
-
selection, stale fingerprints, paragraph IDs, missing anchors, existing
|
|
157
|
-
revisions, artifact prediction, operation conflicts, per-operation authors,
|
|
158
|
-
and runtime validation.
|
|
159
|
-
- Verified the completed phases with 47/47 test files, type checks, dependency
|
|
160
|
-
isolation, changed-file lint, and `git diff --check`.
|
|
161
|
-
|
|
162
|
-
---
|
|
163
|
-
|
|
164
|
-
## Phase 3 — Structured document inspection
|
|
165
|
-
|
|
166
|
-
**Status:** Complete (2026-09-03)
|
|
167
|
-
|
|
168
|
-
### Problem
|
|
169
|
-
|
|
170
|
-
Consumers currently reconstruct paragraph inventories, accepted-view text,
|
|
171
|
-
comment anchors, headings, and visible list numbers themselves. This produces
|
|
172
|
-
multiple subtly different definitions of document text and target identity.
|
|
173
|
-
|
|
174
|
-
### Work
|
|
175
|
-
|
|
176
|
-
1. Add a read-only inspection API over document parts that returns paragraphs
|
|
177
|
-
in document order with:
|
|
178
|
-
- exact canonical visible text;
|
|
179
|
-
- paragraph ID/path and transient index;
|
|
180
|
-
- table-cell and list context;
|
|
181
|
-
- heading/style context;
|
|
182
|
-
- existing revision and comment authors;
|
|
183
|
-
- whether revision markup intersects the paragraph.
|
|
184
|
-
2. Add a comment reader that joins `word/comments.xml` definitions to document
|
|
185
|
-
anchors and reports exact anchored text in document order.
|
|
186
|
-
3. Centralize accepted/rejected/current-view text semantics, including moves,
|
|
187
|
-
tabs, breaks, fields, notes, and other structural content. Reuse the canonical
|
|
188
|
-
extractor in targeting and ingestion rather than maintaining parallel walkers.
|
|
189
|
-
4. Add optional visible numbering resolution from `numbering.xml`, including
|
|
190
|
-
levels, overrides, restarts, and section-continuation cases covered by tests.
|
|
191
|
-
5. Produce human-facing references from provision number, enclosing heading,
|
|
192
|
-
and a quotable excerpt. Treat computed numbering as advisory and always retain
|
|
193
|
-
the excerpt.
|
|
194
|
-
6. Support filtering by index/range, text search, revision presence, table
|
|
195
|
-
context, and non-empty content without requiring callers to post-process a
|
|
196
|
-
full-document dump.
|
|
197
|
-
|
|
198
|
-
### Acceptance
|
|
199
|
-
|
|
200
|
-
- Inspection output can supply target and replacement source strings without
|
|
201
|
-
losing tabs or boundary whitespace.
|
|
202
|
-
- Comment definitions, ranges, authors, and anchor text round-trip on existing
|
|
203
|
-
commented documents.
|
|
204
|
-
- Targeting and inspection use the same canonical text representation.
|
|
205
|
-
- Provision references are verified against fixtures with numbering restarts
|
|
206
|
-
and overrides.
|
|
207
|
-
|
|
208
|
-
### Implementation notes
|
|
209
|
-
|
|
210
|
-
- Added `inspectDocumentParts(...)` with exact text, target identity,
|
|
211
|
-
heading/table/list context, revision authors, comment joins, and filters.
|
|
212
|
-
- Centralized accepted/rejected-view text and reused it in targeting and
|
|
213
|
-
ingestion, including moves, tabs, breaks, and hyphens.
|
|
214
|
-
- Added advisory numbering resolution for level formats and start/level
|
|
215
|
-
overrides while retaining exact excerpts.
|
|
216
|
-
- Added focused coverage in `tests/document_inspection_tests.mjs`.
|
|
217
|
-
|
|
218
|
-
---
|
|
219
|
-
|
|
220
|
-
## Phase 4 — Transactional package facade
|
|
221
|
-
|
|
222
|
-
**Status:** Complete (2026-09-03)
|
|
223
|
-
|
|
224
|
-
### Problem
|
|
225
|
-
|
|
226
|
-
The XML runner cannot safely own concerns that span `document.xml`,
|
|
227
|
-
`comments.xml`, `numbering.xml`, relationships, and content types. Callers must
|
|
228
|
-
currently compose those steps correctly and preserve the original package for
|
|
229
|
-
rollback.
|
|
230
|
-
|
|
231
|
-
### Work
|
|
232
|
-
|
|
233
|
-
1. Add a separate Node adapter or companion package with an API similar to:
|
|
234
|
-
|
|
235
|
-
```js
|
|
236
|
-
const document = await openDocx(inputBuffer);
|
|
237
|
-
const inspection = await document.inspect(options);
|
|
238
|
-
const result = await document.applyOperations(operations, {
|
|
239
|
-
author: 'Editor',
|
|
240
|
-
atomic: true,
|
|
241
|
-
validate: true
|
|
242
|
-
});
|
|
243
|
-
const outputBuffer = await result.toBuffer();
|
|
244
|
-
```
|
|
245
|
-
|
|
246
|
-
2. Seed comment IDs from both document anchors and the existing comments part.
|
|
247
|
-
Keep comment IDs and revision IDs in explicit document/package-scoped
|
|
248
|
-
allocators.
|
|
249
|
-
3. Merge numbering with schema-order-safe behavior by default and preserve all
|
|
250
|
-
existing definitions.
|
|
251
|
-
4. Update comment definitions and anchors together for add/delete operations.
|
|
252
|
-
5. Treat apply, artifact merge, relationship/content-type wiring, and validation
|
|
253
|
-
as one transaction. Atomic failure returns the untouched input buffer.
|
|
254
|
-
6. Validate both the original package and generated package so diagnostics can
|
|
255
|
-
distinguish pre-existing defects from newly introduced ones.
|
|
256
|
-
7. Return a complete report containing operation results, authors used,
|
|
257
|
-
artifacts changed, validation issues, execution order, and whether output was
|
|
258
|
-
written.
|
|
259
|
-
|
|
260
|
-
### Acceptance
|
|
261
|
-
|
|
262
|
-
- Callers can safely edit a `.docx` without manually opening or rewriting ZIP
|
|
263
|
-
parts.
|
|
264
|
-
- Existing comments and numbering survive new comments and lists.
|
|
265
|
-
- A generated validation failure cannot produce a writable partial result in
|
|
266
|
-
atomic mode.
|
|
267
|
-
- No ZIP dependency becomes mandatory for browser or XML-only core consumers.
|
|
268
|
-
|
|
269
|
-
### Implementation notes
|
|
270
|
-
|
|
271
|
-
- Added the isolated `@ansonlai/docx-redline-js/node` entry point with
|
|
272
|
-
`openDocx`, inspection, preflight, batch application, and serialization.
|
|
273
|
-
- Package mutation clones parts, allocates comment IDs above existing package
|
|
274
|
-
IDs, merges numbering by schema order, updates OPC wiring, validates, and
|
|
275
|
-
commits only on success.
|
|
276
|
-
- Results report `written`; atomic failures return the original input bytes.
|
|
277
|
-
Unmodified entry contents remain byte-identical after extraction.
|
|
278
|
-
- Added coverage in `tests/docx_package_facade_tests.mjs`.
|
|
279
|
-
|
|
280
|
-
---
|
|
281
|
-
|
|
282
|
-
## Phase 5 — Supported agent CLI and safer defaults
|
|
283
|
-
|
|
284
|
-
**Status:** Complete (2026-09-03)
|
|
285
|
-
|
|
286
|
-
### Problem
|
|
287
|
-
|
|
288
|
-
Agents are more reliable with small JSON-producing commands than with ad hoc ZIP
|
|
289
|
-
scripts or large XML dumps. The real skill demonstrates a useful command set,
|
|
290
|
-
but every skill author should not need to maintain a private integration layer.
|
|
291
|
-
|
|
292
|
-
### Work
|
|
293
|
-
|
|
294
|
-
1. Build a CLI over the package facade with commands for `inspect`, `extract`,
|
|
295
|
-
`preflight`, `apply`, `accept`, `reject`, `delete-comments`, and `validate`.
|
|
296
|
-
2. Make output structured JSON with stable error codes and meaningful process
|
|
297
|
-
exit codes. Provide built-in range/search/revision/table filters.
|
|
298
|
-
3. Require explicit edit and comment authors for mutating agent workflows, while
|
|
299
|
-
retaining legacy fallback behavior in low-level APIs.
|
|
300
|
-
4. Accept a documented JSON operation file and provide a published JSON Schema.
|
|
301
|
-
5. Preserve input files by default; require an explicit option for in-place
|
|
302
|
-
mutation.
|
|
303
|
-
6. Deprecate silent numbering replacement. In the next major version, merge by
|
|
304
|
-
default or throw if safe merging is unavailable.
|
|
305
|
-
7. Publish a compact agent workflow guide and use it as the source for future
|
|
306
|
-
skills instead of vendoring integration logic independently.
|
|
307
|
-
|
|
308
|
-
### Acceptance
|
|
309
|
-
|
|
310
|
-
- A skill can consist mainly of workflow and review guidance, with no custom ZIP
|
|
311
|
-
or OOXML manipulation code.
|
|
312
|
-
- Exact paragraph text can flow from `extract` to an operation file without
|
|
313
|
-
whitespace normalization.
|
|
314
|
-
- CLI failures never report a mutation as successful and never overwrite the
|
|
315
|
-
input by default.
|
|
316
|
-
- The CLI works on supported Node versions across Windows, macOS, and Linux.
|
|
317
|
-
|
|
318
|
-
### Implementation notes
|
|
319
|
-
|
|
320
|
-
- Added the `docx-redline` executable with JSON `inspect`, `extract`,
|
|
321
|
-
`preflight`, `apply`, `accept`, `reject`, `delete-comments`, and `validate`.
|
|
322
|
-
- Added filters for ranges, indexes, search, revision presence, table/body
|
|
323
|
-
context, empty paragraphs, and accepted/rejected views.
|
|
324
|
-
- Mutations require explicit attribution, are transactional, preserve the input
|
|
325
|
-
by default, refuse existing destinations, and require `--in-place` or
|
|
326
|
-
`--force` for the corresponding destructive intent.
|
|
327
|
-
- Added `docs/schemas/document-operations.schema.json` and the compact
|
|
328
|
-
`docs/AGENT-WORKFLOW.md` source for future skills.
|
|
329
|
-
- Deprecated low-level silent numbering replacement with a runtime warning and
|
|
330
|
-
documented the next-major error behavior. The facade and CLI merge today.
|
|
331
|
-
- Added `tests/agent_cli_tests.mjs` covering every command family and the
|
|
332
|
-
recommended end-to-end workflow.
|
|
333
|
-
|
|
334
|
-
## Testing and release gates
|
|
335
|
-
|
|
336
|
-
Each phase must add focused unit tests plus package-level fixtures where relevant.
|
|
337
|
-
Before release:
|
|
338
|
-
|
|
339
|
-
- Run `npm test`, `npm run test:isolation`, `npm run check:types`, and
|
|
340
|
-
`npm run lint`.
|
|
341
|
-
- Add duplicate-target, existing-comment-ID, multi-author, numbering-merge, and
|
|
342
|
-
atomic-validation regression cases.
|
|
343
|
-
- Add Word differential cases for comments on previously revised runs, multiple
|
|
344
|
-
existing comment authors, and lists added to documents with existing numbering.
|
|
345
|
-
- Confirm accept/reject round trips and Word-open-without-repair behavior.
|
|
346
|
-
- Document any default change in the changelog and provide a migration example.
|
|
347
|
-
|
|
348
|
-
### Phase 1–2 verification record (2026-09-03)
|
|
349
|
-
|
|
350
|
-
- `npm test`: 47/47 test files pass.
|
|
351
|
-
- `npm run check:types`: pass; the stable `./standalone-runner` self-import is
|
|
352
|
-
exercised by the TypeScript usage fixture.
|
|
353
|
-
- `npm run test:isolation`: pass.
|
|
354
|
-
- ESLint on all Phase 1–2 implementation files: pass.
|
|
355
|
-
- `git diff --check`: pass.
|
|
356
|
-
- The repository-wide `npm run lint` remains blocked by pre-existing unused
|
|
357
|
-
variables in `scripts/render-agenda-multilevel.mjs` and
|
|
358
|
-
`scripts/render-multilevel-cases.mjs`; these files were outside this plan and
|
|
359
|
-
were not changed.
|
|
360
|
-
|
|
361
|
-
### Phase 3–4 verification record (2026-09-03)
|
|
362
|
-
|
|
363
|
-
- `npm test`: 49/49 test files pass, including structured inspection and real
|
|
364
|
-
DOCX-buffer transaction regressions.
|
|
365
|
-
- `npm run test:isolation`: pass; the Node facade is a separate export and the
|
|
366
|
-
root/browser dependency graph remains host-independent.
|
|
367
|
-
- `npm run check:types`: pass, including declarations for both new surfaces.
|
|
368
|
-
- `git diff --check`: pass.
|
|
369
|
-
|
|
370
|
-
### Phase 5 and final plan audit (2026-09-03)
|
|
371
|
-
|
|
372
|
-
- `npm test`: 55/55 test files pass. The final suites cover duplicate targets,
|
|
373
|
-
per-operation authors, existing high comment IDs, numbering preservation,
|
|
374
|
-
exact comment anchors, coordinated comment deletion, atomic validation
|
|
375
|
-
rollback, CLI safety, and accept/reject transforms.
|
|
376
|
-
- `npm run test:isolation`: pass. Node filesystem, ZIP, and DOM dependencies
|
|
377
|
-
remain confined to the separate Node surface.
|
|
378
|
-
- `npm run check:types`: pass; 106 root runtime exports have declarations and
|
|
379
|
-
the self-import fixtures cover the standalone and Node subpaths.
|
|
380
|
-
- `npm run lint`: pass. The five pre-existing unused-variable failures in two
|
|
381
|
-
one-off rendering scripts were removed during the final release-gate audit.
|
|
382
|
-
- `npm run build`: pass.
|
|
383
|
-
- `npm pack --dry-run`: pass and includes the executable, Node facade, agent
|
|
384
|
-
guide, and operation JSON Schema.
|
|
385
|
-
- `git diff --check`: pass; only line-ending conversion notices are emitted.
|
|
386
|
-
|
|
387
|
-
| Phase | Final acceptance audit |
|
|
388
|
-
|---|---|
|
|
389
|
-
| 1. Public contracts | Complete: discriminated types, validation, attribution, and result metadata are implemented and tested. |
|
|
390
|
-
| 2. Targeting/preflight | Complete: strict ambiguity, stable descriptors, diagnostics, conflicts, and artifact prediction are implemented and tested. |
|
|
391
|
-
| 3. Inspection | Complete: canonical text, exact comment anchors, styles/headings, table-cell coordinates, structural references, advisory numbering, human references, and filters are implemented and tested. |
|
|
392
|
-
| 4. Package facade | Complete: add/delete comment coordination, scoped IDs, numbering preservation, validation comparison, reports, and byte-safe rollback are implemented and tested. |
|
|
393
|
-
| 5. Agent CLI | Complete: all planned commands, JSON output, explicit attribution, schema, safe paths, deprecation, and workflow guidance are implemented and tested. |
|
|
394
|
-
|
|
395
|
-
The implementation plan is complete. Desktop Word differential/visual runs and
|
|
396
|
-
multi-OS Node execution remain release-environment checks rather than local
|
|
397
|
-
implementation blockers. The existing Word, corpus, XSD, LibreOffice, and CI
|
|
398
|
-
lanes documented in `docs/TESTING.md` and `docs/VALIDATION.md` should run before
|
|
399
|
-
publishing a release. No local Word or independent-office validation result is
|
|
400
|
-
claimed by this audit.
|
|
401
|
-
|
|
402
|
-
### Follow-up regression expansion (2026-09-04)
|
|
403
|
-
|
|
404
|
-
- Added five focused edge suites beyond the original Phase 1–5 acceptance
|
|
405
|
-
coverage. They verify canonical accepted/rejected/current views,
|
|
406
|
-
cross-paragraph comment anchors, outline/table/reference inspection, nested
|
|
407
|
-
numbering, byte-exact no-ops, reusable transaction rollback, selective
|
|
408
|
-
comment/revision authors, package ID seeding, invalid ZIP rejection, CLI
|
|
409
|
-
filters, output collisions, force/in-place authorization, and JSON exit codes.
|
|
410
|
-
- The additional tests exposed and fixed three gaps: explicit `current` view
|
|
411
|
-
behavior, multi-paragraph comment-anchor reconstruction, and byte-exact
|
|
412
|
-
package output for no-op transactions.
|
|
413
|
-
- `npm test` now passes 55/55 test files. The remaining release-environment
|
|
414
|
-
qualifications are unchanged: desktop Word/LibreOffice and multi-OS CI are
|
|
415
|
-
not claimed by this local test run.
|
|
416
|
-
- `npm run test:coverage` passes at 89.05% statements/lines, 77.04% branches,
|
|
417
|
-
and 92.63% functions overall. The Node facade/CLI/ZIP surface reaches 99.61%
|
|
418
|
-
statements/lines, while canonical paragraph text reaches 100%.
|
|
419
|
-
|
|
420
|
-
## Non-goals
|
|
421
|
-
|
|
422
|
-
- Moving ZIP or filesystem dependencies into the host-independent core.
|
|
423
|
-
- Editing headers, footers, text boxes, or notes before the corresponding core
|
|
424
|
-
document-part support is designed and tested.
|
|
425
|
-
- Treating paragraph indexes or computed provision numbers as permanent document
|
|
426
|
-
identifiers.
|
|
427
|
-
- Automatically accepting existing revisions merely to make an operation pass.
|