@kulapard/pi-caveman 0.4.1 → 0.4.2

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 (3) hide show
  1. package/AGENTS.md +14 -44
  2. package/CHANGELOG.md +10 -1
  3. package/package.json +1 -1
package/AGENTS.md CHANGED
@@ -1,55 +1,25 @@
1
1
  # AGENTS.md — pi-caveman conventions
2
2
 
3
- Project memory for agents working in this repo. Non-obvious conventions only.
3
+ Project memory. Non-obvious only.
4
4
 
5
5
  ## Architecture (do not rebuild)
6
6
 
7
- - `extensions/caveman.ts` is the Pi extension; `extensions/caveman-core.ts` holds
8
- the pure, SDK-free logic (`normalizeMode`, `modeInstructions`, `VALID_MODES`,
9
- the activation/deactivation regexes) so it is unit-testable without a fake SDK.
10
- - Mode state is **session-scoped**: stored via `pi.appendEntry("caveman-mode", …)`
11
- and restored from `ctx.sessionManager.getBranch()` on `session_start`. A new
12
- session always starts `off`. There is **no** cross-session config file or env var.
13
- - Activation = `before_agent_start` appends `modeInstructions(mode)` to the
14
- system prompt. Statusline = `ctx.ui.setStatus("caveman", …)` guarded by `hasUI`.
15
- - The extension's `modeInstructions` injection is the **canonical** activator;
16
- the `caveman` skill (`skills/caveman/SKILL.md`) is a standalone fallback for
17
- hosts that load skills but not this extension. When both are active the model
18
- may see both rule sets — mild, intentional redundancy. They are not
19
- programmatically de-duped: skill loading is model-driven and the skill's prose
20
- differs from `modeInstructions`, so there is no reliable text to match on.
21
- - Pi 0.80.2 has **no `agents/` subagent mechanism**. The `agents/cavecrew-*.md`
22
- files are reference personas only and cavecrew is optional/out-of-scope.
7
+ - `extensions/caveman.ts` = Pi extension. `extensions/caveman-core.ts` = pure SDK-free logic (`normalizeMode`, `modeInstructions`, `VALID_MODES`, regexes). Unit-testable without fake SDK.
8
+ - Mode state **session-scoped**: `pi.appendEntry("caveman-mode", …)`, restored from `ctx.sessionManager.getBranch()` on `session_start`. New session always `off`. No cross-session config/env.
9
+ - Activation = `before_agent_start` appends `modeInstructions(mode)`. Statusline = `ctx.ui.setStatus("caveman", …)` guarded by `hasUI`.
10
+ - Extension `modeInstructions` = **canonical** activator. `skills/caveman/SKILL.md` = fallback for hosts loading skills but not extension. If both active, model sees both rule sets — intentional redundancy, no de-dupe.
11
+ - Pi 0.80.2 has **no `agents/` subagent mechanism**. `agents/cavecrew-*.md` = reference personas only; cavecrew optional/out-of-scope.
23
12
 
24
13
  ## Invariants
25
14
 
26
- - **SDK import is `import type` only** in `extensions/*.ts`. The JS tests run via
27
- `--experimental-strip-types`, which erases type-only imports, so no installed
28
- SDK is needed at test time. A value import from `@earendil-works/pi-coding-agent`
29
- would break the tests — `tests/extension.test.mjs` asserts this invariant.
30
- - **Verbatim preservation**: caveman-compress never alters code blocks, inline
31
- code, URLs, file paths, commands, or exact error strings. The skill instructs
32
- the agent to self-validate these against the original and, on any mismatch it
33
- cannot fix, restore from the `.original` backup that was created during the
34
- same invocation (stale backups are rejected before compression starts).
35
- - `caveman-compress` is **prompt-only**: the Pi agent performs the compression
36
- with its own model and file tools, driven by `SKILL.md`. There is no Python and
37
- no external model CLI; coverage is the doc-guard test `tests/compress-docs.test.mjs`.
15
+ - **SDK import `import type` only** in `extensions/*.ts`. JS tests run via `--experimental-strip-types`, erases type-only imports. Value import from `@earendil-works/pi-coding-agent` breaks tests — `tests/extension.test.mjs` asserts this.
16
+ - **Verbatim preservation**: caveman-compress never changes code blocks, inline code, URLs, paths, commands, exact error strings. Skill instructs self-validate against original. Mismatch unfixable → restore from `.original` backup created in same invocation (stale backups rejected before compression).
17
+ - `caveman-compress` is **prompt-only**: Pi agent compresses with own model + file tools, driven by `SKILL.md`. No Python, no external model CLI. Coverage = `tests/compress-docs.test.mjs`.
38
18
 
