@onedotmint/charterleaf 0.2.1 → 0.4.0

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.
package/AGENTS_SNIPPET.md CHANGED
@@ -1,29 +1,34 @@
1
- # Charterleaf instructions
2
-
3
- Project specifications live under `specs/`. For non-trivial architectural, behavioral, or cross-cutting changes, find the smallest relevant set; never read the whole tree by default.
4
-
5
- - `specs/capabilities/` — durable behavior, contracts, invariants, non-goals.
6
- - `specs/engineering/` — durable implementation constraints and concrete recurring pitfalls.
7
- - `specs/decisions/` — important architectural choices and revisit conditions.
8
- - `specs/changes/` — lightweight active deltas.
9
- - `specs/constitution.md` — project-wide guardrails only.
10
-
11
- When a concrete code path is known, use `charterleaf related <path>` to locate matching living specs plus active changes that affect them. When the relevant code path is not yet known, use `charterleaf map` only to discover available specification scopes; do not read every listed specification. Use normal code navigation to locate the smallest relevant area, then use `charterleaf related <path>`. For broad project-level questions, start with normal project entry documents; do not expand into every spec or project-state document merely because no path was provided. Use `charterleaf lint` for structural validation and mechanical active-change conflicts. These commands are helpers, not workflow gates.
12
-
13
- Authority is `Constitution > Active Change > Living Spec > Current Code`. Do not add authority scores or silently rewrite specs to match code.
14
-
15
- Keep specs compressed and evidence-based. Prefer durable contracts and pitfalls over commentary. Do not invent aspirational standards that are not demonstrated by the repo or explicitly accepted.
16
-
17
- Do not create specs for temporary implementation details, current tasks, debugging notes, routine refactors, or trivial fixes with no durable implication. For a durable bug fix, use `Current` / `Expected` when useful and explicitly state what must `PRESERVE`.
18
-
19
- After non-trivial implementation or debugging, consider whether durable project knowledge was discovered. If so, record only the durable result:
20
-
21
- - observable behavior, contract, invariant, or non-goal → capability spec;
22
- - long-lived implementation constraint, boundary, recurring pitfall, or required verification practice → engineering spec;
23
- - important architectural choice, rationale, or revisit condition → decision.
24
-
25
- If nothing durable was learned, do not modify specs. Do not record current task status, implementation progress, temporary debugging notes, one-off commands, session history, Todo items, or transient observations. Specs accumulate durable project knowledge, not development activity.
26
-
27
- For meaningful durable behavior/contract changes, use one change file with only the needed `ADD`, `MODIFY`, `REMOVE`, and/or `PRESERVE` sections. After acceptance and implementation, merge durable results into living specs and delete the change file. Git is the history.
28
-
29
- Charterleaf is a knowledge layer, not a workflow layer. It must not manage tasks, planning, agents, execution, review, memory, compression, semantic search, code/spec verification, release lifecycle, or Git history.
1
+ # Project References
2
+
3
+ Use this file as the project navigation entry.
4
+ Document where authoritative information lives — project state,
5
+ validation, resources, history, and other project-specific sources.
6
+
7
+ Source code owns implementation, tests own executable verification,
8
+ `AGENTS.md` owns navigation, and `specs/` owns durable constraints. Read
9
+ these authoritative owners progressively; stop when sufficient. Keep one
10
+ owner per fact and link to it rather than duplicating it.
11
+
12
+ Charterleaf automation is explicit opt-in, not implied by this entry or
13
+ by an existing `specs/` directory. In Pi, the user chooses Auto, Confirm,
14
+ Reference or Not Enable through `/charterleaf`; the saved project mode in
15
+ `specs/.charterleaf.json` controls automation. Missing config or `off`
16
+ means no automatic scan, adoption prompt or document creation. Do not
17
+ change activation config on the user's behalf.
18
+
19
+ For manual use on a concrete repository path, run from the project root:
20
+
21
+ charterleaf related <path>
22
+
23
+ Read the returned constraints. A routing miss is not proof that none
24
+ apply. The manual CLI remains available independently of Pi and its mode
25
+ config; run `charterleaf lint` after spec edits (structural checks only).
26
+
27
+ With automation enabled, use supplied constraints or explicitly read the
28
+ named specs before retrying a gated write/edit. Use standard `write`/`edit`
29
+ for spec changes: Confirm requires each approval; Reference allows no
30
+ spec changes. Do not bypass these cooperative checks with Bash or another
31
+ writer. No durable change means no spec edit; never relax a spec merely
32
+ to accommodate conflicting code. Preserve user/parallel work and keep
33
+ state, plans, evidence and history in their existing authoritative owners,
34
+ not in a new Charterleaf workflow.
package/README.md CHANGED
@@ -1,55 +1,234 @@
1
1
  # Charterleaf
2
2
 
3
- A tiny specification layer for coding agents.
3
+ A lightweight agent-native constraint layer for coding agents.
4
+
5
+ **Code is implementation. Tests are verification. Specs are durable constraints.
6
+ Charterleaf connects them.**
7
+
8
+ Given a concrete repository path, Charterleaf answers one question:
9
+
10
+ > Which durable constraints should I read before touching this code?
4
11
 
5
12
  Durable project intent, deterministic routing, and structural linting —
6
- without workflow orchestration.
13
+ with opt-in native Pi integration, without workflow orchestration.
7
14
 
8
- > **Keep project intent in the repo, without turning specs into a workflow.**
15
+ ## Two layers
9
16
 
10
- Charterleaf keeps durable project knowledge in Markdown and provides exactly three deterministic helpers:
17
+ Charterleaf sits beside a project's own navigation, not on top of it.
11
18
 
12
- ```bash
13
- charterleaf map
14
- charterleaf related <path>
15
- charterleaf lint
16
- ```
19
+ - **A project reference protocol** — a tracked `AGENTS.md` entry plus
20
+ the project's own documents — tells an agent *where* authoritative
21
+ information lives: current state, validation, resources, history,
22
+ source roots.
23
+ - **Charterleaf** tells an agent *which durable constraints* matter when
24
+ work lands on a specific repository path.
17
25
 
18
- It is a knowledge layer, not a workflow framework.
26
+ Charterleaf complements project navigation; it does not replace
27
+ project-owned sources of state, evidence, or workflow. It stores and
28
+ routes durable constraints; it never becomes the owner of a fact that
29
+ belongs to a project file.
19
30
 
20
31
  ## Install
21
32
 
22
- Install the public scoped npm package:
33
+ Install once in Pi to discover the bundled Extension and Skill:
23
34
 
24
35
  ```bash
25
- npm install -g @onedotmint/charterleaf
36
+ pi install npm:@onedotmint/charterleaf
26
37
  ```
27
38
 
28
- Pi can install the same package and discover its bundled Agent Skill:
39
+ **v0.4 is not yet published.** Until publication, install the local package
40
+ with `pi install /absolute/path/to/charterleaf` (a package directory, not a
41
+ `.tgz` file). For the standalone CLI, pack with `npm pack`, then use `npm install -g ./onedotmint-charterleaf-0.4.0.tgz`; after publication,
42
+ use `npm install -g @onedotmint/charterleaf`.
29
43
 
30
- ```bash
31
- pi install npm:@onedotmint/charterleaf
44
+ Restart Pi or run `/reload` after installation, then use `/charterleaf` in each
45
+ project you want to enable. To stop automation, choose **Not Enable** in that
46
+ menu. To remove the global package, use `pi remove npm:@onedotmint/charterleaf`
47
+ (or the same local directory source used for installation); project docs remain.
48
+
49
+ A Pi-only install needs no second global npm install: the Extension calls Core
50
+ directly and supplies the bundled CLI entry point for optional manual checks.
51
+
52
+ The **Core/CLI** runs standalone on Node.js **20+**, has no dependencies,
53
+ and requires no Pi. The **Pi Extension** is tested against
54
+ `@earendil-works/pi-coding-agent` **1.1.0** and uses `agent_before_settle`:
55
+ it requires a host with that compatible Extension API, not just any Pi
56
+ version. That Pi host requires Node.js **22.19.0+**; the Core's lower
57
+ minimum does not make older Node versions suitable for the host.
58
+
59
+ ## Native Pi modes
60
+
61
+ Run `/charterleaf` in Pi for the native project mode menu:
62
+
63
+ | Choice | Behavior |
64
+ | --- | --- |
65
+ | **Auto** (recommended) | Read constraints; maintain only justified durable knowledge. |
66
+ | **Confirm** | Read automatically; approve each exact standard spec write/edit. |
67
+ | **Reference** | Read and check; report proposals or conflicts, never modify specs. |
68
+ | **Not Enable** | Turn automation off; keep existing documents. |
69
+
70
+ The choice is saved immediately in `specs/.charterleaf.json`:
71
+
72
+ ```json
73
+ { "version": 1, "mode": "off" }
32
74
  ```
33
75
 
34
- No Pi extension or Pi runtime dependency is used.
76
+ Valid modes are `auto`, `confirm`, `reference`, and `off`. Missing config
77
+ means **off**; existing `specs/` alone never enables automation. Activation
78
+ is an explicit user choice, not an Agent decision. Enabling creates only
79
+ this config (and its directory if needed), not a constitution or a pile
80
+ of spec documents. Disabling preserves documents; cancel changes nothing.
81
+ Disabled/unconfigured projects get no automatic adoption prompt, task
82
+ context, scan, or document bootstrap. Manual CLI use is independent of
83
+ this config.
84
+
85
+ Without UI, saved Auto and Reference modes still read/check constraints;
86
+ Confirm denies spec mutations because approval is unavailable. A refused identical
87
+ proposal does not reopen an approval dialog in the same task; a new user task
88
+ can make a fresh proposal. The
89
+ `/charterleaf` menu does nothing without UI.
90
+
91
+ ## Architecture and task behavior
92
+
93
+ - **Core** (`lib/charterleaf.js`) exports `resolveRelated` for structured
94
+ deterministic routing shared with the CLI. This adds no CLI command
95
+ and requires no spec-format migration.
96
+ - **Extension** (`extensions/charterleaf.js`, with `lib/project.js`) uses
97
+ native command, task/context, tool-call/result, compaction and settlement
98
+ hooks for opt-in loading, write gates, mode approval and a final review.
99
+ - **Skill** (`skills/charterleaf/SKILL.md`) supplies semantic judgment and
100
+ maintenance discipline. It is not a deterministic semantic validator.
101
+
102
+ For known paths, standard `read` results carry the applicable constraint
103
+ bodies without replacing the original result. A standard code `write` or
104
+ `edit` with unseen constraints is blocked, carrying the constraints or
105
+ an explicit read request. Read and assess them, then retry; do not evade
106
+ this gate via Bash. Delivery counts as loaded only at the **next model
107
+ request**, not when a parallel sibling tool finishes.
108
+
109
+ Automatic spec bodies have a **24,000-byte budget per task** and an
110
+ **8,000-byte per-file limit**. Larger files or exhausted budgets require
111
+ an explicit complete `read`; a partial/truncated read is not full
112
+ knowledge. Native Pi offset pages are credited only when their exact content
113
+ covers the same spec version with no gaps; ordinary prose about truncation does
114
+ not count as a tool truncation notice. On a scoped miss, the Extension supplies metadata only for
115
+ available living specs, capped at 12 entries and 2,000 characters;
116
+ `charterleaf related <path>` provides the full routing list. A miss never
117
+ proves that no constraints apply.
118
+
119
+ Compact rules from `skills/charterleaf/runtime.md` are supplied once per
120
+ project/session branch; the full `SKILL.md` authoring/CLI guide stays on demand.
121
+ Each task adds only its current mode/root. Same-version spec bodies already
122
+ seen in the retained branch are reused across tasks, while ownership, Git
123
+ baseline and body budget are reset per task. Switching branches or compaction
124
+ clears context-delivery bookkeeping.
125
+ Routing is recomputed through Core for each concrete path check, so new scopes
126
+ and changed globs are not hidden by stale routing caches. Changed spec content
127
+ requires fresh delivery; successful standard spec writes invalidate loaded state.
128
+ Compaction invalidates loaded context so constraints must be delivered
129
+ again. This is task-local bookkeeping, not a watcher or persistent index.
130
+
131
+ At successful, actionable `agent_before_settle`, the Extension may request
132
+ **at most one final semantic review per task** after development. It
133
+ separates successful standard-tool paths whose observed content is still
134
+ unchanged from **unattributed** changes observed against the task's Git
135
+ baseline. Neither a touched file nor a dirty worktree proves ownership
136
+ of every line. Preserve existing user dirt and parallel work; unattributed
137
+ changes alone must not justify spec edits. No automatic revert, stage,
138
+ commit or push is performed.
139
+
140
+ **No durable knowledge means no spec edit.** Keep only established,
141
+ non-obvious, mistake-preventing contracts, invariants, boundaries,
142
+ pitfalls or accepted decisions — not code summaries or task logs. A
143
+ code/spec conflict is not permission to accommodate incorrect code:
144
+ distinguish implementation bugs, authoritatively obsolete specs and
145
+ explicitly intended contract changes. When uncertain, preserve the spec
146
+ and report the conflict. This review does not start an independent
147
+ workflow or another development cycle.
35
148
 
36
149
  ## CLI
37
150
 
38
- Run from a repository root containing `specs/`:
151
+ Charterleaf exposes exactly two deterministic commands. Run them from a
152
+ repository root containing `specs/`:
39
153
 
40
154
  ```bash
41
- charterleaf map
42
- charterleaf related src/auth/session.ts
155
+ charterleaf related <path>
43
156
  charterleaf lint
44
157
  ```
45
158
 
46
- `map` shows a deterministic, lightweight index of the `specs/` layer when a relevant code path is not yet known. It lists specification scopes and metadata only; it does not summarize specs or recommend what to read. Use normal code navigation to find the smallest relevant area, then use `related <path>`.
159
+ There is no `map` command. Discovery is handled by a scoped miss (below)
160
+ and by the project's own reference protocol.
47
161
 
48
- `related <path>` performs deterministic path routing. It matches `applies_to` with `*` and `**`, normalizes repo-relative paths to POSIX form, then appends active changes whose `affects` reference a matched Spec ID. Output is stable; no match is success. It is not semantic search.
162
+ ### related \<path\>
49
163
 
50
- `lint` performs mechanical checks only: frontmatter shape, living Spec IDs, duplicate requirement IDs, change references, static `ADD` / `MODIFY` / `REMOVE` references, and conflicting active changes that touch the same requirement ID. It does not judge wording, architecture quality, or semantic code/spec drift.
164
+ Routes the supplied repo-relative path (`/` or `\` separators) to durable
165
+ constraints:
166
+
167
+ - `specs/constitution.md` is **Global**: returned whenever it exists,
168
+ regardless of frontmatter. It needs no `id` and no `applies_to`.
169
+ - `capabilities/` and `engineering/` specs are **Scoped**: returned when
170
+ any `applies_to` glob matches.
171
+ - Active changes whose `affects` reference a matched spec id are appended
172
+ under `Active changes`.
173
+
174
+ ```text
175
+ Global
176
+ specs/constitution.md
177
+
178
+ Scoped
179
+ specs/capabilities/auth.md
180
+ ```
51
181
 
52
- The frontmatter convention intentionally supports only top-level scalar values and simple string lists. Runtime dependencies remain zero.
182
+ `applies_to` is a deterministic routing hint, not a completeness proof.
183
+ "No match" only ever means "no living spec's `applies_to` glob matched
184
+ this path" — never "no constraints apply". When nothing matches, the
185
+ command states that explicitly and lists available living specs by `id`,
186
+ path, and `applies_to` only, so discovery stays possible without reading
187
+ every spec:
188
+
189
+ ```text
190
+ Global
191
+ specs/constitution.md
192
+
193
+ Scoped
194
+ No applies_to glob matched this path.
195
+
196
+ Available living specs
197
+ auth.session
198
+ specs/capabilities/auth.md
199
+ applies_to: src/auth/**
200
+
201
+ engineering.backend
202
+ specs/engineering/backend.md
203
+ applies_to: src/**/*.ts
204
+ ```
205
+
206
+ `related` never inspects the filesystem for the supplied path; it accepts
207
+ the caller's repo-relative string. A scoped miss is success (exit code
208
+ 0), not an error.
209
+
210
+ ### lint
211
+
212
+ ```bash
213
+ charterleaf lint
214
+ ```
215
+
216
+ `lint` performs mechanical structural checks only: frontmatter shape,
217
+ living Spec IDs, required `applies_to` on living specs, duplicate spec
218
+ and requirement IDs, change references, static `ADD` / `MODIFY` /
219
+ `REMOVE` references, changes whose `ADD` / `MODIFY` / `REMOVE` sections
220
+ are all empty (HTML comments do not count), and conflicting active
221
+ changes that touch the same requirement ID. Success prints
222
+ `0 structural errors`.
223
+
224
+ `lint` does **not** verify:
225
+
226
+ - semantic correctness;
227
+ - code/spec agreement;
228
+ - routing coverage;
229
+ - project compliance;
230
+ - whether a change is actually complete;
231
+ - whether an Agent read the specs.
53
232
 
54
233
  ## Project knowledge
55
234
 
@@ -62,59 +241,152 @@ specs/
62
241
  └── changes/
63
242
  ```
64
243
 
65
- - `constitution.md` — rare project-wide guardrails.
66
- - `capabilities/` — durable behavior, contracts, invariants, non-goals.
67
- - `engineering/` — durable implementation constraints and, when useful, concrete pitfalls.
68
- - `decisions/` — why an important architectural choice exists.
69
- - `changes/` — a lightweight active delta for an intentional durable change.
244
+ - `constitution.md` — rare project-wide durable boundaries. Global
245
+ constraint; not routed by `applies_to`.
246
+ - `capabilities/` — durable observable behavior, contracts, invariants,
247
+ non-goals.
248
+ - `engineering/` — durable implementation boundaries, long-lived
249
+ constraints, recurring pitfalls, verification practice.
250
+ - `decisions/` — important architectural rationale and revisit
251
+ conditions.
252
+ - `changes/` — optional staging for an accepted but not-yet-implemented
253
+ contract. See below.
70
254
 
71
- Authority is structural, not scored metadata:
255
+ ## Writing specs
72
256
 
73
- ```text
74
- Constitution > Active Change > Living Spec > Current Code
75
- ```
257
+ A spec records a constraint whose absence would plausibly cause a future
258
+ developer or agent to make a wrong decision. It should be non-obvious,
259
+ durable, **already true**, and mistake-preventing. Good fits: contracts,
260
+ invariants, architecture boundaries, non-goals, recurring pitfalls,
261
+ accepted rationale, verification constraints.
76
262
 
77
- Keep specs compressed and evidence-based. Prefer contracts over commentary and record durable pitfalls that code alone does not reveal. Do not invent aspirational standards merely to make a spec look complete.
263
+ Do not write specs for current state, future design, aspirations, todos,
264
+ implementation plans, session notes, progress, temporary debugging,
265
+ navigation, or history. What you hope to become is a plan, not a living
266
+ spec.
78
267
 
79
- For bug fixes with durable behavioral implications, clarify `Current`, `Expected`, and `PRESERVE` when that reduces accidental scope. Do not create a spec for trivial fixes with no durable implication.
268
+ ## changes/ is optional staging
80
269
 
