-
Notifications
You must be signed in to change notification settings - Fork 0
130 lines (125 loc) · 5.75 KB
/
Copy pathbrain_board.yml
File metadata and controls
130 lines (125 loc) · 5.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: Brain Board
# Publishes the Brain's operational board — the organism's morning door — to
# this repo's GitHub Pages URL: the page (index.html), its badge.json (the
# cross-board headline contract the umbrella router consumes), the raw
# board.json, and the markdown twin board.md.
#
# The board replaces the interactive /wake_up skill: everything that skill
# assembled by driving doors in sequence (overnight scheduled-run sweep, the
# Heart's readiness headline, version-stamp consistency, the community scan,
# resume context from the Mind, the upkeep doors) is collected here on a
# schedule and rendered with one-tap copy-for-Claude payloads. The renderer is
# board/_board.py; its vocabulary is config/policy.yaml `board:`.
#
# Unlike the Mind dashboard (self-healed into the repo, because its state IS
# the repo), nothing here is committed: the board's data is time-varying, so
# it is served from the Pages artifact only — a daily refresh makes no commit
# noise and can never drift against a repo copy.
#
# Cadence: 05:30 UTC daily — after the 02:00 nightly release driver and the
# Heart's 05:00 heart-health refresh (which rewrites the badge this board
# reads), before the human's morning. GitHub cron jitters 0–3 h under load,
# so the page stamps its own generation time and every consumer should trust
# that stamp over the schedule. workflow_dispatch is the manual refresh
# (also what a human taps when the board says it is stale).
on:
schedule:
- cron: "30 5 * * *"
workflow_dispatch:
# A dev-box publish (`pyauto-brain board publish`, usually morning.sh's
# last step) pushes state/devbox_board.json to main — republish so the
# board shows this morning's local observations a minute later.
#
# And whenever the page's own code changes. Merging a renderer or theme
# change used to leave the published board on yesterday's HTML until the
# next 05:30 cron, so the repo said one thing and the live page showed
# another — the emoji-vs-mark gap of #262 was visible for hours after it
# was fixed. The board is cheap to rebuild; rebuild it when it changes.
push:
branches: [main]
paths:
- "state/devbox_board.json"
- "board/**"
- "config/policy.yaml"
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: true
jobs:
publish:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
path: PyAutoBrain
# The board composes, it does not recompute: the community scan reads
# the body map (repos.yaml) and the resume section reads the registry +
# the Mind's own generated dashboard counts, so the Mind is checked out
# as a sibling — the same two-repo layout tests.yml uses.
- uses: actions/checkout@v4
with:
repository: ${{ github.repository_owner }}/PyAutoMind
path: PyAutoMind
# Hygiene runs IN THE CLOUD: check out the conductor's scan set
# (libraries + organs + workspaces, from the body map) so its --json
# pre-scan needs no dev box at all. Blobless clones + a sparse checkout
# of text/code files keep the big workspace datasets off the runner;
# a repo that fails to clone is simply absent — hygiene reports
# repos_present honestly rather than pretending it scanned everything.
- name: check out the hygiene scan set (blobless + sparse)
run: |
python3 -m pip install --quiet pyyaml
python3 - <<'EOF'
import subprocess, yaml
from pathlib import Path
repos = yaml.safe_load(Path("PyAutoMind/repos.yaml").read_text())["repos"]
for name, meta in sorted(repos.items()):
if meta.get("category") not in ("library", "organ", "workspace"):
continue
if Path(name).exists():
continue
home = meta.get("github")
if not home:
continue
url = f"https://github.com/{home}"
try:
subprocess.run(["git", "clone", "--quiet", "--depth", "1",
"--filter=blob:none", "--no-checkout",
url, name], check=True, timeout=300)
subprocess.run(["git", "-C", name, "sparse-checkout", "set",
"--no-cone", "*.py", "*.ipynb", "*.rst",
"*.md", "*.txt", "*.yaml", "*.yml", "*.toml",
"*.cfg", "*.ini", "*.sh", ".gitattributes"],
check=True, timeout=60)
subprocess.run(["git", "-C", name, "checkout", "--quiet"],
check=True, timeout=600)
except (subprocess.CalledProcessError,
subprocess.TimeoutExpired) as e:
print(f"::warning::scan checkout skipped {name}: {e}")
EOF
- name: render the board
env:
PYAUTO_ROOT: ${{ github.workspace }}
BOARD_HYGIENE_SCAN: "1"
run: |
python3 PyAutoBrain/board/_board.py --apply --out _site
# enablement: true creates the Pages site on first run where the token
# may (Mind/Heart precedent); where it may not (the Hands hit "Resource
# not accessible by integration"), the site must be created once
# out-of-band: gh api -X POST repos/<owner>/PyAutoBrain/pages -f build_type=workflow
- uses: actions/configure-pages@v5
with:
enablement: true
- uses: actions/upload-pages-artifact@v3
with:
path: _site
- id: deployment
uses: actions/deploy-pages@v4