Skip to content

feat: diffx-fetcher with leased, repo-scoped pull request fetches - #116

Merged
flexdinesh merged 1 commit into
github-pr-appfrom
github-pr-fetcher
Oct 25, 2026
Merged

flexdinesh merged 1 commit into
github-pr-appfrom
github-pr-fetcher

Conversation

@flexdinesh

@flexdinesh flexdinesh commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

Stack 3/4: diffx-fetcher and leased, repo-scoped fetches.

  • Behavior owner and resulting change: githubsync leases coalesced refresh intent (Lease/Finish), reads the PR and mints a contents:read token scoped to that repository, and authors the observation itself (identity, labels, pullRequest, deterministic submission ID; Resync run makes it fresh). Fan-out admits every verified follower in one transaction with lease completion. New internal/fetchprotocol, internal/fetcher and cmd/diffx-fetcher: partial-clone mirrors, changed-blob prefetch, offline collection under GIT_NO_LAZY_FETCH, hardened git env, LRU disk cap (20 GiB default).
  • Contracts/invariants affected; local/remote implications: internal listener DIFFX_SERVER_INTERNAL_PORT (default 7979, same host as public, never published) authenticated by DIFFX_SERVER_FETCHER_SECRET (≥32 chars, required with GitHub). Results accepted only for the current lease token and leased head/base SHAs; failures back off 1 min → 1 h. Server image stays scratch; fetcher is a separate Alpine target behind compose profile github.
  • Validation results; remaining risks: mise run check passes. Lease/fan-out tests (generation, retention-run and base-SHA guards mutation-checked); fetcher tests on a real git origin; end-to-end test git origin → fetcher → lease/finish → stored review. Real binaries: internal port 401/401/204/409, public port refuses, fetcher polls. Images built. Risks: collector 30 s timeout for huge PRs; no proxy/CA passthrough; corrupt mirror needs manual removal.
  • Intentional architecture/design changes and rationale: intent row is leased directly instead of a separate fetch-job table (one durable record per PR). Documented in docs/system.md, docs/architecture.md, docs/development.md.
  • UI evidence: n/a.

Server leases coalesced refresh intent on an internal listener with a shared
secret and a contents:read installation token; diffx-fetcher mirrors with
partial clones and collects offline; the server authors the observation and
admits it to every verified follower atomically with lease completion.
@flexdinesh
flexdinesh added this pull request to stack #118 October 25, 2026 05:19
@flexdinesh flexdinesh changed the title feat: GitHub pull request fetcher with leased, repo-scoped fetches feat: diffx-fetcher with leased, repo-scoped pull request fetches Oct 25, 2026
@flexdinesh
flexdinesh marked this pull request as ready for review October 25, 2026 06:33
@flexdinesh
flexdinesh merged commit 93b96de into main Oct 25, 2026
2 checks passed
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