WP-0001: feedback channels, CI, pre-commit, telemetry docs
Add kaizen-agentic feedback CLI, Gitea issue templates, CI workflow, pre-commit hooks, FEEDBACK/TELEMETRY docs, and cross-platform path tests. Improve CLI registry error messages; remove agents_backup scaffolding. Apply black formatting across src/tests for CI consistency. State Hub message sent to agentic-resources for Helix correlation doc link.
This commit is contained in:
@@ -22,11 +22,11 @@ from kaizen_agentic.cli import cli
|
||||
from kaizen_agentic.metrics import MetricsStore, OptimizerStore
|
||||
from kaizen_agentic.optimization import MIN_SAMPLES_FOR_RECOMMENDATIONS
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Helpers
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
def _sys_medic_memory() -> str:
|
||||
"""Realistic sys-medic memory after two simulated sessions."""
|
||||
return textwrap.dedent("""\
|
||||
@@ -124,6 +124,7 @@ def _project_management_memory() -> str:
|
||||
# Fixtures
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def project(tmp_path):
|
||||
"""A temporary 'project' directory with a name."""
|
||||
@@ -136,10 +137,13 @@ def project(tmp_path):
|
||||
# Tests
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
class TestMemoryInit:
|
||||
def test_init_creates_file(self, project):
|
||||
runner = CliRunner()
|
||||
result = runner.invoke(cli, ["memory", "init", "sys-medic", "--target", str(project)])
|
||||
result = runner.invoke(
|
||||
cli, ["memory", "init", "sys-medic", "--target", str(project)]
|
||||
)
|
||||
assert result.exit_code == 0, result.output
|
||||
assert "Initialized memory" in result.output
|
||||
|
||||
@@ -166,7 +170,9 @@ class TestMemoryInit:
|
||||
def test_init_idempotent(self, project):
|
||||
runner = CliRunner()
|
||||
runner.invoke(cli, ["memory", "init", "sys-medic", "--target", str(project)])
|
||||
result = runner.invoke(cli, ["memory", "init", "sys-medic", "--target", str(project)])
|
||||
result = runner.invoke(
|
||||
cli, ["memory", "init", "sys-medic", "--target", str(project)]
|
||||
)
|
||||
assert result.exit_code == 0
|
||||
assert "already exists" in result.output
|
||||
|
||||
@@ -178,14 +184,18 @@ class TestMemoryShow:
|
||||
memory_file.write_text(_sys_medic_memory())
|
||||
|
||||
runner = CliRunner()
|
||||
result = runner.invoke(cli, ["memory", "show", "sys-medic", "--target", str(project)])
|
||||
result = runner.invoke(
|
||||
cli, ["memory", "show", "sys-medic", "--target", str(project)]
|
||||
)
|
||||
assert result.exit_code == 0
|
||||
assert "Node Profiles" in result.output
|
||||
assert "tegpi-01" in result.output
|
||||
|
||||
def test_show_missing_prints_guidance(self, project):
|
||||
runner = CliRunner()
|
||||
result = runner.invoke(cli, ["memory", "show", "sys-medic", "--target", str(project)])
|
||||
result = runner.invoke(
|
||||
cli, ["memory", "show", "sys-medic", "--target", str(project)]
|
||||
)
|
||||
assert result.exit_code == 0
|
||||
assert "No memory found" in result.output
|
||||
assert "memory init" in result.output
|
||||
@@ -205,7 +215,9 @@ class TestMemoryBrief:
|
||||
def test_brief_includes_own_memory(self, project):
|
||||
self._populate(project)
|
||||
runner = CliRunner()
|
||||
result = runner.invoke(cli, ["memory", "brief", "sys-medic", "--target", str(project)])
|
||||
result = runner.invoke(
|
||||
cli, ["memory", "brief", "sys-medic", "--target", str(project)]
|
||||
)
|
||||
assert result.exit_code == 0
|
||||
assert "Orientation Brief for: sys-medic" in result.output
|
||||
assert "Your Memory" in result.output
|
||||
@@ -214,7 +226,9 @@ class TestMemoryBrief:
|
||||
def test_brief_includes_cross_agent_context(self, project):
|
||||
self._populate(project)
|
||||
runner = CliRunner()
|
||||
result = runner.invoke(cli, ["memory", "brief", "sys-medic", "--target", str(project)])
|
||||
result = runner.invoke(
|
||||
cli, ["memory", "brief", "sys-medic", "--target", str(project)]
|
||||
)
|
||||
assert result.exit_code == 0
|
||||
assert "Context From Other Agents" in result.output
|
||||
assert "project-management" in result.output
|
||||
@@ -222,20 +236,26 @@ class TestMemoryBrief:
|
||||
def test_brief_coach_tip_present(self, project):
|
||||
self._populate(project)
|
||||
runner = CliRunner()
|
||||
result = runner.invoke(cli, ["memory", "brief", "sys-medic", "--target", str(project)])
|
||||
result = runner.invoke(
|
||||
cli, ["memory", "brief", "sys-medic", "--target", str(project)]
|
||||
)
|
||||
assert result.exit_code == 0
|
||||
assert "agent-coach" in result.output
|
||||
|
||||
def test_brief_no_memory_gives_guidance(self, project):
|
||||
runner = CliRunner()
|
||||
result = runner.invoke(cli, ["memory", "brief", "sys-medic", "--target", str(project)])
|
||||
result = runner.invoke(
|
||||
cli, ["memory", "brief", "sys-medic", "--target", str(project)]
|
||||
)
|
||||
assert result.exit_code == 0
|
||||
assert "No agent memory files found" in result.output
|
||||
|
||||
def test_brief_raw_flag_skips_header(self, project):
|
||||
self._populate(project)
|
||||
runner = CliRunner()
|
||||
result = runner.invoke(cli, ["memory", "brief", "sys-medic", "--target", str(project), "--raw"])
|
||||
result = runner.invoke(
|
||||
cli, ["memory", "brief", "sys-medic", "--target", str(project), "--raw"]
|
||||
)
|
||||
assert result.exit_code == 0
|
||||
assert "=== sys-medic ===" in result.output
|
||||
# Raw mode should not include the orientation header
|
||||
@@ -275,7 +295,9 @@ class TestMemoryBrief:
|
||||
],
|
||||
)
|
||||
|
||||
result = runner.invoke(cli, ["memory", "brief", "sys-medic", "--target", str(project)])
|
||||
result = runner.invoke(
|
||||
cli, ["memory", "brief", "sys-medic", "--target", str(project)]
|
||||
)
|
||||
|
||||
assert result.exit_code == 0
|
||||
assert "## Performance Summary" in result.output
|
||||
@@ -367,7 +389,10 @@ class TestTddWorkflowMetricsPilot:
|
||||
["metrics", "show", "tdd-workflow", "--target", str(project)],
|
||||
)
|
||||
assert show_result.exit_code == 0
|
||||
assert "test_pass_rate" in show_result.output or "2 execution" in show_result.output.lower()
|
||||
assert (
|
||||
"test_pass_rate" in show_result.output
|
||||
or "2 execution" in show_result.output.lower()
|
||||
)
|
||||
|
||||
store = MetricsStore(project, "tdd-workflow")
|
||||
for i in range(MIN_SAMPLES_FOR_RECOMMENDATIONS - len(sessions)):
|
||||
@@ -422,7 +447,9 @@ class TestProtocolsCommand:
|
||||
|
||||
def test_protocols_show_outputs_content(self):
|
||||
runner = CliRunner()
|
||||
result = runner.invoke(cli, ["protocols", "show", "sys-medic", "k3s-node-health-assessment"])
|
||||
result = runner.invoke(
|
||||
cli, ["protocols", "show", "sys-medic", "k3s-node-health-assessment"]
|
||||
)
|
||||
assert result.exit_code == 0
|
||||
# Protocol should contain key structural sections
|
||||
assert "k3s" in result.output.lower()
|
||||
|
||||
Reference in New Issue
Block a user