Merge t3/rebuild-learning-loop into spec-reconciliation
Learning loop rebuilt on sisi/learning.py as the single store; retro, cycle, scope and documents cut down; improve/backlog/lessons digest retired, approve added. Conflicts resolved keeping the risk-and- relevance hook behaviour (silence by default, 2,000-char prompt cap, structured recipe matcher) on the new learning functions, the union of both sides' CLI changes, and our rewritten README.
This commit is contained in:
commit
6c5d87e5db
31 files changed
+1957
-9830
No files matched your search
+23
-51
@@ -32,35 +32,20 @@ A shared rulebook and enforced definitions of done for every AI coding CLI.
|
||||
sisi export [PATH] | import PATH one tar.gz of personal data, results and session records; restore it
|
||||
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 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
|
||||
5 terms, synonyms included) is how a later agent with different words finds it;
|
||||
--pattern is required (one line that would apply to unrelated
|
||||
work; `sisi retro patterns` lists existing ones to reuse);
|
||||
--short (at most 140 characters) and --topic (at most 30) are optional: when
|
||||
omitted, the next learning round writes them
|
||||
aims: level (the human could have worked at a higher level), verified (a stronger check was
|
||||
possible), hands-off (the human was interrupted more than needed), intent (the result was not
|
||||
what they meant), speed (it took longer than it had to)
|
||||
sisi lessons [filters] | show ID | digest [--all] | set ID --status S | apply ID | export [FILE] | import FILE
|
||||
the shared lessons from retros (--aim --kind --status --repo --top --json);
|
||||
digest prints a short plain-language summary grouped by topic, for the human
|
||||
sisi backlog tool lessons: changes to sisi itself, most seen first
|
||||
sisi cycle [due|apply FILE|check FILE|--dry-run FILE|revert [ID]|status|help|--now]
|
||||
consolidate lessons into rules, entries and enforced checks (no
|
||||
scheduler: due-ness is a counter checked during normal use);
|
||||
with no argument, or with --now, it prints the brief on demand even
|
||||
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 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
|
||||
all projects where sisi may be used? (b) would it be useful
|
||||
to every user who installs sisi? Both yes: core (in force
|
||||
for you, queued for the product). (a) only: user (your
|
||||
standing principles). Neither: project (handed over to it)
|
||||
sisi retro print the unit's record and what stands out in it
|
||||
sisi retro --finding F --cause C --impact value|correctness|time|cost|attention --disposition promote|record|drop [--same-as ID]
|
||||
record one finding; promote also needs --change, --mechanism,
|
||||
--expect and --validate; record needs --limits; drop needs --why-not
|
||||
sisi lessons [--json] | show ID the learning records and their statuses
|
||||
sisi cycle [due|apply FILE|check FILE|revert [ID]|help]
|
||||
turn proposed learnings into mechanisms (no scheduler:
|
||||
due-ness is a counter); apply validates and replays before
|
||||
promoting; help prints the cycle file format
|
||||
sisi approve [ID --yes|--no] decide a consequential learning change a cycle parked
|
||||
sisi learn [--scope user|project] TEXT
|
||||
record an owner statement; it takes effect at once and
|
||||
`sisi oracle` prints it. Scope for other learnings is
|
||||
earned by evidence, never claimed
|
||||
sisi risk [--json] risk floor for the working-tree change, with reasons and
|
||||
what that profile requires
|
||||
sisi handover [--all] | done ID --where PATH [--quote FRAGMENT]
|
||||
@@ -130,8 +115,8 @@ def cmd_contract(args):
|
||||
"(rung 1-4) and add every check that shows the work is done. Until then `sisi verify` fails and "
|
||||
"the end-of-turn gate ignores it." % p)
|
||||
try:
|
||||
from . import retro
|
||||
block = retro.delivery_block(goal or "", "contract-init", extra="contract checks verified")
|
||||
from . import learning as _L
|
||||
block = _L.delivery_text(os.getcwd(), goal or "")
|
||||
if block:
|
||||
print(block)
|
||||
except Exception:
|
||||
@@ -201,18 +186,13 @@ def cmd_oracle():
|
||||
|
||||
def _status_retro():
|
||||
try:
|
||||
from . import retro
|
||||
st = retro.stats()
|
||||
from . import learning as _L
|
||||
rows = _L.load_learnings()
|
||||
print("learnings : %d total, %d proposed, %d promoted (`sisi status --learning` for the report)"
|
||||
% (len(rows), sum(1 for r in rows if r.get("status") == "proposed"),
|
||||
sum(1 for r in rows if r.get("status") in ("promoted", "monitored"))))
|
||||
except Exception:
|
||||
return
|
||||
print("lessons : %d total, %d open, %d applied; %d occurrences in the last 7 days"
|
||||
% (st["total"], st["open"], st["applied"], st["occ7"]))
|
||||
w = st["sessions_with_work"]
|
||||
print("retros : %s of sessions with real work recorded one (%d of %d)"
|
||||
% ("%.0f%%" % (100 * st["sessions_with_retro"] / w) if w else "n/a", st["sessions_with_retro"], w))
|
||||
for t in st["top"]:
|
||||
from . import retro as _R
|
||||
print(" active #%-4d x%-3d %s" % (t["id"], t["count"], _R.heading_text(t, 90)))
|
||||
|
||||
|
||||
def _status_contracts(res):
|
||||
@@ -278,11 +258,6 @@ def cmd_status():
|
||||
except Exception:
|
||||
pass
|
||||
_status_retro()
|
||||
try:
|
||||
from . import cycle
|
||||
print(cycle.improve_line())
|
||||
except Exception:
|
||||
pass
|
||||
_status_contracts(res)
|
||||
from . import verifiers
|
||||
vs = [e for e in verifiers.load_verifiers() if e["header"]]
|
||||
@@ -426,15 +401,12 @@ def main(argv):
|
||||
if cmd == "lessons":
|
||||
from . import retro
|
||||
return retro.cmd_lessons(args)
|
||||
if cmd == "backlog":
|
||||
from . import retro
|
||||
return retro.cmd_backlog(args)
|
||||
if cmd == "cycle":
|
||||
from . import cycle
|
||||
return cycle.cmd_cycle(args)
|
||||
if cmd == "improve":
|
||||
if cmd == "approve":
|
||||
from . import cycle
|
||||
return cycle.cmd_improve(args)
|
||||
return cycle.cmd_approve(args)
|
||||
if cmd == "oracle":
|
||||
return cmd_oracle()
|
||||
if cmd == "risk":
|
||||
|
||||
Reference in new issue
Block a user