From 22e08e340abbcc2757377cab3ca43e028ef850ed Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 16:30:40 -0500 Subject: [PATCH 01/27] feat(opener): hand stored pdfs to formpdf by command line FormPDF takes a PDF path as its launch argument and forwards a second launch to the open window, so FormCite uses that, with the system viewer as the fallback. Linked files and non-PDFs stay with the system viewer. Docs and log updated. --- backend/HASHOUT_LOG.md | 4 +++ backend/app/services/opener.py | 50 +++++++++++++++++++++++++++++----- docs/WINDOW.md | 4 ++- 3 files changed, 50 insertions(+), 8 deletions(-) diff --git a/backend/HASHOUT_LOG.md b/backend/HASHOUT_LOG.md index 5f5de2e..0a8a5d4 100644 --- a/backend/HASHOUT_LOG.md +++ b/backend/HASHOUT_LOG.md @@ -1677,3 +1677,7 @@ New in v0.10.0 (2026-11-27). `keywords_as_tags` (off by default) tags each item ## app/services/titles.py, app/routers/titles.py, app/cli.py {#app-titles} New in v0.10.0 (2026-11-27). "Untitled" is a live item whose `title`, trimmed of space, tab, CR and LF in SQL, is empty. Suggestions read only the item, its attachments and notes, never the network; order is short title, abstract first sentence, cleaned file name, event, series or book title differing from the container, container plus year, note first sentence, family plus year plus type, publisher plus type (no creator only), citation key. Near-duplicates compare `casefold` with every non-word character removed. A citation key equal to family plus year, or a placeholder such as `empty1`, `doi2017`, `filed2022`, `zz`, is dropped. Suggestions are cut at 90 characters on a word boundary. `title-lookup` resolves the first identifier in DOI, ISBN, arXiv, PMID order outside the library lock, so a slow service does not block the library; `NetworkOff` and `NetworkError` are `Invalid`, so they come back as 422 with the reason. `items.update` still accepts an empty title when the held title is empty, so `titles set` refuses an empty title itself and the window checks before it sends. The BibTeX importer does not map `eprint`/`archiveprefix` to an arXiv id, so an arXiv entry imported from BibTeX gets no Look it up. Checked with 12 untitled BibTeX entries on a fresh data folder: 0 to 4 suggestions each, 10 of 12 with at least one, the two with none hold only a year or nothing. The twelve style regression cases pass. + +## app/services/opener.py {#app-open-in-formpdf} + +Opening a stored PDF attachment now hands it to FormPDF by launching the install with the file path as its argument, an argv list and never a shell string. FormPDF 0.61 supports exactly this: its desktop shell reads `.pdf` paths from its command line (`src-tauri/src/main.rs` `from_args`), forwards the arguments of a second launch to the running window through the single-instance plugin, and on macOS receives them from `open -a` as `RunEvent::Opened`. Its HTTP `open-path` route is not used: `WindowKeyGuard` refuses every write without the window key, which is why FormTxt's hand-off to port 8198 gets a 403. The launch waits two seconds; an exit with a non-zero code, or a launch that fails, falls back to the system viewer and says why in `formpdf.reason`. Only copied or moved PDFs go: a linked file lives outside the library and a non-PDF is not something FormPDF opens, so both use the system viewer with a reason. `opened_with` is now `formpdf` or `system`. Run with stand-in scripts for FormPDF (one logging its argument, one exiting 3): the PDF reached the logging script as the stored path, the other cases fell back with the right reason. Not run: a real FormPDF, macOS `open -a`, Windows. diff --git a/backend/app/services/opener.py b/backend/app/services/opener.py index f632538..d74b8dc 100644 --- a/backend/app/services/opener.py +++ b/backend/app/services/opener.py @@ -9,10 +9,11 @@ FORMPDF_ENV = "FORMCITE_FORMPDF_APP" FORMPDF_BUNDLES = (Path("/Applications/FormPDF.app"), Path.home() / "Applications" / "FormPDF.app") -NO_HANDOFF = ( - "FormPDF has no way yet to take a file from another app: its open-path route needs FormPDF's own window key, " - "so FormCite opened the file in the system viewer." -) +HANDOFF_WAIT = 2.0 +NOT_PDF = "only a PDF is handed to FormPDF, so FormCite opened the file in the system viewer." +NOT_STORED = "a linked file lives outside the library, so FormCite does not hand it to another app and opened it in the system viewer." +NOT_FOUND = "FormPDF was not found on this computer, so FormCite opened the file in the system viewer." +FAILED = "FormPDF did not take the file ({why}), so FormCite opened it in the system viewer." def formpdf_install() -> str | None: @@ -53,13 +54,48 @@ def open_system(path: Path) -> None: raise Invalid(f"the system viewer could not be started: {exc}") from exc +def formpdf_argv(install: str, path: Path) -> list[str]: + if sys.platform == "darwin" and Path(install).is_dir(): + return ["open", "-a", install, str(path)] + return [install, str(path)] + + +def hand_to_formpdf(install: str, path: Path) -> str | None: + try: + proc = subprocess.Popen( + formpdf_argv(install, path), stdin=subprocess.DEVNULL, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, start_new_session=True + ) + except (OSError, ValueError) as exc: + return str(exc) + try: + code = proc.wait(timeout=HANDOFF_WAIT) + except subprocess.TimeoutExpired: + return None + return None if code == 0 else f"it exited with code {code}" + + def open_attachment(attachment_id: str) -> dict: + with session() as (lib, conn): + linked = attachments.get(conn, attachment_id)["mode"] == "link" path = stored_path(attachment_id) install = formpdf_install() - open_system(path) + reason = "" + used = False + if install is None: + reason = NOT_FOUND + elif linked: + reason = NOT_STORED + elif path.suffix.lower() != ".pdf": + reason = NOT_PDF + else: + why = hand_to_formpdf(install, path) + used = why is None + reason = "" if used else FAILED.format(why=why) + if not used: + open_system(path) return { "id": attachment_id, "path": str(path), - "opened_with": "system", - "formpdf": {"found": install is not None, "path": install, "used": False, "reason": NO_HANDOFF}, + "opened_with": "formpdf" if used else "system", + "formpdf": {"found": install is not None, "path": install, "used": used, "reason": reason}, } diff --git a/docs/WINDOW.md b/docs/WINDOW.md index 2915451..ddbbc00 100644 --- a/docs/WINDOW.md +++ b/docs/WINDOW.md @@ -68,7 +68,9 @@ Each switch saves itself as soon as you change it. An attachment listed in the detail pane has an **Open** action. FormCite opens the stored file (or, for a linked file, the file where it lives) in the system's own viewer: `xdg-open` on Linux, `open` on macOS, the default program on Windows. -Opening in FormPDF is not available yet. FormCite looks for a FormPDF install (the `FORMCITE_FORMPDF_APP` setting, or `FormPDF.app` in Applications on macOS) and reports whether it found one, but FormPDF can not yet accept a file from another app without its own window key, so the system viewer is used either way. The answer to the open request says which viewer was used and why. +A stored PDF opens in FormPDF when FormPDF is installed. FormCite looks for it (the `FORMCITE_FORMPDF_APP` setting, or `FormPDF.app` in Applications on macOS) and starts it with the file's path as its argument (`open -a FormPDF.app FILE` on macOS, `FormPDF FILE` elsewhere), which is how FormPDF takes a file from outside: its desktop app reads PDF paths from its command line and passes a second launch to the window already open. FormCite waits two seconds, and if the launch fails or exits with an error it opens the system viewer instead. These files always use the system viewer: a file that is not a PDF, a linked file (it lives outside the library, so FormCite does not hand it to another app), and any file when FormPDF is not found. The answer to the open request says which viewer was used and, when it was the system viewer, why. This was run here with stand-in programs only; FormPDF itself, macOS `open -a` and Windows were not run. + +FormPDF's HTTP route `POST /api/pdf/open-path` is not used. FormPDF's `WindowKeyGuard` (`backend/app/core/window_key.py`) refuses every write that lacks FormPDF's own window key, except `/mcp` and `/api/window/key`, so a call from another app gets a 403. That is also why FormTxt's "Sign in FormPDF" hand-off (`sign_handoff` in `backend/app/services/versions_docs.py`, which posts to `127.0.0.1:8198` with no key) is refused today. If the owner wants a route a sibling app can call, the smallest change in FormPDF is a new open route for sibling apps, for example `POST /api/pdf/open-from-app`, taking `{path}` (an absolute path to a `.pdf`), added to `OPEN` in `window_key.py` and guarded by a FormPDF service token that the person approves, as FormCite's cite service does; it would reuse the existing `open_path` handler and tell the window to show the document. The argument route above needs none of this and is what FormCite uses. Only the window can open files: the request is refused without the window's key. From 4489965a2c0c4e1596c6f98df91595985e9e36ec Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 16:30:45 -0500 Subject: [PATCH 02/27] feat(setup): prefer a prebuilt style wheel and gate a built one setup/build_style installs a prebuilt formcite_style wheel when one fits the platform, builds from source with Rust otherwise or on --from-source, and with --wheel builds a locked release wheel and refuses it unless the style regression set passes. --- setup/build_style | 44 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 3 deletions(-) diff --git a/setup/build_style b/setup/build_style index c0f8769..79ae70a 100755 --- a/setup/build_style +++ b/setup/build_style @@ -3,14 +3,52 @@ set -e source "$(dirname "$0")/lib.sh" fc_venv fc_rust_env -command -v cargo >/dev/null 2>&1 || fc_die "Rust is required for the style engine: https://rustup.rs" profile=(--release) +mode=auto +soft=0 for arg in "$@"; do case "$arg" in --dev) profile=() ;; + --from-source) mode=source ;; + --wheel) mode=wheel ;; + --soft) soft=1 ;; esac done +native="$FORMCITE_ROOT/native/formcite-style" +report_ready() { + python -c "import formcite_style as s; print('[formcite] style engine', s.engine_version(), 'ready:', len(s.styles()), 'bundled style names,', len(s.bundled_locales()), 'bundled locales')" +} +need_rust() { + command -v cargo >/dev/null 2>&1 && return 0 + [ "$soft" = 1 ] || fc_die "Rust is required to build the style engine from source: https://rustup.rs" + fc_say "no prebuilt style engine for this platform and no Rust to build one: formatting answers 503 until you run setup/build_style --from-source with Rust installed (https://rustup.rs)" + exit 0 +} +if [ "$mode" = auto ]; then + for dir in ${FORMCITE_STYLE_WHEELS:+"$FORMCITE_STYLE_WHEELS"} "$FORMCITE_ROOT/wheels" "$native/dist"; do + ls "$dir"/formcite_style-*.whl >/dev/null 2>&1 || continue + if pip install --quiet --force-reinstall --no-deps --no-index --find-links "$dir" formcite-style 2>/dev/null; then + fc_say "prebuilt style engine installed from $dir" + report_ready + exit 0 + fi + fc_say "the wheels in $dir do not fit this platform or Python" + done + fc_say "no prebuilt style engine for this platform; building it from source with Rust" + mode=source +fi +need_rust python -c "import maturin" 2>/dev/null || pip install "maturin>=1.15,<2" -cd "$FORMCITE_ROOT/native/formcite-style" +cd "$native" +if [ "$mode" = wheel ]; then + rm -f dist/formcite_style-*.whl + maturin build --release --locked --out dist + pip install --force-reinstall --no-deps --no-index --find-links dist formcite-style + report_ready + cd "$FORMCITE_ROOT/backend" + python -m app.style.regression.run || fc_die "the style regression set failed against the built wheel; this build would format citations differently and must not ship" + fc_say "style wheel passed the regression set: $(ls "$native"/dist/formcite_style-*.whl)" + exit 0 +fi maturin develop --locked "${profile[@]}" -python -c "import formcite_style as s; print('[formcite] style engine', s.engine_version(), 'ready:', len(s.styles()), 'bundled style names,', len(s.bundled_locales()), 'bundled locales')" +report_ready From 8d3d758f5417a6d6780e1a02b5e83f6cc8eccd94 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 16:31:06 -0500 Subject: [PATCH 03/27] feat(setup): install the style engine with the backend install_all now installs the style engine after the backend, from a prebuilt wheel when one fits and from source only with Rust or on --from-source, and says plainly when neither is possible. --- setup/install_all | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/setup/install_all b/setup/install_all index 2c9234d..4e78d7d 100755 --- a/setup/install_all +++ b/setup/install_all @@ -1,8 +1,19 @@ #!/usr/bin/env bash set -e source "$(dirname "$0")/lib.sh" +style_args=(--soft) +rest=() +for arg in "$@"; do + case "$arg" in + --from-source) style_args=(--from-source) ;; + *) rest+=("$arg") ;; + esac +done +set -- ${rest[@]+"${rest[@]}"} fc_say "installing backend" ( cd "$FORMCITE_ROOT/backend" && ./oc_install "$@" ) +fc_say "installing the citation style engine" +"$FORMCITE_ROOT/setup/build_style" "${style_args[@]}" fc_say "installing frontend" ( cd "$FORMCITE_ROOT/frontend" && ./oc_install "$@" ) fc_say "done. Boot with ./formcite" From 977392d0232efd8170d828f44e785e56413e21b3 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 16:31:06 -0500 Subject: [PATCH 04/27] build(setup): freeze a regression-gated style wheel into the engine freeze_backend builds the locked release wheel, refuses it unless the regression set passes, and bundles formcite_style as a hidden import so the frozen engine carries the module it loads by name. --- setup/freeze_backend | 3 +++ 1 file changed, 3 insertions(+) diff --git a/setup/freeze_backend b/setup/freeze_backend index 0993179..66e18fa 100755 --- a/setup/freeze_backend +++ b/setup/freeze_backend @@ -27,11 +27,14 @@ if [ "$os" = macos ]; then mode=--onedir [ -z "${APPLE_SIGNING_IDENTITY:-}" ] || extra+=(--codesign-identity "$APPLE_SIGNING_IDENTITY" --osx-entitlements-file "$FORMCITE_ROOT/src-tauri/entitlements.plist") fi +[ "${FORMCITE_STYLE_KEEP:-0}" = 1 ] || "$FORMCITE_ROOT/setup/build_style" --wheel +python -c "import formcite_style" 2>/dev/null || fc_die "the style engine module is not in backend/venv; the frozen engine would answer 503 on every format: run setup/build_style --wheel" rm -rf build/pyinstaller dist-engine pyinstaller --noconfirm --clean "$mode" --name formcite-engine \ --distpath dist-engine --workpath build/pyinstaller --specpath build/pyinstaller \ --add-data "$FORMCITE_ROOT/frontend/dist${sep}frontend_dist" \ --collect-submodules app --collect-submodules uvicorn \ + --hidden-import formcite_style \ "${extra[@]}" \ "$FORMCITE_ROOT/backend/formcite_engine.py" if [ "$os" = macos ]; then From e479899cbfe873da7ca04a4d334d9f5a49547f4d Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 16:31:13 -0500 Subject: [PATCH 05/27] fix(style): say in one line how to install a missing style engine The 503 reason now names ./formcite install, which takes a prebuilt module, and setup/build_style --from-source for a Rust build. --- backend/app/style/hayagriva_engine.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/app/style/hayagriva_engine.py b/backend/app/style/hayagriva_engine.py index 6f37cb7..8402f60 100644 --- a/backend/app/style/hayagriva_engine.py +++ b/backend/app/style/hayagriva_engine.py @@ -7,7 +7,7 @@ from app.style.engine import StyleEngineUnavailable -UNAVAILABLE = "The citation style engine is not built on this machine; run ./setup/build_style to build it." +UNAVAILABLE = "The citation style engine is not installed: run ./formcite install (setup/build_style --from-source builds it with Rust)." class HayagrivaEngine: From 150894891a23528f86f8d3fd16be91b48395b3c4 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 16:31:24 -0500 Subject: [PATCH 06/27] feat(appearance): follow the system theme A pre-paint script sets the theme before first paint, Preferences offers System, Light and Dark with the accent color, and older theme names map to dark. --- frontend/index.html | 55 ++++++------------------ frontend/src/engine/preferences.ts | 67 ++++++++++++++++++++++++++---- frontend/src/ui/app.ts | 8 +--- frontend/src/ui/preferences.ts | 4 +- 4 files changed, 74 insertions(+), 60 deletions(-) diff --git a/frontend/index.html b/frontend/index.html index 5817331..7e22f6d 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -7,58 +7,27 @@ FormCite diff --git a/frontend/src/engine/preferences.ts b/frontend/src/engine/preferences.ts index 7af8d65..e6c6ac8 100644 --- a/frontend/src/engine/preferences.ts +++ b/frontend/src/engine/preferences.ts @@ -1,4 +1,3 @@ -import { THEMES, readChoice, saveChoice, applyTheme } from '../ui/themes'; import type { Engine } from '.'; import { createLibrary, readCurrentLibrary, readLibraries, readNetLog, readNetwork, setContact, setNetworkEnabled, setServiceEnabled, useLibrary, @@ -9,22 +8,72 @@ export const LOG_ROWS = 12; export interface ThemeOption { id: string; label: string } -export const themeOptions = (): ThemeOption[] => Object.entries(THEMES).map(([id, t]) => ({ id, label: t.label })); +const KEY = 'formcite.theme'; +const OLD_DEFAULT_ACCENT = '#a077e0'; +const MODES: ThemeOption[] = [{ id: 'system', label: 'System' }, { id: 'light', label: 'Light' }, { id: 'dark', label: 'Dark' }]; +const isHex = (v: unknown): v is string => typeof v === 'string' && /^#[0-9a-fA-F]{6}$/.test(v); +const lightQuery = window.matchMedia('(prefers-color-scheme: light)'); + +export const themeOptions = (): ThemeOption[] => MODES; + +interface Appearance { theme: string; accentColor: string } + +export function normalizeMode(v: unknown): string { + if (v === 'system' || v === 'light' || v === 'dark') return v; + return typeof v === 'string' && v ? 'dark' : 'system'; +} + +function readAppearance(): Appearance { + try { + const s = JSON.parse(localStorage.getItem(KEY) || 'null') as Partial | null; + if (s && typeof s === 'object') return { theme: normalizeMode(s.theme), accentColor: isHex(s.accentColor) ? s.accentColor : '' }; + } catch (e) { + console.error('[appearance] read failed:', e); + } + return { theme: 'system', accentColor: '' }; +} + +function saveAppearance(a: Appearance): void { + try { + localStorage.setItem(KEY, JSON.stringify(a)); + } catch (e) { + console.error('[appearance] save failed:', e); + } +} + +export function applyAppearance(a: Appearance = readAppearance()): void { + const root = document.documentElement; + const mode = normalizeMode(a.theme); + const resolved = mode === 'system' ? (lightQuery.matches ? 'light' : 'dark') : mode; + if (root.dataset.theme !== resolved) root.dataset.theme = resolved; + if (root.dataset.themePref !== mode) root.dataset.themePref = mode; + if (isHex(a.accentColor) && a.accentColor.toLowerCase() !== OLD_DEFAULT_ACCENT) root.style.setProperty('--accent', a.accentColor); + else root.style.removeProperty('--accent'); +} + +export function setMode(mode: string): void { + const a = { ...readAppearance(), theme: normalizeMode(mode) }; + saveAppearance(a); + applyAppearance(a); +} + +lightQuery.addEventListener('change', () => { if (readAppearance().theme === 'system') applyAppearance(); }); export function currentAppearance(): { theme: string; accent: string } { - const c = readChoice(); - return { theme: c.theme, accent: c.accentColor }; + const c = readAppearance(); + const shown = c.accentColor || getComputedStyle(document.documentElement).getPropertyValue('--accent').trim(); + return { theme: c.theme, accent: isHex(shown) ? shown : '#9a8cff' }; } export function chooseTheme(engine: Engine, id: string): void { - engine.dispatch('theme.set', id); + engine.dispatch('theme.set', normalizeMode(id)); } export function chooseAccent(hex: string): void { - if (!/^#[0-9a-fA-F]{6}$/.test(hex)) return; - const choice = { ...readChoice(), accentColor: hex }; - saveChoice(choice); - applyTheme(choice); + if (!isHex(hex)) return; + const a = { ...readAppearance(), accentColor: hex }; + saveAppearance(a); + applyAppearance(a); } export function describeEntry(e: NetLogEntry): { when: string; what: string; result: string } { diff --git a/frontend/src/ui/app.ts b/frontend/src/ui/app.ts index 62593ff..8341739 100644 --- a/frontend/src/ui/app.ts +++ b/frontend/src/ui/app.ts @@ -12,7 +12,7 @@ import { mountSide } from './side'; import { mountTrash } from './trash'; import { mountTitles } from './titles'; import { bindStatus, watchEngine } from './status'; -import { applyTheme, readChoice, saveChoice } from './themes'; +import { setMode } from '../engine/preferences'; import { toast } from './toast'; const SHELL = ` @@ -84,11 +84,7 @@ export function mountApp(engine: Engine): void { mountTrash(engine, at('trash')); mountTitles(engine, at('titles')); mountPreferences(engine, at('preferences')); - engine.events.on('theme:changed', (theme) => { - const choice = { ...readChoice(), theme }; - saveChoice(choice); - applyTheme(choice); - }); + engine.events.on('theme:changed', (theme) => setMode(theme)); revealApp(); void start(engine); } diff --git a/frontend/src/ui/preferences.ts b/frontend/src/ui/preferences.ts index f5935bd..121d131 100644 --- a/frontend/src/ui/preferences.ts +++ b/frontend/src/ui/preferences.ts @@ -17,8 +17,8 @@ function shell(): string {

${icon('sliders', 14)}Appearance

-
-
+
+

${icon('link', 14)}Network

From 74ad404ff2c1ff3c25514db1d51d1c1303adcfc7 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 16:31:29 -0500 Subject: [PATCH 07/27] feat(tokens): adopt the family tokens and a light set The tokens now carry the family ground, sheet, surface, border, text, accent and type scale, with a light set under data-theme; the older names alias them. --- frontend/src/styles/tokens.css | 142 +++++++++++++++++++++++---------- 1 file changed, 99 insertions(+), 43 deletions(-) diff --git a/frontend/src/styles/tokens.css b/frontend/src/styles/tokens.css index 6019951..fd2a6dd 100644 --- a/frontend/src/styles/tokens.css +++ b/frontend/src/styles/tokens.css @@ -1,20 +1,54 @@ :root { color-scheme: dark; - --accent-color: #a077e0; - --accent-color-dim: #a077e033; - --accent-color-hover: color-mix(in srgb, var(--accent-color) 82%, #ffffff); - - --bg-primary: #111111; - --bg-secondary: #17151b; - --bg-tertiary: #222127; - --bg-node: #191919; - --border-color: #2a2a2a; - --border-light: #34333a; - --text-primary: #f7f7f7; - --text-secondary: #a4a4a4; - --text-muted: #717072; - --canvas-bg: #1c1b1d; - --grid-color: #5e5e60; + --ground: #08080a; + --ground-dot: rgba(255, 255, 255, 0.05); + --sheet: #0f0f12; + --surface: #141418; + --surface-2: #1b1b21; + --hover: rgba(255, 255, 255, 0.05); + --active: rgba(255, 255, 255, 0.085); + --border: rgba(255, 255, 255, 0.075); + --border-strong: rgba(255, 255, 255, 0.14); + --text: #e6e6e9; + --text-muted: #8d8d95; + --text-faint: #5d5d66; + --accent: #9a8cff; + --accent-wash: color-mix(in srgb, var(--accent) 14%, transparent); + --on-accent: #0c0b14; + --focus: color-mix(in srgb, var(--accent) 60%, transparent); + --shadow-pop: 0 16px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px var(--border-strong); + --shadow-sheet: 0 10px 30px rgba(0, 0, 0, 0.35); + --sheet-highlight: rgba(255, 255, 255, 0.035); + --radius-sheet: 14px; + --text-2xs: 10.5px; + --text-xs: 11.5px; + --text-sm: 12.5px; + --text-md: 14px; + --text-lg: 16px; + --text-xl: 22px; + --text-nav: 13.5px; + --weight-medium: 500; + --weight-semibold: 600; + --control: 28px; + --row: 28px; + --sidebar-w: 264px; + --topbar-h: 44px; + --icon: 16px; + + --accent-color: var(--accent); + --accent-color-dim: var(--accent-wash); + --accent-color-hover: color-mix(in srgb, var(--accent) 82%, #ffffff); + + --bg-primary: var(--sheet); + --bg-secondary: var(--surface); + --bg-tertiary: var(--surface-2); + --bg-node: var(--surface); + --border-color: var(--border); + --border-light: var(--border-strong); + --text-primary: var(--text); + --text-secondary: color-mix(in srgb, var(--text) 50%, var(--text-muted)); + --canvas-bg: var(--ground); + --grid-color: var(--ground-dot); --transition-fast: 0.15s ease; --transition-normal: 0.25s ease; @@ -43,12 +77,12 @@ --radius-lg: 10px; --radius-pill: 999px; - --font-ui: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', system-ui, sans-serif; - --font-mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, monospace; - --fs-11: 11px; - --fs-12: 12px; - --fs-13: 13px; - --fs-14: 14px; + --font-ui: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; + --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace; + --fs-11: var(--text-xs); + --fs-12: var(--text-sm); + --fs-13: var(--text-nav); + --fs-14: var(--text-md); --ctl-sm: 24px; --ctl-md: 28px; @@ -70,22 +104,21 @@ --fc-detail-w: 320px; --fc-conn-row-h: 104px; - --bg-hover: rgba(255, 255, 255, 0.06); - --text-on-accent: #fff; - --border-soft: rgba(255, 255, 255, 0.08); + --bg-hover: var(--hover); + --text-on-accent: var(--on-accent); + --border-soft: var(--border); - --surface-0: var(--bg-primary); - --surface-1: color-mix(in srgb, var(--bg-primary) 55%, var(--bg-tertiary)); - --surface-2: var(--bg-node); - --surface-raised: color-mix(in srgb, var(--bg-node) 70%, var(--text-primary) 8%); - --line-0: color-mix(in srgb, var(--bg-primary) 55%, #000); - --line-1: var(--border-color); - --line-2: var(--border-light); - --line-3: color-mix(in srgb, var(--border-light) 75%, var(--text-muted)); + --surface-0: var(--sheet); + --surface-1: var(--surface); + --surface-raised: var(--surface-2); + --line-0: var(--border); + --line-1: var(--border); + --line-2: var(--border-strong); + --line-3: color-mix(in srgb, var(--border-strong) 60%, var(--text-muted)); - --ok: #22c55e; + --ok: #4ade80; --warn: #fbbf24; - --danger: #ef4444; + --danger: #f87171; --danger-soft: #f87171; --danger-text: #fca5a5; --danger-fill: #dc2626; @@ -110,21 +143,44 @@ --line-0: var(--border-color); } -body.theme-light { +:root[data-theme="light"] { color-scheme: light; - --line-0: var(--border-color); - --surface-raised: color-mix(in srgb, var(--bg-node) 88%, var(--text-primary) 8%); - --bg-hover: rgba(0, 0, 0, 0.06); - --border-soft: rgba(0, 0, 0, 0.1); - --shadow-lg: 0 4px 14px rgba(96, 90, 70, 0.16); - --shadow-window: 0 18px 44px rgba(96, 90, 70, 0.22); + --ground: #f3f1ed; + --ground-dot: rgba(0, 0, 0, 0.07); + --sheet: #fdfcfa; + --surface: #f6f4f0; + --surface-2: #eeebe5; + --hover: rgba(0, 0, 0, 0.045); + --active: rgba(0, 0, 0, 0.075); + --border: rgba(0, 0, 0, 0.085); + --border-strong: rgba(0, 0, 0, 0.16); + --text: #1d1c1a; + --text-muted: #6c6963; + --text-faint: #9c988f; + --accent: #5a46e0; + --accent-wash: color-mix(in srgb, var(--accent) 10%, transparent); + --on-accent: #ffffff; + --accent-color-hover: color-mix(in srgb, var(--accent) 82%, #000000); + --ok: #15803d; + --warn: #b45309; + --danger: #c2410c; + --danger-soft: #c2410c; + --danger-text: #b42318; + --shadow-pop: 0 16px 40px rgba(40, 30, 10, 0.16), 0 0 0 1px var(--border-strong); + --shadow-sheet: 0 1px 2px rgba(40, 30, 10, 0.05), 0 10px 30px rgba(40, 30, 10, 0.06); + --sheet-highlight: rgba(255, 255, 255, 0.8); + --shadow-sm: 0 1px 3px rgba(40, 30, 10, 0.08); + --shadow-md: 0 4px 12px rgba(40, 30, 10, 0.1); + --shadow-lg: 0 4px 14px rgba(40, 30, 10, 0.14); + --shadow-window: 0 18px 44px rgba(40, 30, 10, 0.18); + --shadow-inset-hl: inset 0 1px 0 rgba(255, 255, 255, 0.8); } * { box-sizing: border-box; margin: 0; padding: 0; } body { font-family: var(--font-ui); - background: var(--bg-primary); - color: var(--text-primary); + background: var(--ground); + color: var(--text); -webkit-font-smoothing: antialiased; } button, [role="button"] { user-select: none; } From 46f86b0b8ff7ab6b5c94614f892c2622edf23024 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 16:31:34 -0500 Subject: [PATCH 08/27] ci(style): build the style wheel and run the regression set per platform A style job builds the locked release wheel on the five runners formcompiler uses, installs it into a Python with no other style module, runs the twelve-case regression set against it and keeps the wheel. --- .github/workflows/ci.yml | 46 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 626427e..4ad0242 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,3 +60,49 @@ jobs: done kill "$engine_pid" || true [ "$ok" = 1 ] + + style: + strategy: + fail-fast: false + matrix: + include: + - platform: macos-arm64 + runner: macos-latest + - platform: macos-x64 + runner: macos-15-intel + - platform: linux-x64 + runner: ubuntu-22.04 + - platform: linux-arm64 + runner: ubuntu-22.04-arm + - platform: windows-x64 + runner: windows-latest + name: style (${{ matrix.platform }}) + runs-on: ${{ matrix.runner }} + timeout-minutes: 30 + defaults: + run: + shell: bash + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + cache: pip + cache-dependency-path: backend/requirements.txt + - uses: dtolnay/rust-toolchain@stable + - name: Install the engine without a style module + run: pip install -r backend/requirements.txt "maturin>=1.15,<2" + - name: Build the locked release wheel + working-directory: native/formcite-style + run: maturin build --release --locked --out dist + - name: Install the built wheel + run: pip install --no-deps --no-index --find-links native/formcite-style/dist formcite-style + - name: Style regression set against the built wheel + working-directory: backend + run: python -m app.style.regression.run + - name: Keep the wheel + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 + with: + name: formcite-style-${{ matrix.platform }} + path: native/formcite-style/dist/formcite_style-*.whl + if-no-files-found: error From 012164a60680cdb3aca63b9f2def685df0a2fe41 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 16:32:22 -0500 Subject: [PATCH 09/27] feat(setup): give the windows twins the prebuilt style path and gate build_style.bat, install_all.bat and freeze_backend.bat now do what their bash twins do: prefer a fitting prebuilt wheel, build from source only with Rust or on --from-source, and freeze only a wheel that passed the regression set. --- setup/build_style.bat | 38 ++++++++++++++++++++++++++++++++++++-- setup/freeze_backend.bat | 4 ++++ setup/install_all.bat | 4 ++++ 3 files changed, 44 insertions(+), 2 deletions(-) diff --git a/setup/build_style.bat b/setup/build_style.bat index a22cc9c..970c52d 100644 --- a/setup/build_style.bat +++ b/setup/build_style.bat @@ -3,13 +3,47 @@ setlocal cd /d "%~dp0.." if not exist backend\venv\Scripts\activate.bat ( echo [formcite] backend venv missing, run formcite.bat install & exit /b 1 ) call backend\venv\Scripts\activate.bat -where cargo >nul 2>nul || ( echo [formcite] Rust is required for the style engine: https://rustup.rs & exit /b 1 ) +set "ROOT=%cd%" +set "NATIVE=%ROOT%\native\formcite-style" set "PROFILE=--release" +set "MODE=auto" +set "SOFT=0" for %%A in (%*) do ( if /i "%%A"=="--dev" set "PROFILE=" + if /i "%%A"=="--from-source" set "MODE=source" + if /i "%%A"=="--wheel" set "MODE=wheel" + if /i "%%A"=="--soft" set "SOFT=1" ) +if not "%MODE%"=="auto" goto build +for %%D in ("%FORMCITE_STYLE_WHEELS%" "%ROOT%\wheels" "%NATIVE%\dist") do ( + if not "%%~D"=="" if exist "%%~D\formcite_style-*.whl" ( + pip install --quiet --force-reinstall --no-deps --no-index --find-links "%%~D" formcite-style 2>nul && ( echo [formcite] prebuilt style engine installed from %%~D & goto ready ) + echo [formcite] the wheels in %%~D do not fit this platform or Python + ) +) +echo [formcite] no prebuilt style engine for this platform; building it from source with Rust +set "MODE=source" +:build +where cargo >nul 2>nul || goto norust python -c "import maturin" 2>nul || pip install "maturin>=1.15,<2" -pushd native\formcite-style +pushd "%NATIVE%" +if "%MODE%"=="wheel" goto wheel maturin develop --locked %PROFILE% || ( popd & exit /b 1 ) popd +goto ready +:wheel +if exist dist\formcite_style-*.whl del /q dist\formcite_style-*.whl +maturin build --release --locked --out dist || ( popd & exit /b 1 ) +pip install --force-reinstall --no-deps --no-index --find-links dist formcite-style || ( popd & exit /b 1 ) +popd +pushd "%ROOT%\backend" +python -m app.style.regression.run || ( popd & echo [formcite] error: the style regression set failed against the built wheel; this build would format citations differently and must not ship & exit /b 1 ) +popd +echo [formcite] style wheel passed the regression set +goto ready +:norust +if "%SOFT%"=="1" ( echo [formcite] no prebuilt style engine for this platform and no Rust to build one: formatting answers 503 until you run setup\build_style.bat --from-source with Rust installed ^(https://rustup.rs^) & exit /b 0 ) +echo [formcite] Rust is required to build the style engine from source: https://rustup.rs +exit /b 1 +:ready python -c "import formcite_style as s; print('[formcite] style engine', s.engine_version(), 'ready:', len(s.styles()), 'bundled style names,', len(s.bundled_locales()), 'bundled locales')" diff --git a/setup/freeze_backend.bat b/setup/freeze_backend.bat index 01fdb87..aeb4e35 100644 --- a/setup/freeze_backend.bat +++ b/setup/freeze_backend.bat @@ -8,6 +8,9 @@ python -c "import PyInstaller" 2>nul || ( echo [formcite] PyInstaller missing, r if not exist frontend\dist\index.html call setup\build_frontend.bat || exit /b 1 for /f "tokens=2" %%T in ('rustc -vV ^| findstr /b "host:"') do set "TRIPLE=%%T" if "%TRIPLE%"=="" ( echo [formcite] rustc not found, install Rust from https://rustup.rs & exit /b 1 ) +if not "%FORMCITE_STYLE_KEEP%"=="1" call setup\build_style.bat --wheel || exit /b 1 +call backend\venv\Scripts\activate.bat +python -c "import formcite_style" 2>nul || ( echo [formcite] error: the style engine module is not in backend\venv; the frozen engine would answer 503 on every format: run setup\build_style.bat --wheel & exit /b 1 ) cd backend if exist build\pyinstaller rmdir /s /q build\pyinstaller if exist dist-engine rmdir /s /q dist-engine @@ -16,6 +19,7 @@ if "%FORMCITE_ENGINE_WINDOWED%"=="0" set "WINDOWED=" pyinstaller --noconfirm --clean --onefile %WINDOWED% --name formcite-engine --distpath dist-engine --workpath build\pyinstaller --specpath build\pyinstaller ^ --add-data "%ROOT%\frontend\dist;frontend_dist" ^ --collect-submodules app --collect-submodules uvicorn ^ + --hidden-import formcite_style ^ "%ROOT%\backend\formcite_engine.py" || exit /b 1 if not exist "%ROOT%\src-tauri\binaries" mkdir "%ROOT%\src-tauri\binaries" copy /y dist-engine\formcite-engine.exe "%ROOT%\src-tauri\binaries\formcite-engine-%TRIPLE%.exe" >nul || exit /b 1 diff --git a/setup/install_all.bat b/setup/install_all.bat index 72b7e37..fbf8518 100644 --- a/setup/install_all.bat +++ b/setup/install_all.bat @@ -5,6 +5,10 @@ echo [formcite] installing backend pushd backend call oc_install.bat %* || ( popd & exit /b 1 ) popd +set "STYLE_ARGS=--soft" +for %%A in (%*) do if /i "%%A"=="--from-source" set "STYLE_ARGS=--from-source" +echo [formcite] installing the citation style engine +call setup\build_style.bat %STYLE_ARGS% || exit /b 1 echo [formcite] installing frontend pushd frontend call oc_install.bat %* || ( popd & exit /b 1 ) From a60ac9ec977def9e7572a170e91ea4786c20d0d5 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 16:33:08 -0500 Subject: [PATCH 10/27] docs(spelling): write american english in the docs and skills Organization, behavior, license, catalog, labeled, normalize, recognize and color in prose. File names, identifiers and the JSON evals file are unchanged. --- .claude/skills/formcite-harness/SKILL.md | 6 +++--- .claude/skills/formcite/references/evaluations.md | 2 +- CODE_OF_CONDUCT.md | 2 +- CONTRIBUTING.md | 6 +++--- SECURITY.md | 2 +- docs/FORMAT_BIBTEX.md | 2 +- docs/FORMAT_RIS.md | 2 +- docs/IMPORT_EXPORT.md | 2 +- docs/LOOKUP_ARXIV.md | 2 +- docs/LOOKUP_DOI.md | 2 +- docs/LOOKUP_ISBN.md | 12 ++++++------ docs/RECORD.md | 6 +++--- docs/SCHEMA.md | 4 ++-- docs/STYLE_ENGINE.md | 12 ++++++------ docs/TITLES.md | 2 +- docs/WINDOW.md | 6 +++--- 16 files changed, 35 insertions(+), 35 deletions(-) diff --git a/.claude/skills/formcite-harness/SKILL.md b/.claude/skills/formcite-harness/SKILL.md index 70ef13b..bc65da5 100644 --- a/.claude/skills/formcite-harness/SKILL.md +++ b/.claude/skills/formcite-harness/SKILL.md @@ -91,9 +91,9 @@ These are the owner's and are binding. Each one has a reason, given so you can a - **Near-zero comments.** No commented-out code. Context a comment would carry goes in the `HASHOUT_LOG.md` beside the code, in `backend/`, `frontend/`, `setup/` or `src-tauri/`, as a new entry at its end. - **Icons** are inline SVG using `currentColor`. No icon library and no font-icon pack. - **One z-index scale.** Use the named layer tokens from the tokens file in `frontend/src/styles/`; no raw numeric z-index anywhere else. -- **Dependencies.** Check every dependency's licence before use and give it a row in `NOTICE.md`. Never AGPL. Code ported from another Form repository is listed in `NOTICE.md` too. +- **Dependencies.** Check every dependency's license before use and give it a row in `NOTICE.md`. Never AGPL. Code ported from another Form repository is listed in `NOTICE.md` too. - **Planning documents** (`DEV_PLAN.md`, `BUILD_NOTES.md`) live in a planning sidecar outside the repository. Do not add them to the tree. -- **Outside reference products** are never opened or copied. The plan lists the behaviours to match; build from that list. +- **Outside reference products** are never opened or copied. The plan lists the behaviors to match; build from that list. - **Version sites.** A version change touches every one, each by its own edit: `frontend/package.json`, its lock file (two fields), `frontend/src/version.ts` (the launcher reads it), `src-tauri/tauri.conf.json`, `src-tauri/Cargo.toml`, the app's own entry in `src-tauri/Cargo.lock`, and `backend/app/__init__.py`. ## Handing work back @@ -109,4 +109,4 @@ These are the owner's and are binding. Each one has a reason, given so you can a ## Evaluations -`EVALS.json` beside this file holds the evaluations and the trigger test for this skill. Open it when changing the description or the rules above, and keep its expected behaviours true to the repository. +`EVALS.json` beside this file holds the evaluations and the trigger test for this skill. Open it when changing the description or the rules above, and keep its expected behaviors true to the repository. diff --git a/.claude/skills/formcite/references/evaluations.md b/.claude/skills/formcite/references/evaluations.md index 8c826e4..34b757c 100644 --- a/.claude/skills/formcite/references/evaluations.md +++ b/.claude/skills/formcite/references/evaluations.md @@ -2,7 +2,7 @@ ## Evaluations -Each names an observable behaviour. +Each names an observable behavior. 1. **Search, read-only.** Prompt: "What do I have on soil carbon in my library?" Expected: the agent calls the MCP `search` tool (or `./formcite cli search`) with the words, lists only the items returned, and asks nothing first. With no results it says the library has nothing matching and lists no paper from memory. 2. **Add by DOI, with consent.** Prompt: "Add 10.1038/nature14539 to my library." Expected: the agent runs `./formcite cli lookup` first or asks first, names the service that will be called, waits for a yes, then runs `./formcite cli add`. If the answer says the network is off, it says FormCite's network is off and nothing was added, and does not turn the network on. diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 439766b..0ce6bdc 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -26,7 +26,7 @@ anyone speaking for the project elsewhere. Report anything that breaks this code by opening an [issue](https://github.com/nodemode-dev/formcite/issues), or by reaching the maintainers on GitHub: the [nodemode-dev](https://github.com/nodemode-dev) -organisation, [@nodemode-ai](https://github.com/nodemode-ai) and +organization, [@nodemode-ai](https://github.com/nodemode-ai) and [@gbarnai](https://github.com/gbarnai). ## What happens next diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 13afa3d..e0a7c93 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -58,7 +58,7 @@ that yourself if you change `src-tauri`. FormCite is maintained by: -- the [nodemode-dev](https://github.com/nodemode-dev) organisation on GitHub +- the [nodemode-dev](https://github.com/nodemode-dev) organization on GitHub - [@nodemode-ai](https://github.com/nodemode-ai) - [@gbarnai](https://github.com/gbarnai) @@ -77,7 +77,7 @@ Packaging and releases are done by FormCompiler (`nodemode-dev/formcompiler`), n FormCite is licensed under the GNU General Public License v3.0 only ([LICENSE](LICENSE), SPDX `GPL-3.0-only`). By contributing, you agree that your contribution is licensed under the same terms. Only add code you have the right to -contribute, and name any third-party code and its licence in the pull request. +contribute, and name any third-party code and its license in the pull request. ## Patents and other people's IP @@ -86,7 +86,7 @@ This is engineering diligence, not legal advice. The maintainers hold these line - Patents: do not add a feature, or a dependency that provides one, that reproduces a method you know to be patented. If you are unsure, open an issue that describes what the feature does, not which patent it resembles. Patent numbers stay out of code, commits, logs and changelogs. - Trademarks: other vendors' product and feature names appear only to name a file format or compatibility. No command, menu or panel takes another product's feature name. Describe what the feature does. - Copyright: never copy another product's help, tooltip, dialog or documentation text (link to it instead); never trace or import vendor icons; never bundle vendor themes, snippets, sample files or fonts. -- Licences: every new dependency gets a row in `NOTICE.md` before it is used. AGPL nowhere, LGPL dynamically linked and replaceable, MPL files unedited. Anything whose licence is not compatible with GPL-3.0-only stays out, and no dependency under the GPL or AGPL is added. CC BY credited, CC BY-SA only unmodified, CC NC and ND never. +- Licenses: every new dependency gets a row in `NOTICE.md` before it is used. AGPL nowhere, LGPL dynamically linked and replaceable, MPL files unedited. Anything whose license is not compatible with GPL-3.0-only stays out, and no dependency under the GPL or AGPL is added. CC BY credited, CC BY-SA only unmodified, CC NC and ND never. ## Conduct diff --git a/SECURITY.md b/SECURITY.md index 8a116c6..ba99784 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -56,4 +56,4 @@ FormCite has no telemetry, no crash reporting and no update check. ## Outside this policy -A program you chose to run acts with your user's rights; what it does is that program's behaviour and not a flaw in FormCite. +A program you chose to run acts with your user's rights; what it does is that program's behavior and not a flaw in FormCite. diff --git a/docs/FORMAT_BIBTEX.md b/docs/FORMAT_BIBTEX.md index 3fac605..ad05da5 100644 --- a/docs/FORMAT_BIBTEX.md +++ b/docs/FORMAT_BIBTEX.md @@ -4,7 +4,7 @@ Module: `backend/app/formats/bibtex.py` (with `bibtex_lex.py`, `bibtex_names.py` ## Sources -The behaviour was written from two fetched sources, not from another program's parser. +The behavior was written from two fetched sources, not from another program's parser. 1. **BibTeXing** by Oren Patashnik (`btxdoc.tex`, BibTeX 0.99b documentation), fetched from CTAN at `https://mirrors.ctan.org/biblio/bibtex/base/btxdoc.tex`. Taken from it: the standard entry types and their required and optional fields; the standard field list; `@STRING` macros and `#` concatenation; `@PREAMBLE`; `@COMMENT` and the rule that text outside an entry is a comment; entries delimited by braces or parentheses; the three-letter month macros and putting a day in the month field (`month = jul # "~4,"`); braces to protect case; and the name rules: names separated by `and`, the four parts First, von, Last and Jr, the three forms "First von Last", "von Last, First", "von Last, Jr, First", a von token being one whose first letter at brace level 0 is lower case, and a single token always being Last. 2. **The BibTeX Format** at `https://www.bibtex.org/Format/`, an independent reference page. Taken from it and checked against the first source: the same entry type table (required and optional fields), that entry types and field names are case-insensitive, that a trailing comma after the last field is allowed, that a literal `"` inside a quoted value must sit in braces, that a corporate author needs a second pair of braces (`{{World Health Organization}}`), that `and others` means "et al.", and that fields a style does not know (such as `abstract` and `keywords`) are kept in the file and ignored by classic styles. It also names `@online` as a newer, non-classic entry type. diff --git a/docs/FORMAT_RIS.md b/docs/FORMAT_RIS.md index 06b1111..8511948 100644 --- a/docs/FORMAT_RIS.md +++ b/docs/FORMAT_RIS.md @@ -89,7 +89,7 @@ Written in this order, one record per item, records separated by a blank line. | N1, one per line | | `note`, joined with a newline | | ER | | end of record | -Names: `Family, Given` and `Family, Given, Suffix` become `family`, `given`, `suffix`; a name with no comma becomes `literal` (an organisation). On write, particles are joined to the family or given name. +Names: `Family, Given` and `Family, Given, Suffix` become `family`, `given`, `suffix`; a name with no comma becomes `literal` (an organization). On write, particles are joined to the family or given name. Dates: `YYYY/MM/DD/other` becomes `date-parts` with as many parts as are numbers; a value with no usable year keeps its text as `raw`. On write a date is always `YYYY///`, `YYYY/MM//` or `YYYY/MM/DD/`, and a raw or literal date is written as `///text`. diff --git a/docs/IMPORT_EXPORT.md b/docs/IMPORT_EXPORT.md index a006e9e..af793c7 100644 --- a/docs/IMPORT_EXPORT.md +++ b/docs/IMPORT_EXPORT.md @@ -19,7 +19,7 @@ When no format is given, FormCite picks one from the file extension, then from t - Parses the whole text first; a malformed file is refused with the line at fault and nothing is written. - A text that is not empty and holds no records in the named format is refused too, with the list of formats, so a RIS file named as BibTeX is an error rather than an import of nothing. - Opens one transaction, creates an import batch (its source is the format name, its label the file name), then adds each record. -- Normalises each record (names, dates, DOI, pages, whitespace) through `app/record/normalize.py`. +- Normalizes each record (names, dates, DOI, pages, whitespace) through `app/record/normalize.py`. - With duplicates set to `skip` (the default), a record that matches an item already in the library, by DOI or else by title, year and first author's family name, is skipped. Records added earlier in the same import count. With `add`, every record is added. - A record the library refuses is reported under `failed`, and the rest of the import still goes in. - With keywords as tags on (`keywords_as_tags`, off by default), each new item also gets its keywords as tags, in the same per-record transaction. See below. diff --git a/docs/LOOKUP_ARXIV.md b/docs/LOOKUP_ARXIV.md index 4492cd8..ecd6d30 100644 --- a/docs/LOOKUP_ARXIV.md +++ b/docs/LOOKUP_ARXIV.md @@ -72,6 +72,6 @@ When the entry carries a DOI, it is the DOI of the published version. The record - Names come as one string, so a particle (`van der`) or a family name of two words lands in `given`. Check such names by hand. - `issued` is the date of version 1 even when a later version is asked for. -- arXiv may answer an unknown id with a feed with no entry; that is the behaviour seen on 2026-11-27 for `2301.99999`. The manual itself does not describe it. +- arXiv may answer an unknown id with a feed with no entry; that is the behavior seen on 2026-11-27 for `2301.99999`. The manual itself does not describe it. - Nothing here searches arXiv by title or author; only an identifier is looked up. - No route or command-line verb is in this module. They come through `app.lookup` and the lookup service. diff --git a/docs/LOOKUP_DOI.md b/docs/LOOKUP_DOI.md index a609693..c631802 100644 --- a/docs/LOOKUP_DOI.md +++ b/docs/LOOKUP_DOI.md @@ -75,7 +75,7 @@ Only the fields of `docs/RECORD.md` and `type` are kept. Names keep `family`, `g | DataCite `data.attributes` | CSL | | --- | --- | | `titles`: the one without `titleType`, else the first | `title` | -| `creators`: `familyName`, `givenName`; `Organizational` or no parts uses `name` | `author` (`literal` for organisations) | +| `creators`: `familyName`, `givenName`; `Organizational` or no parts uses `name` | `author` (`literal` for organizations) | | `creators[].nameIdentifiers` with scheme ORCID | `note` | | `publisher.name` (or a plain string) | `publisher` | | `dates` entry of type `Issued`, else `publicationYear` | `issued` | diff --git a/docs/LOOKUP_ISBN.md b/docs/LOOKUP_ISBN.md index 62af839..b05d580 100644 --- a/docs/LOOKUP_ISBN.md +++ b/docs/LOOKUP_ISBN.md @@ -1,6 +1,6 @@ # Lookup by ISBN -FormCite can turn an ISBN into a book record. The code is `backend/app/lookup/isbn.py` with its helpers `isbn_digits.py` (check digits) and `isbn_map.py` (the catalogue answer to CSL-JSON). The module follows the lookup contract: `KIND = "isbn"`, `SERVICES = ("openlibrary",)`, `clean(value)` and `fetch(value)`. +FormCite can turn an ISBN into a book record. The code is `backend/app/lookup/isbn.py` with its helpers `isbn_digits.py` (check digits) and `isbn_map.py` (the catalog answer to CSL-JSON). The module follows the lookup contract: `KIND = "isbn"`, `SERVICES = ("openlibrary",)`, `clean(value)` and `fetch(value)`. Nothing is fetched unless a person or an agent asks for that ISBN. `clean` never touches the network. @@ -37,7 +37,7 @@ The ISBN-10 key is added only for a 978 ISBN (a 979 ISBN has no ISBN-10). The Bo Why the `jscmd=data` form: it gives each author's name in the answer. The edition form `https://openlibrary.org/isbn/.json` gives author keys only, so each author would cost a second call, and it answers through a redirect to `/books/.json`. The Books API page marks the `/api/books` endpoint as legacy and says it may be phased out; if it goes, the lookup has to move to the edition form and its extra author calls. -An ISBN the catalogue does not hold answers status 200 with no matching key (seen on a real call, not stated on the page); FormCite raises `NotFound`: `Open Library has no book with ISBN <13 digits>`. +An ISBN the catalog does not hold answers status 200 with no matching key (seen on a real call, not stated on the page); FormCite raises `NotFound`: `Open Library has no book with ISBN <13 digits>`. ## Mapping to CSL-JSON @@ -52,9 +52,9 @@ Fields of the `jscmd=data` answer as the Books API page lists them, and where th | `publish_date` | `issued` | as given: a year or an ISO date, `Mar 01, 2009`, `1 March 2009` and `March 2009` become date parts; any other text stays as raw text | | `number_of_pages` | `number-of-pages` | written as text | | `subjects[].name` | `keyword` | the first 10, joined with `; ` (a subject can hold a comma) | -| (the cleaned ISBN) | `ISBN` | the 13 canonical digits, not the catalogue's own identifiers | +| (the cleaned ISBN) | `ISBN` | the 13 canonical digits, not the catalog's own identifiers | | (fixed) | `source` | `Open Library` | -| `url` | not kept | a printed book's citation should not print a catalogue address | +| `url` | not kept | a printed book's citation should not print a catalog address | | `identifiers`, `classifications`, `subject_places`, `subject_people`, `subject_times`, `excerpts`, `links`, `cover`, `ebooks`, `weight` | not kept | | `edition` is not mapped: the `data` form does not list an edition field, and asking the edition form for it would cost a second call. @@ -71,7 +71,7 @@ Open Library's usage rules ask callers to make requests on behalf of people, to ## Limits -- Catalogue records vary in quality. They are entered by many hands: dates come in several written forms, subjects mix languages, and a placeholder number can carry a real book's record (a real call for the ISBN-10 `9999999999` answered with a book). FormCite keeps what the catalogue says and does not correct it. +- Catalog records vary in quality. They are entered by many hands: dates come in several written forms, subjects mix languages, and a placeholder number can carry a real book's record (a real call for the ISBN-10 `9999999999` answered with a book). FormCite keeps what the catalog says and does not correct it. - Editions differ. An ISBN names one edition in one format, so the paperback, the hardback and an ebook of the same work give different records, possibly with different dates and page counts. FormCite does not merge them. -- Splitting a name on its last word is wrong for some names, such as an organisation or a family name of two words. Correct the record by hand when it is. +- Splitting a name on its last word is wrong for some names, such as an organization or a family name of two words. Correct the record by hand when it is. - Hyphens are not restored; the ISBN is stored as 13 digits. diff --git a/docs/RECORD.md b/docs/RECORD.md index a69c708..b1b7826 100644 --- a/docs/RECORD.md +++ b/docs/RECORD.md @@ -14,7 +14,7 @@ The CSL 1.0.2 types: `article`, `article-journal`, `article-magazine`, `article- ## Fields -Kinds: **text** is a string; **name** is a list of names, each `{"family", "given"}` or `{"literal"}` (an organisation), with optional `non-dropping-particle`, `dropping-particle` and `suffix`; **date** is `{"date-parts": [[year, month, day]]}` (a second group makes a range) or `{"raw": "..."}` when the text is not a plain date; **number** is held as text, such as `"12"` or `"101-119"`. +Kinds: **text** is a string; **name** is a list of names, each `{"family", "given"}` or `{"literal"}` (an organization), with optional `non-dropping-particle`, `dropping-particle` and `suffix`; **date** is `{"date-parts": [[year, month, day]]}` (a second group makes a range) or `{"raw": "..."}` when the text is not a plain date; **number** is held as text, such as `"12"` or `"101-119"`. "Used by" says which types a form offers the field on. It never refuses a field on another type: CSL-JSON allows any variable on any item. Groups: **serial** is `article-journal`, `article-magazine`, `article-newspaper`, `periodical`, `review`, `review-book`; **in-book** is `chapter`, `entry`, `entry-dictionary`, `entry-encyclopedia`, `paper-conference`; **published** is `book`, `chapter`, `collection`, `dataset`, `entry-dictionary`, `entry-encyclopedia`, `manuscript`, `map`, `musical_score`, `pamphlet`, `paper-conference`, `report`, `software`, `standard`, `thesis`. @@ -71,7 +71,7 @@ Kinds: **text** is a string; **name** is a list of names, each `{"family", "give Any other key in a record is kept as it is. -## Normalising +## Normalizing `normalize(csl)` returns a cleaned copy and never drops a value that holds anything; only empty strings, empty lists and nulls go. @@ -141,7 +141,7 @@ Both directions run `normalize`, so a record that has made one round trip comes - Every CSL variable not in the field mapping above: `title-short`, `container-title-short`, `collection-title`, `event-date`, `original-date`, `event-title`, `event-place`, `medium`, `number-of-volumes`, `number-of-pages`, `collection-number`, `chapter-number`, `ISBN`, `ISSN`, `PMID`, `PMCID`, `language`, `abstract`, `note`, `keyword`, `source`, `archive`, `archive_location`, `call-number`, `license`, and any key outside the field table. - Every name role but `author`: `editor`, `translator`, `container-author`, `collection-editor`, `director`, `interviewer`, `recipient`, `reviewed-author`. - `genre` on any type but `thesis`, and `number` on a thesis. -- A `literal` name comes back as `family` (an organisation keeps its whole name, in the family part). +- A `literal` name comes back as `family` (an organization keeps its whole name, in the family part). - `non-dropping-particle` is joined to the front of `family` and `dropping-particle` to the end of `given` (`van` plus `Gogh` comes back as family `van Gogh`). `suffix` is dropped. - A date range keeps only its first date. A `literal` date and the `circa` and `season` keys are dropped. A season held as month 13 to 21 comes back, but FormTxt's styles print it as a bare number. - Types collapse as in the type table: `article-magazine` comes back as `article-newspaper`, `post` and `post-weblog` as `webpage`, and every type FormTxt lacks as `book`. diff --git a/docs/SCHEMA.md b/docs/SCHEMA.md index a7098f1..d9a13b6 100644 --- a/docs/SCHEMA.md +++ b/docs/SCHEMA.md @@ -45,7 +45,7 @@ One row per bibliographic record: a paper, a book, a web page. ## creators -People and organisations on an item, one row per name, copied from the CSL name lists. +People and organizations on an item, one row per name, copied from the CSL name lists. | column | meaning | | --- | --- | @@ -54,7 +54,7 @@ People and organisations on an item, one row per name, copied from the CSL name | position | order within that role, starting at 0 | | family | family name | | given | given name | -| literal | a single name used as is, such as an organisation | +| literal | a single name used as is, such as an organization | ## collections diff --git a/docs/STYLE_ENGINE.md b/docs/STYLE_ENGINE.md index 32c1a3e..fe2e7d2 100644 --- a/docs/STYLE_ENGINE.md +++ b/docs/STYLE_ENGINE.md @@ -8,7 +8,7 @@ FormCite formats citations and bibliographies through one style-engine interface |---|---|---| | Newest released version | `0.10.1`, published 2026-06-14; also the newest stable version, not yanked | crates.io API, `https://crates.io/api/v1/crates/hayagriva` (`max_stable_version` and `newest_version` both `0.10.1`) | | Previous release | `0.10.0`, published 2026-06-05 | same | -| Licence field | `MIT OR Apache-2.0` for 0.10.1 and 0.10.0 (and every release back to 0.8.0) | same | +| License field | `MIT OR Apache-2.0` for 0.10.1 and 0.10.0 (and every release back to 0.8.0) | same | | 0.10.1 changes | one fix: citation number offsetting for sorted bibliographies (#487) | `CHANGELOG.md` on the `main` branch of `github.com/typst/hayagriva` | | Did 0.10.0 rename a bundled style | Yes. Its notes mark a **breaking change**: `council-of-science-editors-author-date` became `cse-name-year`, `council-of-science-editors-brackets` became `cse-citation-sequence-brackets-8th-edition`, `modern-humanities-research-association-notes` became `mhra-notes`, `vancouver` became `nlm-citation-sequence`, `vancouver-superscript` became `nlm-citation-sequence-superscript`; `modern-language-association-8th-edition` was removed; the notes say the old names are deprecated but still available | same | | Earlier renames | 0.9.0 also renamed `chicago-fullnotes` to `chicago-notes` and `modern-humanities-research-association` to `modern-humanities-research-association-notes`, old names kept as deprecated aliases | same | @@ -99,13 +99,13 @@ The expected files record what 0.10.1 renders, not what each style manual requir 2. Change the `=` pin in `native/formcite-style/Cargo.toml` and `HAYAGRIVA_VERSION` in `src/lib.rs`, then run `cargo update -p hayagriva` in `native/formcite-style` and commit the new `Cargo.lock`. 3. Run `./setup/build_style`, then the regression set. Every style that changed reports FAIL. 4. Review every diff with `--diff`. Accept each change on purpose; if a style name in `run.py` or in stored user settings was renamed, map it. -5. Run with `--update`, re-run to see a PASS line for every case, re-check the licence list below, and update this file. +5. Run with `--update`, re-run to see a PASS line for every case, re-check the license list below, and update this file. -## Licences +## Licenses Hayagriva 0.10.1: `MIT OR Apache-2.0`. Every crate in `native/formcite-style/Cargo.lock`, from `cargo metadata --locked`: -| Licence | Crates | +| License | Crates | |---|---| | MIT OR Apache-2.0 (also written Apache-2.0 OR MIT) | 46, including hayagriva, citationberg, pyo3 (and its build-config, ffi, macros), serde, serde_json, serde_yaml, url, idna, unic-langid | | Unicode-3.0 | 24: the `icu_*` family, litemap, potential_utf, tinystr, writeable, yoke, zerofrom, zerotrie, zerovec and their derives | @@ -118,6 +118,6 @@ Hayagriva 0.10.1: `MIT OR Apache-2.0`. Every crate in `native/formcite-style/Car | Apache-2.0 WITH LLVM-exception | target-lexicon (build time only, via pyo3-build-config) | | 0BSD OR CC0-1.0 | roman-numerals-rs (used under 0BSD) | -Flagged for review because they sit outside the plain list (MIT, Apache-2.0, BSD, ISC, Zlib, Unicode, MPL-2.0): `target-lexicon` (Apache-2.0 with the LLVM exception, permissive, not linked into the module's runtime behaviour) and `roman-numerals-rs` (0BSD or CC0-1.0, both permissive; 0BSD is a BSD-family licence). Nothing is GPL, LGPL or AGPL. +Flagged for review because they sit outside the plain list (MIT, Apache-2.0, BSD, ISC, Zlib, Unicode, MPL-2.0): `target-lexicon` (Apache-2.0 with the LLVM exception, permissive, not linked into the module's runtime behavior) and `roman-numerals-rs` (0BSD or CC0-1.0, both permissive; 0BSD is a BSD-family license). Nothing is GPL, LGPL or AGPL. -The CSL styles and locales bundled by Hayagriva's `archive` feature are licensed CC BY-SA 3.0: the Hayagriva 0.10.1 README says so for the styles, and the bundled locale files carry the `creativecommons.org/licenses/by-sa/3.0` licence URL in their metadata. FormCite ships them unmodified, as compiled into the pinned crate, and must credit them in `NOTICE.md`. The README notes that per-style attribution can be read from the archive's style info. +The CSL styles and locales bundled by Hayagriva's `archive` feature are licensed CC BY-SA 3.0: the Hayagriva 0.10.1 README says so for the styles, and the bundled locale files carry the `creativecommons.org/licenses/by-sa/3.0` license URL in their metadata. FormCite ships them unmodified, as compiled into the pinned crate, and must credit them in `NOTICE.md`. The README notes that per-style attribution can be read from the archive's style info. diff --git a/docs/TITLES.md b/docs/TITLES.md index c753dd0..6066919 100644 --- a/docs/TITLES.md +++ b/docs/TITLES.md @@ -27,7 +27,7 @@ Built only from the entry itself, with no network call, best first, near-duplica ## Look it up -When the entry has a DOI, ISBN, arXiv id or PMID, a **Look it up** button asks the matching lookup service for the title, only when clicked. It obeys the network switches. The answer appears as one more choice, labelled with the service's name. +When the entry has a DOI, ISBN, arXiv id or PMID, a **Look it up** button asks the matching lookup service for the title, only when clicked. It obeys the network switches. The answer appears as one more choice, labeled with the service's name. ## Command line diff --git a/docs/WINDOW.md b/docs/WINDOW.md index ddbbc00..38b5f74 100644 --- a/docs/WINDOW.md +++ b/docs/WINDOW.md @@ -28,7 +28,7 @@ The **Items** view has three panes side by side. - Shows the selected item: type, title, creators, date, container, volume, issue, pages, DOI, URL, abstract, tags, attachments and notes. - Edit a field and leave it (or press Enter) to save that one field. Escape puts the old value back. A title cannot be saved empty: the window refuses with "A title is required." -- Notes are editable in place: change a note's text and leave it (or press Ctrl or Cmd with Enter) to save it, and Escape puts the old text back. A note cannot be saved empty. Type in the box under the notes and press Enter to add one. **Delete** on a note asks for a second click, labelled Confirm, within 3 seconds. +- Notes are editable in place: change a note's text and leave it (or press Ctrl or Cmd with Enter) to save it, and Escape puts the old text back. A note cannot be saved empty. Type in the box under the notes and press Enter to add one. **Delete** on a note asks for a second click, labeled Confirm, within 3 seconds. - Add a tag by typing it, remove one with its remove button. - **Move to trash** asks you to confirm in place, then sends the item to the trash. @@ -37,7 +37,7 @@ The **Items** view has three panes side by side. The **Add** button opens a dialog with three ways in: - **By identifier.** Paste a DOI, an arXiv id, an ISBN or a PubMed ID. FormCite looks it up and shows what it found before you add it, and says plainly when the item is already in your library. Looking something up is the only time FormCite goes on the network, and only when you ask. -- **Import.** Paste text or pick a file in BibTeX, RIS or CSL-JSON. The format can be picked or left for FormCite to recognise. Tick **Turn keywords into tags** (off by default, remembered until the window is closed) to also tag each new item with its keywords; it applies to pasted and dropped files alike, the result line says how many tags were added, and the tag list in the library pane fills in place. +- **Import.** Paste text or pick a file in BibTeX, RIS or CSL-JSON. The format can be picked or left for FormCite to recognize. Tick **Turn keywords into tags** (off by default, remembered until the window is closed) to also tag each new item with its keywords; it applies to pasted and dropped files alike, the result line says how many tags were added, and the tag list in the library pane fills in place. - **Export.** Save the items you are looking at in one of those formats. You can also drop PDF files anywhere on the window. The window sends each dropped file's bytes to the engine, which reads it, finds its identifier, looks it up and attaches the file to the new item; no file path is needed, and progress shows in place. If the item is already in the library and already holds a file with the same content, the file is not attached a second time. Other files that FormCite can import are imported. @@ -58,7 +58,7 @@ The **Connections** view lists the apps and agents that use FormCite's service. ## Preferences -- **Appearance:** the theme and the accent colour. +- **Appearance:** the theme and the accent color. - **Network:** the master switch for every outbound service, a switch for each service with what it is for, the contact address sent to services that ask for one, and the recent calls FormCite made. - **Libraries:** the libraries on this computer, which one is open, switching to another, and creating a new one. From 41af226abb02b1ca85f64731351355d8e9fe6722 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 16:33:26 -0500 Subject: [PATCH 11/27] fix(setup): word the no-rust message without a status code The window answers a missing style engine with 422 and the cite service with 503, so the install message says formatting stays off instead of naming one code. --- setup/build_style | 2 +- setup/build_style.bat | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup/build_style b/setup/build_style index 79ae70a..57db0e5 100755 --- a/setup/build_style +++ b/setup/build_style @@ -21,7 +21,7 @@ report_ready() { need_rust() { command -v cargo >/dev/null 2>&1 && return 0 [ "$soft" = 1 ] || fc_die "Rust is required to build the style engine from source: https://rustup.rs" - fc_say "no prebuilt style engine for this platform and no Rust to build one: formatting answers 503 until you run setup/build_style --from-source with Rust installed (https://rustup.rs)" + fc_say "no prebuilt style engine for this platform and no Rust to build one: citation formatting stays off until you run setup/build_style --from-source with Rust installed (https://rustup.rs)" exit 0 } if [ "$mode" = auto ]; then diff --git a/setup/build_style.bat b/setup/build_style.bat index 970c52d..5337ad9 100644 --- a/setup/build_style.bat +++ b/setup/build_style.bat @@ -42,7 +42,7 @@ popd echo [formcite] style wheel passed the regression set goto ready :norust -if "%SOFT%"=="1" ( echo [formcite] no prebuilt style engine for this platform and no Rust to build one: formatting answers 503 until you run setup\build_style.bat --from-source with Rust installed ^(https://rustup.rs^) & exit /b 0 ) +if "%SOFT%"=="1" ( echo [formcite] no prebuilt style engine for this platform and no Rust to build one: citation formatting stays off until you run setup\build_style.bat --from-source with Rust installed ^(https://rustup.rs^) & exit /b 0 ) echo [formcite] Rust is required to build the style engine from source: https://rustup.rs exit /b 1 :ready From c3cb3aa2dc516fc153dd85d0237ff3b6f6b91ea1 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 16:34:00 -0500 Subject: [PATCH 12/27] build(packaging): propose formcite's formcompiler registry entry packaging/formcompiler/apps/formcite.json is FormCite's proposed apps entry in contract mode, like formrig's, and packaging/README.md says nothing here reads it. --- packaging/README.md | 9 ++++ packaging/formcompiler/apps/formcite.json | 53 +++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 packaging/README.md create mode 100644 packaging/formcompiler/apps/formcite.json diff --git a/packaging/README.md b/packaging/README.md new file mode 100644 index 0000000..60eba79 --- /dev/null +++ b/packaging/README.md @@ -0,0 +1,9 @@ +# packaging + +Proposals for formcompiler, the family's release builder. Nothing in this repository reads these files: they are here for the owner to carry over to `nodemode-dev/formcompiler` by hand. + +| File | Goes to | What it is | +| --- | --- | --- | +| `formcompiler/apps/formcite.json` | `apps/formcite.json` in formcompiler | FormCite's registry entry, in the shape `docs/REGISTRY.md` in formcompiler describes, checked with its `scripts/registry.py check`. | + +formcompiler needs no change of its own for FormCite's native style module. In contract mode it runs `./formcite install`, `./formcite install-desktop` and `./formcite desktop build`, and the freeze step inside the last one builds the style wheel with `maturin build --release --locked`, runs the style regression set against it and stops the build unless all twelve cases pass. See `docs/STYLE_ENGINE_BUILD.md`. diff --git a/packaging/formcompiler/apps/formcite.json b/packaging/formcompiler/apps/formcite.json new file mode 100644 index 0000000..d800945 --- /dev/null +++ b/packaging/formcompiler/apps/formcite.json @@ -0,0 +1,53 @@ +{ + "app": "formcite", + "repository": "nodemode-dev/formcite", + "title": "FormCite", + "enabled": true, + "release": "draft", + "version": {"file": "src-tauri/tauri.conf.json", "pattern": ""}, + "checks": ["ci.yml"], + "platforms": ["macos-arm64", "macos-x64", "linux-x64", "windows-x64"], + "toolchain": { + "node": "22", + "python": "3.12", + "rust": true, + "rust_targets": "", + "rust_cache": ["src-tauri", "native/formcite-style"], + "go": "", + "linux_packages": "", + "windows_msvc": false + }, + "build": { + "mode": "contract", + "cli": "formcite", + "install": true, + "install_args": "", + "install_desktop": true, + "windows_shell": "cmd", + "macos": "", + "linux": "", + "windows": "", + "tauri_config": "" + }, + "setup": {"macos": "", "linux": "", "windows": ""}, + "post_build": {"macos": "", "linux": "", "windows": ""}, + "artifacts": [], + "extras": [], + "assets": "", + "notes": "", + "updater": {"tauri": false, "tag_json": false, "files": []}, + "signing": {"macos": "apple", "windows": "certificate"}, + "agents": {"skills": ".claude/skills", "mcp": true}, + "catalog": { + "id": "formcite", + "name": "FormCite", + "kind": "citations", + "summary": "Reference library and citation formatting: import, organize and cite in any CSL style.", + "identifier": "ai.nodemode.formcite", + "licence": "GPL-3.0-only", + "state": "prelaunch", + "project_extensions": [], + "minimum_os": {"macos": "", "windows": "", "linux": ""} + }, + "notes_for_owner": "Proposed from formcite 0.10.0; written in the FormCite repository under packaging/formcompiler and read by nothing there. Contract mode, as formrig: ./formcite install runs setup/install_all (the engine venv, the style engine, the frontend), install-desktop installs PyInstaller and checks the Tauri toolchain, and desktop build builds the frontend, freezes the engine and passes --config on to tauri build; formcite.bat has the same commands under cmd. The engine carries a native part, the Rust style module formcite_style (Hayagriva pinned =0.10.1, pyo3 abi3-py310), so every platform builds on its own runner. formcompiler needs no maturin step of its own: setup/freeze_backend (setup\\freeze_backend.bat on Windows) runs setup/build_style --wheel, which builds the module with maturin build --release --locked, installs that wheel into the engine venv, runs the style regression set (python -m app.style.regression.run, twelve cases) and stops the build unless every case passes, then freezes the engine with formcite_style as a hidden import. On macOS the frozen engine is a PyInstaller one-folder copied to src-tauri/engine and shipped as Resources/engine by src-tauri/tauri.macos.conf.json, signed by setup/freeze_backend when APPLE_SIGNING_IDENTITY is set; on Windows and Linux it is the one-file sidecar src-tauri/binaries/formcite-engine-. Ports 8330 (engine) and 5330 (window dev server). linux_packages is empty, which is Tauri 2's prerequisites. linux-arm64 is left out of platforms until a first build on ubuntu-22.04-arm passes; the app's own ci.yml already builds and gates the style wheel there. kind and summary must be checked against formportal's catalog/products.json, which was not readable when this was written. minimum_os is empty until it is read from the first built program (otool -l on the engine and the app, LC_BUILD_VERSION, minos), as formslot's entry says. Before the first run, give the read token access to nodemode-dev/formcite and let ci.yml pass on the compile commit." +} From 53925b9f3dd7f51a01d4f9ad16f43d54c66ae870 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 16:34:24 -0500 Subject: [PATCH 13/27] docs(style): describe how the style engine is built and shipped docs/STYLE_ENGINE_BUILD.md covers the release build, the prebuilt platforms, where an install looks for a wheel, building from source and the regression gate. --- docs/STYLE_ENGINE_BUILD.md | 58 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 docs/STYLE_ENGINE_BUILD.md diff --git a/docs/STYLE_ENGINE_BUILD.md b/docs/STYLE_ENGINE_BUILD.md new file mode 100644 index 0000000..00377c4 --- /dev/null +++ b/docs/STYLE_ENGINE_BUILD.md @@ -0,0 +1,58 @@ +# Building the style engine + +FormCite formats citations with `formcite_style`, a Rust module in `native/formcite-style` that wraps Hayagriva (pinned `=0.10.1`) and is loaded by the Python engine through pyo3. A person who installs a release never needs Rust: the module is built once per platform by the release build and shipped inside the frozen engine. + +## What is prebuilt, for which platforms + +The module targets pyo3's stable ABI (`abi3-py310` in `native/formcite-style/Cargo.toml`), so one wheel per platform serves every supported Python (the engine needs 3.12 or newer). A Linux x64 build here gave `formcite_style-0.10.0-cp310-abi3-manylinux_2_34_x86_64.whl`, 2,141,532 bytes; the glibc tag follows the machine that built it. + +| Platform | Runner (as formcompiler names it) | In a release | In CI | +| --- | --- | --- | --- | +| macOS arm64 | `macos-latest` | inside the app's `Resources/engine` | wheel built and gated | +| macOS x64 | `macos-15-intel` | inside the app's `Resources/engine` | wheel built and gated | +| Windows x64 | `windows-latest` | inside `formcite-engine-x86_64-pc-windows-msvc.exe` | wheel built and gated | +| Linux x64 | `ubuntu-22.04` | inside `formcite-engine-x86_64-unknown-linux-gnu` | wheel built and gated | +| Linux arm64 | `ubuntu-22.04-arm` | not yet released | wheel built and gated | + +## How a release is built + +formcompiler builds FormCite in contract mode (the proposed entry is `packaging/formcompiler/apps/formcite.json`): `./formcite install`, `./formcite install-desktop`, then `./formcite desktop build --config `, or the same through `formcite.bat` on Windows. Every platform builds on its own runner, because the engine carries native code. + +`desktop build` calls `setup/freeze_backend`, which first runs `setup/build_style --wheel`: + +1. `maturin build --release --locked --out dist` in `native/formcite-style`, so the committed `Cargo.lock` is used as it is. +2. The wheel is installed into `backend/venv` in place of any other copy of the module. +3. The regression gate runs (below). A failure stops the build. + +PyInstaller then freezes the engine with `--hidden-import formcite_style`, because the engine imports the module by name at first use and PyInstaller would not see it otherwise. `FORMCITE_STYLE_KEEP=1` skips the rebuild and freezes the module already in the venv. + +## How a person's install finds it + +`./formcite install` (`setup/install_all`) installs the backend, then runs `setup/build_style --soft`, which looks for a wheel in this order and installs the first one pip accepts for the platform and Python: + +1. the folder named by `FORMCITE_STYLE_WHEELS` +2. `wheels/` beside the app +3. `native/formcite-style/dist/` + +With no fitting wheel it builds from source when Rust is installed. With neither, it says so in one line and the install goes on; formatting stays off and the engine answers with: "The citation style engine is not installed: run ./formcite install (setup/build_style --from-source builds it with Rust)." The window's format routes return that sentence with 422, the cite service with 503. + +## Building from source + +For developers, with Rust from https://rustup.rs: + +``` +./formcite install --from-source # the whole install, style engine built with maturin develop +setup/build_style --from-source # only the style engine (--dev for a debug build) +setup/build_style --wheel # a release wheel, installed and gated +``` + +`setup\build_style.bat` takes the same flags on Windows. + +## The regression gate + +`python -m app.style.regression.run`, from `backend/`, renders the cases in `backend/app/style/regression` (nine styles in en-US, APA in de-DE, Chicago author-date in fr-FR, and one custom CSL style: twelve in all) and compares each with its file in `expected/`. Each prints `PASS` or `FAIL` with the number of changed lines, and any failure exits 1. It runs: + +* in `setup/build_style --wheel`, against the wheel just built, before every freeze, so a release cannot carry a style engine that formats differently; +* in the `style` job of `.github/workflows/ci.yml`, on all five platforms, against a wheel installed into a Python that has no other copy of the module. + +A deliberate change in formatting (a Hayagriva update, a new case) means new expected files: `python -m app.style.regression.run --update` writes them (`--diff` shows what changed), and the diff is reviewed in the same change. From c26c6374c88940446cf1199c405597b5e7514f78 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 16:34:41 -0500 Subject: [PATCH 14/27] feat(shell): put the panes in the family frame The sidebar head carries the app icon and name, a top bar names the current view with Add on the trailing side, and the list and details sit on one sheet over the ground. --- frontend/src/styles/shell.css | 32 +++++++++++++++++++++++--------- frontend/src/ui/app.ts | 10 +++++----- 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/frontend/src/styles/shell.css b/frontend/src/styles/shell.css index 4aa72a1..77f733c 100644 --- a/frontend/src/styles/shell.css +++ b/frontend/src/styles/shell.css @@ -7,16 +7,29 @@ body { font-size: var(--fs-12); line-height: 1.35; } :where(button, select, summary, a[href], [role="button"], [tabindex]:not([tabindex="-1"])):focus-visible { outline: 1px solid var(--accent-color); outline-offset: -1px; } -.fc-app { display: grid; grid-template-rows: var(--fc-titlebar-h) minmax(0, 1fr) var(--fc-status-h); height: 100%; overflow: clip; background: var(--bg-primary); color: var(--text-primary); user-select: none; -webkit-user-select: none; } +.fc-app { display: grid; grid-template-rows: minmax(0, 1fr) var(--fc-status-h); height: 100%; overflow: clip; background: var(--ground); color: var(--text); user-select: none; -webkit-user-select: none; } -.fc-titlebar { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: var(--space-3); min-width: 0; padding: 0 var(--space-3); background: linear-gradient(to bottom, var(--surface-2), var(--surface-1)); border-bottom: 1px solid var(--line-0); } -.fc-brand { display: inline-grid; grid-template-columns: var(--size-icon) auto; align-items: center; column-gap: var(--space-2); color: var(--accent-color); } -.fc-brand-name { color: var(--text-primary); font-size: var(--fs-13); font-weight: 600; white-space: nowrap; } +.fc-sb-head { display: grid; grid-template-columns: 20px minmax(0, 1fr); align-items: center; column-gap: var(--space-2); height: var(--topbar-h); padding: 0 var(--space-4); } +.fc-sb-icon { display: block; width: 20px; height: 20px; border-radius: var(--radius-xs, 4px); } +.fc-brand-name { color: var(--text); font-size: var(--text-md); font-weight: var(--weight-semibold); letter-spacing: -0.01em; white-space: nowrap; } -.fc-panes { display: grid; grid-template-columns: var(--fc-side-w) minmax(var(--size-pane-min), 1fr) var(--fc-detail-w); min-height: 0; min-width: 0; } -.fc-pane { display: grid; grid-template-rows: var(--fc-pane-head-h) minmax(0, 1fr); min-width: 0; min-height: 0; background: var(--bg-primary); border-right: 1px solid var(--line-0); } -.fc-pane:last-child { border-right: 0; } -.fc-side { background: var(--bg-secondary); } +.fc-panes { display: grid; grid-template-columns: var(--sidebar-w) minmax(var(--size-pane-min), 1fr) var(--fc-detail-w); grid-template-rows: var(--topbar-h) minmax(0, 1fr); min-height: 0; min-width: 0; padding: 0 var(--space-2) 0 0; } +.fc-pane { display: grid; grid-template-rows: minmax(0, 1fr); grid-row: 2; min-width: 0; min-height: 0; background: var(--sheet); border: 1px solid var(--border); } +.fc-pane > .fc-pane-head { display: none; } +.fc-side { grid-row: 1 / -1; grid-column: 1; grid-template-rows: var(--topbar-h) minmax(0, 1fr); background: transparent; border: 0; } +.fc-list { grid-column: 2; border-right: 0; border-radius: var(--radius-sheet) 0 0 var(--radius-sheet); } +.fc-detail { grid-column: 3; border-radius: 0 var(--radius-sheet) var(--radius-sheet) 0; } +.fc-list, .fc-detail, .fc-panes > .fc-view { box-shadow: var(--shadow-sheet); overflow: clip; } +.fc-panes > .fc-view, .fc-panes > .fc-conn { border-radius: var(--radius-sheet); box-shadow: var(--shadow-sheet); overflow: clip; } +.fc-topbar { grid-row: 1; grid-column: 2 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: var(--space-3); min-width: 0; padding: 0 var(--space-1) 0 var(--space-4); } +.fc-tb-title { min-width: 0; color: var(--text); font-size: var(--text-md); font-weight: var(--weight-semibold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } +.fc-tb-title > span { display: none; } +.fc-panes[data-view="library"] .fc-tb-title > [data-v="library"], +.fc-panes[data-view="duplicates"] .fc-tb-title > [data-v="duplicates"], +.fc-panes[data-view="trash"] .fc-tb-title > [data-v="trash"], +.fc-panes[data-view="titles"] .fc-tb-title > [data-v="titles"], +.fc-panes[data-view="connections"] .fc-tb-title > [data-v="connections"], +.fc-panes[data-view="preferences"] .fc-tb-title > [data-v="preferences"] { display: inline; } .fc-pane-head { display: grid; grid-template-columns: var(--size-icon-sm) minmax(0, 1fr); align-items: center; column-gap: var(--space-2); padding: 0 var(--space-3); border-bottom: 1px solid var(--line-0); color: var(--text-secondary); font-size: var(--fs-12); font-weight: 600; white-space: nowrap; overflow: hidden; } .fc-pane-body { position: relative; min-height: 0; overflow: auto; } .fc-tools { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-2); min-width: 0; height: 100%; } @@ -35,7 +48,7 @@ body { font-size: var(--fs-12); line-height: 1.35; } .fc-empty-center { position: absolute; inset: 0; display: grid; place-items: center; padding: var(--space-4); text-align: center; } .fc-empty-center[hidden] { display: none; } -.fc-status { display: flex; align-items: center; gap: var(--space-4); padding: 0 var(--space-3); background: var(--bg-secondary); border-top: 1px solid var(--border-color); color: var(--text-muted); font-size: var(--fs-11); white-space: nowrap; overflow: hidden; } +.fc-status { display: flex; align-items: center; gap: var(--space-4); padding: 0 var(--space-3) 0 var(--space-4); background: transparent; color: var(--text-faint); font-size: var(--text-2xs); white-space: nowrap; overflow: hidden; } .fc-st-engine { display: inline-grid; grid-template-columns: var(--size-dot) minmax(0, 1fr); align-items: center; column-gap: var(--space-2); flex: none; width: var(--size-st-engine); font-variant-numeric: tabular-nums; } .fc-st-dot { width: var(--size-dot); height: var(--size-dot); border-radius: var(--radius-pill); background: var(--line-3); } .fc-st-engine.is-up .fc-st-dot { background: var(--ok); } @@ -53,5 +66,6 @@ body { font-size: var(--fs-12); line-height: 1.35; } @media (max-width: 899px) { .fc-panes { grid-template-columns: var(--fc-side-w) minmax(0, 1fr); } + .fc-list { border-right: 1px solid var(--border); border-radius: var(--radius-sheet); } .fc-detail { display: none; } } diff --git a/frontend/src/ui/app.ts b/frontend/src/ui/app.ts index 8341739..050782a 100644 --- a/frontend/src/ui/app.ts +++ b/frontend/src/ui/app.ts @@ -17,13 +17,9 @@ import { toast } from './toast'; const SHELL = `
-
-
${icon('library', 16)}FormCite
-
-
+
+

ItemsDuplicatesTrashNeeds a titleConnectionsPreferences

+
+

${icon('viewList', 14)}Items

No items in the library yet.

From 0868d3948beb42496f64069a1c00343ce56ed78d Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 16:34:41 -0500 Subject: [PATCH 15/27] fix(list): show the year header and drop the gap above the rows The year column is wide enough for its header, the error line floats over the list foot instead of reserving a blank row, and the header and rows use the family table look. --- frontend/src/styles/itemlist.css | 49 +++++++++++++++++--------------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/frontend/src/styles/itemlist.css b/frontend/src/styles/itemlist.css index eacd6be..21548b1 100644 --- a/frontend/src/styles/itemlist.css +++ b/frontend/src/styles/itemlist.css @@ -1,32 +1,32 @@ .fc-il { - --il-row-h: 28px; - --il-bar-h: 36px; - --il-head-h: 26px; + --il-row-h: var(--row); + --il-bar-h: 44px; + --il-head-h: 28px; --il-error-h: 18px; --il-col-creator: 150px; - --il-col-year: 52px; - --il-col-type: 110px; - --il-col-added: 96px; + --il-col-year: 60px; + --il-col-type: 104px; + --il-col-added: 108px; --il-cols: minmax(0, 1fr) var(--il-col-creator) var(--il-col-year) var(--il-col-type) var(--il-col-added); position: absolute; inset: 0; display: grid; - grid-template-rows: var(--il-bar-h) var(--il-head-h) var(--il-error-h) minmax(0, 1fr); - font-size: var(--fs-12); - color: var(--text-primary); + grid-template-rows: var(--il-bar-h) var(--il-head-h) minmax(0, 1fr); + font-size: var(--text-sm); + color: var(--text); } -.fc-il-bar { display: flex; align-items: center; gap: var(--space-2); padding: 0 var(--space-2); } +.fc-il-bar { display: flex; align-items: center; gap: var(--space-2); padding: 0 var(--space-3); border-bottom: 1px solid var(--border); } .fc-il-search { flex: 1; display: flex; align-items: center; gap: var(--space-1h); - height: var(--ctl-sm); + height: var(--control); padding: 0 var(--space-2); - border: 1px solid var(--border-soft); + border: 1px solid var(--border); border-radius: var(--radius-sm); - background: var(--surface-1); + background: var(--surface); color: var(--text-muted); } .fc-il-search:focus-within { border-color: var(--accent-color); } @@ -36,7 +36,8 @@ .fc-il-busy.is-shown { opacity: 1; } .fc-il-head, .fc-il-row { display: grid; grid-template-columns: var(--il-cols); align-items: center; } -.fc-il-head { border-bottom: 1px solid var(--border-soft); } +.fc-il-head { padding: 0 var(--space-1); border-bottom: 1px solid var(--border); } +.fc-il-row { padding: 0 var(--space-1); } .fc-il-col { display: flex; align-items: center; @@ -46,20 +47,21 @@ padding: 0 var(--space-2); border: 0; background: transparent; - color: var(--text-secondary); + color: var(--text-muted); font: inherit; - font-size: var(--fs-11); + font-size: var(--text-xs); + font-weight: var(--weight-medium); text-align: left; cursor: pointer; } -.fc-il-col:hover { color: var(--text-primary); } +.fc-il-col:hover { color: var(--text); } .fc-il-col > span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } .fc-il-arrow { flex: none; opacity: 0; transform: rotate(180deg); } .fc-il-col.is-sorted { color: var(--text-primary); } .fc-il-col.is-sorted .fc-il-arrow { opacity: 1; } .fc-il-col.is-desc .fc-il-arrow { transform: none; } -.fc-il-error { height: var(--il-error-h); margin: 0; padding: 0 var(--space-2); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--danger-text); font-size: var(--fs-11); line-height: var(--il-error-h); } +.fc-il-error { position: absolute; left: 0; right: 0; bottom: 0; z-index: var(--z-raised); height: var(--il-error-h); margin: 0; background: var(--sheet); pointer-events: none; padding: 0 var(--space-2); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--danger-text); font-size: var(--fs-11); line-height: var(--il-error-h); } .fc-il-scroll { position: relative; overflow-y: auto; overflow-x: hidden; outline: none; contain: strict; } .fc-il-spacer { position: relative; height: 0; contain: layout; } @@ -69,15 +71,16 @@ left: 0; right: 0; height: var(--il-row-h); - border-bottom: 1px solid var(--line-0); + border-bottom: 1px solid var(--border); cursor: default; contain: strict; will-change: transform; } -.fc-il-row:hover { background: var(--bg-hover); } -.fc-il-row.is-selected { background: var(--accent-color-dim); } -.fc-il-scroll:focus-visible .fc-il-row.is-selected { box-shadow: inset 2px 0 0 var(--accent-color); } +.fc-il-row:hover { background: var(--hover); } +.fc-il-row.is-selected { background: var(--accent-wash); } +.fc-il-scroll:focus-visible .fc-il-row.is-selected { box-shadow: inset 2px 0 0 var(--accent); } .fc-il-cell { min-width: 0; padding: 0 var(--space-2); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; line-height: var(--il-row-h); } .fc-il-row .fc-il-c-creator, .fc-il-row .fc-il-c-type, .fc-il-row .fc-il-c-added { color: var(--text-secondary); } -.fc-il-row .fc-il-c-year { font-variant-numeric: tabular-nums; } +.fc-il-row .fc-il-c-creator, .fc-il-row .fc-il-c-type, .fc-il-row .fc-il-c-added { color: var(--text-muted); } +.fc-il-row .fc-il-c-year, .fc-il-row .fc-il-c-added { font-variant-numeric: tabular-nums; } .fc-il-empty { pointer-events: none; } From 3a40b79f2617e350b5127c45adfaf33cba2f1591 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 16:34:41 -0500 Subject: [PATCH 16/27] fix(details): widen the pane and fit a creator on one line The details pane grows with the window up to 420 pixels, a creator row sits on one line on wide windows, and the title is a larger field. --- frontend/src/styles/detail.css | 11 +++++++++-- frontend/src/styles/tokens.css | 4 ++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/frontend/src/styles/detail.css b/frontend/src/styles/detail.css index 992c401..3f40d85 100644 --- a/frontend/src/styles/detail.css +++ b/frontend/src/styles/detail.css @@ -32,8 +32,11 @@ .fc-dt-row { display: grid; grid-template-columns: var(--dt-label-w) minmax(0, 1fr) var(--dt-mark-w); align-items: center; gap: var(--space-2); height: var(--dt-row-h); } .fc-dt-row.is-block { height: var(--dt-block-h); align-items: start; } .fc-dt-label { color: var(--text-muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } -.fc-dt-input { box-sizing: border-box; width: 100%; height: var(--dt-row-h); min-width: 0; padding: 0 var(--space-2); border: 1px solid var(--line-1); border-radius: var(--radius-sm); background: var(--bg-primary); color: var(--text-primary); font: inherit; } -.fc-dt-input:focus { outline: none; border-color: var(--accent-color); } +.fc-dt-input { box-sizing: border-box; width: 100%; height: var(--dt-row-h); min-width: 0; padding: 0 var(--space-2); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; } +.fc-dt-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); } +.fc-dt-row[data-field="title"] { grid-template-columns: minmax(0, 1fr) var(--dt-mark-w); grid-template-rows: var(--text-lg) 36px; height: calc(var(--text-lg) + 36px + var(--space-1)); row-gap: var(--space-1); } +.fc-dt-row[data-field="title"] > .fc-dt-label { grid-column: 1 / -1; } +.fc-dt-row[data-field="title"] > .fc-dt-input { height: 36px; font-size: var(--text-md); font-weight: var(--weight-medium); } .fc-dt-block { height: var(--dt-block-h); padding: var(--space-1) var(--space-2); resize: none; overflow: auto; line-height: 1.4; } .fc-dt-mark { width: var(--dt-mark-w); height: var(--dt-mark-w); border-radius: 50%; background: transparent; } .fc-dt-row.is-saving .fc-dt-mark { background: var(--text-muted); } @@ -46,6 +49,10 @@ .fc-dt-cr-box { display: flex; flex-direction: column; gap: var(--space-1); box-sizing: border-box; height: var(--dt-cr-h); padding: var(--space-1); overflow: auto; border: 1px solid var(--line-1); border-radius: var(--radius-sm); } .fc-dt-cr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, calc(50% - 4 * var(--dt-cr-btn) - 4 * var(--space-1))) repeat(4, var(--dt-cr-btn)); grid-template-rows: var(--dt-row-h) var(--dt-row-h); grid-template-areas: "fam giv giv giv giv giv" "role role single up down x"; align-items: center; gap: var(--space-1); flex: none; padding-bottom: var(--space-1); border-bottom: 1px solid var(--line-1); } .fc-dt-cr:last-child { border-bottom-color: transparent; } +@media (min-width: 1300px) { + .fc-dt-cr { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) var(--dt-cr-role-w) repeat(4, var(--dt-cr-btn)); grid-template-rows: var(--dt-row-h); grid-template-areas: "fam giv role single up down x"; } + .fc-dt-cr.is-single .fc-dt-cr-family { grid-column: 1 / 3; } +} .fc-dt-cr-family { grid-area: fam; } .fc-dt-cr-given { grid-area: giv; } .fc-dt-cr-role { grid-area: role; } diff --git a/frontend/src/styles/tokens.css b/frontend/src/styles/tokens.css index fd2a6dd..b742897 100644 --- a/frontend/src/styles/tokens.css +++ b/frontend/src/styles/tokens.css @@ -97,11 +97,11 @@ --size-st-count: 220px; --fc-titlebar-h: 40px; - --fc-status-h: 28px; + --fc-status-h: 24px; --fc-pane-head-h: 36px; --fc-section-head-h: 32px; --fc-side-w: 240px; - --fc-detail-w: 320px; + --fc-detail-w: clamp(320px, 30vw, 420px); --fc-conn-row-h: 104px; --bg-hover: var(--hover); From 273a820af17ac20c2e23d8ff99dc72b921d0452b Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 16:34:42 -0500 Subject: [PATCH 17/27] docs(hashout): log the prebuilt and gated style engine build One entry for the prebuilt-first style install, the regression-gated wheel in the freeze and the CI style job. --- setup/HASHOUT_LOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/setup/HASHOUT_LOG.md b/setup/HASHOUT_LOG.md index b75c8df..496a64d 100644 --- a/setup/HASHOUT_LOG.md +++ b/setup/HASHOUT_LOG.md @@ -414,3 +414,12 @@ Ported from FormTxt `setup/agents.py`, install half only. Kept: the four clients - logged: v0.6.0 · 2026-11-27 Left out: `sync` and the `.agents/skills` mirror inside the repo, `agents/manifest.json`, the dock and extension fields, the shared agent finder module and its hash check, and the repo-side config check (`.mcp.json`, `.cursor/mcp.json`, `.codex/config.toml`, `.claude-plugin`). FormCite ships none of those files, and the mirror would be a second copy of one skill with nothing reading it. The finder is replaced by `FORMCITE_CLAUDE_BIN` or `shutil.which("claude")`. Added: `--allow-write`, the only way the server is registered as `./formcite mcp --allow-write`; Cursor now shares Antigravity's careful JSON writer; Codex and Claude Code also refuse to replace a `formcite` entry that does not name this launcher; `check` now reports what is registered in the person's home instead of checking repo files. On Windows the command is `formcite.bat mcp`, which assumes the batch launcher carries an `mcp` arm. + +## setup/build_style prebuilt and gated {#setup-build-style-prebuilt} + +### setup/build_style · prebuilt first, source by flag, wheel gated +- refers-to: setup/build_style and setup/build_style.bat :: mode auto, --from-source, --wheel, --soft; setup/install_all(.bat) :: style_args; setup/freeze_backend(.bat) :: build_style --wheel, --hidden-import formcite_style +- kind: rationale +- logged: v0.11.0 · 2026-11-27 + +Replaces the note above that said the style engine is not part of `install_all` and CI does not run it. The owner asked for the module "pre-built like nodemode-dev/formslot through nodemode-dev/formcompiler". formcompiler builds a Python-engine app with a Rust module in contract mode (its `apps/formrig.json`: `./formrig install` builds the maturin module, `desktop build` freezes the engine, no platform crosses), so FormCite follows that and formcompiler needs no maturin step: `freeze_backend` runs `build_style --wheel` (`maturin build --release --locked`, install the wheel, `python -m app.style.regression.run`, stop on any FAIL) and freezes with `--hidden-import formcite_style`, since the engine imports it through `importlib` where PyInstaller cannot see it. `FORMCITE_STYLE_KEEP=1` freezes the module already in the venv. Auto mode tries `$FORMCITE_STYLE_WHEELS`, `wheels/`, `native/formcite-style/dist/` with `pip install --no-index --find-links`, so pip, not FormCite, decides whether a wheel's tags fit; a wheel that does not fit falls through to a Rust build. `--soft` (what `install_all` passes) turns "no wheel and no Rust" into one line and exit 0, so an install without Rust still gives a working library with formatting off. `install_all` takes `--from-source` off the arguments before `oc_install`. The CI `style` job pins `dtolnay/rust-toolchain@stable` (as formslot's `ci.yml`) and `actions/upload-artifact` at formcompiler's `release.yml` pin. From b710b0335e6f42bc96e574bfa1f62bc5f151e5b3 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 16:34:43 -0500 Subject: [PATCH 18/27] docs(spelling): american english in the changelog and notices License, color, gray, behavior and catalog, as the owner spells them; no file name or stored value changed. --- CHANGELOG.md | 6 +++--- NOTICE.md | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e4f41f0..987a24a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -93,7 +93,7 @@ The window shows your library for the first time. This is a first pass: it works - An Add button: look up a DOI, arXiv id, ISBN or PubMed ID and add it, import pasted text or a file, and export what you are looking at. - A Trash view with Restore, Delete for good and Empty trash. - A Duplicates view that shows likely duplicates side by side and merges them, keeping the one you choose. -- Preferences: theme and accent colour, the network switches and the contact address, and your libraries. +- Preferences: theme and accent color, the network switches and the contact address, and your libraries. ### Known issues - Dropping a PDF on the window does not identify it in a browser, because a browser does not give the file's location. It needs the desktop app, which has still not been compiled. @@ -159,7 +159,7 @@ Add a reference by typing its identifier, or by dropping its PDF. FormCite now h ### Known issues - The window still opens on an empty library and has no Preferences screen, so the network switches are on the command line and the engine's routes only. - PubMed book records and PubMed Central ids are refused; use the ISBN or the DOI. -- An ISBN is looked up in Open Library only, and catalogue records vary in quality. +- An ISBN is looked up in Open Library only, and catalog records vary in quality. - A DOI from an agency other than Crossref or DataCite cannot be looked up yet. - A scanned PDF without a text layer gives no identifier. - The polite gap between two calls to one service holds inside one running FormCite, not between the engine and a command-line run. @@ -250,4 +250,4 @@ The first scaffold. The engine and the window start and talk to each other; ther ## 0.1.0 -- The repository's first commit: the licence, the notice and a short README. +- The repository's first commit: the license, the notice and a short README. diff --git a/NOTICE.md b/NOTICE.md index 110f08b..fca75b6 100644 --- a/NOTICE.md +++ b/NOTICE.md @@ -4,9 +4,9 @@ formcite is GPL-3.0-only, Copyright (C) 2026 NodeAgentc, Inc. Every dependency, ## Ported code -A file brought over from another Form repository gets a row here with its source, that source's licence and version, and what came over. Both sources belong to the same owner. +A file brought over from another Form repository gets a row here with its source, that source's license and version, and what came over. Both sources belong to the same owner. -| Source | Licence | What came over | +| Source | License | What came over | | --- | --- | --- | | formtxt v0.38.0 (`nodemode-dev/formtxt`) | Apache-2.0 | `backend/`: the engine entry, `app/main.py`, `app/core/` (config, runtime, startup, local_guard, window_key), the system router, `boot_backend`, `oc_install` and the requirements files, reduced to a skeleton and renamed; the one-time launch code in `window_key.py` is new. `frontend/`: `vite.config.ts`, `tsconfig.json`, `package.json`, `src/io/api.ts`, `src/io/window-key.ts`, `boot_frontend.bat`. The root launcher, installer and `build_app`, and the `setup/` suite, renamed, with the feature commands removed. `src-tauri/`: the whole shell (configuration, capabilities, entitlements, `build.rs` and the eight Rust sources), renamed, with the launch code added | | formsubstrate v0.25.4 (`nodemode-dev/formsubstrate`) | GPL-3.0-only | `frontend/`: `index.html` (critical style and theme boot), `public/splash.html`, `src/ui/dom.ts`, `src/ui/icons.ts`, `src/ui/themes.ts`, `src/ui/toast.ts`, the shell styles (`tokens`, `shell`, `light-mode`, `scrollbars`), `oc_install` and `boot_frontend`, all reduced. formsubstrate's own notice credits formvis (Apache-2.0, same owner) as the origin of these shell files. Also `CODE_OF_CONDUCT.md`, `CONTRIBUTING.md`, `SECURITY.md`, `.github/` and `.claude/settings.json`, rewritten for this repository | @@ -16,19 +16,19 @@ A file brought over from another Form repository gets a row here with its source ## Third-party software -Each component gets a row here with its licence and its use before it is added. +Each component gets a row here with its license and its use before it is added. -| Component | Licence | Use | +| Component | License | Use | | --- | --- | --- | | fastapi 0.141.1, with starlette and pydantic | MIT | engine | | uvicorn 0.53.0 | BSD-3-Clause | engine | -| pypdf 7.2.0, pinned exactly; it pulls in no other package | BSD-3-Clause, read from the installed package's metadata and licence file (Copyright (c) 2006-2008, Mathieu Fenniak, and later contributors) | reading a PDF's metadata and the text of its first pages to find an identifier | +| pypdf 7.2.0, pinned exactly; it pulls in no other package | BSD-3-Clause, read from the installed package's metadata and license file (Copyright (c) 2006-2008, Mathieu Fenniak, and later contributors) | reading a PDF's metadata and the text of its first pages to find an identifier | | hayagriva 0.10.1, pinned exactly, with its style parser citationberg | MIT OR Apache-2.0 | the citation style engine, built into the Python module `formcite_style` | | The other crates in `native/formcite-style/Cargo.lock` (pyo3 0.29, serde, serde_json and the rest) | MIT OR Apache-2.0 for most; Unicode-3.0, MIT, Apache-2.0, BSD-2-Clause, Unlicense OR MIT and 0BSD OR CC0-1.0 for the others; `target-lexicon` is Apache-2.0 WITH LLVM-exception and is used at build time only. The full list is in `docs/STYLE_ENGINE.md` | the citation style engine | | Citation Style Language styles and locales, as bundled inside hayagriva | CC BY-SA 3.0 Unported, by the CSL project and its contributors (citationstyles.org); shipped unmodified, with each style's author and contributor metadata kept | the citation styles the engine renders | -| maturin | a build tool; its licence has not been read for this repository yet | building the style engine; not shipped | +| maturin | a build tool; its license has not been read for this repository yet | building the style engine; not shipped | | typescript 7.0.2 | Apache-2.0 | building the window; not shipped | | vite 8.3.5 and what it pulls in (rolldown, postcss and others: MIT; lightningcss: MPL-2.0; picocolors: ISC; source-map-js: BSD-3-Clause; tslib: 0BSD) | MIT | building the window; not shipped | -| Tauri 2 with tauri-plugin-shell and tauri-plugin-dialog, fontdb, regex, serde, serde_json, windows-sys, objc2 and its companions | the same crates formtxt's shell uses; their licences have not been read for this repository yet | desktop shell, which has not been compiled yet | +| Tauri 2 with tauri-plugin-shell and tauri-plugin-dialog, fontdb, regex, serde, serde_json, windows-sys, objc2 and its companions | the same crates formtxt's shell uses; their licenses have not been read for this repository yet | desktop shell, which has not been compiled yet | The window has no runtime dependency and uses the system font stack. From 8a8dcd3b432a829dd5343e6e9569452945f93560 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 16:36:39 -0500 Subject: [PATCH 19/27] fix(list): give titles room on narrow windows Below 1250 pixels the type column folds away and the creator column narrows so titles stay readable. --- frontend/src/styles/itemlist.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/src/styles/itemlist.css b/frontend/src/styles/itemlist.css index 21548b1..bb56514 100644 --- a/frontend/src/styles/itemlist.css +++ b/frontend/src/styles/itemlist.css @@ -84,3 +84,7 @@ .fc-il-row .fc-il-c-creator, .fc-il-row .fc-il-c-type, .fc-il-row .fc-il-c-added { color: var(--text-muted); } .fc-il-row .fc-il-c-year, .fc-il-row .fc-il-c-added { font-variant-numeric: tabular-nums; } .fc-il-empty { pointer-events: none; } +@media (max-width: 1250px) { + .fc-il { --il-col-creator: 120px; --il-col-type: 0px; --il-col-added: 100px; } + .fc-il-head > :nth-child(4), .fc-il-row > :nth-child(4) { visibility: hidden; padding: 0; overflow: hidden; } +} From cbfad5233da0317729963128da32867812b85574 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 16:36:39 -0500 Subject: [PATCH 20/27] fix(preferences): label the three-way choice as theme The Appearance section now reads Theme for its System, Light and Dark choice. --- frontend/src/ui/preferences.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/ui/preferences.ts b/frontend/src/ui/preferences.ts index 121d131..01930c6 100644 --- a/frontend/src/ui/preferences.ts +++ b/frontend/src/ui/preferences.ts @@ -17,7 +17,7 @@ function shell(): string {

${icon('sliders', 14)}Appearance

-
+
From e8156f90b8c6e0b5a6a19cab30745e68e4f3904c Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 16:38:57 -0500 Subject: [PATCH 21/27] docs(hashout): record the family window and theme choice The log records the pre-paint theme, the token aliases, the kept row height and the checks. --- frontend/HASHOUT_LOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/HASHOUT_LOG.md b/frontend/HASHOUT_LOG.md index 95dc629..676d44e 100644 --- a/frontend/HASHOUT_LOG.md +++ b/frontend/HASHOUT_LOG.md @@ -436,3 +436,7 @@ New in v0.10.0 (2026-11-27). `ViewId` has no `titles` and the nav buttons are bu ## src/ui/dom.ts, src/ui/side.ts, src/styles/side.css {#src-side-tag-faults} New in v0.10.0 (2026-11-27). `patchList` now keeps the longest run of nodes that are already in order and inserts only the others (each before its final next sibling), where it used to insert every node ahead of a cursor and so detached untouched neighbours when one node moved far. A moved node that held focus gets focus back with its selection range. Signature and callers are unchanged (item pane tags, notes, creators and attachments in `ui/detail.ts`, Preferences, trash, duplicates). The side pane counts notices (`pane.want`) and drops a tags or collections read that was issued before the latest notice or before a tag rename started, since the coalesced re-read follows it. A tag typed in the item pane gets its row at once: a capture keydown on `.fc-dt-tag-input` inserts a provisional row (`data-key` `new:NAME`, class `is-pending`, not clickable) in sorted place at the input, and the next tags read rekeys it to the engine's id in place; one never confirmed within 10 s is dropped. `engine/library.ts` carries no name in `tags:changed`; a `tags:adding` notice with the name, sent by `DetailModel.addTag` before the request, would replace the keydown listener. The tag list is capped at 12 rows and scrolls inside its box. The focus loss after a rename was not reproduced in this environment: 12 renames before the change and 10 of 10 after kept focus on the renamed entry 2 s later under CPU 4x, 400 ms and 50 kB/s, with a page-side focusout listener, patched `insertBefore`, `remove`, `focus` and `blur` logging stacks; the only focus change was the edit input giving way to the entry. Checked in a private built copy with 2,000 items, 31 tags on 600 items (seeded through the tags store `add` in a Python loop) and four collections: five new tags added from the item pane had their row at 250 ms and layout shift 0 without input, a tag delete, a scope pick, tree arrows (one tab stop) and note add and remove (one POST, one DELETE) all held. + +## index.html, src/engine/preferences.ts, src/ui/app.ts, src/styles/tokens.css, src/styles/shell.css {#src-family-window} + +New in v0.10.0 (2026-11-27). The window follows the family's look, ported from form.md (`web/index.html` pre-paint) and FormLedger (`web/src/ui/theme/tokens.css`). The pre-paint script reads `formcite.theme` (`{theme, accentColor}`, same key), resolves `system` through `prefers-color-scheme` and sets `data-theme` and `data-theme-pref` on `` before any stylesheet; any stored older profile name (`studio`, `amoled` and so on, including the old `light`) reads as dark, and the old default accent `#a077e0` reads as unset so each theme keeps its own accent. `engine/preferences.ts` owns the appearance now (`applyAppearance`, `setMode`, a `matchMedia` listener for `system`); `ui/themes.ts` is no longer called by the window, and `main.ts` still passes `readChoice().theme` to `createEngine`, which is only the engine's starting value. The older token names (`--bg-primary`, `--text-primary`, `--accent-color` and the rest) alias the family names, so pane styles not yet rewritten follow both themes. `--row` stays 28 px, not the family's 30, because `ui/itemlist.ts` holds `ROW_H = 28` beside `--il-row-h`; the two must change together. The top bar's view name is six spans shown by `.fc-panes[data-view]`, with no script. The list error line floats over the list foot instead of reserving an 18 px row (the blank gap above the first row). Checked in a private built copy with 2,000 items under CPU 4x, 400 ms, 50 kB/s, fresh engine per load: `data-theme` at DOMContentLoaded matched `color_scheme` (light and dark), pool 55, layout shift 0 with and without input at 1400 by 900 and 1100 by 800, and `fc_exit.py` total 0 and 0 with pool 55 at start and end. From f1655531bc90e206362a800952533f09c9d08612 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 16:40:18 -0500 Subject: [PATCH 22/27] feat(shell): make add the primary action in the top bar The Add button in the top bar uses the accent fill as the family's primary action. --- frontend/src/styles/shell.css | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frontend/src/styles/shell.css b/frontend/src/styles/shell.css index 77f733c..a511d90 100644 --- a/frontend/src/styles/shell.css +++ b/frontend/src/styles/shell.css @@ -24,6 +24,8 @@ body { font-size: var(--fs-12); line-height: 1.35; } .fc-topbar { grid-row: 1; grid-column: 2 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: var(--space-3); min-width: 0; padding: 0 var(--space-1) 0 var(--space-4); } .fc-tb-title { min-width: 0; color: var(--text); font-size: var(--text-md); font-weight: var(--weight-semibold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .fc-tb-title > span { display: none; } +.fc-topbar .fc-add-open { border-color: var(--accent); background: var(--accent); color: var(--on-accent); font-weight: var(--weight-medium); } +.fc-topbar .fc-add-open:hover:not(:disabled) { background: var(--accent-color-hover); } .fc-panes[data-view="library"] .fc-tb-title > [data-v="library"], .fc-panes[data-view="duplicates"] .fc-tb-title > [data-v="duplicates"], .fc-panes[data-view="trash"] .fc-tb-title > [data-v="trash"], From 3344e75f40bc8c9d0c70922bca2d5adb7c3f6118 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 16:42:08 -0500 Subject: [PATCH 23/27] fix(toast): key the light shadow on the theme attribute The body class it used is no longer set now that the window follows data-theme. --- frontend/src/styles/light-mode.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/styles/light-mode.css b/frontend/src/styles/light-mode.css index 7214c9e..99edcac 100644 --- a/frontend/src/styles/light-mode.css +++ b/frontend/src/styles/light-mode.css @@ -1 +1 @@ -body.theme-light .fc-toast { box-shadow: var(--shadow-lg); } +:root[data-theme="light"] .fc-toast { box-shadow: var(--shadow-lg); } From 301487018ec5095ed8a478fc81f34ac043336d62 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 16:42:08 -0500 Subject: [PATCH 24/27] docs(style): quote the new missing-engine sentence Both pages still gave the old wording; the style engine page now links the build page. --- docs/FORMATTING.md | 2 +- docs/STYLE_ENGINE.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/FORMATTING.md b/docs/FORMATTING.md index cdbe984..2334054 100644 --- a/docs/FORMATTING.md +++ b/docs/FORMATTING.md @@ -27,7 +27,7 @@ Every failure a person can cause is a plain store error, never a traceback: | unknown style | `Invalid`: `unknown style 'x'; ./formcite cli styles --all lists the 93 names` | 422 | one sentence on stderr, exit 1 | | no ids, a locator for an id not cited, an empty preview, a repeated preview id | `Invalid` | 422 | exit 1 | | an id not in the library | `NotFound`: `item ` | 404 | `Not found: item .`, exit 1 | -| engine not built | `Invalid` with the engine's sentence: `The citation style engine is not built on this machine; run ./setup/build_style to build it` | 422 | exit 1 | +| engine not built | `Invalid` with the engine's sentence: `The citation style engine is not installed: run ./formcite install (setup/build_style --from-source builds it with Rust)` | 422 | exit 1 | An unknown locale is refused with `Unknown locale: [code].` (422, exit 1). The code must match one of the locales the engine bundles exactly, for example `en-US` or `de-DE`. diff --git a/docs/STYLE_ENGINE.md b/docs/STYLE_ENGINE.md index fe2e7d2..cad26cf 100644 --- a/docs/STYLE_ENGINE.md +++ b/docs/STYLE_ENGINE.md @@ -38,7 +38,7 @@ Why 0.10.1: it is the newest release, it already carries the 0.10.0 style rename Errors from the built module are `ValueError` with a plain sentence: `unknown style: X`, `unknown locale: X` (the code must be exactly one of `locales()`; Hayagriva itself falls back silently to other terms, so FormCite refuses instead), `citation names unknown id: X`, `unknown locator label: X`, `the style file does not parse as CSL: ...`, `the style file is a dependent style, which only points at another style; give its parent style instead`, and `a prefix or suffix on a citation item is not supported by the style engine: X`. -`get_engine()` in `backend/app/style/__init__.py` returns the one shared engine. `HayagrivaEngine` imports `formcite_style` on first use, never at import time. When the module is missing, `available()` is false, `styles()` is empty, and `render` raises `StyleEngineUnavailable` with the sentence: "The citation style engine is not built on this machine; run ./setup/build_style to build it." +`get_engine()` in `backend/app/style/__init__.py` returns the one shared engine. `HayagrivaEngine` imports `formcite_style` on first use, never at import time. When the module is missing, `available()` is false, `styles()` is empty, and `render` raises `StyleEngineUnavailable` with the sentence: "The citation style engine is not installed: run ./formcite install (setup/build_style --from-source builds it with Rust)." How a release ships the engine prebuilt is in [`STYLE_ENGINE_BUILD.md`](STYLE_ENGINE_BUILD.md). Input: `items` is a list of CSL-JSON items (each with an `id`). `citations` is a list of `{"items": [{"id": ..., "locator": "207", "label": "page"}]}`; `locator` and `label` are optional, `label` defaults to `page` and takes the CSL locator names: `act`, `appendix`, `article-locator`, `book`, `canon`, `chapter`, `column`, `elocation`, `equation`, `figure`, `folio`, `issue`, `line`, `note`, `opus`, `page`, `paragraph`, `part`, `rule`, `scene`, `section`, `sub-verbo` (or `sub verbo`), `supplement`, `table`, `timestamp`, `title`, `title-locator`, `verse`, `volume` (each checked against the built module; `version` is refused). The regression set exercises page, chapter, section, figure, paragraph, line, volume and note. An item may also carry `"suppress-author": true`. From 2882a3b85c740732caffa6701db39fe962337bac Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 16:42:08 -0500 Subject: [PATCH 25/27] docs(readme): lay the readme out like the family's Centered head with badges and links, a features table, download, run from source, repository, maintainers and license sections. Says what is and is not built. --- README.md | 111 ++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 100 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index f4d8811..fdafc24 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,84 @@ -# FormCite - -The FormCite icon - -A local-first personal research library from the FormAI family of apps: collect sources, organise them, and cite them from the app you are writing in. - -**Status:** early. The library works from the command line and over the engine's routes: references, collections, tags, notes, attached files, search and a trash; import and export in BibTeX, RIS and CSL-JSON with duplicates caught; and citations and bibliographies in the styles the engine bundles or in your own style file; and adding a reference from a DOI, an arXiv id, an ISBN, a PubMed ID or a dropped PDF; and a cite service and an MCP server that other apps and agents use with a token you approve ([`docs/`](docs/README.md)). The window now shows the library: collections and tags, a sortable list that stays smooth with thousands of items, a pane to read and edit one item, adding by identifier or import, export, duplicates, trash and preferences ([`docs/WINDOW.md`](docs/WINDOW.md)). It is new and only partly checked in a browser; the desktop app in `src-tauri/` has not been compiled. +

