volaro 0.1.0-alpha.1 → 0.1.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/README.md +97 -9
  2. package/bin/vl.js +409 -23
  3. package/compiler/SOURCE_INFO.json +6 -0
  4. package/compiler/SOURCE_REV +1 -1
  5. package/compiler/validator/vlcheck/__main__.py +82 -13
  6. package/compiler/validator/vlcheck/ast_nodes.py +59 -0
  7. package/compiler/validator/vlcheck/benchmark_signal.py +86 -0
  8. package/compiler/validator/vlcheck/checks.py +1818 -21
  9. package/compiler/validator/vlcheck/diagnostics.py +1 -1
  10. package/compiler/validator/vlcheck/elements.py +1191 -0
  11. package/compiler/validator/vlcheck/layoutcompose.py +385 -0
  12. package/compiler/validator/vlcheck/lexer.py +75 -2
  13. package/compiler/validator/vlcheck/pagemanifest.py +389 -0
  14. package/compiler/validator/vlcheck/pageroutes.py +468 -0
  15. package/compiler/validator/vlcheck/parser.py +386 -8
  16. package/compiler/validator/vlcheck/resolve.py +70 -8
  17. package/compiler/validator/vlcheck/routes_cli.py +172 -0
  18. package/compiler/validator/vlcheck/test_ids.py +4 -3
  19. package/compiler/vlbuild/vlbuild/__main__.py +138 -9
  20. package/compiler/vlbuild/vlbuild/assets/vlrouter.js +396 -0
  21. package/compiler/vlbuild/vlbuild/assets/vlrt.js +422 -11
  22. package/compiler/vlbuild/vlbuild/emit.py +1755 -149
  23. package/compiler/vlbuild/vlbuild/pages_build.py +368 -0
  24. package/compiler/vlbuild/vlbuild/project.py +338 -0
  25. package/compiler/vlbuild/vlbuild/server_emit.py +598 -50
  26. package/compiler/vlbuild/vlbuild/static_assets.py +83 -0
  27. package/compiler/vlbuild/vlbuild/style_config.py +1 -1
  28. package/language/crib.md +522 -28
  29. package/language/spec.md +685 -10
  30. package/language/supported.md +544 -22
  31. package/package.json +1 -1
  32. package/scripts/record-provenance.mjs +51 -0
  33. package/scripts/selftest.mjs +36 -1
  34. package/scripts/sync-compiler.sh +1 -1
package/README.md CHANGED
@@ -1,7 +1,8 @@
1
1
  # Volaro
2
2
 
3
- **Limited alpha (`0.1.0-alpha.1`). Not yet published to npm.** Install from a
4
- local `npm pack` tarball to try it.
3
+ **Limited alpha, published under the `alpha` dist-tag** (this is `0.1.0-alpha.4`) —
4
+ `npm install volaro@alpha`. Not `latest` (that still resolves to an earlier
5
+ `0.0.x` placeholder) — always specify `@alpha` or the exact version.
5
6
 
6
7
  Volaro is an experimental application language intended for AI authoring and
7
8
  human review. This package ships the language reference **and a working
@@ -58,16 +59,66 @@ volaro example sensors # a worked example (also: station)
58
59
  volaro version | volaro help
59
60
  ```
60
61
 
62
+ ### Benchmark timing log
63
+
64
+ `check` and `build` can append machine-readable compile attempts to a JSONL
65
+ file. Use one unique run ID for the first attempt and every repair attempt in a
66
+ single trial:
67
+
68
+ ```bash
69
+ volaro check app.vl --benchmark-log benchmark.jsonl --benchmark-run test-006-v-01
70
+ # If it fails, repair app.vl and repeat the exact command with the same run ID.
71
+ ```
72
+
73
+ A first-pass success writes a `clean` summary with `t_clean_ms`. A failure
74
+ followed by a success writes a `recovered` summary with `t_fail_ms`,
75
+ `t_repair_ms`, `t_recompile_ms`, and `t_recover_ms`. The log also retains every
76
+ raw attempt, the number of failures, and compiler overhead not attributable to
77
+ repair. A completed run ID cannot be reused, and a run cannot mix `check` and
78
+ `build` attempts or change compiler arguments between attempts.
79
+
80
+ The timer measures the compiler subprocess. `T-repair` is the observed wall
81
+ time between a failed compiler exit and the next compiler start. It measures
82
+ the autonomous repair loop, including agent and tool overhead; it is not a
83
+ claim about model-inference time alone.
84
+
85
+ **Every failed attempt is classified, not just counted.** Each raw `attempt`
86
+ record carries a `classification`: `source_diagnostic` (the compiler ran to
87
+ completion and correctly reported a problem with your source — the only case
88
+ `t_fail_ms` is ever populated for), `operational_failure` (the compiler process
89
+ itself crashed, was killed, or stopped on an invocation/configuration problem —
90
+ `crash_exception_type`/`crash_exception_message` are set when it was a crash),
91
+ `silent_failure` (a non-zero exit with no output at all), or `unknown_failure`
92
+ (a non-zero exit with output that carried none of the compiler's own
93
+ diagnostic signal). This is reported by the compiler itself over a private
94
+ side channel — never guessed from whether stdout/stderr happened to have
95
+ anything in it, since an internal crash prints output too. A `recovered`
96
+ summary whose original failing attempt was not `source_diagnostic` has
97
+ `t_fail_ms: null`, `timing_complete: false`, and a `timing_incomplete_reason`
98
+ explaining why — treat it as an invalid recovery-time sample, not a slow one.
99
+
100
+ **A `recovered` summary can also be invalidated by the wall clock.**
101
+ `t_repair_ms`/`t_recover_ms` are computed from separate processes' own
102
+ timestamps; if one of those timestamps predates an earlier one (a system
103
+ clock step between two attempts), the summary has `clock_anomaly: true`,
104
+ `timing_complete: false`, and the affected fields are `null` — never a
105
+ clamped, misleadingly small positive number.
106
+
61
107
  `volaro dev` serves a static bundle for a single-page app. If the app compiles
62
108
  to a full-stack server (`server.js`), it runs that instead and needs
63
- Node 22.5+ for `node:sqlite`.
109
+ Node 22.5+ for `node:sqlite`. A multi-page project build always emits a
110
+ `server.js` (it serves `public/` and answers a direct link or refresh on a
111
+ dynamic route), so `volaro dev` on a project directory runs that server.
64
112
 
65
113
  ## Scaffold a project
66
114
 
67
115
  ```bash
