formats: JSON Patch #81
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
JSON Patch as format packages: RFC 6902 (JSON Patch:
add,remove,replace,move,copy,test) and JSON Merge Patch (RFC 7396), both in the versions of the ROADMAP table. A patch document is itself JSON, so it is a type onEncode/Decode; applying it works onJsonValue. This is an epic: a pointer type, two patch formats, two public test oracles and docs are more than one PR. Steps become issues just in time, one at a time.Source
EncodeandDecode.std/json(JsonValue) is the document type;std/toml,std/xmlandstd/yamlare the layout model (format value, parser, vendored public suite, docs page).Design record point
ROADMAP "Which versions a format supports" (JSON Patch row) and ENCODING.md section 9. Decided by the loop:
JsonPointerinstd/json(step 1), not a package of its own; #80 expects it there.std/json-patch(hyphenated likestd/json-schema), pure TorbScript onJsonValueandJsonPointer, not in the prelude. They are two operations on one family of documents and share the application engine and the docs page; separate packages would split one small subject in two.JsonPatch(a list of operations) is a value that isEncode/Decode; the six operations are cases of onePatchOperationtype. Applying is a method,JsonPatch.apply(document: JsonValue): Result<JsonValue, PatchError>, and atomic as RFC 6902 section 5 requires: a failing operation, or a failingtest, returns the error and no partial document.JsonValueis a value, so "the original is left untouched" holds by construction.PatchErrornames the operation index and the reason.MergePatchoverJsonValue(MergePatch.apply(target), with the RFC'snulldeletes a member, non-object patch replaces).tests.jsonandspec_tests.json, MIT, vendored as a generatedsuite-cases.trbwith notice and pinned commit, the model isstd/yaml/tests/suite-cases.trb) for RFC 6902, and the RFC 7396 appendix A table (15 cases, public text of the RFC) for Merge Patch. Cases that need arbitrary-precision numbers (JsonValue.Numberis aFloat64) are excluded by name with the reason.diff), and patching typed values throughDescribe; if wanted, they are their own issues later.std/json-patch, and the addition tostd/jsonis a new public type that no std name lookup by string refers to. A step that changes that carries the two-commit rule itself.Steps
JsonPointer(RFC 6901) instd/json: string and URI-fragment forms,JsonValue.get, errors, docs section, tests from the RFC's examplesstd/json-patchwith RFC 6902:JsonPatch/PatchOperationonEncode/Decode, atomicapply(addincl. the-index,remove,replace,move,copy,testwith the RFC's equality rules),PatchError; vendored json-patch-tests suite, docs pagedocs/standard-library/json-patch.md, ROADMAP row marked startedstd/json-patch:MergePatch.apply, the RFC's appendix A cases as tests, docs page extended, ROADMAP row marked done (closes the epic's acceptance)Acceptance criteria (epic)
EncodeandDecodein the versions of the table (RFC 6902 and RFC 7396)docs/standard-library/Dependencies
std/json(JsonValue),std/test, all built.JsonPointerwith the reference step of #80 (whichever lands first adds it tostd/json); otherwise independent of #80, #434, #78 and #79.Moved from the planning lists of the docs; the design record stays the specification.
[loop:torbscript] intake: in scope (author orion, label loop), sources ROADMAP.md format versions and ENCODING.md section 9, not a duplicate, no collision with a design record. TorbScript package, public test suite in forge CI, no seed impact expected. next: refine, waiting (ready buffer full: #4, #163, #164, #223 are ready) until 2026-10-10T04:00:00Z
std/json-schema(step 1 of #80) #434[loop:torbscript] claim refine by session:loop-torbscript-20261023 until 2026-10-23T17:22Z
JsonPointer(RFC 6901) instd/json(step 1 of #81) #435[loop:torbscript] decided by the loop: #81 is too big for one PR, so it is an epic and stays without
ready. It needs a pointer type (RFC 6901), the six RFC 6902 operations with atomic application, RFC 7396 Merge Patch, two public test oracles and the docs, and it shares the pointer with the reference step of #80. Order follows the dependencies:JsonPointerfirst (it unblocks both #81 and #80), then RFC 6902, then Merge Patch. Naming and placement follow the neighbours:JsonPointergoes intostd/jsonas #80 already expects (re-exported from a new file, likestd/toml), patches live instd/json-patch(hyphenated likestd/json-schema), methods not free functions (#146). Test oracles: the public json-patch-tests suite (MIT) vendored as a generatedsuite-cases.trblikestd/yaml, and the appendix cases of RFC 7396; arbitrary-precision numbers are excluded by name becauseJsonValue.Numberis aFloat64.diffgeneration and typed patching are out of scope. No seed touch for the whole epic (the compiler importsstd/jsonbut looks up no new name by string; additions are public declarations only). Step 1 is filed as #435 (keyword search of open and closed issues for pointer, patch, RFC 6901/6902, merge patch and std/json found only #80, #434 and this one; none duplicates it) and isready; steps 2 and 3 are filed just in time. Dependencies: #435 is shared with #80's reference step; otherwise independent of #434.[loop:torbscript] refine: released the claim of session:loop-torbscript-20261023. #81 is an epic (checklist of 3 steps in the body), step 1 filed as #435 with labels
loopandready. Nothing was written to the repo. Worker usage: about 85k tokens (sonnet).next: waiting (epic waits on its steps)
std/json-schema:$id,$ref,$defs,$anchorand a registry of supplied documents (step 2a of #80) #553[loop:torbscript] claim refine by session:loop-torbscript-20261029 until 2026-10-29T13:51Z
std/json-patchwith RFC 6902 JSON Patch and the json-patch-tests suite (step 2 of #81) #581[loop:torbscript] decided by the loop: step 1 (#435) landed on
main(PR #437, merge commitb929c58;std/json/src/pointer.trbwithJsonPointerandJsonValue.get, verified on origin/main), so step 2 starts now. Filed as #581 (keyword search of open and closed issues for json-patch, JsonPointer, pointer, patch and merge patch found only #80, #81, #434 and #435; no duplicate), withloopandready. Sizing: the package, the six operations with atomicapply,Encode/Decode, the docs page and the vendored json-patch-tests suite are one PR in two Conventional Commits (feature plus hand tests and docs; then the generated suite with its exclusions and the ROADMAP row), the same splitstd/json-schemaused. Dependencies are met:JsonPointeris onmain,std/jsonandstd/testare built. No seed touch. Step 3 (RFC 7396) is filed when #581 lands. The epic checklist now ticks step 1 and links #581.[loop:torbscript] refine: step 2 filed as #581 and set
ready; #81 stays an epic withoutready. Nothing was written to the repo. Worker usage: about 60k tokens (sonnet).next: waiting (epic waits on its steps; #581 is ready to implement)
[loop:torbscript] claim refine by session:loop-torbscript-20261030 @anthropic:theorben until 2026-10-30T12:02Z
std/json-patch(step 3 of #81) #687[loop:torbscript] refine: decided by the loop: step 2 (#581) landed on
main(PR #584, commits8acff50and16fe80a,std/json-patchwithJsonPatch, atomicapplyand the json-patch-tests suite, verified on origin/main; issue closed), so step 3 starts now. Step 2 is ticked in the checklist. Filed as #687 (keyword search of open and closed issues for merge patch, 7396 and json-patch found only #80, #81, #435 and #581; no duplicate):MergePatch.apply, the 15 appendix A cases as tests, docs section, ROADMAP row marked done. Labelsloopandready; no seed impact, one PR.released the claim of session:loop-torbscript-20261030
next: ready (#687)
[loop:torbscript] decided by the loop: step 3 (#687) landed on
main(PR #692;std/json-patch/src/merge.trbwithMergePatch.apply, the appendix A cases as tests, docs page and ROADMAP row 'both done' verified on origin/main). All three steps and the epic's acceptance criteria are met, so the epic is closed. Claim of session:loop-torbscript-20261030 released. next: none (epic done)