logseq-graph-living-atlas 0.1.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.
Files changed (41) hide show
  1. package/.env.example +29 -0
  2. package/CHANGELOG.md +38 -0
  3. package/CODE_OF_CONDUCT.md +33 -0
  4. package/CONTRIBUTING.md +116 -0
  5. package/GOVERNANCE.md +40 -0
  6. package/LICENSE +21 -0
  7. package/MAINTAINERS.md +34 -0
  8. package/README.md +370 -0
  9. package/ROADMAP.md +38 -0
  10. package/SECURITY.md +43 -0
  11. package/SUPPORT.md +31 -0
  12. package/dist/assets/AtlasCanvas-p-Pb_C3p.js +172 -0
  13. package/dist/assets/index-Cb0dgkF5.css +1 -0
  14. package/dist/assets/index-D-LUf-q7.js +12 -0
  15. package/dist/assets/three-DQCgX68K.js +3947 -0
  16. package/dist/index.html +13 -0
  17. package/docs/ADAPTERS.md +48 -0
  18. package/docs/API.md +145 -0
  19. package/docs/ARCHITECTURE.md +93 -0
  20. package/docs/CONCEPTS.md +62 -0
  21. package/docs/MCP.md +74 -0
  22. package/docs/RELEASE.md +65 -0
  23. package/docs/REPO_GUIDE.md +92 -0
  24. package/docs/TROUBLESHOOTING.md +138 -0
  25. package/docs/assets/living-atlas-demo.png +0 -0
  26. package/docs/assets/living-atlas-pathfinder.png +0 -0
  27. package/docs/assets/living-atlas-radar.png +0 -0
  28. package/docs/assets/living-atlas-source-detail.png +0 -0
  29. package/package.json +102 -0
  30. package/server/brain-service.mjs +201 -0
  31. package/server/contracts.mjs +346 -0
  32. package/server/fixture/create-fixture-graph.mjs +115 -0
  33. package/server/graph/pathfinding.mjs +155 -0
  34. package/server/graph/quality.mjs +11 -0
  35. package/server/graph/utils.mjs +25 -0
  36. package/server/graph-index.mjs +920 -0
  37. package/server/logseq/parser.mjs +121 -0
  38. package/server/logseq/source-adapter.mjs +147 -0
  39. package/server/redaction.mjs +89 -0
  40. package/server/service.mjs +777 -0
  41. package/server/source-adapter-contract.d.ts +46 -0
package/.env.example ADDED
@@ -0,0 +1,29 @@
1
+ # Copy to .env.local for local source runs:
2
+ # cp .env.example .env.local
3
+ #
4
+ # LOGSEQ_ROOT must point at the graph folder that contains pages/.
5
+ LOGSEQ_ROOT=/absolute/path/to/your/logseq/graph
6
+
7
+ # Local service port.
8
+ LIVING_ATLAS_PORT=8787
9
+
10
+ # Snapshot cache path. Leave empty to use the OS user cache directory.
11
+ LIVING_ATLAS_CACHE=
12
+
13
+ # Real graph reads are token-protected by default.
14
+ # Leave empty to let the CLI generate a one-time local session token.
15
+ LIVING_ATLAS_TOKEN=
16
+ LIVING_ATLAS_REQUIRE_TOKEN=1
17
+
18
+ # Fixture-only local development escape hatches.
19
+ LIVING_ATLAS_ALLOW_UNAUTHENTICATED_READ=0
20
+ LIVING_ATLAS_ALLOW_UNAUTHENTICATED_REINDEX=0
21
+
22
+ # Split frontend/API development. Example:
23
+ # LIVING_ATLAS_ALLOWED_ORIGINS=http://127.0.0.1:5177
24
+ LIVING_ATLAS_ALLOWED_ORIGINS=
25
+
26
+ # Diagnostics and ingest guardrails.
27
+ LIVING_ATLAS_DEBUG_PATHS=0
28
+ LIVING_ATLAS_MAX_FILES=250000
29
+ LIVING_ATLAS_MAX_FILE_BYTES=2097152
package/CHANGELOG.md ADDED
@@ -0,0 +1,38 @@
1
+ # Changelog
2
+
3
+ ## 0.1.0 - 2026-06-01
4
+
5
+ Initial public-ready package.
6
+
7
+ - Local-only Logseq markdown index service.
8
+ - Cinematic Three.js atlas UI with clusters, focus, pathfinding, timeline replay, connector radar, review flags, and local graph delta stream.
9
+ - Public fixture demo for install and UI smoke tests.
10
+ - Runtime API validators, cache envelope validation, and stale-cache rebuilds.
11
+ - Content-aware manifest fingerprints that invalidate cache/watch state even for same-size timestamp-preserving rewrites.
12
+ - 1k, 10k, and 100k synthetic scale evaluation.
13
+ - Configurable service-scale evaluation with normal 10k CI coverage and opt-in 100k disk/watch coverage.
14
+ - WebGL fallback panel for unsupported browsers.
15
+ - Optional token mode for all `/api/*` routes.
16
+ - Real graph CLI runs token-protect `/api/*` reads by default.
17
+ - Programmatic service factory reads are token-required by default unless unauthenticated local reads are explicit.
18
+ - Non-WebGL fallback that still exposes top regions, high-signal pages, and actionable atlas intelligence.
19
+ - Adaptive cinematic/balanced/safe renderer quality tiers for 1k, 10k, and 100k-scale graphs.
20
+ - Budgeted `/api/snapshot` defaults and no-store API responses for safer large/private graph reads.
21
+ - Stable graph-local review storage with an in-app local-data reset.
22
+ - New review flags store graph-scoped hashed node references instead of page names or source paths.
23
+ - Legacy review flags are sanitized during migration so browser storage no longer retains page names or source paths.
24
+ - Compact SSE graph deltas with change counts and sampled live events.
25
+ - Per-snapshot lookup indexes for search, focus, node detail, and pathfinding.
26
+ - Capped node-detail edge samples with full inbound/outbound totals for hub pages.
27
+ - Public source adapter contract and adapter authoring guide.
28
+ - Package-name CLI alias, CSP-protected static HTML, and public issue/support scaffolding.
29
+ - Maintainer, governance, and contribution-process docs for public review and release discipline.
30
+ - Fixture-generated README gallery covering overview, source detail, pathfinding, and connector radar.
31
+ - Keyboard-first mode switching, replay stepping, and search escape behavior.
32
+
33
+ Known limitations:
34
+
35
+ - Large graphs render a sampled overview; full 100k-node inspection requires focused slices.
36
+ - Timeline replay is based on current file mtimes, not a historical event log.
37
+ - The fallback renderer supports basic graph exploration, but the cinematic field still requires WebGL.
38
+ - The filesystem Logseq adapter is the only source adapter in this release.
@@ -0,0 +1,33 @@
1
+ # Code Of Conduct
2
+
3
+ Living Atlas follows the Contributor Covenant Code of Conduct, version 2.1.
4
+
5
+ ## Our Pledge
6
+
7
+ We pledge to make participation in this project a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
8
+
9
+ ## Standards
10
+
11
+ Examples of behavior that contributes to a positive environment include:
12
+
13
+ - using welcoming and inclusive language;
14
+ - respecting different viewpoints and experiences;
15
+ - accepting constructive feedback;
16
+ - focusing on what is best for the community;
17
+ - showing empathy toward other community members.
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ - sexualized language or imagery;
22
+ - insulting or derogatory comments;
23
+ - public or private harassment;
24
+ - publishing others' private information without explicit permission;
25
+ - conduct that would reasonably be considered inappropriate in a professional setting.
26
+
27
+ ## Enforcement
28
+
29
+ Report unacceptable behavior through the repository's private security or maintainer contact path when available. Maintainers may remove comments, close issues, or restrict participation for behavior that violates this code.
30
+
31
+ ## Attribution
32
+
33
+ This code is adapted from the Contributor Covenant, version 2.1, available at https://www.contributor-covenant.org/version/2/1/code_of_conduct.html.
@@ -0,0 +1,116 @@
1
+ # Contributing
2
+
3
+ ## Development
4
+
5
+ Use Node 20 or newer.
6
+
7
+ ```bash
8
+ npm install
9
+ npx playwright install chromium
10
+ npm run dev:api -- --root /absolute/path/to/logseq
11
+ npm run dev
12
+ ```
13
+
14
+ For real graph work, the API is token-protected by default. Either open the `#token=...` URL printed by `dev:api`, or set a known local token:
15
+
16
+ ```bash
17
+ LIVING_ATLAS_TOKEN=<random-local-token> npm run dev:api -- --root /absolute/path/to/logseq --allowed-origin http://127.0.0.1:5177
18
+ npm run dev
19
+ ```
20
+
21
+ Open `http://127.0.0.1:5177/#token=<random-local-token>`.
22
+
23
+ For a production-style local run:
24
+
25
+ ```bash
26
+ npm run build
27
+ npm run serve -- --root /absolute/path/to/logseq
28
+ ```
29
+
30
+ Open the printed `#token=...` URL. Real graph reads are token-protected by default.
31
+
32
+ ## Branches And Pull Requests
33
+
34
+ Use `main` as the only default branch target. Do not propose or document `master`.
35
+
36
+ Keep pull requests focused. A good PR changes one behavior, one doc area, or one test gap. Split visual changes, parser changes, service security changes, and packaging changes when they can be reviewed independently.
37
+
38
+ Branch names should be short and descriptive:
39
+
40
+ ```text
41
+ fix/token-auth-default
42
+ docs/source-adapter-guide
43
+ test/parser-alias-fixture
44
+ ```
45
+
46
+ Every PR should include:
47
+
48
+ - what changed and why;
49
+ - the validation commands run;
50
+ - whether screenshots or graph payloads came only from the generated fixture;
51
+ - docs updates when API payloads, CLI flags, config, storage, or public terminology changed.
52
+
53
+ Small first changes that are usually reviewable:
54
+
55
+ - add one parser fixture for unsupported Logseq syntax;
56
+ - improve one troubleshooting entry;
57
+ - tighten one public term and update the matching test expectation;
58
+ - add a generated fixture screenshot path without real graph data.
59
+
60
+ ## Validation
61
+
62
+ Before proposing a change, run:
63
+
64
+ ```bash
65
+ npm run validate
66
+ ```
67
+
68
+ On Linux CI-like machines, install the browser and system dependencies with `npx playwright install --with-deps chromium`.
69
+
70
+ Use targeted commands while iterating:
71
+
72
+ ```bash
73
+ npm test
74
+ npm run check:runtime
75
+ npm run eval
76
+ npm run test:ui
77
+ npm run check:public
78
+ ```
79
+
80
+ `npm run test:ui` uses a generated fixture graph. It does not read your real Logseq graph unless you explicitly set up a separate manual run.
81
+
82
+ Use `npm run eval:service:100k` only when changing the service scale path or watch behavior. It is intentionally heavier than normal CI.
83
+
84
+ ## Code Style
85
+
86
+ - Prefer small pure helpers for graph math, filtering, budgets, and rendering policy.
87
+ - Keep filesystem reads in `server/logseq/` or source adapters.
88
+ - Keep HTTP/cache/watch behavior in `server/service.mjs`.
89
+ - Keep React components prop-driven and avoid direct API/storage side effects in leaf components.
90
+ - Update runtime validators before relying on a new API field.
91
+ - Use generated fixtures for tests; do not copy real Logseq graph content into the repo.
92
+
93
+ ## Design Rules
94
+
95
+ - Keep the graph visually cinematic but operationally truthful.
96
+ - Do not imply provenance that is not present in the indexed Logseq graph.
97
+ - Do not make every decorative particle clickable. Real page nodes are the interaction targets.
98
+ - Do not draw every edge in overview mode.
99
+ - Keep local-only security constraints intact.
100
+ - Keep graph writes out of this app. Writeback belongs in a guarded MCP layer.
101
+
102
+ ## Public-Safety Rules
103
+
104
+ Target `main` for all public work. Do not create or target any alternate default branch.
105
+
106
+ Do not commit real graph data, screenshots from a real graph, generated caches, private `.env` files, or machine-specific paths.
107
+
108
+ Run `npm run check:public` before publishing or opening a public PR.
109
+
110
+ ## Architecture Links
111
+
112
+ - `docs/ARCHITECTURE.md` explains runtime boundaries, cache, scale, and verification policy.
113
+ - `docs/REPO_GUIDE.md` maps file ownership.
114
+ - `docs/API.md` documents HTTP contracts.
115
+ - `docs/ADAPTERS.md` documents source adapter requirements.
116
+ - `SECURITY.md` and `SUPPORT.md` define private-data handling and report boundaries.
package/GOVERNANCE.md ADDED
@@ -0,0 +1,40 @@
1
+ # Governance
2
+
3
+ Living Atlas uses maintainer-led governance for the first public releases.
4
+
5
+ ## Decision Model
6
+
7
+ Maintainers make final decisions for roadmap, release, security, and architecture boundaries. Contributors are encouraged to open issues and pull requests, but changes must preserve the project constraints:
8
+
9
+ - local-first operation;
10
+ - read-only visualization service;
11
+ - no remote listener by default;
12
+ - no committed real graph data;
13
+ - no direct graph writes from the renderer;
14
+ - public documentation and examples based on generated fixture data.
15
+
16
+ ## Scope Changes
17
+
18
+ Changes that affect trust boundaries require explicit design review before implementation. This includes:
19
+
20
+ - remote access;
21
+ - authentication changes;
22
+ - MCP or Logseq writeback flows;
23
+ - new source adapters;
24
+ - persistent storage format changes;
25
+ - large-graph cache or database changes;
26
+ - public package/release automation.
27
+
28
+ ## Roadmap
29
+
30
+ The roadmap is intentionally conservative. Visual quality matters, but graph-derived truth, local security, and public-safe onboarding have priority over cinematic effects that cannot be explained from indexed data.
31
+
32
+ ## Conflict Resolution
33
+
34
+ When there is disagreement, maintainers should decide using this order:
35
+
36
+ 1. protect user graph privacy and local security;
37
+ 2. preserve correctness of graph-derived claims;
38
+ 3. keep the app installable and testable from public source;
39
+ 4. preserve cinematic quality without obscuring utility;
40
+ 5. minimize maintenance burden.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Logseq Graph Living Atlas contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/MAINTAINERS.md ADDED
@@ -0,0 +1,34 @@
1
+ # Maintainers
2
+
3
+ Living Atlas is maintained by the Living Atlas maintainers.
4
+
5
+ ## Responsibilities
6
+
7
+ Maintainers are responsible for:
8
+
9
+ - keeping the default branch named `main`;
10
+ - protecting local-only security boundaries;
11
+ - rejecting real Logseq graph data, private screenshots, cache snapshots, and local paths in public artifacts;
12
+ - requiring fixture-backed reproduction where possible;
13
+ - keeping release tags, npm package metadata, and docs aligned;
14
+ - reviewing API, cache, adapter, and storage changes against runtime validators and tests.
15
+
16
+ ## Review Expectations
17
+
18
+ Security, privacy, release, and source-adapter changes need maintainer review before merge. Visual-only changes still need fixture screenshots or UI smoke evidence when they affect the rendered atlas.
19
+
20
+ Maintainers should prefer small, reviewable changes. Large rewrites should be split by boundary: parser/source adapter, service/cache/API, graph algorithms, renderer, frontend state, docs, or packaging.
21
+
22
+ ## Release Authority
23
+
24
+ Only maintainers should create public release tags or publish npm packages. A release is eligible only when:
25
+
26
+ - `npm run validate` passes;
27
+ - `npm run smoke:package` passes;
28
+ - `npm audit --audit-level=moderate` reports no vulnerabilities;
29
+ - `npm run check:public` passes;
30
+ - `npm run check:release` passes from a clean `main` checkout with an exact version tag.
31
+
32
+ ## Private Data
33
+
34
+ Maintainers should remove or redact public contributions that include real graph files, private screenshots, token URLs, cache snapshots, or machine-specific paths. When private evidence is needed, handle it outside the repository and summarize only the public-safe result.
package/README.md ADDED
@@ -0,0 +1,370 @@
1
+ # Living Atlas
2
+
3
+ Living Atlas turns a local Logseq graph into a read-only, explorable 3D knowledge map. It indexes markdown files from your graph, serves a localhost API, and renders a cinematic Three.js field with clusters, search, focus slices, pathfinding, timeline replay, review flags, and graph-health signals.
4
+
5
+ The visual goal is science-fiction. The data contract is deliberately boring: every count, label, path, link, and insight must be grounded in the indexed Logseq files.
6
+
7
+ ![Living Atlas fixture demo](docs/assets/living-atlas-demo.png)
8
+
9
+ All screenshots in this README are generated from the public fixture graph.
10
+
11
+ ## Gallery
12
+
13
+ | Overview | Source Detail |
14
+ | --- | --- |
15
+ | ![Fixture overview showing the Living Atlas point cloud, local stats, timeline, and cognition stream](docs/assets/living-atlas-demo.png) | ![Fixture source detail showing selected node orbit edges, direct link weights, and atlas filters](docs/assets/living-atlas-source-detail.png) |
16
+
17
+ | Pathfinder | Connector Radar |
18
+ | --- | --- |
19
+ | ![Fixture pathfinder view showing a traced route from Project Orion to Atlas with alternate paths](docs/assets/living-atlas-pathfinder.png) | ![Fixture connector radar showing a sweep ring and an active connector candidate](docs/assets/living-atlas-radar.png) |
20
+
21
+ ## Contents
22
+
23
+ - [Try it now](#run-from-github-source)
24
+ - [Run from npm](#run-from-npm)
25
+ - [Use your own Logseq graph](#use-your-own-logseq-graph)
26
+ - [Data and privacy model](#why-trust-it-with-a-graph)
27
+ - [Configuration](#configuration)
28
+ - [Validation](#validation)
29
+ - [Architecture docs](#architecture-docs)
30
+
31
+ ## How To Read The Atlas
32
+
33
+ - **All** shows the whole indexed graph within the current group, status, confidence, and source filters.
34
+ - **Core** keeps high-signal pages and cluster roots visible without assuming a fixed private ontology.
35
+ - **Active** shows recently changed pages.
36
+ - **Connectors** shows pages that tie otherwise distant graph regions together.
37
+ - **Gaps** shows pages with missing source, weak confidence, missing status, or little trusted context.
38
+ - **Review** shows pages you flagged locally for cleanup.
39
+ - **Timeline replay** filters the graph by page update time so you can watch the visible atlas grow.
40
+
41
+ Visible group names come from your graph's page types, tags, and inferred clusters. Unknown `source::` values can become filter labels, so use redaction or fixture data for public screenshots.
42
+
43
+ ## Why Trust It With A Graph?
44
+
45
+ - Local only: the service binds to `127.0.0.1`.
46
+ - Read only: Living Atlas never writes to the Logseq graph.
47
+ - No cloud dependency: rendering and indexing happen on your machine.
48
+ - No Logseq Desktop requirement: the app reads the graph folder directly.
49
+ - No absolute paths in normal API responses: source paths are graph-relative by default.
50
+ - Generated cache, screenshots, and QA artifacts are graph-derived data and are ignored by default.
51
+
52
+ Do not expose the service through a reverse proxy or remote tunnel unless you add authentication, transport security, and a deployment-specific threat model.
53
+
54
+ ## Requirements
55
+
56
+ - Node.js `20.19.0` or newer
57
+ - npm
58
+ - A local Logseq graph folder for real data runs
59
+
60
+ The optional companion MCP server is [`logseq-graph-mcp`](https://github.com/johnschieferleuhlenbrock/logseq-graph-mcp). Use it when agents need guarded read/write access to the same graph. Living Atlas itself remains the read-only visualization and index service.
61
+
62
+ ## Release Status
63
+
64
+ The `0.1.x` line is the first public release series. It is local-first, read-only against your Logseq graph, and intended for individual desktop use while the adapter and MCP integration surfaces stabilize.
65
+
66
+ ## Run From npm
67
+
68
+ The npm package ships the built UI and local index service.
69
+
70
+ Try a public fixture without a Logseq graph:
71
+
72
+ ```bash
73
+ npx logseq-graph-living-atlas --demo
74
+ ```
75
+
76
+ Use your own graph:
77
+
78
+ ```bash
79
+ npx logseq-graph-living-atlas --root /absolute/path/to/your/logseq/graph
80
+ ```
81
+
82
+ Open the `#token=...` app URL printed by the command. Real graph reads are token-protected by default. The demo fixture stays unauthenticated for easy evaluation.
83
+
84
+ Useful CLI checks:
85
+
86
+ ```bash
87
+ npx logseq-graph-living-atlas --help
88
+ npx logseq-graph-living-atlas --version
89
+ ```
90
+
91
+ After a global install, both `living-atlas` and `logseq-graph-living-atlas` point at the same CLI.
92
+
93
+ `--root` must point at the graph folder, not the `pages/` folder itself.
94
+
95
+ ## Run From GitHub Source
96
+
97
+ ```bash
98
+ git clone https://github.com/johnschieferleuhlenbrock/logseq-graph-living-atlas.git
99
+ cd logseq-graph-living-atlas
100
+ npm install
101
+ ```
102
+
103
+ ### Try The Demo
104
+
105
+ The demo creates a public-safe fixture graph in the OS user cache at runtime, builds the app, and serves it locally.
106
+
107
+ ```bash
108
+ npm run demo
109
+ ```
110
+
111
+ Open `http://127.0.0.1:8787`.
112
+
113
+ No demo graph files are committed. Repo-local build and QA artifacts can be removed with:
114
+
115
+ ```bash
116
+ npm run clean
117
+ ```
118
+
119
+ Remove user-cache demo graphs too:
120
+
121
+ ```bash
122
+ npm run clean -- --user-cache
123
+ ```
124
+
125
+ Regenerate the README screenshot from the same fixture data:
126
+
127
+ ```bash
128
+ npm run capture:demo
129
+ ```
130
+
131
+ ### Optional MCP Compatibility Smoke
132
+
133
+ This verifies that the published `logseq-graph-mcp` package and Living Atlas can both read the same generated fixture graph:
134
+
135
+ ```bash
136
+ npm run smoke:mcp
137
+ ```
138
+
139
+ By default the smoke uses `npx logseq-graph-mcp@0.1.2`. To test a local MCP checkout instead:
140
+
141
+ ```bash
142
+ LOGSEQ_GRAPH_MCP_CLI=/absolute/path/to/logseq-graph-mcp/dist/cli.js npm run smoke:mcp
143
+ ```
144
+
145
+ Regenerate the full README gallery:
146
+
147
+ ```bash
148
+ npm run capture:demo -- --gallery
149
+ ```
150
+
151
+ ### Use Your Own Logseq Graph
152
+
153
+ `--root` must point at the graph folder, not the `pages/` folder itself. A valid graph root looks like this:
154
+
155
+ ```text
156
+ my-logseq-graph/
157
+ pages/
158
+ Example.md
159
+ journals/
160
+ 2026_05_31.md
161
+ ```
162
+
163
+ Quick preflight:
164
+
165
+ ```bash
166
+ ls /absolute/path/to/your/logseq/graph/pages
167
+ ```
168
+
169
+ Common macOS locations include `~/Documents`, `~/Library/Mobile Documents`, or a synced folder such as iCloud, Dropbox, or OneDrive. Windows and Linux paths work too; pass the absolute folder that contains `pages/`.
170
+
171
+ ```bash
172
+ npm run build
173
+ npm run serve -- --root /absolute/path/to/your/logseq/graph
174
+ ```
175
+
176
+ Open the token URL printed by the service, usually `http://127.0.0.1:8787/#token=...`.
177
+
178
+ For split frontend/API development:
179
+
180
+ ```bash
181
+ LIVING_ATLAS_TOKEN=<random-local-token> npm run dev:api -- --root /absolute/path/to/your/logseq/graph --allowed-origin http://127.0.0.1:5177
182
+ npm run dev
183
+ ```
184
+
185
+ Open `http://127.0.0.1:5177/#token=<random-local-token>`.
186
+
187
+ The Vite dev server proxies `/api` to `127.0.0.1:8787`. Use `--allow-unauthenticated-read` only for trusted local experiments with non-sensitive fixture data.
188
+
189
+ PowerShell example:
190
+
191
+ ```powershell
192
+ npm run serve -- --root "D:\LogseqGraph" --token "replace-with-a-random-local-token"
193
+ ```
194
+
195
+ ## Configuration
196
+
197
+ You can use command-line arguments, shell environment variables, or Node's env-file support.
198
+
199
+ ```bash
200
+ cp .env.example .env.local
201
+ node --env-file=.env.local server/brain-service.mjs --watch --static dist
202
+ ```
203
+
204
+ Supported settings:
205
+
206
+ | Setting | Purpose | Default |
207
+ | --- | --- | --- |
208
+ | `LOGSEQ_ROOT` / `--root` | Logseq graph folder | Required |
209
+ | `LIVING_ATLAS_PORT` / `--port` | Local HTTP port | `8787` |
210
+ | `LIVING_ATLAS_CACHE` / `--cache` | Snapshot cache outside the graph | OS user cache directory |
211
+ | `LIVING_ATLAS_TOKEN` / `--token` | Local API token; generated for real graph CLI runs when omitted | Empty in demo mode |
212
+ | `LIVING_ATLAS_REQUIRE_TOKEN=1` / `--require-token` | Require the token for every `/api/*` route | On for CLI real-graph runs |
213
+ | `LIVING_ATLAS_ALLOW_UNAUTHENTICATED_READ=1` / `--allow-unauthenticated-read` | Allow local API reads without a token | Off |
214
+ | `LIVING_ATLAS_ALLOW_UNAUTHENTICATED_REINDEX=1` / `--allow-unauthenticated-reindex` | Allow manual reindex without a token for local development | Off |
215
+ | `LIVING_ATLAS_ALLOWED_ORIGINS` / `--allowed-origin` | Comma-separated local origins allowed to read the API outside same-origin mode | Empty |
216
+ | `LIVING_ATLAS_DEBUG_PATHS=1` / `--debug-paths` | Include absolute diagnostic paths in `/api/health` | Off |
217
+ | `LIVING_ATLAS_MAX_FILES` | Maximum markdown files accepted during ingest | `250000` |
218
+ | `LIVING_ATLAS_MAX_FILE_BYTES` | Maximum bytes per markdown file during ingest | `2097152` |
219
+
220
+ The service refuses to write its cache inside `LOGSEQ_ROOT`. Cache files are derived graph data; treat them as sensitive unless they were generated from the public fixture.
221
+
222
+ ### Token-Protected Local UI
223
+
224
+ Real graph runs enable read-token mode by default. Provide a token yourself or use the generated session token printed by the service:
225
+
226
+ ```bash
227
+ npx logseq-graph-living-atlas --root /absolute/path/to/your/logseq/graph --token <your-token> --require-token
228
+ ```
229
+
230
+ Then open:
231
+
232
+ ```text
233
+ http://127.0.0.1:8787/#token=<your-token>
234
+ ```
235
+
236
+ The fragment is not sent in the initial HTTP request. The browser stores it in session storage, strips it from the visible URL, and sends API reads with an `Authorization: Bearer <token>` header. The SSE stream uses the documented `/api/events?token=...` fallback because native `EventSource` cannot send custom headers.
237
+
238
+ ## Logseq Compatibility
239
+
240
+ Current support:
241
+
242
+ | Graph area | Status |
243
+ | --- | --- |
244
+ | `pages/**/*.md` | Indexed |
245
+ | `journals/**/*.md` | Indexed |
246
+ | Wikilinks `[[Page]]` | Indexed as graph links |
247
+ | Properties like `type:: project` | Parsed |
248
+ | Typed markdown links like `Owner: [[Page]]` | Parsed |
249
+ | Assets, queries, block refs, and advanced Logseq syntax | Best effort only |
250
+
251
+ The parser is intentionally isolated and covered by fixture tests, but it is not a full Logseq database implementation.
252
+
253
+ ## API
254
+
255
+ The service binds to `127.0.0.1` and rejects non-loopback peers. See `docs/API.md` for schemas, query ranges, SSE frames, and error semantics.
256
+
257
+ ```bash
258
+ curl -H "Authorization: Bearer <your-token>" http://127.0.0.1:8787/api/health
259
+ curl -H "Authorization: Bearer <your-token>" "http://127.0.0.1:8787/api/path?from=Atlas&to=Signal%20Desk"
260
+ ```
261
+
262
+ ## Keyboard Exploration
263
+
264
+ The atlas can be driven without leaving the graph field:
265
+
266
+ | Shortcut | Action |
267
+ | --- | --- |
268
+ | `Ctrl+K` / `Cmd+K` | Focus command search |
269
+ | `1`..`5` | Switch Whole Mind, Today, Focus, Radar, Replay |
270
+ | `Esc` | Clear the active lens and return to Whole Mind |
271
+ | `Left` / `Right` | Step replay backward or forward while Replay is active |
272
+
273
+ Endpoints:
274
+
275
+ - `GET /api/health`
276
+ - `GET /api/snapshot`
277
+ - `GET /api/search?q=<page-or-tag>`
278
+ - `GET /api/focus?q=<page>`
279
+ - `GET /api/node?q=<page>`
280
+ - `GET /api/path?from=<page>&to=<page>`
281
+ - `GET /api/connectors`
282
+ - `GET /api/bridges` deprecated alias for connectors
283
+ - `GET /api/delta`
284
+ - `GET /api/events`
285
+ - `POST /api/reindex`
286
+
287
+ `POST /api/reindex` requires either `Authorization: Bearer <token>` or `x-living-atlas-token: <token>` unless `--allow-unauthenticated-reindex` is enabled for local development. CLI real-graph runs protect read routes by default; `--allow-unauthenticated-read` is the explicit local-development opt-out.
288
+
289
+ ## Validation
290
+
291
+ ```bash
292
+ npx playwright install chromium
293
+ npm test
294
+ npm run check:runtime
295
+ npm run eval
296
+ npm run test:ui
297
+ npm run test:ui:scale
298
+ npm run check:public
299
+ ```
300
+
301
+ `npm run eval` covers both synthetic 1k/10k/100k graph generation and a 10k-file local service disk/API/reindex path. `npm run test:ui:scale` verifies browser rendering for 10k and budgeted 100k atlas payloads.
302
+
303
+ For heavier local proof outside normal CI, run the opt-in disk/watch service evaluation:
304
+
305
+ ```bash
306
+ npm run eval:service:100k
307
+ ```
308
+
309
+ Or run the full gate:
310
+
311
+ ```bash
312
+ npm run validate
313
+ ```
314
+
315
+ The UI smoke test uses a generated fixture graph and writes screenshots to a temporary directory unless `LIVING_ATLAS_QA_DIR` is set.
316
+
317
+ ## Repository Policy
318
+
319
+ Target `main` for all public work. Do not create or target any alternate default branch.
320
+
321
+ Do not commit real graph data or graph-derived artifacts. These paths are intentionally ignored:
322
+
323
+ - `.cache/`
324
+ - `dist/`
325
+ - `docs/qa/`
326
+ - `.env`
327
+ - `.env.local`
328
+ - `.public-readiness.local.json`
329
+
330
+ Contributor validation:
331
+
332
+ ```bash
333
+ npm run clean
334
+ npx playwright install chromium
335
+ npm run validate
336
+ npm audit --audit-level=moderate
337
+ npm pack --dry-run
338
+ npm run smoke:package
339
+ ```
340
+
341
+ Maintainer release validation:
342
+
343
+ ```bash
344
+ npm run clean
345
+ npm run validate
346
+ npm audit --audit-level=moderate
347
+ npm pack --dry-run
348
+ npm run smoke:package
349
+ npm run check:release
350
+ ```
351
+
352
+ For publish rehearsal, `npm pack --dry-run` intentionally runs the production build. Use `npm pack --dry-run --ignore-scripts` only when you want to inspect the package allowlist without regenerating `dist/`.
353
+
354
+ First publish policy: create a `vX.Y.Z` tag matching `package.json` on `origin/main` and let the protected GitHub Release workflow publish with npm provenance. Emergency manual publish is documented in `docs/RELEASE.md`.
355
+
356
+ ```bash
357
+ git tag v0.1.0
358
+ git push origin main v0.1.0
359
+ ```
360
+
361
+ ## Architecture
362
+
363
+ See `docs/ARCHITECTURE.md`, `docs/API.md`, `docs/ADAPTERS.md`, `docs/REPO_GUIDE.md`, `docs/CONCEPTS.md`, `docs/MCP.md`, `docs/TROUBLESHOOTING.md`, and `docs/RELEASE.md`.
364
+
365
+ Short version:
366
+
367
+ - Logseq markdown is the source of truth.
368
+ - The Local Index Service owns parsing, cache, budgets, deltas, and graph APIs.
369
+ - React and Three.js own rendering and interaction.
370
+ - Guarded writes belong in a separate MCP/writeback layer.