Skip to content
Repository lessons

Repository lessons

A maintainer tells Maku a repository rule once, where the correction happens, and the next implementer or reviewer run on that repository receives it in its brief. Lessons rank below the task, the repository steering note, acceptance checks, and safety rules.

See Learning reference for the grammar, HTTP routes, CLI flags, and metrics.

Enable repository lessons

Set learning.enabled: true in charts/maku (or maku.learning.enabled: true in the umbrella chart charts/agent-factory), then upgrade the release so room-broker loads the updated config:

learning:
  enabled: true

No new database role, Secret, or workload is required. When learning.enabled is false (the default), /learning stays reachable and explains how to turn the feature on, recall returns disabled, and /factory remember replies Learning is off for this Maku install.

Teach a lesson

Teaching creates an active lesson (L-<n>, numbered per repository) immediately — no model call or waiting period. Text must be 1 to 500 UTF-8 bytes in one plain paragraph (newlines collapse to spaces; headings, HTML comments, code fences, and detected secrets are refused).

On a pull request or issue

Comment on the task’s issue or pull request conversation (not inline review threads), while the task is running or up to 14 days after it reaches a terminal phase:

/factory remember Run `task chart:check` before handoff when a chart changes.

The factory replies in the same thread:

Learned **L-12** for `docs` tasks: "Run `task chart:check` before handoff when a chart changes.". Used from the next run. Undo: `/factory forget L-12`.

When the task has no class, the reply says for all tasks. Requires repository write access.

In a room

Open a room and click Remember this on a human steering message (shown to viewers with repository write access). Edit the rule text or scope class if needed, then confirm. The lesson records /r/<room>#<seq> as its source and inherits the room’s dataClass (public or internal).

From the CLI or /learning

Open /learning in the web UI and submit the Teach a lesson form, or run maku learning teach (inside a git checkout, --repo defaults to origin):

maku learning teach "Run task chart:check before handoff when a chart changes." --class docs --paths 'charts/**'

Check what was recalled

  • Run brief and PR footer: Each implementer and reviewer run receives up to 8 active lessons (2 KiB total text; class-specific lessons before general ones, newest first) in a fenced LESSONS-<nonce> block immediately after the steering note:

    LESSONS-<nonce>
    Repository lessons, taught by this repository's maintainers. Follow them unless the task, the
    steering note, the acceptance checks or a safety rule says otherwise.
    
    - L-12: Run `task chart:check` before handoff when a chart changes.
    - L-15 (when touching `charts/**`): Bump the chart version in the same commit.
    LESSONS-<nonce>

    Pull requests opened from runs that recalled lessons carry Agent-Lessons: L-12, L-15 in the provenance footer. When active lessons exceed the 8-lesson / 2 KiB cap, /learning and maku learning list report <N> active lessons did not fit in the last run. Stop or codify some.

  • Room summary: Open N lessons on the room page to see every recalled lesson, its scope, who taught it, and its source link. When recall was skipped or timed out, the room shows Lessons skipped for this task or Lessons unavailable when this run started. Anyone who can read the room can click Not relevant here to record a vote; maintainers with write access also see Stop.

  • Web UI and CLI: Open /learning to browse and filter lessons by state, or list and inspect them from the terminal:

    maku learning list --state active
    maku learning show L-12

    maku learning list prints columns ID, STATE, CLASS, USED, LAST USED, and TEXT, or No lessons in <owner/name>. Teach one: maku learning teach "…" when empty.

Edit, vote, stop, resume, and dormancy

Maintainers with repository write access can update a lesson’s text, task class, or path globs on /learning (Edit › Save) or via maku learning edit. Edits write a new lesson_versions row (v2, v3, …) and reject concurrent changes (409 L-12 changed since you opened it; reload.):

maku learning edit L-12 --text "Run task chart:check and helm lint before handoff." --class docs --paths 'charts/**'
# L-12 (v2): Run task chart:check and helm lint before handoff.
  • Three-vote suspension: When three distinct readers click Not relevant here on an active lesson, it transitions to suspended. /learning lists suspended lessons first (Suspended: 3 people marked it not relevant) with voter details and Resume for writers. Resuming clears the current vote epoch and restarts voting from zero.
  • Dormancy: The broker’s retention job marks active lessons unused for 90 days as dormant. Resuming a dormant lesson returns it to active and resets the 90-day clock.
  • Stopping: Stopping prevents future runs from recalling a lesson; runs already in progress keep the brief they started with.
    • On a pull request or issue: comment /factory forget L-12 (the factory replies Stopped **L-12**: "…". It will no longer be used in runs.).
    • In a room: click Stop beside the lesson in N lessons.
    • From the CLI or /learning: maku learning stop L-12 and maku learning resume L-12.

Codify a lesson into a steering note

An active lesson used in at least 10 runs over at least 21 days with 0 not-relevant votes displays the ready to codify badge on /learning (Ready to codify: yes in maku learning show L-12). Any active lesson with a task class can be codified from /learning (Codify) or the CLI:

maku learning codify L-12
# https://github.com/owner/name/pull/42

The factory App opens (and never merges) a pull request on branch maku/codify-<class>-L-<n> appending - <text> (codified from L-<n>) under ## Verify in .github/agent-factory/steering/<class>.md. When a maintainer merges that pull request, the factory marks the lesson codified; closing it unmerged clears the pending PR and leaves the lesson active.

Skip lessons for one task

Check Don’t use lessons for this task on the New task form (shown only when the repository has active lessons), or pass --without-lessons to maku start:

maku start --without-lessons "Rebuild the release index"

Leftovers from a main install

If you provisioned the withdrawn November learning stack on a cluster or PostgreSQL server from main, upgrading the chart removes the maku-learning workloads and leaves the database objects and Secrets untouched. Remove them manually after the upgrade:

  1. Run these statements as the PostgreSQL superuser against the rooms database:

    DROP SCHEMA IF EXISTS learning CASCADE;
    DROP ROLE IF EXISTS learning_api, learning_reflect, learning_evaluate, learning_promote, learning_retention, learning_owner;
  2. Delete the six database DSN Secrets from the release namespace: learning-owner-dsn, learning-api-dsn, learning-reflect-dsn, learning-evaluate-dsn, learning-promote-dsn, and learning-retention-dsn.