Material for working on this repository itself, as opposed to using it to draft content: test running, the full source layout, and known gaps. See README.md for the user-facing Quickstart/Configuration/ Architecture docs and DOCKER.md for running a container; DOCKER-DEVELOPER.md here is this repo's own record of how the two images are built and verified.
# Install pytest/pytest-cov into the same venv (run python-deps first)
bash scripts/install_full_pipeline.sh dev-deps
# Run the full suite with coverage, over every core (pytest-xdist)
.venv-full/bin/python -m pytest -n auto --cov --cov-report=term-missing
# Same, on a host without pandoc/TeX Live/poppler: the render tests skip,
# so opt out of the 100% bar (pyproject's fail_under) rather than lower it
.venv-full/bin/python -m pytest -n auto --cov --cov-report=term-missing \
--cov-fail-under=0
A test that runs past pyproject.toml's timeout (60 s, pytest-timeout)
fails with its stack. On Windows, where the plugin can only end the whole
worker, tests/timeouts.py interrupts the test and skips it, naming it in
the skip reason; one it cannot interrupt still ends the worker. CI lists
every such skip as a warning.
tests/ covers both the corpus layer and chitragupta/core/corpus/enrich/*.
The enrich group's dependencies (docling, chromadb, bertopic,
sentence-transformers) are mocked via sys.modules for fast, deterministic unit
tests, so the dev-deps group alone is not enough: the enrich group (bash scripts/install_full_pipeline.sh python-deps) must already be installed too,
since tests/core/corpus/test_bib_reader.py needs bibtexparser and the
chitragupta/core/corpus/enrich/ test modules need
docling/chromadb/bertopic/sentence-transformers.
One module is the deliberate exception.
tests/core/corpus/test_enrich_real_libraries.py drives the real chromadb through
build_index()/search(), and asks the real
sentence_transformers/bertopic classes whether they still accept the
keywords the fakes accept. The fakes are faithful enough that the
expensive failure is the day they quietly stop being; that module is what
notices. It does not download an embedding model (its own docstring says
why), so it stays as fast and as offline as the rest.
A handful of tests run real dependencies end to end rather than mocking
them, and skip automatically when the dependency is absent:
tests/core/review/test_feature_workflows.py and the TestRenderReal/
TestExtractTextReal classes elsewhere probe for the
pdftotext, pandoc and lualatex binaries on PATH (and
test_feature_workflows.py for pdflatex, to build a fixture PDF);
tests/core/corpus/test_enrich_real_libraries.py probes for an importable library
instead, which is the same idiom against a different kind of absence.
bench/ measures what a full docling parse of the bib corpus costs on
a given machine, and is deliberately kept out of tests/: it takes a couple of
hours, needs real PDFs and a GPU, and answers a "how long / what's the
bottleneck" question rather than a pass/fail one. It is excluded from the
release zip for the same reason tests/ is.
bench/bench/results/. Read its "Which sections are current" table
first: several early conclusions were overturned by later runs and
are kept, marked, rather than deletedWhat the measurements established, and what the code relies on:
docling parse is CPU-bound. A GPU alone buys little; turning OCR
off ([parser].ocr = false, the default) buys more, because OCR
competes for the same CPU the worker pool needs.cuda:0.worker_ceiling() clamps the pool size; bench/RESULTS.md records
what that clamp costs on the multi-GPU machine.Read bench/RESULTS.md's "Which sections are current" table before
quoting a number from it: several early conclusions were overturned by
later runs and are kept, marked, rather than deleted. bench/ exists so
that the next conclusion is measured too.
chitragupta.core.corpus.enrich.docling_parse.parse_corpus and python -m chitragupta.corpus sync both use
a worker pool when [parser].workers is above 1, and every start method
they can pick (forkserver or spawn; see [parser].start_method)
re-imports the calling program's __main__ in each worker. Any script of
your own that calls them must guard its top level:
if __name__ == "__main__":
main()
Without it, every worker re-runs the script on startup and the pool dies
with BrokenProcessPool. The chitragupta/enrich.py and
chitragupta/corpus.py shims are both guarded already; this only bites
ad-hoc scripts, and it bites immediately rather than subtly.
README.md the user-facing overview: what this is, the Quickstart, hardware sizing
bench/ parser measurement (dev-only, not shipped) -- see "Benchmarking the parser"
above; corpus.json/sample*.json are generated and gitignored, results/ is
committed evidence
bench_docling.py backend extraction timings, one process
sweep_sync.py the real `python -m chitragupta.corpus sync` swept over worker/GPU counts -- the harness
every pool-level figure must come from
run_parallel.py independent-process baseline; answers a different question to sweep_sync.py
make_corpus.py builds the gitignored work lists from your own bib file
repro_check.py compares two parses at three levels (bytes, passage spans, passage texts)
and self-checks its own detector on every run
SOUL.md one page: why this exists, the one invariant, what it refuses to become
AGENTS.md instructions for agents drafting *with* the pipeline -- the citekey
invariant, the four layers, retrieval
DEVELOPER-AGENTS.md instructions for agents changing *this repo* -- install notes, dev
process, commit/PR/release conventions
DEVELOPER.md this file -- test running, repo layout, open questions
DOCKER.md how do I run this in a container -- the toolchain image and the agent image
DOCKER-DEVELOPER.md how the toolchain and agent images are built and verified before a release
.github/ CI/release workflows, plus the issue and PR templates GitHub picks up
automatically and RELEASE_TEMPLATE.md (copied by hand)
docs/ reference docs that ship in the release zip -- everything except the
root-level ones above, which stay put because they're what a reader looks
for first. README.md's Documentation tables and mkdocs.yml's nav index
them. Every file here carries a status line on its third line,
`Status: **<kind>.**`, so a reader can tell what they are holding before
reading it -- one of:
tutorial. a lesson a reader follows start to finish
how-to. a procedure for a task the reader already has
reference. what exists and how to look it up
implemented. a built subsystem, described as built
reasoning document. why a decision went the way it did, kept
because the reasoning outlives the decision
measurements. numbers from a real run on a named machine
proposal. nothing here is built; the decision is open
A new document picks one of those rather than inventing an eighth. The
line carries no date: git records when a file was written and revised
Not every file here is on the documentation site: mkdocs.yml's
exclude_docs keeps proposals, reasoning documents, developer-only pages
and the research surveys in git and out of the site, and pages that link
to them use GitHub URLs
DIAGRAMS.md the workflow drawn fourteen ways (off the site; read on GitHub)
diagrams/ every fenced mermaid block under docs/ as standalone files: DIAGRAMS.md's
fourteen, and the ones marked `<!-- diagram: <name> -->` in other pages
*.mmd mermaid sources with a title line
svg/*.svg the browser export; pdf/*.pdf the vector export for papers and slides.
Exports only -- edit the fenced block, run scripts/render_diagrams.py
--sync (house theme + .mmd copy), then re-render, which writes both
svg/sources.json which .mmd fingerprint each svg/pdf pair was rendered from; pinned by a
test, as is every export's width (at most 920px, to read on the site)
images/ demo recording (svg, mp4, webm, gif), the README's topic-map still, and
the topic-graph screenshots under discovery/ (captured at 2x density)
figure-checks/ one page per `figure check` rule family, with faulty/fixed examples
writing-standards/ the element and genre files the drafting skills read as rules
book/ the step-by-step pages of the book tutorial
examples/ the committed sample project and harness examples (examples/README.md)
stylesheets/ mermaid.css, generated by render_diagrams.py --sync
logo.svg, logo-dark.svg the README banner, light and dark
LICENSE MIT
THIRD-PARTY-NOTICES.md every shipped file written elsewhere: where it is, upstream, licence and
copyright line; tests/test_third_party_notices.py fails on one it misses
licenses/ the licence texts THIRD-PARTY-NOTICES.md links to
assets/ data files the pipeline reads at runtime, tracked and shipped
csl/ieee.csl the CSL style pandoc formats citations with ([render].csl default).
Vendored byte-identical to the CSL project's own release (CC BY-SA 3.0)
so it can be re-fetched and diffed -- do not edit it in place; the one
attribute this project needs is injected into a temp copy at render
time (see assets/csl/README.md and render_output._collapsed_csl)
csl/README.md the vendoring policy, upstream URL and sha256
webapp/app/ the webapp build from frontend/: gitignored, but shipped in the wheel,
the sdist and the release zip (docs/PACKAGING.md)
schemas/ one JSON Schema per --json document and one parameter spec per command,
generated by scripts/gen_schemas.py from the core's types and the
parsers, and committed; never edit one (docs/CLI.md)
frontend/ the webapp's source: a Vue 3 + Vite app, its vitest tests and its
Puppeteer end-to-end test; never shipped (docs/PACKAGING.md).
src/api/generated/ is written from assets/schemas/ by
scripts/gen-api.mjs, and gitignored
.github/workflows/ ci.yml (on push/PR: test suite + coverage + uv lock --check on Linux and
Windows, the hook launchers, the lint job, the frontend job, the
webapp's end-to-end test, a Docker build and SonarQube),
commit-message.yml (checks a PR's squash-commit fence),
docs.yml (builds the documentation site on every PR, and publishes it on
every push to main, with no release needed) and release.yml
(on a vX.Y.0 tag: verifies tag matches pyproject.toml's version, builds
the webapp and scripts/release.py's zip, then the wheel and sdist;
publishes all three to a GitHub Release, and the wheel and sdist to
PyPI)
config.toml.example tracked template for the central config -- paths, parser backend, worker
count, embedding model. Copy to config.toml (gitignored, per-host) before
anything imports chitragupta.core.config; see docs/CONFIG.md
papers/ gitignored, per-host data -- not shipped in the repo
bibliography.bib BibTeX export -- source of truth for citekeys/metadata (config.toml's [bib].path default)
bibliography/ the export's companion attachment folder, referenced by each entry's file field
pyproject.toml PEP 621 project metadata -- a real, publishable package (name chitragupta-cli,
import package chitragupta, [build-system] = poetry-core, which decides the
files a wheel carries; docs/PACKAGING.md has the decision and the naming) +
uv/pytest/coverage tool config
uv.lock resolved dependency versions -- `uv lock` after editing a constraint
(re-resolves the whole graph in seconds; docs/UV-MIGRATION.md)
mkdocs.yml the documentation site published at prasad.talasila.in/chitragupta. `docs_dir: .`
on purpose: the site is this repository as it stands, so links between site
pages work unchanged and there is no staging step to keep in sync; a link to
a page in exclude_docs must be a GitHub URL. Built by
.github/workflows/docs.yml from pyproject.toml's optional `docs` extra
(`uv sync --extra docs`). Read its header before editing
chitragupta/ the package: the public entry points at the top level, every front end in
cli/, every module behind them in core/ (docs/ARCHITECTURE.md, "Where the
code lives")
__main__.py shim for the `chitragupta`/`cg` console scripts and `python -m chitragupta`,
whose code is cli/main.py
corpus.py, sync.py shims for `python -m chitragupta.corpus`, whose code is cli/corpus/, and for
the removed `chitragupta.sync`, which refuses with exit 64
draft.py shim for `python -m chitragupta.draft gate|dossier|retrieve|references|
render|...`, twelve verbs (see --help), whose code is cli/draft/
review.py, enrich.py, figure.py shims for `python -m chitragupta.review|enrich|figure`, whose code
is cli/review/, cli/enrich.py and cli/figure/
init.py, doctor.py, install.py shims for the package-level commands, whose code is
cli/init.py, cli/doctor.py and cli/install.py, over the core modules
of the same names (docs/PACKAGING.md)
webapp/ the loopback-only webapp (docs/SECURITY.md); serve.py refuses or starts the
server for cli/webapp.py
cli/ the command-line front ends: one module per verb, no `_cli` suffix and no
__main__ block
main.py the `chitragupta`/`cg` command tree: dispatches corpus, draft, review,
enrich, init, doctor, install, figure and the hidden webapp
command_help.py, help_format.py every layer's one-line help, read without importing the layers,
and the ClickParser every --help is laid out with
corpus/ the corpus layer's single entry point, `python -m chitragupta.corpus
sync|ledger|topics|discover`. Imports the verb it was given rather than both,
so asking for `ledger` never pays for sync's bibtexparser -- see
docs/ARCHITECTURE.md on why that one is not like the other dispatchers
sync.py orchestrates a sync over core/corpus/ -- the corpus layer's `sync` verb;
--remove-stale opts into deleting stale ledger rows (default: report only,
see docs/ZOTERO.md)
ledger.py the read-only `ledger` verb's parser and text; its views are
core/corpus/ledger_view.py's. No __main__ block, like sync.py
topics.py the read-only `topics` verb's parser and text, over core/corpus/seed_topics.py
discover.py the read-only `discover` verb's parser and text, over core/corpus/discover/
draft/ the drafting layer's single entry point; one module per verb with its own
parser (gate, dossier, retrieve, references, evidence, render, style, spec,
unit, registry, tldr, figures, diff), plus the book track's private
_book_run.py, _spec_lines.py and _registry_lines.py and dossier's
_dossier_*.py renderers. gate.py and its core import
only the standard library, so the gate runs under a bare python3
review/ the review layer's single entry point: one parser, eleven subcommands, each
wired to its aid's own build_parser()/run(): every aid has its module
here, over its core builder, with _emit.py printing it (verbatim's
four modes print through _verbatim_render.py) and _registry.py, the
one name->module map, keyed by review.AIDS.
No __main__ block of their own -- see docs/ARCHITECTURE.md on why a
layer's command surface stays one level deep
enrich.py the enrichment layer's entry point, `python -m chitragupta.enrich --stages โฆ`;
orchestrates the stages in core/corpus/enrich/, which carry no __main__
block of their own
figure/ `chitragupta figure sync|check|new|look`: the dispatcher's one parser, and
one module per verb with its subparser and text, over the builders in
core/figure/_commands.py and _look_command.py
webapp.py `chitragupta webapp`'s parser; imports chitragupta.webapp only inside main,
so parsing never loads the web stack
doctor.py, init.py, install.py the package commands' parsers and text, over the core modules
of the same names; install's child inherits the terminal
core/ every module behind the entry points, grouped by layer; the ones more
than one layer reads sit here directly
config.py every setting, as config.NAME; env var overrides
config_load.py the config.toml load and the typed getters config.py reads each setting through
config_enrich.py the [enrich]/[discover] knobs, re-exported by config.py as config.NAME
config_path.py whether a path lies inside content/, re-exported by config.py (docs/SECURITY.md)
version.py the installed distribution's version, for --version and the webapp's status
runlock.py one-writer-at-a-time lock over content/, held by `chitragupta.corpus sync` and
`chitragupta.enrich` -- the only two commands that write to it;
a dedicated sqlite file, so a killed holder releases it with no
staleness check and readers are never blocked
reference_entries.py citekey -> formatted IEEE entry from the ledger, and the refusal of a key it lacks;
shared by references.py, evidence_appendix.py and discover
overlap_index.py disk-cached word n-gram fingerprint index (content/overlap/) for
core/review/verbatim_check/'s overlap and scan modes -- one .fpr file per citekey plus
a merged, binary-searchable corpus-wide index.bin, both keyed by
(pdf_hash, parsed-file stat) so a re-run over an unchanged corpus costs no
re-fingerprinting. Read-only over the corpus layer, no writer lock
corpus/ the corpus layer (sync needs bibtexparser)
bib_reader.py parses bibliography.bib -- the only citekey source
ledger.py per-citekey status tracking (content/ledger.sqlite); find_stale/prune_missing
detect/remove rows for citekeys no longer in the bib file. Also persists each
entry's formatting-relevant BibTeX fields (bib_fields, JSON), so references.py
can build a full bibliography entry without reading the bib file itself
ledger_view.py `corpus ledger`'s five views of the ledger, as data; read-only, no lock
pdf_text/ PDF text extraction, dispatched to pdftotext/docling by config.PARSER; also the parse-quality guard
dedup.py advisory near-duplicate citekey detection (shared DOI/title), called from sync
reranker.py the cross-encoder loader, cached per model id; shared by enrich's search rerank
and discover's ladder, so neither imports the other's privates
discover/ `corpus discover`: the topic-graph walks, the HTML page and the offline app
enrich/ the enrichment layer (pyproject.toml's "enrich" extra), optional; its
entry point is cli/enrich.py
corpus.py the enrichment layer's view of the ledger -- one CorpusDoc per bib item,
so every enriched document is citable, keyed by its citekey
docling_parse.py, embed_index.py, topic_model.py, topic_seeding.py, topic_converge.py
draft/ the drafting layer (citation_gate/references need nothing)
retrieval.py BM25 search over the corpus layer, backed by a cached term-frequency index.
`search` ranks and returns a snippet -- the best-covering passage for the
query, and the same one every run; `evidence` (retrieve.py, beside the
`retrieve` verb's builders) reads more of one document when a snippet is
not enough to judge it. A lookup, not a stage: see docs/REJECTION.md for
the two-stage read that was built and withdrawn. `--log` records each
call's payload in the dossier
passages.py where a citekey's supporting text comes from (docling sidecar -> form-feed
pages -> pdftotext) and whether it may be quoted -- shared by the consumers
that need to point at part of a source rather than all of it
citation_gate.py hard citation-verification gate -- the drafting layer must pass this
dossier/ the working state behind a draft (reader, scope, kept evidence, rejected
candidates, steering, revision log) as Markdown under content/dossiers/,
mirroring the draft's path; plus tar.gz backup/restore. Read-only over the
corpus layer, never a gate -- see docs/DRAFT-ITERATION.md
references.py auto-generates a draft's "## References" section from its own cited citekeys,
as numbered IEEE entries ordered by first appearance -- the same order (and
so the same numbers) pandoc's citeproc assigns when the draft is rendered
render.py the `render` verb's builder: render_output's render, its figures' looks,
and every render failure raised as a refusal
render_output/ Pandoc/TeX Live rendering -- stdlib-only, no enrich group
needed, which is why it sits in the drafting layer and not in core/corpus/enrich/.
`--format md` on a Markdown draft skips pandoc entirely and emits
references.numbered_markdown's plain numbered copy instead
review/ the review layer -- one command, `python -m chitragupta.review <aid>`, eleven aids
__init__.py the layer's shared output contract -- report path (content/review/,
mirroring the draft), the "not a gate" banner, the header, and the
write-md-then-render routine all eleven aids use. No timestamp, so a
report diffs across revisions
citation_coverage.py `coverage` -- retrieval-candidates-vs-actually-cited report, not a gate
citation_provenance.py `provenance` -- what in each cited source supports the claim citing it,
not a gate (scores claims against passages.py's ladder; see
docs/CITATION-PROVENANCE.md)
synthesis.py `synthesis` -- how many sources each unit of the draft rests on, at the
unit its genre binds at (docs/WRITING-STANDARDS.md ยง11), not a gate
uncited_prose.py `uncited` -- which sentences carry no citation at all, the prose-side
question `coverage` does not answer. The one aid that reads no corpus
verbatim_check/ `verbatim` -- per-citekey overlap, whole-draft x whole-corpus scan, and
page-locating checks against sources
figure_layout/ `figure` -- a TikZ figure's own pre-flight defects (occlusion, chaotic
routing, illegible type, ...), not a gate -- see docs/TIKZ-STYLE.md
_blocks.py what a *block* is -- a table row, a list item, a heading -- in both
markups. Shared by provenance and uncited_prose; neither owns it
_aids.py each aid's builder by name, for a caller that runs an aid without its
command (agenda --baseline's refresh)
_claims.py which sentences of a draft carry a claim, and which are scaffolding.
Split from uncited_prose so the roadmap's C2 can share it
_units.py what a "unit" is per genre, and how each genre treats uncited prose --
the two per-genre policy tables, pinned against dossier.GENRES
_synthesis_render.py how a synthesis report reads; _uncited_render.py is the same for uncited
figure/ `chitragupta figure sync|check|new|look`, the figure-drawer toolkit
(docs/figure-checks/README.md)
scripts/ dev tooling only -- no layer entry point lives here
install_full_pipeline.sh single staged install path for host, Docker and CI: os-deps, python-deps,
dev-deps, all, plus the opt-in cpu-torch, gpu-torch, vale, actionlint, stix-two, frontend-deps
release.py bundles a distributable release/chitragupta-<version>.zip, dev files excluded
gen_schemas.py writes assets/schemas/ (`python -m scripts.gen_schemas`); a test fails
when the committed files differ from a fresh run
tests/ pytest suite -- unit tests per module + end-to-end feature tests (see "Running tests"),
mirroring the package: tests/core/<layer>/, tests/cli/<layer>/ and tests/webapp/;
tests of scripts/, hooks, skills and docs sit in tests/ itself, and tests/topic_app/
holds the topic app's node --test files
content/ generated, gitignored (regenerate with sync)
ledger.sqlite, parsed/<citekey>.txt, drafts/, dossiers/, rendered/, review/,
retrieval_index.json, overlap/,
docling/, chroma/, topics.json, topic_seeds.json, topic_set.json,
topic_embed_cache.json (chitragupta/core/corpus/enrich/ outputs)
logs/ gitignored -- pipeline.log, rotated at 5MB x 5 backups. Level from
config.toml's [logging]; relocate with the LOGS_DIR env var
.claude/skills/ drafting layer: six that write a draft (survey-writer,
thesis-chapter-writer, textbook-chapter-writer, tutorial-writer,
deep-research, review-digest), three that revise one that already exists
(draft-reviser, corpus-reviser, agenda-reviser), one that
assembles accepted units into a book (book-assembler), and one
that draws a figure for the others (figure-drawer). Each has a
SKILL.md and, where it needs one, a references/ folder read on
demand. Plus demo-recorder, which records the feature demo, and
skill-bench, which measures a skill change on three harnesses:
developer-only, so no distribution ships them (docs/HARNESS.md)
.claude/skills-common/ references/ shared by several skills (the genre writers' shared steps,
a book skill's shared steps, collection scoping, critique, render and references, prose check,
verbatim scan, mathematical prose, figures/tables/equations in a
revision, digest copying), kept once for all harnesses
.claude/agents/ deep-research's subagents: deep-research-interviewer, deep-research-writer, peer-reviewer
.claude/hooks/ citation_gate_hook.py and style_check_hook.py -- PostToolUse hooks,
mechanically enforcing the citation gate and the prose style check on
every Write/Edit under content/drafts/*.md and *.tex (see AGENTS.md);
code_standards_hook.py reports C1/C2 on a .py write in a checkout;
session_start_hook.py checks the project can draft at all; draft_target.py
is the shared "which file did this tool call touch" helper both PostToolUse
hooks use; safe_path.py decides whether their children may import
chitragupta from the project root (checkout) or not (installed project);
patch_paths.py reads the drafts an apply_patch payload touches (Codex, OpenCode)
.claude/settings.json wires the four hooks above into PostToolUse/SessionStart
.agents/skills/ Codex's copy of each skill's SKILL.md (references stay in .claude/);
.codex/hooks.json runs the same hooks on apply_patch
.opencode/ OpenCode's copy of each SKILL.md (-opencode suffix), its gate plugin, and
opencode.json's deny list for the unsuffixed names (docs/HARNESS.md)
docker/ Dockerfile (TeX Live/Pandoc/uv), Dockerfile.claude + docker-compose.yml +
entrypoint.sh + rc-daemon.sh/.env + .env.example (the Claude Code agent container, cpu/gpu profiles)
-- CI builds docker/Dockerfile (cpu variant) but never runs it, and does not
build Dockerfile.claude; see DOCKER-DEVELOPER.md
A source paper's figures are a reading aid, never draft content.
AGENTS.md
states the rule and the one exception (the
verbatim digest); python -m chitragupta.draft figures <citekey> is the
supported way to look at them. Code here must not insert a source
image into content/drafts/.
python -m chitragupta.review provenance content/drafts/<slug>.md reports, for
every citation in a draft, what in the cited source supports it and
where, ordered worst match first. It writes
content/review/<the draft's path minus its suffix>.provenance.md plus
.tex/.pdf renders beside it. The report mirrors the draft's own place
under content/drafts/, the same rule rendered/ and dossiers/ follow
(config.mirrored_dir), and chitragupta/core/review/__init__.py owns that
contract for every review-layer command.
Run it directly rather than wrapping it in an enrichment stage: that
would have the enrichment layer importing the review layer, and would
make an advisory report wait on sync's write lock.
Advisory, not a gate, deliberately: matching is lexical, so it
cannot tell "the source doesn't say this" from "the source says it in
words I didn't recognise". citation_gate blocks because it checks
something exact (ledger membership); this reports because it doesn't.
Passage quality depends on what has been parsed. With the Docling stage
run, content/docling/<citekey>.passages.json supplies reading-ordered
paragraphs and the report quotes them. Without it, pdftotext output is
used and the report gives a page number without quoting: on a
two-column paper that text splices two columns onto every line, so any
excerpt would be a collage of two arguments.
Full design rationale, including the measurements behind those choices: docs/CITATION-PROVENANCE.md.
Running this pipeline on a schedule is supported: a rotating
logs/pipeline.log, shared by the corpus and enrichment layers (see
chitragupta/core/corpus/logging_setup.py), a pages/s throughput figure, exit
codes an unattended caller can branch on, and worked cron and systemd units in
docs/CLI.md, including the
absolute-interpreter-path detail that cron's minimal environment requires.
One blocker is left, and it is not a coding task. With no continuous
auto-export, bibliography.bib is a manual, point-in-time snapshot: a
scheduled sync re-reads whatever was last exported, so it keeps the
corpus consistent with the bib file but cannot keep the bib file
consistent with your reference manager. A schedule watching only its
mtime does nothing until a human re-exports. Closing that properly means
either a Zotero auto-export plugin (outside this repo) or accepting that
the export stays a deliberate human step.
content/topics.json has no drafting consumerchitragupta/core/corpus/enrich/topic_model.py writes it. Only corpus discover (chitragupta/core/corpus/discover/_data.py, for its c-TF-IDF terms)
and sync's residue report read it; no genre skill does. survey-writer groups
themes by judgement and says so explicitly ("With a small corpus there's no
BERTopic step"). That is defensible today: clustering is whole-corpus, so
assignments are not stable between runs, and on a small corpus every document
legitimately lands in the outlier topic. If it is ever wired in,
survey-writer's "Cluster by judgment" step is the seam, gated on the file
existing and on there being non--1 assignments, the same shape the existing
skills use to gate on content/chroma/.