Skip to content

tri learn: save a lesson into a skill's Traps section once, in .t27 #11060

Closed

Description

@gHashTag

Part of the night-loop epic. A lesson learned in one lane (a sandbox trap, a gate shape, a measured number) is lost unless someone edits the right skill by hand. tri already has experience commands; the gap is saving a lesson into the right skill section, once, without duplicates.

Goal

tri learn add --skill <name> "<lesson>" appends one lesson to that skill's Traps section if no equivalent lesson is there, and prints the file and line; the decision is made in .t27.

Requirements

  • FR-001: The author MUST first search for what exists (tri experience, /experience-save, .trinity/experience.md, specs/tri/) and MUST extend an existing command instead of adding a second one if it can take the same job; the PR body MUST state what was found.
  • FR-002: The decisions MUST live in a .t27 spec with tests: the normalised key of a lesson (case, spaces and punctuation folded), duplicate detection against the existing lines of the section, the row format (- <date> <lesson> (<ref>)), refusal of an empty lesson, of a lesson longer than 400 bytes and of a lesson that contains a secret-shaped token.
  • FR-003: The command MUST write only inside the named skill's file and MUST refuse a skill name that is not a directory under .claude/skills/; a second run with the same lesson MUST change nothing and print duplicate.
  • FR-004: Hand-written Rust MUST stay under the glue caps and net zero or negative.

Scenarios

  • Given a skill with a Traps section, when tri learn add runs with a new lesson, then one line is added and its position is printed.
  • Given the same lesson again, then nothing changes and the output says duplicate.
  • Given a lesson that looks like a token, then it is refused and nothing is written.

Boundary

  • specs/tri/loop/lesson.t27
  • cli/tri/src/main.rs
  • .trinity/seals/tri_loop_lesson.json
  • gen/rust/tri/loop/lesson.rs

Success Criteria

  • t27c test-report specs/tri/loop/lesson.t27 passes with at least 10 tests and vacuous passes 0.
  • t27c seal --verify specs/tri/loop/lesson.t27 exits 0.
  • Running tri learn add twice with the same lesson on a temp copy of a skill changes the file 1 time.
  • ./target/release/tri learn --help exits 0 and ./target/release/tri types ratchet exits 0.

Activity

  1. added 3 commits that reference this issue on Oct 19, 2026
    f89ad01
    03233d5
    3ca8398
  2. added a commit that references this issue on Oct 19, 2026
    fe17653
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions