Skip to content

Semantic diff at the pull-request level: initial concepts #8910

Open

Description

@cristianoc

Commit records (#8908) give each commit a message that describes its change in the change's own form: a parse tree, Lambda, generated JavaScript, a diagnostic, a typing rule or a clause matrix. The Semantic Diff page draws those forms. This issue collects the initial concepts for the pull-request level. They will be refined, and details added, as the commit level is used.

Concepts

  1. A PR's page is its commits' cards. This works today: the page linked on each PR draws every commit in the PR's range.
  2. Aggregation. One view of the PR as a whole: for each object its commits change, the form at the PR's base and at its head, merged from the commits' blocks. A reviewer reads the net change; the per-commit cards remain one click away.
  3. Facts from the PR's diff. Areas touched, tests added or changed, committed generated JavaScript, magic-number bumps for marshaled types, v0 PPX bridge fixtures, and changelog fragments with their validity. These are computed from the whole diff and shown beside the aggregated view, kept apart from what authors write.
  4. Verification. CI can regenerate a declared form from builds of the base and the head and compare it with the form written in the message, flagging a form that no longer matches the code. The head is already built by CI, and the base build can come from master's CI artifacts.
  5. Text written once per PR. The PR's purpose and its review answers have no commit of their own. Candidates: the PR description, or a versioned file in the diff such as the changes/<name>.record (or YAML) proposed in Draw commit records as semantic diffs of the compiler's objects #8882.
  6. What reaches master. The repository squash-merges, and the squash message concatenates the commit messages, so the forms reach history. The page stays archived at cdn.rescript-lang.org/semantic-diff/pr-<N>/.

Open questions

  • Which of these the page shows by default, and which on demand.
  • Whether verification (4) is a warning or a required check.
  • Where PR-level text lives (5), and whether changelog entries move into it.
  • How a stack is drawn: each PR against the PR below it, or the whole stack.

🤖 Generated with Claude Code

Activity

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