sisi 0.2.0: the self-improvement loop, and every major harness
ci / tests (macos-latest, python 3.10) (push) Canceled after 0s
ci / tests (macos-latest, python 3.11) (push) Canceled after 0s
ci / tests (macos-latest, python 3.13) (push) Canceled after 0s
ci / tests (macos-latest, python 3.9) (push) Canceled after 0s
ci / tests (ubuntu-latest, python 3.10) (push) Canceled after 0s
ci / tests (ubuntu-latest, python 3.11) (push) Canceled after 0s
ci / tests (ubuntu-latest, python 3.13) (push) Canceled after 0s
ci / tests (macos-latest, python 3.10) (push) Canceled after 0s
ci / tests (macos-latest, python 3.11) (push) Canceled after 0s
ci / tests (macos-latest, python 3.13) (push) Canceled after 0s
ci / tests (macos-latest, python 3.9) (push) Canceled after 0s
ci / tests (ubuntu-latest, python 3.10) (push) Canceled after 0s
ci / tests (ubuntu-latest, python 3.11) (push) Canceled after 0s
ci / tests (ubuntu-latest, python 3.13) (push) Canceled after 0s
Lessons take effect when recorded, are offered to later agents starting the same kind of work, are counted as listed and read, and are strengthened when the mistake recurs: note, rule, enforced check. `sisi cycle` consolidates them from normal use with no scheduler; `sisi improve` reports the effect. Wiring for Codex, Gemini CLI, Copilot CLI, Qwen Code, Pi, Cursor, OpenCode and rulebook loading for nine more tools, with a dry run, preflight checks and a tested uninstall guarantee. Time to delivery is measured per turn. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 parent
d2ed821480
commit
7a097f94c7
29 files changed
+7001
-235
No files matched your search
@@ -4,6 +4,7 @@
|
||||
|---|---|
|
||||
| [../README.md](../README.md) | learn what sisi is, install it and try it |
|
||||
| [design.md](design.md) | understand why sisi works the way it does, and what is built versus only designed |
|
||||
| [learning.md](learning.md) | how a recorded lesson takes effect, is measured, strengthened, consolidated or withdrawn |
|
||||
| [personal-data.md](personal-data.md) | know where sisi keeps what it learns, how the overlay works, and what an update touches |
|
||||
| [verifier-format.md](verifier-format.md) | write or review an entry in the verifier library (`verifiers/`) or a recipe (`done/`) |
|
||||
| [developing.md](developing.md) | work on sisi while also using it: the source folder, stable releases and rollback |
|
||||
|
||||
+28
-13
@@ -35,8 +35,9 @@ and 90th percentile for the last 7 days against the 7 days before, the share spe
|
||||
slowest checks; `sisi status` shows the 7-day median.
|
||||
|
||||
A learned change that speeds things up but fails a check is rejected. A learned change that keeps every check
|
||||
passing but makes median delivery slower is flagged for reversal. (The measurement exists; the automatic
|
||||
flagging belongs to the learning loop, which is not built.)
|
||||
passing but makes median delivery slower is flagged for reversal. (Built: `sisi cycle status` flags a cycle
|
||||
whose deliveries got worse, and the next cycle brief puts reverting or repairing it first. There is still no
|
||||
replay testing before a learned change ships; it lands in the personal overlay and is judged after.)
|
||||
|
||||
## Why the first design was thrown out
|
||||
|
||||
@@ -160,7 +161,11 @@ ledger file, to match delegations with sessions when it builds the task set.
|
||||
|
||||
## Part 3: learning that compounds
|
||||
|
||||
The data layer of this part is built; the model-driven loop that would act on it is not.
|
||||
The agent-run loop over retro lessons is built: lessons take effect at once, are delivered at matching
|
||||
moments, are measured per lesson, climb a strength ladder, and are consolidated by `sisi cycle`
|
||||
([learning.md](learning.md)). The heavier machinery designed below — background runs, replay experiments on a
|
||||
task set before shipping, the taste judge — is not built; the built loop ships to the personal overlay first
|
||||
and judges by measured deliveries, with exact revert and withdrawal as the safety net.
|
||||
|
||||
**Signals, strongest first.** The loop learns from outcomes that do not depend on a model's opinion:
|
||||
|
||||
@@ -170,10 +175,13 @@ The data layer of this part is built; the model-driven loop that would act on it
|
||||
4. The human's corrections and the agent's questions, read from transcripts by a classifier. Useful for finding
|
||||
causes, weakest as proof.
|
||||
|
||||
**Trigger.** Each tool's session-start hook runs `sisi tick`, which returns quickly. The design has it start a
|
||||
detached background run when there is work and budget, with one lock in the store preventing overlap, so a tick
|
||||
from any tool processes sessions from all tools. Today `sisi tick` records the session baseline and checks the
|
||||
wiring; it starts no background run.
|
||||
**Trigger.** There is no scheduler and no background run. Whether consolidation is due is a counter check made
|
||||
during normal use: the session-start hook (`sisi tick`), the end-of-turn gate on an otherwise-clean stop, and
|
||||
the output of `sisi retro`, `sisi verify` and `sisi done for` — so tools without hooks are covered by commands
|
||||
agents run anyway. A session is told at most once until 20 further checks pass or the counter grows. Two
|
||||
sessions consolidating at once are kept apart by the personal-data lock and a base version in the cycle file:
|
||||
the second apply is refused and re-reads a fresh brief. (The earlier design of tick starting detached
|
||||
background runs on a budget was dropped for this simpler trigger.)
|
||||
|
||||
**What the loop would produce.**
|
||||
|
||||
@@ -189,9 +197,11 @@ wiring; it starts no background run.
|
||||
product are saved for the next one.
|
||||
- **Brief templates**, from what the ledger shows fixed rejected work.
|
||||
|
||||
**Testing a change.** Splitting live sessions between old and new rules proves about one change every three or
|
||||
four days, which is too slow. The main test is a task set built from the user's own work, re-run in the
|
||||
background:
|
||||
**Testing a change.** (Not built; the built loop takes the opposite order by decision — a change lands in the
|
||||
personal overlay at once and is judged by measured deliveries, because waiting for replay evidence left every
|
||||
lesson inert. What follows is the replay design that may still be added.) Splitting live sessions between old
|
||||
and new rules proves about one change every three or four days, which is too slow. The main test is a task set
|
||||
built from the user's own work, re-run in the background:
|
||||
|
||||
- **Human tasks.** A project as it was when a session began, the request the human typed, and what they ended up
|
||||
accepting. In a census of one user's history, only a fraction of sessions were usable as tasks and a smaller
|
||||
@@ -278,6 +288,10 @@ Built and covered by tests:
|
||||
- The rulebook (`canon/core.md`), the minimum-rung floors, the verifier library and the recipes.
|
||||
- Retrospectives and lessons (`sisi retro`, `sisi lessons`), `sisi learn` with quarantine, time to delivery
|
||||
(`sisi time`), `sisi audit`.
|
||||
- The lesson loop: immediate effects in the overlay (field notes, draft recipes, learned notes, `sisi backlog`),
|
||||
moment-of-use delivery with recorded showings, per-lesson measurement, the strength ladder with enforced
|
||||
checks, `sisi cycle` (due counter, brief, validated apply under lock and base version, exact revert, status
|
||||
with worse-cycle flagging) and `sisi improve`.
|
||||
- Personal data, the overlay, update, export and import, releases and rollback, promotion of a personal item
|
||||
into the product.
|
||||
- The data layer for learning: harvest of Claude Code transcripts, task set, ground truth, escape candidates,
|
||||
@@ -286,8 +300,8 @@ Built and covered by tests:
|
||||
Designed, not built:
|
||||
|
||||
- The conductor (`sisi build`) and the oracle queue (`sisi inbox`).
|
||||
- The model-driven learning loop: background runs started from `sisi tick`, experiments on the task set, shipping
|
||||
and removal of learned changes, brief templates, playbooks.
|
||||
- Replay experiments on the task set before a learned change ships, brief templates, playbooks. (Shipping and
|
||||
removal of learned changes exist in the simpler ship-first-measure-after form described in Part 3.)
|
||||
- The taste judge and rung 5 judging by a model.
|
||||
- Blocking gates for tools other than Claude Code.
|
||||
- Harvest sources other than Claude Code.
|
||||
@@ -299,7 +313,8 @@ Designed, not built:
|
||||
2. Signals and scoreboard: transcript adapters, git survival, and a delegation ledger. Partly built (Claude Code
|
||||
transcripts, task set, scoreboard; no git survival signal).
|
||||
3. The conductor and the oracle queue. Not built.
|
||||
4. The loop: coach, replay filter, experiments, shipping and removal. Not built.
|
||||
4. The loop: coach, replay filter, experiments, shipping and removal. Partly built (the lesson loop ships,
|
||||
measures and removes; the coach as a separate model run, the replay filter and experiments are not built).
|
||||
5. The taste judge and playbooks. Not built.
|
||||
|
||||
sisi's own checks: wiring is idempotent and touches no other byte (property tests); the gate cannot be passed
|
||||
|
||||
@@ -0,0 +1,203 @@
|
||||
# Harnesses: what sisi does in each tool
|
||||
|
||||
`sisi install` wires every tool it finds (a tool whose configuration folder is missing is skipped and
|
||||
reported). `sisi doctor` shows the same state as this file, per tool: whether the rulebook is loaded,
|
||||
whether lessons print at session start, how the end of a turn is enforced, and anything you must do
|
||||
yourself. `sisi install --dry-run` prints exactly what would be created, edited (with unified diffs) or
|
||||
skipped, and changes nothing.
|
||||
|
||||
The uninstall guarantee, exactly: a file you have not edited since install is restored byte for byte, or
|
||||
removed if sisi created it (a symlink is never deleted by uninstall; symlinked configs are written
|
||||
through, and dangling symlinks are refused and left alone). A file you have edited since install keeps
|
||||
your edits — uninstall removes only sisi's own entries, by textual span edits, leaving every other byte
|
||||
(formatting, number and string spellings, duplicate keys) as it was; empty containers sisi itself added
|
||||
(an emptied `hooks` object, a seeded `"version": 1`) are removed only when the backup proves sisi added
|
||||
them. A generated plugin or extension you edited since install is left alone entirely. Any file sisi
|
||||
cannot parse or edit with certainty (invalid or commented JSON, duplicate keys on a path being edited,
|
||||
an unrecognised `read:` shape in Aider's config, a read-only or unreadable file) is skipped and
|
||||
reported, never rewritten. Backups are content-addressed under `<personal>/install/backups/`
|
||||
in an owner-only (0700) folder, each with its source file's permissions.
|
||||
|
||||
Wiring is always by reference: an import line, a symlink to the generated rulebook
|
||||
(`~/.local/share/sisi/generated/core.md`), hook entries that run `sisi tick --tool NAME` /
|
||||
`sisi gate --tool NAME`, or a small generated plugin/extension (recognised by its exact
|
||||
`sisi:generated …` first line, never by the words appearing anywhere else in the file). Every registered
|
||||
shell hook command first checks the sisi launcher still exists, so deleting the sisi folder without
|
||||
uninstalling makes hooks exit silently instead of erroring on every turn. The per-tool translation
|
||||
between each tool's hook JSON and the gate lives in `sisi/hookio.py`; the adapters live in
|
||||
`sisi/adapters.py`; the textual JSON editing lives in `sisi/hookjson.py`. Hooks fail open: any error
|
||||
lets the agent finish.
|
||||
|
||||
## Claude Code
|
||||
|
||||
Fully wired, as before: an `@import` line in `~/.claude/CLAUDE.md`, `SessionStart` → `sisi tick`,
|
||||
`Stop`/`SubagentStop` → `sisi gate` (blocking) in `~/.claude/settings.json`. Nothing for you to do.
|
||||
|
||||
## Codex CLI
|
||||
|
||||
Rulebook symlink at `~/.codex/AGENTS.md` (or `$CODEX_HOME/AGENTS.md`), plus hooks in
|
||||
`~/.codex/hooks.json`: `SessionStart` → tick, `Stop`/`SubagentStop` → gate, blocking with
|
||||
`{"decision":"block","reason":...}`. One step is yours: Codex only runs hooks you have trusted, by exact
|
||||
definition hash. After `sisi install`, open Codex, run `/hooks`, and trust the sisi hooks; repeat after
|
||||
any change to the hook commands (for example after moving the sisi clone). `sisi doctor` cannot verify
|
||||
trust from the files it knows, so it always reminds you. Verified: the session-start hook was observed
|
||||
firing with its documented payload in a throwaway home (a full turn needs your Codex login, so the block
|
||||
itself rests on the documented output shape and unit tests). Note Codex caps model-visible hook output
|
||||
at roughly 2,500 tokens and spills the rest to a file, so a long gate report arrives as a preview plus a
|
||||
file path.
|
||||
|
||||
## Gemini CLI
|
||||
|
||||
Rulebook symlink at `~/.gemini/GEMINI.md`, hooks merged into `~/.gemini/settings.json`: `SessionStart`
|
||||
→ tick (lessons injected as `additionalContext`), `AfterAgent` → gate (`{"decision":"deny","reason":...}`
|
||||
rejects the response and forces a retry). Built from the hooks reference; Gemini is not installed on the
|
||||
development machine, so this has not run live. Gemini has no subagent-stop event in its hook list, so
|
||||
only the main turn is gated.
|
||||
|
||||
## GitHub Copilot CLI
|
||||
|
||||
Rulebook symlink at `~/.copilot/copilot-instructions.md` (or under `$COPILOT_HOME`), hooks in
|
||||
`~/.copilot/hooks/sisi.json`: `sessionStart` → tick (`additionalContext`), `agentStop`/`subagentStop` →
|
||||
gate (`{"decision":"block","reason":...}` forces another turn). Verified end to end in a throwaway home:
|
||||
a secret planted in session-start context was answered by the model, and a blocking `agentStop` visibly
|
||||
forced a second turn. The cloud coding agent only runs hooks committed in the repository
|
||||
(`.github/hooks/*.json`); sisi does not write repository files, so cloud enforcement needs such a file
|
||||
copied from your `~/.copilot/hooks/sisi.json` if you want it.
|
||||
|
||||
## Qwen Code
|
||||
|
||||
Rulebook symlink at `~/.qwen/QWEN.md`, hooks merged into `~/.qwen/settings.json`: `SessionStart` → tick,
|
||||
`Stop`/`SubagentStop` → gate (blocking, Claude-shaped output). The `~/.qwen` folder appears on Qwen's
|
||||
first run, so run Qwen once before `sisi install`. Verified: the session-start hook was observed firing
|
||||
with its documented payload (a full turn needs an auth type configured). Qwen's question tool is named
|
||||
`ask_user_question` (the rulebook still names Claude Code's dialog; generalising that wording is future
|
||||
work).
|
||||
|
||||
## Pi
|
||||
|
||||
Rulebook symlink at `~/.pi/agent/AGENTS.md` (or `$PI_CODING_AGENT_DIR/AGENTS.md`; skipped if you already
|
||||
have your own file there) plus a generated extension at `~/.pi/agent/extensions/sisi.ts`. The extension
|
||||
runs `sisi tick` on `session_start` and injects the lessons at `before_agent_start`, and runs the gate on
|
||||
`agent_before_settle`, forcing one continuation with the failure report when checks fail (capped by the
|
||||
gate's own three send-backs). Verified: the extension loads in real Pi and tick runs; the blocking
|
||||
continuation could not be exercised end to end without a model login in the throwaway home.
|
||||
|
||||
## Cursor
|
||||
|
||||
Hooks merged into `~/.cursor/hooks.json`: `sessionStart` → tick (lessons as `additional_context`),
|
||||
`stop`/`subagentStop` → gate. Cursor cannot veto a stop; instead a non-empty `followup_message` is
|
||||
auto-submitted as the next user message, which is how the gate sends the agent back (Cursor caps this at
|
||||
5 per script by default; sisi's own cap is 3). Only completed (not aborted/error) stops are gated.
|
||||
There is no confirmed user-global instruction *file* for Cursor, so sisi wires no global rulebook there;
|
||||
project-level `AGENTS.md` files still load as usual. Built from the hooks documentation — a live run
|
||||
needed a Cursor login that the throwaway home did not have.
|
||||
|
||||
## OpenCode
|
||||
|
||||
Rulebook symlink at `~/.config/opencode/AGENTS.md` plus a generated plugin at
|
||||
`~/.config/opencode/plugins/sisi.js`. The plugin runs `sisi tick` when a session is created and the gate
|
||||
when the session goes idle, and then tries to continue the session with the failure report through the
|
||||
client prompt API where one exists. Be clear about the limits: `session.idle` fires after the agent has
|
||||
finished and cannot veto anything, and on OpenCode v2.3.2 no plugin event delivery or lesson injection
|
||||
could be confirmed in headless runs (the plugin itself is loaded — verified — and the v1-style hooks and
|
||||
v2 `setup()` registration are both attempted, all fail-open). Treat OpenCode enforcement as unproven
|
||||
until it is observed on your version; `sisi doctor` says `unknown` on purpose.
|
||||
|
||||
## Muse Code
|
||||
|
||||
Nothing is wired directly, and `sisi doctor` says why. There is no documented native global instruction
|
||||
path (independent tooling ships `supportsGlobal:false` rather than guess one), so sisi invents no path.
|
||||
Muse loads foreign personal context by default — `~/.claude/CLAUDE.md` and `~/.codex/AGENTS.md` — so the
|
||||
rulebook already reaches it whenever Claude Code or Codex is wired (unless you pass
|
||||
`--no-foreign-personal-context`). Hooks are not wired: the installed binary's hook event list
|
||||
(`SessionStart`, `PreToolUse`, …, `SubagentStop`, `SessionEnd`, `StopFailure`, …) contains no plain
|
||||
end-of-turn `Stop`, and the global hook location/shape via plugins is unconfirmed. Muse's question tool
|
||||
is `request_user_input`.
|
||||
|
||||
## Antigravity
|
||||
|
||||
No separate wiring. Antigravity shares `~/.gemini/GEMINI.md` with Gemini CLI, so the Gemini symlink also
|
||||
serves it. Its hooks are not wired: whether the CLI fires hooks at all is disputed in the sources, and
|
||||
the always-on size budget (a per-file cap around 24 KB) is unconfirmed, so the full rulebook may shrink
|
||||
to a pointer there. `sisi doctor` lists it as unknown when its folders are present.
|
||||
|
||||
## Windsurf (Devin Desktop)
|
||||
|
||||
Global rules are size-capped (6,000 characters for the global file in the sources checked), so sisi
|
||||
cannot link the whole rulebook in. Instead, when no global rules file exists, sisi writes a short
|
||||
pointer at `~/.codeium/windsurf/memories/global_rules.md` telling Cascade to read the generated rulebook
|
||||
and run the contract workflow itself. An existing user file there is left alone. Evidence: the file name
|
||||
and cap are from Cascade's own documentation; the on-disk path is only secondary-sourced, whether
|
||||
Cascade reliably follows such a pointer is unconfirmed, and no session-start or blocking hook is
|
||||
confirmed, so there are no lessons at session start and no gate.
|
||||
|
||||
## Cline
|
||||
|
||||
Rulebook symlink into the global rules directory (`~/Documents/Cline/Rules/sisi.md`, or
|
||||
`~/.cline/rules/sisi.md` when only that exists). Evidence: confirmed — Cline's own rules documentation
|
||||
(linux path included) was read during implementation; that the extension follows the symlink was not
|
||||
verified live (Cline is not installed here). Cline has hooks, but they must be enabled in its settings
|
||||
and no contract is confirmed under which the task-end hook can send the agent back, so sisi wires no
|
||||
gate. Cline's question tool is `ask_followup_question`.
|
||||
|
||||
## Kiro
|
||||
|
||||
Rulebook symlink at `~/.kiro/steering/AGENTS.md` (Kiro always includes `AGENTS.md` files in the global
|
||||
steering folder; frontmatter-less steering files also default to always-included). Kiro hooks are
|
||||
trigger-to-action automations with no confirmed way to veto the end of a turn, so there is no gate.
|
||||
|
||||
## Zed
|
||||
|
||||
Rulebook symlink at `~/.config/zed/AGENTS.md`. Zed's built-in agent has no hooks; external agents run
|
||||
through Zed (ACP) bring their own tool's wiring with them.
|
||||
|
||||
## Goose
|
||||
|
||||
Rulebook symlink at `~/.config/goose/.goosehints` (the global hints file; project `AGENTS.md` files load
|
||||
as usual). Evidence: not confirmed live — the path comes from Goose's published goosehints documentation
|
||||
as surfaced in search results during implementation; the docs site itself could not be fetched then, and
|
||||
Goose is not installed here, so neither the path nor symlink loading was verified live. Goose lifecycle
|
||||
hooks ship in plugins, but on the documented contracts they cannot inject model-visible context or force
|
||||
a continuation, so sisi wires no gate.
|
||||
|
||||
## Amp
|
||||
|
||||
Rulebook symlink at `~/.config/amp/AGENTS.md`. Evidence: the path is confirmed — Amp's own AGENTS.md
|
||||
documentation (ampcode.com/docs) was read during implementation and names `$HOME/.config/amp/AGENTS.md`
|
||||
explicitly; the original research notes had marked it unconfirmed pending that check. Loading was not
|
||||
verified live (no signed-in Amp run in a throwaway home). No blocking end-of-turn hook is confirmed in
|
||||
Amp's documentation, so there is no gate.
|
||||
|
||||
## Grok CLI
|
||||
|
||||
Rulebook symlink at `~/.grok/AGENTS.md` (or `$GROK_HOME/AGENTS.md`) — verified with `grok inspect`,
|
||||
which lists it as a global instruction file under either home. Grok has hooks, but session-start hook output is reportedly discarded before reaching
|
||||
the model and no blocking stop contract is confirmed, so sisi wires no hooks. (Grok also reads Claude
|
||||
Code-compatible configuration; whether sisi's Claude hooks fire under Grok is not relied on.)
|
||||
|
||||
## Crush
|
||||
|
||||
Rulebook symlink at `~/.config/crush/CRUSH.md` (or `$XDG_CONFIG_HOME/crush/CRUSH.md`, honoured as
|
||||
`crush dirs` confirms; one of Crush's default global context paths, confirmed from the binary's own
|
||||
configuration schema). Crush hooks currently support only `PreToolUse`, which is not a turn gate, so
|
||||
sisi wires no hooks. Revisit when its session/turn hook events ship.
|
||||
|
||||
## Aider
|
||||
|
||||
Aider auto-discovers no instruction file. When `~/.aider.conf.yml` already exists, sisi adds the
|
||||
generated rulebook to its `read:` list (creating the file would change Aider's defaults, so sisi never
|
||||
creates it — create it yourself, even empty, and re-run `sisi install`). Aider has no hooks at all, so
|
||||
nothing enforces the rulebook there.
|
||||
|
||||
## T3 Code and Orca
|
||||
|
||||
Both are hosts, not agents: they run other harnesses (Claude Code, Codex, OpenCode, Cursor, Pi, Muse
|
||||
Code and friends) as providers, and each provider loads its own global instructions and fires its own
|
||||
hooks. There is nothing T3- or Orca-specific to wire; wire the providers and both are covered.
|
||||
`sisi doctor` lists them as covered through their providers and names which providers are wired.
|
||||
|
||||
## Not wired
|
||||
|
||||
Roo Code was discontinued (2026-05-15) and gets no wiring; any remaining installs still read project
|
||||
`AGENTS.md`. Agents beyond the list above that read a project `AGENTS.md` (Factory, Warp, Junie and
|
||||
similar) are covered by the project file, with no per-tool wiring and no gate.
|
||||
@@ -0,0 +1,147 @@
|
||||
# How sisi learns
|
||||
|
||||
**There is nothing to schedule. You install it and use your AI; it improves from use.** No cron, no
|
||||
timers, no daemons, nothing to set up. Every step below happens inside commands and hooks that run
|
||||
because you used a tool: recording a lesson at the end of a piece of work, starting a session, asking
|
||||
what "done" means, verifying, or being sent back by the gate.
|
||||
|
||||
## The loop in plain words
|
||||
|
||||
1. **A lesson is recorded.** At the end of each piece of work the agent answers how it could have gone
|
||||
better (`sisi retro`): the aim it fell short of, the concrete moment, why, and the change to sisi
|
||||
that would make the next agent do it right without being told. It also names, with `--when` (at
|
||||
least five comma-separated words or short phrases, required), the kinds of work the lesson applies
|
||||
to in the words a different agent would use, synonyms included — for a CSV lesson: "csv, tsv,
|
||||
spreadsheet, tabular data, import, export, parse, delimited file". This matters because word
|
||||
overlap alone cannot bridge "CSV" and "spreadsheet": the recording agent, who knows what the lesson
|
||||
is about, supplies the bridge vocabulary in advance. Lessons recorded before when-terms existed
|
||||
keep working by their own wording and are listed in the cycle brief so a consolidating agent can
|
||||
add terms.
|
||||
2. **It takes effect at once**, in your personal data (the overlay), never in the product files:
|
||||
- a verifier or recipe lesson naming an entry is attached to it as a field note straight away;
|
||||
- a recipe lesson naming a recipe that does not exist is kept as a draft recipe note;
|
||||
- a rule, oracle or brief lesson becomes an active learned note with trigger words taken from its text;
|
||||
- a tool lesson (a change to sisi itself) goes on the backlog (`sisi backlog`, most seen first).
|
||||
In developer mode, a session started inside the sisi source folder is told the top item.
|
||||
3. **It is shown at the moment it matters**, not only at session start. Session start prints up to
|
||||
eight active lessons, strongest first. `sisi done for`, `sisi done ID`, `sisi verifiers for` and
|
||||
`sisi contract init` print a two-part block, because the asking agent is a far better matcher than
|
||||
word overlap: part one, "likely to apply", holds at most three lessons in full and only on a
|
||||
strict test (at least two of the request's own content words inside the when-terms, or one plus
|
||||
the lesson's target being the entry being printed); part two lists every remaining loose lesson as
|
||||
a one-line heading (best overlap first, within a 1,500-character budget, saying how many were left
|
||||
out) for the agent to open with `sisi lessons show ID`. Being printed or listed counts as
|
||||
*listed*; opening counts as *read* — the two are reported separately, because "listed many times,
|
||||
never read, still recurs" means the heading is bad, and the cycle brief says so. `sisi verifiers
|
||||
show` and the gate's send-back message keep the older single strong-match block. Draft recipe notes
|
||||
appear in `sisi done for` when their words match. Lesson text is always framed as information to
|
||||
weigh, not as commands, and text from a lesson is never executed.
|
||||
4. **Showings are counted.** Every time a lesson is printed or listed, sisi records which lesson, in
|
||||
which session, and where; opening one in full counts separately as read. Promotion needs at least
|
||||
two listings or readings since the last promotion. A later sighting of the same problem — a retro recorded with `--same-as`, which
|
||||
is also where the "a similar lesson exists" answer sends you — is a recurrence. When sisi itself
|
||||
spots the resemblance and refuses a duplicate, that unconfirmed sighting is recorded too (shown by
|
||||
`sisi lessons show ID` and in the cycle brief), so it is not lost even if the agent files its lesson
|
||||
separately; it counts toward strengthening only once confirmed with `--same-as`. Recurrences after a
|
||||
lesson has been shown are the signal that the lesson is not working.
|
||||
5. **Recurring lessons get stronger.** Each lesson has a strength: 1 (a note), 2 (a candidate rule),
|
||||
3 (enforced). A recurrence after at least two showings since the last promotion moves it up one
|
||||
step — each step needs its own fresh evidence. A strength-2 lesson
|
||||
becomes a real rule only through consolidation (below), because the rulebook has a hard budget of
|
||||
120 lines and must not grow. A strength-3 lesson needs a check the gate can run; a folded lesson
|
||||
shown 20 times with no recurrence is retired from the notes (it stays in history); a lesson that
|
||||
still recurs at strength 3 is withdrawn, and the same wording will not be learned again.
|
||||
6. **Consolidation happens in a cycle**, run by whichever agent is working — see below.
|
||||
|
||||
## The cycle (`sisi cycle`)
|
||||
|
||||
Consolidation is due when 5 or more lessons have been recorded since the last cycle, or a lesson is
|
||||
waiting to move up a step, or the learned notes pass their size limit, or more than 30 lessons are
|
||||
still loose (or their one-line headings pass the 1,500-character budget) — the loose list stays short
|
||||
by construction, because the brief's first instruction is to fold lessons into the recipe or entry
|
||||
for their kind of work, or lift several into one rule, so they leave it. That is a counter check, not a
|
||||
schedule: it runs at session start, at the end of every turn in the gate, and in the output of
|
||||
`sisi retro`, `sisi verify` and `sisi done for` — commands agents run in every tool, so the loop works
|
||||
in tools with no hooks at all. `sisi cycle due` runs the same check by hand. A session that has been
|
||||
told is not told again until 20 further checks pass or the counter grows.
|
||||
|
||||
`sisi cycle` prints a brief the agent can act on without any other context: the lessons with their
|
||||
counts and measurements, the current rulebook with its line count and budget, and instructions (merge
|
||||
lessons that say the same thing; lift specific lessons into one general rule; fold a lesson into the
|
||||
entry it belongs to; say which existing rule text gets shorter so the book does not grow; write checks
|
||||
for strength-3 lessons). The agent answers with one JSON file:
|
||||
|
||||
```json
|
||||
{"version": 1, "base": "<base version from the brief>", "summary": "one line",
|
||||
"rules": [{"id": "rule-id", "title": "Title", "body": "text, ending with Why: ...", "action": "add|replace"}],
|
||||
"disable_rules": ["rule-id"],
|
||||
"notes": [{"lesson": 3, "action": "merge|fold-into-rule|fold-into-entry|retire|withdraw|keep",
|
||||
"into": "rule or entry id", "merged_into": 4,
|
||||
"when": "at least 5 terms (optional; sets the lesson's when-terms)"}],
|
||||
"enforced": [{"lesson": 3, "type": "command", "cmd": "...", "expect": {"exit": 0}, "timeout_s": 30},
|
||||
{"lesson": 4, "type": "contract-requirement", "when": "parser",
|
||||
"require_kind": "parsing", "max_rung": 2}]}
|
||||
```
|
||||
|
||||
`sisi cycle apply FILE` checks the file before writing anything: every lesson id exists, the base
|
||||
version is still current, changed rules keep their id and their Why, named `sisi` commands and
|
||||
enforced programs exist, and the resulting rulebook is inside the budget and no longer than before
|
||||
unless a rule was replaced. The base version plus the personal-data lock means two sessions
|
||||
consolidating at once cannot overwrite each other: the second apply is refused and told to read a
|
||||
fresh brief. A successful apply is one commit in your personal repository, with before-and-after
|
||||
measurements. `sisi cycle revert` undoes the newest applied cycle exactly (the changed files byte for
|
||||
byte, and the lesson rows it touched). `sisi cycle status` shows each cycle with what happened since:
|
||||
deliveries, send-backs each, median time, and recurrences of the lessons it touched. A cycle whose
|
||||
deliveries got worse after at least 10 of them is flagged, and the next brief says to revert or repair
|
||||
it first.
|
||||
|
||||
Enforced checks live in `overlay/enforced.json` and are checked like the minimum-rung floors: a
|
||||
contract-requirement fails a contract that touches its subject without a check of the required kind;
|
||||
a command check runs in the project like a contract check, and only in projects already on the trust
|
||||
list.
|
||||
|
||||
## Is it getting better?
|
||||
|
||||
`sisi improve` (and one line of `sisi status`) answers with what is actually counted: lessons recorded,
|
||||
taking effect, strengthened, retired and withdrawn; the recurrence rate this week against the week
|
||||
before; send-backs per delivery and median time to delivery, this week against before; and the
|
||||
rulebook size against its budget. With too little data it says so.
|
||||
|
||||
## Safety, and what is not claimed
|
||||
|
||||
Changes take effect first and are measured after; there is deliberately no replay testing before a
|
||||
change ships. Safety comes from narrow scope instead: everything lands in the personal overlay,
|
||||
every cycle is one commit that can be reverted exactly, the rulebook cannot grow past its budget, and
|
||||
a change whose measures get worse is flagged and withdrawn. The human is never asked anything by this
|
||||
loop.
|
||||
|
||||
What is measured is counts and times: showings, recurrences, send-backs, delivery times, rulebook
|
||||
lines. What is not measured is whether the delivered work is what the human meant — that still rests
|
||||
on contract checks and the human's corrections.
|
||||
|
||||
Matching is measured, not asserted — twice over, and correctness no longer rests on it: part one is
|
||||
deliberately strict, and everything else still reaches the asking agent as a heading it can judge.
|
||||
The test suite carries two labelled sets, each measured the same way: how often a wrong lesson is
|
||||
shown in full in part one (precision), and how often the right lesson is reached at all (in part one,
|
||||
or listed in part two within its budget). The first set (25 should-match pairs, each request
|
||||
rephrased but sharing vocabulary with its lesson, and 26 should-not) is a regression floor only — one
|
||||
author wrote both sides, so of course they share words: reach 25/25, part-one wrong 0/26, proving
|
||||
little beyond "does not regress". The second is harder and is the honest test: 21 pairs whose
|
||||
requests share *no* content word with the lesson's moment, cause or change text (the test asserts
|
||||
this), so only the recording agent's when-terms can bridge them, against 24 should-not requests:
|
||||
reach 21/21 (20 of them already in part one; one — a request sharing a single when-word — reaches
|
||||
only as a heading, as designed), part-one wrong 0/24. Both sets are small and hand-written; treat
|
||||
even those figures as evidence about this mechanism on these examples, not as a promise about yours.
|
||||
|
||||
Delivery therefore depends on the quality of the when-terms the recording agent writes. Thin or
|
||||
copy-of-the-text terms leave a lesson findable only by its own wording, exactly the failure they
|
||||
exist to prevent. What sisi ultimately measures is not match scores but the outcome that matters:
|
||||
whether the same problem recurs after a lesson has been shown. A lesson that is never found cannot be
|
||||
shown, which is why the cycle brief lists lessons still missing terms.
|
||||
|
||||
At most three lessons are shown as matches, and every showing is on record in `sisi lessons show ID`.
|
||||
Two display rules differ by surface: at session start (unsolicited), a lesson whose text reads like
|
||||
an instruction to run something is withheld; when an agent's own query asked (`done for`, gate
|
||||
send-back and friends), ordinary verbs like "run a property test" are shown — framed as information —
|
||||
while URLs, shell constructs and outside paths are refused in both places. The task-set experiments
|
||||
and taste judge in [design.md](design.md) remain unbuilt.
|
||||
@@ -15,8 +15,9 @@ Under `SISI_HOME` (tests) the personal folder is `$SISI_HOME/.local/share/sisi`
|
||||
VERSION format version of this folder, a single integer (an update migrates older folders after taking a backup).
|
||||
Not the product's release number: that is the VERSION file in the clone, shown by `sisi --version`
|
||||
oracle.md what the person wants
|
||||
overlay/ learned changes to the product (below)
|
||||
notes/<id>.md field notes per verifier or recipe id
|
||||
overlay/ learned changes to the product (below); overlay/enforced.json holds enforced lessons
|
||||
notes/<id>.md field notes per verifier or recipe id (notes/draft-<id>.md: a recipe that does not exist yet)
|
||||
cycles/ one JSON record per learning cycle, including the bytes revert restores
|
||||
config.json settings (over config.default.json)
|
||||
trusted.json projects whose contracts may run commands
|
||||
lessons.jsonl sorted dump of the lessons database, committed whenever lessons change
|
||||
|
||||
Reference in new issue
Block a user