chore: housekeeping from the runs of 2026-10-09
Some checks failed
validation / verify (push) Failing after 12s
Some checks failed
validation / verify (push) Failing after 12s
- An Execution's files are written as each Deliverable is submitted, marked in_progress, so a killed process or one waiting for its user leaves them on disk. A write removes files an earlier write left that it no longer has. - A question about delivered work is answered from that Execution's solution guide by the reply writer; a question about the service is answered as before. Nothing is started for either. - Lessons: prove writes only for lessons the Skill holds; the Skill records the vendored Skill versions the lessons were read against, status names any that changed, and a test fails until they are reviewed. - Four more code patterns: Firestore, BigQuery, Eventarc and GKE. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -75,7 +75,7 @@ def complete_run_turns() -> dict:
|
||||
|
||||
|
||||
def client_for(
|
||||
tmp_path: Path, turns: dict, decider=None
|
||||
tmp_path: Path, turns: dict, decider=None, answers=None
|
||||
) -> tuple[TestClient, FakeAgentRuntime]:
|
||||
bundle = load_provider("gcp")
|
||||
roles = load_roles(AGENTS_DIR, bundle)
|
||||
@@ -96,6 +96,7 @@ def client_for(
|
||||
roles,
|
||||
{"compute": "API not enabled"},
|
||||
intake=Intake(decider, tmp_path) if decider else None,
|
||||
answers=answers,
|
||||
)
|
||||
|
||||
return TestClient(create_app(get_settings(), fake_assembly)), runtime
|
||||
@@ -398,6 +399,74 @@ def delivered_case(tmp_path: Path, case: str = "acme") -> None:
|
||||
)
|
||||
|
||||
|
||||
class Answers:
|
||||
"""Stands in for the reply writer answering from delivered files."""
|
||||
|
||||
def __init__(self, reply):
|
||||
self.reply = reply
|
||||
self.asked: list[tuple[str, str, str]] = []
|
||||
|
||||
async def answer(self, question, customer_case, execution_id):
|
||||
self.asked.append((question, customer_case, execution_id))
|
||||
return self.reply
|
||||
|
||||
|
||||
ABOUT_DELIVERED = {
|
||||
"intake": Answer("question", 0.98),
|
||||
"about_delivered": Answer(0.92, 0.9),
|
||||
}
|
||||
|
||||
|
||||
def test_a_question_about_delivered_work_is_answered_from_it(tmp_path):
|
||||
delivered_case(tmp_path)
|
||||
answers = Answers("Cloud SQL, because bookings are relational.")
|
||||
client, runtime = client_for(tmp_path, {}, FakeDecider(ABOUT_DELIVERED), answers)
|
||||
with client:
|
||||
task = send(
|
||||
client,
|
||||
[{"text": "Why did you choose Cloud SQL?"}],
|
||||
metadata={"customer_case": "acme"},
|
||||
)
|
||||
|
||||
text, data = status_parts(task)
|
||||
assert task["status"]["state"] == "TASK_STATE_COMPLETED"
|
||||
assert text == "Cloud SQL, because bookings are relational."
|
||||
assert data == {"status": "answered", "intake": "question", "about": "v1"}
|
||||
assert answers.asked == [("Why did you choose Cloud SQL?", "acme", "v1")]
|
||||
assert runtime.runs == []
|
||||
|
||||
|
||||
def test_a_question_that_could_not_be_answered_says_where_to_look(tmp_path):
|
||||
delivered_case(tmp_path)
|
||||
client, _ = client_for(tmp_path, {}, FakeDecider(ABOUT_DELIVERED), Answers(None))
|
||||
with client:
|
||||
task = send(
|
||||
client, [{"text": "Why Cloud SQL?"}], metadata={"customer_case": "acme"}
|
||||
)
|
||||
|
||||
text, data = status_parts(task)
|
||||
assert "could not answer that from the documents delivered in Execution v1" in text
|
||||
assert data["about"] == "v1"
|
||||
|
||||
|
||||
def test_a_question_about_the_service_is_still_answered_in_general(tmp_path):
|
||||
delivered_case(tmp_path)
|
||||
decider = FakeDecider(
|
||||
{"intake": Answer("question", 0.98), "about_delivered": Answer(0.08, 0.9)}
|
||||
)
|
||||
answers = Answers("unused")
|
||||
client, _ = client_for(tmp_path, {}, decider, answers)
|
||||
with client:
|
||||
task = send(
|
||||
client, [{"text": "What can you do?"}], metadata={"customer_case": "acme"}
|
||||
)
|
||||
|
||||
text, data = status_parts(task)
|
||||
assert text.startswith("I design cloud solution architectures.")
|
||||
assert data == {"status": "answered", "intake": "question"}
|
||||
assert answers.asked == []
|
||||
|
||||
|
||||
def test_a_change_to_delivered_work_names_the_baseline_and_starts_nothing(tmp_path):
|
||||
delivered_case(tmp_path)
|
||||
decider = FakeDecider({"intake": Answer("change_request", 0.98)})
|
||||
|
||||
Reference in New Issue
Block a user