Repository navigation
fix(fix): assisted Stripe fixes on real repositories - #87
Merged
Merged
Conversation
Found on boxyhq/saas-starter-kit at abc9b68, where `fix stripe` ended with 0 agent fixes, types 4 -> 4 and "baseline tests failed". - Import guidance: the helper's specifier is written the way the file's neighbours write imports (a tsconfig `paths` alias they already use, else an extensionless relative path; .js/.ts only where the repo does). The guide suggests it and no longer requires a spelling; compiling decides. The `.ts` it mandated failed TS5097. - Diagnostics are compared through the edit's line moves, so an import added above a pre-existing error no longer makes that error "new". Used by agent acceptance and by fix, pin, reverify and the action. - Sites of the same change in one file go to the agent as one task with every enclosing function shown, and are accepted together; each keeps its report entry. - Jest: affected files come before the array-valued --testPathIgnorePatterns, which swallowed them. When a related-tests run fails before any test, or finds none, the repository's own suite runs; the report shows the scoped command and its output. - Reports print the published CLI version, not the engine's 0.1.0. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01B2T8GmEVnZwfNrugajEMqi Signed-off-by: Claude <[email protected]>
lucasbraum
added a commit
that referenced
this pull request
Oct 12, 2026
#87 fixed the jest argument order and the related-tests fallback on main, and matches diagnostics across line moves (gitLineMoves). Main's versions are kept; this branch's duplicate jest fix and its changeset are dropped. The SDK gate now uses gitLineMoves too, so a task that passes its gate is judged the same way by the final verdict; newDiagnosticsAcrossShifts is gone. The incremental typeChecker and the related-tests mode for the SDK gates are kept on top of main's verify.ts. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Lucas Braum <[email protected]>
Merged
This was referenced Oct 13, 2026
lucasbraum
added a commit
that referenced
this pull request
Oct 13, 2026
…ace (#96) ## What and why #87 sends manual sites of the same rule in one file to the patch agent as one task. But the task can edit only the first site's related declarations. On alanagoyal/alanagoyal @ 22aa5f1 (React 19), `components/apps/notes/notes-app.tsx` has two `RefObject<HTMLDivElement | null>` errors, at lines 91 and 119. Their fixes live in two different files: the `containerRef` prop types of the mobile presenter and of the desktop presenter. Grouped, the agent could reach only the mobile one, and the task is accepted only when both errors are gone. It answered "No patch submitted" three times, and both sites stayed manual. The default agent went from 12/12 sites and 3/3 verified before #87 to 10/12 and 0/3 after. Sites now group only when they share both: - **the root cause:** the same rule, or the same change path when there is no rule (as before); - **the likely fix location:** the same repository declarations behind their compiler errors, or none. saas-starter-kit's two period reads (#87's case) link to no repository declaration, so they still go out as one task. Two prop types in two files are two tasks. ## Test `related-declaration.test.ts` reproduces the alanagoyal layout with the real compiler: - two presenters' prop files and one call site with two TS2322 errors of the same rule; - a fixer that widens whatever prop types its request lets it edit. It expects two requests (`mobile.ts`, then `desktop.ts`) and both sites fixed. Against main's `assisted.ts` it fails with three requests, all limited to `mobile.ts`. #87's grouping test still passes. `pnpm typecheck`, `pnpm lint` and `pnpm public:check` pass, and `pnpm test` gives CLI 413 passed and core 1,290 passed. The one core failure was an assisted test that timed out in the full parallel run, with the machine at load 15 under another benchmark. It passes alone and with its file, and it doesn't exercise grouping. ## alanagoyal, default agent, 3 runs **Pending**, run once the machine is quiet. Target: 12/12 sites, 3/3 verified. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Signed-off-by: Lucas Braum <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
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.
What and why
On boxyhq/saas-starter-kit at
abc9b68,uptide fix stripe --max-cost 3ended with 5 manual sites, 0 agent fixes, types 4 → 4, and "baseline tests failed", even thoughnpm testpasses there. This PR fixes the five causes.Import guidance. The guide required
import { subscriptionPeriod } from "../../../lib/stripe.ts", which fails with TS5097. A newimportSpecifier(packs/import-specifier.ts) picks the specifier in this order:pathsalias that the file or its neighbours already import through (extendsis followed). Here that gives@/lib/stripe, because the file already imports@/lib/env..jsonly when the file's own relative imports use it, or the module resolution (node16/nodenext) requires an extension..tsonly when the file's relative imports use it andallowImportingTsExtensions(orrewriteRelativeImportExtensions) is set.The guide now offers this spelling as a suggestion, not a requirement: any specifier that resolves to the module and compiles is accepted. The Stripe API-version follow-up import (
clientPins) uses the same function.Diagnostics across line shifts.
newDiagnosticsnow takesLineMoves, the old line → new line mapping for the lines an edit kept, built from a common head/tail plus an LCS of the middle. A pre-existing error that an added import moves from line 86 to 87 now matches its old self. Lines the edit changed are never remapped, so any error on them still counts as new. Agent acceptance uses this mapping, including the check that a site's own diagnostic is really gone and not just shifted.fix,pin,reverifyand the action use it too, viagitLineMoves.Group sites. Manual sites in the same file with the same rule (or the same change path, when no rule is set) now go to the agent as one task:
sharedDiagnostics, and every enclosing function is in the context;Also in this item:
diagnosticFornow breaks ties on the message. Line 117 carries two TS2339 errors (_startand_end), and both sites used to pick the same one.Baseline tests. The cause was argument order, not
sync-stripe.js. Jest reads--testPathIgnorePatternsas an array, so it swallowed the files that followed it, and Jest then failed with "The --findRelatedTests option requires file paths to be specified." Files now come right after--findRelatedTests. When a related-tests run fails before running any test, or finds no related test, the repository's own suite runs instead: itstestscript (afterpretestwhen relevant), or the unit-test run over the workspace when service tests are excluded. A failing test is never re-run under a wider command. The report says which command failed or found nothing, shows its output (last 40 lines), and names what ran instead.Version. Reports showed the private engine's 0.1.0. They now show the published CLI version: the value of
__UPTIDE_CLI_VERSION__in the bundle, orpackages/cli/package.jsonwhen run from source.How it was verified
pnpm lint,pnpm typecheckandpnpm testall pass: core 1203 passed / 28 skipped, CLI 393 passed.New tests:
import-specifier.test.ts: alias used by the file, alias used by a neighbour throughextends, extensionless,.tsonly when allowed,.js, nodenext.saas-starter-kit
abc9b68with the built CLI,fix stripe --max-cost 3, no--pr:pages/api/webhooks/stripe.ts:@/lib/stripe.To exercise the agent path without a key, I ran the real
fixpipeline on a copy of the repo with a scripted fixer that edits the way the guide asks:import { subscriptionPeriod } from '@/lib/stripe'above the pre-existing errors and was accepted;This shows grouping, line-shift matching and the specifier working together. It does not show what a real model writes. That still needs a run with a key:
npx uptide fix stripe --max-cost 3on that commit.Checklist
🤖 Generated with Claude Code
https://claude.ai/code/session_01B2T8GmEVnZwfNrugajEMqi
Generated by Claude Code