Skip to content

Commit c467c4a

Browse files
hyperpolymathclaude
andcommitted
chore(a2ml): upgrade .machine_readable/ suite to current standards shape
Suite upgrade deferred from 2026-04-10 manhattan-recovery. No .ml code changes. dune build clean before and after. Migrated (git mv — history preserved): contractiles/ → .machine_readable/contractiles/ (dust, k9, lust, must, trust — 5 existing types, all files) Added to .machine_readable/: CLADE.a2ml — identity + clade="language" ADJUST.contractile — accessibility invariants (CLI/LSP/docs) INTENT.contractile — purpose + anti-scope-creep MUST.contractile — hard invariants (build, safety, thesis) TRUST.contractile — AI agent trust levels (maximal) contractiles/adjust/Adjustfile.a2ml contractiles/intend/Intentfile.a2ml agent_instructions/README.adoc agent_instructions/coverage.a2ml agent_instructions/debt.a2ml — BUG-001-004 + ZERO/ONE tokens + traits agent_instructions/methodology.a2ml integrations/verisimdb.a2ml integrations/vexometer.a2ml Updated: anchors/ANCHOR.a2ml — appended suite-upgrade realignment-history entry; updated notes section 6a2/STATE.a2ml — marked [deferred-upgrade] done (2026-04-12) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 732253e commit c467c4a

27 files changed

Lines changed: 621 additions & 45 deletions

.machine_readable/6a2/STATE.a2ml

Lines changed: 17 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -191,39 +191,23 @@ regression-test-status = "deferred — fixture needs a known-unknown function na
191191
# scope creep into that plan.
192192

193193
[deferred-upgrade]
194-
session = "separate, not Phase 0"
195-
estimated-effort = "1-2 focused hours"
196-
197-
present:
198-
# What AffineScript already has
199-
present = [
200-
".machine_readable/6a2/AGENTIC.a2ml",
201-
".machine_readable/6a2/ECOSYSTEM.a2ml",
202-
".machine_readable/6a2/META.a2ml",
203-
".machine_readable/6a2/NEUROSYM.a2ml",
204-
".machine_readable/6a2/PLAYBOOK.a2ml",
205-
".machine_readable/6a2/STATE.a2ml",
206-
".machine_readable/anchors/ANCHOR.a2ml", # added 2026-04-10 as first anchor
207-
"contractiles/ (root-level, old location) — dust, k9, lust, must, trust"
208-
]
194+
# DONE 2026-04-12 — suite upgrade completed in dedicated session (no .ml changes)
195+
status = "done"
196+
completed = "2026-04-12"
209197

