Add manifest_drift tick check: continuous body-map identity drift#36
Merged
Conversation
Runs PyAutoMind/scripts/repos_sync.py --check every tick and parses its report — Heart's repos.yaml, pre_build.sh, ensure_workspace_labels.sh and every checkout's origin vs the PyAutoMind/repos.yaml body map. The drift logic stays in repos_sync.py (Mind owns the manifest; Heart observes). Classification: YELLOW per drifted surface (identity hygiene, never RED); skipped (available:false) when no PyAutoMind checkout, and an unparseable report surfaces as unavailable rather than hollow green. Wired into tick.sh, state.aggregate, readiness, and capabilities.yaml; ~1s live, 210 tests pass (8 new). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds a new continuous (“tick”) check that detects body-map identity drift between PyAutoMind/repos.yaml and downstream repo identity surfaces (Heart/Build/labels + local checkout origins). This keeps the drift logic in Mind (repos_sync.py --check) while Heart observes and reports the results into state and readiness.
Changes:
- Introduces
heart.checks.manifest_driftto runPyAutoMind/scripts/repos_sync.py --check, parse its report, and persistmanifest_drift.json. - Wires the new check into
tick.sh,state.aggregate(), andreadiness(drift surfaces as YELLOW, never RED). - Adds unit tests for report parsing, run behavior, and readiness classification.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_readiness.py | Adds readiness tests ensuring manifest drift is YELLOW and “unavailable” stays GREEN. |
| tests/test_manifest_drift.py | New tests for parsing repos_sync.py --check output and run-path edge cases. |
| heart/tick.sh | Runs heart.checks.manifest_drift each tick when Mind checkout is present. |
| heart/state.py | Aggregates manifest_drift.json into state.json. |
| heart/readiness.py | Converts manifest drift per-surface failures into readiness YELLOW reasons. |
| heart/checks/manifest_drift.py | Implements the new tick check runner + parser + state writer. |
| health_agent/capabilities.yaml | Documents the new continuous check and its gate role. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+302
to
+310
| manifest = snapshot.get("manifest_drift") | ||
| if isinstance(manifest, dict) and manifest.get("available"): | ||
| for label, chk in (manifest.get("checks") or {}).items(): | ||
| if isinstance(chk, dict) and not chk.get("ok", True): | ||
| n = len(chk.get("problems") or []) | ||
| yellow.append( | ||
| f"manifest drift: {label} — {n} mismatch(es) vs PyAutoMind/repos.yaml" | ||
| ) | ||
| hit("manifest_drift") |
Comment on lines
+71
to
+75
| proc = subprocess.run( | ||
| [sys.executable, str(script), "--check", "--root", str(PYAUTO_ROOT)], | ||
| capture_output=True, | ||
| text=True, | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to PyAutoLabs/PyAutoMind#36: manifest drift now surfaces without anyone remembering to run the check.
heart/checks/manifest_drift.py— runsPyAutoMind/scripts/repos_sync.py --checkeach tick and parses its per-surface report; the drift logic stays in Mind (Heart only observes and reports).ghcall or label sweep, not a release blocker (same stance as URL hygiene, but visible in readiness cautions). Missing PyAutoMind checkout → skipped; unparseable output →available: false, never a hollow green.tick.sh(guarded),state.aggregate,readiness.compute, andhealth_agent/capabilities.yaml.✓ manifest_drift identity in sync (4 surfaces vs repos.yaml)andstate.jsoncarries the result. 210 tests pass (5 check tests + 2 readiness tests + parse edge case).🤖 Generated with Claude Code