Skip to content

docs(lastcode): keep fork changes to small seams in upstream files - #769

Merged
lastobelus merged 3 commits into
lastcode/mainfrom
lastcode/fork-footprint-rule
Nov 20, 2026
Merged

lastobelus merged 3 commits into
lastcode/mainfrom
lastcode/fork-footprint-rule

Conversation

@lastobelus

@lastobelus lastobelus commented Nov 20, 2026 •

Copy link
Copy Markdown
Owner

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:

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:

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

lastobelus and others added 3 commits November 19, 2026 22:20
Implementers following "put new behavior in fork-owned files" still wrote
large inline edits in upstream-owned files. Spell out the seam shape: logic
in a fork-owned module, one-line hand-offs in upstream files, upstream's own
injection points first, no re-indenting, no copied upstream modules.

Carry-Group: tooling
Carry-Observation: The rule lives in docs/lastcode/fork-conventions.md; AGENTS.md carries a single pointer line directly under "Extend before you add". A nine-run pilot (three historical LastCode PRs, today's rule vs owner prompt vs this rule) found this wording gave the smallest upstream-owned footprint on every task without any prompt reminder.

Co-Authored-By: Claude <[email protected]>
@lastobelus
lastobelus marked this pull request as ready for review November 20, 2026 05:26
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 20, 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-20T05:28:37.322447Z af4cc27 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. Breezy!

Reviewed commit: af4cc27184

ℹ️ 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 3e23232 into lastcode/main Nov 20, 2026
46 of 49 checks passed
@lastobelus
lastobelus deleted the lastcode/fork-footprint-rule branch November 20, 2026 05:33
lastobelus added a commit that referenced this pull request Nov 20, 2026
The **Prepare Dependencies** Action only prepares the checkout of the thread that launches it, and `run_project_action_and_resume` takes no target. A checkout no thread owns, such as a `git worktree add` checkout or an eval's historical base, had no sanctioned way to get dependencies: `AGENTS.md` says to use the Action, and delegated children hand every Action to their parent. In the #769 pilot, an eval child stalled asking its parent to prepare three scratch checkouts, and the parent could not target them.

## Fix

One new bullet in `AGENTS.md` Dev servers, right after "Need a second checkout?": whoever uses a checkout no thread owns prepares it directly, delegated children included. Run `node scripts/prepare-dependencies.ts` from inside it, or `pnpm install --frozen-lockfile` with its pinned pnpm where the checkout has no such script.

Thread-owned checkouts still use the Action, and children still hand Actions for their own checkout to the parent. It's an added line, with no edits to existing ones.

## Validation

- `vp run check:changed origin/lastcode/main`: format pass; no code changed.
- `node scripts/prepare-dependencies.ts` run directly in a checkout verified the pinned pnpm, installed, and reported `dependencies-installed`.
- Re-read against the motivating case, the pilot child's three scratch bases: the new bullet covers them, and the child would no longer need a handoff.

Local review: 1 round with gpt-6.1-terra (xhigh), approved.

Implemented by Claude Opus 5.5 in Claude Code via T3 Code.

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

Carry-Source-Ref: refs/lastcode/carry-sources/pr-798/5ce4d556c9d65b183ca4dddde58b87ae3e0bee5f
Carry-Source-Base: 27b1e62
Carry-Source-Head: 5ce4d55
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