Skip to content

Commit 697fd97

Browse files
hyperpolymathclaude
andcommitted
docs: clean up the three drift items flagged in #112
Follow-up to #112. Three items were flagged there as "not done — would expand scope". This commit addresses all three. 1. dune-project: relax OCaml constraint to match reality ------------------------------------------------------- `dune-project` declared `(ocaml (>= 5.1))`, but the current tree builds clean on 4.14.2 (209/209 tests green; verified in #112). The constraint was stricter than the actual code requires, so `opam install .` against a 4.14 switch failed for no real reason. Bumped down to `(ocaml (>= 4.14))`. `affinescript.opam` regenerated via `dune build` and the corresponding README note ("dune-project lists `>= 5.1` but ...") is no longer needed and has been dropped. If a 5.x-only feature is later introduced, bump the constraint at that point with a commit that links the offending source line. 2. AI.a2ml: fix .scm → .a2ml drift, align with on-disk reality -------------------------------------------------------------- `AI.a2ml` told agents to read `.machine_readable/STATE.scm`, `AGENTIC.scm`, etc., and to "read `.machine_readable/*.scm` files at session start". None of those files exist — the actual files are `.a2ml`, living under `.machine_readable/6a2/` (per the canonical rule that `.scm` is reserved for Guix: `guix.scm`, `.guix-channel`). Rewrote the file to reflect the actual on-disk layout, split into: - Core 6a2 metadata under `.machine_readable/6a2/` - Top-level contractile files (`*.contractile`, `CLADE.a2ml`, anchors) - Agent guidance (`agent_instructions/methodology.a2ml` etc.) Workflow steps now point at `STATE.a2ml` and `AGENTIC.a2ml` with the correct path prefix. 3. CONTRIBUTING.md: replace template placeholders, fix truncation ----------------------------------------------------------------- `CONTRIBUTING.md` was a half-rendered standards template: - Started with a bare `# Clone the repository` (no title, no intro, with a dangling closing ` ``` ` left over from a deleted fence). - Placeholders never substituted: `{{FORGE}}`, `{{OWNER}}`, `{{REPO}}`, `{{MAIN_BRANCH}}`. - Ended mid-sentence in the Conventional Commits format block (line 117 with an unclosed code fence and no closing sections — License / CoC pointers, PR workflow, etc.). - Suggested setup steps that don't apply here (`nix develop`, `toolbox`, `just check`) — affinescript builds with `dune`. Rewrote as a real contributor guide: - Title + intro pointing at README.adoc and STATE.a2ml. - Quick Start matching the README's opam + `eval $(opam env)` recipe. - Repository Structure that reflects what's actually on disk (lib/, bin/, stdlib/, packages/, .machine_readable/, js/ for the playground). - Real GitHub label URLs. - Branch naming + Conventional Commits + Required Checks + Pull Requests sections, all closed out properly. - License + Code of Conduct pointers at the bottom. Notably dropped: the "Perimeter 1/2/3" framework from the source template — it does not appear anywhere else in the affinescript tree (only in vendored sibling-repo `.github/` mirrors), so it was template baggage rather than project vocabulary. CODE_OF_CONDUCT.md is still a placeholder template — that's a separate pass (kept out of this PR to keep it reviewable). Verification ------------ $ dune build → exit 0 $ dune runtest → 209/209 green Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 8d515b3 commit 697fd97

5 files changed

Lines changed: 137 additions & 82 deletions

File tree

.build/dune-project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
(description
2626
"AffineScript combines Rust-style ownership (affine types), compile-time size verification (dependent types), extensible records (row polymorphism), and trackable side effects (extensible effects). It compiles to WebAssembly for efficient, portable execution.")
2727
(depends
28-
(ocaml (>= 5.1))
28+
(ocaml (>= 4.14))
2929
(dune (>= 3.14))
3030
(menhir (>= 20231231))
3131
(sedlex (>= 3.2))

AI.a2ml

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,36 @@
22

33
# Machine-Readable Metadata
44

5-
Project metadata and AI agent configuration files are located in `.machine_readable/`:
5+
Project metadata and AI agent configuration files live under `.machine_readable/`. All metadata files use the `.a2ml` extension; the `.scm` extension is reserved for Guix (`guix.scm`, `.guix-channel`).
66

7-
- **STATE.scm** - Current project state, progress, blockers, next actions
8-
- **ECOSYSTEM.scm** - Position in ecosystem, relationships to other projects
9-
- **META.scm** - Architecture decisions, governance, development practices
10-
- **PLAYBOOK.scm** - Operational runbook, procedures, alerts
11-
- **AGENTIC.scm** - AI agent interaction patterns and constraints
12-
- **NEUROSYM.scm** - Neurosymbolic integration configuration
7+
## Core 6a2 metadata (`.machine_readable/6a2/`)
8+
9+
- **STATE.a2ml** - Current project state, progress, blockers, next actions, session notes
10+
- **ECOSYSTEM.a2ml** - Position in ecosystem, relationships to sibling projects
11+
- **META.a2ml** - Architecture decisions, governance, development practices
12+
- **PLAYBOOK.a2ml** - Operational runbook, procedures, alerts
13+
- **AGENTIC.a2ml** - AI agent interaction patterns and constraints
14+
- **NEUROSYM.a2ml** - Neurosymbolic integration configuration
15+
16+
## Top-level contractile files (`.machine_readable/`)
17+
18+
- **ADJUST.contractile**, **INTENT.contractile**, **MUST.contractile**, **TRUST.contractile** - Trident-shape commitments
19+
- **CLADE.a2ml** - Phylogenetic context within the estate
20+
- **anchors/ANCHOR.a2ml** - Stable references for tooling
21+
22+
## Agent guidance (`.machine_readable/agent_instructions/`)
23+
24+
- **methodology.a2ml** - Required checks (dune build / dune runtest must pass; see for the full list)
25+
- **coverage.a2ml**, **debt.a2ml** - Tracked metrics
26+
- **README.adoc** - Human-readable summary of agent instructions
1327

1428
**These files are the canonical source of truth for project metadata.**
1529

1630
## Workflow
1731

18-
1. Read `.machine_readable/*.scm` files at session start
19-
2. Check STATE.scm for current phase, blockers, next actions
20-
3. Follow patterns and constraints from AGENTIC.scm
21-
4. Update STATE.scm after completing work
22-
5. Sync to database: `~/sync-language-tracker.sh`
32+
1. Read `.machine_readable/6a2/*.a2ml` files at session start
33+
2. Check `STATE.a2ml` for current phase, blockers, next actions
34+
3. Follow patterns and constraints from `AGENTIC.a2ml`
35+
4. Follow methodology gates from `agent_instructions/methodology.a2ml`
36+
5. Update `STATE.a2ml` after completing work
37+
6. Sync to database: `~/sync-language-tracker.sh`

CONTRIBUTING.md

Lines changed: 107 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,59 @@
1-
# Clone the repository
2-
git clone https://{{FORGE}}/{{OWNER}}/{{REPO}}.git
3-
cd {{REPO}}
1+
# Contributing to AffineScript
42

5-
# Using Nix (recommended for reproducibility)
6-
nix develop
3+
Thank you for your interest in AffineScript — a practical language for resource-safe systems, compiling to typed WebAssembly. This guide covers how to set up a working tree, file useful bugs, and submit changes.
74

8-
# Or using toolbox/distrobox
9-
toolbox create {{REPO}}-dev
10-
toolbox enter {{REPO}}-dev
11-
# Install dependencies manually
5+
For the language itself, start from [`README.adoc`](README.adoc). For project state, blockers, and next-actions, see [`.machine_readable/6a2/STATE.a2ml`](.machine_readable/6a2/STATE.a2ml).
6+
7+
---
8+
9+
## Quick Start
10+
11+
```bash
12+
git clone https://github.com/hyperpolymath/affinescript.git
13+
cd affinescript
14+
15+
# Provision the OCaml toolchain (one-shot). See README.adoc "Getting Started"
16+
# for the full list of opam packages and the `eval $(opam env)` note for
17+
# non-interactive shells.
18+
opam install -y \
19+
sedlex menhir ppx_deriving ppx_sexp_conv sexplib0 fmt cmdliner yojson \
20+
alcotest ocamlformat \
21+
js_of_ocaml js_of_ocaml-ppx js_of_ocaml-compiler
22+
eval "$(opam env --switch=default --set-switch)"
1223

1324
# Verify setup
14-
just check # or: cargo check / mix compile / etc.
15-
just test # Run test suite
25+
dune build
26+
dune runtest
1627
```
1728

29+
Tested on OCaml 4.14.2 (the constraint in `dune-project` is `>= 4.14`).
30+
1831
### Repository Structure
32+
1933
```
20-
{{REPO}}/
21-
├── src/ # Source code (Perimeter 1-2)
22-
├── lib/ # Library code (Perimeter 1-2)
23-
├── extensions/ # Extensions (Perimeter 2)
24-
├── plugins/ # Plugins (Perimeter 2)
25-
├── tools/ # Tooling (Perimeter 2)
26-
├── docs/ # Documentation (Perimeter 3)
27-
│ ├── architecture/ # ADRs, specs (Perimeter 2)
28-
│ └── proposals/ # RFCs (Perimeter 3)
29-
├── examples/ # Examples (Perimeter 3)
30-
├── spec/ # Spec tests (Perimeter 3)
31-
├── tests/ # Test suite (Perimeter 2-3)
32-
├── .well-known/ # Protocol files (Perimeter 1-3)
33-
├── .github/ # GitHub config (Perimeter 1)
34-
│ ├── ISSUE_TEMPLATE/
35-
│ └── workflows/
36-
├── CHANGELOG.md
34+
affinescript/
35+
├── lib/ # Compiler core (lexer, parser, typechecker, codegen, verifier)
36+
├── bin/ # CLI driver — `_build/default/bin/main.exe`
37+
├── stdlib/ # Standard library `.affine` modules
38+
├── test/ # Alcotest suites (lexer, golden, e2e fixtures)
39+
├── tests/ # Topic-grouped tests (borrow, codegen, effects, parser, …)
40+
├── examples/ # Self-contained example programs
41+
├── conformance/ # Conformance test corpus
42+
├── docs/ # Specs, decisions, guides
43+
├── packages/ # Aggregate JS/TS/ReScript binding packages
44+
├── editors/ # Editor integrations
45+
├── js/ # `js_of_ocaml` playground (built into `playground.bc.js`)
46+
├── .machine_readable/ # Machine-readable metadata (`.a2ml`) — see AI.a2ml
47+
├── .github/ # CI workflows, issue templates
3748
├── CODE_OF_CONDUCT.md
3849
├── CONTRIBUTING.md # This file
39-
├── GOVERNANCE.md
40-
├── LICENSE
41-
├── MAINTAINERS.md
50+
├── LICENSE / LICENSES # MIT OR AGPL-3.0-or-later
51+
├── MAINTAINERS.adoc
4252
├── README.adoc
53+
├── ROADMAP.adoc
4354
├── SECURITY.md
44-
├── flake.nix # Nix flake (Perimeter 1)
45-
└── justfile # Task runner (Perimeter 1)
55+
├── dune-project
56+
└── justfile
4657
```
4758

4859
---
@@ -51,66 +62,95 @@ just test # Run test suite
5162

5263
### Reporting Bugs
5364

54-
**Before reporting**:
55-
1. Search existing issues
56-
2. Check if it's already fixed in `{{MAIN_BRANCH}}`
57-
3. Determine which perimeter the bug affects
65+
**Before reporting:**
66+
1. Search [existing issues](https://github.com/hyperpolymath/affinescript/issues).
67+
2. Check that the bug reproduces against `main` (`git pull && dune build`).
5868

59-
**When reporting**:
69+
**When reporting:** use the [bug report template](.github/ISSUE_TEMPLATE/bug_report.md) and include:
6070

61-
Use the [bug report template](.github/ISSUE_TEMPLATE/bug_report.md) and include:
62-
63-
- Clear, descriptive title
64-
- Environment details (OS, versions, toolchain)
65-
- Steps to reproduce
66-
- Expected vs actual behaviour
67-
- Logs, screenshots, or minimal reproduction
71+
- Clear, descriptive title.
72+
- Environment: OCaml version, opam switch, OS.
73+
- Steps to reproduce, ideally as a minimal `.affine` file plus the exact `dune exec affinescript -- <subcommand> <file>` invocation.
74+
- Expected vs actual behaviour (compiler output, generated Wasm, runtime trap, etc.).
6875

6976
### Suggesting Features
7077

71-
**Before suggesting**:
72-
1. Check the [roadmap](ROADMAP.md) if available
73-
2. Search existing issues and discussions
74-
3. Consider which perimeter the feature belongs to
75-
76-
**When suggesting**:
78+
**Before suggesting:**
79+
1. Skim [`ROADMAP.adoc`](ROADMAP.adoc) and `.machine_readable/6a2/STATE.a2ml`.
80+
2. Search existing issues and discussions.
7781

78-
Use the [feature request template](.github/ISSUE_TEMPLATE/feature_request.md) and include:
82+
**When suggesting:** use the [feature request template](.github/ISSUE_TEMPLATE/feature_request.md) and include:
7983

80-
- Problem statement (what pain point does this solve?)
81-
- Proposed solution
82-
- Alternatives considered
83-
- Which perimeter this affects
84+
- Problem statement — what pain point does this solve?
85+
- Proposed solution and any alternatives considered.
86+
- Whether the change touches the core language, a face (frontend surface), a backend, or the stdlib.
8487

8588
### Your First Contribution
8689

8790
Look for issues labelled:
8891

89-
- [`good first issue`](https://{{FORGE}}/{{OWNER}}/{{REPO}}/labels/good%20first%20issue) — Simple Perimeter 3 tasks
90-
- [`help wanted`](https://{{FORGE}}/{{OWNER}}/{{REPO}}/labels/help%20wanted) — Community help needed
91-
- [`documentation`](https://{{FORGE}}/{{OWNER}}/{{REPO}}/labels/documentation) — Docs improvements
92-
- [`perimeter-3`](https://{{FORGE}}/{{OWNER}}/{{REPO}}/labels/perimeter-3) — Community sandbox scope
92+
- [`good first issue`](https://github.com/hyperpolymath/affinescript/labels/good%20first%20issue)
93+
- [`help wanted`](https://github.com/hyperpolymath/affinescript/labels/help%20wanted)
94+
- [`documentation`](https://github.com/hyperpolymath/affinescript/labels/documentation)
9395

9496
---
9597

9698
## Development Workflow
9799

98100
### Branch Naming
101+
99102
```
100-
docs/short-description # Documentation (P3)
101-
test/what-added # Test additions (P3)
102-
feat/short-description # New features (P2)
103-
fix/issue-number-description # Bug fixes (P2)
104-
refactor/what-changed # Code improvements (P2)
105-
security/what-fixed # Security fixes (P1-2)
103+
docs/short-description # Documentation
104+
test/what-added # Test additions
105+
feat/short-description # New features
106+
fix/issue-number-description # Bug fixes
107+
refactor/what-changed # Code improvements
108+
security/what-fixed # Security fixes
109+
ci/what-changed # CI / tooling
106110
```
107111

112+
Branch from `main` and target `main` in your PR.
113+
108114
### Commit Messages
109115

110116
We follow [Conventional Commits](https://www.conventionalcommits.org/):
117+
111118
```
112119
<type>(<scope>): <description>
113120
114121
[optional body]
115122
116-
[optional footer]
123+
[optional footer, e.g. closes #N or Co-Authored-By: ...]
124+
```
125+
126+
Common types: `feat`, `fix`, `docs`, `test`, `refactor`, `chore`, `ci`. Common scopes: `lexer`, `parser`, `typecheck`, `codegen`, `verify`, `stdlib`, `cli`, `readme`.
127+
128+
### Required Checks
129+
130+
Before opening a PR, locally:
131+
132+
```bash
133+
dune build # must exit 0
134+
dune runtest # must be green
135+
dune fmt # optional — auto-formats with ocamlformat
136+
```
137+
138+
The `methodology.a2ml` file lists the canonical gate set. CI will rerun `build` + `runtest` plus the security, lint, and policy workflows in `.github/workflows/`.
139+
140+
### Pull Requests
141+
142+
1. Push your branch and open a PR against `main`.
143+
2. Use a Conventional-Commit-shaped title.
144+
3. In the body, summarise the change and link the issue it closes.
145+
4. Keep PRs focused — split unrelated changes into separate PRs.
146+
5. CI must be green. Maintainers squash-merge by default; commit message lineage is preserved in the PR body.
147+
148+
---
149+
150+
## Code of Conduct
151+
152+
This project follows the [Code of Conduct](CODE_OF_CONDUCT.md). By participating you agree to abide by it.
153+
154+
## License
155+
156+
By contributing you agree your contribution is licensed under the project's dual licence (MIT OR AGPL-3.0-or-later), as recorded in [`LICENSE`](LICENSE) and per-file SPDX headers.

README.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ Games are one place where the language’s properties are easy to demonstrate. T
387387

388388
=== Prerequisites
389389

390-
- OCaml 4.14.2+ (dune-project lists `>= 5.1`, but the current tree also builds clean on 4.14.2; the constraint is stricter than the actual code requires)
390+
- OCaml 4.14.2+
391391
- Dune 3.14+
392392
- opam packages: `sedlex`, `menhir`, `ppx_deriving`, `ppx_sexp_conv`, `sexplib0`, `fmt`, `cmdliner`, `yojson`, `alcotest` (test), `ocamlformat` (test), `js_of_ocaml`, `js_of_ocaml-ppx`, `js_of_ocaml-compiler`
393393

affinescript.opam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ homepage: "https://github.com/hyperpolymath/affinescript"
2222
doc: "https://github.com/hyperpolymath/affinescript"
2323
bug-reports: "https://github.com/hyperpolymath/affinescript/issues"
2424
depends: [
25-
"ocaml" {>= "5.1"}
25+
"ocaml" {>= "4.14"}
2626
"dune" {>= "3.14" & >= "3.14"}
2727
"menhir" {>= "20231231"}
2828
"sedlex" {>= "3.2"}

0 commit comments

Comments
 (0)