Skip to content

release-tag-publication: fetch the published tip before skipping as not-checked (#612) - #646

Merged
brettheap merged 2 commits into
mainfrom
fix/612-release-tag-fetch-tip
Sep 4, 2026
Merged

brettheap merged 2 commits into
mainfrom
fix/612-release-tag-fetch-tip

Conversation

@brettheap

@brettheap brettheap commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Lane: doxbench-stewardship

The diagnosis in the issue is the one the family printed, and it is wrong

release-tag-publication emits, for nine governed repositories on every
nightly, 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 governed
submodule'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:

repo fetched by the workflow named in the report
AdxFactory 79f85b7c873b 79f85b7c8
LedgerxFactory 38743cf32149 38743cf32
MedxFactory 73cee96dd87e 73cee96dd
HealthLinc ce844c14f78b ce844c14f
MedxEHR a24965d6a516 a24965d6a
OpsxFactory ae53ce1bf369 ae53ce1bf
codexFactory a79ff008b800 a79ff008b
MedxChart 68d2f1f5db93 68d2f1f5d
MedxPractice d8d73195609d d8d731956

Those nine repositories simply carry no contracts/manifest.yaml — most
carry no contracts/ directory at all. The sibling family
release-inventory-drift says exactly that about the same nine, in the same
report, thirty lines higher up.

Root cause

blobs_at answers a per-path None for 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_repo asserted the second without ever asking, so the benign case
was 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}. The
    fact, in one process.
  • RealGit.fetch_commit(repo, sha, depth) — fetches exactly that commit from
    origin. By sha, not by branch, because the caller already resolved the ref
    and a branch fetch would race it. Verified against a real --depth=1 clone
    that 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 own
    window
    (threshold + 2), so a clone that must fetch fetches enough history
    to 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.
  • --depth is applied only to an already-shallow clone, and that guard is
    load-bearing. Measured 2026-09-04: git fetch --no-tags --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. A
    full clone gets a plain object fetch, measured to leave both the reachable
    count and the shallow flag untouched.
  • 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 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 AND clause — is the unfetched case, which this
PR keeps intact and now proves rather than assumes. The new arm fires only after
commit_present has established that the commit is here. Both arms are still
a Skip reported as an info, so nothing about the family's shape or severity
moves; 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.py per
mutation. Zero survivors.

# mutation killed by
M1 presence gate deleted (always the unfetched words) 3 tests
M2 the answer arm deleted (present tip falls through to "no bundle declared") 2
M3 obtain_commit never fetches 5
M4 the tip obtain is not called before the read 4
M5 the fetch window collapses to 1 2
M6 the tag-peel obtain deleted 1
M7 --depth applied to every clone (the truncation hazard) 1
M8 --depth never applied (a shallow clone pays for all history) 1
M9 commit_present always answers True 4

Real proof: a shallow aggregation-shaped checkout

git clone --depth=1 opensoft/xFactory + git submodule update --init --depth=1 openxFactory xFactories/{codexFactory,OpsxFactory,AdxFactory}, then
python3 scripts/doc-health.py --repo-root <that> --family release-tag-publication. Every submodule is pinned behind its live tip, so
every 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:

Skipped families (never silently omitted):
- release-tag-publication — AdxFactory: contracts/manifest.yaml could not be read at the published tip 79f85b7c8 …;
  OpsxFactory: … ad18b372f …; codexFactory: … f4fa6abac …; openxFactory: … bbc21e41e …

After — 0 unfetched-tip skips, the three bundle-less repositories answered,
and openxFactory actually judged, reporting its real finding:

### release-tag-publication
- [info] AdxFactory:contracts/manifest.yaml — not checked: AdxFactory: the published tip 79f85b7c8 IS present in this clone and carries no contracts/manifest.yaml, so no contract bundle is declared there
- [info] OpsxFactory:… the published tip ad18b372f IS present in this clone …
- [info] codexFactory:… the published tip f4fa6abac IS present in this clone …
- [info] openxFactory:contracts/releases/contract-v2.6.digests.yaml — contract-v2.6 is declared SPENT: … RULED BY Brett Heap, 2026-09-02 …

All four submodules are still shallow afterwards (is-shallow-repository=true),
which is the --depth guard working in the direction it is for.

before after
"could not be read at the published tip" skips 4 0
repositories judged 0 4
family result one family-level skip 4 results

On the nightly itself the visible delta is smaller and honest: the nine
infos keep their info severity and gain the true reason, and openxFactory is
judged 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 existing FakeGit cannot express) where the fact is
a store fact, and over real git with a real origin where it is a transport
fact:

  • a tip this clone holds that carries no manifest is an answer, and nothing is
    fetched (the nine repositories)
  • an absent tip that can be fetched is fetched and then judged, + control: same
    shim with an unservable origin keeps the ratified skip
  • the fetch window is the walk window and not 1
  • a tag peeling to a commit this clone lacks is obtained, not unlistable, +
    control
  • a depth-bounded fetch never truncates a full clone, and an already-shallow one
    pays for exactly its window
  • a real published tip this clone lacks is obtained and graded (real origin,
    second clone pushes)
  • when the fetch cannot obtain it the ratified skip still stands (the
    fail-closed fallback)
  • a tip already held costs no round trip on real git
  • the self-gate: zero unfetched-tip skips over an aggregation-shaped estate,
    • positive control: break the fetch and exactly the absent-tip repository
      fires

python3 -m pytest tests/doc-health/test_release_tag_publication.py -q → 145
passed
. 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 main while this branch was in flight) reproduces its defect
by 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 tip in the second rendering. Those are exactly the words this PR
stops 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 configuration
notice 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-publication from _render_cmd and the test still reds.

scripts/doc_health/modified_block_currency.py is untouched (PR #640's file).

Closes #612.

…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]>
Copilot AI lite review requested due to automatic review settings September 4, 2026 05:47

@sourcery-ai sourcery-ai 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.

Hi @brettheap! 👋

Your private repo does not have access to Sourcery.

Please upgrade to continue using Sourcery ✨

Copilot AI 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.

🟢 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-level obtain_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.

Comment thread docs/doc-health.md
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).
Comment on lines +1116 to 1122
# 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])
Comment on lines +85 to +87
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]>
Copilot AI review requested due to automatic review settings September 4, 2026 06:38

Copilot AI 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.

🟡 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

Comment on lines +1121 to 1123
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:
@brettheap
brettheap merged commit 2177b2a into main Sep 4, 2026
9 checks passed
@brettheap
brettheap deleted the fix/612-release-tag-fetch-tip branch September 4, 2026 12:35
brettheap added a commit that referenced this pull request Sep 5, 2026
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants