Conversation
Add an incremental compiler test that forces a stale/inconsistent .ty path through impl-only dependency changes. The test rewrites main.ty to keep a stale typed-module dependency while updating header fields enough to stay on the TyTask/impl- refresh route. Without the impl-refresh fallback fix this triggers an internal failure (NoItem in this repro).
💡 Codex Reviewacton/compiler/lib/src/Acton/Compile.hs Lines 2319 to 2320 in 16ef54b
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
A cached TyTask can enter runImplRefresh when only impl dependency hashes change. In that path we load the typed module from .ty and recompute impl deps/hashes against current dependency name-hash maps. If the cached .ty is internally stale or inconsistent, mkEnv/splitDeps/ hash resolution can fail and surface internal failures such as NoItem or hash-missing diagnostics, even though this is a recoverable stale- cache situation. This change makes runImplRefresh fall back to runFront when impl- refresh cannot resolve dependency hashes reliably. It wraps impl- refresh execution in an exception fallback, treats mkEnv and dep-hash resolution failures as stale-cache signals, and emits a verbose stale message before rerunning front passes. Async cancellation exceptions are rethrown instead of treated as stale- cache failures. This keeps cancel semantics intact in watch and LSP flows and prevents canceled generations from continuing stale work. This aligns impl-refresh behavior with stale-check handling where unresolved dep hashes trigger refresh rather than hard internal errors.
A cached TyTask can enter runImplRefresh when only impl dependency hashes change. In that path we load the typed module from .ty and recompute impl deps/hashes against current dependency name-hash maps.
If the cached .ty is internally stale or inconsistent, mkEnv/splitDeps/ hash resolution can fail and surface internal failures such as NoItem or hash-missing diagnostics, even though this is a recoverable stale-cache situation.
This change makes runImplRefresh fall back to runFront when impl-refresh cannot resolve dependency hashes reliably. This aligns impl-refresh behavior with stale-check handling where unresolved dep hashes trigger refresh rather than hard internal errors.