Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ Swift-JSON requires Swift tools/compiler 6.4+, Swift language mode 6 and
macOS/SDK 27+. Read README.md, CONTRIBUTING.md and the relevant contracts in
Documentation/Architecture before changing behavior.

- Keep nine public products: JSON, JSONSchema, JSONStreaming, JSONPatch, JSONHTML,
JSONBridges, JSONNavigation, JSONInspection and the swift-json executable. JSONFilterRuntime and JSONCLIEngine are package-private.
- Keep ten candidate products: JSON, JSONSchema, JSONSchemaExamples, JSONStreaming,
JSONPatch, JSONHTML, JSONBridges, JSONNavigation, JSONInspection and the swift-json executable.
JSONSchemaExamples is opt-in and depends on JSON and JSONSchema only.
JSONFilterRuntime and JSONCLIEngine are package-private.
JSONHTML and opt-in JSONBridges depend on JSON only; core never re-exports the bridges.
The approved CLI and E2 additions preserve historical product contracts.
JSONNavigation depends on JSON only. Opt-in JSONInspection depends on JSON and
Expand Down
59 changes: 50 additions & 9 deletions Documentation/Architecture/API.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Public API contract

This document describes the implemented public interface. Native compiler symbol
graphs supply the complete declarations in the seven DocC catalogs. Examples
graphs supply the complete declarations in the eight DocC catalogs. Examples
in the [README](../../README.md) are compiled and executed by the public consumer.

## Products and ownership
Expand All @@ -18,7 +18,8 @@ in the [README](../../README.md) are compiled and executed by the public consume
| JSONHTML | JSONHTMLRenderer, JSONHTMLRenderingOptions, JSONHTMLLimits, JSONHTMLRenderReport, JSONHTMLAnnotation, JSONExportDocument, JSONExportOptions, JSONExportReport | Structured forms/cards and bounded native previews, exact HTML, native Apple transfer, immutable prepared JSON/text/Markdown/static HTML/opt-in styled RTF and cumulative budgets |

JSON imports no siblings. JSONSchema depends on JSON and package-private
JSONRegexRuntime. Streaming, Patch, HTML and Bridges depend on JSON. There are eight candidate public products: seven libraries and the swift-json executable,
JSONRegexRuntime. Streaming, Patch, HTML, Bridges and Navigation depend on JSON.
JSONSchemaExamples depends only on JSON and JSONSchema. There are nine public products: eight libraries and the swift-json executable,
and no external root-package dependencies. No HTTP, MCP or documentation-tool dependency is introduced. JSONHTML conditionally
uses Apple SDK frameworks for explicit native transfer/PDF preparation; the portable
value, schema, Patch and streaming contracts do not acquire UI semantics.
Expand Down Expand Up @@ -233,13 +234,53 @@ is neither native validation of an instance nor a service-acceptance guarantee.
and all phase accounting are specified in [Providers](Release1.4/Providers.md) and the frozen
[profile table](Release1.4/ProviderProfiles.json). No new product, SDK client or Apple type is added.

## Best-effort diagnostics and versioned CLI identity

With best-effort schema output, an optional diagnostic-byte refusal returns ordinary
invalidity with `diagnosticsComplete == false`; it does not poison the active work
ledger. Work, retention, annotation exhaustion and cancellation remain operational
errors. Strict diagnostic output still throws on the same byte bound.

## Schema examples (1.6 G4 development)

The optional JSONSchemaExamples product prepares an immutable document/explicit
registry/compiled-plan snapshot. `JSONSchemaExampleGenerator(document:registry:options:)`
and `generate(seed:profile:)` offer exact declared candidates and compiler-qualified
static reference targets. Every success contains the actual native valid verdict
for the original root. Minimal scans stable exact declarations; demonstration
uses metered SplitMix64 rejection sampling and circular scans. An immutable exact
`JSONSchemaExampleCorpus` supplies candidates for true/empty schemas. Returned
objects/numbers use scalar order and normalized exact spelling. Conservative
typed construction covers the qualified foundational subset. G4 adds conservative
contains minima and a small anchored ASCII pattern-proposal grammar. Native
validation retains conditional, dependency, regex and evaluated-location semantics.
General constraint
solving, arbitrary regex inversion and dynamic construction remain incomplete.

`JSONSchemaExampleFailure` distinguishes unsupported construction, searchExhausted,
reviewed trivial provenUnsatisfiable and invalidConfiguration. Core operational
failures and cancellation propagate without retries. Preparation accounting is
separate from the shared per-generation ledger, which includes all completed
invalid checks. Discarded validation ownership is released without refunding work. Logical
retention is not process RSS.
The result binds the versioned snapshot, ordered corpus, all generation/compiler/
evaluator caps and flags, and complete abstract trace with SHA-256 digests. Trace
bytes share diagnosticBytes with native diagnostics; exhaustion never truncates a
success. See [the G3 constructive subset](Release1.6/G3Construction.md),
[the G4 advanced boundary](Release1.6/G4Construction.md),
[the capability ledger](Release1.6/Capabilities.json), [the G2 byte transports](Release1.6/G2Determinism.md), the historical
[G1 API decision](Release1.6/G1API.md), and the
[compiled public consumer](../../Examples/SchemaExamplesConsumer/README.md).

## Optional verified schema examples (1.6 development)

JSONSchemaExamples adds an immutable prepared generator over admitted documents and
explicit offline registries. Every returned value has a completed native root verdict,
with exact JSON semantics, cumulative generation statistics and versioned provenance.
It does not alter JSON/JSONSchema APIs, policies, products or dependencies.

