Repository navigation
937 lines (782 loc) · 40.9 KB
/
Copy pathvalidate.yml
File metadata and controls
937 lines (782 loc) · 40.9 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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
name: Validate YAML and Frontmatter
# A fork whose default branch is a user/* branch (this repo's own instances
# included) would otherwise get no validation at all, so the glob is here too.
on:
push:
branches: [main, 'user/**']
pull_request:
branches: [main, 'user/**']
# Reusable: release.yml calls this suite as a job and its release job
# needs it, so no release is cut from a commit these checks did not pass.
# Same checks as a PR, no duplicated steps.
workflow_call:
# Manual re-run on any ref (e.g. before cutting a tag).
workflow_dispatch:
jobs:
yaml-lint:
name: YAML Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Install yamllint
run: pip install yamllint
- name: Run yamllint
run: yamllint -c .yamllint.yml .
ecosystem-validation:
name: Ecosystem Cross-Refs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Check ecosystem.yaml exists
id: check
run: |
if [ -f ecosystem.yaml ]; then
echo "exists=true" >> "$GITHUB_OUTPUT"
else
echo "exists=false" >> "$GITHUB_OUTPUT"
echo "::notice::ecosystem.yaml not found — skipping ecosystem-validation (expected for open-bridge / OSS repos)"
fi
- name: Install PyYAML
if: steps.check.outputs.exists == 'true'
run: pip install pyyaml
- name: Validate ecosystem.yaml cross-refs
if: steps.check.outputs.exists == 'true'
run: python3 scripts/validate-ecosystem.py
- name: Run validator fixture tests
if: steps.check.outputs.exists == 'true' && hashFiles('scripts/tests/test-validate-ecosystem.sh') != ''
run: bash scripts/tests/test-validate-ecosystem.sh
schema-validation:
name: Bridge Config Schemas
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Install check-jsonschema
run: pipx install check-jsonschema
- name: Validate all schema-bearing surfaces
run: python3 scripts/validate-bridge.py
# validate-bridge.py holds the LIVE inventories against the schema. It
# cannot tell whether a rule is still enforced, because a rule nobody
# violates and a rule that was deleted look identical from a green run.
# These two do: the first asserts every negative control fails for its
# own reason, the second removes each rule in turn and proves the right
# control goes hollow.
- name: Run remote inventory schema contract
run: bash infra/remotes/_tests/run.sh
- name: Prove every remote-inventory control still bites
run: bash infra/remotes/_tests/run.sh --mutate
# The object-store declarations, measured the same way: every negative
# control fails for its own reason, and removing a rule hollows exactly
# the control that belongs to it (docs/object-store.md).
- name: Run object-store schema contract
run: bash infra/object-stores/_tests/run.sh
- name: Prove every object-store control still bites
run: bash infra/object-stores/_tests/run.sh --mutate
okf-export:
name: OKF Export
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Install PyYAML + pytest
run: pip install pyyaml pytest
- name: Run OKF exporter test suite
run: bash scripts/tests/test-okf-export.sh
script-suites:
name: Board Generator + Frontmatter + Rule Map + Context Budget
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Install PyYAML + pytest
run: pip install pyyaml pytest
- name: Run board generator test suite
run: bash scripts/tests/test-gen-board.sh
- name: Run frontmatter extractor test suite
run: bash scripts/tests/test-extract-frontmatter.sh
- name: Run rule-inventory test suite
run: bash scripts/tests/test-validate-bridge-rule-map.sh
- name: Run standing-order contract test suite
run: bash scripts/tests/test-standing-orders.sh
- name: Run config-slice test suite
run: bash scripts/tests/test-bridge-config.sh
- name: Run doc-route test suite
run: bash scripts/tests/test-doc-routes.sh
- name: Run work-log slice test suite
run: bash scripts/tests/test-worklog.sh
- name: Run context-index test suite
run: bash scripts/tests/test-context-index.sh
- name: Run memory-location test suite
run: bash scripts/tests/test-memory-location.sh
- name: Run skill-learnings test suite and check
run: python3 -m pytest scripts/tests/test_skill_learnings.py -q -rs && python3 scripts/check-skill-learnings.py
- name: Run question-map test suite and check
run: python3 -m pytest scripts/tests/test_where_things_live.py -q -rs && python3 scripts/check-where-things-live.py
- name: Run inbox, workplace, briefing-advice and briefing-profile test suites
run: bash scripts/tests/test-inbox.sh
# The cmux workplace driver (optional skill). Runs against a fake `cmux`
# on PATH, never the real one, so it needs no cmux on the runner.
- name: Run cmux skill test suite
run: python3 -m pytest -q skills/cmux/tests
# The cockpit relay (mods/cockpit-relay): its pure functions, checked against the server's relay.py.
- name: Run cockpit-relay mod tests
run: npx -y -p typescript@5.6.3 -c 'node mods/cockpit-relay/tests/pure.test.mjs'
# The Bridge cockpit (scripts/bridge-cockpit.py, docs/bridge-cockpit.md).
# Hermetic: the server suites run against a temp Bridge with a fake runner,
# the frontend suites are node:test without npm dependencies.
- name: Run bridge-cockpit server tests
run: python3 -m pytest scripts/tests/test_ai_services.py scripts/tests/test_bridge_cockpit*.py scripts/tests/test_cockpit_costs_contract.py scripts/tests/test_task.py scripts/tests/test_task_review.py scripts/tests/test_triage.py scripts/tests/test_bridge_resources.py scripts/tests/test_cloud_inventory.py -q -rs
# The heap cap and the per-test timeout end a runaway view (a render loop, an unbounded list) in seconds
# instead of filling the runner; the suites peak near 80 MB of heap and finish in seconds
# (scripts/tests/cockpit_render.mjs § the runaway guard).
- name: Run bridge-cockpit frontend tests
run: node --max-old-space-size=512 --test --test-timeout=30000 scripts/tests/bridge_cockpit_*.test.mjs # every frontend suite, the glob keeps a new one from being left out
# The mail-draft engine (skills/mail-draft). Hermetic: osascript is
# replaced in every client test, so nothing reaches a mail client. The
# mutation battery proves each guard (body never in argv, draft verified,
# stale notice hidden, ...) has a test that notices it being softened.
- name: Run mail-draft skill suite and mutation battery
run: |
pip install jsonschema
bash skills/mail-draft/run-tests.sh
bash skills/mail-draft/run-tests.sh --mutate
MAIL_DRAFT_ROOT=skills/mail-draft/tests/fixtures/bridge skills/mail-draft/mail-draft.sh validate
# The inbox notifier (skills/inbox-notify). Hermetic: signal-cli is a fake on
# PATH that records calls and replays scripted votes; no message leaves the runner.
- name: Run inbox-notify skill suite
run: bash skills/inbox-notify/run-tests.sh
- name: Validate briefing profiles
run: python3 scripts/briefing.py validate && python3 scripts/briefing.py --root examples/portfolio validate
- name: Run command-reference test suite and check
run: python3 -m pytest scripts/tests/test_commands_doc.py -q -rs && python3 scripts/check-commands-doc.py
- name: Run learning-ledger test suite
run: pip install "jsonschema>=4.18" && bash scripts/tests/test-learning-ledger.sh
- name: Every worked example validates against the CORE schemas
run: pip install "jsonschema>=4.18" && python3 -m pytest scripts/tests/test_examples_schema.py -q -rs
- name: Run reachability test suite
run: bash scripts/tests/test-reachability.sh
- name: Data model contract (every family once, renderings generated)
run: bash scripts/tests/test-data-model.sh
- name: AGENTS.md keeps its invariants, imports and pointers
run: python3 -m pytest -q scripts/tests/test_kernel_invariants.py scripts/tests/test_entry_file.py scripts/tests/test_onboarding_one_path.py
- name: Run edge-guard test suite
run: bash scripts/tests/test-edges.sh
# An always-on document earns its size by pointing at the file that owns
# a mechanic instead of restating it. That trade only holds while the
# pointer resolves, and a dead pointer fails silently, at the moment
# somebody needed the thing it pointed at.
- name: Every route in an always-on document resolves
run: python3 scripts/check-doc-routes.py
- name: Hold the CORE/USER figure to the tree
run: python3 scripts/check-figure-counts.py
# A broken inline script never runs and the page still renders, still
# parses as HTML and still screenshots correctly. Nothing else here looks
# at the JavaScript in docs/.
- name: Every inline script in docs/ parses
run: python3 scripts/check-inline-scripts.py
# .nojekyll means Pages serves markdown raw, so a relative .md link takes
# the reader to an unstyled file. Deep links into repo documents go to
# GitHub; only .html is linked relatively.
- name: Every internal link on the site resolves
run: python3 scripts/check-site-links.py
# No build step, so the site's house rules are checked instead: canonical
# link and sitemap entry per page, robots and 404, og:locale on the
# bilingual pages, the palette equal to DESIGN.md `site:`, and no schema
# $id pointing at a Pages address with no file behind it.
- name: The site stands on the repo's rules
run: python3 scripts/check-site-basics.py
# Refuses an order that defers without a trigger or without a summary.
# Such a file reads as enforced in the tree and loads in no session, which
# is a worse failure than the cost the contract removes.
- name: Validate the standing-order load contract
run: python3 scripts/standing-orders.py --check
- name: Run context-budget test suite
run: bash scripts/tests/test-measure-context.sh
# The declaration is the failure surface the index adds. A name in
# `keep:` or `sections:` that the source does not have is absorbed in
# silence: the real key falls through to "also present", its content
# stops being resident, and the card still renders and still passes its
# cap. Same run also proves the parser can slice everything the index
# advertises, on this tree rather than on a fixture.
- name: Every declared card checks out against its source
run: python3 scripts/context-index.py --check
# The budget proves the always-on layer is small and the index proves a
# body can be fetched. Neither proves a session still KNOWS the body is
# there. A cut that removes the last mention of a config family leaves
# every other check green and the capability gone, because nothing will
# go looking for it. Five families were in that state when this was
# first run, none of them caused by a cut — they had never been named.
- name: Every config family is reachable, and the scenarios walk
run: python3 scripts/check-reachability.py
# A sub-agent loads the entry file, its @-imports and the listings, and
# no Phase 1: no standing order, no registry card. A family named only in
# an eager order is resident in the session and invisible to every
# dispatch. CORE names its families in kernel/families.yaml, which AGENTS.md
# imports, so this passes by construction once the index is imported.
- name: Every config family is reachable from a sub-agent too
run: python3 scripts/check-reachability.py --surface subagent
# And the check has to be able to fail. Hide each pointer in turn and
# demand a finding: a needle that matches nothing softens nothing.
- name: Prove every reachability needle bites
run: python3 scripts/check-reachability.py --mutate
# One picture of the data model, held to the tree: every config family
# is described exactly once in docs/data-model.yaml, and the tables in
# docs/data-model.md, the ring on the landing page and kernel/families.yaml
# (imported by AGENTS.md) are generated from it; it also checks every
# route/skill/guide field and guards the AGENTS.md kernel sections.
# The landing page said "the agent reads every ring" for weeks after
# that stopped being true, because nothing compared it with anything.
- name: The data model covers every family, and its renderings match it
run: python3 scripts/data-model.py
- name: Prove every data-model needle bites
run: python3 scripts/data-model.py --mutate
# The reference grammar lives in rules/secret-placement.md and in five
# machine copies, each of them a literal on purpose, because two of the
# skills that carry one have to keep working when their directory is
# copied out of the repo alone. Measured the day this ran first: three of
# the copies disagreed with the rule and with each other, and the account
# template used a sixth scheme that no list defined.
- name: Every copy of the secret-reference grammar says the same thing
run: python3 scripts/check-secret-grammar.py
- name: Prove the grammar comparison bites
run: python3 scripts/check-secret-grammar.py --mutate
- name: The grammar check has its own suite
run: python3 -m pytest scripts/tests/test_secret_grammar.py -q
# The object reference grammar has one source (the object-store schema)
# and a guard from its first commit, and the same script holds the ADR's
# hard never: nothing a session reads before its first answer may point
# at an object.
- name: Every copy of the object grammar agrees, and nothing always-on points at an object
run: python3 scripts/check-object-grammar.py
- name: Prove the object grammar check bites
run: python3 scripts/check-object-grammar.py --mutate
- name: The object grammar check has its own suite
run: python3 -m pytest scripts/tests/test_object_grammar.py -q
# The same shape one layer up: three places scan for a plaintext secret,
# and before this check they had drifted in every direction. The promote
# table had no AIza and no github_pat_, the overlay list had neither plus
# no Bearer, and the third list lived in an instance-only rule that never
# reached CORE at all.
- name: Every scanner knows the same plaintext shapes
run: python3 scripts/check-secret-patterns.py
- name: Prove the pattern comparison bites
run: python3 scripts/check-secret-patterns.py --mutate
- name: The pattern check has its own suite
run: python3 -m pytest scripts/tests/test_secret_patterns.py -q
# The third layer. Entries reference each other in ordinary fields —
# a customer names its mandant, an account names the task that
# provisioned it — and nothing checked that those resolve. On a live
# instance 38 of 145 did not, and 20 of those had simply moved KIND:
# the documented `mv work/{from}/{slug}` lifecycle, with no reference
# pulled along. open-bridge itself declares none, so this is quiet
# upstream and load-bearing downstream, which is the correct shape.
- name: Every declared reference between entries resolves
run: python3 scripts/check-edges.py
# The hook is the enforcement that runs before a commit exists, on every
# branch, and the only one an instance gets where this workflow never
# runs: a private fork with Actions off, or a clone with no CI at all.
# (The workflow itself triggers on `main` and `user/**` alike.) Its gate
# is a shell &&/|| chain, which is the kind that reads correct and
# behaves otherwise, so its three branches per guard are asserted.
- name: The pre-commit always-on gate keeps its contract
run: sh scripts/tests/test-precommit-guards.sh
# The Stop hook is the other half of that enforcement, and the half that
# can fail in BOTH directions: too loose and drift ships, too eager and
# every turn blocks until somebody switches it off with `.bridge-nolog`,
# which is what happened on the instance this was found on, for 57 days.
# Both directions are asserted, the two live false positives included.
- name: The Stop hook bites the right files and only those
run: bash scripts/tests/test-worklog-drift-check.sh
# The gate itself, on the live tree. Bytes are exact and offline, so this
# needs no key and no network; token counts ride along as an estimate and
# never fail the build. A new always-on file that nobody declared fails
# here on purpose — a meter that cannot see a new file reports green
# while the thing it watches grows.
- name: Hold the always-on context to its budget
run: python3 scripts/measure-context.py
# The scope router decides which files may reach a PUBLIC repo, and its
# 551-line regression suite ran nowhere until 2026-08-27. Two of its
# guards re-derive their answer from the tree instead of a hand-kept list,
# so a family added next to a registered one can no longer go stale in
# silence. Both were red when they were written.
- name: Run scope-router regression suite
run: python3 -m pytest scripts/tests/test_scope_router.py -q
# The kernel (docs/kernel.md): kernel/manifest.yaml names every file a
# session reads before its first answer, where it lives, when it is read
# and which file links it, and check-kernel.py holds each promise to the
# router, the meter and the data model. docs/ is tiered by folder like
# rules/; the suites pin that rule, the scope tables that document it, and
# the one-time move a fork runs (scripts/migrate-docs-tier.py).
- name: Hold the kernel manifest to the tree
run: python3 scripts/check-kernel.py
- name: Run kernel, docs-tier and scope-docs suites
run: >-
python3 -m pytest -q scripts/tests/test_check_kernel.py
scripts/tests/test_docs_tier.py scripts/tests/test_migrate_docs_tier.py
scripts/tests/test_scope_docs.py
# The archive plan. /archive used to take "the oldest bucket with content"
# and then reset the WHOLE log, so a log holding twelve periods archived one
# and lost eleven. These pin that one run names every closed period, that the
# open one stays, and that the year comes from the rows rather than from today.
- name: Run archive-plan contract
run: python3 -m pytest scripts/tests/test_archive_buckets.py -q
# The daily upstream auto-update. It used to stop at the first predicted
# conflict and, since nothing resolved one, every morning after. These run
# the real script against throwaway repos: a promoted-then-followed-up file
# takes upstream, a revert or a never-promoted edit is held, one held file
# holds the run with the branch untouched, a dirty log does not block.
- name: Run upstream auto-update contract
run: python3 -m pytest scripts/tests/test_upstream_autoupdate.py -q
# The scheduled archive. Order is the safety property: every archive file is
# written and verified before log.md is touched, because until then the log is
# the only place those rows exist. These also pin the refusals — an existing
# archive is never overwritten, and it declines off a user/* branch.
- name: Run scheduled-archive contract
run: python3 -m pytest scripts/tests/test_archive_autorun.py -q
# Contracts for the promote/export path and the commit seam: the scope
# router's classifier, the overlay exporter (exclusions, never_promote,
# overlay-managed files survive a prune), the pre-commit .env guard, the
# pre-push content net, the state reader taking no index lock, and the
# validator surfaces covering every schema-bearing family.
- name: Run promote, export and guard contracts
run: >-
python3 -m pytest -q
scripts/tests/test_categorize_commits.py
scripts/tests/test_extract_bridge_state_locks.py
scripts/tests/test_overlay_export.py
scripts/tests/test_overlay_export_exclusions.py
scripts/tests/test_overlay_export_managed_prune.py
scripts/tests/test_precommit_env_guard.py
scripts/tests/test_push_guard_content_net.py
scripts/tests/test_validators_coverage.py
# Every suite in scripts/tests, by directory. The steps above name their
# suites one by one, next to the check each one guards, and a list kept by
# hand leaves out the suite nobody remembered: twelve of them ran in no
# job until this one existed. The glob cannot forget a file. It does run
# the named suites a second time, which costs minutes and buys a list that
# stays complete. scripts/tests/test_ci_wiring.py holds every test_*.py in
# the tree to SOME job, this one or another.
script-tests:
name: Every scripts/tests Suite
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Install test dependencies
run: |
pip install pyyaml pytest "jsonschema>=4.18"
pipx install check-jsonschema
- name: Run every suite in scripts/tests
run: python3 -m pytest scripts/tests -q -rs
# Skill suites that are plain pytest and had no job. Their own job, and one
# pytest run per skill: each skill puts its own directory on sys.path and
# imports its package by a short name (`engine`), and two of those in one
# session would shadow each other.
skill-pytest:
name: Skill Suites (board-pilot, html-canvas, html-slides, bridge-audit)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
# Both suites import yaml (board-pilot's engine config, html-canvas's
# design-to-css), so it is installed here like in every peer job rather
# than left to whatever the runner image happens to ship.
- name: Install pytest and pyyaml
run: pip install pyyaml pytest
# html-slides' PowerPoint export (scripts/render-pptx.py) needs python-pptx.
# Its suite fails instead of skipping when CI is set, so a missing package
# shows up here rather than as a quietly skipped module.
- name: Install python-pptx
run: pip install python-pptx==1.0.2
# The html-canvas and html-slides browser tests open each page from an
# empty dir over file:// in headless chromium. Without it they skip, and
# a skipped browser test proves nothing about the offline contract.
# Same pin as the cockpit demo smoke job.
- name: Install playwright and chromium
run: |
pip install playwright==1.64.0
python3 -m playwright install --with-deps chromium
# The board-driven pipeline engine. Hermetic: every gh and claude call
# is faked, git runs in throwaway repos with a local identity.
- name: Run board-pilot suite
run: python3 -m pytest skills/board-pilot/tests -q -rs
- name: Run html-canvas suite
run: python3 -m pytest skills/html-canvas/tests -q -rs
# Slide engine, deck assembler, stage and send checks. It consumes the
# html-canvas scripts by relative path, so it runs after that suite.
- name: Run html-slides suite
run: python3 -m pytest skills/html-slides/tests -q -rs
# The audit's checker runner (Check 16). Hermetic: it runs fixture
# checkers in a temp tree, never the repository's own.
- name: Run bridge-audit suite
run: python3 -m pytest skills/bridge-audit/tests -q -rs
# The briefing's meeting-obligation check (Stream A 5b). Hermetic: a temp
# Bridge with a local wiki directory, no clone, no network.
- name: Run briefing meeting-obligations suite
run: python3 -m pytest skills/briefing/tests/test_meeting_obligations.py -q -rs
# The greeting's usage panel. Hermetic: one bash function against a cache
# file in a temp directory, no network.
- name: Run bridge-greeting suite
run: python3 -m pytest skills/bridge-greeting/tests -q -rs
# The cockpit demo (docs/cockpit-demo/) in a real browser: every page of the
# page bar opens, in en and de, without a console error. Its own job, so the
# browser download stays out of the script-suites job.
cockpit-demo-smoke:
name: Cockpit Demo Browser Smoke
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Install pytest + Playwright with Chromium
run: |
pip install pytest playwright==1.64.0
python3 -m playwright install --with-deps chromium
- name: Open every demo page and fail on console errors
env:
COCKPIT_DEMO_SMOKE: require
run: python3 -m pytest scripts/tests/test_cockpit_demo_smoke.py -q -rs
# The workload skill carries three suites of its own, and each answers a
# different question. The skill writes unit files onto machines: a contract it
# can break unnoticed is the one contract that ends up on a service manager.
#
# * the engine suite does the code still do what it says
# * the schema contract is every rule still enforced, and does every negative
# control still name the rule it proves
# * the mutation battery do those controls still BITE. Two needles had gone
# hollow before anyone noticed: one matched nothing
# after a rule was restructured, one matched twice
# after a second spelling appeared. A needle that
# matches nothing softens nothing, and the run still
# reported green for the rest.
workload-suites:
name: Workload Engine + Schema Contract + Mutations
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Install PyYAML + check-jsonschema
run: |
pip install pyyaml
pipx install check-jsonschema
- name: Run workload engine suite
run: bash skills/workload/run-tests.sh
- name: Prove every engine test still bites
run: bash skills/workload/run-tests.sh --mutate
- name: Run declaration schema contract
run: bash workflow/workloads/_tests/run.sh
- name: Prove every negative control still bites
run: bash workflow/workloads/_tests/run.sh --mutate
secrets-suites:
name: Secrets Broker + Mutations
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
# The engine itself needs nothing but the standard library. The store
# declarations are YAML, so the suite that reads them needs a parser, and
# a job that relies on the runner image happening to carry one is a job
# that breaks on an image update with a failure that names the wrong file.
- name: Install PyYAML
run: pip install pyyaml
- name: Run the secrets engine suite
run: bash skills/secrets/run-tests.sh
- name: Prove every secrets test still bites
run: bash skills/secrets/run-tests.sh --mutate
object-store-suites:
name: Object Store Resolver + Mutations
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
# Standard library only, except PyYAML for the declarations. S3 is played
# by an in-memory fake on loopback; the suite's guard refuses any other
# connection and any child process.
- name: Install PyYAML
run: pip install pyyaml
- name: Run the object-store resolver suite
run: bash skills/object-store/run-tests.sh
- name: Prove every object-store test still bites
run: bash skills/object-store/run-tests.sh --mutate
a2a-suite:
name: A2A Skill
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
# Hermetic: every HTTP call is stubbed, no keychain, no network. PyYAML
# reads the peer files, jsonschema holds the shipped template to its schema.
- name: Install test dependencies
run: pip install pyyaml pytest jsonschema
- name: Run the a2a skill suite
run: bash skills/a2a/run-tests.sh
workspace-tests:
name: Workspace Engine + Registry + Skill
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Install PyYAML
run: pip install pyyaml
- name: Run workspace engine test suite
if: hashFiles('scripts/tests/test-workspace.sh') != ''
run: bash scripts/tests/test-workspace.sh
- name: Run workspace registry test suite
if: hashFiles('scripts/tests/test-workspace-registry.sh') != ''
run: bash scripts/tests/test-workspace-registry.sh
- name: Run workspace skill conformance test suite
if: hashFiles('scripts/tests/test-workspace-skill.sh') != ''
run: bash scripts/tests/test-workspace-skill.sh
content-leak:
name: Content Leak Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
# This job ends on a pytest step. Without this install it fails with
# "No module named pytest" on every run, which nobody saw because the
# suite was gated to a branch this instance never pushes to.
- name: Install test dependencies
run: pip install pyyaml pytest
# Full-repo scan (no file args = CI mode). Catches scrub-leak
# pipe-list scopes plus PII content classes (personal names,
# /Users/ paths, @your-org.com addresses, customer names) with
# per-class allowlists for governance files — see the script header.
# Core-branch only. On a user/* branch the instance's own name, paths
# and customers are the CORRECT content, so a full-repo scan there
# reports the working state as a leak.
- name: Scan for content leaks
if: ${{ !startsWith(github.ref_name, 'user/') }}
run: python3 scripts/no-scrub-leak.py
# A control character in generated markup is invisible in the source and
# kills the publish step somewhere else entirely. See the script header.
- name: Reject control characters in generated markup, CSS and JS
run: python3 scripts/check-generated-output.py
- name: Guard's own contract
run: python3 -m pytest scripts/tests/test_generated_output_escapes.py -q
skill-scope:
name: Skill Scope + AGENTS.md
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Install PyYAML
run: pip install pyyaml
- name: Validate skill scope + AGENTS.md SKILL-SCOPE block
run: python3 scripts/validate-skill-scope.py --check
- name: Validate STATUS.md status enum
run: python3 scripts/validate-status.py
frontmatter-check:
name: Frontmatter Validation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Validate agent frontmatter
run: |
errors=0
# Skip:
# - _templates/ (templates have placeholder frontmatter)
# - README.md (documentation markers, not agent definitions)
# - _*.md (underscore-prefixed files like _instance.md are
# meta-templates describing schemas, not agent files)
for file in $(find .claude/agents -name '*.md' \
-not -path '*/agents/_templates/*' \
-not -name 'README.md' \
-not -name '_*.md'); do
# Extract frontmatter (between first --- and second ---)
frontmatter=$(awk '/^---$/{n++; next} n==1{print} n==2{exit}' "$file")
if [ -z "$frontmatter" ]; then
echo "ERROR: $file — missing frontmatter block"
errors=$((errors + 1))
continue
fi
for field in name description; do
if ! echo "$frontmatter" | grep -q "^${field}:"; then
echo "ERROR: $file — missing required field: $field"
errors=$((errors + 1))
fi
done
done
if [ "$errors" -gt 0 ]; then
echo ""
echo "Found $errors frontmatter error(s) in agent files."
exit 1
fi
echo "All agent files have valid frontmatter."
- name: Block personas with PII on the core branch
if: ${{ !startsWith(github.ref_name, 'user/') }}
run: |
# Personas carry tax_id, vat_id, iban, address — USER-layer only.
# The only persona files allowed on the core branch are the template
# and the locale-neutral examples/.
errors=0
if [ -d identity/personas ]; then
for file in $(find identity/personas -name '*.yaml' \
-not -name '_template.yaml' \
-not -name '_schema.yaml' \
-not -path '*/personas/examples/*'); do
echo "ERROR: $file — persona files with real data must not land on the core branch"
echo " (commit them on your user/{name} branch instead)"
errors=$((errors + 1))
done
fi
if [ "$errors" -gt 0 ]; then
echo ""
echo "Found $errors persona file(s) that must not be on the core branch."
echo "See rules/operations.md for the USER-layer path rules."
exit 1
fi
echo "No USER-layer persona files leaked to the core branch."
- name: Block active agent instances on the core branch
if: ${{ !startsWith(github.ref_name, 'user/') }}
run: |
# .claude/agents/active/<instance-id>/ holds stateful, learned,
# per-user instance files (role.md, process.md, knowledge.md,
# log.md). They are USER-layer only — tied to a specific
# persona, context, and learned knowledge. Only the README.md
# marker is CORE.
errors=0
if [ -d .claude/agents/active ]; then
for file in $(find .claude/agents/active -type f \
-not -name 'README.md'); do
echo "ERROR: $file — active instance files are USER-layer only"
echo " (commit them on your user/{name} branch instead)"
errors=$((errors + 1))
done
fi
if [ "$errors" -gt 0 ]; then
echo ""
echo "Found $errors active-instance file(s) that must not be on the core branch."
echo "See rules/operations.md — agents/* path rules exclude _templates and presets only."
exit 1
fi
echo "No USER-layer active instance files leaked to the core branch."
- name: Validate standing-order frontmatter
run: |
errors=0
for file in $(find protocols/standing-orders -maxdepth 1 -name '*.md' \
-not -name 'README.md'); do
frontmatter=$(awk '/^---$/{n++; next} n==1{print} n==2{exit}' "$file")
if [ -z "$frontmatter" ]; then
echo "ERROR: $file — missing frontmatter block"
errors=$((errors + 1))
continue
fi
for field in name scope enforcement applies_to; do
if ! echo "$frontmatter" | grep -q "^${field}:"; then
echo "ERROR: $file — missing required field: $field"
errors=$((errors + 1))
fi
done
done
if [ "$errors" -gt 0 ]; then
echo ""
echo "Found $errors frontmatter error(s) in standing-order files."
exit 1
fi
echo "All standing-order files have valid frontmatter."
- name: Validate theme files
run: |
errors=0
for file in $(find themes -name '*.yaml' \
-not -name '_schema.yaml' \
-not -name '_template.yaml'); do
for field in schema_version; do
if ! grep -q "^${field}:" "$file"; then
echo "ERROR: $file — missing required field: $field"
errors=$((errors + 1))
fi
done
for field in name display_name; do
if ! grep -q "^ ${field}:" "$file"; then
echo "ERROR: $file — missing meta.$field"
errors=$((errors + 1))
fi
done
done
if [ "$errors" -gt 0 ]; then
echo ""
echo "Found $errors error(s) in theme files."
exit 1
fi
echo "All theme files have valid structure."
leak-roster-guard:
name: Leak Roster Guard
runs-on: ubuntu-latest
# An org keeps its private leak roster (customer / third-party person
# names) untracked / gitignored; the scanner loads it at runtime. It may
# live in a private working repo, but must never be committed to a
# published repo. Runs only when the repo is public — a no-op while private.
if: ${{ !github.event.repository.private }}
steps:
- uses: actions/checkout@v7
- name: Block a tracked leak roster
run: |
if git ls-files --error-unmatch scripts/leak-patterns-internal.txt > /dev/null 2>&1; then
echo "ERROR: scripts/leak-patterns-internal.txt is tracked in a PUBLIC repository."
echo "The org-private leak roster must never be committed to a published repo."
exit 1
fi
echo "No private leak roster tracked — public repo is clean."
onboard-safety:
name: Onboarding Safety (push guard + leak sim)
runs-on: ubuntu-latest
# Proves the public-origin push guard (rules/push-guard.md): a user/* branch
# of private data can never be published to a public upstream. Unit contract
# + a model-free end-to-end leak simulation (skills/onboard-sim).
steps:
- uses: actions/checkout@v7
- name: Install deps for the org-overlay engine contract
run: |
pip install pyyaml
pipx install check-jsonschema
- name: Push-guard unit contract
run: bash scripts/tests/test-push-guard.sh
- name: Push-guard commit-set contract (private-remote-already-has-it net)
run: sh scripts/tests/test-push-guard-commit-set.sh
- name: Push-guard content net covers every family in the tree
run: python3 -m pip install pytest && python3 -m pytest scripts/tests/test_push_guard_paths.py -q
- name: Instance data follows the origin, and carries no credential
run: python3 -m pytest scripts/tests/test_user_data.py -q
- name: System-discovery scope-consent backstop
run: bash scripts/tests/test-system-discovery.sh
- name: Org-overlay engine contract (scope routing + materialize gates)
run: bash scripts/tests/test-overlay.sh
- name: Meeting-transcription transport modes (local/remote)
if: hashFiles('skills/meeting-transcription/tests/test-transport-modes.sh') != ''
run: bash skills/meeting-transcription/tests/test-transport-modes.sh
- name: Onboarding leak simulation (scripted, model-free)
run: |
set -euo pipefail
SBX="$RUNNER_TEMP/obsim"
bash skills/onboard-sim/assets/build-sandbox.sh "$PWD" "$SBX"
# the scripted newcomer's push SHOULD be rejected by the guard (non-zero exit)
bash skills/onboard-sim/assets/run-scripted-newcomer.sh "$SBX/newcomer" || true
bash skills/onboard-sim/assets/assert-no-leak.sh "$SBX"
# One check that stands for all of them, so branch protection has a single
# name to require and a job added later cannot be forgotten there. It runs
# even when a dependency failed (a failed need would otherwise SKIP it, and
# a skipped required check counts as passed). A job that is skipped by its
# own `if:`, like the leak-roster guard on a private repo, is not a failure.
# scripts/tests/test_ci_wiring.py fails when a job is missing from `needs`.
all-green:
name: All green
if: ${{ always() }}
needs:
- yaml-lint
- ecosystem-validation
- schema-validation
- okf-export
- script-suites
- script-tests
- skill-pytest
- cockpit-demo-smoke
- workload-suites
- secrets-suites
- object-store-suites
- a2a-suite
- workspace-tests
- content-leak
- skill-scope
- frontmatter-check
- leak-roster-guard
- onboard-safety
runs-on: ubuntu-latest
steps:
- name: Every needed job passed or was skipped by its own condition
env:
RESULTS: ${{ join(needs.*.result, ' ') }}
run: |
echo "results: $RESULTS"
for r in $RESULTS; do
case "$r" in
failure|cancelled) echo "::error::a required job ended with $r"; exit 1 ;;
esac
done
echo "All required jobs green."