Repository navigation
108 lines (107 loc) · 5.57 KB
/
Copy pathestate-rules.yml
File metadata and controls
108 lines (107 loc) · 5.57 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
# This workflow is managed by gh actions-lock.
# SPDX-License-Identifier: MPL-2.0
# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
#
# Estate Rules — enforces hyperpolymath estate-wide conventions:
# * root shape (allowlist of permitted root entries)
# * AsciiDoc-by-default (no .md files under docs/)
# * AsciiDoc that renders (every tracked .adoc parses with no diagnostics)
# * V-lang is banned (no V-lang scaffolding or references; Zig is the FFI default)
#
# Each rule is enforced by an executable check script under scripts/. Failures
# are surfaced as workflow errors so the rule can't silently regress.
name: Estate Rules
on:
push:
branches: [main]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
estate-rules:
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v7.0.1
# Prove the instrument works before trusting its reading. This gate was
# one-directional for months, which is indistinguishable from a working
# gate until you try to make it fail.
- name: Root-shape gate self-test (must fail on drift)
run: bash tests/shape/check_root_shape_test.sh
- name: Root shape allowlist
run: bash scripts/check-root-shape.sh .
# The map is generated. Five hand-written predecessors all rotted because
# nothing diffed them.
# The freshness check below is only meaningful if the generator is
# environment-independent. It wasn't: sort is locale-dependent, so the
# map generated differently in CI than locally. Vary the locale first.
- name: Repository map generates identically across locales
run: bash tests/shape/repo_map_determinism_test.sh
- name: Repository map is not stale
run: |
cp docs/architecture/REPOSITORY-MAP.adoc /tmp/map.before
bash scripts/gen-repo-map.sh .
diff -u /tmp/map.before docs/architecture/REPOSITORY-MAP.adoc \
|| { echo "::error::REPOSITORY-MAP.adoc is stale - run 'just repo-map'"; exit 1; }
- name: AsciiDoc by default (no .md under docs/)
run: bash scripts/check-no-md-in-docs.sh .
# The rule above checks the file EXTENSION only, so a Markdown body
# renamed to .adoc passes it. This one checks the file actually parses.
# asciidoctor's --failure-level defaults to FATAL, so a document emitting
# WARNING or ERROR still exits 0; the version is pinned because the
# verdict rests on a stderr comparison.
- name: Install asciidoctor
run: sudo gem install asciidoctor -v 2.0.26 --no-document
- name: AsciiDoc render gate self-test (must catch what bare asciidoctor misses)
run: bash tests/workflows/check_adoc_renders_test.sh
- name: Every tracked .adoc renders clean
run: bash scripts/check-adoc-renders.sh .
- name: No V-language references
run: bash scripts/check-no-vlang.sh .
# Was written but wired to nothing, so it had never run in CI.
- name: V-language gate self-test
run: bash tests/workflows/check_no_vlang_test.sh
# .a2ml is retired estate-wide: facts are deed clauses, contracts are .k9.
- name: No .a2ml files
run: bash scripts/check-no-a2ml.sh .
- name: No-a2ml gate self-test (planted positives must fail)
run: bash tests/workflows/check_no_a2ml_test.sh
- name: Deed clause writer controls
run: bash tests/workflows/deed_clause_test.sh
- name: Install verified Nickel 1.17.0
run: |
mkdir -p "$RUNNER_TEMP/nickel-bin"
curl --proto '=https' --proto-redir '=https' --fail --silent --show-error --location \
https://github.com/nickel-lang/nickel/releases/download/1.17.0/nickel-x86_64-linux \
--output "$RUNNER_TEMP/nickel-bin/nickel"
echo "afcdfa6e0fff31760cf229e85997456c02c00b8b3b84ff38f897ac7b3f39ae34 $RUNNER_TEMP/nickel-bin/nickel" | sha256sum --check --strict
chmod +x "$RUNNER_TEMP/nickel-bin/nickel"
echo "$RUNNER_TEMP/nickel-bin" >> "$GITHUB_PATH"
- name: Evaluate session contracts
run: bash scripts/validate-session-contracts.sh
- name: Check Nickel typecheck controls
run: bash tests/workflows/k9_typecheck_test.sh
- name: Verify session envelope controls
run: bash tests/workflows/session_contracts_test.sh
- name: Verify mint cleanup controls
run: bash tests/workflows/mint_cleanup_test.sh
# An archetype overlay once shipped its own actions.lock, which replaced
# the spine's at mint and left every Julia mint with Lock Sync red.
- name: Archetype lock fragments merge into a valid lock
run: bash tests/workflows/archetype_lock_merge_test.sh
# The CHECK half of the template contract. repo-init has always written an
# answer-file (now the child deed's (provenance) clause); nothing ever read it.
# This is the missing reader, and it covers the #200/#201/#203 class:
# self-parenting identity, unresolved pins, and leaked template branches.
#
# The template itself self-skips (archetypes/ present), so the real check
# runs in minted children. What THIS proves is that the instrument can
# fail — the only property that matters for a gate, and the one that was
# missing in #49, #64 and the conformance gate that "reported them
# conforming" upstream.
- name: Template conformance gate self-test (must fail on drift)
run: bash tests/workflows/template_conformance_test.sh