Repository navigation
Swift-JSON 1.8.0
Swift-JSON 1.8.0
Adds located root-array streaming to JSONStreaming. JSONLocatedTopLevelArraySequence reads one root array like JSONTopLevelArraySequence. Each element also comes with its JSONSourceSpan: zero-based, half-open UTF-8 byte offsets in the complete stream. The span excludes surrounding whitespace and separators, and it doesn't depend on how the caller's source splits chunks. Spans are provisional until documentCompleted, exactly like the elements. The reader keeps no copy of the original bytes; consumers that need raw record slices keep their own immutable source.
for try await event in JSONLocatedTopLevelArraySequence(chunks) {
switch event {
case .element(let index, let value, let span):
stage(index, value, bytes[Int(span.start)..<Int(span.end)])
case .documentCompleted:
commitStagedRecords()
}
}Both root-array readers share one internal driver. Strict grammar, per-element and lifetime quotas, JSONFailure values, statistics, cancellation and the completion boundary are identical, and JSONTopLevelArraySequence keeps its public API and behavior. The feature was integrated through PR #78. PR #79 prepares the CLI version metadata, release notes and roadmap update.
The change is additive. No product, runtime dependency, platform or deployment floor changes. Twelve libraries plus swift-json continue to share one package version, with thirteen DocC catalogs. Swift tools/compiler 6.4+, language mode 6 and Apple OS/SDK 27+ remain required. Root dependencies remain empty; Apache-2.0 and upstream notices are retained.
The roadmap's previously proposed 1.8 scope (bounded structural workflows) moves to 1.9.0, and durable workflows move to 1.10.0. Both remain proposed scope.
Release source: 66718f11514d8c555f6a6b0ecc738e5029405a55, tree 8422e5eccc9c16d4b9de091be0aac8b61eaaeb0a. The annotated 1.8.0 tag points to this exact merge. The CI-qualified PR #79 head (56707b7) and the final commit have byte-identical source trees.
Qualification
All hosted lanes passed on the release commit itself: Native: native, safety, docs, Git-free archive reproduction and Linux ARM64/x86_64 behavior and safety. They also passed on the identical PR #79 tree (Native, Linux) and on PR #78. On PR #78, the first Native archive attempt reached the reproduction script's fixed 55-minute timeout in its final step, with 57 of 58 commands passed. A single unchanged-source rerun passed, and the original failure remains recorded.
Debug and Release root behavior ran 14 bundles, 408 parameterized cases and 36 JSONStreaming functions; the 6 new functions are public-consumer tests. DocC covers 1,509 of 1,509 authored public declarations across 13 catalogs. The Git-free reproduction rebuilt the 1,513-entry source archive byte-for-byte (7228fcf2…), and the attached source asset is that exact archive. A separate SwiftPM consumer resolved exact: "1.8.0" to the release commit and passed the located-span witness in Debug and Release.
Not run for this release: WASI, iPhoneOS/simulator SDK consumer builds, physical devices and controlled performance measurement. See the attached qualification JSON for runs, commits, counts and hashes.
Navigation G4 remains HOLD, with zero accepted controlled timing samples. Transform's historical scoped performance disposition and incomplete sampling windows are retained for unchanged workloads, without a new measured pass. No speed, throughput, allocation or RSS claim is made. The existing approximately 11% streaming regression disposition and 10% review trigger remain. Logical retained bytes are accounting quantities, distinct from RSS and caller work.
Assets: exact reproducible source, thirteen-catalog compiled DocC built by CI at the release commit, the DocC member manifest, the qualification receipt and SHA-256 checksums. Hosted documentation tracks main; use the attached DocC archive for the frozen reference. Full comparison.