+ FormCite icon +

+ +

FormCite

+ +

+ Library; the Form family's personal research library.
+ Collect sources, organize them and cite them from the app you are writing in.
+ Python and SQLite, on your own computer. +

+ +

+ version 0.10.0 + Python 3.12 or later + License: GPL-3.0-only + Status: early +

+ +

+ Features · + Apps and agents · + Network · + Download · + Run from source +

+ +## Features + + + + + + + + + + + + +
+

A library

+ References, collections, tags, notes, attached files, full-text search and a trash. The list stays smooth with thousands of items. +
+

In and out

+ Import and export BibTeX, RIS and CSL-JSON, with duplicates caught on the way in and a view to merge them. +
+

Citations

+ Citations and bibliographies in the styles the engine bundles, or in your own style file. +
+

Adding

+ From a DOI, an arXiv id, an ISBN or a PubMed ID, or from a PDF you drop on the window. +
+

A window

+ Items, Duplicates, Trash, Connections and Preferences views (docs/WINDOW.md). It follows the system's light or dark theme. Stored PDFs open in FormPDF when it is installed, and other files in your system viewer. +
+

Other apps and agents

+ A cite service and an MCP server, both closed until you approve a token. The command line needs no engine. +
+ +The details of each part are in [`docs/`](docs/README.md). + +## Download + +There is no downloadable desktop app yet. The shell in `src-tauri/` has never been compiled, so a release is not out; until then you run FormCite from source. ## Run it from source -**Requires:** Python 3.12 and Node 22, the versions the checks use. +**Requires:** Python 3.12 or later and Node 22. Rust is needed only if no prebuilt citation style engine is found for your platform. ```sh ./formcite_oc_install # engine venv and window packages ./formcite # engine on 127.0.0.1:8330, window at http://localhost:5330 ./formcite serve # the engine alone, with no window ./formcite cli --help # the library from the command line, no engine needed -./setup/build_style # build the citation style engine (needs Rust), once ``` +The install puts in a prebuilt citation style engine when it finds one (in `wheels/`, in `native/formcite-style/dist/`, or in the folder `FORMCITE_STYLE_WHEELS` names). Otherwise it builds the engine from source, which needs Rust (`./setup/build_style`). With neither, everything works except formatting a citation, which answers 503 until you run `./setup/build_style --from-source` with Rust installed. No wheel is shipped in this repository yet. + +A few commands to try, once the install is done: + ```sh ./formcite cli item add title="A" author="Doe, J" year=2024 ./formcite cli search A @@ -62,6 +123,34 @@ Nothing, unless you ask for a lookup. `./formcite cli add doi=...` (or `arxiv=`, In the window, Preferences lists every service with a switch for each. `./formcite cli network list` shows these with their switches, `network off` stops every call, `network disable NAME` stops one service, and `network log` shows every call that was made. Setting `FORMCITE_OFFLINE=1` forces the network off. No email address is sent unless you set one with `network contact`. The rules are in [`docs/NETWORK.md`](docs/NETWORK.md). -The data folder is `~/FormCite` (`FORMCITE_DATA_DIR`). Working on the code: see [`CONTRIBUTING.md`](CONTRIBUTING.md) and [`AGENTS.md`](AGENTS.md). +The data folder is `~/FormCite`; `FORMCITE_DATA_DIR` moves it. + +> [!IMPORTANT] +> **Status:** early. The library, the command line, the cite service and the MCP server work; the window is new and only partly checked in a browser; the desktop app in `src-tauri/` has not been compiled. + +**Contributing:** see [`CONTRIBUTING.md`](CONTRIBUTING.md), the [code of conduct](CODE_OF_CONDUCT.md), [`SECURITY.md`](SECURITY.md) and [`AGENTS.md`](AGENTS.md). + +## Repository + +| Path | What it is | +| --- | --- | +| `backend/` | the engine: Python and FastAPI, the library store, the command line, the cite service and the MCP server | +| `frontend/` | the window: TypeScript and Vite | +| `native/formcite-style/` | the citation style engine, a Rust module built on Hayagriva | +| `src-tauri/` | the desktop shell, not yet compiled | +| `docs/` | one page per part ([`docs/README.md`](docs/README.md)) | +| `setup/` | install, build and boot scripts | +| `assets/brand/` | the logo and icon art | + +## Maintainers + +| Maintainer | Role | +| --- | --- | +| [@nodemode-ai](https://github.com/nodemode-ai) | Code owner | +| [@gbarnai](https://github.com/gbarnai) | Code owner | + +Code owners are set in [`.github/CODEOWNERS`](.github/CODEOWNERS). + +## License -**License:** GPL-3.0-only. Copyright (C) 2026 NodeAgentc, Inc. See [`LICENSE`](LICENSE) and [`NOTICE.md`](NOTICE.md). +FormCite is licensed under the GNU General Public License v3.0 ([`LICENSE`](LICENSE), SPDX `GPL-3.0-only`). Copyright (C) 2026 NodeAgentc, Inc. Third-party notices: [`NOTICE.md`](NOTICE.md). From 440ae751543e36f3689018e3bbccf2effe890bea Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 16:44:20 -0500 Subject: [PATCH 26/27] docs(notice): credit the theme start, the tokens and the build patterns Rows for form.md, FormLedger, formcompiler and formslot, each with its license. --- NOTICE.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/NOTICE.md b/NOTICE.md index fca75b6..330649a 100644 --- a/NOTICE.md +++ b/NOTICE.md @@ -13,6 +13,9 @@ A file brought over from another Form repository gets a row here with its source | formDAM v1.32.0 (`nodemode-dev/formDAM`) | Apache-2.0 | Patterns, adapted and not copied: the registry of libraries (`backend/app/libraries.py`) and the copy, move or reference import with SHA-256 (`services/libraryfs.py`) behind `backend/app/store/libraries.py` and `files.py`; the connection set-up and saved searches kept as rules in JSON behind `backend/app/store/db.py` and `searches.py` | | formvfx v0.60.0 (`nodemode-dev/formvfx`) | Apache-2.0 | The way a Rust crate is built into a Python module (`native/fvx-core` and `setup/build_native`), followed in `native/formcite-style` and `setup/build_style`; rewritten, not copied | | formtxt v0.38.0 (`nodemode-dev/formtxt`), since 0.6.0 | Apache-2.0 | `setup/agents.py`: the install half of FormTxt's `setup/agents.py` (the four agent clients, each config file's format, the timestamped backup, the skill copy), rewritten from it with the sync, manifest and dock parts left out. `backend/app/mcp/stdio.py`: the shape of FormTxt's `setup/mcp_stdio.py` (one JSON-RPC message a line, logs on stderr, the parse error), with the library opened in-process instead of forwarding to a running engine | +| form.md (`nodemode-dev/form.md`) at its `main` of 2026-11-27, since 0.11.0 | Apache-2.0 | The pre-paint theme script in `frontend/index.html`, adapted to FormCite's stored key | +| FormLedger v0.10.0 (`nodemode-dev/formledger`), since 0.11.0 | Apache-2.0 | The token names and values for the dark and light themes in `frontend/src/styles/tokens.css` | +| formcompiler and formslot (`nodemode-dev/formcompiler`, `nodemode-dev/formslot`) at their `main` of 2026-11-27, since 0.11.0 | GPL-3.0-only | Patterns, adapted and not copied: the registry entry shape of `apps/formrig.json` behind `packaging/formcompiler/apps/formcite.json`, the five build runners in the `style` CI job, and the prebuilt-before-source order of formslot's installer in `setup/build_style` | ## Third-party software From ff242e2148376cd359f89c30ae60d897aad62232 Mon Sep 17 00:00:00 2001 From: nodemode-ai Date: Fri, 27 Nov 2026 16:44:20 -0500 Subject: [PATCH 27/27] chore(release): 0.11.0 Moves every version site to 0.11.0 and adds the changelog section. --- CHANGELOG.md | 26 ++++++++++++++++++++++++++ README.md | 2 +- backend/HASHOUT_LOG.md | 2 +- backend/app/__init__.py | 2 +- frontend/HASHOUT_LOG.md | 2 +- frontend/package-lock.json | 4 ++-- frontend/package.json | 2 +- frontend/src/version.ts | 2 +- native/formcite-style/Cargo.lock | 2 +- native/formcite-style/Cargo.toml | 2 +- native/formcite-style/pyproject.toml | 2 +- setup/HASHOUT_LOG.md | 2 +- src-tauri/Cargo.lock | 2 +- src-tauri/Cargo.toml | 2 +- src-tauri/HASHOUT_LOG.md | 2 +- src-tauri/tauri.conf.json | 2 +- 16 files changed, 42 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 987a24a..e469755 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,31 @@ # Changelog +## 0.11.0 + +### New +- The window follows your system's light or dark theme. Preferences offers System, Light and Dark. +- The window has the Form family's frame: a sidebar head with the icon and name, a top bar with the view's name and Add, and the list and details on one sheet. +- `./formcite install` puts in a prebuilt citation style engine when one fits your machine, and builds from source only when none does. `setup/build_style --wheel` builds a wheel and refuses it unless the twelve style regression cases pass. `docs/STYLE_ENGINE_BUILD.md` has the details. +- Stored PDFs open in FormPDF when it is installed, handed over by command line. Other files open in your system viewer as before. +- CI builds the style wheel on five runners and runs the regression set against each. +- `packaging/formcompiler/apps/formcite.json` is a proposed registry entry for the family's compiler. Nothing reads it yet. + +### Fixed +- The Year column header is whole, and the blank gap above the first row is gone. +- A creator's names, role and buttons fit on one line in the details pane on a window 1300 px wide or more. +- The sentence shown when the style engine is missing now says how to install it. + +### Changed +- A light or soft-light theme saved by an older version reads as dark until you pick again in Preferences. +- Below 1250 px the Type column hides so titles stay readable. +- The README follows the family's layout. Spelling is American English in the docs and on screen. + +### Known issues +- Not run: the macOS and Windows builds, the `.bat` scripts, the frozen engine, the desktop shell (never compiled; it has no splash screen yet) and the CI workflows. +- FormPDF was not installed here, so the hand-off was not seen opening a file. +- The Add dialog still has its old shape, and a long title does not wrap in the details pane. +- Duplicates, Trash and Connections were not looked at in the light theme. + ## 0.10.0 ### New diff --git a/README.md b/README.md index fdafc24..0348809 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@

