Repository navigation
proposal(core): clarify defaults, identity and document representations - #677
marcschier wants to merge 31 commits into
Conversation
Signed-off-by: Marc Schier <marcschier@hotmail.com>
Signed-off-by: Marc Schier <marcschier@hotmail.com>
Remove the approved issue-specific policy helper, prose-bound tests and script-only README. Preserve all specification changes and defer policy decisions to the original PR review. Signed-off-by: Marc Schier <marcschier@hotmail.com>
Signed-off-by: Marc Schier <marcschier@hotmail.com>
Port only the reviewed Core net diff. Preserve arbitrary permitted fractional precision, timestamp operand boundaries and equal-instant ID tie-breaking. This remains a category e policy proposal, not a claim of prior nonconformance. Source-PR: xregistry#681 Source-Head: 7f7a59c Source-Merge-Base: 1b87273 Source-Commit: c0a5b76 Signed-off-by: Marc Schier <marcschier@hotmail.com>
Retain the reviewed category e rejection proposal and its source-defined per-creation case-insensitive Version-ID order. Admission precedes retention and final default processing; pruning cannot rescue a failed creation. Explicit ancestors and permitted backdated timestamps keep their existing semantics. Source-PR: xregistry#679 Source-Head: a4767a7 Source-Merge-Base: 1b87273 Source-Commit: faed10c Source-Authority: xregistry#586 (comment) Signed-off-by: Marc Schier <marcschier@hotmail.com>
Retain the reviewed category e immutable-snapshot traversal past a protected default. Preserve actual-deletion restrictions, atomic exhaustion failure and all remaining model constraints. The earlier xregistry#679 admission check remains a prerequisite, and xregistry#677 still validates the final effective sticky selection. Source-PR: xregistry#680 Source-Head: e6c5e2c Source-Merge-Base: 1b87273 Source-Commit: b5e693a Signed-off-by: Marc Schier <marcschier@hotmail.com>
Retain the reviewed category e 61-character Group singular bound and explicit migration requirement. Group plural and Resource limits stay unchanged; the separately deferred input-meta-schema work in xregistry#594 is not imported. Source-PR: xregistry#678 Source-Head: 3aeeccd Source-Merge-Base: 1b87273 Source-Commit: 8bd2a3b Signed-off-by: Marc Schier <marcschier@hotmail.com>
Retain the category e model-permitted claim admission policy, disabled/lenient versus strict checker behavior, and whole-operation rejection for actual failures. The two copied compatibility link/word corrections retain category a ownership in xregistry#722 until that prerequisite actually merges. Do not import xregistry#723 strict-validation diagnostic changes or either whole prerequisite branch. Source-PR: xregistry#682 Source-Head: 648f656 Source-Merge-Base: 9ecf8ea Source-Commit: 28fb72e Prerequisite-Owner: xregistry#722 (compatibility status link and copied word) Signed-off-by: Marc Schier <marcschier@hotmail.com>
Transfer the proven category d correction independently from the policy proposals. Preserve absolute API identity while scoping fragment suffix, uniqueness and mutability rules to the appropriate view, and use the RFC6901 root and fragment-encoding rules. Source-PR: xregistry#687 Source-Head: 378021c Source-Merge-Base: 9ecf8ea Source-Commit: 67f6997 Signed-off-by: Marc Schier <marcschier@hotmail.com>
Retain category e typemap precedence over discretionary base64 and the proposed lossless string fallback without choosing a universal character encoding. The established string/json/binary, implicit-map, binary-flag and empty-document alignment retains category b ownership in xregistry#723. Keep that required overlap until its actual upstream merge; do not merge the whole prerequisite branch. The next source commit composes xregistry#707 decoded-null exception. Source-PR: xregistry#699 Source-Head: 9d29755 Source-Merge-Base: 9ecf8ea Source-Commit: 9668fa6 Prerequisite-Owner: xregistry#723 (established document representation alignment) Signed-off-by: Marc Schier <marcschier@hotmail.com>
Retain the reviewed category e original-byte base64 exception for decoded JSON null, even without the binary flag, and leave request-null reset, nested null and the JSON string null unchanged. Qualify xregistry#699 generic mapping statements with this existing exception in Core and Model; its base64 description now refers to all representation rules. This is source composition, not a new encoding policy. Source-PR: xregistry#707 Source-Head: 38e7c4f Source-Merge-Base: 9ecf8ea Source-Commit: 88855d7 Composed-With: xregistry#699 (9d29755) Signed-off-by: Marc Schier <marcschier@hotmail.com>
Apply the eight retained review findings for this PR without changing any of its other proposals. 677-C-1: keep the 61-character Group type singular bound and reconcile the rest of the document set with it. core/model.md now explains that `<GROUP>id` is the only Core attribute name derived from a Group singular, which is why that bound is 61 while the Group plural and both Resource type names stay at 57, and it describes the baseline bound as 63 rather than claiming a 62-character allowance that was never stated. Primer 11.12 now states one bound per kind of name instead of 57 for all four. The explicit migration and no-silent-truncation guidance is unchanged. 677-C-2, 677-D-1, F677-B1: restate `manual` mode pruning past a protected default as a deterministic round-based algorithm that always makes progress. Each round takes an immutable ancestry snapshot, traverses from the roots by oldest `createdat` with a lowest case-insensitive `versionid` tie-break, walks past Versions it cannot select so that their descendants still become eligible, and deletes the first deletion candidate it reaches. A candidate is a visited Version that is not the default and whose deletion does not increase the number of roots while `singleversionroot` is `true`, which admits childless Versions and a root with at most one child. Because a fresh snapshot starts every round, a reduction of more than one Version keeps making progress instead of stranding the Versions an earlier round skipped. For `a <- b <- c` with a sticky default `a`, `singleversionroot: true` and `maxversions: 2`, this deletes `c` rather than splitting the tree at `b`. The undefined "cannot legally be deleted" predicate and the Version "deprecation/removal promises" appeal are removed, `deprecated` is not added to Versions, and the unreachable no-progress `bad_request` branch is dropped rather than mandating two different errors for one request. The existing Deleted Ancestor rule is untouched, no re-parenting exception is added, and pre-existing invalid ancestry keeps its existing error contracts. Primer 11.20 is updated to match, since its branching example previously concluded that such a request must be rejected. 677-D-2: replace the undefined "In completed metadata" qualifier on `defaultversionid` with the specification's end-of-operation wording. The effective-selection paragraph still carries the request-side rule and still validates after all Version processing. F677-A1: state the response representation algorithm once, in core/spec.md#resource-attribute. That section keeps binary-flag precedence, the mandatory `json` and `string` mapping behavior, the lossless string fallback including the prohibition on replacing or discarding invalid bytes, the no-mapping policy including that a base64 preference does not override a mapping, the single non-empty-document JSON `null` constraint, the worked `filebase64` example and the request-side `"file": null` rule. core/model.md keeps the `typemap` value meanings, the type/subtype lookup rule, the conflicting-entries rule, the implicit mapping table and the `model_error`, and links to that algorithm instead of repeating it. F677-B2: replace "Backdated timestamps are not categorically rejected" with the positive admission condition, and replace the undefined "input-kind" with "JSON type". F-FMT-1: rewrap the one over-length prose line this PR added. Review-Findings: 677-C-1, 677-C-2, 677-D-1, 677-D-2, F677-A1, F677-B1, F677-B2, F-FMT-1 Review-Comment: xregistry#677 (comment) Reviewed-Head: ac0abc5 Signed-off-by: Marc Schier <marcschier@hotmail.com>
Support the explicitly reviewed usage.item.enum shape. Reuse scalar enum and strict semantics for array elements and map values, while retaining the ban on enum on the owning container. Signed-off-by: Marc Schier <marcschier@hotmail.com>
…ep Avro membership The Core rule is now public at 6cabc4b on xregistry#677. It makes `item.strict` OPTIONAL and MUST only be used when `item.type` is a scalar, and it states that `strict` false makes the enum advisory without relaxing the `item.type` requirement. The first pass admitted `strict` beside any item type and let the effective-enum shortcut skip the value-kind check whenever `strict` was false, so both clauses were unenforced. Reject `strict` on an array, map, object or `any` item in the source ItemDefinition and in the generator, alongside the existing `enum` guard, and check the declared value kinds before the membership shortcut so an advisory set with a wrong-kind value is still rejected, including inside a nested container. A scalar item may carry `strict` with no `enum`; that stays legal and adds no restriction. Two of the reported Avro fallbacks were avoidable rather than intrinsic. A repeated legal value names the same Avro symbol, so it is now folded in first-occurrence order instead of dropping the restriction. A different legal set that would need an already-taken name now takes the next name in the same convention through the existing definition cache, so `UsageEnumType` still belongs to the actual roles, an identical set still reuses the first definition, and a second set becomes `UsageEnumType2` with its own enforced membership. Both colliding definitions are exercised with the real DatumWriter and DatumReader plus non-member rejection. The genuinely unrepresentable sets are unchanged and still documented as a mapping limit: a non-string scalar kind, and a value that is not a legal Avro name. No codec is invented for either. tools/item-enum-projection.md now states that Core does not permit `enum` on the owning array or map attribute, so the surviving array-level projection is named as legacy plumbing and a P2 prerequisite rather than valid Core. That projection and the test pinning it are deliberately retained. The tools suite grows from 1054 to 1096 cases with no baseline case removed, and all sixteen generated artifacts still reproduce: the raw generator output bytes are identical to the checked-in bytes, with no carriage returns and no normalization or reformatting step on either side. Signed-off-by: Marc Schier <marcschier@hotmail.com>
Restore the reviewed explanation of as-is document bytes in the no-typemap fallback: without any additional processing such as escaping. Preserve the proposed mapping precedence and representation choices unchanged. This completes the earlier follow-up promised in the PR 723 review thread. Signed-off-by: Marc Schier <marcschier@hotmail.com>
Retain the document-representation proposal and its explicit as-is, no-extra-escaping criterion. Incorporate the accepted JSON string example correction: escape quotation marks, backslashes and control characters U+0000 through U+001F. Other upstream changes merge without altering the remaining proposal. Signed-off-by: Marc Schier <marcschier@hotmail.com>
The primer gives every Group and Resource type name a 57-character limit. The existing model allows 63 characters for Group singular names and 57 for the other names. Source: #677. Category: consistency. Scope: the name-limit recap in core/primer.md; no model limit changes. Signed-off-by: Clemens Vasters <clemensv@microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Resource self and defaultversionurl examples omit the metadata suffix, and the root JSON Pointer example uses a slash. Existing rules require metadata URLs and a pointer to the entity within the returned document; the root pointer is empty. Sources: #723 and #677. Category: consistency. Scope: five example values in core/spec.md; no URL or document-view policy changes. Signed-off-by: Clemens Vasters <clemensv@microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adopt the now-accepted 61-character Group singular bound and empty-root JSON Pointer wording. Retain the proposal explanation, immutable-name migration constraint and RFC6901 token escaping requirements. Remaining default-selection and document-representation proposals are unchanged. All 16 artifacts reproduce; 67 tools tests and documentation checks pass. Signed-off-by: Marc Schier <marcschier@hotmail.com>
| stated 63-character Group singular names do not satisfy this bound. Existing | ||
| immutable Group types MUST NOT be silently truncated or renamed; adopting | ||
| this bound requires an explicit migration. | ||
|
|
There was a problem hiding this comment.
I think we can drop this since the Primer talks about it. But if we keep it here, then drop it from the pimer
There was a problem hiding this comment.
Removed the model-side explanation in 7fd8879. The explanation stays in the Primer; the model retains only the existing 61-character constraint.
| - These checks validate the stored | ||
| [`meta.compatibility` claim](spec.md#compatibility-attribute); they do not | ||
| replace the Resource model's attribute constraints. When disabled, lack of | ||
| checker support MUST NOT by itself reject a stored claim. |
There was a problem hiding this comment.
I'm not following - why would someone think it replaces the Resource attribute constraints?
There was a problem hiding this comment.
There is no existing rule suggesting that compatibility checks replace attribute constraints. I was trying to distinguish document compatibility checking from model validation, but this note introduced an unnecessary distinction here. Removed it in 7fd8879; claim admission remains discussed under compatibility itself.
| rules also define the precedence of the | ||
| [binary flag](./spec.md#binary-flag), the JSON `null` constraint and the | ||
| [empty-document rule](./spec.md#resourcebase64-attribute). | ||
|
|
There was a problem hiding this comment.
If this is just repeating the core spec, then revert it. If not, what is new?
There was a problem hiding this comment.
Removed this cross-reference paragraph in 7fd8879, together with the proposed representation-precedence rewrite it referred to. It no longer duplicates Core or implies an additional typemap rule.
| A value of `json` indicates that the Resource's document is JSON. Under the | ||
| [Core document representation rules](./spec.md#resource-attribute) this | ||
| selects the `<RESOURCE>` attribute for a response. When using `<RESOURCE>`, | ||
| the server MAY choose to modify the formatting of the document (e.g. to |
There was a problem hiding this comment.
Reverted the json typemap rewrite to main's wording in 7fd8879.
| serialization rules for the Resource's metadata format. The document bytes | ||
| do not need to already be a valid value in that format. For example, when | ||
| using JSON, this means quoting the string and escaping quotation marks, | ||
| backslashes and control characters (U+0000 through U+001F). |
There was a problem hiding this comment.
I'd prefer to revert this since people can still choose to use RESOURCEbase64 if they wanted
There was a problem hiding this comment.
Reverted the string typemap rewrite in 7fd8879. I also restored the Core text allowing the server to return <RESOURCE>base64, rather than making the proposed mapping precedence override that choice.
| rule MUST NOT discard a candidate before the existing | ||
| [Resource creation-clue processing](#resource-processing-algorithm). An invalid | ||
| effective selection fails the whole operation under | ||
| [Error Processing](#error-processing), without retaining partial changes. |
There was a problem hiding this comment.
This was trying to separate the final default's existence check from validation of an ignored request value. The existing non-sticky update example already accepts defaultversionid: "abc" when the resulting non-sticky default ignores it.
Rewrote the paragraph in 7fd8879 around that concrete case and linked the example. The final selected Version must exist; a supplied value still must have valid string/ID syntax, and its earlier use as a Version-creation clue is unchanged.
| For example, the four document bytes `null` for a `file` Resource are | ||
| represented by the following document field: | ||
|
|
||
| <!-- words: bnvsba --> |
There was a problem hiding this comment.
while valid, for consistency, move to the top
There was a problem hiding this comment.
Moved the bnvsba spelling directive to the file's existing word list at the top in 7fd8879.
| is free to use `<RESOURCE>base64` when returning the data. | ||
| MUST select the response representation according to the rules above. It can | ||
| return `<RESOURCE>base64` when those rules require it or, when no `typemap` | ||
| mapping applies, when it prefers that form. |
There was a problem hiding this comment.
Reverted this rewrite in 7fd8879. The server is again explicitly free to return <RESOURCE>base64 even when the client supplied <RESOURCE>.
| valid JSON document. A server preference for `<RESOURCE>base64` MUST NOT | ||
| override a `json` or `string` mapping. Document bytes MUST NOT be converted | ||
| to a string merely to fit the metadata format when no `string` mapping | ||
| applies. |
There was a problem hiding this comment.
I'm leaning towards reverting this one too
There was a problem hiding this comment.
Reverted the added response-representation/typemap selection block in 7fd8879. The original description and server-choice wording are restored; the separate document-bytes-versus-metadata-null clarification remains.
| then either `<RESOURCE>` or `<RESOURCE>base64` MUST be present. | ||
| - MUST only be used if the Version's document (bytes) is in the same | ||
| format as the serialization of the Version entity. | ||
| - MUST only be used when permitted by the representation rules above. |
There was a problem hiding this comment.
revert if we drop the above text
There was a problem hiding this comment.
Reverted this dependent constraint in 7fd8879 together with the representation block above it.
| Each pointer MUST use the | ||
| [URI fragment identifier representation of RFC6901](https://datatracker.ietf.org/doc/html/rfc6901#section-6): | ||
| escape `~` as `~0` and `/` as `~1` within each reference token, then perform | ||
| the UTF-8 and URI-fragment percent-encoding from that section. |
There was a problem hiding this comment.
I don't think we allow ~ or / as attribute names, so this shouldn't be needed, right?
There was a problem hiding this comment.
Attribute names cannot contain them, but the pointer also traverses collection keys containing entity IDs. Core explicitly permits ~ in a <SINGULAR>id, so file~one needs the pointer token file~0one. I added that example in 7fd8879 to show why RFC6901 token escaping is relevant without suggesting the attribute-name grammar is broader.
There was a problem hiding this comment.
Remove this paragraph. We don't need to duplicate what's in the RFC.
There was a problem hiding this comment.
Removed the paragraph in bd94bed; the preceding text still refers to JSON Pointer.
| equal, and `2030-01-01T00:00:00.1Z` compares greater than either one. | ||
| RFC3339 offset and leap-second semantics remain applicable. This rule does | ||
| not impose a uniform number of fractional digits on stored or returned | ||
| values. |
There was a problem hiding this comment.
actually I think string collation was the intent, so if we need to say something about "no trailing zero" then let's say it, but we need to allow for strcmp
There was a problem hiding this comment.
Restored the existing UTC-normalized string-comparison rule in 7fd8879. The instant-based comparison, arbitrary-fraction equality and related sorting changes are removed. This PR no longer requires a different comparison algorithm or adds a fractional-second normalization rule.
| MUST be used as a secondary sorting key, using the same `asc`/`desc` value | ||
| specified for the primary sorting key. | ||
| Different timestamp representations of the same instant MUST use this | ||
| secondary key, not their serialized spellings. |
There was a problem hiding this comment.
Removed the timestamp-specific secondary-sort rule in 7fd8879; sorting now retains main's existing rules.
| values. | ||
| Presence, `null`, and whole-value `*` existence tests retain their existing | ||
| semantics. Outside those tests, operands MUST be RFC3339 timestamps. | ||
| Other string-wildcard patterns are not timestamp operands. |
There was a problem hiding this comment.
revert, I think. I'm not 100% sure follow
There was a problem hiding this comment.
Reverted the added timestamp-operand and wildcard restrictions in 7fd8879 along with the instant-comparison rewrite.
Incorporate the accepted pagination_noncollection error from upstream without changing this PR's proposals. Signed-off-by: Marc Schier <marcschier@hotmail.com>
Signed-off-by: Marc Schier <marcschier@hotmail.com>
Merge current upstream main including the accepted Message name and Endpoint target fixes. Retain the reviewed Core proposal without restoring withdrawn wording. All16 artifacts reproduce and existing tools checks pass. Signed-off-by: Marc Schier <marcschier@hotmail.com>
Signed-off-by: Marc Schier <marcschier@hotmail.com>
Signed-off-by: Marc Schier <marcschier@hotmail.com>
| the [Resource processing algorithm](#resource-processing-algorithm). The | ||
| final existence check does not change that earlier processing. The | ||
| [non-sticky update example](./resource.md#update-resource-with-non-sticky-bad-defaultversionid) | ||
| shows an ignored request value that does not cause an error. |
There was a problem hiding this comment.
I think we can revert this - I think it's just repeating things
There was a problem hiding this comment.
Restored the original defaultversionid existence-check wording and removed the following paragraph in 552cc23.
Signed-off-by: Marc Schier <marcschier@hotmail.com>
Signed-off-by: Marc Schier <marcschier@hotmail.com> # Conflicts: # core/spec.md
Signed-off-by: Marc Schier <marcschier@hotmail.com>
Proposed changes
This Core proposal now retains:
selfpointers whose effective identity remains immutable, and RFC6901 escaping for collection keys such as entity IDs containing~.null, distinct from a metadatanullthat requests an empty document.