veda-wiki

module
v0.0.0-...-a2d7020 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2026 License: MIT

README

VEDA

A reading-first knowledge base for people and agents. React UI, Go service, local versioned Markdown articles, REST API and MCP server (veda mcp).

Early development: local source creation and article create/read/update work. GitHub connections and background synchronization are implemented and tested with a simulated GitHub service. Cross-repository moves, including linked articles and images, have also passed a synthetic live test through an authenticated gh proxy; VEDA's own saved App/PAT credentials have not passed live acceptance. Scoped agent read keys and named reader users and teams are implemented; production account acceptance and per-agent OS isolation remain open. This repository contains no knowledge-base content, credentials, production configuration or deployment history.

Run

Requires Go 1.26, Node 22.22.2+ (24.15+ on Node 24) and npm. Runtime is a single Go binary; Node is only needed to build the interface. Linux/macOS are supported.

make build
./veda

For a portable Linux archive and dedicated service account, see the packaging and systemd instructions.

Open http://127.0.0.1:8080/. Both listeners show only public content without authorization. The separate public listener is http://127.0.0.1:8081/ and always ignores owner tokens. The database starts empty.

The first start creates .veda/ (0700), state.json on first write and an owner.key and reader.key files (0600). The key is never printed. Protect and back up this directory; never add it to Git. The process holds an exclusive writer lock. One process owns one data directory. There is no multi-process database support. On SIGTERM or SIGINT, VEDA stops accepting requests, cancels background work and waits up to ten seconds for active requests and workers before exiting. An incomplete shutdown is logged as an error; durable outbox jobs are recovered on the next start.

The browser can sign in with a named reader account, the separate reader key or a source-scoped key to view private content; it cannot edit articles. See browser access. Authenticated REST and MCP remain the writing paths. Do not expose the loopback service remotely until HTTPS and a suitable authentication boundary are configured. Host validation remains mandatory.

API

See API reference. Writes require an owner bearer token and an explicit source. Browser-origin writes are refused. Each update supplies the expected revision; stale writes return 409 rather than replacing newer content. Identical paths in different sources remain distinct articles.

Local sources have owner-selected visibility. Connected GitHub sources derive visibility from a verified repository response and fail closed if verification expires or fails. Program sources accept article paths below docs/ only. Wiki sources accept Markdown article paths.

MCP

MCP is served by the same binary, with no Python required:

veda mcp --key-file .veda/owner.key

Register that command with your MCP client, using absolute paths appropriate to your checkout. For read-only Codex, Claude Code, OpenCode and Hermes examples and the proposal workflow, see agent setup. stdio is the MCP transport; use --url to choose the loopback REST endpoint. For a local read-only agent, the service can instead expose a Unix socket in a private directory owned by the service user. Start VEDA with --reader-socket /path/to/private/reader.sock, then run veda mcp with --reader-socket pointing to that socket. This server advertises sources, search, read, context, and non-persistent preparation of new articles and updates; it has no write/admin access. The socket's directory must be 0700 and owned by the server user. Anyone sharing that OS identity can read all private sources; this is not per-agent authorization. An optional Linux-only root snapshot import channel is described in the API reference.

The owner key allows reading and writing all sources. To grant an agent only current-content reading, pass --reader-key-file .veda/reader.key instead. The reader key cannot write or use administrative endpoints and is ignored by the public listener. It grants access to all private sources and is not user-scoped. An existing private infrastructure MCP configuration must not be replaced automatically by this development server.

