Skip to main content

Github Local Mirror

@evrardjp/github-local-mirrorv2026.07.29.1· 1mo agoMODELSREPORTS
01README

Swamp-backed local GitHub mirror: keeps a local git object cache plus queryable Swamp metadata for PRs, issues, comments, reviews, checks, patch revisions, and local development or review worktrees.

02Release Notes

2026.07.29.1

Fixed: The PR context report now prefers the canonical current mirror-state artifact, preventing stale synchronization dates from historical data names.

Upgrade note: No migration is required. Historical mirror-state artifacts remain supported when the canonical artifact is absent.

03Models1
@evrardjp/github-local-mirrorv2026.07.29.1github_local_mirror.ts

Global Arguments

ArgumentTypeDescription
ownerstring
repostring
githubToken?string
gitObjectPathstringPath to the managed bare git object repository used by the mirror
workspaceRootstringDirectory where prepare_worktree creates editable worktrees
artifactRootstringDirectory where sync stores durable mirror artifacts and cursors
gitRemotestring
gitRemoteUrl?string
sshRemoteBasestring
syncOverlapMinutesnumber
firstSyncSince?string
knownRemotesrecord
timelineCodeGranularityenum
needsClarificationLabelsarray
reviewerHandlesarray
reviewFocusStaleDaysnumber
maxApiPagesnumber
fn sync(budgetSeconds?: number, requireComplete?: boolean)
Fetch GitHub refs plus full PR/issue metadata into the local mirror and Swamp index
ArgumentTypeDescription
budgetSeconds?number
requireComplete?boolean
fn prepare_worktree(prNumber: number, identity?: string)
Create an editable local worktree for the latest mirrored PR head without calling GitHub
ArgumentTypeDescription
prNumbernumber
identity?string
fn create_worktree(prNumber?: number, branch?: string, baseRef?: string, identity?: string)
Create a review worktree from a mirrored PR or a development worktree from a local ref
ArgumentTypeDescription
prNumber?number
branch?string
baseRef?string
identity?string
fn attach_worktree(worktreeId: string, prNumber: number)
Associate an active registered worktree with a locally mirrored pull request
ArgumentTypeDescription
worktreeIdstring
prNumbernumber
fn detach_worktree(worktreeId: string)
Remove only the pull request association from a worktree
ArgumentTypeDescription
worktreeIdstring
fn remove_worktree(worktreeId: string, force: boolean, deleteBranch: boolean)
Remove a registered worktree after checking local changes and commits
ArgumentTypeDescription
worktreeIdstring
forceboolean
deleteBranchboolean
fn prepare_review_context(subjectType: enum, number: number)
Validate a mirrored review subject and refresh local worktree evidence
ArgumentTypeDescription
subjectTypeenum
numbernumber
fn record_pr_analysis(prNumber: number, headSha: string, generator: string, codePathWalkthrough: string, reviewAttentionMap: string, evidenceRefs: array)
Record generated review evidence for the current PR head
ArgumentTypeDescription
prNumbernumber
headShastring
generatorstring
codePathWalkthroughstring
reviewAttentionMapstring
evidenceRefsarray
fn analyze_worktrees()
Analyze registered worktrees for stale PR heads, dirty state, missing paths, and local commits
fn close_merged_worktrees()
Remove non-dirty worktrees for merged pull requests while retaining their review branches
fn refresh_pr_worktrees(identity?: string, autoAttach: boolean, materialize: boolean, dryRun: boolean)
Reconcile tracked PR worktree lineages against current local mirror state
ArgumentTypeDescription
identity?string
autoAttachboolean
materializeboolean
dryRunboolean
fn status()
Write and return the current local mirror status summary

Resources

mirrorState(infinite)— Durable mirror cursors and sync state
repoSnapshot(infinite)— GitHub repository metadata snapshot
prSnapshot(infinite)— Pull request snapshot with branch, state, and remote metadata
prRevision(infinite)— Observed PR head revision and local patch artifact references
prHeadState(infinite)— Current PR head read from the fetched local Git ref
prFileSnapshot(infinite)— Changed file metadata for one PR revision
issueSnapshot(infinite)— Issue snapshot
activityEvent(infinite)— Issue/PR comments, reviews, review comments, and timeline events
subjectReference(infinite)— References between mirrored GitHub subjects
prCommit(infinite)— Commit belonging to a pull request
collectionStatus(infinite)— Completeness status for a GitHub API subcollection
prAnalysisEvidence(infinite)— Generated review context tied to an exact PR head
reviewSelection(infinite)— PR or issue selected for the current context report
checkRunSnapshot(infinite)— GitHub check run status for PR heads
worktreeSnapshot(infinite)— Registered local development or review worktree
worktreeAnalysis(infinite)— Automated analysis of local worktree freshness and state
worktreeCleanupRun(infinite)— Results from one merged pull request worktree cleanup run
worktreeRefreshRun(infinite)— Actions performed by one PR worktree reconciliation run
syncRunSummary(infinite)— One sync run summary
mirrorStatus(infinite)— Current mirror status summary
04Reports3
@evrardjp/github-local-mirror-statusmodel
github_local_mirror_status.ts

