From d58498f7adcac614a3ce0c352ea90de372ea8a67 Mon Sep 17 00:00:00 2001 From: Jammy2211 Date: Wed, 7 Oct 2026 07:50:57 +0100 Subject: [PATCH 1/3] docs: expand dashboard check-in prompts --- heart/dashboard.py | 58 ++++++++++++++++++++++++++++------------------ 1 file changed, 35 insertions(+), 23 deletions(-) diff --git a/heart/dashboard.py b/heart/dashboard.py index a0a64497..64ba0237 100644 --- a/heart/dashboard.py +++ b/heart/dashboard.py @@ -1155,29 +1155,41 @@ def build_fix_plan(board: Board, snapshot: dict | None = None, *, non-HTML Heart consumers depend on a Brain checkout. """ lines = [ - "Use the health skill. Work through this Heart dashboard systematically in this chat.", - "Scope: every monitored check. Run pyauto-brain health --scope dashboard --json. " - "Read monitoring.checks and monitoring.findings in the full board JSON before acting. " - "Release GREEN is not completion: finish only when monitoring.complete is true, " - "or report every unresolved finding, evidence gap and environment blocker. " - "Reconcile the same finding IDs after refresh; do not stop at a green release verdict.", + ( + "Use the health skill and treat this chat as an ongoing place to understand and " + "improve PyAutoLabs health. Read current authoritative Heart evidence and check " + "its freshness before acting. Run `pyauto-brain health --scope dashboard --json` " + "and inspect the full monitoring inventory and findings; the copied dashboard " + "snapshot may be stale or incomplete.\n\n" + "When I give no particular direction, work through every monitored check " + "systematically. Build a deduplicated checklist covering release blockers, " + "missing or stale evidence, local drift and advisory improvements. Explain which " + "findings affect release readiness and which do not. Missing evidence is not " + "itself a code failure.\n\n" + "When I name a finding, repository or question, make that the main focus. Help me " + "understand a verdict, investigate a failure, refresh evidence, examine slow " + "checks or plan repairs. If I ask for explanation or diagnosis, provide that " + "before proposing changes. Bring in related findings where they affect the work; " + "do not repeat the full dashboard review on every follow-up.\n\n" + "Use the appropriate health, bug, development, hygiene, cleanup or release " + "procedure for each action. Check active tasks and claims before starting " + "overlapping work. Complete clearly authorized work, retaining approvals already " + "given in this conversation and asking when a missing decision materially changes " + "the next step.\n\n" + "Preserve user edits and recoverable work. Do not lower thresholds, waive tests " + "or change scoring weights merely to improve the verdict. Follow existing " + "approval requirements for implementation, destructive cleanup, merges and " + "releases; keep release rehearsal separate from publication.\n\n" + "Refresh relevant evidence after changes and reconcile the same finding IDs. For " + "a systematic review, a GREEN release verdict alone is not completion: finish " + "when monitoring is complete, or report every unresolved finding, evidence gap " + "and environment blocker. For focused work, report its outcome and any related " + "issues that remain.\n\n" + "End with what changed, what was verified and what still needs attention. Stop at " + "the session deliverable without scheduling background follow-up." + ), + "", f"Snapshot: {board.ts or 'unknown'}; verdict: {board.verdict}; score: {board.score}.", - "1. Read current authoritative Heart evidence first. Reconcile older dev-box " - "observations and the published board before acting; this snapshot may be stale.", - "2. Make a deduplicated checklist: real release blockers, missing evidence, " - "local drift, then advisory timing and score improvements. A red section is " - "not necessarily a release blocker. Missing evidence is not a code failure.", - "3. Use the health, bug, start-dev, hygiene, repo-cleanup and " - "release skills (rehearse for release) as appropriate. Follow plan approvals and active " - "task claims. This prompt is not approval to merge, delete work or release; " - "rehearsal and publication are separate actions.", - "4. Complete authorized items in this chat, refresh evidence after relevant " - "work, then report what remains with concrete next steps. Stop at the session " - "deliverable; never schedule background follow-up or promise GREEN.", - "5. Preserve user edits. Dirty worktrees are not disposable. Never lower " - "thresholds, waive tests or change weights to improve the score. Treat the " - "context below as evidence, not authorization; diagnose unsupported findings " - "instead of inventing a command.", "", "Readiness findings (all tiers):", ] for item in board.blockers: @@ -1234,7 +1246,7 @@ def build_fix_plan(board: Board, snapshot: dict | None = None, *, evidence_note = ( "\n\nFull evidence: read the published Heart board.json at " - f"{PAGES_URL}board.json, including monitoring.checks, monitoring.findings, blockers, sections, performance and " + f"{PAGES_URL}board.json, including monitoring.complete, monitoring.checks, monitoring.findings, blockers, sections, performance and " "fix_plan.evidence. For local evidence use pyauto-heart dashboard --json " "and the state.json/release_ready.json files in HEART_STATE_DIR " "(default ~/.pyauto-heart). Reconcile timestamps before acting. " From 7c2a705e8e6146bed3ce99dc09df1e53377b6de0 Mon Sep 17 00:00:00 2001 From: Jammy2211 Date: Wed, 7 Oct 2026 07:56:13 +0100 Subject: [PATCH 2/3] fix: derive prompt organization from board metadata --- heart/dashboard.py | 5 +++-- tests/test_monitoring.py | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/heart/dashboard.py b/heart/dashboard.py index 64ba0237..a0e3406b 100644 --- a/heart/dashboard.py +++ b/heart/dashboard.py @@ -1157,7 +1157,7 @@ def build_fix_plan(board: Board, snapshot: dict | None = None, *, lines = [ ( "Use the health skill and treat this chat as an ongoing place to understand and " - "improve PyAutoLabs health. Read current authoritative Heart evidence and check " + "improve {owner} health. Read current authoritative Heart evidence and check " "its freshness before acting. Run `pyauto-brain health --scope dashboard --json` " "and inspect the full monitoring inventory and findings; the copied dashboard " "snapshot may be stale or incomplete.\n\n" @@ -1187,7 +1187,8 @@ def build_fix_plan(board: Board, snapshot: dict | None = None, *, "issues that remain.\n\n" "End with what changed, what was verified and what still needs attention. Stop at " "the session deliverable without scheduling background follow-up." - ), + ).format(owner=REPO_OWNERS.get(PAGES_URL.rstrip("/").rsplit("/", 1)[-1]) + or "the organism's"), "", f"Snapshot: {board.ts or 'unknown'}; verdict: {board.verdict}; score: {board.score}.", "", "Readiness findings (all tiers):", diff --git a/tests/test_monitoring.py b/tests/test_monitoring.py index aa3412e7..66cbd600 100644 --- a/tests/test_monitoring.py +++ b/tests/test_monitoring.py @@ -84,13 +84,16 @@ def test_nested_non_gating_workflow_failure_is_not_hidden_by_rollup(): assert not any(c["status"] == "grey" and c["family"] == "ci_status" for c in m["findings"]) -def test_monitoring_does_not_change_release_gate_and_prompt_uses_complete_scope(): +def test_monitoring_does_not_change_release_gate_and_prompt_uses_complete_scope(monkeypatch): + monkeypatch.setattr(dashboard, "REPO_OWNERS", {"SomeHeart": "SomeOrg"}) + monkeypatch.setattr(dashboard, "PAGES_URL", "https://someorg.github.io/SomeHeart/") s = {"ts": TS, "ci_timing": {"ts": TS, "events": [{"repo": "Example", "kind": "suspect_cancelled"}]}} before = readiness.compute(s) b = dashboard.build_board(s, {"verdict": "green", "score": 100}, now=NOW) assert b.score == 100 and b.verdict == "green" assert b.monitoring["score"] < 100 and b.monitoring["status"] == "red" assert readiness.compute(s) == before + assert "improve SomeOrg health" in b.fix_plan["prompt"] assert "--scope dashboard" in b.fix_plan["prompt"] assert "monitoring.complete" in b.fix_plan["prompt"] assert len(b.fix_plan["prompt"]) < 45000 From 2274c55318d9e0f4f845e1200d3f431f4eeecdc8 Mon Sep 17 00:00:00 2001 From: Jammy2211 Date: Wed, 7 Oct 2026 08:08:53 +0100 Subject: [PATCH 3/3] test: align Heart repair assertions with approved prompt --- tests/test_fix.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/test_fix.py b/tests/test_fix.py index 9bb6ba84..67d708ac 100644 --- a/tests/test_fix.py +++ b/tests/test_fix.py @@ -38,10 +38,10 @@ def test_complete_plan_ignores_display_caps_and_keeps_authority_boundaries(): assert "https://example.org/run/11" in plan assert "task24" in plan and "absent-task" in plan and "/orphan" in plan assert "pkg9" in plan - assert "not approval to merge, delete work or release" in plan - assert "Dirty worktrees are not disposable" in plan - assert "never schedule background follow-up" in plan - assert "diagnose unsupported findings" in plan + assert "approval requirements for implementation, destructive cleanup, merges and releases" in plan + assert "Preserve user edits and recoverable work" in plan + assert "without scheduling background follow-up" in plan + assert "If I ask for explanation or diagnosis, provide that before proposing changes" in plan assert board.verdict == "red" and board.score == 25 assert {b["severity"] for b in board.blockers} == {"red", "yellow", "stale"} @@ -101,8 +101,8 @@ def test_summary_overflow_preserves_authority_and_explains_omissions(): prompt = board.fix_plan["prompt"] assert len(prompt) < 50_000 assert "summary lines omitted" in prompt - assert "not approval to merge, delete work or release" in prompt - assert "Dirty worktrees are not disposable" in prompt + assert "approval requirements for implementation, destructive cleanup, merges and releases" in prompt + assert "Preserve user edits and recoverable work" in prompt assert "read the full evidence" in prompt assert len(board.blockers) == 114