@gentbajko/slopify 4.3.2 → 4.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/extension/slopify-studio-chrome.zip +0 -0
- package/dist/extension/slopify-studio-firefox.zip +0 -0
- package/dist/kernel/runner/index.js +3 -1
- package/dist/main.js +1 -1
- package/dist/patch-notes/4.3.3.md +11 -0
- package/dist/patch-notes/4.3.4.md +11 -0
- package/dist/patch-notes/index.json +12 -0
- package/dist/slices/rebuild/runtime-plan.js +56 -0
- package/dist/slices/rebuild/runtime-store.js +21 -3
- package/package.json +1 -1
|
Binary file
|
|
Binary file
|
|
@@ -194,6 +194,8 @@ export function createRunner(deps) {
|
|
|
194
194
|
}
|
|
195
195
|
function startEligible(projectId) {
|
|
196
196
|
const stages = deps.stages.stagesOf(projectId);
|
|
197
|
+
// Worked out once for this sweep and thrown away at the end of it.
|
|
198
|
+
const pass = new Map();
|
|
197
199
|
const releasesKind = (dependent) => (kind) => {
|
|
198
200
|
const matches = stages.filter((stage) => stage.kind === kind);
|
|
199
201
|
return (matches.length > 0 && matches.every((stage) => releases(dependent, kind, stage.state)));
|
|
@@ -205,7 +207,7 @@ export function createRunner(deps) {
|
|
|
205
207
|
const dependencies = deps.stages.dependenciesOf?.(projectId, stage.kind) ?? graph[stage.kind];
|
|
206
208
|
if (deps.stages.ready === undefined
|
|
207
209
|
? !dependencies.every(releasesKind(stage.kind))
|
|
208
|
-
: !deps.stages.ready(stage.work)) {
|
|
210
|
+
: !deps.stages.ready(stage.work, pass)) {
|
|
209
211
|
continue;
|
|
210
212
|
}
|
|
211
213
|
if (deps.stages.paused?.(projectId))
|
package/dist/main.js
CHANGED
|
@@ -1139,7 +1139,7 @@ alignSubtitles: aligner = alignSubtitlesWith(() => readSettings({ db, log }).sub
|
|
|
1139
1139
|
return projectStandings(execution, projectId);
|
|
1140
1140
|
},
|
|
1141
1141
|
standingsOf: (projectId) => executionStandings(execution, projectId),
|
|
1142
|
-
ready: (work) => invocationReady(execution, work),
|
|
1142
|
+
ready: (work, pass) => invocationReady(execution, work, pass),
|
|
1143
1143
|
// A project in the trash (Settings → Trash) holds like a paused one until it is restored.
|
|
1144
1144
|
paused: (projectId) => projectPaused(db, projectId) ||
|
|
1145
1145
|
queueWaiting(db, projectId) ||
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Slopify 4.3.3
|
|
2
|
+
|
|
3
|
+
Released 9 November 2026.
|
|
4
|
+
|
|
5
|
+
A video with many images no longer stops the app while it decides what to run next.
|
|
6
|
+
|
|
7
|
+
## The run stops blocking the app
|
|
8
|
+
|
|
9
|
+
- **Every time a run asked itself what to start next, it worked the answer out from scratch for each waiting step** — reading the whole revision back off disk, a check for every output and every picture, the article read again, and every step re-derived from the narration up. With twelve pictures that happened a few dozen times across a run and nobody saw it. With 240 it happened tens of thousands of times, one core went to nothing but that, and the app stopped answering: pages hung, and nothing could be opened until it was restarted.
|
|
10
|
+
- **It is now worked out once for each sweep and shared by every step in it.** A sweep starts with nothing carried over from the one before, so a step that has just finished is still seen the moment it finishes.
|
|
11
|
+
- **Nothing about what runs, or in what order, has changed** — only how often the same answer is worked out.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Slopify 4.3.4
|
|
2
|
+
|
|
3
|
+
Released 10 November 2026.
|
|
4
|
+
|
|
5
|
+
The plan a run is made from is worked out once and shared, instead of again for every step that asks.
|
|
6
|
+
|
|
7
|
+
## A run no longer blocks the app
|
|
8
|
+
|
|
9
|
+
- **Ten places ask the project what it is making, and each worked it out from scratch** — the whole revision read back off disk, a check for every output and every picture, the article read again, every step derived from the narration up. With twelve pictures that was a few dozen times across a run and nobody saw it. With 240 it ran into the tens of thousands, one core went to nothing but that, and the app stopped answering.
|
|
10
|
+
- **It is now worked out once and handed to every caller that asks** while nothing it was made from has changed.
|
|
11
|
+
- **It is thrown away the moment anything does change** — any write to your data, a picture or an output whose file is no longer on disk, or a different model catalogue. The check is deliberately blunt, so it can only ever work the plan out more often than needed, never hand back one that has gone stale.
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"id": "4.3.4",
|
|
4
|
+
"title": "Slopify 4.3.4",
|
|
5
|
+
"version": "4.3.4",
|
|
6
|
+
"date": "2026-11-10"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"id": "4.3.3",
|
|
10
|
+
"title": "Slopify 4.3.3",
|
|
11
|
+
"version": "4.3.3",
|
|
12
|
+
"date": "2026-11-09"
|
|
13
|
+
},
|
|
2
14
|
{
|
|
3
15
|
"id": "4.3.2",
|
|
4
16
|
"title": "Slopify 4.3.2",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { readFileSync } from "node:fs";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { catalogueSchema } from "../../catalog/schema.js";
|
|
4
|
+
import { fingerprint } from "../../kernel/runner/work.js";
|
|
4
5
|
import { getRevisionView, readyOutput, withEarlierJoins } from "../revisions/view.js";
|
|
5
6
|
import { outputPath } from "../storage/layout.js";
|
|
6
7
|
import { referencedAssetsAvailable, retainedNarrationPieces } from "./narration-history.js";
|
|
@@ -51,7 +52,62 @@ export function workLlm(db, workId, choice, label) {
|
|
|
51
52
|
...call,
|
|
52
53
|
});
|
|
53
54
|
}
|
|
55
|
+
// Ten places ask for the plan, and each one used to derive it from scratch: the article read
|
|
56
|
+
// back off disk, every recipe rebuilt from the narration up. At twelve images that happened a
|
|
57
|
+
// few dozen times over a run; at 240 it happened tens of thousands of times and the server
|
|
58
|
+
// spent its whole time planning instead of answering.
|
|
59
|
+
//
|
|
60
|
+
// The plan is kept and handed back while nothing in the database has changed, which SQLite
|
|
61
|
+
// counts for us. That is a blunt test on purpose: a write anywhere - another project, another
|
|
62
|
+
// revision - throws the plan away and it is derived again. It can never hand back a plan from
|
|
63
|
+
// after a write it has not seen, which is the only direction that would matter, because a
|
|
64
|
+
// stale plan would start the wrong work.
|
|
65
|
+
// Per database, never shared between them: two of them (the app and a mirror, or two tests)
|
|
66
|
+
// can hold the same project under the same id, and one's plan is not the other's.
|
|
67
|
+
const kept = new WeakMap();
|
|
68
|
+
const changeCount = z.object({ changes: z.number() });
|
|
69
|
+
function writesSoFar(deps) {
|
|
70
|
+
return changeCount.parse(deps.db.prepare("SELECT total_changes() AS changes").get()).changes;
|
|
71
|
+
}
|
|
72
|
+
// Two catalogues that differ give different plans, so the catalogue belongs in the key. Its
|
|
73
|
+
// date and shape identify it without hashing the whole of it on every call.
|
|
74
|
+
function catalogueMark(catalogue) {
|
|
75
|
+
return [
|
|
76
|
+
catalogue.schemaVersion,
|
|
77
|
+
catalogue.updatedAt,
|
|
78
|
+
catalogue.llm.length,
|
|
79
|
+
catalogue.image?.length ?? 0,
|
|
80
|
+
Object.keys(catalogue.providers).length,
|
|
81
|
+
].join("/");
|
|
82
|
+
}
|
|
83
|
+
// What the plan was derived from, beyond the database: whether each output and piece is
|
|
84
|
+
// selected and whether its file is still on disk. A file deleted by hand is no write at all,
|
|
85
|
+
// so `total_changes()` would never notice it, and the plan would go on reusing work whose
|
|
86
|
+
// output is gone. Walking a few hundred rows is nothing beside deriving the plan again.
|
|
87
|
+
function viewMark(view) {
|
|
88
|
+
const rows = [String(view.articleMarkdown?.length ?? -1)];
|
|
89
|
+
for (const row of view.outputs)
|
|
90
|
+
rows.push(`o${row.recordId}:${row.selected ? 1 : 0}${row.available ? 1 : 0}:${row.fingerprint}`);
|
|
91
|
+
for (const row of view.pieces)
|
|
92
|
+
rows.push(`p${row.recordId}:${row.selected ? 1 : 0}${row.available ? 1 : 0}:${row.fingerprint}`);
|
|
93
|
+
return fingerprint(rows.join("\n"));
|
|
94
|
+
}
|
|
54
95
|
export function executionPlan(deps, view, catalogue) {
|
|
96
|
+
const key = `${view.revision.projectId}/${view.revision.id}/${catalogueMark(catalogue)}/${viewMark(view)}`;
|
|
97
|
+
const changes = writesSoFar(deps);
|
|
98
|
+
const forDb = kept.get(deps.db) ?? new Map();
|
|
99
|
+
kept.set(deps.db, forDb);
|
|
100
|
+
const held = forDb.get(key);
|
|
101
|
+
if (held !== undefined && held.changes === changes)
|
|
102
|
+
return held.plan;
|
|
103
|
+
const plan = derivePlan(deps, view, catalogue);
|
|
104
|
+
// A cache, not a store: a handful of revisions is all a run needs at once.
|
|
105
|
+
if (forDb.size > 8)
|
|
106
|
+
forDb.clear();
|
|
107
|
+
forDb.set(key, { changes, plan });
|
|
108
|
+
return plan;
|
|
109
|
+
}
|
|
110
|
+
function derivePlan(deps, view, catalogue) {
|
|
55
111
|
const textOutput = (role) => {
|
|
56
112
|
const row = readyOutput(view, { role });
|
|
57
113
|
return row === undefined
|
|
@@ -82,7 +82,23 @@ export function executionStages(deps, projectId) {
|
|
|
82
82
|
};
|
|
83
83
|
});
|
|
84
84
|
}
|
|
85
|
-
|
|
85
|
+
// The view and the plan a sweep works out once. Reading a revision stats every output and
|
|
86
|
+
// every piece on disk and reads the article back, and planning it derives every recipe from
|
|
87
|
+
// the narration up; at twelve images that was a few dozen times over a run and nobody saw it,
|
|
88
|
+
// at 240 it is tens of thousands and the server stops answering. `pass` is the caller's
|
|
89
|
+
// scratch space for one sweep (`kernel/runner`): within it nothing writes the pieces or
|
|
90
|
+
// outputs these are read from, so the answer cannot have gone stale. Without one, every call
|
|
91
|
+
// works it out afresh, as it always did.
|
|
92
|
+
function passPlan(pass, key, make) {
|
|
93
|
+
if (pass === undefined)
|
|
94
|
+
return make();
|
|
95
|
+
if (pass.has(key))
|
|
96
|
+
return pass.get(key);
|
|
97
|
+
const value = make();
|
|
98
|
+
pass.set(key, value);
|
|
99
|
+
return value;
|
|
100
|
+
}
|
|
101
|
+
export function invocationReady(deps, work, pass) {
|
|
86
102
|
const row = deps.db
|
|
87
103
|
.prepare("SELECT recipe_context,retry_at FROM revision_work WHERE id=? AND project_id=? AND revision_id=?")
|
|
88
104
|
.get(work.workId, work.projectId, work.revisionId);
|
|
@@ -91,10 +107,12 @@ export function invocationReady(deps, work) {
|
|
|
91
107
|
// Waiting out a failure time can fix: `dueRetries` clears the wait when it runs out.
|
|
92
108
|
if (row.retry_at !== null)
|
|
93
109
|
return false;
|
|
94
|
-
const view = executionView(deps, work.projectId, work.revisionId);
|
|
110
|
+
const view = passPlan(pass, `view:${work.projectId}:${work.revisionId}`, () => executionView(deps, work.projectId, work.revisionId));
|
|
95
111
|
if (view === undefined)
|
|
96
112
|
return false;
|
|
97
|
-
|
|
113
|
+
// The catalogue is the work row's own, so it belongs in the key: two steps saved under
|
|
114
|
+
// different catalogues must not share a plan.
|
|
115
|
+
const plan = passPlan(pass, `plan:${work.projectId}:${work.revisionId}:${String(row.recipe_context)}`, () => executionPlan(deps, view, savedCatalogue(row.recipe_context)));
|
|
98
116
|
const pieces = workPieces(deps.db, work.workId);
|
|
99
117
|
return pieces.some((piece) => {
|
|
100
118
|
if (piece.state === "done" ||
|