You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given that relations cannot cross a window boundary and constraints do not survive the merge, how do we chunk — and what do we do about the guarantees we lose?
Surfaced by #345, which established two facts that together undercut "valid by construction" at the document level:
Cross-window relations are never produced.joint_ie/long_text.py decodes each chunk independently and drops any relation whose endpoints did not both come from the same chunk. Its own comment: "Both IDs must originate in this same chunk result. This explicit lookup is what prevents accidental cross-window edge creation."
Constraints are not re-applied at the merge.long_text.py never touches schema.constraints; it set-unions rows. Verified empirically: the same span came back simultaneously as three different types, violating the EntityOverlapPolicy every compiled schema carries, and a max_per_head=1 relation ended up with 2 edges on one head after merging.
So enforcement is real (#345 confirmed it happens during beam expansion) but per window only. The document-level result can violate the constraints we declared.
This matters here specifically because extract_long() is not optional for us — #336/#338 made it mandatory precisely because session texts blow the context window. A reconciled session is one document; real session Chunk.text values run to several thousand characters, against a default chunk_size of 384 tokens. So most sessions will be many windows, and a relation between a person named early and an organisation named late is exactly the case that silently vanishes.
Open:
Chunking regime. Keep a session as one document and accept per-window relations? Chunk on conversational turn boundaries so related mentions co-occur more often? Larger windows with more overlap, trading compute? Something structural — e.g. extract per turn and relate across turns in a separate pass?
What "document-level valid" should even mean. Do we want the merged graph to satisfy the declared constraints, or is per-window validity enough? If we want the former, something has to re-check after the merge — and What JointSchema actually enforces #345 flagged that Constraint.apply has zero call sites in the package, so that path is untested library surface.
Interaction with entity identity. If the same entity appears in several windows it becomes several nodes, which is Entity identity across chunks #346's problem — but note it also causes relation loss here, since endpoints in different windows can never be joined. These two may share a solution.
Whether this changes the relation vocabulary. If cross-window relations are structurally unavailable, relation types that typically span a long conversation may be unextractable in practice regardless of how well they are specified (The starter relation vocabulary #347).
Interacts with #348 but deliberately not blocking it: #348 can be decided knowing the fact that enforcement is per-window, without first settling the chunking regime. Whoever picks up either should read the other.
Part of #344
Question
Given that relations cannot cross a window boundary and constraints do not survive the merge, how do we chunk — and what do we do about the guarantees we lose?
Surfaced by #345, which established two facts that together undercut "valid by construction" at the document level:
joint_ie/long_text.pydecodes each chunk independently and drops any relation whose endpoints did not both come from the same chunk. Its own comment: "Both IDs must originate in this same chunk result. This explicit lookup is what prevents accidental cross-window edge creation."long_text.pynever touchesschema.constraints; it set-unions rows. Verified empirically: the same span came back simultaneously as three different types, violating theEntityOverlapPolicyevery compiled schema carries, and amax_per_head=1relation ended up with 2 edges on one head after merging.So enforcement is real (#345 confirmed it happens during beam expansion) but per window only. The document-level result can violate the constraints we declared.
This matters here specifically because
extract_long()is not optional for us — #336/#338 made it mandatory precisely because session texts blow the context window. A reconciled session is one document; real sessionChunk.textvalues run to several thousand characters, against a defaultchunk_sizeof 384 tokens. So most sessions will be many windows, and a relation between a person named early and an organisation named late is exactly the case that silently vanishes.Open:
Constraint.applyhas zero call sites in the package, so that path is untested library surface.Interacts with #348 but deliberately not blocking it: #348 can be decided knowing the fact that enforcement is per-window, without first settling the chunking regime. Whoever picks up either should read the other.