Skip to content

Commit 1e8fb7b

Browse files
committed
Refactoring
1 parent 99a1f06 commit 1e8fb7b

30 files changed

Lines changed: 2012 additions & 412 deletions

.github/workflows/pages.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Deploy GitHub Pages
2+
3+
on:
4+
push:
5+
branches: ["main", "master"]
6+
paths:
7+
- "site/**"
8+
- "README.md"
9+
- "specification.md"
10+
- "registry/**"
11+
- ".github/workflows/pages.yml"
12+
workflow_dispatch:
13+
14+
permissions:
15+
contents: read
16+
pages: write
17+
id-token: write
18+
19+
concurrency:
20+
group: "pages"
21+
cancel-in-progress: true
22+
23+
jobs:
24+
build:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
30+
- name: Build static site
31+
run: |
32+
mkdir -p _site
33+
cp -R site/* _site/
34+
cp README.md _site/README.md
35+
cp specification.md _site/specification.md
36+
cp -R registry _site/registry-files
37+
touch _site/.nojekyll
38+
39+
- name: Upload Pages artifact
40+
uses: actions/upload-pages-artifact@v3
41+
with:
42+
path: _site
43+
44+
deploy:
45+
runs-on: ubuntu-latest
46+
needs: build
47+
environment:
48+
name: github-pages
49+
url: ${{ steps.deployment.outputs.page_url }}
50+
steps:
51+
- name: Deploy to GitHub Pages
52+
id: deployment
53+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.DS_Store
2+
**/.DS_Store

CONTRIBUTING.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,12 @@
55
Community feature packages are published via pull requests to `registry/packages`.
66

77
1. Create a package directory: `registry/packages/<feature>/`.
8-
2. Add `package.json` with required keys:
9-
- `name`
10-
- `version` (`x.y`)
11-
- `summary`
12-
- `files` (array of `.ail` file paths)
13-
3. Add package AIL files at package root.
8+
2. Add exactly one package entry file: `<feature>.intent`.
9+
3. Add optional facet files referenced by `INCLUDES` and/or inline intent payloads.
1410
4. Open a pull request.
11+
5. Update `registry/index.json` with `name`, `version`, and `entry`.
1512

16-
CI validates package integrity and AIL header conventions.
13+
CI validates package integrity and AIM header conventions.
1714

1815
## Spec Changes
1916

PROMPT.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Generic AIM Synthesis Prompt
2+
3+
Use this prompt in a local AI coding session:
4+
5+
```md
6+
Implement one AIM package in this local project.
7+
8+
Inputs:
9+
- PACKAGE: <package-name>
10+
- REF: <git-tag-or-commit>
11+
12+
Steps:
13+
1. Fetch AIM spec:
14+
https://raw.githubusercontent.com/juicejs/application-intent-language/<REF>/specification.md
15+
2. Fetch registry catalog:
16+
https://raw.githubusercontent.com/juicejs/application-intent-language/<REF>/registry/index.json
17+
3. Resolve PACKAGE by `name` and fetch its `entry` file.
18+
4. Resolve and fetch optional details from:
19+
- `INCLUDES` linked facets
20+
- top-level inline facet blocks
21+
- embedded facet payloads in `INTENT`
22+
using AIM precedence/diagnostics rules from the spec.
23+
5. Materialize all fetched AIM sources into local:
24+
- `./ail/` for feature files
25+
- `./ail/mappings/` for mapping files (if present)
26+
6. Generate production-ready code from local `./ail` in this repository's detected stack.
27+
7. If any required reference is unresolved, stop and report precise gaps.
28+
29+
If network fetch is unavailable, use local fallback:
30+
- ./specification.md
31+
- ./registry/index.json
32+
- package `entry` path from local index
33+
- local `./ail` as synthesis source of truth
34+
```

README.md

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# Application Intent Language (AIL)
1+
# Application Intent Model (AIM)
22

3-
AIL is an intent-first specification language for describing software features in a form that both humans and AI coding agents can use.
3+
AIM is an intent-first specification language for describing software applications in a form that both humans and AI coding agents can use.
44

55
Start simple with one intent file, then add precision only where needed.
66

7-
## Why AIL
7+
## Why AIM
88

99
- Keep product intent readable.
1010
- Keep synthesis deterministic.
@@ -14,14 +14,14 @@ Start simple with one intent file, then add precision only where needed.
1414

1515
Each feature has one canonical intent file:
1616

17-
- `<feature>.intent.ail`
17+
- `<feature>.intent`
1818

1919
Optional precision facets can be added:
2020

21-
- `<feature>.schema.ail`
22-
- `<feature>.flow.ail`
23-
- `<feature>.contract.ail`
24-
- `<feature>.persona.ail`
21+
- `<feature>.schema.intent`
22+
- `<feature>.flow.intent`
23+
- `<feature>.contract.intent`
24+
- `<feature>.persona.intent`
2525

2626
This enables progressive detail:
2727

@@ -56,7 +56,7 @@ To enable it in GitHub:
5656
## Quick Example
5757

5858
```ail
59-
AIL: game.snake#intent@1.4
59+
AIM: game.snake#intent@1.4
6060
6161
INTENT SnakeGame {
6262
SUMMARY: "A single-player snake game with top-10 scores."
@@ -76,12 +76,11 @@ INTENT SnakeGame {
7676
## Repository Layout
7777

7878
- [`specification.md`](./specification.md): canonical language specification
79-
- [`ail/`](./ail): example feature sources
80-
- [`ail/game.snake.intent.ail`](./ail/game.snake.intent.ail): intent envelope example
8179
- [`registry/`](./registry): feature package registry
82-
- [`registry/packages/`](./registry/packages): publishable feature packages
80+
- [`registry/index.json`](./registry/index.json): package catalog with intent entrypoints
81+
- [`registry/packages/`](./registry/packages): publishable feature packages (intent entry + optional facets)
8382
- [`CONTRIBUTING.md`](./CONTRIBUTING.md): contribution and publishing workflow
84-
- [`test/`](./test): test workspace and tooling
83+
- [`PROMPT.md`](./PROMPT.md): generic local AI synthesis prompt
8584

8685
## Current Demo
8786

@@ -94,6 +93,17 @@ It is also published as a registry package:
9493

9594
- [`registry/packages/game.snake`](./registry/packages/game.snake)
9695

96+
## Local AI Fetch Flow
97+
98+
Use this sequence:
99+
100+
1. Fetch `specification.md`.
101+
2. Fetch `registry/index.json`.
102+
3. Select package by `name`.
103+
4. Fetch the package `entry` intent file and related facet files.
104+
5. Materialize fetched sources into local `/ail` (and `/ail/mappings` when needed).
105+
6. Synthesize from local `/ail` so users can edit and rebuild without refetching.
106+
97107
## Status
98108

99-
Current spec version: **AIL v1.4**.
109+
Current spec version: **AIM v1.4**.

registry/README.md

Lines changed: 28 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# AIL Feature Registry
1+
# AIM Feature Registry
22

3-
This directory is the publish surface for community AIL feature packages.
3+
This directory is the publish surface for community AIM feature packages.
44

55
## Package Layout
66

@@ -10,54 +10,48 @@ Each package lives in:
1010

1111
Each package must contain:
1212

13-
1. `package.json`
14-
2. One or more `.ail` source files at package root
13+
1. Exactly one intent entry file: `<feature>.intent`
14+
2. Optional additional facet files referenced by the intent file
1515

16-
## `package.json` Schema
16+
## `registry/index.json` Schema
1717

1818
Required fields:
1919

20+
- `version`: index schema version
21+
- `packages`: array of package objects
22+
23+
Each package object requires:
24+
2025
- `name`: feature namespace (lowercase, dot-separated segments; single-segment allowed)
21-
- `version`: `x.y`
22-
- `summary`: short one-line description
23-
- `files`: array of relative `.ail` file paths (for package entry files)
24-
25-
Example:
26-
27-
```json
28-
{
29-
"name": "game.snake",
30-
"version": "1.3",
31-
"summary": "Single-player snake game with top-10 leaderboard",
32-
"files": [
33-
"game.snake.intent.ail",
34-
"game.snake.schema.ail",
35-
"game.snake.flow.ail",
36-
"game.snake.contract.ail",
37-
"game.snake.persona.ail"
38-
]
39-
}
40-
```
26+
- `version`: `x.y` matching entry file header
27+
- `entry`: relative path to canonical intent file
4128

4229
## Pull Request Publishing Flow
4330

4431
1. Fork and create a branch.
45-
2. Add or update a package in `registry/packages`.
46-
3. Open a PR.
47-
4. CI runs `scripts/validate_registry.py`.
48-
5. Maintainers review and merge.
32+
2. Add or update package files in `registry/packages/<feature>/`.
33+
3. Update `registry/index.json` with package `name`, `version`, and `entry`.
34+
4. Open a PR.
35+
5. CI runs `scripts/validate_registry.py`.
36+
6. Maintainers review and merge.
4937

5038
Merged PRs are the publishing mechanism.
5139

40+
## Consumption Model
41+
42+
Consumers fetch package `entry` from this registry, resolve related sources, and materialize files into local project `/ail` (and `/ail/mappings` when applicable) before synthesis.
43+
5244
## Validation Rules
5345

5446
CI enforces:
5547

56-
- package manifest required fields
57-
- version format `x.y`
58-
- package name and directory match
59-
- listed files exist and end with `.ail`
60-
- each file uses `AIL: <feature>#<facet>@<x.y>`
48+
- index schema validity and non-empty package list
49+
- package/index consistency (one index record per package directory)
50+
- `entry` exists and points to `.intent`
51+
- entry header matches `name`, `intent` facet, and `version`
52+
- exactly one `*.intent` file per package directory
53+
- optional `INCLUDES` targets exist and match feature/facet/version
54+
- stale manifest files (`package.json`, `manifest.intent`) are rejected
6155
- legacy metadata tokens are rejected
6256

