@volter/supercode-orchestrator 0.5.27 → 0.5.28
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/board/ztrack.mjs +9 -3
- package/package.json +1 -1
package/board/ztrack.mjs
CHANGED
|
@@ -339,12 +339,14 @@ class ZtrackBoard {
|
|
|
339
339
|
}
|
|
340
340
|
|
|
341
341
|
// A document whose hash is neither the published one nor the one a pending publication replaces
|
|
342
|
-
// was edited by hand.
|
|
342
|
+
// was edited by hand. A write also reads again a document its index does not measure: spans whose lengths do not
|
|
343
|
+
// add up to the text cannot place an edit in it (a span's stored text changed outside the board, its length not).
|
|
343
344
|
staleDocuments({ pending }) {
|
|
344
345
|
const published = this.get('published', {});
|
|
345
346
|
const inFlight = pending ? this.get('pending_hashes', null) : null;
|
|
347
|
+
const measured = (doc) => this.entries(doc.role).reduce((sum, e) => sum + e.len, 0) === lf(doc.raw).length;
|
|
346
348
|
return this.docs.map((doc) => ({ ...doc, ...this.fileHash(doc.path) }))
|
|
347
|
-
.filter((doc) => doc.hash !== published[doc.role] && !(inFlight?.[doc.role] && doc.hash === inFlight[doc.role].before))
|
|
349
|
+
.filter((doc) => (doc.hash !== published[doc.role] && !(inFlight?.[doc.role] && doc.hash === inFlight[doc.role].before)) || (!pending && !measured(doc)))
|
|
348
350
|
.map((doc) => ({ ...doc, text: lf(doc.raw) }));
|
|
349
351
|
}
|
|
350
352
|
|
|
@@ -493,9 +495,13 @@ class ZtrackBoard {
|
|
|
493
495
|
const edit = stale.find((s) => s.role === doc.role);
|
|
494
496
|
if (!edit) { plan.layout.set(doc.role, entries); continue; }
|
|
495
497
|
let base = this.get('published', {})[doc.role] !== undefined && entries.length ? entries : [];
|
|
498
|
+
// Spans are compared by their stored text and spliced by their recorded length: an index whose lengths are not
|
|
499
|
+
// its texts' (a stored span rewritten outside the board) is no base to re-read a region against.
|
|
500
|
+
let texts = this.texts(base);
|
|
501
|
+
if (texts.some((t, i) => t.text.length !== base[i].len)) { base = []; texts = []; }
|
|
496
502
|
let result;
|
|
497
503
|
// A region that cannot be re-read on its own is read with the whole document.
|
|
498
|
-
try { result = this.codec.rechunkBoardDocument(
|
|
504
|
+
try { result = this.codec.rechunkBoardDocument(texts, edit.text, doc.path); }
|
|
499
505
|
catch { base = []; result = this.codec.rechunkBoardDocument([], edit.text, doc.path); }
|
|
500
506
|
const added = result.chunks.slice(result.from, result.to).map((c) => ({ cid: null, id: c.id, level: c.level, len: c.text.length, rec: null, text: c.text }));
|
|
501
507
|
plan.layout.set(doc.role, [...base.slice(0, result.from), ...added, ...base.slice(result.oldTo)]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volter/supercode-orchestrator",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.28",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "The orchestrator runtime over the Volter Harness ontology: one typed operational model whose folder is its serialization, read and written through the harness orchestration doors (docs/ORCHESTRATOR-IR.md)",
|
|
6
6
|
"exports": {
|