Add smiley feedback collector with comment after a completed run (RBT-WP-0004-T12)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Assistant: claude-code Assistant-Model: sonnet Assistant-Process: 295952@bnt-lap001 Assistant-Session: e93f64ad-516c-46eb-9666-aad8d300c477
This commit is contained in:
parent
7d0249ed51
commit
c17b43264d
6 changed files with 167 additions and 2 deletions
|
|
@ -45,6 +45,8 @@ def _run(pk, a) -> int:
|
|||
R.retry(r, a.step); return 0
|
||||
if a.action == "skip":
|
||||
R.skip(r, a.step, a.note); return 0
|
||||
if a.action == "feedback":
|
||||
R.add_feedback(r, a.rating or "", a.note); print("recorded"); return 0
|
||||
old, new = R.exercise_update(r)
|
||||
import difflib
|
||||
print("".join(difflib.unified_diff(old.splitlines(True), new.splitlines(True), "pack.yaml", "pack.yaml")))
|
||||
|
|
@ -63,7 +65,7 @@ def main(argv: list[str] | None = None) -> int:
|
|||
sp = sub.add_parser(name)
|
||||
sp.add_argument("root", nargs="?", default=".")
|
||||
sp = sub.add_parser("run", help="record a run of a native pack")
|
||||
sp.add_argument("action", choices=["new", "list", "status", "cmd", "start", "verify", "done", "fail", "retry", "skip", "finish"])
|
||||
sp.add_argument("action", choices=["new", "list", "status", "cmd", "start", "verify", "done", "fail", "retry", "skip", "finish", "feedback"])
|
||||
sp.add_argument("manifest")
|
||||
sp.add_argument("run_id", nargs="?")
|
||||
sp.add_argument("step", nargs="?")
|
||||
|
|
@ -71,12 +73,15 @@ def main(argv: list[str] | None = None) -> int:
|
|||
sp.add_argument("--param", "-p", action="append", default=[], help="name=value")
|
||||
sp.add_argument("--evidence", "-e", action="append", default=[], help="name=value (non-secret)")
|
||||
sp.add_argument("--note", default="")
|
||||
sp.add_argument("--rating", choices=["good", "neutral", "poor"], help="feedback: how the runbook felt")
|
||||
sp.add_argument("--yes", action="store_true", help="confirm running a verify command")
|
||||
sp.add_argument("--pass", dest="passed", action="store_true", help="manual check: operator confirms it passed")
|
||||
sp.add_argument("--apply", action="store_true", help="finish: write the exercise-status change")
|
||||
sp = sub.add_parser("ui", help="serve the local UI on 127.0.0.1")
|
||||
sp.add_argument("roots", nargs="*", default=["."])
|
||||
sp.add_argument("--port", type=int, default=8877)
|
||||
sp = sub.add_parser("feedback", help="list the latest feedback of every run of a pack")
|
||||
sp.add_argument("manifest")
|
||||
sp = sub.add_parser("launch"); sp.add_argument("manifest")
|
||||
sp.add_argument("--timeout", type=float, default=30.0)
|
||||
sp = sub.add_parser("show"); sp.add_argument("manifest")
|
||||
|
|
@ -113,6 +118,11 @@ def main(argv: list[str] | None = None) -> int:
|
|||
if not pk.ok:
|
||||
print("\n".join(pk.errors), file=sys.stderr)
|
||||
return 1
|
||||
if a.cmd == "feedback":
|
||||
from . import run as R
|
||||
for f in R.all_feedback(pk):
|
||||
print(f"{f['at']} {R.RATINGS[f['rating']]} {f['operator']} {f['run_id']} {f['comment']}")
|
||||
return 0
|
||||
if a.cmd == "run":
|
||||
return _run(pk, a)
|
||||
if a.cmd == "launch":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue