spec(0.10.0): §2.4 — retention_profile names behavior.ngram_size; §12.1 omits behavior when two composed inputs differ in it - #21
Open
coderoast-dev wants to merge 1 commit into
Conversation
….1 omits behavior when two composed inputs differ in it ngram_size was in neither processing identifier's list, so two documents produced at different sequence orders could carry equal identifiers and pass §2.4's comparability gate; compose() then picked one input's required ngram_size (breaking §12.2's commutativity MUST), and a MetaLogDiff across them reported total n-gram turnover as a witness of change. §2.4 now states what retention_profile names as a rule (every parameter fixing which entries a bounded block retains, how they are ranked, and what an entry's key denotes), with behavior.ngram_size among its examples, so the existing gate refuses a cross-order compose and diff. §12.1 covers the case that gate does not reach (an input without the identifier): C.behavior MUST be omitted when both inputs carry it at different ngram_size, never merged at a minimum and never carried from one side. The §1 table and the schema's retention_profile description name the parameter. RFC #8, P3 (f). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The problem
behavior.ngram_sizeis required (§4) and fixes what atop_ngramskey denotes: an order-2 key and an order-3 key are different objects. It is named by neither processing identifier in §2.4 —retention_profileliststop_ksize, the reservoir parameters and the salience arithmetic;canonicalization_versionlists masking, tokenization and classification. So two documents produced at different sequence orders can carry equal identifiers, and §2.4's comparability gate passes them. Three consequences:compose()breaks §12.2's commutativity MUST on a required field. A composer must declare onengram_size; withAat 2 andBat 3,compose(A, B)andcompose(B, A)declare different values.top_k_size/top_ngrams_size: those are ranking cuts over one population, whilengram_sizeselects a different population. Declaring the smaller order while carrying the larger order'ssequencearrays is a false declaration; filtering to the smaller order drops one input's n-grams from a document whosewindowcovers both, and no field reports the loss (dropped_ngram_observationscounts observations refused at the producer). Counts across orders are also not comparable (every order-noccurrence implies an order-mone form < n), andprobabilityis conditioned to a different depth on each side.MetaLogDiffreports total turnover. §2.4's gate covers §13 in the same sentence, so the same equal-identifier pair is diffable: every n-gram of one side reads as vanished and every n-gram of the other as new. Under 0.10.0's §13.2 that maximally non-vacuousngram_deltais a witness, so the document asserts"changed"for a change in configuration.The proposed change
retention_profilenames as a rule — every parameter that fixes which entries a bounded block retains, how they are ranked, and what an entry's key denotes — with the existing items andbehavior.ngram_sizeas examples, the list illustrating the rule rather than closing it. The existing gate then refuses a cross-ordercompose()andMetaLogDiffat both sites, with no new mechanism.behaviorat differentngram_size,C.behaviorMUST be omitted — never merged at a minimum, never carried from one side; when they agree,C.behavior.ngram_sizeis that value. The precondition is block-grained, like thecubeclause; the rest ofCcomposes as usual.retention_profiledescription name the parameter (description text only; no keyword changed).CHANGELOG.mdrecords it under 0.10.0 → Changed, adds it to the version's breaking summary, and notes that P3's item (f) is the first item of RFC rfc: 0.10.0 — close the extension boundary, make the diff's MUST decidable, and give the composed document its own caps #8's P3 taken (the caps rule stays proposed).Classification, for the editor
Breaking by the letter: a producer keeping one
retention_profileacross two sequence orders, or a composer merging two orders'behaviorblocks, becomes non-conformant. No document's validity changes: both identifiers stay opaque strings andbehaviorstays optional. Filed for merge underGOVERNANCE.md§2's 0.x rule; 0.10.0 has no tag and no Release.Alternatives considered
ngram_size, as for the other caps. Rejected: a rule that reads like its neighbours and means something else (see above).compose()on a mismatch. Rejected: the incomparability is confined to one optional block, and failing the document would destroy a well-definedstatsmerge. §2.4's hard failure stays document-grained, where the contract it guards is.windowcovering both.Open question for the editor (not in this text)
§2.4's gate is conditional, so an identifier-less pair at different orders still reaches §13. The reference implementation emits no
ngram_deltafor such a pair (no key can match across orders). §13 says nothing about it today; whether it should state that, as §12.1 now does forcompose(), is left to you.Migration impact
The reference implementation (insight-metalog) adopts both rules in the same release: its derived
retention_profilegains the sequence order as an axis, itscompose()omitsbehavioracross differing orders, and its diff emits nongram_deltaacross them. Omitting the block also dropsdropped_ngram_observations— a count lost, not falsified.conformance/metalog_validate.py --selftest: 32/32 fixtures pass on this branch.🤖 Generated with Claude Code