68
- npm create volaro my-app # the separate create-volaro package
116
+ npm create volaro@alpha my-app # the separate create-volaro package
69
117
  ```
70
118
 
119
+ (`@alpha` matters — `npm create volaro` with no tag resolves `latest`, which
120
+ is still an earlier `0.0.x` placeholder, not this build.)
121
+
71
122
  It writes one single-page starter, a `volaro.json`, and `package.json` scripts
72
123
  (`dev` / `build` / `check`) that call `volaro`.
73
124
 
@@ -78,8 +129,20 @@ density against selected baselines — not a general productivity result.
78
129
  Security and accessibility checks cover a tested prototype subset, not a
79
130
  universal guarantee. Independent human-readability validation is outstanding.
80
131
 
81
- **MVP scope is single-page.** Routing, nested layouts and multi-page starters
82
- are later work; `volaro build` / `volaro dev` target one entry file.
132
+ **Pages, routing and nested layouts are implemented** (2026-09-23). A project
133
+ directory with any `app/**/index.vl` builds as a real multi-page app: nested
134
+ `_layout.vl` shells placing content with `@children`, `(group)` folders that add
135
+ layout ancestry but no URL segment, typed `[name=type]` dynamic parameters, and
136
+ optional `_loading.vl` / `_error.vl` / `_not-found.vl` boundaries, served by a
137
+ client router with a direct-link/refresh fallback in the generated server. Point
138
+ `volaro build` / `volaro dev` at the project directory; `volaro routes` prints
139
+ what was discovered. A single `.vl` entry file still builds exactly as before.
140
+
141
+ **Still out of scope:** server-side rendering and hydration (the shell is
142
+ route-agnostic and the client does the first render); `theme` / `recipe` styling
143
+ in a multi-page build, so styled output is single-entry only; catch-all routes,
144
+ per-file route prefixes, and inherited authorization. **`npm create volaro`
145
+ scaffolds a single-page starter** — a multi-page starter is later work.
83
146
 
84
147
  ## Not included
85
148
 
@@ -89,9 +152,12 @@ builds (`theme` / `recipe`) additionally need a one-time
89
152
  `npm ci` inside `compiler/vlbuild/styling`; the single-page starter does not
90
153
  use them.
91
154
 
92
- **Form controls:** the element set is `text` inputs plus `button` / `link` —
93
- there is no `checkbox`, `radio`, `select`, `textarea`, or `disabled` attribute.
94
- Model a toggle as a `button` reading a `state` bool. `variant:` is a literal
155
+ **Form controls:** `input` (a full type matrix, including `checkbox`/`radio`
156
+ binding a `checked` state), `textarea`, `select`/`option`/`optgroup`,
157
+ `fieldset`/`legend`, `datalist`, `button`, `link`. `disabled:` works on
158
+ `button input textarea select fieldset optgroup option`. There is no
159
+ standalone `label` element and no semantic `switch`/`aria-pressed` toggle —
160
+ model one as a `button` reading a `state` bool. `variant:` is a literal
95
161
  style name, not a computed expression. `if` used as an expression is binary
96
162
  (`if c a else b`); `match` and block `if` are statements only. A module-level
97
163
  `fn` is not available to a view. **`volaro supported` and `volaro crib` are
@@ -110,3 +176,25 @@ The legacy `volara` npm package is unrelated to this release.
110
176
  ## License
111
177
 
112
178
  MIT
179
+
180
+
181
+ ## Local assets
182
+
183
+ Put public files in `assets/` beside your entry `.vl` file and use
184
+ `img src:"assets/logo.svg" alt:"Logo"`. Build and dev copy them to the browser
185
+ bundle. Dev watches changes; refresh the browser after a rebuild. Missing
186
+ literal asset references fail the build. Output `assets/` is compiler-owned.
187
+
188
+ ## Package provenance
189
+
190
+ `compiler/SOURCE_REV` records the source commit. `compiler/SOURCE_INFO.json`
191
+ adds its origin, Git dirty status where available, and a SHA-256 digest of
192
+ compiler and CLI/documentation content. A package version alone does not
193
+ identify a local candidate; preserve the tarball hash as well.
194
+
195
+ Packaging a Git export uses `.volaro-source-rev`, expanded by `git archive`.
196
+ For other exported source, set `VOLARO_SOURCE_REV` to the full source commit
197
+ hash before `npm pack`. Missing/invalid revisions fail packaging; an explicit
198
+ revision cannot override a different checkout HEAD. Export metadata identifies
199
+ the base revision, not an assurance that someone has not modified the export;
200
+ the content hash distinguishes modified candidates. Nothing is published by packing.