See the [current public declarations and failures](Release1.6/API.md),
[supported construction subset](../../Sources/JSONSchemaExamples/Documentation.docc/TypedConstruction.md),
[resource scope](Release1.6/SchemaExamplesLimits.md) and
[compiled public consumer](../../Examples/SchemaExamplesConsumer/README.md).
Preparation and generation use separate finite ledgers. All attempts within a generation
share one ledger; false verdicts consume work, operational errors/cancellation terminate
without a candidate or successful report, and search exhaustion is not a proof.
The [combined-source G8 record](Release1.6/G8Qualification.md) describes qualification,
review and platform limits. Merge and release approval remain separate.
The CLI's human version reports the candidate/release source version. JSON metadata
includes `revisionKind: "source-sha256"` and `revision: "sha256:<hex>"`. This is the
SHA-256 of the ordered Package.swift plus Sources content manifest, excluding only
Expand Down
28 changes: 27 additions & 1 deletion Documentation/Architecture/ExtractionManifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,28 @@
"Scripts/qualify_schema_providers.py",
"Tools/CLIQualification/Sources/ProviderConsumer"
]
},
{
"repository": "SwiftJSON-SchemaExamples-S3-Codex-Wave-v1.0 briefing packet",
"archive_sha256": "f67ec2f5d0bfd223f54a3577f93c03951a7992ecab524910ba44f6bc8621c4a1",
"original_path": "Reference/SplitMix64.swift and Reference/SplitMix64Check.swift",
"destination": "Sources/JSONSchemaExamples/SchemaExampleDeterminism.swift",
"disposition": "SplitMix64 constants, wrapping steps and rejection threshold adapted into invocation-owned noncopyable state with cumulative native metering; standalone shims not used. Sixteen golden draws retained in real-engine tests.",
"attribution": "Apache-2.0 SPDX header retained; original Swift-JSON integration code Apache-2.0.",
"validation": "Tests/JSONSchemaExamplesTests/DeterminismTests.swift; independent stdlib transport oracle and public consumer",
"evidence": "Release1.6 G2 qualification; actual native/safety/docs receipts"
},
{
"repository": "SwiftJSON-SchemaExamples-S3-Codex-Wave-v1.0 briefing packet",
"archive_sha256": "f67ec2f5d0bfd223f54a3577f93c03951a7992ecab524910ba44f6bc8621c4a1",
"original_path": "Fixtures/cases.json",
"original_sha256": "6f2bfd4fdb7c7e206b6570c2156ca8e248831840733b0258aa8cd5938b35649f",
"destination": "Tests/Fixtures/SchemaExamples",
"disposition": "Original 44-case input retained byte-for-byte alongside the independently reviewed G0 integral-number correction (155 witnesses). G3 selects exactly 24 must-generate IDs plus two sound proofs; 18 G4 cases remain separate. No fixture expected verdict was lowered for the generator.",
"amended_sha256": "5b3e6e40e83439a810d0eb7ac412ce158a4e582f36b9d36d6e313c159654ddd3",
"attribution": "User-authored packet fixture input; original integration/tests Apache-2.0. Packet source/provenance retained separately.",
"validation": "TypedConstructionTests.swift and public G3Acceptance consumer; strict native compiler/evaluator authority",
"evidence": "Release1.6/G3 qualification and materialized per-case receipts"
}
],
"original_implementation_notes": [
Expand All @@ -272,10 +294,14 @@
"1.4 C4 immutable IR/function/pattern metadata, invocation closures/thunks, continuations, scalar string and format helpers, root-provenance paths and transactional mutation are original Apache-2.0 code. No eager upstream evaluator, Foundation regex or approximate arithmetic was copied.",
"1.4 C5 stream/offline-schema adapters, checked sink handoff, command help and consumers are original Apache-2.0 code. Five NewInputs fixtures are copied byte-for-byte from the maintainer CLI briefing pack 43f8819c57e3d93bc6f7cf561d2d111442e089f2973cb7c62e16e3bd3fd73d0d; these authored data fixtures introduce no runtime dependency. Missing provider helper prerequisites remain blocked rather than adapted or silently rewritten.",
"1.4 checked schema resource lookup and its missing/quota/cancellation/install regressions are original Apache-2.0 code. Supported app/framework/command layouts retain all nine official resource pins; no unbounded directory scan, fallback engine or external dependency is introduced.",
"1.6 S3 G4 contains-minimum proposals and the small anchored ASCII proposal scanner are original Apache-2.0 Swift code. Native compiler-qualified references and complete native regex/schema evaluation remain authoritative; no matcher, resolver, engine source or dependency is adapted. The original/amended S3 fixtures retain their pinned byte identities.",
"1.5.1 restores 126 original Apache-2.0 test functions and qualification tools from Swift-JSON 1.2.1 (e8b687f822c577311156b13bf1d15c2d5620b84e), with file hashes and stable function identities in Qualification/Release1.5.1/Restoration.json. The diagnostic omission and Git-free provenance repairs are restored original code; current seven-product harness reconciliation and deterministic CLI identity are original contributions. No new upstream adaptation or dependency.",
"1.6 S3 G7 seeded grammar, scalar-key permutation tests, public replay consumer and strict cardinality/matrix harness are original Apache-2.0 contributions. The 64-schema authored fixture has SHA-256 cb55604183a6db7df5fa968db283e7abeae794277d2b0cef033b0bdb92e615cb. Independent python-jsonschema 4.26.0 is research qualification only, with exact numeric binding; no Python runtime dependency or copied validator/engine is distributed.",
"1.6 S3 G8 materializes the unchanged synthetic corpus per caller access, replacing process-lifetime stored JSON payloads exposed by Linux ASan/LSan. The public process-lifetime consumer and strengthened exact/value-copy test are original Apache-2.0 qualification code; no suppression, runtime fallback, new dependency or corpus/digest change is introduced.",
"Composition reference-load fixtures, serial descriptor staging, public-only adapter, capacity/terminal tests and strict CI receipt checks are original Apache-2.0 code. Generated JSON graphs introduce no upstream protocol fixtures, engine or dependency. Core public APIs, finite profiles and accounting weights are unchanged.",
"NAV5 public array-evidence packaging, external consumer and DocC are original Apache-2.0 code. Existing exact shape evidence, exclusive reducer, weights and I01-I17 semantics are unchanged; no upstream engine or dependency is adapted. Promotion is a draft candidate, not a released product.",
"NAV5 package-only complete structural snapshot, parent-linked metadata, original source-ownership transfer and S01-S24 synthetic tests are original Apache-2.0 code. The existing read scope admits once; its default public read/traversal/inspection completion behavior is preserved. No persistent identity, upstream algorithm or new dependency is introduced."
"NAV5 package-only complete structural snapshot, parent-linked metadata, original source-ownership transfer and S01-S24 synthetic tests are original Apache-2.0 code. The existing read scope admits once; its default public read/traversal/inspection completion behavior is preserved. No persistent identity, upstream algorithm or new dependency is introduced.",
"NAV6 snapshot access-level promotion, external consumer, independent 28-record maintainer oracle, terminal-transfer/concurrent lookup proofs and compiled DocC are original Apache-2.0 contributions. No upstream engine, new semantic authority, dependency or additional product is adapted."
],
"jsonhtml_export_original_contributions": {
"license": "Apache-2.0",
Expand Down
Loading