Bridge Coach memory brief with project metrics summaries.
Add Performance Summary block to memory brief, document metrics synthesis in agent-coach, and add e2e and CLI tests for qualitative plus quantitative briefs.
This commit is contained in:
@@ -209,6 +209,49 @@ class TestMemoryBrief:
|
||||
# Raw mode should not include the orientation header
|
||||
assert "Orientation Brief for:" not in result.output
|
||||
|
||||
def test_brief_includes_performance_summary_with_memory_and_metrics(self, project):
|
||||
self._populate(project)
|
||||
runner = CliRunner()
|
||||
runner.invoke(
|
||||
cli,
|
||||
[
|
||||
"metrics",
|
||||
"record",
|
||||
"sys-medic",
|
||||
"--target",
|
||||
str(project),
|
||||
"--success",
|
||||
"--time",
|
||||
"30",
|
||||
"--quality",
|
||||
"0.88",
|
||||
],
|
||||
)
|
||||
runner.invoke(
|
||||
cli,
|
||||
[
|
||||
"metrics",
|
||||
"record",
|
||||
"project-management",
|
||||
"--target",
|
||||
str(project),
|
||||
"--success",
|
||||
"--time",
|
||||
"15",
|
||||
"--quality",
|
||||
"0.95",
|
||||
],
|
||||
)
|
||||
|
||||
result = runner.invoke(cli, ["memory", "brief", "sys-medic", "--target", str(project)])
|
||||
|
||||
assert result.exit_code == 0
|
||||
assert "## Performance Summary" in result.output
|
||||
assert "Success rate:" in result.output
|
||||
assert "tegpi-01" in result.output
|
||||
assert "Context From Other Agents" in result.output
|
||||
assert "project-management" in result.output
|
||||
|
||||
|
||||
class TestMemoryClear:
|
||||
def test_clear_removes_file(self, project):
|
||||
|
||||
@@ -114,6 +114,30 @@ class TestMetricsCli:
|
||||
assert metrics_dir.exists()
|
||||
assert (metrics_dir / "executions.jsonl").exists()
|
||||
|
||||
def test_memory_brief_includes_performance_summary(
|
||||
self, runner: CliRunner, project_dir: Path
|
||||
):
|
||||
target = str(project_dir)
|
||||
runner.invoke(cli, ["memory", "init", "tdd-workflow", "--target", target])
|
||||
runner.invoke(
|
||||
cli,
|
||||
[
|
||||
"metrics",
|
||||
"record",
|
||||
"tdd-workflow",
|
||||
"--target",
|
||||
target,
|
||||
"--success",
|
||||
"--quality",
|
||||
"0.9",
|
||||
],
|
||||
)
|
||||
|
||||
result = runner.invoke(cli, ["memory", "brief", "tdd-workflow", "--target", target])
|
||||
assert result.exit_code == 0
|
||||
assert "## Performance Summary" in result.output
|
||||
assert "Success rate: 100.0%" in result.output
|
||||
|
||||
def test_memory_init_no_metrics_flag(self, runner: CliRunner, project_dir: Path):
|
||||
result = runner.invoke(
|
||||
cli,
|
||||
|
||||
Reference in New Issue
Block a user