Skip to content

Add a checked port-patch ledger for upstream divergences #105

Closed as not planned

Description

@ericlitman

Current scope (maintainer, 2026-10-20)

Unscheduled. Re-measured on 2026-10-20 against Cursor pstack 0.15.29 (88d4751): 6 files verbatim, 3 clean merges, 3 needing review, 14 unmapped. That is down from 28 needing review at 0.15.25. At most 1 or 2 of the 3 review files are rule-shaped, and the static invariants in tests/skill-collision-repro.sh already guard the key divergences.

Build condition: a merge rehearsal that needs review on more than 10 files with at least a third of them rule-shaped, or a sync that drops a port divergence that the static invariants miss. scripts/upstream-audit.py, scripts/upstream-merge.py and the ledger file then need nonRuntime mappings in .claude/skills/verify-open-pstack/features/registry.json.

Original request

Goal

Record every intentional divergence from Cursor pstack in a checked-in ledger that the merge tooling applies and verifies.

Why (updated 2026-10-12)

Proposed shape

A machine-readable ledger with two kinds of entry:

  • Rules. Substitutions and excluded lines, each with a pattern, files, reason and issue. scripts/upstream-merge.py applies them to both upstream blobs before git merge-file, so a conflict caused only by a known rule merges clean.
  • Patches. Hunks the port keeps, each with an anchor, reason and issue. A check verifies them after the merge.

The 3-of-10 estimate comes from one small sample. Measure it again on the next sync.

Acceptance criteria

  • The ledger lists each divergence with its file or glob, anchor or rule, reason and issue.
  • upstream-merge.py applies rule entries before the three-way merge. Replaying the 0.15.20 merge from the pre-sync main commit leaves fewer conflicts with the ledger than without it, and the PR reports both counts.
  • A check run in CI fails when a ledgered divergence no longer holds after a merge, or when a port file differs from upstream with no ledger entry.
  • The exclusion list in UPSTREAM.md is generated from the ledger or checked against it.
  • Bun tests, strict typecheck, static invariants and plugin validation pass. This is repository tooling with no plugin runtime change, and the live gate records that.

Order

After #157 (registry U3), so that model slugs need no ledger entries. #106 depends on this issue.

Source: docs/plans/2026-10-01-triage-and-roadmap.md, section 3, item 3, and triage 2026-10-12.

Activity

  1. ericlitman commented on Oct 21, 2026

    @ericlitman
    OwnerAuthor

    Not planned. The 0.15.29 sync needed review on 3 files, and on 2026-10-21 main is level with Cursor's pstack: the audit finds nothing to merge. The static invariants in tests/skill-collision-repro.sh guard the key divergences. Reopen this when a merge rehearsal needs review on more than 10 files, or when a sync drops a port divergence that the static invariants miss.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions