Universal lessons with project handover; whole-document edits; worker discovery and routing
ci / tests (macos-latest, python 3.10) (push) Canceled after 0s
ci / tests (macos-latest, python 3.11) (push) Canceled after 0s
ci / tests (macos-latest, python 3.13) (push) Canceled after 0s
ci / tests (macos-latest, python 3.9) (push) Canceled after 0s
ci / tests (ubuntu-latest, python 3.10) (push) Canceled after 0s
ci / tests (ubuntu-latest, python 3.11) (push) Canceled after 0s
ci / tests (ubuntu-latest, python 3.13) (push) Canceled after 0s
ci / tests (macos-latest, python 3.10) (push) Canceled after 0s
ci / tests (macos-latest, python 3.11) (push) Canceled after 0s
ci / tests (macos-latest, python 3.13) (push) Canceled after 0s
ci / tests (macos-latest, python 3.9) (push) Canceled after 0s
ci / tests (ubuntu-latest, python 3.10) (push) Canceled after 0s
ci / tests (ubuntu-latest, python 3.11) (push) Canceled after 0s
ci / tests (ubuntu-latest, python 3.13) (push) Canceled after 0s
Lessons and statements carry a required scope; project items leave the shared store for a per-project handover pile filed into that project's own docs. Every learning round ends with a whole-document edit with traced lessons. sisi workers / route / delegate discover tools, choose the most affordable adequate worker and record results in the personal store; the host tool's own subagents come first, the command-line runner is the fallback. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 parent
dad13062a1
commit
ba84772acf
33 files changed
+4623
-125
No files matched your search
@@ -153,5 +153,61 @@ class LabelledMatchingTests(PromptCase):
|
||||
self.assertIn("sisi done release", self.ctx("cut a new release and tag it"))
|
||||
|
||||
|
||||
class RecipeFloorLabelledTests(SisiCase):
|
||||
"""Long real-style multi-part requests and plain questions. Expected is a recipe id or None."""
|
||||
CASES = [
|
||||
("Please change the brand text everywhere it appears: the product is now called sisi is still improving in the help text, the README, the docs and the version banner, and update any tests that pin the old name; do not change behaviour, commands or file layout, just the words users see, and check nothing else still says the old name", None),
|
||||
("Should lessons be universal, or can a lesson mention the project it came from?", None),
|
||||
("Rename the exported brand string in the CLI help, the man page draft and the docs index to the new product name, keep every command name and flag exactly as it is, and make the tests that assert the old wording pass with the new wording", None),
|
||||
("Fix the bug where the parser crashes on an empty file, a reported defect: reproduce it with a failing test first, find the cause in the tokeniser, fix only that, and run the whole suite to show nothing else changed", "bugfix"),
|
||||
("Build a new command-line tool that runs from a shell with arguments and standard output, converting delimited files to JSON: flags for input and output, clear errors and exit codes for bad input, help text that matches behaviour, and tests for empty and huge inputs", "cli-tool"),
|
||||
("Change the web settings page in the browser app to add a dark mode toggle, check the interface in a real browser at phone and desktop sizes, keep keyboard use working and do not move anything else on the page", "web-ui-change"),
|
||||
("Upgrade the HTTP client library to the next major version, read its changelog for behaviour changes, pin it in the lockfile and make the whole suite pass from a clean checkout without weakening tests", "dependency-upgrade"),
|
||||
("Performance work on the export job: make it faster and lighter on resource use, take a measured baseline first on the same inputs, speed up the hot loop, show identical outputs afterwards and report before and after latency timings with a spread", "performance-work"),
|
||||
("Migrate the stored records to the new schema: every record in a realistic copy must survive, counts must match before and after by an independent check, old files must still load and running it twice must be safe", "data-migration"),
|
||||
("Fix the security vulnerability where user input reaches the shell command, an injection weakness: reproduce it with an attack-shaped exploit test, fix the root cause everywhere the pattern occurs and keep legitimate behaviour unchanged", "security-fix"),
|
||||
("Add an MCP server that AI agents call to search the catalogue: each tool needs a clear name and description, validated inputs, small structured outputs, and real agent tasks to prove agents pick the right tool", "agent-tool-surface"),
|
||||
("Write the release: tag the version, make the manifest, tag and changelog agree, build the package from a clean checkout and check a fresh machine can install and upgrade it", "release"),
|
||||
("Refactoring the billing module: change the structure of the code to remove the duplicated rounding logic without changing what it does, capture the current outputs and public interface first, compare afterwards and show performance did not get worse", "refactor"),
|
||||
("Change the build configuration and CI workflow so the tests run on every push, run it in the real CI system, and show the new step fails when it should and secrets are not in the logs", "config-or-infra-change"),
|
||||
]
|
||||
QUESTIONS = [
|
||||
"Should lessons always be universal, or can they name a project?",
|
||||
"Why did the last learning round get refused as stale?",
|
||||
"What does the recipe for releasing actually require in full?",
|
||||
"Can a lesson mention a file name and still apply everywhere?",
|
||||
"How does request-time delivery decide which recipe to hand over?",
|
||||
"Is it better to fold this lesson into a rule or into an entry?",
|
||||
"Whether we keep project facts with the project or in the general notes?",
|
||||
"Do you think the backlog should have its own size limit?",
|
||||
]
|
||||
|
||||
def test_labelled_requests(self):
|
||||
from sisi import prompt as P
|
||||
hits = false_matches = 0
|
||||
for text, want in self.CASES:
|
||||
got = P._best_recipe(text)
|
||||
got_id = got["id"] if got else None
|
||||
if got_id == want:
|
||||
hits += 1
|
||||
elif got_id is not None:
|
||||
false_matches += 1
|
||||
self.assertEqual(got_id, want, "%r -> %r (want %r)" % (text[:60], got_id, want))
|
||||
self.assertGreaterEqual(len(self.CASES), 12)
|
||||
|
||||
def test_questions_get_nothing(self):
|
||||
from sisi import prompt as P
|
||||
for q in self.QUESTIONS:
|
||||
self.assertEqual(P.build_context(q), "", q)
|
||||
self.assertGreaterEqual(len(self.QUESTIONS), 8)
|
||||
|
||||
def test_reconstructed_failures(self):
|
||||
from sisi import prompt as P
|
||||
brand, question = self.CASES[0][0], self.CASES[1][0]
|
||||
self.assertIsNone(P._best_recipe(brand))
|
||||
self.assertNotEqual((P._best_recipe(question) or {}).get("id"), "bugfix")
|
||||
self.assertEqual(P.build_context(question), "")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user