Skip to content

feat(scan): explain an excluded Go cache instead of omitting it (#619) - #639

Merged
sungjunlee merged 2 commits into
mainfrom
feat/619-go-cache-unverified
Oct 9, 2026
Merged

sungjunlee merged 2 commits into
mainfrom
feat/619-go-cache-unverified

Conversation

@sungjunlee

Copy link
Copy Markdown
Owner

Closes #619.

A Go build cache that failed the layout check (a foreign top-level entry, a symlink, a wrong file type, or an unreadable layout) disappeared from scan and dry-run without explanation. It now appears with a reason and is never selectable.

  • Scan lists the cache with its measured size and the cause, for example Go cache unverified: foreign top-level entry "notes.txt".
  • clean --dry-run shows it skipped with reason code go_cache_unverified and leaves its bytes out of selected_bytes. Age, volume-pressure relaxation, and --force cannot select it.
  • Eligibility is re-derived from the live cache catalog (path, signature, layout), never from the stored row, so a cached scan row carries no authority. The row keeps the go-build identity so the existing Go-cache safety branch applies.
  • A GOCACHE override without Go's README signature stays hidden: there is no evidence it is a Go cache.
  • A valid cache is unchanged: the whole cache root is removed through the deletion gate.
  • Docs: AGENTS.md (replaces "silently exclude" for layout failures), docs/JSON_SCHEMA.md (additive reason code, schema_version 1), docs/SPEC.md, docs/CATEGORY.md, skills/aibris/SKILL.md.

Decisions are recorded in #619.

Verification

  • CLI and domain tests per cause; TestGoCacheUnverifiedCLI failed on the base (row missing).
  • make check, go test -race -count=1 ./..., GOOS=windows go vet ./...: exit 0.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2ad9ce9d-cc02-4137-87e6-7980bc7bf926

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-09T14:50:32.135337Z 10af90f New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Report rejected Go cache layouts with measured bytes and their cause. Recheck live Go cache authority before cleanup eligibility and project skipped policy as go_cache_unverified.

Document unsigned override hiding, unchanged whole-root removal, and independent-provider overlap behavior.

Co-Authored-By: Codex <noreply@openai.com>
@sungjunlee
sungjunlee force-pushed the feat/619-go-cache-unverified branch from fc92078 to eb5c292 Compare October 9, 2026 14:37

@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: eb5c292b56

ℹ️ 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 on lines +154 to +158
if path == "" && target.id == "go-build" {
var cause string
path, cause = rejectedGoCache()
if cause != "" {
reason = "Go cache unverified: " + cause

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Invalidate pre-change scan snapshots

When upgrading with a scan snapshot written by the previous binary less than five minutes ago, an invalid Go cache is absent from that snapshot, and clean accepts it because this change neither bumps internal/scancache.lastScanCacheSchemaVersion nor changes the provider identity. Consequently the cached cleanup path never executes this new diagnostic branch and omits the required go_cache_unverified row until the snapshot expires or a live scan replaces it; bump the internal scan-cache compatibility revision for this provider behavior change.

AGENTS.md reference: AGENTS.md:L256-L261

Useful? React with 👍 / 👎.

A last-scan snapshot from an earlier version has no go_cache_unverified row,
so reusing it would hide the new diagnostic until it expired.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sungjunlee

Copy link
Copy Markdown
Owner Author

Addressed the snapshot note in 10af90f: the last-scan cache revision is bumped, so a snapshot written by an earlier version is rescanned and the new row appears immediately.

@sungjunlee
sungjunlee merged commit 7889e10 into main Oct 9, 2026
6 checks passed
@sungjunlee
sungjunlee deleted the feat/619-go-cache-unverified branch October 9, 2026 15:23
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.

feat(scan): explain an excluded Go cache instead of omitting it

1 participant