Skip to content

Simplify three duplication hotspots - #2006

Merged
Aaronontheweb merged 1 commit into
refactor/binding-enginefrom
refactor/simplify-hotspots
Aug 19, 2026
Merged

Simplify three duplication hotspots#2006
Aaronontheweb merged 1 commit into
refactor/binding-enginefrom
refactor/simplify-hotspots

Conversation

@Aaronontheweb

@Aaronontheweb Aaronontheweb commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

What

Phase 5 of the code-reduction stack (on top of #2005). Three within-file duplication hotspots, −322 net lines, zero behavior change:

  1. SQLiteMemoryStoreApplyInlineCurationBatchAsync and ApplyCurationBatchAsync ran the same ~190-line per-operation loop (anchor resolution, record insert, dedup lookup, document + FTS upsert) word-for-word. One shared ApplyCurationOperationsAsync now serves both; the checkpoint variant keeps its status='completed' update before commit. SQL text, parameter names, public signatures, and transaction boundaries unchanged.
  2. TUI test fixtures (issue Extract shared HeadlessTerminaFixture for TUI page tests #929) — the issue counted three duplicated headless Termina setups; there were seven. One HeadlessTerminaFixture.Create<TPage,TVm> helper replaces them, with per-site page/VM lambdas and dimensions preserved. The three multi-route fixtures (Sessions/Chat/InitExistingInstall) intentionally stay as-is.
  3. Program.cs — seventeen mode handlers repeated the same 4-line quiet host-builder setup; one CreateQuietHostBuilder helper replaces them. The chat/sessions path uses WebApplication.CreateBuilder (hosts a SignalR endpoint) — different builder type, deliberately not converted, documented on the helper.

Verification

  • Memory suites (44), converted TUI page suites (45), full Netclaw.Cli.Tests (1,370), full Netclaw.Actors.Tests (3,447) — all green
  • dotnet slopwatch analyze: 0 issues; headers verified; zero build warnings
  • No persisted-format, schema, CLI, or API surface change

Stack

PR 5. Base: refactor/binding-engine (#2005).

@Aaronontheweb
Aaronontheweb force-pushed the refactor/simplify-hotspots branch from 97fa3c1 to 1efc3ee Compare August 19, 2026 02:08
@Aaronontheweb
Aaronontheweb marked this pull request as ready for review August 19, 2026 02:09
@Aaronontheweb Aaronontheweb added the cleanup Code quality improvements and tech debt reduction label Aug 19, 2026
@Aaronontheweb
Aaronontheweb force-pushed the refactor/simplify-hotspots branch from 1efc3ee to 582950a Compare August 19, 2026 02:52
@Aaronontheweb
Aaronontheweb force-pushed the refactor/simplify-hotspots branch from 582950a to 1efc3ee Compare August 19, 2026 03:39
- SQLiteMemoryStore: the inline and checkpoint curation batch writers
  ran the same per-operation loop. One shared
  ApplyCurationOperationsAsync now serves both; the checkpoint variant
  keeps its status update before commit. SQL text, parameters, and
  transaction boundaries are unchanged.
- TUI tests: seven page-test fixtures repeated the same headless
  Termina setup. One HeadlessTerminaFixture.Create helper replaces
  them (closes the duplication issue #929 describes). The three
  multi-route fixtures stay as they are.
- Program.cs: seventeen mode handlers repeated the same four-line
  quiet host-builder setup. One CreateQuietHostBuilder helper replaces
  them. The chat/sessions WebApplication builder is a different
  builder type and stays separate.

Net: -322 lines. No behavior change.
@Aaronontheweb
Aaronontheweb force-pushed the refactor/simplify-hotspots branch from 1efc3ee to 780ae9c Compare August 19, 2026 12:26

@Aaronontheweb Aaronontheweb left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Aaronontheweb
Aaronontheweb merged commit df7fc65 into dev Aug 19, 2026
36 of 42 checks passed
@Aaronontheweb
Aaronontheweb deleted the refactor/simplify-hotspots branch August 19, 2026 16:41
@Aaronontheweb Aaronontheweb added refactoring memory Memory formation, recall, curation pipeline tests All issues related to testing, quality assurance, and smoke testing. labels Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup Code quality improvements and tech debt reduction memory Memory formation, recall, curation pipeline refactoring tests All issues related to testing, quality assurance, and smoke testing.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant