ceulen 0.23.0 → 0.25.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/CHANGELOG.md CHANGED
@@ -1,5 +1,70 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.25.0 — 2026-11-01
4
+
5
+ Goal module (`extensions/modules/goal/`): OMP/Codex-style **autonomous
6
+ self-continuation goal mode** — reverses the 2026-10-02 decision that
7
+ dropped pi-plan's `/goal` (all three peer harnesses ship the feature:
8
+ Codex v0.128+, Claude Code `/goal`, OMP core).
9
+
10
+ - **`/goal <objective> [--budget N]`** (+ `status|pause|resume|clear|
11
+ budget <N|off>`): sets a session goal and fires the objective as the
12
+ first work turn. After every settled turn (`agent_settled` — pi's
13
+ "no retry/compaction/queued continuation will run" contract) a hidden
14
+ continuation re-prompts (`triggerTurn:true, deliverAs:"followUp"` —
15
+ cron's fire mechanism) with OMP's 6-point completion-audit prompt.
16
+ - **`goal` tool (DIRECT, never deferred)**: `get` reports state;
17
+ `complete` ends the loop — accepted only from the agent, and only when
18
+ repo state proves every deliverable (budget exhaustion ≠ completion).
19
+ Plan mode blocks it via plan-tools.ts BLOCKED_TOOLS; goal mode never
20
+ bypasses plan gates or bash approvals.
21
+ - **Token budget** = OMP `goalTokenDelta` (input+cacheWrite+output;
22
+ cacheRead excluded) over rolling `message_end` snapshots: a goal set
23
+ mid-run bills only post-goal deltas; a fresh-session goal bills from
24
+ zero (live-test fix — the first turn of a fresh-session goal is goal
25
+ work). Flip to `budget-limited` sends ONE wrap-up turn
26
+ (`followUp+triggerTurn`, deliberately not OMP's mid-turn steer: at a
27
+ pi turn boundary nothing can consume a steer). One wrap-up per budget
28
+ episode; `/goal budget` set-below-usage re-limits immediately, raise
29
+ above usage revives.
30
+ - **Boundaries**: turn cap `goal.maxTurns` (default 50) stops the loop;
31
+ abort/plan-mode pauses; restart restores PAUSED — terminal tombstone
32
+ entries (`complete`/`stopped`) prevent cleared-goal resurrection.
33
+ - **Settings**: GLOBAL `goal` section (`maxTurns`, `defaultBudget`,
34
+ 0 = unbounded); /config → Tasks → Goal mode 🎯; status segment
35
+ `ceulen-goal`; registry position before rules/steering (append-only
36
+ `before_agent_start` composer). Live-verified in a herdr pane
37
+ (set/complete/continuation/budget/pause/resume + 16-entry jsonl trail).
38
+
39
+ ## 0.24.0 — 2026-10-23
40
+
41
+ pi 1.4.0 compatibility pass (verified by diffing the 1.3.0 and 1.4.0
42
+ managed releases surface by surface): **no breaking changes**. The 1.4.0
43
+ delta is additive for the extension API — types.d.ts zero-diff,
44
+ SettingsManager/settings-selector/theme-schema byte-identical, pi-tui
45
+ editor internals unchanged.
46
+
47
+ - **Peer deps widened** `>=0.99.1 <1.4.0` → `>=0.99.1 <1.5.0` for both
48
+ `@earendil-works/pi-coding-agent` and `@earendil-works/pi-tui` (the old
49
+ range semver-excluded pi 1.4.0). AGENTS.md inline range updated; lockfile
50
+ refreshed to pi 1.4.0 + pi-tui 1.4.0.
51
+ - **Deferred tier verified against the #11062 resume rework**: pi 1.4.0
52
+ activates never-mentioned extension tools on session resume, but only
53
+ ones declarable on registration (`direct`/`model-only`) — deferred tools
54
+ stay inactive, the session_start `tool_search` re-arm still composes.
55
+ - **Composer comment** updated to pi 1.4.0 compaction semantics
56
+ (`reserveTokens` only controls when compaction STARTS; summaries use the
57
+ model's full output limit).
58
+ - **Free wins from pi 1.4.0**: codemode worker queueing (parallel subagent
59
+ dispatches queue up to 60s instead of failing), truncated-tool-call
60
+ recovery (#11227), OpenAI Responses prompt-cache retention on deferred
61
+ tool loads (#10940), dialog stacking (#11166 — /config + a2a prompts no
62
+ longer orphan promises).
63
+
64
+ Verification: tsc clean against 1.4.0; 2931 tests / 0 fail (3 env skips);
65
+ rpc-mode live smoke on managed pi 1.4.0 — 29 modules, 59 commands (parity
66
+ with 1.3.0), 51 deferred tools, zero stderr.
67
+
3
68
  ## 0.23.0 — 2026-10-19
4
69
 
5
70
  Thinking-mode gaps closed — GLM-5.3 gets its real effort ladder on the router,
@@ -50,6 +50,8 @@ import attachmentsModule from "../modules/attachments/index.ts";
50
50
  import { attachmentsConfig } from "../modules/attachments/configPanel.ts";
51
51
  import cronModule from "../modules/cron/index.ts";
52
52
  import { cronConfig } from "../modules/cron/configPanel.ts";
53
+ import goalModule from "../modules/goal/index.ts";
54
+ import { goalConfig } from "../modules/goal/configPanel.ts";
53
55
  import permissionModule from "../modules/permission/index.ts";
54
56
  import shellsModule from "../modules/shells/index.ts";
55
57
  import sgModule from "../modules/sg/index.ts";
@@ -163,6 +165,12 @@ export const MODULES: ModuleEntry[] = [
163
165
  // Cron after todo: scheduled prompts into the live session (the clock-driven
164
166
  // sibling of the task board). No before_agent_start → no ordering constraint.
165
167
  { name: "cron", category: "Tasks", describe: "Scheduled jobs firing prompts into the live session: add/remove/list/run/enable/disable/test/logs/export, headless pinned runs, crontab export.", load: cronModule, config: cronConfig, deferredTools: ["cron"] },
168
+ // Goal after cron: the autonomy sibling (cron is clock-driven, goal is
169
+ // condition-driven). It IS a before_agent_start composer (append-only
170
+ // goal_context) — must precede rules/steering like every prompt composer.
171
+ // `goal` tool stays DIRECT (munin-loop lesson: a protocol's terminal action
172
+ // never rides the deferred tier); plan mode blocks it via plan-tools.ts.
173
+ { name: "goal", category: "Tasks", describe: "Autonomous goal mode: /goal sets an objective; the loop re-injects continuation after every settled turn until the agent verifies completion via the goal tool, hits the token budget or turn cap, or you pause.", load: goalModule, config: goalConfig },
166
174
  // ── Tools ─────────────────────────────────────────────────────────────
167
175
  // Repair first in the section: it wraps the built-in tools; serena/fff ride
168
176
  // on top (no load-order dependency — hooks resolve at call time).
@@ -358,7 +358,8 @@ function gaugeFill(w: number, data: BandData | undefined, theme: ShapeTheme): st
358
358
  const scale = windowStart >= 0 ? windowStart : w;
359
359
  const usedCount = Math.min(scale, Math.max(1, Math.round(((pct ?? 0) / 100) * scale)));
360
360
  const percentStart = percentLabel ? Math.min(Math.max(1, scale - percentLabel.length - 1), Math.max(1, usedCount)) : -1;
361
- // pi's compaction fires at contextWindow − reserveTokens (16384 default).
361
+ // pi's compaction STARTS at contextWindow − reserveTokens (16384 default);
362
+ // since pi 1.4.0 the summary itself uses the model's full output limit.
362
363
  const thresholdIdx =
363
364
  data?.autoCompact && w >= 8 && data.window ? Math.min(scale - 1, Math.max(0, Math.round(((data.window - 16384) / data.window) * scale))) : -1;
364
365
  let out = "";
@@ -0,0 +1,63 @@
1
+ /**
2
+ * goal's /config contribution — Tasks tab, Goal mode section 🎯.
3
+ *
4
+ * Rows write the GLOBAL agent-dir settings.json `goal` section (see
5
+ * lib/settings.ts); read per event, so a save applies without /reload.
6
+ */
7
+ import { row, toInt, type PanelGroup } from "../../lib/panel.js";
8
+ import type { ModuleConfig } from "../../lib/registry.js";
9
+ import { readGoalSettings, DEFAULT_GOAL_SETTINGS, type GoalSettings } from "./lib/settings.js";
10
+
11
+ /** Build the panel groups over a working copy (mutated by row setters). */
12
+ export function buildGoalGroups(cfg: GoalSettings): PanelGroup[] {
13
+ return [
14
+ {
15
+ key: "goal",
16
+ label: "Goal mode",
17
+ tab: "Tasks",
18
+ icon: "🎯",
19
+ rows: [
20
+ row("goal.maxTurns", "Max continuation turns", "number", cfg.maxTurns, (v) => {
21
+ const n = toInt(v, cfg.maxTurns);
22
+ if (n > 0) cfg.maxTurns = n;
23
+ }, {
24
+ description: "Hard cap on autonomous continuation turns before the loop stops itself.",
25
+ warning: "Uncapped autonomous loops burn tokens — the cap is the seatbelt.",
26
+ defaultValue: DEFAULT_GOAL_SETTINGS.maxTurns,
27
+ }),
28
+ row("goal.defaultBudget", "Default token budget", "number", cfg.defaultBudget ?? 0, (v) => {
29
+ const n = toInt(v, 0);
30
+ if (n >= 0) cfg.defaultBudget = n;
31
+ }, {
32
+ description: "Default token budget for /goal set without --budget. 0 = unbounded.",
33
+ defaultValue: DEFAULT_GOAL_SETTINGS.defaultBudget,
34
+ }),
35
+ ],
36
+ },
37
+ ];
38
+ }
39
+
40
+ const OWNED_PREFIX = "goal.";
41
+
42
+ /** goal's ModuleConfig for the central /config panel. */
43
+ export function goalConfig(): ModuleConfig {
44
+ const working: GoalSettings = readGoalSettings();
45
+ return {
46
+ groups: () => buildGoalGroups(working),
47
+ save: async (edited, ctx) => {
48
+ if (![...edited].some((k) => k.startsWith(OWNED_PREFIX))) return;
49
+ // Read-modify-write the two owned keys into the GLOBAL settings.json.
50
+ try {
51
+ const { writeGoalSection } = await import("./lib/settings.js");
52
+ const patch: Partial<GoalSettings> = {};
53
+ if (edited.has("goal.maxTurns")) patch.maxTurns = working.maxTurns;
54
+ if (edited.has("goal.defaultBudget")) patch.defaultBudget = working.defaultBudget;
55
+ if (!Object.keys(patch).length) return;
56
+ const file = writeGoalSection(patch);
57
+ ctx.ui.notify(`Goal settings saved to ${file} (applies without /reload).`);
58
+ } catch (e) {
59
+ ctx.ui.notify(`Goal save failed: ${e instanceof Error ? e.message : e}`, "error");
60
+ }
61
+ },
62
+ };
63
+ }