Repository navigation
Multi-language Jsontron: spec, conformance suite, .NET/JS/Python on JQLite - #26
Merged
Merged
Conversation
The repo will hold one folder per language implementation. dotnet-file entries are re-keyed to the new local paths; the old src/ paths are skipped so the repo-wide sync does not recreate them. includes.yml and _config.yml carry local edits and are skipped from sync. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Co-authored-by: CodeAlta <noreply@codealta.io>
The spec states the semantics the .NET implementation and readme carried implicitly, including the lowering of a rule set to one jq program and the portable jq profile. tests/ holds the language-neutral cases every implementation runs. An item without a message now has its test text as a literal message instead of evaluating that text as a jq string, which broke on tests containing quotes or interpolation. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Co-authored-by: CodeAlta <noreply@codealta.io>
- ConformanceSuite runs every tests/*.json case as its own xUnit case; a missing or empty suite fails. - Each failed assert/report (or the evaluation error) is now its own validation error: the keyword returns one Details entry per failure, produced by a private subschema, instead of a "; "-joined string. - An item without message uses its test text literally as the failure text instead of evaluating it as jq. - tests/locations.json: the nested-location message used escaped quotes inside \(...), which jq 1.8 rejects after the spec's wrapping; use the explicit jq string form instead. - Undefined $variables are skipped as known JQSharp gaps: its parser does not reject them, unlike jq. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Co-authored-by: CodeAlta <noreply@codealta.io>
Every behaviour the old xUnit classes checked is now a suite case; the ones the suite lacked are added (report sugar shape and mixed array form, report merged into an existing "." rule, let with report sugar alone, labels on a rule report, blank id, flag+role on a rule item, let names starting with a digit, rule-level let binding root). The behaviour classes are deleted; ApiTests keeps what is .NET-specific: registration, the dialect, JsonSchemaException at build, and the shape of reported errors. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Co-authored-by: CodeAlta <noreply@codealta.io>
A new npm package in js/ that adds rules, assert, report and let to Ajv 8 (draft 2020-12), running jq 1.8.2 through jq-wasm behind a JqEngine interface. - loadJsontron(options) loads the engine asynchronously and returns addJsontron(ajv); compile and validation are synchronous. - The first present keyword (rules, assert, report, let) owns the schema object's rule set; all four are registered so strict mode stays on. - Build time: keyword values validated against schemas/jsontron-0.2.json (bundled at build), flag/role and blank labels rejected, every jq expression checked in isolation with the variables in scope declared. - Evaluation: the reference lowering of spec section 7, one jq call per schema object; the root is passed only when an expression reads $root. - One Ajv error per failure text, one for a jq evaluation error. - vitest: unit tests and a runner for every ../tests/*.json file. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Co-authored-by: CodeAlta <noreply@codealta.io>
JsontronValidator (Draft202012Validator with rules, assert, report and let) and extend() for other validator classes, evaluated by jq 1.8 through the jq package with the reference lowering of spec section 7. - The root document is tied to the validator lineage: the outermost iter_errors registers a copy of the validator, and evolve() registers every derived one, so $root stays right when validations interleave or one starts inside another. Subschemas that declare the same $schema keep the extended class instead of jsonschema's plain one. - check_schema checks keyword shapes against schemas/jsontron-0.2.json (packaged at build time by a hatch hook), flag with role, blank labels, and every jq expression in isolation with its variables declared; the same checks run on first use without check_schema. - Lowered programs are cached per schema object (bounded, holding the object so its id cannot be reused) and receive $root only when an expression references it. - pytest runs every ../tests/*.json; one locations.json group is a strict xfail: its plain-text message escapes " inside \(...), which jq 1.8.2 rejects. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Co-authored-by: CodeAlta <noreply@codealta.io>
Real jq rejects an escaped quote inside an interpolation, so escaping every quote made plain-text messages such as order \(.id // "?") a build error in the JS and Python implementations. JQSharp accepts it, which hid the problem in .NET. The spec now copies \(...) unchanged and lets a backslash keep the character after it; all three implementations follow, with suite cases. Expressions are also followed by two newlines in the lowered program, since jq continues a comment ending in a backslash onto the next line. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Co-authored-by: CodeAlta <noreply@codealta.io>
js.yml and python.yml run each implementation against the conformance suite and publish to npm and PyPI by trusted publishing on release. AGENTS.md records the layout and the decisions behind the ports; the readme lists the implementations. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Co-authored-by: CodeAlta <noreply@codealta.io>
…ckage to @devlooped/jsontron - Spec & suite: align with jqlite (portable jq 1.8 profile); move unbound $variable checks from build-errors to evaluation-errors and add an unknown-function build-error test. - .NET: migrate from Devlooped.JQSharp to JQLite 1.0.0 and remove all conformance suite skips. - JS/TS: migrate from jq-wasm to @devlooped/jqlite 1.0.0, rename package from ajv-jsontron to @devlooped/jsontron, switch to ESM-only and synchronous addJsontron(ajv). - Python: migrate from jq (libjq) to devlooped-jqlite 1.0.0 (requires Python >=3.11). - CI & docs: update workflows, root readme, package readmes, and AGENTS.md. Co-authored-by: CodeAlta <noreply@codealta.io>
kzu
enabled auto-merge (rebase)
November 30, 2026 06:15
Member
Author
🧪 Details on Ubuntu 26.04.1 LTSfrom retest v1.1.0 on .NET 11.0.0 with 💜 by @devlooped |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extracts a language-neutral Jsontron 0.2 specification and shared JSON conformance suite, adds JavaScript/TypeScript and Python implementations alongside .NET, and standardizes all three implementations on
devlooped/jqlite1.0.0.Highlights
spec/jsontron.md,tests/): normative spec forrules,assert,report,let, reference lowering, and portable jq profile aligned withjqlite, backed by a shared language-neutral JSON conformance suite run by every implementation..NETsources fromsrc/todotnet/alongsidejs/andpython/.dotnet/, NuGetJsontron):Devlooped.JQSharptoJQLite1.0.0.js/, npm@devlooped/jsontron):@devlooped/jqlite1.0.0(ESM-only, zero native/WASM dependencies, synchronousaddJsontron(ajv)).ajv-jsontronto@devlooped/jsontron(unscopedjsontronis taken on npm).python/, PyPIjsontron):jsonschemakeywords powered bydevlooped-jqlite1.0.0(requires Python>=3.11)..github/workflows/js.yml,.github/workflows/python.yml):ubuntu,windows,macos) and OIDC trusted publishing on GitHub releases.Verification
dotnet formatclean;dnx --yes retest— 243 passed, 0 skipped (includingJsonSchema.Net 9.7.0).npm test— 275 passed;npm run typecheck,npm run build,npm pack --dry-runclean.pytest— 327 passed;ruff checkandruff format --checkclean.This pull request was created by CodeAlta.