Tools: veda_sources, veda_search, veda_find, veda_read, veda_read_excerpt, veda_outline, veda_changes, veda_stale, veda_check_source, veda_prepare_update, veda_prepare_new_article, veda_create_source, veda_write_article, veda_edit_article, veda_copy_article, veda_transfer_plan, veda_moves, veda_move_article, veda_cancel_move, veda_context, veda_conflicts, veda_resolve_conflict, veda_github_status, veda_github_connect, veda_sync, veda_reconcile_sources, veda_source_mirrors, veda_configure_source_mirror, veda_publish_job, veda_cancel_bundle, and, for the optional knowledge graph, veda_entities, veda_entity, veda_article_links, veda_graph, veda_graph_context, veda_knowledge_status and veda_knowledge_reindex. Reader keys and the reader socket list 19 read-only tools: the fourteen reading and proposal tools and the five knowledge reads; the owner lists all 38. veda_read_excerpt reads bounded Unicode slices and uses the first slice's SHA to reject continuations after a revision changes. veda_outline lists an article's sections with offsets and sizes for such excerpts, and veda_read with if_sha256 answers unchanged instead of resending an unchanged article. veda_changes lists articles changed since a time, veda_stale those whose front matter verified: date is old or missing, and veda_check_source reports formatting warnings and links or images whose targets are missing across a whole source. veda_search returns at most 20 ranked hits with source ID, path, title and the best matching line (match, with the offset for veda_read_excerpt); veda_find pages further. veda_edit_article replaces one unique fragment instead of resending the whole article, and write responses omit the text. A refused call reports the HTTP status and a short server error code, for example HTTP 409 for a stale revision that must be reread; other response text is never returned to the agent. Context follows root and ancestor AGENTS.md articles inside one source. Documentation is evidence, never an authorization to execute infrastructure actions. veda_prepare_update rereads the current revision and returns the proposed text's digest and the base digest for review. It does not save a draft or publish anything; an authorized client must reread or submit with the returned expected revision. veda_prepare_new_article similarly prepares an unsaved creation proposal after checking that no article is currently visible at the path. It does not reserve the path; deleted history or a concurrent write can still prevent creation. The knowledge tools call /api/v1/knowledge/ and are refused with knowledge_disabled unless VEDA runs with --knowledge. Their mentions and relations are model-extracted hypotheses with evidence (source, path, SHA, quote); quotes are untrusted article text, and the graph does not replace veda_context, AGENTS.md or reading the article.

Knowledge graph (optional)

With --knowledge VEDA extracts entities and typed relations from the articles it holds using a local GLiNER2.5 model (a separate Python service in services/knowledge-extractor), keeps them as a derived index in Neo4j Community and serves them with evidence (source, path, content SHA, quote at code-point offsets) over /api/v1/knowledge/ and the knowledge MCP tools. Access is computed per request from VEDA's own read rules, so public callers see only the published text of public sources. The module is off by default; without it nothing changes and no Python, model, Docker or Neo4j is needed. A Docker Compose development profile (python3 scripts/knowledge_stack.py up --extractor) runs Neo4j and a CPU extractor on loopback and offline after a one-time model fetch. Extracted relations are model hypotheses, not facts. See docs/knowledge-graph.md for the data model, access rules, operation, the end-to-end smoke, measurements and an evaluation with its failure modes. PDF/DOCX/OCR input, answer generation and vector search are not implemented.

Development

The Go backend is one module with the dispatcher in cmd/veda and the code in internal/ (domain, store, the areas auth, importer, transfer, syncer, agentctx, and the adapters httpapi and app). Architecture lists the packages, allowed dependencies, collection ownership and the transaction model. make lint enforces a 500-line limit for Go and script files and runs scripts/check_architecture.py, which fails on forbidden package imports and on writes to a checked collection outside its owner.

make lint
make test
.venv/bin/python scripts/smoke.py
.venv/bin/python scripts/smoke_large.py

The CI workflow builds from a clean checkout and runs make test, browser and MCP smoke tests. make test builds React, tests tree navigation, runs Go race tests and go vet. The smoke test uses temporary empty storage and the official MCP SDK against the actual Go server. It verifies REST/MCP write-through, revisions, actual CLI import, conflict resolution and public/private isolation.

CI also runs python3 scripts/check_tracked_secrets.py against tracked regular working-tree files. It checks a small set of common private-key, token and credential-URL shapes without printing matching values. It does not scan Git history, untracked files, symlink targets or every possible secret and is not a substitute for review.

An optional browser smoke test needs Node 22+ and a trusted local Chrome or Chromium executable. It starts a temporary VEDA with synthetic public articles and a temporary browser profile; it checks article navigation, search and viewport overflow, plus scoped key and named-user login, source isolation and logout on desktop and mobile, including access to GitHub and settings from the mobile menu. It checks equal article paths across separate sources, tests synthetic admin sessions, and verifies that they do not authorize browser article writes. It runs in CI with the hosted runner’s Chrome and does not exercise production credentials or GitHub connections:

