Expand description
Bounded coreference: exact-string grouping plus an experimental pronoun sieve.
NLP-001 is a resource/contract repair, not a coreference-quality claim. Exact surface grouping is not identity. The name-to-gender list is experimental and must not emit personal gender or identity facts. Substrate mention generation is still one-word-per-mention; NLP-500/NLP-501 replace the detector and heuristic. Empty mention lists skip detection.
Structs§
- Cancellation
Token - Cooperative cancellation. Polls are cheap; a zero
cancel_after_pollsdisables auto-cancel (the production default). - Coref
Chain - A resolved coreference chain: all mentions judged co-referent.
- Coref
Chain Head - Chain header written into a caller buffer.
- Coref
Limits - Caller-visible limits. Lower them in tests; raising defaults needs measured resource evidence recorded in the NLP plan.
- Coref
Mention - One coreference mention with byte-span provenance. Cold/host form.
- Coref
Scratch - Caller-owned hot-path workspace.
- Coref
Work Stats - Instrumented work. These are counters, not wall-clock claims.
- Mention
Work - Per-mention scratch record. Caller-owned; zero-initialized then filled.
- Validated
Mention - Validated mention used on the hot path. Text is the source slice.
Enums§
- Coref
Error - Recoverable coreference failure. Host adapters map budget/cancel/output
variants to
E400and the rest toE100. - Mention
Kind - Coarse mention kind, used by the pronoun sieve for agreement.
Constants§
- DEFAULT_
MAX_ ANTECEDENTS_ PER_ PRONOUN - Proper-noun candidates inspected per pronoun (search window).
- DEFAULT_
MAX_ ANTECEDENT_ CHECKS - Total Proper-noun antecedent inspections per call (non-Proper mentions are skipped without charging this counter).
- DEFAULT_
MAX_ CHAINS - Default emitted-chain cap.
- DEFAULT_
MAX_ MENTIONS - Default mention-list cap.
- DEFAULT_
MAX_ MENTION_ TEXT_ BYTES - Default aggregate supplied mention-text cap.
- DEFAULT_
MAX_ SOURCE_ BYTES - Default source cap (transport-sized, not a latency claim).
- DEFAULT_
MAX_ WORKSPACE_ BYTES - Default caller workspace for this operation.
- SENTINEL_
BYTES - 42 MiB Sentinel ceiling. This operation’s workspace must stay under it together with the borrowed source.
Functions§
- aggregate_
mention_ text_ bytes - Sum mention-text bytes with saturating arithmetic, failing at the cap.
- fnv1a64
- FNV-1a 64-bit over already-normalized key bytes.
- mention_
kind_ from_ label - Parse a supported mention kind. Unknown strings fail; they are not coerced.
- offset_
from_ i64 - Checked conversion from a host
i64offset. Negative values never wrap. - offset_
from_ u64 - Checked conversion from a host
u64offset. - preflight_
counts - Reject oversize source/list/text before any grouping work.
- resolve_
coreferences - Cold adapter: validate, allocate scratch, resolve, materialize chains.
- resolve_
coreferences_ counted - Cold adapter that also returns work counters.
- resolve_
coreferences_ into - Resolves coreferences into
out. - validate_
mention - Validate one mention against the immutable source.
prevenforces document order. - validate_
mentions - Validate every mention after the count/byte preflight has passed.
- workspace_
bytes_ required - Bytes for
nmention work records plus twou32permutations plusnorm. Cold adapters also allocatevalidated/heads/ids; those are not part of this hot workspace figure and stay well under the 42 MiB Sentinel.