Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

address review: restore autoLock + sourceSeriesId on series-driven extracts

[._.]/ Adam Eivy1b304fafe4f9
diff --git a/server/routes/pipeline.js b/server/routes/pipeline.js
index c5f4876943..59dcf8aeca 100644
--- a/server/routes/pipeline.js
+++ b/server/routes/pipeline.js
@@ -935,10 +935,16 @@ router.post('/series/:id/seasons/:seasonId/episodes/generate', asyncHandler(asyn
.filter(Boolean)
.join('\n\n');
if (corpus.trim() && series?.universeId) {
+ // Stamp new inserts as series-extracted (autoLock + sourceSeriesId) so
+ // continuity-derived canon survives later AI refines and stays
+ // attributable to this series. Matches the pre-B.4 series-side
+ // extract semantics.
const extractRes = await extractCanonFromProse(series.universeId, {
corpus,
providerOverride: body.providerOverride,
parallel: true,
+ autoLock: true,
+ sourceSeriesId: series.id,
}).catch((err) => {
console.warn(`⚠️ Continuity extraction failed for season ${req.params.seasonId}: ${err.message}`);
return null;
diff --git a/server/services/pipeline/textStages.js b/server/services/pipeline/textStages.js
index 0bf2521101..4f25b7dce3 100644
--- a/server/services/pipeline/textStages.js
+++ b/server/services/pipeline/textStages.js
@@ -231,10 +231,17 @@ export async function generateStage(issueId, stageId, options = {}) {
// succeeds, the user just doesn't get the bible auto-populated until
// they link a universe.
if (stageId === 'prose' && output && series.universeId) {
+ // Stamp new inserts as series-extracted: autoLock prevents a later AI
+ // refine/differentiate from silently rewriting prose-derived canon, and
+ // sourceSeriesId attributes them to the triggering series. Matches the
+ // pre-B.4 `extractAndMergeIntoSeries` semantics so existing-data behavior
+ // is preserved.
await extractCanonFromProse(series.universeId, {
corpus: output,
providerOverride: options.providerId,
parallel: true,
+ autoLock: true,
+ sourceSeriesId: series.id,
}).catch((err) => {
console.warn(`⚠️ Prose extraction failed for issue ${issueId.slice(0, 8)}: ${err.message}`);
});