DEV Community

Discussion on: Write-Side Custody: Trust Begins Before Memory

Collapse
 
izgorodin profile image
Edward Izgorodin •

Ken, the custody decision in the example is a boolean, but the paragraph above it names three outcomes: accepted, rejected, or accepted with qualification. The first two are enforcement. The third is not, and it is the only one whose value gets decided after the boundary.

A rejected write never exists downstream, so nothing later can misread it. A qualified acceptance does exist, and the qualification has to survive two hops that custody does not control. Retrieval has to rank it as something less than governing. Then context assembly has to keep the caveat attached when the record is flattened into text. Assembly is where I would expect it to break. Once a set of records becomes a prompt, a qualified record and an authoritative one are both just sentences, and the qualification is a phrase competing for attention rather than a field the system obeys.

So the argument that read-side cleverness loses the war holds for the two binary outcomes and inverts for the middle one. Accepted with qualification is a promise that the read path will honor a distinction the write path made, and neither the ledger nor durable memory can make it keep that promise.

The middle value pays for itself only when the qualification is expressed in something retrieval already obeys: a separate namespace, exclusion from the authoritative set, a companion record that has to travel with it. As a field on the record it is closer to a comment than to custody. It may be more accurate to say custody has two outcomes it can enforce and one it can only recommend, and to name the recommending case as such.

Collapse
 
kenwalger profile image
Ken W Alger •

I think you're right, and “as a field on the record it is closer to a comment than to custody” identifies the weakness pretty cleanly.

I've been treating accepted-with-qualification as though preserving the qualification were the same as enforcing it. It isn't. ALLOW and DENY are outcomes the custody boundary can actually enforce. Once a qualified record crosses the boundary, custody no longer controls whether retrieval ranks it beside governing records or whether context assembly preserves the distinction strongly enough for the model to honor it.

So I think the middle case needs a stronger representation than a caveat field. If the qualification affects how the record may be used, it has to become something downstream architecture must obey: a custody/state classification, retrieval eligibility constraint, separate namespace, required companion relationship, or some equivalent mechanism. Otherwise, the boundary preserves useful metadata but doesn't enforce qualified use.

That also suggests I should be more precise with the language. Custody can enforce admission or rejection. It can also admit something into a constrained state, but only if those constraints remain machine-enforceable downstream. If they're merely descriptive, then yes, custody is recommending rather than governing what happens next.

And I think your context-assembly point matters especially. We spend a lot of time worrying about retrieval flattening relationships, but prompt assembly can flatten authority just as easily. A system hasn't preserved a distinction just because it still exists somewhere in storage.

Collapse
 
izgorodin profile image
Edward Izgorodin •

The gap between preserving and enforcing has a shipped example, and it is ours, so I can report how it fails rather than predict it. Our write gate refuses a correction phrased like the thing it corrects, because a correction is by nature a near duplicate of the record it cancels. Since late August a write can declare which record it supersedes, and a declared correction is admitted. That declaration is exactly your witnessed relationship, captured at admission, at the strongest possible moment. And it still does not govern: the superseded atom is marked, not hidden, and keeps competing in reads. All of this is public, in our changelog and the piece built on it, which is why I can cite it.

So the failure in our case is not metadata quality. The relationship is machine readable, admitted with the write, and correct. What is missing is the obligation: nothing on the read path is required to consult the mark before ranking the superseded record beside the one that replaced it. Preserved perfectly, enforced nowhere, which is your caveat versus custody distinction running in production rather than in an argument.

Of the four mechanisms you name, our case argues for the retrieval eligibility constraint, because it is the only one of the four that changes what the reader receives rather than what the store knows. A constrained state that ranking is free to ignore is a comment with better formatting.

Thread Thread
 
kenwalger profile image
Ken W Alger •

That's a much stronger example because it removes the ambiguity about whether the relationship was captured correctly in the first place. You have the witnessed supersession relationship, established at admission, and the failure still occurs because nothing downstream is obligated to obey it.

I think that makes the distinction clearer than I had it before. Preserving a constraint and enforcing a constraint are separate responsibilities, and preservation alone doesn't create an obligation on the next boundary.

Your retrieval eligibility point makes sense to me for exactly that reason. If a record is known to be superseded, allowing it into the same unconstrained candidate set and hoping ranking interprets the mark correctly is already too late. The relationship needs to affect eligibility before relevance scoring treats the two records as peers.

I'm also starting to think the broader invariant is that a consequential state transition has to change the behavior of the next consumer, not merely the metadata available to it. superseded that retrieval may ignore isn't really a governing state. It's an annotation.

And this pushes the architecture one boundary further than the write-side argument alone. Custody can establish and witness the transition at the strongest possible moment, but the read path needs its own enforcement contract. Otherwise, we've successfully prevented unauthorized writes while still allowing obsolete authorized writes to govern forever.

Thread Thread
 
izgorodin profile image
Edward Izgorodin •

Ken, the invariant you landed on is the one that survives: a state transition that does not change the next consumer's behavior is an annotation, not a state. The addition I would argue for is that the read path enforcement contract needs its own receipt. If retrieval is obligated to exclude superseded records from the candidate set, then an audit has to be able to ask what was excluded on this read and why, otherwise enforcement is asserted the same way custody used to be asserted, by trusting the component to have done it. That is the same gap moved one boundary later. A concrete shape: eligibility filtering emits an exclusion record naming the rule that fired and the relationship it fired on, queryable next to the results. It also settles the witnessed versus derived distinction operationally, because an exclusion justified by a witnessed supersession can be enforced unconditionally, while one justified by a derived edge inherits the derivation's provenance and can be challenged. Preservation, enforcement, and now accountability of enforcement. Each boundary seems to need all three before the boundary after it can trust anything.