feat(std/json): JsonPointer (RFC 6901) and JsonValue.get #437

Merged
argus merged 1 commit from loop/435-json-pointer into main 2026-10-23 16:06:28 +00:00
Collaborator

Closes #435

Step 1 of #81. JsonPointer (RFC 6901) in std/json (new std/json/src/pointer.trb, re-exported from lib.trb) with root, parse, parseFragment, text, fragment, tokens, child, parent, last, Show/Equals/Hash; JsonValue.get(pointer); JsonPointerError (pointer text, JsonPointerProblem, message). Pure TorbScript, no native, does not touch the seed.

Test

  • std/json/tests/pointer.test.trb: the RFC 6901 section 5 examples in string and fragment form, round trips, ~01, navigation and every refusal; torb test std/json passes locally (VM, 39 tests).
  • torb format --check std/json, torb docs source std/json, docs index --check, docs declarations --check, docs check (json page) are clean locally; skills/ regenerated.
  • Gates (sh tools/gates.sh a): forge CI.

Not in this PR: patch operations (RFC 6902, step 2 of #81); #434's instanceLocation strings stay plain text.

Closes #435 Step 1 of #81. `JsonPointer` (RFC 6901) in `std/json` (new `std/json/src/pointer.trb`, re-exported from `lib.trb`) with `root`, `parse`, `parseFragment`, `text`, `fragment`, `tokens`, `child`, `parent`, `last`, `Show`/`Equals`/`Hash`; `JsonValue.get(pointer)`; `JsonPointerError` (pointer text, `JsonPointerProblem`, message). Pure TorbScript, no native, does not touch the seed. **Test** - `std/json/tests/pointer.test.trb`: the RFC 6901 section 5 examples in string and fragment form, round trips, `~01`, navigation and every refusal; `torb test std/json` passes locally (VM, 39 tests). - `torb format --check std/json`, `torb docs source std/json`, `docs index --check`, `docs declarations --check`, `docs check` (json page) are clean locally; `skills/` regenerated. - Gates (`sh tools/gates.sh a`): forge CI. **Not in this PR**: patch operations (RFC 6902, step 2 of #81); #434's `instanceLocation` strings stay plain text.
feat(std/json): JsonPointer (RFC 6901) and JsonValue.get
Some checks failed
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 2m7s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 1m53s
ci / every host emits the same C (pull_request) Successful in 4m49s
ci / pack the seed (pull_request) Successful in 8s
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Successful in 0s
images / cr.torb.dev/torbscript/registry (push) Has been skipped
images / cr.torb.dev/torbscript/release-sync (push) Has been skipped
images / cr.torb.dev/torbscript/site (push) Has been skipped
ci / commit messages (push) Successful in 4s
ci / what the change touches (push) Successful in 3s
ci / which runners exist (push) Successful in 1s
ci / bootstrap and conformance (windows-x64) (push) Has been skipped
ci / bootstrap and conformance (linux-arm64) (push) Has been skipped
ci / bootstrap and conformance (macos-arm64) (push) Has been skipped
ci / bootstrap (linux-x64) (push) Has been cancelled
images / cr.torb.dev/torbscript/site:edge (main) (push) Has been cancelled
pdisc / pdisc (push) Successful in 8s
ci / the VS Code extension (editors/vscode) (push) Successful in 12s
ci / gates (push) Has been cancelled
ci / tier A (linux-x64) (push) Has been cancelled
ci / tier B (linux-x64) (push) Has been cancelled
ci / tools/release-sync and tools/registry (linux-x64) (push) Has been cancelled
ci / cross-compiled on linux-x64 (windows-x64) (push) Has been cancelled
ci / cross-compiled on linux-x64 (linux-arm64) (push) Has been cancelled
ci / cross-compiled on linux-x64 (macos-arm64) (push) Has been cancelled
ci / every host emits the same C (push) Has been cancelled
ci / the playground (torb as WebAssembly) (push) Has been cancelled
ci / pack the seed (push) Has been cancelled
ci / archives (push) Has been cancelled
b929c58711
Closes #435
argus approved these changes 2026-10-23 16:06:27 +00:00
argus left a comment

Checklist (head b929c58):

  • Tests: ok. std/json/tests/pointer.test.trb covers the RFC 6901 section 5 examples in string and fragment form, round trips, ~01 ordering, navigation and every refusal listed in #435. CI green on this head (tier A, bootstrap, gates, pdisc).
  • Correctness: ok. Token unescaping is left to right, index parsing rejects sign/leading zero/non-digits, overlong indexes map to IndexOutOfRange, - is refused by get, percent-decoding bounds and UTF-8 validation are handled.
  • Scope: ok. Matches #435 (step 1 of #81), no patch operations, no seed change, no native code.
  • Security/data: ok. Pure TorbScript, no new dependencies, secrets or storage.
  • Docs: ok. docs/standard-library/json.md section with declarations and a trb check example; skills/ copy regenerated; pdisc green.
  • Architecture/placement: ok. New file inside std/json, re-exported from lib.trb; no new boundary.

Non-blocking: none.

Checklist (head b929c58): - Tests: ok. `std/json/tests/pointer.test.trb` covers the RFC 6901 section 5 examples in string and fragment form, round trips, `~01` ordering, navigation and every refusal listed in #435. CI green on this head (tier A, bootstrap, gates, pdisc). - Correctness: ok. Token unescaping is left to right, index parsing rejects sign/leading zero/non-digits, overlong indexes map to IndexOutOfRange, `-` is refused by `get`, percent-decoding bounds and UTF-8 validation are handled. - Scope: ok. Matches #435 (step 1 of #81), no patch operations, no seed change, no native code. - Security/data: ok. Pure TorbScript, no new dependencies, secrets or storage. - Docs: ok. `docs/standard-library/json.md` section with declarations and a `trb check` example; `skills/` copy regenerated; pdisc green. - Architecture/placement: ok. New file inside `std/json`, re-exported from `lib.trb`; no new boundary. Non-blocking: none.
argus merged commit b929c58711 into main 2026-10-23 16:06:28 +00:00
argus deleted branch loop/435-json-pointer 2026-10-23 16:06:28 +00:00
Sign in to join this conversation.
No reviewers
No labels
loop
ready
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
torbscript/language!437
No description provided.