learning

package
v0.625.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 17, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package learning implements Pando's opt-in "learner and documentarian" session mode: a per-session policy that makes the agent lean much harder on the knowledge base and memory subsystem, capture non-trivial discoveries as living documentation, actively ask the user what it needs to know, and keep existing documentation honest (updating stale docs and marking superseded ones outdated).

It mirrors the architecture of internal/superpowers, internal/caveman and internal/ponytail: the policy is delivered through the agent's existing per-turn skill injection (see internal/llm/agent.prepareProvider), so it works uniformly across the TUI, Web UI and ACP surfaces, and it composes with user/project skills and with the other session policies.

The mode is enabled with /learning and disabled with /learning-finish. State is session-scoped, ephemeral (process-bounded) and safe for concurrent sessions. There is no configured default: a session that never invoked /learning behaves exactly as before.

Index

Constants

View Source
const AlreadyActiveMessage = "Learning mode is already active. It stays on until /learning-finish."

AlreadyActiveMessage is the idempotent response to re-invoking /learning.

View Source
const NotActiveMessage = "Learning mode is not active. Nothing to finish — you are already in normal mode."

NotActiveMessage is the response to /learning-finish outside the mode.

Variables

This section is empty.

Functions

func ActivationMessage

func ActivationMessage(focus string) string

ActivationMessage is the confirmation shown when the mode is switched on. The focus, when given, is echoed back but not persisted: it only frames the confirmation.

func Enabled

func Enabled(sessionID string) bool

Enabled reports whether Learning mode is active for a session.

func FinishPrompt

func FinishPrompt() string

FinishPrompt returns the prompt for the closing turn run by /learning-finish. It is a normal agent turn: it consolidates what was learned into KB/memory, flags stale docs, and reports. It performs no git side effect.

func Instructions

func Instructions() string

Instructions returns the learner/documentarian policy injected into the system prompt on every turn of an enabled session.

func SetEnabled

func SetEnabled(sessionID string, enabled bool)

SetEnabled enables or disables Learning mode for a session. It is safe for concurrent use and is the single mutation point used by every surface that exposes the /learning commands (ACP, Web UI, TUI).

Types

type State

type State struct {
	Enabled bool
}

State is the per-session Learning state. It is a struct rather than a bare bool so later phases can carry richer session data (e.g. a running learning log) without changing the storage shape.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL