PWN::AI::Agent::Learning
PWN::AI::Agent::Learning is the self-improvement engine that closes the pwn-ai feedback loop. It captures task outcomes, mines session transcripts for durable lessons, promotes successful workflows into reusable skills, and keeps ~/.pwn lean (memory + learning.jsonl + mistakes + sessions) so the agent gets sharper over time instead of accumulating noise. Data flows: Loop.run --(tool telemetry)--> Metrics.record Loop.run --(final answer)----> Learning.auto_introspect (opt-in) auto_introspect --(throttled)--> Learning.gc_stores! # ~/.pwn lean model --(tool calls)------> learning_note_outcome / _distill_skill PromptBuilder <----------------- Learning.to_context + Metrics.to_context Everything is file-backed under ~/.pwn so it survives across REPL restarts and is shared by every future session.
When to use
Call PWN::AI::Agent::Learning from pwn_eval when the task needs this module.
Do not reimplement it in shell.
Methodologies
Generated from pwn/ai/agent/learning.rb. Prefer the public class methods below.
Class methods take (opts = {}) and read opts.
How to call
PWN::AI::Agent::Learning.help
PWN::AI::Agent::Learning.evidence_transcript(opts)
Public methods
evidence_transcriptsession_evidenceevidence_completemigrate_evidenceannotate_evidencerollback_evidencenote_outcomeconsistency_checkdisputed_saveoutcomesregression_taskstatsto_contextexemplars_forexport_finetunedistill_skillupdate_skillreflectrsi_tickauto_introspectflip_last_outcomeconsolidateresetreconcile_verdict_tagsprune_outcomesleangc_storespurge_noiselesson_recordlesson_observelesson_promptlist_conflictedrequeue_conflictedcompactauthorshelpcompact!evidence_complete?gc_stores!lean!prune_outcomes!reconcile_verdict_tags!
Source
pwn/ai/agent/learning.rb
Verification
PWN::AI::Agent::Learning.respond_to?(:evidence_transcript) after the
module is loaded. Read the source for parameter names.