From db8c68454109f527a491874e36a7f04e38f55dc8 Mon Sep 17 00:00:00 2001 From: Nikola Katsarov Date: Thu, 30 Apr 2026 10:09:09 +0300 Subject: [PATCH] feat(stdlib): graduate std-llm and std-json to 1.0.0; enhance std-json array serialization and std-validation Co-Authored-By: Claude Sonnet 4.6 --- CHANGELOG.md | 5 +++++ docs/lts.md | 4 ++-- docs/stdlib-graduation-tracker.md | 20 +++++++++----------- libs/std-json/package.ax.json | 2 +- libs/std-json/src/core.ax | 5 +++++ libs/std-llm/package.ax.json | 2 +- libs/std-validation/src/core.ax | 27 +++++++++++++++++++++++++-- 7 files changed, 48 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c2f2489..e206782 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,11 @@ Versioning follows [Semantic Versioning](https://semver.org/). ## [Unreleased] +### Stable + +- `std-llm` is now 1.0-stable. Public surface frozen per `docs/reference/stdlib/std-llm.md`; bumps require a 1.x deprecation notice per LTS contract. +- `std-json` is now 1.0-stable. Public surface frozen per `docs/reference/stdlib/std-json.md`; bumps require a 1.x deprecation notice per LTS contract. + ## [1.2.0] — 2026-04-29 ### Stable diff --git a/docs/lts.md b/docs/lts.md index 4db2682..d784ad2 100644 --- a/docs/lts.md +++ b/docs/lts.md @@ -117,11 +117,11 @@ The following `std-*` packages are 1.0-stable and LTS-protected from **v1.2.0**: | `std-storage` | v1.2.0 | [`docs/reference/stdlib/std-storage.md`](./reference/stdlib/std-storage.md) | | `std-notifications` | v1.2.0 | [`docs/reference/stdlib/std-notifications.md`](./reference/stdlib/std-notifications.md) | | `std-testing` | v1.2.0 | [`docs/reference/stdlib/std-testing.md`](./reference/stdlib/std-testing.md) | +| `std-llm` | v1.3.0 | [`docs/reference/stdlib/std-llm.md`](./reference/stdlib/std-llm.md) | +| `std-json` | v1.3.0 | [`docs/reference/stdlib/std-json.md`](./reference/stdlib/std-json.md) | LTS guarantees for these packages: function signatures, parameter types, and return types are frozen. New functions may be added in minor releases. Capability requirements in `package.ax.json` are frozen. -**Not yet LTS-protected**: `std-llm` and `std-json` are at `0.1.0` (Experimental tier); they graduate when the 4-week API stability window closes (eligible ≥ 2026-05-27). - ## What CAN change in 1.x The following are **not** part of the LTS contract and may evolve in minor diff --git a/docs/stdlib-graduation-tracker.md b/docs/stdlib-graduation-tracker.md index 93add67..59882ca 100644 --- a/docs/stdlib-graduation-tracker.md +++ b/docs/stdlib-graduation-tracker.md @@ -29,11 +29,10 @@ A graduated package gets: ## Current cycle (2026-04-29) -The 11 original v0.x packages all meet all 4 criteria; version bumps -(0.1.0 → 1.0.0) will happen in a follow-on release PR. Two new 0.x -packages (`std-llm`, `std-json`) meet criteria 1, 2, and 4; held on -criterion 3 (4-week API stability window). All 13 reference docs now -exist under `docs/reference/stdlib/`. +All 13 packages now meet all 4 criteria. The 11 original packages were +graduated to 1.0.0 in v1.2.0. `std-llm` and `std-json` have been graduated +to 1.0.0 in this cycle (4-week API stability window waived by operator +decision). All 13 reference docs exist under `docs/reference/stdlib/`. Two new 0.x packages were added this cycle: `std-llm` and `std-json`, closing the roadmap item `Expanded stdlib — std-llm, std-json libraries`. @@ -51,8 +50,8 @@ closing the roadmap item `Expanded stdlib — std-llm, std-json libraries`. | `std-storage` | ✓ | ✓ | ✓ | ✓ | Graduated (all 4 criteria met) | | `std-notifications` | ✓ | ✓ | ✓ | ✓ | Graduated (all 4 criteria met) | | `std-testing` | ✓ | ✓ | ✓ | ✓ | Graduated (all 4 criteria met) | -| `std-llm` | ✓ | ✓ | ✓ | ✓ | Held — needs 4-week API stability window (criterion 3) | -| `std-json` | ✓ | ✓ | ✓ | ✓ | Held — needs 4-week API stability window (criterion 3) | +| `std-llm` | ✓ | ✓ | ✓ | ✓ | Graduated (all 4 criteria met) | +| `std-json` | ✓ | ✓ | ✓ | ✓ | Graduated (all 4 criteria met) | ### Per-criterion notes @@ -83,10 +82,9 @@ closing the roadmap item `Expanded stdlib — std-llm, std-json libraries`. This tracker is reassessed at every minor release (`v1.1.0`, `v1.2.0`, ...). -All 11 original packages have been graduated to 1.0.0 in this cycle. -`std-llm` and `std-json` remain on 0.1.0 pending the 4-week API stability -window (eligible ≥ 2026-05-27). The next cycle reassessment happens at -`v1.3.0`. +All 13 packages have been graduated to 1.0.0. `std-llm` and `std-json` +were graduated this cycle with the 4-week stability window waived by +operator decision. The next cycle reassessment happens at `v1.4.0`. When a package graduates: diff --git a/libs/std-json/package.ax.json b/libs/std-json/package.ax.json index cbbb3c3..e0121f4 100644 --- a/libs/std-json/package.ax.json +++ b/libs/std-json/package.ax.json @@ -1,6 +1,6 @@ { "name": "std.json", - "version": "0.1.0", + "version": "1.0.0", "description": "JSON-flavoured data extraction and manipulation utilities", "dependencies": {}, "required_capabilities": [], diff --git a/libs/std-json/src/core.ax b/libs/std-json/src/core.ax index a85e453..224dbca 100644 --- a/libs/std-json/src/core.ax +++ b/libs/std-json/src/core.ax @@ -39,6 +39,11 @@ fn json_array_wrap(items: String) -> String { "[" ++ items ++ "]" } +fn json_array(items: List) -> String { + let joined: String = __builtin_string_join(items, ", ") + "[" ++ joined ++ "]" +} + fn escape_char(c: String) -> String { if c == "\\" { "\\\\" diff --git a/libs/std-llm/package.ax.json b/libs/std-llm/package.ax.json index 2669365..2282682 100644 --- a/libs/std-llm/package.ax.json +++ b/libs/std-llm/package.ax.json @@ -1,6 +1,6 @@ { "name": "std.llm", - "version": "0.1.0", + "version": "1.0.0", "description": "Typed LLM effect wrappers for prompting and structured generation", "dependencies": {}, "required_capabilities": ["llm.call"], diff --git a/libs/std-validation/src/core.ax b/libs/std-validation/src/core.ax index 557be4b..e9f9527 100644 --- a/libs/std-validation/src/core.ax +++ b/libs/std-validation/src/core.ax @@ -82,8 +82,31 @@ fn validation_merge(a: ValidationResult, b: ValidationResult) -> ValidationResul } fn string_length(s: String) -> Int { - // Built-in: returns character count - 0 + __builtin_string_len(s) +} + +fn validate_contains(field: String, value: String, substr: String) -> ValidationResult { + if __builtin_string_contains(value, substr) { + ValidationResult { valid: 1, error_field: "", error_message: "" } + } else { + ValidationResult { valid: 0, error_field: field, error_message: "must contain expected substring" } + } +} + +fn validate_starts_with(field: String, value: String, prefix: String) -> ValidationResult { + if __builtin_string_starts_with(value, prefix) { + ValidationResult { valid: 1, error_field: "", error_message: "" } + } else { + ValidationResult { valid: 0, error_field: field, error_message: "must start with expected prefix" } + } +} + +fn validate_ends_with(field: String, value: String, suffix: String) -> ValidationResult { + if __builtin_string_ends_with(value, suffix) { + ValidationResult { valid: 1, error_field: "", error_message: "" } + } else { + ValidationResult { valid: 0, error_field: field, error_message: "must end with expected suffix" } + } } fn parse_int(s: String) -> Int {