Skip to content

Cache network-backed resolutions and add refresh - #145

Merged
t-kalinowski merged 6 commits into
mainfrom
feat/resolution-cache-refresh
Jul 30, 2026
Merged

Cache network-backed resolutions and add refresh#145
t-kalinowski merged 6 commits into
mainfrom
feat/resolution-cache-refresh

Conversation

@t-kalinowski

@t-kalinowski t-kalinowski commented Jul 30, 2026

Copy link
Copy Markdown
Member

Summary

Cache dependency graphs that pak resolves to network-backed package sources, so a second invocation of the same script can reuse the resolved library without launching R or performing another network operation.

Previously, the cache policy classified the user’s input ref before resolution. That excluded remote refs such as r-xla/anvl and could not account for transitive or mixed local/network graphs. This change lets pak resolve the graph once, then bases the cache policy on pak’s resolved source locations.

User-facing changes

  • Reuse warm resolutions for any graph containing a network-backed source, including registry snapshots, GitHub, GitLab, Bitbucket, git, URL, SCP-style SSH, transitive remote dependencies, and mixed local/network graphs.
  • Add --refresh to run, render, preview, tool run, rx, and tool install.
  • Support nonempty IR_REFRESH as the environment-level refresh control.
  • Treat IR_LATEST_RESOLUTION_MAX_AGE_SECONDS=0 as an unconditional miss for time-bounded markers, including markers written during the current second.
  • Continue resolving local-only graphs and refs with pak query modifiers on every invocation.
  • Preserve the previous warm result when a refresh fails.

Internal changes

  • Remove custom Rust and R parsing of user package refs for cache policy decisions.
  • Use pak’s resolved sources, mirror, and params fields to identify network-backed graphs and explicit query modifiers.
  • Apply one expiring-marker policy to every network-backed R graph. exclude-newer remains part of the cache key but no longer makes a network resolution permanently current.
  • Create marker timestamps only after successful materialization.
  • Store each tool provider’s timestamp, library path, and package name in an independent marker so providers sharing a dependency set remain coherent across refreshes.
  • Bypass both R and Python resolution markers during refresh, including reads after acquiring the resolver lock.
  • Use pak’s direct-package result, with a focused pak solve when needed, to identify the primary package for tool metadata.
  • Update command help, cache documentation, and public CLI regression coverage.

@t-kalinowski t-kalinowski changed the title Cache remote refs and add resolution refresh Cache network-backed resolutions and add refresh Jul 30, 2026
@t-kalinowski
t-kalinowski marked this pull request as ready for review July 30, 2026 18:33

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 66742c4a79

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread driver/resolve.R Outdated
Comment thread driver/resolve.R Outdated
Comment thread driver/resolve.R Outdated
@t-kalinowski
t-kalinowski merged commit 51bd866 into main Jul 30, 2026
4 checks passed
@t-kalinowski
t-kalinowski deleted the feat/resolution-cache-refresh branch July 30, 2026 21:14
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