Skip to content

Try to parse TL as UserFn before DB in legacy binary (de)serializer - #1

Closed
StachuDotNet wants to merge 1 commit into
mainfrom
legacy-binary-serializer-parse-userfn-before-db
Closed

StachuDotNet wants to merge 1 commit into
mainfrom
legacy-binary-serializer-parse-userfn-before-db

Conversation

@StachuDotNet

@StachuDotNet StachuDotNet commented Feb 15, 2022

Copy link
Copy Markdown
Owner

What is the problem/goal being addressed?

If you

  • create a canvas
  • add a user function
  • (re)load the canvas with the F# backend,

currently the user function is (seemingly consistently) 'parsed' as a DB TopLevel rather than a UserFn.

What is the solution to this problem?

In the legacy binary serialization server, attempt to parse UserFns before DBs.

How are you sure this works/how was this tested?

I've tested this in the UI, and confirmed no regressions in other tests.

As existing integration tests already covered this bug (when the integration tests target F#, which they shortly will by default), I did not write new tests to cover this.

@StachuDotNet

Copy link
Copy Markdown
Owner Author

PR in wrong repo.

StachuDotNet pushed a commit that referenced this pull request Mar 1, 2023
StachuDotNet added a commit that referenced this pull request Jan 30, 2024
…ension

Attempt #1: Publish VS Code Extension
StachuDotNet added a commit that referenced this pull request Jul 26, 2026
The "promote a value back to source" primitive that unlocks live values (dream #1). `dvalToExpr` takes a
runtime value and returns a ProgramTypes expression, or an Error with a reason when the value has no literal
syntax.

Mapped: unit, bool, all int widths, float (split into sign/whole/fraction for EFloat), char, string, list,
tuple, dict — recursively, so nested collections round-trip. Fresh gid IDs, which don't affect rendered
source.

Fails (Error, caller falls back): DateTime and Uuid (no literal form — pointed at their parse fns), records
and enums (not yet mappable — need PT type-name construction), and functions / DB refs / blobs (no source at
all).

Tests are the standard `.dark` execution testfile. Because IDs are random, they pattern-match the result
structurally rather than comparing whole expressions, and cover each literal kind, nested list/tuple/dict
shapes, and the Error path for unmappable values (DDB, DUuid).

Claude-Session: https://claude.ai/code/session_015BbLwctE41vpgJksNa9X4C
StachuDotNet added a commit that referenced this pull request Aug 8, 2026
…->main isolation leak

Two things, both load-bearing:

1. ISOLATION LEAK (real bug): authoring to main ran WipRefresh, which treated a branch's
   effective=0 ops as main WIP -- discardWipOps + re-insert flipped them effective=1 and folded
   them into main, so a branch's work leaked into main just by authoring on main. Fixed: getWipOps
   + discardWipOps exclude op_branches-tagged ops (branch-pending state is not main WIP).

2. REBASE on a RELOAD-STABLE base model. The base_ts timestamp watermark was meaningless (reload
   re-stamps origin_ts), so it false-positived every merge after any main movement. Replaced with
   PER-NAME content-hash bases: branch_name_bases records main's content-hash for each name a branch
   first touches (stable across reload). A conflict = main's CURRENT hash for that name differs from
   the base (main changed the same name). canMerge blocks only on real conflicts; `dark ops rebase
   <id>` accepts main's state + reports what moved, unblocking merge (the branch's ops LWW on top).

Verified end to end: author on a branch, author a DIFFERENT name to main -> branch stays isolated
(effective=0), merge succeeds (no false conflict); author the SAME name on both -> merge blocked ->
rebase -> merge succeeds. Plain eval + val to main unchanged; 6 BranchOverlay tests green.

Design: notes/fresh-arch/scm-spec.md (open-q #1 resolved: base op set, realized as per-name hashes).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LYzWX7SQ1W1Cf3gZTu2mHY
StachuDotNet added a commit that referenced this pull request Aug 8, 2026
…terialises rt_dval)

branchValueContentFoldIsolatesName only guarded the isolation half of the
expression-value fix (431f903): a branch value's AddValue content folds into
package_values but its SetName must NOT land in main's locations. The other half
of that fix -- that an EXPRESSION body actually materialises its Dval into rt_dval
via evaluateAllValues (applyOps alone stores NULL) -- had no automated guard; it
was the original bug (expression-valued branch values read a NULL rt_dval and
returned nothing) and was only verified by hand.

Extend the same test to run the production evaluateAllValues path after the fold
and assert rt_dval materialises to 3+4=7. One test now locks both halves, so a
regression in either surfaces in CI instead of only under manual branch probing.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LYzWX7SQ1W1Cf3gZTu2mHY
StachuDotNet added a commit that referenced this pull request Aug 8, 2026
BranchOps.Tests.fs (545 lines) was disabled in BOTH the fsproj and the test list
and referenced LibDB.Rebase / LibDB.BranchOpPlayback, modules that no longer exist
-- it would not compile if re-enabled. It tested the carved commit / partial-commit
/ rebase model; the overlay model replaced that wholesale, with fresh coverage in
BranchOverlay.Tests + BranchCli.Tests (isolation, convergence, merge, review, the
bug #1 value fold). Nothing in it is salvageable, so drop the file and its two
tombstone comments rather than leave a misleading orphan.

Also fix LibDB/README.md: it still listed Rebase.fs / Merge.fs as SCM-ops files.
Both were folded into Branches.fs by the overlay carve; point the doc there.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LYzWX7SQ1W1Cf3gZTu2mHY
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