Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions tests/kurultai/test_buildroom_foundation.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,3 +466,58 @@ def test_control_room_report_flags_missing_evidence(tmp_path: Path) -> None:
assert payload["rooms"][0]["has_missing_evidence"] is True
assert "missing" in html_output.read_text()




def test_control_room_cron_emits_attention_and_kanban_drafts(tmp_path):
room = copy_demo_room(tmp_path)
trust_path = room / "trust/trust-report.json"
trust = json.loads(trust_path.read_text())
trust["state"] = "investigate"
trust_path.write_text(json.dumps(trust))
rooms_root = room.parent
attention = tmp_path / "attention.json"
drafts = tmp_path / "drafts.json"
markdown = tmp_path / "control-room.md"
payload = tmp_path / "control-room.json"
html = tmp_path / "control-room.html"

result = run_script(
"tools/kurultai/buildroom/scripts/control_room_cron.py",
"--rooms-root", rooms_root,
"--markdown-output", markdown,
"--json-output", payload,
"--html-output", html,
"--attention-output", attention,
"--kanban-drafts-output", drafts,
)

assert result.returncode == 0, result.stderr
attention_payload = json.loads(attention.read_text())
draft_payload = json.loads(drafts.read_text())
assert attention_payload["summary"]["room_count"] == 1
assert attention_payload["summary"]["critical_count"] == 1
assert attention_payload["summary"]["actionable_item_count"] == 1
assert attention_payload["items"][0]["category"] == "trust"
assert draft_payload["draft_count"] == 1
assert draft_payload["drafts"][0]["priority"] == "high"
assert "Buildroom follow-up" in draft_payload["drafts"][0]["title"]


def test_control_room_cron_fail_on_actionable_exit_code(tmp_path):
room = copy_demo_room(tmp_path)
trust_path = room / "trust/trust-report.json"
trust = json.loads(trust_path.read_text())
trust["state"] = "watch"
trust_path.write_text(json.dumps(trust))
result = run_script(
"tools/kurultai/buildroom/scripts/control_room_cron.py",
"--rooms-root", room.parent,
"--attention-output", tmp_path / "attention.json",
"--kanban-drafts-output", tmp_path / "drafts.json",
"--markdown-output", tmp_path / "control-room.md",
"--json-output", tmp_path / "control-room.json",
"--html-output", tmp_path / "control-room.html",
"--fail-on-actionable",
)
assert result.returncode == 2
74 changes: 74 additions & 0 deletions tools/kurultai/buildroom/control-room-attention-items.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
"actionable_items": [
{
"category": "operator_decision",
"headline": "gkisokay Auto Think Auto Build",
"id": "2026-05-10-gkisokay-auto-think-auto-build:operator-decisions",
"kanban_recommended": true,
"operator_decisions_needed": [
"Run validate_room",
"Review operator summary"
],
"recommended_action": "Resolve or route the operator decision queue.",
"room_id": "2026-05-10-gkisokay-auto-think-auto-build",
"severity": "warning",
"summary": "Room has 2 operator decision(s) queued."
},
{
"category": "trust",
"headline": "gkisokay Auto Think Auto Build",
"id": "2026-05-10-gkisokay-auto-think-auto-build:trust-watch",
"kanban_recommended": true,
"recommended_action": "Refresh the operator summary and decide whether the room is clean, needs more evidence, or needs investigation.",
"room_id": "2026-05-10-gkisokay-auto-think-auto-build",
"severity": "warning",
"summary": "Room is in watch state."
}
],
"generated_at": "2026-05-11T02:09:12Z",
"items": [
{
"category": "operator_decision",
"headline": "gkisokay Auto Think Auto Build",
"id": "2026-05-10-gkisokay-auto-think-auto-build:operator-decisions",
"kanban_recommended": true,
"operator_decisions_needed": [
"Run validate_room",
"Review operator summary"
],
"recommended_action": "Resolve or route the operator decision queue.",
"room_id": "2026-05-10-gkisokay-auto-think-auto-build",
"severity": "warning",
"summary": "Room has 2 operator decision(s) queued."
},
{
"category": "trust",
"headline": "gkisokay Auto Think Auto Build",
"id": "2026-05-10-gkisokay-auto-think-auto-build:trust-watch",
"kanban_recommended": true,
"recommended_action": "Refresh the operator summary and decide whether the room is clean, needs more evidence, or needs investigation.",
"room_id": "2026-05-10-gkisokay-auto-think-auto-build",
"severity": "warning",
"summary": "Room is in watch state."
},
{
"category": "monitor",
"headline": "Install a typed buildroom foundation for autonomous improvement work",
"id": "demo-room:clean-monitor",
"kanban_recommended": false,
"recommended_action": "No immediate action; include in retention sweep.",
"room_id": "demo-room",
"severity": "info",
"summary": "Room is clean and complete."
}
],
"summary": {
"actionable_item_count": 2,
"attention_item_count": 3,
"critical_count": 0,
"error_count": 0,
"info_count": 1,
"room_count": 2,
"warning_count": 2
}
}
33 changes: 33 additions & 0 deletions tools/kurultai/buildroom/control-room-kanban-drafts.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"draft_count": 2,
"drafts": [
{
"body": "Room: 2026-05-10-gkisokay-auto-think-auto-build\nHeadline: gkisokay Auto Think Auto Build\nCategory: operator_decision\nSeverity: warning\nSummary: Room has 2 operator decision(s) queued.\nRecommended action: Resolve or route the operator decision queue.",
"labels": [
"buildroom",
"control-room",
"operator_decision",
"warning"
],
"priority": "normal",
"room_id": "2026-05-10-gkisokay-auto-think-auto-build",
"source": "buildroom-control-room-cron-v0",
"title": "Buildroom follow-up: 2026-05-10-gkisokay-auto-think-auto-build \u2014 operator_decision"
},
{
"body": "Room: 2026-05-10-gkisokay-auto-think-auto-build\nHeadline: gkisokay Auto Think Auto Build\nCategory: trust\nSeverity: warning\nSummary: Room is in watch state.\nRecommended action: Refresh the operator summary and decide whether the room is clean, needs more evidence, or needs investigation.",
"labels": [
"buildroom",
"control-room",
"trust",
"warning"
],
"priority": "normal",
"room_id": "2026-05-10-gkisokay-auto-think-auto-build",
"source": "buildroom-control-room-cron-v0",
"title": "Buildroom follow-up: 2026-05-10-gkisokay-auto-think-auto-build \u2014 trust"
}
],
"generated_at": "2026-05-11T02:09:12Z",
"source": "buildroom-control-room-cron-v0"
}
4 changes: 2 additions & 2 deletions tools/kurultai/buildroom/control-room.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<div>
<p class="eyebrow">Kurultai / Buildroom</p>
<h1>Control Room</h1>
<p class="subtitle">Generated 2026-05-11T01:58:38Z. Static, public-safe dashboard for buildroom trust and evidence.</p>
<p class="subtitle">Generated 2026-05-11T02:09:12Z. Static, public-safe dashboard for buildroom trust and evidence.</p>
</div>
</section>
<section class="summary">
Expand Down Expand Up @@ -239,7 +239,7 @@ <h2>Install a typed buildroom foundation for autonomous improvement work</h2>
}
],
&quot;summary&quot;: {
&quot;generated_at&quot;: &quot;2026-05-11T01:58:38Z&quot;,
&quot;generated_at&quot;: &quot;2026-05-11T02:09:12Z&quot;,
&quot;room_count&quot;: 2,
&quot;rooms_needing_decision&quot;: 1,
&quot;rooms_with_missing_evidence&quot;: 0,
Expand Down
2 changes: 1 addition & 1 deletion tools/kurultai/buildroom/control-room.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
}
],
"summary": {
"generated_at": "2026-05-11T01:58:38Z",
"generated_at": "2026-05-11T02:09:12Z",
"room_count": 2,
"rooms_needing_decision": 1,
"rooms_with_missing_evidence": 0,
Expand Down
2 changes: 1 addition & 1 deletion tools/kurultai/buildroom/control-room.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Kurultai Buildroom Control Room

Generated: 2026-05-11T01:58:38Z
Generated: 2026-05-11T02:09:12Z

## Summary

Expand Down
Loading
Loading