Skip to content

Enhancement: support opt-in typed inference for plain Markdown links #96

@Looted

Description

@Looted

Summary

Now that #93 is fixed, plain string Markdown frontmatter links are intentionally imported as generic relates_to edges.

That behavior looks correct and is now documented/tested.

This issue is a separate enhancement request: support an opt-in way to get typed relationships from concise Markdown link syntax, so repos that rely heavily on requirement/scenario/test/fact traceability do not have to use verbose typed objects everywhere.

Current behavior

Given:

---
id: REQ-001
title: Example requirement
status: open
links:
  - FACT-001
  - SCEN-001
  - TEST-001
---

kibi sync imports:

  • REQ-001 relates_to FACT-001
  • REQ-001 relates_to SCEN-001
  • REQ-001 relates_to TEST-001

That is now intentional and consistent with the current docs/tests/spec.

Problem

For repos using Kibi as a strict traceability layer, relates_to is often too weak.

To get precise edges today, authors must write the more verbose form:

links:
  - type: constrains
    target: FACT-001
  - type: specified_by
    target: SCEN-001
  - type: verified_by
    target: TEST-001

That works, but it is noticeably more tedious when maintaining a large number of requirement files.

Proposed enhancement

Add an opt-in mode or shorthand so concise Markdown links can still produce typed edges.

Examples of possible approaches:

Option A: config-driven typed inference

A config flag such as:

{
  "markdownLinks": {
    "inferTypedRelationships": true
  }
}

Then infer by source entity type + target ID prefix, e.g.:

  • req -> FACT-* => constrains
  • req -> SCEN-* => specified_by
  • req -> TEST-* => verified_by

Option B: shorthand string syntax

Allow strings like:

links:
  - constrains:FACT-001
  - specified_by:SCEN-001
  - verified_by:TEST-001

Option C: separate frontmatter fields

Allow concise typed fields such as:

specified_by:
  - SCEN-001
verified_by:
  - TEST-001
constrains:
  - FACT-001

Backward compatibility

I would not change the current default semantics of plain string links:.

The enhancement should preserve existing behavior by default and only produce typed edges when the repo explicitly opts in (or uses an explicit shorthand).

Why this helps

  • keeps current relates_to behavior stable
  • preserves simple authoring for casual repos
  • gives traceability-heavy repos a concise way to express typed edges
  • reduces boilerplate in requirement files
  • makes KB queries and validation more useful without forcing verbose frontmatter everywhere

Real-world motivation

I ran into this while rebuilding a fairly large Kibi corpus for another repo.

Once typed req->fact/scenario/test edges were present, the KB became much more useful for traceability and auditing. The only friction was that the authoring format in Markdown became much more verbose than the plain string links: form.

If helpful, I can provide a concrete before/after example from that repo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions