Skip to content

chore: deps update, migration fix, marketplace cleanup#151

Merged
thebtf merged 7 commits into
mainfrom
chore/deps-and-migration-077
Apr 14, 2026
Merged

chore: deps update, migration fix, marketplace cleanup#151
thebtf merged 7 commits into
mainfrom
chore/deps-and-migration-077

Conversation

@thebtf
Copy link
Copy Markdown
Owner

@thebtf thebtf commented Apr 14, 2026

Changes

fix(db): expand migration 077 constraints

  • Add missing relation_type values: follows, prompted_by, references, referenced_by
  • Replace silent error swallowing with proper error returns
  • Add Rollback function

chore(deps): muxcore v0.15.0 → v0.17.0

  • Named daemon sockets prevent conflicts between muxcore apps
  • Breaking DaemonControlPath(baseDir, name) is internal to engine — no engram code affected

chore(ci): remove sync-marketplace workflow

  • Marketplace repo switched to git-subdir source — CC fetches plugin files directly from engram:plugin/engram/
  • The sync workflow was generating noise (59+ commits) without updating the marketplace version

chore: remove plugin/.claude-plugin/marketplace.json

  • Source of truth for marketplace.json is now the engram-marketplace repo

chore(plugin): bump version to 4.0.2

Smoke test

  • go build ./cmd/engram/
  • go build ./cmd/engram-server/
  • Client starts, connects in proxy mode ✅
  • gRPC h2c handshake fails (pre-existing cmux issue, not related to muxcore update)

Known issue

gRPC over plaintext (h2c) doesn't work with cmux HTTP2HeaderFieldPrefix matcher — cmux routes h2c connections to the HTTP handler. Needs cmux.HTTP2() matcher or TLS. Filed as separate issue.

Summary by CodeRabbit

Примечания к выпуску

  • Обновления версий

    • Плагин engram обновлён с 4.0.1 до 4.0.2.
  • Обновления зависимостей

    • Обновлён модуль Go: muxcore v0.15.0 → v0.17.0.
  • Улучшения базы данных

    • Расширены допустимые типы отношений наблюдений; миграция теперь останавливается при ошибке и помечена как необратимая.
  • Улучшения сети

    • Улучшена обработка gRPC/HTTP2 (h2c) для корректного установления сессий.
  • Удалено

    • Удалён автоматический синхрон с маркетплейсом и локальный манифест.

thebtf added 5 commits April 14, 2026 04:06
…llback

- Add missing relation_type values: follows, prompted_by, references,
  referenced_by (used by detector.go FR-4,5,36)
- Replace silent error swallowing (_ = tx.Exec) with proper error returns
- Add Rollback function that restores original migration 019 constraints
Breaking change DaemonControlPath(baseDir, name) is internal to engine —
engram uses only engine.New/Run, no direct calls affected.
Benefit: named daemon sockets prevent conflicts between muxcore apps.
Marketplace repo switched to git-subdir source — CC now fetches
plugin files directly from engram:plugin/engram/ via sparse checkout.
The sync workflow is obsolete and was generating noise (59 commits
that didn't update the marketplace version, causing stale installs).
Source of truth for marketplace.json is now the engram-marketplace
repo (thebtf/engram-marketplace). This file was a copy target for
the now-deleted sync-marketplace workflow.
@gemini-code-assist
Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 14, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 89408986-47a9-4cf1-8721-520513a9756a

📥 Commits

Reviewing files that changed from the base of the PR and between afe67f8 and 4bd5a0a.

📒 Files selected for processing (3)
  • internal/db/gorm/migrations.go
  • internal/db/gorm/models.go
  • pkg/models/relation.go

Walkthrough

Удалён workflow синхронизации маркетплейса и локальный манифест; обновлён модуль Go; расширены типы отношений в коде и миграции БД (с fail‑fast и Rollback), изменён matcher cmux для gRPC (h2c), и повышена версия плагина до 4.0.2.

Changes

Cohort / File(s) Summary
Marketplace workflow & manifest
\.github/workflows/sync-marketplace.yml, plugin/.claude-plugin/marketplace.json
Удалён GitHub Actions workflow синхронизации маркетплейса и удалён связанный marketplace.json.
Go dependency
go.mod
Обновлён модуль github.com/thebtf/mcp-mux/muxcore с v0.15.0v0.17.0.
DB migration 077
internal/db/gorm/migrations.go
Расширен набор допустимых значений CHECK для observation_relations.relation_type; миграция теперь возвращает ошибку при первом сбое (fail‑fast) и включает Rollback, который намеренно помечен как необратимый.
GORM model tag
internal/db/gorm/models.go
Актуализирован gorm‑тег поля RelationType — CHECK содержит расширенный список типов связей, синхронизированный с миграцией.
Relation types
pkg/models/relation.go
Добавлены новые константы RelationType (modifies, reads, follows, prompted_by, references, referenced_by) и включены в AllRelationTypes.
gRPC listener matcher
internal/worker/service.go
Заменён вызов cmux: Match(...)MatchWithWriters(cmux.HTTP2MatchHeaderFieldPrefixSendSettings(...)) для корректной отправки HTTP/2 SETTINGS в h2c.
Plugin manifest version
plugin/engram/.claude-plugin/plugin.json
Обновлена версия плагина с 4.0.14.0.2.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • chore: deps update, migration fix, marketplace cleanup #151 — содержит те же изменения: удаление workflow и marketplace.json, обновление go.mod, расширение миграции 077 с Rollback, синхронизация RelationType и изменение cmux matcher.

Suggested labels

ai-review:passed

Poem

🐇 В норе шуршу, к первому коммиту бегу,
Workflow пропал — ветру я рад,
Миграции шепчут: "новые пути",
Версию поднял, cmux подправил — ура!
Пусть пуши идут ровно, как лунный сад.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Название охватывает основные изменения (обновление зависимостей, исправление миграции, очистка marketplace), но формулировка слишком общая и не отражает наиболее критичные изменения (расширение ограничений миграции 077 и переключение cmux для h2c).
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/deps-and-migration-077

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.11.4)

Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions
The command is terminated due to an error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions


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

