Skip to content

Cache graph and worktree identity within large proxy plans #212

Open

Description

@codekiln

The Microfreak B2 proxy refresh in Gitpa PR #24 plans 741 source pages and spends several minutes planning before atomic apply. A read-only inspection found repeated graph scans and Git identity subprocesses inside a single shared plan.

In mise-tasks/logseq/entity/proxy/page/lib/core.py, resolve_page (lines 160–171) scans every source page on each lookup, even when a raw or encoded candidate exists. The current graph has about 6,648 source pages. add_page, embedded-page traversal, and task_imports.py repeatedly resolve pages. graph_name, infer_codeforge, and validate_codeforge also repeat Git repository/remote/branch identity queries per page.

Gitpa's scripts/sync_namespace.py already creates one shared plan; splitting or rebuilding plans is not the cause.

Implement plan-scoped page indexes and repository identity snapshots:

  • Preserve logical-name ambiguity detection, symlink validation, explicit source/destination worktree identity, and local-edit checks.
  • Reuse the source/destination name indexes and Git identity within a plan; consider caching entity-owned properties in the same scope.
  • Preserve atomic apply and source-expected hash verification. Do not cache across separate runs.
  • Add meaningful counter tests proving that graph scans and Git identity calls stay bounded per graph, alongside existing proxy/worktree tests.
  • Confirm planned bytes and source/destination identity behavior are unchanged, and record before/after timing on a namespace-sized fixture or real dry run.

Related to guide-image migration #204 and Gitpa PR #24. This is an independent follow-up, not a blocker for the B2 migration. Priority: normal. No dedicated implementation agent is running; no branch or worktree has been created for this issue. Discovery session: 01a110f1-45c5-7633-ad92-c6f9f7f131d8, read-only reviewer episode_sources now idle.

--AI(gpt-6-unspecified proxy planning performance)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority:normalFollow-up after current prerequisites

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions