Repository navigation
Conversation
MergeProjectsByName migrates one explicitly named source project spelling onto an explicitly named target in a single transaction, reusing the Gentleman-Programming#1415 migration core via mergeProjectRecordsTx. The pair does not need to normalize-equivalent — that is the point of an explicit rename-merge such as acmeapi -> acme-api — and both existing admission contracts (MergeProjects, MergeExplicitProjectVariants) are pinned unchanged by regression tests. CountProjectRecords reports the exact-spelling counts the dry-run preview prints, mirroring the merge UPDATE predicate so the preview can neither overstate nor understate what --apply moves. Refs Gentleman-Programming#1296
engram projects merge --from <name> --to <name> names the pair the consolidate detector cannot group (e.g. acmeapi and acme-api). Without --apply it prints the observation/session/prompt counts that would move and opens no write path; --apply migrates them through MergeProjectsByName and prints consolidate's post-merge report with honest nothing-merged reporting. A pair that normalizes to the same project is refused outright with a pointer to consolidate. DOCS.md documents the command. Checks: gofmt clean; go build ./... OK; go test ./internal/store/... ./cmd/engram/... -count=1 -skip 'TestCmdServeSignalClosesUnixSocket' (pre-existing host-environment failure) ok. Live smoke on a throwaway store verified preview-no-mutation, apply, both refusal spellings, and honest empty-source reporting. Refs Gentleman-Programming#1296
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
MergeProjectsByName now computes sync-identity presence for the exact source spelling (sync_enrolled_projects rows plus pending sync_mutations, mirroring mergeProjects' explicit check) before the record migration and enqueues backfillProjectSyncMutationsTx only when the merge moved record rows or sync identity. A missing source stays a successful no-op that writes zero sync mutations. Adds the guard regression test (RED against the unconditional backfill), a CountProjectRecords error-path test, and ACMEAPI exact-spelling pins in the merge and count tests. Addresses CodeRabbit findings on Gentleman-Programming#1452. Refs Gentleman-Programming#1451
…tests into the CLI chain
golangci-lint runs with only-new-issues, so the new cmdProjectsMerge and its tests must honor the s.Close error like the store tests do. Rebased onto the seam branch including its backfill guard fix. Addresses the Lint failures on Gentleman-Programming#1453. Refs Gentleman-Programming#1296
Contributor
Author
|
Closing as superseded by #1457, which landed the explicit project-merge variants and closed #1296. My implementation here covers the same surface (same files), so keeping it open would only invite drift. #1452 stays draft until #1451 is triaged, and I will re-scope or close it against the merged #1457 baseline as needed. Thanks for landing the feature line. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔗 Linked Issue
Closes #1296
🏷️ PR Type
type:bug— Bug fixtype:feature— New featuretype:question— Question requiring tracked worktype:docs— Documentation onlytype:refactor— Code refactoring (no behavior change)type:chore— Maintenance, dependencies, toolingtype:breaking-change— Breaking change📝 Summary
engram projects merge --from <name> --to <name> [--apply]: the operator names the pair the consolidate detector cannot group (e.g.acmeapiandacme-api).--applyit prints the observation/session/prompt counts that would move and opens no write path;--applymigrates them throughMergeProjectsByNameand prints consolidate's post-merge report with honest nothing-merged reporting.consolidate. DOCS.md documents the command; the--candidatescompanion ask from feat(cli): merge two explicitly named projects when "projects consolidate --all" finds no groups #1296 stays out of scope.📂 Changes
cmd/engram/main.goprojects mergerouting, usage line,cmdProjectsMerge(flag parsing, unconditional same-normalized refusal, dry-run preview, apply report)cmd/engram/main_test.goDOCS.md🧪 Test Plan
go test ./cmd/engram/... ./internal/store/... -count=1 -skip 'TestCmdServeSignalClosesUnixSocket'passes (skipped test is a pre-existing host-environment failure, reproduced on base without this diff)--applymoves all records; both same-normalized spellings refused non-zero; empty source reports honestlygofmtclean;go build ./...OK✅ Contributor Checklist
type:*label — checkboxtype:featurechecked; label itself needs a maintainer (pull-only author)feat(cli): …)Co-Authored-BytrailersChain Context
main(see note below; logically builds on #1452)feat/1296-store-by-name-merge)c9de012(tip of #1452)Chain Overview
Scope
--candidateslisting (explicitly out of scope per feat(cli): merge two explicitly named projects when "projects consolidate --all" finds no groups #1296)Autonomy