cmux.HTTP2HeaderFieldPrefix doesn't work for plaintext HTTP/2 (h2c)
because the gRPC client blocks waiting for the server SETTINGS frame
before sending HEADERS. Switch to HTTP2MatchHeaderFieldPrefixSendSettings
which actively participates in the h2c handshake.

Symptom: "error reading server preface: use of closed network connection"
Root cause: cmux routed h2c gRPC connections to the HTTP handler
@thebtf
Copy link
Copy Markdown
Owner Author

thebtf commented Apr 14, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 14, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@internal/db/gorm/migrations.go`:
- Around line 2264-2268: The DB migration expands allowed relation_type values
but the in-code enum/constants still list only the original 17 types; update the
code so the application and schema match by adding the new values
("modifies","reads","follows","prompted_by","references","referenced_by") to the
relation type definitions used by the app: update the relation type list/enum in
internal/db/gorm/models.go (the RelationType or related constant slice around
the existing lines 195-210) and in pkg/models/relation.go (the relation
types/validation list around lines 9-63), or better yet centralize the list into
a single exported source (e.g., a shared constant slice or type) and reference
it from both places so the DB migration and app validation remain in sync.
Ensure any validation logic or switch/case handling that enumerates relation
types is updated to include the new values.
- Around line 2280-2292: The rollback's Rollback func(tx *gorm.DB) error re-adds
narrower CHECK constraints (chk_observation_relations_relation_type and
chk_observation_relations_detection_source) on observation_relations without
first normalizing or removing rows that violate them (e.g., creative_association
used by internal/consolidation/associations.go:270-280), so ADD CONSTRAINT will
fail on real data; fix by either (A) adding a data-migration step inside
Rollback that updates or removes incompatible relation_type and detection_source
values (identify and transform creative_association and any new relation_type
values into allowed values or NULL) before executing the ALTER TABLE statements,
or (B) mark the rollback as irreversible (return a descriptive error indicating
rollback is not supported) and remove the destructive ALTERs; modify the
Rollback function accordingly and reference
chk_observation_relations_relation_type,
chk_observation_relations_detection_source, observation_relations, and the
Rollback func(tx *gorm.DB) error when making the change.
🪄 Autofix (Beta)

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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 39877d2b-19fb-4c31-b1e1-6b80050302d4

📥 Commits

Reviewing files that changed from the base of the PR and between 52f5d11 and 2580721.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (5)
  • .github/workflows/sync-marketplace.yml
  • go.mod
  • internal/db/gorm/migrations.go
  • plugin/.claude-plugin/marketplace.json
  • plugin/engram/.claude-plugin/plugin.json
💤 Files with no reviewable changes (2)
  • plugin/.claude-plugin/marketplace.json
  • .github/workflows/sync-marketplace.yml

Comment thread internal/db/gorm/migrations.go
Comment thread internal/db/gorm/migrations.go Outdated
…ack irreversible

- Add 6 new RelationType constants to pkg/models/relation.go
  (modifies, reads, follows, prompted_by, references, referenced_by)
- Update AllRelationTypes slice (used by handler validation and stats)
- Update GORM struct tag CHECK constraint to match migration 077
- Replace destructive rollback with explicit irreversible error
  (rows with new types may exist after migration runs)

CodeRabbit review finding: handler rejected new types with 400,
GORM model out of sync with DB schema.
@thebtf thebtf merged commit 653fabb into main Apr 14, 2026
0 of 2 checks passed
@thebtf thebtf deleted the chore/deps-and-migration-077 branch April 14, 2026 01:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant