tools.read_own_docs module
Read the bot’s own documentation, architecture graphs, and recent history.
- async tools.read_own_docs.run(section='', **_kwargs)[source]
Return Stargazer’s own documentation for the requested section.
Entry point for the
read_own_docstool, letting the bot read its own architecture graphs, reference docs, and recent git history at runtime. With no section it returns the top-level self-doc overview (stargazer-docs.md);"list"enumerates the available sections;"commits"shows the latest git log; any other value is looked up in the module-level_SECTIONSmap and the corresponding doc file is read.Section docs are read via
_read_file()(async,aiofiles-backed), and"commits"shells out togit log --oneline -5throughsubprocess.runoffloaded withasyncio.to_threadso the event loop is not blocked. All paths are resolved relative to the repository root (_PROJECT_ROOT). Read-only: no Redis, knowledge-graph, LLM, or network access. This module-levelrunis discovered and dispatched by the tool runtime viatool_loader.py(getattr(module, "run")); no other in-repo callers.- Parameters:
section (
str) – Section selector — empty for the overview,"list"for the index,"commits"for git history, or a key from_SECTIONS. Case-insensitive and whitespace-trimmed.- Returns:
The requested document text, the section index, the recent commit list, or a human-readable error/”unknown section” message. Errors are returned as strings rather than raised.
- Return type: