Skip to content

refactor(session): move instance read side to session/instancestore (I2) - #1714

Merged
tstapler merged 2 commits into
mainfrom
refactor/i2-instancestore
Nov 20, 2026
Merged

tstapler merged 2 commits into
mainfrom
refactor/i2-instancestore

Conversation

@tstapler

Copy link
Copy Markdown
Owner

I2 of project_plans/package-split-ocp/instance-dto-lowering-plan.md. Moves the instance read side (Get/List*/*WithOptions, applyLoadOptions, session-artifact getters, GetClaudeConversationUUIDBySessionUUID, the ent-to-InstanceData mapper; about 450 lines) out of session/ent_repository.go into the new leaf session/instancestore. EntRepository embeds *instancestore.Instances, built in initStores(), so callers are unchanged through promotion. No consumer-side port is needed: the read side takes only the ent client.

Verified:

  • Normalised old/new diff of moved bodies: identical except package/imports and one receiver rename (r to i).
  • storage_test.go and ent_repository_test.go unchanged; TestEntRepository_should_BuildEveryEmbeddedStore_When_ConstructedByAnyPath passes.
  • New leaf tests; 15 mutations (each applyLoadOptions filter dropped and forced-on, project edge, claude metadata, list preset, empty-id guard, by-uuid, by-status) all killed.
  • Whole-tree depguard and unused/ineffassign/staticcheck: 0 issues. scoping t9/boundaries/inversions/budget --base origin/main clean. make gazelle no diff.
  • go test ./session/... passes except session/unfinished and session/unfinished/gogitstore fsnotify-timing tests (code untouched here; not re-run on main).

I2 of project_plans/package-split-ocp/instance-dto-lowering-plan.md. Get/List*/*WithOptions,
applyLoadOptions, the session-artifacts getters and the ent-to-InstanceData mapper become
methods of instancestore.Instances, embedded in EntRepository and built in initStores (every
constructor path). Method bodies are unchanged apart from the receiver; callers are untouched
through promotion. Adds the isolate_instancestore depguard row, boundaries/budget rows and
go_sources wiring.
@github-actions

Copy link
Copy Markdown
Contributor

Selective e2e (shadow, non-blocking): 0 of 0 targets selected; shard jobs: skipped. The full suite in build.yml stays authoritative.

Adds tests for the GetAllSessionArtifacts non-empty filter, the (nil, nil) artifacts path, the
exact not-found text and every scalar mapper field (all mutation-checked). Renames the loop
variable that shadowed the receiver, orders the legacy_pr_readers row, and ratchets the session
budget row to the measured values.

scoping-budget-raise: session imports 67 -> 68 (the new session/instancestore import; loc 25556 -> 25126, files unchanged)
@github-actions

Copy link
Copy Markdown
Contributor

Selective e2e (shadow, non-blocking): 0 of 0 targets selected; shard jobs: skipped. The full suite in build.yml stays authoritative.

@github-actions

Copy link
Copy Markdown
Contributor

CI memory (Go affected-package tests)

2 benchmarks (no base to compare with)

ci-memory/test-affected

Benchmark Value Range
peak_used [max] 5763 MB —
min_available [min] 10218 MB —
Environment
Head
sha dc7942182a59fc23dc933979ff41f2702c19968b

Head-only report: add a base to see changes.

@github-actions

Copy link
Copy Markdown
Contributor

📊 Feature E2E Coverage

Feature E2E coverage: 57/351 tested (16%)

Run make e2e-report locally to view the full Allure report.

@tstapler
tstapler merged commit bedd646 into main Nov 20, 2026
25 of 26 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.

1 participant