gortiz opened a new pull request, #20275:
URL: https://github.com/apache/pinot/pull/20275

   ## Summary
   
   This PR adds developer documentation under `docs/dev`. The pages explain how 
Pinot works internally. They are for new contributors and for coding agents 
that read the raw Markdown in a checkout. The site is built with 
[Zensical](https://zensical.org), but the Markdown files are the source of 
truth.
   
   The first topic is query routing: how the broker selects segments and 
servers, and how the multi-stage engine (MSE) assigns workers to stages.
   
   This PR replaces 
[apache/pinot#14346](https://github.com/apache/pinot/pull/14346). Most of the 
technical facts in that PR are now stale, so the content is written again from 
the current code.
   
   ## Why
   
   - New contributors have no in-repo description of the internals. The user 
documentation describes how to use Pinot, not how it works.
   - Coding agents read the repository directly. A short, correct page with the 
class names saves them a large code search, and it stops them from guessing.
   - A wrong page is worse than no page. For this reason, each page records the 
commit at which it was compared with the code (`verified_at`), and a skill 
describes how to verify a page again.
   
   ## What changes
   
   | Path | Change |
   |---|---|
   | `docs/dev/index.md`, `glossary.md` | Entry page and glossary. The glossary 
fixes one term for each concept, for example MSE and SSE. |
   | `docs/dev/contributing-to-dev-docs.md` | Page template, allowed Markdown 
features, rules to keep pages correct, writing style, build commands. |
   | `docs/dev/routing/index.md` | Overview of routing: cached state versus 
per-query work, and the SSE flow. |
   | `docs/dev/routing/routing-table.md` | `BaseBrokerRoutingManager` and the 
routing entry: events, pruners, instance selectors, selection modes, time 
boundary. |
   | `docs/dev/routing/mse-worker-assignment.md` | 
`WorkerManager.assignWorkers`: leaf stages (non-partitioned, partitioned, 
replicated), intermediate stages, determinism, query options. |
   | `zensical.toml` | Site configuration. |
   | `.github/workflows/pinot_dev_docs.yml` | Runs `zensical build --strict` on 
pull requests that change the docs. The build fails on broken links and 
anchors. |
   | `kb/skills/verify-dev-doc.md`, `.claude/skills/verify-dev-doc/SKILL.md` | 
Procedure to compare a page with the code and update `verified_at`. |
   | `AGENTS.md`, `CLAUDE.md` | A table that sends agents from a topic to its 
page. |
   | `pom.xml` | Excludes `docs/dev/**` from the license check, like `kb/**`. A 
page must start with YAML front matter. |
   | `.gitignore` | Ignores the `site/` build output. |
   
   ## How the pages are written
   
   Each page has the same structure, so that a reader (human or agent) knows 
where to look:
   
   ```mermaid
   flowchart LR
     FM[Front matter<br/>summary, key_classes, verified_at] --> TLDR[TL;DR] --> 
D[Diagram<br/>+ same content as a list] --> C[Code and configs] --> 
I[Invariants] --> G[Gotchas]
   ```
   
   - The `summary` field in the front matter lets an agent decide if it needs 
the page without reading it.
   - Each mermaid diagram is followed by the same content as a list or table. A 
reader that cannot render the diagram loses nothing.
   - The site enables only features that render the same on GitHub and in a 
text editor. Admonitions, snippets, content tabs, and abbreviation tooltips are 
not allowed.
   - `docs/dev` describes how Pinot works. `kb/` describes how to do a task. 
The pages link to each other and do not copy content.
   
   ## How to view it
   
   ```bash
   # With uv
   uvx zensical==0.1.1 serve
   # With Docker
   docker run --rm -it -p 8000:8000 -v "$(pwd)":/docs zensical/zensical:0.1.1
   ```
   
   Then open <http://localhost:8000>. GitHub also renders the pages, including 
the diagrams.
   
   ## Notes for reviewers
   
   - This PR changes no code. The routing pages state some behavior that can 
surprise readers. For example, a partitioned MSE leaf stage does not use the 
instance selector. These statements describe the current code. They do not 
propose changes.
   - The Zensical version is pinned to `0.1.1` in three places: the workflow, 
`zensical.toml`, and the contributing page.
   - The CI job does not publish the site.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to