Commit graph

240 commits

Author SHA1 Message Date
Andrew Pimenov
3a628521f2
Merge e299e58eb4 into bede889ced 2026-10-27 05:56:34 -07:00
Horizontal42
bede889ced ci: fix tauri --ci flag in woodpecker 2026-09-20 02:35:05 +03:00
Horizontal42
617a295084 ci: add clippy component in rust container 2026-09-20 02:26:02 +03:00
Horizontal42
8de1925be6 ci: add woodpecker pipeline for build and tests 2026-09-20 02:22:50 +03:00
google-labs-jules[bot]
e299e58eb4 ⚡ Optimize registry addPhrase deduplication lookup
Replaced the `.join(" ")` array concatenations in the registry's phrase deduplication logic with an element-wise comparison using `.every()`. The previous logic repeatedly allocated new strings and iterated through arrays for every element in the collision list, leading to redundant memory allocations during registry creation. This change reduces the average time to execute `buildRegistry()` across 5 iterations from ~864ms to ~304ms, representing an ~65% performance improvement.

Co-authored-by: Horizontal42 <75383519+Horizontal42@users.noreply.github.com>
2026-09-10 08:44:12 +00:00
Horizontal42
37cfd2144b update docs: fix test count (373 not 259), add missing files to arch tree
- vitest actually runs 373 cases across 21 files, not 259
- added workspace.ts, sparkline.ts, logger.ts to the file tree in ARCHITECTURE
- fixes in all four language variants: README + ARCHITECTURE in EN and RU
2026-08-23 18:45:27 +03:00
Horizontal42
663b2ccab8 sync package-lock.json with 1.2.9 2026-08-19 16:52:30 +03:00
Horizontal42
a4b69ec9e7 sync Cargo.lock with 1.2.9 2026-08-19 16:50:11 +03:00
Horizontal42
b91f650c31 update tauri.conf version to 1.2.9 2026-08-19 16:49:57 +03:00
Horizontal42
1cd9807543 bump cargo version to 1.2.9 2026-08-19 16:49:50 +03:00
Horizontal42
942f963c9d bump version to 1.2.9 2026-08-19 16:49:43 +03:00
Horizontal42
786dbe3daa
Refactor evalCall to use BUILTIN_FUNCS lookup object (#103)
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2026-08-19 16:47:06 +03:00
Horizontal42
70492159e6
⚡ Unnecessary DOM writes in drag mousemove event (#98)
* perf: Optimize DOM writes in drag mousemove event

Optimizes the drag-and-drop `mousemove` event handler by caching the previously hovered element. The `drag-over` class is now only removed from `prevOver` and added to the new hover target, instead of looping through all `cachedItems` to remove the class on every move. This eliminates layout thrashing and high CPU usage during drag operations.

Co-authored-by: Horizontal42 <75383519+Horizontal42@users.noreply.github.com>

* drop stray benchmark script

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2026-08-19 16:44:07 +03:00
Horizontal42
203c4b4efd
refactor: use switch statement in parser loop for readability (#101)
Replaces the deeply nested if-chain inside the Pratt parser loop in `src/engine/parser.ts` with a `switch` statement over token types. Introduces a labeled `loop: for(;;)` to maintain accurate `continue`/`break` semantics while greatly enhancing the visual parsing and extensibility of the logic without hurting evaluation speed.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2026-08-19 16:36:38 +03:00
Horizontal42
34d2defa82
Refactor: Extract removeDocById helper for document filtering (#112)
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2026-08-19 16:36:35 +03:00
Horizontal42
12ae91da2e
perf(engine): reuse Decimal(0) and Decimal(1) instances (#106)
Added exported constants `DEC_ZERO` and `DEC_ONE` in `src/engine/types.ts`
and replaced all instances of `new Decimal(0)` and `new Decimal(1)`
across `src/engine/evaluator.ts` with these constants.
This reduces unnecessary memory allocations and garbage collection
overhead in the evaluator engine, especially during hot loops like
goal seek (root finding).

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2026-08-19 16:36:10 +03:00
Horizontal42
1e80c55011
Refactor parseLine logic in src/engine/parser.ts (#100)
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2026-08-19 16:36:05 +03:00
Horizontal42
62f55b10a9
Extract getDocById helper function (#97)
- Extracts `data.docs.find((d) => d.id === ...)` into a helper function to deduplicate finding document logic.
- Cleans up an unused `data` parameter on `setupDocInteraction`.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2026-08-19 16:36:02 +03:00
Horizontal42
5158771aeb
Add test suite for application main entry point (#114)
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2026-08-19 16:35:49 +03:00
Horizontal42
8c50fc8aa9
🔒 [security fix] Remove unsafe path canonicalization in directory gate (#111)
* 🔒 [security fix] Remove unsafe path canonicalization in directory gate

🎯 What:
Removed filesystem-level path canonicalization in the DataDirGate check (`canon_or_raw`).

⚠️ Risk:
An attacker could bypass directory authorization by creating a symlink to an authorized directory, allowing them to redirect arbitrary path reads/writes via TOCTOU (Time-of-Check to Time-of-Use) attacks or misleading unverified paths.

🛡️ Solution:
Replaced `fs::canonicalize` with purely lexical path normalization (resolving `.` and `..` in memory) to ensure strict string match validation without following symlinks. Ensure relative paths with `..` that go above the start are handled securely.

Co-authored-by: Horizontal42 <75383519+Horizontal42@users.noreply.github.com>

* 🔒 [security fix] Remove unsafe path canonicalization in directory gate

🎯 What:
Removed filesystem-level path canonicalization in the DataDirGate check (`canon_or_raw`).

⚠️ Risk:
An attacker could bypass directory authorization by creating a symlink to an authorized directory, allowing them to redirect arbitrary path reads/writes via TOCTOU (Time-of-Check to Time-of-Use) attacks or misleading unverified paths.

🛡️ Solution:
Replaced `fs::canonicalize` with purely lexical path normalization (resolving `.` and `..` in memory) to ensure strict string match validation without following symlinks. Ensure relative paths with `..` that go above the start are handled securely without dropping components incorrectly. Added proper Iterator methods to appease clippy.

Co-authored-by: Horizontal42 <75383519+Horizontal42@users.noreply.github.com>

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2026-08-19 16:35:45 +03:00
Horizontal42
ddb51ee9f9
Refactor registerCoreVocab to reduce duplication (#110)
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2026-08-19 16:35:41 +03:00
Horizontal42
cba2286371
🧹 [Extract evaluateText helper in tests] (#109)
Extracted `evaluateText` helper function in `src/engine/edge.test.ts` to replace the repeated mapping `eng.evaluateDocument(doc).map((x) => x.text)`.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2026-08-19 16:35:37 +03:00
Horizontal42
19a9631709
perf(workspace): cache sheet list during invalidate loop (#107)
Moved the evaluation of `this.sheets()` outside of the `while (changed)` invalidation loop to avoid redundant evaluations and allocations on deep dependency chains.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2026-08-19 16:35:33 +03:00
Horizontal42
d166820b28
test: add coverage for workspace evaluation error cleanup (#105)
Adds a test to `src/workspace.test.ts` to ensure that when `engine.evaluateDocument` throws an exception, the `this.resolving` set is correctly cleaned up in the `finally` block of `doEvaluate`.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2026-08-19 16:35:29 +03:00
Horizontal42
22302b57cc
perf: defer document string split allocation in numeric search (#104)
In `src/ui/search.ts`, numeric threshold searches previously called `doc.text.split("\n")` eagerly on every open document. This commit changes `lines` to be lazily allocated only if an actual numeric search match is found, eliminating unnecessary memory allocations and loop overhead on documents that do not match.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2026-08-19 16:35:26 +03:00
Horizontal42
289ae8aa3f
⚡ [perf: avoid expensive doc stringification for autocomplete] (#102)
* perf: avoid expensive doc stringification for autocomplete

Refactored the autocomplete variable matching logic in `src/ui/editor.ts` to iterate through document lines using CodeMirror's `iterLines()` instead of allocating the entire document string in memory with `toString()`. Also pulled the regex up and introduced a quick `.includes("=")` bailout to skip the regex engine completely for most lines.

Co-authored-by: Horizontal42 <75383519+Horizontal42@users.noreply.github.com>

* drop stray benchmark script

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2026-08-19 16:35:21 +03:00
Horizontal42
d528aa9bbb
test: add unit tests for logger utility (#96)
Adds a test file `src/logger.test.ts` to verify that `logger.info`, `logger.warn`, and `logger.error` correctly call the underlying console methods with the passed arguments.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2026-08-19 16:35:18 +03:00
Horizontal42
868a34497b cargo fmt 2026-08-19 04:17:58 +03:00
Horizontal42
f26bd3ff39 sync package-lock.json with 1.2.8 2026-08-19 04:14:05 +03:00
Horizontal42
15e4fc5157 sync Cargo.lock with 1.2.8 2026-08-19 04:13:59 +03:00
Horizontal42
e88872a2b3 update tauri.conf version to 1.2.8 2026-08-19 04:13:49 +03:00
Horizontal42
6a81673cd5 bump cargo version to 1.2.8 2026-08-19 04:13:38 +03:00
Horizontal42
b506db168f bump version to 1.2.8 2026-08-19 04:13:29 +03:00
Horizontal42
f9fcc27d8b
Merge pull request #95 from Horizontal42/fix/adversarial-review-issues
fix: address adversarial review findings
2026-08-19 04:12:27 +03:00
Andrew Pimenov
b285f546c2 stream-cap rates responses instead of buffering then checking size
resp.bytes() already pulls the whole body into memory before the 5MB
check ran, so a malicious server could still OOM the process during
download. read_body_capped aborts mid-stream once the cap is hit.

also fix goal-seek probe fallback: it could update lo/hi to a genuine
bracket without ever setting found=true, throwing "no solution" on
cases that do have one.
2026-08-19 04:11:27 +03:00
Андрей Пименов
509926bcef fix: address adversarial review findings
- Fix race condition in write_atomic_bytes by using unique temp file names
- Fix logic flaw in DataDirGate authorization on migration failures
- Reject invalid padding in base64_decode
- Set size limits on json fetches for rates
- Fix Date math around DST boundaries for tomorrow/yesterday
- Handle division by zero exceptions gracefully in goal seek
- Fix OOM vector for huge hexadecimal number rendering
2026-08-19 04:11:27 +03:00
Horizontal42
b987a96bd0 use a PAT for release creation, GITHUB_TOKEN got blocked by GitHub 2026-08-14 15:38:23 +03:00
Horizontal42
28a2dd86ca strip leading emoji from release-note lines 2026-08-14 13:39:09 +03:00
Horizontal42
826e041593 strip version-bump commits and PR numbers from release notes 2026-08-14 13:39:09 +03:00
Horizontal42
0fb63e9150 sync Cargo.lock with 1.2.7 2026-08-14 13:39:08 +03:00
Horizontal42
5ee51f465a sync package-lock.json with 1.2.7 2026-08-14 13:39:08 +03:00
Horizontal42
5918d89755 update tauri.conf version to 1.2.7 2026-08-14 13:39:08 +03:00
Horizontal42
c29b9fc244 bump cargo version to 1.2.7 2026-08-14 13:39:08 +03:00
Horizontal42
51b9495519 bump version to 1.2.7 2026-08-14 13:39:08 +03:00
Horizontal42
51ee3b3208 linux + macos release builds (unsigned)
split bundle config into tauri.{windows,linux,macos}.conf.json so each
platform only carries its own targets; gen-icon emits icon.icns; macos is
ad-hoc signed since arm64 refuses unsigned downloads
2026-08-14 13:39:08 +03:00
Horizontal42
e5667966fd sync Cargo.lock with 1.2.6 2026-08-14 13:39:08 +03:00
Horizontal42
f30f0e2580 sync package-lock.json with 1.2.6 2026-08-14 13:39:07 +03:00
Horizontal42
c09aec627e update tauri.conf version to 1.2.6 2026-08-14 13:39:07 +03:00
Horizontal42
5ec2f59b0c bump cargo version to 1.2.6 2026-08-14 13:39:07 +03:00
Horizontal42
7c1eb49d48 bump version to 1.2.6 2026-08-14 13:39:07 +03:00