Fixes found via use for server
This commit is contained in:
parent
836ad9c110
commit
1668a2b3a8
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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"]
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Reference in New Issue