Repository navigation
release-tag-publication: fetch the published tip before skipping as not-checked (#612) - #646
Conversation
…ore reading a missing manifest as an answer (#612) THE DIAGNOSIS IN THE ISSUE IS THE ONE THE FAMILY PRINTED, AND IT IS WRONG. Nine governed repositories read "not checked: ... contracts/manifest.yaml could not be read at the published tip <sha> — the commit may not be present locally" on every nightly. The commit WAS present locally. The workflow's "Fetch each governed submodule's live origin/main" step fetched all ten tips successfully in the same job (opensoft/xFactory run 33711158378), and the nine shas the report names are byte-for-byte the nine that step logged as fetched. Those repositories carry no `contracts/manifest.yaml` at all — most carry no `contracts/` directory — which is a fact about them and not about the checkout. THE DEFECT IS A CONFLATION ONE LAYER DOWN. `blobs_at` answers a per-path None for two things that are not each other: the path is absent at a commit we hold, and the commit is not in the object store. `check_repo` asserted the second without ever asking, so the benign case was reported in the serious case's words — #338's shape, pointed the other way, and it sent every reader of the nightly to look for a fetch defect the workflow had already ruled out. TWO SEAM METHODS SETTLE IT. `RealGit.commit_present` asks git (`cat-file -e <sha>^{commit}`), and `RealGit.fetch_commit` obtains exactly the commit from `origin` when it is missing. `obtain_commit` runs BEFORE the read, at the distance walk's own window, so a clone that has to fetch fetches enough history to grade in the same round trip rather than trading a manifest skip for a distance skip. The same obtain runs at the tag-peel read, where an unobtainable peel silences the WHOLE repository as "unlistable". `--depth` IS APPLIED ONLY TO AN ALREADY-SHALLOW CLONE, and that guard is load-bearing rather than tidy. Measured 2026-09-04: `git fetch --depth=7 origin <sha>` against a FULL clone of this repository truncated it from 1938 commits reachable from `origin/main` to 74 and wrote `.git/shallow`. The nightly's submodules are full clones and other families walk their history, so an unconditional depth flag would repair one family by breaking several. THE RATIFIED SKIP STAYS, AS THE FAIL-CLOSED FALLBACK. A tip that could be neither found nor fetched still reports "could not be read at the published tip", now saying that the bounded fetch was attempted and did not obtain it. A tip that IS here and carries no manifest is answered instead — in the words the sibling family `release-inventory-drift` already uses for exactly these repositories — with the presence stated in the reason so the two can never again be read as each other. MEASURED ON A REAL AGGREGATION-SHAPED SHALLOW CHECKOUT (root `--depth=1`, four governed submodules `--depth=1`): before, 4 of 4 repositories skipped with the unfetched-tip words and the family returned a single family-level skip — nothing judged at all. After, 0 such skips, the three bundle-less repositories answered, and openxFactory actually JUDGED, reporting its real `contract-v2.6 is declared SPENT` finding. Every submodule is still shallow. Tests: eight new, hermetic where the fact is a store fact and over real git with a real origin where it is a transport fact — including the self-gate the issue asks for (zero unfetched-tip skips over an aggregation-shaped estate) and its positive control (break the fetch and exactly the absent-tip repository fires). Nine mutations run; zero survivors. Closes #612. Co-Authored-By: Claude Fable 5 <[email protected]>
There was a problem hiding this comment.
Hi @brettheap! 👋
Your private repo does not have access to Sourcery.
Please upgrade to continue using Sourcery ✨
There was a problem hiding this comment.
🟢 Approval recommended
The change is well-tested and correctly addresses the root-cause conflation, with only minor polish items noted in review comments.
Pull request overview
This PR fixes release-tag-publication’s “unfetched tip” skip reason by distinguishing “commit missing from object store” from “path absent at a commit we do have”, and by opportunistically fetching the published tip commit when it’s not present locally, so governed repos without contracts/manifest.yaml are reported with the correct reason instead of being misdiagnosed.
Changes:
- Added an object-store presence/fetch seam (
commit_present/fetch_commit) and a family-levelobtain_commit(...)helper to fetch the published tip (and peeled tag commits) before reading at those SHAs. - Expanded the release-tag-publication test suite with hermetic and real-git scenarios, including a self-gate over an aggregation-shaped estate.
- Updated doc-health documentation to describe the new fetch-before-skip behavior and its safety guard around
--depth.
File summaries
| File | Description |
|---|---|
| scripts/doc_health/release_tag_publication.py | Adds obtain_commit(...) and uses it to fetch/verify tip and peeled commits before reading manifests, preventing skip-reason conflation. |
| scripts/doc_health/corpus.py | Implements RealGit.commit_present(...) and RealGit.fetch_commit(...), including a shallow-only --depth safeguard. |
| tests/doc-health/conftest.py | Extends FakeGit with object-store/fetch seams used by new tests. |
| tests/doc-health/test_release_tag_publication.py | Adds extensive new test coverage for the new “obtain then read” behavior, including real-git transport cases and a self-gate. |
| docs/doc-health.md | Documents the new published-tip obtain/fetch behavior and the rationale for the shallow-only depth guard. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| changelog or the inventory to match the absence*. The gap it closes reached | ||
| `contract-v1.33`/`v1.35`/`v1.39` in August and recurred on `contract-v2.3` | ||
| and `contract-v2.4`; a human found it both times (issue #528). | ||
| and `contract-v2.4`; a human found it both times (issue #528). Because it reads at the PUBLISHED tip, the family first asks whether that commit is in the local object store and FETCHES exactly it — bounded, at the distance window's depth, and `--depth` only where the clone is already shallow — before it will read a missing `contracts/manifest.yaml` as anything at all: a tip it holds that carries no manifest is answered as *no bundle declared*, and only a tip it could neither find nor fetch keeps the fail-closed *could not be read at the published tip* skip (issue #612, which had nine governed repositories reported in the second sentence's words every nightly while the first was true). |
| # THE SAME OBTAIN AT THE OTHER READ. A tag peels to a commit that is often | ||
| # OLDER than anything a shallow or freshly-advanced clone holds, and the | ||
| # guard below turns a missing one into "unlistable", which skips the WHOLE | ||
| # repository. Depth 1: only the peeled commit's own tree is read here, so | ||
| # there is no walk to fund. | ||
| obtain_commit(git, repo_path, peeled, 1) | ||
| target = git.blobs_at(repo_path, peeled, [MANIFEST]) |
| self.present_commits = set(present_commits or ()) | ||
| self.fetchable = set(fetchable or ()) | ||
| self.fetch_calls: list[tuple[str, str, object]] = [] |
`test_the_measured_pair_survives_a_landing_on_main` reproduces #626 by rendering one unchanged tree twice across a landing on published `main` that the checkout does not hold, and it asserted the straddle by looking for the words `could not be read at the published tip` in the second rendering. Those are exactly the words the parent commit stops emitting when the tip can be obtained: the family now FETCHES the landing and READS it, so it reads a DIFFERENT TREE than the first rendering did — the same straddle, a different symptom. The fixture's own docstring anticipated this and gave the instruction followed here: "re-aim this fixture at whatever it reports now — do not delete it." Both arms are re-aimed off reason STRINGS and onto the facts they were standing in for: * the control straddle is asserted on the live-remote family's own SECTION differing across the landing, whatever words it differs in; * the pin is asserted on the `skipped by run configuration` notice being present in both pinned renderings, which is the fact `--skip-family` is supposed to produce. The old spelling ("the family did not say the words it used to say") would now pass over a family that ran in BOTH renderings, which is the failure it exists to catch. Verified in the direction the fixture declares: take `--skip-family release-tag-publication` out of `_render_cmd` and the test still reds. Co-Authored-By: Claude Fable 5 <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
_tag_state still treats a missing manifest at a present/obtainable peeled commit as unlistable, which can incorrectly skip whole repos instead of reporting a misplaced tag.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (1)
docs/doc-health.md:165
- This paragraph was collapsed into a single very long line, which is inconsistent with the surrounding wrapped Markdown and makes future diffs/reviews harder (small edits will reflow a huge line). Consider re-wrapping it to the same approximate line length used elsewhere in this document.
and `contract-v2.4`; a human found it both times (issue #528). Because it reads at the PUBLISHED tip, the family first asks whether that commit is in the local object store and FETCHES exactly it — bounded, at the distance window's depth, and `--depth` only where the clone is already shallow — before it will read a missing `contracts/manifest.yaml` as anything at all: a tip it holds that carries no manifest is answered as *no bundle declared*, and only a tip it could neither find nor fetch keeps the fail-closed *could not be read at the published tip* skip (issue #612, which had nine governed repositories reported in the second sentence's words every nightly while the first was true).
- Files reviewed: 6/6 changed files
- Comments generated: 1
- Review effort level: Lite
| obtain_commit(git, repo_path, peeled, 1) | ||
| target = git.blobs_at(repo_path, peeled, [MANIFEST]) | ||
| if target is None or target.get(MANIFEST) is None: |
…s behind an unreadable manifest read (#678) Lane: openxfactory-1 (openXfactory-1) Ratified 2026-09-05 by Brett Heap (openxFactory operator authority) — "ratify 678, use openxfactory-1, land it when green". Record: openspec/changes/amend-published-tip-unreadable-scenario/review/ratification-2026-09-05.md; verification: review/verification-2026-09-05.md. Canon catches up with the checker: the doc-health scenario "The manifest cannot be read at the published tip" now names both facts behind an unreadable read (commit absent from the object store vs commit held with no manifest) and requires the family to establish which before choosing its words (#646 already does). One canon unit replaced, marker carried. code_surface none → archives on landing. Landed under Rule 6 on the required contexts. Admin merge: self-authored PR (standing pattern B2). Refs #662 Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01H9aKd8YF3ktcLmVJJxQYKv
Lane: doxbench-stewardship
The diagnosis in the issue is the one the family printed, and it is wrong
release-tag-publicationemits, for nine governed repositories on everynightly,
not checked: <repo>: contracts/manifest.yaml could not be read at the published tip <sha> — the commit may not be present locally.The commit is present locally. In the same job that produced the 2026-09-03
report (opensoft/xFactory run
33711158378), the step "Fetch each governedsubmodule's live origin/main" logged a successful fetch for all ten governed
submodules, and the nine shas the report names are byte-for-byte the nine that
step logged:
79f85b7c873b79f85b7c838743cf3214938743cf3273cee96dd87e73cee96ddce844c14f78bce844c14fa24965d6a516a24965d6aae53ce1bf369ae53ce1bfa79ff008b800a79ff008b68d2f1f5db9368d2f1f5dd8d73195609dd8d731956Those nine repositories simply carry no
contracts/manifest.yaml— mostcarry no
contracts/directory at all. The sibling familyrelease-inventory-driftsays exactly that about the same nine, in the samereport, thirty lines higher up.
Root cause
blobs_atanswers a per-pathNonefor two facts that are not each other:the path is absent at a commit we hold, and the commit is not in the object
store.
check_repoasserted the second without ever asking, so the benign casewas reported in the serious case's words — #338's conflation, pointed the other
way. It sent every reader of the nightly to look for a fetch defect the
workflow's own fetch step had already ruled out, and it hid the case where a
tip genuinely is missing.
So fix direction 2 in the issue is unnecessary (the workflow step already
does its job, and its success is what proves the diagnosis), and fix direction 1
alone would have changed nothing on the nightly. The fix is to settle the
question the read cannot answer.
Design
RealGit.commit_present(repo, sha)—git cat-file -e <sha>^{commit}. Thefact, in one process.
RealGit.fetch_commit(repo, sha, depth)— fetches exactly that commit fromorigin. By sha, not by branch, because the caller already resolved the refand a branch fetch would race it. Verified against a real
--depth=1clonethat GitHub serves a reachable sha this way.
obtain_commit(git, repo, sha, depth)in the family — present, else fetch,else
False. It runs before the read, at the distance walk's ownwindow (
threshold + 2), so a clone that must fetch fetches enough historyto grade in the same round trip instead of trading a manifest skip for a
distance skip. The same obtain runs at the tag-peel read, where an
unobtainable peel silences the whole repository as
unlistable.--depthis applied only to an already-shallow clone, and that guard isload-bearing. Measured 2026-09-04:
git fetch --no-tags --depth=7 origin <sha>against a full clone of this repository truncated it from 1938commits reachable from
origin/mainto 74 and wrote.git/shallow. Thenightly's submodules are full clones and other families walk their history, so
an unconditional depth flag would repair one family by breaking several. A
full clone gets a plain object fetch, measured to leave both the reachable
count and the shallow flag untouched.
neither found nor fetched still reports could not be read at the published
tip, now adding that a bounded fetch was attempted and did not obtain it. A
tip that is here and carries no manifest is answered instead, with the
presence stated in the reason so the two can never again be read as each
other.
One scenario-text note for the reviewer
The canon scenario "The manifest cannot be read at the published tip" says the
family MUST NOT report that read as the repository declaring no bundle. Its
whole force — and its own
ANDclause — is the unfetched case, which thisPR keeps intact and now proves rather than assumes. The new arm fires only after
commit_presenthas established that the commit is here. Both arms are stilla
Skipreported as aninfo, so nothing about the family's shape or severitymoves; only which of the two ratified reasons is named. If the council wants the
scenario's wording to carry the distinction explicitly, that is a one-line
amendment and this PR is not it.
Mutation table
python3 -m pytest tests/doc-health/test_release_tag_publication.pypermutation. Zero survivors.
obtain_commitnever fetches--depthapplied to every clone (the truncation hazard)--depthnever applied (a shallow clone pays for all history)commit_presentalways answersTrueReal proof: a shallow aggregation-shaped checkout
git clone --depth=1 opensoft/xFactory+git submodule update --init --depth=1 openxFactory xFactories/{codexFactory,OpsxFactory,AdxFactory}, thenpython3 scripts/doc-health.py --repo-root <that> --family release-tag-publication. Every submodule is pinned behind its live tip, soevery tip is genuinely absent — the case the nightly does not have and every
plain clone does.
Before — 4 of 4 repositories skipped with the unfetched-tip words, so the
family returned one family-level skip and nothing was judged at all:
After — 0 unfetched-tip skips, the three bundle-less repositories answered,
and openxFactory actually judged, reporting its real finding:
All four submodules are still shallow afterwards (
is-shallow-repository=true),which is the
--depthguard working in the direction it is for.On the nightly itself the visible delta is smaller and honest: the nine
infos keep their
infoseverity and gain the true reason, and openxFactory isjudged exactly as before. What changes there is that the report stops
misdirecting its reader — and that any future genuine fetch gap now shows up as
itself, and reds the self-gate.
Tests
Eight new — hermetic (a fake object store that gates reads on
commit_present, which the existingFakeGitcannot express) where the fact isa store fact, and over real git with a real origin where it is a transport
fact:
fetched (the nine repositories)
shim with an unservable origin keeps the ratified skip
unlistable, +control
pays for exactly its window
second clone pushes)
fail-closed fallback)
fires
python3 -m pytest tests/doc-health/test_release_tag_publication.py -q→ 145passed.
OPENSPEC_TELEMETRY=0 openspec validate --all --strict→ 89 passed,0 failed.
One collateral fixture, re-aimed rather than deleted (second commit)
test_modified_block_currency_self_gate.py::test_the_measured_pair_survives_a_landing_on_main(#626, landed on
mainwhile this branch was in flight) reproduces its defectby rendering one unchanged tree twice across a landing the checkout does not
hold, and asserted the straddle by looking for the words
could not be read at the published tipin the second rendering. Those are exactly the words this PRstops emitting when the tip can be obtained — the family now fetches the
landing and reads a different tree, which is the same straddle with a different
symptom. Its own docstring gave the instruction followed here: "re-aim this
fixture at whatever it reports now — do not delete it."
Both arms are moved off reason strings and onto the facts they stood in for:
the control straddle is asserted on the live-remote family's own section
differing across the landing, and the pin on the
skipped by run configurationnotice being present in both pinned renderings. The old spelling of the second
arm ("the family did not say the words it used to say") would now pass over a
family that ran in both renderings — the failure it exists to catch. Verified
in the direction the fixture declares: remove
--skip-family release-tag-publicationfrom_render_cmdand the test still reds.scripts/doc_health/modified_block_currency.pyis untouched (PR #640's file).Closes #612.