Files
sisi/.sisi/contract.json
T

235 lines
9.9 KiB
JSON

{
"id": "spec-reconciliation",
"goal": "BRUTALLY critique it against the objective/principles/specification document below. THAT IS THE BIBLE OF WHAT WE WANT TO ACHIEVE (not necessarily exactly HOW) with sisi. Find ALL the flaws, the unnecessary complexities, the things that are just flat out wrong. Consider its use and its customers, what goes in sisi itself (things that work broadly across all projects, all users) versus what is learned and evolved for an individual user. Then convert that into a PLAN and IMPLEMENTATION to fix it. Anything short of perfection, based on that document below, is UNACCEPTABLE!! Please save this spec document VERBATIM in the project. It is our ONE TRUE NORTH STAR!!!",
"checks": [
{
"id": "spec-saved-verbatim",
"claim": "the owner's specification is in the project unchanged: the original .docx byte for byte and SPEC.md with the same words",
"kind": "general",
"rung": 2,
"cmd": "sha256sum -c docs/spec/SHA256SUMS",
"expect": {
"exit": 0
},
"timeout_s": 10,
"covers": "the specification being altered or replaced without the owner",
"mandatory": true
},
{
"id": "critique-and-plan-complete",
"claim": "the critique gives a verdict for every module and command at the base commit, and the plan names every reconciliation stage",
"kind": "general",
"rung": 3,
"cmd": "cd tests && python3 -m unittest test_reconciliation",
"expect": {
"exit": 0
},
"timeout_s": 10,
"covers": "a component left out of the inventory",
"mandatory": true
},
{
"id": "requirements-accounted-for",
"claim": "every numbered requirement of the specification has an entry in the conformance table",
"kind": "general",
"rung": 2,
"cmd": "cd tests && python3 -m unittest test_spec test_conformance",
"expect": {
"exit": 0
},
"timeout_s": 10,
"covers": "a requirement silently dropped from the table or the list",
"mandatory": true
},
{
"id": "product-is-universal",
"claim": "the product contains no owner name, model name, price or home path",
"kind": "general",
"rung": 3,
"cmd": "cd tests && python3 -m unittest test_product_universal",
"expect": {
"exit": 0
},
"timeout_s": 10,
"covers": "owner-specific or perishable material shipped to every user",
"mandatory": true
},
{
"id": "learning-gates-hold",
"claim": "the approval, scope, validation and delivery gates of the learning loop refuse the abuse cases an independent reviewer found",
"kind": "general",
"rung": 3,
"cmd": "cd tests && python3 -m unittest test_learning_loop",
"expect": {
"exit": 0
},
"timeout_s": 30,
"covers": "a learning cycle weakening a rule, widening its scope or injecting text without the owner",
"mandatory": true,
"independent": true,
"by": "abuse cases probed by a Claude Sonnet reviewer against a build by a different model family; each became a test"
}
],
"invariants": [
{
"id": "unit-tests",
"claim": "the whole test suite passes",
"cmd": "python3 tests/run_parallel.py",
"expect": {
"exit": 0
},
"timeout_s": 60,
"covers": "existing behaviour getting worse"
},
{
"id": "library-lint",
"claim": "every verifier and recipe lints clean, and recipes cite only existing verifier ids",
"cmd": "bin/sisi verifiers lint",
"expect": {
"exit": 0
},
"timeout_s": 10,
"covers": "existing behaviour getting worse"
},
{
"id": "launcher-help",
"claim": "the launcher still prints help",
"cmd": "bin/sisi help",
"expect": {
"exit": 0,
"stdout_contains": "sisi verify"
},
"timeout_s": 10,
"covers": "existing behaviour getting worse"
}
],
"assumptions": [
"Tests never touch the real home: SISI_HOME and SISI_STATE point to temp dirs.",
"The critique, plan and design section are added to this contract once the inventory of the existing system (SPEC 19, steps 1-4) is back; implementation checks are added with the plan.",
"Work happens on a branch with local commits as checkpoints; nothing is pushed without the owner asking.",
"Owner amendment 2026-11-23: the standalone orch.py is deprecated and orchestration becomes a core part of sisi, generic and strategic (objectives for discovering models, prices and benchmarks, measuring performance, dispatching dynamically; no named models), feeding the objective function on wall time, cost and efficiency.",
"Owner amendment 2026-11-23: gross change and re-architecture are acceptable; the only measure is implementing the specification plus the orchestration layer perfectly. Backward compatibility with the old design is not a goal.",
"Owner amendment 2026-11-23: at cutover the old orch.py and everything related to it (its folder, ledger, routing table and the orchestrator section of his Claude instructions) is removed completely, after its ledger is merged into the user store and a backup is taken. He will restart T3 Code and try the release in a new session in ~/Code/highroute, and wants to be told the moment it is ready."
],
"questions": [],
"parent": "owner request 2026-11-23: reconcile sisi with SPEC.md",
"scope": {
"in": [
"the critique against SPEC.md",
"the plan",
"the rebuild of sisi to meet the specification, including one generic orchestrator",
"the switch of the owner's installation and removal of the old orchestrator"
],
"out": [
"new host-tool adapters",
"evidence of improvement over time (SPEC 20.3): only the means to measure it are in scope"
]
},
"risk": {
"profile": "release",
"why": "this changes hooks that run in every session of every tool the owner uses, migrates his personal data, and replaces his installed copy",
"blast_radius": "every agent session on the owner's machine: session start, each prompt, each shell command and the end of each turn; his learned data; his Claude instructions and settings",
"rollback": "sisi rollback switches the installed copy back and the old code runs against the migrated data; the timestamped archive made by the cutover restores the data folder, CLAUDE.md, settings.json and the old orchestrator"
},
"approach": {
"chosen": "staged reconciliation in the order SPEC 19 gives, each stage built in its own checkout and merged only with the suite passing",
"why": "it keeps what the audits showed is working, removes what serves no requirement, and lets each stage be verified and reviewed on its own",
"alternatives": [
"rewrite from the specification on a clean slate: loses the safe installer and the hooks that work",
"patch the missing pieces on top: keeps every duplicate and every unenforced rule"
],
"reuses": [
"the contract, check runner and gate",
"the safe installer and release with rollback",
"the personal data repository",
"the transcript evidence layer"
]
},
"requirements": [
{
"id": "q1",
"kind": "explicit",
"text": "a brutal critique against the specification, naming every flaw and needless complexity",
"decision": "now",
"why": "asked for",
"check": "critique-and-plan-complete"
},
{
"id": "q2",
"kind": "explicit",
"text": "the specification saved verbatim in the project",
"decision": "now",
"why": "asked for",
"check": "spec-saved-verbatim"
},
{
"id": "q3",
"kind": "explicit",
"text": "a plan and an implementation that meet the specification, plus a generic, strategic orchestration layer replacing orch.py",
"decision": "now",
"why": "asked for",
"check": "unit-tests"
},
{
"id": "q4",
"kind": "explicit",
"text": "what is product (all projects, all users) is separated from what is learned for one user",
"decision": "now",
"why": "asked for",
"check": "product-is-universal"
},
{
"id": "q5",
"kind": "implied",
"text": "the owner's learned data, statements and delegation history survive the switch",
"decision": "now",
"why": "a rebuild that loses his data is not an improvement",
"check": null
},
{
"id": "q6",
"kind": "implied",
"text": "sessions already running keep working, or he is told to restart them",
"decision": "now",
"why": "his installed copy serves every open session",
"check": null
},
{
"id": "q7",
"kind": "contextual",
"text": "standard library only, no scheduler, nothing in the product naming a model, price or person",
"decision": "now",
"why": "his standing constraints",
"check": "product-is-universal"
},
{
"id": "q8",
"kind": "anticipated",
"text": "he will want to try it on another project before every stage is finished",
"decision": "now",
"why": "he asked; the release is ordered before the documents and the grading",
"check": null
},
{
"id": "q9",
"kind": "anticipated",
"text": "evidence that sisi improves over comparable work (SPEC 20.3)",
"decision": "architect",
"why": "it needs time; the unit record, scorecard and evaluation harness are what will show it",
"check": null
},
{
"id": "q10",
"kind": "experiential",
"text": "hooks stay quiet unless a session can act on what they say, and always-loaded text does not grow without reason",
"decision": "now",
"why": "his statements about context size and noise",
"check": null
}
],
"limitations": [
"Hooks have been run with Claude-Code-shaped input in temporary homes and a sandbox copy of the owner's setup, not yet inside a live session of the new release.",
"Token and cost telemetry is tested against hand-made transcripts only."
]
}