81
- After non-trivial implementation or debugging, record only genuinely durable knowledge: behavior, contracts, invariants, and non-goals in capabilities; long-lived constraints, boundaries, pitfalls, or verification practices in engineering; and important architectural choices in decisions. If nothing durable was learned, do not modify specs. Specs accumulate durable project knowledge, not development activity.
270
+ Use `specs/changes/<name>.md` only when an accepted future contract must
271
+ temporarily coexist with current living reality — for example when
272
+ implementation happens in another session or by another agent, human
273
+ review comes first, or a multi-step migration is underway. A change must
274
+ contain at least one of `ADD`, `MODIFY`, `REMOVE`; `PRESERVE` alone is
275
+ not a change.
82
276
 
83
- Load the smallest relevant set; do not read the whole tree by default. After an accepted change is implemented, merge the durable result into living specs and delete the change file. Git is the history.
277
+ Otherwise, implement, verify, and update the living spec if durable truth
278
+ changed. After an accepted change is implemented, merge the durable
279
+ result into living specs and delete the change file. Git keeps history.
84
280
 
85
- ## Other agents
281
+ ## Agent conventions
86
282
 
87
- Charterleaf core does not depend on Pi. Any coding agent capable of reading Markdown and executing shell commands can use it.
283
+ The complete Agent convention lives in
284
+ [`skills/charterleaf/SKILL.md`](skills/charterleaf/SKILL.md): adoption
285
+ and ownership, progressive retrieval, `related` and `lint` semantics,
286
+ mode behavior, spec writing discipline, and durable learning.
88
287
 
89
- Use `AGENTS_SNIPPET.md` with agents that support project instructions. Agent Skills-compatible harnesses can use the bundled `skills/charterleaf/SKILL.md`.
288
+ For agents that read project instructions, the minimal reference
289
+ bootstrap is [`AGENTS_SNIPPET.md`](AGENTS_SNIPPET.md).
90
290
 
91
- ## Boundaries
92
-
93
- Charterleaf has no:
291
+ Charterleaf core does not depend on Pi. Any coding agent that can read
292
+ Markdown and run shell commands can use it.
94
293
 
95
- - planning
96
- - task management
97
- - agent orchestration
98
- - implementation or review workflow
99
- - session memory or context compression
100
- - semantic search or embeddings
101
- - code/spec semantic verification
102
- - database, index, or cache
103
- - daemon or background watcher
104
- - plugin/extension runtime
105
- - Git/history abstraction
294
+ ## Boundaries
106
295
 
107
- The three CLI commands are helpers, not workflow gates.
296
+ Charterleaf has no project state/task system, planning or workflow
297
+ orchestration, memory/evidence/history management, scope/owner registry,
298
+ project bootstrap command, semantic search/embeddings, coverage analyzer,
299
+ database, persistent index, daemon, watcher or independent AI service.
300
+ The Extension uses the host lifecycle and lightweight Git snapshots;
301
+ it does not become a session manager or Git workflow.
302
+
303
+ Important limits:
304
+
305
+ - Bash, external writers and opaque/custom tools cannot be fully
306
+ intercepted. Reference and Confirm are **not security sandboxes**;
307
+ use standard `write`/`edit` for all spec changes.
308
+ - In non-Git projects, standard-tool observations still work, but opaque
309
+ changes cannot be reliably discovered or attributed; final review falls
310
+ back to conversation evidence. Git snapshots do not detect gitignored
311
+ files; standard tool observations can still identify directly touched
312
+ paths. Neither mechanism proves ownership of all content.
313
+ - Custom/nested tool integrations depend on compatible host forwarding
314
+ and queue support. Where supported, constraint notes must survive into
315
+ the model-visible result while original content, images and structured
316
+ results are preserved. Do not assume every custom envelope does this;
317
+ read large specs directly with standard `read` and offset pages rather than relying on
318
+ a nested wrapper that can hide or truncate their bodies.
319
+ - `lint` checks structure only. Skill-guided reviews are model judgments
320
+ and may misjudge relevance, durable value or a conflict; neither proves
321
+ semantic correctness or compliance.
322
+ - Paths support repo-relative or same-project absolute paths, `/` or `\`
323
+ separators, Pi's `@path`/`file://` aliases, and Windows drive paths mapped
324
+ to `/mnt/<drive>/` on WSL. Enabled standard tools execute the normalized
325
+ path that was checked; spec authorization also preserves the original path's
326
+ protected identity when a spec symlink points elsewhere inside the project.
327
+ Foreign UNC paths are not interpreted as local paths; symlink escapes are
328
+ rejected for project spec writes. Native Windows behavior needs platform testing.
329
+ - `related` has no filesystem awareness of the supplied target path and
330
+ no proof of routing coverage. Task-local hashes are not a continuous
331
+ monitor of external changes. A single spec line larger than Pi's read byte
332
+ limit cannot be credited as read; do not keep retrying or bypass the gate —
333
+ report it and ask for readable formatting or a user-chosen mode change.
334
+ Files over 2 MiB use coarse size/mtime fingerprints;
335
+ Git checks exceeding 500 changed/untracked entries fall back to conversation
336
+ evidence instead of scanning a large worktree.
337
+
338
+ The two CLI commands remain helpers, not workflow gates. Native tool
339
+ gates apply only to the opt-in Pi integration, within the limits above.
108
340
 
109
341
  ## Development
110
342
 
111
- Requires Node.js 20 or newer. There are no runtime or development dependencies and no build step.
343
+ Core development requires Node.js 20 or newer; there are no runtime or
344
+ development dependencies and no build step. Use the higher Node/host
345
+ requirements above for Pi smoke checks.
346
+
347
+ Verification commands:
112
348
 
113
349
  ```bash
114
350
  npm test
351
+ npm run test:pi # requires compatible Pi on PATH; isolated RPC UI smoke, no model calls
352
+ node --test tests/extension.test.js
115
353
  npm pack --dry-run
354
+ node bin/charterleaf.js related extensions/charterleaf.js
355
+ node bin/charterleaf.js lint
116
356
  ```
117
357
 
358
+ Validated on Node.js 24.21.0 and Pi 1.1.0: 149 automated Core/Extension tests,
359
+ structural lint, dry-run npm packaging, and real Pi RPC loading/native selection
360
+ for cancellation, mode changes, disable and cross-process restore. The RPC smoke
361
+ uses isolated temporary projects/settings and makes no model calls.
362
+
363
+ Independent acceptance also exercised real `openai/gpt-5.6-terra` sessions in
364
+ isolated Git projects: ordinary refactors, intentional API updates, durable
365
+ rounding knowledge, conflicts, all three modes, no-UI Confirm, parallel nested
366
+ tools, oversized specs, dirty/concurrently modified files, Bash writes and
367
+ invalid metadata. Evidence was checked against tool results and file diffs,
368
+ not assistant claims. These bounded examples do not prove model reliability
369
+ on every task or provider. The original activation message measured 8,450 UTF-8
370
+ bytes (8.25 KiB), mostly the full Skill; it was not all native Pi context or a
371
+ Token count. After the dedicated context audit, compact rules plus activation
372
+ measure about 2 KiB: in a controlled first-request comparison the Charterleaf
373
+ increment fell from 1,720 to 403 provider input tokens, with identical native
374
+ prompt/tools. Smaller total context does not guarantee the same reduction in
375
+ uncached input charges: cache-hit sizes vary. Substantive work still requests
376
+ at most one extra model review. A model
377
+ initially misreported a blocked edit as completed; clearer error text corrected
378
+ the observed regression, but final claims still need independent verification.
379
+
380
+ For an interactive smoke check in a disposable project, install the local
381
+ package in a compatible Pi host and run `/charterleaf`: check immediate
382
+ mode persistence, cancel/disable preserving documents, constraint loading
383
+ on a standard read, a blocked unseen-constraint write followed by retry,
384
+ Confirm approve/refuse, and Reference denying spec writes. After a
385
+ substantive edit, check that at most one final review occurs and that no
386
+ durable change leaves specs untouched. Also check saved modes without UI:
387
+ Auto/Reference still read, Confirm denies spec writes, and the menu is
388
+ inactive. Automated hook tests do not substitute for this real-host smoke.
389
+
118
390
  ## License
119
391
 
120
392
  MIT
File without changes