Skip to content

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

Closed

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

  1. added
    enhancement
    on Aug 23, 2026
  2. claude commented on Aug 23, 2026

    @claude
    Contributor

    Claude finished @phernandez's task in 26s —— View job


    Triage

    Type: Enhancement — new opt-in markdown syntax to disambiguate relation-shaped bullets, not a defect.

    Component: Markdown/relation parsing (src/basic_memory/markdown/) — the parser that currently treats a single token before a wikilink as an explicit relation type. Not Cloud-specific (component label: none).

    Priority: Medium — no breakage; it's an authoring escape hatch that closes out the ambiguity left after the #1260 fix landed in #1291. Useful but not urgent.

    Complexity: Medium — requires recognizing an exact terminal #bm:links_to token (with trailing-whitespace tolerance) during relation parsing, forcing every wikilink on that line to links_to instead of the leading-token relation type, while ensuring the directive itself is stripped from tag/observation/indexed content and preserved verbatim in the canonical Markdown source. Touches the same parsing path modified by #1291, so should account for interaction with the existing prose-tail fallback logic there.

    No duplicate open issues found (only the related, closed root-cause issue #1260 and its follow-up fix in #1291, both referenced in this issue already). The proposed syntax and acceptance criteria are clear and self-contained — no clarifying questions needed before someone picks this up.

  3. added this to the v0.23.1 milestone on Aug 25, 2026
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

    enhancement

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions