pi-goala 0.2.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 ADDED
@@ -0,0 +1,62 @@
1
+ # Changelog
2
+
3
+ ## 0.2.0 (2026-07-26)
4
+
5
+ - Rename the package, repository, extension namespace, storage, environment
6
+ variables, and setup command to Goala (`pi-goala`).
7
+ - Add `final` and `per-step` review policies.
8
+ - Pause after each step with validation evidence for a human approval or
9
+ revision gate, with optional independent `/verify`.
10
+ - Add a separately configurable fast step-verifier role while retaining the
11
+ stronger final verifier.
12
+ - Preserve review checkpoints across pause and resume.
13
+ - Require explicit confirmation or `--replace` before discarding active goal
14
+ and progressed-plan state.
15
+ - Enforce read-only discussion before plan and step approval.
16
+ - Require non-empty verification summaries and concrete check evidence.
17
+ - Replace vendor-specific setup branching with a data-driven preset registry.
18
+ - Require Pi coding-agent and TUI hosts at version 0.82.1 or newer.
19
+ - Clarify authentication-only clean migration and `/goal-plan` pre-plan
20
+ feedback.
21
+ - Discover unfinished goals from recent same-project Pi sessions when
22
+ `/goal-status` is run from an idle session, including path aliases and
23
+ case-insensitive filesystem spellings.
24
+ - Render goal status as a persistent TUI-only entry rather than a transient
25
+ notification.
26
+ - Align the four CoALA memory types with Pi-native working context,
27
+ `AGENTS.md`/project documentation, skills/workflows, and distilled episodic
28
+ recall instead of treating every type as SQLite content.
29
+ - Promote only evidence-backed findings produced by the independent final
30
+ verifier; planner and executor claims no longer become durable learnings.
31
+ - Add recoverable `/memory retire` and `/memory restore` lifecycle controls,
32
+ repository ancestry labels, and visible memory-health diagnostics.
33
+ - Make full redacted transcript retention opt-in and harden evidence directory
34
+ naming and duplicate writes.
35
+ - Split the extension entry point into clearly owned `tools`, `session`,
36
+ `policy`, and `presenters` modules, with direct boundary tests.
37
+ - Add authoritative goal-source documents with bounded project-local
38
+ resolution, persistent hashes, phase-wide references, and drift detection.
39
+ - Document the original one-fixture benchmark as a retrieval experiment and
40
+ define a multi-condition organic lifecycle evaluation.
41
+
42
+ ## 0.1.2
43
+
44
+ - Render full plans through Pi's registered TUI entry API.
45
+ - Keep displayed plans out of model context to avoid duplicate token usage.
46
+
47
+ ## 0.1.1
48
+
49
+ - Display the complete structured plan persistently before execution approval.
50
+ - Add `/goal-plan` to reopen acceptance criteria, risks, implementation details,
51
+ and per-step verification methods.
52
+
53
+ ## 0.1.0
54
+
55
+ - Add persistent goal, plan, execution, verification, and bounded repair phases.
56
+ - Add configurable planner, executor, verifier, and repair model roles.
57
+ - Add fresh planning/execution sessions and logical verifier context isolation.
58
+ - Add verifier-gated local episodic memory with SQLite FTS5 retrieval.
59
+ - Add redacted cold evidence, content-hash deduplication, and repository provenance.
60
+ - Add namespaced, non-destructive configuration and storage.
61
+ - Add `/goala-setup`, `/memory-status`, and goal lifecycle commands.
62
+ - Add static, packaging, and end-to-end evaluation fixtures.
@@ -0,0 +1,25 @@
1
+ # Contributing
2
+
3
+ Contributions are welcome after the public repository opens.
4
+
5
+ ## Development
6
+
7
+ ```text
8
+ npm install
9
+ npm run check
10
+ ```
11
+
12
+ Changes to context selection or memory retrieval must include:
13
+
14
+ 1. a deterministic regression test;
15
+ 2. a quality comparison on the included fixture;
16
+ 3. separate uncached-input, output, cache-read, total-token, and cost reporting;
17
+ 4. confirmation that the verifier receives no recalled memory.
18
+
19
+ Do not weaken the independent verification boundary to improve a token metric.
20
+
21
+ ## Pull requests
22
+
23
+ Keep pull requests focused. Explain the user-visible behavior, trust-boundary
24
+ impact, tests run, and any migration required for existing memory or
25
+ configuration.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Barry King
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,529 @@
1
+ # Goala
2
+
3
+ Goala—Goal-Oriented Agent Lifecycle Architecture—is an installable
4
+ plan → execute → independently verify workflow for [Pi](https://pi.dev), with
5
+ phase-isolated context and verifier-gated episodic memory.
6
+
7
+ ```text
8
+ goal → recall verified memory → read-only plan → explicit approval
9
+ |
10
+ v
11
+ fresh execution session → independent verify → complete
12
+ ^ |
13
+ └──────── repair ───────┘
14
+
15
+ per-step review:
16
+ execute one step → run checks → human approve/revise → next step
17
+ └→ optional independent /verify
18
+ ```
19
+
20
+ Goala turns an outcome into a persistent, testable workflow:
21
+
22
+ - a capable model inspects the repository and proposes acceptance criteria;
23
+ - implementation waits for explicit `/execute` approval;
24
+ - a faster coding model works through the approved plan;
25
+ - a separate verifier checks actual files and test output without editing;
26
+ - failed verification returns actionable defects to a bounded repair loop;
27
+ - only independently verified outcomes become searchable long-term memory.
28
+
29
+ ## Install
30
+
31
+ Pi 0.82 or newer and Node.js 22.19 or newer are recommended.
32
+
33
+ Install the latest release from npm:
34
+
35
+ ```text
36
+ pi install npm:pi-goala
37
+ ```
38
+
39
+ Pin a release for reproducible team installations:
40
+
41
+ ```text
42
+ pi install npm:pi-goala@0.2.0
43
+ ```
44
+
45
+ Pi's package command both downloads Goala and registers its extension. A plain
46
+ `npm install -g pi-goala` does not register the package with Pi and is not a
47
+ supported installation path.
48
+
49
+ From GitHub or a local checkout:
50
+
51
+ ```text
52
+ pi install git:github.com/barryking/pi-goala@v0.2.0
53
+ pi install /absolute/path/to/pi-goala
54
+ ```
55
+
56
+ Pi packages execute with the permissions of the user running Pi. Review the
57
+ source before installing any extension.
58
+
59
+ Existing Pi installations do not normally need to be reset. If you are
60
+ replacing a hand-maintained workflow and want a clean migration, preserve the
61
+ whole Pi agent directory before carrying only authentication into the new
62
+ installation. Old sessions remain in the backup for rollback and are not
63
+ imported into the clean installation. See
64
+ [clean migration and rollback](docs/configuration.md#clean-migration-and-rollback).
65
+
66
+ ## Quick start
67
+
68
+ Open Pi in the project you want to change:
69
+
70
+ ```text
71
+ pi
72
+ /goala-setup
73
+ /goal Describe the finished outcome and important constraints
74
+ ```
75
+
76
+ Review the structured plan, then approve it:
77
+
78
+ ```text
79
+ /execute
80
+ ```
81
+
82
+ `/execute` uses the configured review policy. The default, `final`, executes
83
+ the approved plan and reviews it when complete. For a long-running or
84
+ direction-sensitive goal, request a human-in-the-loop approval gate after each
85
+ plan step:
86
+
87
+ ```text
88
+ /execute per-step
89
+ ```
90
+
91
+ Each step runs its declared checks and pauses with concrete evidence for
92
+ discussion. Run `/goal approve` to accept it and continue, `/goal revise
93
+ <feedback>` to return it to the executor, or `/verify` when the checkpoint
94
+ warrants an independent second opinion. The full goal always receives
95
+ independent final verification before completion.
96
+
97
+ Useful commands:
98
+
99
+ ```text
100
+ /goal <objective> Start a persistent goal
101
+ /goal --source <path> -- <objective>
102
+ Start a goal with an authoritative requirements file
103
+ /goal status Show the active goal or a recoverable saved goal
104
+ /goal approve Accept the reviewed step and continue
105
+ /goal revise <feedback> Return the reviewed step for revision
106
+ /goal pause Stop advancing while preserving the goal
107
+ /goal resume Continue a paused goal
108
+ /goal clear Remove the active goal state
109
+ /goal-plan Show the full approval plan and verification methods
110
+ /plan Re-plan before work has started
111
+ /plan --replace Explicitly discard a progressed plan
112
+ /execute [final|per-step] Approve the plan with a review policy
113
+ /verify Independently verify a checkpoint or the final goal
114
+ /memory-status Show memory health and recent active/retired episodes
115
+ /memory retire <id> Exclude an obsolete episode from recall
116
+ /memory restore <id> Restore a retired episode
117
+ /goala-setup Choose a model preset
118
+ /goala-setup status Show effective configuration
119
+ ```
120
+
121
+ ## Detailed PRDs and authoritative sources
122
+
123
+ Do not paste a long PRD into the goal objective. Keep it as a versioned project
124
+ file and register it as an authoritative source:
125
+
126
+ ```text
127
+ /goal --source docs/PRD.md -- Implement the offline export workflow
128
+ ```
129
+
130
+ Multiple sources are supported, including quoted paths:
131
+
132
+ ```text
133
+ /goal --source "docs/Product Requirements.md" --source docs/architecture.md -- Implement the import workflow
134
+ ```
135
+
136
+ Goala records each project-relative path, byte count, and SHA-256 hash in the
137
+ persistent goal state. It does not copy the document into every model prompt.
138
+ Instead, every active phase receives the bounded references and must read the
139
+ current files before acting:
140
+
141
+ - planning must turn all source requirements into acceptance criteria and
142
+ testable steps;
143
+ - execution must preserve the source contract;
144
+ - checkpoint review uses the sources as its requirements reference;
145
+ - final verification independently checks the current sources as well as the
146
+ submitted acceptance criteria.
147
+
148
+ If a source changes or disappears after goal creation, Goala injects an
149
+ explicit source-drift warning. The agent must surface the discrepancy rather
150
+ than silently reinterpret the approved contract. Plan, progress, checkpoint,
151
+ and final-verification submissions are rejected until the captured file is
152
+ restored or a replacement goal explicitly captures the new contract.
153
+
154
+ Sources must be UTF-8 regular files inside the current project. A goal may
155
+ reference at most eight files, each no larger than 1,000,000 bytes. Paths with
156
+ spaces may be quoted. The `--` separator before the objective is required.
157
+
158
+ The source documents remain ordinary repository files and should be committed
159
+ when they are part of the product contract. `/goal clear` removes the active
160
+ reference set but does not delete those files or historical Pi session entries.
161
+ Register stable inputs, not files the implementation is expected to rewrite;
162
+ an intentional contract revision should start a replacement goal.
163
+
164
+ ## Resuming after exiting Pi
165
+
166
+ Goal state is stored in Pi's saved session tree. Exiting Pi does not delete the
167
+ goal, but launching plain `pi` starts a new session and does not silently adopt
168
+ state from another session.
169
+
170
+ To continue the most recent saved session for the current working directory:
171
+
172
+ ```text
173
+ pi -c
174
+ ```
175
+
176
+ To browse saved sessions:
177
+
178
+ ```text
179
+ pi -r
180
+ ```
181
+
182
+ If you already opened a new session, run `/goal-status`. Status is rendered as
183
+ a persistent TUI-only entry and does not enter model context. When there is no
184
+ goal in the current session, Goala searches recent saved sessions for
185
+ the same working directory, ignores completed and superseded goal states, and
186
+ shows the most recent recoverable goal with an exact command:
187
+
188
+ ```text
189
+ No active goal in this Pi session.
190
+
191
+ Recoverable goal found:
192
+ Goal: Add project-level task filtering
193
+ Phase: awaiting-review
194
+ Progress: 2/4
195
+
196
+ Resume it from your shell:
197
+ pi --session 019f...
198
+ ```
199
+
200
+ Recovery is advisory rather than automatic because a project can have multiple
201
+ unfinished goals in different sessions. If more than one exists,
202
+ `/goal-status` recommends `pi -r` so you can choose deliberately. Session
203
+ discovery is bounded to the 100 most recently modified sessions for the
204
+ working directory.
205
+
206
+ ## Choosing a workflow
207
+
208
+ Goala is most useful when the desired outcome can be stated before
209
+ implementation begins. Choose the lightest flow that gives the work enough
210
+ control:
211
+
212
+ | Kind of work | Recommended flow |
213
+ |---|---|
214
+ | Typo or obvious one-line edit | Use Pi normally; a persistent goal adds little value |
215
+ | Small bug, test fix, or bounded refactor | One goal with `final` review |
216
+ | Feature with clear acceptance criteria | `final` when direction is settled; `per-step` when you want to inspect intermediate decisions |
217
+ | Greenfield, product, or visual work | `per-step`, with human review of each meaningful product milestone |
218
+ | Security, data migration, or other high-risk work | `per-step`; use `/verify` at the risky checkpoints and inspect the real diff or environment |
219
+ | Unclear or exploratory request | Plan and discuss first; do not run `/execute` until the outcome and acceptance criteria are credible |
220
+ | Multi-release or open-ended objective | Keep the parent roadmap in the repository and run one bounded Goala goal per milestone |
221
+
222
+ ### Small bug or bounded refactor
223
+
224
+ Describe the observable result, constraints, and checks—not a guessed
225
+ implementation:
226
+
227
+ ```text
228
+ /goal Fix duplicate invoice creation when a retried request uses the same idempotency key. Preserve the public API and add a regression test.
229
+ /goal-plan
230
+ /execute final
231
+ ```
232
+
233
+ This is the economical default. The executor works through the approved plan
234
+ in fresh context, then the independent verifier evaluates the whole result.
235
+
236
+ ### Feature with reviewable milestones
237
+
238
+ Use checkpoints when an early implementation choice could change what should
239
+ happen later:
240
+
241
+ ```text
242
+ /goal Add project-level task filtering with shareable URLs, keyboard access, and tests. Do not change the stored task format.
243
+ /goal-plan
244
+ /execute per-step
245
+ ```
246
+
247
+ At each checkpoint, inspect the evidence and discuss the result with Pi. Then
248
+ choose one action:
249
+
250
+ ```text
251
+ /goal approve
252
+ /goal revise Keep the URL parameter names compatible with the existing links
253
+ /verify
254
+ ```
255
+
256
+ `/goal approve` starts the next step in a fresh execution session. `/goal
257
+ revise` reworks only the current step using your feedback. `/verify` adds an
258
+ independent checkpoint review and returns to the approval gate if it passes;
259
+ it is intentionally optional because running a second model after every step
260
+ substantially increases token use. Final independent verification is always
261
+ required.
262
+
263
+ ### Greenfield or visual work
264
+
265
+ Ask the planner for a few meaningful, independently reviewable milestones,
266
+ such as product structure, a working interaction slice, and the final
267
+ accessibility/resilience pass. Avoid a long list of mechanical setup tasks.
268
+ Use `per-step` so you can run the app and judge the direction before approving
269
+ the next milestone.
270
+
271
+ Goala can verify files, tests, and declared checks, but subjective claims
272
+ such as “best looking” still need human review in the real UI. Treat `/verify`
273
+ as a technical second opinion, not a substitute for browser, device, or
274
+ usability review.
275
+
276
+ ### Risky changes
277
+
278
+ For authentication, permissions, destructive migrations, deployment logic, or
279
+ security-sensitive code:
280
+
281
+ 1. Put rollback, compatibility, and negative-test requirements in the goal.
282
+ 2. Use `per-step` around irreversible or high-impact boundaries.
283
+ 3. Run `/verify` before approving a checkpoint whose failure would be costly.
284
+ 4. Review the actual diff and test output; use a disposable environment where
285
+ appropriate.
286
+
287
+ The approval flow reduces accidental progression, but it is not an
288
+ operating-system sandbox and it does not make a risky command safe.
289
+
290
+ ### An overarching goal
291
+
292
+ Do not make one Goala goal carry an indefinite product roadmap. Goala
293
+ tracks one active goal in the current Pi session tree, and durable memory is
294
+ written only after that goal passes final verification. Instead:
295
+
296
+ 1. Keep the stable objective, constraints, decisions, and milestone list in a
297
+ repository document such as `PROJECT_GOAL.md` or `ROADMAP.md`.
298
+ 2. Start a bounded `/goal` for the next milestone or release.
299
+ 3. Use `per-step` inside that milestone when you want discussion and approval
300
+ between implementation slices.
301
+ 4. Complete and verify it, update the roadmap, then start the next goal.
302
+
303
+ This gives each executor only the context needed for its task while the
304
+ repository remains the source of truth across sessions.
305
+
306
+ ### Where stack, architecture, and guidance belong
307
+
308
+ Goala memory is verified history, not the place to configure a project.
309
+ Use this hierarchy:
310
+
311
+ | Information | Put it here |
312
+ |---|---|
313
+ | Concise outcome for the current change | The `/goal` objective |
314
+ | Detailed PRD or one-goal requirements contract | A versioned file registered with `/goal --source` |
315
+ | Stable stack, coding conventions, required commands, and safety rules | The repository's `AGENTS.md` |
316
+ | Detailed architecture, domain rules, and decisions | Versioned repository docs, linked from `AGENTS.md` |
317
+ | Product direction and future milestones | `PROJECT_GOAL.md` or `ROADMAP.md` |
318
+ | Personal defaults that apply to every repository | `~/.pi/agent/AGENTS.md` |
319
+ | Distilled experience from successfully completed work | Verified Goala episodic memory |
320
+
321
+ Pi loads repository and global `AGENTS.md` files into every fresh Goala phase.
322
+ Keep them concise because repeated instructions consume context in
323
+ planning, execution, and verification. Put detailed material in files such as
324
+ `docs/architecture.md` or Architecture Decision Records, and tell the agent
325
+ when to read them:
326
+
327
+ ```markdown
328
+ # Project guidance
329
+
330
+ ## Stack
331
+ - Node.js 22, TypeScript in strict mode, React 19, and PostgreSQL 17.
332
+ - Do not introduce another state-management or database library.
333
+
334
+ ## Architecture
335
+ - Keep domain logic independent of HTTP and persistence adapters.
336
+ - Read `docs/architecture.md` before changing module boundaries.
337
+ - Record accepted architectural decisions under `docs/decisions/`.
338
+
339
+ ## Validation
340
+ - Run `npm run check` for code changes.
341
+ - Run integration tests for database or API changes.
342
+
343
+ ## Safety
344
+ - Never run production migrations from a development session.
345
+ ```
346
+
347
+ Run `/reload` after changing `AGENTS.md`. For a one-off exception, state it in
348
+ the goal instead of changing the durable project rules:
349
+
350
+ ```text
351
+ /goal Add CSV export using the existing TypeScript and React stack. Keep domain logic framework-independent, follow docs/architecture.md, and do not add runtime dependencies.
352
+ ```
353
+
354
+ If a verified task produces a reusable lesson, the independent final verifier
355
+ can include it as an evidence-backed episode finding. Important decisions
356
+ should still be committed to the repository; future memory is bounded,
357
+ relevance-ranked, and deliberately treated as untrusted evidence.
358
+
359
+ ### When direction changes
360
+
361
+ Use `/goal revise <feedback>` when the current checkpoint needs rework. Use
362
+ `/goal pause` and `/goal resume` when discussion or outside work interrupts the
363
+ flow. Before execution begins, `/plan` can safely regenerate the plan. After
364
+ progress exists, `/plan --replace` deliberately discards the structured plan
365
+ history and creates a new plan; it does not undo repository changes. Prefer a
366
+ new bounded goal when the desired outcome has materially changed.
367
+
368
+ ## Model roles
369
+
370
+ The recommended OpenAI Codex preset is:
371
+
372
+ | Phase | Model | Reasoning |
373
+ |---|---|---:|
374
+ | Plan | `gpt-5.6-sol` | medium |
375
+ | Execute | `gpt-5.6-luna` | medium |
376
+ | Optional step verification | `gpt-5.6-luna` | medium |
377
+ | Verify | `gpt-5.6-sol` | medium |
378
+ | Repeated repair | `gpt-5.6-terra` | medium |
379
+
380
+ If those models are unavailable, Goala can use the model that was active
381
+ when Pi started. Run `/goala-setup current` to persist that portable
382
+ single-model configuration. Advanced users can configure each role in
383
+ `~/.pi/agent/pi-goala/config.json`.
384
+
385
+ The package does not overwrite Pi's `settings.json`, model list, skills,
386
+ prompts, other extensions, or authentication.
387
+
388
+ ## Memory with a trust boundary
389
+
390
+ The four CoALA memory types have distinct homes:
391
+
392
+ | Type | Placement |
393
+ |---|---|
394
+ | Working | Bounded current phase packet |
395
+ | Semantic | `AGENTS.md`, architecture docs, ADRs, and other versioned project knowledge |
396
+ | Procedural | Pi skills and the executable Goala workflow |
397
+ | Episodic | Distilled, independently verified prior-task episodes in local SQLite |
398
+
399
+ Goala owns working-memory assembly and episodic recall. It does not copy
400
+ semantic or procedural sources of truth into its database.
401
+
402
+ Episodic memory is local, bounded, and advisory:
403
+
404
+ 1. Starting `/goal` searches active verified episodes using the new objective
405
+ and ranks results from the current repository first.
406
+ 2. Up to four relevant results and 6,000 characters are recalled by default;
407
+ planning and execution may run narrower searches when needed.
408
+ 3. Recall contains verified outcomes, evidence-backed findings, open items,
409
+ relevant files, commit provenance, and repository ancestry. It never
410
+ replays the previous planning or execution conversation.
411
+ 4. Current code, `AGENTS.md`, tests, the goal, and acceptance criteria outrank
412
+ memory. Recall is labelled as untrusted evidence, never instructions.
413
+ 5. The final verifier receives no recalled memory or executor completion
414
+ claims. Only findings derived from its own inspection and checks become
415
+ reusable learnings; an empty list is valid.
416
+ 6. `/memory retire <id>` makes an obsolete episode ineligible for recall
417
+ without deleting its audit record; `/memory restore <id>` reverses that.
418
+ 7. Common secret patterns are redacted and content hashes deduplicate
419
+ episodes. Full redacted transcript retention is optional and disabled by
420
+ default.
421
+
422
+ Episodic memory can help a later related goal rediscover what previously worked;
423
+ it does not guarantee a preferred stack, enforce architecture, remember every
424
+ discussion, or replace version-controlled project documentation. Run
425
+ `/memory-status` to see recent promoted episodes.
426
+
427
+ Data is namespaced under:
428
+
429
+ ```text
430
+ ~/.pi/agent/pi-goala/
431
+ ├── config.json
432
+ └── memory/
433
+ ├── coala.sqlite3
434
+ └── evidence/<goal-id>/ # only when cold evidence is enabled
435
+ ```
436
+
437
+ Directories are `0700`; configuration, database, manifests, and transcript
438
+ evidence are `0600`.
439
+
440
+ ## Context isolation
441
+
442
+ Goala does not forward the complete planning conversation into
443
+ execution. Interactive planning and execution use separate Pi sessions with a
444
+ small persisted handoff. In `per-step` review, every approved step starts the
445
+ next executor session with only the remaining plan and relevant goal state.
446
+ Automatic execution-to-verification transitions use a signed context boundary
447
+ so each verifier sees the goal, relevant criteria and verification methods,
448
+ and current tool results—not recalled memory or old completion claims.
449
+
450
+ The complete transcript remains local for provenance while provider context is
451
+ bounded to what the current phase needs.
452
+
453
+ ## Evaluation evidence
454
+
455
+ The repository includes deterministic memory/context tests and a reproducible
456
+ end-to-end fixture. Results from the original OpenAI Codex evaluation:
457
+
458
+ | Measurement | Control | Memory flow | Change |
459
+ |---|---:|---:|---:|
460
+ | Hidden contract | FAIL | PASS | Quality improved |
461
+ | Uncached input tokens | 61,577 | 55,380 | -10.1% |
462
+ | Output tokens | 5,488 | 5,693 | +3.7% |
463
+ | Cache-read tokens | 36,864 | 44,544 | +20.8% |
464
+ | Total tokens | 103,929 | 105,617 | +1.6% |
465
+ | Reported cost | $0.310883 | $0.295532 | -4.9% |
466
+
467
+ The isolated executor context shrank from 5,671 to 1,437 characters, a 74.7%
468
+ reduction. The packaged extension was then installed into a clean Pi home and
469
+ passed 6/6 public tests, its independent hidden contract, and Sol verification
470
+ with zero repairs. That packaged run used 98,184 total tokens across 21 calls
471
+ and reported a cost of $0.339985.
472
+
473
+ These are fixture results, not a promise of universal savings. In the paired
474
+ run, uncached input and cost fell while total processed tokens rose slightly
475
+ because cache reads increased. See [the evaluation methodology](docs/evaluation.md).
476
+
477
+ The verifier-grounded 0.2.0 regression also exercised the full formation →
478
+ promotion → fresh-checkout recall path. With only the organically produced
479
+ episode eligible, the fixture again passed its hidden contract with zero
480
+ repairs. That single sample used 4.7% more total tokens and cost 7.3% more than
481
+ its no-memory control, so the evidence supports quality transfer on this
482
+ fixture—not a general token-saving claim.
483
+
484
+ The later per-step benchmark also passed the hidden contract and final
485
+ verification. Pausing for human review after three milestones used 143,765
486
+ tokens and 31 calls—52.3% more tokens than the 94,425-token final-only
487
+ reference. Automatically invoking an independent verifier at every checkpoint
488
+ raised usage to 220,712 tokens. This is why checkpoint `/verify` is optional
489
+ while final independent verification remains mandatory.
490
+
491
+ ## Safety
492
+
493
+ Planning and verification expose only inspection tools and allow-listed
494
+ read-only commands. High-risk execution commands require interactive
495
+ confirmation and are blocked in non-interactive runs.
496
+
497
+ This is application-level policy, not an operating-system sandbox. Pi
498
+ extensions run with the user's filesystem, process, network, and credential
499
+ access. See [security and limitations](docs/security.md).
500
+
501
+ ## Documentation
502
+
503
+ - [Architecture](docs/architecture.md)
504
+ - [Configuration](docs/configuration.md)
505
+ - [Memory model](docs/memory.md)
506
+ - [Evaluation](docs/evaluation.md)
507
+ - [Security](docs/security.md)
508
+ - [Contributing](CONTRIBUTING.md)
509
+
510
+ ## Influences and acknowledgments
511
+
512
+ The memory architecture is inspired by
513
+ [CoALA: Cognitive Architectures for Language Agents](https://arxiv.org/abs/2309.02427),
514
+ especially its separation of working, semantic, procedural, and episodic
515
+ memory. [This memory-system talk](https://www.youtube.com/watch?v=BacJ6sEhqMo)
516
+ prompted the practical placement used here: bounded context for working memory,
517
+ project files for semantic memory, progressively disclosed skills/workflows for
518
+ procedural memory, and distilled cross-session experience for episodic memory.
519
+
520
+ Public implementation notes from
521
+ [Entire's checkpoint architecture](https://github.com/entireio/cli/blob/ec5d9a7610039703017e4fa8c34a070ce47dc3b3/docs/architecture/sessions-and-checkpoints.md#L196-L255)
522
+ informed the general ideas of durable episode provenance, stable identifiers,
523
+ and linking evidence to repository state. Goala is an independent
524
+ implementation and has no Entire runtime, service, SDK, storage-format, or
525
+ installation dependency.
526
+
527
+ ## License
528
+
529
+ MIT
package/SECURITY.md ADDED
@@ -0,0 +1,27 @@
1
+ # Security policy
2
+
3
+ ## Trust model
4
+
5
+ Goala is a Pi extension and therefore runs with the permissions of
6
+ the user who starts Pi. Its command checks and phase-specific tool lists reduce
7
+ accidental changes; they are not an operating-system sandbox.
8
+
9
+ Install only reviewed releases. Use Pi inside a container or other external
10
+ sandbox when the repository or task requires a stronger boundary.
11
+
12
+ ## Memory and secrets
13
+
14
+ Verified episodic memory is stored locally under `~/.pi/agent/pi-goala/` by
15
+ default. Full redacted transcript evidence is opt-in. Common API keys, bearer
16
+ tokens, password assignments, private keys, and credential-bearing database
17
+ URLs are redacted before persistence.
18
+
19
+ Pattern-based redaction cannot guarantee removal of every possible secret.
20
+ Do not place credentials in goals, prompts, source files, test output, or
21
+ verification findings.
22
+
23
+ ## Reporting a vulnerability
24
+
25
+ Before a public repository is created, report vulnerabilities privately to the
26
+ maintainer. The repository's GitHub Security Advisories page will become the
27
+ preferred reporting channel after publication.