210-
missing = [
198+
added = [
211199
".machine_readable/CLADE.a2ml",
212-
".machine_readable/contractiles/ (should migrate from root contractiles/)",
213-
".machine_readable/contractiles/adjust/",
214-
".machine_readable/contractiles/intend/",
215-
".machine_readable/agent_instructions/",
216-
".machine_readable/integrations/",
217-
".machine_readable/ADJUST.contractile (top-level instance)",
218-
".machine_readable/INTENT.contractile (top-level instance)",
219-
".machine_readable/MUST.contractile (top-level instance)",
220-
".machine_readable/TRUST.contractile (top-level instance)"
200+
".machine_readable/contractiles/ (migrated from root via git mv — history preserved)",
201+
".machine_readable/contractiles/adjust/Adjustfile.a2ml",
202+
".machine_readable/contractiles/intend/Intentfile.a2ml",
203+
".machine_readable/agent_instructions/README.adoc",
204+
".machine_readable/agent_instructions/coverage.a2ml",
205+
".machine_readable/agent_instructions/debt.a2ml",
206+
".machine_readable/agent_instructions/methodology.a2ml",
207+
".machine_readable/integrations/verisimdb.a2ml",
208+
".machine_readable/integrations/vexometer.a2ml",
209+
".machine_readable/ADJUST.contractile",
210+
".machine_readable/INTENT.contractile",
211+
".machine_readable/MUST.contractile",
212+
".machine_readable/TRUST.contractile"
221213
]
222-
223-
notes = """
224-
Root-level contractiles/ directory has 5 of 7 current types. The canonical
225-
pattern is .machine_readable/contractiles/ with all 7 types. Migration is
226-
deferred to a separate session because it requires reading each contractile
227-
definition from the standards repo and deciding which apply to AffineScript
228-
specifically. Do not conflate with Manhattan Phase 0.
229-
"""
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
; SPDX-License-Identifier: PMPL-1.0-or-later
2+
; ADJUST.contractile — Accessibility instance for AffineScript
3+
; Compiler/LSP accessibility — subset of WCAG 2.2 AA applicable to developer tools.
4+
5+
(adjust-contractile
6+
(version "1.0.0")
7+
(repo "nextgen-languages/affinescript")
8+
(standard "CLI-accessible (WCAG 2.2 AA where applicable to developer tools)")
9+
10+
(invariants
11+
; ── CLI output ──
12+
(adjust "all error messages include file:line:col — not just a message")
13+
(adjust "error messages use plain language — not jargon codes alone")
14+
(adjust "no information conveyed by ANSI colour alone (symbol + colour)")
15+
(adjust "output safe in non-TTY (piped to file or CI log)")
16+
(adjust "all subcommands support --help with plain-text output")
17+
(adjust "exit codes documented in QUICKSTART-USER.adoc")
18+
19+
; ── Affine type errors ──
20+
(adjust "affine/linear violation messages name the variable and say why it is consumed")
21+
(adjust "error code E#### always accompanied by human-readable description")
22+
(adjust "quantity annotation syntax documented in both @annotation and :sugar forms (ADR-007)")
23+
24+
; ── LSP ──
25+
(adjust "hover responses in plain Markdown (no raw HTML)")
26+
(adjust "completion items include kind field for screen reader discrimination")
27+
(adjust "diagnostic ranges use start+end, not character offset alone")
28+
29+
; ── Documentation ──
30+
(adjust "all diagrams in docs/ have alt text or text description")
31+
(adjust "code examples in guides include explanatory comments")
32+
)
33+
34+
(enforcement
35+
(ci "panic-attack checks for colour-only output patterns")
36+
(manual "LSP output reviewed for plain-Markdown compliance on new diagnostic types")
37+
)
38+
)

.machine_readable/CLADE.a2ml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
2+
# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
3+
# Clade declaration — part of the gv-clade-index registry
4+
# See: https://github.com/hyperpolymath/gv-clade-index
5+
6+
[identity]
7+
uuid = "b3f82c1a-4e9d-4b7a-a831-6c2d5e9f0a14"
8+
primary-forge = "github"
9+
primary-owner = "hyperpolymath"
10+
canonical-name = "affinescript"
11+
prefixed-name = "gv-affinescript"
12+
13+
[clade]
14+
primary = "language"
15+
secondary = ["compiler", "type-system"]
16+
assigned = "2026-04-12"
17+
rationale = "AffineScript is a programming language with affine types targeting Typed WASM. Primary clade is 'language'; secondary clades capture the compiler pipeline and type-system research aspects."
18+
19+
[forges]
20+
github = "hyperpolymath/nextgen-languages"
21+
# affinescript lives in the nextgen-languages monorepo submodule
22+
# it is NOT a standalone GitHub repo
23+
24+
[lineage]
25+
type = "submodule"
26+
parent = "nextgen-languages — the hyperpolymath language monorepo"
27+
born = "2025-09-12"
28+
note = "Predates ANCHOR.a2ml convention. Retroactively assigned clade 2026-04-12 during suite upgrade."
29+
30+
[language]
31+
# AffineScript-specific fields
32+
paradigm = ["functional", "affine", "typed"]
33+
compile-targets = ["typed-wasm", "julia", "wasm-gc"]
34+
inspiration = ["ReScript", "Rust", "Granule", "OCaml"]
35+
headline-feature = "affine-types-with-javascript-ergonomics"
36+
37+
[thesis]
38+
one-sentence = "AffineScript is JavaScript-ergonomic correctness: the developer experience of the -script family raised to a higher correctness floor through affine types, compiling to Typed WASM."
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
; SPDX-License-Identifier: PMPL-1.0-or-later
2+
; INTENT.contractile — Purpose and anti-scope-creep for AffineScript
3+
; See ANCHOR.a2ml for the full thesis. This file is the machine-readable summary.
4+
5+
(intent-contractile
6+
(version "1.0.0")
7+
(repo "nextgen-languages/affinescript")
8+
9+
(purpose
10+
"AffineScript is a programming language with affine types and JavaScript
11+
ergonomics, compiling to Typed WASM. Feature set is fixed by thesis in
12+
ANCHOR.a2ml.")
13+
14+
(anti-purpose
15+
"NOT a language with dependent types (Typed WASM project)."
16+
"NOT a language with linear types as a separate concept (bot scope creep — subsumed by affine)."
17+
"NOT a language with tropical types (Typed WASM project)."
18+
"NOT a language with units of measure (Typed WASM project)."
19+
"NOT a general-purpose JS replacement.")
20+
21+
(load-bearing-decisions
22+
(adr "ADR-001" "Split-Γ typing context")
23+
(adr "ADR-002" "Scaled Let rule")
24+
(adr "ADR-003" "Left-to-right evaluation")
25+
(adr "ADR-007" "Quantity annotation surface syntax")
26+
(adr "ADR-010" "Faces architecture"))
27+
28+
(ecosystem-position
29+
(upstream "nextgen-languages monorepo — sister to Ephapax, WokeLang, Eclexia")
30+
(compile-target-primary "typed-wasm")
31+
(compile-target-secondary "julia")
32+
(downstream-consumer "IDApTIK (AGPL, game engine)")
33+
(downstream-consumer "airborne-submarine-squadron (AGPL, game)"))
34+
35+
(scope-creep-history
36+
(event "2026-04-10 manhattan-recovery"
37+
"Bot scope creep added linear types, dependent types, algebraic effect
38+
handler ambitions. Scope narrowed back to 8-feature thesis. Three ADRs
39+
adopted. See ANCHOR.a2ml realignment-history for full record."))
40+
)

.machine_readable/MUST.contractile

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
; SPDX-License-Identifier: PMPL-1.0-or-later
2+
; MUST.contractile — Hard invariants for AffineScript
3+
; These MUST NOT be violated by any AI agent or human contributor.
4+
5+
(must-contractile
6+
(version "1.0.0")
7+
(repo "nextgen-languages/affinescript")
8+
9+
(invariants
10+
11+
; === Build ===
12+
(must "dune build passes before and after every change")
13+
(must "dune runtest passes — all E2E tests green")
14+
(must "no compilation errors introduced by any commit")
15+
16+
; === Safety patterns ===
17+
(must "no assert_total in any OCaml file")
18+
(must "no Obj.magic in any OCaml file")
19+
(must "no believe_me in any Idris2 file")
20+
(must "no TODO-as-implementation (stub bodies are forbidden in shipped code; use explicit failwith with a tag)")
21+
22+
; === Scope ===
23+
(must "thesis in ANCHOR.a2ml is authoritative — new features require a new ADR")
24+
(must "linear types may not be added as a separate concept — they are subsumed by affine types")
25+
(must "dependent types remain out of scope — they belong in the Typed WASM project")
26+
(must "algebraic effect handlers beyond try/catch remain out of scope (ADR-004 extension point only)")
27+
28+
; === Architecture ===
29+
(must "the Split-Γ typing context (ADR-001) is canonical — do not introduce alternative context shapes")
30+
(must "the Scaled Let rule (ADR-002) governs all let-binding — do not bypass with ad-hoc quantity inference")
31+
(must "left-to-right evaluation order (ADR-003) — do not evaluate argument lists right-to-left")
32+
(must "face-specific logic belongs in lib/face.ml — do not inline face dispatch in parser.mly or typecheck.ml")
33+
34+
; === Tests ===
35+
(must "every new language feature ships with at least one E2E test in test/e2e/")
36+
(must "regression fixtures must be added when a bug is fixed")
37+
38+
; === Licenses ===
39+
(must "SPDX-License-Identifier: PMPL-1.0-or-later in every source file")
40+
(must "MPL-2.0 as legal fallback (lawyer-confirmed) — no re-labelling needed")
41+
42+
; === IDApTIK integration ===
43+
(must "do not break the AffineTEA Wasm output consumed by IDApTIK (AGPL project, co-developed with son)")
44+
(must "wasm/titlescreen.wasm, wasm/router.wasm in idaptik/public/assets/wasm/ must remain valid after compiler changes")
45+
)
46+
47+
(enforcement
48+
(ci "panic-attack assail runs on every PR")
49+
(ci "dune build + dune runtest in CI")
50+
(pr-block "build failure blocks merge")
51+
)
52+
)
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
; SPDX-License-Identifier: PMPL-1.0-or-later
2+
; TRUST.contractile — AI agent trust levels for AffineScript
3+
4+
(trust-contractile
5+
(version "1.0.0")
6+
(repo "nextgen-languages/affinescript")
7+
8+
(default-trust "maximal")
9+
; Rationale: AffineScript is a research compiler. Claude is the primary
10+
; implementer. Maximal trust for all non-destructive work. Jonathan reviews
11+
; via git diff before committing.
12+
13+
(trust-grant "maximal"
14+
(allow "read any file in the repo")
15+
(allow "write to lib/*.ml, lib/*.mli, bin/*.ml, test/e2e/")
16+
(allow "write to .machine_readable/ (except STATE.a2ml open-bugs — append only)")
17+
(allow "write to spec/, docs/")
18+
(allow "add new test fixtures in test/e2e/fixtures/")
19+
(allow "update CHANGELOG.md")
20+
(allow "run dune build and dune runtest")
21+
(allow "run panic-attack assail")
22+
)
23+
24+
(trust-deny "all-tiers"
25+
(deny "commit directly — always produce a diff for Jonathan to review in this private repo")
26+
(deny "push without confirmation in the same session")
27+
(deny "add a language feature not in ANCHOR.a2ml thesis")
28+
(deny "reverse any ADR (ADR-001 through ADR-010) without a new ADR")
29+
(deny "delete or overwrite the 6a2/ core files (STATE/META/ECOSYSTEM/AGENTIC/NEUROSYM/PLAYBOOK)")
30+
(deny "modify IDApTIK without explicit instruction (AGPL — separate repo, separate session)")
31+
)
32+
33+
(scope-boundary
34+
(note "AffineScript is private (ALL RIGHTS RESERVED in Claude context).")
35+
(note "The thesis in ANCHOR.a2ml is the scope boundary. Violating it is a MUST violation.")
36+
(note "007 is a separate private language — do not confuse the two compilers.")
37+
)
38+
)
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// SPDX-License-Identifier: PMPL-1.0-or-later
2+
// Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
3+
= AffineScript Agent Instructions
4+
:toc: preamble
5+
6+
Methodology-aware configuration for AI agents working in this repository.
7+
Read at session start by any AI agent (Claude, Gemini, Copilot, etc.).
8+
9+
== Critical: read before touching code
10+
11+
1. **ANCHOR.a2ml is authoritative for scope.** The thesis is fixed. New features require a new ADR, not a code change. Bot scope creep has been a recurring problem (see manhattan-recovery 2026-04-10).
12+
2. **No `.ml` edits without reading ANCHOR.a2ml + META.a2ml first.** The type system has interdependencies that are not obvious from reading individual files.
13+
3. **dune build must pass** before and after every change. Run it.
14+
4. **Thesis is the authority; code must conform.** If code contradicts thesis, code is wrong.
15+
16+
== Files
17+
18+
[cols="1,3"]
19+
|===
20+
| File | Purpose
21+
22+
| `methodology.a2ml`
23+
| Default mode, ring ceiling, priority weights, wave cap
24+
25+
| `coverage.a2ml`
26+
| Session coverage tracking — what was visited, what was skipped
27+
28+
| `debt.a2ml`
29+
| Meander debt — things found but not fixed, carried between sessions
30+
|===
31+
32+
== Open bugs (from ANCHOR.a2ml)
33+
34+
BUG-001 through BUG-004 are tracked in STATE.a2ml. Check before starting any type-system work — one of these may already cover the issue you found.
35+
36+
== Faces architecture
37+
38+
AffineScript supports multiple surface-syntax dialects (canonical, python-face, js-face, pseudocode-face). New faces follow the pattern in `lib/face.ml`. Do NOT add face-specific logic directly to the parser or type checker.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
2+
# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
3+
#
4+
# coverage.a2ml — Session coverage tracking for AffineScript
5+
# Updated at the end of each AI agent session.
6+
7+
[metadata]
8+
version = "1.0.0"
9+
last-updated = "2026-04-12"
10+
11+
[coverage]
12+
total-components = 39 # compiler modules (from STATE.a2ml [stats])
13+
visited-components = 0
14+
coverage-percent = 0
15+
16+
# ============================================================================
17+
# VISITED COMPONENTS
18+
# ============================================================================
19+
# Component → session date + what was done
20+
21+
[coverage.visited]
22+
# Suite upgrade session (2026-04-12) — .machine_readable/ only, no .ml changes
23+
24+
# [coverage.visited.typecheck]
25+
# date = "2026-04-11"
26+
# ring = 1
27+
# fixes = 3
28+
# note = "Traits wired, linear arrows enforced, borrow checker gated"
29+
30+
# [coverage.visited.lsp-server]
31+
# date = "2026-04-11"
32+
# ring = 1
33+
# fixes = 4
34+
# note = "Phases A-D complete: hover, goto-def, completion, JSON-RPC server"

0 commit comments

Comments
 (0)