39
19
  ## Changelog
40
20
 
41
- Every notable change must update `CHANGELOG.md` under `[Unreleased]`. Before
42
- finishing a task, run `npm run changelog:check` to confirm the changelog was
43
- updated for the files you changed. CI also runs this check on every pull
44
- request.
45
-
46
- - `npm test` runs `pretest` (`npm run typecheck` → `tsc --noEmit`) first, then the
47
- `node --test` suites under `tests/`. Typecheck failures fail the test run.
48
- - The JS test glob (`tests/**/*.test.mjs`) is expanded by the Node `--test` runner,
49
- not the shell. Directory-recursion (`--test tests/`) does **not** work on the
50
- current Node — keep the glob.
51
- - Several tests are **phantom-reference guards** (`tests/stats-docs.test.mjs`,
52
- `tests/cavecrew-docs.test.mjs`, `tests/compress-docs.test.mjs`): they assert the
53
- docs do **not** mention a Claude-Code hooks layer, a plugin install path, the
54
- `⛏` badge, Claude-only subagent presets, or broken asset paths. Do not
55
- reintroduce those references.
21
+ Every notable change must update `CHANGELOG.md` under `[Unreleased]`. Before finishing task, run `npm run changelog:check` to confirm changelog updated for files changed. CI runs same check on every PR.
22
+
23
+ - `npm test` runs `pretest` (`npm run typecheck` `tsc --noEmit`), then `node --test tests/**/*.test.mjs`. Typecheck failures fail test run.
24
+ - Node `--test` glob expanded by runner, not shell. Directory-recursion `--test tests/` does **not** work on current Node — keep glob.
25
+ - Tests are **phantom-reference guards** (`tests/stats-docs.test.mjs`, `tests/cavecrew-docs.test.mjs`, `tests/compress-docs.test.mjs`): docs must not mention Claude-Code hooks layer, plugin install path, `⛏` badge, Claude-only subagent presets, broken asset paths. Do not reintroduce.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.4.2] - 2026-06-29
11
+
12
+ ### Changed
13
+
14
+ - Compressed `AGENTS.md` with `caveman-compress` to reduce session token load.
15
+ - Added `*.original` and `*.original.*` to `.gitignore` so caveman-compress
16
+ backups are not committed accidentally.
17
+
10
18
  ## [0.4.1] - 2026-06-29
11
19
 
12
20
  ### Changed
@@ -104,7 +112,8 @@ port of [caveman](https://github.com/JuliusBrussee/caveman).
104
112
  token, automatic provenance, a tag-equals-version guard, and a concurrency
105
113
  group).
106
114
 
107
- [Unreleased]: https://github.com/kulapard/pi-caveman/compare/v0.4.1...HEAD
115
+ [Unreleased]: https://github.com/kulapard/pi-caveman/compare/v0.4.2...HEAD
116
+ [0.4.2]: https://github.com/kulapard/pi-caveman/compare/v0.4.1...v0.4.2
108
117
  [0.4.1]: https://github.com/kulapard/pi-caveman/compare/v0.4.0...v0.4.1
109
118
  [0.4.0]: https://github.com/kulapard/pi-caveman/compare/v0.3.0...v0.4.0
110
119
  [0.3.0]: https://github.com/kulapard/pi-caveman/compare/v0.2.0...v0.3.0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kulapard/pi-caveman",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "Caveman for Pi: ultra-compressed agent output that preserves technical substance. Six intensity modes, slash commands, natural-language activation, and a session statusline.",
5
5
  "type": "module",
6
6
  "license": "MIT",