make build
VEDA_TEST_CHROME=/absolute/path/to/chrome python3 scripts/smoke_ui.py

For frontend development run the Go server and npm run dev in web/; Vite proxies API requests to the default loopback endpoint.

Frontend checks, run in web/:

npm run typecheck
npm run lint
npm test
npm run build

make test runs them together with the Go tests; make lint also limits every .ts, .tsx and .css file in web/src to 500 lines. The layout is described in Architecture.

Visual regression check: after make build, capture screens and compare them with the baseline (0.1% of pixels per screen):

VEDA_TEST_CHROME=/absolute/path/to/chrome python3 scripts/screens.py --out DIR
node scripts/ui_compare.mjs web/screens/baseline DIR --threshold 0.001

The baseline in web/screens/baseline is machine-local and git-ignored; capture it with scripts/screens.py from a known-good build before changing the UI.

The default store uses an atomic, fsynced JSON transaction file, bounded to 64 MiB including revision history. An opt-in SQLite backend removes that whole-store limit; migration and backup requirements are in storage. Articles are bounded to 1 MiB of UTF-8; documents over 256,000 bytes require store format v13, which older binaries reject. The store keeps the three newest revisions of each article plus protected ones, and veda migrate-revisions converts older stores. Treat this as early software, not a completed hosted multi-user wiki. Named readers and teams have source-scoped read access; account recovery, MFA and SSO are not implemented.

Import local repositories

See repository import. Wiki sources use strict root veda.yaml metadata; program sources import docs/ only. Import uses the authenticated REST service, preserves local changes as conflicts, and tracks Git/content provenance. See GitHub synchronization.

To publish a wiki or docs/ as a static site (GitHub Pages) with the same rendering, see static site export and the wiki template.

Direction

See content and source model and roadmap. MIT licensed code. Third-party font and icon licenses are included with the assets; asset provenance describes the generated illustrations.

For storage migration, backup and rollback requirements, see storage.

Directories

Path Synopsis
cmd
veda command
Command veda runs the VEDA service or one of its subcommands.
Command veda runs the VEDA service or one of its subcommands.
veda-site command
Command veda-site exports a wiki or program checkout as a static website (for GitHub Pages) with VEDA's Markdown rules.
Command veda-site exports a wiki or program checkout as a static website (for GitHub Pages) with VEDA's Markdown rules.
internal
agentctx
Package agentctx builds what agents are shown before they read or propose changes: root and ancestor AGENTS.md instructions, source status and the bases of write proposals.
Package agentctx builds what agents are shown before they read or propose changes: root and ancestor AGENTS.md instructions, source status and the bases of write proposals.
app
Package app wires the VEDA server: it opens the store, builds the services, starts the owner and public listeners and the background loops, and shuts them down on signal.
Package app wires the VEDA server: it opens the store, builds the services, starts the owner and public listeners and the background loops, and shuts them down on signal.
app/commands
Package commands implements the veda subcommands.
Package commands implements the veda subcommands.
auth
Package auth owns access keys, named users and teams, password hashing and browser sessions.
Package auth owns access keys, named users and teams, password hashing and browser sessions.
domain
Package domain holds the VEDA data model, its errors and validators, and the pure state-transition rules over a Database.
Package domain holds the VEDA data model, its errors and validators, and the pure state-transition rules over a Database.
github
Package github is the GitHub REST client used by synchronization: token exchange for GitHub App and personal credentials, repository and tree reads, and the write operations behind publication.
Package github is the GitHub REST client used by synchronization: token exchange for GitHub App and personal credentials, repository and tree reads, and the write operations behind publication.
github/githubtest
Package githubtest provides an in-memory GitHub server for tests.
Package githubtest provides an in-memory GitHub server for tests.
httpapi
Package httpapi serves the REST API, the browser sessions and the embedded reading interface.
Package httpapi serves the REST API, the browser sessions and the embedded reading interface.
importer
Package importer applies observed repository content to the store: veda.yaml metadata, bounded local checkout observations, batch decoding, asset storage, import conflicts and the process-local import observations.
Package importer applies observed repository content to the store: veda.yaml metadata, bounded local checkout observations, batch decoding, asset storage, import conflicts and the process-local import observations.
knowledge
Package knowledge holds the contracts of the derived knowledge graph: text preparation with source maps, the per-request access rule over VEDA's own read rules, the extraction schema, pipeline fingerprints, entity normalization and uncertainty markers.
Package knowledge holds the contracts of the derived knowledge graph: text preparation with source maps, the per-request access rule over VEDA's own read rules, the extraction schema, pipeline fingerprints, entity normalization and uncertainty markers.
knowledge/extractorclient
Package extractorclient is the HTTP client of the knowledge extractor service (wire contract v1, see knowledge.ExtractRequest).
Package extractorclient is the HTTP client of the knowledge extractor service (wire contract v1, see knowledge.ExtractRequest).
knowledge/indextest
Package indextest is the shared contract suite of knowledge.Index.
Package indextest is the shared contract suite of knowledge.Index.
knowledge/jobs
Package jobs is the durable store of background knowledge indexing: <data>/knowledge.sqlite with its own migrations, the manifest of snapshots (one row per snapshot and pipeline fingerprint, which is also the job) and the immutable extraction results.
Package jobs is the durable store of background knowledge indexing: <data>/knowledge.sqlite with its own migrations, the manifest of snapshots (one row per snapshot and pipeline fingerprint, which is also the job) and the immutable extraction results.
knowledge/memindex
Package memindex is the in-memory knowledge index: deterministic, used by make test and by the non-persistent development mode, and the reference behaviour every other knowledge.Index must match.
Package memindex is the in-memory knowledge index: deterministic, used by make test and by the non-persistent development mode, and the reference behaviour every other knowledge.Index must match.
knowledge/neo4jindex
Package neo4jindex stores the derived knowledge index in Neo4j (driver v6, Community edition).
Package neo4jindex stores the derived knowledge index in Neo4j (driver v6, Community edition).
mcp
Package mcp is the VEDA MCP server: the tool table, strict argument validation and handlers that call the REST service through client.Client.
Package mcp is the VEDA MCP server: the tool table, strict argument validation and handlers that call the REST service through client.Client.
mcp/client
Package client is the REST client behind the MCP adapter.
Package client is the REST client behind the MCP adapter.
notify
Package notify keeps owner notifications apart from VEDA's state: the access requests visitors send from the public surface, the Telegram IDs of users, which notifications were already sent, and an outbound-only Telegram bot.
Package notify keeps owner notifications apart from VEDA's state: the access requests visitors send from the public surface, the Telegram IDs of users, which notifications were already sent, and an outbound-only Telegram bot.
render
Package render turns article Markdown into sanitized HTML with a table of contents, and builds the link graph between articles.
Package render turns article Markdown into sanitized HTML with a table of contents, and builds the link graph between articles.
search
Package search implements full-text search over article pages and the ranking of its results.
Package search implements full-text search over article pages and the ranking of its results.
site
Package site exports a wiki or program checkout as a static website with the same Markdown rules as VEDA, for GitHub Pages and other static hosts.
Package site exports a wiki or program checkout as a static website with the same Markdown rules as VEDA, for GitHub Pages and other static hosts.
store
Package store owns the VEDA data directory: one lock over the in-memory database and durable commits to the JSON or SQLite backend.
Package store owns the VEDA data directory: one lock over the in-memory database and durable commits to the JSON or SQLite backend.
store/storetest
Package storetest builds stores with data for tests in other packages.
Package storetest builds stores with data for tests in other packages.
syncer
Package syncer synchronizes sources with GitHub: the background loop, connections and their status, credentials of GitHub accounts, pulls into the store, the write outbox and move deletions, publication approval, source mirrors and source reconciliation.
Package syncer synchronizes sources with GitHub: the background loop, connections and their status, credentials of GitHub accounts, pulls into the store, the write outbox and move deletions, publication approval, source mirrors and source reconciliation.
transfer
Package transfer copies and moves articles between sources, with their relative images and linked articles, and plans linked-graph transfers.
Package transfer copies and moves articles between sources, with their relative images and linked articles, and plans linked-graph transfers.
webui
Package webui embeds the built reading interface.
Package webui embeds the built reading interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL