refactor(core): CORE-18 type builtins and own prompt lifetimes

This commit is contained in:
Harvey Zhao committed 2026-09-11 12:31:01 +08:00
1 parent a842058136
commit 98a1800032
55 files changed
+26511 -650

No files matched your search

+141
View File
@@ -0,0 +1,141 @@
{
"task": "CORE-18",
"date": "2026-09-11",
"status": "partial",
"parentCommit": "a842058136997b94db93155dc6db06eab72604bb",
"node": "v24.21.0",
"scope": "Adds autoPlayback, lock and miniProgressBar. Info/loading/mask and installed-package exit remain outstanding.",
"fingerprints": {
"packages/artplayer/src/notice.ts": "cd13f8cb7147088a02ee4583d4edc2120848a039d07878dd996dcb54781db66e",
"packages/artplayer/src/input/long-press.ts": "110cf16cf9dae845597377ebbc43249e103cbc0ece56f89e44ec6ecc7f3819b0",
"packages/artplayer/src/plugins/fastForward.ts": "74c03e3fcfe2f87dcb0ef1a5da5410cb96322509fd07e32930128584c54f62b5",
"packages/artplayer/src/plugins/builtins.ts": "1f45028b00dd82e622cc6387b1ee73e39e6ab85ca0d15117ace11b5f02dee37f",
"packages/artplayer/src/plugins/autoPlayback.ts": "e349010813bbcd53503383b707c5f6e6e60d8ade6442d020fe6ba07a128c3122",
"packages/artplayer/src/plugins/auto-playback/records.ts": "731df519f264c602e5128c66f943b40e8645c403dc880652dea8f171574adc78",
"packages/artplayer/src/plugins/auto-playback/prompt.ts": "cdcfd8542d49c2be61a31c74f2ff5ff0cdd1f829858b9bf5b497f2dde85c2002",
"packages/artplayer/src/plugins/lock.ts": "9a08cec3a92006be8a9d2dba8d850bc4f8f38d586a50de86d725d0d8929130fd",
"packages/artplayer/src/plugins/miniProgressBar.ts": "21b4850fcaf6b0e82d5e62ca7aca60c179c578f7ff6d5606e6025628ff4b1cc7",
"test/auto-playback.test.js": "2d61bffa99bf7acab58f263fb60cb50fef8b1d450d3ea22a4f1eef8066b162a0",
"test/builtin-layers.test.js": "0ff767aadbfc7c142dc03e64891dd000b651e812509488f474dcf01ca5d0df05",
"test/types/auto-playback.ts": "3af10afc38be6eb0d6a8c9f82f76b6b046ab0b0439a22c1318fab5557a2157e4",
"test/types/builtin-layers.ts": "4bf0c661011e15bb3f620e0e4bf7b51ca381c420dda261fcd59988cafd2e53c8",
"test/browser/auto-playback.spec.js": "39d9258fb808ef42dfbd38836572335a5c759d99cc1b0ecc1b635a2d7cb3b0fe",
"test/browser/builtin-layers.spec.js": "4efa0ebe413cbf0ca9b06074ce73ead337136bc477c4f8fda6665be0504a31eb",
"package.json": "b51633ce5b1d55b8b9b91a2169a627c27f59c1cee0b00225b53a736802d35cc3"
},
"ci": {
"tests": 359,
"unit": 330,
"engineering": 4,
"baseline": 25,
"productionTs": 196,
"publicTypesUnchanged": true,
"log": "refactor/.cache/core18-auto-layers-ci-final.log",
"sha256": "9b6ab1f59cdba15a19833c001fd9eb292cd5160620aa06a437e7037d2944f42a"
},
"browser": {
"tests": 90,
"retries": 0,
"skipped": 0,
"unexpectedPageErrors": 0,
"knownRejections": [
{
"browser": "chromium",
"core": "published",
"rejections": [
{
"name": "Error",
"message": "controlled play rejection",
"same": true
},
{
"name": "Error",
"message": "controlled play rejection",
"same": true
}
]
},
{
"browser": "chromium",
"core": "candidate",
"rejections": []
},
{
"browser": "firefox",
"core": "published",
"rejections": [
{
"name": "Error",
"message": "controlled play rejection",
"same": true
},
{
"name": "Error",
"message": "controlled play rejection",
"same": true
}
]
},
{
"browser": "firefox",
"core": "candidate",
"rejections": []
},
{
"browser": "webkit",
"core": "published",
"rejections": [
{
"name": "Error",
"message": "controlled play rejection",
"same": true
},
{
"name": "Error",
"message": "controlled play rejection",
"same": true
}
]
},
{
"browser": "webkit",
"core": "candidate",
"rejections": []
}
],
"report": "refactor/.cache/core18-auto-layers-browser-final.json",
"sha256": "21c6ffce5aba6519f8dfd88b9678bf06db4d1880e12139887a99e13df8d82c88",
"browsers": {
"chromium": "153.0.8010.12",
"firefox": "155.0",
"webkit": "26.6"
},
"candidate": {
"source": {
"kind": "workspace-build",
"entry": "packages\\artplayer\\src\\index.js"
},
"sha256": "6dc05603a158ec31a52629f7a0c370b8befbe82258aad26c90f8cd880169dd98",
"bytes": 316545
},
"limitation": "Workspace-built UMD, not installed-package or legacy acceptance. Simulated mobile conditions do not certify physical devices."
},
"initialReproduction": {
"autoPlayback": {
"passed": 2,
"failed": 6
},
"builtinLayers": {
"passed": 1,
"failed": 4
},
"node": "24.21.0"
},
"remaining": [
"info",
"loading",
"mask",
"all prompt integration",
"final build/i18n/package and installed browser matrices"
]
}
@@ -0,0 +1,77 @@
{
"task": "CORE-18",
"date": "2026-09-11",
"status": "partial",
"parentCommit": "a842058136997b94db93155dc6db06eab72604bb",
"node": "v24.21.0",
"scope": "Notice and fastForward only; other builtins/prompts and installed-package exit remain outstanding.",
"fingerprints": {
"packages/artplayer/src/notice.ts": "cd13f8cb7147088a02ee4583d4edc2120848a039d07878dd996dcb54781db66e",
"packages/artplayer/src/input/long-press.ts": "110cf16cf9dae845597377ebbc43249e103cbc0ece56f89e44ec6ecc7f3819b0",
"packages/artplayer/src/plugins/fastForward.ts": "74c03e3fcfe2f87dcb0ef1a5da5410cb96322509fd07e32930128584c54f62b5",
"packages/artplayer/src/plugins/builtins.ts": "b3848611b329a059df684e1f3d515a98e6f051aef9d3a7e0408693794c65c6ab",
"test/notice.test.js": "8d454d731cde5bf5d47f6573503fa7782de68b3c1b09ef4298a5fa1bd4b60855",
"test/fast-forward.test.js": "81172dc0fadbf62cf88904fb7a54d131f848602a0fdfe3be93a37fcf4ca7b389",
"test/types/notice.ts": "f896ea15c1dc1f71e7018e3a00e7276f415b9ff58fb6058d8767cac9438a047a",
"test/types/fast-forward.ts": "bd724069d82a78b8f9264f73ac3d7862f27b2bb161936a49763812e5d5966246",
"test/browser/notice.spec.js": "56b2d2977e19fd798f3867e9819e631bcb99e51496387a9c67791b60a41048a6",
"test/browser/fast-forward.spec.js": "5b884fae1cd48cb592c2004a8149890aed4741ac0a92b1e415e47b94411bb368",
"test/browser/event-scheduling.spec.js": "4ebd5dab23ca8e49580bd1dc3234e612cbae36b735c7c9401d168059eae11c5c",
"package.json": "6c772a8d39b30444c27bd4d12896050052392f65d99c7e41665cae00ab5adb6a"
},
"ci": {
"tests": 340,
"unit": 311,
"engineering": 4,
"baseline": 25,
"productionTs": 191,
"publicTypesUnchanged": true,
"log": "refactor/.cache/core18-partial-ci.log",
"sha256": "b9384ab43b6dd4bedf2cf14d738b190b84c709e1534c9260c9beaf2576a07d20"
},
"browser": {
"tests": 96,
"retries": 0,
"skipped": 0,
"pageErrors": 0,
"report": "refactor/.cache/core18-prompts-input-browser.json",
"sha256": "f8557584b8f9b21a714c3a7e0e5d809bef0d88614f84ee5f539060c053db58e4",
"browsers": {
"chromium": "153.0.8010.12",
"firefox": "155.0",
"webkit": "26.6"
},
"candidate": {
"source": {
"kind": "workspace-build",
"entry": "packages\\artplayer\\src\\index.js"
},
"sha256": "ad326102f632ec856d8ed9a14f522a6b32c058c56ed82fe3e6204e44abd21376",
"bytes": 313815
},
"limitation": "Workspace-built UMD, not installed-package/legacy acceptance. Controlled touch events do not certify physical devices."
},
"initialReproduction": {
"notice": {
"passed": 3,
"failed": 3,
"node": "25.2.1"
},
"fastForward": {
"passed": 3,
"failed": 8,
"node": "24.21.0"
},
"source": "Before respective migration in this task; see ignored raw logs and committed regression tests."
},
"remaining": [
"autoPlayback",
"lock",
"miniProgressBar",
"info",
"loading",
"mask",
"autoOrientation/builtin integration",
"final build/i18n/package and installed browser matrices"
]
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,70 @@
# CORE-18 内置插件与提示模块
状态:完成;父提交 `a8420581`。以下分批过程保留历史结果,最终验收见末节。
## 第一批:notice 与 fastForward
- `src/notice.ts` 使用最小宿主类型,公开字段仍只有 art/timer,原型仍为 constructor/destroy/show。内部请求代次放在 WeakMap;取消、重入与销毁不再让旧提示覆盖新提示。功能规模较小,状态与 DOM 操作保留在一个模块。
- `src/plugins/fastForward.ts` 负责插件接口、原生触摸和实例事件订阅;`src/input/long-press.ts` 负责按压状态、延时、原播放速率和资源释放。每次按压归属于当前 source scope,重复开始、取消、锁定、暂停、切源、销毁都会释放旧工作。
- 保留 notice 的 Error 消息 trim、字符串空白、false/空字符串仅隐藏而保留旧文本/待执行清空计时器,以及显式 notice.destroy 仅取消计时器、存活实例仍可复用的行为。
- 保留 fastForward 的名称、只读 state、默认安装条件、单指/播放/未锁定条件、实时 FAST_FORWARD_TIME/VALUE 以及松手恢复原速率。新增 touchcancel 等清理是生命周期缺陷修正。
- notice 的真实 getter 为 boolean,历史公开声明却是 string/Error/false。本批源类型与正反例明确实际行为,旧声明保持;BASE-TYPE-07 继续开放,由 CORE-21 提供兼容的精确公共视图,不能简单用 boolean 替换旧消费者读类型。
- builtins 的 fastForward 类型断言与已有 autoOrientation 相同,只位于尚未迁移的构造器到最小宿主的接合处;CORE-20 收敛入口时需核对,不向内部传播 any。
## 已复现与测试过程
notice 初次六项 Node 复现为三通过、三失败,显示写入中销毁后仍创建 timer、过期回调覆盖新消息、到期清空中重入的新消息被隐藏。初次复现使用宿主 Node 25.2.1;后续执行切回固定 Node 24.21.0。真实旧发布包在 Chromium/Firefox/WebKit 均复现 DOM 写入中的销毁和重入缺陷;候选通过。
fastForward 初次十一项固定 Node 复现为三通过、八失败,包含重复定时器、缺少取消与生命周期防护。后续扩展源切换、回调时状态变化及恢复速率时重入的回归。
notice 三浏览器专项 33 项通过,涵盖旧包/候选的接口、DOM、自然提示到期与真实视频播放,及候选过期回调防护。fastForward 第一轮 27 项中六项失败:测试误把切源/原生 load 后的默认速率重置当成必须保持 1.5。检查实际 reset() 调用 video.load(),补入旧包/候选原生换源重置对照;检查实际恢复 setter 收到 1.5,而随后原生换源保持默认 1。待触发按压销毁后则明确断言 resetRate=1 且迟到回调不再修改它。修正后专项 33 项通过,没有增加等待时间或重试。
测试文件:`test/notice.test.js`、`test/fast-forward.test.js`,对应 `test/types/` 正反例和 `test/browser/notice.spec.js`、`test/browser/fast-forward.spec.js`。模拟触摸使用真实 DOM 事件与实际视频,物理设备仍由 REL-03/REVIEW-02 验收。
第一批最终源码已通过 `yarn ci:check`:311 项单元、4 项工程、25 项基线,共 340 项;191 个生产 TS 文件(核心 186、chapter 5)及五组新旧消费者模式通过。notice/fastForward/event-scheduling 三组源码构建的浏览器专项合跑 96 项通过,Chromium 153.0.8010.12、Firefox 155.0、WebKit 26.6,无重试、跳过和未处理页面错误。精确指纹及日志信息见 [部分阶段证据](../baselines/builtin-prompts-partial.json)。本结果明确不代表安装包或 legacy 出口验收,后续源码变化须重新验证对应范围。
## 剩余与交接
所有目标模块已迁移,autoOrientation 沿用 CORE-16 实现并通过组合矩阵。完整任务出口已通过;BASE-TYPE-07 的兼容精确公共视图仍交 CORE-21,移动真机与多轮发布复盘仍由 REL-03/REVIEW-02 验收。下一任务 CORE-19。
没有增加依赖,使用既有 Yarn/Node/TypeScript/Playwright 工具。最终生产产物已由构建生成并核对安装包;本任务按独立本地 commit 交付,不推送、不发布。分批阶段的 doing 状态属于历史记录。
回退以父提交为比较基准,只撤销本任务源文件、测试、任务/架构/风险文档与最终生成产物,保留此前 CORE-17 交付。
## 第二批:autoPlayback
`plugins/autoPlayback.ts` 保留 name/times/clear/delete 结果;`auto-playback/records.ts` 负责 playing 时写入 times,`auto-playback/prompt.ts` 负责提示 DOM、ready/restart、点击和首个 timeupdate 后的超时。存储仍使用 artplayer_settings 的 times 成员,优先 option.id、回退 option.url;严格保留旧版的 keys.length > AUTO_PLAYBACK_MAX 时仅删除最早一项,不能在 TS 化时悄悄改为固定最大长度。
记录订阅属于实例;移除提示层仍继续记忆播放位置。每一轮提示属于图层且连接当前 source scope;重启、切源、图层移除、实例销毁均取消旧点击/首帧订阅/定时器。点击顺序仍为 seek、play、隐藏 poster/提示;用户回调若切源或销毁,则停止失效的后续操作。提示 HTML、类名、翻译、阈值和超时读取方式保持。新增内部类型,没有修改现有公共声明或增加依赖。
迁移前固定 Node 的八项复现为二通过、六失败;迁移后扩展了旧 timeout、seek 中 restart、翻译/存储回调销毁、NaN 阈值和内部播放拒绝。首轮三浏览器 39 项通过,明确证实旧包连续 restart 后一次点击执行三次 seek/play,而候选只使用最新保存时间响应一次;也覆盖真正的 seek/play/持续记录、本地存储信封、清理和销毁重入。新增关闭按钮与播放拒绝兼容用例后继续专项验证,完整结果见对应阶段证据,不覆盖或重写第一批的历史指纹。
## 第三批:lock / miniProgressBar
两个简单内置插件分别保留单文件并迁移 TS,使用最小宿主类型。lock 保留 name/state 结果、class → isLock → lock 事件顺序和重复相同赋值仍通知的行为。图层移除时只取消图标订阅,存活实例的插件 state 仍可读写;销毁后则忽略旧引用上的 setter/click。miniProgressBar 仍根据 control 事件切换原类名,仅返回 name,订阅归实例所有。没有为了拆文件创建多层转发。
迁移前五项 Node 复现为一通过、四失败;迁移后五项通过。浏览器增加旧包/候选、桌面/模拟移动、直播/点播的内置插件启用矩阵,以及 lock 重复事件、图标、图层移除、mini 控件同步和销毁后引用的验证。这里的移动条件用 userAgent 固定,只证明现有分支及 DOM 行为,不证明真实移动设备能力。
第二/三批第一次合跑 90 项有 15 项失败:12 项图标测试错误读取 art.icons getter 新建的节点,改为从实际挂载的 lock 图层取节点;其余 3 项准确暴露旧发布包在重复注册的续播点击中产生两个未处理播放拒绝。旧包专用捕获器只匹配本测试的 Error 对象,断言每个浏览器恰好两次并附带 known-resume-rejections 证据,不忽略其他异常;候选不安装捕获器且要求零异常。当前分支在本任务前已使用 silencePromise,这部分是保留既有修复,不能宣称是本批新修正的生产缺陷。
修正测试后合跑 90 项通过,无重试或跳过,候选与非预期页面错误为零。最终 `yarn ci:check` 通过 330 项单元、4 项工程、25 项基线,共 359 项;196 个生产 TS 文件(核心 191、chapter 5)及五组消费者类型检查通过。新增自动续播单元 14 项、图层单元 5 项已加入 test:unit。嵌套的浏览器/类型文件另行 lint 通过;精确源码、报告和日志指纹见 [续播与内置图层部分证据](../baselines/auto-layers-partial.json)。尚未生成本任务最终产物或执行安装包出口,CORE-18 继续 doing。
## 第四批:info / loading / mask
info.ts 保留 Component 字段与 init 原型方法;info/poll.ts 管理动态媒体字段、原 DOM 文本转换、关闭监听与循环。每次 init 先释放上一轮,WeakMap 保存内部代次;支持手动 destroy 事件停止轮询、存活时 init 重启,拒绝实际销毁后的写入。固定数值保留 toFixed(2),空值、布尔、对象、NaN/Infinity 与 Symbol 错误用真实 DOM 对照验证。
loading.ts 仍只负责 loading 图标与继承的组件行为。mask.ts 保留原生点击内部播放处理和 state/error 图标。最初尝试在根 scope 清理时切换 mask,随后新增的观察顺序测试揭示它会让早于 mask 注册的 destroy 监听器看到提前变化的图标;已修正。lifecycle/instance.ts 新增内部 finalization scope:普通销毁在原 destroy 事件之后释放,直接根 scope.dispose 则在根资源清理完毕后释放。mask 正常仍由原注册位置的事件回调显示终止图标,最终阶段只补偿未执行/失败的回调并取消订阅,避免改变旧观察顺序或重复正常 DOM 写入。较早的用户 destroy 回调抛错时,清理完成后仍抛出原错误。
迁移前八项专项为二通过、六失败;扩展后包含十二项单元与生命周期关联测试。初始 mask 顺序修复前的十二项中一项失败,修复后联合 instance-lifecycle/resource-scope 共二十六项通过。完整源码与安装包出口结果在任务收尾时追加。
info/mask 源码浏览器专项 45 项通过;其中新增观察顺序用例最初遗漏 option.layers 的必需 html 字段,导致九项初始化失败,补齐合法输入后通过,没有改变播放器验证规则。最终兼容复核还发现 notice setter 不应通过可被消费者覆盖的 public destroy 方法取消旧 timer;七项 notice 单元中新增覆盖测试曾失败,改用内部 cancelNotice 后修正,并加入旧包/候选的真实浏览器回归。该修正发生在首轮打包之后,先前 run-7Jpsrp 不作为最终候选,必须重新打包验证。
## 最终任务验收
固定 Node 24.21.0 / Yarn 1.22.22。完整 CI 372 项通过(343 单元、4 工程、25 基线),200 个生产 TS 文件(核心 195、chapter 5)及五组新旧类型消费模式通过。实际 tarball 安装为 run-4YqfAy,27 项运行时与五组类型零诊断;工作区源文件、包内全部文件、UMD/legacy/ESM、docs 副本、22 个语言产物与许可指纹一致。
安装的 UMD 和 legacy 各完整执行 1350 项三浏览器测试,各含 207 项本任务专项与 300 项显示模式回归,无重试或跳过。Chromium 153.0.8010.12、Firefox 155.0、WebKit 26.6;原生桌面 fullscreen 与可用引擎 PiP 播放继续验证。精确匹配并记录旧包的已知续播播放拒绝;候选和非预期页面错误为零。完整报告、源码与测试指纹见 [最终证据](../baselines/builtins-prompts-validation.json)。
公开声明未改;类型冲突仍按兼容策略交 CORE-21,不能把旧消息读类型改成 boolean 并宣称无影响。关闭 BASE-LIFE-31/32/33/34/35;BASE-PERF-01 已有修复通过相关全量回归。无新增依赖或 lockfile 变化;新增五组单元文件共 51 项并接入既有命令,浏览器/类型与包内架构同步维护。
当前 214 项:54 完成、160 待办,下一项 CORE-19。本任务独立本地提交,不推送、不发布,也不代表完整重构或发布复盘已完成。
+3 -2
View File
@@ -4,7 +4,7 @@
基线:`40fcda6a37d0049d42e49c1e64e70d4fd9ba5f7f`。总任务 214 项,范围 22 个包及工作区/示例。
状态:todo 161 / doing 0 / blocked 0 / done 53 / deferred 0。风险 L/M/H 表示兼容风险,不表示工期。
状态:todo 160 / doing 0 / blocked 0 / done 54 / deferred 0。风险 L/M/H 表示兼容风险,不表示工期。
前置依赖是启动条件;验收是完成条件。任务可以继续拆分,但不能复用或悄悄删除旧 ID。
@@ -121,7 +121,7 @@
| CORE-15 | artplayer<br>迁移字幕获取、解析和渲染 | CORE-11, CORE-13 | subtitle 请求/track/DOM/URL 生命周期与类型 | 过期结果、偏移、cue 数组、原生全屏及错误路径通过;接续 BASE-TYPE-07 的真实 cue 数组与旧隐式 scalar 回调声明兼容 | H | done |
| CORE-16 | artplayer<br>迁移全屏、PiP、mini 与尺寸模式 | CORE-11, CORE-12 | 显示模式服务和原公开属性门面 | 模式互斥/恢复位置、手势权限、移动方向和退出失败通过 | H | done |
| CORE-17 | artplayer<br>迁移键盘、手势、焦点和全局事件 | CORE-13, CORE-16 | events/hotkey 的明确 document 与资源归属 | 跨 document 重绑、触摸/键盘、快捷键及销毁无重复响应;修复 BASE-PERF-01 pending resize debounce 销毁后执行,并验证正常 resize 不变 | H | done |
| CORE-18 | artplayer<br>迁移内置插件和提示模块 | CORE-14, CORE-16, CORE-17 | autoPlayback/autoOrientation/fastForward/lock/miniProgressBar 及 info/notice/loading/mask | 默认启用条件、storage 格式、定时器/动画清理通过;结合 BASE-PERF-01 防止销毁后重新安排 notice timer;接续 BASE-TYPE-07 的 notice.show boolean getter 与历史读类型冲突 | M | todo |
| CORE-18 | artplayer<br>迁移内置插件和提示模块 | CORE-14, CORE-16, CORE-17 | autoPlayback/autoOrientation/fastForward/lock/miniProgressBar 及 info/notice/loading/mask | 默认启用条件、storage 格式、定时器/动画清理通过;结合 BASE-PERF-01 防止销毁后重新安排 notice timer;接续 BASE-TYPE-07 的 notice.show boolean getter 与历史读类型冲突 | M | done |
| CORE-19 | artplayer<br>整理进度、质量、缩略图和截图 | CORE-10, CORE-13, CORE-16 | 相关 player/control 功能与纯计算分离 | 截图跨域失败、缩略图布局、quality/进度边界保持 | M | todo |
| CORE-20 | artplayer<br>收敛核心入口与依赖方向 | CORE-14, CORE-15, CORE-18, CORE-19 | Artplayer 门面、初始化依赖与最终目录 | 所有核心自有源码迁移,公开描述符/静态接口/事件差分通过 | H | todo |
| CORE-21 | artplayer<br>生成核心声明并校验包内容 | CORE-20, ENG-07 | 由 TS 生成的既有入口声明与三种发布产物 | 内部类型不泄漏,旧 JS/TS 消费者与 i18n 通过;逐项完成 CORE-07 留下的 BASE-TYPE-04/05/07 声明方案,旧合法消费者与实际返回分别留证;不能以虚假的交叉返回类型或改变运行时来掩盖冲突,未决项阻止核心声明出口;处理 CORE-10 / BASE-TYPE-08 的 setter-only 属性虚构 getter 声明,并复核 PlaybackControls 精确视图与旧 toggle 声明共存策略 | H | todo |
@@ -452,6 +452,7 @@
- CORE-15: [记录](changes/2026-09-11-CORE-15-subtitle.md) [记录](baselines/subtitle-validation.json)
- CORE-16: [记录](changes/2026-09-11-CORE-16-display.md) [记录](baselines/display-validation.json)
- CORE-17: [记录](changes/2026-09-11-CORE-17-input.md) [记录](baselines/input-validation.json)
- CORE-18: [记录](changes/2026-09-11-CORE-18-builtins-prompts.md) [记录](baselines/builtins-prompts-validation.json)
- PKG-CHAPTER-01: [记录](changes/2026-09-10-PKG-CHAPTER-01-contract.md) [记录](baselines/chapter-contract.md)
- PKG-CHAPTER-02: [记录](changes/2026-09-10-PKG-CHAPTER-02-tests.md) [记录](baselines/chapter-validation.json)
- PKG-CHAPTER-03: [记录](changes/2026-09-10-PKG-CHAPTER-03-typescript-modules.md) [记录](baselines/chapter-migration-validation.json)
+8
View File
@@ -1,5 +1,13 @@
# 进度与证据
## 当前实施:CORE-18 内置插件与提示模块完成
notice、autoPlayback、fastForward、lock、miniProgressBar、info、loading、mask 已迁移 TS,拆清记录、提示、长按与轮询归属;autoOrientation 组合复验通过。修复重复响应、陈旧回调和清理,同时保持公开结果、存储格式、DOM 与 destroy 观察顺序。
CI 372 项、200 个生产 TS 严格检查、实际 tarball 27 项运行时与五组类型通过;安装 UMD/legacy 各 1350 项三浏览器全量通过,各含 207 项本任务专项。源码、包文件、三个格式、语言、文档副本和许可指纹一致。见 [交付记录](changes/2026-09-11-CORE-18-builtins-prompts.md) 和 [最终证据](baselines/builtins-prompts-validation.json)。
关闭五项生命周期差异;BASE-TYPE-07 精确公共视图继续交 CORE-21,物理设备与多轮复盘仍保留发布门槛。当前 214 项:54 完成、160 待办;下一项 CORE-19。本任务独立本地提交,无推送或发布。
## 当前实施:CORE-17 输入、全局事件与调度完成
Hotkey 与 Events 全部初始化器已迁移 TS,拆清焦点、监听器、全局重绑、手势和调度;正常旧 API、回调/事件和交互保持,新增 document:touchcancel。
+5
View File
@@ -95,3 +95,8 @@
| BASE-LIFE-29 | resolved / 已复现 | Scroll throttle reset timers remain pending after player destruction | CORE-17 |
| BASE-LIFE-30 | resolved / 已复现 | Screen orientation changes are ignored when onchange is initially null | CORE-17 |
| BASE-DOM-18 | resolved / 已复现 | View visibility uses the original global viewport after container adoption into an iframe | CORE-17 |
| BASE-LIFE-31 | resolved / 已复现 | Notice reentrant writes can schedule after destruction or erase a newer message | CORE-18 |
| BASE-LIFE-32 | resolved / 已复现 | Fast-forward repeated starts and missing cancellation retain timers or accelerated playback | CORE-18 |
| BASE-LIFE-33 | resolved / 已复现 | Auto-playback restarts retain obsolete resume clicks, subscriptions and timers | CORE-18 |
| BASE-LIFE-34 | resolved / 已复现 | Lock icon and miniature progress subscriptions outlive their UI or player | CORE-18 |
| BASE-LIFE-35 | resolved / 已复现 | Info repeated initialization retains polling and close callbacks; destroyed reads continue writing | CORE-18 |
+121 -1
View File
@@ -900,7 +900,7 @@
"compatibleResolution": "Keep legacy consumers; add explicit cue-array listener overloads, type internal implementations accurately, and resolve remaining generated/public facade contracts at CORE-21 without false intersections.",
"closureCriteria": "Actual setting/null/void and notice boolean returns, cue array callbacks and old legal type consumers all have an explicit compatible declaration strategy and package tests.",
"scopeNote": "CORE-07 provides runtime evidence and explicit cue-array overloads; old inferred scalar event callbacks and return signatures are not claimed corrected.",
"workspaceState": "CORE-14 source models item/null/void setting returns; CORE-15 source models cue arrays and string/null/undefined subtitle results. Historical public consumers and explicit array listener overloads still compile; scalar inference and public return facade coordination remain CORE-18/21."
"workspaceState": "CORE-14 source models item/null/void setting returns; CORE-15 source models cue arrays and string/null/undefined subtitle results. Historical public consumers and explicit array listener overloads still compile; scalar inference and public return facade coordination remain CORE-18/21. CORE-18 notice.ts now models a boolean getter and string/Error/false writes; source and retained public consumer fixtures are in test/types/notice.ts. Public precise-view coordination remains CORE-21."
},
{
"id": "BASE-TYPE-08",
@@ -1878,6 +1878,126 @@
"refactor/baselines/input-validation.json"
],
"resolutionRationale": "View calculations use the current owner viewport after iframe adoption and preserve the original edge/gap boundaries. Final installed UMD/legacy each pass 1119 full-suite plus 24 supplemental cases on identical artifacts, and exact-package consumers pass. Controlled touch/IME/orientation paths do not waive physical-device release gates."
},
{
"id": "BASE-LIFE-31",
"title": "Notice reentrant writes can schedule after destruction or erase a newer message",
"confirmation": "reproduced",
"status": "resolved",
"owners": [
"CORE-18"
],
"evidence": [
"test/notice.test.js",
"test/browser/notice.spec.js",
"refactor/changes/2026-09-11-CORE-18-builtins-prompts.md"
],
"compatibleResolution": "Preserve public fields and normal hide/expiry behavior; own timer generations and reject stale writes.",
"closureCriteria": "Installed UMD and legacy verify normal notices, reentrant writes and destruction without late timers or stale DOM effects.",
"workspaceState": "Final CORE-18 source, production outputs and installed UMD/legacy artifacts match; ownership and compatible behavior are verified.",
"resolutionEvidence": [
"refactor/changes/2026-09-11-CORE-18-builtins-prompts.md",
"refactor/baselines/builtins-prompts-validation.json",
"test/notice.test.js",
"test/browser/notice.spec.js"
],
"resolutionRationale": "Owned prompt/input resources prevent stale callbacks and survive reentry/removal/destruction; normal public API and event ordering are retained. Final installed UMD and legacy each pass 1350 browser cases, including 207 CORE-18 cases, plus actual tarball runtime/type consumers. Physical mobile and release-review gates remain outstanding for the overall refactor."
},
{
"id": "BASE-LIFE-32",
"title": "Fast-forward repeated starts and missing cancellation retain timers or accelerated playback",
"confirmation": "reproduced",
"status": "resolved",
"owners": [
"CORE-18"
],
"evidence": [
"test/fast-forward.test.js",
"test/browser/fast-forward.spec.js",
"refactor/changes/2026-09-11-CORE-18-builtins-prompts.md"
],
"compatibleResolution": "Own a single press in the current source; restore its prior rate and clean subscriptions while preserving native load reset behavior.",
"closureCriteria": "Installed UMD and legacy verify touch and cancellation, pause/lock/source/destroy and rate restoration; physical touch limitations remain documented.",
"workspaceState": "Final CORE-18 source, production outputs and installed UMD/legacy artifacts match; ownership and compatible behavior are verified.",
"resolutionEvidence": [
"refactor/changes/2026-09-11-CORE-18-builtins-prompts.md",
"refactor/baselines/builtins-prompts-validation.json",
"test/fast-forward.test.js",
"test/browser/fast-forward.spec.js"
],
"resolutionRationale": "Owned prompt/input resources prevent stale callbacks and survive reentry/removal/destruction; normal public API and event ordering are retained. Final installed UMD and legacy each pass 1350 browser cases, including 207 CORE-18 cases, plus actual tarball runtime/type consumers. Physical mobile and release-review gates remain outstanding for the overall refactor."
},
{
"id": "BASE-LIFE-33",
"title": "Auto-playback restarts retain obsolete resume clicks, subscriptions and timers",
"confirmation": "reproduced",
"status": "resolved",
"owners": [
"CORE-18"
],
"evidence": [
"test/auto-playback.test.js",
"test/browser/auto-playback.spec.js",
"refactor/changes/2026-09-11-CORE-18-builtins-prompts.md"
],
"compatibleResolution": "Keep storage and public plugin contracts; bind one prompt generation to the layer and source, independently of instance-owned time recording.",
"closureCriteria": "Installed UMD and legacy prove single current resume action, actual playback/storage, close/rejection and restart/source/remove/destroy cleanup.",
"workspaceState": "Final CORE-18 source, production outputs and installed UMD/legacy artifacts match; ownership and compatible behavior are verified.",
"resolutionEvidence": [
"refactor/changes/2026-09-11-CORE-18-builtins-prompts.md",
"refactor/baselines/builtins-prompts-validation.json",
"test/auto-playback.test.js",
"test/browser/auto-playback.spec.js"
],
"resolutionRationale": "Owned prompt/input resources prevent stale callbacks and survive reentry/removal/destruction; normal public API and event ordering are retained. Final installed UMD and legacy each pass 1350 browser cases, including 207 CORE-18 cases, plus actual tarball runtime/type consumers. Physical mobile and release-review gates remain outstanding for the overall refactor."
},
{
"id": "BASE-LIFE-34",
"title": "Lock icon and miniature progress subscriptions outlive their UI or player",
"confirmation": "reproduced",
"status": "resolved",
"owners": [
"CORE-18"
],
"evidence": [
"test/builtin-layers.test.js",
"test/browser/builtin-layers.spec.js",
"refactor/changes/2026-09-11-CORE-18-builtins-prompts.md"
],
"compatibleResolution": "Scope icon subscriptions to their layer and miniature progress to the player; retain live lock setters after UI removal while suppressing post-destroy mutations.",
"closureCriteria": "Installed UMD and legacy verify builtin activation matrix, state/event/icon contracts, layer removal and retained setters/events after destruction.",
"workspaceState": "Final CORE-18 source, production outputs and installed UMD/legacy artifacts match; ownership and compatible behavior are verified.",
"resolutionEvidence": [
"refactor/changes/2026-09-11-CORE-18-builtins-prompts.md",
"refactor/baselines/builtins-prompts-validation.json",
"test/builtin-layers.test.js",
"test/browser/builtin-layers.spec.js"
],
"resolutionRationale": "Owned prompt/input resources prevent stale callbacks and survive reentry/removal/destruction; normal public API and event ordering are retained. Final installed UMD and legacy each pass 1350 browser cases, including 207 CORE-18 cases, plus actual tarball runtime/type consumers. Physical mobile and release-review gates remain outstanding for the overall refactor."
},
{
"id": "BASE-LIFE-35",
"title": "Info repeated initialization retains polling and close callbacks; destroyed reads continue writing",
"confirmation": "reproduced",
"status": "resolved",
"owners": [
"CORE-18"
],
"evidence": [
"test/prompt-components.test.js",
"test/browser/prompt-components.spec.js",
"refactor/changes/2026-09-11-CORE-18-builtins-prompts.md"
],
"compatibleResolution": "Own one info initialization generation; preserve mask destroy observer ordering and finalize its resources after event dispatch, including failure paths.",
"closureCriteria": "Installed UMD and legacy verify info initial/repeated/mobile/manual/failed init and DOM conversion, plus mask playback, destroy ordering and throwing-observer finalization.",
"workspaceState": "Final CORE-18 source, production outputs and installed UMD/legacy artifacts match; ownership and compatible behavior are verified.",
"resolutionEvidence": [
"refactor/changes/2026-09-11-CORE-18-builtins-prompts.md",
"refactor/baselines/builtins-prompts-validation.json",
"test/prompt-components.test.js",
"test/browser/prompt-components.spec.js"
],
"resolutionRationale": "Owned prompt/input resources prevent stale callbacks and survive reentry/removal/destruction; normal public API and event ordering are retained. Final installed UMD and legacy each pass 1350 browser cases, including 207 CORE-18 cases, plus actual tarball runtime/type consumers. Physical mobile and release-review gates remain outstanding for the overall refactor."
}
]
}
+5 -2
View File
@@ -1090,11 +1090,14 @@
"CORE-16",
"CORE-17"
],
"status": "todo",
"status": "done",
"risk": "M",
"deliverable": "autoPlayback/autoOrientation/fastForward/lock/miniProgressBar 及 info/notice/loading/mask",
"acceptance": "默认启用条件、storage 格式、定时器/动画清理通过;结合 BASE-PERF-01 防止销毁后重新安排 notice timer;接续 BASE-TYPE-07 的 notice.show boolean getter 与历史读类型冲突",
"evidence": []
"evidence": [
"changes/2026-09-11-CORE-18-builtins-prompts.md",
"baselines/builtins-prompts-validation.json"
]
},
{
"id": "CORE-19",