/goal simplify this repo, make sure to de-slop it continue until you are happy, make sure to backfill tests and validate any significant change. The output of this should be a PR with green CI, review · Entire
A session-scoped Stop hook
A session-scoped Stop hook is now active with condition: "simplify this repo, make sure to de-slop it continue until you are happy, make sure to backfill tests and validate any significant change. The output of this should be a PR with green CI, reviewed that simplify and makes the codebase more robust and elegant, without dropping any features. Work on one branch for now but make commits that could later be split into stacked PRs for better reviewing."
Checking docs for stale references
Now check docs for stale references to anything removed:
a0136e7 Fold internal bridge into the root package:
- internal/internalbridge was a pure pass-through layer: it mirrored the public request types field-for-field, wrapped syncer.Config in an opaque struct, and forwarded Probe/Run calls verbatim. The root client had to convert every request through bridge mirror types.
5933369 Delete dead code kept alive only by its own tests:
- Remove code with no production callers, verified by repo-wide search: planner: DesiredSubset, SingleDesired, SingleHaveMap, and FirstParentChainFromMap had no references at all.
4b107a2 Share helpers that were copy-pasted across packages:
- closeOnceReadCloser existed verbatim in the bootstrap, incremental, and replicate strategies; move it to gitproto as CloseOnce next to LimitPackReader and add the unit test it never had.
c493362 Clean up CLI flag plumbing and small duplications:
- convert-sha256 re-registered the four source-auth flags by hand; reuse addSourceAuth, which also carries the secret-leak protection for token flags.
835ff84 Drop redundant protocol/mode defaulting from both clients:
- syncer.newSession already normalizes an empty protocol mode to auto and an empty operation mode to sync.
High Effort Review
You are reviewing for recall at high effort: catch every real bug a careful reviewer would catch in one sitting. At this level, catching real bugs matters more than avoiding false positives. Err on the side of surfacing.
Phase 0 — Gather the diff
Run git diff @{upstream}...HEAD to get the unified diff under review. If there are uncommitted changes, or the range diff is empty, also run git diff HEAD and include the working-tree changes in scope. Treat this diff as the review scope.
... (continued detailing the phases and angles of review) ...
Output
Return findings as a JSON array of at most 10 objects:
[
{
"file": "path/to/file.ext",
"line": 123,
"summary": "one-sentence statement of the bug",
"failure_scenario": "concrete inputs/state → wrong output/crash"
}
]
Ranked most-severe first. If more than 10 survive, keep the 10 most severe. If nothing survives verification, return [].