@lmzhen/dsh-evolution-core 0.3.31 → 0.3.33

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 (3) hide show
  1. package/README.md +14 -6
  2. package/lib/index.js +10 -3
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -31,12 +31,20 @@ two processes sharing `DSH_HOME` cannot interleave their RMW on one file.
31
31
  `create` writes a new file and `archive`/`consolidate` already own a two-phase
32
32
  commit, so they deliberately stay outside the serial chain.
33
33
 
34
- When no `transact` is injected (the current default callers), only the
35
- in-process serial chain protects the RMW; same-skill concurrent writes from
36
- different surfaces (foreground `skill_manage`, the review pipeline, the
37
- curator, `/evolution restructure`) still resolve **last writer wins**. Wire a
38
- `transact` at every SkillLibrary instantiation point to extend that guarantee
39
- across processes.
34
+ When the backend provides `transact` (nodeEvolutionIo and the io adapter do),
35
+ the constructor binds it BY DEFAULT since 0.3.27 — the single-file entry points
36
+ (`update`, `patch`, `writeSupportFile`, and each per-file piece of
37
+ `restructure`) run their read→write inside the cross-process lock for every
38
+ instantiation, so same-file concurrent writes from different processes no
39
+ longer resolve to last-writer-wins there. An explicit `transact` argument
40
+ overrides the default binding. The two-phase paths deliberately stay outside
41
+ that lock: `create` (exists probe + write) can still double-pass the probe
42
+ across processes, `archive`/`consolidate` are rename-based with best-effort
43
+ rollback (an archive loser's rollback surfaces the raw failure when the source
44
+ vanished), and `restructure`'s multi-file swap can expose an interleaved tree
45
+ to a concurrent reader. These residual windows are documented rather than
46
+ locked — cross-process writers to the SAME skill file should serialize through
47
+ the single-file paths above.
40
48
 
41
49
  ## Known Limitations and Deferred Work
42
50
 
package/lib/index.js CHANGED
@@ -2182,7 +2182,7 @@ var MemoryStore = class {
2182
2182
  if (threat) return {
2183
2183
  result: {
2184
2184
  ok: false,
2185
- message: `Operation ${position}: ${threat}`,
2185
+ message: `Operation ${position}: ${threat}${previewEntries(entries)}`,
2186
2186
  entries,
2187
2187
  chars: entries.join(ENTRY_DELIMITER).length,
2188
2188
  limit: this.limitFor(target)
@@ -2249,7 +2249,7 @@ var MemoryStore = class {
2249
2249
  if (threat) return {
2250
2250
  result: {
2251
2251
  ok: false,
2252
- message: `Operation ${position}: ${threat}`,
2252
+ message: `Operation ${position}: ${threat}${previewEntries(entries)}`,
2253
2253
  entries,
2254
2254
  chars: entries.join(ENTRY_DELIMITER).length,
2255
2255
  limit: this.limitFor(target)
@@ -3970,7 +3970,14 @@ var SkillLibrary = class {
3970
3970
  try {
3971
3971
  await this.io.rename(dir, dest);
3972
3972
  } catch {
3973
- await this.io.copy(dir, dest);
3973
+ try {
3974
+ await this.io.copy(dir, dest);
3975
+ } catch (copyError) {
3976
+ return {
3977
+ ok: false,
3978
+ message: `Skill "${name}" archive fell back to copy but failed (${copyError instanceof Error ? copyError.message : String(copyError)}); the skill stays where it is.`
3979
+ };
3980
+ }
3974
3981
  try {
3975
3982
  await this.io.remove(dir);
3976
3983
  } catch (error) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lmzhen/dsh-evolution-core",
3
3
  "description": "Shared stores, prompts, signals and lifecycle logic for the dsh-evolution plugin family (community build)",
4
- "version": "0.3.31",
4
+ "version": "0.3.33",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },