Skip to content

feat(macos): name the files a sweep could not refresh, up to a bound - #150

Merged
h1d3mun3 merged 1 commit into
stack/virtiofs-staleness-2026-07from
feat/macos-sweep-name-failures
Jul 28, 2026
Merged

feat(macos): name the files a sweep could not refresh, up to a bound#150
h1d3mun3 merged 1 commit into
stack/virtiofs-staleness-2026-07from
feat/macos-sweep-name-failures

Conversation

@h1d3mun3

Copy link
Copy Markdown
Owner

Follow-up to the merged #124 / #135 series, branched from the current
stack/virtiofs-staleness-2026-07.

Why

The sweep reported counts only:

[augur] Share refresh finished with problems (ok=40 unstable=1); some files may still read stale in the guest.

That answers "is one file wrong or are hundreds?" — which is what changes how alarmed to be. It
does not answer "which one", and that is what decides whether to care at all:

unstable /…/.build/foo.o a host-side build is running. Expected. Ignore.
unstable /…/src/main.swift someone is mid-write. The agent may see truncated content.

The remedy is identical either way (down --macos && up --macos), so this is diagnosis, not
action
— which is exactly why it is bounded rather than exhaustive.

What changed

The guest prints its counts on the first line — the host still reads that as the summary, so the
existing verdict matching is unchanged — and below it up to _MACOS_SWEEP_DETAIL (5) lines naming
individual failures, then and N more.

The truncation is stated, not silent. A list that quietly stops at five reads as "there were only
five", which is the failure class this whole series exists to remove.

Only the three classes the host actually warns about are namedunstable, nomap,
msyncfail. gone and empty are normal: a file removed by a build between the host's find and
the guest's open is routine, and naming those would turn the warning into noise nobody reads.

Filenames are sanitised for display. macOS permits a newline in a filename, and an unsanitised one
would split a single failure across two output lines — so the host would print half a path as though
it were a second failure. Tested with a real newline in a real filename.

Tests — tests/41, 47 → 55 assertions

Six new ones: counts stay on line one, the cap holds at the requested value, the truncation notice
appears, a clean sweep prints nothing but the summary, a newline-bearing filename stays on one line,
and the host surfaces both the named file and the notice.

Two existing assertions were updated for the new shape, not for a defect — one compared the whole
output where it now means the summary line, and one asserted the retry count was the final argument
when the detail cap is now last. The second is stronger for it: it pins both arguments in order,
so a swap that silently gave 5 retries and named 3 failures no longer passes.

Mutation check — 6/6 detected

mutation result
M1 truncation notice dropped (silent cut) 1 failed
M2 cap ignored 2 failed
M3 filenames not sanitised 1 failed
M4 whole blob used as the summary 1 failed
M5 nothing is ever named 3 failed
M6 the two arguments swapped 1 failed

make offline-testsALL GREEN (29 scripts).

Scope

No behaviour change to the sweep itself — same files invalidated, same verdicts, same remedy. This
only widens what the operator is told when something goes wrong, and the failure path it reports on
has never fired in a real environment; it is reachable by construction, not observed.

🤖 Generated with Claude Code

The sweep reported counts only — "ok=40 unstable=1". That answers "is one file
wrong or are hundreds?", which is what changes how alarmed to be. It does not
answer "which one", which is what decides whether to care at all: `unstable` on
a build artefact while a host-side build is running is expected; the same
verdict on a source file is not.

The remedy is identical either way (`down --macos && up --macos`), so this is
diagnosis rather than action. That is exactly why it is bounded: a host-side
build running during a sweep can legitimately leave hundreds of files
`unstable`, and the attach-path warnings go to the operator's terminal.

The guest now prints its counts on the FIRST line — the host still reads that
as the summary, so the existing verdict matching is unchanged — and below it up
to _MACOS_SWEEP_DETAIL (5) lines naming individual failures, then "and N more".
The truncation is stated rather than silent, because a list that quietly stops
at five reads as "there were only five".

Only the three classes the host actually warns about are named: `unstable`,
`nomap`, `msyncfail`. `gone` and `empty` are normal — a file removed by a build
between the host's `find` and the guest's `open` is routine, and naming those
would turn the warning into noise nobody reads.

Filenames are sanitised for display. macOS permits a newline in a filename, and
an unsanitised one would split a single failure across two output lines, so the
host would print half a path as though it were a second failure. There is a
test for that, driven with a real newline in a real filename.

tests/41 gains six assertions: the counts stay on line one, the cap holds at
the requested value, the truncation notice appears, a clean sweep prints
nothing but the summary, a newline-bearing filename stays on one line, and the
host surfaces both the named file and the notice.

Two existing assertions needed updating for the new shape rather than for a
defect: one compared the whole output where it now means the summary line, and
one asserted the retry count was the final argument when the detail cap is now
last. The second is stronger for it — it pins both arguments in order, so a
swap that gave 5 retries and named 3 failures no longer passes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🧭 Egress drift reminder

This PR changes the egress core (augur / augur-proxy/ / gvproxy/ / augur.conf / augur-vm/) but does not touch docs/security-reviews/.

If this change alters the egress posture, please:

  • run /egress-survey (the bounded drift audit), and
  • if it drifted: add a new dated snapshot under docs/security-reviews/ and/or update docs/security-reviews/INVARIANTS.md.

Non-blocking reminder. It does not verify correctness (that is the egress fail-closed E2E + swift test). If no doc update is needed, ignore this.

@h1d3mun3
h1d3mun3 merged commit b16ce3f into stack/virtiofs-staleness-2026-07 Jul 28, 2026
3 checks passed
@h1d3mun3
h1d3mun3 deleted the feat/macos-sweep-name-failures branch July 28, 2026 11:36
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