Skip to content

Make the tool import existing ADR docs in a repository #504

Open

Description

@rikbosch

What problem does this solve?

Most repositories contain existing ADR documentation that might be of interest codebase-memory.

Proposed solution

It would be nice if the initial project onboarding would import those docs as well.

Alternatives considered

No response

Confirmations

  • I searched existing issues and this is not a duplicate.

Activity

  1. DeusData commented on Jun 18, 2026

    @DeusData
    Owner

    Thanks so much for this, @rikbosch 🙏 It fits naturally with the existing manage_adr tool, which already stores ADRs in the graph; we just don't bootstrap from what's already on disk yet. For a first cut we'd detect a conventional ADR location (docs/adr/, adr/, or MADR style NNNN_*.md filenames) and import them so get_architecture and manage_adr surface them.

    Two quick questions: (1) auto detect, or a config key like adr_path? (2) one time import on first index, or keep them in sync via the watcher? If you have a preferred ADR tool (MADR or log4brains), let us know which to target first. PRs very welcome!

  2. rikbosch commented on Jun 22, 2026

    @rikbosch
    Author

    Maybe a combination? Scavenge most user paths line docs/adr or other known paths like **/adr/*.md?

    I'd keep them in sync just like the rest of the code. The adr documents should be immutable, but they can be superseded by newer adr documents.

  3. DeusData commented on Jun 23, 2026

    @DeusData
    Owner

    This overlaps heavily with #507, which proposes the broader MADR multi-record support — including importing existing ADR records already present in a repo. Marking this duplicate and consolidating the discussion under #507 so the "import existing docs" piece is tracked as part of that work. Leaving this open for visibility for now. Thanks for raising it.

  4. added
    priority/backlogValuable contribution, lower scheduling urgency; review when maintainer capacity opens.
    and removed
    duplicateThis issue or pull request already exists
    on Jun 30, 2026
  5. DeusData commented on Jul 1, 2026

    @DeusData
    Owner

    Re-checked this under the stricter duplicate rule we are using now: this is related to #507, but it is not a 100% duplicate.

    #507 is the broader Markdown/MADR support track. This issue is specifically about importing existing ADR documents during onboarding/indexing, so I am keeping it open as a distinct acceptance criterion and removing the duplicate label. We should still implement it in coordination with #507.

  6. added this to the 0.9.2-rc milestone on Jul 8, 2026
  7. added
    parsing/qualityGraph extraction bugs, false positives, missing edges
    on Sep 5, 2026
  8. DeusData commented on Oct 25, 2026

    @DeusData
    Owner

    Thank you for clarifying that existing ADR files should stay synchronized and retain supersession history. Importing repository ADRs remains a distinct acceptance criterion coordinated with #507, rather than a duplicate to close. No additional reporter detail is needed to retain that scope. Sorry for the delay—this is waiting on maintainer follow-up, and I’ll follow up soon.

  9. datadevdavid commented on Nov 12, 2026

    @datadevdavid

    Data point from v0.12.1: the indexer already finds a repo's ADR files, but the ADR surfaces don't show them.

    Setup: a repo with 43 ADRs in docs/decisions/ (NNNN-title.md, plus amendments named NNNNa-title.md), alongside a README.md and a TEMPLATE.md.

    What the index has: all 43 files became ADR nodes, each with its Section children and SUPERSEDES edges between them. README.md and TEMPLATE.md were correctly skipped. So detection already works, even for a non-conventional path.

    What the ADR surfaces show: nothing. The graph UI's ADR workspace (?workspace=adr, GET /api/adr → {"has_adr":false}) and manage_adr (outline: headings: 0) read only project_summaries. That table is empty until someone writes the single summary document by hand. Users with a full docs/decisions/ folder open the ADR tab and see "no record yet".

    Suggested first cut for this issue: list the indexed ADR nodes (name, title, file, supersedes/superseded-by) in the ADR workspace and in the manage_adr outline, next to the hand-written summary or in place of it when the summary is empty. The nodes are already kept in sync by the watcher, which covers the "keep them in sync" point above without a separate import step.

    Two related gaps that make the existing nodes hard to find:

    1. Node names don't match how ADRs are cited. mdr_adr_id in src/pipeline/doc_links_md.c builds the name as ADR-%u, so 0032-….md becomes ADR-32, while documents and code cite it as ADR-0032. As a result, search_graph with name_pattern: "ADR-0032" returns nothing. Amendments like 0006a-….md fail the digits-only parse and fall back to the file stem, so they have no ADR-… name at all.
    2. ADR-NNNN mentions in code comments aren't linked. In the same repo, about 300 source files cite ADR-0NNN in comments. None of these becomes a MENTIONS edge to the ADR node, and none appears in doc_link_unresolved either. That leaves no graph path from code to the decision behind it.
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 requestparsing/qualityGraph extraction bugs, false positives, missing edgespriority/backlogValuable contribution, lower scheduling urgency; review when maintainer capacity opens.

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions