One worker decision used by the contract guard, meter, delegation guard, fallback logic, gate; lazy transcript recognition; opening patterns as data. done: items 1-3 / next: tool list and name words
This commit is contained in:
1 parent
858401d58e
commit
1899f1ae4a
8 files changed
+33
-66
No files matched your search
@@ -11,7 +11,7 @@ from support import *
|
||||
import test_meter as TM
|
||||
import test_unitguard as TG
|
||||
from sisi import contract as C, gate, lifecycle, orchestration, prompt, routing, rulecmd, store, unit as U, unitguard as G
|
||||
from sisi import watch, workers
|
||||
from sisi import brief, watch, workers
|
||||
|
||||
SRC = TG.SRC
|
||||
CONTRACT_LINES = 12
|
||||
@@ -119,7 +119,7 @@ class OneRefusalAtATime(Both):
|
||||
self.assertIsNone(self.edit(agent_id="w1"))
|
||||
self.assertIsNone(self.agent(BUILD_BRIEF, agent_id="w1"))
|
||||
# a session whose first prompt opens with the brief template's line is a worker too
|
||||
orchestration.new_turn("wk", self.proj, orchestration.brief_line() + "\nOutcome: x")
|
||||
orchestration.new_turn("wk", self.proj, brief.template().splitlines()[0] + "\nOutcome: x")
|
||||
d = {"session_id": "wk", "cwd": self.proj, "hook_event_name": "PreToolUse", "tool_name": "Edit",
|
||||
"tool_input": {"file_path": os.path.join(self.proj, SRC), "old_string": "a", "new_string": "b"}}
|
||||
r = self.sisi("watch", "--before", "--tool", "claude-code", stdin=json.dumps(d))
|
||||
|
||||
+1
-1
@@ -245,7 +245,7 @@ class WhoIsMeteredTests(MeterBase):
|
||||
def test_a_main_prompt_that_only_mentions_worker_later_is_still_metered(self):
|
||||
from sisi import brief
|
||||
line = brief.template().splitlines()[0]
|
||||
self.prompt("fix the parser, and remember this: " + line + " you are a worker of mine")
|
||||
self.prompt("fix the parser and explain each module in the project. " * 8 + "remember this: " + line + " you are a worker of mine")
|
||||
self.assertEqual(self.read_n(8), [False] * 6 + [True] * 2)
|
||||
# nor does a brief line in the second prompt change a session that began as a main thread
|
||||
self.prompt(line + " again please do this")
|
||||
|
||||
Reference in new issue
Block a user