Skip to content

feat: Markdown-vault + OPML import/export#26

Merged
hyperpolymath merged 2 commits into
mainfrom
claude/project-scope-planning-5zoaze
Jul 3, 2026
Merged

feat: Markdown-vault + OPML import/export#26
hyperpolymath merged 2 commits into
mainfrom
claude/project-scope-planning-5zoaze

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

First of four follow-up PRs completing the roadmap (order: Import/export → Accessibility+PWA → Differentiators → Usable canvas). This one makes a Nexia notebook portable — data is never trapped in the app's JSON, and existing Obsidian users can trial it at zero cost.

What's added

Core (Rust)

  • core/src/wikilink.rs — a total, fuzz-safe [[Title]] / [[Title|alias]] parser. Byte offsets are always valid char boundaries (property-tested on arbitrary input). Reused later by the editor autocomplete in the Differentiators PR.
  • core/src/exchange.rs
    • to_markdown: one file per note (YAML-ish front-matter, body, a ## Links section of [[Title]]).
    • to_opml: OPML 2.0, XML-escaped.
    • from_markdown_vault: title from # H1 or filename; [[Title]] resolved case-insensitively against titles; unresolved targets become placeholder notes (Obsidian semantics); backlinks rebuilt.
    • Round-trip preserves titles and link topology.
  • core/src/wasm.rsexport_markdown / export_opml / import_markdown_vault bindings.

UI (ReScript) — no npm zip library, honouring the Deno-only policy

  • ui/src/store/vault.js — File System Access showDirectoryPicker() writes one .md per note where available (Chromium), else a single concatenated-bundle download; OPML download; webkitdirectory folder picker for import.
  • ui/src/store/{WasmStore,Exchange}.res — bind the three ops; async effects resolve through Dispatcher (NotebookLoaded / SetError).
  • Msg/Update/ViewExportMarkdown / ExportOpml / ImportVault messages + toolbar buttons.

Verified

  • cargo test — 28 tests incl. new property tests (parser + import are total; round-trip preserves topology).
  • deno task test:ui — 6 tests incl. the new cross-boundary exchange contract (export shape, round-trip, placeholder creation).
  • E2E (headless Chromium): toolbar renders Import / Export MD / Export OPML, and Export OPML triggers a real .opml download.

Known-red estate governance checks (ReScript-language ban, scorecard staleness) are pre-existing policy on main and out of scope, as in #24.

🤖 Generated with Claude Code

https://claude.ai/code/session_01PAEqVP7Y3bZDhtAaPUTbps


Generated by Claude Code

Adds portable import/export so a notebook is never trapped in Nexia's
JSON, and existing PKM users (Obsidian) can try it with zero cost.

Core (Rust):
- wikilink.rs: total, fuzz-safe [[Title]] / [[Title|alias]] parser (byte
  offsets are always valid char boundaries) — reused later by the editor
  autocomplete.
- exchange.rs: to_markdown (one file per note, front-matter + body + a
  ## Links section of [[Title]]), to_opml (OPML 2.0, XML-escaped), and
  from_markdown_vault (title from # H1 or filename; [[Title]] resolved
  case-insensitively; unresolved targets become placeholder notes, per
  Obsidian). Round-trip preserves titles + link topology.
- wasm.rs: export_markdown / export_opml / import_markdown_vault.
- tests/exchange.rs: proptest — parser + import are total; round-trip
  preserves topology.

UI (ReScript), no npm zip lib (Deno-only):
- store/vault.js: File System Access showDirectoryPicker() to write one
  .md per note, else a single concatenated-bundle download; OPML
  download; webkitdirectory vault picker for import.
- store/WasmStore.res + store/Exchange.res: bind the three ops; effects
  resolve through Dispatcher (NotebookLoaded / SetError).
- Msg/Update/View: ExportMarkdown / ExportOpml / ImportVault + toolbar
  buttons.
- tests/exchange.test.js: contract test across the wasm boundary
  (export shape, round-trip, placeholder creation).

Verified: cargo test (28 incl. new property tests), deno test:ui (6),
E2E — toolbar renders Import/Export MD/Export OPML and Export OPML
downloads a .opml.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PAEqVP7Y3bZDhtAaPUTbps
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 56 issues detected

Severity Count
🔴 Critical 1
🟠 High 23
🟡 Medium 32

⚠️ Action Required: Critical security issues found!

View findings
[
  {
    "reason": "Issue in boj-build.yml",
    "type": "missing_timeout_minutes",
    "file": "boj-build.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in casket-pages.yml",
    "type": "missing_timeout_minutes",
    "file": "casket-pages.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in casket-pages.yml",
    "type": "missing_timeout_minutes",
    "file": "casket-pages.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in codeql.yml",
    "type": "missing_timeout_minutes",
    "file": "codeql.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in dogfood-gate.yml",
    "type": "missing_timeout_minutes",
    "file": "dogfood-gate.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in dogfood-gate.yml",
    "type": "missing_timeout_minutes",
    "file": "dogfood-gate.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in dogfood-gate.yml",
    "type": "missing_timeout_minutes",
    "file": "dogfood-gate.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in dogfood-gate.yml",
    "type": "missing_timeout_minutes",
    "file": "dogfood-gate.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in dogfood-gate.yml",
    "type": "missing_timeout_minutes",
    "file": "dogfood-gate.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in hypatia-scan.yml",
    "type": "missing_timeout_minutes",
    "file": "hypatia-scan.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

Deno 2 removed the `window` global; `deno lint` rejects it. In browsers
globalThis === window, so showDirectoryPicker resolves identically.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PAEqVP7Y3bZDhtAaPUTbps
@sonarqubecloud

sonarqubecloud Bot commented Jul 3, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 56 issues detected

Severity Count
🔴 Critical 1
🟠 High 23
🟡 Medium 32

⚠️ Action Required: Critical security issues found!

View findings
[
  {
    "reason": "Issue in boj-build.yml",
    "type": "missing_timeout_minutes",
    "file": "boj-build.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in casket-pages.yml",
    "type": "missing_timeout_minutes",
    "file": "casket-pages.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in casket-pages.yml",
    "type": "missing_timeout_minutes",
    "file": "casket-pages.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in codeql.yml",
    "type": "missing_timeout_minutes",
    "file": "codeql.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in dogfood-gate.yml",
    "type": "missing_timeout_minutes",
    "file": "dogfood-gate.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in dogfood-gate.yml",
    "type": "missing_timeout_minutes",
    "file": "dogfood-gate.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in dogfood-gate.yml",
    "type": "missing_timeout_minutes",
    "file": "dogfood-gate.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in dogfood-gate.yml",
    "type": "missing_timeout_minutes",
    "file": "dogfood-gate.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in dogfood-gate.yml",
    "type": "missing_timeout_minutes",
    "file": "dogfood-gate.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in hypatia-scan.yml",
    "type": "missing_timeout_minutes",
    "file": "hypatia-scan.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

@hyperpolymath
hyperpolymath marked this pull request as ready for review July 3, 2026 01:08
@hyperpolymath
hyperpolymath merged commit ccdceeb into main Jul 3, 2026
22 of 24 checks passed
@hyperpolymath
hyperpolymath deleted the claude/project-scope-planning-5zoaze branch July 3, 2026 01:09
hyperpolymath added a commit that referenced this pull request Jul 3, 2026
* feat: agents (saved queries) + graph view

The two self-contained namesake differentiators. (Wiki-link *editing*
moves to the next PR alongside the manual link-creation picker, where the
link-reconciliation logic belongs; the [[…]] parser landed in #26.)

Agents — the feature Nexia is named for:
- core/src/agent.rs: an Agent { id, name, query } plus a total,
  whitespace-separated query DSL (bare text over title+content,
  title:word, attr:key=value, linksto:<uuid>), ANDed; an empty query
  matches nothing. Notebook gains a persisted (serde-default) agents
  list with add/remove/run_agent/run_query.
- wasm bindings: agents / add_agent / remove_agent / run_agent /
  run_query.
- UI: an Agents panel in the sidebar (add form + list); clicking an
  agent shows only its collected notes, and the collection stays live —
  every update() re-runs the active agent so adding a matching note
  grows it immediately.

Graph view (replaces the "coming soon" placeholder):
- GraphLayout.res: a pure, deterministic circular layout (static — no
  animation, friendly to prefers-reduced-motion; coordinates always
  finite and in-box). SVG render with clickable, keyboard-focusable
  nodes (role=button) and link edges; a new Graph toolbar button.

Verified: cargo test (28 unit incl. agent DSL + persistence; property +
golden suites); deno test:ui (9, incl. new agents contract across the
wasm boundary and graph-layout geometry); deno lint + cargo fmt/clippy
(-D warnings, wasm feature) clean. E2E (headless Chromium): an agent
collects its 2 matching notes and grows to 3 live when a match is added;
the graph renders nodes + edges; axe-core still reports 0 serious/
critical WCAG 2.2 AA violations with the agents panel present.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PAEqVP7Y3bZDhtAaPUTbps

* fix(ui): use RescriptCore Dict, not deprecated Js.Dict, in GraphLayout

Clears the Hypatia code-scanning deprecated_api alert on the new file.
Dict.t and Js.Dict.t are the same underlying dict<'a>, so consumers are
unaffected.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PAEqVP7Y3bZDhtAaPUTbps

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants