@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 +34 -29
- package/README.md +327 -55
- package/bin/charterleaf.js +0 -0
- package/extensions/charterleaf.js +314 -0
- package/lib/charterleaf.js +84 -112
- package/lib/project.js +142 -0
- package/package.json +10 -4
- package/skills/charterleaf/SKILL.md +20 -41
- package/skills/charterleaf/runtime.md +11 -0
- package/templates/change.md +10 -0
package/AGENTS_SNIPPET.md
CHANGED
|
@@ -1,29 +1,34 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
|
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
|
-
|
|
15
|
+
## Two layers
|
|
9
16
|
|
|
10
|
-
Charterleaf
|
|
17
|
+
Charterleaf sits beside a project's own navigation, not on top of it.
|
|
11
18
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
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
|
|
33
|
+
Install once in Pi to discover the bundled Extension and Skill:
|
|
23
34
|
|
|
24
35
|
```bash
|
|
25
|
-
|
|
36
|
+
pi install npm:@onedotmint/charterleaf
|
|
26
37
|
```
|
|
27
38
|
|
|
28
|
-
|
|
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
|
-
|
|
31
|
-
|
|
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
|
-
|
|
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
|
-
|
|
151
|
+
Charterleaf exposes exactly two deterministic commands. Run them from a
|
|
152
|
+
repository root containing `specs/`:
|
|
39
153
|
|
|
40
154
|
```bash
|
|
41
|
-
charterleaf
|
|
42
|
-
charterleaf related src/auth/session.ts
|
|
155
|
+
charterleaf related <path>
|
|
43
156
|
charterleaf lint
|
|
44
157
|
```
|
|
45
158
|
|
|
46
|
-
|
|
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
|
-
|
|
162
|
+
### related \<path\>
|
|
49
163
|
|
|
50
|
-
|
|
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
|
-
|
|
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
|
|
66
|
-
|
|
67
|
-
- `
|
|
68
|
-
-
|
|
69
|
-
- `
|
|
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
|
-
|
|
255
|
+
## Writing specs
|
|
72
256
|
|
|
73
|
-
|
|
74
|
-
|
|
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
|
-
|
|
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
|
-
|
|
268
|
+
## changes/ is optional staging
|
|
80
269
|
|
|
81
|
-
|
|
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
|
-
|
|
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
|
-
##
|
|
281
|
+
## Agent conventions
|
|
86
282
|
|
|
87
|
-
|
|
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
|
-
|
|
288
|
+
For agents that read project instructions, the minimal reference
|
|
289
|
+
bootstrap is [`AGENTS_SNIPPET.md`](AGENTS_SNIPPET.md).
|
|
90
290
|
|
|
91
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
package/bin/charterleaf.js
CHANGED
|
File without changes
|