Skip to content

Add versioned links network migrations - #212

Merged
konard merged 7 commits into
mainfrom
issue-209-cd958ca258df
Nov 29, 2026
Merged

konard merged 7 commits into
mainfrom
issue-209-cd958ca258df

Conversation

@konard

@konard konard commented Nov 28, 2026 •

Copy link
Copy Markdown
Member

Fixes #209

Changes

  • Add ordered, checksum-pinned LiNo migrations to the Rust, C#, and JavaScript CLIs. List and plan changes, apply up or down to a target, or choose manual, auto-up, or auto-down admission before running a query, export, or server.
  • Commit the requested range, its applied history, and the row and name images used to reverse it under one store lock and journal decision. Preserve the current migration checkpoint when ordinary transaction history is compacted.
  • Generate inverses from observed changes. Require an authored down query for deletions or merges, and abort if undoing a migration would overwrite later changes or invalidate references.
  • Use “links network” in the workbench, source, guides, and release notes. Preserve names of external technologies and original evidence.

The latest target follows the supplied manifest, so an older release can reverse a newer schema using the saved rollback data. Managed databases use the default transitions journal and an activation marker. Tags are available on managed stores. Branch movement and checkout are restricted so a version-control restore cannot bypass schema admission. An auto-up or auto-down open can export a LiNo snapshot after the binary store reaches the target.

Reproduce and verify

Run these commands from the repository root using the pre-migration CLI in the issue reproduction.

dir=$(mktemp -d)
db="$dir/state.links"
clink --db "$db" --transactions --in examples/migrations/bootstrap.lino
clink --db "$db" --migrate up

The last command exits with Error: unknown option '--migrate'. The runnable example uses the new CLI to apply a rename and backfill, export the new schema, make an unrelated write, and reverse the changes. The final state contains (task: key value) and (later: task task).

The Rust, C#, and JavaScript migration integration tests cover targeted and automatic opens, rollback conflicts, atomic failure, and journal retention. JavaScript also tests recovery with and without a durable commit decision. The Rust–JavaScript differential test compares command output and persisted files, and the cross-runtime experiment compares LiNo exports across all three implementations. A separate CLI check reimported each binary export after auto-up and auto-down and matched it byte for byte against the corresponding LiNo export in all three implementations.

Local verification includes the focused Rust and C# suites, Rust Clippy and formatting, the JavaScript migration and differential tests, JavaScript lint and repository tests, and the parity checker. The initial PR CI failures came from the generated root .gitkeep, which failed the layout test. Its removal is included.

The pre-commit executable was unavailable. The applicable checks were run manually. The local .NET 10.0.112 solution formatter reported whitespace findings in unchanged files. Changed C# files passed the focused whitespace check, and the full format check passed in GitHub Actions using .NET 10.0.403.

See the migration guide and case study.

CI follow-up

All 14 GitHub Actions workflows succeeded on a58b6067. GitHub reported 92 passing checks and 19 skipped jobs. The Windows, macOS, and Linux Rust and C# suites passed. PR checks

  • The Windows Node 20 concurrent import test hit EPERM during atomic file replacement. The JavaScript text store now uses the same bounded Windows retry as PID lock cleanup and holds the store lock throughout. A deterministic test injects the sharing error and verifies that the staged file replaces the original. All 90 focused tests passed, with 100% coverage of the retry and storage code. Windows test log
  • Clippy 1.100 flagged a range loop in the Rust migration runner. The loop now iterates over the selected definitions directly. Both Rust and WASM Clippy checks and the Rust migration tests passed locally. Rust lint log
  • The workbench now uses lucide-react 1.83.0, fixing a dependency check that also failed on main. The registry check and production Vite build passed locally. Default branch dependency check
  • Added C# tests for invalid migration options, a missing managed journal, the lock upgrade on a reader, and a rollback blocked by a later reference on a version-controlled store. All five C# migration tests pass. Codecov's C# patch coverage report rose from 82.46% to 91.42%. Codecov report

Workbench wording

Playwright ran the same family-links query in both versions and checked the heading, accessible image name, counters, and rendered links. The production bundle also passed with the updated icon dependency.

Before After
Workbench with the old heading Workbench with the Links network heading

Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: #209
@konard konard self-assigned this Nov 28, 2026
@konard konard changed the title [WIP] Add versioned graph migrations with manual and automatic up/down and generated rollback Add versioned links network migrations Nov 28, 2026
@konard
konard marked this pull request as ready for review November 28, 2026 18:16
@codecov-commenter

codecov-commenter commented Nov 28, 2026 •

Copy link
Copy Markdown

@konard

konard commented Nov 28, 2026

Copy link
Copy Markdown
Member Author

Working session summary

PR #212 implements issue #209 in Rust, C#, and JavaScript and is ready for review. The branch includes the latest main and has a clean working tree.

The CLIs support listing and planning migrations, manual and automatic upgrades and downgrades, and conflict-checked rollback that preserves unrelated writes. Migration history and rollback data commit with the store changes and survive journal compaction. Managed stores restrict checkout and branch switching to keep data and migration history in sync. The PR also updates repository terminology to “links network.” Migration guide

All 14 CI workflows succeeded on a58b6067, with 92 checks passing and 19 skipped. I verified matching binary and LiNo exports after upgrade and rollback in all three implementations. I ran the applicable pre-commit checks manually because the executable was unavailable. PR checks

Elapsed time was 1 hour 53 minutes.


This summary was automatically extracted from the AI working session output.

@konard

konard commented Nov 28, 2026

Copy link
Copy Markdown
Member Author

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Model: GPT-6.2 Sol
  • Provider: OpenAI
  • Public pricing estimate: $12.381625

📊 Context and tokens usage:

  • 723.8K input tokens across requests (cumulative, larger than the 272K context window, so not one request's context), 129.8K / 128K (101%) output tokens

Total: (723.8K + 37.7M cached) input tokens, 129.8K output tokens, $12.381625 cost

🤖 Models used:

  • Tool: OpenAI Codex
  • Requested: gpt-6.2-sol
  • Thinking level: xhigh (~31999 tokens)
  • Model: GPT-6.2 Sol (gpt-6.2-sol)

📎 Log file uploaded as Gist (2331KB)


This AI session has ended. Monitoring of this pull request continues. Feel free to review and add feedback while checks are running.

@konard

konard commented Nov 28, 2026

Copy link
Copy Markdown
Member Author

✅ Ready to merge

This pull request is now ready to be merged:

  • All CI checks have passed
  • No merge conflicts
  • No uncommitted changes

@konard
konard merged commit 6c3165f into main Nov 29, 2026
111 checks passed
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.

Add versioned graph migrations with manual and automatic up/down and generated rollback

2 participants