Skip to content

Commit 738cbd8

Browse files
claudehyperpolymath
authored andcommitted
chore(governance): add missing estate pieces — Dust/Bust contractiles, bot_directives trio, self-validating k9 set
Inventory of PR #185's estate supply found three gaps; this fills them: - contractiles/Dustfile.a2ml: TOML-A2ML, ports the full content of the pre-estate root contractiles/Dustfile.a2ml (deleted by #185) into the flat layout; cleanup/hygiene/reversibility sections populated from repo reality (not-applicable keys carry explicit reasons). - contractiles/Bustfile.a2ml: no bust reference exists anywhere in the estate; written fully from repo-true gates (All/Smoke suite, kernel-guard, guardrails, append-only history, proof-debt exceptions). - bot_directives/{README.adoc,hypatia.a2ml,gitbot-fleet.a2ml, git-private-farm.a2ml}: net-new trio per the estate standard; accepted-findings mirror .hypatia-ignore rationales + PR #156/#172 adjudications; propagation disabled (no instant-sync.yml). - self-validating/: shared k9 template set copied from the nextgen-typing reference (maa-framework precedent), adapted only in repo-identity fields; examples point at the real build commands. All new .a2ml files tomllib-verified. nickel binary unavailable; k9 .ncl files syntax-checked by eye against the reference set.
1 parent 9ffaff4 commit 738cbd8

13 files changed

Lines changed: 1194 additions & 0 deletions

