Integration 1 and 2: one approval path for changes, learned drivers and allowance probes (typed word at the terminal, hook refuses any id, every decision recorded); one description of a host's tools (canon/orchestration-tools.json read by orchestration and discovery). done / next: 3 (a learned worker is a worker everywhere), tests per point

This commit is contained in:
swaits committed 2026-11-23 16:35:47 -07:00
1 parent 29101c63e7
commit 3c2aa9b395
10 files changed
+190 -116

No files matched your search

+1 -24
View File
@@ -1,28 +1,5 @@
{
"comment": "Data for sisi/discovery.py: what a host's capability listing and delegation tool look like, which flags switch off approvals, which names are never tools, and which names hint at an agent tool. Names of tools and hosts live here, never in code. Paths are dotted keys into the tool's JSON.",
"hosts": [
{
"host": "t3-code",
"capability_tool": "^mcp__t3-code__orchestrator_capabilities$",
"delegation_tool": "^mcp__t3-code__delegate_task$",
"capability": {
"providers": "providers",
"provider": "providerInstanceId",
"kind": "driverKind",
"name": "displayName",
"models": "models",
"model": "id",
"label": "label",
"usable": "canRunChildTask",
"constraints": "constraints"
},
"delegation": {
"tool_name": "delegate_task",
"provider": "target.providerInstanceId",
"model": "target.model"
}
}
],
"comment": "Data for sisi/discovery.py: which flags switch off approvals, which names are never tools, and which names hint at an agent tool. A host's own tools (its capability listing and delegation tool, and where the provider and model sit in them) are in canon/orchestration-tools.json, the one description of a host's tools. Names of tools and hosts live in data, never in code. Paths are dotted keys into the tool's JSON.",
"blocking_constraint_words": ["disabled", "unavailable", "not installed", "not authenticated", "not signed in", "unsupported"],
"approval_bypass_patterns": [
"^--?dangerous",
+18 -2
View File
@@ -1,5 +1,5 @@
{
"_about": "Host tool names the orchestration meter needs (sisi/orchestration.py). Per host: `delegation` tools start a worker (where the call carries the model and the brief text, as dotted paths into the tool's input); `exempt` tools are never counted as direct work (the question dialog, planning and to-do tools, messaging tools). Any other tool, including one named nowhere here, counts. `refuse` says how the host's before-tool hook refuses a call: `json-deny` prints the host's permission-deny JSON, `exit-2` exits with status 2 and the reason on standard error, `none` means the meter only counts there. `evidence` says how sure this entry is.",
"_about": "Host tool names the orchestration meter needs (sisi/orchestration.py). Per host: `delegation` tools start a worker (where the call carries the model and the brief text, as dotted paths into the tool's input); `exempt` tools are never counted as direct work (the question dialog, planning and to-do tools, messaging tools). Any other tool, including one named nowhere here, counts. `refuse` says how the host's before-tool hook refuses a call: `json-deny` prints the host's permission-deny JSON, `exit-2` exits with status 2 and the reason on standard error, `none` means the meter only counts there. `evidence` says how sure this entry is. `capability` tools list what the host can reach (providers and models, as dotted paths into the tool's result), and a delegation entry that names a `provider` path says where the call carries the provider; both carry `reach`, the label under which what they learn is stored (sisi/discovery.py, read through orchestration.reach_specs). A tool name here may be an exact name or, when it starts with `^`, a pattern. This file is the one description of a host's tools: sisi/orchestration.py and sisi/discovery.py both read it.",
"claude-code": {
"refuse": "json-deny",
"evidence": "observed live (tools/live_orchestration_check.py)",
@@ -14,7 +14,23 @@
},
"mcp__t3-code__delegate_task": {
"model": "target.model",
"brief": "task"
"brief": "task",
"provider": "target.providerInstanceId",
"reach": "t3-code"
}
},
"capability": {
"mcp__t3-code__orchestrator_capabilities": {
"reach": "t3-code",
"providers": "providers",
"provider": "providerInstanceId",
"kind": "driverKind",
"name": "displayName",
"models": "models",
"model": "id",
"label": "label",
"usable": "canRunChildTask",
"constraints": "constraints"
}
},
"exempt": {
+2 -3
View File
@@ -293,9 +293,8 @@ def main(argv):
from . import cycle
return cycle.cmd_cycle(args)
if cmd == "approve":
from . import cycle, discovery
handled = discovery.approve_hook(args) # a learned driver waiting for the owner (ids drv-NAME)
return handled if handled is not None else cycle.cmd_approve(args)
from . import cycle
return cycle.cmd_approve(args) # learning changes (P-N), learned drivers (drv-NAME), allowance probes (probe-NAME)
if cmd == "oracle":
return cmd_oracle()
if cmd == "risk":
+52 -10
View File
@@ -248,7 +248,7 @@ def due_notice(session=None):
if n >= DUE_AFTER or fl:
lines.append("sisi: a learning cycle is due (%d proposed learning(s)%s; `sisi cycle` prints the brief)"
% (n, ", %d flagged not working" % fl if fl else ""))
pend = L.pending_notice()
pend = L.pending_notice(waiting_count())
if pend:
lines.append(pend)
return "\n".join(lines)
@@ -1241,14 +1241,47 @@ def park_rule_change(action, reasons):
return pid
def _waiting():
"""Everything that waits for the owner, of all three kinds, as dicts with "id", "lines" (the full action) and
"apply" (yes -> (exit code, text)): a learning change (P-N), a learned driver (drv-NAME), an allowance
probe (probe-PROVIDER). One list, one ask."""
def one(i):
def apply(yes, how, pid=i["id"]):
return 0, apply_pending(pid, yes, how)
return {"id": i["id"], "lines": describe_pending(i), "apply": apply, "kind": "change", "item": i}
out = [one(i) for i in L.load_pending()]
try:
from . import discovery
for w in discovery.waiting_decisions():
inner = w["apply"]
w["apply"] = lambda yes, how, f=inner: f(yes)
out.append(w)
except Exception as e: # a broken listing of drivers must not hide the learning changes
from . import store
store.log_error("approve-waiting", e)
return out
def waiting_count():
"""How many decisions wait for the owner, of all three kinds (the session-start line counts them together)."""
n = len(L.load_pending())
try:
from . import discovery
n += discovery.waiting_count()
except Exception as e:
from . import store
store.log_error("approve-count", e)
return n
def cmd_approve(argv):
items = L.load_pending()
waiting = _waiting()
if not argv:
if not items:
if not waiting:
print("nothing waits for a decision")
return 0
for i in items:
print("\n".join(describe_pending(i)))
for w in waiting:
print("\n".join(w["lines"]))
print()
print("The owner decides, in a terminal: sisi approve ID --yes | --no (and types the word it shows)")
return 0
@@ -1256,13 +1289,13 @@ def cmd_approve(argv):
if not yes and "--no" not in argv:
print("usage: sisi approve [ID --yes | --no]", file=sys.stderr)
return 2
item = next((i for i in items if i.get("id") == pid), None)
item = next((w for w in waiting if w["id"] == pid), None)
tty = _open_terminal()
relayed = False
if tty is None:
if not relay_allowed():
if item:
print("\n".join(describe_pending(item)), file=sys.stderr)
print("\n".join(item["lines"]), file=sys.stderr)
refuse_attempt(pid, "no controlling terminal")
print("sisi approve: refused. A decision is the owner's, typed at a terminal: this process has no "
"controlling terminal (an agent, a script, a pipe). Show the owner what it does (the listing "
@@ -1276,7 +1309,7 @@ def cmd_approve(argv):
print("sisi approve: no pending change %r (`sisi approve` lists them)" % pid, file=sys.stderr)
return 2
word = _decision_word()
tty.write("\n".join(describe_pending(item)) + "\n\nYou are about to %s %s.\n"
tty.write("\n".join(item["lines"]) + "\n\nYou are about to %s %s.\n"
% ("APPROVE" if yes else "REFUSE", pid))
if not _typed_word(tty, word):
refuse_attempt(pid, "the word was not typed at the terminal")
@@ -1288,9 +1321,18 @@ def cmd_approve(argv):
tty.close()
except OSError:
pass
if item is None:
print("sisi approve: no pending change %r (`sisi approve` lists them)" % pid, file=sys.stderr)
return 2
how = {"terminal": tty is not None, "relayed": relayed}
try:
print(apply_pending(pid, yes, {"terminal": tty is not None, "relayed": relayed}))
return 0
if item["kind"] != "change": # a change records its own decision inside its transaction (apply_pending)
L.record_approval({"id": pid, "decision": "yes" if yes else "no", "ts": L.now(), "kind": item["kind"],
"session": os.environ.get("SISI_SESSION_ID") or None, "terminal": bool(how["terminal"]),
"relayed": "relayed by an agent" if relayed else None, "action": item.get("action")})
rc, text = item["apply"](yes, how)
print(text, file=sys.stdout if rc == 0 else sys.stderr)
return rc
except (CycleError, overlay.OverlayError, documents.DocumentError) as e:
print("sisi approve: %s" % e, file=sys.stderr)
return 2
+53 -61
View File
@@ -38,14 +38,22 @@ _DATA = []
def data():
"""canon/discovery.json (names of hosts' tools, flag patterns, hints), read once per process."""
"""canon/discovery.json (flag patterns, hints) with the hosts' tools from canon/orchestration-tools.json (the one
description of a host's tools, read through orchestration.reach_specs), read once per process."""
if not _DATA:
try:
with open(paths.canon("discovery.json"), encoding="utf-8") as f:
d = json.load(f)
_DATA.append(d if isinstance(d, dict) else {})
d = d if isinstance(d, dict) else {}
except (OSError, ValueError):
_DATA.append({})
d = {}
try:
from . import orchestration
d = dict(d, hosts=orchestration.reach_specs())
except Exception as e: # no hosts: nothing is learned from a host, the rest of discovery works
store.log_error("discovery-hosts", e)
d = dict(d, hosts=[])
_DATA.append(d)
return _DATA[0]
@@ -789,72 +797,57 @@ def waiting_drivers():
return {n: r for n, r in load_drivers().items() if r.get("state") == "waiting-owner"}
def _owner_may_decide(lines):
"""True when this is the owner's terminal (or the config lets an agent relay a decision); else prints why not."""
import sys
from . import cycle
if cycle._stdin_is_tty() or cycle.relay_allowed():
return True
print("\n".join(lines), file=sys.stderr)
print("sisi approve: refused. A decision must be made by the owner in a terminal: this was run without one "
"(an agent, a script, a pipe). Show the owner the text above and give them the line to type.", file=sys.stderr)
return False
def waiting_decisions():
"""What waits for the owner here, as `sisi approve` lists and decides it: one dict per learned driver
(`drv-NAME`) and per allowance probe (`probe-PROVIDER`) with {"id", "kind", "lines" (the full action),
"action" (a short record of it for the approvals log), "apply" (a function of yes, True or False, returning
(exit code, text))}. The ask itself (the full action shown, the random word typed back at the terminal, the
refusals recorded) is cycle.cmd_approve's, the same for every kind; this module only says what is waiting
and what each decision does."""
out = []
for n, r in sorted(waiting_drivers().items()):
out.append({"id": "drv-" + n, "kind": "driver", "lines": describe_driver(n, r),
"action": {"action": "approve-driver", "tool": n, "command": list(r["driver"]["run"]),
"bypass": list(r.get("bypass") or [])},
"apply": (lambda yes, n=n: _decide_driver(n, yes))})
for n, d in sorted(waiting_probes().items()):
out.append({"id": "probe-" + n, "kind": "probe", "lines": describe_probe(n, d),
"action": {"action": "approve-probe", "provider": n,
"command": d.get("command") or d.get("secret_command"), "url": d.get("url")},
"apply": (lambda yes, n=n: _decide_probe(n, yes))})
return out
def approve_hook(args):
"""Called first by `sisi approve`. Handles the ids `drv-NAME` (a learned driver) and `probe-PROVIDER` (an
allowance probe) and adds both kinds waiting for the owner to the listing. Returns an exit code when it
handled the call, None to let the cycle's approvals go on."""
import sys
from . import learning
waiting, probes = waiting_drivers(), waiting_probes()
if not args:
if not waiting and not probes:
return None
for n, r in sorted(waiting.items()):
print("\n".join(describe_driver(n, r)) + "\n")
for n, d in sorted(probes.items()):
print("\n".join(describe_probe(n, d)) + "\n")
if learning.load_pending():
return None
print("The owner decides, in a terminal: sisi approve drv-NAME|probe-PROVIDER --yes | --no")
return 0
if not (args[0].startswith("drv-") or args[0].startswith("probe-")):
return None
kind, name = args[0].split("-", 1)
held = waiting if kind == "drv" else probes
yes = "--yes" in args
if name not in held:
print("sisi approve: nothing named %r waits for a decision" % args[0], file=sys.stderr)
return 2
if not yes and "--no" not in args:
print("usage: sisi approve drv-NAME|probe-PROVIDER --yes | --no", file=sys.stderr)
return 2
if not _owner_may_decide(describe_driver(name, held[name]) if kind == "drv" else describe_probe(name, held[name])):
return 2
if kind == "probe":
provs = load_providers()
if not yes:
provs[name].pop("allowance", None)
save_providers(provs)
print("probe-%s refused; the probe was removed" % name)
return 0
provs[name]["allowance"]["state"] = "usable"
def waiting_count():
return len(waiting_drivers()) + len(waiting_probes())
def _decide_probe(name, yes):
provs = load_providers()
if not isinstance(provs.get(name, {}).get("allowance"), dict):
return 2, "sisi approve: nothing named probe-%s waits for a decision" % name
if not yes:
provs[name].pop("allowance", None)
save_providers(provs)
print("probe-%s approved; it is read when `sisi workers` is asked and when routing needs it" % name)
return 0
return 0, "probe-%s refused; the probe was removed" % name
provs[name]["allowance"]["state"] = "usable"
save_providers(provs)
return 0, "probe-%s approved; it is read when `sisi workers` is asked and when routing needs it" % name
def _decide_driver(name, yes):
if not yes:
forget(name)
print("drv-%s refused; the driver was removed" % name)
return 0
return 0, "drv-%s refused; the driver was removed" % name
drivers = load_drivers()
if name not in drivers:
return 2, "sisi approve: nothing named drv-%s waits for a decision" % name
drivers[name]["state"] = "unverified"
drivers[name]["approved_at"] = time.time()
save_drivers(drivers)
res = prove(name, drivers)
print("drv-%s approved. Smoke task: %s" % (name, "PASSED, the driver is usable" if res["ok"] else
"FAILED (%s): %s" % (res["kind"], res["note"])))
return 0 if res["ok"] else 1
return (0 if res["ok"] else 1), "drv-%s approved. Smoke task: %s" % (
name, "PASSED, the driver is usable" if res["ok"] else "FAILED (%s): %s" % (res["kind"], res["note"]))
# ---------------------------------------------------------------- the brief for a cheap worker
@@ -1330,8 +1323,7 @@ def _cmd_allowance(args):
re.compile(pth[3:])
else:
path_values({}, pth) # raises ValueError for a path it cannot read
from . import cycle
defn["state"] = "usable" if cycle._stdin_is_tty() else "waiting-owner"
defn["state"] = "waiting-owner" # a probe runs a command or sends a request with a key: only the owner's decision lets it
defn["defined"] = time.strftime("%Y-%m-%d")
provs.setdefault(prov, {})["allowance"] = defn
save_providers(provs)
+5 -3
View File
@@ -794,11 +794,13 @@ def approved_ids():
return {a["id"] for a in load_approvals() if a.get("decision") == "yes" and a.get("id")}
def pending_notice():
n = len(load_pending())
def pending_notice(count=None):
"""The session-start line for decisions waiting for the owner. `count` is every kind together (learning
changes, learned drivers, allowance probes: cycle.waiting_count); by default only the learning changes."""
n = len(load_pending()) if count is None else count
if not n:
return ""
return ("sisi: %d learning change(s) wait for the owner's decision. Ask the owner through the host's "
return ("sisi: %d change(s) wait for the owner's decision. Ask the owner through the host's "
"question dialog (`sisi approve` lists each change in full; show the owner what it would do) and give "
"the owner the command to run in a terminal: `sisi approve ID --yes` or `--no`. "
"Do not run it for the owner." % n)
+27
View File
@@ -49,6 +49,33 @@ def hosts():
return _HOSTS
def _name_regex(name):
"""A tool name from the data file as a case-insensitive regular expression: an exact name, or a pattern when
it starts with `^`."""
n = str(name)
return "(?i)" + (n if n.startswith("^") else "^" + re.escape(n) + "$")
def reach_specs():
"""What discovery needs of the hosts' tools, from the same data file the meter reads: one dict per `reach`
(the label what is learned is stored under) with "host" (the label), "capability_tool" and "delegation_tool"
(regular expressions), "capability" (dotted paths into the listing) and "delegation" ("tool_name", "provider"
and "model": dotted paths into the delegation tool's input). A reach lacking either tool is still returned."""
out = {}
for hd in hosts().values():
for name, spec in (hd.get("capability") or {}).items():
if isinstance(spec, dict) and spec.get("reach"):
r = out.setdefault(spec["reach"], {"host": spec["reach"]})
r.update(capability_tool=_name_regex(name), capability={k: v for k, v in spec.items() if k != "reach"})
for name, spec in (hd.get("delegation") or {}).items():
if isinstance(spec, dict) and spec.get("reach") and spec.get("provider"):
r = out.setdefault(spec["reach"], {"host": spec["reach"]})
r.update(delegation_tool=_name_regex(name),
delegation={"tool_name": str(name).rsplit("__", 1)[-1], "provider": spec["provider"],
"model": spec.get("model")})
return list(out.values())
def host_data(host):
return hosts().get(host or "claude-code") or {}
+16 -4
View File
@@ -126,7 +126,11 @@ def note_shell(sess, cmd, payload):
_APPROVE = re.compile(r"(?:^|[\s/;&|(=`$])(?:sisi|sisi\.py|__main__\.py)(?=\s)(?:\s+-{1,2}[\w=-]+)*\s+approve\b([^;&|\n)`]*)")
_DECISION = re.compile(r"\bP-\d+\b[\s\S]*--(?:yes|no)\b|--(?:yes|no)\b[\s\S]*\bP-\d+\b")
# what names a change to decide, whatever its kind: P-N (a learning change), drv-NAME (a learned tool),
# probe-PROVIDER (an allowance probe) or any other word that is not the documentation's own placeholder
_ID = r"(?:P-\d+|(?:drv|probe)-(?!(?:NAME|PROVIDER|ID|X+)\b)[A-Za-z0-9][\w.-]*)"
_PLACEHOLDER = re.compile(r"^(?:ID|NAME|PROVIDER|(?:drv|probe|P)-(?:ID|NAME|PROVIDER|N+|X+))$|^\.\.\.$|^\[.*\]$|^<.*>$")
_DECISION = re.compile(_ID + r"\b[\s\S]*--(?:yes|no)\b|--(?:yes|no)\b[\s\S]*\b" + _ID)
_FLAG = re.compile(r"--(?:yes|no)\b")
APPROVE_REFUSED = ("sisi: refused. Approving or refusing a learning change is the owner's alone; an agent does not "
"run `sisi approve ID --yes|--no`, however it is wrapped. Show the owner what is waiting (run "
@@ -134,6 +138,14 @@ APPROVE_REFUSED = ("sisi: refused. Approving or refusing a learning change is th
"to type himself in a terminal.")
def _names_something(args):
"""Does the first word after `approve` (the id `sisi approve` reads) name a change: any word that is not a
flag and not the documentation's placeholder? An id of any shape counts: the refusal does not depend on
how it looks."""
words = [w for w in args.split() if not w.startswith("-")]
return bool(words) and not _PLACEHOLDER.match(words[0])
def refuse_self_approval(cmd, sid):
"""Before-tool guard, for main threads and workers alike: a shell command whose text invokes
sisi's approve command with a decision (`--yes` or `--no` for a change it names) is refused (exit 2,
@@ -149,13 +161,13 @@ def refuse_self_approval(cmd, sid):
# a decision has --yes or --no and names the change: an id, or something a shell would fill in
# (a variable, a command, a brace); prose that only mentions the command (`sisi approve ID --yes`
# in a doc, a search pattern) is not an invocation
named = bool(re.search(r"\bP-\d+\b", text))
hit = any(_FLAG.search(m.group(1)) and (named or re.search(r"[${`]", m.group(1)))
named = bool(re.search(r"\b" + _ID, text))
hit = any(_FLAG.search(m.group(1)) and (named or re.search(r"[${`]", m.group(1)) or _names_something(m.group(1)))
for m in _APPROVE.finditer(text)) \
or bool(re.search(r"\bsisi\b", text) and _DECISION.search(text))
if not hit:
return
pid = re.search(r"\bP-\d+\b", text)
pid = re.search(_ID, text)
from . import cycle
cycle.refuse_attempt(pid.group(0) if pid else "", "an agent's shell command invoked it (refused by the "
"before-tool hook)", how="hook", session=sid)
+13 -6
View File
@@ -5,7 +5,7 @@ policy is empirical and revisable: an unproven worker earns difficulty by its ju
is persisted so it is not rediscovered), R-16-3 and R-16-7 (a driver file is untrusted input: validated, least
privilege), R-16-4 (the brief never reaches a shell), R-16-6 (a tool's output is data), R-16-8 (consequential changes
are recorded), R-16-11 (a learned driver cannot widen permissions: approvals-off waits for the owner)."""
import json, os, stat, sys, time, unittest
import json, os, shutil, stat, sys, time, unittest
from unittest import mock
from support import *
@@ -76,6 +76,9 @@ class DiscoveryCase(SisiCase):
self.bindir = os.path.join(self.tmp, "sysbin")
os.makedirs(self.userbin)
os.makedirs(self.bindir)
git = shutil.which("git")
if git: # decisions and the store's history need git; nothing else of the machine's tools is on this PATH
os.symlink(git, os.path.join(self.bindir, "git"))
self.marker = os.path.join(self.tmp, "mark")
self.argsfile = os.path.join(self.tmp, "args")
patcher = mock.patch.dict(os.environ, {"PATH": self.userbin + os.pathsep + self.bindir,
@@ -551,15 +554,19 @@ class WaitsForTheOwner(DiscoveryCase):
self.assertIn("fakeagent --dangerously-skip-permissions -p {prompt}", listing)
refused = self.sisi("approve", "drv-fakeagent", "--yes")
self.assertEqual(refused.returncode, 2)
self.assertIn("owner in a terminal", refused.stderr)
self.assertIn("typed at a terminal", refused.stderr)
self.assertEqual(discovery.load_drivers()["fakeagent"]["state"], "waiting-owner")
self.assertEqual(self.runs(), [])
self.assertEqual(self.sisi("approve", "drv-ghost", "--yes").returncode, 2)
def test_the_owners_yes_runs_the_smoke_task_and_only_then_the_driver_is_usable(self):
self.bypass()
self.write_cfg({"learning": {"agent_relayed_approval": True}}) # stands in for the owner's terminal here
r = self.sisi("approve", "drv-fakeagent", "--yes")
owner = terminal() # the owner's own terminal: the full action is shown and the word typed back
with owner:
r = self.sisi("approve", "drv-fakeagent", "--yes")
t = owner.fake
self.assertIn("fakeagent --dangerously-skip-permissions -p {prompt}", t.text)
self.assertIn("Type the word", t.text)
self.assertEqual(r.returncode, 0, r.stdout + r.stderr)
self.assertIn("PASSED", r.stdout)
self.assertEqual(discovery.load_drivers()["fakeagent"]["state"], "usable")
@@ -567,8 +574,8 @@ class WaitsForTheOwner(DiscoveryCase):
def test_the_owners_no_removes_the_driver(self):
self.bypass()
self.write_cfg({"learning": {"agent_relayed_approval": True}})
self.assertEqual(self.sisi("approve", "drv-fakeagent", "--no").returncode, 0)
with terminal():
self.assertEqual(self.sisi("approve", "drv-fakeagent", "--no").returncode, 0)
self.assertEqual(discovery.load_drivers(), {})
self.assertEqual(self.runs(), [])
+3 -3
View File
@@ -93,7 +93,7 @@ class ProviderCase(TD.DiscoveryCase):
limit_signatures=["allowance used up"], tokens_regex=None)
r = self.sisi("workers", "learn", "multi", "--record", f)
self.assertEqual(r.returncode, 0, r.stdout)
self.write_cfg({"learning": {"agent_relayed_approval": True}, "discovery": {"allowance_timeout_s": 1}})
self.write_cfg({"discovery": {"allowance_timeout_s": 1}})
def cands(self):
return {c["worker"]: c for c in workers.build_candidates()}
@@ -114,7 +114,8 @@ class ProviderCase(TD.DiscoveryCase):
*PATHS, *extra)
self.assertEqual(r.returncode, 0, r.stdout)
if approve:
self.assertEqual(self.sisi("approve", "probe-zai", "--yes").returncode, 0)
with terminal(): # the owner's own terminal
self.assertEqual(self.sisi("approve", "probe-zai", "--yes").returncode, 0)
return r
@@ -381,7 +382,6 @@ class AllowanceProbe(ProviderCase):
self.assertIn("allowance probe waits for the owner", shown)
self.sisi("route", "--kind", "read", "--difficulty", "1")
self.assertEqual(self.q.hits, [], "not one request before the owner approved")
self.write_cfg({"discovery": {"allowance_timeout_s": 1}}) # no relay: an agent cannot decide
self.assertEqual(self.sisi("approve", "probe-zai", "--yes").returncode, 2)
self.assertEqual(self.q.hits, [])