Fix goal-scores enum drift: GoalPriorityEntityType rejects legacy 'checkpoint' entityType (Sentry PRODUCT-MANAGER-R)#1666
Open
pulzzejason wants to merge 2 commits into
Open
Fix goal-scores enum drift: GoalPriorityEntityType rejects legacy 'checkpoint' entityType (Sentry PRODUCT-MANAGER-R)#1666pulzzejason wants to merge 2 commits into
pulzzejason wants to merge 2 commits into
Conversation
…ue 'feedback' Fixes Sentry PRODUCT-MANAGER-R: schema.prisma still declared the GoalPriorityEntityType member as 'checkpoint', but the production DB enum was renamed 'checkpoint'->'feedback' by migration 20260513100000_schema_drift_fix. Every goal-score read/write for a checkpoint-backed entity passed the literal 'checkpoint', hitting Postgres `invalid input value for enum GoalPriorityEntityType: "checkpoint"`. Direction A (chosen): align schema + code to the already-deployed DB value 'feedback'. No new DB migration is required (the DB already has 'feedback') and it matches the shipped /feedbacks API rename. Rejected Direction B: add a new prod migration reverting the enum to 'checkpoint' — heavier/riskier, must remap existing 'feedback' rows, and fights the shipped direction. Flag before merging if a reviewer prefers B. Scope guard: only the GoalPriorityEntityType / GoalPriorityScore.entityType surface changed. The internal domain discriminator 'checkpoint' (comments, attachments, mentions, notify-followers resourceType, phase-board item.type, sow/recommendations, the Checkpoint Prisma model/table, etc.) is untouched. - schema.prisma: enum member checkpoint -> feedback (+ prisma generate) - score-goal-priority.ts: fetchEntity/resolveEntityTitle cases -> 'feedback' (bodies still query db.checkpoint); normalize legacy 'checkpoint' payloads to 'feedback' so residual queued BullMQ jobs drain without re-raising the error - trigger-rescore, goal-scores routes, feedbacks routes, use-goal-score hook, goal-priority-badge, phase-board, item-detail-panel: 'checkpoint' -> 'feedback' on the goal-score surface only - tests updated + legacy-normalization case added No PM Agent config update needed (internal enum value; no tool/workflow change). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The reconcileRepos orphan-sweep (repos.ts) reads the workspace root via
readdirSync + statSync, but repos.test.ts mocked node:fs WITHOUT stubbing
those two. So the two reconcileRepos rmSync-assertion tests enumerated the
REAL /workspace and rm-rf'd any sibling directory found there (e.g. other
checked-out repos in a CI/dev container), firing spurious rmSync calls that
broke:
- 'adopts a valid checkout ... does NOT attempt a clone' (expected 0 rmSync)
- 'rm-rf's a non-matching dir then re-clones exactly once' (expected 1 rmSync)
These failed deterministically in any container with sibling workspace dirs,
which made the whole 'npm run test' / coverage run exit non-zero and blocked
the goal-score task's review gates (test-suite-failed + coverage-report-not-
found, both fail-closed on a non-green suite).
Fix is test-only: mock readdirSync -> [] and statSync -> {mtimeMs:0} so the
sweep sees an empty workspace and only the intended rmSync calls fire. The
orphan sweep itself remains covered by the pure sweepOrphanWorkspaceDirs
tests (injected deps). No daemon source/runtime behavior changes.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Integration PR for this goal — its tasks commit onto this branch (one PR per goal). Opened automatically by the engine on first push; left as a draft until the goal completes.