File tree

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// SPDX-License-Identifier: MPL-2.0
2+
// SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell
3+
= Bot directives — echo-types
4+
:toc:
5+
6+
== Purpose
7+
8+
Per-repo directives for automated agents operating on
9+
`hyperpolymath/echo-types`. These files tell bots what this repository
10+
considers safe, what is forbidden, and which findings are already
11+
adjudicated, so automated runs do not relitigate settled decisions or
12+
touch protected surfaces.
13+
14+
== Precedence
15+
16+
. Maintainer instruction (see `MAINTAINERS.adoc`) — always wins.
17+
. These directives.
18+
. Bot built-in defaults.
19+
20+
== Scope
21+
22+
These directives apply to:
23+
24+
* the *Hypatia* scanner (`hypatia.a2ml` — scanner config pointers and
25+
accepted findings with reasons);
26+
* the *gitbot fleet* (`gitbot-fleet.a2ml` — fleet roster, branch policy,
27+
never-touch paths, per-bot constraints);
28+
* *.git-private-farm propagation* (`git-private-farm.a2ml` — propagation
29+
is currently disabled here; the file records the contract for if/when
30+
an `instant-sync.yml` workflow is added).
31+
32+
== Repo-specific ground rules (summary)
33+
34+
* This is a proof repository: `proofs/`, `tutorial/`, `All.agda`,
35+
`Smoke.agda`, and `.github/workflows/agda.yml` are bot-off-limits.
36+
* CI green precedes merge; bots never auto-merge and never delete
37+
branches.
38+
* Escalation channel is an issue, not PR-comment spam.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# SPDX-License-Identifier: MPL-2.0
2+
# git-private-farm.a2ml — .git-private-farm propagation directives for
3+
# echo-types. Net-new at the 2026-06-12 governance checkpoint per the
4+
# estate bot_directives standard.
5+
6+
[metadata]
7+
repo = "echo-types"
8+
last-updated = "2026-06-12"
9+
owner = "hyperpolymath"
10+
11+
[propagation]
12+
enabled = false
13+
# echo-types has NO .github/workflows/instant-sync.yml as of 2026-06-12
14+
# (workflows present: agda, codeql, governance, hypatia-scan, mirror,
15+
# scorecard, secret-scanner). The keys below record the estate contract
16+
# that applies if/when the workflow is added.
17+
workflow = ".github/workflows/instant-sync.yml" # absent; enabled = false until it exists
18+
target = "hyperpolymath/.git-private-farm"
19+
event-type = "propagate"
20+
secret = "FARM_DISPATCH_TOKEN" # secret NAME only; value lives in repo secrets
21+
presence-gated = false # no workflow present, so no gate exists yet; gate it on addition
22+
23+
[never-propagate]
24+
items = [
25+
"secrets",
26+
"unmerged branches",
27+
"work-in-progress",
28+
]
29+
30+
[on-token-rotation]
31+
command = "gh secret set FARM_DISPATCH_TOKEN --repo hyperpolymath/echo-types" # name only; paste the new value when prompted
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# SPDX-License-Identifier: MPL-2.0
2+
# gitbot-fleet.a2ml — gitbot fleet directives for echo-types.
3+
# Net-new at the 2026-06-12 governance checkpoint per the estate
4+
# bot_directives standard.
5+
6+
[metadata]
7+
repo = "echo-types"
8+
last-updated = "2026-06-12"
9+
owner = "hyperpolymath"
10+
11+
[fleet]
12+
bots = ["rhodibot", "echidnabot", "sustainabot", "glambot", "seambot", "finishbot"]
13+
14+
[fleet.roles]
15+
rhodibot = "git operations"
16+
echidnabot = "code quality"
17+
sustainabot = "dependency updates"
18+
glambot = "documentation"
19+
seambot = "integration"
20+
finishbot = "task completion"
21+
22+
[branch-policy]
23+
working-branch-pattern = "<bot>/<topic>" # human sessions use session/<topic>; bots use their own prefix
24+
draft-PRs-only = true
25+
ci-green-before-merge = true # repo-level discipline: admin-merge-before-CI-green is a recorded anti-pattern (CLAUDE.md, PR #133 note)
26+
never-touch = [
27+
".claude/CLAUDE.md",
28+
"CLAUDE.md",
29+
"proofs/",
30+
"tutorial/",
31+
"*.agda",
32+
".github/workflows/agda.yml",
33+
"docs/retracted/",
34+
]
35+
36+
# ============================================================
37+
# Per-bot constraints where this repo gives specific reason;
38+
# defaults apply otherwise.
39+
# ============================================================
40+
41+
[per-bot.rhodibot]
42+
deny = ["force-push to main", "branch deletion", "history rewrites"]
43+
note = "History is append-only here; superseded docs get SUPERSEDED banners, reverts are git-revert."
44+
45+
[per-bot.echidnabot]
46+
deny = ["editing proof code", "introducing postulates", "weakening --safe --without-K"]
47+
note = "Code quality in this repo is gated by the Agda typechecker + scripts/kernel-guard.sh + tools/check-guardrails.sh; the only sanctioned postulates are the enumerated proof-debt module (docs/proof-debt.md)."
48+
49+
[per-bot.sustainabot]
50+
allow = ["GitHub Actions group bumps (precedent: PRs #179 and the codeql-action bump)"]
51+
deny = ["bumping the Agda or agda-stdlib pins without a green full-suite run"]
52+
note = "CI installs agda-stdlib v2.3 (see .github/workflows/agda.yml); the proof suite is the compatibility gate."
53+
54+
[per-bot.glambot]
55+
deny = ["resurrecting anything under docs/retracted/", "moving claims past the R-2026-05-18 narrowings"]
56+
note = "Docs are AsciiDoc by convention (README.md is the GitHub-render exception and the canonical README after the 2026-06-12 dedup). Honest labels (Landed/Partial/Open) per CLAUDE.md."
57+
58+
[per-bot.seambot]
59+
note = "Cross-repo bridge edits follow docs/echo-types/cross-repo-bridge-status.md; bridge stubs are NARROW by design (META adr-011) — do not widen scope mechanically."
60+
61+
[per-bot.finishbot]
62+
note = "Task completion must respect the repo's gate ledger (docs/echo-types/earn-back-plan.adoc, roadmap-gates.adoc); gates pass only with explicit ledger entries, never silently."
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# SPDX-License-Identifier: MPL-2.0
2+
# hypatia.a2ml — Hypatia scanner directives for echo-types.
3+
# Net-new at the 2026-06-12 governance checkpoint per the estate
4+
# bot_directives standard.
5+
6+
[metadata]
7+
repo = "echo-types"
8+
last-updated = "2026-06-12"
9+
owner = "hyperpolymath"
10+
11+
[scanner]
12+
ignore-file = ".hypatia-ignore" # present at repo root; each entry carries a verified-false-positive rationale
13+
workflow = ".github/workflows/hypatia-scan.yml"
14+
15+
# ============================================================
16+
# Accepted findings (known false positives / adjudicated advisories).
17+
# Each entry mirrors an in-repo rationale; do not re-raise these.
18+
# ============================================================
19+
20+
[[accepted-findings]]
21+
rule = "code_safety/agda_postulate"
22+
path = "proofs/agda/Smoke.agda"
23+
status = "verified-false-positive"
24+
reason = """
25+
The rule is a naive \\bpostulate\\b regex over raw file content that does
26+
not strip comments. The only 'postulate' tokens in Smoke.agda are in
27+
comments documenting the suite's postulate-free discipline; there is no
28+
postulate declaration. The repo's own guardrail (tools/check-guardrails.sh)
29+
strips comments before checking and is the real gate. Suppressed in
30+
.hypatia-ignore with full rationale.
31+
"""
32+
33+
[[accepted-findings]]
34+
rule = "code_safety/js_http_url_in_code"
35+
path = "tools/banner/build-banner.mjs"
36+
status = "verified-false-positive"
37+
reason = """
38+
The flagged http:// is the SVG XML namespace identifier
39+
xmlns="http://www.w3.org/2000/svg" — a constant namespace URI never
40+
dereferenced over the network; changing it to https would be semantically
41+
wrong and break SVG handling. Not CWE-319. Suppressed in .hypatia-ignore.
42+
"""
43+
44+
[[accepted-findings]]
45+
rule = "code_safety/agda_postulate"
46+
path = "proofs/agda (Exploratory cohort)"
47+
status = "scope-narrowed"
48+
reason = """
49+
The agda_postulate alert on the Exploratory module was scope-narrowed via
50+
inline allow in PR #156. The four propositional-truncation postulates in
51+
proofs/agda/EchoImageFactorizationPropPostulated.agda are enumerated
52+
proof debt under Disposition (c) NECESSARY AXIOM (docs/proof-debt.md,
53+
PR #172); the module is isolated and not imported by All.agda/Smoke.agda.
54+
"""
55+
56+
[[accepted-findings]]
57+
rule = "workflow hardening (general)"
58+
path = ".github/workflows/"
59+
status = "resolved-at-source"
60+
reason = """
61+
PR #178 hardened CI workflows and resolved the then-outstanding Hypatia
62+
findings at source rather than by suppression. New findings in workflows
63+
should be fixed at source in the same spirit, not added here.
64+
"""
65+
66+
# ============================================================
67+
# Prohibited actions
68+
# ============================================================
69+
70+
[prohibited-actions]
71+
auto-delete-branches = false
72+
auto-merge = false
73+
modify-workflows = false
74+
escalation = "open an issue, do not spam PR comments"
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# SPDX-License-Identifier: MPL-2.0
2+
# Bustfile.a2ml — breakage contract for echo-types: what counts as a
3+
# busted state, how it is detected, and how to respond.
4+
#
5+
# Format: TOML-A2ML (parses with tomllib; `#` comments, [section], key = "value")
6+
#
7+
# Provenance: the flat-contractile completion of the estate layout
8+
# (PR #185 supplied Adjustfile/Intentfile/Justfile/Mustfile/Trustfile but
9+
# no Bustfile, and no nested bust/ contractile ever existed in this repo
10+
# or its visible siblings). Written fully from repo-true obligations on
11+
# 2026-06-12: the busted-state definitions, detection commands, and
12+
# response ladder below are the repo's own existing gates (Agda suite,
13+
# kernel-guard, guardrail scripts, CI workflows), not new policy.
14+
15+
[bustfile]
16+
version = "1.0.0"
17+
format = "a2ml"
18+
repo = "echo-types"
19+
last-updated = "2026-06-12"
20+
21+
# ============================================================
22+
# Busted-state definition (any one of these means the repo is busted)
23+
# ============================================================
24+
25+
[definition]
26+
busted-states = [
27+
"proofs/agda/All.agda fails to typecheck under --safe --without-K",
28+
"proofs/agda/Smoke.agda fails to typecheck (a pinned headline theorem broke)",
29+
"a postulate appears outside the enumerated proof-debt module (docs/proof-debt.md: proofs/agda/EchoImageFactorizationPropPostulated.agda)",
30+
"scripts/kernel-guard.sh fails (kernel/derived classification drift)",
31+
"tools/check-guardrails.sh fails (guardrail policy violation)",
32+
"a retracted claim from docs/retractions.adoc reappears in canonical docs",
33+
"main is red on the agda / governance / hypatia-scan workflows",
34+
]
35+
36+
# ============================================================
37+
# Detection (run these to decide whether the repo is busted)
38+
# ============================================================
39+
40+
[[detection]]
41+
name = "full-suite"
42+
doc = "The verified suite: every module imported by All.agda typechecks."
43+
run = "agda -i proofs/agda proofs/agda/All.agda"
44+
severity = "critical"
45+
46+
[[detection]]
47+
name = "smoke-pins"
48+
doc = "Every headline theorem pinned via `using` clauses still exists."
49+
run = "agda -i proofs/agda proofs/agda/Smoke.agda"
50+
severity = "critical"
51+
52+
[[detection]]
53+
name = "kernel-guard"
54+
doc = "Kernel-vs-derived module classification is consistent (docs/echo-types/echo-kernel-note.adoc)."
55+
run = "scripts/kernel-guard.sh"
56+
severity = "high"
57+
58+
[[detection]]
59+
name = "guardrails"
60+
doc = "Repo guardrail checks (incl. comment-stripping postulate check, the real postulate gate)."
61+
run = "tools/check-guardrails.sh"
62+
severity = "high"
63+
64+
[[detection]]
65+
name = "no-unsafe"
66+
doc = "No unsafe escape hatches outside the documented exceptions."
67+
run = "scripts/check-no-unsafe.sh"
68+
severity = "high"
69+
70+
# ============================================================
71+
# Response ladder (in order; stop at the first step that restores green)
72+
# ============================================================
73+
74+
[response]
75+
step-1 = "Do not merge anything while a critical detection fails on main; CI green precedes merge (admin-merges before CI green are a known anti-pattern in this repo's history — see CLAUDE.md PR #133 note)."
76+
step-2 = "If the breakage is uncommitted local work: run the Dustfile source-rollback task (git checkout HEAD -- .) and clean-build, then re-run detection."
77+
step-3 = "If the breakage landed on a branch: fix forward on that branch or close it as superseded at the next rung consolidation; never force-push over another session's work without re-fetching first."
78+
step-4 = "If the breakage landed on main: git revert the offending commit (history is append-only; no force-push to main)."
79+
step-5 = "Record the incident: open an issue with the failing command + output; if a proof rung was lost, note it in the session ledger per the CLAUDE.md rung-consolidation policy."
80+
81+
[escalation]
82+
owner = "hyperpolymath"
83+
contact = "MAINTAINERS.adoc"
84+
bot-rule = "automated agents open an issue and stop; they do not auto-revert main, do not auto-merge fixes, and do not spam PR comments"
85+
86+
# ============================================================
87+
# Known exceptions (NOT busted states; do not 'fix' these)
88+
# ============================================================
89+
90+
[[known-exceptions]]
91+
name = "proof-debt-postulates"
92+
detail = "The four propositional-truncation postulates in proofs/agda/EchoImageFactorizationPropPostulated.agda are enumerated proof debt under Disposition (c) NECESSARY AXIOM (docs/proof-debt.md, PR #172). The module is isolated, guardrail-exempt by design, and not imported by All.agda or Smoke.agda."
93+
94+
[[known-exceptions]]
95+
name = "hypatia-verified-false-positives"
96+
detail = "The entries in .hypatia-ignore (agda_postulate on Smoke.agda comments; the SVG xmlns http:// constant in tools/banner/build-banner.mjs) are verified false positives with in-file rationale; see bot_directives/hypatia.a2ml."
97+
98+
[[known-exceptions]]
99+
name = "ordinal-track-open-gates"
100+
detail = "Ordinal-track Gate 1 (tail-rank-equality discharge, CHECKED-REFUTED unblock routes per PR #146) and Gate 3 (Path-4+ extensions) are documented OPEN work, not breakage. See STATE [blockers]."
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# SPDX-License-Identifier: MPL-2.0
2+
# Dustfile.a2ml — cleanup, hygiene & recovery contract for echo-types
3+
#
4+
# Format: TOML-A2ML (parses with tomllib; `#` comments, [section], key = "value")
5+
#
6+
# Provenance: the flat-contractile completion of the estate layout
7+
# (PR #185 supplied Adjustfile/Intentfile/Justfile/Mustfile/Trustfile but
8+
# no Dustfile). The [[tasks]] entries below PORT the full content of the
9+
# pre-estate root `contractiles/Dustfile.a2ml` (S-expression form,
10+
# deleted by PR #185); section shape follows the estate dust reference
11+
# (nextgen-languages contractiles/dust/Dustfile.a2ml). Added 2026-06-12.
12+
13+
[dustfile]
14+
version = "1.0.0"
15+
format = "a2ml"
16+
repo = "echo-types"
17+
last-updated = "2026-06-12"
18+
19+
# ============================================================
20+
# Recovery & rollback tasks (ported from the pre-estate root Dustfile)
21+
# ============================================================
22+
23+
[[tasks]]
24+
name = "source-rollback"
25+
doc = "Revert all source changes to last commit."
26+
tag = "rollback"
27+
cmd = "git checkout HEAD -- ."
28+
29+
[[tasks]]
30+
name = "clean-build"
31+
doc = "Remove all build artifacts (Agda .agdai files)."
32+
tag = "clean"
33+
cmd = "find proofs -name '*.agdai' -delete"
34+
35+
[[tasks]]
36+
name = "resync-from-template"
37+
doc = "Re-run scaffold-component.{py,my} to restore drifted boilerplate."
38+
tag = "scaffold"
39+
cmd = "echo 'Manual: run scaffold-component for echo-types resync.'"
40+
41+
# ============================================================
42+
# Cleanup policy
43+
# ============================================================
44+
45+
[cleanup]
46+
build-artifacts = "Agda interface files (*.agdai) under proofs/ and tutorial/; never committed (.gitignore); removed by the clean-build task"
47+
generated-dirs = "_build/ is gitignored (commit 9c00087); safe to delete at any time"
48+
stale-branch-policy = "session/* and consolidation branches are enumerated and dispositioned (landing / superseded / abandoned) at each rung consolidation, per the CLAUDE.md rung-consolidation policy; bots never delete branches"
49+
artifact-retention = "not-applicable"
50+
artifact-retention-reason = "echo-types publishes no build artifacts; the proof suite is re-checked from source on every CI run"
51+
cache-policy = "CI caches the Agda toolchain + stdlib only; cache invalidation follows .github/workflows/agda.yml"
52+
53+
# ============================================================
54+
# Hygiene
55+
# ============================================================
56+
57+
[hygiene]
58+
proof-hygiene = "agda All.agda + Smoke.agda must exit 0 under --safe --without-K; zero postulates outside the enumerated proof-debt module (docs/proof-debt.md)"
59+
guardrails = "tools/check-guardrails.sh + scripts/kernel-guard.sh are the repo-native hygiene gates; scripts/check-no-unsafe.sh supplements"
60+
dead-code-rule = "modules that compile but are not imported by proofs/agda/All.agda are treated as dead code (CLAUDE.md working rules)"
61+
todo-tracking = "inline TODOs on the ordinal track are slice-scoped and tracked in the obstruction docs (docs/echo-types/buchholz-rank-obstruction.adoc); repo-wide notes go to issues"
62+
linting = "not-applicable"
63+
linting-reason = "no general-purpose linter for Agda; the typechecker + guardrail scripts fill the role"
64+
formatting = "not-applicable"
65+
formatting-reason = "no enforced Agda formatter; .editorconfig + .gitattributes (LF, .agdai binary) carry the file-hygiene load"
66+
67+
# ============================================================
68+
# Reversibility
69+
# ============================================================
70+
71+
[reversibility]
72+
backup-before-destructive = true
73+
rollback-mechanism = "git-revert (history is append-only; superseded docs get SUPERSEDED banners rather than deletion, per STATE standing-decision sd-006)"
74+
retracted-content-policy = "retractions are recorded in docs/retractions.adoc + docs/retracted/ and are never silently resurrected (R-2026-05-18 discipline)"
75+
data-retention-policy = "not-applicable"
76+
data-retention-reason = "echo-types holds no runtime data; everything reproducible is derived from source under version control"

0 commit comments

Comments
 (0)