Documents rewritten around what now exists: design.md describes the built system, target.md retired
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
commit
52c15222e1
18 files changed
+419
-779
No files matched your search
@@ -17,6 +17,8 @@ All notable changes to this project are recorded here. The format follows
|
|||||||
- Telemetry with a class on every value, the eight-dimension scorecard, and `sisi status` as the
|
- Telemetry with a class on every value, the eight-dimension scorecard, and `sisi status` as the
|
||||||
one report (recent units, then trends by project, risk profile, model and policy version).
|
one report (recent units, then trends by project, risk profile, model and policy version).
|
||||||
- Scratch pruning of old session state, on a counter at session start.
|
- Scratch pruning of old session state, on a counter at session start.
|
||||||
|
- `sisi workers note` and `sisi workers only`; `sisi learn --withdraw`; failure evidence stored
|
||||||
|
with failed checks; `sisi help` grouped by reader with full text under `sisi help COMMAND`.
|
||||||
- The end-of-turn gate is rebuilt on risk profiles (docs/records.md, "The end-of-turn gate"): it
|
- The end-of-turn gate is rebuilt on risk profiles (docs/records.md, "The end-of-turn gate"): it
|
||||||
enforces exactly the `requirements` row of `canon/risk.json` for the profile (a contract, checks
|
enforces exactly the `requirements` row of `canon/risk.json` for the profile (a contract, checks
|
||||||
with `covers`, invariants, a requirement list, a risk note, an `approach`, independent evidence),
|
with `covers`, invariants, a requirement list, a risk note, an `approach`, independent evidence),
|
||||||
@@ -51,6 +53,9 @@ All notable changes to this project are recorded here. The format follows
|
|||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
- The package version is read from the VERSION file, the one source of truth.
|
- The package version is read from the VERSION file, the one source of truth.
|
||||||
|
- A contract must declare `risk.profile`; a mandatory check that is not-applicable and has
|
||||||
|
never passed counts as never run; a pause also ends when `sisi verify` runs; `sisi status`
|
||||||
|
shows the last five units; `sisi update` on an installed copy runs the migration step.
|
||||||
- The README is rewritten and shortened; contributions are judged against SPEC.md by
|
- The README is rewritten and shortened; contributions are judged against SPEC.md by
|
||||||
requirement id.
|
requirement id.
|
||||||
|
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ to report a problem privately.
|
|||||||
## Where to read more
|
## Where to read more
|
||||||
|
|
||||||
- [SPEC.md](SPEC.md) — the standard sisi is built and judged against.
|
- [SPEC.md](SPEC.md) — the standard sisi is built and judged against.
|
||||||
- [docs/target.md](docs/target.md) — how sisi meets that standard.
|
- [docs/design.md](docs/design.md) — how sisi meets that standard.
|
||||||
- `sisi help` — every command, with no per-command reference kept in this file.
|
- `sisi help` — every command, with no per-command reference kept in this file.
|
||||||
- [docs/README.md](docs/README.md) — the index of the remaining documentation.
|
- [docs/README.md](docs/README.md) — the index of the remaining documentation.
|
||||||
- [CONTRIBUTING.md](CONTRIBUTING.md) — how to run the tests and send a change.
|
- [CONTRIBUTING.md](CONTRIBUTING.md) — how to run the tests and send a change.
|
||||||
|
|||||||
+10
@@ -65,3 +65,13 @@ delivery for good.
|
|||||||
Please report security problems privately, using a private security advisory on the GitHub repository
|
Please report security problems privately, using a private security advisory on the GitHub repository
|
||||||
(github.com/swaits/sisi, "Security" tab, "Report a vulnerability"). Do not open a public issue for something
|
(github.com/swaits/sisi, "Security" tab, "Report a vulnerability"). Do not open a public issue for something
|
||||||
that could be exploited. Include the version (`sisi --version`), what you did, and what happened.
|
that could be exploited. Include the version (`sisi --version`), what you did, and what happened.
|
||||||
|
|
||||||
|
## What these mechanisms do and do not guarantee
|
||||||
|
|
||||||
|
The trust list guarantees only that an untrusted project's contract does not run; it does not
|
||||||
|
make a trusted contract safe. Protected rules guarantee that a cycle or overlay cannot change
|
||||||
|
them; they do not stop someone who can write the product folder. Owner approval guarantees
|
||||||
|
that a consequential change waits and that a decision without a terminal is refused unless
|
||||||
|
relayed approval is allowed in config; it does not prove who was at the terminal. The
|
||||||
|
delivery ledger guarantees that only rows sisi's own commands wrote, as written, are
|
||||||
|
delivered; it does not prove the content of a row is true.
|
||||||
+2
-2
@@ -4,9 +4,9 @@
|
|||||||
|---|---|
|
|---|---|
|
||||||
| [../README.md](../README.md) | learn what sisi is, install it and try it |
|
| [../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 |
|
| [../SPEC.md](../SPEC.md) | read the standard sisi is built and judged against |
|
||||||
| [target.md](target.md) | see how sisi meets that standard |
|
| [design.md](design.md) | see how sisi meets that standard, and why it works the way it does |
|
||||||
| [design.md](design.md) | understand why sisi works the way it does, and what is built versus only designed |
|
|
||||||
| [records.md](records.md) | know what a closed work unit records, the five verification statuses, telemetry classes and `sisi status` |
|
| [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 |
|
| [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 |
|
| [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 |
|
| [personal-data.md](personal-data.md) | know where sisi keeps what it learns, how the overlay works, and what an update touches |
|
||||||
|
|||||||
+344
-403
@@ -1,409 +1,350 @@
|
|||||||
# sisi: design
|
# How sisi meets SPEC.md
|
||||||
|
|
||||||
Status: this document describes the design of sisi and marks what is built and what is not. The section
|
This document describes sisi as it is built. Section numbers in brackets are sections of
|
||||||
"What is built" lists both. Where the text below says "sisi does" something that the list marks as not built,
|
`SPEC.md`, which is the standard. Where this document and the specification disagree, the
|
||||||
read it as the intended design.
|
specification wins. For the dated record of how the rebuild was decided, see
|
||||||
|
`docs/reconciliation/`.
|
||||||
|
|
||||||
## Intent
|
**sisi** is still improving: this design describes the current system, and the learning loop
|
||||||
|
in section 8 is how it changes.
|
||||||
|
|
||||||
AI coding tools execute well and understand poorly. An agent does not know what success means, so it guesses,
|
## 1. What sisi is
|
||||||
and sometimes it damages work that was already good. Nobody can list every such failure in advance, so the
|
|
||||||
system has to find them itself.
|
|
||||||
|
|
||||||
The end state: a person states a product and gets a verified product. Five objectives, each with the number
|
sisi is the operating layer that makes a host AI coding tool behave as the engineering
|
||||||
that shows it:
|
organization the specification describes, makes that behaviour observable, and improves it from
|
||||||
|
evidence. The host tool supplies the agent. sisi supplies five things:
|
||||||
|
|
||||||
| Objective | Shown by |
|
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].
|
||||||
|
- `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 |
|
||||||
|---|---|
|
|---|---|
|
||||||
| Work at a higher level (functions, modules, products) | size of verified work delivered per human message |
|
| Intent fulfilment | requirements with a passing check; requirements added after the first verification (surprise); human corrections after delivery (inferred) |
|
||||||
| Verifiable outcomes, formal where possible | share of delivered claims backed by a check that ran, by rung |
|
| Correctness and assurance | results by status; techniques used; checks seen failing; independent evidence; deviation or unverified flags |
|
||||||
| Hands off | human minutes and blocking questions per delivered piece of work |
|
| 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 |
|
||||||
| Delivered sooner, with no weaker check | median time from request to verified result (`sisi status`) |
|
| Resource efficiency | tokens by category and model; cost from known prices (estimated); retries |
|
||||||
| Improves itself from use, everywhere | the numbers above, as trends, across all tools |
|
| Parallelism | delegations, how many overlapped, worker minutes against wall time |
|
||||||
|
| Human experience | human messages, question dialogs, corrections (inferred) |
|
||||||
## The objective
|
| 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 |
|
||||||
Hard requirements come first: the result is correct, complete, verified at the rung its kind of claim needs,
|
|
||||||
and what the human meant. Among results that meet them, sisi minimises two things: the time from the request to
|
`sisi status` is the one report: the last five units with their scorecards, then trends by project,
|
||||||
a verified result (time to delivery), and the number of times the human is interrupted. Speed is never bought
|
risk profile, model and policy version, with the median and the 95th percentile, and "too few"
|
||||||
with a weaker check or a smaller result.
|
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.
|
||||||
Time to delivery is measured, not guessed. Each time the end-of-turn gate lets a turn end it records one
|
|
||||||
delivery row: the time since the last message the human actually typed (hook feedback and tool results do not
|
## 7. The gate [9, 10.3, 17]
|
||||||
count), how many times the gate sent the agent back, and how long the checks ran. `sisi status` shows the median
|
|
||||||
and 90th percentile for the last 7 days against the 7 days before, the share spent in checks, and the five
|
At the end of a turn in which the session changed something:
|
||||||
slowest checks; `sisi status` shows the 7-day median.
|
|
||||||
|
1. Compute the risk floor. If the profile requires a contract and none is open, say so.
|
||||||
A learned change that speeds things up but fails a check is rejected. A learned change that keeps every check
|
2. Run the selected fast checks. A blocking result sends the agent back with the failures.
|
||||||
passing but makes median delivery slower is flagged for reversal. (Built: `sisi cycle status` flags a cycle
|
3. If the profile's other requirements are missing (requirement model, risk note, independent
|
||||||
whose deliveries got worse, and the next cycle brief puts reverting or repairing it first. There is still no
|
evidence), say which.
|
||||||
replay testing before a learned change ships; it lands in the personal overlay and is judged after.)
|
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>"`.
|
||||||
## Why the first design was thrown out
|
5. A paused or closed unit with no new change passes silently.
|
||||||
|
|
||||||
The first version was a rulebook of at most 120 lines, plus advice. It was attacked and found too small, for
|
In this build the retro is offered once for each state of the tree and a trivial change is asked
|
||||||
these reasons, which still shape the design:
|
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
|
||||||
1. **It was advice.** The definition of done was prose in an instruction file. Nothing made an agent write it or
|
docs/records.md, "The end-of-turn gate".
|
||||||
run it.
|
|
||||||
2. **It had a low ceiling.** Its only output was one rulebook. The best case was one good instruction file, then
|
Send-backs stay bounded; when they run out the unit is released as `unverified` and recorded
|
||||||
a plateau.
|
as such. A session marked as a subagent is never blocked and never sent back for a retro: a
|
||||||
3. **It ignored the main objective.** Product-level work was a late phase, and "not a new harness" was a stated
|
subagent's last message is its report to its parent and must stay that. The question-dialog
|
||||||
non-goal. Nothing in it could drive hours of work from one sentence.
|
gate stays as it is.
|
||||||
4. **It treated the human as a cost.** The human can help define success; the first version only tried to ask
|
|
||||||
less.
|
## 8. The learning loop [11, 14.4]
|
||||||
5. **Its measurements were weak.** A classifier's opinion of transcripts, compared before and after with no
|
|
||||||
control group. And "fewer corrections, fewer questions" is also what a user who has given up looks like.
|
**The retro** runs when a unit closes. It is grounded in the record: `sisi retro` with no
|
||||||
6. **It left the best data unused.** Records of delegated work, with outcomes, show that most rejections are
|
arguments prints the unit's scorecard and what stands out in it. Each finding is recorded with:
|
||||||
fixed by a better brief. The hand-off of intent is the largest known source of failure, and the first
|
|
||||||
version declared that out of scope.
|
```
|
||||||
7. **It ignored competing instructions.** Installed plugins can tell agents to do the opposite of the rulebook
|
sisi retro --finding "<what happened, with the evidence>" --cause "<root cause>"
|
||||||
(for example, forcing a question-and-answer design conversation before any work). The loudest instruction
|
--impact value|correctness|time|cost|attention
|
||||||
wins.
|
--disposition promote|record|drop
|
||||||
8. **Formal methods were one line of text.** Agents fall back to example tests because the formal tools are not
|
promote: --change "<the exact improvement>" --mechanism policy|orchestration|skill|tool|infrastructure|verification|knowledge|benchmark
|
||||||
installed or set up.
|
--scope organization|user|project|task-class --expect "<observable effect>" --validate "<how it will be tested>"
|
||||||
9. **It opened a hole.** Any agent could write "facts about the user" that every agent in every tool would then
|
record: --limits "<where it applies and where it does not>"
|
||||||
obey. An agent misled by a web page could poison all of them.
|
drop: --why-not "<why it is not worth promoting>"
|
||||||
|
[--same-as ID]
|
||||||
## Goals
|
```
|
||||||
|
|
||||||
- Success is an executable artefact, enforced by the tools, not requested.
|
At least one finding per closed unit; generic findings are refused as now. Search terms,
|
||||||
- One sentence can start work that runs to a verified result.
|
topics and short lines are derived by the tool, not demanded. A finding that resembles an
|
||||||
- The human's time goes to defining success, without blocking the work.
|
existing learning is attached to it as a recurrence candidate instead of being refused.
|
||||||
- What accumulates is capability (checks, verifiers, a calibrated judge of the human's taste, playbooks), not
|
|
||||||
only rules.
|
**The learning record** follows [11.4]: id, title, source unit, observation (evidence,
|
||||||
- One shared store for everything, used by every tool.
|
impact), root cause, proposed change (description, mechanism type, scope, target), expected
|
||||||
|
effect, validation (method, benchmark), status, version, provenance (every unit and project it
|
||||||
## Non-goals
|
was seen in), confidence. Status moves through `observed`, `analyzed`, `proposed`,
|
||||||
|
`implemented`, `validated`, `promoted`, `monitored`, and may end `revised`, `reverted` or
|
||||||
- No cron, timers, daemons, or third-party Python packages. Everything runs because a tool was used or a
|
`rejected`.
|
||||||
command was started.
|
|
||||||
- No new chat UI. sisi drives the existing command-line tools.
|
**Scope is earned.** A learning is in force in the project it came from at once. It is
|
||||||
- No per-project tuning. The store is global. Contracts are per piece of work.
|
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].
|
||||||
## Anti-goals
|
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
|
||||||
- An agent that asks nothing and delivers something wrong.
|
keeping it in history.
|
||||||
- Ceremony on small tasks.
|
|
||||||
- Changes nobody can see or undo.
|
**Promotion** is the cycle, due by a counter. A cycle turns proposed learnings into
|
||||||
- Scores that go up while the delivered work gets worse.
|
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, or rule text. Changes to
|
||||||
## Part 1: contracts that are enforced
|
sisi's own code are `tool` learnings: they go to the backlog and the contribution export.
|
||||||
|
`sisi cycle apply`:
|
||||||
A **contract** is a file that says how this piece of work will be known to be done. The agent writes it from the
|
|
||||||
request and the project. It holds:
|
- **validates before promoting**. A command check is replayed on the commits of the unit it
|
||||||
|
came from where they are known (must fail before the fix, pass after). What cannot be
|
||||||
- **checks**: each has the claim it supports, the command that tests it, the expected result, and its rung on
|
replayed is promoted as `unvalidated` and reported as such; it is never called validated.
|
||||||
the ladder
|
- **commits** each change to the user store; revert is exact, as now.
|
||||||
- **invariants**: for existing work, what must not change or get worse, with a baseline captured before the
|
- **refuses** to touch protected rules (`canon/protected.json`: the non-negotiable
|
||||||
first edit
|
constraints, verification before done, truthful reporting, this governance). Disabling a
|
||||||
- **assumptions**: what the agent decided to fill gaps
|
rule, widening a scope to everything, or adding a command that runs in every project is
|
||||||
- **open questions**: only those where the answer cannot be worked out and a wrong guess is expensive, each with
|
consequential: it is stored as pending and takes effect only after the owner's decision
|
||||||
a default
|
(`sisi approve ID --yes|--no`, asked through the host's question dialog). `sisi approve`
|
||||||
- **design** (sizeable work): how the approach was chosen — what the goal and the owner's standing
|
refuses a decision made without a terminal unless a config setting allows relayed approval.
|
||||||
principles imply that the request did not spell out; what the environment, host tool or existing
|
- **must act on flagged learnings**: see monitoring.
|
||||||
system already provides that should be used instead of built, with evidence it exists; at least two
|
|
||||||
other approaches with cost and risk; the chosen one and why it is what the owner would pick; for
|
**Monitoring.** A recurrence after promotion counts against the learning. Two recurrences flag
|
||||||
each standing principle, the objection the owner would raise and how the design answers it (or why
|
it "not working"; the next cycle must revise or revert it. `sisi status --learning` shows, per
|
||||||
it does not apply); and an independent challenge by a different model or a subagent playing the
|
promoted learning, units since, recurrences and a verdict, and the realization rate
|
||||||
owner, with what changed in response. Validation is structural and aimed at filler (named existing
|
(promoted learnings holding with no recurrence over at least five relevant units).
|
||||||
things are checked where checkable, a command on PATH or a file in the repository). That the
|
Being shown is not evidence: showings never promote anything.
|
||||||
challenge predates the first edit is honestly not checkable: edit attribution records paths, not a
|
|
||||||
first-edit time, so a parseable recording time is all that is required
|
## 9. Orchestration [7]
|
||||||
|
|
||||||
The ladder, highest first:
|
The product gives direction and keeps the record. It names no model.
|
||||||
|
|
||||||
1. Proof, model checking, the type system
|
**Direction** (one rule in the rulebook, a longer playbook on demand in `canon/orchestration.md`):
|
||||||
2. Property-based tests, fuzzing, comparison with a reference
|
the main agent owns the outcome; give each task to the least expensive worker that is
|
||||||
3. Example tests
|
sufficiently capable, counting rework as cost; use the host's own delegation first; run
|
||||||
4. Golden files and snapshots, including screenshots
|
independent work in parallel when it shortens the critical path; write a delegation contract;
|
||||||
5. A rubric scored by a judge model whose agreement with the human is measured
|
judge what comes back in proportion to risk and record the judgement; treat an unavailable
|
||||||
6. The human
|
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
|
||||||
`sisi verify` runs the contract and records every result in the shared store. A contract with top-level
|
itself (discovery, price and benchmark research, first-pass review can go to a fast cheap
|
||||||
`"parallel": true` runs its fast-tier checks at the same time (at most 4); a check with `"serial": true` always
|
worker).
|
||||||
runs alone. Results are reported in contract order either way.
|
|
||||||
|
**The record** (user store):
|
||||||
**Enforcement.** The tool's end-of-turn hook calls `sisi verify`. If a contract exists and a check fails or was
|
|
||||||
not run, the agent is sent back with the failures and cannot report the work as done. If no contract exists and
|
- `sisi workers`: the tools and models found on this machine, what is usable now, and the
|
||||||
the change is larger than a small threshold, the agent is sent back to write one; a change that size
|
judged record as three tables: by task type and difficulty; what fixed each rejection (a
|
||||||
with a contract whose design section is missing or fails validation is sent back to fill it. Small
|
better brief, a stronger worker, nothing); how good the difficulty guesses were.
|
||||||
edits and subagents pass untouched, and the same send-back budget bounds every send-back, so no
|
- **Worker facts**: prices and benchmark standing, each with a source and a date, written by
|
||||||
session is trapped. Request-time delivery hands the standing principles and the design instruction
|
`sisi workers fact …`. When facts are missing or old, session start says so in one line and
|
||||||
over when a request reads as design or build work, and `sisi design` prints them before a contract
|
asks for a cheap worker to research them. Nothing is hard-coded.
|
||||||
exists.
|
- Routing treats a worker id with no provider prefix as the host's own subagent.
|
||||||
Claude Code supports a blocking stop hook. The equivalent in OpenCode, Codex and Muse is not verified; where it
|
`sisi workers note` records a standing fact about matching workers and `sisi workers only`
|
||||||
does not exist, verification is meant to run at the next session start and failures to be reported then (that
|
restricts routing to matching models of one provider; both are honoured by `sisi route`.
|
||||||
fallback is a design intention, not built).
|
`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
|
||||||
**What a risk profile requires.** The strength of the evidence follows the risk of the change, not the kind a
|
workers with a judged record, a known price or a benchmark prior. With a thin record it
|
||||||
check declares for itself: logic and above need every check to say what it covers, integration and above need
|
ranks by price and prior instead of arbitrarily, and about one low-stakes task in ten goes
|
||||||
invariants, a requirement list, a risk note and an approach, and data, critical and release need independent
|
to a cheaper worker with a thin record. `sisi workers avoid|prefer PATTERN --why` holds the
|
||||||
evidence. The table is `requirements` in `canon/risk.json`; the gate enforces it and nothing else.
|
user's own constraints.
|
||||||
|
- `sisi delegate judge …` is the only way a result enters the ledger (type, difficulty, worker,
|
||||||
**Formal tooling is provisioned.** sisi keeps a verifier library: for each language and kind of claim, the
|
outcome, strongest check applied, minutes, tokens, retry-of). `amend` marks one that later
|
||||||
tool, a working template and a worked example (Kani and Verus for Rust, TLA+ or Quint and Alloy for designs,
|
proved wrong. `down`/`up` record availability. The ledger is where a unit's delegation
|
||||||
property testing per language, screenshot comparison for UI). Each time a check was hard to set up, the set-up
|
telemetry and the parallelism measure come from.
|
||||||
is meant to be saved, so the next use is cheap.
|
- **Delegation contract** [7.5]: `sisi delegate brief` prints the template (outcome and scope,
|
||||||
|
context and sources of truth, constraints and interfaces, acceptance, deliverables and
|
||||||
**Feedback.** Feedback from the human becomes an amendment to the contract, restated in one line. Only what the
|
report format, files it may change, verification expected, budget, when to escalate);
|
||||||
amendment covers may change, and the invariants are re-run. A UI that was good stays good unless the amendment
|
`sisi delegate check FILE` says which parts a brief lacks.
|
||||||
says otherwise.
|
- `sisi delegate --brief FILE …` still runs a worker through its own CLI when the host has no
|
||||||
|
delegation of its own.
|
||||||
## Part 2: the conductor (not built)
|
|
||||||
|
The owner's hand-written orchestrator (`orch.py`, its ledger, and the section of his Claude
|
||||||
`sisi build "<what I want>"` would turn a statement into verified work. It can be started from a terminal or by
|
instructions) is replaced by this. Its ledger is merged into the user store with a row count
|
||||||
an agent inside any tool. It is a plain program that drives the installed command-line tools in headless mode.
|
check, then it is removed.
|
||||||
Its state is on disk in the shared store, so a run survives the session that started it and can be resumed from
|
|
||||||
any tool. None of this exists yet; there is no `sisi build` and no `sisi inbox` command.
|
## 10. The rulebook
|
||||||
|
|
||||||
1. **Frame.** A strong model writes the product contract: acceptance checks for the whole, and for the core
|
`canon/core.md` is rewritten as the organization's operating policy, in the order work happens.
|
||||||
logic a formal model where one applies. It fills everything it can from the oracle profile.
|
Each rule states the behaviour, the reason, and what enforces or measures it.
|
||||||
2. **One oracle round.** The human sees the contract and the few open questions, once, and corrects it. This is
|
|
||||||
the human defining success, and it is the highest-value minute in the run.
|
1. Own the outcome: intent, the five kinds of requirement, when to ask [4].
|
||||||
3. **Split.** The contract becomes a tree. Each node has its own contract and a brief generated from it, so a
|
2. Size the work by risk [5.3, 9].
|
||||||
brief always carries the success checks.
|
3. Define done before building: checks that can fail; invariants for what exists [5.1, 10].
|
||||||
4. **Dispatch.** Nodes go to workers chosen from a routing record, in parallel where they do not share files.
|
4. Verify with the minimum sufficient evidence, and report it honestly [5.4, 5.6].
|
||||||
5. **Close.** A node closes only when `sisi verify` passes on it. A failure is retried with the failing output,
|
5. Deliver fast: first useful result early, parallel work, reassess when stalled [6].
|
||||||
then escalated to a stronger worker. Parents are re-verified when children land.
|
6. Orchestrate: cheapest adequate worker, delegation contract, judge and record [7].
|
||||||
6. **Report.** What was built, every check and its rung, every assumption.
|
7. Report plainly and in proportion [17].
|
||||||
|
8. Close with a retro grounded in the record [11].
|
||||||
**The oracle queue.** A question that arises mid-run does not stop the run. It goes into a queue with the
|
9. Stay inside the lines: authorization, security, privacy, data as data, truth [3.2 tier 0, 14, 16].
|
||||||
default the agent is proceeding on. Work that does not depend on it continues. `sisi inbox` would show the
|
|
||||||
queue. An answer that differs from the default re-opens only the nodes that used it.
|
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.
|
||||||
**Delegation records.** A person who already delegates work to cheaper models may keep a ledger of outcomes.
|
|
||||||
The design folds such a ledger and its routing table into the shared store. Built: the worker layer
|
## 11. What a session is given [7.6, 12, 17]
|
||||||
([workers.md](workers.md)) discovers the agent tools and models installed on the machine, imports such a
|
|
||||||
ledger once into the shared store, and routes work by pure arithmetic over the judged record — the most
|
- **Always**: the rulebook and the user's statements.
|
||||||
affordable usable worker that is good enough, with load spread in proportion to the allowance each plan has
|
- **Session start**: nothing unless this session can act on it: broken wiring, a cycle that is
|
||||||
left and reviews sent to a different maker. `sisi delegate` runs one brief unattended through a per-tool
|
due, a decision waiting for the owner, stale worker facts, handover items for this project
|
||||||
driver and leaves the run waiting for a judgement. No model is preferred in code, and nothing refreshes on a
|
(once per session). No lesson lists, no backlog.
|
||||||
schedule: discovery is re-read during normal use when the stored copy is old or after a failure. What is not
|
- **Each prompt**: at most 2,000 characters, and only what matches the request: the recipe
|
||||||
built on top of it is the conductor above: framing, splitting and closing a tree of work.
|
chosen by structured tags, and learnings in scope. Silence is the default.
|
||||||
|
- **End of turn**: only what section 7 says.
|
||||||
## Part 3: learning that compounds
|
|
||||||
|
## 12. Commands by reader
|
||||||
The agent-run loop over retro lessons is built: lessons take effect at once, are delivered at matching
|
|
||||||
moments, are measured per lesson, climb a strength ladder, and are consolidated by `sisi cycle`
|
`sisi help` lists every command and `sisi help COMMAND` explains one in full. Commands group
|
||||||
([learning.md](learning.md)). The heavier machinery designed below — background runs, replay experiments on a
|
by who uses them. For the owner: `sisi install`, `sisi uninstall`, `sisi doctor`,
|
||||||
task set before shipping, the taste judge — is not built; the built loop ships to the personal overlay first
|
`sisi update`, `sisi status`, `sisi rollback`, `sisi approve`, `sisi oracle`, `sisi export`
|
||||||
and judges by measured deliveries, with exact revert and withdrawal as the safety net.
|
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`,
|
||||||
**Signals, strongest first.** The loop learns from outcomes that do not depend on a model's opinion:
|
`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:
|
||||||
1. Check results recorded by `sisi verify`.
|
`sisi release`, `sisi promote`, `sisi cycle`, `sisi version` and `sisi help`.
|
||||||
2. Survival of work in git: was an agent's change reverted or rewritten within 14 days.
|
|
||||||
3. Delegation outcomes in a ledger.
|
## 13. Evaluation
|
||||||
4. The human's corrections and the agent's questions, read from transcripts by a classifier. Useful for finding
|
|
||||||
causes, weakest as proof.
|
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
|
||||||
**Trigger.** There is no scheduler and no background run. Whether consolidation is due is a counter check made
|
the outcome. A comparison is a sample of past work, not a proof about future work. See
|
||||||
during normal use: the session-start hook (`sisi tick`), the end-of-turn gate on an otherwise-clean stop, and
|
`docs/evaluation.md`.
|
||||||
the output of `sisi retro`, `sisi verify` and `sisi done for` — so tools without hooks are covered by commands
|
|
||||||
agents run anyway. A session is told at most once until 20 further checks pass or the counter grows. Two
|
|
||||||
sessions consolidating at once are kept apart by the personal-data lock and a base version in the cycle file:
|
|
||||||
the second apply is refused and re-reads a fresh brief. (The earlier design of tick starting detached
|
|
||||||
background runs on a budget was dropped for this simpler trigger.)
|
|
||||||
|
|
||||||
**What the loop would produce.**
|
|
||||||
|
|
||||||
- **Rules.** One change at a time, each with its reason and evidence. The always-loaded core stays under 120
|
|
||||||
lines; the rest loads on demand.
|
|
||||||
- **The oracle profile.** What the human wants, so a thing is asked once ever.
|
|
||||||
- **A taste judge.** Every time the human judges an outcome ("this is worse"), the before, the after and the
|
|
||||||
verdict are saved. A judge is tuned on these and its agreement with the human on held-back verdicts is
|
|
||||||
measured. It may stand in for the human on rung 5 only for kinds of work where agreement is above 85%. This is
|
|
||||||
how taste becomes checkable.
|
|
||||||
- **The verifier library**, described in part 1.
|
|
||||||
- **Playbooks.** Runs that closed cleanly are mined too. The decomposition and checks that worked for a kind of
|
|
||||||
product are saved for the next one.
|
|
||||||
- **Brief templates**, from what the ledger shows fixed rejected work.
|
|
||||||
|
|
||||||
**Testing a change.** (Not built; the built loop takes the opposite order by decision — a change lands in the
|
|
||||||
personal overlay at once and is judged by measured deliveries, because waiting for replay evidence left every
|
|
||||||
lesson inert. What follows is the replay design that may still be added.) Splitting live sessions between old
|
|
||||||
and new rules proves about one change every three or four days, which is too slow. The main test is a task set
|
|
||||||
built from the user's own work, re-run in the background:
|
|
||||||
|
|
||||||
- **Human tasks.** A project as it was when a session began, the request the human typed, and what they ended up
|
|
||||||
accepting. In a census of one user's history, only a fraction of sessions were usable as tasks and a smaller
|
|
||||||
fraction had ground truth that could be fully trusted. From the day sisi is installed, every session is
|
|
||||||
recorded with its exact starting commit, so the set grows with use.
|
|
||||||
- **Brief tasks.** Records of delegated work, each an instruction, the work done, and whether it was accepted.
|
|
||||||
These test how instructions are written and which model suits which job.
|
|
||||||
|
|
||||||
A candidate change is run against a sample of tasks next to the current version, in separate copies of the
|
|
||||||
project. It is scored on: the accepted version's tests passing, closeness to what the human accepted, questions
|
|
||||||
asked, and whether its checks would have caught the failure that really happened. It ships only if it passes
|
|
||||||
every check and scores higher on tasks it was not written from; a change that is faster but fails a check is
|
|
||||||
rejected, however quick. Live sessions then confirm or reverse it, and a change that keeps the checks passing
|
|
||||||
but makes median time to delivery slower than before is flagged for reversal. The spend is capped by a budget
|
|
||||||
that favours flat-rate plans first, then the cheaper models.
|
|
||||||
|
|
||||||
Other things the loop would improve, besides rules: recipes are tightened whenever a bug gets past a passing
|
|
||||||
set of checks; techniques are ranked by how often they catch real failures; checks that never fail are flagged
|
|
||||||
(`sisi checks` does this); new models are scored on the task set before routing changes.
|
|
||||||
|
|
||||||
**Owning the instruction surface.** Every source of instructions each tool loads
|
|
||||||
(instruction files, plugins, skills) and reports where they contradict the rulebook. Contradictions the loop
|
|
||||||
cannot remove itself would be put in the oracle queue.
|
|
||||||
|
|
||||||
## One shared store
|
|
||||||
|
|
||||||
One rulebook, one oracle profile, one set of contracts and results, one verifier library, one scoreboard. Tools
|
|
||||||
are connected by reference (an import line or a symlink), never by copy, so a change is live everywhere at the
|
|
||||||
next session. Every write to personal data is a git commit. Private session text and results live in scratch
|
|
||||||
(`~/.local/state/sisi/`) and are not committed. The layout as built is in `docs/personal-data.md`.
|
|
||||||
|
|
||||||
### Product and personal data are separate
|
|
||||||
|
|
||||||
sisi is two things on disk, and an update to one must never cost the other.
|
|
||||||
|
|
||||||
- **The product**: what a person clones. Code, the base rulebook, the base library of techniques and recipes,
|
|
||||||
defaults. sisi never writes into it at run time. `sisi update` replaces it.
|
|
||||||
- **Personal data**: everything sisi has learned for this person. It lives in one folder outside the clone
|
|
||||||
(`~/.local/share/sisi/`), with its own local git history so any change can be undone, and it is never touched
|
|
||||||
by an update. It holds the profile of what the person wants, the lessons, learned changes to the rulebook,
|
|
||||||
field notes, added or replaced techniques and recipes, the task set, results, settings and trusted projects.
|
|
||||||
- **Scratch**: things that can be rebuilt (the transcript index, locks, logs) stay in `~/.local/state/sisi/`.
|
|
||||||
|
|
||||||
Learned changes are stored as an overlay, not as edits to the product. Every base rule, technique and recipe
|
|
||||||
has a stable id. The overlay can add an item, replace one by id, or switch one off. What agents load is the
|
|
||||||
result of applying the overlay to the base, generated into the personal folder; the tools point at that
|
|
||||||
generated file.
|
|
||||||
|
|
||||||
On update the overlay is applied again to the new base. If the product changed an item the person's overlay
|
|
||||||
replaced, the person's version stays and the item is queued for re-testing against the new base version.
|
|
||||||
Personal data carries a format version, and `sisi update` migrates it after taking a backup.
|
|
||||||
|
|
||||||
One folder means one thing to back up or copy to another machine (`sisi export`, `sisi import`). Results and
|
|
||||||
session records stay in scratch and are included in the export. Nothing personal is ever placed in the
|
|
||||||
product, so the product can be published.
|
|
||||||
|
|
||||||
Any agent in any tool reads through the files or the CLI and writes through the CLI:
|
|
||||||
|
|
||||||
- `sisi learn`: record something the human said, in their words. It takes effect at once: user-tier
|
|
||||||
statements are the owner's standing principles (`sisi oracle`), core statements are queued for the
|
|
||||||
product, project statements are handed over to their project. Tiers follow the owner's two questions:
|
|
||||||
does it apply to all projects where sisi may be used, and would it help every user who installs
|
|
||||||
sisi? Both yes is a product change (`core`, in force at once through the overlay, written into the
|
|
||||||
source tree by `sisi promote` from the clone once folded, the personal copy dropped when
|
|
||||||
the product contains it; on an ordinary install `sisi promote --export` writes a contribution file
|
|
||||||
and nothing is ever sent automatically). The tool's own name never makes an item project-bound: how
|
|
||||||
sisi itself should behave is core, wherever it was recorded.
|
|
||||||
|
|
||||||
Models used by the loop run with no tools and return text. sisi's own code checks and writes that text, and
|
|
||||||
writes only inside the personal data folder (as overlay changes; see `docs/personal-data.md`), never into the
|
|
||||||
product. Text inside transcripts that the human did not type is data, never instruction.
|
|
||||||
|
|
||||||
## Scoreboard
|
|
||||||
|
|
||||||
`sisi scoreboard` shows weekly and per-repository trends computed from harvested sessions; `sisi status` shows
|
|
||||||
verification statistics. The design adds, per tool: verified work per human message; share of claims by rung;
|
|
||||||
blocking questions and human minutes per piece of work; share of agent changes surviving 14 days; taste-judge
|
|
||||||
agreement. The last two are not built.
|
|
||||||
|
|
||||||
## What is built
|
|
||||||
|
|
||||||
Built and covered by tests:
|
|
||||||
|
|
||||||
- The CLI and the shared store; contracts (`sisi contract`), `sisi verify` with fast and deep tiers and trust
|
|
||||||
for contracts that run commands.
|
|
||||||
- The end-of-turn gate (`sisi gate`) and session-start hook (`sisi tick`), wired into Claude Code with a
|
|
||||||
blocking hook; wiring (`sisi install`, `uninstall`, `doctor`) also points Codex and OpenCode at the rulebook,
|
|
||||||
where nothing blocks.
|
|
||||||
- The rulebook (`canon/core.md`), the risk table, the verifier library and the recipes.
|
|
||||||
- Retrospectives and lessons (`sisi retro`, `sisi lessons`), `sisi learn` live at once, time to delivery
|
|
||||||
(`sisi status`).
|
|
||||||
- Choosing the approach as a checked step: the contract design section, `sisi design`, the gate's
|
|
||||||
design send-back on large changes, and request-time delivery of the standing principles for design
|
|
||||||
or build requests. The rulebook's first rule states it and `sisi rule` reports its enforcement.
|
|
||||||
- Patterns: each retro names the general failure of thinking behind the incident; patterns are
|
|
||||||
first-class, merged in rounds, and promoted into the rulebook as strategic behaviours past a
|
|
||||||
threshold; the digest and `sisi improve` show them first. Three tiers (`core`, `user`, `project`)
|
|
||||||
replace the two-way scope, with older universal items tiered by the next round, and `sisi promote`
|
|
||||||
listing, writing (from the clone) or exporting core items.
|
|
||||||
- The lesson loop: immediate effects in the overlay (field notes, draft recipes, learned notes, `sisi backlog`),
|
|
||||||
moment-of-use delivery with recorded showings, per-lesson measurement, the strength ladder with enforced
|
|
||||||
checks, `sisi cycle` (due counter, brief, validated apply under lock and base version, exact revert, status
|
|
||||||
with worse-cycle flagging) and `sisi improve`.
|
|
||||||
- Personal data, the overlay, update, export and import, releases and rollback, promotion of a personal item
|
|
||||||
into the product.
|
|
||||||
- The data layer for learning: harvest of Claude Code transcripts, task set, ground truth, escape candidates,
|
|
||||||
check statistics, scoreboard.
|
|
||||||
- The worker layer: discovery of the installed agent tools and their models (`sisi workers`), the delegation
|
|
||||||
ledger in the shared store with a one-time lossless import of the earlier hand-kept ledger, unavailability
|
|
||||||
kept apart from judged quality, choice by measured results (`sisi route`), and unattended runs with
|
|
||||||
judgement (`sisi delegate`). The session's model is kept from hook payloads, strength comes from the record
|
|
||||||
plus a stored prior with source and date (no ranking shipped in code), and session start says whether the
|
|
||||||
session should plan and delegate or work itself. Stored price and strength tables are ready for a later
|
|
||||||
research refresh; that refresh, and any driver for a host with its own delegation interface, are not built.
|
|
||||||
|
|
||||||
Designed, not built:
|
|
||||||
|
|
||||||
- The conductor (`sisi build`) and the oracle queue (`sisi inbox`).
|
|
||||||
- Replay experiments on the task set before a learned change ships, brief templates, playbooks. (Shipping and
|
|
||||||
removal of learned changes exist in the simpler ship-first-measure-after form described in Part 3.)
|
|
||||||
- The taste judge and rung 5 judging by a model.
|
|
||||||
- A blocked turn proven end to end in each tool. Gates are built for the tools whose hooks allow one
|
|
||||||
(see [harnesses.md](harnesses.md)); most are tested against the documented hook format only.
|
|
||||||
- Harvest sources other than Claude Code.
|
|
||||||
|
|
||||||
## Build order
|
|
||||||
|
|
||||||
1. Store, CLI, wiring into each tool, contract format, `sisi verify`, the end-of-turn gate, the first
|
|
||||||
verifier-library entries, rulebook version 0. Built.
|
|
||||||
2. Signals and scoreboard: transcript adapters, git survival, and a delegation ledger. Partly built (Claude Code
|
|
||||||
transcripts, task set, scoreboard; no git survival signal).
|
|
||||||
3. The conductor and the oracle queue. Not built.
|
|
||||||
4. The loop: coach, replay filter, experiments, shipping and removal. Partly built (the lesson loop ships,
|
|
||||||
measures and removes; the coach as a separate model run, the replay filter and experiments are not built).
|
|
||||||
5. The taste judge and playbooks. Not built.
|
|
||||||
|
|
||||||
sisi's own checks: wiring is idempotent and touches no other byte (property tests); the gate cannot be passed
|
|
||||||
with a failing or unrun check (property test over generated contracts); a rulebook change is visible to every
|
|
||||||
tool with no further command; `tick` returns quickly; no command writes inside the product at run time; the
|
|
||||||
learning loop, when built, cannot write outside the personal data folder; a conductor run killed at any step
|
|
||||||
resumes without redoing closed nodes (to be model-checked, then tested).
|
|
||||||
|
|
||||||
## Decisions
|
|
||||||
|
|
||||||
1. Delegation tooling is folded into sisi: discovery, the ledger, the choice rule and unattended runs are
|
|
||||||
built (see [workers.md](workers.md)); the conductor that frames and splits whole products is not.
|
|
||||||
2. The end-of-turn gate is on by default. Each check has a time limit, and after three send-backs in a row the
|
|
||||||
agent is let through with the result marked unverified. One setting turns the gate off.
|
|
||||||
3. Session text may be read by any provider the user already uses as a worker, never by a model whose id marks it
|
|
||||||
as training on prompts. This is a user setting, not something sisi decides for them.
|
|
||||||
4. Background spend has a default budget (a number of cheap calls and test runs a day). Not built, since no
|
|
||||||
background runs exist yet.
|
|
||||||
|
|
||||||
## Known limits
|
|
||||||
|
|
||||||
- Whether an agent understood cannot be proved. Survival in git and check results are evidence, with delay.
|
|
||||||
- A contract can be wrong. Passing checks prove the checks, so the product contract gets the one oracle round.
|
|
||||||
- Experiments at this volume detect large effects only.
|
|
||||||
- The taste judge is worthless until the human has given enough verdicts, and it is trusted per kind of work,
|
|
||||||
not globally.
|
|
||||||
- Outside Claude Code and Copilot CLI, a blocked turn has not been run end to end; Muse has no confirmed
|
|
||||||
instruction path or end-of-turn hook, and OpenCode's plugin events are unproven.
|
|
||||||
- The end-of-turn gate attributes edits per session. Edit-tool calls are read from the session's own
|
|
||||||
transcript (incrementally, from a per-session offset), including the transcripts of subagents it
|
|
||||||
started natively. Shell commands are not judged from their text where the tool has before/after tool
|
|
||||||
hooks (Claude Code, Codex, Gemini, Copilot and Cursor have them wired): `sisi watch` takes a stat-only
|
|
||||||
tree snapshot (file sizes and modification times, `.gitignore` honoured, `.git` never included) before
|
|
||||||
and after the command and attributes exactly the paths that changed to that session, and the session
|
|
||||||
answers for a failing check only when a path changed since the last passing state is attributed to
|
|
||||||
it. That measurement has honest limits: another agent changing the tree inside this session's command
|
|
||||||
window is attributed to this session (it errs strict, the safe side); a change that keeps a file's
|
|
||||||
size and mtime, a write to a git-ignored file, and a write between the last complete transcript line
|
|
||||||
and a crash are invisible; `git commit` changes only `.git` and so is never an edit; sisi's own
|
|
||||||
commands write only personal data and state (except `sisi contract init/waive/trust`) and never count,
|
|
||||||
so `sisi retro` cannot create the need for another retro. Where a tool has no before/after tool events
|
|
||||||
(Qwen, Pi, OpenCode), shell commands are still judged by the older command-text classifier, which
|
|
||||||
over-attributes interpreters and test runners. A missing or unreadable transcript, a corrupt line, an
|
|
||||||
unparseable shell command, a shell command whose after-record never arrives, and an unread transcript
|
|
||||||
tail over 64 MB are all treated as "this session edited" — strict — never as "someone else did it".
|
|
||||||
Attribution decides who is sent back and who owes a retrospective; it never turns a failing check into
|
|
||||||
a pass — a stop allowed over another session's failing tree is recorded unverified, once per tree state.
|
|
||||||
- This is several months of building. Each phase is useful on its own.
|
|
||||||
+1
-1
@@ -21,7 +21,7 @@ whether the source folder is ahead of it.
|
|||||||
|
|
||||||
## Make a release
|
## Make a release
|
||||||
|
|
||||||
Run from the clone:
|
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 # runs the checks; refuses if they fail
|
||||||
bin/sisi release --deep # also needs the slow checks to pass
|
bin/sisi release --deep # also needs the slow checks to pass
|
||||||
|
|||||||
+1
-1
@@ -101,7 +101,7 @@ one line of reason [13.3]. The judgement is stored with the result as `judged_by
|
|||||||
judge from the same maker is refused: a worker's own assessment is never recorded as
|
judge from the same maker is refused: a worker's own assessment is never recorded as
|
||||||
independent evidence.
|
independent evidence.
|
||||||
|
|
||||||
## Honest limits
|
## What this does not do
|
||||||
|
|
||||||
- A replay is a **sample**, not the original work: the worker, its context and the state
|
- 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
|
of the world have all moved on. Outcomes are comparable between policies run the same
|
||||||
|
|||||||
+1
-1
@@ -27,7 +27,7 @@ uninstalling makes hooks exit silently instead of erroring on every turn. The pe
|
|||||||
between each tool's hook JSON and the gate lives in `sisi/hookio.py`; the adapters live in
|
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
|
`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
|
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.
|
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).
|
||||||
|
|
||||||
## Claude Code
|
## Claude Code
|
||||||
|
|
||||||
|
|||||||
+9
-5
@@ -81,8 +81,7 @@ store: an enforced contract requirement, an enforced command check (both in
|
|||||||
adjustment (`overlay/risk-adjustments.json`), a routing adjustment
|
adjustment (`overlay/risk-adjustments.json`), a routing adjustment
|
||||||
(`overlay/routing-adjustments.json`), or a benchmark case
|
(`overlay/routing-adjustments.json`), or a benchmark case
|
||||||
(`overlay/benchmarks/<name>.json`). `tool` learnings — changes to sisi's own code — are
|
(`overlay/benchmarks/<name>.json`). `tool` learnings — changes to sisi's own code — are
|
||||||
refused by the cycle; they go to the backlog shown in the learning report and to the
|
refused by the cycle; they go to the tool list shown in the learning report and to the contribution export.
|
||||||
contribution export.
|
|
||||||
|
|
||||||
`sisi cycle apply FILE` treats the file as untrusted input and plans everything before writing anything —
|
`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
|
the budget and every other check run first, and a refusal applies nothing. If applying then fails part-way
|
||||||
@@ -144,7 +143,7 @@ never delivered again.
|
|||||||
|
|
||||||
## Migration
|
## Migration
|
||||||
|
|
||||||
`sisi update` (and `sisi migrate`, and `sisi learn`/`sisi oracle`) run the learning migration whenever the
|
`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
|
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
|
(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
|
not stop it). Old lesson rows become learning records with honest statuses (a lesson folded into prose
|
||||||
@@ -167,8 +166,7 @@ learnings in scope that target that entry.
|
|||||||
## Seams for other parts of sisi
|
## Seams for other parts of sisi
|
||||||
|
|
||||||
- `learning.findings_for_unit(project, unit_id)` — the findings a unit record stores.
|
- `learning.findings_for_unit(project, unit_id)` — the findings a unit record stores.
|
||||||
- `learning.learning_report()` — the text `sisi status --learning` prints. It replaces
|
- `learning.learning_report()` — the text `sisi status --learning` prints, the one learning report.
|
||||||
`sisi improve`, `sisi backlog` and `sisi lessons digest`, which are deleted.
|
|
||||||
- `cycle.enforced_results(contract, project, ...)` — what `sisi verify` runs, filtered by project.
|
- `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.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.routing_adjustments(project)` — the learned routing adjustments that apply in a project.
|
||||||
@@ -176,3 +174,9 @@ learnings in scope that target that entry.
|
|||||||
- `retro.satisfied(repo, since, fp)` and `retro.TEMPLATE` — what the gate asks.
|
- `retro.satisfied(repo, since, fp)` and `retro.TEMPLATE` — what the gate asks.
|
||||||
- `learning.delivery_text(project, query, targets=())` — what the prompt hook may add.
|
- `learning.delivery_text(project, query, targets=())` — what the prompt hook may add.
|
||||||
- `evaluate.validate_command(repo, before, after, cmd)` — the replay.
|
- `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.
|
||||||
@@ -23,11 +23,12 @@ Under `SISI_HOME` (tests) the personal folder is `$SISI_HOME/.local/share/sisi`
|
|||||||
cycles/ one JSON record per learning cycle, including the bytes revert restores
|
cycles/ one JSON record per learning cycle, including the bytes revert restores
|
||||||
config.json settings (over config.default.json)
|
config.json settings (over config.default.json)
|
||||||
trusted.json projects whose contracts may run commands
|
trusted.json projects whose contracts may run commands
|
||||||
lessons.jsonl sorted dump of the lessons database, committed whenever lessons change
|
learnings.jsonl one JSON object per learning, committed whenever learnings change
|
||||||
learn.jsonl, notes.jsonl, proposals.jsonl what the person stated (`sisi learn`, live at once;
|
findings.jsonl retro findings, one per line
|
||||||
an older learn-quarantine.jsonl is migrated into learn.jsonl on first read)
|
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)
|
retest.jsonl replaced items whose base changed in an update (id, old base hash, new base hash)
|
||||||
retro.db lessons database (sqlite; not in git; lessons.jsonl is its committed form)
|
|
||||||
generated/core.md the effective rulebook (not in git; rebuilt by install and update)
|
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)
|
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)
|
backups/ copies taken before a migration or an update (not in git)
|
||||||
@@ -57,6 +58,6 @@ person's version and is queued in `retest.jsonl` for the learning loop.
|
|||||||
|
|
||||||
## Moving data
|
## Moving data
|
||||||
|
|
||||||
`sisi update` (also run by install) moves an older layout in, after a timestamped copy under
|
`sisi update` on an installed copy runs the migration step: it moves an older layout in (the old
|
||||||
`backups/`. `sisi export [PATH]` / `sisi import PATH` carry personal data, results and session records as one
|
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.
|
tar.gz.
|
||||||
+14
-14
@@ -1,7 +1,7 @@
|
|||||||
# Plan: bringing sisi into conformance with SPEC.md
|
# Plan: bringing sisi into conformance with SPEC.md
|
||||||
|
|
||||||
The work list for the reconciliation. `docs/reconciliation/critique.md` says what is wrong,
|
The work list for the reconciliation. `docs/reconciliation/critique.md` says what is wrong,
|
||||||
`docs/target.md` says what replaces it, `docs/spec/conformance.json` holds the status of every
|
`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
|
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`.
|
asked for. Section numbers in brackets are sections of `SPEC.md`.
|
||||||
|
|
||||||
@@ -18,19 +18,19 @@ built it grades the table against the specification text. The measurements in
|
|||||||
Stages are an order, not a ceiling. Each one lands on the `spec-reconciliation` branch only
|
Stages are an order, not a ceiling. Each one lands on the `spec-reconciliation` branch only
|
||||||
with the whole test suite passing.
|
with the whole test suite passing.
|
||||||
|
|
||||||
| # | Stage | Serves | What it delivers |
|
| # | Stage | Status | Serves | What it delivers |
|
||||||
|---|---|---|---|
|
|---|---|---|---|
|
||||||
| 0 | Standard and baseline | [19] steps 1-4, 6 | The specification saved and protected; its requirements numbered with a completeness test; four audits; a measured baseline. |
|
| 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 | [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. |
|
| 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 | [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. |
|
| 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 | [7] | One ledger, worker facts, `route`, the delegation contract, the strategy playbook; nothing in the product names a model. |
|
| 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 | [19] step 2, [20] | Status of every requirement before the rebuild, then kept current by every stage. |
|
| 4 | Conformance table | done | [19] step 2, [20] | Status of every requirement before the rebuild, then kept current by every stage. |
|
||||||
| 5 | Proportional gate | [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. |
|
| 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 | [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. |
|
| 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 | [3, 4, 17] | `canon/core.md` rewritten as the operating policy; the documents rewritten around what now exists. |
|
| 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 | [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. |
|
| 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 | [13.3] | Conformance graded requirement by requirement by a different model family; the exceptions list. |
|
| 9 | Grading | not done | [13.3] | Conformance graded requirement by requirement by a different model family; the exceptions list. |
|
||||||
| 10 | Cutover | [14, 16] | The owner's installation switched, his data migrated, the old orchestrator removed. |
|
| 10 | Cutover | not done | [14, 16] | The owner's installation switched, his data migrated, the old orchestrator removed. |
|
||||||
|
|
||||||
## Cutover checklist
|
## Cutover checklist
|
||||||
|
|
||||||
@@ -61,4 +61,4 @@ answered, in `docs/reconciliation/owner-statements.md`.
|
|||||||
|
|
||||||
## Exceptions
|
## Exceptions
|
||||||
|
|
||||||
Requirements that are not met when the work is reported, in plain words. Filled in at stage 9.
|
Requirements that are not met when the work is reported, in plain words. To be filled by the lead.
|
||||||
+12
-5
@@ -24,12 +24,13 @@ never stops the close.
|
|||||||
|
|
||||||
Delivery status is one of `delivered`, `delivered-with-deferred`, `deviation` (a check was
|
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
|
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, or
|
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
|
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.
|
plainly `delivered`. `sisi contract waive` records a deviation; it turns nothing green.
|
||||||
|
|
||||||
A pause records what the unit waits for. While nothing in the tree changes the gate asks
|
A pause records what the unit waits for. While nothing in the tree changes the gate asks
|
||||||
nothing; a change ends the wait. Waiting time is telemetry.
|
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
|
## The end-of-turn gate
|
||||||
|
|
||||||
@@ -61,8 +62,7 @@ settled stop.
|
|||||||
One send-back lists everything missing, each with the command or field that supplies it, within 25 lines.
|
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
|
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`
|
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
|
(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`
|
||||||
ends when the tree changes; `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
|
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
|
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
|
agent is told to say so in its report. A subagent's stop never blocks and never asks for a retro; what it
|
||||||
@@ -97,7 +97,8 @@ category and model, question dialogs, human messages and inferred corrections co
|
|||||||
host's transcript when it has one with usage; cost is estimated only when every model used has a
|
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.
|
recorded price. Changed files and lines come from git; delegations from the ledger.
|
||||||
|
|
||||||
The scorecard has the eight dimensions of SPEC 13.1. `sisi status` prints recent units with
|
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
|
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.
|
median and 95th percentile and "too few" under five units. It prints no single score.
|
||||||
`sisi status --learning` prints the learning report.
|
`sisi status --learning` prints the learning report.
|
||||||
@@ -108,3 +109,9 @@ Session-state files older than `scratch.session_max_age_days` (30) are removed o
|
|||||||
session start and every `scratch.prune_every`th (20) after it, with no scheduler. A run is
|
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
|
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.
|
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.
|
||||||
-331
@@ -1,331 +0,0 @@
|
|||||||
# Target design
|
|
||||||
|
|
||||||
How sisi meets `SPEC.md`. This is the build reference for the reconciliation:
|
|
||||||
`docs/reconciliation/critique.md` says what was wrong, this says what replaces it.
|
|
||||||
Section numbers in brackets are sections of `SPEC.md`. Where this document and the
|
|
||||||
specification disagree, the specification wins.
|
|
||||||
|
|
||||||
## 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 and the mechanisms promoted from them, the delegation ledger, worker facts, one summary line per closed unit | 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. |
|
|
||||||
|
|
||||||
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`. A learning of mechanism type `policy` may adjust the user's table.
|
|
||||||
The contract's `risk.profile` 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. Wait time is telemetry [6.1].
|
|
||||||
- `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 unit that closes with deferred or
|
|
||||||
human-pending checks is `delivered-with-deferred` and the record lists them.
|
|
||||||
- **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.
|
|
||||||
- **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 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.
|
|
||||||
|
|
||||||
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. Subagents are 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.
|
|
||||||
|
|
||||||
**Promotion** is the cycle, due by a counter. 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, or rule text. Changes to
|
|
||||||
sisi's own code are `tool` learnings: they go to the backlog and the contribution export.
|
|
||||||
`sisi cycle apply`:
|
|
||||||
|
|
||||||
- **validates before promoting**. A command check is replayed on the commits of the unit it
|
|
||||||
came from where they are known (must fail before the fix, pass after). What cannot be
|
|
||||||
replayed is promoted as `unvalidated` and 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, widening a scope to everything, or adding a command that runs in every project is
|
|
||||||
consequential: it is stored as pending and takes effect only after the owner's decision
|
|
||||||
(`sisi approve ID --yes|--no`, asked through the host's question dialog).
|
|
||||||
- **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.
|
|
||||||
- `sisi route --kind K --difficulty N [--explain]`: the recommendation. Candidates are only
|
|
||||||
workers with a judged record, a known price or a benchmark prior. With a thin record it
|
|
||||||
ranks by price and prior instead of arbitrarily, 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.
|
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
| For | Commands |
|
|
||||||
|---|---|
|
|
||||||
| The user | `install`, `uninstall`, `doctor`, `update`, `status`, `rollback`, `approve`, `oracle`, `export`, `import` |
|
|
||||||
| The agent at work | `contract`, `unit`, `risk`, `verify`, `retro`, `learn`, `route`, `delegate`, `workers`, `verifiers`, `done`, `rule`, `handover`, `lessons` |
|
|
||||||
| Hooks | `tick`, `prompt`, `gate`, `watch` |
|
|
||||||
| Maintaining sisi | `release`, `promote`, `cycle`, `version`, `help` |
|
|
||||||
|
|
||||||
## 13. Retired
|
|
||||||
|
|
||||||
`note`, `propose`, `audit`, `design` and the six-part design section, `dev`, `improve`, `time`,
|
|
||||||
`scoreboard`, `backlog` and `lessons digest` as separate reports, `build-canon` and `canon cost`
|
|
||||||
as public commands, the line-count thresholds, the strength ladder driven by showings, the
|
|
||||||
lesson list at session start, the per-prompt handover notice, mandatory `--when`, `--pattern`
|
|
||||||
and `--aim` on a retro, `migrate` (folded into `update`), and the standalone `orch.py`.
|
|
||||||
@@ -61,8 +61,8 @@ Body headings, in this order, all required:
|
|||||||
`.sisi/contract.json`, with `id`, `claim`, `kind`, `rung`, `cmd`, `expect`
|
`.sisi/contract.json`, with `id`, `claim`, `kind`, `rung`, `cmd`, `expect`
|
||||||
(`exit`, optionally `stdout_contains`) and `timeout_s`. Whenever `timeout_s`
|
(`exit`, optionally `stdout_contains`) and `timeout_s`. Whenever `timeout_s`
|
||||||
is over 60, include `"tier": "deep"`: fast checks (the default) may not
|
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
|
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
|
||||||
`sisi verify --deep`, in the background, and never block a turn by being slow.
|
only a `release` change, never an ordinary turn by being slow.
|
||||||
Contract-level options: top-level `"parallel": true` makes `sisi verify` and
|
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
|
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
|
come in contract order), and `"serial": true` on a check makes it always run
|
||||||
|
|||||||
+7
-2
@@ -27,7 +27,7 @@ or learned from judged results. The strategy is [canon/orchestration.md](../cano
|
|||||||
needs no command-line tool, is usable unless marked down, and `sisi route` says to start it with
|
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
|
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.
|
store is committed there, one small commit per command.
|
||||||
- `sisi workers down WORKER --reason limit|auth|missing|error [--until DATE] [--note TEXT]` and
|
- `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 up WORKER` — availability. Without `--until`, the wait widens on repeat failures.
|
||||||
- `sisi workers import FILE` — merge another ledger file into the delegation ledger, idempotently,
|
- `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.
|
printing row counts before and after. The source file is only read.
|
||||||
@@ -76,9 +76,14 @@ allows it per tool (`workers.allow_bypass`).
|
|||||||
|
|
||||||
In the user store: `workers.json` (discovery cache), `delegations.jsonl` (the ledger),
|
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-availability.json`, `worker-prices.json` and `model-strength.json` (worker facts),
|
||||||
`worker-prefs.json` (avoid/prefer). When facts are missing or older than
|
`worker-prefs.json` (avoid/prefer) and `worker-notes.json` (standing notes). When facts are missing or older than
|
||||||
`workers.facts_max_age_days` (default 30), session start prints one line asking for a fast,
|
`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
|
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:
|
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`,
|
`refresh_after_s`, `timeout_s`, `allow_bypass`, `facts_max_age_days`, `digest_days`,
|
||||||
`host_cross_provider`.
|
`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.
|
||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
{"decision":"block","reason":...} on stdout, exit 0. Anything that goes wrong inside sisi allows
|
{"decision":"block","reason":...} on stdout, exit 0. Anything that goes wrong inside sisi allows
|
||||||
(fail open) and is logged to the state dir.
|
(fail open) and is logged to the state dir.
|
||||||
|
|
||||||
The flow is target.md section 7, and each stop answers these in order:
|
The flow is docs/design.md section 7, and each stop answers these in order:
|
||||||
|
|
||||||
1. Did THIS session change anything since its last settled stop? If not, the turn ends silently
|
1. Did THIS session change anything since its last settled stop? If not, the turn ends silently
|
||||||
(a paused unit with no new change, a closed unit, another session's edits: all silent).
|
(a paused unit with no new change, a closed unit, another session's edits: all silent).
|
||||||
|
|||||||
@@ -154,10 +154,8 @@ class NoStaleValues(unittest.TestCase):
|
|||||||
|
|
||||||
def test_docs_have_no_stale_values(self):
|
def test_docs_have_no_stale_values(self):
|
||||||
rels = ["CONTRIBUTING.md", "SECURITY.md"]
|
rels = ["CONTRIBUTING.md", "SECURITY.md"]
|
||||||
# docs/target.md is the reconciliation build reference: its start date and "as today"
|
|
||||||
# describe that project, not the product, so they do not go stale with the product.
|
|
||||||
rels += [os.path.join("docs", n) for n in sorted(os.listdir(os.path.join(REPO, "docs")))
|
rels += [os.path.join("docs", n) for n in sorted(os.listdir(os.path.join(REPO, "docs")))
|
||||||
if n.endswith(".md") and n != "target.md"]
|
if n.endswith(".md")]
|
||||||
findings = []
|
findings = []
|
||||||
for rel in rels:
|
for rel in rels:
|
||||||
findings += _stale_value_findings(_text(rel), rel, allow_version_evidence=True)
|
findings += _stale_value_findings(_text(rel), rel, allow_version_evidence=True)
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
"""The work-unit record (SPEC 10), telemetry and the scorecard (SPEC 6.1, 13), `sisi status`, and
|
"""The work-unit record (SPEC 10), telemetry and the scorecard (SPEC 6.1, 13), `sisi status`, and
|
||||||
scratch pruning (docs/target.md sections 2, 4, 6)."""
|
scratch pruning (docs/design.md sections 2, 4, 6)."""
|
||||||
import json, os, subprocess, time, unittest
|
import json, os, subprocess, time, unittest
|
||||||
from unittest import mock
|
from unittest import mock
|
||||||
from support import *
|
from support import *
|
||||||
|
|||||||
Reference in new issue
Block a user