Skip to content

Commit d7b70b2

Browse files
author
codejunkie99
committed
docs: v0.9.1 release notes (CHANGELOG + README)
- CHANGELOG.md: full patch-release entry — every fix grouped under "Fixed", the test-tracking + adapter.json change under "Changed", migration note, credits to @aliirz and the codex second opinion that surfaced the auto_dream window race. - README.md: short "New in v0.9.1" block above the v0.9.0 block, focused on what users will feel (brew install no longer crashes, pi dream cycle actually runs, reflections carry diff content again, no more tz drift).
1 parent f1c362d commit d7b70b2

2 files changed

Lines changed: 105 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,88 @@ All notable changes to this project.
55
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and the project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.9.1] — 2026-04-26
9+
10+
Patch release that closes the gap between v0.9.0 and a working pi adapter.
11+
Every brew user on v0.9.0 hit the first bug; the rest are quieter but make
12+
the dream cycle and the cross-harness episodic log actually correct.
13+
14+
### Fixed
15+
- **`agentic-stack pi` crashed for every brew user with `ModuleNotFoundError:
16+
No module named 'harness_manager'`.** The v0.9.0 Formula didn't include
17+
`harness_manager/` in `pkgshare.install`, so `install.sh` couldn't dispatch.
18+
Adds it back.
19+
- **Pi dream cycle never fired.** The `session_shutdown` handler filtered
20+
on `event.reason`, but Pi's `SessionShutdownEvent` carries no `reason`
21+
field — verified against `pi-coding-agent` types.d.ts and the emit site
22+
at `agent-session.js:1638`. The filter rejected every event, so
23+
`auto_dream.py` never ran. Filter dropped; re-entrancy guard added.
24+
- **Pi edit reflections lost the diff.** Hook accessed `event.input.edits[0]`
25+
but Pi's `EditToolInput` is flat `{ path, oldText, newText }` (no `edits`
26+
array — that's MultiEdit on Claude Code). Reflections silently degraded
27+
to `Edited <path>` with no old/new content. Read the flat fields.
28+
- **`decay.py` crashed comparing aware-UTC entries to naive cutoff.** The
29+
new `session_shutdown` hook surfaced this on every clean pi exit. Cutoff
30+
is now `datetime.now(timezone.utc)`; entry timestamps are normalised to
31+
UTC before comparison.
32+
- **Naive-local Python timestamps drifted against the UTC decay window.**
33+
Decay's "naive == UTC" assumption was correct only if writers emitted UTC.
34+
They didn't: `post_execution`, `on_failure`, `learn`, `graduate`,
35+
`promote`, `review_state`, `render_lessons` all wrote naive-local. Every
36+
writer now emits aware UTC; every reader (`salience`, `show._human_age`
37+
/ `_daily_counts` / `failing_skills` / `last_dream_cycle`,
38+
`on_failure._count_recent_failures`, `review_state._age_factor`,
39+
`archive`) normalises naive timestamps to UTC before comparison.
40+
- **One bad regex in `hook_patterns.json` disabled every user pattern in
41+
the Pi hook.** Pre-fix used a single combined RegExp per list, caught
42+
any error, returned null for both. Now per-fragment validation with
43+
incremental merge — same posture as `claude_code_post_tool.py`'s
44+
`_filter_valid` / `_build_with_fallback`.
45+
- **`auto_dream` lost entries that landed mid-cycle.** Original `_write_entries`
46+
had a truncate-before-lock window — `open(path, "w")` truncates BEFORE
47+
a lock can be taken. The deeper bug: even after fixing the inner race,
48+
any `append_jsonl()` between `_load_entries()` and `_write_entries(kept)`
49+
would be truncated away by the rewrite. The cycle now holds a single
50+
exclusive flock on `AGENT_LEARNINGS.jsonl` across the entire
51+
read-modify-write window via `_episodic_locked()`. Mutually exclusive
52+
with `_episodic_io.append_jsonl` (same flock target). POSIX only;
53+
Windows falls back to historical best-effort behaviour.
54+
- **`_cachedSha` went stale after `git commit` inside a pi session.** TS
55+
hook cached the SHA per-process for performance, so every entry logged
56+
after a mid-session commit recorded the pre-commit SHA. Cache, but
57+
invalidate on bash commands matching `git <subcmd>` for HEAD-moving
58+
subcommands. Allows option flags between `git` and the subcommand
59+
(`git -c key=val checkout main`, `git -C path switch dev`).
60+
- **`salience` over-scored future-skewed legacy rows.** Legacy naive-local
61+
timestamps re-interpreted as UTC could read as a few hours in the future
62+
during the migration window. `timedelta.days` then went negative and
63+
recency exceeded the intended cap. Floor age at 0; clamp recency to ≤ 10.
64+
- **`decay` archive filename used local date while cutoff was UTC.**
65+
`archive_{date}.jsonl` now uses UTC date so a tz-jumping user gets a
66+
deterministic path.
67+
68+
### Changed
69+
- `adapters/pi/adapter.json` no longer manages
70+
`.agent/harness/hooks/pi_post_tool.py` via `from_stack`. The TS hook is
71+
self-contained — all scoring + reflection inline, no Python subprocess
72+
per tool call. The .py still ships in the brain template under
73+
`.agent/harness/hooks/` for standalone use.
74+
- `tests/` is now untracked and listed in `.gitignore`. CI never ran
75+
these (`.github/workflows/ci.yml` runs `test_claude_code_hook.py` +
76+
`verify_*.py` at repo root). Pull from an older tag if you want the
77+
unittest suite locally.
78+
79+
### Migration
80+
`brew upgrade agentic-stack` is enough — there are no on-disk schema
81+
changes. Existing pi installs with the v0.9.0 hook get the new logic on
82+
the next `./install.sh pi`. Existing `.agent/memory/episodic/AGENT_LEARNINGS.jsonl`
83+
files with naive-local timestamps continue to work — readers normalise
84+
them at compare time and writers emit UTC going forward.
85+
86+
### Credits
87+
PR #24 by @aliirz; Codex CLI used for an independent second-opinion review
88+
that surfaced the auto_dream window race + the SHA-regex narrowness.
89+
890
## [0.9.0] — 2026-04-23
991

1092
### Added

README.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,28 @@ A portable `.agent/` folder (memory + skills + protocols) that plugs into Claude
1212
<img src="docs/diagram.svg" alt="agentic-stack architecture" width="880"/>
1313
</p>
1414

15-
### New in v0.9.0 — harness manager
15+
### New in v0.9.1 — pi adapter fixes + tz correctness
16+
17+
Patch release. Closes the gap between v0.9.0 and a working pi adapter,
18+
plus a timezone sweep across every Python writer/reader so the dream
19+
cycle stops drifting against the UTC decay window.
20+
21+
- Brew users on v0.9.0 hit `ModuleNotFoundError: harness_manager` on
22+
first run. Formula now installs `harness_manager/` correctly.
23+
- Pi's dream cycle never fired (`session_shutdown` filter rejected every
24+
event because `SessionShutdownEvent` has no `reason` field). Now runs.
25+
- Pi's edit reflections were missing the diff (hook expected MultiEdit
26+
shape; Pi's edit input is flat). Now captures `oldText` / `newText`.
27+
- Naive-local Python timestamps reinterpreted at decay time as UTC
28+
caused silent drift. Every writer now emits aware UTC; every reader
29+
normalises naive entries before comparing.
30+
- `auto_dream` held no lock across its read-modify-write window —
31+
concurrent appenders could be silently truncated. Now holds a single
32+
`flock(LOCK_EX)` on the episodic log for the full cycle.
33+
34+
See [CHANGELOG.md](CHANGELOG.md) for the full list.
35+
36+
### v0.9.0 — harness manager
1637

1738
<p align="center">
1839
<img src="docs/harness-manager.svg" alt="harness manager v0.9.0" width="880"/>
@@ -23,8 +44,7 @@ Manifest-driven adapter system: every harness is now declared by an
2344
verb subcommands or an interactive TUI. Cross-platform (POSIX +
2445
Windows) with concurrent-write protection, pre-v0.9 migration via
2546
`./install.sh doctor`, and shared-file ownership tracking so removing
26-
one adapter never orphans another. See [CHANGELOG.md](CHANGELOG.md)
27-
for the full list.
47+
one adapter never orphans another.
2848

2949
[![GitHub release](https://img.shields.io/github/v/release/codejunkie99/agentic-stack)](https://github.com/codejunkie99/agentic-stack/releases)
3050
[![License: Apache 2.0](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE)

0 commit comments

Comments
 (0)