Skip to content

refactor(meta): move dual-store engine into internal/module/meta - #257

Merged
buke merged 7 commits into
mainfrom
refactor/meta-pkg-split-clean
Aug 7, 2026
Merged

refactor(meta): move dual-store engine into internal/module/meta#257
buke merged 7 commits into
mainfrom
refactor/meta-pkg-split-clean

Conversation

@buke

@buke buke commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Move the dual-store engine (meta_raw_*, declaration APIs, FlushEffective, merge/expand) from pkg/meta into internal/module/meta, leaving pkg/meta as catalog entities/utils.
  • Fold former internal/module/metadata ops tables and meta_lock_lease into CatalogEntities / OpsEntities; remove metadata and state/lease/model.
  • Delete dead Ensure/Upsert/Prefer/Has*Catalog, IMD migrate, and ACL remap surfaces; unexport internal helpers and wire the live (application, name) unique index.

Test plan

  • go test ./pkg/meta/ ./internal/module/meta/ ./internal/state/lease/ ./internal/bootstrap/service/ ./internal/module/lifecycle/ -count=1
  • go test ./internal/module/artifact/... ./internal/module/evolution/... -count=1
  • Smoke: install core modules and confirm AutoMigrate still creates meta_raw_*, ops tables, and meta_lock_lease
  • Smoke: module install/upgrade/uninstall still Replace/Remove declarations and FlushEffective

Made with Cursor


Summary by cubic

Moved the dual-store meta engine and declaration APIs from pkg/meta to internal/module/meta (modmeta), consolidating ops tables and meta_lock_lease. The live (application, name) unique-index ensure is idempotent, and tests now cover index ensure and declaration edge cases with a shared duplicate-model helper.

  • Refactors

    • Relocated declaration layer (raw tables), effective recompute/merge/expand, and lookup into internal/module/meta; removed internal/module/metadata and state/lease/model.
    • Unified AutoMigrate via modmeta.CatalogEntities(); modmeta.EnsureEffectiveAppNameUniqueIndex(db) is idempotent and only cleans leftover temp indexes.
    • Deleted unused Ensure/Upsert/Prefer/Has*Catalog, IMD migrate, and ACL remap; unexported internal helpers and hardened bootstrap/guards.
    • Updated tests and e2e to use modmeta types/APIs; added coverage for unique-index ensure and declaration guards; extracted a shared seedDuplicateLiveModelsForTest helper for consistent duplicate-live-model scenarios.
  • Migration

    • Replace meta.EnsureDualStoreTables(db) with db.AutoMigrate(modmeta.CatalogEntities()...), then call modmeta.EnsureEffectiveAppNameUniqueIndex(db) (safe to run multiple times).
    • Use modmeta.ReplaceModuleDeclarations(db, moduleID, []*meta.Model{...}) instead of persisting raw trees directly.
    • Switch to modmeta.ListDeclarations, modmeta.MergeSameNameModelsByExtensionChain, modmeta.LookupEffectiveModel, and modmeta.ExpandModelsAlongExtends.
    • Import modmeta.ModuleIndex, modmeta.ModelData, modmeta.Setting, modmeta.ModuleMigrationHistory, and modmeta.LockLease.
    • For tests/tools that drop raw tables, prefer db.Migrator().DropTable("meta_raw_model").

Written for commit 9cc6ef6. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • New Features

    • Added centralized management for module declarations, including listing, replacement, removal, and effective-model updates.
    • Improved database catalog migration and registration for module metadata and operational records.
    • Added safeguards for effective-model uniqueness and declaration consistency.
  • Refactor

    • Consolidated metadata and lease handling under a unified internal layer.
    • Simplified module installation, upgrades, synchronization, evolution, and uninstallation workflows.
    • Reduced the public metadata API by removing obsolete helpers and status values.

- Relocate dual-store, declaration APIs, and raw tables to internal/module/meta so pkg/meta stays catalog entities and utils.

- Fold former metadata ops tables and meta_lock_lease into CatalogEntities; remove internal/module/metadata and state/lease/model.

- Delete unused Ensure/Upsert/Prefer/Has*Catalog, IMD migrate, and ACL remap; unexport internal helpers and wire the live unique index.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The PR consolidates metadata models and persistence APIs under internal/module/meta. It adds declaration and catalog APIs, updates effective-model processing and callers, relocates lease models, and removes obsolete public helpers.

Changes

Metadata consolidation

Layer / File(s) Summary
Declaration and dual-store foundation
internal/module/meta/...
Adds declaration listing, deletion, replacement, catalog registries, raw helpers, ID handling, and unique-index setup.
Effective-model processing
internal/module/meta/effective_merge.go, internal/module/meta/extends_expand.go, internal/module/meta/recompute.go, internal/module/meta/selection_merge.go
Uses shared pkg/meta types for lookup, inheritance expansion, merging, selection resolution, and recomputation.
Application integration
internal/module/artifact/..., internal/module/evolution/..., internal/module/lifecycle/..., internal/bootstrap/..., cmd/...
Updates persistence, migrations, module indexes, settings, bootstrap, uninstallation, and tests to use internal/module/meta.
Lease and model relocation
internal/state/lease/..., internal/module/meta/meta_*.go
Moves lease and operational metadata models into the consolidated package.
Public API cleanup
pkg/meta/..., internal/module/metadata/..., internal/state/lease/model/...
Removes obsolete declaration, dual-store, ACL, raw-table, and entity helpers. Selected utility identifiers are private.

Estimated code review effort: 3 (Moderate) | ~30 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ModuleLifecycle
  participant InternalMeta
  participant RawCatalog
  participant EffectiveCatalog
  ModuleLifecycle->>InternalMeta: RemoveModuleDeclarations
  InternalMeta->>RawCatalog: Delete declaration trees
  InternalMeta-->>ModuleLifecycle: Return affected logical keys
  ModuleLifecycle->>InternalMeta: FlushEffective
  InternalMeta->>EffectiveCatalog: Rebuild effective projections
  EffectiveCatalog-->>ModuleLifecycle: Return flush result
Loading

Possibly related PRs

Suggested labels: Review effort 3/5

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 9.84% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely describes the main change: moving the dual-store engine into internal/module/meta.
Description check ✅ Passed The description explains the refactor scope, migration details, objectives, and test plan in a structure aligned with the repository template.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/meta-pkg-split-clean

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

Failed to generate code suggestions for PR

@codecov

codecov Bot commented Aug 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 5

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
internal/module/artifact/build/backend/builder.go (1)

886-905: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Make declaration mutation and effective recomputation atomic.

ReplaceModuleDeclarations or RemoveModuleDeclarations changes the raw declaration store before FlushEffective runs. If FlushEffective fails, meta_model can retain stale effective projections.

Run each operation pair in one outer transaction. Add a regression test that forces recomputation to fail and verifies rollback.

  • internal/module/artifact/build/backend/builder.go#L886-L905: wrap ReplaceModuleDeclarations and FlushEffective in one transaction.
  • internal/module/lifecycle/uninstaller.go#L64-L70: wrap RemoveModuleDeclarations and FlushEffective in one transaction.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/module/artifact/build/backend/builder.go` around lines 886 - 905,
Make declaration mutation and effective recomputation atomic by running
ReplaceModuleDeclarations and FlushEffective together in one outer transaction
in internal/module/artifact/build/backend/builder.go:886-905, preserving the
existing key collection and error propagation. Apply the same transaction
boundary to RemoveModuleDeclarations and FlushEffective in
internal/module/lifecycle/uninstaller.go:64-70. Add regression coverage that
forces recomputation to fail and verifies both the declaration changes and
effective projections roll back.
🧹 Nitpick comments (7)
internal/module/lifecycle/uninstaller_clean_models_test.go (1)

193-204: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider exporting the raw table names instead of duplicating literals.

