@greenpandastudios/aug-cli 0.19.0

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 (414) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +13 -0
  3. package/THIRD_PARTY_NOTICES.md +18 -0
  4. package/bin/aug.mjs +3 -0
  5. package/docs/api/crypto.md +351 -0
  6. package/docs/api/io.md +207 -0
  7. package/docs/api/json.md +21 -0
  8. package/docs/api/memory.md +109 -0
  9. package/docs/api/time.md +54 -0
  10. package/docs/api/web.md +184 -0
  11. package/docs/assets/benchmarks/execution.svg +2978 -0
  12. package/docs/assets/benchmarks/http.svg +1674 -0
  13. package/docs/assets/benchmarks/improvements.svg +2315 -0
  14. package/docs/assets/benchmarks/memory.svg +1891 -0
  15. package/docs/benchmark-baseline.json +1087 -0
  16. package/docs/benchmark-results.json +91123 -0
  17. package/docs/benchmarks.json +38 -0
  18. package/docs/compatibility.md +42 -0
  19. package/docs/concurrency-implementation.md +18 -0
  20. package/docs/diagnostics.md +97 -0
  21. package/docs/docker.md +35 -0
  22. package/docs/example-projects.json +26 -0
  23. package/docs/examples/approved-design/counters.md +253 -0
  24. package/docs/examples/approved-design/dependencies/august/0.19.0/io/contracts.md +395 -0
  25. package/docs/examples/approved-design/domain/app.md +165 -0
  26. package/docs/examples/approved-design/domain/export.md +83 -0
  27. package/docs/examples/approved-design/domain/models.md +80 -0
  28. package/docs/examples/approved-design/domain/numbers.md +248 -0
  29. package/docs/examples/approved-design/index.md +39 -0
  30. package/docs/examples/approved-design/main-yaml.md +24 -0
  31. package/docs/examples/approved-design/main.md +215 -0
  32. package/docs/examples/benchmark/index.md +33 -0
  33. package/docs/examples/benchmark/main-yaml.md +17 -0
  34. package/docs/examples/benchmark/main.md +117 -0
  35. package/docs/examples/cli-args/index.md +32 -0
  36. package/docs/examples/cli-args/main.md +107 -0
  37. package/docs/examples/collections/index.md +32 -0
  38. package/docs/examples/collections/main.md +118 -0
  39. package/docs/examples/collections-benchmark/index.md +34 -0
  40. package/docs/examples/collections-benchmark/main.md +115 -0
  41. package/docs/examples/cpu-benchmark/index.md +34 -0
  42. package/docs/examples/cpu-benchmark/main.md +90 -0
  43. package/docs/examples/developer-workflow/calculator.md +357 -0
  44. package/docs/examples/developer-workflow/dependencies/august/0.19.0/io/contracts.md +395 -0
  45. package/docs/examples/developer-workflow/index.md +37 -0
  46. package/docs/examples/developer-workflow/logging/console.md +124 -0
  47. package/docs/examples/developer-workflow/logging/export.md +70 -0
  48. package/docs/examples/developer-workflow/logging/logger.md +111 -0
  49. package/docs/examples/developer-workflow/main.md +172 -0
  50. package/docs/examples/drop/index.md +33 -0
  51. package/docs/examples/drop/main.md +85 -0
  52. package/docs/examples/drop/resource.md +95 -0
  53. package/docs/examples/errors/errors.md +85 -0
  54. package/docs/examples/errors/index.md +33 -0
  55. package/docs/examples/errors/main.md +92 -0
  56. package/docs/examples/ffi/index.md +33 -0
  57. package/docs/examples/ffi/main.md +75 -0
  58. package/docs/examples/ffi/native.md +93 -0
  59. package/docs/examples/generic-di/dependencies/august/0.19.0/io/contracts.md +395 -0
  60. package/docs/examples/generic-di/index.md +33 -0
  61. package/docs/examples/generic-di/main.md +111 -0
  62. package/docs/examples/generic-di/types.md +180 -0
  63. package/docs/examples/generics/index.md +33 -0
  64. package/docs/examples/generics/main.md +120 -0
  65. package/docs/examples/generics/types.md +189 -0
  66. package/docs/examples/hello/app/export.md +67 -0
  67. package/docs/examples/hello/app/greeter.md +190 -0
  68. package/docs/examples/hello/dependencies/august/0.19.0/io/contracts.md +395 -0
  69. package/docs/examples/hello/index.md +37 -0
  70. package/docs/examples/hello/logging/console.md +121 -0
  71. package/docs/examples/hello/logging/export.md +71 -0
  72. package/docs/examples/hello/logging/logger.md +120 -0
  73. package/docs/examples/hello/main.md +115 -0
  74. package/docs/examples/http-benchmark/index.md +35 -0
  75. package/docs/examples/http-benchmark/main.md +79 -0
  76. package/docs/examples/http-benchmark/routes.md +88 -0
  77. package/docs/examples/index.md +60 -0
  78. package/docs/examples/interceptors/app.md +250 -0
  79. package/docs/examples/interceptors/dependencies/august/0.19.0/io/contracts.md +395 -0
  80. package/docs/examples/interceptors/index.md +35 -0
  81. package/docs/examples/interceptors/interceptors.md +284 -0
  82. package/docs/examples/interceptors/logging.md +155 -0
  83. package/docs/examples/interceptors/main.md +162 -0
  84. package/docs/examples/json-benchmark/data.md +71 -0
  85. package/docs/examples/json-benchmark/dependencies/august/0.19.0/json/contracts.md +103 -0
  86. package/docs/examples/json-benchmark/index.md +35 -0
  87. package/docs/examples/json-benchmark/main.md +131 -0
  88. package/docs/examples/new-syntax/console.md +118 -0
  89. package/docs/examples/new-syntax/dependencies/august/0.19.0/io/contracts.md +395 -0
  90. package/docs/examples/new-syntax/greeter.md +145 -0
  91. package/docs/examples/new-syntax/index.md +36 -0
  92. package/docs/examples/new-syntax/logger.md +111 -0
  93. package/docs/examples/new-syntax/main.md +135 -0
  94. package/docs/examples/new-syntax/math.md +79 -0
  95. package/docs/examples/oidc-login/client/contracts.md +151 -0
  96. package/docs/examples/oidc-login/client/endpoints.md +263 -0
  97. package/docs/examples/oidc-login/client/export.md +107 -0
  98. package/docs/examples/oidc-login/client/login.md +515 -0
  99. package/docs/examples/oidc-login/client/logout.md +249 -0
  100. package/docs/examples/oidc-login/client/protocol.md +595 -0
  101. package/docs/examples/oidc-login/client/session.md +297 -0
  102. package/docs/examples/oidc-login/client/views.md +144 -0
  103. package/docs/examples/oidc-login/common/export.md +115 -0
  104. package/docs/examples/oidc-login/common/headers.md +162 -0
  105. package/docs/examples/oidc-login/common/keys.md +336 -0
  106. package/docs/examples/oidc-login/common/settings.md +116 -0
  107. package/docs/examples/oidc-login/common/views.md +103 -0
  108. package/docs/examples/oidc-login/dependencies/august/0.19.0/crypto/contracts.md +925 -0
  109. package/docs/examples/oidc-login/dependencies/august/0.19.0/crypto/jose.md +434 -0
  110. package/docs/examples/oidc-login/dependencies/august/0.19.0/json/contracts.md +103 -0
  111. package/docs/examples/oidc-login/dependencies/august/0.19.0/memory/store.md +374 -0
  112. package/docs/examples/oidc-login/dependencies/august/0.19.0/time/contracts.md +150 -0
  113. package/docs/examples/oidc-login/dependencies/august/0.19.0/web/contracts.md +532 -0
  114. package/docs/examples/oidc-login/index.md +57 -0
  115. package/docs/examples/oidc-login/main-yaml.md +28 -0
  116. package/docs/examples/oidc-login/main.md +283 -0
  117. package/docs/examples/oidc-login/provider/authorization.md +457 -0
  118. package/docs/examples/oidc-login/provider/contracts.md +267 -0
  119. package/docs/examples/oidc-login/provider/credentials.md +148 -0
  120. package/docs/examples/oidc-login/provider/discovery.md +215 -0
  121. package/docs/examples/oidc-login/provider/export.md +131 -0
  122. package/docs/examples/oidc-login/provider/token.md +364 -0
  123. package/docs/examples/oidc-login/provider/userinfo.md +228 -0
  124. package/docs/examples/oidc-login/provider/views.md +137 -0
  125. package/docs/examples/ownership/counter.md +140 -0
  126. package/docs/examples/ownership/index.md +33 -0
  127. package/docs/examples/ownership/main.md +90 -0
  128. package/docs/examples/ownership-transfer/dependencies/august/0.19.0/io/contracts.md +395 -0
  129. package/docs/examples/ownership-transfer/index.md +33 -0
  130. package/docs/examples/ownership-transfer/main.md +125 -0
  131. package/docs/examples/ownership-transfer/resource.md +150 -0
  132. package/docs/examples/packages-app/dependencies/packages/@example/aug-math/0.1.0/arithmetic.md +117 -0
  133. package/docs/examples/packages-app/index.md +34 -0
  134. package/docs/examples/packages-app/main-yaml.md +18 -0
  135. package/docs/examples/packages-app/main.md +80 -0
  136. package/docs/examples/packages-math/aug-package-json.md +24 -0
  137. package/docs/examples/packages-math/index.md +36 -0
  138. package/docs/examples/packages-math/package-json.md +25 -0
  139. package/docs/examples/packages-math/src/arithmetic.md +121 -0
  140. package/docs/examples/packages-math/src/export.md +63 -0
  141. package/docs/examples/startup-benchmark/index.md +34 -0
  142. package/docs/examples/startup-benchmark/main.md +68 -0
  143. package/docs/examples/visibility/counter.md +142 -0
  144. package/docs/examples/visibility/index.md +33 -0
  145. package/docs/examples/visibility/main.md +96 -0
  146. package/docs/examples.json +47 -0
  147. package/docs/getting-started.md +5 -0
  148. package/docs/grammar.md +136 -0
  149. package/docs/implementation-map.md +106 -0
  150. package/docs/index.md +46 -0
  151. package/docs/language-conformance.md +30 -0
  152. package/docs/language-constructs.md +1461 -0
  153. package/docs/language-design-audit.md +147 -0
  154. package/docs/maintaining-docs.md +43 -0
  155. package/docs/packages.md +184 -0
  156. package/docs/performance.md +535 -0
  157. package/docs/production-readiness.md +39 -0
  158. package/docs/reference.md +361 -0
  159. package/docs/release-review.md +23 -0
  160. package/docs/releasing.md +79 -0
  161. package/docs/roadmap.md +13 -0
  162. package/docs/specifications.md +86 -0
  163. package/docs/testing.md +120 -0
  164. package/docs/tooling.md +197 -0
  165. package/docs/web-implementation-plan.md +39 -0
  166. package/docs/web-library-gaps.md +27 -0
  167. package/docs/web.md +197 -0
  168. package/examples/approved-design/.aug-spec/august/0.19.0/io/contracts.aug +36 -0
  169. package/examples/approved-design/.aug-spec/august/0.19.0/io/contracts.aug.md +316 -0
  170. package/examples/approved-design/.aug-spec/manifest.json +14 -0
  171. package/examples/approved-design/counters.aug +22 -0
  172. package/examples/approved-design/counters.aug.md +177 -0
  173. package/examples/approved-design/domain/app.aug +12 -0
  174. package/examples/approved-design/domain/app.aug.md +97 -0
  175. package/examples/approved-design/domain/export.aug +5 -0
  176. package/examples/approved-design/domain/export.aug.md +25 -0
  177. package/examples/approved-design/domain/models.aug +2 -0
  178. package/examples/approved-design/domain/models.aug.md +30 -0
  179. package/examples/approved-design/domain/numbers.aug +29 -0
  180. package/examples/approved-design/domain/numbers.aug.md +141 -0
  181. package/examples/approved-design/main.aug +26 -0
  182. package/examples/approved-design/main.aug.md +108 -0
  183. package/examples/approved-design/main.yaml +8 -0
  184. package/examples/benchmark/.aug-spec/manifest.json +7 -0
  185. package/examples/benchmark/main.aug +17 -0
  186. package/examples/benchmark/main.aug.md +43 -0
  187. package/examples/benchmark/main.yaml +1 -0
  188. package/examples/cli-args/.aug-spec/manifest.json +7 -0
  189. package/examples/cli-args/main.aug +15 -0
  190. package/examples/cli-args/main.aug.md +38 -0
  191. package/examples/collections/.aug-spec/manifest.json +7 -0
  192. package/examples/collections/main.aug +18 -0
  193. package/examples/collections/main.aug.md +43 -0
  194. package/examples/developer-workflow/.aug-spec/august/0.19.0/io/contracts.aug +36 -0
  195. package/examples/developer-workflow/.aug-spec/august/0.19.0/io/contracts.aug.md +316 -0
  196. package/examples/developer-workflow/.aug-spec/manifest.json +13 -0
  197. package/examples/developer-workflow/calculator.aug +55 -0
  198. package/examples/developer-workflow/calculator.aug.md +228 -0
  199. package/examples/developer-workflow/logging/console.aug +8 -0
  200. package/examples/developer-workflow/logging/console.aug.md +67 -0
  201. package/examples/developer-workflow/logging/export.aug +2 -0
  202. package/examples/developer-workflow/logging/export.aug.md +19 -0
  203. package/examples/developer-workflow/logging/logger.aug +6 -0
  204. package/examples/developer-workflow/logging/logger.aug.md +57 -0
  205. package/examples/developer-workflow/main.aug +25 -0
  206. package/examples/developer-workflow/main.aug.md +79 -0
  207. package/examples/drop/.aug-spec/manifest.json +8 -0
  208. package/examples/drop/main.aug +3 -0
  209. package/examples/drop/main.aug.md +35 -0
  210. package/examples/drop/resource.aug +8 -0
  211. package/examples/drop/resource.aug.md +44 -0
  212. package/examples/errors/.aug-spec/manifest.json +8 -0
  213. package/examples/errors/errors.aug +6 -0
  214. package/examples/errors/errors.aug.md +33 -0
  215. package/examples/errors/main.aug +7 -0
  216. package/examples/errors/main.aug.md +36 -0
  217. package/examples/ffi/.aug-spec/manifest.json +8 -0
  218. package/examples/ffi/main.aug +2 -0
  219. package/examples/ffi/main.aug.md +27 -0
  220. package/examples/ffi/native.aug +6 -0
  221. package/examples/ffi/native.aug.md +43 -0
  222. package/examples/generic-di/.aug-spec/august/0.19.0/io/contracts.aug +36 -0
  223. package/examples/generic-di/.aug-spec/august/0.19.0/io/contracts.aug.md +316 -0
  224. package/examples/generic-di/.aug-spec/manifest.json +10 -0
  225. package/examples/generic-di/main.aug +9 -0
  226. package/examples/generic-di/main.aug.md +49 -0
  227. package/examples/generic-di/types.aug +17 -0
  228. package/examples/generic-di/types.aug.md +124 -0
  229. package/examples/generics/.aug-spec/manifest.json +8 -0
  230. package/examples/generics/main.aug +9 -0
  231. package/examples/generics/main.aug.md +58 -0
  232. package/examples/generics/types.aug +19 -0
  233. package/examples/generics/types.aug.md +132 -0
  234. package/examples/hello/.aug-spec/august/0.19.0/io/contracts.aug +36 -0
  235. package/examples/hello/.aug-spec/august/0.19.0/io/contracts.aug.md +316 -0
  236. package/examples/hello/.aug-spec/manifest.json +14 -0
  237. package/examples/hello/app/export.aug +1 -0
  238. package/examples/hello/app/export.aug.md +17 -0
  239. package/examples/hello/app/greeter.aug +22 -0
  240. package/examples/hello/app/greeter.aug.md +109 -0
  241. package/examples/hello/logging/console.aug +7 -0
  242. package/examples/hello/logging/console.aug.md +65 -0
  243. package/examples/hello/logging/export.aug +2 -0
  244. package/examples/hello/logging/export.aug.md +19 -0
  245. package/examples/hello/logging/logger.aug +9 -0
  246. package/examples/hello/logging/logger.aug.md +59 -0
  247. package/examples/hello/main.aug +9 -0
  248. package/examples/hello/main.aug.md +49 -0
  249. package/examples/interceptors/.aug-spec/august/0.19.0/io/contracts.aug +36 -0
  250. package/examples/interceptors/.aug-spec/august/0.19.0/io/contracts.aug.md +316 -0
  251. package/examples/interceptors/.aug-spec/manifest.json +12 -0
  252. package/examples/interceptors/app.aug +28 -0
  253. package/examples/interceptors/app.aug.md +162 -0
  254. package/examples/interceptors/interceptors.aug +40 -0
  255. package/examples/interceptors/interceptors.aug.md +180 -0
  256. package/examples/interceptors/logging.aug +12 -0
  257. package/examples/interceptors/logging.aug.md +96 -0
  258. package/examples/interceptors/main.aug +22 -0
  259. package/examples/interceptors/main.aug.md +76 -0
  260. package/examples/new-syntax/.aug-spec/august/0.19.0/io/contracts.aug +36 -0
  261. package/examples/new-syntax/.aug-spec/august/0.19.0/io/contracts.aug.md +316 -0
  262. package/examples/new-syntax/.aug-spec/manifest.json +13 -0
  263. package/examples/new-syntax/console.aug +7 -0
  264. package/examples/new-syntax/console.aug.md +63 -0
  265. package/examples/new-syntax/greeter.aug +10 -0
  266. package/examples/new-syntax/greeter.aug.md +89 -0
  267. package/examples/new-syntax/logger.aug +6 -0
  268. package/examples/new-syntax/logger.aug.md +57 -0
  269. package/examples/new-syntax/main.aug +12 -0
  270. package/examples/new-syntax/main.aug.md +64 -0
  271. package/examples/new-syntax/math.aug +3 -0
  272. package/examples/new-syntax/math.aug.md +29 -0
  273. package/examples/oidc-login/.aug-spec/august/0.19.0/crypto/contracts.aug +73 -0
  274. package/examples/oidc-login/.aug-spec/august/0.19.0/crypto/contracts.aug.md +791 -0
  275. package/examples/oidc-login/.aug-spec/august/0.19.0/crypto/jose.aug +68 -0
  276. package/examples/oidc-login/.aug-spec/august/0.19.0/crypto/jose.aug.md +266 -0
  277. package/examples/oidc-login/.aug-spec/august/0.19.0/json/contracts.aug +6 -0
  278. package/examples/oidc-login/.aug-spec/august/0.19.0/json/contracts.aug.md +55 -0
  279. package/examples/oidc-login/.aug-spec/august/0.19.0/memory/store.aug +45 -0
  280. package/examples/oidc-login/.aug-spec/august/0.19.0/memory/store.aug.md +250 -0
  281. package/examples/oidc-login/.aug-spec/august/0.19.0/time/contracts.aug +11 -0
  282. package/examples/oidc-login/.aug-spec/august/0.19.0/time/contracts.aug.md +96 -0
  283. package/examples/oidc-login/.aug-spec/august/0.19.0/web/contracts.aug +58 -0
  284. package/examples/oidc-login/.aug-spec/august/0.19.0/web/contracts.aug.md +420 -0
  285. package/examples/oidc-login/.aug-spec/manifest.json +40 -0
  286. package/examples/oidc-login/README.md +29 -0
  287. package/examples/oidc-login/client/contracts.aug +7 -0
  288. package/examples/oidc-login/client/contracts.aug.md +80 -0
  289. package/examples/oidc-login/client/endpoints.aug +21 -0
  290. package/examples/oidc-login/client/endpoints.aug.md +161 -0
  291. package/examples/oidc-login/client/export.aug +7 -0
  292. package/examples/oidc-login/client/export.aug.md +29 -0
  293. package/examples/oidc-login/client/login.aug +58 -0
  294. package/examples/oidc-login/client/login.aug.md +331 -0
  295. package/examples/oidc-login/client/logout.aug +18 -0
  296. package/examples/oidc-login/client/logout.aug.md +150 -0
  297. package/examples/oidc-login/client/protocol.aug +106 -0
  298. package/examples/oidc-login/client/protocol.aug.md +326 -0
  299. package/examples/oidc-login/client/session.aug +34 -0
  300. package/examples/oidc-login/client/session.aug.md +155 -0
  301. package/examples/oidc-login/client/views.aug +21 -0
  302. package/examples/oidc-login/client/views.aug.md +68 -0
  303. package/examples/oidc-login/common/export.aug +9 -0
  304. package/examples/oidc-login/common/export.aug.md +33 -0
  305. package/examples/oidc-login/common/headers.aug +11 -0
  306. package/examples/oidc-login/common/headers.aug.md +79 -0
  307. package/examples/oidc-login/common/keys.aug +37 -0
  308. package/examples/oidc-login/common/keys.aug.md +207 -0
  309. package/examples/oidc-login/common/settings.aug +4 -0
  310. package/examples/oidc-login/common/settings.aug.md +47 -0
  311. package/examples/oidc-login/common/views.aug +16 -0
  312. package/examples/oidc-login/common/views.aug.md +34 -0
  313. package/examples/oidc-login/main.aug +39 -0
  314. package/examples/oidc-login/main.aug.md +166 -0
  315. package/examples/oidc-login/main.yaml +12 -0
  316. package/examples/oidc-login/provider/authorization.aug +59 -0
  317. package/examples/oidc-login/provider/authorization.aug.md +264 -0
  318. package/examples/oidc-login/provider/contracts.aug +15 -0
  319. package/examples/oidc-login/provider/contracts.aug.md +193 -0
  320. package/examples/oidc-login/provider/credentials.aug +10 -0
  321. package/examples/oidc-login/provider/credentials.aug.md +64 -0
  322. package/examples/oidc-login/provider/discovery.aug +13 -0
  323. package/examples/oidc-login/provider/discovery.aug.md +133 -0
  324. package/examples/oidc-login/provider/export.aug +13 -0
  325. package/examples/oidc-login/provider/export.aug.md +41 -0
  326. package/examples/oidc-login/provider/token.aug +37 -0
  327. package/examples/oidc-login/provider/token.aug.md +223 -0
  328. package/examples/oidc-login/provider/userinfo.aug +26 -0
  329. package/examples/oidc-login/provider/userinfo.aug.md +104 -0
  330. package/examples/oidc-login/provider/views.aug +18 -0
  331. package/examples/oidc-login/provider/views.aug.md +63 -0
  332. package/examples/ownership/.aug-spec/manifest.json +8 -0
  333. package/examples/ownership/counter.aug +14 -0
  334. package/examples/ownership/counter.aug.md +85 -0
  335. package/examples/ownership/main.aug +4 -0
  336. package/examples/ownership/main.aug.md +38 -0
  337. package/examples/ownership-transfer/.aug-spec/august/0.19.0/io/contracts.aug +36 -0
  338. package/examples/ownership-transfer/.aug-spec/august/0.19.0/io/contracts.aug.md +316 -0
  339. package/examples/ownership-transfer/.aug-spec/manifest.json +10 -0
  340. package/examples/ownership-transfer/main.aug +9 -0
  341. package/examples/ownership-transfer/main.aug.md +63 -0
  342. package/examples/ownership-transfer/resource.aug +16 -0
  343. package/examples/ownership-transfer/resource.aug.md +89 -0
  344. package/examples/packages/README.md +15 -0
  345. package/examples/packages/app/.aug-spec/manifest.json +9 -0
  346. package/examples/packages/app/.aug-spec/packages/@example/aug-math/0.1.0/arithmetic.aug +9 -0
  347. package/examples/packages/app/.aug-spec/packages/@example/aug-math/0.1.0/arithmetic.aug.md +63 -0
  348. package/examples/packages/app/main.aug +2 -0
  349. package/examples/packages/app/main.aug.md +33 -0
  350. package/examples/packages/app/main.yaml +2 -0
  351. package/examples/packages/math/.aug-spec/manifest.json +8 -0
  352. package/examples/packages/math/README.md +3 -0
  353. package/examples/packages/math/aug-package.json +8 -0
  354. package/examples/packages/math/package.json +9 -0
  355. package/examples/packages/math/src/arithmetic.aug +8 -0
  356. package/examples/packages/math/src/arithmetic.aug.md +63 -0
  357. package/examples/packages/math/src/export.aug +1 -0
  358. package/examples/packages/math/src/export.aug.md +17 -0
  359. package/examples/visibility/.aug-spec/manifest.json +8 -0
  360. package/examples/visibility/counter.aug +14 -0
  361. package/examples/visibility/counter.aug.md +87 -0
  362. package/examples/visibility/main.aug +7 -0
  363. package/examples/visibility/main.aug.md +39 -0
  364. package/package.json +50 -0
  365. package/runtime/aug_crypto.c +121 -0
  366. package/runtime/aug_html.c +93 -0
  367. package/runtime/aug_http.c +829 -0
  368. package/runtime/aug_json.c +165 -0
  369. package/runtime/aug_runtime.c +792 -0
  370. package/runtime/aug_runtime.h +245 -0
  371. package/runtime/aug_tasks.c +172 -0
  372. package/runtime/aug_time.c +5 -0
  373. package/runtime/aug_values.c +80 -0
  374. package/scripts/bootstrap-native.mjs +121 -0
  375. package/scripts/native-dependencies.lock.json +65 -0
  376. package/scripts/native-home.mjs +11 -0
  377. package/src/actions.js +109 -0
  378. package/src/ast.js +19 -0
  379. package/src/builtins.js +93 -0
  380. package/src/checker.js +2896 -0
  381. package/src/cli.js +344 -0
  382. package/src/codegen.js +1159 -0
  383. package/src/config.js +149 -0
  384. package/src/continuation.js +110 -0
  385. package/src/di.js +24 -0
  386. package/src/documentation.js +27 -0
  387. package/src/editor.js +782 -0
  388. package/src/effects.js +29 -0
  389. package/src/fixes.js +222 -0
  390. package/src/formatter.js +296 -0
  391. package/src/freshness.js +154 -0
  392. package/src/help.js +212 -0
  393. package/src/html.js +27 -0
  394. package/src/http-policies.js +90 -0
  395. package/src/inference.js +16 -0
  396. package/src/interceptors.js +70 -0
  397. package/src/javadoc.js +67 -0
  398. package/src/lexer.js +199 -0
  399. package/src/libraries.js +31 -0
  400. package/src/lsp.js +180 -0
  401. package/src/native.js +144 -0
  402. package/src/navigation.js +162 -0
  403. package/src/openapi.js +220 -0
  404. package/src/ownership.js +232 -0
  405. package/src/package-manager.js +299 -0
  406. package/src/parser.js +1155 -0
  407. package/src/policies.js +130 -0
  408. package/src/project-init.js +19 -0
  409. package/src/project.js +292 -0
  410. package/src/schemas.js +62 -0
  411. package/src/semantic.js +255 -0
  412. package/src/spec.js +738 -0
  413. package/src/testing.js +186 -0
  414. package/src/types.js +10 -0
@@ -0,0 +1,120 @@
1
+ # Built-in unit tests
2
+
3
+ Tests live in the same file as the declaration they describe. Class suites use `test ClassName subject`; function suites use `test functionName`. Tests are excluded from production executables, and no test package is required.
4
+
5
+ Endpoint suites use `test endpoint endpointName client`. HttpTestClient enters the native routing and policy pipeline with explicit method, relative path, headers and optional Bytes body. Group bindings supply fresh test dependencies; production startup is excluded. See the [complete service and endpoint cases](web.md#endpoint-tests). Live sockets, TLS negotiation and disconnect behavior require transport tests separately.
6
+
7
+ ## A complete function suite
8
+
9
+ ```aug project=testing-guide file=main.aug
10
+ import add from math
11
+
12
+ print(value=add(left=1, right=2))
13
+ ```
14
+
15
+ ```aug project=testing-guide file=fixtures.aug
16
+ /** A reusable, pure test input. */
17
+ fixture seven() returns int:
18
+ return 7
19
+ ```
20
+
21
+ ```aug project=testing-guide file=math.aug
22
+ import seven from fixtures
23
+
24
+ /**
25
+ * Add two integers with defined wrapping.
26
+ * @param left First operand.
27
+ * @param right Second operand.
28
+ * @return Their sum.
29
+ */
30
+ add(int left, int right) returns int:
31
+ return left + right
32
+
33
+ test add:
34
+ when addition:
35
+ it adds for (left, right, expected) in [(1, 2, 3), (4, 3, 7), (0, 0, 0)]:
36
+ assert(add(right=right, left=left) == expected)
37
+
38
+ it uses_fixture:
39
+ assert(add(left=seven(), right=0) == 7)
40
+ ```
41
+
42
+ Each tuple row becomes a separately listed and executed case. Row arity and types are checked. The row variables are local to that case. Fixtures are ordinary checked functions marked `fixture`; import them explicitly and declare any dependencies/effects. They create no implicit fixture scope and remain callable as ordinary functions.
43
+
44
+ ## A complete class suite
45
+
46
+ ```aug project=class-testing-guide file=main.aug
47
+ import Counter from counter
48
+
49
+ counter = Counter(initial=1)
50
+ print(value=counter.value())
51
+ ```
52
+
53
+ ```aug project=class-testing-guide file=counter.aug
54
+ interface Count:
55
+ increment() changes self
56
+ value() returns int
57
+
58
+ Counter(mutable int initial to _count) implements Count:
59
+ increment() changes self:
60
+ _count = _count + 1
61
+ value() returns int:
62
+ return _count
63
+
64
+ test Counter counter:
65
+ when increment:
66
+ counter = Counter(initial=3)
67
+ it advances:
68
+ borrow counter:
69
+ counter.increment()
70
+ assert(counter.value() == 4)
71
+ it starts_fresh:
72
+ assert(counter.value() == 3)
73
+ ```
74
+
75
+ The subject header identifies a local class and the variable used to test it. It does not invoke the constructor; initialize that subject in setup or the case. Generic classes use concrete type arguments. Tests follow ordinary member privacy and cannot access private fields merely because they share the file.
76
+
77
+ ## Groups, setup, and dependencies
78
+
79
+ Group/case names are identifiers or quoted strings. A suite's groups are unique; a group's cases are unique. Within a group, place bindings or included compositions first, setup statements second, and cases last. Nested groups are not supported.
80
+
81
+ Every case gets its own setup, bindings, native process, managed heap, and assertion state. Production main bindings and startup never run. Setup variables are visible only to that case. All bindings use ordinary graph, lifetime, and purity checks.
82
+
83
+ Resolve expressions belong in setup. Test bodies and helpers receive visible dependencies through setup variables or headers. A test can explicitly replace a capability with a private adapter. See [the runnable calculator tests](../examples/developer-workflow/calculator.aug).
84
+
85
+ Process isolation does not reset files, databases, sockets, or other external resources. Use explicit adapters or case-specific resources for integration tests.
86
+
87
+ ## Assertions and failure
88
+
89
+ `assert(condition)` and `assert(condition=condition)` require a bool. A failed assertion reports file, line, and source condition. Catching its error cannot make the case pass. Setup may assert its invariants, but every case body must also execute an assertion. A body that executes none fails.
90
+
91
+ An uncaught checked error, a native crash, a nonzero exit, or a timeout fails the case. Assertions are test operations, not production contracts.
92
+
93
+ ## CLI and coverage
94
+
95
+ Use `aug` when installed, or `node bin/aug.mjs` from this repository.
96
+
97
+ | Command | Action |
98
+ | --- | --- |
99
+ | `aug test PROJECT` | Run all cases. |
100
+ | `aug test PROJECT GROUP_NAME` | Select an exact group name. |
101
+ | `aug test PROJECT --group NAME` | Same explicit selection. |
102
+ | `aug test PROJECT --list --json` | Discover IDs, subject, group, case, row, file, and line. |
103
+ | `aug test PROJECT --case ID` | Select an exact ID; repeat for several. |
104
+ | `aug test PROJECT --json` | Machine-readable pass/fail counts and captured output. |
105
+ | `aug test PROJECT --timeout 2000` | Limit each native execution to 2 seconds. |
106
+ | `aug test PROJECT --coverage` | Merge executed statement lines across selected cases. |
107
+
108
+ Selection is exact and case sensitive. Quote names containing spaces. Unknown selections fail. The default timeout is ten seconds per native case; compilation is outside that timeout.
109
+
110
+ Test C and binaries live under `.aug-build/tests/`. Coverage writes `.aug-build/coverage/coverage.json` and `lcov.info`, retaining zero-count executable lines in the compiled test closure. It reports statement lines, not branch coverage. Production startup is omitted, so the result is not whole-application startup coverage. Filtering reports only selected tests and their reachable declarations.
111
+
112
+ `aug check` checks production and test bodies. `aug test` checks selected tests and their reachable declarations; it does not execute or type-check production startup. A test project still has a root main.aug.
113
+
114
+ ## VS Code
115
+
116
+ Test Explorer groups cases by project, declaration, and when group. Parameterized rows have separate entries and source locations. Saving refreshes discovery; **AugScript: Refresh Tests** refreshes it manually. Running saves pending edits first. Cancellation skips remaining cases after the active case finishes or times out.
117
+
118
+ Choose **Native tests** to run or **Native coverage** to see merged statement-line coverage when the installed VS Code supports its coverage API. **AugScript: Test Project** runs the project CLI in a task terminal.
119
+
120
+ The adapter uses the [VS Code Testing API](https://code.visualstudio.com/api/extension-guides/testing). `try`/`always` performs explicit cleanup; snapshots and nested groups are not part of this version. Each selected case currently compiles a separate native binary.
@@ -0,0 +1,197 @@
1
+ # Native builds and developer tooling
2
+
3
+ ## CLI
4
+
5
+ Use `aug` if installed or `node bin/aug.mjs` from the repository. Commands take a project folder, defaulting to the current directory. Editor commands also accept --file and --offset; use --help for the command inventory.
6
+
7
+ | Command | Output |
8
+ | --- | --- |
9
+ | `check PROJECT [--json]` | Production, tests, module policy, documentation, and configuration diagnostics. |
10
+ | `build PROJECT [--out NAME] [--json]` | Native path; JSON contains output and sourceMap. |
11
+ | `run PROJECT -- args...` | Builds and runs; program stdout is preserved. |
12
+ | `emit-c PROJECT` | Generated C for inspection. |
13
+ | `format PROJECT [--file PATH] [--write] [--json]` | Canonical source; --write updates files. |
14
+ | `migrate PROJECT [--file PATH] [--write] [--json]` | Verified migration of rejected legacy syntax; preview by default. |
15
+ | `spec PROJECT [--check] [--json]` | Adjacent Markdown specs and offline dependency explanations; --check detects drift without writing. |
16
+ | `test PROJECT [--coverage] [--json]` | Isolated native tests and optional statement-line report. |
17
+ | `bench PROJECT [--iterations N] [--warmup N] [--timeout MS] [--json] -- args...` | Release build with timed native executions. |
18
+ | `explain PROJECT --file PATH [--name NAME]` | Checked contracts, dependencies, layers, origins, tests, and module surface. |
19
+ | `context PROJECT --file PATH [--name NAME] [--budget N]` | Bounded JSON context, including related declarations and source snippets. |
20
+ | `lsp PROJECT` | Persistent language server over stdio. |
21
+ | `package init DIRECTORY --name @owner/name` | Standalone source library with public exports, Javadoc and a same-file test. |
22
+ | `package pack DIRECTORY` | Checked source archive ready for npm publishing or local installation. |
23
+ | `install PROJECT [--frozen] [--offline]` | Explicit dependency snapshot and aug.lock.json. |
24
+
25
+ Warnings are nonblocking. Machine diagnostics carry severity, code, file, line, column, and message. check/build fail on errors; invalid command usage returns nonzero. Test failure returns nonzero and includes the case output.
26
+
27
+ ## Native standard libraries
28
+
29
+ Web, crypto, JSON and tasks use pinned private C dependencies. On macOS or Linux, bootstrap them once from the compiler directory:
30
+
31
+ ```sh
32
+ node scripts/bootstrap-native.mjs
33
+ ```
34
+
35
+ The script verifies archive SHA-256 hashes and builds under `.aug-native`; it does not install system packages. `--extract-only` supplies yyjson and minicoro for JSON/task-only programs. Web and crypto require the complete native build. Sources, dependency revisions and hashes are recorded in scripts/native-dependencies.lock.json; the installed manifest also records host platform and architecture. The full build has run on macOS ARM and Linux ARM; Linux x86-64 is checked by the Docker CI job.
36
+
37
+ Set `AUG_NATIVE_HOME` to share a dependency directory across compiler copies. It names the directory containing `sources/` and `prefix/`, not the prefix itself. Bootstrap and compilation both honor it. For the bundled VS Code compiler, set `augscript.nativeHome` to that same absolute directory. The extension bundles the bootstrap scripts and lockfile; it does not bundle host-specific native libraries. Node 24+ and a C11 compiler remain requirements.
38
+
39
+ The [web guide](web.md) covers transport/TLS/OpenAPI configuration and the working login app. The [gap ledger](web-library-gaps.md) records remaining native and language coverage.
40
+
41
+ ## Configuration
42
+
43
+ main.yaml is optional. The supported subset has scalar key/value lines and indented dash lists; it is not a general YAML implementation.
44
+
45
+ ```yaml
46
+ output: application
47
+ optimization: debug
48
+ block_style: indent
49
+ indentation: tabs
50
+ assignment: to
51
+ spec:
52
+ require_comments: none
53
+ strict_modules: false
54
+ max_public_symbols: 12
55
+ max_dependencies: 8
56
+ lint:
57
+ - wildcard_imports
58
+ - public_helpers
59
+ - public_docs
60
+ - broad_errors
61
+ - discarded_errors
62
+ - architecture
63
+ module_dependencies:
64
+ - ".: app, contracts"
65
+ - "app: contracts, shared"
66
+ libraries:
67
+ - m
68
+ library_paths:
69
+ - native/lib
70
+ ```
71
+
72
+ | Key | Contract |
73
+ | --- | --- |
74
+ | output | Executable name under .aug-build, or an absolute output path. |
75
+ | optimization | debug (-O0) or release (-O2); both retain debug information. |
76
+ | block_style | Formatter braces or indent. |
77
+ | indentation | Formatter spaces (four) or tabs. |
78
+ | assignment | Formatter equals or to; both remain accepted source forms. |
79
+ | spec.require_comments | Require Javadoc on none (default), public declarations/methods, or all declarations/methods. Inherited method docs satisfy it. |
80
+ | strict_modules | Require sibling declarations to be listed in the folder export file. |
81
+ | max_public_symbols | Public declaration/member warning threshold, default 12. |
82
+ | max_dependencies | Import fan-out warning threshold, default 8. |
83
+ | lint | Optional warnings listed above. |
84
+ | module_dependencies | Allowed folder edges; same-folder imports and standard capabilities are allowed. |
85
+ | libraries / library_paths | Linker library names and project-relative search directories. |
86
+
87
+ An owner without a rule is unrestricted. . names the project root; folder names use slash paths. * matches any folder, and domain/* matches that folder and descendants. Rules use the first matching owner. Import cycles are always rejected independently of the policy.
88
+
89
+ Unknown/duplicate keys, invalid values, and unsupported list shapes fail during check. VS Code provides key help and completion. Architecture warnings count public surface and dependency fan-out; there is no file-length rule.
90
+
91
+ ## Numeric and text contracts
92
+
93
+ - int is a signed 64-bit integer. Literals are checked exactly. +, -, multiplication, and negation wrap in two's-complement arithmetic. The minimum divided by -1 also wraps to the minimum. Integer comparison preserves values beyond floating-point precision.
94
+ - Division by a potentially zero operand raises checked ArithmeticError. A known nonzero integer literal divisor does not need that clause.
95
+ - float uses C double. Literals must be finite. Mixed int/float arithmetic widens to double and can lose integer precision. Runtime floating-point results follow native double behavior.
96
+ - c_int is signed 32-bit and maps to the platform C int, whose width is checked during compilation. c_int(value=wide) raises ConversionError outside its range; int(value=narrow) widens without loss.
97
+ - Source strings are Unicode text, emitted as UTF-8. NUL and unpaired surrogates are compile errors. File text rejects embedded NUL and malformed/overlong UTF-8 as FileError. Binary files need a future byte API.
98
+ - Immutable tuples and records have structural equality/hashing. Behavioral classes and mutable collection objects have identity equality. Map/Set preserve insertion order for iteration.
99
+
100
+ ## C boundary
101
+
102
+ The programmer can expose a C declaration through the language, then wrap it in an ordinary callable with a visible effect contract:
103
+
104
+ ```aug project=ffi-guide file=main.aug
105
+ import announce from native
106
+
107
+ announce(message="Hello from C")
108
+ ```
109
+
110
+ ```aug project=ffi-guide file=native.aug
111
+ extern C puts(string value) returns c_int
112
+
113
+ announce(string message) uses C.puts:
114
+ unsafe:
115
+ result = puts(value=message)
116
+ ```
117
+
118
+ | AugScript | C ABI |
119
+ | --- | --- |
120
+ | int | int64_t |
121
+ | c_int | int, checked as 32 bits |
122
+ | float | double |
123
+ | bool | bool |
124
+ | string | const char* (UTF-8, no NUL) |
125
+ | void | void |
126
+
127
+ C calls require unsafe, and callables declare uses C.function. Ordinary scalar extern declarations have no generics, resolve parameters, ownership transfer, nullable boundary types, or checked error clause. For libc functions taking C int, explicitly narrow with c_int; do not declare their boundary as int64_t.
128
+
129
+ Standard adapters use `extern C value` for the managed AugValue ABI. Each C argument and result must actually be AugValue; headers expose the declared capability effect and checked failures. `pure` asserts a trusted native implementation has no observable effects. These declarations are unsafe contracts, not automatic C bindings. Crypto, HTTP, JSON and time adapters demonstrate this narrow boundary in src/stdlib and runtime.
130
+
131
+ The extern declaration must match the real native ABI. This version does not expose pointers, callbacks, binary buffers, arbitrary structs, or a C header importer.
132
+
133
+ ## Source locations and debugging
134
+
135
+ Native output lives under .aug-build. Generated C has #line locations for executable AugScript statements and extern declarations. Native compiler errors at those locations become NATIVE diagnostics. A successful build writes EXECUTABLE.augmap.json with compiler version, exact C arguments, source hashes, generated hash, and symbol origins.
136
+
137
+ Every build uses -g. Use **Debug AugScript** in VS Code with LLVM lldb-dap on PATH, or configure augscript.lldbDapPath. The extension builds the project and launches the standard adapter. See the [VS Code debugger API](https://code.visualstudio.com/api/extension-guides/debugger-extension) and [LLDB DAP documentation](https://lldb.llvm.org/use/lldbdap.html).
138
+
139
+ **AugScript: Debug in LLDB Terminal** works with an ordinary lldb executable. Example terminal commands:
140
+
141
+ ```text
142
+ breakpoint set --file /absolute/project/domain/numbers.aug --line 20
143
+ run
144
+ bt
145
+ ```
146
+
147
+ Debug information resolves source breakpoints. Variables currently display the C runtime's tagged representation; rich AugScript variable views, expression evaluation, and ownership-aware debugging are future work. This machine has LLDB but no lldb-dap, so the DAP launch path requires installing/configuring that adapter. The source-breakpoint smoke test resolved two locations; native launch then stalled on this host and was stopped, so interactive stepping and call-stack behavior remain unverified here.
148
+
149
+ AUG_TRACE_DROPS=1 enables runtime cleanup tracing to stderr for lifecycle verification; it is developer instrumentation, not a language I/O capability.
150
+
151
+ ## Benchmarks
152
+
153
+ `aug bench` compiles release C, runs warmups, then reports every sample, median, minimum, and p95 in milliseconds. Measurements include process startup and exclude compilation. The timeout bounds each native run.
154
+
155
+ See [performance and benchmark graphs](performance.md) for measured comparisons with C, Node and Python, peak memory, HTTP throughput, raw results, and reproducible commands. `npm run bench:compare` measures the fixed workloads under `benchmarks/`. The earlier [single-workload baseline](benchmarks.json) is preserved as historical evidence.
156
+
157
+ The runtime uses tagged values, dynamic member lookup, a managed heap, and runtime collection adapters. Speed claims require workload comparisons and profiling; translating to C alone does not establish them.
158
+
159
+ ## Context for developers and LLMs
160
+
161
+ Explain emits checked callable inputs, results, mutation, capabilities, effective errors, interceptor order/dependencies/short-circuit signals, source locations, tests, and binding lifetimes. Endpoint contracts also include route, status, streaming, wire input sources, policy options and explicit policy dependencies. Context adds reachable related declarations and source snippets within a character budget (512–100000, default 12000).
162
+
163
+ Output labels completeness as checked or partial and marks truncation explicitly. A partial or truncated result cannot establish whole-application correctness. Provenance uses stable declaration IDs and absolute source locations.
164
+
165
+ Save a report, then compare architecture with --baseline previous.json. Reports include file dependency edges, public signature hashes, and member counts; changes describe added/removed dependencies and public interface growth. Both reports must cover the modules being compared.
166
+
167
+ ## Persistent editor checks and reproducibility
168
+
169
+ ### File icons
170
+
171
+ The VS Code extension includes an August logo and a file icon theme. Run
172
+ **AugScript: Open Welcome** for the illustrated overview and guides; its images
173
+ are bundled and work offline. Run
174
+ **AugScript: Enable File Icons** to select it for the current workspace, or use
175
+ **Preferences: File Icon Theme → AugScript Icons**. The repository already sets
176
+ `workbench.iconTheme` to `augscript-icons` in its workspace settings.
177
+
178
+ | File | Icon meaning |
179
+ | --- | --- |
180
+ | `.aug` | Blue source file. |
181
+ | `main.aug` | Amber startup file. |
182
+ | `export.aug` | Purple public module surface. |
183
+ | `main.yaml` | Teal project configuration. |
184
+
185
+ Default light/dark language icons also work with compatible icon themes. The
186
+ August theme provides the special startup and export marks. After installing an
187
+ updated VSIX, use **Developer: Reload Window** if the editor still displays the
188
+ previous version. Editable vector artwork and its rendering instructions live
189
+ in `vscode/media`.
190
+
191
+ ### Language server
192
+
193
+ The language server implements the [LSP 3.17 protocol](https://github.com/Microsoft/language-server-protocol/blob/gh-pages/_specifications/lsp/3.17/specification.md) over Content-Length framed UTF-8 messages. It handles document versions, diagnostics, hover, completion, definitions, formatting, fixes, and semantic tokens.
194
+
195
+ One server runs per project. Parsed modules and checked import closures are cached by source/configuration revision. Unrelated edits reuse the previous immutable semantic document; dependency edits invalidate its closure. Local files can be checked while main composition is incomplete. Whole-project check/build still validates all bindings and startup.
196
+
197
+ Compiler and extension development dependencies use exact versions and lockfiles. Native maps record the selected C toolchain and inputs; C compiler/OS versions are environment requirements, not vendored binaries. User-authored source packages use npm archives/registry transport, exact versions, and `aug.lock.json`; [the package guide](packages.md) covers creation, installation, public imports and frozen CI builds.
@@ -0,0 +1,39 @@
1
+ # August web implementation
2
+
3
+ ## Confirmed scope
4
+
5
+ The user confirmed the language and web design on 2026-09-28 and asked for implementation, with a runnable OpenID Connect login proof. Both the OpenID Connect provider and the relying-party login flow belong in the same August application.
6
+
7
+ The language tenets are simplicity and developer scalability. Public declarations must show inputs, dependencies, effects, errors, and behavior in context. Imports and module exports remain explicit. Application logic belongs in August; native protocol and cryptographic operations belong behind safe capability interfaces and narrow unsafe adapters.
8
+
9
+ ### Delivery requirements
10
+
11
+ - C output and pinned libwebsockets/GnuTLS HTTP/1.1, HTTP/2, HTTP/3, and TLS transport.
12
+ - Structured concurrency: scope-owned tasks and DI, start/wait for, ordered grouped and collection waits, always cleanup, cancellation, bounded workers, reference sharing, explicit locks, channels and broadcasts.
13
+ - Named first-party endpoints, typed binding sources, explicit serve selection in main.aug, JSON/HTML/binary and bounded streaming responses, outbound HttpClient, and HttpResponse<T>.
14
+ - JSX-style server components with checked named properties and children. handle endpoint(...) binds an HTTP action. input from form supplies a typed body. Successful actions follow redirects or reload the page. August application code runs on the server; generated transport wires events to requests.
15
+ - Immutable records with immutable collection fields, consuming deep freeze, optional versus nullable states, and private body fields with pure initialization.
16
+ - Checked unless errors, mapped errors, Problem Details, automatic 400/413/415/422 binding responses, request-scoped 500 handling, and termination after streaming has begun.
17
+ - Configurable interceptors in declaration order and explicit authentication capabilities.
18
+ - Strict OpenAPI generation configured in main.yaml, same-file endpoint tests, protocol integration tests, compiler diagnostics, documentation, and VS Code support.
19
+ - august.crypto and a same-application OpenID Connect provider/client proof, issuing a separate application session JWT after validating the provider ID token.
20
+
21
+ ### Agreed public test seams
22
+
23
+ The confirmed design includes compiler/CLI behavior, same-file endpoint tests through the HTTP pipeline, and actual native protocol tests. The requested proof adds the externally observable login flow: discovery, authorization, code exchange, signature and claim validation, session issuance, protected access, and logout. Cryptographic verification is tested through public capability operations and independently specified vectors.
24
+
25
+ ## Work sequence
26
+
27
+ 1. Establish reproducible native dependencies and record current gaps.
28
+ 2. Implement foundational syntax and safe runtime data operations in vertical slices.
29
+ 3. Implement endpoint checking, HTTP transport, serialization, response control, and OpenAPI.
30
+ 4. Implement server markup, components, forms, and endpoint action transport.
31
+ 5. Implement structured concurrency and synchronized scoped resources.
32
+ 6. Implement crypto capabilities, JOSE/JWT, and OpenID Connect application modules.
33
+ 7. Exercise the native app end to end, address discovered gaps, update tooling, review, and run release gates.
34
+
35
+ ## Proof profile
36
+
37
+ Authorization Code flow with S256 PKCE, unpredictable state and nonce, exact redirect-URI matching, one-use short-lived authorization codes, a discovery document and JWKS, validated signed ID tokens, and an independently signed expiring application-session JWT in an HttpOnly cookie. Provider and application session credentials have distinct validation contexts. Loopback HTTP is an explicit development configuration; external deployments use TLS.
38
+
39
+ This file records requirements, not a claim that delivery is complete. Actual verification and remaining gaps are recorded separately.
@@ -0,0 +1,27 @@
1
+ # Web and crypto library gaps
2
+
3
+ This ledger records gaps discovered while implementing the confirmed web design and the same-application OpenID Connect proof. Status must reflect executable evidence.
4
+
5
+ | Gap | Why the proof needs it | Status |
6
+ | --- | --- | --- |
7
+ | Native HTTP/TLS transport | Provider and client must exchange real HTTP requests in one app without blocking each other. | HTTP/1.1, TLS peer verification, HTTP/2 and an HTTP/3-only QUIC client pass socket tests. Same-process outbound requests suspend the request task. Independent implementations and broader protocol conformance remain to be exercised. |
8
+ | Typed requests, responses, headers, cookies, redirects and forms | Login, authorization, token exchange, session issuance and logout need explicit protocol control. | The native login flow verifies typed JSON and form input, duplicate-preserving headers, browser cookies and redirects. Multipart forms, inbound streaming and broader HTTP conformance remain. |
9
+ | JSON decoding and length-aware binary/text values | JWKS, tokens, request records, and valid JSON need safe lossless serialization. | Strict parsing, int64 record decoding, value-or-null optional fields and shared frozen collections pass native tests. Omitted optional fields become null. More HTTP input coverage remains. |
10
+ | Cryptographic capabilities | Secure randomness, SHA-256/PKCE, signatures, verification, key handling and constant-time comparison. | Injectable GnuTLS adapter, RSA JWK export/import, fixed-algorithm/type JOSE and PBKDF2 run in the proof. Node independently verifies the provider signature. General secret-buffer zeroization and key lifecycle APIs remain. |
11
+ | Protocol-specific error bodies | OAuth token errors require OAuth JSON rather than the default RFC 9457 body. | Token grant and form failures return OAuth JSON; transport-level limits still use HTTP Problem Details. The response contract is visible in generated OpenAPI. |
12
+ | OpenID Connect protocol support | Discovery, exact client/redirect checks, PKCE, nonce/state, one-use codes, and ID-token validation. | Same-application authorization-code flow passes. Wrong PKCE, replay, tampered JWTs, provider-token/session substitution, protected access and logout revocation pass. Broader provider profiles, account persistence, federation, key rotation and certification remain. |
13
+ | Scoped concurrent state | Authorization transactions and codes need bounded lifetimes and synchronized access. | Bounded ExpiringStore<T> uses Shared<Map<...>> with atomic removal. Scope joining, cancellation, cleanup and task capture loans pass native/compiler tests. Scheduling remains on one OS thread; bounded multicore workers, channels and broadcasts remain. |
14
+ | Server markup and typed HTTP actions | Login forms and protected pages must be authored in August. | Typed components, escaped markup and deferred handle actions pass compiler/socket tests. POST/PATCH/PUT/DELETE forms use generated same-origin event transport. Provider sign-in and app logout pass browser interaction testing with typed actions. Ordinary no-referrer HTML form POST sends a null Origin in this browser; the proof uses actions while preserving strict Origin and CSRF checks. |
15
+ | Same-file endpoint tests and OpenAPI | Public behavior and contracts must remain discoverable and verifiable. | Strict OpenAPI 3.2.1 generation, the served API explorer, and same-file endpoint pipeline tests pass. The test client exercises native routing, binding, DI, serialization, and bounded streaming collection. Editor help and context preserve route, wire source, policy options and endpoint cases. Test transport parsing is not a substitute for socket tests. |
16
+ | Streaming and interceptor policies | Streams need backpressure, cancellation and whole-request policy lifetime. | Yielded SSE, Bytes and Html pass socket tests with a single bounded 64 KiB pending item and transport backpressure. Errors before output map to responses; errors after headers terminate output. TCP disconnect runs always cleanup and request logging. Authentication before decode, permission checks, rate limits, exact-origin CORS/preflight, gzip and streaming deadlines pass native socket tests. Policies currently precede custom parameter interceptors. Inbound streams, request-reception deadlines and broader compression negotiation remain. |
17
+ | Native dependency tooling | Full web/crypto builds need a private native stack on each host platform. | Pinned private bootstrap and native tests pass on macOS ARM and Linux ARM. Linux x86-64 runs in Docker CI. The build and runtime images include matching native libraries; other platforms remain unverified. |
18
+ | Public task error contracts | Task helpers should show their delayed failures in context. | Locally scheduled errors follow task aliases, collections, waits, exception paths and implicit joins. A helper accepting Task<T> must handle or declare Error; a public type spelling for a narrower delayed-error contract remains. |
19
+ | Injected captures and owned shared payloads | Concurrent helpers must preserve dependency loans and resource lifetime. | The compiler tracks task reads through injected dependencies as well as written arguments and receivers. A native regression verifies that dropping an owned `Shared<T>` drops its transferred payload before later locals. Broader ownership and cancellation conformance work remains in the language roadmap. |
20
+
21
+ Release review regressions cover duplicate scalar query/header/cookie/form inputs without process failure, inherited child deadlines, lock progress, owned resource lifetime, sibling and grouped cleanup errors, bounded response statuses, int64 action captures, complex and Json-valued forms, empty streams, and post-yield endpoint-test failures.
22
+
23
+ ## Scope boundaries
24
+
25
+ The proof is a development identity provider in the same application as its relying party. Identity-provider certification, persistent account management, federation, key rotation, and distributed session revocation require explicit follow-up work unless delivered and verified here. The provider must still implement the protocol checks used by its declared flow.
26
+
27
+ Multicore worker and channel/broadcast patches were rejected by automatic approval review because their execution, ownership and wakeup changes affect the runtime broadly. Those patches were not applied. Explicit approval requests remain pending; scheduling remains on one OS thread.
package/docs/web.md ADDED
@@ -0,0 +1,197 @@
1
+ # HTTP, server pages, and crypto
2
+
3
+ HTTP endpoints are language declarations. `august.web` supplies explicit network, authentication, authorization, and logging capabilities; `august.crypto` supplies cryptographic adapters. August source owns routing contracts and application decisions. The native boundary owns transport, serialization, and cryptographic primitives.
4
+
5
+ ## A complete service
6
+
7
+ This project serves a protected JSON endpoint, an August page, a form action, and an event stream. The documentation gate builds it and runs its endpoint cases without starting a persistent server. Copy the files into one folder and run `aug run FOLDER` to listen on port 8080.
8
+
9
+ ```aug project=web-guide file=main.aug
10
+ import readUser and events from api
11
+ import home from pages
12
+ import save from actions
13
+ import DemoAuthentication from auth
14
+ import Authentication and RequestLogger and WebRequestLogger from august.web
15
+
16
+ implement Authentication with DemoAuthentication
17
+ implement RequestLogger with WebRequestLogger scoped
18
+ serve readUser and events and home and save on port 8080
19
+ ```
20
+
21
+ ```aug project=web-guide file=models.aug
22
+ record User(int id, string name)
23
+ record UserInput(string name)
24
+ ```
25
+
26
+ ```aug project=web-guide file=auth.aug
27
+ import Authentication and Principal from august.web
28
+
29
+ /** A demonstration adapter. Replace its credential check for a real application. */
30
+ DemoAuthentication() implements Authentication:
31
+ authenticate(HttpRequest request) returns optional Principal uses Authentication.authenticate unless HttpError:
32
+ match request.headers.get(name="authorization"):
33
+ when null:
34
+ return null
35
+ when some value:
36
+ if value == "Bearer demo":
37
+ return Principal(subject="ada", permissions=["users.read"])
38
+ return null
39
+ ```
40
+
41
+ ```aug project=web-guide file=api.aug
42
+ import User from models
43
+ import DemoAuthentication from auth
44
+ import Authentication and RequestLogger and WebRequestLogger from august.web
45
+
46
+ /** Look up one user. Authentication runs before the identifier is decoded. */
47
+ [LogRequest(logger=logger)]
48
+ [RequireLogin(authentication=auth)]
49
+ [RateLimit(requests=100, seconds=60)]
50
+ [Timeout(milliseconds=1000)]
51
+ [Compress]
52
+ endpoint GET "/users/{id}" as readUser(int id from path, resolve Authentication auth, resolve RequestLogger logger) returns User uses auth.authenticate and logger.complete:
53
+ return User(id, name="Ada")
54
+
55
+ test endpoint readUser client:
56
+ when requests:
57
+ implement Authentication with DemoAuthentication
58
+ implement RequestLogger with WebRequestLogger scoped
59
+ it requires_identity_before_decoding:
60
+ response = client.request(method="GET", path="/users/not-an-integer")
61
+ assert(condition=response.status == 401)
62
+ it returns_a_user:
63
+ headers = Headers().with(name="authorization", value="Bearer demo")
64
+ response = client.request(method="GET", path="/users/7", headers)
65
+ assert(condition=response.status == 200)
66
+ assert(condition=response.body.text() == "{\"id\":7,\"name\":\"Ada\"}")
67
+
68
+ /** Each yield waits for transport capacity; disconnect cancels the producer. */
69
+ endpoint GET "/events" as events() streams ServerEvent<User> unless HttpError:
70
+ yield ServerEvent(data=User(id=1, name="Ada"), event="user", id="first")
71
+ yield ServerEvent(data=User(id=2, name="Grace"), event="user")
72
+
73
+ test endpoint events client:
74
+ when streaming:
75
+ it returns_events:
76
+ response = client.request(method="GET", path="/events")
77
+ assert(condition=response.status == 200)
78
+ assert(condition=response.headers.get(name="content-type") == "text/event-stream")
79
+ ```
80
+
81
+ ```aug project=web-guide file=actions.aug
82
+ import UserInput from models
83
+ import redirect from august.web
84
+
85
+ /** Accept a typed form and redirect after handling it. */
86
+ endpoint POST "/users" as save(UserInput input from form) returns HttpResponse<string> unless HttpError:
87
+ return redirect(location="/")
88
+ ```
89
+
90
+ ```aug project=web-guide file=views.aug
91
+ import User from models
92
+ import save from actions
93
+
94
+ UserCard(User user) returns Html:
95
+ return <article><h2>{user.name}</h2><p>User {user.id}</p></article>
96
+
97
+ NewUser() returns Html unless HttpError:
98
+ return <form onSubmit={handle save(input from form)}><label>Name <input name="name" required /></label><button type="submit">Save</button></form>
99
+ ```
100
+
101
+ ```aug project=web-guide file=pages.aug
102
+ import User from models
103
+ import UserCard and NewUser from views
104
+
105
+ /** Render checked components; interpolated text and attributes are escaped. */
106
+ endpoint GET "/" as home() returns Html unless HttpError:
107
+ return <html><head><title>August users</title></head><body><UserCard user={User(id=7, name="Ada")} /><NewUser /></body></html>
108
+ ```
109
+
110
+ Use POST, PUT, PATCH, or DELETE for a write action. `handle remove(id=user.id)` describes a deferred HTTP request; it does not call `remove` while rendering. `input from form` maps form fields to a checked record. The generated same-origin browser transport submits the selected endpoint, follows its redirect, reloads successful writes, and displays failures as text. There is no August browser compiler in this version.
111
+
112
+ Captured values and form inputs preserve signed 64-bit integers, including identifiers beyond JavaScript's safe integer range. A form field containing a record, collection, or `Json` uses JSON text; for example, `[1,2]`, `{"id":7}`, or `"Ada"` for a string-valued `Json`. Ordinary string fields contain plain text. The transport encodes fields according to their declared types.
113
+
114
+ ## Wire contracts and responses
115
+
116
+ Every ordinary endpoint input states its source: `from path`, `from query`, `from header`, `from cookie`, `from body`, `from form`, or `from request`. A source can specify a wire name. `resolve` inputs come from the application's explicit DI composition. Only endpoints selected by `serve` are reachable over HTTP.
117
+
118
+ JSON bodies decode into concrete immutable records. `optional T` allows a value or null. Omitted optional fields and inputs become null, including PATCH bodies. Match null/some before reading the value. Serializing a record includes null optional fields; it does not recreate whether a field was originally omitted. Unknown or incorrectly typed record fields are rejected. An absent required query/header/form value and invalid scalar syntax return 400; invalid JSON syntax returns 400, a valid JSON schema mismatch returns 422, unsupported media returns 415, and an oversized body returns 413.
119
+
120
+ An ordinary return becomes the documented status and a JSON, Html, or Bytes representation. `HttpResponse<T>` selects status and immutable `Headers` explicitly. `Headers.with` appends a value, preserving repeated headers such as Set-Cookie; singular wire inputs reject duplicates. The `redirect` and `cookie` helpers validate header values. Cookie callers explicitly choose Secure and lifetime settings.
121
+
122
+ Response status literals must range from 200 to 599; constructing a response with a dynamic status requires handling or declaring `HttpError`. Complex form fields use the same JSON schemas as body inputs: malformed JSON text returns 400 and a schema mismatch returns 422.
123
+
124
+ `unless ErrorType with status CODE` declares an error response. Unexpected failures produce 500 with server-side error reporting. Default failures use [RFC 9457 Problem Details](https://www.rfc-editor.org/rfc/rfc9457.html). OAuth endpoints in the proof return their protocol's JSON errors explicitly. HEAD suppresses the body; 204 and 304 suppress body and Content-Length. See the [gap ledger](web-library-gaps.md) for unimplemented HTTP behavior; this is not a claim of full protocol conformance.
125
+
126
+ ## Policies and interceptors
127
+
128
+ The first written HTTP policy is outermost. Policies execute before wire decoding; custom parameter interceptors execute after decoding. The compiler requires all HTTP policies before custom interceptors. Put `LogRequest` first to observe failures rejected by later guards.
129
+
130
+ | Policy | Inputs and behavior |
131
+ | --- | --- |
132
+ | RequireLogin | `authentication=auth` maps an explicit `resolve Authentication auth`; declare `uses auth.authenticate`. A null identity returns 401. The adapter validates credentials. |
133
+ | RequirePermission | Maps Authentication and Authorization dependencies plus a literal permission; denied access returns 403. Declare both capability operations. |
134
+ | LogRequest | Maps `resolve RequestLogger logger` and `uses logger.complete`. Calls completion in reverse layer order after transport completion or disconnect. Disconnect status is 499 for logging. WebRequestLogger emits escaped JSON metadata without credentials or query strings. |
135
+ | RateLimit | Literal requests and seconds; a bounded fixed-window counter per endpoint and trusted transport peer. It ignores client-supplied forwarding headers. Excess returns 429. |
136
+ | Timeout | Literal milliseconds; handler, scoped tasks, streaming and transport share the deadline. Before output, timeout returns 504; after headers it terminates output. C calls finish before cooperative cancellation is observed. Buffered request reception precedes this deadline. |
137
+ | Cors | Literal exact origins, optional request-header allowlist and credentials. A supplied disallowed origin returns 403. Preflight checks the selected route's method and requested headers. Wildcard cannot enable credentials. CORS is not authentication or CSRF protection. |
138
+ | Compress | Negotiates gzip, respects an existing Content-Encoding, and skips bodyless statuses. Stream items use complete concatenated gzip members as permitted by [RFC 1952](https://www.rfc-editor.org/rfc/rfc1952.html). |
139
+
140
+ Options are compile-time literals; dependency mappings must reference the canonical `august.web` capabilities. Cors and Compress may each appear once. Multiple deadlines choose the earliest. Custom interceptors retain their checked around/next contracts and written order.
141
+
142
+ ## Streams and scoped tasks
143
+
144
+ An endpoint may `streams ServerEvent<T>`, `streams Bytes`, or `streams Html`. `yield` supplies one item. Each pending encoded item is bounded to 64 KiB and sent under transport backpressure. A response has one consumer. Errors before headers become HTTP responses; later failures terminate output without appending a second error representation. Disconnect cancels the request and its children; `always` cleanup runs. The request DI scope survives through response completion.
145
+
146
+ `start fetch(...)` creates a task owned by its lexical scope. `wait for loadingUsers and loadingOrders to users and orders` waits in the stated result order; `wait for taskList` returns an ordered result list. `to`, `as`, and `=` result assignments are supported where the grammar permits them. Scope exit joins children; an unhandled child failure cancels siblings. Read-only frozen values can be shared without copying. Mutable captures are loaned until the task is observed. `lock shared as value` grants exclusive mutation and forbids nested locks, I/O, task starts and waits inside the locked region.
147
+
148
+ Declare an owned resource directly in its task's `scope` block to keep it alive through implicit joining. A resource declared in a shorter nested block must be waited for before that block ends; the compiler rejects a live task borrow at that boundary. Unrelated owned cleanup does not join the enclosing scope's children. Pure loops under a lock finish or observe cancellation before another coroutine runs.
149
+
150
+ Scheduling checks receiver and argument errors immediately. A scheduled callee's errors are checked at waits and implicit joins. A wait can observe an unhandled sibling failure; grouped and collection waits finish observing every selected child before rethrowing the first error. Catch around the entire scope when handling failures from children that are not explicitly observed.
151
+
152
+ Scheduling currently uses cooperative coroutines on one OS thread. Outbound HttpClient I/O suspends the coroutine, so the same executable can call its own endpoints. Multicore workers, bounded channels/broadcasts, and inbound request streams remain gaps. The [gap ledger](web-library-gaps.md) records delivery status.
153
+
154
+ ## OpenAPI configuration
155
+
156
+ Add to main.yaml:
157
+
158
+ ```yaml
159
+ web:
160
+ host: 127.0.0.1
161
+ body_limit: 1048576
162
+ response_limit: 4194304
163
+ http3: false
164
+ openapi:
165
+ enabled: true
166
+ title: August users
167
+ version: 1.0.0
168
+ path: /openapi.json
169
+ docs: /docs
170
+ output: .aug-build/openapi.json
171
+ ```
172
+
173
+ `web.tls` accepts certificate, private_key and optional outbound ca paths relative to the project. HTTP/3 requires TLS. Native HttpClient verifies peers and returns redirects for explicit handling. The private bootstrap enables libwebsockets HTTP/1.1, HTTP/2 and HTTP/3 on tested macOS ARM and Linux ARM hosts.
174
+
175
+ OpenAPI 3.2.1 includes selected endpoints, input sources, concrete record schemas, explicit response variants and Javadoc. Streams have item schemas. Unsupported contracts fail compilation when generation is enabled. `/docs` is the generated API explorer. [OpenAPI 3.2.1](https://spec.openapis.org/oas/v3.2.1.html) is the contract reference.
176
+
177
+ ## Endpoint tests
178
+
179
+ `test endpoint NAME client` must live with that endpoint. The compiler supplies HttpTestClient; group bindings replace production dependencies explicitly. `client.request` exercises the shared native router, policies, wire binding, DI, handler and serialization. Stream collection is bounded by response_limit. Each case has fresh process state. Production startup is excluded.
180
+
181
+ This tests the application pipeline; socket parsing, TLS negotiation and transport disconnects need separate live-transport tests. Run `aug test FOLDER requests` to select the example's group. The [testing guide](testing.md) describes rows, filtering and coverage.
182
+
183
+ ## Crypto and the login proof
184
+
185
+ Crypto is an injected capability with GnuTlsCrypto as its native adapter. It provides OS-backed randomness, SHA-256, constant-time content comparison, strict base64url, opaque RSA keys, RS256 signing/verification, RSA JWK import/export, and PBKDF2-HMAC-SHA256 password derivation. Private RSA material is scrubbed on reclamation; general secret-buffer lifecycle and key rotation APIs remain gaps.
186
+
187
+ `signJwt` requires an explicit key id and token type. `verifyJwt` accepts the configured RS256/key-id/type profile, rejects unsupported JOSE fields, verifies the signature before exposing claims, and follows no token-provided URL. The consuming protocol still validates issuer, audience, times, nonce and token purpose. The implementation follows the fixed-algorithm approach described in [JWT best current practices](https://www.rfc-editor.org/rfc/rfc8725.html).
188
+
189
+ The [same-app login example](../examples/oidc-login/README.md) contains an OpenID Connect provider and relying party in one August application. It uses real loopback discovery, authorization, token, JWKS and UserInfo endpoints, Authorization Code with S256 PKCE, browser-bound state/nonce/CSRF, and a distinct application-session JWT with live revocation. The UI signs in and signs out through typed actions. See [OpenID Connect Core validation](https://openid.net/specs/openid-connect-core-1_0.html#IDTokenValidation) and [S256 PKCE](https://datatracker.ietf.org/doc/html/rfc7636).
190
+
191
+ ```sh
192
+ node scripts/bootstrap-native.mjs
193
+ node bin/aug.mjs run examples/oidc-login
194
+ node bin/aug.mjs test examples/oidc-login --group signed_identity_claims
195
+ ```
196
+
197
+ Open http://127.0.0.1:8787 and sign in as **ada** with **august-demo**. `/me` returns the protected identity; `/docs` exposes endpoint contracts. The [gap ledger](web-library-gaps.md) distinguishes this verified development profile from broader provider, library and runtime support.
@@ -0,0 +1,36 @@
1
+ // Generated by aug spec. This is a copy of the installed dependency source.
2
+ /** Permission to write to a console, provided by an explicitly selected adapter. */
3
+ capability Console:
4
+ /** Write one line of text. @param value Text to display. */
5
+ write<T>(T value) uses Console.write
6
+
7
+ /** The native standard-output adapter. Construction performs no output. */
8
+ SystemConsole() implements Console:
9
+ write<T>(T value):
10
+ print(value=value)
11
+
12
+ /** Read UTF-8 text through an explicitly selected filesystem adapter. */
13
+ capability FileReader:
14
+ /** Read text. @param path File path. @throws FileError The file could not be read. */
15
+ read(string path) returns string uses FileReader.read unless FileError
16
+
17
+ /** Write UTF-8 text through an explicitly selected filesystem adapter. */
18
+ capability FileWriter:
19
+ /** Write text. @param path File path. @param content Text. @throws FileError Writing failed. */
20
+ write(string path, string content) uses FileWriter.write unless FileError
21
+
22
+ /** Native files. Operations are explicit; construction opens no files. */
23
+ LocalFiles() implements FileReader, FileWriter:
24
+ read(string path) returns string unless FileError:
25
+ return read_file(path=path)
26
+ write(string path, string content) unless FileError:
27
+ write_file(path=path, content=content)
28
+
29
+ /** Read command-line input through an explicit dependency. */
30
+ capability Arguments:
31
+ read() returns List<string> uses Arguments.read
32
+
33
+ /** Native command-line arguments. */
34
+ ProcessArguments() implements Arguments:
35
+ read() returns List<string>:
36
+ return arguments()