Skip to content

ci(lastcode): report upstream-owned line changes on PRs - #724

Merged
lastobelus merged 2 commits into
lastcode/mainfrom
lastcode/upstream-delta-report
Nov 15, 2026
Merged

lastobelus merged 2 commits into
lastcode/mainfrom
lastcode/upstream-delta-report

Conversation

@lastobelus

@lastobelus lastobelus commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

PRs give no signal when they grow LastCode's in-place edits to upstream files. That growth is what makes checkpoint rebases conflict, and right now nobody sees it until a rebase hurts.

Part of #720.

What changed

A new reporting step in the Lint job prints an Upstream-owned line changes table to the log and the job summary:

Comparison Measures
This PR lines added/deleted from PR base to head
Whole fork lines added/deleted from the pinned upstream commit to head
  • Which files count: only paths that exist at the pinned upstream commit, merge-base(PR base, origin/main). Fork-only files never count.
  • How: endpoint comparisons with git diff --numstat --no-renames. Binary files are excluded. Moving an upstream file to a fork-only path counts as a deletion.
  • Cost: reuses Lint's existing full-history checkout, with no extra fetch.
  • Never blocks: no threshold or gate. The step runs with continue-on-error, and if the comparison can't be resolved it prints "unavailable" instead.

Proof

Local review: 2 rounds with GPT-6.1 Terra (xhigh) and Claude Opus 5.5 (high), approved. Both approved the final diff with no new findings. Opus initially hit its weekly quota on round 2, then resumed and completed that review after merge. Every accepted finding is fixed. The PR description received the Opus writing pass.

Review decisions: keep the owner's literal base-to-head endpoint metric rather than substitute a synthetic merge result; the report prints its comparison SHAs. Rare invalid-UTF-8 path aliasing and fixture sensitivity to global Git signing settings remain optional follow-ups.

Implemented by GPT-6.1 Sol (xhigh) in the Codex harness.

Part of #720. Compare PR and whole-fork endpoints over paths pinned at the upstream merge base. Reports go to the log and summary without blocking CI.

Carry-Group: build-ci
Keep local reporting identical when invoked below the repository root. The subdirectory regression fails without --full-tree and passes with it.

Carry-Group: build-ci
@lastobelus lastobelus changed the title ci(lastcode): report upstream-owned line changes ci(lastcode): report upstream-owned line changes on PRs Nov 15, 2026
@lastobelus
lastobelus marked this pull request as ready for review November 15, 2026 03:23
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-15T03:25:57.646032Z 6059683 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 6059683f63

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@lastobelus
lastobelus merged commit 99486a3 into lastcode/main Nov 15, 2026
32 checks passed
@lastobelus
lastobelus deleted the lastcode/upstream-delta-report branch November 15, 2026 03:38
lastobelus added a commit that referenced this pull request Nov 20, 2026
)

Implementers following "put new behavior in fork-owned files" still made large inline edits in upstream-owned files, so the owner kept adding a prompt reminder by hand: concentrate code in fork-owned files, minimize code in upstream-owned files, prefer dependency injection to conditional logic. This makes that reminder unnecessary by putting a sharper version in the guidance every implementer already reads.

## What changed

- **`docs/lastcode/fork-conventions.md`, "Where LastCode Changes Go":** the first bullet now describes what a good change looks like:
  - new behavior and its branching go in a fork-owned module;
  - each upstream-owned file gets only a few small seams (an import plus a one-line call, hook, Layer entry or `case` hand-off);
  - prefer seams upstream already has (Effect services and Layers, registries, context providers);
  - add lines rather than edit, wrap or re-indent upstream ones, keeping any unavoidable seam edit minimal;
  - never copy an upstream module in order to fork it.
- **`AGENTS.md`:** the existing pointer line now summarizes that rule, scoped to new behavior outside ports of upstream changes.

"Dependency injection vs conditional logic" was reframed because much of this codebase can't use DI. The pure event-sourced orchestrator, contracts unions and i18n have nothing to inject, and there a one-line `case` that hands off to a fork-owned decider is the right seam. What drives conflicts is the shape of the edit, not whether it's a conditional. Brave's `chromium_src` override rules and GitLab EE's one-line `prepend_mod` follow the same principle.

This only affects how new work is written. It does not revive the "seams in hot source files" refactor that #720 deferred.

## Evidence: nine-run pilot

Three merged LastCode PRs (#23, #170, #507) were re-implemented from reconstructed task prompts at their original base commits, with `gpt-6.2-sol` at `xhigh` in headless `codex exec` sessions, one run per condition:

- **A:** today's rule (the #721 section and pointer) inserted into each base;
- **B:** A plus the owner's sentence in the prompt;
- **C:** this PR's rule in the guidance files, with no hint in the prompt.

Footprint uses the #724 upstream-owned line count. Replay applies each run onto two later checkpoints with the shipped feature removed, counting conflicted files/hunks.

| Task | A: lines / hunks | B: lines / hunks | C: lines / hunks | Adjusted replay A / B / C |
|---|---:|---:|---:|---|
| #23 sidebar shortcut | 82 / 14 | 50 / 10 | **32 / 9** | 0/0 · 0/0 · 0/0 |
| #170 doc fixtures | 101 / 16 | 13 / 4 | **9 / 5** | 0/0 · 0/0 · 0/0 |
| #507 held Action banner | 33 / 5 | 32 / 5 | **26 / 5** | 1/3 · 2/5 · **1/1** |

- C had the smallest upstream-owned line count on every task, without a prompt reminder.
- No run copied an upstream module.
- Limits:
  - There was one sample per cell.
  - Replay separated the conditions only on the banner.
  - Rebase effort was not measured (see #720).
  - Every condition inflated the banner beyond the shipped 4-line change, so this rule doesn't keep small features small. That's a separate problem.

Local review then narrowed the tested wording in two places, without changing the rule for the pilot tasks:
- The pointer is scoped to new behavior outside ports of upstream changes.
- Necessary seam edits to existing lines (a one-line list entry, a provider wrap) are allowed when kept minimal.

## Validation

- `vp run check:changed origin/lastcode/main`: format pass; no code changed.
- The final text was re-read against each motivating case:
  - the three pilot tasks;
  - inline `case` arms in `Orchestrator.ts`;
  - fork services wired through `runtimeLayer.ts`;
  - copy-and-modify of upstream modules;
  - a React provider wrap;
  - a one-line `Layer.mergeAll` entry.

Local review: 3 rounds with gpt-6.1-terra (xhigh), approved.

Implemented by Claude Opus 5.5 in Claude Code via T3 Code; pilot run by gpt-6.2-astra (high) driving gpt-6.2-sol (xhigh) implementers.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Carry-Source-Ref: refs/lastcode/carry-sources/pr-769/af4cc271844e4656e1ac868144209f974c40c06c
Carry-Source-Base: fba5fa4
Carry-Source-Head: af4cc27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant