@letterblack/lbe-core 1.3.4 → 1.3.5

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 (78) hide show
  1. package/.githooks/pre-commit +2 -0
  2. package/.githooks/pre-push +2 -0
  3. package/CHANGELOG.md +75 -0
  4. package/LICENSE +1 -1
  5. package/README.md +127 -154
  6. package/RELEASE_WORKSPACE_RULES.md +110 -0
  7. package/Release-README.md +65 -0
  8. package/WORKSPACE.md +422 -0
  9. package/_proof.mjs +246 -0
  10. package/assets/runtime-boundary.svg +36 -36
  11. package/bin/lbe.js +12 -0
  12. package/config/identity.config.json +3 -0
  13. package/config/policy.default.json +24 -0
  14. package/dist/cli/lbe.js +4432 -0
  15. package/dist/hooks/register.cjs +505 -0
  16. package/dist/state/appendCentral.cjs +87 -0
  17. package/dist/state/index.cjs +101 -0
  18. package/exec/cli.js +472 -0
  19. package/exec/index.js +2 -0
  20. package/index.js +24 -0
  21. package/lbe.audit.jsonl +46 -0
  22. package/package.json +48 -16
  23. package/release/README.md +216 -0
  24. package/release/TRUST.md +90 -0
  25. package/release/exec-README.md +215 -0
  26. package/release/exec-types.d.ts +50 -0
  27. package/release-exec/LICENSE +1 -0
  28. package/release-exec/README.md +215 -0
  29. package/release-exec/assets/lbe-gates.jpg +0 -0
  30. package/release-exec/assets/lbe-gates.png +0 -0
  31. package/release-exec/assets/runtime-boundary.svg +36 -0
  32. package/release-exec/assets/story-allow.jpg +0 -0
  33. package/release-exec/assets/story-allow.png +0 -0
  34. package/release-exec/assets/story-deny.jpg +0 -0
  35. package/release-exec/assets/story-deny.png +0 -0
  36. package/release-exec/dist/cli.js +2841 -0
  37. package/release-exec/dist/index.js +1835 -0
  38. package/release-exec/dist/lbe_engine.wasm +0 -0
  39. package/{dist → release-exec/dist}/wasm.lock.json +4 -5
  40. package/release-exec/hooks/register.cjs +473 -0
  41. package/release-exec/package.json +35 -0
  42. package/release-exec/types.d.ts +50 -0
  43. package/runtime/engine.js +322 -0
  44. package/runtime/lbe_engine.wasm +0 -0
  45. package/src/cli/commands/assertConsumer.js +198 -0
  46. package/src/cli/commands/auditVerify.js +36 -0
  47. package/src/cli/commands/dryrun.js +175 -0
  48. package/src/cli/commands/health.js +153 -0
  49. package/src/cli/commands/init.js +306 -0
  50. package/src/cli/commands/integrityCheck.js +57 -0
  51. package/src/cli/commands/logs.js +53 -0
  52. package/src/cli/commands/openState.js +44 -0
  53. package/src/cli/commands/policyAdd.js +8 -0
  54. package/src/cli/commands/policyMode.js +7 -0
  55. package/src/cli/commands/policySign.js +72 -0
  56. package/src/cli/commands/proof.js +122 -0
  57. package/src/cli/commands/run.js +342 -0
  58. package/src/cli/commands/status.js +73 -0
  59. package/src/cli/commands/verify.js +144 -0
  60. package/src/cli/main.js +181 -0
  61. package/src/cli/parseArgs.js +115 -0
  62. package/src/exec/localExecutor.js +289 -0
  63. package/src/hooks/register.cjs +505 -0
  64. package/src/state/appendCentral.cjs +87 -0
  65. package/src/state/fileIndex.js +140 -0
  66. package/src/state/index.cjs +101 -0
  67. package/src/state/index.js +65 -0
  68. package/src/state/intentRegistry.js +83 -0
  69. package/src/state/migration.js +112 -0
  70. package/src/state/proofRunner.js +246 -0
  71. package/src/state/stateRoot.js +40 -0
  72. package/src/state/targetRegistry.js +108 -0
  73. package/src/state/workspaceId.js +40 -0
  74. package/src/state/workspaceRegistry.js +65 -0
  75. package/types.d.ts +175 -2
  76. package/dist/cli.js +0 -141
  77. package/dist/index.js +0 -52
  78. /package/dist/{lbe_engine.wasm → cli/lbe_engine.wasm} +0 -0
@@ -0,0 +1,46 @@
1
+ {"kind":"local_policy","timestamp":"2026-06-19T23:35:11.147Z","action":"echo","actor":"agent:x","target":null,"command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"GENESIS","hash":"4fa59031cd7aefdda2eaa673582431436e61b29cc52b1df44dcec64ff9500156"}
2
+ {"kind":"local_policy","timestamp":"2026-06-19T23:35:11.287Z","action":"write_file","actor":"agent:gpt","target":"Z:\\Core_Control\\letterblack-sentinel\\data\\backup-test-target.txt","command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"4fa59031cd7aefdda2eaa673582431436e61b29cc52b1df44dcec64ff9500156","hash":"ebe9a6effd202c1bfc7c744e34b9a4594fb87fbb9fcf9008fcb879d07b9e2e83"}
3
+ {"kind":"local_policy","timestamp":"2026-06-19T23:37:07.027Z","action":"echo","actor":"agent:x","target":null,"command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"ebe9a6effd202c1bfc7c744e34b9a4594fb87fbb9fcf9008fcb879d07b9e2e83","hash":"09837b4ecbfea59315450838934da8dacff3e4606be177a9f2374ea3a7a17b7b"}
4
+ {"kind":"local_policy","timestamp":"2026-06-19T23:37:07.162Z","action":"write_file","actor":"agent:gpt","target":"Z:\\Core_Control\\letterblack-sentinel\\data\\backup-test-target.txt","command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"09837b4ecbfea59315450838934da8dacff3e4606be177a9f2374ea3a7a17b7b","hash":"55b48900a3fe9129aa3c5d6ca56b987b13b9519567ccdcf87111ee8fcf9d0c65"}
5
+ {"kind":"local_policy","timestamp":"2026-06-20T00:00:57.479Z","action":"echo","actor":"agent:x","target":null,"command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"55b48900a3fe9129aa3c5d6ca56b987b13b9519567ccdcf87111ee8fcf9d0c65","hash":"43b7db12e0fb2a5c78b0cde6219e1899d0c153b06332304f5ffb588184f9a546"}
6
+ {"kind":"local_policy","timestamp":"2026-06-20T00:00:57.597Z","action":"write_file","actor":"agent:gpt","target":"Y:\\Core_Control\\letterblack-sentinel\\data\\backup-test-target.txt","command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"43b7db12e0fb2a5c78b0cde6219e1899d0c153b06332304f5ffb588184f9a546","hash":"ad3bff0b0d87f8d7cdd89c81d4feccf5ecb2b1ba6c6c87f4e1941b9f7602682a"}
7
+ {"kind":"local_policy","timestamp":"2026-06-20T00:01:37.683Z","action":"echo","actor":"agent:x","target":null,"command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"ad3bff0b0d87f8d7cdd89c81d4feccf5ecb2b1ba6c6c87f4e1941b9f7602682a","hash":"0cd624477f29707d50fb51ed129cfcc4b1492fff6f764851818d85007de9d8a2"}
8
+ {"kind":"local_policy","timestamp":"2026-06-20T00:01:37.800Z","action":"write_file","actor":"agent:gpt","target":"Y:\\Core_Control\\letterblack-sentinel\\data\\backup-test-target.txt","command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"0cd624477f29707d50fb51ed129cfcc4b1492fff6f764851818d85007de9d8a2","hash":"60849f57f26cb478d16dfacbd890285c86039b353dd32b610781f2bd1ead37e2"}
9
+ {"kind":"local_policy","timestamp":"2026-06-20T07:38:16.456Z","action":"echo","actor":"agent:x","target":null,"command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"60849f57f26cb478d16dfacbd890285c86039b353dd32b610781f2bd1ead37e2","hash":"14893cfb196d22710a42277d90e2f25210965842732cc9f945bb96ce8f9f4fcb"}
10
+ {"kind":"local_policy","timestamp":"2026-06-20T07:38:16.579Z","action":"write_file","actor":"agent:gpt","target":"Z:\\Core_Control\\letterblack-sentinel\\data\\backup-test-target.txt","command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"14893cfb196d22710a42277d90e2f25210965842732cc9f945bb96ce8f9f4fcb","hash":"882079452527f032349a2e7a60dd12d135198e22497d3f4b68b60f800f468e9e"}
11
+ {"kind":"local_policy","timestamp":"2026-06-20T08:26:18.715Z","action":"echo","actor":"agent:x","target":null,"command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"882079452527f032349a2e7a60dd12d135198e22497d3f4b68b60f800f468e9e","hash":"5ebd63b1800100e757fd313bc9533e317595e3f387246403e583d7e47ae182dd"}
12
+ {"kind":"local_policy","timestamp":"2026-06-20T08:26:18.895Z","action":"write_file","actor":"agent:gpt","target":"Z:\\Core_Control\\letterblack-sentinel\\data\\backup-test-target.txt","command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"5ebd63b1800100e757fd313bc9533e317595e3f387246403e583d7e47ae182dd","hash":"2d8c2e634df7bea55d1086da89b9b2cba39385b8f8f4c93fe5f00e2861af4ebb"}
13
+ {"kind":"local_policy","timestamp":"2026-06-20T08:47:49.677Z","action":"echo","actor":"agent:x","target":null,"command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"2d8c2e634df7bea55d1086da89b9b2cba39385b8f8f4c93fe5f00e2861af4ebb","hash":"58705eea240aca0a89a23848d8e217bfc66a20754d26d4d5e1c873a5d7f26243"}
14
+ {"kind":"local_policy","timestamp":"2026-06-20T08:47:49.835Z","action":"write_file","actor":"agent:gpt","target":"Z:\\Core_Control\\letterblack-sentinel\\data\\backup-test-target.txt","command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"58705eea240aca0a89a23848d8e217bfc66a20754d26d4d5e1c873a5d7f26243","hash":"f7e59903f44ed0ef649dd51d1ac0f9c65928f7ac9e1d05d3ed647ccfd439043e"}
15
+ {"kind":"local_policy","timestamp":"2026-06-20T09:16:18.272Z","action":"echo","actor":"agent:x","target":null,"command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"f7e59903f44ed0ef649dd51d1ac0f9c65928f7ac9e1d05d3ed647ccfd439043e","hash":"9b46fff5248d53c6e6a3d0292306e72f72107717d720bbb8110f1c9bbe4aba98"}
16
+ {"kind":"local_policy","timestamp":"2026-06-20T09:16:18.415Z","action":"write_file","actor":"agent:gpt","target":"Z:\\Core_Control\\letterblack-sentinel\\data\\backup-test-target.txt","command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"9b46fff5248d53c6e6a3d0292306e72f72107717d720bbb8110f1c9bbe4aba98","hash":"3ce47f5511666be6bcd556a20b3f67fe98e30835036a7f8da0c98af0d2bb6eed"}
17
+ {"kind":"local_policy","timestamp":"2026-06-20T09:47:26.292Z","action":"echo","actor":"agent:x","target":null,"command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"3ce47f5511666be6bcd556a20b3f67fe98e30835036a7f8da0c98af0d2bb6eed","hash":"6bec570ee7f1ccfb93ab08d3668e50f787318fece9461dc06c9a2b1a62c53727"}
18
+ {"kind":"local_policy","timestamp":"2026-06-20T09:47:26.439Z","action":"write_file","actor":"agent:gpt","target":"Z:\\Core_Control\\letterblack-sentinel\\data\\backup-test-target.txt","command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"6bec570ee7f1ccfb93ab08d3668e50f787318fece9461dc06c9a2b1a62c53727","hash":"d25f758c9d834280d62aecdd50bee074a910bb5a16876c834f3df3ef7dd90a9f"}
19
+ {"kind":"local_policy","timestamp":"2026-06-20T10:02:37.628Z","action":"echo","actor":"agent:x","target":null,"command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"d25f758c9d834280d62aecdd50bee074a910bb5a16876c834f3df3ef7dd90a9f","hash":"b076f0c558e069a876135b52f197fe4eb265dd44efd9b74b68cf74eaf199c8ae"}
20
+ {"kind":"local_policy","timestamp":"2026-06-20T10:02:37.771Z","action":"write_file","actor":"agent:gpt","target":"Z:\\Core_Control\\letterblack-sentinel\\data\\backup-test-target.txt","command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"b076f0c558e069a876135b52f197fe4eb265dd44efd9b74b68cf74eaf199c8ae","hash":"b915c35fe9d842f42399bc83e5ed8bbf4c9ac0cf1d592fe72f51ec4d539b7fdb"}
21
+ {"kind":"local_policy","timestamp":"2026-06-20T11:47:47.851Z","action":"echo","actor":"agent:x","target":null,"command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"b915c35fe9d842f42399bc83e5ed8bbf4c9ac0cf1d592fe72f51ec4d539b7fdb","hash":"817368eab148ac1bc57ecfa22f06124164b1e6176c4051b050b5e3b23f9152a1"}
22
+ {"kind":"local_policy","timestamp":"2026-06-20T11:47:48.023Z","action":"write_file","actor":"agent:gpt","target":"Z:\\Core_Control\\letterblack-sentinel\\data\\backup-test-target.txt","command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"817368eab148ac1bc57ecfa22f06124164b1e6176c4051b050b5e3b23f9152a1","hash":"060d71f2c54bb153628220eb1258231940a06ff16a6d7024201052d84176606d"}
23
+ {"kind":"local_policy","timestamp":"2026-06-20T11:56:56.022Z","action":"echo","actor":"agent:x","target":null,"command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"060d71f2c54bb153628220eb1258231940a06ff16a6d7024201052d84176606d","hash":"6aed9fdcb3a3bec3530a0d89c06f7ac3fc1f3119ca91da4f1b056d813710a30a"}
24
+ {"kind":"local_policy","timestamp":"2026-06-20T11:56:56.171Z","action":"write_file","actor":"agent:gpt","target":"Z:\\Core_Control\\letterblack-sentinel\\data\\backup-test-target.txt","command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"6aed9fdcb3a3bec3530a0d89c06f7ac3fc1f3119ca91da4f1b056d813710a30a","hash":"91f2c57d924a21815ad3ef0abf0a4e8c05060380fe2c36ae104c4a8a67cebdbe"}
25
+ {"kind":"local_policy","timestamp":"2026-06-20T12:03:02.759Z","action":"echo","actor":"agent:x","target":null,"command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"91f2c57d924a21815ad3ef0abf0a4e8c05060380fe2c36ae104c4a8a67cebdbe","hash":"d889e17676f042abfa4200d7834aa2a53bfabde2d339b81b8e6db8c365e83e28"}
26
+ {"kind":"local_policy","timestamp":"2026-06-20T12:03:02.916Z","action":"write_file","actor":"agent:gpt","target":"Z:\\Core_Control\\letterblack-sentinel\\data\\backup-test-target.txt","command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"d889e17676f042abfa4200d7834aa2a53bfabde2d339b81b8e6db8c365e83e28","hash":"f76eb13e259464f177968a80df07c737ad414ea324a2eeadc1f22afef29cf3ea"}
27
+ {"kind":"local_policy","timestamp":"2026-06-20T12:06:17.815Z","action":"echo","actor":"agent:x","target":null,"command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"f76eb13e259464f177968a80df07c737ad414ea324a2eeadc1f22afef29cf3ea","hash":"b2710860f37999d3365ef9c3702e0d619e80138d45d086054fad169d98f9e212"}
28
+ {"kind":"local_policy","timestamp":"2026-06-20T12:06:17.957Z","action":"write_file","actor":"agent:gpt","target":"Z:\\Core_Control\\letterblack-sentinel\\data\\backup-test-target.txt","command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"b2710860f37999d3365ef9c3702e0d619e80138d45d086054fad169d98f9e212","hash":"4346d148ce5d4f090f2f1f574eeb6d748e641b30aadfdac27e41aae59d48ba35"}
29
+ {"kind":"local_policy","timestamp":"2026-06-20T12:07:08.214Z","action":"echo","actor":"agent:x","target":null,"command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"4346d148ce5d4f090f2f1f574eeb6d748e641b30aadfdac27e41aae59d48ba35","hash":"a30c9b09a33473fc27fa0fb7b0d8900ad662be4a07486ffdb15a9a2f715e9a7e"}
30
+ {"kind":"local_policy","timestamp":"2026-06-20T12:07:08.344Z","action":"write_file","actor":"agent:gpt","target":"Z:\\Core_Control\\letterblack-sentinel\\data\\backup-test-target.txt","command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"a30c9b09a33473fc27fa0fb7b0d8900ad662be4a07486ffdb15a9a2f715e9a7e","hash":"83f2c7d56d26415e6d4b6fdc4111e5e979e32485f6d994cb433622a96dd70aca"}
31
+ {"kind":"local_policy","timestamp":"2026-06-20T12:08:25.892Z","action":"echo","actor":"agent:x","target":null,"command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"83f2c7d56d26415e6d4b6fdc4111e5e979e32485f6d994cb433622a96dd70aca","hash":"1f649193b5fb02d0c83f36b7ff7648342da42d10b2b0589a884f2979a4518940"}
32
+ {"kind":"local_policy","timestamp":"2026-06-20T12:08:26.076Z","action":"write_file","actor":"agent:gpt","target":"Z:\\Core_Control\\letterblack-sentinel\\data\\backup-test-target.txt","command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"1f649193b5fb02d0c83f36b7ff7648342da42d10b2b0589a884f2979a4518940","hash":"939f5ceaa938d0a6e7dc520b607375cbd8bda9e6bce672db2adddc08ebe5167e"}
33
+ {"kind":"local_policy","timestamp":"2026-06-20T12:14:43.895Z","action":"echo","actor":"agent:x","target":null,"command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"939f5ceaa938d0a6e7dc520b607375cbd8bda9e6bce672db2adddc08ebe5167e","hash":"88409073a33f89a8e29b5c9188816d8de460f23bfe92647f89cefba5029ccaa4"}
34
+ {"kind":"local_policy","timestamp":"2026-06-20T12:14:44.042Z","action":"write_file","actor":"agent:gpt","target":"Z:\\Core_Control\\letterblack-sentinel\\data\\backup-test-target.txt","command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"88409073a33f89a8e29b5c9188816d8de460f23bfe92647f89cefba5029ccaa4","hash":"cf477d692f3888269d9243b450d9c000e630c4bba5be1f223b4baba16b70db8d"}
35
+ {"kind":"local_policy","timestamp":"2026-06-20T13:23:45.701Z","action":"echo","actor":"agent:x","target":null,"command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"cf477d692f3888269d9243b450d9c000e630c4bba5be1f223b4baba16b70db8d","hash":"baa3e917baa568c84ee8172d913a5744356dda663db1a6b6403f1e7380ccba3d"}
36
+ {"kind":"local_policy","timestamp":"2026-06-20T13:23:46.038Z","action":"write_file","actor":"agent:gpt","target":"Z:\\Core_Control\\letterblack-sentinel\\data\\backup-test-target.txt","command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"baa3e917baa568c84ee8172d913a5744356dda663db1a6b6403f1e7380ccba3d","hash":"8a347b48752b01af461624d9b62a0d626a7d0c16c61930ac5765a41c5146f41c"}
37
+ {"kind":"local_policy","timestamp":"2026-06-20T13:53:06.494Z","action":"echo","actor":"agent:x","target":null,"command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"8a347b48752b01af461624d9b62a0d626a7d0c16c61930ac5765a41c5146f41c","hash":"0f40141f3d9d3f865a01aa684e5e6e36bcf04b037c0fa566b6ab78650f68c8c3"}
38
+ {"kind":"local_policy","timestamp":"2026-06-20T13:53:06.939Z","action":"write_file","actor":"agent:gpt","target":"Z:\\Core_Control\\letterblack-sentinel\\data\\backup-test-target.txt","command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"0f40141f3d9d3f865a01aa684e5e6e36bcf04b037c0fa566b6ab78650f68c8c3","hash":"af45bc8c55e6682f81a14869d1b3ba0acc40107bf4e007e6b7b89786dc4cf226"}
39
+ {"kind":"local_policy","timestamp":"2026-06-20T14:58:33.144Z","action":"echo","actor":"agent:x","target":null,"command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"af45bc8c55e6682f81a14869d1b3ba0acc40107bf4e007e6b7b89786dc4cf226","hash":"c4984421fa1863224c6fc12af043894aba767eb351b7934f0e351f594888825e"}
40
+ {"kind":"local_policy","timestamp":"2026-06-20T14:58:33.291Z","action":"write_file","actor":"agent:gpt","target":"Z:\\Core_Control\\letterblack-sentinel\\data\\backup-test-target.txt","command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"c4984421fa1863224c6fc12af043894aba767eb351b7934f0e351f594888825e","hash":"cfccb5a4c4877491f8e3d06e84f43af20eeea5ab447fcb57412e71e9ff4691be"}
41
+ {"kind":"local_policy","timestamp":"2026-06-20T14:59:22.384Z","action":"echo","actor":"agent:x","target":null,"command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"cfccb5a4c4877491f8e3d06e84f43af20eeea5ab447fcb57412e71e9ff4691be","hash":"fc67b954900c2b704ac3b33c17837de0bd021d64f5607f4add942815e8463008"}
42
+ {"kind":"local_policy","timestamp":"2026-06-20T14:59:22.517Z","action":"write_file","actor":"agent:gpt","target":"Z:\\Core_Control\\letterblack-sentinel\\data\\backup-test-target.txt","command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"fc67b954900c2b704ac3b33c17837de0bd021d64f5607f4add942815e8463008","hash":"f93630b6208fe6b3e135f63e935343fb633a20d9a4a129cc11ae88bdadec1794"}
43
+ {"kind":"local_policy","timestamp":"2026-06-20T15:00:10.434Z","action":"echo","actor":"agent:x","target":null,"command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"f93630b6208fe6b3e135f63e935343fb633a20d9a4a129cc11ae88bdadec1794","hash":"84640c42c4213b5a6e5f995ff36c12e036faabaecb2bb6bd1675e69206425e15"}
44
+ {"kind":"local_policy","timestamp":"2026-06-20T15:00:10.578Z","action":"write_file","actor":"agent:gpt","target":"Z:\\Core_Control\\letterblack-sentinel\\data\\backup-test-target.txt","command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"84640c42c4213b5a6e5f995ff36c12e036faabaecb2bb6bd1675e69206425e15","hash":"b3669fa5f3bb23eb8964ce1b414efb1cad3e9879708e6186c1ebf15f33685362"}
45
+ {"kind":"local_policy","timestamp":"2026-06-20T15:00:59.854Z","action":"echo","actor":"agent:x","target":null,"command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"b3669fa5f3bb23eb8964ce1b414efb1cad3e9879708e6186c1ebf15f33685362","hash":"70ca3430dc4b2e0af375aa4bbe864f362f9f05e67d59e1ba4d2d8941b11c7a01"}
46
+ {"kind":"local_policy","timestamp":"2026-06-20T15:00:59.974Z","action":"write_file","actor":"agent:gpt","target":"Z:\\Core_Control\\letterblack-sentinel\\data\\backup-test-target.txt","command":null,"mode":"observe","decision":"allow","wouldDeny":false,"ruleIds":[],"prevHash":"70ca3430dc4b2e0af375aa4bbe864f362f9f05e67d59e1ba4d2d8941b11c7a01","hash":"5aa409b72bc1b26cef4e2ecefa7441805006096bb5b8e11d0e80c56b18b949a9"}
package/package.json CHANGED
@@ -1,30 +1,52 @@
1
1
  {
2
2
  "name": "@letterblack/lbe-core",
3
- "version": "1.3.4",
4
- "description": "Local-first execution governance SDK for AI agents.",
3
+ "version": "1.3.5",
4
+ "description": "Local-first execution governance SDK for AI agents. Agents propose → Controller validates → Adapters execute.",
5
5
  "type": "module",
6
- "main": "dist/index.js",
6
+ "main": "index.js",
7
7
  "types": "types.d.ts",
8
8
  "exports": {
9
9
  ".": {
10
10
  "types": "./types.d.ts",
11
- "default": "./dist/index.js"
11
+ "default": "./index.js"
12
12
  },
13
- "./cli": "./dist/cli.js"
13
+ "./engine": "./runtime/engine.js",
14
+ "./adapters": "./src/adapters/index.js",
15
+ "./exec": "./exec/index.js",
16
+ "./hooks/register.cjs": "./dist/hooks/register.cjs"
14
17
  },
15
18
  "bin": {
16
- "lbe": "dist/cli.js"
19
+ "lbe": "bin/lbe.js"
17
20
  },
18
- "files": [
19
- "dist/",
20
- "assets/",
21
- "types.d.ts",
22
- "README.md",
23
- "LICENSE"
24
- ],
25
21
  "scripts": {
26
- "pack": "npm pack",
27
- "pack:check": "npm pack --dry-run"
22
+ "test": "node --test",
23
+ "lint": "eslint src/ bin/",
24
+ "init": "node bin/lbe.js init",
25
+ "verify": "node bin/lbe.js verify",
26
+ "dryrun": "node bin/lbe.js dryrun",
27
+ "run": "node bin/lbe.js run",
28
+ "policy:sign": "node bin/lbe.js policy-sign",
29
+ "health": "node bin/lbe.js health --json true",
30
+ "integrity:generate": "node bin/lbe.js integrity-generate",
31
+ "integrity:check": "node bin/lbe.js integrity-check",
32
+ "build:engine": "node scripts/build-engine.js",
33
+ "build:public-sdk": "node scripts/build-public-sdk.mjs",
34
+ "build:public-exec": "node scripts/build-public-exec.mjs",
35
+ "build:package-runtime": "node scripts/build-package-runtime.mjs",
36
+ "proof": "node _proof.mjs",
37
+ "audit:public-docs": "node scripts/audit-public-docs.mjs",
38
+ "verify:package-runtime": "node scripts/verify-package-runtime.mjs",
39
+ "assert-consumer": "node bin/lbe.js assert-consumer",
40
+ "verify:public-exec": "npm run proof && npm run build:public-exec && node scripts/check-public-exec.mjs && cd release-exec && npm pack --dry-run",
41
+ "verify:public-sdk": "npm run build:public-sdk && node scripts/check-public-artifact.mjs && cd release-public && npm pack --dry-run",
42
+ "engine:check": "node scripts/check-engine.js",
43
+ "pack:check": "npm pack --dry-run",
44
+ "audit:verify": "node bin/lbe.js audit-verify",
45
+ "guard:mainhead": "node scripts/mainhead-guard.mjs",
46
+ "hooks:install": "node scripts/install-git-hooks.mjs",
47
+ "prepack": "npm run build:package-runtime",
48
+ "validate:all": "npm run guard:mainhead && npm run engine:check && npm run lint && npm run test",
49
+ "publish:release": "node scripts/publish.mjs"
28
50
  },
29
51
  "keywords": [
30
52
  "ai-governance",
@@ -38,8 +60,18 @@
38
60
  ],
39
61
  "author": "LetterBlack",
40
62
  "license": "SEE LICENSE IN LICENSE",
41
- "dependencies": {},
63
+ "dependencies": {
64
+ "tweetnacl": "^1.0.3",
65
+ "json-canonicalize": "^1.0.4"
66
+ },
67
+ "devDependencies": {
68
+ "esbuild": "^0.25.11",
69
+ "eslint": "^8.52.0"
70
+ },
42
71
  "engines": {
43
72
  "node": ">=20.9.0"
73
+ },
74
+ "directories": {
75
+ "doc": "docs"
44
76
  }
45
77
  }
@@ -0,0 +1,216 @@
1
+ # {{PACKAGE_NAME}}
2
+
3
+ LBE is local execution control for AI agents. It evaluates file and shell
4
+ actions routed through its execution boundary and records local evidence.
5
+ It is not an AI model, IDE, full OS sandbox, or cloud monitor.
6
+
7
+ ## Setup
8
+
9
+ ```bash
10
+ npm install {{PACKAGE_NAME}}
11
+ npx lbe init
12
+ npx lbe status
13
+ npx lbe logs
14
+ npx lbe proof --public
15
+ npx lbe open-state
16
+ ```
17
+
18
+ State is stored locally in a central per-user folder, keyed by workspace ID.
19
+ In v1.3, `.lbe/events.jsonl` remains local fallback truth and is imported once
20
+ without changing the original file. Proof uses intent, target, file index, LBE
21
+ events, and `proof/latest.json`; `--public` redacts sensitive proof details.
22
+
23
+ LBE controls only actions routed through its execution boundary. Central writes
24
+ are best-effort, logs remain local, and non-inspectable targets may produce
25
+ `WEAK_PROOF`.
26
+
27
+ ---
28
+
29
+ LBE puts a local policy gate between what an AI agent proposes and what the system actually executes. Every action — file write, shell command, anything — is validated locally before it runs. No cloud service. No daemon.
30
+
31
+ > **Used in production:** LBE is the safety engine inside [Letterblack for After Effects](https://letterblack.net) — every AI-generated script and automation command passes through it before touching a live project.
32
+
33
+ ---
34
+
35
+ ## Which package do you need?
36
+
37
+ | I want… | Package |
38
+ |---|---|
39
+ | LBE to handle file writes and shell commands for me (full controller) | `@letterblack/lbe-exec` |
40
+ | Just the allow/deny decision — I'll execute it myself | `@letterblack/lbe-sdk` ← you are here |
41
+
42
+ ---
43
+
44
+ ## Install
45
+
46
+ ```bash
47
+ npm install {{PACKAGE_NAME}}
48
+ ```
49
+
50
+ Requires Node.js ≥ 20.9.0.
51
+
52
+ ---
53
+
54
+ ## Quick start
55
+
56
+ ```js
57
+ import { execute } from '{{PACKAGE_NAME}}';
58
+
59
+ const request = {
60
+ version: '1.0',
61
+ request_id: 'req-001',
62
+ timestamp: Math.floor(Date.now() / 1000),
63
+ actor: { id: 'agent:local', role: 'agent' },
64
+ intent: { type: 'command', name: 'write_file', payload: { target: 'out.txt' } },
65
+ context: { workspace: process.cwd(), env: {}, history: [] },
66
+ constraints: { policy_mode: 'strict', timeout_ms: 5000 },
67
+ auth: { signature: '<host-signed>', nonce: '<unique-per-request>' }
68
+ };
69
+
70
+ const result = JSON.parse(execute(JSON.stringify(request)));
71
+ // Approved: { ok: true, decision: 'allow', ... }
72
+ // Blocked: { ok: false, decision: 'deny', error: { stage, message } }
73
+ ```
74
+
75
+ `execute(input: string): string` — accepts JSON, returns JSON. The runtime validates and returns a decision. The host acts on the decision.
76
+
77
+ ### Request fields
78
+
79
+ | Field | Required | Description |
80
+ |---|---:|---|
81
+ | `version` | Yes | `"1.0"` |
82
+ | `request_id` | Yes | Caller-supplied unique identifier |
83
+ | `timestamp` | Yes | Unix timestamp in seconds |
84
+ | `actor` | Yes | `{ id, role }` — identity of the requesting agent |
85
+ | `intent` | Yes | `{ type, name, payload }` — what the agent wants to do |
86
+ | `context` | Yes | Workspace path and caller context |
87
+ | `constraints` | Yes | `policy_mode` and `timeout_ms` |
88
+ | `auth` | Yes | Host-supplied `signature` and `nonce` |
89
+
90
+ ---
91
+
92
+ ## Observer mode — start here
93
+
94
+ Not ready to block? Start in observer mode. Every request is fully validated and logged exactly as it would be in enforcement — but nothing is blocked. Watch what the agent is doing before you decide what to deny.
95
+
96
+ ```bash
97
+ npx lbe init # create lbe.policy.json in observer mode
98
+ npx lbe enforce # switch to blocking
99
+ npx lbe observe # switch back to advisory
100
+ ```
101
+
102
+ ---
103
+
104
+ ## CLI reference
105
+
106
+ | Command | Purpose |
107
+ |---|---|
108
+ | `npx lbe init` | Create project-local policy and key state in observer mode |
109
+ | `npx lbe policy-add` | Add a rule to the active policy |
110
+ | `npx lbe observe` | Set advisory (log-only) mode |
111
+ | `npx lbe enforce` | Set blocking mode |
112
+ | `npx lbe run` | Validate and execute a proposal from `--in <file>` |
113
+ | `npx lbe verify` | Validate a proposal without executing |
114
+ | `npx lbe dryrun` | Validate and simulate without executing |
115
+ | `npx lbe health` | Check all required files are present and readable |
116
+ | `npx lbe audit-verify` | Verify the audit log hash chain |
117
+
118
+ ---
119
+
120
+ ## How the gate pipeline works
121
+
122
+ ![LBE gate sequence — Request flows through Policy, Identity, and Scope gates before reaching Action. A rejected request is routed to denial before it reaches execution.](https://unpkg.com/@letterblack/lbe-exec/assets/lbe-gates.jpg)
123
+
124
+ Every request enters a 7-gate pipeline. A failure at any gate returns a structured denial — the remaining gates are not evaluated.
125
+
126
+ ```
127
+ [1] Schema required fields and structural validity
128
+
129
+ [2] Timestamp permitted clock-skew window (±10 minutes)
130
+
131
+ [3] Key lifecycle trusted key, active, not expired
132
+
133
+ [4] Signature Ed25519 request authenticity
134
+
135
+ [5] Rate limit per-requester sliding-window limit
136
+
137
+ [6] Nonce single-use replay protection
138
+
139
+ [7] Policy configured authorization (deny-wins)
140
+
141
+ allow / deny / error — structured result returned to host
142
+ ```
143
+
144
+ The WASM runtime owns all gate decisions. Your host receives the decision and acts on it. Nothing executes inside the runtime.
145
+
146
+ ---
147
+
148
+ ## When a request is approved
149
+
150
+ ![Happy path — agent proposes action, identity confirmed, policy approved, governed write executed, audit chain extended, result returned to app.](https://unpkg.com/@letterblack/lbe-exec/assets/story-allow.jpg)
151
+
152
+ 1. The agent produces a signed action proposal.
153
+ 2. Identity is confirmed against a locally held key — no network call required.
154
+ 3. The project policy is evaluated. The action is approved.
155
+ 4. The host executes the write or command inside the allowed workspace.
156
+ 5. The audit chain is extended — every approved action appends a hash-linked entry to the local log, permanently verifiable, impossible to silently remove.
157
+ 6. A structured result returns: whether it succeeded, which rules matched, and the audit entry identifier.
158
+
159
+ The application stays in control. {{PACKAGE_NAME}} decides whether the action was permitted and hands the answer back. It does not execute for you.
160
+
161
+ ---
162
+
163
+ ## When a request is blocked
164
+
165
+ ![Deny path — policy rejection before a governed action, shell untouched, filesystem unchanged, audit entry written, final state clean.](https://unpkg.com/@letterblack/lbe-exec/assets/story-deny.jpg)
166
+
167
+ 1. The agent proposes an action that is outside the permitted policy.
168
+ 2. The policy gate closes immediately. The WASM runtime stamps the request denied before any adapter is reached.
169
+ 3. The shell is untouched. The filesystem is unchanged.
170
+ 4. The denial is written to the immutable audit log — chain sealed, evidence preserved.
171
+
172
+ No partial execution. No silent failures. Denial is a first-class outcome, not an error.
173
+
174
+ ---
175
+
176
+ ## What this covers
177
+
178
+ | Threat | Gate |
179
+ |---|---|
180
+ | Malformed or incomplete request | Schema |
181
+ | Stale or replayed request | Timestamp + Nonce |
182
+ | Tampered or expired key | Key lifecycle + Signature |
183
+ | Excessive requests from one actor | Rate limit |
184
+ | Action not permitted by project policy | Policy — deny-wins |
185
+ | Agent writing outside project root | Scope check in host after decision |
186
+
187
+ ---
188
+
189
+ ## What ships
190
+
191
+ ```
192
+ dist/index.js WebAssembly runtime loader and execute()
193
+ dist/cli.js Local CLI (npx lbe)
194
+ dist/lbe_engine.wasm Verified runtime binary
195
+ dist/wasm.lock.json Runtime integrity lock (SHA-256 of wasm binary)
196
+ assets/lbe-gates.jpg Gate sequence diagram
197
+ assets/story-allow.jpg Approved-request storyboard
198
+ assets/story-deny.jpg Blocked-request storyboard
199
+ assets/runtime-boundary.svg Runtime boundary diagram
200
+ assets/lbe-gates.png Gate sequence diagram (full resolution)
201
+ assets/story-allow.png Approved-request storyboard (full resolution)
202
+ assets/story-deny.png Blocked-request storyboard (full resolution)
203
+ types.d.ts TypeScript declarations
204
+ ```
205
+
206
+ At load time the runtime verifies `lbe_engine.wasm` against `wasm.lock.json`. A missing, modified, or swapped binary fails before any request is processed.
207
+
208
+ Source code, controller implementation, adapters, tests, keys, and runtime state are not included.
209
+
210
+ ---
211
+
212
+ ## Limits
213
+
214
+ This package validates requests routed through its runtime. It does not provide kernel-level process isolation, network-egress control, multi-tenant separation, or a hosted control plane.
215
+
216
+ For an in-process controller with file operations, shell, and policy management built in, see `@letterblack/lbe-exec`.
@@ -0,0 +1,90 @@
1
+ # Trust Model
2
+
3
+ This document states plainly what you can and cannot verify about `@letterblack/lbe-exec` and `@letterblack/lbe-sdk`. It is written for agents and developers who want to reason about the trust surface before depending on this package.
4
+
5
+ ---
6
+
7
+ ## What this package does
8
+
9
+ LBE intercepts Node.js file system and shell operations at the process level via a CJS preload hook (`--require`). Every intercepted action is evaluated against a local policy file and appended to an audit log. The governance engine runs inside a compiled WASM binary shipped with the package.
10
+
11
+ ---
12
+
13
+ ## What you can verify independently
14
+
15
+ ### 1. Hook behavior (fully verifiable)
16
+
17
+ The preload hook (`hooks/register.cjs`) is client-side JavaScript. You can read it, run it in isolation, and confirm it patches the APIs it claims to patch. The minified form is smaller but not protected — it can be formatted and read.
18
+
19
+ ```bash
20
+ # Confirm hook patches fs and child_process
21
+ node --require ./node_modules/@letterblack/lbe-exec/hooks/register.cjs \
22
+ -e "require('fs').writeFileSync('test.txt','x')"
23
+ cat .lbe/events.jsonl
24
+ ```
25
+
26
+ ### 2. Audit log integrity (partially verifiable)
27
+
28
+ `audit.jsonl` is append-only JSONL in `.lbe/`. You can read every entry. The format is stable and human-readable. There is no cryptographic hash chain on the events.jsonl written by the hook — entries can be deleted without detection at the file level.
29
+
30
+ ### 3. WASM hash lock (tamper-detection, not supply-chain proof)
31
+
32
+ `dist/wasm.lock.json` contains a SHA-256 hash of `dist/lbe_engine.wasm`. The CLI verifies this at runtime.
33
+
34
+ **What this protects against:** post-install tampering — if someone modifies the WASM binary on your machine after installation, the hash check fails and the CLI refuses to run.
35
+
36
+ **What this does not protect against:** the initial install. If the package on npm is compromised before you install it, the hash in `wasm.lock.json` will match the compromised binary. This is standard supply-chain trust, not an additional guarantee.
37
+
38
+ ### 4. Commit signatures (verifiable from 2026-06-21 forward)
39
+
40
+ Commits to this repository are GPG-signed with key `B902B3111F7D01BA` (Ed25519, expires 2028-06-20). You can verify:
41
+
42
+ ```bash
43
+ git log --show-signature
44
+ ```
45
+
46
+ This confirms that commits were made by the key holder. It does not make the code open source.
47
+
48
+ ---
49
+
50
+ ## What you cannot verify
51
+
52
+ ### The WASM runtime is closed source
53
+
54
+ `dist/lbe_engine.wasm` is a compiled binary. Its source is not published. You cannot audit the governance engine logic — policy evaluation, signature verification, rate limiting, nonce replay protection — from the shipped artifact.
55
+
56
+ The trust chain for the runtime is: **you trust the binary or you don't.** There is no open-source alternative at this time.
57
+
58
+ ### Minified JS is not hidden
59
+
60
+ `hooks/register.cjs` and `dist/cli.js` are minified. Minified means smaller and harder to read — not protected, not encrypted, not obfuscated beyond whitespace and name compression. A motivated reader can format and read the full implementation.
61
+
62
+ ---
63
+
64
+ ## What the hook does and does not govern
65
+
66
+ **Governed:** Node.js processes that load the hook via `--require` or `NODE_OPTIONS`.
67
+
68
+ **Not governed:** Python, Go, Rust, native binaries, PowerShell scripts, subprocess spawns outside `child_process`, or any process that runs outside the hooked Node.js environment.
69
+
70
+ The hook is a best-effort governance layer for Node.js agents, not a sandbox or kernel-level enforcement mechanism.
71
+
72
+ ---
73
+
74
+ ## Verification surface summary
75
+
76
+ | Claim | Verifiable? | How |
77
+ |---|---|---|
78
+ | Hook patches fs and child_process | Yes | Run it, read the audit log |
79
+ | Audit log captures intercepted actions | Yes | Read `.lbe/events.jsonl` |
80
+ | WASM binary not tampered post-install | Yes | Hash in `wasm.lock.json` |
81
+ | WASM binary not tampered at publish time | No | Closed source, standard npm trust |
82
+ | Governance engine logic is correct | No | WASM is not open source |
83
+ | Commits are from the stated author | Yes | GPG signatures on git history |
84
+ | Hook controls every Node.js action | No | JS is not a sandbox |
85
+
86
+ ---
87
+
88
+ ## Reporting
89
+
90
+ If you find behaviour that contradicts this document — the hook not logging, the hash check not failing on a modified binary, or audit entries missing — open an issue on the public repository.