Skip to content

Split Mind prompt-file lifecycle into draft/ active/ complete/ #71

Description

@Jammy2211

Overview

PyAutoMind/issued/ is a flat, append-only pile of 444 prompt files — every prompt ever start_dev'd, done or not — so it is useless for tracking state. The root cause is two parallel lifecycles that have drifted apart: prompt files flow <work-type>/ → issued/ (and then never move), while ledger entries flow active.md → complete.md. This task makes the file lifecycle track the three ledger states via a clean top-level split — draft/active/complete/YYYY/MM/ — and splits the 6000-line complete.md into per-task rich records (the substrate for a later token-light archive wiki, filed separately).

Phase 2 (the complete/ wiki index) is the already-filed follow-up feature/pyautomind/complete_archive_wiki.md and is out of scope here — do not issue it until this nears shipping.

Plan

Ships as two sequential PRs under this issue (the Feature Agent flagged the task too-large for one PR; its generic core_api/workspace/docs phases don't apply to a Mind-internal restructure):

PR-A — Rewire (no historical data moved):

  • Establish draft/ / active/ / complete/YYYY/MM/ conventions (zero-padded months = numerical order). draft/ wraps the existing <work-type>/<target>/ taxonomy.
  • New scripts/lifecycle.py: move (bucket a completed file by its ledger completed: date), split-complete (complete.md → per-file records), --check (drift detection).
  • Update the 6 Brain skills and 3 Mind scripts to the new paths (see Implementation Steps).
  • Smoke a throwaway create_issue → ship round-trip. New work flows correctly; the 444 files still sit in issued/.

PR-B — Migrate (mechanical, big diff):

  • Run lifecycle.py to move the 444 issued/ files into active/ vs complete/YYYY/MM/ (cross-referenced against active.md/complete.md; orphans → complete/unknown/), and split complete.md into per-file rich records — via a review manifest first, then git mv to preserve history.
  • Regenerate + republish the spawn template (spawn --check / spawn_drift CI).
Detailed implementation plan

Affected Repositories

  • PyAutoMind (primary) — dir layout, scripts/lifecycle.py, spawn.py, status.sh, prompt_sync.sh
  • PyAutoBrain — the 6 dev-workflow skills wired to issued/ / complete.md

Branch Survey

Repository Current Branch Dirty?
./PyAutoMind main clean
./PyAutoBrain main clean

Suggested branch: feature/lifecycle-state-split

Note: two stray codex worktrees sit on PyAutoMind branches (codex-organ-skill-wrappers, codex-skill-bookkeeping) — not conflicting (worktree_check_conflict exit 0), but land this before they grow to avoid merge friction.

Implementation Steps (PR-A)

  1. Conventions + docs — define draft/ active/ complete/YYYY/MM/ in PyAutoMind/README.md "Prompt taxonomy"; add complete/AGENTS.md stub for the archive schema.
  2. scripts/lifecycle.pymove <file> (read ledger completed: date → complete/<year>/<month>/), split-complete (parse complete.md H2 sections → complete/YYYY/MM/<slug>.md rich records + append ## Original prompt), --check (active-file whose ledger entry is already in complete.md; complete-file with no ledger entry; draft with an open issue; mis-bucketed date). Mirror repos_sync.py --check exit-code convention.
  3. Brain skills (PyAutoBrain/skills/):
    • create_issue/SKILL.mdmv <path> issued/active/; "timestamp-suffix if exists in issued/" → active/.
    • ship_library/{ship_library,reference}.md + ship_workspace/{ship_workspace,reference}.md — on merge, also move the file active/<name>.md → complete/<year>/<month>/<slug>.md and write the rich record, in the same beat as the active.md → complete.md ledger move.
    • start_dev/reference.mdissued/<basename> lookup → active/; grep complete.md for ^## <candidate>$ shipped-check → scan complete/** (or generated index).
    • intake/intake.mdreconcile cross-ref against complete.md/issued/ and "retire to issued/ by hand" → new paths.
    • WORKFLOW.md, PyAutoMind/skills/OWNERSHIP.md — schema/pointer prose.
  4. Mind scripts:
    • spawn.py — glob ("issued/*","DROP")("active/*","DROP") + ("complete/**", …); adjust ("complete.md","EMPTY") for the split/retired file.
    • status.shLIFECYCLE_DIRS (issuedactive, add complete); complete_count counts complete/**/*.md not complete.md H2s.
    • prompt_sync.shgrep -v '^issued/'active/.
  5. Smoke — throwaway prompt through create_issue → active/, simulate ship → complete/YYYY/MM/, run lifecycle.py --check clean.

Implementation Steps (PR-B)

  1. Migrationlifecycle.py batch pass emits a review manifest (each issued/ file → target state + confidence); human/agent review; execute git mv + complete.md split in a committed series. Orphans → complete/unknown/, never dropped.
  2. Template parityspawn.py --write regenerate PyAutoMind-template; confirm spawn --check / spawn_drift CI green; republish.

Key Files

  • PyAutoMind/scripts/lifecycle.py — new; the move/split/check engine.
  • PyAutoMind/scripts/{spawn.py,status.sh,prompt_sync.sh} — path rewiring.
  • PyAutoBrain/skills/{create_issue,ship_library,ship_workspace,start_dev,intake}/*.md — lifecycle path rewiring.
  • PyAutoMind/complete.md (640KB, ~6000 lines) — split source.
  • PyAutoMind/issued/ (444 files) — migration source.

Traps

  • active.md - Repo lines are claims (feedback_active_md_dash_repos) — migration script must not misread them.
  • Filenames map only fuzzily to complete.md slugs — decide state by ledger cross-ref, never by name.
  • No JAX / behaviour change here; Mind-internal, so no downstream library API impact — but there IS a create_issue/ship_* behaviour change, hence the round-trip smoke.

Original Prompt

Click to expand starting prompt

See PyAutoMind/issued/lifecycle_state_split.md (moved from feature/pyautomind/ on issue creation). Original user request:

pyautomind/issued is huge and hard ot track, can we: (i) put all things not in issued in a folder called active, to make state split; (ii) make a complete folder which is for complete and separate from issued which are on going; (iii) put a folder for not yet active, e.g. drafts or thigns which are intaken but not start_dev; (iv) For complete, put them in folders by year and month in a way that appears numerically in order. As a follow up, I think we probbaly want to then build a wiki or indexing scheme for the complete folder so its really easy for an agent to look up old issues in a token light way, analogous to the wiki features used in autolens_assistant (e.g. RAG is dead).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions