@volter/supercode-orchestrator 0.4.99 → 0.4.100

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.
Files changed (2) hide show
  1. package/board/ztrack.mjs +13 -1
  2. package/package.json +1 -1
package/board/ztrack.mjs CHANGED
@@ -259,7 +259,19 @@ class ZtrackBoard {
259
259
  load({ observe = false } = {}) {
260
260
  const text = read(this.path), archiveText = read(this.archive);
261
261
  const saved=this.get('snapshot', {});
262
- if (!observe && saved.documentHashes?.open===hash(text) && saved.documentHashes?.archived===hash(archiveText) && this.rows.normalized()) {
262
+ let cached=saved.documentHashes?.open===hash(text)&&saved.documentHashes?.archived===hash(archiveText);
263
+ if(!observe && !cached && saved.documentHashes) {
264
+ // The durable intent may have replaced the documents while its runtime commit
265
+ // is still pending. Readers keep the previous committed projection, never parse
266
+ // an intermediate pair of files. A real hand edit does not match these hashes.
267
+ const pending=this.get('pending');
268
+ cached=Boolean(pending?.files?.length===2 && pending.files.every(file=>{
269
+ const expected=file.path===this.path?saved.documentHashes.open:saved.documentHashes.archived;
270
+ const current=hash(file.path===this.path?text:archiveText);
271
+ return file.before===expected&&(current===file.before||current===hash(file.text));
272
+ }));
273
+ }
274
+ if (!observe && cached && this.rows.normalized()) {
263
275
  this.openCachedReader(saved);
264
276
  this.text=text;this.archiveText=archiveText;
265
277
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volter/supercode-orchestrator",
3
- "version": "0.4.99",
3
+ "version": "0.4.100",
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": {