@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,2 @@
1
+ #!/bin/sh
2
+ node letterblack-sentinel/scripts/mainhead-guard.mjs
@@ -0,0 +1,2 @@
1
+ #!/bin/sh
2
+ node letterblack-sentinel/scripts/mainhead-guard.mjs
package/CHANGELOG.md ADDED
@@ -0,0 +1,75 @@
1
+ # Changelog
2
+
3
+ ## 1.3.3 — 2026-06-23
4
+
5
+ ### Fixed
6
+ - Rebuilt the docs-aligned release from a committed tree so the npm artifact
7
+ gitHead matches the release commit.
8
+
9
+ ## 1.3.2 — 2026-06-23
10
+
11
+ ### Fixed
12
+ - Aligned the public README surfaces and release docs with the shipped
13
+ `@letterblack/lbe-core` package and current CLI commands.
14
+
15
+ ## 1.3.1 — 2026-06-23
16
+
17
+ ### Fixed
18
+ - Re-aligned the release branch and published package lineage after the 1.3.0
19
+ tag/artifact mismatch was detected.
20
+
21
+ ## 1.3.0 — 2026-06-23
22
+
23
+ ### Added
24
+ - Central local workspace state, proof summaries, and one-time import of legacy
25
+ `.lbe/events.jsonl` entries while preserving the original local log.
26
+
27
+ ## 1.2.0 — 2026-06-20
28
+
29
+ ### Added
30
+ - **Real JS governance engine** — `createLBE()` now uses the full 7-gate validation pipeline (schema → key lifecycle → timestamp skew → rate limit → nonce replay → policy) with backup, rollback, and audit. Previously backed by a thin WASM wrapper.
31
+ - **Observer mode** — `createLBE({ mode: 'observe' })` or `npx lbe observe`. All gates run silently, audit log is written, nothing is blocked. Default for new and half-built projects.
32
+ - **Policy file** (`lbe.policy.json`) — human-readable rule store per project. Records `effect`, `type`, `pattern`, the original user message (`from`), and timestamp (`at`). Deny always wins over allow.
33
+ - **New CLI commands:**
34
+ - `npx lbe observe` — switch to observer mode
35
+ - `npx lbe enforce` — switch to enforcement mode
36
+ - `npx lbe policy` — list all rules with source context
37
+ - **Universal CLI interface** — non-JS projects (Python, Rust, Go, any language) can pipe JSON to `npx lbe execute`. Exit 0 = allowed, exit 1 = denied, exit 2 = error.
38
+ - **Language-agnostic design** — WASM runtime path documented as the path to non-JS bindings. JS engine is the current production runtime.
39
+
40
+ ### Changed
41
+ - `LBEResult` now includes `commandId`, `stage`, `risk`, `output` fields.
42
+ - `LBEOptions` removes `policy_mode` / `timeout_ms` — these are managed by the governance engine internally.
43
+ - `wrapTools().dispatch()` now returns `Promise<LBEResult>` (async) to match the real engine contract.
44
+ - Types updated throughout to reflect observer mode result shape (`LBEObservedResult`).
45
+
46
+ ---
47
+
48
+ ## 1.0.4 — 2026-06-19
49
+
50
+ ### Removed
51
+ - MCP execution surface — `lbe-mcp` command, MCP adapter, and configuration examples removed.
52
+ An MCP server only offers LBE as one optional tool; agent hosts with native tools can act outside that boundary, so it cannot enforce the governance boundary. See `docs/decisions/ADR-001-remove-mcp-execution-surface.md`.
53
+ - HTTP server surface — `lbe-serve` command and HTTP adapter removed.
54
+ An HTTP endpoint replicates governance in a separate process and creates a second attack surface without guaranteeing the calling agent routes through it. See `docs/decisions/ADR-002-remove-http-server-surface.md`.
55
+
56
+ ### Changed
57
+ - Established SDK-only product boundary: LBE ships as one local SDK and CLI embedded in the caller's application. No daemon, host platform, Docker deployment, or companion system. See `docs/decisions/ADR-003-sdk-only-product-boundary.md`.
58
+ - Workspace pruned to SDK-only source; all optional execution surfaces removed from `src/`, `bin/`, and CI config.
59
+ - Public package identity (`LBE_PUBLIC_PACKAGE_NAME`, `LBE_PUBLIC_PACKAGE_VERSION`) is now parameterised via environment variables in the build script.
60
+ - Test command made portable across Node.js versions (no `--experimental-vm-modules` flag needed).
61
+
62
+ ### Public surface
63
+ The public package (`@letterblack/lbe-sdk`) exports exactly one function:
64
+
65
+ ```ts
66
+ export function execute(input: string): string;
67
+ ```
68
+
69
+ No server, daemon, MCP surface, or optional execution layer ships in the public package.
70
+
71
+ ---
72
+
73
+ ## 1.0.3 and earlier
74
+
75
+ Pre-release development. No public changelog maintained.
package/LICENSE CHANGED
@@ -1 +1 @@
1
- SEE LICENSE IN LICENSE
1
+ SEE LICENSE IN LICENSE
package/README.md CHANGED
@@ -1,194 +1,167 @@
1
- # @letterblack/lbe-core
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 and workspace initialization
8
-
9
- ```bash
10
- npm install @letterblack/lbe-core
11
- npx lbe init
12
- npx lbe status
13
- npx lbe logs
14
- npx lbe open-state
15
- npx lbe proof
16
- npx lbe proof --public
17
- ```
18
-
19
- `npx lbe init` creates the workspace policy and state material in the central
20
- per-user folder keyed by workspace ID. `npx lbe status`, `logs`, and
21
- `open-state` read that local state, while `proof` writes the proof record and
22
- `--public` redacts sensitive proof details.
23
-
24
- In v1.3, `.lbe/events.jsonl` remains local fallback truth and is imported once
25
- without changing the original file. Proof uses intent, target, file index, LBE
26
- events, and `proof/latest.json`. Central writes are best-effort, logs remain
27
- local, and non-inspectable targets may produce `WEAK_PROOF`.
28
-
29
- ---
30
-
31
- LBE puts a local policy gate between what an AI agent proposes and what the
32
- system actually executes. Every action — file write, shell command, anything —
33
- is validated locally before it runs. No cloud service. No daemon.
34
-
35
- > **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.
36
-
37
- ---
38
-
39
- ## Install
40
-
41
- ```bash
42
- npm install @letterblack/lbe-core
43
- ```
44
-
45
- Requires Node.js ≥ 20.9.0.
1
+ # @letterblack/lbe-core
46
2
 
47
- ---
3
+ LBE Core is **local execution control for AI agents**.
4
+
5
+ It evaluates file and shell actions routed through its execution boundary, records local evidence, and returns an allow/deny/proof outcome before agent work is treated as complete.
6
+
7
+ LBE is not an AI model, IDE, full OS sandbox, cloud monitor, or hosted control plane. It only controls actions that are routed through LBE.
48
8
 
49
- ## Quick start
50
-
51
- ```js
52
- import { execute } from '@letterblack/lbe-core';
53
-
54
- const request = {
55
- version: '1.0',
56
- request_id: 'req-001',
57
- timestamp: Math.floor(Date.now() / 1000),
58
- actor: { id: 'agent:local', role: 'agent' },
59
- intent: { type: 'command', name: 'write_file', payload: { target: 'out.txt' } },
60
- context: { workspace: process.cwd(), env: {}, history: [] },
61
- constraints: { policy_mode: 'strict', timeout_ms: 5000 },
62
- auth: { signature: '<host-signed>', nonce: '<unique-per-request>' }
63
- };
64
-
65
- const result = JSON.parse(execute(JSON.stringify(request)));
66
- // Approved: { ok: true, decision: 'allow', ... }
67
- // Blocked: { ok: false, decision: 'deny', error: { stage, message } }
9
+ ```text
10
+ Agent wants to act
11
+
12
+ LBE validates workspace, policy, target, and evidence
13
+
14
+ allow / deny / weak proof / error
15
+
16
+ Host executes only if LBE approved
17
+
18
+ Audit and proof records are written locally
68
19
  ```
69
20
 
70
- `execute(input: string): string` — accepts JSON, returns JSON. The runtime validates and returns a decision. The host acts on the decision.
21
+ ---
71
22
 
72
- ### Request fields
23
+ ## Install and start
73
24
 
74
- | Field | Required | Description |
75
- |---|---:|---|
76
- | `version` | Yes | `"1.0"` |
77
- | `request_id` | Yes | Caller-supplied unique identifier |
78
- | `timestamp` | Yes | Unix timestamp in seconds |
79
- | `actor` | Yes | `{ id, role }` — identity of the requesting agent |
80
- | `intent` | Yes | `{ type, name, payload }` — what the agent wants to do |
81
- | `context` | Yes | Workspace path and caller context |
82
- | `constraints` | Yes | `policy_mode` and `timeout_ms` |
83
- | `auth` | Yes | Host-supplied `signature` and `nonce` |
25
+ ```bash
26
+ npm install @letterblack/lbe-core
27
+ npx lbe init
28
+ npx lbe status
29
+ npx lbe logs
30
+ npx lbe proof --public
31
+ npx lbe open-state
32
+ ```
84
33
 
85
- ---
34
+ Requires Node.js `>= 20.9.0`.
35
+
36
+ Command summary:
86
37
 
87
- ## CLI reference
88
-
89
- | Command | Purpose |
90
- |---|---|
91
- | `npx lbe init` | Initialize the workspace policy and state material |
92
- | `npx lbe status` | Show the current workspace and proof status |
93
- | `npx lbe logs` | Inspect local evidence and event logs |
94
- | `npx lbe open-state` | Open the central local state folder |
95
- | `npx lbe proof` | Write the current proof record |
96
- | `npx lbe proof --public` | Write a redacted proof record for public surfaces |
38
+ | Command | Purpose |
39
+ |---|---|
40
+ | `npx lbe init` | Initialize LBE state for the current workspace |
41
+ | `npx lbe status` | Show workspace policy, state, and proof status |
42
+ | `npx lbe logs` | Show recent local LBE audit events |
43
+ | `npx lbe open-state` | Open the central local state folder for this workspace |
44
+ | `npx lbe proof` | Show the latest private proof result |
45
+ | `npx lbe proof --json` | Print the latest proof as JSON |
46
+ | `npx lbe proof --public` | Print a redacted proof safe for public sharing |
47
+ | `npx lbe status --all` | List known local workspaces from the workspace registry |
97
48
 
98
49
  ---
99
50
 
100
- ## How the gate pipeline works
51
+ ## What LBE does
101
52
 
102
- ![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)
53
+ LBE gives agent builders a local execution boundary:
103
54
 
104
- Every request enters a 7-gate pipeline. A failure at any gate returns a structured denial — the remaining gates are not evaluated.
55
+ - validates requested file and shell actions before execution
56
+ - keeps governed actions inside the intended workspace
57
+ - records local audit evidence
58
+ - tracks intent, target, file-index snapshots, and proof results
59
+ - supports private proof and public/redacted proof output
60
+ - preserves legacy `.lbe/events.jsonl` logs while using central local state
105
61
 
62
+ Most systems ask only:
63
+
64
+ ```text
65
+ Did the user approve this?
106
66
  ```
107
- [1] Schema required fields and structural validity
108
-
109
- [2] Timestamp permitted clock-skew window (±10 minutes)
110
-
111
- [3] Key lifecycle trusted key, active, not expired
112
-
113
- [4] Signature Ed25519 request authenticity
114
-
115
- [5] Rate limit per-requester sliding-window limit
116
-
117
- [6] Nonce single-use replay protection
118
-
119
- [7] Policy configured authorization (deny-wins)
120
-
121
- allow / deny / error — structured result returned to host
122
- ```
123
67
 
124
- The WASM runtime owns all gate decisions. Your host receives the decision and acts on it. Nothing executes inside the runtime.
68
+ LBE asks a stricter question:
69
+
70
+ ```text
71
+ Is this exact action allowed to reach the filesystem or terminal, and can we prove what happened?
72
+ ```
125
73
 
126
74
  ---
127
75
 
128
- ## When a request is approved
76
+ ## Local state and proof
129
77
 
130
- ![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)
78
+ LBE keeps state locally in a central per-user state folder. Each workspace has a stable workspace ID and its own event log.
131
79
 
132
- 1. The agent produces a signed action proposal.
133
- 2. Identity is confirmed against a locally held key — no network call required.
134
- 3. The project policy is evaluated. The action is approved.
135
- 4. The host executes the write or command inside the allowed workspace.
136
- 5. The audit chain is extended — every approved action appends a hash-linked entry to the local log, permanently verifiable, impossible to silently remove.
137
- 6. A structured result returns: whether it succeeded, which rules matched, and the audit entry identifier.
80
+ In v1.3, an existing `.lbe/events.jsonl` remains local fallback truth and is imported into central state once. The source file is preserved.
138
81
 
139
- The application stays in control. @letterblack/lbe-core decides whether the action was permitted and hands the answer back. It does not execute for you.
82
+ Proof combines:
140
83
 
141
- ---
84
+ ```text
85
+ intent
86
+
87
+ target
88
+
89
+ file-index before action
90
+
91
+ LBE audit event
92
+
93
+ file-index after action
94
+
95
+ proof/latest.json
96
+ ```
142
97
 
143
- ## When a request is blocked
98
+ Proof results:
144
99
 
145
- ![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)
100
+ | Result | Meaning |
101
+ |---|---|
102
+ | `PASS` | Evidence is complete and actual changes match declared intent |
103
+ | `FAIL` | Evidence violates intent, policy, or expected file changes |
104
+ | `WEAK_PROOF` | Target evidence was uncertain or required user confirmation |
105
+
106
+ Use:
146
107
 
147
- 1. The agent proposes an action that is outside the permitted policy.
148
- 2. The policy gate closes immediately. The WASM runtime stamps the request denied before any adapter is reached.
149
- 3. The shell is untouched. The filesystem is unchanged.
150
- 4. The denial is written to the immutable audit log — chain sealed, evidence preserved.
108
+ ```bash
109
+ npx lbe proof --public
110
+ ```
151
111
 
152
- No partial execution. No silent failures. Denial is a first-class outcome, not an error.
112
+ for a redacted proof summary. Public proof redacts private paths, raw internal IDs, full diffs, hashes, and sensitive failure details.
153
113
 
154
114
  ---
155
115
 
156
- ## What this covers
116
+ ## What ships
157
117
 
158
- | Threat | Gate |
159
- |---|---|
160
- | Malformed or incomplete request | Schema |
161
- | Stale or replayed request | Timestamp + Nonce |
162
- | Tampered or expired key | Key lifecycle + Signature |
163
- | Excessive requests from one actor | Rate limit |
164
- | Action not permitted by project policy | Policy — deny-wins |
165
- | Agent writing outside project root | Scope check in host after decision |
118
+ The npm package ships the packaged runtime boundary, not the private source tree.
119
+
120
+ ```text
121
+ bin/lbe.js CLI shim
122
+ dist/cli/lbe.js Bundled CLI runtime
123
+ dist/hooks/register.cjs Hook preload runtime
124
+ dist/state/index.cjs Packaged CJS state resolver
125
+ dist/state/appendCentral.cjs Packaged central JSONL append helper
126
+ README.md
127
+ Release-README.md
128
+ CHANGELOG.md
129
+ LICENSE
130
+ package.json
131
+ ```
132
+
133
+ The npm package must not include private implementation folders such as `src/core/**`, tests, local `.lbe/**` state, AppData state, diagnostic helpers, private keys, or workspace-local proof artifacts.
166
134
 
167
135
  ---
168
136
 
169
- ## What ships
137
+ ## Limits
170
138
 
171
- ```
172
- dist/index.js WebAssembly runtime loader and execute()
173
- dist/cli.js Local CLI (npx lbe)
174
- dist/lbe_engine.wasm Verified runtime binary
175
- dist/wasm.lock.json Runtime integrity lock (SHA-256 of wasm binary)
176
- assets/lbe-gates.jpg Gate sequence diagram
177
- assets/story-allow.jpg Approved-request storyboard
178
- assets/story-deny.jpg Blocked-request storyboard
179
- assets/runtime-boundary.svg Runtime boundary diagram
180
- assets/lbe-gates.png Gate sequence diagram (full resolution)
181
- assets/story-allow.png Approved-request storyboard (full resolution)
182
- assets/story-deny.png Blocked-request storyboard (full resolution)
183
- types.d.ts TypeScript declarations
184
- ```
139
+ LBE controls only actions routed through its execution boundary.
140
+
141
+ It does not provide:
185
142
 
186
- 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.
143
+ - kernel-level process isolation
144
+ - network-egress control
145
+ - multi-tenant separation
146
+ - hosted monitoring
147
+ - universal control over tools outside LBE's execution boundary
187
148
 
188
- Source code, controller implementation, adapters, tests, keys, and runtime state are not included.
149
+ Central writes are best-effort. Local logs remain local.
189
150
 
190
151
  ---
191
152
 
192
- ## Limits
193
-
194
- 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.
153
+ ## Release status
154
+
155
+ Current aligned release:
156
+
157
+ ```text
158
+ @letterblack/lbe-core@1.3.3
159
+ ```
160
+
161
+ Earlier `1.3.0`, `1.3.1`, and `1.3.2` builds are superseded by `1.3.3`.
162
+
163
+ ---
164
+
165
+ ## One-sentence summary
166
+
167
+ LBE Core does not make the agent smarter. It makes the agent's execution path controlled, evidence-backed, and locally auditable.
@@ -0,0 +1,110 @@
1
+ # LBE Release Workspace Rules
2
+
3
+ This file defines what can and cannot be used as LBE release proof.
4
+
5
+ ## Release authority boundary
6
+
7
+ Only the designated LBE release workspace may certify LBE release safety.
8
+
9
+ A downstream project, integration lab, copied repository, downloaded folder, worktree, or consumer app is not release authority for LBE.
10
+
11
+ Consumer projects may prove only their own integration behavior with the installed LBE package.
12
+
13
+ They must not claim:
14
+
15
+ - LBE release-ready
16
+ - LBE published
17
+ - full LBE proof passed
18
+ - npm/GitHub release alignment
19
+ - package release correctness
20
+
21
+ ## Consumer dependency rule
22
+
23
+ Other projects must consume LBE as an installed package dependency from the public registry.
24
+
25
+ Allowed consumer model:
26
+
27
+ ```bash
28
+ npm install @letterblack/lbe-core
29
+ npx lbe init
30
+ npx lbe status
31
+ npx lbe proof --public
32
+ ```
33
+
34
+ Do not use a copied LBE source tree as the authority for consumer projects.
35
+
36
+ Do not point consumer projects at LBE through:
37
+
38
+ - `file:`
39
+ - `link:`
40
+ - `workspace:`
41
+ - `git+`
42
+ - `github:`
43
+ - local relative paths
44
+ - local absolute paths
45
+ - symlinked `node_modules` packages
46
+
47
+ ## assert-consumer rule
48
+
49
+ `npx lbe assert-consumer` is a downstream consumer-safety guard.
50
+
51
+ It answers:
52
+
53
+ - Is this project using `@letterblack/lbe-core` as an installed dependency?
54
+ - Is this project accidentally pointing at a copied source tree, workspace link, git dependency, local path, or symlink?
55
+
56
+ It must always report consumer status only.
57
+
58
+ It is not release proof.
59
+
60
+ It is not package provenance proof.
61
+
62
+ It is not a substitute for:
63
+
64
+ - full test suite
65
+ - `npm run proof`
66
+ - package runtime verification
67
+ - packed tarball inspection
68
+ - npm `gitHead` check
69
+ - GitHub tag alignment
70
+ - GitHub Release verification
71
+ - fresh install smoke from the registry
72
+
73
+ Expected classification for a valid consumer project:
74
+
75
+ ```txt
76
+ consumer-project-using-installed-registry-dependency
77
+ releaseClaimsAllowed: false
78
+ ```
79
+
80
+ If a project passes `assert-consumer`, the only valid conclusion is:
81
+
82
+ ```txt
83
+ This project consumes LBE from an installed package dependency.
84
+ This does not certify LBE release safety.
85
+ ```
86
+
87
+ ## Hard stop conditions
88
+
89
+ Stop and report if:
90
+
91
+ - a consumer project is used to certify an LBE release
92
+ - focused integration tests are used as release proof
93
+ - a copied/lab workspace is treated as package authority
94
+ - local path, git, workspace, or symlink dependencies are used for LBE in a consumer project
95
+ - release claims are made without npm/GitHub/package provenance checks
96
+
97
+ ## Agent report format
98
+
99
+ Before making any LBE-related release claim, report:
100
+
101
+ ```txt
102
+ Workspace classification:
103
+ - Path:
104
+ - Type: LBE release workspace / consumer project / local lab / copied workspace / unknown
105
+ - npm run proof available: yes/no
106
+ - full suite exit code:
107
+ - release claims allowed: yes/no
108
+ ```
109
+
110
+ If the workspace is a consumer project, local lab, copied workspace, or unknown, release claims are not allowed.
@@ -0,0 +1,65 @@
1
+ # @letterblack/lbe-core
2
+
3
+ LBE is local execution control for AI agents. It evaluates file and shell
4
+ actions routed through its execution boundary, records local evidence, and
5
+ returns an allow/deny outcome before the governed action runs.
6
+
7
+ This release documents the decision-only package. If you need the in-process
8
+ controller that performs governed file and shell operations, that is a separate
9
+ legacy/internal surface.
10
+
11
+ ## Install and start
12
+
13
+ ```bash
14
+ npm install @letterblack/lbe-core
15
+ npx lbe init
16
+ npx lbe status
17
+ npx lbe logs
18
+ npx lbe proof --public
19
+ npx lbe open-state
20
+ ```
21
+
22
+ `init` creates project policy material. `status` shows the local central state
23
+ for the current workspace; `logs` reads its event history; `proof` shows the
24
+ latest proof result; and `open-state` opens the central state folder.
25
+
26
+ ## Local state and proof
27
+
28
+ LBE keeps state locally in a central per-user state folder. Each workspace has
29
+ a stable workspace ID and its own event log. In v1.3, an existing
30
+ `.lbe/events.jsonl` remains local fallback truth and is imported into central
31
+ state once; the source file is preserved.
32
+
33
+ Proof combines an intent, optional target, file index, LBE events, and
34
+ `proof/latest.json`. Use `lbe proof --public` for a redacted proof summary.
35
+ Non-inspectable targets can produce `WEAK_PROOF` rather than a stronger claim.
36
+
37
+ ## CLI reference
38
+
39
+ | Command | Purpose |
40
+ |---|---|
41
+ | `npx lbe init` | Create project-local policy and key state |
42
+ | `npx lbe status` | Show workspace ID and central state paths |
43
+ | `npx lbe logs` | Read the central event history |
44
+ | `npx lbe open-state` | Open the local central state folder |
45
+ | `npx lbe proof` | Show the latest proof result |
46
+ | `npx lbe proof --public` | Show a redacted proof summary |
47
+
48
+ ## What ships
49
+
50
+ ```
51
+ bin/lbe.js CLI entrypoint
52
+ dist/cli/lbe.js Packaged CLI runtime
53
+ dist/hooks/register.cjs Packaged hook bridge
54
+ dist/state/index.cjs Packaged central-state resolver
55
+ dist/state/appendCentral.cjs Packaged central event appender
56
+ ```
57
+
58
+ Source code, controller implementation, adapters, tests, keys, and runtime
59
+ state are not included.
60
+
61
+ ## Limits
62
+
63
+ Only actions routed through LBE are controlled. Central writes are best-effort,
64
+ logs remain local, and LBE does not provide process isolation or network
65
+ egress control.