Project rules: one list per repository, claimed migration, undo that checks the file

- In git the project root is always the main checkout's, from any subfolder or worktree; the
  git check-ignore branch and the non-git ancestor walk are gone. When git cannot answer, the
  nearest folder holding .git; inside a git directory or bare repository nothing is written.
- The root is looked up once per process: session start runs 4 git processes (was 10).
- Every write of a project's list (learn, retro, organize, move) records path/before/after in
  rules/last-project.json and commits it, so `sisi rules revert` undoes the last change of any
  kind; it restores only while the file holds exactly what the change left, else declines.
- The move from the store is claimed by an atomic rename; the store copy is removed only after
  the store commit succeeds; a claim left by a crash is picked up later; BOM and non-UTF-8 safe.
- A linked .sisi is named in one line; the note closes the file it opens; learn into a folder
  that cannot be written says so in one line and keeps nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude Opus 5.5 committed 2026-11-24 19:58:19 -07:00
1 parent a540bd45ff
commit b588cec7a8
6 files changed
+496 -147

No files matched your search

+4 -2
View File
@@ -80,7 +80,7 @@ its limits are.
| `sisi retro --no-gap … --term T --better …` | Nothing fell short, but work can always be done better: name the term and the one concrete thing that would have scored better (recorded with the retro; it becomes a rule only if it recurs, when the rules are organized) |
| `sisi retro --later …` | The work is not finished yet |
| `sisi learn [--project] "…"` | The person's own words become a rule at once |
| `sisi rules` / `sisi rules organize [--record FILE]` / `sisi rules revert` | See the learned rules; have a worker organize them; undo the last change |
| `sisi rules` / `sisi rules organize [--record FILE]` / `sisi rules revert` | See the learned rules; have a worker organize them; undo the last change to them, a project's `.sisi/rules.md` included (it declines, changing nothing, when that file was changed since or its folder moved or is gone) |
| `sisi models` / `sisi models research [--record FILE]` | The workers table; have a worker rebuild it |
| `sisi judge WORKER good\|bad "…" [--minutes N] [--newest]` | How a delegation went; the minutes are measured from the pick's delegation (or `--minutes N`) and make the wheel favour faster workers. With several of one worker's jobs open, the oldest is judged first, `--newest` the newest |
| `sisi direct "…"` | Allow more direct tool calls this turn, with the reason |
@@ -95,7 +95,9 @@ Rules live at three levels:
(how you like to work, across all your projects), `models.md` (your workers), `retro.jsonl` (each piece of work: session,
`retro_seconds`, counts, goal, term) and `outcomes.jsonl` (each judged delegation: session, `project_key`, `model`,
`started`/`ended`, minutes, verdict, why). All plain text you can read and edit.
- **Each project** (`.sisi/rules.md` at the project root, never in a subfolder): rules specific to one project. You choose
- **Each project** (`.sisi/rules.md` in the project's folder: in a git repository, the root of its main checkout, shared by
all its worktrees; outside git, the folder sisi is run in): rules specific to one project. A worktree's own checked-in
copy of `.sisi/rules.md` is the committed version; new rules are written in the main checkout, for you to commit. You choose
whether to check `.sisi/` into git or ignore it (sisi works either way, and never commits or stages it for you). Whenever
sisi writes `.sisi/rules.md`, it also puts a marked note (`<!-- sisi:begin -->` ... `<!-- sisi:end -->`) in the project
root's `AGENTS.md` pointing to `.sisi/rules.md`, so the note is in the file those tools read. It is skipped with a