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
54 changes: 54 additions & 0 deletions .github/workflows/atlas-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: atlas docs

# CI tier policy: see .github/ci-policy.md

# Build the atlas book (#13251): pkgs/atlas-search/book.toml +
# pkgs/atlas-search/book, rendered by the flake output .#atlas-docs
# (pkgs/atlas-search/docs.nix) — the same `nix build` locally and in
# CI, mirroring the fleet book's build job in fleet-docs.yml.
#
# This workflow only builds; it never deploys. A repository has
# exactly one GitHub Pages site and every Pages deployment replaces
# the whole site, so the atlas book is deployed by the mcpx-docs
# workflow's deploy job, staged under atlas/ with siteUrl
# "/code/atlas/" — an atlas-only deploy from here would wipe the
# mcpx and fleet books (and vice versa). See the book's "Deploying
# this book" chapter:
# pkgs/atlas-search/book/operations/deploying-this-book.md.

on:
push:
branches: [main]
workflow_dispatch:

permissions:
contents: read

jobs:
build:
name: "build: nix build .#atlas-docs"
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v7

- uses: DeterminateSystems/nix-installer-action@3138316df39ed29be04236d7ffc686fa525866aa # v23

- uses: DeterminateSystems/magic-nix-cache-action@84c0677f58dcedf3b91f8223ce36a9ea5b3c84b7 # v15
continue-on-error: true
with:
# Same cache posture as mcpx-docs.yml: no FlakeHub, the
# GitHub Actions cache is the cache.
use-flakehub: false
use-gha-cache: true

- name: Nix build
run: nix build .#atlas-docs --print-build-logs

# The nix result is a symlink into the store; copy it
# dereferenced so the staged tree is a plain static site.
- name: Stage site
run: |
rm -rf site
cp -rL result site
test -f site/index.html
26 changes: 26 additions & 0 deletions .github/workflows/mcpx-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,32 @@ jobs:
cp -rL result-fleet-docs site/fleet
test -f site/fleet/index.html

# The atlas book (#13251, pkgs/atlas-search/book) shares this
# repository's single Pages site the same way: built with its
# own siteUrl and staged under atlas/ here, in the same deploy
# — a separate atlas-only deploy would wipe the mcpx and fleet
# books. Its build-only workflow is atlas-docs.yml; see the
# book's "Deploying this book" chapter
# (pkgs/atlas-search/book/operations/deploying-this-book.md).
- name: Nix build (atlas book, siteUrl /code/atlas/)
run: |
# Intentional: the single-quoted string in this block is a Nix expression
# evaluated by nix, not the shell -- ${builtins.currentSystem} in it is
# Nix's, and letting the shell expand it would break the build.
# shellcheck disable=SC2016
nix build --impure --print-build-logs --expr \
'(builtins.getFlake (toString ./.)).packages.${builtins.currentSystem}.atlas-docs.override { siteUrl = "/code/atlas/"; }' \
--out-link result-atlas-docs

- name: Stage atlas book into site/atlas
run: |
rm -rf site/atlas
# site/ is a copy of a Nix store path: its directories are
# read-only, so make the root writable before adding atlas/.
chmod u+w site
cp -rL result-atlas-docs site/atlas
test -f site/atlas/index.html

- uses: actions/configure-pages@v6

- uses: actions/upload-pages-artifact@v5
Expand Down
2 changes: 2 additions & 0 deletions lib/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,7 @@ let
genericPythonRuntime = pkgs.callPackage ../pkgs/generic-containers/python-runtime.nix { };
mcpxDocs = pkgs.callPackage ../pkgs/mcpx/docs.nix { };
fleetDocs = pkgs.callPackage ../pkgs/fleet/docs.nix { };
atlasDocs = pkgs.callPackage ../pkgs/atlas-search/docs.nix { };
mcpxRealServers = pkgs.callPackage ../pkgs/mcpx/real-servers.nix { };
idMailDeploy = pkgs.callPackage ../nixos/services/id-mail/worker/deploy.nix { };
pkarrDeploy = pkgs.callPackage ../pkgs/pkarr-worker/deploy.nix {
Expand Down Expand Up @@ -791,6 +792,7 @@ let
;
mcpx-docs = mcpxDocs;
fleet-docs = fleetDocs;
atlas-docs = atlasDocs;
mcpx-real-servers = mcpxRealServers;
mcpx-container = mcpxContainer;
identity-image = identityImage;
Expand Down
96 changes: 96 additions & 0 deletions pkgs/atlas-search/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# atlas-search

Atlas is a unified search index over every corpus Drew produces:
provenance-first storage, tiered sensitivity, and hybrid (full-text +
vector) retrieval. This package is the whole system in one workspace —
the retrieval engine, the command-line tools, the laptop service, and
the Cloudflare Worker that fronts it for hosted clients.

Program epic: #8983. Design of record:
`doc/2026-11-04T08-07-13Z_design_atlas_binary_service/` in the
repository-root `doc/` archive.

## The book

[`book/`](book/) (mdBook sources, [`book.toml`](book.toml) at this
package's root) is the complete, self-contained reference for the
system — every command, flag, default, schema, protocol and
operational procedure, plus the forward design. It is published at
https://developing-today.github.io/code/atlas/ and builds with
`nix build .#atlas-docs`. Start there; this README is only the
package's front door.

## Layout

- `crates/atlas-embed` — the embedding library (Snowflake
arctic-embed-m-v2.0, native ONNX, parity-certified against the
Python reference).
- `crates/atlas-core` — the engine: corpus stores, staging and
promotion, classification, retrieval, evaluation, feedback.
- `crates/atlas-proto` — the wire contract shared by the CLI, the
service and the Worker (including `query-parameters-v1.json`, the
defaults contract).
- `crates/atlas-search` — the binaries: `atlas-search` (search,
get-chunk, serve, init, fetch-model, traces, feedback), `atlas-stage`,
`atlas-classify`, `atlas-eval`, `atlas-sweep`,
`atlas-github-comments`.
- `worker/` — the Cloudflare Worker: the hosted REST API and the
Atlas MCP server, with a per-query Durable Object cache and a D1
hot-cache tier.
- `atlas_search.py` — the Python reference implementation the Rust
was certified against; kept for parity.
- `eval/`, `schema/`, `tools/`, `fixtures/`, `test-vectors/` — the
evaluation programme, the staging/gate schemas, and the operator
tools.
- `docs/` — package-local design notes. The book supersedes these
for reference purposes; they remain as design records.

## Build and run

This package is a self-contained workspace on the pkgs/id pattern,
with its own flake:

```sh
nix build path:./pkgs/atlas-search # the packaged binaries
nix develop path:./pkgs/atlas-search # the pinned toolchain shell
```

ONNX Runtime is vendored in-tree (`onnxruntime/`) and loaded
dynamically; it is never downloaded at build or run time.

The corpus itself lives outside this repo, on the laptop
(`~/atlas/`), and is never committed. Secrets are resolved by name
through the fleet secrets broker; no credential is stored in this
tree.

## Operator and contributor contract (DOC-01)

The contract with the humans and agents who operate and change
Atlas, in the shape of the fleet package's DOC-01 (#10728):

- **The surface is the code.** The binaries' parsers, the service's
route table, the Worker's `mcp.ts` tool schemas and
`query-parameters-v1.json` are the authority on what Atlas can do.
Documentation — this README, `docs/`, and the book — must not
present a designed spelling as shipped. Where a doc and the code
disagree, the code wins and the disagreement is filed as an issue
in the same pass it is found.
- **The book is part of the same change.** Any change to a command,
a flag, a default, a config key, an MCP tool, a REST route, a
schema, the embedding model, or an operational procedure updates
the matching chapter of [`book/`](book/) in the same change. The
rule is stated for readers in the book's own "Keeping this book
current" chapter. `create-missing = false` in `book.toml` makes a
missing chapter a build failure, never a stub, and the
`atlas-docs.yml` workflow builds `.#atlas-docs` on `main` so a
broken chapter fails by name.
- **Sensitivity is a boundary, not a convention.** Corpus tiers
(public / internal / secret) and client ceilings (shareable <
personal < local-only < secret-bearing) are enforced server-side,
in the retrieval layer. No change may move enforcement into client
goodwill, send secret-tier text to a hosted embedder or reranker,
or reproduce secret-tier content in docs, issues or logs.
- **Model changes are migrations.** A new embedding model means a
new model-tagged vector space, a shadow index, and a golden-set
evaluation; cutover happens on the eval result, not on completion
(see the book's "Change the embedding model" chapter).
18 changes: 18 additions & 0 deletions pkgs/atlas-search/book.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# mdBook configuration for the atlas book (#13251).
# The book root is pkgs/atlas-search itself so the sources stay next to
# the system they document: plain markdown under book/, readable on
# GitHub exactly as written, and rendered as a book via the
# .#atlas-docs flake output (pkgs/atlas-search/docs.nix).
[book]
title = "atlas"
authors = ["developing-today"]
language = "en"
src = "book"

[build]
build-dir = "rendered"
# Every chapter in SUMMARY.md must exist on disk; never invent stubs.
create-missing = false

[output.html]
git-repository-url = "https://github.com/developing-today/code"
69 changes: 69 additions & 0 deletions pkgs/atlas-search/book/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Summary

<!-- id: book-summary since: pre-release -->

- [atlas](index.md)

- [Installation and provisioning](getting-started/installation.md)
- [Quickstart](getting-started/quickstart.md)
- [The shape of the system](getting-started/shape.md)

- [Architecture](concepts/architecture.md)
- [The corpus: provenance and content addressing](concepts/corpus-and-provenance.md)
- [Sensitivity tiers and client ceilings](concepts/sensitivity.md)
- [Embeddings: Snowflake Arctic and the parity contract](concepts/embeddings.md)
- [Retrieval: hybrid full-text and vector search](concepts/retrieval.md)
- [Ingest today: staging, classification, promotion](concepts/ingest.md)
- [The service and the Worker](concepts/service-and-worker.md)
- [Consumers: fleet, agents, memory and ID](concepts/consumers.md)
- [Evaluation: golden sets and gates](concepts/evaluation.md)

- [atlas-search: search and get-chunk](reference/atlas-search.md)
- [atlas-search: serve, init, fetch-model, traces and feedback](reference/atlas-search-admin.md)
- [atlas-stage](reference/atlas-stage.md)
- [atlas-classify](reference/atlas-classify.md)
- [atlas-eval](reference/atlas-eval.md)
- [atlas-sweep](reference/atlas-sweep.md)
- [atlas-github-comments](reference/atlas-github-comments.md)
- [fleet search and fleet serve search](reference/fleet-search.md)
- [The service HTTP API](reference/service-api.md)
- [The Worker HTTP API](reference/worker-api.md)
- [The Atlas MCP server](reference/mcp.md)
- [Configuration and environment](reference/configuration.md)
- [Data stores and schemas](reference/data-stores.md)
- [atlas_search.py: the Python reference implementation](reference/python-implementation.md)

- [The crates](library/crates.md)
- [atlas-core: the engine as a library](library/atlas-core.md)
- [atlas-embed: embeddings as a library](library/atlas-embed.md)
- [atlas-proto: the wire contract](library/atlas-proto.md)

- [Tutorial: search the corpus three ways](tutorials/search-the-corpus.md)
- [Tutorial: stage, classify and promote a source](tutorials/stage-and-promote-a-source.md)
- [Tutorial: give an agent the Atlas MCP server](tutorials/wire-an-mcp-client.md)
- [Tutorial: run the golden set and read a gate](tutorials/run-an-evaluation.md)

- [Design: automatic ingest of all sources](design/automatic-ingest.md)
- [Design: query planning](design/query-planning.md)
- [Design: layered search characteristics on Snowflake](design/layered-search.md)
- [Design: the reranking stage](design/reranking.md)
- [Design: the single-user recommender](design/recommender.md)
- [Design: search integration for fleet and ID](design/fleet-and-id-integration.md)
- [Design: MCP and programmatic access, next steps](design/access-evolution.md)
- [Design: the standing evaluation programme](design/evaluation-programme.md)
- [Roadmap and issue map](design/roadmap-and-issue-map.md)

- [Repository layout](development/layout.md)
- [Building and testing](development/building.md)
- [Add a command or a tool](development/add-a-verb.md)
- [Add an ingest source](development/add-a-source.md)
- [Change the embedding model](development/change-the-model.md)
- [Release and rollout](development/release-and-rollout.md)
- [Keeping this book current](development/keeping-this-book-current.md)

- [Running the service and the Worker](operations/services.md)
- [Backup, restore and the census](operations/backup-and-census.md)
- [Troubleshooting](operations/troubleshooting.md)
- [Deploying this book](operations/deploying-this-book.md)
- [FAQ](operations/faq.md)
- [Glossary](operations/glossary.md)
Loading