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
145 changes: 145 additions & 0 deletions .github/workflows/wiki-currency.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
# Wiki-currency check — the single home of the "is the wiki current?" rules.
#
# This workflow is the ONLY place the check logic lives (symbol audit, idiom deny-list,
# provenance). It versions with the content it grades, which is why it lives in
# autofit_assistant and not in the release hub. Two triggers feed it:
#
# 1. workflow_call — invoked by PyAutoBuild at stack-release time with the new version,
# so a release that moves the API is graded against the wiki immediately. PyAutoBuild
# only calls and reports; it owns none of the rules below.
# 2. pull_request / schedule / workflow_dispatch — runs in this repo against the
# currently-released stack, catching drift introduced by assistant changes themselves.
#
# See skills/af_audit_skill_apis.md and modes/maintainer.md "Release-time wiki-currency
# check" for the two-trigger / one-check design.
name: wiki-currency

on:
workflow_call:
inputs:
stack_version:
description: "PyAutoFit version to install and check against (empty = latest released)."
required: false
type: string
default: ""
assistant_ref:
description: "Ref of autofit_assistant to check out (empty = the triggering ref)."
required: false
type: string
default: ""
workflow_dispatch:
inputs:
stack_version:
description: "PyAutoFit version to install and check against (empty = latest released)."
required: false
type: string
default: ""
pull_request:
# --- PAUSED 2026-07-06: routine cron disabled org-wide; re-enable by uncommenting ---
# schedule:
# # Mondays 06:00 UTC — re-check the wiki against the currently-released stack.
# - cron: "0 6 * * 1"

permissions:
contents: read

jobs:
wiki-currency:
runs-on: ubuntu-latest
env:
NUMBA_CACHE_DIR: /tmp/numba_cache
MPLCONFIGDIR: /tmp/matplotlib
PYAUTO_SKIP_WORKSPACE_VERSION_CHECK: "1"
steps:
# Always check out autofit_assistant. On native triggers github.ref already points
# here; under workflow_call github.ref is the *caller's* ref, so PyAutoBuild passes
# assistant_ref (e.g. main / the release tag) to pin the version of the rules used.
- name: Check out autofit_assistant
uses: actions/checkout@v4
with:
repository: PyAutoLabs/autofit_assistant
ref: ${{ inputs.assistant_ref || github.ref }}

- uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install the released stack
run: |
python -m pip install --upgrade pip
VER="${{ inputs.stack_version }}"
if [ -n "$VER" ]; then
echo "Installing autofit==$VER (pulls the pinned autoconf)."
pip install "autofit==$VER"
else
echo "Installing the latest released autofit."
pip install autofit
fi

# Citation paths are graded against the refs the docs pin (`main` checkouts),
# NOT the pip-installed release above — post-release file moves would otherwise
# false-fail the docs. The pip install stays the ground truth for the symbol /
# version / idiom checks (what users actually run); the clones land in sources/,
# the resolver's documented fallback. autofit_workspace is sparse-cloned to its
# cited surface (scripts/ + root catalogues) to skip the heavy dataset blobs.
- name: Clone cited source trees (citation ground truth)
run: |
mkdir -p sources
for repo in PyAutoConf PyAutoFit; do
git clone --quiet --depth 1 "https://github.com/PyAutoLabs/$repo" "sources/$repo"
done
git clone --quiet --depth 1 --filter=blob:none --sparse \
https://github.com/PyAutoLabs/autofit_workspace sources/autofit_workspace
# Cone mode: directories only; root-level catalogue files are included
# automatically.
git -C sources/autofit_workspace sparse-checkout set scripts

- name: Run wiki-currency checks
id: checks
run: |
set +e
REPORT=drift-report.md
{
echo "# Wiki-currency drift report"
echo
echo "- stack_version: \`${{ inputs.stack_version || 'latest released' }}\`"
echo "- assistant_ref: \`${{ inputs.assistant_ref || github.ref }}\`"
echo
} > "$REPORT"

fail=0
run() {
local name="$1"; shift
echo "## $name" >> "$REPORT"
echo '```' >> "$REPORT"
python autoassistant/audit_skill_apis.py "$@" >> "$REPORT" 2>&1
local rc=$?
echo '```' >> "$REPORT"
if [ "$rc" -ne 0 ]; then
echo "**FAILED** — \`$name\` exited $rc" >> "$REPORT"
fail=1
fi
echo >> "$REPORT"
}

# The released stack installed above is the ground truth for the first four
# checks; citations resolve against the sources/ clones from the previous
# step (the refs the docs pin — see skills/af_audit_skill_apis.md §6).
run "Version drift (--check-version)" --check-version
run "Symbol audit (--scope all)" --scope all
run "Idiom deny-list (--lint-idioms)" --lint-idioms
run "Provenance (--check-provenance)" --check-provenance
run "Citation paths (--check-citations)" --check-citations

cat "$REPORT" >> "$GITHUB_STEP_SUMMARY"
if [ "$fail" -ne 0 ]; then
echo "::error::wiki-currency drift detected — see the job summary / drift-report artifact."
fi
exit "$fail"

- name: Upload drift report
if: always()
uses: actions/upload-artifact@v4
with:
name: wiki-drift-report
path: drift-report.md
Loading
Loading