YmerNode.References.Reference (Ymer Node v0.2.1)

Copy Markdown View Source

One row of the registry: a pointer naming where knowledge lives and when to look, never what it says. The rule that keeps it a pointer — the membrane — is stated in YmerNode.References.

Shape decisions:

  • The uri is both the identity and the deep link. A reference's source and fetch recipe are DERIVED from it at read time (YmerNode.References.Sources) and never stored, so accepting a script upgrades every reference pointing at the hosts it claims, retroactively — and un-accepting it downgrades them in the same moment.
  • fragment locates content within the target and is stored as "" when absent, never NULL, because SQLite treats NULLs as distinct in a unique index: a nullable fragment would let the same uri be added twice. The same uri with different fragments is legitimately two references — two sections of one page.
  • uri equality is byte-equality after a whitespace trim. There is no canonicalization: http and https, and a trailing slash, make distinct references. Near-duplicates are grooming's problem, and a canonicalizer would have to guess which of two spellings the user meant.
  • tags are free text, cast but never validated. The vocabulary is the user's, and it is the only thing binding a reference to anything else.
  • title and uri are required; title must clear a two-character floor and a 255-character ceiling. The ceiling is enforced here rather than only declared in the tool's JSON schema, which nothing checks at runtime.

search_text/1 is the keyword projection every find ranks against.

Summary

Functions

The keyword-search projection: title, description, fragment, uri and tags joined with newlines, skipping the empty ones.

Functions

changeset(reference, attrs)

search_text(reference)

The keyword-search projection: title, description, fragment, uri and tags joined with newlines, skipping the empty ones.

Every text field is in it deliberately, so a term carried only by the uri — an issue key, a page id — matches a reference whose prose never mentions it.