Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,20 @@ A unified `research-toolkit` CLI (`scripts/cli.py`,
`build-dashboard`, `freshness`, `export`, `resume-gather`, `compose-kg`, …) so
the chain can be run by hand without `python scripts/<x>.py` per stage.

**Auxiliary producer (off the linear chain):**

| Producer | Kind | Consumes | Primary artifact | Verified by |
|---|---|---|---|---|
| `scripts/emit_bibtex.py` (`emit-bibtex`) | producer | `bib_ledger.yml` + cache | a biblatex `.bib` | `validators/bibtex_out.py` |

`emit-bibtex` is a deterministic ledger→BibTeX transform for manuscript
authoring, not a gated pipeline stage. The ledger `authors` field is a display
string, so it reconstructs real author lists from the cached arXiv Highwire
`citation_author` tags (the same bytes the excerpt anchors point into), falling
back to a live arXiv Atom lookup (re-cached, so still anchored) and then to the
ledger display string (flagged on stderr). It escapes `& % # _ $` only — never
braces (that destroys BibTeX brace-protection).

## What is agent-authored vs deterministic

| Decision | Who makes it | Why |
Expand Down
5 changes: 4 additions & 1 deletion scripts/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import sys
from collections.abc import Callable
from pathlib import Path
from typing import TextIO

if __package__ in (None, ""):
sys.path.insert(0, str(Path(__file__).resolve().parent.parent))
Expand All @@ -47,6 +48,7 @@
"backlog-stamp": ("scripts.backlog_stamp", "main", SHAPE_FULL),
"resume-gather": ("scripts.resume_gather_from_cache", "main", SHAPE_SLICED),
"compose-kg": ("scripts.compose_cross_project_kg", "main", SHAPE_SLICED),
"emit-bibtex": ("scripts.emit_bibtex", "main", SHAPE_SLICED),
}

# One-line help shown by ``research-toolkit --help`` (no module import needed).
Expand All @@ -62,6 +64,7 @@
"backlog-stamp": "Stamp a topic_backlog.yml entry as handed off / done.",
"resume-gather": "Rebuild a sources-JSON skeleton from the content-addressed cache.",
"compose-kg": "Merge per-project claim graphs into a cross-project KG snapshot.",
"emit-bibtex": "Emit a biblatex .bib from bib_ledger.yml (authors from cached Highwire tags).",
}


Expand Down Expand Up @@ -104,7 +107,7 @@ def _dispatch(name: str, rest: list[str]) -> int:
return code if isinstance(code, int) else 1


def _print_top_help(stream: object) -> None:
def _print_top_help(stream: TextIO) -> None:
print("usage: research-toolkit <subcommand> [args...]", file=stream)
print("", file=stream)
print("Unified entry point for the research_toolkit pipeline.", file=stream)
Expand Down
Loading