Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/seal-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# T70: this gate classifies a broken seal as `dangling` (spec was
# committed, then deleted -- remove the seal with it) or `phantom`
# (spec appears in NO commit -- find it or drop the seal), and it
# decides from `git log --all`. A depth-1 checkout has no history,
# so the dangling arm could never fire here and all 74 printed as
# phantom with the wrong repair attached. l1-traceability.yml and
# now-sync-gate.yml already set this for the same reason.
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.12"
Expand Down
25 changes: 25 additions & 0 deletions docs/now/2026-08-23-seal-gate-had-no-history.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# NOW -- the seal gate decided from history CI does not have (2026-08-23)

Refs #2325.

- `check_seal_coverage.py` classifies a broken seal as `dangling` (spec was
committed then deleted -- "remove the seal with it, or restore both") or
`phantom` (spec appears in NO commit -- "find the spec or drop the seal").
It decides from `git log --all`.
- `seal-coverage.yml` used a bare `actions/checkout@v4`, i.e. depth 1. There
is no history in a one-commit clone, so the dangling arm could never fire
and every one printed as phantom -- wrong class, wrong prescribed repair, on
the only output the gate prints. `l1-traceability.yml` and `now-sync-gate.yml`
already set `fetch-depth: 0`, so the omission was load-bearing.
- Measured in a real `--depth=1` clone, three ways:

full history dangling 89, no-spec-path 5, stale 191
shallow, before fix PHANTOM 89, no-spec-path 5, stale 191
shallow, after fix dangling 89, no-spec-path 5, stale 191

- Two changes, because either alone is half: `fetch-depth: 0` in the workflow,
and `_ever_existed` now detects a shallow checkout and returns the milder
classification instead of answering a question it cannot see. A gate that
reads its own verdict out of a truncated instrument is the broken-ruler
error, and this function's docstring already records the author falling into
it once -- an earlier pass overstated by fivefold.
27 changes: 27 additions & 0 deletions tools/check_seal_coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,21 @@ def scan(root=ROOT):


_EVER = {}
_SHALLOW = {}


def _shallow(root):
"""True when this checkout has no history to ask about."""
if root in _SHALLOW:
return _SHALLOW[root]
try:
r = subprocess.run(["git", "rev-parse", "--is-shallow-repository"],
cwd=root, capture_output=True, text=True, timeout=10)
val = r.stdout.strip() == "true"
except Exception:
val = False
_SHALLOW[root] = val
return val


def _ever_existed(root, sp):
Expand All @@ -107,6 +122,18 @@ def _ever_existed(root, sp):
"""
if sp in _EVER:
return _EVER[sp]
# T70: in a SHALLOW clone there is no history to ask, and answering "never
# committed" from a one-commit checkout is not a measurement -- it is the
# broken-ruler error, with the instrument inside the failure domain. CI
# used a bare `actions/checkout@v4`, i.e. depth 1, so the exact-path arm
# could never fire and every deleted spec printed `phantom` ("the spec
# appears in NO commit -- find the spec or drop the seal") instead of
# `dangling` ("remove the seal with it, or restore both"). Wrong class,
# wrong prescribed repair, on the only output the gate prints. Measured in
# a real --depth=1 clone: {stale 191, dangling 74, phantom 15} became
# {stale 191, phantom 89, dangling 0}.
if _shallow(root):
return True # cannot tell: assume the milder classification
base = os.path.basename(sp)
hit = False
for args in (["--", sp], ["--", "*/" + base]):
Expand Down
Loading