Add explicit flush to append_entry and strengthen commit ordering docs

Add file.flush() call in append_entry() to ensure planner history
entries are written to disk before git commits execute. While the
file handle drop should flush, explicit flush simplifies reasoning
about the ordering invariant.

Extend code comments in stage_and_commit() to document that the
write_git_commit-before-git::commit ordering has regressed multiple
times and must be preserved in any refactoring.

Requirements: completed_requirements_2025-12-11_10-05-08.md
This commit is contained in:
Jochen
2025-12-11 10:05:39 +11:00
parent b3ac7746b9
commit 1a13fc5345
8 changed files with 323 additions and 14 deletions

View File

@@ -91,3 +91,17 @@
>>
2025-12-10 16:54:45 USER SKIPPED RECOVERY
2025-12-10 16:55:05 - COMPLETED REQUIREMENTS (completed_requirements_2025-12-10_16-55-05.md, completed_todo_2025-12-10_16-55-05.md)
2025-12-10 16:55:24 - GIT COMMIT (Preserve planner history ordering and add regression guardrails)
2025-12-10 17:02:30 - REFINING REQUIREMENTS (new_requirements.md)
2025-12-10 17:05:46 - GIT HEAD (b3ac7746b94aa96c29e364a382a81716973b0217)
2025-12-10 17:05:49 - START IMPLEMENTING (current_requirements.md)
<<
Ensure `write_git_commit` is always called before any git commit and treated as a hard invariant.
Confirm `append_entry` matches the described implementation, decide on flush semantics, and document that its not ...
Use git history to verify past regressions were due to call ordering, then update the external explanation accordingl...
Perform an endtoend planner test in `/tmp/commit_test` and record commands plus the final `GIT COMMIT` history ...
Strengthen comments, tests, and helper APIs so plannermode commits cannot bypass the historybeforecommit ord...
>>
2025-12-11 10:05:02 USER SKIPPED RECOVERY
2025-12-11 10:05:08 - COMPLETED REQUIREMENTS (completed_requirements_2025-12-11_10-05-08.md, completed_todo_2025-12-11_10-05-08.md)
2025-12-11 10:05:39 - GIT COMMIT (Add explicit flush to append_entry and strengthen commit ordering docs)