Skip to content

The notes mirror is written locally and never leaves the machine, so a teammate's clone cannot see a record it holds #416

Description

@MongLong0214

What happens today

commitlore init installs the post-commit hook, and records that reach refs/notes/commitlore — backfill output, squash inheritance, anything attached after the fact — are written there correctly.

Nothing ever pushes that ref.

doctor --fix writes the fetch refspec, so a clone that runs it receives notes on the next git fetch. But the machine that wrote the note has no path to send it. The mirror is one-directional in the wrong direction: everyone can read what nobody can publish.

PRD-F3 lists "confirm round-trip notes synchronization between teammates" as an acceptance item. The round trip has no second half.

Why it matters more now

The product direction is that CommitLore runs in the background after one install, with no separate user commands. A record that exists only on the machine that produced it fails that on the most basic reading: the teammate whose agent is about to revive a rejected decision is exactly the person who cannot see the record.

Constraints this has to respect

  • notesAvailability reads git config only — no network, no fetch. That is deliberate and documented in src/core/notes.ts. The read path must stay offline; the PreToolUse hook has a latency budget and a network call in it would be felt on every edit.
  • A hook must never break the git operation it sits next to. post-commit exits 0 unconditionally; capture "is never allowed to block the commit it sits next to". A failed notes push must not fail a code push.
  • No surprise network. Pushing to a remote on every commit is not something a user asked for. The push should ride an operation the user already initiated.

Proposal

  1. commitlore sync — the primitive. Fetch the notes ref, merge if the remote moved, push. Fail-closed on an unclean merge: report and change nothing.
  2. A pre-push hook that runs it. When the user pushes their branch, the notes go with it. No extra command, no network the user did not ask for, and it exits 0 whatever happens so a notes failure cannot block a code push.

Fetch needs nothing new: the refspec init already writes carries notes in on any git fetch.

Note for whoever implements it

git notes merge defaults to manual and the union strategy is cat_sort_uniq, which concatenates two writers' notes into one blob. #409 covers the trust consequence of that — a merged note is now graded against every identity that has written it, keeping the floor — so a union merge is safe but will hold the merged note at claim. That is the correct outcome and should be stated where a user can find it, not discovered.

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