The helpers now hardcode seven raw table names. internal/module/meta already defines raw table constants, for example rawServiceTable. The literals here drift silently if a raw table is renamed. Exporting the constants, or adding a small test helper in internal/module/meta, removes the duplication.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/module/lifecycle/uninstaller_clean_models_test.go` around lines 193
- 204, Update deleteRawCleanModelsPrefix and deleteRawModelTree to reuse the raw
table-name constants defined in internal/module/meta, such as rawServiceTable,
instead of hardcoded literals. Export the required constants if necessary,
preserving the existing deletion order and behavior.
internal/module/meta/declaration_test.go (2)

176-179: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Remove the redundant ensureDualStoreTables call.

openDeclarationTestDB already calls ensureDualStoreTables at line 25 of declaration_coverage_test.go. Line 177 repeats it.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/module/meta/declaration_test.go` around lines 176 - 179, Remove the
redundant ensureDualStoreTables call and its error handling from the test setup
after openDeclarationTestDB in the remove-decls test, relying on
openDeclarationTestDB to initialize the tables.

67-97: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Extend the cascade test to cover decorators, arguments, and parameters.

The seeded tree contains only one field and one service. DeleteDeclarationTrees branches on decoratorIDs, rawArgument, rawParameter, and rawTypeParameter at lines 116-134 of declaration.go. Those branches never run in this test. Add a decorator with an argument, plus a service parameter and type parameter, and assert that all rows are removed. This matches the _Cascade name.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/module/meta/declaration_test.go` around lines 67 - 97, Extend
TestDeleteDeclarationTrees_Cascade’s seeded Model tree with a decorator
containing an argument, and add a parameter and type parameter to the service,
using the existing metadata relationships and raw models. After
DeleteDeclarationTrees, assert that decorator, argument, parameter, and
type-parameter rows for the model’s descendants are all absent, alongside the
existing model, field, and service assertions.
internal/module/meta/declaration_coverage_test.go (2)

119-131: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Rename the test to match what it verifies.

The name says NilPrevDeclRow, but the inline comment states that path is unreachable. The test actually covers an invalid logical key produced from a zero-valued previous effective model. Rename it to, for example, TestReplaceModuleDeclarations_SkipsInvalidPrevEffectiveKey, and remove the obsolete first comment line.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/module/meta/declaration_coverage_test.go` around lines 119 - 131,
Rename TestReplaceModuleDeclarations_NilPrevDeclRow to reflect that it covers
skipping an invalid previous-effective key, such as
TestReplaceModuleDeclarations_SkipsInvalidPrevEffectiveKey. Remove the obsolete
comment stating that ListDeclarations can return a nil element, while retaining
the comment describing the zero-valued pkgmeta.Model coverage.

41-52: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Assert the last-wins result for duplicate paths.

Lines 44-45 give "A" and "A2" the same path /a.ts. ReplaceModuleDeclarations overwrites modelByPath, so "A2" wins while the path order comes from "A". The test checks only len(keys) != 0. Add an assertion that the persisted declaration for /a.ts is named "A2". This locks down the deduplication behavior.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/module/meta/declaration_coverage_test.go` around lines 41 - 52,
Extend the test around ReplaceModuleDeclarations to retrieve the persisted
declaration for /a.ts and assert its name is "A2". Keep the existing non-empty
keys assertion and error handling unchanged, using the test’s available database
or lookup mechanism to verify the last duplicate wins.
internal/module/meta/declaration.go (2)

213-244: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Deduplicate the returned logical keys.

appendKey appends without deduplication. The same (application, name) pair usually appears in prevDecls, prevEff, and the new models, so the returned slice repeats keys. Callers pass these keys to FlushEffective, which then repeats work for the same key. RemoveModuleDeclarations at line 163 already deduplicates with a seen map. Apply the same approach here for consistency.

♻️ Proposed deduplication
 	keys := make([]LogicalKey, 0)
+	seen := map[string]struct{}{}
 	appendKey := func(application, name string) {
 		k := LogicalKey{Application: application, Name: name}.Normalized()
-		if k.Valid() {
-			keys = append(keys, k)
+		if !k.Valid() {
+			return
 		}
+		id := k.Application + "\x00" + k.Name
+		if _, ok := seen[id]; ok {
+			return
+		}
+		seen[id] = struct{}{}
+		keys = append(keys, k)
 	}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/module/meta/declaration.go` around lines 213 - 244, Deduplicate
logical keys in the appendKey closure within the surrounding
declaration-processing function by tracking normalized (application, name) pairs
in a seen map before appending to keys. Preserve the existing Valid check and
ensure repeated keys from prevDecls, prevEff, and orderedPaths are added only
once, consistent with RemoveModuleDeclarations.

246-262: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low value

Consider setting ModuleId inside the transaction.

Line 242 mutates each caller-supplied *pkgmeta.Model before the transaction runs. If the transaction fails, the database rolls back, but the caller's structs keep the assigned ModuleId. Callers that reuse the slice after an error then observe partially mutated input.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/module/meta/declaration.go` around lines 246 - 262, Move the
`ModuleId` assignment for caller-supplied `*pkgmeta.Model` values into the
`db.Transaction` callback, before `deleteRawModelsForModule` and
`persistModelTreeAsRaw` execute. Ensure the mutation occurs only within the
transaction flow so failed transactions do not leave the input models assigned.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@internal/module/meta/dual_store.go`:
- Around line 64-70: Update ensureBaseModelID to treat an invalid b.Id as absent
by generating a new ID when either !b.Id.Valid or the trimmed ID string is
empty; preserve the existing nil guard and assignment behavior.

In `@internal/module/meta/extends_expand_test.go`:
- Around line 29-31: Revert the fixture’s rawModel Name value in the parent
setup to a realistic TypeScript-style declaration name, rather than the Go-style
"pkgmeta.BaseModel" value. Leave the BaseModel field reference and
parent-resolution behavior unchanged.

In `@internal/module/meta/lookup_effective_test.go`:
- Around line 17-24: Replace the named shared-cache SQLite setup in
TestLookupEffectiveModel_FindsLiveRow with the package helper
openDualStoreTestDB(t), preserving the existing table initialization and error
handling. Also update the test using the lookup-eff-closed DSN to use
openDualStoreTestDB(t) so both tests receive isolated temporary databases.

In `@internal/module/meta/raw_helpers.go`:
- Around line 30-35: Update the query construction in the rawModel count helper
to use db.Model(&rawModel{}) so GORM applies the default soft-delete scope, then
retain q = q.Unscoped() only when unscoped is true. Add coverage verifying a
soft-deleted record produces scoped count 0 and unscoped count 1.

In `@internal/testing/e2e/runner.go`:
- Around line 685-687: Update the AutoMigrate error message in the session setup
flow to report the consolidated modmeta.ModuleIndex type instead of the obsolete
metadata.ModuleIndex name, while preserving the existing wrapped error behavior.

---

Outside diff comments:
In `@internal/module/artifact/build/backend/builder.go`:
- Around line 886-905: Make declaration mutation and effective recomputation
atomic by running ReplaceModuleDeclarations and FlushEffective together in one
outer transaction in internal/module/artifact/build/backend/builder.go:886-905,
preserving the existing key collection and error propagation. Apply the same
transaction boundary to RemoveModuleDeclarations and FlushEffective in
internal/module/lifecycle/uninstaller.go:64-70. Add regression coverage that
forces recomputation to fail and verifies both the declaration changes and
effective projections roll back.

---

Nitpick comments:
In `@internal/module/lifecycle/uninstaller_clean_models_test.go`:
- Around line 193-204: Update deleteRawCleanModelsPrefix and deleteRawModelTree
to reuse the raw table-name constants defined in internal/module/meta, such as
rawServiceTable, instead of hardcoded literals. Export the required constants if
necessary, preserving the existing deletion order and behavior.

In `@internal/module/meta/declaration_coverage_test.go`:
- Around line 119-131: Rename TestReplaceModuleDeclarations_NilPrevDeclRow to
reflect that it covers skipping an invalid previous-effective key, such as
TestReplaceModuleDeclarations_SkipsInvalidPrevEffectiveKey. Remove the obsolete
comment stating that ListDeclarations can return a nil element, while retaining
the comment describing the zero-valued pkgmeta.Model coverage.
- Around line 41-52: Extend the test around ReplaceModuleDeclarations to
retrieve the persisted declaration for /a.ts and assert its name is "A2". Keep
the existing non-empty keys assertion and error handling unchanged, using the
test’s available database or lookup mechanism to verify the last duplicate wins.

In `@internal/module/meta/declaration_test.go`:
- Around line 176-179: Remove the redundant ensureDualStoreTables call and its
error handling from the test setup after openDeclarationTestDB in the
remove-decls test, relying on openDeclarationTestDB to initialize the tables.
- Around line 67-97: Extend TestDeleteDeclarationTrees_Cascade’s seeded Model
tree with a decorator containing an argument, and add a parameter and type
parameter to the service, using the existing metadata relationships and raw
models. After DeleteDeclarationTrees, assert that decorator, argument,
parameter, and type-parameter rows for the model’s descendants are all absent,
alongside the existing model, field, and service assertions.

In `@internal/module/meta/declaration.go`:
- Around line 213-244: Deduplicate logical keys in the appendKey closure within
the surrounding declaration-processing function by tracking normalized
(application, name) pairs in a seen map before appending to keys. Preserve the
existing Valid check and ensure repeated keys from prevDecls, prevEff, and
orderedPaths are added only once, consistent with RemoveModuleDeclarations.
- Around line 246-262: Move the `ModuleId` assignment for caller-supplied
`*pkgmeta.Model` values into the `db.Transaction` callback, before
`deleteRawModelsForModule` and `persistModelTreeAsRaw` execute. Ensure the
mutation occurs only within the transaction flow so failed transactions do not
leave the input models assigned.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: bbc1d5f2-a78e-4d40-aab6-03328b4e2c4f

📥 Commits

Reviewing files that changed from the base of the PR and between 61a4a1b and 54e7b76.

📒 Files selected for processing (104)
  • cmd/cmd_module.go
  • cmd/cmd_module_test.go
  • cmd/cmd_test_cmd_e2e_test.go
  • internal/bootstrap/service/coordinator.go
  • internal/bootstrap/service/coordinator_admin_coverage_test.go
  • internal/bootstrap/service/workspace_freshness.go
  • internal/module/artifact/build/backend/builder.go
  • internal/module/artifact/build/backend/builder_test.go
  • internal/module/artifact/build/backend/inject_test.go
  • internal/module/artifact/build/injectappmodel/coverage_test.go
  • internal/module/artifact/build/injectappmodel/helpers.go
  • internal/module/artifact/build/injectappmodel/injectappmodel_test.go
  • internal/module/artifact/build/injectappmodel/supersede.go
  • internal/module/artifact/generate/generator.go
  • internal/module/evolution/data/loader.go
  • internal/module/evolution/data/loader_test.go
  • internal/module/evolution/data/translated_seed.go
  • internal/module/evolution/schema/foreignkey.go
  • internal/module/evolution/schema/foreignkey_test.go
  • internal/module/evolution/schema/helpers_test.go
  • internal/module/evolution/schema/migrator.go
  • internal/module/evolution/schema/migrator_test.go
  • internal/module/evolution/scripts/context_test.go
  • internal/module/evolution/scripts/history.go
  • internal/module/evolution/scripts/history_test.go
  • internal/module/evolution/scripts/runner_decorators_test.go
  • internal/module/lifecycle/bundles_app_setting_test.go
  • internal/module/lifecycle/bundles_field_default_test.go
  • internal/module/lifecycle/bundles_translation_term_test.go
  • internal/module/lifecycle/install_module_test.go
  • internal/module/lifecycle/install_prefetch_test.go
  • internal/module/lifecycle/installer_commit_test.go
  • internal/module/lifecycle/module_index_sync.go
  • internal/module/lifecycle/module_index_sync_registry.go
  • internal/module/lifecycle/module_index_sync_registry_test.go
  • internal/module/lifecycle/module_index_sync_test.go
  • internal/module/lifecycle/modulemanager.go
  • internal/module/lifecycle/modulemanager_coverage_test.go
  • internal/module/lifecycle/modulemanager_fastfail_test.go
  • internal/module/lifecycle/uninstaller.go
  • internal/module/lifecycle/uninstaller_clean_models_test.go
  • internal/module/lifecycle/uninstaller_model_data_test.go
  • internal/module/lifecycle/upgrade_uninstall_commit_test.go
  • internal/module/meta/declaration.go
  • internal/module/meta/declaration_coverage_test.go
  • internal/module/meta/declaration_test.go
  • internal/module/meta/dual_store.go
  • internal/module/meta/dual_store_coverage_test.go
  • internal/module/meta/dual_store_test.go
  • internal/module/meta/effective_merge.go
  • internal/module/meta/effective_merge_coverage_test.go
  • internal/module/meta/effective_merge_test.go
  • internal/module/meta/entities.go
  • internal/module/meta/entities_test.go
  • internal/module/meta/extends_expand.go
  • internal/module/meta/extends_expand_coverage_test.go
  • internal/module/meta/extends_expand_test.go
  • internal/module/meta/lookup_effective.go
  • internal/module/meta/lookup_effective_test.go
  • internal/module/meta/meta_lock_lease.go
  • internal/module/meta/meta_model_data.go
  • internal/module/meta/meta_module_index.go
  • internal/module/meta/meta_module_management_log.go
  • internal/module/meta/meta_module_migration_history.go
  • internal/module/meta/meta_raw_argument.go
  • internal/module/meta/meta_raw_decorator.go
  • internal/module/meta/meta_raw_field.go
  • internal/module/meta/meta_raw_field_test.go
  • internal/module/meta/meta_raw_model.go
  • internal/module/meta/meta_raw_parameter.go
  • internal/module/meta/meta_raw_service.go
  • internal/module/meta/meta_raw_typeparameter.go
  • internal/module/meta/meta_setting.go
  • internal/module/meta/raw_helpers.go
  • internal/module/meta/raw_helpers_test.go
  • internal/module/meta/recompute.go
  • internal/module/meta/recompute_coverage_test.go
  • internal/module/meta/recompute_test.go
  • internal/module/meta/selection_merge.go
  • internal/module/meta/selection_merge_test.go
  • internal/module/metadata/model.go
  • internal/module/metadata/model_test.go
  • internal/state/lease/lease.go
  • internal/state/lease/lease_test.go
  • internal/state/lease/model/model.go
  • internal/state/lease/model/model_test.go
  • internal/testing/e2e/runner.go
  • pkg/meta/acl_remap.go
  • pkg/meta/acl_remap_coverage_test.go
  • pkg/meta/acl_remap_test.go
  • pkg/meta/declaration.go
  • pkg/meta/declaration_test.go
  • pkg/meta/dual_store_migrate_coverage_test.go
  • pkg/meta/dual_store_migrate_test.go
  • pkg/meta/facade.go
  • pkg/meta/facade_coverage_test.go
  • pkg/meta/facade_test.go
  • pkg/meta/meta_field.go
  • pkg/meta/meta_field_test.go
  • pkg/meta/meta_module.go
  • pkg/meta/model.go
  • pkg/meta/model_test.go
  • pkg/meta/raw_facade.go
  • pkg/meta/utils.go
💤 Files with no reviewable changes (16)
  • internal/state/lease/model/model.go
  • internal/state/lease/model/model_test.go
  • pkg/meta/model_test.go
  • pkg/meta/raw_facade.go
  • internal/module/metadata/model_test.go
  • pkg/meta/facade_coverage_test.go
  • pkg/meta/facade_test.go
  • pkg/meta/acl_remap.go
  • internal/module/metadata/model.go
  • pkg/meta/acl_remap_test.go
  • pkg/meta/declaration_test.go
  • pkg/meta/dual_store_migrate_coverage_test.go
  • pkg/meta/declaration.go
  • pkg/meta/acl_remap_coverage_test.go
  • pkg/meta/facade.go
  • pkg/meta/dual_store_migrate_test.go

Comment thread internal/module/meta/dual_store.go
Comment thread internal/module/meta/extends_expand_test.go Outdated
Comment thread internal/module/meta/lookup_effective_test.go
Comment thread internal/module/meta/raw_helpers.go Outdated
Comment thread internal/testing/e2e/runner.go

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All reported issues were addressed across 104 files

Tip: instead of fixing issues one by one fix them all with cubic

Re-trigger cubic

Comment thread internal/module/meta/entities.go
Comment thread internal/module/meta/raw_helpers.go Outdated
Comment thread internal/module/meta/declaration.go Outdated
Comment thread internal/module/meta/dual_store.go Outdated
Comment thread internal/module/evolution/schema/helpers_test.go
Comment thread internal/module/evolution/schema/foreignkey_test.go
Comment thread internal/module/meta/raw_helpers.go Outdated
Comment thread internal/module/meta/entities_test.go Outdated
Comment thread internal/module/meta/declaration.go
Comment thread internal/module/meta/extends_expand_test.go Outdated
buke and others added 2 commits August 7, 2026 14:33
- Treat invalid NullString IDs as absent and apply soft-delete scope in raw count helpers.

- Collect legacy effective keys in RemoveModuleDeclarations and ensure the live unique index after catalog AutoMigrate.

- Clean gofmt, obsolete error text, pkgmeta aliases, and brittle shared-memory test DSNs.

Co-authored-by: Cursor <cursoragent@cursor.com>
- Update TestSeedModuleIndexForE2EAutoMigrateError after the metadata package rename.

Co-authored-by: Cursor <cursoragent@cursor.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All reported issues were addressed across 26 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread internal/module/lifecycle/modulemanager.go
Comment thread internal/module/meta/declaration.go Outdated
Comment thread internal/module/meta/entities_test.go Outdated
Comment thread internal/module/lifecycle/modulemanager.go
- Skip drop/recreate when the final live unique index already exists and only clean leftover temp indexes.

- Deduplicate Remove/Replace effective-key lookup via appendEffectiveKeysForModule.

- Drop the dead meta_ir_ table-name guard from entities tests.

Co-authored-by: Cursor <cursoragent@cursor.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All reported issues were addressed across 4 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Fix all with cubic | Re-trigger cubic

Comment thread internal/module/meta/dual_store_coverage_test.go
buke and others added 2 commits August 7, 2026 15:01
- Exercise EnsureEffectiveAppNameUniqueIndex success and failure from bootstrap and migrateBaseModule.

- Cover ListDeclarations/RemoveModuleDeclarations guards and dual-store ensure edge cases for patch coverage.

Co-authored-by: Cursor <cursoragent@cursor.com>
- Drop dead failingDropDialector/Migrator now that MySQL drop-error coverage uses failingDropTempDialector.

Co-authored-by: Cursor <cursoragent@cursor.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All reported issues were addressed across 4 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Fix all with cubic | Re-trigger cubic

Comment thread internal/module/lifecycle/modulemanager_coverage_test.go Outdated
…ests

- Extract seedDuplicateLiveModelsForTest so bootstrap and migrateBaseModule failure cases keep the same live-duplicate shape.

Co-authored-by: Cursor <cursoragent@cursor.com>
@buke
buke merged commit fdf6bb3 into main Aug 7, 2026
44 checks passed
@buke
buke deleted the refactor/meta-pkg-split-clean branch August 7, 2026 07:33
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