Skip to content

Add literal occurrence strands over stable fragments - #58

Merged
isomorphisms merged 5 commits into
mainfrom
feature/occurrence-strand
Sep 12, 2026
Merged

isomorphisms merged 5 commits into
mainfrom
feature/occurrence-strand

Conversation

@isomorphisms

@isomorphisms isomorphisms commented Sep 12, 2026

Copy link
Copy Markdown
Owner

Implements the deliberately narrow first operation from #54 without adding novel-specific or model-derived machinery.

  • searches the authoritative source text with deterministic exact-string matching;
  • maps each occurrence start coordinate to an existing stable fragment source range;
  • records the matching fragment and its position on a supplied materialized strand;
  • returns bounded before/after fragment-id windows directly from that strand rather than repeatedly following next links;
  • refuses a context lookup when a stored hit position no longer points at the same fragment;
  • keeps duplicate textual occurrences distinct while also exposing unique matching fragment ids;
  • includes exact Unicode matching and a match that crosses a fragment boundary, so chunking does not redefine source search semantics.

For #54 the supplied strand is the source's document-order strand. The Strand type itself remains source-agnostic, preserving #52's requirement that other strands may cross source-document boundaries.

The smoke fixture uses synthetic text and the known-reading Sherlock fixture identity; no copyrighted source text is added. The richer alias/entity/theme/classification/interpretation layers described in #54 remain out of scope.

This follows the fragment/link/strand architecture described in #52: stable fragment identities and source coordinates are durable semantics; the document-order strand is the cheap contiguous traversal representation.

@isomorphisms
isomorphisms merged commit d94d350 into main Sep 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant