Skip to content

Commit 6653b5b

Browse files
TMHSDigitalclaude
andcommitted
fix(drift-check): --all covers every live repo, not only active ones
--all now checks every registry entry except deprecated and archived, so experimental and beta tools (6 of 17 today) are no longer invisible to the weekly drift run. The token setup doc notes that a PAT scoped to selected repositories must include new entries. required-refs.json stays empty on purpose: the check has no warn tier, so any requirement would fail every repo at once. The comment now records that rationale and the rollout path. Closes #125 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: TMHSDigital <154358121+TMHSDigital@users.noreply.github.com>
1 parent 577d51c commit 6653b5b

4 files changed

Lines changed: 18 additions & 8 deletions

File tree

‎docs/drift-check-token-setup.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# `DRIFT_CHECK_TOKEN` setup
22

3-
The drift checker's `--all` / `--remote` mode sparse-checks every active
4-
tool repo from the registry. This requires cross-repo read access that
3+
The drift checker's `--all` / `--remote` mode sparse-checks every live
4+
tool repo from the registry (every status except `deprecated` and
5+
`archived`). If the token is scoped to selected repositories, add each new
6+
registry entry to its repository list. This requires cross-repo read access that
57
the workflow's auto-issued `GITHUB_TOKEN` does not have. `DRIFT_CHECK_TOKEN`
68
is the dedicated fine-grained PAT that fills that gap.
79

‎scripts/drift_check/cli.py‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,10 @@ def _resolve_gh_token(args_token: Optional[str]) -> Optional[str]:
297297

298298

299299
def _expand_all_repos(meta_repo_path: Path) -> List[str]:
300-
"""Read registry.json from the meta-repo and return active repo slugs
301-
(owner/name)."""
300+
"""Read registry.json from the meta-repo and return every live repo
301+
slug (owner/name): all statuses except ``deprecated`` and ``archived``.
302+
Experimental and beta repos are included because new tools are the
303+
ones most likely to drift."""
302304
import json
303305
reg_path = meta_repo_path / "registry.json"
304306
if not reg_path.is_file():
@@ -308,7 +310,10 @@ def _expand_all_repos(meta_repo_path: Path) -> List[str]:
308310
)
309311
raise SystemExit(2)
310312
data = json.loads(reg_path.read_text(encoding="utf-8"))
311-
return [r["repo"] for r in data if r.get("status") == "active"]
313+
return [r["repo"] for r in data if r.get("status") not in RETIRED_STATUSES]
314+
315+
316+
RETIRED_STATUSES = frozenset({"deprecated", "archived"})
312317

313318

314319
def _run_checks(snapshots: Sequence[RepoSnapshot]) -> List[Finding]:

‎standards/required-refs.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"version": 1,
3-
"_comment": "Required standards references per repo type. Q2 resolution: start permissive. Audit on 2026-04-24 found zero tool repos with standards/*.md links; shipping with an empty requirements block so the check is silent until tool repos start referencing standards deliberately. File a follow-up issue against Developer-Tools-Directory to populate this when the first tool repo adds a standards reference.",
3+
"_comment": "Required standards references per repo type. Intentionally empty: the required_refs check only emits errors (no warn tier), and a 2026-04-24 audit found zero tool repos linking standards/*.md, so any requirement here would fail every weekly drift run at once. Populate per repo type once tool repos reference standards deliberately, starting with one link (for example AGENTS.md -> standards/agents-template.md) rolled out across the fleet first. Revisited in DTD#125.",
44
"requirements": {
55
"cursor-plugin": {},
66
"mcp-server": {}

‎tests/test_cli_remote_flags.py‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ def meta_repo(tmp_path: Path) -> Path:
2727
{"repo": "TMHSDigital/Alpha", "status": "active"},
2828
{"repo": "TMHSDigital/Beta", "status": "active"},
2929
{"repo": "TMHSDigital/Stale", "status": "archived"},
30+
{"repo": "TMHSDigital/Fresh", "status": "experimental"},
31+
{"repo": "TMHSDigital/Old", "status": "deprecated"},
3032
]),
3133
encoding="utf-8",
3234
)
@@ -59,7 +61,7 @@ def test_all_without_registry_errors(capsys, tmp_path: Path):
5961
assert "registry.json" in capsys.readouterr().err
6062

6163

62-
def test_all_expands_active_repos(capsys, meta_repo: Path):
64+
def test_all_expands_live_repos(capsys, meta_repo: Path):
6365
"""--all without a working network would normally fail at sparse-checkout.
6466
We patch build_remote_snapshot to verify the expansion logic only."""
6567
seen = []
@@ -79,7 +81,8 @@ def fake_remote(repo_slug, **kw):
7981
with patch("scripts.drift_check.cli.build_remote_snapshot", side_effect=fake_remote):
8082
rc = cli.main(["--all", "--gh-token", "x", *_base(meta_repo)])
8183
# 2 active entries; archived is skipped
82-
assert {s for s, _ in seen} == {"Alpha", "Beta"}
84+
# Every live repo, including experimental; retired statuses excluded.
85+
assert {s for s, _ in seen} == {"Alpha", "Beta", "Fresh"}
8386
assert all(o == "TMHSDigital" for _, o in seen)
8487
# Empty snapshots have no findings -> exit 0
8588
assert rc == 0

0 commit comments

Comments
 (0)