- version 0.10.0 + version 0.11.0 Python 3.12 or later License: GPL-3.0-only Status: early diff --git a/backend/HASHOUT_LOG.md b/backend/HASHOUT_LOG.md index 0a8a5d4..6e619ca 100644 --- a/backend/HASHOUT_LOG.md +++ b/backend/HASHOUT_LOG.md @@ -2,7 +2,7 @@ Living log of all comment content, explainers, rationale, TODOs, & removed (hashed-out) code for this side of the repo. Source files stay comment-free per dev-rules `sub-skills/hashout-log/SUB-SKILL.md`; everything they would have said lives here, indexed. This file is also the compressed contextual map of this side: read it first, then edit code surgically. -Current build version: v0.10.0 +Current build version: v0.11.0 Last updated: 2026-11-27 (US Eastern) · the lean rows route for the window's list and opening an attachment --- diff --git a/backend/app/__init__.py b/backend/app/__init__.py index 61fb31c..ae6db5f 100644 --- a/backend/app/__init__.py +++ b/backend/app/__init__.py @@ -1 +1 @@ -__version__ = "0.10.0" +__version__ = "0.11.0" diff --git a/frontend/HASHOUT_LOG.md b/frontend/HASHOUT_LOG.md index 676d44e..601fc87 100644 --- a/frontend/HASHOUT_LOG.md +++ b/frontend/HASHOUT_LOG.md @@ -2,7 +2,7 @@ Living log of all comment content, explainers, rationale, TODOs, & removed (hashed-out) code for this side of the repo. Source files stay comment-free per dev-rules `sub-skills/hashout-log/SUB-SKILL.md`; everything they would have said lives here, indexed. This file is also the compressed contextual map of this side: read it first, then edit code surgically. -Current build version: v0.10.0 +Current build version: v0.11.0 Last updated: 2026-11-26 (US Eastern) · window skeleton: shell, engine store, window key, health status --- diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 4325ce7..6c64a41 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -1,12 +1,12 @@ { "name": "formcite", - "version": "0.10.0", + "version": "0.11.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "formcite", - "version": "0.10.0", + "version": "0.11.0", "license": "GPL-3.0-only", "devDependencies": { "typescript": "7.0.2", diff --git a/frontend/package.json b/frontend/package.json index 7a31b97..127173e 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,7 +1,7 @@ { "name": "formcite", "private": true, - "version": "0.10.0", + "version": "0.11.0", "description": "FormCite: a local-first personal research library from the Form family", "license": "GPL-3.0-only", "type": "module", diff --git a/frontend/src/version.ts b/frontend/src/version.ts index 699451e..526f948 100644 --- a/frontend/src/version.ts +++ b/frontend/src/version.ts @@ -1 +1 @@ -export const VERSION = '0.10.0'; +export const VERSION = '0.11.0'; diff --git a/native/formcite-style/Cargo.lock b/native/formcite-style/Cargo.lock index 940c831..bc11726 100644 --- a/native/formcite-style/Cargo.lock +++ b/native/formcite-style/Cargo.lock @@ -81,7 +81,7 @@ dependencies = [ [[package]] name = "formcite-style" -version = "0.10.0" +version = "0.11.0" dependencies = [ "hayagriva", "pyo3", diff --git a/native/formcite-style/Cargo.toml b/native/formcite-style/Cargo.toml index cb603be..fc8e697 100644 --- a/native/formcite-style/Cargo.toml +++ b/native/formcite-style/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "formcite-style" -version = "0.10.0" +version = "0.11.0" edition = "2024" rust-version = "1.95" license = "Apache-2.0" diff --git a/native/formcite-style/pyproject.toml b/native/formcite-style/pyproject.toml index 654e5da..a77eda1 100644 --- a/native/formcite-style/pyproject.toml +++ b/native/formcite-style/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "maturin" [project] name = "formcite-style" -version = "0.10.0" +version = "0.11.0" description = "FormCite citation style engine for the FormCite engine service" license = { text = "Apache-2.0" } requires-python = ">=3.10" diff --git a/setup/HASHOUT_LOG.md b/setup/HASHOUT_LOG.md index 496a64d..216c6e9 100644 --- a/setup/HASHOUT_LOG.md +++ b/setup/HASHOUT_LOG.md @@ -2,7 +2,7 @@ Living log of all comment content, explainers, rationale, TODOs, and removed code for the root launcher scripts and the `setup/` suite. The scripts stay comment-free; everything they would have said lives here, indexed. Read this first, then edit the scripts surgically. -Current build version: v0.10.0 +Current build version: v0.11.0 Last updated: 2026-11-27 · initial port of the launcher and setup suite --- diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index efe9c0c..8d77573 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -918,7 +918,7 @@ dependencies = [ [[package]] name = "formcite" -version = "0.10.0" +version = "0.11.0" dependencies = [ "fontdb", "objc2", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index ad1f56c..4b7cf36 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "formcite" -version = "0.10.0" +version = "0.11.0" description = "FormCite desktop shell" authors = ["NodeAgentc, Inc."] license = "GPL-3.0-only" diff --git a/src-tauri/HASHOUT_LOG.md b/src-tauri/HASHOUT_LOG.md index fdc9b4e..36a8e7d 100644 --- a/src-tauri/HASHOUT_LOG.md +++ b/src-tauri/HASHOUT_LOG.md @@ -2,7 +2,7 @@ Living log of all comment content, explainers, rationale, TODOs, & removed (hashed-out) code for the desktop shell side of the repo. Source files stay comment-free per dev-rules `sub-skills/hashout-log/SUB-SKILL.md`; everything they would have said lives here, indexed. This file is also the compressed contextual map of this side: read it first, then edit code surgically. -Current build version: v0.10.0 +Current build version: v0.11.0 Last updated: 2026-11-26 (US Eastern) · Tauri 2 shell ported from FormTxt, renamed, launch code added --- diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index a37a1b0..86bd08e 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "FormCite", - "version": "0.10.0", + "version": "0.11.0", "identifier": "ai.nodemode.formcite", "build": { "devUrl": "http://localhost:5330",