@alextis59/athena 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/docs/index.md DELETED
@@ -1,61 +0,0 @@
1
- # Documentation Index
2
-
3
- Start with the root files, then use the task-specific docs below.
4
-
5
- ## Agent Entry Points
6
-
7
- - [../AGENTS.md](../AGENTS.md): repository instructions for coding agents.
8
- - [../ARCHITECTURE.md](../ARCHITECTURE.md): current package, module, runtime,
9
- data-flow, and invariant map.
10
- - [../README.md](../README.md): user-facing install, command, config, MCP, and
11
- development quickstart.
12
-
13
- ## Product And Implementation
14
-
15
- - [agentic-rag-specifications.md](agentic-rag-specifications.md): product and
16
- engineering requirements for Athena's local-first documentation RAG behavior.
17
- - [agentic-rag-study.md](agentic-rag-study.md): source study behind the
18
- architecture choices.
19
- - [implementation-plan.md](implementation-plan.md): milestone checklist and
20
- historical proof notes for implementation work.
21
- - [mcp-integration.md](mcp-integration.md): OpenCode, Codex, and generic MCP
22
- setup, exposed read-only tools, and manual stdio smoke test.
23
- - [validation-corpus.md](validation-corpus.md): corpus layout, licensing,
24
- retrieval, cache, and coverage rules.
25
-
26
- ## Harness Operations
27
-
28
- - [SECURITY.md](SECURITY.md): security model, local-first boundaries, secrets,
29
- network, filesystem, MCP, and server exposure notes.
30
- - [QUALITY.md](QUALITY.md): validation ladder for docs, source changes,
31
- retrieval/parser changes, corpus changes, package release checks, and manual
32
- smoke tests.
33
- - [tech-debt-tracker.md](tech-debt-tracker.md): practical deferred work that is
34
- visible from the current code and docs.
35
- - [exec-plans/template.md](exec-plans/template.md): reusable plan template for
36
- larger changes.
37
-
38
- ## Decisions
39
-
40
- - [adr/0001-sqlite-driver.md](adr/0001-sqlite-driver.md): why Athena uses
41
- `better-sqlite3` for the local SQLite layer.
42
-
43
- ## Source Map
44
-
45
- - `src/cli/`: command parsing and dispatch.
46
- - `src/config/`: default config, config loading, validation, and
47
- `defineConfig()`.
48
- - `src/storage/`: `.athena/` paths, migrations, schema checks, and
49
- transactions.
50
- - `src/indexer/`: discovery, hashing, parsing, chunking, embedding, and index
51
- writes.
52
- - `src/parsers/`: text-like parsers, PDF parsing, chunking, and normalization.
53
- - `src/embeddings/`: local, Ollama, and remote embedding providers.
54
- - `src/retrieval/`: read-only retrieval tools and trace capture.
55
- - `src/agent/`: Athena-owned agent loop, model providers, tools, citations, and
56
- turn persistence.
57
- - `src/server/`: local HTTP UI/API server.
58
- - `src/ui/`: static web UI.
59
- - `src/mcp/`: stdio MCP server.
60
- - `scripts/`: corpus and evaluation commands.
61
- - `test/`: Node test suites and validation corpus fixtures.
@@ -1,227 +0,0 @@
1
- # Athena MCP Integration
2
-
3
- Athena exposes a read-only Model Context Protocol server through `athena mcp`.
4
- Use it when an external coding agent needs citation-aware project
5
- documentation retrieval without taking over Athena's own agent loop.
6
-
7
- ## Preconditions
8
-
9
- Build or install Athena, then index the documentation project that the external
10
- agent should read:
11
-
12
- ```sh
13
- npm run build
14
- node dist/cli/main.js index --root /absolute/path/to/project
15
- ```
16
-
17
- For an installed package, replace `node dist/cli/main.js` with `athena` or
18
- `npx @alextis59/athena`.
19
-
20
- ## Agent Provider Option
21
-
22
- OpenCode is the default external-agent provider. Use `--agent-provider codex`
23
- when the MCP server is configured for Codex:
24
-
25
- ```sh
26
- athena mcp --root /absolute/path/to/project --agent-provider codex
27
- ```
28
-
29
- The same choice can be made durable in `athena.config.ts`,
30
- `athena.config.mjs`, or `athena.config.json`:
31
-
32
- ```ts
33
- import { defineConfig } from "@alextis59/athena";
34
-
35
- export default defineConfig({
36
- agent: {
37
- provider: "codex"
38
- }
39
- });
40
- ```
41
-
42
- The option changes client-specific initialization guidance only. The MCP server
43
- continues to expose the same read-only retrieval tools for every provider.
44
-
45
- ## OpenCode
46
-
47
- OpenCode configures MCP servers under the `mcp` key. A local MCP entry uses
48
- `type: "local"` and a `command` array, with optional `cwd`, `environment`,
49
- `enabled`, and `timeout` fields.
50
-
51
- Development checkout example:
52
-
53
- ```json
54
- {
55
- "$schema": "https://opencode.ai/config.json",
56
- "mcp": {
57
- "athena": {
58
- "type": "local",
59
- "command": [
60
- "node",
61
- "/absolute/path/to/athena/dist/cli/main.js",
62
- "mcp",
63
- "--root",
64
- "."
65
- ],
66
- "cwd": "/absolute/path/to/project",
67
- "enabled": true,
68
- "timeout": 10000
69
- }
70
- }
71
- }
72
- ```
73
-
74
- Installed package example:
75
-
76
- ```json
77
- {
78
- "$schema": "https://opencode.ai/config.json",
79
- "mcp": {
80
- "athena": {
81
- "type": "local",
82
- "command": ["npx", "--yes", "@alextis59/athena", "mcp", "--root", "."],
83
- "cwd": "/absolute/path/to/project",
84
- "enabled": true,
85
- "timeout": 10000
86
- }
87
- }
88
- }
89
- ```
90
-
91
- After saving the config, run `opencode mcp list` to check that OpenCode can
92
- start the server and discover its tools.
93
-
94
- ## Codex
95
-
96
- Codex stores MCP servers in `config.toml`. You can configure Athena in the
97
- user-level `~/.codex/config.toml` or in a trusted project-scoped
98
- `.codex/config.toml`.
99
-
100
- Installed package example:
101
-
102
- ```toml
103
- [mcp_servers.athena]
104
- command = "npx"
105
- args = [
106
- "--yes",
107
- "@alextis59/athena",
108
- "mcp",
109
- "--root",
110
- ".",
111
- "--agent-provider",
112
- "codex"
113
- ]
114
- cwd = "/absolute/path/to/project"
115
- enabled = true
116
- startup_timeout_sec = 10
117
- tool_timeout_sec = 60
118
- ```
119
-
120
- Development checkout example:
121
-
122
- ```toml
123
- [mcp_servers.athena]
124
- command = "node"
125
- args = [
126
- "/absolute/path/to/athena/dist/cli/main.js",
127
- "mcp",
128
- "--root",
129
- ".",
130
- "--agent-provider",
131
- "codex"
132
- ]
133
- cwd = "/absolute/path/to/project"
134
- enabled = true
135
- startup_timeout_sec = 10
136
- tool_timeout_sec = 60
137
- ```
138
-
139
- After saving the config, start Codex in the project and use `/mcp` in the
140
- terminal UI to check that the `athena` server is connected.
141
-
142
- ## Exposed Tools
143
-
144
- Athena exposes only read-only retrieval tools:
145
-
146
- - `searchDocs`
147
- - `readSourceRange`
148
- - `readPdfSource`
149
- - `grepDocs`
150
- - `listDocs`
151
- - `relatedChunks`
152
-
153
- It does not expose write, edit, delete, shell, indexing, chat, or package
154
- management tools through MCP. External agents can retrieve context, but they do
155
- not own Athena's model loop. Use `athena ask` or the local UI when you want
156
- Athena itself to plan tool calls and validate final answer citations.
157
-
158
- ## Citation And Trace Shape
159
-
160
- MCP tool results are returned as text content containing JSON:
161
-
162
- ```json
163
- {
164
- "result": {},
165
- "trace": {
166
- "seenChunkIds": [],
167
- "readLocators": [],
168
- "searchScores": []
169
- }
170
- }
171
- ```
172
-
173
- `result` is the normal Athena retrieval payload. Search results include chunk
174
- IDs, paths, snippets, score details, and text or PDF locators. Source-read
175
- tools return exact line or PDF page/region locators.
176
-
177
- `trace` mirrors the runtime trace shape used by the UI and Athena's internal
178
- agent loop. Use it to inspect which chunks were surfaced, which source locators
179
- were read, and how retrieval scores were assigned during the MCP session.
180
-
181
- ## Manual Smoke Test
182
-
183
- From this repository, build and index a small fixture project:
184
-
185
- ```sh
186
- tmpdir="$(mktemp -d)"
187
- mkdir -p "$tmpdir/docs"
188
- cat > "$tmpdir/docs/admin-guide.md" <<'EOF'
189
- # Admin Guide
190
-
191
- ## Indexing
192
-
193
- Set `ATHENA_INDEX_BATCH_SIZE=64` before indexing large docsets.
194
- EOF
195
-
196
- npm run build
197
- node dist/cli/main.js index --root "$tmpdir" --json
198
- ```
199
-
200
- Then send a finite stdio MCP session:
201
-
202
- ```sh
203
- printf '%s\n' \
204
- '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"manual-smoke","version":"1.0.0"}}}' \
205
- '{"jsonrpc":"2.0","method":"notifications/initialized"}' \
206
- '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}' \
207
- '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"searchDocs","arguments":{"query":"ATHENA_INDEX_BATCH_SIZE","pathPrefix":"docs/"}}}' \
208
- '{"jsonrpc":"2.0","id":4,"method":"tools/call","params":{"name":"readSourceRange","arguments":{"path":"docs/admin-guide.md","startLine":3,"endLine":5}}}' \
209
- | node dist/cli/main.js mcp --root "$tmpdir"
210
- ```
211
-
212
- Expected output:
213
-
214
- - one `initialize` response with `serverInfo.name` set to `athena`;
215
- - one `tools/list` response with the six read-only retrieval tools;
216
- - one `searchDocs` response whose JSON text has
217
- `result[0].path == "docs/admin-guide.md"` and non-empty
218
- `trace.seenChunkIds`;
219
- - one `readSourceRange` response whose JSON text includes
220
- `ATHENA_INDEX_BATCH_SIZE` and a `trace.readLocators` entry for
221
- `docs/admin-guide.md`.
222
-
223
- ## References
224
-
225
- - [MCP 2025-03-26 transports](https://modelcontextprotocol.io/specification/2025-03-26/basic/transports)
226
- - [MCP 2025-03-26 tools](https://modelcontextprotocol.io/specification/2025-03-26/server/tools)
227
- - [OpenCode MCP servers](https://opencode.ai/docs/mcp-servers)
@@ -1,21 +0,0 @@
1
- # Tech Debt Tracker
2
-
3
- Track deferred work that is visible from the current implementation. Keep this
4
- file practical: each item should have a reason, a likely validation path, and a
5
- status.
6
-
7
- | Item | Context | Validation | Owner | Status |
8
- | --- | --- | --- | --- | --- |
9
- | Align chat provider docs and adapters | Config validation recognizes `openai`, `anthropic`, and `gemini` chat providers, but `createConfiguredModelProvider()` currently implements Ollama only after validation. Either add adapters or keep user docs explicit that non-Ollama chat adapters are not ready. | Provider tests plus `athena ask` smoke for each supported adapter. | TBD | Open |
10
- | Decide authenticated server posture before non-loopback use | The HTTP server is intentionally local and unauthenticated today. Binding `--host` to a non-loopback address should remain an operator-controlled advanced use until there is an authenticated mode. | Server tests for auth behavior if added; security doc update. | TBD | Open |
11
- | Evaluate query embedding parity for remote/provider-specific indexes | Indexed vectors can come from provider-specific embeddings. Retrieval currently builds query vectors inside the retrieval layer rather than routing the query through the configured embedding provider. Confirm whether this is acceptable for release quality or add provider-aware query embedding. | Retrieval/eval tests comparing hybrid, FTS-only, vector-only, and provider-backed query behavior. | TBD | Open |
12
- | Harden package smoke automation | Package readiness currently relies on manual tarball and `npx --package` smoke commands documented in `docs/QUALITY.md`. A script could reduce release mistakes while preserving the same checks. | New script plus tarball CLI smoke in a temp project. | TBD | Open |
13
- | Expand parser warning summaries | Doctor reports total parser warnings, while PDF warning detail is available in parser artifacts and retrieval responses. A future doctor view could summarize warning codes by source. | Doctor tests and fixture with repeated PDF warnings. | TBD | Open |
14
-
15
- ## Closing Criteria
16
-
17
- Close an item only after:
18
-
19
- - the implementation or documentation change lands;
20
- - the validation in the row passes;
21
- - related docs are updated when behavior or policy changes.
@@ -1,71 +0,0 @@
1
- # Athena Validation Corpus
2
-
3
- Date: 2026-07-03
4
-
5
- ## Purpose
6
-
7
- The validation corpus gives Athena realistic documents early in the
8
- implementation. It is used to validate discovery, parsing, chunking, retrieval,
9
- citations, PDF extraction, UI source previews, and later evaluation runs.
10
-
11
- ## Directory Layout
12
-
13
- - `test/corpus/manifest.json` is the locked corpus manifest.
14
- - `test/corpus/manifest.schema.json` documents the manifest shape.
15
- - `test/corpus/ground-truth.json` contains deterministic validation questions.
16
- - `test/corpus/synthetic/` contains committed synthetic controls.
17
- - `test/corpus/cache/` contains downloaded third-party artifacts and is ignored
18
- by git.
19
-
20
- The cache is intentionally outside `.athena/` so tests can distinguish the
21
- validation corpus from runtime indexes. The script still treats the cache as
22
- local runtime state, not source code.
23
-
24
- ## Licensing and Redistribution
25
-
26
- Synthetic controls are committed under this project's license-compatible test
27
- fixture policy and are marked `redistribution: "committed"`.
28
-
29
- Third-party documents are marked `redistribution: "download-only"`. Athena
30
- commits their URL, license metadata, retrieval date, expected size, and SHA-256
31
- hash, but it does not commit the downloaded artifacts. This avoids copying
32
- third-party documentation into the repository while keeping the validation set
33
- reproducible.
34
-
35
- ## Retrieval
36
-
37
- Download or refresh the corpus:
38
-
39
- ```bash
40
- npm run corpus:retrieve
41
- ```
42
-
43
- Verify an already-cached corpus without network access:
44
-
45
- ```bash
46
- npm run corpus:health
47
- ```
48
-
49
- The retrieval script refuses changed downloads. If an upstream document changes
50
- intentionally, refresh the cache, review the changed file, update the manifest
51
- hash and size in the same commit, and describe why the change is acceptable.
52
-
53
- ## Coverage
54
-
55
- The manifest covers:
56
-
57
- - Markdown README, API reference, and changelog samples;
58
- - MDX with imports, exports, and embedded JSX that must not execute;
59
- - plain text and extensionless documentation;
60
- - reStructuredText;
61
- - AsciiDoc;
62
- - HTML with navigation and visible documentation content;
63
- - born-digital PDF;
64
- - table-heavy PDF;
65
- - encrypted hard-PDF warning behavior;
66
- - synthetic exact-citation, ambiguous-heading, exact-symbol, semantic-only,
67
- hybrid-comparison, and stale-document controls.
68
-
69
- Every required document type has at least one ground-truth question. Negative
70
- questions require Athena to refuse or mark an answer unsupported when the corpus
71
- does not contain the requested fact.