feat(manager): harden Mastra enrichment handoff - #1087
Open
lumberman wants to merge 7 commits into
Open
Conversation
Make the per-job engine stamp round-trip so the Mastra cutover's runtime
flag and callback gate have a real field to read/write:
- EnrichmentEngine type + JobOptions.engine, stored in the existing options
JSON (no Admin schema change)
- readEngineStamp() with .catch("workflow") so legacy/missing/corrupt stamps
resolve to the engine whose dependency stays installed through Phase 1
- createJob threads + persists the stamp (mock + admin paths)
- restampEngine() merge-aware re-stamp for the transcription-rerun path
(never bare-replaces options)
- UpdateAdminJobInput accepts options; toJobRecord parses node.options
Corrects a deepening-review finding: toJobRecord (flagged as the load-bearing
read drop) has no src/ call sites; the real read paths already preserved
options. The actual gap was the missing type field + create never writing it.
Refs docs/plans/2026-05-28-001-feat-manager-enrichment-mastra-migration-plan.md
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Requirements doc (ce:brainstorm) + comprehensive plan (ce:plan, deepened by 11 review agents). Captures the engine-consolidation decisions, the two-phase cutover reconciliation, and the verified Phase 0 findings (forge-manager = 1 replica + Local World → P0-B descoped, R-DUR is not a regression). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Serialize callback state and reset run fences on redispatch. Require the dedicated enrichment bearer and keep Mastra ramp gated.
|
🚅 Deployed to the forge-pr-1087 environment in forge
7 services not affected by this PR
|
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.
Summary
Manager can now launch video enrichment through Mastra behind the
forge.enrichment.engineflag while keeping the legacy workflow path available. The handoff is fenced by run IDs, callback sequence checks, terminal-state guards, and a first-callback watchdog so Manager job state does not get reopened or corrupted by stale Mastra traffic.What changed
forge.enrichment.engine..paralleloutput keying and.foreachconcurrency to de-risk the next graph-port stage.docs/plans/2026-06-01-001-feat-manager-enrichment-mastra-finishable-stages-plan.md.Scope boundary
This PR intentionally stops before the production Mastra-native enrichment graph port. Transcript-only, scene-analysis, parity corpus, rollout ramp, and Phase 2 legacy workflow removal remain follow-up stage work after this runtime seam is stable.
Validation
pnpm --filter @forge/manager test -- launchVideoEnrichment mastraEnrichmentWatchdog mastra-enrichment enrichment-callback statepnpm --filter @forge/mastra test -- forge-video-enrichment forge-video-enrichment-primitivespnpm --filter @forge/manager typecheckpnpm --filter @forge/mastra typecheckpnpm --filter @forge/manager lintpnpm --filter @forge/mastra lintgit diff --checkNo browser evidence was captured because this slice changes internal API, workflow, service, and state surfaces rather than a user-facing route.