diff --git a/src/groundrecall/assistant_export.py b/src/groundrecall/assistant_export.py index da26719..bf57358 100644 --- a/src/groundrecall/assistant_export.py +++ b/src/groundrecall/assistant_export.py @@ -5,6 +5,7 @@ import json from pathlib import Path from typing import Any +import groundrecall.assistants # noqa: F401 from .assistants.base import get_assistant_adapter from .query import build_query_bundle_for_concept from .store import GroundRecallStore diff --git a/src/groundrecall/assistants/__init__.py b/src/groundrecall/assistants/__init__.py index 3ce55a6..1cd9ff0 100644 --- a/src/groundrecall/assistants/__init__.py +++ b/src/groundrecall/assistants/__init__.py @@ -1,2 +1,9 @@ from __future__ import annotations +from .base import get_assistant_adapter, list_assistant_adapters + +# Import concrete adapters so CLI entry points can resolve them by name. +from . import claude_code as _claude_code # noqa: F401 +from . import codex as _codex # noqa: F401 + +__all__ = ["get_assistant_adapter", "list_assistant_adapters"] diff --git a/src/groundrecall/groundrecall_source_adapters/doclift_bundle.py b/src/groundrecall/groundrecall_source_adapters/doclift_bundle.py index 22cbf5c..7ee0926 100755 --- a/src/groundrecall/groundrecall_source_adapters/doclift_bundle.py +++ b/src/groundrecall/groundrecall_source_adapters/doclift_bundle.py @@ -43,6 +43,11 @@ class DocliftBundleSourceAdapter: def build_rows(self, context, sources: list[DiscoveredImportSource]) -> StructuredImportRows | None: base = Path(context.source_root) + if not self.detect(base) and sources: + for candidate in [sources[0].path.parent, *sources[0].path.parents]: + if self.detect(candidate): + base = candidate + break manifest_path = base / "manifest.json" if not manifest_path.exists(): return None diff --git a/src/groundrecall/ingest.py b/src/groundrecall/ingest.py index feec996..942d508 100644 --- a/src/groundrecall/ingest.py +++ b/src/groundrecall/ingest.py @@ -56,7 +56,9 @@ def _default_import_id(source_root: Path) -> str: def _portable_source_root_ref(source_path: Path, output_root: Path) -> tuple[str, str]: anchor = output_root.resolve().parent if source_path.is_relative_to(anchor): - return source_path.relative_to(anchor).as_posix(), "output_root_parent_relative" + relative = source_path.relative_to(anchor).as_posix() + if relative != ".": + return relative, "output_root_parent_relative" return source_path.name, "source_label" diff --git a/src/groundrecall/review_export.py b/src/groundrecall/review_export.py index f0442ea..7cf6abd 100644 --- a/src/groundrecall/review_export.py +++ b/src/groundrecall/review_export.py @@ -418,7 +418,7 @@ def _build_import_review_payload(session: ReviewSession, import_dir: Path) -> di ], "concept_reviews": concept_reviews, "citation_reviews": [entry.model_dump() for entry in session.citation_reviews], - "bibliography": bibliography_summary_payload(manifest.get("source_root", "")), + "bibliography": bibliography_summary_payload(resolved_source_root), "citations": { "enabled": True, "provider": "citegeist" if artifact_citations and artifact_citations[0].get("citegeist_backends") else "none",