Commit Graph
4 Commits
Author SHA1 Message Date
SivanColaandJuly-X 174ea10844 refactor: harden parsers with maintained libraries
Replace several hand-rolled parsers and text processors with maintained libraries while preserving Reasonix-specific policy boundaries and fallbacks.

Add focused regression coverage for shell argv policy, HTML extraction, frontmatter decoding, dotenv parsing, glob matching, diff output, grapheme clipping, and optional tree-sitter code indexing.

Co-authored-by: July-X <[email protected]>
2026-07-04 01:11:34 +08:00
SivanCola 7377f46239 fix(diff): avoid input-derived Myers allocation arithmetic (#3777) 2026-06-09 21:27:49 -07:00
reasonix 731875700f fix(diff): cap Myers edit distance so a large rewrite can't OOM the preview
The Myers trace stores O(D) snapshots of an O(D)-wide vector, so the edit
distance D drives O(D²) ≈ O(N²) time and memory: a full rewrite of a 3000-line
file allocated ~565 MB, ~6 GB at 10k lines — enough to OOM the synchronous
write-preview/checkpoint diff. Cap D at 2000 edits: small changes converge well
below it (so a tiny edit in a huge file still gets a real diff), while a near-
total rewrite falls back to cheap order-insensitive tallies and an omitted-diff
marker instead of a gigabyte allocation. A 6000-line rewrite now costs 63 MB.
2026-06-01 06:29:01 -07:00
esengine fc60496676 feat(core): desktop-harness foundations — diff preview, introspection, config writes, per-agent workdir
Four reusable harness capabilities a desktop front-end needs, all additive and
independent of the agent loop / TUI (agent.go, chat_tui.go, cli.go untouched):

- diff: Myers line-diff engine (internal/diff) + a tool.Previewer optional
  capability. write_file/edit_file/multi_edit can now compute the change a call
  WOULD make (unified diff, +N/-M, create/modify) without touching disk, for
  approval cards and changed-files panels. A consistency test asserts the
  preview matches what Execute persists, so the two can't drift.

- inspect: read-only projection of providers (with key readiness), tools
  (builtin vs mcp, read-only, previewable, schema), MCP servers/prompts/
  resources, and slash commands into JSON-ready structs for a settings UI.

- config: programmatic, validated mutation surface (SetDefaultModel,
  Upsert/RemoveProvider, SetPlannerModel, permission-rule edits, Upsert/
  RemovePlugin) plus an atomic SaveTo, separate from the init wizard.

- builtin.Workspace: binds the built-in tools to a working directory so
  concurrent agents (e.g. desktop tabs on different projects) get independent
  path roots. A zero workDir is byte-identical to today's process-cwd behavior.
2026-05-29 19:23:44 -07:00