--- status: current version: 0.5.0 canonical: true audience: [ai, human] last_updated: 2026-10-05 --- # EveGlyph Editor — Current State (v0.5.0) This is the authoritative technical description of what EveGlyph Editor v0.5.0 ships. It is intentionally calmer and more precise than marketing copy. For a short citable version see [./public-summary.md](./public-summary.md); for how it got here see [./design-history.md](./design-history.md); for the problem it addresses see [./origin.md](./origin.md). If a capability is not described in this corpus, treat it as not shipped. ## Status **v0.5.0** — a **preview**, **local prototype, pre-1.0**. Product code `EG-MD-2026`. Built by Neo.K under EveMissLab (EVEMISS TECHNOLOGY CO., LTD. / 一言諾科技有限公司), Taipei, Taiwan. Licensed under MIT. Version and availability are separate facts. v0.5.0 is the current version of the product. As of this revision (2026-10-05) its source is public on GitHub under the MIT license (). A per-user Windows installer and a zip of the same app are attached to its [GitHub Releases](https://github.com/kakon77777-commits/EveMissLab-eveglyph-editor/releases); they are **not code-signed**, so Windows SmartScreen may warn about an unknown publisher — compare the SHA-256 published with the download. The homepage also offers a browser demo of the editor and live preview; see [../source-access.md](../source-access.md). ## What it is EveGlyph Editor is a local-first, agent-native Markdown editor and workspace. From source it runs as a local dev server (`npm run dev`, or the bundled `start-eveglyph.bat` on Windows) and is used through a browser at `http://localhost:5173`. The Windows desktop app (Electron, described below) runs the same bridge and frontend in its own window. It is the editor half of EveGlyph-MD, a lightweight Markdown classification format. ## Editor and workspace - **CodeMirror 6** for the editing surface, with Markdown syntax and built-in search & replace (`Ctrl+F`). - A **file tree**, **tabs**, and a **folder browser**. A workspace is opened either through the browser's File System Access API (a folder picker) or through the local bridge using an absolute path. - **Encoding-aware I/O** — a file's encoding is detected (`jschardet`) and preserved on save (`iconv-lite`: Big5 / GBK / Shift-JIS, and others). A per-file status-bar menu (for bridge-opened files) allows re-reading or converting; Settings → Default encoding is the fallback when detection is uncertain and the encoding for newly created files. - **Workspace search** — exact string/regex search and replace (current file or whole workspace; workspace replace goes through a git snapshot and diff), plus an **AI semantic search** mode that ranks and quotes the most relevant passages using the configured cloud provider. The two modes are kept separate; exact search is never AI-assisted. - **DOCX → Markdown import** with a rules cleanup pass. - **Appearance** — Dark, Light, Studio, Paper and Midnight themes; a full h1–h6 preview heading scale; a user **Custom CSS** file (a workspace-relative path, loaded after the app's own styles); drag-resizable sidebar and right panel whose widths persist; and an **English / 繁體中文** interface (`Settings → Language`; AI prompt text, Monitor payloads, and document content are intentionally never translated). - **Docs tabs** — the changelog and a user guide are readable inside the app. ## Live preview and math - The preview is built on `marked` with `:::` callout blocks and EveGlyph-MD frontmatter badges, sanitized with **DOMPurify** (default configuration — script / iframe / event-handler attributes stripped) before being shown. - **Math** renders with KaTeX. A formula KaTeX cannot render gets one more try through MathJax, loaded lazily only when there is a failure to retry (this covers gaps such as the `multline` environment and `\ce{…}` chemistry notation); a rescued formula carries a subtle marker. Recognized syntax aliases are quietly rewritten before rendering (Safe Rewrite), with a note above the preview. A formula that still fails, or partially degrades, appears in a **diagnostics panel** above the preview and is logged to the Monitor tab rather than disappearing silently. - **Charts and plots** (Visual IR) — `::: chart {type="bar|line|pie"}` for self-contained data and `::: plot {domain="[a, b]"}` for a function's curve, rendered as hand-built SVG; an `aimd-view {renderer="chart"}` can also visualize a computed AIMD-C table. **PDF export of these blocks is not built yet.** ## Computable documents — AIMD-C AIMD-C blocks (`aimd-value`, `aimd-function`, `aimd-compute`, `aimd-assert`, `aimd-table`, `aimd-view`) make a Markdown document compute: typed values, pure functions, a real dependency graph, assertions, and results that re-evaluate live as you type. Any block's result can be referenced from anywhere in the document (`@id.field`) or inline in prose (`{{ id.field }}`). Wrong types and circular references are caught and reported, not silently ignored. Evaluation uses a **closed-grammar evaluator** (`src/aimdc/evaluator.js`) with no `eval` and no `Function`, so a malformed or adversarial block can only produce a parse or type error. AIMD-C replaced an earlier `::: aimd :::` block syntax (see [concept-genealogy.md](./concept-genealogy.md)). ## Dynamic Logic `aimd-claim`, `aimd-evidence`, `aimd-judgment` and `aimd-history` blocks add a claim / evidence / judgment layer **on top of** AIMD-C — not a second math engine. A deterministic reducer tracks each judgment through open → generating → provisionally true/false, and reopens a closed judgment when later evidence drifts back across its own closure threshold. In the browser, UI-local replay (`←` / `→` / `Live`) steps through a claim's evidence history without rewriting Markdown or touching disk. Autoplay (`▶ Play`) moves one real evidence step per tick; there is no decorative animation loop, motion fires only when a state or value actually changes, and `prefers-reduced-motion` is respected. A narrow `externalRefs` bridge lets `{{ }}` and `aimd-view` syntax read a judgment's values (for example `@weather-judge.support`); local AIMD-C ids always take precedence. Verified with `npm run verify:dynamic-logic` and `npm run verify:dynamic-rendering`. ## PDF export (Typst) A **PDF** button compiles the active Markdown document into a real typeset PDF (proper math layout, real page breaks) using a WebAssembly build of the [Typst](https://typst.app) compiler that is bundled as an ordinary dependency and served from the app — nothing is uploaded anywhere. Frontmatter selects a named theme (`typst_theme:` — `evemiss-serif-light`, the default, or `evemiss-classic-light`) and a layout profile (`typst_layout:` — `technical-whitepaper`, the default, `academic-paper`, or `long-form-book`) controlling font, scale, colors, page size and margins, and equation numbering. AIMD-C blocks export as typeset output, `{{ id.field }}` references resolve, Theorem / Lemma / Definition callouts are numbered sequentially, and Traditional Chinese text renders correctly (Noto Serif TC). The first export in a session downloads roughly 51 MB (compiler and fonts) and is cached afterwards. The browser's own **Print** / Save-as-PDF path (`@media print`) still exists separately. ## AI providers, presets and agent modes Three provider paths are supported: **Anthropic (Claude)**, **any OpenAI-compatible endpoint**, and a **local CLI agent** (Claude Code, Codex, or Gemini). The cloud providers never touch the local filesystem — only the local-agent path edits files, and only on the machine where EveGlyph Editor is running. Built-in presets cover clean-up, academic expansion, voice-preserving rewrite, KaTeX fixing, heading normalization, whitepaper extraction, changelog generation and workspace audit. A **RigorLoop audit** preset does not call the configured provider: it runs AMEP, a separate open method-pack project, directly in the browser (about 14 MB on first use) as a heuristic scanner for compressed proof language, unclear equivalence claims and missing citations — not a theorem prover and not an LLM. Local-agent runs have three modes: **Suggest** (advice only), **Patch** (edit plus diff-review, the default) and **Direct** (apply immediately, one-click revert). ## PatchMD — diff-first agent review Before a local agent runs, the workspace is git-snapshotted (a repo is initialized if one does not already exist). The agent then runs with auto-approve, confined to the one confirmed workspace folder. Afterward, a real `git diff` is shown through a shared renderer (`src/diffview.js`, used by both the agent panel and workspace replace-all): a unified diff grouped into **per-file cards with +/− counts**, collapsible, and fully escaped since it renders untrusted agent/git output. The human then chooses: - **Accept** — commits the agent's changes (`agent: `). - **Reject** — `git reset --hard HEAD` plus `git clean -fd`, discarding all agent edits *and* untracked files. This is destructive to any uncommitted work in the workspace. There is no partial-accept or per-hunk staging; the review unit is the whole agent run. A live agent activity panel streams a transient "working…" view of the agent's output tail while it runs, replaced by the diff view on completion. ## Permission tiers — real enforcement Three tiers — **Cautious**, **Standard**, **Trusted** — flow from the frontend to the bridge and map to actual CLI enforcement, not just prompt text: Claude Code's `--permission-mode` plus a tool allow-list, Codex's `exec --full-auto` (or a sandbox bypass at Trusted), and Gemini's `--approval-mode` (`--yolo` at Trusted). Claude Code is enforced at all three tiers; Codex and Gemini are coarser below Trusted, where Cautious and Standard share CLI flags and differ by prompt clause (exact flags in [../specs/permission-tiers.md](../specs/permission-tiers.md)). This has been the case since v0.4.0; before that the same tier names only varied the prompt (see [design-history.md](./design-history.md)). ## EveGlyph-MD frontmatter `src/frontmatter.js` implements a `type` / `status` / `tags` classification layer on top of a document's YAML frontmatter, using a round-trip-safe YAML-subset parser that edits the raw frontmatter block line-by-line so a human's block scalars, nested maps, and comments survive untouched. A status-bar chip and popover let a person set the class (and warn if a value is out of the configured enum); the preview shows schema badges; new `.md` files are stamped with a class at creation. The active document's class is injected into the agent's context as fenced, enum-clamped, sanitized metadata — treated strictly as data for the agent to read, never as instructions to follow. ## Workspace memory (`.eveglyph/`) and Monitor A workspace-local, gitignored `.eveglyph/` directory can hold `rules.md` (injected verbatim, with elevated authority, into every agent run — "follow these before anything else"), `glossary.md`, and `memory/pitfalls.md` / `memory/recent.md`. A context compiler (`src/context.js`) assembles these into the prompt sent to the agent. A back-stage **Monitor** tab (`src/monitorview.js`) tail-reads a local diagnostic JSONL log, with color-coded rows (agent / git / file / ui / error), a substring filter and manual or automatic refresh. The log lives in the OS temp directory (rolled at 5 MB, override with `EVEGLYPH_MONITOR_FILE`) and is never sent over the network. ## World IR and World Studio (opt-in) Opening a `.yaml` / `.yml` file that starts with `kind: state_machine`, `kind: entity` or `kind: entity_list` renders it visually instead of as Markdown (state machines as a clickable SVG diagram, entities as an editable form, lists as a table), each view running a validator. The file itself always stays plain YAML. The advanced surface — Runtime, World, Studio and editable World IR Preview — is **off by default** (Settings → Enable World Studio). The Studio tab asks the configured cloud provider for a bounded state-machine draft; it is parsed and validated locally with hard size limits, an invalid draft cannot be applied, and applying a valid draft changes only the editor buffer until the user explicitly saves. It never writes Runtime State or saves a file automatically. ## MCP server `mcp-server.js` is a standalone **stdio** [MCP](https://modelcontextprotocol.io) server, and `mcp-server-remote.js` serves the same tools over **HTTP** bound to `127.0.0.1` with a mandatory bearer token (`EVEGLYPH_MCP_TOKEN`, 16+ characters, constant-time comparison); reaching it from outside this machine requires the user to tunnel it. Settings → Enable remote MCP server starts and stops that process from the app. Both require an explicit workspace root and confine file paths to it. Eleven tools are exposed — see [../tools/catalog.json](../tools/catalog.json): - Workspace and computation: `list_files`, `read_file`, `write_file`, `evaluate_aimdc`, `validate_world_ir`. - Publication runtime: `get_publication_capabilities`, `inspect_document`, `validate_document`, `render_document`, `get_render_artifact`, `get_render_report`. `render_document` produces a **temporary PDF artifact** (default profile `evemiss-whitepaper-v1`; `evemiss-academic-v1` is the other) without modifying the source or workspace. Artifacts are process-scoped, expire after 30 minutes, and are capped at 64 MiB each and 256 MiB in total; rendering is single-document only. `write_file` writes immediately, with no diff-review step of its own: an MCP host is expected to gate each tool call with its own approval UI. A leaked bearer token on a tunneled remote server means direct, un-reviewed read/write access to the workspace. See `SECURITY.md` in the repository. ## Capability sandbox foundation AIMD-C document computation — in the live preview and in MCP `evaluate_aimdc` — enters through a deny-by-default **capability control plane** (`src/capabilities/`). Its default `document-only` profile grants only `document.read.self` on `document:self`, `document.compute` on `document:self`, and `ephemeral.output` on `execution:*`; it has no filesystem, network, process, host-environment or credential object to call. Requests carry a capability id, resource, lifetime, reason and inert context; grants need an exact capability match and an exact resource or a single trailing-`*` prefix scope, read does not imply write, unknown capabilities and profiles fail closed, expired grants do not authorize, and a `once` grant is consumed after its first use. Every allow/deny decision records actor-aware audit evidence. `src/capabilities/mcp-map.js` records the authority each MCP tool would need; that mapping is **groundwork**, not a behavior change: there is no user-facing grant-acquisition flow yet, and workspace MCP tools keep their existing transport-level behavior. This is **not** an OS or process sandbox and does not claim to make arbitrary native code safe. ## Desktop app (Windows) `desktop/` wraps the same bridge and built frontend in an Electron window. It is a thin shell: a loopback-only server (`127.0.0.1`, preferred port 47831 so the page origin and its saved settings stay stable between launches) mounts the bridge and the built `dist/`, and the window shows it. Every `/api` request must carry a random per-launch token that only the app's own window adds, so other local web pages and programs cannot use the bridge. The window runs with `contextIsolation` and `sandbox` on, no Node integration, and opens other sites in the default browser. The release assets are a per-user NSIS installer (no administrator rights) and a zip of the same folder. They are **not code-signed**: Windows SmartScreen may warn about an unknown publisher, so compare the download's SHA-256 with the value published next to it. The build recipe (`desktop/build.mjs`) stages only the files and npm packages the Node side imports, and the app is not packed into an `asar` archive. Everything in `SECURITY.md` still applies: `git` must be installed for diff review, local-agent mode runs a CLI with auto-approve, and API keys are kept in the app profile's local storage (`%APPDATA%\EveGlyph Editor`) in plaintext. There is no macOS or Linux desktop build, and the app does not update itself. ## Architecture and the local bridge ``` browser frontend ⇄ vite-agent-bridge (/api) ⇄ filesystem · git · CLI agent ``` The frontend is vanilla ES modules plus CodeMirror, with mutable state held in a single `S` singleton (`src/`). The bridge (`vite-agent-bridge.js`) is a Vite plugin declared `apply: 'serve'`: under `npm run dev` Vite mounts it, and the Windows desktop app mounts the same code on its own loopback-only server. It is never part of a production *web* build and is never publicly hosted or network-reachable. It exposes `/api/*` endpoints for filesystem I/O, encoding detection, git diff-review, and agent spawning, and every endpoint is gated to local requests only (`Host` / `Origin` must resolve to localhost; the desktop app additionally requires a per-launch token). These endpoints exist solely on the end user's own machine for the duration of their own local session — there is no hosted or public `/api/*` surface for EveGlyph Editor anywhere. Cloud-provider API keys are stored in the browser's `localStorage` in plaintext (key `eveglyph_cfg`). ## Verification `npm test` runs the capability-foundation, MCP capability-sandbox, MCP publication, publication-profile, inspect/validate, artifact-store, Node-renderer and real-corpus-compatibility suites; `npm run verify:dynamic-logic` and `npm run verify:dynamic-rendering` check the Dynamic Logic engine and renderer. A bundled `examples/` workspace (welcome, AIMD-C, Dynamic Logic, math corpus, Typst export, Visual IR, a World IR village) gives something to open immediately. ## Pre-1.0 status EveGlyph Editor is explicitly described by its own README as a **local prototype, pre-1.0**, and v0.5.0 is a preview. It is under active development; interfaces and behavior may change before 1.0. ## See also - [origin.md](./origin.md) — the problem this project addresses. - [design-history.md](./design-history.md) — the v0.1 → v0.5 version lineage. - [deprecated-concepts.md](./deprecated-concepts.md) — what is *not* shipped. - [public-summary.md](./public-summary.md) — a short citable summary.