From 9b69d419507885342f604623211ddcc5807beb78 Mon Sep 17 00:00:00 2001 From: Stephen Waits Date: Mon, 23 Nov 2026 10:55:41 -0700 Subject: [PATCH 1/7] Retire note, propose, audit, dev mode, build-canon, canon cost and migrate commands --- sisi/__init__.py | 11 +++- sisi/audit.py | 119 ---------------------------------- sisi/cli.py | 52 +++------------ sisi/cycle.py | 8 +-- sisi/overlay.py | 8 +-- sisi/release.py | 64 +++++------------- sisi/store.py | 4 +- sisi/taskset.py | 13 ++-- sisi/wiring.py | 12 ++-- tests/test_learning.py | 14 ++-- tests/test_personal.py | 44 +++++++------ tests/test_public.py | 6 +- tests/test_release.py | 58 ++++++----------- tests/test_retro.py | 7 +- tests/test_tick_store.py | 38 ++++------- tests/test_tiers_amendment.py | 11 ++-- 16 files changed, 126 insertions(+), 343 deletions(-) delete mode 100644 sisi/audit.py diff --git a/sisi/__init__.py b/sisi/__init__.py index 31c1a7e..5045eab 100644 --- a/sisi/__init__.py +++ b/sisi/__init__.py @@ -1,2 +1,11 @@ """sisi: one rulebook and enforced definitions of done for every AI coding CLI.""" -__version__ = "0.1.0" +import os + +def _version(): + try: + with open(os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), "VERSION"), encoding="utf-8") as f: + return f.read().strip() + except OSError: + return "unknown" + +__version__ = _version() diff --git a/sisi/audit.py b/sisi/audit.py deleted file mode 100644 index 43f729e..0000000 --- a/sisi/audit.py +++ /dev/null @@ -1,119 +0,0 @@ -"""Inventory of standing instructions each tool loads. Counts lines; does not judge.""" -import glob, json, os, re - -from . import paths - - -def _lines(p): - try: - with open(p, "rb") as f: - return f.read().count(b"\n") + 1 - except OSError: - return None - - -def _imports(p, depth=0, seen=None): - """Files pulled in by `@path` lines (Claude Code import syntax).""" - seen = seen if seen is not None else set() - out = [] - try: - text = open(p, encoding="utf-8", errors="replace").read() - except OSError: - return out - for m in re.finditer(r"^@(\S+)\s*$", text, re.M): - q = os.path.expanduser(m.group(1)) - if not os.path.isabs(q): - q = os.path.join(os.path.dirname(p), q) - if q not in seen and os.path.isfile(q): - seen.add(q) - out.append(("import of %s" % os.path.basename(p), q)) - if depth < 4: - out += _imports(q, depth + 1, seen) - return out - - -def _skills(d, label): - return [(label, f) for f in sorted(glob.glob(os.path.join(d, "*", "SKILL.md")))] - - -def _dirmd(d, label): - return [(label, f) for f in sorted(glob.glob(os.path.join(d, "**", "*.md"), recursive=True))] - - -def collect(): - h = paths.home() - j = lambda *a: os.path.join(h, *a) - inv = {} - cl = [] - for f in (j(".claude", "CLAUDE.md"),): - if os.path.isfile(f): - cl.append(("global instructions", f)) - cl += _imports(f) - cl += _dirmd(j(".claude", "rules"), "rules") - cl += _skills(j(".claude", "skills"), "skill") - cl += _skills(j(".agents", "skills"), "skill (shared)") - try: - with open(j(".claude", "plugins", "installed_plugins.json"), encoding="utf-8") as f: - plugins = json.load(f).get("plugins", {}) - except (OSError, ValueError, AttributeError): - plugins = {} - for name, entries in sorted(plugins.items()): - for e in entries if isinstance(entries, list) else []: - ip = e.get("installPath") if isinstance(e, dict) else None - if ip: - pl = "plugin " + name - cl += _skills(ip, pl + " skill") + _dirmd(os.path.join(ip, "commands"), pl + " command") \ - + _dirmd(os.path.join(ip, "agents"), pl + " agent") - inv["claude-code"] = cl - cx = [] - for n in ("AGENTS.override.md", "AGENTS.md"): - f = j(".codex", n) - if os.path.isfile(f): - cx.append(("global instructions", f)) - cx += _skills(j(".codex", "skills"), "skill") + _skills(j(".agents", "skills"), "skill (shared)") - inv["codex"] = cx - oc = [] - f = j(".config", "opencode", "AGENTS.md") - if os.path.isfile(f): - oc.append(("global instructions", f)) - else: - f2 = j(".claude", "CLAUDE.md") - if os.path.isfile(f2): - oc.append(("global instructions (fallback to Claude's file)", f2)) - for n in ("opencode.json", "opencode.jsonc"): - cf = j(".config", "opencode", n) - try: - for ins in json.load(open(cf, encoding="utf-8")).get("instructions", []): - q = os.path.expanduser(ins) - if os.path.isfile(q): - oc.append(("config instructions", q)) - except (OSError, ValueError, AttributeError): - pass - oc += _dirmd(j(".config", "opencode", "agents"), "agent") + _dirmd(j(".config", "opencode", "commands"), "command") - oc += _skills(j(".agents", "skills"), "skill (shared)") - inv["opencode"] = oc - mu = [] - for f in (j(".config", "muse", "AGENTS.md"),): - if os.path.isfile(f): - mu.append(("global instructions", f)) - mu += _skills(j(".agents", "skills"), "skill (shared)") - inv["muse"] = mu - return inv - - -def main(args=()): - inv = collect() - grand = 0 - for tool, items in inv.items(): - print("%s" % tool) - tot = 0 - for label, f in items: - n = _lines(f) or 0 - tot += n - print(" %6d %-34s %s" % (n, label[:34], f)) - if not items: - print(" (none found)") - print(" %6d total\n" % tot) - grand += tot - print("all tools: %d lines (shared files counted once per tool)" % grand) - return 0 diff --git a/sisi/cli.py b/sisi/cli.py index a4e5e7a..5237ce6 100644 --- a/sisi/cli.py +++ b/sisi/cli.py @@ -21,7 +21,6 @@ A shared rulebook and enforced definitions of done for every AI coding CLI. wire sisi into the tools (by reference), undo, inspect; --dry-run only prints what would change sisi release [--deep] run the source's checks, then make the stable copy the tools run (see docs/developing.md) sisi rollback switch the stable copy back to the previous release - sisi dev on [PATH] | off | status developer mode: where the source folder is sisi promote [ID|lesson:N] [--apply] | --export [PATH] no ID: list core-tier items not yet in the product; an ID scrubs a personal overlay item into the source folder and @@ -29,14 +28,10 @@ A shared rulebook and enforced definitions of done for every AI coding CLI. run unless --apply); lesson:N promotes a core lesson on a developer install; --export writes a contribution file (universal text only; nothing is sent anywhere) - sisi migrate move an older installation's personal data into the personal folder (safe to repeat) sisi update fast-forward the product clone, then back up, migrate and rebuild personal data sisi export [PATH] | import PATH one tar.gz of personal data, results and session records; restore it - sisi build-canon regenerate the effective rulebook (base rules + your overlay) - sisi canon cost size of what is always loaded: rulebook lines and characters against both budgets, lessons block maximum sisi overlay list|diff|add-rule|replace-rule|disable-rule|enable-rule|add-verifier|...|revert COMMIT learned changes to rules, verifiers and recipes; each one a commit in your personal repo - sisi audit inventory of standing instructions per tool sisi retro --scope core|user|project --aim A --moment M --cause C --change-kind K --change X --when "csv, tsv, spreadsheet, tabular data, import, parse, delimited file" --pattern "the general failure of thinking, one line" [--pattern-id N] [--target ID] [--same-as ID | --new] [--short "one plain sentence"] [--topic "1-3 lower-case words"] (or --json - with the same keys on stdin) end of every piece of work: HOW it could have gone better; --when (at least @@ -59,8 +54,6 @@ A shared rulebook and enforced definitions of done for every AI coding CLI. when none is due; check/--dry-run prints what would change, changing nothing; help prints the full cycle file format sisi improve is it getting better? lessons, recurrence, send-backs, time, rulebook size - sisi note TEXT (older; prefer retro) record something that went wrong - sisi propose TEXT (older; prefer retro) suggest a rule change sisi learn --scope core|user|project TEXT record a human-stated preference; it takes effect at once. --scope is required, by two questions: (a) does it apply to @@ -212,18 +205,6 @@ def _commit_personal(path, msg): pdata.commit(msg, [os.path.basename(path)]) -def cmd_store(kind, args): - from . import store - text = " ".join(args).strip() - if not text: - print("usage: sisi %s TEXT" % {"notes": "note", "proposals": "propose"}[kind]) - return 1 - store.append(kind, store.stamp({"text": text})) - _commit_personal(store.file_path(kind), "%s: %s" % ({"notes": "note", "proposals": "proposal"}[kind], " ".join(text.split())[:60])) - print("recorded") - return 0 - - def cmd_oracle(): from . import principles sys.stdout.write(principles.oracle_text()) @@ -343,6 +324,11 @@ def cmd_wiring(name, args=()): if r.get("action"): line += " | you need to: " + r["action"] print(line) + try: + from . import overlay + print("always loaded : " + overlay.cost_line()) + except Exception: + pass return 0 rc, notes = getattr(wiring, name)() for n in notes: @@ -357,23 +343,6 @@ def cmd_personal(cmd, args): return overlay.main(args) if cmd == "update": return lifecycle.cmd_update(args) - if cmd == "migrate": - for n in lifecycle.run() or ["nothing to migrate: personal data is in place"]: - print(n) - return 0 - if cmd == "build-canon": - b = overlay.build_canon() - print("%s: %d lines, %d characters%s" % (b["path"], b["lines"], b["chars"], "" if b["changed"] else " (unchanged)")) - if b["over_budget"]: - print("sisi: over the %d-line budget; shorten or replace a rule" % overlay.MAX_LINES, file=sys.stderr) - return 1 - return 0 - if cmd == "canon": - if args[:1] == ["cost"]: - print(overlay.cost_line()) - return 0 - print("usage: sisi canon cost") - return 1 if cmd == "export": print("exported to %s" % lifecycle.export(args[0] if args else None)) return 0 @@ -447,27 +416,22 @@ def main(argv): return verify.cmd_verify(args) if cmd in ("install", "uninstall", "doctor"): return cmd_wiring(cmd, args) - if cmd in ("migrate", "update", "export", "import", "build-canon", "canon", "overlay"): + if cmd in ("update", "export", "import", "overlay"): return cmd_personal(cmd, args) - if cmd in ("release", "rollback", "dev", "promote"): + if cmd in ("release", "rollback", "promote"): from . import release try: return {"release": release.cmd_release, "rollback": release.cmd_rollback, - "dev": release.cmd_dev, "promote": release.cmd_promote}[cmd](args) + "promote": release.cmd_promote}[cmd](args) except release.ReleaseError as e: print("sisi %s: %s" % (cmd, e), file=sys.stderr) return 1 - if cmd == "audit": - from . import audit - return audit.main(args) if cmd == "learn": from . import scope return scope.cmd_learn(args) if cmd == "handover": from . import handover return handover.main(args) - if cmd in ("note", "propose"): - return cmd_store({"note": "notes", "propose": "proposals"}[cmd], args) if cmd == "retro": from . import retro return retro.cmd_retro(args) diff --git a/sisi/cycle.py b/sisi/cycle.py index 7f4f8ed..c6f247a 100644 --- a/sisi/cycle.py +++ b/sisi/cycle.py @@ -564,8 +564,8 @@ Notes - one object per decision; the same lesson may appear several times (split (b) would it be useful to every user who installs sisi? Both yes: core - examples: "write delimited files with a quoting writer"; "use what the host tool already provides instead of building a replacement". (a) yes, (b) no: - user - examples: "always ask this owner questions as options with a - recommendation"; "prefer this owner's flat-rate plans over per-use ones". + user - examples: "always present questions as options with a + recommendation"; "prefer flat-rate plans over per-use ones where available". (a) no: project - examples: "this product's settings page keeps advanced options behind one toggle"; "this app uses the left control key for search". Core and user require the delivered text (change, short, when) to be @@ -613,8 +613,8 @@ Learn statements - the equivalent for `sisi learn` statements ("learn" at the to project moves it to that project's handover pile, out of the global store. Tier by the two questions at set-scope above: a statement about how sisi itself should behave for everyone is core ("sisi should anticipate what is needed from what was already said"; "checks, not - advice"); how this owner wants work done is user ("always ask questions as options with a - recommendation"; "never set up scheduled jobs or timers"); a fact about one product is + advice"); how the user wants work done is user ("always present questions as options with + a recommendation"; "never set up scheduled jobs or timers"); a fact about one product is project ("this product's settings page keeps advanced options behind one toggle"; "this app uses the left control key for search"). diff --git a/sisi/overlay.py b/sisi/overlay.py index 48ca03f..8f2535b 100644 --- a/sisi/overlay.py +++ b/sisi/overlay.py @@ -12,7 +12,7 @@ Files, all under /overlay/: done/disabled.txt ids of recipes switched off bases.json for each replacement: the hash of the base item it was made against -The effective rulebook (base + overlay) is generated to /generated/core.md by `build-canon`. +The effective rulebook (base + overlay) is generated to /generated/core.md. Every command that changes the overlay is one commit in the personal git repository and is refused when the generated rulebook would exceed MAX_LINES. """ @@ -222,7 +222,7 @@ def render(): base_h = sha(open(paths.canon("core.md"), "rb").read())[:8] except OSError: base_h = "missing" - head = "" % (base_h, overlay_hash()) parts = [head] if pre.strip(): @@ -245,7 +245,7 @@ def build_canon(strict=False): over = lines > MAX_LINES or chars > MAX_CHARS if over and strict: raise OverlayError("the rulebook would be %d lines and %d characters; the budgets are %d lines and %d " - "characters. Shorten or replace another rule first (`sisi canon cost` shows the size)" + "characters. Shorten or replace another rule first (`sisi doctor` shows the size)" % (lines, chars, MAX_LINES, MAX_CHARS)) pdata.ensure() p = paths.generated() @@ -294,7 +294,7 @@ def cost(): def cost_line(c=None): c = c or cost() if c["rulebook_lines"] is None: - return "rulebook not generated yet (run `sisi build-canon`); lessons block at most %d characters" % c["lessons_block_max_chars"] + return "rulebook not generated yet (run `sisi update`); lessons block at most %d characters" % c["lessons_block_max_chars"] return "rulebook %d lines (budget %d), %d characters (budget %d); session-start lessons block at most %d characters, %d lines" % ( c["rulebook_lines"], c["rulebook_budget_lines"], c["rulebook_chars"], c.get("rulebook_budget_chars", MAX_CHARS), c["lessons_block_max_chars"], c["lessons_block_max_lines"]) diff --git a/sisi/release.py b/sisi/release.py index cbb5c45..8207109 100644 --- a/sisi/release.py +++ b/sisi/release.py @@ -30,22 +30,14 @@ def is_source(d): return all(os.path.exists(os.path.join(d, p)) for p in ("bin/sisi", "sisi/cli.py", "canon/core.md")) -def dev_source(): - s = (paths.personal_config().get("developer") or {}).get("source") - return s if isinstance(s, str) and s else None - - def source(explicit=None): - """The source folder: the one given, else the folder sisi runs from (unless that is a release), else the - developer setting.""" + """The source folder: the one given, else the product folder of the launcher that is running.""" if explicit: s = os.path.abspath(os.path.expanduser(explicit)) elif not in_lib(paths.REPO): s = paths.REPO else: - s = dev_source() - if not s: - raise ReleaseError("no source folder: run this from the source folder, or set it with `sisi dev on PATH`") + raise ReleaseError("no source folder: run this from the source folder (bin/sisi release from the clone)") if not is_source(s): raise ReleaseError("%s does not look like the sisi source folder (bin/sisi, sisi/, canon/core.md)" % s) return s @@ -188,10 +180,13 @@ def prune(keep=KEEP): def _rebuild_rulebook(): - """Regenerate the rulebook with the code that is now live (not the code that is switching it).""" - launcher = os.path.join(paths.current_link(), "bin", "sisi") - r = subprocess.run([sys.executable, launcher, "build-canon"], capture_output=True, text=True) - return (r.stdout + r.stderr).strip(), r.returncode + """Regenerate the rulebook with the code that is now live.""" + try: + from . import overlay + b = overlay.build_canon() + return ("%s: %d lines, %d characters" % (b["path"], b["lines"], b["chars"])), 0 + except Exception as e: + return str(e), 1 def run_checks(src, deep=False): @@ -252,40 +247,11 @@ def cmd_rollback(args): return 0 if ok else 1 -# ---- developer mode --------------------------------------------------------- -def cmd_dev(args): - sub = args[0] if args else "status" - if sub == "on": - cand = args[1] if len(args) > 1 else (os.getcwd() if is_source(os.getcwd()) else - (paths.REPO if not in_lib(paths.REPO) else None)) - if not cand: - print("usage: sisi dev on PATH", file=sys.stderr) - return 1 - cand = os.path.abspath(os.path.expanduser(cand)) - if not is_source(cand): - print("sisi dev: %s does not look like the sisi source folder" % cand, file=sys.stderr) - return 1 - paths.set_personal_config(("developer", "source"), cand, "developer mode on: " + cand) - print("developer mode on: source is %s" % cand) - return 0 - if sub == "off": - paths.set_personal_config(("developer", "source"), None, "developer mode off") - print("developer mode off") - return 0 - if sub == "status": - s = dev_source() - print("developer mode: " + ("on, source %s%s" % (s, "" if is_source(s) else " (NOT a sisi source folder)") if s else "off")) - print("live copy: " + live_text()) - return 0 - print("usage: sisi dev on [PATH] | off | status", file=sys.stderr) - return 1 - - def live_text(): cur = current_name() if not cur or not os.path.isdir(paths.current_link()): return "the clone %s (no release made)" % paths.REPO - s = dev_source() or (paths.REPO if not in_lib(paths.REPO) and is_source(paths.REPO) else None) + s = paths.REPO if not in_lib(paths.REPO) and is_source(paths.REPO) else None txt = "release %s at %s" % (cur, os.path.realpath(paths.current_link())) if s and is_source(s): a, c, r = diff(s, paths.current_link()) @@ -543,12 +509,12 @@ def _promote_lesson(lid, apply): "(`sisi cycle`) first, then promote it; or send it upstream with " "`sisi promote --export`." % lid, file=sys.stderr) return 1 - src = dev_source() - if not src or not is_source(src): - print("sisi promote: this is not a developer install (no developer source set): nothing " + try: + src = source() + except ReleaseError: + print("sisi promote: run this from the source folder (bin/sisi promote from the clone): nothing " "was written. `sisi promote --export` writes a contribution file you may send " - "upstream; on a developer install (`sisi dev on PATH`) promote writes into the " - "source tree.", file=sys.stderr) + "upstream.", file=sys.stderr) return 1 return _promote_overlay(pid, apply, src) diff --git a/sisi/store.py b/sisi/store.py index 445bb27..1e214ec 100644 --- a/sisi/store.py +++ b/sisi/store.py @@ -3,7 +3,7 @@ import json, os, re, time from . import paths -FILES = {"results": "results.jsonl", "notes": "notes.jsonl", "proposals": "proposals.jsonl", +FILES = {"results": "results.jsonl", "learn": "learn.jsonl", "quarantine": "learn.jsonl", "waivers": "waivers.jsonl", "deliveries": "deliveries.jsonl"} @@ -82,7 +82,7 @@ def session_id(): return os.environ.get("SISI_SESSION_ID") or None -PERSONAL = ("notes", "proposals", "learn", "quarantine") # what the person told or taught sisi: personal data, the rest is scratch +PERSONAL = ("learn", "quarantine") # what the person told or taught sisi: personal data, the rest is scratch def file_path(name): diff --git a/sisi/taskset.py b/sisi/taskset.py index 19fb4a9..522f38d 100644 --- a/sisi/taskset.py +++ b/sisi/taskset.py @@ -117,18 +117,17 @@ def read_ledger(home=None): def worker_class(worker): w = (worker or "").lower() - for c in ("haiku", "sonnet", "opus"): - if w == c or w.startswith(c + "-"): - return c - return None + if not w: + return None + return w.split("/")[0].split(":")[0] or None def sub_class(models, meta): found = set() for m in list(models) + [str((meta or {}).get("model") or "")]: - for c in ("haiku", "sonnet", "opus"): - if c in m.lower(): - found.add(c) + c = worker_class(m) + if c: + found.add(c) return found diff --git a/sisi/wiring.py b/sisi/wiring.py index fd61cde..37a4036 100644 --- a/sisi/wiring.py +++ b/sisi/wiring.py @@ -378,9 +378,7 @@ def _ours(p): return True if t.startswith(os.path.join(paths.lib(), "")): return True # the stable copy - from . import release # a link made when the tools ran from the source folder - src = release.dev_source() - return bool(src) and t.startswith(os.path.join(src, "")) + return False def _link(m, p, target, notes, label): @@ -698,12 +696,12 @@ def doctor(): todo = lifecycle.pending() rows.append({"tool": "personal", "status": "ok" if pdata.exists() and not todo else "not ready", "detail": "%s (format %d)%s" % (paths.data(), pdata.version(), - "; run `sisi migrate`: still to move: " + ", ".join(todo) if todo else ""), + "; run `sisi update`: still to move: " + ", ".join(todo) if todo else ""), "blocking_hook": "-"}) gen = paths.generated() cur = os.path.isfile(gen) and not overlay.is_stale() rows.append({"tool": "rulebook", "status": "current" if cur else ("stale" if os.path.isfile(gen) else "missing"), - "detail": gen + ("" if cur else "; run `sisi build-canon`"), "blocking_hook": "-"}) + "detail": gen + ("" if cur else "; run `sisi update` to rebuild"), "blocking_hook": "-"}) return rows @@ -715,11 +713,11 @@ def quick_problem(): refs = any(os.path.islink(p) and os.readlink(p) == core() for _, p in links) refs = refs or _claude_md_wired(_read(L["claude_md"])) # only complain about a rulebook something points at if refs and not os.path.isfile(core()): - return "the generated rulebook is missing at %s (run `sisi build-canon`)" % core() + return "the generated rulebook is missing at %s (run `sisi update` to rebuild)" % core() if refs: from . import overlay if overlay.is_stale(): - return "the generated rulebook is out of date (run `sisi build-canon`)" + return "the generated rulebook is out of date (run `sisi update` to rebuild)" for k, p in links: if os.path.islink(p) and os.readlink(p).startswith((paths.REPO, paths.data())) and not os.path.exists(p): return "%s link is dangling" % k diff --git a/tests/test_learning.py b/tests/test_learning.py index fca1014..6c82394 100644 --- a/tests/test_learning.py +++ b/tests/test_learning.py @@ -154,7 +154,7 @@ class ImmediateEffectTests(LearningCase): self.assertIn("pars", l["triggers"]) # stems: parser/parsing/parse all meet at 'pars' self.assertTrue(l["applied_at"]) - def test_tool_lessons_backlog_order_and_dev_mode_tick_line(self): + def test_tool_lessons_backlog_order(self): a = self.mk(change_kind="tool", change="Make the gate count session edits separately per session") b = self.mk(change_kind="tool", change="Make sisi verify name the slowest check first") c = self.mk(change_kind="tool", change="Cache transcript scans between gate decisions") @@ -163,12 +163,6 @@ class ImmediateEffectTests(LearningCase): ids = [int(l.split()[0][1:]) for l in out if l.startswith("#")] self.assertEqual(ids, [b, c, a]) # most seen first; the tie goes to the older lesson self.assertEqual(self.lesson(b)["effect"], "backlog") - paths.set_personal_config(("developer", "source"), self.proj, "test") - tick = self.sisi("tick", stdin=json.dumps({"session_id": "dev1", "cwd": self.proj, "source": "startup"})).stdout - self.assertIn("top sisi backlog #%d" % b, tick) - other = os.path.join(self.tmp, "elsewhere"); os.makedirs(other) - tick2 = self.sisi("tick", stdin=json.dumps({"session_id": "dev2", "cwd": other, "source": "startup"})).stdout - self.assertNotIn("backlog", tick2) class DeliveryTests(LearningCase): @@ -1219,9 +1213,9 @@ class CycleGapTests(LearningCase): if r2.returncode != 0: self.assertNotIn("add `shortens`", r2.stdout) - def test_gap15_char_budget_rewrap_and_canon_cost(self): - self.sisi("build-canon") - self.assertIn("characters (budget %d)" % overlay.MAX_CHARS, self.sisi("canon", "cost").stdout) + def test_gap15_char_budget_rewrap_and_doctor_size(self): + overlay.build_canon() + self.assertIn("characters (budget %d)" % overlay.MAX_CHARS, self.sisi("doctor").stdout) pre, base = overlay.base_rules() title = next(r["title"] for r in base if r["id"] == "know-done") body = ("Before non-trivial work write a contract listing the checks that decide success " diff --git a/tests/test_personal.py b/tests/test_personal.py index 0cf95d6..5db23e2 100644 --- a/tests/test_personal.py +++ b/tests/test_personal.py @@ -58,6 +58,9 @@ class PersonalCase(SisiCase): self.assertEqual(r.returncode, 0, r.stdout + r.stderr) return r + def build_canon(self): + return overlay.build_canon() + def generated(self): with open(paths.generated()) as f: return f.read() @@ -80,19 +83,19 @@ class PersonalCase(SisiCase): class OverlayTests(PersonalCase): def test_first_use_creates_personal_repo(self): - self.ok("build-canon") + self.build_canon() self.assertTrue(os.path.isdir(os.path.join(self.data, ".git"))) self.assertEqual(open(os.path.join(self.data, "VERSION")).read().strip(), str(pdata.FORMAT_VERSION)) self.assertIn("retro.db", open(os.path.join(self.data, ".gitignore")).read()) g = self.generated() - self.assertTrue(g.startswith("