@quolu/lattice 0.63.8 → 0.63.10

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 (72) hide show
  1. package/LICENSE +147 -147
  2. package/README.ja.md +378 -378
  3. package/README.md +303 -303
  4. package/bin/lattice-mcp.mjs +0 -0
  5. package/bin/lattice-scripted-adapter.mjs +0 -0
  6. package/bin/lattice-scripted-worker.mjs +0 -0
  7. package/bin/lattice-work-order-adapter.mjs +0 -0
  8. package/bin/lattice.mjs +0 -0
  9. package/docs/bridge-setup.md +248 -248
  10. package/docs/schemas/lattice.executor_packet.v1.schema.json +57 -57
  11. package/docs/schemas/lattice.executor_receipt.v1.schema.json +66 -66
  12. package/docs/schemas/lattice.phase_todo_revision.v3.schema.json +360 -360
  13. package/docs/schemas/lattice.plan_create_input.v1.schema.json +56 -56
  14. package/docs/schemas/lattice.plan_create_input.v2.schema.json +72 -72
  15. package/docs/schemas/lattice.plan_create_input.v3.schema.json +81 -81
  16. package/docs/schemas/lattice.plan_create_input.v4.schema.json +357 -357
  17. package/docs/schemas/lattice.plan_scope_review.v1.schema.json +55 -55
  18. package/docs/schemas/lattice.run_request.v1.schema.json +238 -238
  19. package/docs/schemas/lattice.runtime_adapter_capabilities.v2.schema.json +55 -55
  20. package/docs/schemas/lattice.runtime_adapter_registration_input.v1.schema.json +78 -78
  21. package/docs/schemas/lattice.runtime_adapter_registration_input.v2.schema.json +86 -86
  22. package/docs/schemas/lattice.todo_extraction.v2.schema.json +298 -298
  23. package/docs/schemas/lattice.todo_extraction.v3.schema.json +150 -150
  24. package/docs/schemas/lattice.todo_extraction.v4.schema.json +161 -161
  25. package/docs/schemas/lattice.todo_revision.v2.schema.json +260 -260
  26. package/docs/schemas/lattice.todo_revision_set.v3.schema.json +363 -363
  27. package/docs/schemas/lattice.todo_structure_binding.v1.schema.json +47 -47
  28. package/docs/schemas/lattice.todo_structure_realization.v1.schema.json +55 -55
  29. package/docs/schemas/lattice.todo_structure_set.v1.schema.json +264 -264
  30. package/package.json +109 -109
  31. package/sensor/LICENSE +21 -21
  32. package/sensor/NOTICE +19 -19
  33. package/sensor/dist/bin/lattice-sensor.js +9 -9
  34. package/sensor/dist/db/index.js +24 -24
  35. package/sensor/dist/db/migrations.js +41 -41
  36. package/sensor/dist/db/queries.js +164 -164
  37. package/sensor/dist/db/schema.sql +205 -205
  38. package/sensor/dist/directory.js +5 -5
  39. package/sensor/dist/extraction/wasm/tree-sitter-c_sharp.wasm +0 -0
  40. package/sensor/dist/extraction/wasm/tree-sitter-cfml.wasm +0 -0
  41. package/sensor/dist/extraction/wasm/tree-sitter-cfquery.wasm +0 -0
  42. package/sensor/dist/extraction/wasm/tree-sitter-cfscript.wasm +0 -0
  43. package/sensor/dist/extraction/wasm/tree-sitter-cobol.wasm +0 -0
  44. package/sensor/dist/extraction/wasm/tree-sitter-erlang.wasm +0 -0
  45. package/sensor/dist/extraction/wasm/tree-sitter-go.wasm +0 -0
  46. package/sensor/dist/extraction/wasm/tree-sitter-java.wasm +0 -0
  47. package/sensor/dist/extraction/wasm/tree-sitter-javascript.wasm +0 -0
  48. package/sensor/dist/extraction/wasm/tree-sitter-nix.wasm +0 -0
  49. package/sensor/dist/extraction/wasm/tree-sitter-pascal.wasm +0 -0
  50. package/sensor/dist/extraction/wasm/tree-sitter-python.wasm +0 -0
  51. package/sensor/dist/extraction/wasm/tree-sitter-tsx.wasm +0 -0
  52. package/sensor/dist/extraction/wasm/tree-sitter-typescript.wasm +0 -0
  53. package/sensor/dist/extraction/wasm/tree-sitter-vbnet.wasm +0 -0
  54. package/sensor/dist/mcp/liveness-watchdog.js +53 -53
  55. package/sensor/dist/mcp/server-instructions.js +95 -95
  56. package/sensor/package.json +56 -56
  57. package/src/fs-dir-sync.mjs +14 -0
  58. package/src/hooks-cli.mjs +1 -8
  59. package/src/rc2-campaign.mjs +1 -12
  60. package/src/runtime-adapter-registry.mjs +2 -10
  61. package/src/runtime-cli.mjs +2 -6
  62. package/src/runtime-control-store.mjs +1 -8
  63. package/src/runtime-driver-state.mjs +1 -12
  64. package/src/runtime-gate-store.mjs +1 -8
  65. package/src/runtime-lifecycle-lock.mjs +1 -8
  66. package/src/runtime-multi-epoch-store.mjs +1 -12
  67. package/src/runtime-pull-intake.mjs +1 -8
  68. package/src/runtime-scripted-adapter-controller.mjs +2 -10
  69. package/src/runtime-work-order-controller.mjs +2 -10
  70. package/src/todo-migration.mjs +1 -1
  71. package/src/todo-note-store.mjs +2 -6
  72. package/src/todo-store.mjs +2 -14
@@ -1,4 +1,5 @@
1
1
  import { createHash, randomBytes } from 'node:crypto';
2
+ import { fsyncDirectory } from './fs-dir-sync.mjs';
2
3
  import {
3
4
  mkdir, open, readFile, readdir, rename, rm, stat,
4
5
  } from 'node:fs/promises';
@@ -193,12 +194,7 @@ async function atomicWrite(ref, bytes) {
193
194
  await handle.close();
194
195
  handle = null;
195
196
  await rename(temporary, ref);
196
- const directory = await open(path.dirname(ref), 'r');
197
- // Windowsはdirectory handleのfsyncを許さず常にEPERM/EINVALを返す(Node仕様)。
198
- // win32のこの2値だけ許容し、他OS・他エラーは従来どおり失敗させる。
199
- try { await directory.sync(); } catch (error) {
200
- if (process.platform !== 'win32' || !['EPERM', 'EINVAL'].includes(error?.code)) throw error;
201
- } finally { await directory.close(); }
197
+ await fsyncDirectory(path.dirname(ref));
202
198
  } finally {
203
199
  if (handle) await handle.close();
204
200
  await rm(temporary, { force: true });
@@ -1,4 +1,5 @@
1
1
  import { randomBytes } from 'node:crypto';
2
+ import { fsyncDirectory } from './fs-dir-sync.mjs';
2
3
  import {
3
4
  lstat, mkdir, open, readFile, readdir, realpath, rename, rm, rmdir,
4
5
  } from 'node:fs/promises';
@@ -1654,12 +1655,7 @@ async function atomicWrite(absolute, bytes) {
1654
1655
  }
1655
1656
  await handle.close(); handle = null;
1656
1657
  await rename(temporary, absolute);
1657
- const directory = await open(path.dirname(absolute), 'r');
1658
- // Windowsはdirectory handleのfsyncを許さず常にEPERM/EINVALを返す(Node仕様)。
1659
- // win32のこの2値だけ許容し、他OS・他エラーは従来どおり失敗させる。
1660
- try { await directory.sync(); } catch (error) {
1661
- if (process.platform !== 'win32' || !['EPERM', 'EINVAL'].includes(error?.code)) throw error;
1662
- } finally { await directory.close(); }
1658
+ await fsyncDirectory(path.dirname(absolute));
1663
1659
  } finally {
1664
1660
  if (handle) await handle.close();
1665
1661
  await rm(temporary, { force: true });
@@ -1687,14 +1683,6 @@ async function atomicWriteMode(absolute, bytes, mode) {
1687
1683
  }
1688
1684
  }
1689
1685
 
1690
- async function fsyncDirectory(absolute) {
1691
- const directory = await open(absolute, 'r');
1692
- // Windowsはdirectory handleのfsyncを許さず常にEPERM/EINVALを返す(Node仕様)。
1693
- // win32のこの2値だけ許容し、他OS・他エラーは従来どおり失敗させる。
1694
- try { await directory.sync(); } catch (error) {
1695
- if (process.platform !== 'win32' || !['EPERM', 'EINVAL'].includes(error?.code)) throw error;
1696
- } finally { await directory.close(); }
1697
- }
1698
1686
 
1699
1687
  async function createWriteLock(lockRef, { recordOwner = false } = {}) {
1700
1688
  const handle = await open(lockRef, 'wx', 0o600);