Repository navigation
Description
Overview
Programme task M1.2 (epic autonomous-orchestrators, phase 8). prompt_sync_push stages with git add -A (scripts/prompt_sync.sh:104), then commits and pushes with no guard. In the shared Mind checkout this has swept other sessions' edits into commits, committed conflict markers twice, and dropped live active.md entries. The ecosystem review confirmed it (FB-1, MIND-1). The helper should stage only the paths it is given and refuse anything unsafe.
Plan
prompt_sync_push "<msg>" <path>...stages only the given paths. It refuses when no paths are given.- It refuses, committing nothing, when the tree has changes outside those paths, when any staged file contains conflict markers, or when
state.json(if staged) does not parse. - Tests in PyAutoMind cover each refusal and the happy path.
- Every skill file that calls the helper passes its explicit paths (Mind's
create_issue, plus 11 Brain skill and doctrine files). prompt_sync_new_promptskeeps its own contract (new untracked prompt files only) and is checked for the sameadd -Apattern.
Tier: glance — merge mode: auto-merge on green if the Witness passes, post-merge summary
Detailed implementation plan
Affected Repositories
- PyAutoMind (primary):
scripts/prompt_sync.sh, tests,skills/create_issue/SKILL.md - PyAutoBrain: caller docs, namely
skills/{intake/intake.md, start_library/start_library.md, start_dev/start_dev.md, start_dev_for_user/{start_dev_for_user.md,reference.md}, prm/reference.md, start_workspace/reference.md, ship_library/reference.md, ship_workspace/reference.md},AUTONOMY.md,agents/conductors/batch/AGENTS.md
Suggested branch: feature/prompt-sync-explicit-paths in both repos. Merge Mind first: the Brain docs describe the new signature.
Implementation Steps
scripts/prompt_sync.sh: change the signature toprompt_sync_push <message> <path> [path...].- Refuse with no paths.
- Refuse when
git status --porcelainlists changes outside the given paths. Untracked files outside the paths count too, unless ignored. git add -- <paths>only.--no-renames-safe: a staged rename's deletion side must be inside the given paths, or the helper refuses.- Refuse when any staged file contains conflict markers (
^<<<<<<< |^=======$|^>>>>>>>). - Refuse when
state.jsonis staged and does not parse. - Keep the existing current-branch push behaviour (7354a32).
- Tests (Mind's existing test layout): a throwaway git repo fixture with a bare remote, covering:
- a dirty file outside the paths → refuse, nothing committed;
- conflict markers → refuse;
- bad
state.json→ refuse; - no paths → refuse;
- the happy path commits exactly the given paths and pushes.
- Update every caller doc to pass explicit paths, with a one-line note of the refusal rules where the helper is introduced.
Witness
grep -n "add -A" scripts/prompt_sync.shreturns nothing.- A test with a dirty file outside the given paths shows the helper refuses and commits nothing.
- A test with conflict markers in a staged file refuses, and so does one with an unparseable
state.json. - The skill files that call the helper pass explicit paths.
Unattended: never: this is the helper every session uses to write Mind, so it ships with the human present.
Original Prompt
Click to expand starting prompt
prompt_sync_push: commit only the paths it is given
Type: bug
Target: PyAutoMind
Repos:
- PyAutoMind
- PyAutoBrain
Difficulty: small
Autonomy: supervised
Priority: high
Status: draft
Filed: 2026-11-10
Consequence: glance
Witness:grep -n "add -A" scripts/prompt_sync.shreturns nothing; a test with a dirty file outside the given paths shows the helper refuses and commits nothing; a test with conflict markers in a staged file, and one with an unparseablestate.json, both refuse; the skill files that call the helper pass explicit paths
Review-minutes: 5
Unattended: never
Lane: any
Source: the ecosystem review of 2026-11-10, findings FB-1 and MIND-1, both confirmed by an independent verifier. Report: https://claude.ai/artifact/4A94P1cevvkESoM22QoMWm (private) and Science/scratch/ecosystem_review_2026-11/REPORT.md, sections B3 and B6 and Appendix A.
What was measured. Twelve feedback memories from 2026-05-10 to 2026-11-05 record write hazards in the shared Mind checkout. About six of them are a commit that swept up files the session did not own, and four of those came after the commit guard of 2026-07-16, three through prompt_sync_push. The helper still runs git add -A at scripts/prompt_sync.sh:104, then commits and pushes with no pull, rebase, retry or lock. PyAutoBrain/bin/mind_commit_guard.py has no reference to the helper and cannot see a helper call. Ten checked-in skill files still tell sessions to call it; only prm/reference.md warns about the add -A.
Recorded damage with one human and a few sessions: conflict markers committed twice, live active.md entries dropped and restored by hand, other sessions' edits swept into commits, and six completion records stranded on unmerged branches.
The change.
prompt_sync_pushtakes explicit file paths and stages only those.- It refuses when the tree has changes outside those paths, when any staged file contains conflict markers, or when
state.jsondoes not parse. - Update the skill files that call it to pass their paths.
For autonomous shifts the one-Mind-writer rule is already enforced by a hook since 2026-11-03 (PyAutoBrain#560), so this fix is for every other session. The remote transport a cloud writer needs is a separate question and belongs in the cloud watcher design.
Unattended: never because this is the helper every session uses to write Mind; ship it with the human present.
Activity
draft: prompt_sync explicit-paths follow-ups (#554, M1.2)
Jammy2211 commentedon Nov 12, 2026
Heart RED override (development only), recorded per AUTONOMY.md.
The live human authorized it in the programme session on 2026-11-12: "Override + merge on green". That covers the development-only RED override for this issue and the merge command (Mind PR first, then the Brain docs PR), on condition that every required check is green within the turn.
Current RED reasons, verbatim (
pyauto-heart readiness, ts 2026-11-12T17:29:04Z):None of these is in PyAutoMind or PyAutoBrain. Branch gates passed:
add -Aleft, and the refusal tests pass.PRs: #555 and PyAutoLabs/PyAutoBrain#605
🤖 Generated with Claude Code
Merge pull request #555 from PyAutoLabs/feature/prompt-sync-explicit-…
Jammy2211 commentedon Nov 12, 2026
Shipped. Both PRs merged on green CI:
Witness:
grep -n "add -A" scripts/prompt_sync.shprints nothing.state.jsonpass.Follow-ups are filed as
draft/maintenance/pyautomind/prompt_sync_explicit_paths_followups.md.Programme M1.2 is done.
🤖 Generated with Claude Code