broader-vids 0.1.13 → 0.1.15

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "broader-vids",
3
- "version": "0.1.13",
3
+ "version": "0.1.15",
4
4
  "description": "Curated YouTube and Bilibili recommendations for Claude Code",
5
5
  "author": {
6
6
  "name": "Broader Vids contributors"
package/README.md CHANGED
@@ -48,10 +48,9 @@ This command registers an npm backed marketplace and installs the plugin skills
48
48
 
49
49
  The desktop app accepts repository URLs in **Add marketplace**. Use the npm command for npm installation. See the [plugin packaging guide](https://developers.openai.com/plugins/build/plugins) for supported sources.
50
50
 
51
-
52
51
  ### Experimental Claude Code path
53
52
 
54
- Claude Code support is experimental. Static package checks and launcher fixtures cover it. No host acceptance test has been performed. These installation steps require a future npm release that contains the Claude files. See the [Claude Code installation notes](docs/REFERENCE.md#experimental-claude-code-installation).
53
+ Claude Code support is experimental. Static package checks and launcher fixtures cover it. No host acceptance test has been performed. See the [Claude Code installation notes](docs/REFERENCE.md#experimental-claude-code-installation).
55
54
 
56
55
  ## Update the plugin
57
56
 
@@ -600,6 +600,41 @@ function main(args = process.argv.slice(2)) {
600
600
  if (result.status === "partial") process.exitCode = 2;
601
601
  return;
602
602
  }
603
+ if (args[index] === "runtime") {
604
+ const values = args.slice(index + 1);
605
+ if (values.length === 1 && ["--help", "-h"].includes(values[0])) {
606
+ console.log(
607
+ "Usage: broader-vids [--data-dir PATH] runtime cleanup [--apply]",
608
+ );
609
+ return;
610
+ }
611
+ if (
612
+ values[0] !== "cleanup" ||
613
+ values.length > 2 ||
614
+ (values.length === 2 && values[1] !== "--apply")
615
+ )
616
+ throw Error("Use runtime cleanup with optional --apply.");
617
+ require("./profile-data.cjs").validateRoot(root, packageRoot);
618
+ return withSetup(root, () => {
619
+ const digest = wheelDigest(bundledWheel(packageRoot, manifest.version));
620
+ if (
621
+ !runtimeBuildMatches(runtime, digest, packageRoot) ||
622
+ checkRuntime(runtime, executable).status !== "ready"
623
+ )
624
+ throw Error(
625
+ "Complete setup successfully before removing older runtimes. No runtime files were removed.",
626
+ );
627
+ const report = require("./runtime-storage.cjs").cleanupRuntimeStorage(
628
+ root,
629
+ packageRoot,
630
+ manifest.version,
631
+ digest,
632
+ { apply: values[1] === "--apply" },
633
+ );
634
+ console.log(JSON.stringify(report, null, 2));
635
+ if (report.status === "partial") process.exitCode = 2;
636
+ });
637
+ }
603
638
  if (args[index] === "setup") {
604
639
  validateSetupArguments(args, index);
605
640
  if (args.includes("--check")) {
@@ -682,11 +717,21 @@ function main(args = process.argv.slice(2)) {
682
717
  environment,
683
718
  );
684
719
  }
685
- recordRuntimeBuild(runtime, wheelDigest(wheel), packageRoot, groups);
720
+ const installedDigest = wheelDigest(wheel);
721
+ recordRuntimeBuild(runtime, installedDigest, packageRoot, groups);
722
+ const storageCleanup =
723
+ require("./runtime-storage.cjs").cleanupRuntimeStorage(
724
+ root,
725
+ packageRoot,
726
+ manifest.version,
727
+ installedDigest,
728
+ { apply: true },
729
+ );
686
730
  console.log(
687
731
  JSON.stringify(
688
732
  {
689
733
  status: "installed",
734
+ storage_cleanup: storageCleanup,
690
735
  runtime,
691
736
  data_directory: root,
692
737
  next_action:
@@ -115,7 +115,7 @@ function validateRoot(root, packageRoot) {
115
115
  inside(root, path.resolve(packageRoot))
116
116
  )
117
117
  throw Error(
118
- "Reset and Clean cannot target a system directory, user home, or a directory containing the plugin.",
118
+ "Data removal cannot target a system directory, user home, or a directory containing the plugin.",
119
119
  );
120
120
  for (let current = root; ; current = path.dirname(current)) {
121
121
  if (fs.existsSync(current) && fs.lstatSync(current).isSymbolicLink())
@@ -324,4 +324,4 @@ function apply(root, operation, packageRoot, confirmation) {
324
324
  };
325
325
  }
326
326
 
327
- module.exports = { preview, apply, ensureMarker, MARKER };
327
+ module.exports = { preview, apply, ensureMarker, validateRoot, MARKER };
@@ -0,0 +1,149 @@
1
+ "use strict";
2
+
3
+ const fs = require("node:fs");
4
+ const path = require("node:path");
5
+ const { randomUUID } = require("node:crypto");
6
+ const { validateRoot } = require("./profile-data.cjs");
7
+
8
+ const STAGED = /^\.obsolete-[0-9a-f-]{36}$/;
9
+ const TEMPORARY = /^\.[0-9a-f-]{36}\.tmp$/;
10
+
11
+ function versionParts(value) {
12
+ const match =
13
+ /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-alpha\.(0|[1-9]\d*))?$/.exec(
14
+ value,
15
+ );
16
+ if (!match) return null;
17
+ const parts = match.slice(1, 4).map(Number);
18
+ parts.push(match[4] === undefined ? 1 : 0, Number(match[4] || 0));
19
+ return parts.every(Number.isSafeInteger) ? parts : null;
20
+ }
21
+
22
+ function compareVersions(left, right) {
23
+ for (let i = 0; i < left.length; i += 1) {
24
+ if (left[i] !== right[i]) return left[i] < right[i] ? -1 : 1;
25
+ }
26
+ return 0;
27
+ }
28
+
29
+ function wheelVersion(name) {
30
+ const match =
31
+ /^broader_vids-(\d+\.\d+\.\d+(?:a\d+)?)-[A-Za-z0-9_.-]+\.whl$/.exec(name);
32
+ return match ? versionParts(match[1].replace(/a(\d+)$/, "-alpha.$1")) : null;
33
+ }
34
+
35
+ function cleanupRuntimeStorage(
36
+ root,
37
+ packageRoot,
38
+ version,
39
+ digest,
40
+ { apply = false } = {},
41
+ ) {
42
+ const current = versionParts(version);
43
+ if (!current || !/^[a-f0-9]{64}$/.test(digest))
44
+ throw Error("Runtime cleanup requires a valid version and wheel digest.");
45
+ const report = {
46
+ dry_run: !apply,
47
+ status: "preview",
48
+ candidates: [],
49
+ removed: [],
50
+ preserved: [],
51
+ issues: [],
52
+ };
53
+ const issue = (target, error) =>
54
+ report.issues.push({
55
+ path: target,
56
+ code: error.code || "UNSAFE_PATH",
57
+ reason: error.message,
58
+ });
59
+ try {
60
+ root = validateRoot(root, packageRoot);
61
+ } catch (error) {
62
+ issue(".", error);
63
+ return { ...report, status: "partial" };
64
+ }
65
+ for (const kind of ["runtimes", "wheels"]) {
66
+ const folder = path.join(root, kind);
67
+ let entries;
68
+ try {
69
+ const stat = fs.lstatSync(folder);
70
+ if (stat.isSymbolicLink() || !stat.isDirectory())
71
+ throw Error("Runtime storage cannot be a link or a file.");
72
+ entries = fs.readdirSync(folder);
73
+ } catch (error) {
74
+ if (error.code !== "ENOENT") issue(kind, error);
75
+ continue;
76
+ }
77
+ for (const name of entries) {
78
+ const relative = path.join(kind, name);
79
+ let target = path.join(folder, name);
80
+ try {
81
+ const stat = fs.lstatSync(target);
82
+ let disposable =
83
+ STAGED.test(name) &&
84
+ (stat.isDirectory() || (kind === "wheels" && stat.isFile()));
85
+ if (!disposable && !stat.isSymbolicLink()) {
86
+ if (kind === "runtimes") {
87
+ const parsed = versionParts(name);
88
+ disposable =
89
+ stat.isDirectory() &&
90
+ parsed &&
91
+ compareVersions(parsed, current) < 0 &&
92
+ ["pyvenv.cfg", "broader-vids-build.json"].some((marker) =>
93
+ fs.existsSync(path.join(target, marker)),
94
+ );
95
+ } else if (stat.isFile()) {
96
+ const parsed = wheelVersion(name);
97
+ disposable = parsed && compareVersions(parsed, current) <= 0;
98
+ } else if (
99
+ stat.isDirectory() &&
100
+ /^[a-f0-9]{64}$/.test(name) &&
101
+ name !== digest
102
+ ) {
103
+ disposable = fs
104
+ .readdirSync(target, { withFileTypes: true })
105
+ .every((entry) => {
106
+ if (!entry.isFile()) return false;
107
+ const parsed = wheelVersion(entry.name);
108
+ return (
109
+ TEMPORARY.test(entry.name) ||
110
+ (parsed && compareVersions(parsed, current) <= 0)
111
+ );
112
+ });
113
+ }
114
+ }
115
+ if (!disposable) {
116
+ report.preserved.push(relative);
117
+ continue;
118
+ }
119
+ report.candidates.push(relative);
120
+ if (!apply) continue;
121
+ // Staging keeps interrupted deletions recognizable on the next cleanup.
122
+ if (!STAGED.test(name)) {
123
+ const staged = path.join(folder, `.obsolete-${randomUUID()}`);
124
+ fs.renameSync(target, staged);
125
+ target = staged;
126
+ }
127
+ if (path.dirname(path.resolve(target)) !== path.resolve(folder))
128
+ throw Error("Runtime cleanup escaped its storage directory.");
129
+ fs.rmSync(target, {
130
+ recursive: true,
131
+ force: false,
132
+ maxRetries: 3,
133
+ retryDelay: 100,
134
+ });
135
+ report.removed.push(relative);
136
+ } catch (error) {
137
+ issue(path.relative(root, target), error);
138
+ }
139
+ }
140
+ }
141
+ report.status = report.issues.length
142
+ ? "partial"
143
+ : apply
144
+ ? "completed"
145
+ : "preview";
146
+ return report;
147
+ }
148
+
149
+ module.exports = { cleanupRuntimeStorage };
@@ -33,6 +33,7 @@ broader-vids/
33
33
  broader-vids.cjs Node setup and process launcher
34
34
  plugin-install.cjs Explicit npm plugin registration through Codex
35
35
  runtime-lock.cjs Shared runtime use and exclusive installation
36
+ runtime-storage.cjs Obsolete runtime and wheel cleanup
36
37
  profile-data.cjs Preview, reset, and complete data removal
37
38
  skills/
38
39
  broader-vids/ Recommendations and feedback instructions
@@ -237,9 +238,19 @@ See [data directory selection](REFERENCE.md#choose-a-data-directory).
237
238
  | `access/bilibili/profile/` | Separate browser profile for Bilibili sign-in |
238
239
  | `runtimes/`, `wheels/` | External engine environments and cached wheels for the Node launcher |
239
240
 
241
+ After successful setup, `bin/runtime-storage.cjs` removes superseded managed runtimes and wheel copies.
242
+ The launcher holds its exclusive installation lease through installation and cleanup.
243
+ It retains the current build, newer versions, unknown content, and all profile records.
244
+ Failed deletion leaves a recognizable staged directory for a later retry.
245
+ The launcher reports cleanup issues without invalidating successful installation.
246
+ The `runtime cleanup` command provides a preview and an explicit apply operation.
247
+
240
248
  Onboarding uses an atomic versioned file protected by a separate configuration lease.
241
249
  It does not change SQLite schema 12 or the learning revision.
242
- Preference transfer excludes this file.
250
+ Preference transfer excludes the onboarding file.
251
+
252
+ Verified Bilibili login status also uses atomic file replacement.
253
+ A failed replacement preserves the previous status file.
243
254
  Preflight counts unique recommendation exposures against current structured ratings.
244
255
  Cleared fields count as incomplete again.
245
256
  Its isolated subprocess checks have a deadline and owned process cleanup.
@@ -327,10 +338,32 @@ Pacing waits count toward an optional saved deadline.
327
338
  Access failures cancel queued retrieval before another YouTube collector starts.
328
339
  The gate preserves request pacing and prevents concurrent reservation of the last request slot.
329
340
  Platform locks prevent conflicting recommendation jobs.
341
+ Separate startup reservations cover CLI readiness checks, round creation, execution, and reporting.
342
+ YouTube and Bilibili requests reserve their platforms in a fixed order.
343
+ The CLI releases each reservation when the request ends.
330
344
  Short database transactions protect user actions and final result writes.
331
345
  Dashboard lookup checks recommendation rounds from newest to oldest and stops at the first usable list.
332
346
  Feedback resolves the displayed video evidence before it acquires its database write transaction.
333
347
  Earlier pending videos retain their saved topic and depth context.
348
+ New rounds freeze interest-mapping policy 2 separately from alignment record format 1.
349
+ Rounds with alignment version 1 retain their original instructions and cache identities.
350
+ Older builds reject new alignment-version-2 rounds during recovery.
351
+ The mapping cache identity includes policy 2 when applicable.
352
+ A policy change can require text-only mapping without repeating visual assessment.
353
+ New rounds freeze ranking policy 4 for short-video and portrait deductions.
354
+ Recovery uses the ranking policy saved in each round.
355
+ Adjustment records use format 2 with portrait deduction and verified dimensions for policy 4.
356
+ New media verification reads decoded FFmpeg output dimensions after automatic rotation.
357
+ Quality-cache results carry saved dimensions into ranking, including after full-media cleanup.
358
+ A retained, verified frame supplies the orientation for older cached dimensions.
359
+ Dashboard and calibration responses resolve creator metadata in batches of at most 500 video IDs.
360
+ Each response builds a local creator-rule index. No profile-wide cache retains these objects.
361
+ Creator and tag responses use separate revisions to reject stale updates.
362
+
363
+ New exploration plans create recent-observation lookup indexes when needed.
364
+ Index creation occurs during writable planning, rather than when a database connection opens.
365
+ These derived indexes preserve schema 12 and all observation history.
366
+ Per-invocation planning limits do not replace the saved round allowance.
334
367
 
335
368
  The engine checks profile, feedback, and queue changes before it saves a final recommendation list.
336
369
  A conflicting change requires another ranking calculation.
@@ -348,13 +381,15 @@ YouTube and Bilibili share the same limit of three retries for recoverable candi
348
381
  The engine saves attempt counts before worker dispatch. Continuation cannot grant an extra attempt.
349
382
  Manual cancellation preserves that allowance.
350
383
  Exhausted candidates become unavailable while other candidates continue.
351
- Caption access challenges stop acquisition for the affected platform.
352
- Already prepared assessments retain their individual timeouts and any explicit shared deadline.
353
- Other platform access challenges and shared model failures stop the applicable workers.
384
+ Caption access challenges pause the affected platform.
385
+ In a combined round, any platform pause cancels unfinished work on both platforms.
386
+ Completed results remain available. Continuation requires a new user request.
354
387
  Reports preserve the first failure separately from later cancellation messages.
355
388
  Preparation checkpoints record transfer progress for interrupted-byte accounting.
356
389
  Unknown usage retains an explicit upper bound.
357
- Paused rounds can retain a provisional preview without creating exposure history.
390
+ Paused assessment and alignment stages can retain a provisional preview without creating exposure history.
391
+ Previews use the saved ranking policy and validated interest mappings.
392
+ Their video-state lookup reads only inspection candidates.
358
393
  Batch heartbeats and live elapsed calculations keep progress reports current.
359
394
 
360
395
  ## Evidence lifetime
package/docs/REFERENCE.md CHANGED
@@ -397,6 +397,7 @@ Topic-planning calls have a 120-second timeout.
397
397
  A timeout automatically uses the next saved planning call, if one remains.
398
398
  This retry retains the selected topics, model, effort, and planning policy.
399
399
  The default planning allowance remains two calls, including optional subdivision.
400
+ The round keeps this allowance when an invocation uses fewer calls.
400
401
  If planning still fails, the recommendation report includes the source failure.
401
402
  A model-capacity error requires service availability. It does not indicate a Bilibili sign-in failure.
402
403
  The engine does not switch to paid API access automatically.
@@ -439,6 +440,14 @@ The report identifies that result as partial.
439
440
  Manual publication uses the same content-alignment step as automatic publication.
440
441
  It retains the round's saved model settings and remaining allowances.
441
442
  If alignment cannot finish, the report shows unresolved mappings and uses exact matches.
443
+ New rounds use subject-matter mapping policy 2. Saved rounds retain their original instructions.
444
+ A central suspected-crime investigation can match crime while its allegations remain unverified.
445
+ Mapping confidence describes relevance, not factual proof. A brief incidental mention need not produce a match.
446
+ This policy does not rewrite published lists, quality evidence, or saved ratings.
447
+
448
+ New ranking policy 4 adds a five-point final-score deduction for verified portrait videos.
449
+ Portrait means height greater than width. Unknown dimensions give zero portrait deduction.
450
+ Open Score details to inspect the dimensions, portrait deduction, short-video deduction, and final score.
442
451
 
443
452
  ## Review and rate videos
444
453
 
@@ -758,6 +767,36 @@ Interrupted copies resume from verified files.
758
767
  The engine removes temporary copies after failure or before the next reuse attempt.
759
768
  Add a frame before the augmented assessment, within that limit.
760
769
 
770
+ ## Remove obsolete runtime files
771
+
772
+ Successful runtime setup removes older managed runtimes and obsolete wheel copies from the selected data directory.
773
+ Cleanup starts only after installation succeeds and the current build receipt is saved.
774
+ A failed installation preserves the previous runtime and wheel copies.
775
+ The current runtime and its wheel remain available.
776
+ A rollback setup also preserves runtimes and wheels from newer versions.
777
+
778
+ To preview cleanup through an installed package, run:
779
+
780
+ ```powershell
781
+ npx --yes broader-vids@latest --data-dir "C:\path\to\broader-vids" runtime cleanup
782
+ ```
783
+
784
+ Use the same data directory that setup reports.
785
+ Add `--apply` to remove the listed candidates.
786
+ The command requires a verified current runtime.
787
+ Stop the dashboard before cleanup. Finish active recommendation and sign-in operations first.
788
+
789
+ The launcher holds the installation lock during cleanup.
790
+ It preserves unknown directories, linked storage roots, profile data, account sessions, recovery backups, and optional models.
791
+ A locked file can defer deletion without failing an otherwise successful setup.
792
+ The setup result reports deferred paths under `storage_cleanup.issues`.
793
+ Repeat cleanup after you resolve the reported file or permission issue.
794
+ Interrupted deletions remain recognizable for the next cleanup attempt.
795
+
796
+ Host plugin caches and shared npm or UV caches have separate owners.
797
+ Broader Vids does not remove them automatically.
798
+ Reset preserves installed tools. Clean removes all managed profile data after confirmation.
799
+
761
800
  ## Clean temporary evidence
762
801
 
763
802
  ```powershell
@@ -769,6 +808,8 @@ The first command previews disposable files.
769
808
  The second command applies the cleanup policy.
770
809
  The policy preserves user originals, active jobs, and user history.
771
810
  Completed assessments normally remove downloaded full videos automatically.
811
+ Cleanup also retries deletion of partial media after a terminal download failure.
812
+ It preserves resumable transfers, captions, frames, and resource accounting.
772
813
 
773
814
  ## Run automated checks
774
815
 
@@ -1372,6 +1413,8 @@ They do not measure isolated model inference time.
1372
1413
  Paused rounds can show a provisional preview in the digest and dashboard.
1373
1414
  The dashboard labels the preview and allows ratings before publication.
1374
1415
  That preview does not publish recommendations or change pending membership.
1416
+ It uses the saved duration deduction and any validated interest mappings.
1417
+ A pause during interest alignment can also retain this preview.
1375
1418
 
1376
1419
  Scorecard schemas and validators use the same topic-label length bound of 120 characters.
1377
1420
  See the [OpenAI Structured Outputs guide](https://developers.openai.com/api/docs/guides/structured-outputs) for supported schema constraints.
package/docs/SCORING.md CHANGED
@@ -27,8 +27,15 @@ The engine requires a verified playable duration greater than sixty seconds and
27
27
  The saved evidence quality must reach 60 points out of 100.
28
28
  For new assessments without a usable transcript, subtract ten points from quality after adding the duration prior, with a floor of zero.
29
29
  The same deduction applies to the learned quality component during ranking.
30
- After the learned final score, subtract 10 × clamp((300 − t) / 240, 0, 1), where t is seconds.
31
- This deduction is 7.5 at two minutes, 5 at three, 2.5 at four, and 0 at five minutes.
30
+ After the learned final score, subtract 20 × clamp((300 − t) / 240, 0, 1), where t is seconds.
31
+ This deduction is 15 at two minutes, 10 at three, 5 at four, and 0 at five minutes.
32
+ New rounds use ranking policy 4, with a maximum short-video deduction of 20 points.
33
+ Saved policy-2 rounds retain the previous ten-point maximum. Policy-1 rounds retain no duration deduction.
34
+ Policy 4 also subtracts five final-score points for portrait videos with verified height greater than width.
35
+ The engine adds this deduction to the short-video deduction after learned scoring.
36
+ A square or landscape video receives zero portrait deduction. Unknown dimensions also give zero deduction.
37
+ Eligibility uses evidence quality before these final-score deductions.
38
+ Policy 3 applies the twenty-point short-video rule.
32
39
  Clamp the adjusted score at zero.
33
40
  The existing evidence quality gate and screening rules do not change.
34
41
  Audio quality is not a criterion.
@@ -168,6 +175,14 @@ It ignores retrieval origin and accepts only medium- or high-confidence matches.
168
175
  Accepted matches supply canonical broad-root features for learned lookup.
169
176
  Assessed topic labels remain unchanged.
170
177
 
178
+ Mapping policy 2 classifies the video's central subject.
179
+ A crime match can include suspected, alleged, or unresolved crimes when investigation is central to the content.
180
+ The match does not confirm an offense or establish guilt.
181
+ A brief poisoning warning in a pet-care video need not match crime.
182
+ Mapping confidence describes topic relevance, not the probability that an allegation is true.
183
+ The rationale must preserve uncertainty about allegations.
184
+ These instructions do not change quality grades or existing user feedback.
185
+
171
186
  The initial interest probability $I_0$ is 0.75 for a domain related to the user's stated interests.
172
187
  It is 0.35 for a known unrelated domain and 0.50 when domains are unknown.
173
188
  Search-domain labels describe retrieval context.
@@ -253,6 +268,10 @@ Historical snapshots can retain an older overall adjustment.
253
268
  Published historical lists retain their saved scores.
254
269
  Later runs use the current model.
255
270
 
271
+ Provisional previews use the round's saved ranking policy and validated interest mappings.
272
+ The short-video deduction applies once when the saved policy requires it.
273
+ Previews create no recommendation history.
274
+
256
275
  ## 6. Structured feedback
257
276
 
258
277
  Topic interest, broad-subject interest, depth fit, and video quality are independent dimensions.
package/docs/WORKFLOW.md CHANGED
@@ -101,7 +101,7 @@ A shared batch deduplicates new topic proposals across platforms at its baseline
101
101
  It does not force the platforms to choose different topics.
102
102
 
103
103
  Legacy rounds retain their saved policies when they resume.
104
- New rounds use rotation version 2 and ranking policy 2.
104
+ New rounds use rotation version 2 and ranking policy 4.
105
105
  The language rule changes search text, not interest labels or hierarchy levels.
106
106
  Existing topic labels and aliases stay stable as the hierarchy grows.
107
107
  The engine converts Traditional Chinese keywords to Simplified Chinese and rejects incompatible scripts before a keyword search.
@@ -340,14 +340,22 @@ This favors distinct videos. Repeats remain possible when all remaining videos o
340
340
  This text-only batch contains at most thirty-five candidates.
341
341
  It matches medium- or high-confidence canonical topics.
342
342
  The alignment uses assessed content, not query origin.
343
- It preserves existing labels, manual narrow-topic feedback, and depth feedback.
343
+ New rounds use mapping policy 2 to classify the central subject.
344
+ A suspected or unresolved crime investigation can match crime without confirming any allegation.
345
+ A brief incidental mention does not establish the video's central subject.
346
+ Confidence describes topic relevance. The rationale retains uncertainty about allegations.
347
+ The alignment preserves existing labels, manual narrow-topic feedback, and depth feedback.
344
348
  An interest edit does not trigger a full reassessment.
345
349
 
346
350
  If alignment fails, the engine retries three times after the initial call.
347
351
  It then uses exact matches and reports the fallback.
348
352
 
349
- The engine applies a duration deduction after the learned final score: 10 × clamp((300 − t) / 240, 0, 1).
350
- The deduction is 7.5 at two minutes, 5 at three, 2.5 at four, and 0 at five minutes.
353
+ The engine applies a duration deduction after the learned final score: 20 × clamp((300 − t) / 240, 0, 1).
354
+ The deduction is 15 at two minutes, 10 at three, 5 at four, and 0 at five minutes.
355
+ New rounds freeze ranking policy 4. Each round stores its policy for continuation.
356
+ Verified portrait dimensions, where height exceeds width, add a five-point final-score deduction.
357
+ The engine uses saved media dimensions and reports both deductions in Score details.
358
+ Missing dimensions give zero portrait deduction.
351
359
  The adjusted score has a floor of zero.
352
360
  The existing evidence quality gate and screening rules remain unchanged.
353
361
  It applies no unrelated-topic quota.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "broader-vids",
3
- "version": "0.1.13",
3
+ "version": "0.1.15",
4
4
  "description": "Codex and experimental Claude Code skills for local YouTube/Bilibili recommendations",
5
5
  "license": "MIT",
6
6
  "engines": {
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "files": [
13
13
  "bin/",
14
- "python/broader_vids-0.1.13-*.whl",
14
+ "python/broader_vids-0.1.15-*.whl",
15
15
  "python/core-requirements.txt",
16
16
  "python/evidence-requirements.txt",
17
17
  "python/asr-requirements.txt",
@@ -27,7 +27,7 @@
27
27
  ".claude-plugin/marketplace.json"
28
28
  ],
29
29
  "scripts": {
30
- "test": "node --test tests/launcher.test.cjs tests/profile-data.test.cjs",
30
+ "test": "node --test tests/launcher.test.cjs tests/profile-data.test.cjs tests/runtime-storage.test.cjs",
31
31
  "check:web": "prettier --check src/broader_vids/web/static",
32
32
  "release:prepare": "uv run --no-sync scripts/release.py prepare"
33
33
  },
@@ -48,6 +48,6 @@
48
48
  "tag": "latest"
49
49
  },
50
50
  "broaderVidsRelease": {
51
- "sourceCommit": "b44359de0922eeb8958c4b061f18d415b9e808c4"
51
+ "sourceCommit": "3c8ef20b931af015dfa5f788c00e114d3e3c8b31"
52
52
  }
53
53
  }
package/plugin.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
3
3
  "name": "broader-vids",
4
- "version": "0.1.13",
4
+ "version": "0.1.15",
5
5
  "description": "Curated YouTube and Bilibili recommendations with bounded quality evidence and local watched/feedback state.",
6
6
  "license": "MIT",
7
7
  "extensions": {
@@ -98,6 +98,9 @@ Do not repeat the introduction for a completed profile during routine checks.
98
98
  Check Node.js 20 or later, UV, and Codex CLI availability.
99
99
  Report exact repair steps for missing system tools.
100
100
  Run `setup --evidence` to install the external runtime and evidence dependencies when needed.
101
+ Successful setup removes obsolete managed runtimes and wheel copies under the installation lock.
102
+ If `storage_cleanup.issues` is nonempty, report the deferred paths and reasons.
103
+ Keep setup successful when only obsolete-file deletion fails. Never remove active files or shared caches manually.
101
104
  Setup creates the runtime directory before platform or interest configuration.
102
105
  On Windows, it uses UV to select Python and Python's standard module to create the virtual environment.
103
106
  If copied Windows launchers cannot initialize, setup tries an executable-link environment in the same directory once.
@@ -7,7 +7,7 @@ This guide is for Claude Code. Use it instead of the Codex-specific instructions
7
7
  - Keep the user's selected profile stable. Run `data show` and pass its absolute path with `--data-dir` on every engine command.
8
8
  - Resolve the plugin root from the installed skill path. Run the Node launcher from that root.
9
9
  - Put `--host claude` before each engine subcommand. For example, run `node <plugin-root>/bin/broader-vids.cjs --host claude recommend`.
10
- - The Node launcher handles `data show`, `data use`, `data reset`, `reset`, and `clean`. It consumes `--host` for these commands.
10
+ - The Node launcher handles `data show`, `data use`, `data reset`, `runtime cleanup`, `reset`, and `clean`. It consumes `--host` for these commands.
11
11
  - Run `setup --host claude --evidence` only to install or repair the runtime. The Node setup command does not complete onboarding.
12
12
  - Use Claude's active model and effort only when Claude exposes both values in the current session. Otherwise ask the user once for both values and wait. Never infer either value from Codex, an old setting, or a default.
13
13
  - Pass the verified values with `--model MODEL --effort EFFORT` for setup completion and recommendation commands. The engine can also read `BROADER_VIDS_CLAUDE_MODEL` and `BROADER_VIDS_CLAUDE_EFFORT` when the user explicitly sets both values.
@@ -19,6 +19,8 @@ Use the setup skill's workflow as described here, with the engine's returned que
19
19
 
20
20
  Check Node.js, UV, Claude CLI, FFmpeg, yt-dlp, Pillow, and the selected platform access. Use the Node launcher setup command to install the runtime. Use `doctor` for diagnostics. Preserve a working profile during repair.
21
21
 
22
+ Successful setup removes obsolete managed runtimes and wheel copies. Report any `storage_cleanup.issues` without treating cleanup alone as an installation failure.
23
+
22
24
  Use `onboarding questions`, `onboarding status`, `profile show`, and `onboarding configure` as required by the engine. Preview starter preferences or imports before applying them. Open Bilibili sign-in only when needed. Wait for the user to report sign-in completion, then check access.
23
25
 
24
26
  Complete onboarding with `onboarding complete --format chat --model MODEL --effort EFFORT`. Include the exact active Claude model and effort. If the engine reports a required failure, repair it and repeat completion. Do not report success while an answer or required check is pending.