Summarize sync freshness, local mirror paths, and registered worktree state for a GitHub local mirror model.

@evrardjp/github-pr-contextmodel
github_pr_context.ts

Render a complete local-mirror PR or issue context cluster, readiness, timeline, worktree state, and analysis evidence.

@evrardjp/github-repo-review-focusmodel
github_repo_review_focus.ts

Build a deterministic repository-wide reviewer action queue from stored local-mirror data.

05Previous Versions8
2026.07.24.1

2026.07.24.1

Added: create_worktree can register development worktrees from a local base ref before a pull request exists. attach_worktree, detach_worktree, and remove_worktree provide explicit lifecycle operations without conflating PR association with filesystem state.

Added: refresh_pr_worktrees uniquely attaches matching development worktrees, retains superseded PR revisions, materializes missing current revisions for tracked identity lineages, and safely removes merged-PR worktrees.

Changed: Worktree analysis and status now include creation provenance, optional PR association, current branch and HEAD, upstream configuration, revision state, and unambiguous PR attachment candidates.

Changed: sync accepts requireComplete=true so workflows can stop before worktree reconciliation when synchronization returns partial results.

Changed: Development worktrees now default to the mirrored repository's symbolic HEAD, and sync preserves their registered local branches instead of reconciling those branches as mirror-owned refs. Creation rejects branch names already owned by the configured mirror.

Fixed: Concurrent worktree lifecycle methods no longer lose registry updates, interrupted PR-head materialization remains registered for retry, and missing checkouts cannot delete ahead branches without explicit force.

Fixed: Identity-specific review worktrees use collision-resistant names and resource IDs, while existing unhashed identity worktrees remain idempotent.

Fixed: Retrying review preparation preserves local descendant commits, and sync keeps exact-name upstream branches local-owned while still rejecting Git namespace prefix conflicts.

Changed: Detached, identity-verified worktrees remain eligible for refresh, and analysis treats local descendants of the latest PR head as current.

Changed: The review branch name is reserved for managed PR worktrees. Sync fails safely when a registered development worktree was renamed outside the model instead of pruning its current branch.

Changed: Worktree cleanup verifies a persistent checkout identity before removal, and malformed PR artifacts are isolated instead of aborting all analysis and reconciliation.

Upgrade note: Existing worktree registry records are decoded as review worktrees and remain compatible. prepare_worktree and close_merged_worktrees remain available for existing callers; new automation should use sync -> refresh_pr_worktrees -> analyze_worktrees. The worktreeSnapshot.prNumber field is now optional for pre-PR development worktrees. Consumers must read a PR association as prLink?.prNumber ?? prNumber so both new and legacy review snapshots remain supported; both values are absent for unattached development worktrees. worktreeAnalysis.isPrHeadStale is now nullable while a development worktree is unattached; consumers must test for true or false before using PR freshness. Legacy worktrees without a checkout identity are retained by automatic cleanup; re-run prepare_worktree or the matching create_worktree, or explicitly run attach_worktree, to validate the checkout and backfill its identity.

Modified 1 models

2026.07.23.2

2026.07.23.2

Added: The @evrardjp/github-repo-review-focus report classifies every mirrored open pull request into a deterministic reviewer action queue and includes reviewer load, label concentration, large changes, path overlap, and stale backlog summaries in Markdown and JSON.

Changed: Model definitions can configure reviewerHandles and reviewFocusStaleDays. Report rendering uses stored mirror data only and marks missing current-HEAD or collection data as incomplete instead of ready.

Upgrade note: Existing models remain valid with no configured reviewer handles and a 14-day stale threshold. Configure reviewerHandles to enable the personal Re-review and Requested From You queues.

Added 1 reports

2026.07.23.1

2026.07.23.1

Fixed: Sync now updates canonical branches such as refs/heads/main in the managed bare repository instead of leaving them stale while fetching only into hard-coded refs/remotes/origin/* references.

Changed: The configured gitRemote now determines the remote-tracking namespace. Upstream branches are also available through canonical branch names, while local worktree branches remain independent.

Upgrade note: After pulling this version, run sync once to refresh stale canonical branch references in existing bare mirrors. If a custom gitRemote was previously used and origin is not a separate remote you need to retain, remove its legacy stale refs with git --git-dir <path> for-each-ref --format='delete %(refname)' refs/remotes/origin | git --git-dir <path> update-ref --stdin.

2026.07.22.2

2026.07.22.2

Added: The close_merged_worktrees method removes non-dirty worktrees after their pull requests are merged while retaining their review branches and local commits.

Changed: The local mirror status report now shows merged cleanup candidates, successful removals, and cleanup failures. One dirty worktree no longer prevents other eligible worktrees from being processed.

Upgrade note: Add close_merged_worktrees between sync and analyze_worktrees in scheduled mirror workflows to enable automatic cleanup.

Modified 1 models

2026.07.22.1

2026.07.22.1

Fixed: Bounded syncs now emit each repository-level collection status once when budgetSeconds expires, avoiding duplicate data instance names while still recording incomplete PR and issue collection state.

2026.07.21.1

Fixed: Context reports can be retrieved after prepare_review_context without resupplying method arguments, because the selected PR or issue is now retained in Swamp.

Fixed: Comment-only reviews no longer clear an active changes-requested state, dismissed reviews now clear it, and missing check-run data now leaves CI readiness Unknown instead of reporting that no fixes are needed.

Fixed: Commit timelines exclude commits dropped by a force-push, initial PR revisions use the Git merge base, and incremental PR listing stops once records are older than the sync window.

Fixed: Local repository references are matched case-insensitively and generated analysis commands safely quote model names.

Upgrade note: Run sync after upgrading so PR commits are recorded against their current head. Until an older PR is resynced, its legacy commit records remain visible; once current-head records exist, stale and legacy records are excluded from its timeline.

2026.07.21.1

2026.07.21.1

Fixed: Context reports can be retrieved after prepare_review_context without resupplying method arguments, because the selected PR or issue is now retained in Swamp.

Fixed: Comment-only reviews no longer clear an active changes-requested state, dismissed reviews now clear it, and missing check-run data now leaves CI readiness Unknown instead of reporting that no fixes are needed.

Fixed: Commit timelines exclude commits dropped by a force-push, initial PR revisions use the Git merge base, and incremental PR listing stops once records are older than the sync window.

Fixed: Local repository references are matched case-insensitively and generated analysis commands safely quote model names.

Upgrade note: Run sync after upgrading so PR commits are recorded against their current head. Until an older PR is resynced, its legacy commit records remain visible; once current-head records exist, stale and legacy records are excluded from its timeline.

Modified 1 models

2026.07.20.1

2026.07.20.1

Added: @evrardjp/github-pr-context provides a deterministic issue-centered PR/issue timeline with complete comments and event data, per-push or per-commit changed-file tables, local Git inspection commands, worktree state, and tri-state review readiness facts.

Added: PR and issue bodies, subject references, PR commits, richer review events, and collection-completeness records are retained in Swamp. External references remain unresolved and expose their URL when known.

Added: prepare_review_context selects a mirrored PR or issue, while record_pr_analysis stores code-path walkthrough and review-attention evidence tied to an exact PR head. The bundled github-pr-review skill asks before generating missing LLM evidence.

Changed: GitHub pagination is bounded and incomplete timeline, check, commit, or snapshot collection is recorded explicitly. Incomplete syncs no longer advance the successful cursor.

Fixed: Incomplete PR file pagination is retried for the same head until the complete changed-file set has been stored.

Upgrade note: Run sync after upgrading to populate the new context, relationship, commit, and collection-status resources. Existing snapshots remain compatible, but readiness remains Unknown until completeness records exist.

Modified 1 models. Added 1 reports. updated labels

2026.07.17.1

2026.07.17.1

Added: Initial @evrardjp/github-local-mirror extension with a repo mirror model, full-fidelity sync, prepare_worktree, analyze_worktrees, and status methods.

Added: Local patch revision artifacts, contributor fork remote discovery, Swamp-indexed PR/issue activity, check run snapshots, worktree snapshots, and worktree stale/dirty/ahead analysis.

Added: @evrardjp/github-local-mirror-status report for mirror freshness and local worktree state.

Upgrade note: This is a new extension and stores data separately from @evrardjp/github-project-activity.

06Stats
A
100 / 100
Downloads
0
Archive size
120.8 KB
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types (deprecated)1/1earned
  • Dependencies pass trust audit2/2earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License declared1/1earned
  • Verified public repository2/2earned
07Platforms
08Labels