Skip to content

fix: Continuous harden — OCC, load resilience, metadata, snippets - #20

Merged
kegouro merged 7 commits into
mainfrom
kegouro/fix/harden-polish-continuous
Jul 10, 2026
Merged

fix: Continuous harden — OCC, load resilience, metadata, snippets#20
kegouro merged 7 commits into
mainfrom
kegouro/fix/harden-polish-continuous

Conversation

@kegouro

@kegouro kegouro commented Jul 10, 2026

Copy link
Copy Markdown
Owner

Summary

Production hardening pass after v0.3.0: fix real data-loss races, API metadata gaps, and catalog bugs.

Correctness / data loss

  • Autosave OCC: serialize PUTs, always refresh activeVersion on success, retry once on 409 using server current
  • Atomic replace: EventStore.append(..., expected_version=) under page lock (no TOCTOU between check and write)
  • Stale version after writes: refresh page version after diagram insertCell, time-travel restore, and export freeze
  • Optimistic UI: diagrams/parameters persist first, then update local latex from server response

API / UI resilience

  • PageDetail includes project_id + updated_at (frontend no longer forces project_id: null)
  • App shell boot uses Promise.allSettled so one failing endpoint does not blank the whole UI
  • Cells panel / lab-canvas: try/catch on mutations; listCells failure handled
  • Export “sitio estático” enabled without an active page
  • Bound title (500) and project_id (128); clamp fontScale 70–150; ignore unknown panel ids from localStorage
  • Safe LABLOG_PORT parse

Catalog

  • Fix fit_line (.format collision with f-string braces)
  • Fix simple_table extra \\ producing broken LaTeX

Test plan

  • pytest -q — 209 passed, coverage ≥80%
  • cd ui && npm test -- --run — 26 passed
  • npx tsc --noEmit + pre-commit hooks (ruff, mypy, tsc, oxlint)
  • Manual: type in editor, insert diagram+sim, export freeze, restore version — no 409 toast loop
  • Manual: assign project_id via PATCH, open page — sidebar group still correct

kegouro and others added 7 commits July 10, 2026 19:11
Preserve project_id/updated_at on PageDetail so the UI does not wipe
grouping after getPage. Fail soft on boot (allSettled), guard cell/panel
mutations, clamp fontScale, bound title/project_id, and colorize TikZ
only within the same option bracket.

Co-Authored-By: Kimi Code <noreply@example.com>
Serialize page autosaves and always refresh version from the server;
retry once on 409 using conflict current. Make replace_document OCC
atomic under the event-store lock. Refresh version after diagram cell
inserts, restore, and export freezes. Fix fit_line/simple_table templates
and harden lab-canvas error paths.

Co-Authored-By: Kimi Code <noreply@example.com>
Persist unsaved lab cell source before leaving lab mode (toolbar,
shortcuts, command palette, settings, and unmount). Resync page
latex/version after flush. insert/update cell APIs return version for
OCC; snippets and templates pass version on replace.

Co-Authored-By: Kimi Code <noreply@example.com>
move_cell includes event-log version so lab mode can keep activeVersion
aligned without a full page reload.

Co-Authored-By: Kimi Code <noreply@example.com>
Rewrite the project README as a research-oriented handbook: full TOC,
gallery assets, mermaid event-sourcing and layered diagrams, PyPI/CLI/API
surfaces, twelve diagram presets, security invariants, and citation block.
Sober monochrome GitHub badges and figures; no emoji.

Co-Authored-By: Kimi Code <noreply@example.com>
Capture live workbench, diagrams, parameters, lab mode, settings and
cells from Vite+API; expand architecture mermaid diagrams; document
keyboard shortcuts; add README.es.md as full Spanish twin with shared
gallery assets and GitHub badge set.

Co-Authored-By: Kimi Code <noreply@example.com>
Translate remaining mixed English paragraphs, feature rows, module map,
export tables, roadmap status labels, contributing and acknowledgements
into academic Spanish while keeping code and identifiers intact.

Co-Authored-By: Kimi Code <noreply@example.com>
@kegouro
kegouro merged commit 4975b73 into main Jul 10, 2026
2 checks passed
@kegouro
kegouro deleted the kegouro/fix/harden-polish-continuous branch July 10, 2026 23:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant