Skip to content

Add a #bm:links_to directive for ambiguous relation-shaped bullets #1301

Description

@phernandez

Problem

Basic Memory intentionally treats a single token before a wikilink as an explicit relation type:

- Mother [[Target]]

That grammar is valid and cannot be distinguished reliably from a short prose label. Capitalization or vocabulary heuristics would be arbitrary and backward-incompatible.

PR #1291 fixed the actionable prose-tail bug from #1260: a line such as - Added [[Target]] to the roster now falls back to implicit links_to handling without dropping content or additional wikilinks. Authors still need an explicit escape hatch for the genuinely ambiguous no-tail form.

Proposed syntax

Reserve an exact terminal directive:

- Mother [[Target]] #bm:links_to

The directive means: preserve the line and its wikilinks, but treat every wikilink on this line as an implicit links_to edge rather than parsing the leading token as a relation type.

Expected behavior

  • Recognize only the exact #bm:links_to directive at the end of the line, allowing trailing whitespace.
  • Emit links_to for every wikilink on the line.
  • Do not expose the directive as a note tag, observation text, relation context, or indexed content.
  • Preserve the directive in the canonical Markdown source.
  • Leave explicit relations without the directive unchanged.
  • Do not introduce capitalization, language, or relation-vocabulary heuristics.

Examples

- Mother [[Alice]] #bm:links_to
- Mentions [[Alice]] and [[Bob]] #bm:links_to
- spouse_of [[Alice]]

The first line creates links_to [[Alice]]; the second creates links_to edges to both targets; the third remains an explicit spouse_of relation.

Acceptance tests

  • Ambiguous single-token prefix plus the directive falls back to links_to.
  • Multiple wikilinks on a directed line are all preserved as links_to.
  • The directive does not become a hashtag/tag or indexed text.
  • A normal explicit relation still retains its authored relation type.
  • Similar text that is not the exact terminal directive has no special behavior.

Follow-up to #1260 and #1291.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions