volaro 0.1.0-alpha.1 → 0.1.0-alpha.11

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