mikser-io 9.46.0 → 9.46.1

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.
@@ -646,6 +646,12 @@ happened, and losing them would be worse than not attributing them.
646
646
  rest into unattributed ones, which is what lets it offer undo for the first and
647
647
  not the second.
648
648
 
649
+ The engine records the grouping and takes no position on what is done with it —
650
+ it knows nothing about commits, branches or reverts. Versioning the paths
651
+ together is one use; a snapshot, an audit trail, a draft-then-publish gate or a
652
+ filesystem-level rollback all want the same fact. That is why change sets live
653
+ in core and git does not.
654
+
649
655
  ## Search
650
656
 
651
657
  `queryEntities` sifts **meta**. `searchEntities` answers the other question —
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mikser-io",
3
- "version": "9.46.0",
3
+ "version": "9.46.1",
4
4
  "description": "<p align=\"center\"> <img src=\"mikser-lockup-stacked.svg\" alt=\"mikser\" width=\"198\" /> </p>",
5
5
  "main": "index.js",
6
6
  "exports": {
package/src/changeset.js CHANGED
@@ -8,8 +8,12 @@
8
8
  // second are indistinguishable, so removing one removes the other.
9
9
  //
10
10
  // A change set is the missing grain. The caller names it, the writes
11
- // accumulate under it, and a consumer mikser-io-git today can commit
12
- // exactly those paths and later remove exactly that contribution.
11
+ // accumulate under it, and a consumer can act on exactly those paths.
12
+ //
13
+ // The engine records the grouping and takes no position on what is done with
14
+ // it. Versioning the paths together is one use — mikser-io-git's — but a
15
+ // snapshot, an audit trail, a draft-then-publish gate or a filesystem-level
16
+ // rollback all want the same fact, and none of them is a commit.
13
17
  //
14
18
  // Deliberately NOT a transaction. Nothing is held back, nothing rolls back on
15
19
  // failure, and a half-finished set is a real set containing what actually
@@ -55,8 +59,11 @@ function store() {
55
59
  return runtime.changeSets
56
60
  }
57
61
 
58
- // Repo-relative, POSIX-separated: these end up in a git pathspec, and a
59
- // consumer should not have to redo that conversion or guess the root.
62
+ // Relative to the working folder, POSIX-separated.
63
+ //
64
+ // The working folder is the root every consumer already reasons in, and
65
+ // forward slashes are the separator entity ids use — so a path here matches
66
+ // the vocabulary of the rest of the engine rather than the host's.
60
67
  function relativeToWorkingFolder(uri) {
61
68
  const root = runtime.options?.workingFolder
62
69
  if (!root || !uri) return null
@@ -82,9 +89,9 @@ export function recordChangeSetWrite({ changeSet, summary, principal, uri, opera
82
89
  undoOf ??= ambient?.undoOf
83
90
  if (!changeSet || !uri) return null
84
91
  const rel = relativeToWorkingFolder(uri)
85
- // Outside the working folder there is nothing a repo-scoped consumer can
86
- // do with the path, and silently keeping an absolute one would produce a
87
- // pathspec that matches nothing.
92
+ // Outside the working folder there is nothing a consumer scoped to the
93
+ // project can do with the path, and silently keeping an absolute one would
94
+ // produce a selector that quietly matches nothing.
88
95
  if (!rel) return null
89
96
 
90
97
  const sets = store()
@@ -94,9 +101,9 @@ export function recordChangeSetWrite({ changeSet, summary, principal, uri, opera
94
101
  id: changeSet,
95
102
  summary: summary ?? null,
96
103
  principal: principal ?? null,
97
- // Set when this change set exists to take another one back, so
98
- // the undo is itself an ordinary, undoable change rather than a
99
- // special history-rewriting operation.
104
+ // Set when this change set exists to take another one back, so an
105
+ // undo is itself an ordinary, undoable change rather than a
106
+ // privileged operation that rewrites the record.
100
107
  undoOf: undoOf ?? null,
101
108
  startedAt: Date.now(),
102
109
  paths: new Map(),
@@ -110,8 +117,8 @@ export function recordChangeSetWrite({ changeSet, summary, principal, uri, opera
110
117
  return set.id
111
118
  }
112
119
 
113
- // Every set with writes not yet consumed, oldest first — the order a consumer
114
- // should commit them in, so history reads the way the work happened.
120
+ // Every set with writes not yet consumed, oldest first — the order the work
121
+ // actually happened in, which is the order a consumer should record it in.
115
122
  export function pendingChangeSets() {
116
123
  return [...store().values()]
117
124
  .filter(set => set.paths.size)
@@ -129,10 +136,10 @@ export function pendingChangeSets() {
129
136
 
130
137
  // Drop sets a consumer has dealt with.
131
138
  //
132
- // Called after the paths are committed, not after they are written: a crash in
133
- // between loses the attribution but not the work, which then reaches the
134
- // consumer as an unclaimed write. That is the right way round — attribution is
135
- // a convenience, the bytes are not.
139
+ // Called after a consumer has durably recorded the paths, not after they are
140
+ // written: a crash in between loses the attribution but not the work, which
141
+ // then reaches the consumer as an unclaimed write. That is the right way
142
+ // round — attribution is a convenience, the bytes are not.
136
143
  export function clearChangeSets(ids = []) {
137
144
  const sets = store()
138
145
  for (const id of ids) sets.delete(id)