Skip to content

Restatement guard: mark the ledger on git pull/checkout of the model #504

Closed

Description

@MendixMau

Follow-up from #269 / PR #498 (restatement guard).

The last-writer ledger (.claude/loop/script-owners/written.tsv) is machine-local and only sees exec.sh writes. A git pull or git checkout that brings newer .mpr work in after a local exec leaves the ledger saying "S wrote last", so a replay of S over that newer work stays quiet (reproduced in review: a ledger holding only 05, model carrying 09's work, replay 05 → rc 0, no output).

Proposal: a post-merge / post-checkout hook installed by install-project-hooks.sh that appends a RESTORE row to the ledger whenever mprcontents/ (or the .mpr) changed. so_last_writer already ignores rows before the last RESTORE, so the next replay falls back to DESCRIBE (capped at 5 per exec).

Also from the same review, optional: have restore-mpr.sh take the exec lock so a manual restore during an exec cannot lose its RESTORE row in the compaction window.


Generated by Claude Code

Activity

  1. MendixMau commented on Oct 26, 2026

    @MendixMau
    OwnerAuthor

    Fixed in #578 (squash a088b4e): post-merge and post-checkout hooks write a RESTORE git-<hook> row when a pull or checkout touched the model. They:

    • chain any existing hook;
    • never block git;
    • install on the next sync.

    With core.hooksPath set, the installer prints the snippet to add. restore-mpr.sh taking the exec lock waits on draft #379.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions