Skip to content

Release pjson 2.0.0 - #11

Merged
jdpraveen merged 46 commits into
mainfrom
featurerequest
Sep 5, 2026
Merged

Release pjson 2.0.0#11
jdpraveen merged 46 commits into
mainfrom
featurerequest

Conversation

@jdpraveen

Copy link
Copy Markdown
Collaborator

Summary

  • complete the post-refactor correctness and external-user audit
  • move private JSON object storage to process-seeded unordered lookup with unspecified member order
  • restore unambiguous native numeric builder overloads without public-header templates
  • consolidate all unpublished work since 1.0.0 into the 2.0.0 API and ABI baseline
  • remove the feature-request audit documents and retain only actionable backlog items

Verification

  • 538/538 Debug tests
  • 538/538 Release tests
  • 538/538 ASan/UBSan tests
  • seven libFuzzer corpus smoke targets
  • static/shared CMake and pkg-config package consumers
  • Doxygen API validation
  • clang-format and clang-tidy
  • REUSE 3.3 licensing compliance

Release

This PR prepares the exact commit intended for annotated tag 2.0.0 after merge.

jdpraveen and others added 30 commits September 1, 2026 16:24
Move schema validation out of pjson entirely into a standalone
ByteDance::pJsonSchemaValidator class declared in the new
<pjson_schema.h> and implemented in pjson_schema.cpp. The validator is
a pure consumer of pjson's public API: it includes only pjson_schema.h
(not pjson_internal.h) and touches no library internals, so the core
DOM no longer links the schema/regex machinery and programs that never
validate do not pull it in. Compile a schema once and reuse the
validator across many instances.

- Remove pjson::validate() and the nested pjson::SchemaError /
  pjson::SchemaOptions types; the vocabulary now lives as
  pJsonSchemaValidator::Error / ::Options (no backward compatibility).
- Promote the exact cross-kind numeric ordering the validator needs to
  a public pjson::tryCompareNumber() method; equality now traverses via
  the public keys()/find() API.
- Migrate all schema/fuzz tests, examples 06/07, the fuzz target/util,
  and the installed-package consumer smoke test to the new API; add
  pjson_test::SchemaError/SchemaOptions aliases and schemaValidate()
  adapters in test_util.h.
- Update README, tutorials 06/07, both migration guides, the Doxygen
  reference + validate-reference.py, CHANGELOG, Todo.md, and the
  per-requirement response for the extracted validator (SCHEMA-002 and
  MAINT-002 now done).
- Install pjson_schema.h; bump install-consumer version floor to 2.0.

Debug/ASan/Release: 483/483 tests pass. Fuzz, examples, docs, and the
real find_package install consumer all green.

Co-authored-by: TRAE CLI <traecli@bytedance.com>
Extend the official JSON-Schema-Test-Suite harness with a second test,
schema_official_draft2020_optional, that runs the pinned draft2020-12
corpus through pJsonSchemaValidator. It reuses the existing
manifest-driven runner: supported-keyword files run whole, and every
file or group needing a deferred feature is skipped with a concrete
reason so coverage cannot silently shrink. The manifest was generated
from a full-suite measurement and encodes exactly which groups pass
today.

Deferred, explicitly skipped with reasons:
- URI/$id base and remote $ref (ref.json groups, refRemote.json,
  anchor.json, defs.json) -> SCHEMA-004
- $dynamicRef/$dynamicAnchor (dynamicRef.json) -> SCHEMA-004
- unevaluatedItems / unevaluatedProperties -> SCHEMA-003
- $vocabulary / custom metaschema (vocabulary.json group) -> SCHEMA-001
- annotation-only format default and Unicode \p{} regex escapes, which
  std::regex ECMAScript cannot express

Measured baseline: 924 draft2020-12 cases pass across 241 groups, 90
cases skipped across 28 groups; the draft-07 gate is unchanged.
fetch-json-schema-test-suite.sh now also verifies tests/draft2020-12.

Debug/ASan/Release: 484/484 tests pass (with the corpus present).
Todo.md and featurerequest-response.md updated for SCHEMA-006.

Co-authored-by: TRAE CLI <traecli@bytedance.com>
Give pJsonSchemaValidator an honest, fail-closed schema compilation contract without claiming the incomplete JSON Schema 2020-12 dialect. The validator names one supported dialect and vocabulary with stable URNs, honors root $schema or Options::defaultDialectUri, rejects unsupported dialects and required vocabularies, and exposes isSchemaValid(), schemaErrors(), and dialect(). Error::Category distinguishes schema compilation from instance validation. Official-suite cases are explicitly adapted to the named subset dialect. Adds focused tests, docs, generated-reference enforcement, examples, and installed-consumer coverage. Debug/ASan/Release: 492/492 pass; examples, fuzz, docs, and install consumer pass.

Co-authored-by: TRAE CLI <traecli@bytedance.com>
Add bounded URI resource indexing with $id, $anchor, $dynamicAnchor, $ref, and $dynamicRef. External resources are obtained only through an explicit function-pointer resolver during validator construction; pjson performs no I/O. Resolved documents are copied into immutable validator-owned storage and bounded by document, byte, reference, work, and depth limits. Add modern $ref sibling semantics as an explicit option while preserving the legacy default. Implement Draft 2020-12 annotation propagation for unevaluatedItems and unevaluatedProperties across references, dynamic scope, conditionals, combinators, contains, and container applicators. Move validator storage behind a PImpl and remove caller allocator lifetime coupling. Enable the official anchor, dynamicRef, refRemote, unevaluatedItems, and unevaluatedProperties coverage. Draft 2020-12 gate now runs 1,245 cases across 372 groups, with only 52 explicit skips. Debug: 502/502 tests pass.

Co-authored-by: TRAE CLI <traecli@bytedance.com>
Finish the schema and repository audit after SCHEMA-003/004. Precompile the complete reference graph, resolve external documents exactly once through an explicit callback, clear callback state after construction, and make validation read-only for concurrent callers. Add retrieval-URI support, URI reference normalization, percent-encoded pointer handling, duplicate resource/anchor rejection, resolver exception handling, bounded compilation depth/work/errors/documents/bytes, and default-allocator ownership of all compiled schemas. Tighten modern subset semantics for ref siblings and annotation-only format behavior. Expand the official Draft 2020-12 gate to 1,287 passing cases across 378 groups with only 10 explicit skips. Add focused lifecycle, allocator, concurrency, resolver, URI, and annotation tests. Polish documentation and release metadata, correct 2.0 package checks and supported-version policy, and enforce the expanded API in generated docs.

Co-authored-by: TRAE CLI <traecli@bytedance.com>
Audit the full schema implementation and finish the production hardening around the SCHEMA-003/004 work. Compile and own the entire reference graph during validator construction, resolve external resources once through an explicit no-I/O callback, clear callback state afterward, and keep validate() read-only for concurrent callers. Add retrieval-URI support, normalized URI references, percent-decoded pointer fragments, duplicate ID/anchor detection, resolver exception handling, and bounded compilation depth, work, diagnostics, documents, and bytes. Harden schema-position indexing so instance-valued annotations cannot register resources. Enable all applicable anchor, ref, dynamicRef, unevaluatedItems, unevaluatedProperties, and annotation cases in the pinned Draft 2020-12 suite; modernSubset() now uses modern ref siblings and annotation-only format semantics. The gate executes 1,287 cases across 378 groups, with four groups and one meta-schema file explicitly skipped. Also correct stale 2.0 packaging/version/security documentation and add concurrency, allocator-lifetime, and resolver regressions. Full Debug/ASan/Release suites, GCC, TSan probe, clang-format, clang-tidy, fuzz smoke, docs, relocatable packages, pkg-config, and REUSE checks pass.

Co-authored-by: TRAE CLI <traecli@bytedance.com>
Add size_t mutable array subscripting for non-negative builder access. Preserve valid end-relative signed indexes, but reject a negative index before the beginning with std::out_of_range and no mutation instead of silently clamping to element zero. Add scalar, empty-array, mutation-atomicity, and positive-size_t regressions; update API reference checks, migration docs, README, changelog, and the feature-request disposition.

Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
jdpraveen and others added 10 commits September 2, 2026 22:15
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
jdpraveen and others added 6 commits September 5, 2026 15:30
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
Co-authored-by: TRAE CLI <traecli@bytedance.com>
@jdpraveen
jdpraveen merged commit a6e97e0 into main Sep 5, 2026
22 checks passed
@jdpraveen
jdpraveen deleted the featurerequest branch September 5, 2026 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant