Skip to content

SMOODEV-4160: th attest reuses a pass while inputs are unchanged - #851

Merged
brentrager merged 3 commits into
mainfrom
SMOODEV-4160-attest-credit-reuse
Oct 25, 2026
Merged

brentrager merged 3 commits into
mainfrom
SMOODEV-4160-attest-credit-reuse

Conversation

@brentrager

Copy link
Copy Markdown
Contributor

Problem

Re-attesting after a rebase, a docs-only commit or a review fixup re-runs every row, often 20–50 min in the contended machine-wide ci-queue, even when nothing a row reads changed. The idea comes from dagger's content-addressed @check cache.

Solution

  • New attest/reuse.rs: a local pass ledger (SQLite WAL, ~/.smooth/attest/credits.db, keyed by repo common-dir + check + sha; 72h max age via REUSE_MAX_HOURS).
  • Before routing, each requested row looks at its recent passes (≤20). A pass carries over when the diff to it (head vs head, base vs base) is empty, or when the repo's scripts/ci/_rows-touched.sh says the row is untouched. The hook gets 10s and must exit 0.
  • Any change under scripts/ci/ always runs the row. A dirty tree, --no-reuse, SMOOTH_CI_NO_REUSE/SMOOAI_CI_NO_REUSE and failures are never reused.
  • A reused status says passed locally in Ns (reused from abc1234: no input changed); JSON adds reused_from.
  • Works alongside attest: skip untouched rows before they queue #844: that skips rows untouched vs main, this carries a pass across commits.
  • The smooai side (scripts/ci/_rows-touched.sh) landed in SmooAI/smooai#6448.

Verification

  • cargo clippy -p smooai-smooth-cli --all-targets: clean
  • cargo test -p smooai-smooth-cli --bin th attest::: 126 passed (new: same-commit re-attest, hook untouched/touched, no hook, check-definition change, --no-reuse, failure never reused, dirty run, status/description name the source commit, hook memo, hook timeout)

Jira: https://smooai.atlassian.net/browse/SMOODEV-4160

🤖 Generated with Claude Code

https://claude.ai/code/session_01UApL5uBTfZnkfrXRhXTYSo

…changed

Re-attesting after a rebase or a docs-only commit re-ran every row for
minutes in a contended queue. A local pass ledger (~/.smooth/attest/credits.db)
now credits a row from a recent passing commit when the repo's
scripts/ci/_rows-touched.sh says nothing between them touches it, or the
diff is empty. Check-definition changes, dirty trees and --no-reuse always run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UApL5uBTfZnkfrXRhXTYSo
@changeset-bot

changeset-bot Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9f4e3c3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@smooai/smooth Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@brentrager
brentrager enabled auto-merge (squash) October 25, 2026 00:55
…mon test deletes it

th_without_a_daemon_says_so_in_two_lines deleted flow.addr right after the
rig saw the 'listening' line, but the daemon claims flow.addr after that line,
so the file could reappear and th harness list found a daemon (CI failed twice).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UApL5uBTfZnkfrXRhXTYSo
@brentrager
brentrager merged commit 480e25c into main Oct 25, 2026
8 checks passed
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