Skip to content

fix(mind): record --apply auto-regenerates complete/index.md - #97

Merged
Jammy2211 merged 2 commits into
mainfrom
feature/mind-lifecycle-auto-index
Jul 24, 2026
Merged

fix(mind): record --apply auto-regenerates complete/index.md#97
Jammy2211 merged 2 commits into
mainfrom
feature/mind-lifecycle-auto-index

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Problem

The Lifecycle Drift workflow runs lifecycle.py index --check on every push to main touching complete/**. Because Mind pushes go directly to main (no PR to pre-catch drift), a stale complete/index.md fails the run and emails the maintainer — every time a shipped record lands.

Root cause: record --apply writes + stages the completion record but leaves the index stale. The separate index --apply step is documented in the ship skills but gets forgotten. (It happened again live today: dpie-simulator-port shipped without a regen.)

Fix

Fold the index regeneration into cmd_record's --apply branch — regenerate via the existing _render_index/_existing_curated helpers, write complete/index.md, and git add it. Same effect as index --apply, but it can no longer drift from the record write.

Behaviour-preserving except that record --apply now also freshens the index.

Test

Ran record <slug> --apply on a throwaway record: both the record and a refreshed complete/index.md were staged, and index --check passed. Reverted the scratch record.

🤖 Generated with Claude Code

Jammy2211 and others added 2 commits July 24, 2026 15:32
record --apply wrote the completion record but left complete/index.md stale;
the separate `index --apply` step (documented in the ship skills) was easy to
forget, so the Lifecycle Drift workflow failed on every push to main landing a
record and emailed the maintainer. Fold the index regen + git-add into
cmd_record's --apply branch so the two can't drift apart.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Jammy2211
Jammy2211 merged commit f615c10 into main Jul 24, 2026
1 check passed
@Jammy2211
Jammy2211 deleted the feature/mind-lifecycle-auto-index branch July 24, 2026 14:44
Jammy2211 pushed a commit that referenced this pull request Jul 24, 2026
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Jammy2211 pushed a commit that referenced this pull request Jul 30, 2026
The Lifecycle Drift guard has emailed a failure on every push to main since
2026-07-28: vacuous-jax-assertions shipped (record written, index refreshed
per PR #97) but its '## vacuous-jax-assertions' section was never removed
from the active.md registry — that edit was still a separate manual step in
the ship skills, and it was forgotten. Same failure shape as the index drift
PR #97 fixed, one file over.

Fold the registry prune into cmd_record --apply (new _prune_ledger_section:
drops the H2 section through the next H2/EOF, matched via safe_name), stage
active.md alongside the record, and announce the pending prune in dry-run
output. Also clears the current red by pruning the stale
vacuous-jax-assertions section (both PRs merged 2026-07-28, issue closed).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant