{"type": "fact", "id": "project-identity", "text": "EveGlyph Editor is a local-first, agent-native Markdown editor and workspace by EVEMISS TECHNOLOGY CO., LTD. (一言諾科技有限公司), authored by Neo.K (許筌崴), Taipei, Taiwan. Part of EveMissLab. Current version is v0.5.0, a preview of a local prototype, pre-1.0. Licensed MIT. Canonical domain eveglypheditor.com; the source is public on GitHub (https://github.com/kakon77777-commits/EveMissLab-eveglyph-editor) and a Windows desktop app (unsigned installer and zip) is attached to its GitHub Releases; business/licensing contact kakon77777@evemisslab.com."}
{"type": "principle", "id": "four-stage-loop", "text": "EveGlyph Editor is built around one loop: workspace ↔ agent ↔ diff-review ↔ human. A human writes clean Markdown; a local CLI agent (Claude Code, Codex, or Gemini) edits files on disk with auto-approve; the workspace is git-snapshotted so every change surfaces as a reviewable diff; the human accepts or rejects it. Nothing is applied silently. Front-stage stays minimal, back-stage carries the capability."}
{"type": "concept", "id": "eveglyph-md-format", "text": "EveGlyph-MD (product code EG-MD-2026) is a lightweight semantic classification layer for Markdown documents, adding type/status/tags frontmatter fields on top of otherwise plain Markdown. EveGlyph Editor is the editor half of this format."}
{"type": "definition", "id": "eveglyph-md-frontmatter-fields", "text": "EveGlyph-MD frontmatter (src/frontmatter.js) defines three classification fields: type, status, and tags. A round-trip-safe YAML-subset parser edits the raw frontmatter block line-by-line so a human's block scalars, nested maps, and comments survive a rewrite untouched. New .md files are stamped with this schema at creation. The active document's class is injected into the agent's prompt context as fenced, enum-clamped, sanitized metadata, treated strictly as data for the agent to read, never as instructions for it to follow."}
{"type": "concept", "id": "patchmd-diff-review", "text": "PatchMD is EveGlyph Editor's diff-first agent review mechanism. Before any local agent runs, the workspace is git-snapshotted (a git repo is initialized if one doesn't exist yet). Afterward, a real git diff is shown to the human for Accept or Reject. There is no partial-accept or per-hunk staging; the review unit is the whole agent run."}
{"type": "fact", "id": "patchmd-diff-renderer", "text": "PatchMD's diff view (src/diffview.js) is one shared renderer used by both the agent review panel and workspace-wide replace-all: a unified diff grouped into collapsible per-file cards with +/− counts, fully escaped because it renders untrusted agent/git output."}
{"type": "fact", "id": "patchmd-accept", "text": "Accepting a PatchMD diff review commits the agent's changes to git with the commit message 'agent: <message>'."}
{"type": "fact", "id": "patchmd-reject", "text": "Rejecting a PatchMD diff review runs 'git reset --hard HEAD' followed by 'git clean -fd', discarding all of the agent's edits and any untracked files. This is destructive to uncommitted work in the workspace."}
{"type": "fact", "id": "agent-modes", "text": "Local-agent runs have three modes: Suggest (the agent only advises; any edit it makes anyway is detected and offered for revert), Patch (edit plus diff-review, the default), and Direct (changes apply immediately with a one-click revert)."}
{"type": "fact", "id": "permission-tiers-real-enforcement", "text": "Since v0.4.0 (shipped 2026-06-27), and unchanged in v0.5.0, EveGlyph Editor's three permission tiers (Cautious/Standard/Trusted) flow from the frontend to the local bridge and map to actual CLI flags: Claude Code --permission-mode plus a tool allow-list (enforced at all three tiers), Codex exec --full-auto or --dangerously-bypass-approvals-and-sandbox at Trusted, and Gemini --approval-mode or --yolo at Trusted (Codex and Gemini share CLI flags between Cautious and Standard, which differ by prompt clause). This replaced the v0.3 behavior where the same three tier names only varied a prompt capability clause and were advisory, not sandboxed."}
{"type": "fact", "id": "ai-providers", "text": "EveGlyph Editor supports three AI provider paths: Anthropic (Claude), any OpenAI-compatible endpoint, and a local CLI agent (Claude Code, Codex, or Gemini). The cloud providers (Anthropic, OpenAI-compatible) never touch the local filesystem; only the local-agent path edits files, and only on the machine where EveGlyph Editor is running."}
{"type": "concept", "id": "eveglyph-workspace-memory", "text": "EveGlyph Editor supports a gitignored, per-workspace .eveglyph/ directory holding rules.md, glossary.md, and memory/pitfalls.md plus memory/recent.md. A context compiler (src/context.js) assembles these files into the prompt sent to the local agent on every run. If .eveglyph/rules.md is present, it is injected verbatim with elevated authority ('follow these before anything else'); these files are trusted-but-attacker-controllable configuration in an unfamiliar workspace."}
{"type": "concept", "id": "aimdc-computable-documents", "text": "AIMD-C makes a Markdown document compute. Blocks aimd-value, aimd-function, aimd-compute, aimd-assert, aimd-table and aimd-view define typed values, pure functions, a real dependency graph, assertions and computed results that re-evaluate live as the document is edited. A block's result is referenced anywhere in the document as @id.field, or inline in prose as {{ id.field }}. Wrong types and circular references are caught and reported, not silently ignored. AIMD-C replaced an earlier '::: aimd :::' block syntax (Logic_Node / Coupling Node)."}
{"type": "fact", "id": "aimdc-evaluator-no-eval", "text": "AIMD-C expressions are evaluated by a closed-grammar evaluator (src/aimdc/evaluator.js) with no eval and no Function constructor, in the live preview, in PDF export and in the MCP evaluate_aimdc tool. A malformed or adversarial AIMD-C block can only produce a parse or type error; it is not handed filesystem, network, process or credential authority."}
{"type": "concept", "id": "dynamic-logic", "text": "Dynamic Logic adds aimd-claim, aimd-evidence, aimd-judgment and aimd-history blocks on top of AIMD-C (it is not a second math engine). A deterministic reducer tracks each judgment through open, generating, and provisionally true/false, and reopens a closed judgment when later evidence drifts back across its closure threshold. The browser offers UI-local replay (previous / next / Live) that never rewrites Markdown or touches disk, plus autoplay that advances one real evidence step per tick; motion fires only on an actual value change and prefers-reduced-motion is respected. An externalRefs bridge lets AIMD-C {{ }} and aimd-view syntax read a judgment's values; local ids take precedence."}
{"type": "fact", "id": "math-rendering-layers", "text": "Math in the preview renders with KaTeX first. A formula KaTeX cannot render gets one more try through MathJax, loaded lazily only when needed (covering gaps such as the multline environment and \\ce chemistry notation). Recognized syntax aliases are quietly rewritten before rendering (Safe Rewrite) with a note above the preview. A formula that still fails, or partially degrades, is reported in a diagnostics panel above the preview and logged to the Monitor tab instead of disappearing silently."}
{"type": "fact", "id": "visual-ir-chart-plot", "text": "Visual IR blocks render as hand-built SVG in the preview: '::: chart {type=bar|line|pie}' for self-contained data and '::: plot {domain=[a, b]}' for a function's curve; an aimd-view with renderer chart can visualize a computed AIMD-C table. PDF export of chart and plot blocks is not built."}
{"type": "fact", "id": "typst-pdf-export", "text": "A PDF button compiles the active Markdown document into a real typeset PDF using a WebAssembly build of the Typst compiler bundled with the app and served locally; nothing is uploaded. Frontmatter selects a theme (typst_theme: evemiss-serif-light, the default, or evemiss-classic-light) and a layout (typst_layout: technical-whitepaper, the default, academic-paper, or long-form-book). AIMD-C blocks export as typeset output, Theorem/Lemma/Definition callouts are numbered, and Traditional Chinese renders with bundled fonts. The first export in a session downloads about 51 MB (compiler and fonts), cached afterwards. The browser Print / Save-as-PDF path still exists separately."}
{"type": "component", "id": "mcp-servers", "text": "mcp-server.js is a standalone stdio MCP server; mcp-server-remote.js serves the same tools over HTTP bound to 127.0.0.1 only, with a mandatory bearer token (EVEGLYPH_MCP_TOKEN, 16+ characters, constant-time comparison) and stateless per-request handling. Reaching the HTTP server from another machine requires the user to tunnel it. Settings > Enable remote MCP server starts and stops it from the app. Both require an explicit workspace root argument and confine file paths to it. Neither is publicly hosted."}
{"type": "fact", "id": "mcp-tools", "text": "The MCP servers expose eleven tools: list_files, read_file, write_file, evaluate_aimdc, validate_world_ir, get_publication_capabilities, inspect_document, validate_document, render_document, get_render_artifact, get_render_report. The six publication tools are read-only by annotation and never modify the workspace or source."}
{"type": "component", "id": "mcp-publication-runtime", "text": "The MCP publication runtime inspects and validates canonical EveGlyph/Markdown source and renders it to a temporary PDF artifact through a headless Typst compiler, sharing the markdown-to-Typst conversion with the browser export. Profiles: evemiss-whitepaper-v1 (default; theme evemiss-serif-light, layout technical-whitepaper) and evemiss-academic-v1 (theme evemiss-serif-light, layout academic-paper). Artifacts are process-scoped, expire after 30 minutes, are capped at 64 MiB each and 256 MiB in total, and come with source and artifact SHA-256 hashes in a render report. Single-document rendering only."}
{"type": "fact", "id": "mcp-write-file-no-review", "text": "The MCP write_file tool writes immediately and UTF-8 encodes the content; it has no snapshot/diff/Accept step of its own, because an MCP host is expected to gate each tool call with its own approval UI. Over the tunneled remote HTTP server, a leaked bearer token means direct, un-reviewed read/write access to the opened workspace; treat the token like a password."}
{"type": "component", "id": "desktop-app", "text": "The Windows desktop app (desktop/) is an Electron 44 shell over the same bridge and built frontend: a loopback-only server on 127.0.0.1 (preferred port 47831) mounts the bridge and dist/, every /api request must carry a random per-launch token (X-EveGlyph-Desktop) that only the app's own window adds, and the window runs with contextIsolation and sandbox on, no Node integration, and opens other sites in the default browser. Release assets: a per-user NSIS installer (no administrator rights) and a zip, both unsigned (Windows SmartScreen may warn), published with SHA-256 checksums. API keys stay in the app profile's local storage in plaintext; git must be installed for diff review. There is no macOS or Linux build and no auto-update."}
{"type": "concept", "id": "capability-document-only-profile", "text": "AIMD-C computation enters through a deny-by-default capability control plane (src/capabilities/). The default document-only profile grants only document.read.self on document:self, document.compute on document:self, and ephemeral.output on execution:*. The document runtime receives no filesystem, network, process, host-environment or credential object. 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; read does not imply write; unknown capabilities and profiles fail closed; expired grants do not authorize; a once grant is consumed after first use. Every allow/deny decision records actor-aware audit evidence."}
{"type": "fact", "id": "capability-scope-honesty", "text": "The capability layer is control-plane groundwork, not an OS or process sandbox, and it does not claim to make arbitrary native code safe. src/capabilities/mcp-map.js records the authority each MCP tool would need, but there is no user-facing grant-acquisition flow yet: workspace MCP tools keep their existing transport-level behavior and remote MCP still uses a bearer token."}
{"type": "concept", "id": "world-ir-studio", "text": "Opening a .yaml/.yml file that begins with kind: state_machine, entity or entity_list renders it visually (clickable SVG state machine, editable entity form, list table) with an inline validator; the file stays plain YAML. The advanced surface (Runtime, World, Studio, editable World IR Preview) is off by default (Settings > Enable World Studio). The Studio tab asks the configured cloud AI provider for a bounded state-machine draft, parsed and validated locally with hard size limits; an invalid draft cannot be applied and applying a valid one changes only the editor buffer until the user explicitly saves."}
{"type": "fact", "id": "search-and-assist", "text": "Search has two separate modes: exact string/regex search and replace (current file or workspace; workspace replace goes through a git snapshot and diff), and an AI semantic search that ranks and quotes relevant passages using the configured cloud provider. A RigorLoop audit preset 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; it is not a theorem prover and not an LLM."}
{"type": "fact", "id": "encoding-aware-io", "text": "EveGlyph Editor detects a file's encoding on open (jschardet) and preserves it on save (iconv-lite: Big5, GBK, Shift-JIS and others). A per-file status-bar menu re-reads or converts the encoding; Settings > Default encoding is the fallback when detection is uncertain and the encoding for new files."}
{"type": "fact", "id": "interface-and-themes", "text": "The interface is available in English and 繁體中文 (Settings > Language; AI prompt text, Monitor payloads and document content are never translated). Themes: Dark, Light, Studio, Paper and Midnight, plus a user Custom CSS file loaded after the app's own styles, a full h1-h6 preview heading scale, and drag-resizable panes whose widths persist."}
{"type": "fact", "id": "license", "text": "EveGlyph Editor's source code is licensed under the MIT License. Copyright (c) 2026 EVEMISS TECHNOLOGY CO., LTD. (一言諾科技有限公司), author Neo.K (許筌崴), Taipei, Taiwan. It is not Apache-2.0."}
{"type": "fact", "id": "version", "text": "The current version of EveGlyph Editor is v0.5.0, a preview, described in its own README and package.json as a local prototype, pre-1.0; its source was published on 2026-10-05 and it also ships as an unsigned Windows desktop app. The previous release, v0.4.0, shipped 2026-06-27."}
{"type": "route", "id": "source-access", "path": "https://github.com/kakon77777-commits/EveMissLab-eveglyph-editor", "text": "The source is public on GitHub under the MIT License. A Windows desktop app (unsigned installer and zip) is attached to its GitHub Releases (see https://eveglypheditor.com/ai/source-access.md). The browser demo and published documentation remain available."}
{"type": "route", "id": "canonical-domain", "path": "https://eveglypheditor.com", "text": "The canonical domain for the EveGlyph Editor project website."}
{"type": "component", "id": "bridge-local-only", "text": "vite-agent-bridge.js is a Vite plugin declared apply: 'serve', exposing /api/* endpoints for filesystem I/O, encoding detection, git diff-review, and agent spawning. Vite mounts it under 'npm run dev'; the Windows desktop app mounts the same code on a loopback-only server and additionally requires a per-launch token. It runs only on a user's own machine, is never part of a production web build, and is never publicly hosted or network-reachable. There is no public HTTP/REST API for eveglypheditor.com or the product."}
{"type": "component", "id": "bridge-isLocalRequest", "text": "Every /api request in EveGlyph Editor's local bridge is gated by isLocalRequest: the Host header must be localhost, 127.0.0.1, or ::1, and if an Origin header is present its hostname must also be local; otherwise the request is rejected with HTTP 403. This blocks CSRF and DNS-rebinding attacks from a malicious web page. The gate is header-based and is not a substitute for network isolation: do not start the dev server with --host on an untrusted network."}
{"type": "component", "id": "bridge-resolveInside", "text": "resolveInside confines all file-read and file-write target paths in EveGlyph Editor's local bridge to the workspace root; any path that would resolve outside the workspace root is rejected."}
{"type": "component", "id": "bridge-confirmedWorkspace", "text": "EveGlyph Editor's local bridge pins every workspace-scoped operation (file I/O, the four /api/git/* endpoints, and /api/agent spawning) to the single folder recorded as confirmedWorkspace when the user opened it. assertWorkspace(cwd) rejects any request whose working directory is not that folder or a descendant, before any operation runs."}
{"type": "fact", "id": "api-key-storage", "text": "EveGlyph Editor stores cloud-provider API keys in the browser's localStorage under the key eveglyph_cfg, in plaintext. This is not secure storage and should not be used on a shared or untrusted machine. The Windows desktop app keeps them in its profile's local storage, also in plaintext; moving keys to the OS keychain is not done."}
{"type": "fact", "id": "agent-spawn-safety", "text": "EveGlyph Editor delivers the agent's prompt to the spawned local CLI over stdin, never as a command-line argument, so prompt text is never interpreted as shell syntax or command-line flags. It also enforces a hard 180-second timeout on the spawned agent process; the child process is killed on timeout, on the user pressing Stop, or on the connection closing."}
{"type": "fact", "id": "telemetry-local-only", "text": "EveGlyph Editor sends no telemetry. A best-effort diagnostic stream is appended to a local JSONL file in the OS temp directory (rolled at 5 MB; override with EVEGLYPH_MONITOR_FILE) and read by the Monitor tab. Files stay on the user's machine; only content the user sends to a cloud AI provider they configured leaves it."}
{"type": "fact", "id": "not-shipped", "text": "Not shipped in v0.5.0: a code-signed installer or auto-update; a macOS or Linux desktop build (the earlier Tauri idea was not pursued; the desktop app uses Electron); OS-keychain API-key storage; a Pandoc export pipeline; PDF export of chart and plot blocks; a user-facing capability-grant flow or identity-aware MCP authorization; an OS-level sandbox; partial-accept or per-hunk staging in diff review; any hosted or public API."}
{"type": "fact", "id": "verification", "text": "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 its browser renderer."}
{"type": "rights", "id": "rights-scope-distinction", "text": "EveGlyph Editor's rights-spectrum.json (AIRS/AILP) governs how AI systems may learn from eveglypheditor.com's written content (marketing prose, corpus docs, governance docs) — it does not restrict the separately MIT-licensed source code, which is already broadly reusable, including for AI training, under MIT's own terms."}
{"type": "rights", "id": "rights-non-commercial", "text": "Under EveGlyph Editor's AI rights spectrum, non-commercial AI training, embedding storage, and summarization of the website's written content are highly permitted (0.8 by default site-wide, raised to 1.0 for content under /ai/ and /ai/corpus/), with attribution and citation required."}
{"type": "rights", "id": "rights-commercial-license-required", "text": "Under EveGlyph Editor's AI rights spectrum, commercial AI training, fine-tuning, and distillation on the website's written content are marked license_required, needing a paid license agreement, compensation, and attribution. Licensing contact: kakon77777@evemisslab.com."}
{"type": "rights", "id": "rights-prohibited", "text": "Under EveGlyph Editor's AI rights spectrum, verbatim memorization, style imitation, and long-quote/substitutive generation of the website's written content are set to 0.0 (not allowed)."}
