Skip to content

Cache hits replay the original log and exit status - #160

Open
calvin-archastro wants to merge 2 commits into
mainfrom
factory/tsk_2V8v8TvDrPgG2r6dh4dDiL-d44f3154-8358-40eb-ab49-
Open

calvin-archastro wants to merge 2 commits into
mainfrom
factory/tsk_2V8v8TvDrPgG2r6dh4dDiL-d44f3154-8358-40eb-ab49-

Conversation

@calvin-archastro

@calvin-archastro calvin-archastro commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Epic: Aster restores real build artifacts from a shared cache, including the GitHub Actions cache
Task: Cache hits replay the original log and exit status

Local git hooks skipped: pre-push on the submission push and the publish push. CI is the gate for what those hooks check.

Problem and author intent

A cache hit restored outputs but did not replay the stored target log or the recorded duration. The hit result used an empty output/log, duration_ms: 0, and a hardcoded exit code of 0. JSON then treated cached results like skips and dropped exit_code to None, so CI logs for cached targets stayed silent and status fields did not match the manifest.

Intent: on a hit, print Manifest.log through the same captured-output path live targets use, mark the status line (cached), and report the stored exit code and duration. --no-replay suppresses only the printed log.

What changed

Before, check_cache returned (cache_hit, hash). A hit built an ExecutionResult with empty output, zero duration, and Some(0), then called mark_cached with only the address. build_execution_output set exit_code to None when cached was true.

After, lookup is CacheLookup::Hit { manifest, log } or Miss(hash). The log blob is loaded before restore. A missing or unreadable blob, or a restore failure, warns and is a miss so the target runs instead of replaying nothing. A manifest with no log digest is still a hit with an empty log. cached_result fills output and log from the blob (from_utf8_lossy), duration_ms from manifest.duration_ms, and exit_code from manifest.exit_code. Unless the mode is JSON or --no-replay is set, that log is printed on the same channel as aster logs / ExecutionResult.output. ProgressDisplay::mark_cached then prints a (cached) suffix (CI and verbose include PASS and duration; normal mode prints the address and suffix). JSON keeps the log on the result and does not print it. Skips still use exit_code: None; cache hits no longer do. Failures are still not cached, so the stored code is expected to be 0.

Global --no-replay (default off) is threaded through the run, affected, and heterogeneous executors via Executor::with_no_replay. It suppresses printing only; cached, exit code, and duration stay on the result.

Scope

Seven paths, 24 hunks, +305/−42: .github/workflows/ci.yml, src/cli/commands.rs, src/cli/output.rs, src/executor/runner.rs, src/main.rs, src/ui/progress.rs, tests/cache_artifacts.rs. Those patch hunks are fully included (omitted_hunks: 0, omitted_paths: 0). No hasher or remote-cache backend changes are in this revision.

Risk assessment

Author grade: low. Most of the change is output and status reporting. Hit eligibility is slightly stricter: a matching manifest whose log blob cannot be read is no longer a hit. Non-UTF-8 logs can be altered by lossy UTF-8 conversion when printed or stored on output.

User impact

A cache hit on captured aster run / target execution reprints the stored log and shows (cached), with stored duration in CI and verbose progress. aster run --json results include cached: true, the stored exit_code, duration_ms, and the log in output, without printing the log to stderr. --no-replay hides the replayed log only. Callers that treated a cached exit_code as absent will now see the stored code.

Testing

Canonical test added in source: tests/cache_artifacts.rs cache_hit_replays_stored_log_and_exit_status. It runs //app:build (echo hello, cache enabled), checks aster logs stored hello, then asserts a second run replays hello and (cached); --json reports cached: true, exit_code 0, a duration_ms, and output containing hello without hello on stderr; --no-replay omits hello but still marks (cached); --json --no-replay still reports cached, exit code, and duration. The workflow diff adds --test cache_artifacts. The task states this is the macOS job, and that Ubuntu already runs cargo test --locked --workspace --all-targets --all-features.

Advisory pipeline outcomes: format, lint, and test each reported succeeded with exit code 0. Check excerpts are truncated and do not name cache_hit_replays_stored_log_and_exit_status, so this review cannot confirm that function from the CI log. Patch text is not proof the test passed. diagnostics.truncated is true; the pipeline log is not complete evidence.

Follow-ups and known issues

Streaming targets (execute_streaming) do not consult the cache. Replay covers captured run/target execution only. aster watch uses a quiet executor and does not print target logs. Cached results still set tests: None.

@calvin-archastro
calvin-archastro requested a review from a team October 18, 2026 12:10
@calvin-archastro

calvin-archastro commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor Author

ArchDev is watching this pull request. State: watching (cycle 3 of 3 for head 911ff4f).

when trigger decision result
2026-10-18T12:19:06.832Z failed ci enqueue job_ea5ebf1ff5555b2b17565a78 published f045896
2026-10-19T02:21:40.611Z merge conflict enqueue job_a6559e65346915581056167c published 911ff4f
2026-10-19T02:37:19.462Z verify head enqueue job_402cd8e758668ec054c988b2 no change

Paused by the no-autofix label or a draft; never resolves reviewer threads. Jobs: job_ea5ebf1ff5555b2b17565a78, job_a6559e65346915581056167c, job_402cd8e758668ec054c988b2.

@calvin-archastro
calvin-archastro force-pushed the factory/tsk_2V8v8TvDrPgG2r6dh4dDiL-d44f3154-8358-40eb-ab49- branch from f045896 to 911ff4f Compare October 19, 2026 02:26

This branch has not been deployed

No deployments
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