Warn about an upstream only when there might be one - #531
Merged
Conversation
MongLong0214
force-pushed
the
notes-absent-everywhere
branch
2 times, most recently
from
August 11, 2026 06:28
70157e7 to
f175256
Compare
CommitLore — record lintTrailers: clean — 2 commits in Active constraints for the paths this PR touchesLimits (132)
Ruled out (297)
Truncated: 211 lines omitted — the comment hit GitHub's 65000 character limit. Trailer violations fail this check. Active constraints are informational — they are what the repository already decided, not a verdict on this PR. |
A repository with no notes mirror anywhere was warned, on every single query, that its answer might be missing records that exist upstream -- and pointed at a fix that could not change anything, while `doctor --fix` reported the same two checks `ok`. One surface said something was wrong and the other said everything was fine, and neither was actionable. That disagreement was half the bug. The read path was answering the wrong question. It asked what this clone intends to fetch, which is git config, and treated a covering refspec as proof that a remote had been consulted. It never has been: `doctor --fix` writes the refspec and fetches nothing, so a repository that has never spoken to its remote looked exactly like one that had and found nothing. So the probe moved to where a network call belongs. `doctor --fix` asks each remote what it advertises and records the answer bound to that remote's exact configured URL. The query path reads that local observation and nothing else -- no round trip before an edit, and a changed remote URL invalidates the evidence rather than inheriting it. Three states now stay apart. A mirror that exists here answers for itself. A recorded observation that every configured remote advertised none makes an empty answer a true empty. Everything else -- no observation, an unreachable remote, a refspec that does not cover the mirror -- stays incomplete and keeps warning, which is the case the warning was built for and the one that must survive this change. A repository with no remote at all is a true empty, not an unknown. There is nowhere for an unseen record to be, and no probe that could ever settle it, so warning there would be permanent and about nothing -- the same incoherence this fixes, arriving from the other side. Limit: the observation is as old as the last `doctor --fix`; a mirror pushed upstream after it is not visible here, and an empty answer will read as a true empty until the next probe Ruled-out: probing the remote from the query path | `context` runs before every edit and an edit must not wait on a network round trip Ruled-out: treating a covering refspec as evidence the remote was consulted | the refspec says what this clone would fetch, never what a remote has Blast: module Undo: easy Certainty: firm Verified: two hundred and twenty-five cases pass across the query, notes-availability, doctor and doctor-invariants suites, including a mirror present locally, a recorded absence, an unverified remote, an unreachable remote and a repository with no remote; typecheck clean and two builds produce a byte-identical dist Provenance: authored Record-Id: r-notes512a
Three suites build a clone, add the notes refspec by hand and never speak to the remote. That is now exactly the unverified state: a refspec says what a clone would fetch, never what the remote has, so availability stays unknown and every answer reads incomplete. The incompleteness is correct and it is about something else. These cases measure a shallow boundary and reference integrity, and an unrelated caveat riding along masks what they were written to catch. So each fixture records the same evidence `doctor --fix` writes after its probe, and goes back to measuring its own subject. Blast: local Undo: easy Certainty: firm Verified: three hundred and fifty-five cases pass across validate, shallow-history, query, notes-availability, doctor, doctor-invariants, mcp and path-not-in-history; typecheck clean Provenance: authored Record-Id: r-notes512b
MongLong0214
force-pushed
the
notes-absent-everywhere
branch
from
August 11, 2026 06:48
fbed7f3 to
c386bd5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #512 once this reaches
main.A repository with no notes mirror anywhere was warned on every query that its answer might be missing records upstream, and pointed at a fix that could not change anything — while
doctor --fixreported the same two checksok. One surface said something was wrong, the other said everything was fine, and neither was actionable. That disagreement was half the bug.The read path was answering the wrong question
It asked what this clone intends to fetch — git config — and treated a covering refspec as proof a remote had been consulted. It never has been:
doctor --fixwrites the refspec and fetches nothing, so a repository that has never spoken to its remote looked exactly like one that had and found nothing.The probe moved to where a network call belongs
doctor --fixasks each remote what it advertises and records the answer bound to that remote's exact configured URL. The query path reads that local observation and nothing else — no round trip before an edit, and a changed remote URL invalidates the evidence rather than inheriting it.Three states, kept apart
That third row is the case the warning exists for, and the one that had to survive this change: no observation, an unreachable remote, or a refspec that does not cover the mirror all stay incomplete. Turning "I could not check" into silence would be a worse bug than the one being fixed.
The other side of the same incoherence
A repository with no remote at all is a true empty, not an unknown. There is nowhere for an unseen record to be, and no probe that could ever settle it — so warning there would be permanent and about nothing, and
doctor --fixcould never clear it because there is no remote to ask. The first pass made thisunfetched; it isabsent.Stated
Limit:the observation is as old as the lastdoctor --fix. A mirror pushed upstream after it is not visible here, and an empty answer reads as a true empty until the next probe.225 cases pass across the query, notes-availability, doctor and doctor-invariants suites — a mirror present locally, a recorded absence, an unverified remote, an unreachable remote and a repository with no remote. Typecheck clean; two builds produce a byte-identical
dist.