Skip to content

Docs/infra/.github review: CODEOWNERS+concurrency, find_repo_root, infra hygiene, docs fixes#24

Merged
docxology merged 4 commits into
mainfrom
improve/docs-infra-github-review
Jun 5, 2026
Merged

Docs/infra/.github review: CODEOWNERS+concurrency, find_repo_root, infra hygiene, docs fixes#24
docxology merged 4 commits into
mainfrom
improve/docs-infra-github-review

Conversation

@docxology
Copy link
Copy Markdown
Owner

Summary

Clean, CI-verified subset of a docs/ + infrastructure/ + .github/ review pass, re-applied directly onto current main. (The original work branched before the recent Active-Inference PRs #19–22 landed; rather than force a 21-conflict merge that would re-resolve AI manuscript content, only the genuinely-additive, still-needed fixes are cherry-picked here.)

What's included (4 commits, all verified against current main)

  1. .github hygieneCODEOWNERS aligned to the 9-exemplar CI matrix (was 6, missing template_autoscientists/newspaper/textbook); concurrency: guards added to release.yml (no cancel-in-progress) and stale.yml. Symmetric diff vs the ci.yml test-project matrix is now empty; actionlint clean.
  2. find_repo_root() helper — centralizes repo-root computation in infrastructure.core.project_paths; routes 5 hard-coded Path(__file__).resolve().parents[N] sites to it, fixing a latent parents[4] bug in multi_project_cli (it resolved one level above the repo root; dormant only because callers always pass repo_root). RedTeam-audited for path-equivalence.
  3. Infrastructure quick wins — remove dead _load_plugin_manifest + unused import from cache_gate; portable XDG/~/.cache default (was root-only /var/cache); drop a redundant os.path.normpath wrapper in doctor/safety (.resolve() already normalizes); assert two real-but-untested facade exports in test_consistency_lint; document the six audit regexes in public_audit.
  4. Docs fixes — add the missing literature-data-flow.md row to docs/core/README.md; fix the broken Pitfall-6 anchor in documentation-index.md to the real heading slug.

Verification

  • ruff check + format (CI scope), mypy (776 files), check_template_drift --strict, module-line-count gate, tracked-projects guard, lint_docs (links/consistency/doc-pairs) — all green.
  • 165 affected infra tests pass; RedTeam adversarial pass on the find_repo_root refactor returned SAFE.

Deliberately deferred (separate follow-ups)

  • integration_audit.py split — it's 948 lines on main (WARN, 2 under the 950 fail line). The split is valuable but needs fresh re-derivation against main's current version (PR feat(active_inference): four AIF extensions — precision sweep, cue-T-maze, Dirichlet learning, Lean identity #22 modified it); risky to cherry-pick as-is. Worth its own focused PR.
  • TO-DO.md refresh — main's backlog is current for its state; my rewrite targeted a diverged fork copy.
  • A pre-existing figures.py mypy fix from the original branch was not needed — main's figures.py is already clean.

🤖 Generated with Claude Code

docxology added 4 commits June 5, 2026 15:46
…/stale concurrency

- CODEOWNERS listed 6 exemplars while ci.yml runs 9; added the 3 missing
  (template_autoscientists, template_newspaper, template_textbook). Symmetric
  diff against the ci.yml test-project matrix is now empty.
- release.yml: add concurrency group release-${{ github.ref }} with
  cancel-in-progress: false (never cancel an in-flight release).
- stale.yml: add concurrency group stale with cancel-in-progress: true.

Verified: comm -3 CODEOWNERS vs ci.yml matrix = empty (9 == 9); actionlint
exits 0 over all workflows; .github docs already state '9 exemplars x 2 = 18
cells' (no drift).
…epo_root()

Five call sites hard-coded Path(__file__).resolve().parents[N] with N varying
by file depth (2 or 3) — fragile to file moves and easy to get off by one. Add
find_repo_root() to core/project_paths.py (the canonical foundation helper, at a
fixed location) and route them through it:
- publishing/metadata_export_cli.py (was parents[2])
- orchestration/cli.py (was parents[2])
- validation/integrity/check_links.py (was parents[3])
- project/linking.py (was parents[2] fallback)
- core/pipeline/multi_project_cli.py: was parents[4], which resolved ABOVE the
  repo root — a latent bug, dormant only because the sole caller
  (scripts/execute_multi_project.py) always passes repo_root explicitly. Routing
  to find_repo_root() corrects it.

scanner.py deliberately left unchanged: its _find_repo_root_for_main() already
does a pyproject.toml marker-walk (strictly more robust than a fixed depth).

Verifier-first: proved each routed site's old parents[N] resolves to the same
dir as find_repo_root() at runtime. RedTeam adversarial pass (path equivalence,
the bugfix, import cycles, symlink/worktree edge cases, scanner skip) returned
SAFE with no defects. New test pins the find_repo_root contract.

Verified: ruff + mypy clean (6 files); 171 affected tests pass (linking,
orchestration cli, discovery, project_discovery incl. new find_repo_root test).
… default, redundancy, test/doc hygiene)

Each item re-verified against the tree before editing:
- cache_gate.py: remove dead _load_plugin_manifest (def only, zero callers) +
  now-unused Any import; make the default cache dir portable
  (XDG_CACHE_HOME/~/.cache instead of root-only /var/cache/template).
- doctor/safety.py: drop redundant os.path.normpath wrapper around
  Path.resolve() (resolve already normalises; behaviour-identical).
- test_consistency_lint.py: assert the two facade exports the smoke test had
  drifted past (check_memory_decision_rule_links, check_project_discovery_claims).
- public_audit.py: document the six top-level audit regexes (comments only).

Refuted/skipped (verifier-first): mermaid_lint macOS Chrome path is a
documented, .exists()-guarded tier-4 fallback — removing it would break Chrome
resolution on macOS without a puppeteer cache; left as-is. print()->logger in
cache_gate skipped: prints are intentional CLI gate output.

Verified: ruff check + format clean; mypy clean (3 files); tests pass —
consistency_lint+public_audit (8), doctor (49), cache_gate (3).
- docs/core/README.md: add the missing literature-data-flow.md row to the
  Contents table (file existed but was unlisted).
- docs/documentation-index.md: fix the broken Pitfall-6 link
  (#pitfall-6-root-venv had no matching heading) to the real generated anchor,
  matching the already-correct quick-start-cheatsheet.md link.
- docs/_generated/canonical_facts.md: modules-on-disk 516 -> 519 (this session
  added 3 infra validators; re-derived find infrastructure -name '*.py' | wc -l).

Verified: lint_docs.py PASS (0 broken cross-links, 0 consistency, 0 doc-pairs),
check_template_drift.py PASS.
@docxology docxology merged commit 49718f9 into main Jun 5, 2026
35 checks passed
@docxology docxology deleted the improve/docs-infra-github-review branch June 5, 2026 23:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant