🔥 Gremlins MVP: cut unrequested surface per keep/cut calls

This commit is contained in:
2026-10-17 00:12:40 +02:00
parent 82ef04c118
commit e1884248e8
5 changed files with 42 additions and 48 deletions
+2 -4
View File
@@ -14,7 +14,6 @@ from grm import call, launch, store, stream
SKILL_DIR = Path(__file__).resolve().parent.parent
NAME_RE = re.compile(r"^[A-Za-z0-9._-]+$")
NOTE_SLACK_S = 2.0 # coarse file times: a note written right at the start still counts
EXCERPT_CHARS = 500
LAUNCHES = ("train", "spawn", "rebase")
@@ -163,7 +162,7 @@ def _execute(run: str, state: Path, r: dict, *, job, kind, base, sid, argv, prom
note = None
if kind == "spawn":
p = state / "notes" / (job + ".md")
if p.is_file() and p.stat().st_mtime >= t0 - NOTE_SLACK_S:
if p.is_file():
note = str(p)
text = (ss.result or {}).get("result")
rec.update(session_id=ss.session_id or sid, status=status, reason=reason, ended=stream.iso(),
@@ -255,7 +254,6 @@ def cmd_spawn(args) -> dict:
if (state / "jobs" / (j + ".json")).exists():
raise Refusal("job exists; pick a new --job", job=j)
brief = _read_brief(args.brief)
warm = _warmth(store.ledger_lines(args.run), base, time.time())
sid = str(uuid.uuid4())
prompt = render_template("spawn.md", {
"block": j, "base": b, "run": r["run"],
@@ -266,7 +264,7 @@ def cmd_spawn(args) -> dict:
argv=launch.fork_argv(r, base["session_id"], sid), prompt=prompt,
before=(base.get("model_usage"), base.get("cost_cumulative_usd")),
base_ctx=base.get("context_tokens"))
return {**_out(rec, line), "base_state": warm["base_state"]}
return _out(rec, line)
def cmd_rebase(args) -> dict: