Skip to content

[01/06] feat(core): add bounded functions exec foundations - #3

Draft
HeavenllyDemon wants to merge 2 commits into
mainfrom
feat/functions-exec-01-foundations
Draft

[01/06] feat(core): add bounded functions exec foundations#3
HeavenllyDemon wants to merge 2 commits into
mainfrom
feat/functions-exec-01-foundations

Conversation

@HeavenllyDemon

Copy link
Copy Markdown
Member

First PR in the ordered functions.exec stack. Adds private, cross-platform protocol, NDJSON framing, retention, and worker-helper foundations only. No tool registration, daemon, engine, provider, persistence, or client surface is changed.

Verification:

  • bun test test/functions-exec (18 pass)
  • strict stage-only TypeScript check
  • Bun bundle of all four modules
  • git diff --check

Full Core TypeScript still has six pre-existing approvals.test.ts diagnostics; nested Seatbelt workflow execution is blocked by the enclosing host sandbox.

@HeavenllyDemon
HeavenllyDemon force-pushed the feat/functions-exec-01-foundations branch from bf1b550 to 13c96f1 Compare August 18, 2026 13:15
@HeavenllyDemon HeavenllyDemon changed the title [01/05] feat(core): add bounded functions exec foundations [01/06] feat(core): add bounded functions exec foundations Aug 18, 2026
HeavenllyDemon added a commit that referenced this pull request Aug 20, 2026
USER LIVE-GATE FIX #4, research half: does LOK paint an infinite grid
past a spreadsheet's used range, the way Excel/Calc's own UI does?
Answered empirically against our real vendored LOK pin, not assumed —
OfficeHelperLiveTests.testGateXlsxTilesPastTheUsedRangeEmpiricalInfinite
GridProbe requests gate.xlsx tiles at the used-range edge and ~20 tiles
beyond it: both come back as a clean, gridded, non-blank canvas (PNG
dump), unchanged all the way out. paintPartTile genuinely renders empty
cells there; nothing needed faking client-side.

Implementation: OfficeTileCanvasView.effectiveExtentTwips extends the
scrollable bound by 2 extra screens per axis, for spreadsheets only
(isSpreadsheet, read once from the open document's type — presentations/
documents have real fixed page bounds and were never probed for this).
One computed property feeds BOTH the scroll clamp (clampedOriginX/Y) and
performSubscribe's churn-audit skip-check
(officeClampViewportToDocumentExtent's call site) so they cannot disagree
— the trap being guarded against: if scrolling reached further than the
skip-check's own clamp, the margin would be scrollable but its tiles
would never actually get requested (placeholders forever, just moved past
the new margin instead of past sizeTwips).

That widened skip-check interacts with fix #3's whole-document residency
sweep at a small, fully-resident spreadsheet's own edge: the fixed
subscribeMarginPoints overscan now genuinely touches real, never-
prefetched margin tiles, so a resident document's post-fill scroll near
its edge now costs exactly one further subscribe (a one-time margin
warm), not the prior zero. testResidentDocumentIsPrefetchedWholeIn...
NoFurtherRequests is amended (not weakened) into a two-phase pin proving
exactly that: one warm, then genuine silence once the touched slice is
also cached — the "no chatter for zero benefit" invariant's spirit holds,
only its letter moved.
HeavenllyDemon added a commit that referenced this pull request Aug 25, 2026
…rsor position before typing

Coordinator review, Important #2 and #3, addressed together in
writeOneCellOnDedicatedThread since both land in the same function:

#2 — formulaKeyEvent(for:) was called inside the typing loop itself, so an
unmapped character (any non-ASCII, e.g. =A1&"café") threw AFTER already
posting every character before it, leaving a real, uncommitted, partial
formula in Calc's own edit mode on a document a human may have open. Fixed
by pre-validating every character in a pure pass before the first
keystroke; a new SaveError.unsupportedFormulaCharacter replaces the old
writeVerificationFailed mislabel for this path.

#3 — the old positioning check trusted GoToCell's own best-effort dance and
moved straight to typing; on a non-empty bystander cell, a GoToCell that
never landed would leave the cursor on the WRONG cell, which already has
content, so the lenient post-write check read non-empty and passed. Closed
via getCommandValues(".uno:CellCursor") — a live probe
(OfficeHelperLiveTests.testProbeInvestigatesWhetherCellAddressCallbacks...)
first found the obvious candidate (LOK_CALLBACK_CELL_ADDRESS/CELL_CURSOR,
raw types 34/17) never fires for a GoToCell-driven move at all, only real
mouse/key input; getCommandValues is a synchronous query instead, called
within the same dedicated-thread closure that positioned the cursor, so it
is immune to the async-callback-staleness class this file's own GoToCell
docs already cover. A (column,row) mismatch now throws
SaveError.positionVerificationFailed before any keystroke is posted.

Both fixes deletion-red verified live: temporarily reverted each guard,
confirmed real failures (partial formula characters typed; every correctly
positioned write wrongly refused), then reverted. Full
OfficeSheetsCommandTests class: 19/19 after the fix.
HeavenllyDemon added a commit that referenced this pull request Aug 25, 2026
…s it (red/green)

The original flake could not be summoned (2 full suite passes under saturating load
never hit it), so it was injected instead — deletion-red discipline inverted: rather
than breaking a mechanism to watch a drill go red, force the FAILURE and watch the FIX
go green.

  RED  (forced pass-2 `body` positioning nil, retry disabled): 6 failures, and the
       refusal text reproduced the original full-suite failure BYTE FOR BYTE — "body
       failed after title in this SAME set_text call already applied: slide 2 in <id>
       has no body placeholder — nothing was written." Same assertion count as the real
       failure.
  GREEN (identical force, retry enabled): Executed 1 test, with 0 failures — AND exactly
       one "re-posting Escape+Tab once" evidence line.

That evidence line is the load-bearing half: it proves the forced miss still fired and
the RETRY absorbed it, rather than the probe having silently stopped working — which
would be this arc's own defect class #3 (the self-restoring instrument) reappearing
inside the proof of a fix for it.

Probe reverted, tree confirmed byte-identical. Record kept inline at the call site,
including the explicit non-overclaim: this proves the retry absorbs a single discrete
loss; that it cures the ORIGINAL flake is argued from the measured distribution, not
from a reproduced-and-cured instance.

Claude-Session: https://claude.ai/code/session_019pqCwL5mTcMEPHer8TK5D8
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