6357
## Notes

registry/index.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
{
55
"name": "game.snake",
66
"version": "1.3",
7-
"path": "registry/packages/game.snake"
7+
"entry": "registry/packages/game.snake/game.snake.intent"
88
},
99
{
1010
"name": "weather",
1111
"version": "1.4",
12-
"path": "registry/packages/weather"
12+
"entry": "registry/packages/weather/weather.intent"
1313
}
1414
]
1515
}

registry/packages/game.snake/game.snake.contract.ail renamed to registry/packages/game.snake/game.snake.contract.intent

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
AIL: game.snake#contract@1.3
1+
AIM: game.snake#contract@1.3
22

33
CONTRACT StartGame {
44
INTENT:

registry/packages/game.snake/game.snake.flow.ail renamed to registry/packages/game.snake/game.snake.flow.intent

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
AIL: game.snake#flow@1.3
1+
AIM: game.snake#flow@1.3
22

33
FLOW InitializeSession {
44
INTENT:

registry/packages/game.snake/game.snake.intent.ail renamed to registry/packages/game.snake/game.snake.intent

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
AIL: game.snake#intent@1.3
1+
AIM: game.snake#intent@1.3
22

33
INTENT SnakeGame {
44
SUMMARY: "A classic single-player snake game where the player grows the snake, avoids collisions, and tries to reach the top-10 leaderboard."
@@ -12,10 +12,10 @@ INTENT SnakeGame {
1212
}
1313

1414
INCLUDES:
15-
- schema: game.snake.schema.ail
16-
- flow: game.snake.flow.ail
17-
- contract: game.snake.contract.ail
18-
- persona: game.snake.persona.ail
15+
- schema: game.snake.schema.intent
16+
- flow: game.snake.flow.intent
17+
- contract: game.snake.contract.intent
18+
- persona: game.snake.persona.intent
1919

2020
BEHAVIOR:
2121
- StartGame creates a new running session with deterministic initial snake state.

0 commit comments

Comments
 (0)