Skip to content

Commit 5fb7cac

Browse files
committed
docs: add canonical language spec, governance, and adoption guides
1 parent dc4df76 commit 5fb7cac

File tree

10 files changed

+544
-17
lines changed

10 files changed

+544
-17
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ The format is based on Keep a Changelog, and this project follows Semantic Versi
99
- Added `orgscript format <file> --check` for canonical formatting checks without rewriting files.
1010
- Added `npm run format:check:all` and integrated formatting checks into CI.
1111
- Added `orgscript check <file>` as the combined quality command for validation, linting, and formatting checks.
12+
- Added `orgscript check <file> --json` for machine-readable combined quality diagnostics.
13+
- Added `npm run check:all` and switched CI to the combined quality path.
1214
- Added `orgscript export mermaid <file>` for first-pass Mermaid exports of processes and stateflows.
15+
- Added a canonical master language spec and lightweight governance guidance.
16+
- Added an example catalog and an initial VS Code syntax-highlighting scaffold.
1317

1418
## [0.3.0] - 2026-03-29
1519

README.md

Lines changed: 138 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,18 +119,23 @@ See the full example in [`examples/craft-business-lead-to-order.orgs`](examples/
119119
- [`docs/language-principles.md`](docs/language-principles.md)
120120
- [`docs/github-labels.md`](docs/github-labels.md)
121121
- [`docs/github-project-setup.md`](docs/github-project-setup.md)
122+
- [`docs/governance.md`](docs/governance.md)
122123
- [`docs/orgscript-for-humans.md`](docs/orgscript-for-humans.md)
123124
- [`docs/orgscript-for-ai.md`](docs/orgscript-for-ai.md)
124125
- [`docs/roadmaps/v0.4.0.md`](docs/roadmaps/v0.4.0.md)
125126
- [`docs/repository-structure.md`](docs/repository-structure.md)
126127
- [`docs/syntax.md`](docs/syntax.md)
127128
- [`docs/semantics.md`](docs/semantics.md)
129+
- [`examples/README.md`](examples/README.md)
128130
- [`spec/grammar.ebnf`](spec/grammar.ebnf)
131+
- [`spec/language-spec.md`](spec/language-spec.md)
129132
- [`spec/canonical-model.md`](spec/canonical-model.md)
133+
- [`spec/diagnostics.md`](spec/diagnostics.md)
130134
- [`examples/craft-business-lead-to-order.orgs`](examples/craft-business-lead-to-order.orgs)
131135
- [`examples/lead-qualification.orgs`](examples/lead-qualification.orgs)
132136
- [`examples/order-approval.orgs`](examples/order-approval.orgs)
133137
- [`examples/service-escalation.orgs`](examples/service-escalation.orgs)
138+
- [`editors/vscode/README.md`](editors/vscode/README.md)
134139
- [`packages/parser/README.md`](packages/parser/README.md)
135140
- [`packages/cli/README.md`](packages/cli/README.md)
136141
- [`packages/formatter/README.md`](packages/formatter/README.md)
@@ -146,11 +151,14 @@ See the full example in [`examples/craft-business-lead-to-order.orgs`](examples/
146151
- Canonical format checks: `orgscript format <file> --check`
147152
- AST-backed linting: `orgscript lint <file>`
148153
- Combined quality checks: `orgscript check <file>`
154+
- Machine-readable combined checks: `orgscript check <file> --json`
149155
- Canonical JSON export: `orgscript export json <file>`
150156
- Mermaid export for `process` and `stateflow`: `orgscript export mermaid <file>`
151-
- Machine-readable diagnostics: `orgscript validate <file> --json`, `orgscript lint <file> --json`
157+
- Machine-readable diagnostics: `orgscript validate <file> --json`, `orgscript lint <file> --json`, `orgscript check <file> --json`
152158
- Golden snapshot tests for AST, canonical model, and formatter output
153159
- Stable lint severities: `error`, `warning`, `info`
160+
- Canonical master spec: [`spec/language-spec.md`](spec/language-spec.md)
161+
- Initial VS Code syntax-highlighting scaffold: [`editors/vscode`](editors/vscode)
154162

155163
## Quick start
156164

@@ -159,6 +167,7 @@ npm install
159167
node ./bin/orgscript.js validate ./examples/craft-business-lead-to-order.orgs
160168
node ./bin/orgscript.js validate ./examples/craft-business-lead-to-order.orgs --json
161169
node ./bin/orgscript.js check ./examples/craft-business-lead-to-order.orgs
170+
node ./bin/orgscript.js check ./examples/craft-business-lead-to-order.orgs --json
162171
node ./bin/orgscript.js format ./examples/craft-business-lead-to-order.orgs
163172
node ./bin/orgscript.js format ./examples/craft-business-lead-to-order.orgs --check
164173
node ./bin/orgscript.js lint ./tests/lint/process-missing-trigger.orgs
@@ -173,19 +182,139 @@ Exit codes are CI-friendly:
173182
- `lint` returns `0` when findings contain only `warning` and `info`, and `1` when findings contain at least one `error`.
174183
- `check` returns `0` only when validation passes, lint has no `error`, and formatting is canonical. Warnings and info findings alone do not fail `check`.
175184

185+
## JSON diagnostics
186+
187+
OrgScript exposes stable JSON diagnostics for CI, editors, AI systems, and downstream tooling.
188+
189+
`validate --json` on a canonical example:
190+
191+
```json
192+
{
193+
"command": "validate",
194+
"file": "examples/craft-business-lead-to-order.orgs",
195+
"ok": true,
196+
"valid": true,
197+
"summary": {
198+
"topLevelBlocks": 4,
199+
"statements": 47,
200+
"diagnostics": 0,
201+
"error": 0,
202+
"warning": 0,
203+
"info": 0
204+
},
205+
"diagnostics": []
206+
}
207+
```
208+
209+
`lint --json` on a warning-only fixture:
210+
211+
```json
212+
{
213+
"command": "lint",
214+
"file": "tests/lint/process-missing-trigger.orgs",
215+
"ok": true,
216+
"clean": true,
217+
"summary": {
218+
"diagnostics": 1,
219+
"error": 0,
220+
"warning": 1,
221+
"info": 0
222+
},
223+
"diagnostics": [
224+
{
225+
"source": "lint",
226+
"code": "process-missing-trigger",
227+
"severity": "warning",
228+
"line": 1,
229+
"message": "Process `MissingTrigger` has no `when` trigger."
230+
}
231+
]
232+
}
233+
```
234+
235+
`check --json` on a clean file:
236+
237+
```json
238+
{
239+
"command": "check",
240+
"file": "examples/craft-business-lead-to-order.orgs",
241+
"ok": true,
242+
"summary": {
243+
"diagnostics": 0,
244+
"error": 0,
245+
"warning": 0,
246+
"info": 0
247+
},
248+
"validate": {
249+
"ok": true,
250+
"valid": true,
251+
"skipped": false,
252+
"summary": {
253+
"topLevelBlocks": 4,
254+
"statements": 47,
255+
"diagnostics": 0,
256+
"error": 0,
257+
"warning": 0,
258+
"info": 0
259+
},
260+
"diagnostics": []
261+
},
262+
"lint": {
263+
"ok": true,
264+
"clean": true,
265+
"skipped": false,
266+
"summary": {
267+
"diagnostics": 0,
268+
"error": 0,
269+
"warning": 0,
270+
"info": 0
271+
},
272+
"diagnostics": []
273+
},
274+
"format": {
275+
"ok": true,
276+
"canonical": true,
277+
"skipped": false,
278+
"summary": {
279+
"diagnostics": 0,
280+
"error": 0,
281+
"warning": 0,
282+
"info": 0
283+
},
284+
"diagnostics": []
285+
}
286+
}
287+
```
288+
176289
## Guides
177290

178291
- Human authoring guide: [`docs/orgscript-for-humans.md`](docs/orgscript-for-humans.md)
179292
- AI interpretation guide: [`docs/orgscript-for-ai.md`](docs/orgscript-for-ai.md)
180293
- Diagnostics contract: [`spec/diagnostics.md`](spec/diagnostics.md)
294+
- Canonical language spec: [`spec/language-spec.md`](spec/language-spec.md)
295+
- Language governance: [`docs/governance.md`](docs/governance.md)
296+
- Example catalog: [`examples/README.md`](examples/README.md)
297+
- VS Code editor scaffold: [`editors/vscode/README.md`](editors/vscode/README.md)
298+
299+
## Editor support
300+
301+
OrgScript now ships with a first VS Code syntax-highlighting scaffold under [`editors/vscode`](editors/vscode).
302+
303+
It currently covers:
304+
305+
- `.orgs` file association
306+
- top-level blocks and core keywords
307+
- strings, numbers, and operators
308+
309+
See [`editors/vscode/README.md`](editors/vscode/README.md) for local installation and usage notes.
181310

182311
## Near-term plan
183312

184-
1. Show real JSON diagnostics examples in the README and diagnostics spec.
185-
2. Improve diagnostics consistency across CLI commands.
186-
3. Add `orgscript check --json` for machine-readable combined quality output.
187-
4. Add an initial VS Code syntax highlighting scaffold.
188-
5. Add a first editor integration path that contributors can install locally.
313+
1. Expand diagnostics examples and integration guidance around CI and editors.
314+
2. Improve diagnostics consistency further across human-readable CLI output.
315+
3. Grow the example catalog across `simple`, `realistic`, and `advanced` scenarios.
316+
4. Extend editor support beyond the initial VS Code syntax-highlighting scaffold.
317+
5. Add additional downstream exporters and documentation views.
189318

190319
See [`docs/roadmaps/v0.4.0.md`](docs/roadmaps/v0.4.0.md) for the current milestone plan.
191320

@@ -203,6 +332,7 @@ orgscript lint file.orgs --json
203332
orgscript export json file.orgs
204333
orgscript export mermaid file.orgs
205334
orgscript check file.orgs
335+
orgscript check file.orgs --json
206336
```
207337

208338
`orgscript check` runs `validate`, `lint`, and `format --check` in that order and fails on validation errors, lint errors, or formatting drift. Warnings and info findings alone do not fail the command.
@@ -216,6 +346,8 @@ See [`docs/cli-v0.1-plan.md`](docs/cli-v0.1-plan.md) for the implementation plan
216346
```text
217347
npm test
218348
npm run export:mermaid
349+
npm run check
350+
npm run check:all
219351
npm run format:check:all
220352
npm run validate:all
221353
npm run lint:all

ROADMAP.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@
4141

4242
- Open the v0.4.0 developer-experience milestone
4343
- Prepare issue drafts for formatter checks, diagnostics docs, combined quality checks, diagnostics consistency, and editor support
44+
- Publish the canonical language spec and governance notes
45+
- Add the first editor integration scaffold for VS Code
46+
- Expand diagnostics guidance and example indexing for contributors
4447

4548
## Later
4649

docs/cli-v0.1-plan.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Implemented:
1919
- `validate --json`
2020
- `lint --json`
2121
- `check`
22+
- `check --json`
2223

2324
Planned next:
2425

@@ -105,6 +106,8 @@ Output:
105106
- compact pass/fail summary for each stage
106107
- clear indication of which stage failed
107108
- stable text output suitable for CI logs
109+
- optional machine-readable diagnostics via `--json`
110+
- easy composition into repo-level wrappers such as `npm run check:all`
108111

109112
Exit behavior:
110113

@@ -159,7 +162,7 @@ TypeScript is the fastest start:
159162
## Success criteria for v0.1
160163

161164
- One can run `orgscript validate` on example files.
162-
- One can run `orgscript validate --json` and `orgscript lint --json` for downstream tooling.
165+
- One can run `orgscript validate --json`, `orgscript lint --json`, and `orgscript check --json` for downstream tooling.
163166
- One can run `orgscript format` on example files without changing canonical files.
164167
- One can run `orgscript format --check` in CI or pre-commit workflows.
165168
- One can run `orgscript check` to combine validation, linting, and format checks.

docs/governance.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# OrgScript Governance
2+
3+
This note defines how the language evolves without losing its canonical shape.
4+
5+
## Principles
6+
7+
- Protect the small core.
8+
- Prefer explicit semantics over convenience features.
9+
- Preserve backward compatibility where possible.
10+
- Treat keyword meaning as stable once documented.
11+
- Keep the language readable for humans and deterministic for machines.
12+
13+
## Change policy
14+
15+
- Any change to keywords, grammar, canonical modeling, or diagnostics is a spec change.
16+
- New features should start as a documented proposal before implementation.
17+
- Experimental ideas should stay out of the canonical spec until they are stable enough to support long-term tooling.
18+
- If a change can be expressed with existing language forms, prefer that over adding a new construct.
19+
20+
## Core vs tooling vs exporters
21+
22+
- Core language changes affect keywords, grammar, semantics, formatting rules, or the canonical model.
23+
- Tooling changes affect CLI behavior, diagnostics presentation, editor support, and developer workflow.
24+
- Exporter changes affect derived outputs such as JSON, Mermaid, Markdown summaries, or HTML documentation.
25+
- Prefer exporter or tooling extensions over core-language growth when the same user need can be met without changing OrgScript syntax.
26+
27+
## Review expectations
28+
29+
- Check alignment with `spec/language-spec.md`.
30+
- Check alignment with the manifesto and language principles.
31+
- Check parser and formatter impact before approving syntax changes.
32+
- Check canonical model and diagnostic impact before approving semantic changes.
33+
34+
## Versioning guidance
35+
36+
- Make breaking changes only with an explicit version plan.
37+
- Keep release notes aligned with the canonical spec.
38+
- When a feature is promoted from draft to canonical, update the spec first and then the supporting docs.

docs/repository-structure.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ spec/
1414

1515
```text
1616
docs/
17+
governance.md
1718
cli-v0.1-plan.md
1819
language-principles.md
1920
manifesto.md
@@ -22,11 +23,20 @@ docs/
2223
syntax.md
2324
2425
examples/
26+
README.md
2527
craft-business-lead-to-order.orgs
2628
lead-qualification.orgs
2729
order-approval.orgs
2830
service-escalation.orgs
2931
32+
editors/
33+
vscode/
34+
README.md
35+
language-configuration.json
36+
package.json
37+
syntaxes/
38+
orgscript.tmLanguage.json
39+
3040
scripts/
3141
validate-all.js
3242
@@ -51,13 +61,16 @@ packages/
5161
5262
spec/
5363
canonical-model.md
64+
diagnostics.md
5465
grammar.ebnf
66+
language-spec.md
5567
```
5668

5769
## Structure principles
5870

5971
- `docs/` explains purpose, language behavior, governance, and roadmap
6072
- `examples/` demonstrates realistic domain use cases
73+
- `editors/` contains language-support scaffolds and editor integrations
6174
- `spec/` holds normative language definitions
6275
- `src/` contains the current reference implementation
6376
- `packages/` contains implementation units

docs/roadmaps/v0.4.0.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,15 @@ Make OrgScript easier to use in daily development, CI, and editor workflows with
1313
- editor support foundation
1414
- stable quality workflows for contributors
1515

16+
## Delivered so far
17+
18+
- `format --check`
19+
- `check`
20+
- `check --json`
21+
- JSON diagnostics examples in the README and diagnostics spec
22+
- canonical language spec and governance notes
23+
- initial VS Code syntax-highlighting scaffold
24+
1625
## Non-goals
1726

1827
- new language keywords
@@ -48,7 +57,7 @@ Make OrgScript easier to use in daily development, CI, and editor workflows with
4857
## Success criteria
4958

5059
- CI can verify canonical formatting without rewriting files.
51-
- README shows real JSON examples for `validate --json` and `lint --json`.
60+
- README shows real JSON examples for `validate --json`, `lint --json`, and `check --json`.
5261
- Contributors have one clear quality command for routine checks.
5362
- CLI output feels predictable in both text and JSON modes.
5463
- `.orgs` files are easier to read in a mainstream editor.

0 commit comments

Comments
 (0)