pi-self-learning synthesis
Type: agentic-system-analyses/types/agentic-system-synthesis.md
Bounded synthesis
pi-self-learning implements a trace-fed memory update and later-context pathway: selected coding-session activity becomes model-authored mistakes and fixes, persistent rule files, and text supplied to later agent turns. This is a concrete improvement-directed contribution, not weight training. Whether the changed memory improves future capacity or prevents repeated mistakes remains unestablished. Evidence is inspected code and declared design in SRC-1, extensions/self-learning.ts, README.md and the other tracked package files, frozen at e0d76a93195b11b688ca71da8a8b5700c6541542, with an applicability cutoff of 2026-10-15. No execution trace, generated user memory or causal experiment was supplied. The whole-system boundary covers this extension package, not the enclosing pi agent, provider services or their internal state (source register, RT-RTE-task-reflection).
From task event to admitted memory
The host owns the foreground coding task, tools and task-end event. Extension code owns the reflection sequence. On agent_end, it checks enablement, automatic-reflection settings, the latest assistant's stop reason and a redistill suppression deadline. A stop-ended response is not verified task success. Code selects a recent branch-message tail, filters recognized cancellations and adds bounded permission/blocking error signals. It then sends a separate completion request with embedded mistake/fix instructions. The model sees selected evidence, not the full foreground prompt, separately loaded memory or tools. These isolated requests limit context exposure without compacting the host's accumulated transcript (RT-RTE-task-reflection, MEM-OBJ-branch-messages, workflow account).
The model proposes strings; code admits them. Direct parsing or JSON-object extraction can be followed by one repair completion. Repair receives malformed output, not the original conversation. A nonempty mistakes or fixes list suffices; neither diagnosis truth nor prevention value is checked. Invalid output is rejected before reflection persistence, but plausible false text can pass. Accepted here means structural admission, not evidence-consuming epistemic acceptance. No inspected route evaluates a substantive claim against a truth/prevention criterion and then integrates it on that basis (RT-RTE-task-reflection, epistemic ledger).
Admission appends a dated daily entry, updates a canonical JSON index, renders core and long-term Markdown, attempts optional Git commits and records a short process-local note. Daily entries are already derived reflections, not raw session logs. They lack structural links to source messages or explicit mistake-to-fix relations. Reasons can survive in prose but are not required. Fixes become learnings; deterministic code prefixes mistakes with Avoid:. That conversion changes their policy role without evaluating whether the historical mistake supports the resulting advice (MEM-OBJ-daily, MEM-OBJ-index-text, EPI-RTE-watchout-conversion).
From retained rules to later action
The index separates natural-language content from symbolic access state. Normalized text keys merge repeated entries; hits, scores and age determine priority with per-kind balancing. Repetition raises visibility, not corroboration. The core file contains a bounded selection, default 20 items; long-term memory contains all current indexed rules, not every historical wording or its evidence lineage. Rendering strips the avoidance prefix from watch-outs. If index recovery falls back to rendered core bullets, it can recover only that subset and misclassify stripped watch-outs (MEM-OBJ-index-ranking, MEM-OBJ-core, MEM-CLM-complete-history, EPI-RTE-index-migration).
A later before_agent_start independently selects recent process notes and configured files. Default disk supply is core; daily and monthly files are optional. Selection follows availability, dates, counts and fixed budgets, not the user's query. File text receives per-file and aggregate prefix caps, default 12000 characters for the bundle; core precedes daily and monthly material. Later sections and qualifiers can disappear. Notes are outside that cap and can still arrive when file context is disabled. Long-term text is named by path in consultation guidance, not automatically bundled (RT-RTE-context-injection, RT-OBJ-runtime-notes).
The terminal extension output is a hidden custom message plus optional system-prompt consultation instructions. The external host/model owns subsequent action. Retained prose supplies historical context and potentially standing prevention advice; fixed metadata separately controls ranking and routing. Even strict mode requests consultation rather than intercepting answers or verifying reads. Thus wired delivery and afforded file consultation are distinct from exercised reliance or enforced use (RT-BAP-memory-policy, RT-CLM-strict-consultation, profile verification).
Maintenance and failure boundaries
Manual reflection uses the same producer but bypasses the automatic completion and suppression gates. Monthly summarization selects daily files by month, supplies bounded text to a completion model and overwrites the month's summary if output is nonempty. Global redistill selects scored rules, rewrites them in chunks and merges normalized collisions; missing response IDs retain original text. Requests to preserve meaning and remove project specifics are not semantic checks. Invocation, preview and coarse batch confirmation are not per-rule human approval. Monthly and redistill maintenance bypass the learning-enabled toggle; redistill dry-run suppresses final rewrites but can initialize a missing core during loading (RT-RTE-task-reflection, RT-RTE-month-summary, RT-RTE-core-redistill).
The representative workflow therefore connects task-end reflection to later delivery, but not to a verified better coding result. Automatic errors are mostly silent; manual commands expose diagnostics. Multi-file writes are not transactional, optional Git is best effort, and no automatic rollback repairs partial writes. Redistill changes current rules without revising old journals, summaries or process notes, so later inputs can contain inconsistent formulations. Memory roots can be project-wide or global; process notes are not keyed by root or branch. Branch controls are not isolation boundaries, and callback/process write serialization is unestablished (workflow account, memory write side, RT-RTE-runtime-controls).
What kind of improvement is supported?
Automatic trace-fed writes produce durable behavior-shaping artifacts with later consumers. This supports wired trace learning from conversational turns and tool feedback, including manually initiated reflection. Unknown legacy-file origins do not erase that positive pathway, but prevent classifying every maintenance input as trace-derived. Neither this classification nor repeated rewrites establishes improved capacity (MEM-OBJ-branch-messages, RT-RTE-task-reflection, profile verification).
The independent theory-builder findings remain separate: condition 1, localized theory content, is afforded by individually retained rule strings; condition 2, decisions depending on their content, is uninspected; condition 3, claim-directed criticism with explicit blame and resulting changed reliance, is uninspected; condition 4, retained criticism shaping another round, is uninspected. Actual generated prose is unavailable. No evidence shows that criticism of a consumed theory improved future capacity. Reflection has a wired session-self-representation and later context path, but reciprocal behavioral effect is unobserved. Computation performs proposal dispatch, parsing and writes without item approval; autonomous performance of all theory-builder operations, and a reflective theory builder, are not established (RT-RTE-task-reflection).
For extension-owned memory/context organization across sessions, the independently stated objective is preventing repeated mistakes. Trace input shapes proposed updates, accepted updates change retained organization, and that organization has a live delivery channel capable of influencing later action. This is a dispositional improvement-directed self-change pathway. Subsequent operation causally depending on the change—the fourth self-improvement link—is unestablished; exercised self-improvement and successful improvement therefore remain unestablished separately. The extension does not update model parameters; external provider mutability is unresolved (RT-RTE-task-reflection, RT-CMP-reflection-model).
For recurring-task historical recall, the implemented contribution is bounded availability of recent and recurrent candidate lessons. For verified mistake prevention or cross-project reuse, neither structural admission, frequency ranking nor requested generalization supplies the required warrant. A linked trace from session evidence through admitted rule, delivered text and a content-dependent later decision would change the activation assessment. Outcome comparisons would be needed for benefit, with attribution no finer than the intervention compared. Input/output comparisons or an implemented evidence-consuming semantic evaluator could change the fidelity and acceptance assessment; cross-copy withdrawal and transactional recovery would change maintenance guarantees. No product ranking or transfer recommendation follows from the present account (EPI-CLM-prevention-scope, epistemic bounded conclusion).
Limitations
| Limitation | Affected SRC IDs and record citations | Inspected boundary | Conclusion prevented | Evidence that would resolve it |
|---|---|---|---|---|
| Registration-count reporting conflict; verification identifies eight handlers, not the nine stated in boundary/runtime. | SRC-1; RT-RTE-runtime-controls, report-verification Limits, boundary coverage | Complete tracked extension; extensions/self-learning.ts. |
The members do not supply a consistent count; readers must not repeat nine. Verification settles the source count without changing supported route coverage. | Corrected originating members in an authorized correction or new run; no further source evidence is needed for the count. |
| No supplied execution or outcome comparison. | SRC-1; RT-RTE-task-reflection, RT-RTE-context-injection, RT-BAP-memory-policy | Package implementation and doctrine, excluding host internals and deployed operation. | Actual host application, consultation, content-dependent decisions, theory-builder conditions 2–4, exercised self-improvement and prevention benefit cannot be established. | Linked execution evidence through later action; relevant criticism/revision traces; scoped outcome comparisons for benefit and causal attribution. |
| Generated and pre-existing memory content/provenance is unavailable. | SRC-1; MEM-OBJ-daily, MEM-OBJ-index-text, MEM-OBJ-monthly, RT-RTE-core-redistill | Inspected schemas, prompts and transformations, not actual user memory. | Truth, retained reasons, semantic preservation, novelty, effective generalization and complete legacy lineage/admission/trace-source classifications remain unresolved. | Provenance-linked inputs and outputs, original admission records and scoped semantic or transfer checks. |
| Persistence and coordination are wired rather than observed. | SRC-1; RT-RTE-task-reflection, RT-RTE-core-redistill | Filesystem/Git call sites and hook control flow; deployed scheduling excluded. | Successful durable history, serialized concurrent updates and recovery after partial failure are not established; optional Git does not guarantee rollback. | Filesystem/commit and concurrency traces; enforced coordination and transactional or tested recovery mechanisms. |
| Provider and enclosing-host implementations are external. | SRC-1; RT-CMP-reflection-model, RT-BAP-memory-policy | Extension API call sites and symbolic model references. | Exact deployed weights, provider mutation, host isolation and end-to-end integration guarantees cannot be inferred. | Separately authorized pinned dependency evidence and deployment traces. |