Repository navigation
ci(lastcode): report upstream-owned line changes on PRs - #724
Merged
Merged
Conversation
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
marked this pull request as ready for review
November 15, 2026 03:23
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Owner
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
merge-base(PR base, origin/main). Fork-only files never count.git diff --numstat --no-renames. Binary files are excluded. Moving an upstream file to a fork-only path counts as a deletion.continue-on-error, and if the comparison can't be resolved it prints "unavailable" instead.Proof
git diff --numstaton real PRs:ls-tree --full-treeand passes after the fix.check:changedpassed: format, lint, knip, 41 affected typechecks, tests.6059683f631877765e539d7db581babba9ef41cfagainst base217eac9e1863a9819e5d99efc97392c0c7b8d5c5.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.