sisi is two loops and nothing else: a forced retro whose improvement becomes a rule at once, with the rules organized by a worker; and delegation by a researched models table, with the lead stopped when it does the work itself. Everything else is removed (it is kept under the tag before-core-rewrite).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude Fable 5.2 committed 2026-11-23 19:42:59 -07:00
1 parent 6b0baf2473
commit 084bfc1d6d
326 files changed
+1182 -69591

No files matched your search

-21
View File
@@ -1,21 +0,0 @@
# Documentation
| Page | Read it to |
|---|---|
| [../README.md](../README.md) | learn what sisi is, install it and try it |
| [../SPEC.md](../SPEC.md) | read the standard sisi is built and judged against |
| [design.md](design.md) | see how sisi meets that standard, and why it works the way it does |
| [records.md](records.md) | know what a closed work unit records, the five verification statuses, telemetry classes and `sisi status` |
| [evaluation.md](evaluation.md) | see how policy versions are compared by replaying past work |
| [learning.md](learning.md) | how a recorded lesson takes effect, is measured, strengthened, consolidated or withdrawn |
| [workers.md](workers.md) | how the agent tools and models on the machine are found, chosen between by measured results, and run |
| [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 |
| [harnesses.md](harnesses.md) | see, per tool, what is wired, what blocks, and what is unproven |
| [../CONTRIBUTING.md](../CONTRIBUTING.md) | run the tests and send a change |
| [../SECURITY.md](../SECURITY.md) | understand what sisi runs, and report a problem |
| [../CHANGELOG.md](../CHANGELOG.md) | see what changed |
The rulebook that agents actually read is [../canon/core.md](../canon/core.md).
Run `sisi help` for every command; no per-command reference is kept in these pages.
-450
View File
@@ -1,450 +0,0 @@
# How sisi meets SPEC.md
This document describes sisi as it is built. Section numbers in brackets are sections of
`SPEC.md`, which is the standard. Where this document and the specification disagree, the
specification wins. For the dated record of how the rebuild was decided, see
`docs/reconciliation/`.
**sisi** is still improving: this design describes the current system, and the learning loop
in section 8 is how it changes.
## 1. What sisi is
sisi is the operating layer that makes a host AI coding tool behave as the engineering
organization the specification describes, makes that behaviour observable, and improves it from
evidence. The host tool supplies the agent. sisi supplies five things:
1. **An operating policy**: a short rulebook of strategic direction, always loaded. The agent
works out the tactics.
2. **Records**: the work unit, its verification record, its telemetry and its scorecard.
3. **Gates**: executable checks at the moments a host exposes (session start, prompt, tool
use, end of turn).
4. **A learning loop**: evidence, learning record, mechanism, validation, promotion,
monitoring, revert.
5. **An orchestration record**: which workers exist, what they cost, how they performed.
Standing constraints from the owner, which bind every part:
- Python standard library only. No scheduler: anything periodic is a counter checked during
normal use.
- Works in any host tool, and uses the host's native mechanisms first.
- Nothing in the product names a specific model, price, person or version.
- A behaviour is wanted either as a mechanism or as policy that is measured. Prose that
nothing checks or measures is removed.
- One of everything. When something is replaced, the old one is deleted in the same change.
## 2. Where things live [12]
| Layer | Path | Holds | Rule |
|---|---|---|---|
| Product | the clone and its stable copy | code, `SPEC.md`, base rulebook, library, default risk table, strategy text | True for every project and every user. Never written at run time. A test scans it for owner-specific names, model ids, prices and home paths. |
| User | `~/.local/share/sisi` (a git repository) | owner statements, `learnings.jsonl`, `findings.jsonl`, `units.jsonl`, `delegations.jsonl`, `worker-notes.json`, the mechanisms promoted from learnings, worker facts | This user, all projects. |
| Project | `<project>/.sisi/` | the open contract, closed unit records, project risk overrides | This project only. Project knowledge itself goes in the project's own docs (handover). |
| Scratch | `~/.local/state/sisi` | session state, caches, logs | May be deleted. Pruned by age during normal use. A release is made from the running launcher's folder. |
`sisi update` on an installed copy runs the migration step for the old store as part of the
update. The specification's "organization-wide" scope is the product. A user's learning reaches the
product only through `sisi promote` / `--export`, scrubbed.
## 3. Risk profiles [5.3, 9, Appendix A]
Ceremony is set by risk, not by the size of a diff. The profiles, lowest first:
`trivial`, `isolated`, `logic`, `integration`, `data`, `critical`, `release`.
`sisi risk [--json]` computes a **floor** from the paths changed since the unit started, using
`canon/risk.json`: glob and keyword patterns mapped to profiles. Defaults: documentation, text
and styling only is `trivial`; one module's behaviour is `isolated`; algorithms, parsing, money
and state machines are `logic`; several top-level packages or a public interface is
`integration`; schema, persistence and migration is `data`; authorization, secrets, crypto,
payments, concurrency primitives, installers and hooks is `critical`. A project may override in `.sisi/risk.json`. The floor is a minimum, not a verdict: it was
measured against independent labels (`measured` in `canon/risk.json`) and agrees about five
times in six, which is why the declared profile sits above it. A learning of mechanism type `policy` may adjust the user's table.
A contract must declare `risk.profile`; it may raise the floor freely and lower it only with
`risk.why`. The record keeps both the floor and the declared profile.
What a profile requires. The gate enforces exactly this table and nothing else:
| Profile | Contract | Checks | Requirement model | Risk note | Independent evidence | Retro at close |
|---|---|---|---|---|---|---|
| trivial | no | the diff; a targeted check when one exists | no | no | no | only on an anomaly (two send-backs, or a human correction) |
| isolated | yes | at least one that is not vacuous | no | no | no | yes |
| logic | yes | as isolated, each with `covers` | no | no | no | yes |
| integration | yes | as logic, plus invariants and an `approach` | yes | yes | no | yes |
| data, critical | yes | as integration | yes | yes | yes | yes |
| release | yes | every check (`--all`) | yes | yes | yes | yes |
"Requirement model" is the contract's `requirements` list (section 4); an `approach` is the
contract's `approach` object with `chosen`, `why` and at least one alternative. Text such as `TODO`,
`n/a` or `none` fills no field. The table is held as data in `canon/risk.json` (`requirements`, with
machine keys beside the prose ones) and read by the gate. "Risk note" is
`risk.blast_radius` and `risk.rollback`. "Independent evidence" is an accepted review delegation
in the ledger for this project inside the unit's window with a check stronger than `none`, or a passing check
marked `"independent": true` that names who or what produced it in `"by"`.
## 4. The work unit [10]
The open unit is `.sisi/contract.json`. New fields are optional unless the profile requires them.
```json
{
"id": "…", "parent": "request or workstream id",
"goal": "the human's words", "scope": {"in": ["…"], "out": ["…"]},
"requirements": [
{"id": "q1", "kind": "explicit|implied|contextual|anticipated|experiential",
"text": "…", "decision": "now|architect|defer|ignore", "why": "…", "check": "check id or null"}
],
"risk": {"profile": "logic", "why": "…", "blast_radius": "…", "rollback": "…"},
"checks": [
{"id": "…", "claim": "…", "cmd": "…", "expect": {"exit": 0}, "rung": 2, "tier": "fast",
"covers": "the failure this would catch", "when_changed": ["src/parser/**"],
"mandatory": true, "independent": false}
],
"invariants": [], "assumptions": [], "questions": [],
"deferred": [{"what": "…", "why": "…", "safe_because": "…"}],
"limitations": [], "plan": []
}
```
- `sisi contract init` starts a unit. If the previous unit is closed it is replaced. If it is
still open the command refuses and names `sisi unit close --abandon "<reason>"`, which
records the disposition [10.3].
- `sisi unit close` archives the unit to `.sisi/units/<id>.json` and appends one summary line
to the user store's `units.jsonl`. The archived record carries the fourteen items of [10.2]:
id and parent; outcome and scope; requirements; acceptance checks and invariants; risk
profile (floor and declared); plan and the workers used; models and budgets; start, end and
telemetry; changed artifacts; every verification result; deferred checks, limitations and
open risks; delivery status; the scorecard; the retro findings and the learnings they made.
It also carries the **policy version**: a hash of the effective rulebook, the enforced checks
and the risk table, so every unit says which policies were in force [11.6].
- `sisi unit pause "<what it waits for>"` records a wait and lets the turn end with no
demands. The pause also ends when the tree changes or `sisi verify` runs. Wait time is
telemetry [6.1]. A pause defers checks that wait on something and the retro, never the
contract: it is refused when no unit is open, the unit is not the session's own, or it is
missing what is required before building (below). It silences the gate only for the session
that holds the unit, and only while the unit is valid.
- A unit is **bound to the session that works on it** [10.1]. A session opened it
(`sisi contract init`) or said it continues it (`sisi unit continue`, which prints the goal,
age and owed checks); the binding is kept in the session record, never in the contract. A
unit with no activity (a verification run, an allowed edit, a continue) for `unit.stale_hours`
(12) needs `continue` again. `sisi unit park "<why>"` sets the open unit aside, kept under
`.sisi/parked/` and listed by `status` and `unit list`; `sisi unit resume ID` brings it back
when no unit is open. `contract init` on an open unit names the three ways on: continue,
park, or close it as abandoned.
- **The contract comes before the work** (rule 3). `sisi/unitguard.py`, called from the
before-tool hook (`sisi watch`) on a main thread, works out the risk floor of the path a
file-changing call (or a shell write the classifier recognises) is about to change, together
with the paths this session already changed since its last valid unit. Above `trivial` the
call is refused (a short message, at most 12 lines, naming each missing item and the command
that supplies it) unless the session holds a valid unit: bound, not stale, passing
`sisi contract check` with no placeholder check left, and carrying what the profile needs
*before building* from canon/risk.json (the requirement list, risk note and approach for
integration and above; independent evidence and the retro come at the end). Writes under
`.sisi/` and outside the project, worker and subagent sessions, and every error inside the
hook are let through. A shell command the classifier does not recognise is caught by the
after-tool snapshot, and the next counted call is refused the same way. Delegating a build
needs the unit too (the contract is where the brief's acceptance comes from). Word lists
live in canon/guard.json. Every refusal is stored (what, when) and kept in the unit record
(`guard_refusals`); `sisi status` counts them.
- Nobody is their own independent evidence [13.3]: a check marked `independent` counts only
if `by` names something other than the author (not empty, not the session's own model, not
a self-reference such as "me" or "my own review"), and a review counts only from a worker
other than the author's model, judged with a check stronger than `none`.
- `sisi unit show [ID]` prints a record. Nothing is ever overwritten or lost.
- Delivery status is one of `delivered`, `delivered-with-deferred`, `deviation` (a check was
waived), `unverified` (the gate released after its send-backs ran out), `abandoned`.
## 5. Verification [5.4, 5.5, 5.6, 6.4]
- **Five statuses**: `passed`, `failed`, `skipped`, `not-applicable`, `not-run`, each of the
last three with a reason. A timeout is `not-run (timed out)`. A check that needs a person is
`not-run (needs human)`. Nothing that did not run is ever reported as passed.
- **What blocks**: a `failed` check, or a mandatory check that is `not-run` for any reason other
than a recorded deferral or needing a human. A mandatory check that is `not-applicable` and
has never passed counts as never run. A unit that closes with deferred or human-pending
checks is `delivered-with-deferred` and the record lists them. Failed checks keep their
failure evidence with the result, so a later reader can see what failed without re-running.
- **Selection by change**: a check with `when_changed` runs only when a changed path matches;
otherwise it is `skipped (not affected by this change)`. A check without it always runs.
`--all` runs everything. The reason is recorded, which is the justification [5.4] asks for.
- **Reuse**: a check whose inputs (the tree restricted to its `when_changed`, or the whole
tree) are identical to those of its last pass is `skipped (reused: passed at <time>)`.
- **Vacuous checks are refused**: `sisi contract check` rejects a `cmd` that cannot fail
(`true`, `:`, `exit 0`, a bare `echo`, and the like).
- **Seen failing**: the record notes for every check whether it has ever been observed to fail
in this unit (red before green). It does not block; it is reported as evidence quality.
- **Waiver**: `sisi contract waive` no longer makes a unit pass. It records a deviation with
its reason; the unit's delivery status becomes `deviation` and the completion report must
say so.
- Slow checks run in the background and block only a `release` change. A command check that
replay did not validate always waits for the owner before it takes effect.
- **Cost**: every result stores its duration; `sisi verify` prints the slowest checks and
the time saved by selection and reuse.
## 6. Telemetry and scorecard [6.1, 13]
Every value carries a class: `measured`, `inferred`, `estimated` or `unavailable`. Missing data
is `unavailable`, never zero and never good.
Sources: the hooks (request start, human messages, stops, send-backs, pauses), the host's
transcript where it exposes one (token usage by category and model, question dialogs,
subagent runs), the delegation ledger, git (changed artifacts), and the verification record.
The scorecard has the eight dimensions of [13.1]:
| Dimension | Recorded |
|---|---|
| Intent fulfilment | requirements with a passing check; requirements added after the first verification (surprise); human corrections after delivery (inferred) |
| Correctness and assurance | results by status; techniques used; checks seen failing; independent evidence; deviation or unverified flags |
| Delivery velocity | time to first useful result (first allowed stop after the request); time to validated completion (close); time in checks, in waits, in delegations |
| Resource efficiency | tokens by category and model; cost from known prices (estimated); retries |
| Parallelism | delegations, how many overlapped, worker minutes against wall time |
| Human experience | human messages, question dialogs, corrections (inferred) |
| Lifecycle quality | files and lines changed, tests changed with code, public surface touched |
| Organizational improvement | findings, learnings created, recurrences of known failures in this unit |
`sisi status` is the one report: the last five units with their scorecards, then trends by project,
risk profile, model and policy version, with the median and the 95th percentile, and "too few"
where a segment has fewer than five units. It replaces `improve`, `time`, the old `status`,
`scoreboard`, `lessons digest` and `backlog` as separate reporters. No single score is printed.
## 7. The gate [9, 10.3, 17]
At the end of a turn in which the session changed something:
1. Compute the risk floor. If the profile requires a contract and none is open, say so.
2. Run the selected fast checks. A blocking result sends the agent back with the failures.
3. If the profile's other requirements are missing (requirement model, risk note, independent
evidence), say which.
4. If everything is green and the unit is not closed, offer the two ways on: record the retro
(`sisi retro`), which closes the unit; or `sisi unit pause "<what it waits for>"`.
5. A paused or closed unit with no new change passes silently. A pause silences only the session
that holds the unit, and only while it is valid.
The gate judges a session's changes only against a unit the session holds. When the open unit
is another session's, or stale, a non-trivial change is sent back with the three ways on
(continue, park, or init) and none of that unit's checks are run; if the send-backs run out the
turn ends as unverified and the other unit is left as it was.
In this build the retro is offered once for each state of the tree and a trivial change is asked
nothing (unless the unit shows an anomaly); a recorded retro closes the unit. A session is judged only on
its own edits, so another session's work in the same tree never sends it back. The detail is in
docs/records.md, "The end-of-turn gate".
Send-backs stay bounded; when they run out the unit is released as `unverified` and recorded
as such. A session marked as a subagent is never blocked and never sent back for a retro: a
subagent's last message is its report to its parent and must stay that. The question-dialog
gate stays as it is.
## 8. The learning loop [11, 14.4]
**The retro** runs when a unit closes. It is grounded in the record: `sisi retro` with no
arguments prints the unit's scorecard and what stands out in it. Each finding is recorded with:
```
sisi retro --finding "<what happened, with the evidence>" --cause "<root cause>"
--impact value|correctness|time|cost|attention
--disposition promote|record|drop
promote: --change "<the exact improvement>" --mechanism policy|orchestration|skill|tool|infrastructure|verification|knowledge|benchmark
--scope organization|user|project|task-class --expect "<observable effect>" --validate "<how it will be tested>"
record: --limits "<where it applies and where it does not>"
drop: --why-not "<why it is not worth promoting>"
[--same-as ID]
```
At least one finding per closed unit; generic findings are refused as now. Search terms,
topics and short lines are derived by the tool, not demanded. A finding that resembles an
existing learning is attached to it as a recurrence candidate instead of being refused.
**The learning record** follows [11.4]: id, title, source unit, observation (evidence,
impact), root cause, proposed change (description, mechanism type, scope, target), expected
effect, validation (method, benchmark), status, version, provenance (every unit and project it
was seen in), confidence. Status moves through `observed`, `analyzed`, `proposed`,
`implemented`, `validated`, `promoted`, `monitored`, and may end `revised`, `reverted` or
`rejected`.
**Scope is earned.** A learning is in force in the project it came from at once. It is
delivered in other projects only when its provenance has at least two units in at least two
projects, or it is an owner statement. One incident never becomes a universal rule [11.6].
Learnings recorded by a subagent are held as candidates until the parent's retro includes them.
`sisi learn --withdraw` takes an owner statement recorded by mistake out of delivery while
keeping it in history.
**Promotion** is the cycle, due by a counter (what a cycle can act on, arrived since the last one). `sisi cycle`
prints a brief a cheap agent can act on alone (format with an example per action, every value, what happens to
each kind of action, at most eight learnings, at most 6,000 characters). A cycle turns proposed learnings into
mechanisms in the user store: an enforced contract requirement, an enforced command check, a library entry, a
risk-table or routing adjustment, a benchmark case, a sentence added to a rule (`rule-add`) or a whole rule
(`rule-replace`, the owner's). Changes to sisi's own code are `tool` learnings: status `backlog`, never in a
brief, they go to the contribution export. `sisi cycle check` runs nothing and lists every problem at once;
`sisi cycle apply`:
- **validates before promoting**. A command check is replayed only between the two commits of the learning's
own record (its unit's start and closing commits), in an exported copy of each tree with no history and a
reduced environment, and must name a path the fix changed. It must fail before the fix and pass after. What
cannot be replayed is `unvalidated`, waits for the owner and is reported as such; it is never called validated.
- **commits** each change to the user store; revert is exact, as now.
- **refuses** to touch protected rules (`canon/protected.json`: the non-negotiable
constraints, verification before done, truthful reporting, this governance). Disabling a
rule, replacing a whole rule, widening a scope to everything, or adding a command that runs in every
project is consequential: it is stored as pending (the learning is `pending-approval`) and takes effect
only after the owner's decision (`sisi approve ID --yes|--no`, asked through the host's question dialog).
`sisi approve` needs the word it prints typed at the controlling terminal, and the before-tool hook refuses an
agent's shell command that invokes it.
- **must act on flagged learnings**: see monitoring.
**Monitoring.** A recurrence after promotion counts against the learning. Two recurrences flag
it "not working"; the next cycle must revise or revert it. `sisi status --learning` shows, per
promoted learning, units since, recurrences and a verdict, and the realization rate
(promoted learnings holding with no recurrence over at least five relevant units).
Being shown is not evidence: showings never promote anything.
## 9. Orchestration [7]
The product gives direction and keeps the record. It names no model.
**Direction** (one rule in the rulebook, a longer playbook on demand in `canon/orchestration.md`):
the main agent owns the outcome; give each task to the least expensive worker that is
sufficiently capable, counting rework as cost; use the host's own delegation first; run
independent work in parallel when it shortens the critical path; write a delegation contract;
judge what comes back in proportion to risk and record the judgement; treat an unavailable
worker as temporary; keep finding out what exists, what it costs and how good it is; keep the
strongest model for judgement and hand the legwork down, including the legwork of orchestration
itself (discovery, price and benchmark research, first-pass review can go to a fast cheap
worker).
**The record** (user store):
- `sisi workers`: the tools and models found on this machine, what is usable now, and the
judged record as three tables: by task type and difficulty; what fixed each rejection (a
better brief, a stronger worker, nothing); how good the difficulty guesses were.
- **Worker facts**: prices and benchmark standing, each with a source and a date, written by
`sisi workers fact …`. When facts are missing or old, session start says so in one line and
asks for a cheap worker to research them. Nothing is hard-coded.
- Routing treats a worker id with no provider prefix as the host's own subagent.
`sisi workers note` records a standing fact about matching workers and `sisi workers only`
restricts routing to matching models of one provider; both are honoured by `sisi route`.
`sisi workers down --until` accepts a date or a time, after which the worker is usable again.
- `sisi route --kind K --difficulty N [--explain]`: the recommendation. Candidates are only
workers with a judged record, a known price or a benchmark standing. It picks the cheapest
worker that is capable enough for the kind and difficulty (judged record, then the nearest
judged evidence, then benchmark standing against other standings, see docs/workers.md), and
about one low-stakes task in ten goes to a cheaper worker with a thin record. `sisi workers avoid|prefer PATTERN --why` holds the
user's own constraints.
- `sisi delegate judge …` is the only way a result enters the ledger (type, difficulty, worker,
outcome, strongest check applied, minutes, tokens, retry-of). `amend` marks one that later
proved wrong. `down`/`up` record availability. The ledger is where a unit's delegation
telemetry and the parallelism measure come from.
- **Delegation contract** [7.5]: `sisi delegate brief` prints the template (outcome and scope,
context and sources of truth, constraints and interfaces, acceptance, deliverables and
report format, files it may change, verification expected, budget, when to escalate);
`sisi delegate check FILE` says which parts a brief lacks.
- `sisi delegate --brief FILE …` still runs a worker through its own CLI when the host has no
delegation of its own.
**Enforcement** (`sisi/orchestration.py`, `sisi/fallback.py`; host tool names in `canon/orchestration-tools.json`).
The before- and after-tool hooks run for every tool, not only the shell, and keep a per-session,
per-turn meter in the scratch store (`sessions/<id>.meter.json`, under a file lock; every counted event is
also appended to `orchestration.jsonl`). It meters main threads only: a session the host marks as a subagent,
one whose first prompt opens with the brief template's first line, and one started by `sisi delegate` are
workers and are never counted or refused; neither is anything refused when no usable worker other than the
session's own model exists. Every entry point fails open.
- **Direct-work budget.** Every tool call that is not a delegation, the question dialog, a planning or to-do
tool, a message or a `sisi` command counts, with the characters of its result. Past `orchestrate.direct_calls`
(6) or `orchestrate.direct_chars` (30000) the next counted call is refused with at most 12 lines: the count,
rule 6, the router's pick for reading and for building (taken from the routing code, with its mechanism
line) and two ways on: delegate with a brief, or `sisi unit direct "<reason>"`. A specific reason (a generic
one is refused) extends the turn by `orchestrate.extension` (10) calls and the matching share of characters;
each extension and its reason is stored and shown by `sisi status`. The turn starts again at each prompt (a
host's notice about a background worker is not a prompt) and when the gate lets the turn end.
- **Delegation guard.** A delegation that names no model, or the session's own, is refused with the router's
pick; an allowed one is checked with `brief.check` (advice only) and written to the ledger as a pending run
(worker, project, session, start), completed with minutes and tokens when the result reports them, or, for an
async launch, when the host's completion notice arrives as a prompt. The gate asks once per set of finished,
unjudged runs for the judgements.
- **The router is asked first.** `sisi route` writes a routing decision for the session (kind, difficulty
guess, pick, time). The first delegation with no decision inside `orchestrate.route_window_min` (15) is
refused once; afterwards the pending run carries the kind and difficulty, so `sisi delegate judge ID` needs
only the outcome and the check. A worker other than the router's pick is allowed and recorded
(`chosen_against_route`); `sisi workers` shows how often and how those turned out (too few under five).
`sisi route --retry-of ID` keeps the same worker with an instruction to improve the brief after the first
rejection and then moves to a worker whose evidence is strictly better (`routing.retry_choice`: the cheapest
capable one with better evidence, else the strongest known usable one) after a second.
- **One before-tool path, one refusal at a time.** `sisi/watch.py` runs, for every tool: workers and subagents
are exempt from all of it; then the contract guard (a call that would change a project file, or delegate a
build, with no valid unit: rule 3); then the delegation guard (a model is named and is not the main thread's
own; a routing decision exists); then the direct-work budget. The agent sees only the first refusal in that
order, so an agent told to delegate is never refused afterwards for a contract it was not told about. A
refused call is not counted by the meter. Every stage fails open on its own.
- **Repeat failure.** The fourth identical failing shell command (whitespace-normalised) with no file changed
in between is refused once (rule 5).
- **Unavailable workers.** A limit, quota, login or connection failure arriving as a delegation result or as a
host notice is classified (`workers.classify_failure`), the worker's provider (or just the model) is marked
down until the reset time the message names, its pending run is marked `superseded` (never asked to be
judged), and the agent gets at most six lines: the router's next worker for the same kind of work, to fall
back now with the same brief, not to ask and not to report it (worker availability is internal, SPEC 9.7 and
17), and to cancel the failed task. A question-dialog call right after is refused once; ending the turn with
no fallback started is sent back (twice at most); a final message naming the failed worker or the failure is
sent back once. All state-based. The person hears of it only when nothing usable is left or the outcome or
its timing changes for them.
- **New workers.** A model discovery finds that the previous one did not have is named once at session start
as unproven (low-stakes work first, checked more carefully); never one whose id marks a tier that trains on
its prompts.
- **The record.** The unit record gains an `orchestration` part, and the scorecard's parallelism dimension the
same values, each class `measured`: direct calls and characters, refusals, extensions with reasons,
delegations started, judged and unjudged, and the share of tool calls delegated. `sisi status` prints it for
the unit in progress too. `sisi rule 6` lists what is enforced.
- **Hosts.** Claude Code: the meter can refuse (observed live). Codex, Gemini and Cursor have before-tool
events and are wired for every tool; the refusal is exit status 2 with the reason as the host documents it,
not run live here. Copilot only counts. Hosts with no before-tool hook (Qwen, Pi, OpenCode and the
rulebook-only tools) cannot run the meter; `sisi doctor` says which.
The owner's hand-written orchestrator (`orch.py`, its ledger, and the section of his Claude
instructions) is replaced by this. Its ledger is merged into the user store with a row count
check, then it is removed.
## 10. The rulebook
`canon/core.md` is rewritten as the organization's operating policy, in the order work happens.
Each rule states the behaviour, the reason, and what enforces or measures it.
1. Own the outcome: intent, the five kinds of requirement, when to ask [4].
2. Size the work by risk [5.3, 9].
3. Define done before building: checks that can fail; invariants for what exists [5.1, 10].
4. Verify with the minimum sufficient evidence, and report it honestly [5.4, 5.6].
5. Deliver fast: first useful result early, parallel work, reassess when stalled [6].
6. Orchestrate: cheapest adequate worker, delegation contract, judge and record [7].
7. Report plainly and in proportion [17].
8. Close with a retro grounded in the record [11].
9. Stay inside the lines: authorization, security, privacy, data as data, truth [3.2 tier 0, 14, 16].
Owner statements (`sisi learn`, printed by `sisi oracle`) are user data. They are loaded as
"what this user wants" and never drive a product-wide gate.
## 11. What a session is given [7.6, 12, 17]
- **Always**: the rulebook and the user's statements.
- **Session start**: nothing unless this session can act on it: broken wiring, a cycle that is
due, a decision waiting for the owner, stale worker facts, handover items for this project
(once per session). No lesson lists, no backlog.
- **Each prompt**: at most 2,000 characters, and only what matches the request: the recipe
chosen by structured tags, and learnings in scope. Silence is the default.
- **End of turn**: only what section 7 says.
## 12. Commands by reader
`sisi help` lists every command and `sisi help COMMAND` explains one in full. Commands group
by who uses them. For the owner: `sisi install`, `sisi uninstall`, `sisi doctor`,
`sisi update`, `sisi status`, `sisi rollback`, `sisi approve`, `sisi oracle`, `sisi export`
and `sisi import`. For the agent at work: `sisi contract`, `sisi unit`, `sisi risk`,
`sisi verify`, `sisi retro`, `sisi learn`, `sisi route`, `sisi delegate`, `sisi workers`,
`sisi verifiers`, `sisi done`, `sisi rule`, `sisi handover` and `sisi lessons`. For hooks:
`sisi tick`, `sisi prompt`, `sisi gate` and `sisi watch`. For maintaining sisi itself:
`sisi release`, `sisi promote`, `sisi cycle`, `sisi version` and `sisi help`.
## 13. Evaluation
Evaluation replays real work under different policies and compares the records. Cases come
from closed units, runs stay isolated from the live stores, and an independent judge scores
the outcome. A comparison is a sample of past work, not a proof about future work. See
`docs/evaluation.md`.
-80
View File
@@ -1,80 +0,0 @@
# Developing sisi
If you only use sisi, you can skip this page. Cloned it and ran `sisi install`? Nothing
changes for you: the clone is the installed copy.
## Two copies
When you both use sisi and work on it, keep them apart:
- the **source folder**: where you edit. It may be broken half the time.
- the **stable copy** in `~/.local/lib/sisi/`: what the tools actually run, so a running
session is protected while sisi itself is being changed.
The stable copy is a set of releases, `~/.local/lib/sisi/releases/<UTC timestamp>/`, each
holding only the product files. A link called `current` points at the active one. Once a
`current` release exists, `sisi install` wires the hooks and `~/.local/bin/sisi` to it. A
release is built under a hidden name and renamed into place, and `current` is switched
atomically, so a running tool never sees a half-written copy: a process that has started
keeps running the release it started with. `sisi doctor` shows which copy is live and
whether the source folder is ahead of it.
## The live orchestration check
Before any release that touches the hooks or the rulebook, run
python3 tools/live_orchestration_check.py
It starts the host's command-line tool headless with its least expensive model in small temporary
projects, with the hooks from this checkout and a temporary `SISI_DATA` and `SISI_STATE` (the real sisi data is
never read or written; the script asserts that it did not change). Scenario 3 starts from a project with no
open unit and a task that needs more than six calls, with a witness hook recording whether a valid unit stood
behind each call: no file may change before one does, and the agent must meet the guards in the order the rules
give (the contract before the budget), each refusal in at most twelve lines. `--model NAME` sets the main
thread's model. Scenario 1 asserts that the meter refused a
tool call with its message, that the session then ran `sisi route` and delegated with a named model or recorded
a reason with `sisi unit direct`, and that the ledger or events hold the matching record. Scenario 2 uses a fake
provider that always answers with a quota error and a reset time: the provider must be marked down until that
time, the session must go on with another worker, never call the question dialog and never mention the
failure in its final message. It costs a few cents and needs the host's login, so it is not part of the unit
suite; synthetic hook input is what let an earlier release ship broken. If the agent ignores a refusal or the
host does not honour it, that is a finding: fix the hook output, do not weaken the assertion.
## Make a release
Run from the clone (a release is made from the running launcher's folder):
bin/sisi release # runs the checks; refuses if they fail
bin/sisi release --deep # also needs the slow checks to pass
It copies the product files, switches `current`, rebuilds your rulebook with the new code,
keeps the newest releases, and prints what changed. The first time, run `sisi install`
afterwards so the tools point at the stable copy (release tells you if they do not).
## Roll back
bin/sisi rollback
Switches `current` to the release before it and rebuilds the rulebook.
## Check the contract guard against a real agent
`tools/live_contract_check.py` runs the host's command-line tool headless in a temporary
git project, with the hooks of THIS clone and temporary sisi data and state folders, and asserts
that a leftover open contract from other work cannot be built on, skipped or paused away. It
needs a login and costs a few cents, so it is not part of the unit suite. Run it
(`python3 tools/live_contract_check.py`) after changing sisi/unitguard.py, sisi/watch.py, the
gate's unit logic or the refusal wording, and whenever the host's hook interface changes.
## Promote a personal addition
Rules, verifiers and recipes you added live in your personal overlay. Run from the clone:
bin/sisi promote <id> # shows what would be written, and every term it scrubbed
bin/sisi promote <id> --apply # writes it into the source folder
It replaces your home path, user name and email addresses, and any terms listed under
`developer.personal_terms` in your personal `config.json`, with placeholders. If a personal
term still appears afterwards, it stops and names the lines. A rule goes into the base
rulebook; a verifier or recipe into the library. It never commits. Review the change,
commit it, make a release, then remove your overlay copy so the two do not drift apart.
-119
View File
@@ -1,119 +0,0 @@
# Evaluation
The harness that answers "is sisi getting better?" with evidence instead of claims. A
learning cycle changes the policy (rules, checks, routing, guidance); this replays
representative past work under the old and the new policy and puts the results side by side.
Section numbers in brackets are sections of `SPEC.md`.
## Concepts
- A **case** is one replayable piece of real work, stored as JSON in the user store under
`benchmarks/<id>.json`. The product ships no cases from any real project.
- A **replay** runs a case in a temporary checkout of the case's repository and records
what happened. Nothing replays in the user's working tree, and the temporary copy is
removed afterwards whatever the outcome.
- A **policy version** is a hash of the effective policy: the product rulebook plus the
store's generated rulebook, overlay and config. A run may also be labelled by hand
(`--policy NAME`); the hash is then kept beside the label.
- **Results** live in the user store as `eval-results.jsonl`: one row per run with the
case, split, policy version, worker, outcome, minutes, tokens and cost, every value
carrying its class (measured, estimated, unavailable) [13.4].
## The case format
```json
{"id": "case-name", "kind": "check",
"source": {"unit": "the work unit it came from", "learning": "or the learning"},
"project": {"repo": "path or remote", "start_commit": "before the work",
"fix_commit": "after the work"},
"request": "the human's own words",
"checks": [{"id": "tests", "cmd": "the check command", "expect": {"exit": 0}}],
"tags": ["task class"], "split": "dev", "added": "<date>"}
```
Two kinds and three splits:
- `check`: the command must **fail at `start_commit` and pass at `fix_commit`**. That is
what "validated" means for a promoted command check [11.5]. Passing at both is
`failed-to-fail` (the check proves nothing); failing at both is `failed-to-pass`.
- `task`: starting from `start_commit`, a worker given `request` under the policy under
test must produce a tree on which the checks pass.
- `dev` cases are for tuning. `holdout` cases are held out: a tuning run (`--split dev`)
and a shadow evaluation must never include them, and they run only when named.
`counterexample` cases must **still pass**: they are the guard against overfitting a
rule to the incident it came from [11.6].
## How cases accumulate
- From finished work: `sisi.evaluate.capture_case(unit_record)` is called when a unit
closes. A unit with a repository, a start commit and command checks becomes a case;
its id and dev/holdout split are deterministic, so re-capturing changes nothing.
- From the harvested task set: `sisi eval import` converts the replayable harvested tasks
(graded A or B, with a test command) into cases. Their split is the same deterministic
hash as the task's. The old hidden `sisi tasks` and `sisi checks` commands are served
by this module now; `sisi harvest` itself is unchanged.
- By hand: `sisi eval add case.json`, or `sisi eval add --id ... --check ...`.
## Replay and cost
`sisi eval run` with no arguments replays only `check` cases: that needs no AI tool and
spends nothing. `task` cases spend real money, so they run only with an explicit
`--tasks N`. Before any task replay the command prints the estimated cost, worked out
from the median cost of recorded task runs, or the word `unknown` when nothing has been
recorded. A per-invocation hard cap can be set in the personal config
(`{"eval": {"max_cost_per_run": VALUE, "timeout_s": SECONDS, "worker_timeout_s": SECONDS}}`);
a known estimate above the cap refuses the run, and the cap also stops further task
cases once the known spend reaches it.
A task replay hands the request to a worker through the existing delegate runner, with a
brief that carries the policy under test, then runs the case's checks on the result. A
run that cannot happen (repository gone, commit missing, timed out, no worker) is
recorded as `not-run` with its reason, never as a pass [13.4].
## Comparing policies
`sisi eval compare A B` treats A as the baseline and B as the candidate, over the cases
**both** ran: pass rate, median and 95th-percentile minutes, and cost, each beside its
counter-metric (a speed or cost figure is meaningless without the pass rate next to it),
plus the same break-down per task class [13.5]. Under five common cases it says "too
few" and claims nothing. Cases only one side ran are listed, not ignored, and
unavailable cost is never counted as zero. A candidate that fails cases the baseline
passed is called "not an improvement" in so many words, however much faster or cheaper
it is. There is deliberately no single score.
`sisi eval shadow DIR` does the same for a candidate policy that exists only as a copy of
the user store (a learning cycle applied to the copy, not to the real store): it runs a
sample of dev cases plus every counterexample under the current policy and the candidate
and prints the comparison, before anyone is asked to approve the change [11.6]. The
learning loop calls the same code as `sisi.evaluate.compare_for_candidate(dir, sample)`,
and calls `sisi.evaluate.validate_command(repo, before, after, cmd)` before promoting a command
check: `validated` only if the command ran and failed at `before` and ran and passed at `after`
(program present at both commits; not 126/127, a timeout or a signal), `before` an ancestor of
`after`, in a repository on the trust list. A stored case is replayed the same way by
`validate_check(case)`.
## Independent judging
`sisi eval judge RESULT_ID` asks a worker from a **different maker** than the one that
did the run (chosen through the routing module's reviewer selection) to read the request,
the diff and the check results and answer met or not met for each acceptance item, with
one line of reason [13.3]. The judgement is stored with the result as `judged_by`. A
judge from the same maker is refused: a worker's own assessment is never recorded as
independent evidence.
## What this does not do
- A replay is a **sample**, not the original work: the worker, its context and the state
of the world have all moved on. Outcomes are comparable between policies run the same
way; they are not a rerun of history.
- A pass rate over a handful of cases says little, which is why the comparison refuses to
claim improvement under five common cases and splits figures by task class instead of
hiding a bad one behind a good one.
- Holdout cases exist to catch tuning that overfits the cases it was tuned on. Using them
to tune a rule quietly converts them into dev cases and destroys their value: run them
to check, never to adjust.
- A check case that passes at both commits may still be a useful check; it is only a bad
*benchmark case*, because it cannot distinguish a fixed tree from a broken one.
- Cost and token figures are as good as what the worker tools report. Where nothing is
reported they stay "unavailable", and the harness will not invent precision to fill
the gap.
-258
View File
@@ -1,258 +0,0 @@
# 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 prompt --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`. Install also links any
skills shipped under `canon/skills` into `~/.agents/skills`; `sisi doctor` reports the linked
state. Hooks fail open: any error lets the agent finish. Where a tool's hook input has no transcript path, the gate falls back to its pre-attribution behaviour (tree-change based, with no per-session edit attribution). Shell commands are attributed by measurement, not by their text, wherever the tool has confirmed before/after tool events (`sisi watch` takes a stat-only tree snapshot before and after the command and attributes the paths that changed to the session; provably read-only commands skip the pair); tools without confirmed before/after tool events keep the command-text classifier described in [docs/design.md](design.md).
## The orchestration meter, per tool
The before- and after-tool hooks count the main thread's direct tool calls and refuse past a budget (rule 6,
[design.md](design.md) section 9). `sisi doctor` prints what it can do in each tool:
| tool | meter | evidence |
|---|---|---|
| Claude Code | counts and refuses every tool (permission-deny output), delegation guard, fallback | observed live (`tools/live_orchestration_check.py`) |
| Codex CLI | counts and can refuse every tool (exit status 2 with the reason) | the host's hook documentation; not run live here |
| Gemini CLI | counts and can refuse every tool (exit status 2) | documentation; not run live |
| Cursor | counts and can refuse every tool (exit status 2) | documentation; not run live |
| GitHub Copilot CLI | only counts: its refusal contract is not confirmed | not run live |
| Qwen, Pi, OpenCode, Muse, Grok, Crush and the rulebook-only tools | cannot run: no before-tool hook is wired | see each section |
Host tool names (delegation, question dialog, planning, messaging) are data in
`canon/orchestration-tools.json`; a tool named nowhere there still counts. Only Claude Code's delegation tool is
named for the guard and the fallback; elsewhere delegation goes through `sisi delegate`, which is exempt.
## Claude Code
Fully wired, as before: an `@import` line in `~/.claude/CLAUDE.md`, `SessionStart` → `sisi tick`,
`UserPromptSubmit` → `sisi prompt` (the matching recipe and lessons for the human's request, as
added context; silent when nothing strictly matches, and never able to block a turn),
`Stop`/`SubagentStop` → `sisi gate` (blocking), and `PreToolUse`/`PostToolUse`/`PostToolUseFailure` with no
matcher (every tool) → `sisi watch` (the orchestration meter, and before/after tree measurement for shell
commands) in `~/.claude/settings.json`. An installation from an earlier release (shell-only matchers) is
changed by `sisi install` and by `sisi update`, span-preserving; `sisi uninstall` restores the original bytes. The gate also enforces
the question-dialog rule here: `AskUserQuestion` exists and the transcript is readable, so ending a
turn by asking in reply text without using the dialog is sent back once. Evidence: the hooks
reference documents `UserPromptSubmit` and its added-context output. Nothing for you to do.
The before-tool hook also carries the contract guard (`sisi/unitguard.py`, docs/design.md section 4): it
refuses a file-changing call, or a build delegation, that has no valid unit behind it, with
`hookSpecificOutput.permissionDecision: "deny"` and the reason (the hooks reference documents the shape;
`tools/live_contract_check.py` confirms a headless run honours it and shows the agent the reason). It sees
every tool only where the hook is registered for every tool (a `Bash`-only matcher covers shell writes
alone). The refusal is written in Claude Code's shape only; the other tools' before-tool hooks still just
measure, so for them the end-of-turn gate is the enforcement.
## Codex CLI
Rulebook symlink at `~/.codex/AGENTS.md` (or `$CODEX_HOME/AGENTS.md`), plus hooks in
`~/.codex/hooks.json`: `SessionStart` → tick, `UserPromptSubmit` → prompt (the hooks page documents
the event and its added-context output; it needs the same one-time trust below),
`Stop`/`SubagentStop` → gate,
`PreToolUse`/`PostToolUse` (every tool) → `sisi watch`, 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`), `BeforeAgent` → prompt (the documented
before-turn event, carrying the request text), `AfterAgent` → gate, `BeforeTool`/`AfterTool` →
`sisi watch` (`{"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`),
`userPromptSubmitted` → prompt (the documented before-prompt event), `agentStop`/`subagentStop` →
gate (`{"decision":"block","reason":...}` forces another turn), `preToolUse`/`postToolUse` → `sisi watch`. 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). The gate's question-dialog check is wired for Qwen the same way as for Claude Code, but
Qwen's transcript shape is unconfirmed, so the check reads nothing — and therefore sends nothing
back — until that shape is verified. No prompt hook is registered either: Qwen's prompt-submission
event name is not confirmed in its hooks reference excerpts or in the installed package's text, and
sisi does not guess event names into a config. Qwen's before/after tool event names are not confirmed, so sisi registers no watch hooks there:
shell edits in Qwen are still judged from the command text.
## 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`, runs
`sisi prompt` there too with the request text that event carries (the installed extension docs
confirm the event and its message injection; a missing text field leaves it silent), 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. Pi gets no
watch hooks (its extension has no confirmed before/after shell payload for this), so shell edits there are
still judged from the command text.
## Cursor
Hooks merged into `~/.cursor/hooks.json`: `sessionStart` → tick (lessons as `additional_context`),
`stop`/`subagentStop` → gate, `preToolUse`/`postToolUse` → `sisi watch`. No prompt hook: Cursor's
documented `beforeSubmitPrompt` event can allow or stop a submission, but no channel for injecting
added context is documented for it, so there is nothing for `sisi prompt` to print into. 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. It also gets no
prompt hook: a per-message plugin callback exists, but the transform that would inject added
context is unconfirmed on the installed version. OpenCode gets no watch
hooks either, so shell edits there are still judged from the command text.
## 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 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 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.
-206
View File
@@ -1,206 +0,0 @@
# The learning loop
How sisi turns what happened in one work unit into a mechanism that helps the next.
The rule throughout: a behaviour is wanted either as a mechanism or as policy that is
measured. Prose that nothing checks or measures is not learning.
## The record
One store: `learnings.jsonl` in the user store (`~/.local/share/sisi`), one JSON object
per learning, committed to that folder's git repository — git is the history. Retro
findings live in `findings.jsonl`. There is no second copy and no database mirror.
A learning record carries: id, title, source unit, observation (evidence and impact),
root cause, the proposed change (description, mechanism type, scope, target), expected
effect, validation (method, benchmark, result), status, version, provenance (every unit
and project it was seen in) and confidence. Status moves through `observed`, `analyzed`,
`proposed`, `pending-approval` (a decision waits for the owner), `backlog` (a change to sisi
itself), `implemented`, `validated`, `promoted`, `monitored`, and may end `revised`, `reverted`,
`rejected` or `merged` (into another learning). Showings are never recorded: being printed is not evidence.
## The retro
`sisi retro` with no arguments prints the unit's record and what stands out — it reads
`sisi.unit.summary_for_retro(project)` when that module is present, otherwise the open
contract and the verification results on record. Each finding is then recorded with a
disposition, and only the fields that disposition needs:
```
sisi retro --finding "<what happened, with the evidence>" --cause "<root cause>"
--impact value|correctness|time|cost|attention
--disposition promote|record|drop
promote: --change "<exact improvement>" --mechanism policy|orchestration|skill|tool|
infrastructure|verification|knowledge|benchmark --scope ... (optional)
--expect "<observable effect>" --validate "<how it will be tested>"
record: --limits "<where it applies and where it does not>"
drop: --why-not "<why it is not worth promoting>"
[--same-as ID]
```
At least one finding per closed unit. A finding that is only generic advice is refused wherever
the filler appears ("be more careful when writing tests in future"); a short specific one is
accepted ("Tests flaked on CI: 3 of 10 runs"). Things that look like keys, tokens or passwords are
replaced by `<redacted>` before a finding or a learning is stored. Search terms, topics and short
lines are derived by the tool, never demanded.
A finding that resembles a learning **in force in this project** is attached to it as a recurrence,
and the match is printed; `--new` records the finding as a learning of its own instead. Resemblance
searches nothing else. `--same-as ID` names the learning it repeats; for a learning from another
project the finding must plainly be the same thing, and it is that project's own evidence (a unit
there) that adds the provenance, never the resemblance. A unit is counted once for a learning, so
repeating a retro in one unit inflates nothing.
Recorded by a subagent means what the hooks recorded: tick marks a session that started as a
subagent, and the watch hook records, for each shell command, whether its hook payload came from
a subagent (an agent id or a subagent transcript path). `sisi retro` reads that session record; no
environment variable decides it. A subagent's learning is held as a candidate and attaches to nothing;
the parent adopts it with `sisi retro --adopt ID`, never by resemblance. `--target ID` names the rule,
recipe or technique a learning concerns, so `sisi rule`, `sisi done` and `sisi verifiers show` can
list the learnings behind it.
## Scope is earned
A learning is in force in the project it came from at once. It is delivered in other projects only
when its provenance holds at least two units in at least two projects (`organization` scope), or it is
an owner statement made at user scope; a project-scoped statement is delivered only in its project. One
incident never becomes a universal rule. Text delivered into a prompt is framed as background
information to weigh, never as an instruction. Relevance is scored against the learning's own terms, so
a long prompt does not dilute a real match; silence is the default.
Only rows that sisi's own commands wrote, as they wrote them, are delivered or acted on. Each such
command appends the id and content digest of what it wrote to `learnings-ledger.jsonl`, in the same
commit as the row; a row added by hand, or edited by hand, has no matching entry and is never delivered
(`sisi lessons` and the learning report name it). A later sisi write does not launder it.
## The cycle
Promotion is the cycle, due by a counter checked during normal use (no scheduler): five learnings a cycle
can act on arrived since the last cycle, or, fourteen days after it, five still waiting. `sisi cycle` prints
the brief for a cheap worker that has nothing else to read: the complete file format with one filled example
per action, every enumerated value, what happens to each kind of action (takes effect, held for the owner,
refused), and at most eight learnings (flagged first, then the most recurrent, then the oldest), each with its
statement, origin project, source unit and whether commits are recorded, in at most 6,000 characters; what does
not fit waits for the next cycle. The worker writes one JSON cycle file. `sisi cycle check FILE` runs nothing
and lists every problem in the file at once, each with how to fix it; `sisi cycle apply FILE` prints what took
effect, what waits and what was refused in at most fifteen lines. Mechanism kinds a cycle can install in the
user store: an enforced contract requirement (`when` is a risk profile or a path glob: something the code
evaluates), an enforced command check (both in `overlay/enforced.json`), a library entry (recipe or verifier;
it is linted when the file is checked), `rule-add` (one or two sentences added to a named rule before its
`Why:`, naming what the addition shortens or saying nothing can be; the applied message prints the loaded
rulebook size before and after), `rule-replace` (the whole rule; always the owner's), a risk-table adjustment
(`overlay/risk-adjustments.json`), a routing adjustment (`overlay/routing-adjustments.json`), or a benchmark case
(`overlay/benchmarks/<name>.json`). A learning that should not be promoted is `reject`ed with a specific reason
(a generic one is refused) or `merge`d into the learning it repeats. `tool` learnings are never in a brief or in
"due": they have the status `backlog` from the moment they are recorded and go to the tool list in the learning
report and to the contribution export (`sisi promote --export`).
`sisi cycle apply FILE` treats the file as untrusted input and plans everything before writing anything —
the budget and every other check run first, and a refusal applies nothing. If applying then fails part-way
(a full disk), every file the cycle wrote is restored.
- **A mechanism reaches only what its learning earned.** Each entry written carries the learning id,
the scope the learning has earned (`learning.earned_scope`: its origin project unless it earned more)
and the origin project. Enforced checks, risk and routing adjustments are filtered by project when read.
A scope or `every_project` flag in the cycle file is a request for more, never the gate.
- **Replay before promotion** (`evaluate.validate_command`, the one replay implementation). `check` never
executes anything from the file. `apply` replays a command check only between the two commits the learning's
own record holds (the start and closing commits of the unit it was found in, from the unit record, or the
commits stored with the finding; commits named in the file are ignored), in the learning's origin project, on
the trust list. Each run is in an exported copy of that commit's tree with no `.git` directory (the command
cannot read history), an environment of PATH, HOME (an empty directory) and LANG only, a time limit, and
the copy is deleted afterwards. The command must name a path that differs between the two trees, or it is
refused as vacuous. It is `validated` only if it **ran and failed** at the start (not exit 126/127, not a
timeout, not killed by a signal; its program, and a script given to an interpreter, must exist at *both*
commits) and ran and passed at the end, and `before` is an ancestor of `after`; a learning with no recorded
commits, or any other reason it cannot be shown, leaves it `unvalidated` and waiting for the owner. A replay
that ran and behaved wrongly refuses the whole cycle. Replay never touches the working tree.
- **Protected rules** (`canon/protected.json`) cannot be replaced or disabled by a cycle or by
`sisi overlay`. If the file cannot be read, no rule can be changed.
- **Consequential changes wait for the owner**: more scope than the learning earned; an enforced command
not proven by replay (or that would run outside its origin project); a risk pattern that lowers a
profile; any whole-rule replacement or disabling of a rule; a sentence added to a rule, or a library entry,
from a learning confined to one project; a mechanism for a project that no longer exists on disk;
`sisi overlay replace-rule` and `disable-rule`. They are stored as pending and take effect only after
`sisi approve ID --yes|--no`. While a decision waits, its learning is `pending-approval`; promoting it
again is refused, and so is a second change to a rule that has one waiting. If the owner refuses, the
learning is rejected, not proposed again.
- **`sisi approve`** with no arguments lists every waiting change in full: the command, the pattern and
profile, the rule text as a diff, why it needs the owner, and the replay result. The same listing, word and
record serve a learned tool that switches off approvals (`drv-NAME`) and an allowance probe (`probe-PROVIDER`). A decision needs the word
`sisi approve ID --yes|--no` prints typed back at the controlling terminal device (never standard input), and
the before-tool hook refuses any shell command of an agent that invokes it; a process with no controlling
terminal is refused unless the user config sets `learning.agent_relayed_approval`. Every decision, and every
refused attempt, is recorded in `approvals.jsonl` (when, session, terminal or not, `relayed by an agent`).
Session start prints one line while a decision is waiting, telling the agent to ask the owner through
the host's question dialog and to give him the command to run himself. SECURITY.md says what this does and
does not guarantee.
- **Flagged learnings must be acted on** (below); a cycle that ignores one is refused.
- Each change is its own commit in the user store, and each cycle (and each approval) is recorded with the
files and learning fields it changed. `sisi cycle revert [ID]` undoes exactly those: statements, findings
and recurrences recorded after the cycle survive, and a revert is refused if a later change touched the
same file.
- A learning that was validated but waits for the owner is `pending-approval` with its validation result kept;
once promoted and a unit in its scope has closed, or it has recurred, `monitored`.
- An origin project is always the main repository's key, never a linked worktree's path; `sisi update` repairs
records and mechanisms written before that (and statuses: tool learnings to `backlog`, learnings with a
decision waiting to `pending-approval`).
## Monitoring
A recurrence after promotion counts against the learning (once per unit). Two flag it "not working";
the next cycle must revise or revert it. `sisi status --learning` prints only
`learning.learning_report()`: per promoted learning the units in its own scope since promotion
(read from `units.jsonl` in the user store, one JSON object per line with `id`, `project`, `closed_at`,
`risk`; the file may not exist yet, which counts as none), the recurrences, whether it is validated or
unvalidated, and the verdict, plus the realization rate (promoted learnings holding with no recurrence over
at least five units in their scope) — or "too few" when the numbers are small. A project-scoped learning
counts only its project's units. No claim of improvement is printed from counts of records.
## Owner statements
One path: `sisi learn "<what you want>"` writes an owner statement into the same learning store, live
at once; `sisi oracle` prints the ones in force in the current project. A user-scope statement is
delivered everywhere, a project-scoped one only in its project. The record says whether the quoted words
appear in a human-typed message of the session transcript (`typed by the owner`) or not, or no transcript is
available (`relayed by an agent`); it is never blocked, and `sisi oracle` shows the relayed ones as such.
`sisi learn --withdraw ID --reason "..."` withdraws a statement recorded by mistake: kept in its history,
never delivered again.
## Migration
`sisi update` (and `sisi learn`/`sisi oracle`) run the learning migration whenever the
old store exists and the `learnings-migrated.json` marker does not: a backup first, merged by legacy id
(a lesson already carried over is not carried twice; a learning recorded before the first migration does
not stop it). Old lesson rows become learning records with honest statuses (a lesson folded into prose
is `implemented`, always unvalidated; nothing becomes `validated`); occurrences become provenance with the
old `repo` values normalised to the project key new code uses, and only occurrences that attach to a
lesson are counted; impressions, sightings and pattern rows are not carried (the backup keeps them);
owner statements join the same store with their scope, duplicates dropped. Malformed lines are counted and
reported, not hidden. A migrated learning is earned beyond its project only under the same
two-units-two-projects rule as a new one. The sqlite store is read too.
## The product
`sisi promote --export` writes the contribution file for `tool` learnings and for learnings that earned
organization scope (scrubbed: no history, no user or project names); `sisi promote L-NNNN [--apply]`
writes the rule or recipe such a learning was folded into into the source folder and marks the learning
`in_product`. `sisi handover` lists the project-scope learnings and statements waiting to be filed in
their own project's documents. `sisi rule ID`, `sisi done ID` and `sisi verifiers show ID` list the
learnings in scope that target that entry.
## Seams for other parts of sisi
- `learning.findings_for_unit(project, unit_id)` — the findings a unit record stores.
- `learning.learning_report()` — the text `sisi status --learning` prints, the one learning report.
- `cycle.enforced_results(contract, project, ...)` — what `sisi verify` runs, filtered by project.
- `cycle.risk_patterns(cwd)` — the learned risk patterns that apply in a project (`risk.load_patterns`).
- `cycle.routing_adjustments(project)` — the learned routing adjustments that apply in a project.
- `cycle.due_notice()` — the session-start lines (cycle due, decision waiting).
- `learning.delivery_text(project, query, targets=())` — what the prompt hook may add.
- `evaluate.validate_command(repo, before, after, cmd)` — the replay.
## What this does not do
Replay validation needs commits and a trusted project; without them a check stays
unvalidated and waits for the owner. Being shown is never evidence, and one incident never
earns wider scope on its own.
-63
View File
@@ -1,63 +0,0 @@
# Product and personal data
sisi lives in three places. An update replaces the first and never touches the second.
| Place | Where | What | Written at run time |
|---|---|---|---|
| Product | the clone (`paths.REPO`) | code, `canon/core.md` (base rulebook), `verifiers/`, `done/`, `config.default.json`, `VERSION`, docs | never (a test enforces it; bytecode goes to scratch) |
| Personal data | `$SISI_DATA`, else `$XDG_DATA_HOME/sisi`, else `~/.local/share/sisi` | what sisi learned for this person; its own local git repository | yes, committed |
| Scratch | `$SISI_STATE`, else `~/.local/state/sisi` | `harvest.db`, locks, logs, session records, results, bytecode | yes, rebuildable |
Under `SISI_HOME` (tests) the personal folder is `$SISI_HOME/.local/share/sisi` unless `SISI_DATA` is set.
## Personal data layout
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: the standing principles (user-tier statements, plus
core ones until the product carries them), rewritten as a whole document
by learning rounds; absent until a round writes it, in which case
`sisi oracle` prints the live statements directly
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
learnings.jsonl one JSON object per learning, committed whenever learnings change
findings.jsonl retro findings, one per line
units.jsonl one summary line per closed work unit
delegations.jsonl the delegation ledger: judged attempts and runs awaiting judgement
worker-notes.json standing facts about workers, by pattern
retest.jsonl replaced items whose base changed in an update (id, old base hash, new base hash)
generated/core.md the effective rulebook (not in git; rebuilt by install and update)
install/ manifest and original copies of the files `sisi install` edited (not in git)
backups/ copies taken before a migration or an update (not in git)
Git is private bookkeeping: author `sisi`, no hooks, no global git config needed, never pushed.
## Overlay
Ids: rules are `## 1. Title {#rule-id}` in `canon/core.md`; verifiers and recipes use their file stem.
overlay/rules/<id>.md `## Title` + body. A base id replaces that rule; a new id adds one
overlay/rules/disabled.txt ids switched off, one per line
overlay/rules/order.txt order of added rules (they follow the base rules)
overlay/verifiers/<section>/<id>.md a verifier in the library format: replaces the product's, or adds
overlay/verifiers/disabled.txt
overlay/done/<id>.md a recipe: replaces or adds
overlay/done/disabled.txt
overlay/bases.json per replacement, the hash of the base item it was made against
Commands: `sisi overlay list | diff | add-rule | replace-rule | disable-rule | enable-rule` (and the same for
`verifier` and `recipe`), `sisi overlay revert COMMIT`. Each change is one commit and rebuilds the rulebook.
The generated rulebook may not exceed its line and character budgets: a change that would pass it is refused, so a rule is added
by shortening or replacing another. `sisi doctor` prints the always-loaded size.
On `sisi update` the overlay is applied to the new product. A replacement whose base item changed keeps the
person's version and is queued in `retest.jsonl` for the learning loop.
## Moving data
`sisi update` on an installed copy runs the migration step: it moves an older layout in (the old
lesson store becomes `learnings.jsonl`), after a timestamped copy under `backups/`. `sisi export [PATH]` / `sisi import PATH` carry personal data, results and session records as one
tar.gz.
-114
View File
@@ -1,114 +0,0 @@
# Plan: bringing sisi into conformance with SPEC.md
The work list for the reconciliation. `docs/reconciliation/critique.md` says what is wrong,
`docs/design.md` says what replaced it, `docs/spec/conformance.json` holds the status of every
numbered requirement, and this file says in what order it is built and what the owner has
asked for. Section numbers in brackets are sections of `SPEC.md`.
## What done means
Every requirement in `docs/spec/requirements.json` is either met by a named mechanism with a
test that cites its id, or it is on the exceptions list at the end of this file, in plain
words, with the reason and what it would take. A different model family from the one that
built it grades the table against the specification text. The measurements in
`tools/measure.py` are shown before and after.
## Stages
Stages are an order, not a ceiling. Each one lands on the `spec-reconciliation` branch only
with the whole test suite passing.
| # | Stage | Status | Serves | What it delivers |
|---|---|---|---|
| 0 | Standard and baseline | done | [19] steps 1-4, 6 | The specification saved and protected; its requirements numbered with a completeness test; four audits; a measured baseline. |
| 1 | Cut and sort | done | [8.2, 12, 17] | Dead commands and developer mode removed; the product scanned by a test for owner-specific and perishable material; a shorter README; `tools/measure.py` and the "before" numbers. |
| 2 | Records | done | [5.4-5.6, 6.1, 6.4, 10, 13] | The durable work-unit record; the five verification statuses; selection by change and reuse; telemetry with honest classes; the scorecard; `sisi status`; scratch pruning. |
| 3 | Orchestration | done | [7] | One ledger, worker facts, `route`, the delegation contract, the strategy playbook; nothing in the product names a model. |
| 4 | Conformance table | done | [19] step 2, [20] | Status of every requirement before the rebuild, then kept current by every stage. |
| 5 | Proportional gate | done | [5.3, 9, 10.3, 17] | Risk profiles replace line counts; the gate enforces only what the profile requires; retro at close; `unit pause`; subagents pass; hooks add only what a session can act on; recipes found by structured tags. |
| 6 | Learning loop | done | [11, 12, 14.4, 16] | Learning records per [11.4]; a retro grounded in the unit record; scope earned by evidence; validation before promotion; promotion as a revertible commit; recurrence monitoring; protected rules and owner approval for consequential changes. |
| 7 | Rulebook and documents | done | [3, 4, 17] | `canon/core.md` rewritten as the operating policy; the documents rewritten around what now exists. |
| 8 | Evaluation harness | done | [11.5, 11.6, 13.3, 19 step 9, 20.3] | Benchmark cases from real work and from learnings; a replay runner; policy versions compared on historical, held-out and counterexample cases; an independent judge. |
| 9 | Grading | done | [13.3] | Conformance graded requirement by requirement by a different model family; the exceptions list. |
| 10 | Cutover | done | [14, 16] | The owner's installation switched, his data migrated, the old orchestrator removed. |
## Cutover checklist
The installed copy is not changed in the middle of a stage.
1. Archive, with a timestamp, the personal data folder, the scratch folder's ledgers, and the
owner's Claude instructions and settings.
2. Run the data migration on a copy of the real data and compare counts: lessons to
learnings, owner statements, delegation ledger rows (the old `orch.py` log merged in).
3. Prove `sisi rollback` in a sandbox: release, switch, roll back, compare byte for byte.
4. Check that the new hooks accept state written by sessions that are already running.
5. Release. Run `sisi doctor`. Run the measurements and print the before-and-after table.
6. Remove the hand-written orchestrator section from the owner's Claude instructions and
retire `orch.py`, in one edit with the backup from step 1. Running sessions get a
one-time notice through the prompt hook.
7. If anything in steps 5 or 6 fails: `sisi rollback`, restore the archive, stop and report.
## Spending
Builders are the non-Claude workers. Claude workers are used only for short reviews that must
block, at most ten in the whole job. If every non-Claude worker is unavailable, the work stops
at a stage boundary and says so.
## What the owner has said about sisi
His recorded statements are requirements on this work. Each is quoted, with where it is
answered, in `docs/reconciliation/owner-statements.md`.
## Exceptions
Graded against commit cab81df. One model family judged every requirement against the code and
tests, and a second family re-checked every verdict of "met" and overturned 6 of 68.
| Status | Requirements |
|---|---|
| Met, confirmed by the audit | 62 |
| Partial | 282 |
| Missing | 15 |
| Not applicable | 16 |
By this plan's own definition the work is not done: 297 requirements are not met. Each of them is a row in
`docs/spec/conformance.json`, with what exists (`how`), what is lacking (`gap`) and what would close it
(`fix`). Sorted by what closing them would take. The sorting is a first pass by a cheap worker and was not
checked row by row:
| What it would take | Requirements |
|---|---|
| Judgement: the text asks for a quality of thinking that no code can check; sisi can only ask for it or record it | 109 |
| A small addition to a mechanism that exists | 99 |
| A new mechanism or a substantial change | 51 |
| Only a test: the mechanism does it, and nothing would catch its removal | 17 |
| Boundary: complete, but it can be switched off or waived, or does not run on every host | 9 |
| Wording: a definition or description with nothing to test | 6 |
| Overturned by the audit, not sorted yet | 6 |
### Missing: nothing in the code does it
- **R-4.2-4** (SHOULD) "Relevant project and user context." Nothing in the code puts relevant project or user context into the intent or requirement model.
- **R-7.3-2** (SHOULD) "The organization SHOULD measure cost per accepted change and cost per unit of verified user value where …" No measure of cost per accepted change or per unit of verified user value exists.
- **R-7.4-4** (SHOULD) "The organization SHOULD measure wall-clock reduction against additional compute and coordination costs." No measure of wall-clock reduction against added compute and coordination cost.
- **R-8.2-1** (SHOULD) "The organization SHOULD minimize accidental complexity." Nothing in the code does it; not even a recorded field or a retro question addresses accidental complexity.
- **R-8.2-2** (MUST NOT) "It MUST NOT equate simplicity with the fewest lines of code, fewest files, shortest implementation, or …" No mechanism detects or refuses the prohibited behaviour; the prohibition exists only in the specification.
- **R-8.3-1** (SHOULD) "The organization SHOULD preserve architectural consistency where it supports comprehension and changeability." No mechanism asks whether a change keeps the existing architecture, conventions or patterns.
- **R-9.2-2** (SHOULD) "It SHOULD prefer targeted evidence gathering over broad, expensive repository analysis." Nothing in the code prefers targeted evidence gathering over broad, expensive analysis.
- **R-9.4-1** (SHOULD) "Agents SHOULD report discoveries that materially affect scope, risk, architecture, or estimates promptly." No mechanism, rule sentence or record covers prompt reporting of discoveries by agents.
- **R-9.8-1** (SHOULD) "A second retrospective SHOULD occur at the end of a multi-unit user request to identify cross-unit …" No second retrospective at the end of a multi-unit request, and no rule sentence asks for one.
- **R-10.1-1** (SHOULD) "The organization SHOULD avoid both extremes: overly large units that hide failures and excessively fragmented …" Nothing in the code steers between oversized and fragmented units.
- **R-11.2-4** (MUST) "What assumptions were wrong, and which were useful?" No mechanism, measure or check for wrong or useful assumptions; rule 8 does not mention them either.
- **R-11.2-5** (MUST) "What decisions were unnecessarily expensive or slow?" No mechanism, measure or check for decisions that were unnecessarily expensive or slow.
- **R-11.2-13** (MUST) "What could have been anticipated or automated?" No mechanism, measure or check.
- **R-12-7** (DEFINITION) "Workstream knowledge: current initiative, plans, interfaces, unresolved decisions, and dependencies across …" There is no workstream layer: nothing stores or retrieves a workstream's plan, interfaces, open decisions or dependencies between units; only the unit's parent …
- **R-13.2-3** (SHOULD) "Rework rate: proportion of work repeated or corrected due to misunderstanding, poor implementation, …" No rework rate is computed from the recorded corrections, send-backs or retries.
### Overturned by the audit
- **R-5.1-4** (MUST) "Implementation correctness: whether the implementation satisfies the specification." Nothing in sisi distinguishes implementation correctness from the other four correctness kinds (grep finds no such term; check kinds are domain labels like money/parsing). Checks are only tied to …
- **R-6.4-4** (SHOULD) "Independent checks SHOULD run concurrently where doing so reduces wall-clock time without causing resource …" Concurrency exists only as an opt-in contract flag `parallel`; nothing sets it, recommends it or judges independence or contention, so sisi does not make concurrent runs happen. The cited test shows …
- **R-7.5-2** (SHOULD) "A clear outcome and bounded scope." Refusal of a thin brief applies only to `sisi delegate`; native host delegations get only non-blocking post-hoc advice (orchestration.py:731). The cited test covers only `delegate check` output, and …
- **R-7.5-6** (SHOULD) "Files, resources, or modules the agent may change." Same gap: the 'Files you may change' requirement is enforced only for `sisi delegate`; a native Agent delegation is only advised afterward. The cited test checks `delegate check` output, not a …
- **R-13.3-2** (SHOULD) "Execution telemetry: timestamps, commands, tool calls, model identity, token counts, costs, retries, test …" The unit record keeps only counts (direct_calls, delegations), not each tool call with its name or the commands run (the shell note says command text is not kept), and the named test covers only …
- **R-13.5-1** (MUST) "An aggregate index MAY be maintained for trend visualization, but decisions MUST also inspect the underlying …" The mechanism is only the absence of an index plus a retro printout; nothing makes a decision inspect scorecard, gate outcomes, confidence and counter-metrics (the cycle brief does not show them), …
-22
View File
@@ -1,22 +0,0 @@
{
"commands_in_help": 39,
"commit": "ec91e52",
"date": "2026-11-23",
"hook_median_seconds": {
"gate": 0.0315,
"prompt": 0.0602,
"tick": 0.0801
},
"library_files": 160,
"modules": 41,
"prompt_chars": {
"add multi-page map printing with selectable paper size": 0,
"fix a typo in the README": 0,
"why is the build slow?": 0
},
"python_lines_in_sisi": 18124,
"rulebook_chars_fresh": 8533,
"test_count": 566,
"test_suite_seconds": 16.82,
"tick_chars_fresh": 0
}
File diff suppressed because it is too large. Load diff
-221
View File
@@ -1,221 +0,0 @@
# Critique of sisi against SPEC.md
Assessed on 2026-11-23 at commit `ec91e52`, as the specification's reconciliation steps 1 to 4
require [19]: four read-only audits of the code (the learning engine; the path from request
to "done"; installation, wiring and orchestration; and a measured baseline from the owner's
live data), each checked against the others. Numbers in brackets are sections of `SPEC.md`.
This is a dated record. The living status of each requirement is `docs/spec/conformance.json`.
## Verdict
sisi at this commit is a system for circulating prose between agents, with one good gate
attached. It has about 18,000 lines of Python, 41 commands and 160 library files, and after
a day of heavy use it cannot say what any piece of work cost, whether the human accepted it,
or whether anything it learned made later work better. The specification's first milestone is
"observability and control, not sophistication" [19]. sisi built the sophistication first.
What it does well is real and is kept: installation that cannot damage a user's tools, hooks
that fail open, a gate that turns "done" from a claim into an executed check, and a clean
separation of product, personal data and scratch.
## The defects, most serious first
### Flat-out wrong
1. **Learning produces no mechanisms** [11.3, 18]. Of 42 lessons, none became an executable,
validated mechanism: no lesson has a check attached, none reached the top strength, and no
enforced-check file exists. All 23 "folded" changes are Markdown. Every path ends as text in
a later prompt, which the specification lists as a prohibited anti-pattern ("prompt-only
self-improvement").
2. **Nothing is validated, by stated policy** [11.5, 11.6]. `docs/learning.md` says "there is
deliberately no replay testing before a change ships". Applying a learning cycle checks
structure only. Monitoring is one flag comparing send-backs before and after, confounded by
everything else that changed. A set of 1,627 harvested tasks built for replay has no runner.
3. **It cannot show it is improving** [13, 20.3]. No store holds token counts, cost, human
attention, acceptance or escaped defects. `sisi improve` counts lessons, showings and
send-backs. By its own output every failure pattern's recurrence is "not falling". The
rulebook grew from 98 to 158 lines over five cycles; one cycle was reverted and one is
flagged worse. The specification says a system "MUST NOT claim to be improving solely
because it has accumulated more prompts, skills, agents, tools, or learning records".
4. **There is no work-unit record** [10.2]. One `.sisi/contract.json` per project is edited
by hand for each new task; the previous goal and checks are lost. Check results,
delivery timings and retros live in three stores that share no id. Of the fourteen items a
record must hold, the contract has four.
5. **Verification proves exit codes, not claims** [5.1, 5.6]. A check is a command and an
expected exit status. `{"cmd": "true", "rung": 1, "kind": "money"}` satisfies the floor for
money code, because the floor compares a self-declared integer. The project's own tests use
`true` as the model of a good check. Nothing ever requires a check to be seen failing.
6. **The verification record has the wrong vocabulary** [5.6]. Statuses are passed, failed,
timeout and awaiting-human. There is no skipped, not-applicable or not-run; running out of
budget is recorded as a timeout; and a check waiting for a human counts as success.
7. **Every gate can be escaped by the agent it gates** [3.2, 10.3]. `sisi contract waive
"<anything>"` needs no approval and resets the gate. After three send-backs the gate lets
the turn end.
8. **Ceremony follows the size of a diff, not its risk** [5.3, 9, Appendix A]. Forty changed
lines or three files demand a six-part design essay; a 39-line change to a money parser
demands nothing. There is no risk model, no change-impact analysis, no selection of checks
and no reuse of results [5.4, 6.4].
9. **A retro is demanded at every stop that edited anything** [9, 11.1]. That includes a pause
to wait for background work and a subagent's hand-back. In the session that produced this
critique the demand replaced a reviewer's ten-point report with a note about its retro, and
the report had to be requested again. The gate also sent sessions back 34 times in 87
deliveries, 9 of them in one session for another worker's edits.
10. **Two orchestrators, and the product's is fiction** [7]. `sisi delegate` has no native run
on record: its 936 ledger rows were imported once from the owner's hand-written `orch.py`,
which is what actually runs, loaded into every session from his private instructions.
sisi's router has no prices and no priors, so "cheapest" is arbitrary among flat-plan
models; 1,875 catalogue entries flood the candidates; there is no delegation contract [7.5],
no parallelism [7.4] and no cost capture [7.3]. A new user gets none of what produced the
owner's results.
11. **Self-modification is ungoverned** [11.7, 14.3, 14.4, 16]. A cycle written by any working
agent may disable or replace any rule, including the ones that require verification and
retros, and install command checks, with no human asked. The only guards are a size budget
and an undo.
12. **One incident becomes a universal rule** [11.6]. Scope is the recording agent's claim,
checked only for whether the text names the project. 30 of 42 lessons were declared
universal, almost all on one sighting, and are delivered in every project from that moment.
Promotion counts "showings" that sisi generates by printing the lesson.
13. **The owner's personal preferences drive a product-wide gate** [12]. The design section
requires one answer per standing principle, and on this machine those include a Claude
quota and OpenCode prices. Recording a new statement immediately made the contract invalid
until it was answered. Any user's installation would work the same way with their own.
14. **The learning store is an instruction channel anyone can write** [16]. Text from lessons is
injected into every later session in every tool. A delegated worker, or any process running
as the user, can write it. Contract trust gates commands; nothing gates instruction text.
### Missing
15. **No intent or requirement model** [4.1, 4.2]. Explicit, implied, contextual, anticipated
and experiential requirements collapse into a free-text list of assumptions. Requirement
surprise and rework cannot be measured.
16. **No time to first useful result, no stall detection, no budgets** [6.1, 6.3, 6.5]. Only
the time from request to an allowed stop is measured.
17. **No scorecard** [13.1, 13.4]. None of the eight dimensions is recorded per unit and
nothing is labelled measured, inferred or unavailable.
18. **No independent evaluation** [13.3]. Scores, scope and recurrence are all judged by the
agent that did the work.
19. **No confidence, contradiction or staleness handling for knowledge** [12]. Lessons never
expire; a wrong lesson that is rarely shown lives for ever.
### Overbuilt
20. **Forty-one commands, sixteen of which only manage sisi** [8.2, 17]. A retro alone has a
twelve-line synopsis of required flags. Four taxonomies sit on one lesson record (aim,
change kind, pattern, topic); four reporters overlap (`improve`, `status`, `time`,
`scoreboard`); three writers share one store (`overlay`, `cycle`, `promote`); `note` and
`propose` are self-declared leftovers.
21. **The prompt hook delivers the wrong thing** [7.6, 12]. For a typo fix, a diagnosis question
and a feature request it returned the same notice about unfiled handover items, and no
lesson or recipe. For both of the specification's own example requests it delivers
nothing. Its matcher is word overlap: "fix the race condition" ranks `security-fix` above
`concurrent-code`.
22. **The retro manufactures lessons** [11.1]. Because one is demanded every time, agents find
one every time: 42 lessons in one day, 67% of the evidence from sisi working on sisi, 40 of
42 seen once. Its duplicate check matched a lesson about subagent hand-backs to one about
check timeouts and refused to record it.
23. **Whole-document rewriting machinery** (861 lines) exists to keep prose tidy.
24. **Scratch state is unbounded**: 22,651 session files, 177 MB.
25. **Eighteen tool adapters, six of which can block a turn.** The documentation is honest
about this; the count is not a problem, the unverified ones are simply not evidence.
## What is good and stays
- Installation: everything checked before anything is touched, content-addressed backups,
edits that never re-serialise a user's configuration, byte-for-byte uninstall (verified in a
sandbox), and hooks that let the turn end on any sisi error.
- The executable contract and the blocking gate with bounded send-backs. It is the one place
where "done" is evidence and not a sentence.
- The check runner (process-group kill on timeout, parallel cap) and the deep tier
(fingerprint freshness, detached runs).
- The trust allowlist for running a project's commands.
- Delivery timing measured from the last message the human typed.
- The product, personal and scratch split; personal data as its own git repository; cycles
that revert exactly.
- Handover of project facts into the project's own documents.
- The transcript evidence layer (`harvest`, `groundtruth`).
- Honesty: `doctor` says "unknown", `sisi rule` says "not enforced", `improve` says "not
measured", library entries say "what a pass does not prove".
- The test suite: fast, green and sandboxed.
- Routing as pure arithmetic over a judged record, with the reviewer drawn from a different
maker than the author.
## Verdict for every module
| Module | Lines | Verdict | Why |
|---|---|---|---|
| `cycle.py` | 2052 | Replace the core | Keep exact revert, the base-version lock and enforced checks; add validation, governance and monitoring; remove showing-driven promotion. |
| `retro.py` | 1899 | Replace | Record per [11.4]; a retro grounded in the unit's record; no strength ladder, no lesson list, no mandatory taxonomies. |
| `adapters.py` | 1626 | Keep | Works and is tested; unverified tools are already labelled. |
| `workers.py` | 1053 | Replace the core | One ledger, worker facts, a delegation contract, candidate cap. Keep discovery and failure classification. |
| `gate.py` | 989 | Rebuild | Around risk profiles; retro only at close; pause; subagents pass. |
| `documents.py` | 861 | Simplify | Keep structure checks; drop the trace regime. |
| `wiring.py` | 757 | Keep | Safe install. |
| `overlay.py` | 729 | Keep | The real promotion mechanism; trim its public commands. |
| `release.py` | 665 | Simplify | Keep release, rollback and scrubbed promote; retire developer mode. |
| `verifiers.py` | 616 | Keep, replace the matcher | Match by the structured tags entries already carry. |
| `hookjson.py` | 551 | Keep | The cost of never rewriting a user's JSON. |
| `harvest.py` | 541 | Keep | Evidence source; add token usage. |
| `cli.py` | 532 | Simplify | Fewer commands. |
| `lifecycle.py` | 445 | Keep | Fold `migrate` into `update`. |
| `scope.py` | 273 | Replace the logic | Scope earned by evidence, not claimed. |
| `routing.py` | 261 | Keep the arithmetic | Feed it facts; remove the vendor table. |
| `design.py` | 257 | Retire | Replaced by a requirement model and a risk note where the risk warrants. |
| `taskset.py` | 255 | Keep for the evaluation harness | Built and never run; it is the source of benchmark cases. |
| `prompt.py` | 255 | Simplify | Relevance only. |
| `hookio.py` | 249 | Keep | |
| `groundtruth.py` | 242 | Keep | Validation by replay needs its commits. |
| `contract.py` | 238 | Extend | The work-unit schema. |
| `delivery.py` | 235 | Keep | Becomes unit telemetry. |
| `verify.py` | 230 | Keep, extend | Five statuses, selection, reuse. |
| `handover.py` | 222 | Keep | Remove the per-prompt notice. |
| `deep.py` | 216 | Keep | |
| `store.py` | 211 | Keep | Add pruning. |
| `rulecmd.py` | 210 | Keep | |
| `pdata.py` | 195 | Keep | |
| `watch.py` | 192 | Keep | |
| `tick.py` | 167 | Simplify | Only what the session can act on. |
| `learn_cli.py` | 162 | Merge | Into the one report. |
| `paths.py` | 143 | Keep | |
| `gitutil.py` | 123 | Keep | |
| `audit.py` | 119 | Retire | Counts lines, judges nothing. |
| `principles.py` | 113 | Merge | One path for owner statements. |
| `scoreboard.py` | 100 | Merge | Into the scorecard, labelled inferred. |
| `escapes.py` | 89 | Merge | Into the scorecard. |
| `trust.py` | 46 | Keep | |
| `__init__.py`, `__main__.py` | 5 | Keep | One source for the version. |
| `done/` (20 recipes) | 626 | Keep | Good checklists; fix how they are found. |
| `verifiers/` (140 entries) | 8596 | Keep | Rank entries that ran here above documentation-only ones. |
| `canon/core.md` | 154 | Rewrite | As the operating policy, in the order work happens. |
| `canon/floors.json` | 7 | Replace | Floors by risk profile and technique, not a self-declared number. |
## Verdict for every command
| Command | Verdict |
|---|---|
| `contract` (init, check, waive, trust, untrust) | Keep; `waive` records a deviation instead of passing |
| `verify` | Keep, extend |
| `gate`, `tick`, `prompt`, `watch` | Keep (hooks); rebuilt as above |
| `rule` | Keep |
| `install`, `uninstall`, `doctor` | Keep |
| `release`, `rollback` | Keep |
| `dev` | Retire |
| `promote` | Keep, simplify |
| `migrate` | Fold into `update` |
| `update`, `export`, `import` | Keep |
| `build-canon`, `canon cost` | Internal; size shown by `doctor` |
| `overlay` | Internal except `revert` |
| `audit` | Retire |
| `retro` | Replace |
| `lessons` | Keep, smaller |
| `backlog`, `improve`, `time`, `scoreboard`, `lessons digest` | Merge into `status` |
| `cycle` | Keep, rebuilt |
| `note`, `propose` | Retire |
| `learn`, `oracle` | Keep |
| `design` | Retire |
| `handover` | Keep |
| `status` | Replace with the one report |
| `verifiers`, `done` | Keep |
| `workers`, `route`, `delegate` | Replace the core |
| `harvest`, `tasks`, `escapes`, `checks` | Internal to the evaluation harness |
| `version`, `help` | Keep |
| New: `unit`, `risk`, `approve` | See `docs/target.md` |
-95
View File
@@ -1,95 +0,0 @@
{
"commit": "ec91e52",
"modules": [
"__init__.py",
"__main__.py",
"adapters.py",
"audit.py",
"cli.py",
"contract.py",
"cycle.py",
"deep.py",
"delivery.py",
"design.py",
"documents.py",
"escapes.py",
"gate.py",
"gitutil.py",
"groundtruth.py",
"handover.py",
"harvest.py",
"hookio.py",
"hookjson.py",
"learn_cli.py",
"lifecycle.py",
"overlay.py",
"paths.py",
"pdata.py",
"principles.py",
"prompt.py",
"release.py",
"retro.py",
"routing.py",
"rulecmd.py",
"scope.py",
"scoreboard.py",
"store.py",
"taskset.py",
"tick.py",
"trust.py",
"verifiers.py",
"verify.py",
"watch.py",
"wiring.py",
"workers.py"
],
"commands": [
"contract",
"verify",
"gate",
"tick",
"prompt",
"rule",
"watch",
"install",
"uninstall",
"doctor",
"release",
"rollback",
"dev",
"promote",
"migrate",
"update",
"export",
"import",
"build-canon",
"canon cost",
"overlay",
"audit",
"retro",
"lessons",
"backlog",
"cycle",
"improve",
"note",
"propose",
"learn",
"design",
"handover",
"oracle",
"status",
"time",
"verifiers",
"done",
"workers",
"route",
"delegate",
"version",
"help",
"harvest",
"tasks",
"escapes",
"checks",
"scoreboard"
]
}
-31
View File
@@ -1,31 +0,0 @@
# What the owner has said about sisi
Recorded statements, quoted as recorded, each followed by where the reconciliation answers it
(`target N` is a section of `docs/target.md`; stages and cutover steps are in `docs/plan.md`).
These are requirements on the work.
- "It is NOT about that one system. This is a CORE STRATEGIC LEVEL BEHAVIOR to be smarter about how you do things. I shouldn't need to specify these menial details. This is a sisi core problem."
Answer: the rulebook becomes strategic direction with mechanisms behind it (target 1, 10).
- "sisi should also optimize for minimize(time to delivery) for each task. Just about anything I ask it to do can take HOURS, and sometimes it can take DAYS. I don't want to give up the autonomy or completeness or correctness! But I want both. I want all that AND I want it delivered quickly. So this needs to be part of the sisi core objective optimization function."
Answer: time to first useful result and to validated completion are measured per unit and reported with their percentiles; selection and reuse of checks; pauses and waits measured (target 5, 6; stage 2).
- "The pushed README still says 'Version 0.1.0, an early release.' under Status. This is the problem with this kind of text, hardcoded to specific versions or numbers or whatever. Also I'm pretty sure the whole README could be reduced by 25-50%."
Answer: stage 1 rewrites the README without versions or counts, and a test scans the product for perishable material.
- "For price and benchmarking, I'm totally fine with sisi doing web research on that, and updating it every now and then. Generally sisi is built for SWE tasks, so those kinds of benchmarks are what's most useful, and if they do well there they probably do well in other places too, with a few exceptions like specialized software security models."
Answer: worker facts with source and date, researched by a cheap worker when stale (target 9; stage 3).
- "the brand and title is always **sisi** is still improving. Lowercase, and emph on sisi if it is available."
Answer: stage 1 and stage 7 documents.
- "Make sure they do a cleanup and backfill to get that garbage out of my global disk data. Stuff like the keymap for phrp belong in that project's work list and design documentation!!! (on project-specific items stored in sisi's global data; lessons must be universally applicable, project details allowed only as the historical example of where a lesson came from)"
Answer: scope is earned by evidence and a learning is in force only in its own project until then; the migration in stage 6 re-scopes the existing lessons and hands project items to their projects (target 8; cutover step 2).
- "As part of the orchestrator incorporation into sisi, make sure you delete the old version so my sessions aren't running two orchestrators. Also we will need to let current running sessions know about the changes or else I need to restart them."
Answer: cutover steps 4 and 6.
- "Subagent performance history goes in the user sisi store, not sisi core. And sisi needs to work in t3 or Claude or Hermes or anything else out there. It should always choose the native subagent delegation mechanism!!!!!"
Answer: the ledger and worker facts live in the user store; `sisi route` names the host's own mechanism first (target 2, 9).
- "I feel like I'm really still having to lead you around by the nose. With sisi I thought you were going to be getting smarter, seeing around corners, anticipating and building what I need before I realize it????"
Answer: the requirement model with implied, contextual, anticipated and experiential requirements, required where the risk warrants; requirement surprise measured per unit (target 3, 4, 6).
- "The question you have to ask is whether something applies to ALL projects where sisi may be in play AND if it would be universally useful to ALL USERS who install and use sisi. If so it goes in sisi core! If not it's either a user-preference or project-specific and it goes in my user sisi data store. Working on the sisi project itself is the exception -- we'll normally just have sisi as our shell while we work on a wide variety of different projects."
Answer: the four layers and the universality test (target 2; stage 1).
- "OBTW part of this is deprecating the whole standalone orch.py thing to make that a core part of sisi. But it should be GENERIC and STRATEGIC in direction, so the agent works out the tactics on the fly. IOW, it shouldn't explicitly say use THIS EXACT MODEL or whatever. It sets out OBJECTIVES about how to discover models, discover pricing, discover benchmarking, measure performance, and dispatch and orchestrate DYNAMICALLY and INTELLIGENTLY. And it can leverage subagents with specific orchestration tasks like assessing, routing decisions, whatever. That could be a Haiku/Ember level model sometimes too! This should play DIRECTLY into the main system's objective function, especially around wall time, cost, efficiency."
Answer: target 9; stage 3; delegation time, tokens and overlap feed the scorecard (target 6).
- "Ok get to work. Also note that I'm totally fine with GROSS change. Rearchitecting is okay. The ONLY thing that matters is that we implement the spec (plus orchestration layer) PERFECTLY."
Answer: backward compatibility with the old design is not a goal; what is replaced is deleted.
-123
View File
@@ -1,123 +0,0 @@
# Records: the work unit, verification, telemetry and the scorecard
The open work unit is `.sisi/contract.json`. `sisi contract init` starts one and refuses while
another is open. `sisi unit close` archives it; the commands are `sisi unit close [--abandon
"<reason>"]`, `sisi unit pause "<what it waits for>"`, `sisi unit show [ID]` and
`sisi unit list`. `sisi help` lists them with the rest.
## The record
Closing writes `.sisi/units/<id>.json` in the project and one summary line (id, project,
closed time, risk, delivery status, scorecard) to `units.jsonl` in the user store. The archive is
created whole or not at all and is never replaced: closing twice, starting a new unit, abandoning
and a crash between the archive and the reset each leave every earlier record as it was, and a
second `sisi unit close` after a crash completes the close from the archive. An id already taken
by another unit moves the new one to a fresh id.
It holds the fourteen items of SPEC 10.2, the start and closing commits when the project is a
git repository, the risk floor (from the paths changed since the unit started, by the risk
table) beside the declared profile, the delegations the ledger has for the project in the
unit's window, the retro findings and learnings of the unit, and a hash of the policies in
force (rulebook, risk tables, enforced checks, gate and verify settings; it never contains a
path). Closing offers the unit to the evaluation harness as a benchmark case; a failure there
never stops the close.
Delivery status is one of `delivered`, `delivered-with-deferred`, `deviation` (a check was
waived), `unverified` (the gate released the unit after its send-backs) and `abandoned`. A unit
with a failing check cannot close as delivered. A mandatory check that never ran to a pass, is `not-applicable` and has never passed, or
whose `when_changed` glob matches no file, makes the unit `delivered-with-deferred`, never
plainly `delivered`. `sisi contract waive` records a deviation; it turns nothing green.
The record also carries `guard_refusals`: every building step the before-tool guard refused for
this unit, with what, when, the tool and the unit's state (see docs/design.md, section 4). Units
set aside with `sisi unit park` are kept whole under `.sisi/parked/<id>.json` with the reason, the
time and what each still owes. The guard's own state (which session continues which unit, a unit's
last activity, remembered floors) lives in the state folder and is scratch.
A pause records what the unit waits for. While nothing in the tree changes the gate asks
nothing; a change ends the wait, and so does running `sisi verify`. Waiting time is telemetry.
A contract must declare `risk.profile`; see [docs/design.md](design.md).
## The end-of-turn gate
At each stop the gate asks, in order: did **this session** change anything since its last settled
stop (its own edits only, read from its transcript and the before/after shell measurement, never another
session's work in the same tree)? If not, the turn ends silently, as it does for a paused unit with no
new change and for a closed unit. Otherwise it works out the profile and enforces what that profile's
row of `canon/risk.json` requires, and nothing else:
| Profile | Required |
|---|---|
| trivial | nothing (the retro is asked once only if the unit shows two send-backs or a human correction) |
| isolated | a contract with at least one check that can fail |
| logic | as isolated; every check has `covers` |
| integration | as logic; `invariants`, a `requirements` list (kind, text, decision), `risk.blast_radius` and `risk.rollback`, and an `approach` (chosen, why, an alternative) |
| data, critical | as integration, plus independent evidence |
| release | as data, plus every deep check passing on the tree |
Independent evidence is an accepted `review` delegation in the ledger for this project inside the unit's
window with a check stronger than `none`, or a passing check with `"independent": true` and a `"by"`
naming who or what produced it. Text such as `TODO`, `n/a` or `none` fills no field.
The profile is the floor (from the paths changed, see `sisi risk`) unless the contract declares a higher
one. A contract may declare a lower one only with `risk.why`; the unit then runs at the declared profile and
the record keeps floor, declared profile and reason, and `sisi status` shows it as lowered. Without a
reason the floor applies. With no unit open the floor covers the paths this session changed since its last
settled stop.
One send-back lists everything missing, each with the command or field that supplies it, within 25 lines.
When the checks pass and everything required is present, a unit with recorded retro findings is closed and
the turn ends; otherwise the gate says once, for that state of the tree, the two ways on: `sisi retro`
(which records the findings and so closes the unit) or `sisi unit pause "<what it waits for>"`. A pause ends when the tree changes or `sisi verify` runs; `sisi contract init` refuses while a unit is open or paused; `sisi status`
lists open and paused units with their age. Send-backs are bounded (`gate.max_blocks`); when they run out
the gate lets the turn end, the unit's delivery status is `unverified`, the record says why, and the
agent is told to say so in its report. A subagent's stop never blocks and never asks for a retro; what it
observed (that it edited, and which files) is recorded for its parent's gate. When a logic-or-higher unit
has no check stronger than examples (rung 2 or better) the gate says so once, without blocking, and the
record stores whether the unit had one. A `git commit` or `git merge` whose unit has no passing result for the
current tree prints a one-line notice (`sisi verify`) and is never blocked.
## Verification
Five statuses: `passed`, `failed`, `skipped`, `not-applicable`, `not-run`; the last three always
carry a reason. A timeout is `not-run (timed out)`; a check a person must judge is `not-run (needs
human)`. A failed check blocks, and so does a mandatory not-run other than a recorded deferral or
needing a human.
- A check with `when_changed` runs only when a changed path matches (`skipped (not affected by
this change)`); one whose globs match no file is `not-applicable`. `--all` runs everything.
- A check whose command and inputs (the watched files, or the whole tree) are identical to its
last pass is `skipped (reused: passed at ...)`. A failure is never reused. Files git ignores are
not seen by the whole-tree fingerprint.
- `sisi contract check` refuses a command that cannot fail (`true`, `:`, `exit 0`, `echo`,
`test 1 = 1`, any of them in `sh -c`, joined with `;` or `&&`, or after `||`). This is a floor,
not a proof: no analysis finds every constant.
- Every result stores its duration and whether the check has been seen failing in the unit.
`sisi verify` prints the slowest checks and the time saved by selection and reuse.
## Telemetry and the scorecard
Every value is `{"value", "class"}` with class `measured`, `inferred`, `estimated` or
`unavailable`; an unavailable value has no value, and is never counted as zero. Tokens by
category and model, question dialogs, human messages and inferred corrections come from the
host's transcript when it has one with usage; cost is estimated only when every model used has a
recorded price. Changed files and lines come from git; delegations from the ledger.
The scorecard has the eight dimensions of SPEC 13.1. Slow checks run in the background and block only a `release` change. Failed checks keep their
failure evidence with the result. `sisi status` prints the last five units with
their scorecards and then trends by project, risk profile, model and policy version, with the
median and 95th percentile and "too few" under five units. It prints no single score.
`sisi status --learning` prints the learning report.
## Scratch
Session-state files older than `scratch.session_max_age_days` (30) are removed on the first
session start and every `scratch.prune_every`th (20) after it, with no scheduler. A run is
bounded by `prune_max_delete` files and `prune_budget_s` seconds and the next start continues. A
session is kept while it is the current one or its transcript has been written to within the age.
## What this does not do
Token and cost figures need a host transcript with usage; without one they stay unavailable.
The risk floor is a minimum from paths alone, not a verdict on the change. Approval
authenticity rests on a terminal check, not on proving who typed a relayed decision.
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
-101
View File
@@ -1,101 +0,0 @@
# Verifier library: format and quality bar
The library exists so that an agent, in any tool, can answer two questions
without asking a human: "how do I know this works?" and "how do I know I am
done?". Agents query it with `sisi verifiers for "<claim>"` and `sisi done for
"<kind of work>"`. Every entry must be something an agent can act on in
minutes: a real tool, a real command, and a snippet it can paste into a
contract.
## Technique entries: `verifiers/<section>/<id>.md`
Sections: `design`, `prove`, `many-inputs`, `concurrency`, `test-quality`,
`regression`, `real-world`, `safety`, `intent`, `completeness`.
The file stem equals `id`. Lowercase, hyphens. The file starts with a header
of single-line `key: value` pairs between `---` lines:
```
---
id: cargo-mutants
title: Mutation testing for Rust with cargo-mutants
answers: Would my tests notice if this code were wrong?
rung: 2
section: test-quality
languages: rust
kinds: general, money, parsing
cost: medium
detect: cargo mutants --version
ran_here: no
verified: docs
---
```
- `answers`: the question, in plain words, that a passing run answers. This
is what the chooser matches on, so write it the way an agent would phrase
its doubt.
- `rung`: 1 proof, model checking or types; 2 property-based testing, fuzzing,
differential, mutation; 3 examples; 4 golden files and snapshots;
5 judged rubric; 6 human.
- `languages`: comma list, or `any`.
- `kinds`: any of general, concurrency, parsing, money, state-machine,
migration, ui.
- `cost`: low, medium or high. Set-up plus run effort for a first use.
- `detect`: a shell command that exits 0 when the tool is installed. Empty if
the technique needs no tool.
- `ran_here`: yes only if you ran the minimal example on this machine and it
behaved as the entry says.
- `verified`: `ran` (you ran it), `docs` (commands and flags checked against
the tool's current official documentation or its `--help`), or `memory`
(neither; avoid this, and never use it silently).
Body headings, in this order, all required:
- `## Use when`: the situations and claims it fits. Two to five bullets.
- `## Do not use when`: where it is the wrong tool or a weaker one is enough.
- `## Set up`: install and project set-up commands.
- `## Minimal example`: the smallest complete, correct example. Real code.
- `## Run`: the exact command, and under a `Passing looks like:` line the
output or exit status that means success. Say how failure shows.
- `## As a contract check`: a JSON object for the `checks` array of
`.sisi/contract.json`, with `id`, `claim`, `kind`, `rung`, `cmd`, `expect`
(`exit`, optionally `stdout_contains`) and `timeout_s`. Whenever `timeout_s`
is over 60, include `"tier": "deep"`: fast checks (the default) may not
exceed 60 s, because they run in the end-of-turn gate. Deep checks run with `sisi verify --deep`, in the background; a slow background check blocks
only a `release` change, never an ordinary turn by being slow.
Contract-level options: top-level `"parallel": true` makes `sisi verify` and
the gate run the fast-tier checks at the same time (at most 4; results still
come in contract order), and `"serial": true` on a check makes it always run
alone, for checks that share a port, a database or a build directory. Without
`parallel`, checks run one after another.
- `## What a pass does not prove`: the limits. Bounds, assumptions, things
that make a pass vacuous, and how to check that the check itself can fail.
Length: 30 to 80 lines. No history of the tool, no selling, no filler.
## Recipes: `done/<id>.md`
Header keys: `id`, `title`, `applies_to` (one line). Body headings, required:
- `## Done means`: the claims that must all be true, in plain words.
- `## Checks`: for each claim, the technique ids from `verifiers/` that can
show it, strongest first, and the minimum acceptable rung.
- `## Common false finishes`: the ways this kind of work looks done and is
not.
Length: 25 to 60 lines.
## Quality bar
- Commands and flags must be right. Check each against the tool's official
documentation or `--help`. A wrong flag costs an agent more than a missing
entry. If you cannot confirm something, say so in the entry.
- Run the minimal example when the tool is already installed on this machine.
Work only in a throwaway directory. Do not install toolchains globally and
do not change anything outside the sisi repository.
- Prefer the technique over the brand. If several tools do the same job in
different languages, one entry per language is right; two entries for the
same language and job is not, unless they differ in what they can show.
- Be honest about rung. A technique that samples is rung 2 at best.
- Use plain, direct English. Full sentences. No jargon the entry does not
explain.
-201
View File
@@ -1,201 +0,0 @@
# Workers: discovery, choice and delegation
sisi finds the agent command-line tools on the machine, keeps a judged record of work given to
them, and recommends the most affordable worker that is good enough. No model, price or ranking
ships in the product: everything specific is discovered here, researched into the user store,
or learned from judged results. The strategy is [canon/orchestration.md](../canon/orchestration.md)
(`sisi delegate guide` prints it); this page is the mechanics.
## The commands
- `sisi workers [--refresh]` — each tool found, the models it lists, whether it is usable now
and why not, allowance and price where known, runs waiting for a judgement, then the judged
record as three tables: by task type and difficulty (attempts, accepted, checked well, later
wrong, median minutes; thin rows marked), what fixed each rejection, and difficulty-guess
calibration.
- `sisi workers fact WORKER --price-in N --price-out N | --price N | --standing N --source S
[--date D] [--plan flat|per-use] [--maker M]` — record a price as published (input and output,
per million tokens), one blended price for a source that publishes only that, or a benchmark
standing (0–100; `--score` is the old name), each with its source and date, in the user store.
A fact without a source is refused. Ranking uses one blend of the two prices, by default three
parts input to one part output (`route.price_blend_input_parts`); `sisi workers` shows both
prices and the blend, and lists each benchmark standing apart from the accepted rates it prints.
- `sisi workers fact WORKER --maker M --class NAME [--released YYYY-MM-DD] --source S` — the maker, class and
release date researched for a model. `sisi workers` lists each routable worker's recorded maker, class and release date.
- `sisi workers classify [--record FILE [--by WORKER]]` — sisi reads nothing from a model's name. Without
arguments it prints a short instruction and the ids of routable workers that have no classification; hand
that to a fast, cheap worker (it takes seconds). The answer is one small JSON object: for each id its maker,
class and release date (`unknown` where it does not know), and for each maker its classes from most to least
capable. `--record FILE` validates it (an id that was not asked about refuses the whole answer; `unknown` is
stored as unknown and changes nothing in routing) and stores the facts with the classifying worker as the
source; a class order already recorded is never overwritten. Session start names unclassified workers in its
one facts line, and `sisi route` adds one line only when an unclassified worker is in the running.
- `sisi workers classes MAKER CLASS [CLASS...] --source S` — a maker's classes from most capable to least
(`--remove` forgets them). A class is the tier word of one line (a "flash" beside the standard model) or,
for a maker whose lines are the classes, the line's own name; `sisi workers` shows both as the class label.
- `sisi workers avoid|prefer PATTERN --why TEXT` — the user's own routing constraints.
- `sisi workers only PROVIDER PATTERN... --why TEXT` — only the matching models of that provider are
routable; anything else from it (a newly discovered model, say) is passed over with the reason.
`--remove` deletes the limit.
- `sisi workers note PATTERN "TEXT" --why SOURCE` — a standing operational fact about workers that
match PATTERN. Shown in `sisi workers` and, for the chosen and passed-over workers it applies to,
in `sisi route`, as information for the agent. The product ships none; `--remove` deletes one.
- A worker id with no provider prefix is a host-native worker (the host's own subagent model): it
needs no command-line tool, is usable unless marked down, and `sisi route` says to start it with
the host's own subagent tool. Everything `sisi workers` and `sisi delegate` write to the user
store is committed there, one small commit per command.
- `sisi workers down WORKER --reason limit|auth|missing|error [--until DATE-OR-TIME] [--note TEXT]` and
`sisi workers up WORKER` — availability. Without `--until`, the wait widens on repeat failures.
- `sisi workers import FILE` — merge another ledger file into the delegation ledger, idempotently,
printing row counts before and after. The source file is only read.
- `sisi route --kind K --difficulty 1|2|3 [--review-of W] [--explain]` — the recommended worker
and the mechanism to start it with (the host's own subagents, its cross-provider delegation,
or `sisi delegate`). `--explain` says why, briefly, and why the rest were passed over.
- `sisi delegate brief` prints the delegation-contract template (eight parts);
`sisi delegate check FILE` lists the parts a brief lacks.
- `sisi delegate --kind K --difficulty N --brief FILE [--worker W] [--review-of W] [--cwd DIR] [--timeout-min N]`
runs a brief through the worker's own CLI when the host has no delegation of its own. A brief
lacking outcome, acceptance or the files it may change is refused. `--timeout-min N` (1 to 120)
sets the time limit of this run in place of `workers.timeout_s` (default 15 minutes).
- `sisi delegate judge` is the only way a result enters the ledger: by run id for
`sisi delegate` runs, or directly (`--worker --type --difficulty`) for work run any other way.
It carries outcome, the strongest check applied, minutes, tokens, cost, retry-of, and project,
session and start/end times when known. `sisi delegate amend ID` marks one later proved
wrong; `sisi delegate recent [-n N] [--project P]` lists judgements to find an id.
## How the choice is made
Candidates are only workers with a judged record, a known price or a benchmark standing; discovered
catalogue models with none of those are listed but never routed to. On a cold start nobody
qualifies: the pick is then a trial among usable workers, `--explain` says so, and asks for the
result to be judged and facts recorded.
In order: a tier that trains on prompts is never chosen; unavailable and allowance-spent workers
are skipped and named; `avoid` patterns remove a worker unless that leaves nobody; a reviewer
comes from a different maker than the author (a stored `maker` fact, else derived from the model
id). Then the cheapest worker that is capable enough for the kind and difficulty, judged by the
best evidence about each worker, in this order: (a) its judged record for that kind and
difficulty (enough attempts at or above the accepted-rate bar, not later found wrong); (b) the
nearest judged evidence: the same kind at a harder difficulty proves an easier one, then all
kinds at that difficulty or a harder one (the same kind at an easier difficulty is weak evidence,
used only when no usable worker is capable otherwise); (c) benchmark standing as a prior, compared
only with other workers' standing: at least 85 percent of the best usable standing for difficulty
3, 60 percent for difficulty 2, no floor for difficulty 1 (`route.standing_floor` in the config);
(d) nothing known: difficulty 1 only, as an exploration. Above difficulty 1 a benchmark is a reason
to try a worker, not to prefer it to proof: when any usable worker is capable by a judged record for
the kind (a, or b from a harder difficulty of the kind), only those compete; the record across all
kinds counts as proof only when nobody has evidence from the kind; standing decides only when nobody
has a judged record for the request. A thick bad record at this or an easier
difficulty, or a thin one with repeated rejections, keeps a worker off its benchmark. The two
scales never meet: a standing is never compared with an accepted rate. Cheapest first among the
competing workers: flat-rate allowance before per-use prices (blended input and output), unknown prices
last, then standing, `prefer` patterns first, then load balancing across allowances. When no
worker is capable by the evidence, the strongest known usable worker is recommended and `--explain`
says that none is proven. About one difficulty-1 task in ten goes to a cheaper thin-record worker
instead, so cheaper options gather evidence. The choice is deterministic for one fixed record.
`--explain` prints one line for the evidence behind the choice (which of a to d, with the numbers),
one per group of workers passed over as not capable enough, and names an exploration or a fallback.
## Newest version of a class, always
Newer versions of a model are almost always better and almost always cheaper, so `sisi route` always uses
the newest version of a given model (the same maker and class) that is usable, and never an older version of
it. This is about versions of one model: a newer release of a different model or class never wins for being
newer. sisi reads
nothing from a model's name: a model's maker, class and release date are facts, researched by a cheap,
fast worker (session start and `sisi route` say when they are missing) and recorded with
`sisi workers fact WORKER --maker M --class C --released YYYY-MM-DD --source S`. A model's identity is its
maker and class; recency is its release date. For a maker whose lines are the classes the class is the
line's own name; for a maker with a "flash" beside its standard model it is `flash` or `standard`. A model
with no recorded maker and class is never compared with another. The same model through two providers is
one model: if its newest version is usable through any provider, older versions do not compete through any
provider, and the existing cost comparison picks the provider. There is no exception for a better old
record or a cheaper old plan. The older version competes again only while the newer is unusable (marked
down, allowance spent, avoided by the user, or limited away) or has no recorded class. A newer model with a
thick bad record is not replaced by its older version either: routing moves to another class or maker by the
usual rules. Different classes are different things and never supersede each other. A bare host alias with a
recorded class and no release date counts as the newest version of its class.
The class order is a prior and nothing more. A worker with no judged proof and no benchmark standing,
whose class is in its maker's recorded order, is capable when the class sits high enough for the
difficulty: `route.class_span` (default routine work 100, ordinary 70, hard 35) is the share of the order,
counted from the most capable class down, that each difficulty reaches. With four classes routine work
reaches all four, ordinary work the top three, hard work the top two; the cheapest capable worker then
wins, so routine work goes to the lowest class and hard work to the upper ones. A judged record or a
benchmark standing always outranks the order; when nobody is proven, the strongest known worker is the
one in the highest class. Classes of different makers are never compared. Until a maker with two or
more classes among the usable workers has an order recorded, `sisi route` adds one line asking for it.
A new version starts from its predecessor's judged record: a model with no thick record of its own
for a kind and difficulty inherits, as evidence, the thick record of the closest older version of
its maker and class (one version back at a time), named in `--explain`. It ranks below the model's
own record and above a benchmark, counts as a judged record for the rule that proof comes before
benchmark, stops once the model has a thick record of its own, and a predecessor's bad record is not
inherited. A discovered model with no data of its own is routable when its predecessor is. Where the
arithmetic falls back to a stable tie-break, the newer version of the same model goes first (never across makers
or classes).
## Costs and failures
Tokens and cost are captured where the worker's output reports them, and marked `unavailable`
otherwise; when tokens are known but cost is not, cost is estimated from the price fact and
marked `estimated`. Failure is recognised from output text, never the exit status alone: a
limit, login, missing tool or outage is unavailability with a retry time, the brief falls
through to the next choice, and quality is untouched. Poor work is a rejected judgement, which
never marks a worker down. No approval- or sandbox-switching flag is passed unless the config
allows it per tool (`workers.allow_bypass`).
## Orchestration the hooks enforce
`sisi route` records the session's routing decision (kind, difficulty guess, pick). A delegation started with
the host's own tool is written to the ledger by the hooks as a pending run with that kind and difficulty, and
completed when it returns; `sisi delegate judge ID --outcome O --check C` then needs nothing else. A worker
other than the router's pick is recorded as an override, and `sisi workers` ends with one line on how often
and how they turned out. After a rejection `sisi delegate judge` prints `sisi route --retry-of ID`: the same
worker with a better brief first, then a worker whose evidence is strictly better (`routing.retry_choice`, the
same ladder the capability routing uses). `sisi route --kind K` takes only the ledger's kinds (`impl`, `impl-multi`,
`edit`, `tests`, `debug` build; `read`, `search`, `research`, `review`, `docs` do not; the list is data in
canon/guard.json) and names them when given another; the decision is kept in the session's orchestration meter,
which is also where the contract guard reads it to tell a build delegation from a read.
When a worker fails for a reason that is not about its work (a quota, limit, login or connection failure,
arriving as a delegation result or as a host notice), the hooks record it down until the reset time in the
message, mark its pending run `superseded` and hand the agent the router's next worker. The agent is told to
fall back at once with the same brief and neither ask the person nor report it. `sisi delegate` itself says
the same when only host-native workers remain. A failure is read from the end of what a worker printed, never
from everything it read: `workers.failure_text` returns the last 1,500 characters of each stream, and nothing
when the run exited 0 and printed more than 4,000 (it did its work; a short exit-0 message such as a limit
notice is still read). Every classifier (a run, a model listing, a smoke run of a learned tool, a provider's
own phrases, a learned tool's phrases, the hooks on a host delegation result) reads that text. The shell hook
acts only on a command that really runs `sisi delegate` and only on a line that begins with a worker id and
` is unavailable (`, the last one. Models discovery finds that it had not seen are named once at
session start as unproven. Settings under `orchestrate`: `direct_calls`, `direct_chars`, `extension`,
`route_window_min`. Mechanics: [design.md](design.md) section 9.
## Stored, and when facts go stale
In the user store: `workers.json` (discovery cache), `delegations.jsonl` (the ledger),
`worker-availability.json`, `worker-prices.json` and `model-strength.json` (worker facts),
`worker-prefs.json` (avoid/prefer), `worker-notes.json` (standing notes) and `worker-drivers.json` (learned drivers). When facts are missing or older than
`workers.facts_max_age_days` (default 30), session start prints one line asking for a fast,
cheap worker to research current prices and benchmark standing and record them — an age check
during normal use, never a scheduler. Settings live under `workers` in the config:
`refresh_after_s`, `timeout_s`, `allow_bypass`, `facts_max_age_days`, `digest_days`,
`host_cross_provider`.
## What this does not do
Prices and benchmark standing are only as fresh as their recorded source and date. A worker
with no judged record, price or prior is listed but never routed to until evidence exists, except a new worker from the section above, which is tried on routine work first.
## Workers that appear later
A worker that did not exist when sisi was installed becomes routable through ordinary use; nothing is scheduled. Host tool names are data (`canon/orchestration-tools.json`, shared with the orchestration meter), never code.
- **From the host.** The after-tool hook reads the host's capability listing and delegation calls. Each provider the host says can run a task, and each model, is the worker `provider/model`; a provider the host disables is stored, never routable, and one missing from `discovery.drop_after_listings` listings (3) is dropped. A listing over `discovery.catalogue_over` models (8) is a catalogue: only models used, priced or with a standing are candidates. `sisi route` names the delegation tool and the ids to pass it. Your own `only` limit still decides what is routable.
- **From PATH.** Session start compares the executables in the user-level folders on PATH (nothing is run) with the stored list and names new ones once, five at most (`discovery.path_refresh_s`, `discovery.path_every_starts`).
- **A tool, learned as data.** `sisi workers learn NAME` prints the brief for a cheap worker to read the tool's help and write a small JSON driver; `--check FILE` validates, `--record FILE` stores it (`worker-drivers.json`) and runs one smoke task, `--verify` retries, `sisi workers forget NAME` removes it. The command is an argument list, never a shell. A name that collides with a built-in driver is refused. A command with a flag that switches off approvals or a sandbox runs nothing until the owner decides.
- **Earning a place.** Such a worker is unproven until it has `MIN_ATTEMPTS` judged attempts: difficulty 1 only, a free or flat one gets one routine task in `route.explore_free_one_in` (3), and `sisi route`/`sisi delegate` say to check its result. Unknown plan counts as per-use.
- **Providers.** A tool can carry several providers (the part of an id before the first slash), each with facts of its own that never reach another: `sisi workers plan PROVIDER flat|free|per-use --source S`; `sisi workers allowance PROVIDER --url|--command ...` (a probe: the key comes from a named command at probe time, goes in one request, and is never stored or printed; the smallest remaining window decides, the provider is down until every spent window resets; a failed probe changes nothing); `sisi workers signature PROVIDER --match TEXT --class auth|limit|missing|error` (the provider's own failure phrases, before the built-in ones). A limit marks that provider down until the time the error names, else the probe's reset.
- **Vouching.** `sisi workers vouch WORKER --up-to 1|2|3 --why "OWNER'S WORDS"`: capable up to that difficulty on the owner's word, ranked with judged proof, shown by `--explain` as its own evidence; a thick bad record overrides it and its own thick record replaces it. Words not found in a message the owner typed count only to difficulty 2.
- **The owner's decisions.** Learned drivers that switch off approvals (`drv-NAME`) and allowance probes (`probe-PROVIDER`) are decided with learning changes by one command, `sisi approve`: it lists all three kinds in full, and a decision needs the random word it prints typed at the controlling terminal. An agent's shell command is refused, whatever the id.