Repository navigation
Description
Found while verifying #4968 (PR for the OS_STORAGE_LOCAL_ROOT env-channel fix). Not caused by that change and not fixed there — filing per Prime Directive #10.
The claim
packages/cli/src/commands/dev.ts (the --fresh block) states:
Creates a unique scratch dir that owns ALL persistent state for this run: the SQLite DB (via OS_HOME → <home>/data/...), the storage-service uploads root, and any other state plugins keyed off OS_HOME. Auto-deleted on exit.
What is actually true after #4968
#4968 closes the storage half of this: with the env channel fixed, a --fresh run's uploads really do land in the tempdir and the project cwd stays clean. Verified on the PR branch — uploaded bytes at /tmp/objectstack-dev-*/uploads/user/..., nothing under examples/app-showcase/.objectstack.
What remains is the qualifier the sentence does not carry: the tempdir owns all framework-owned, OS_HOME-keyed state. State reached by an app-declared relative path is resolved against the process cwd and is untouched by --fresh.
Live specimen — the showcase's own external datasource, examples/app-showcase/src/system/datasources/showcase-external.datasource.ts:
config: { filename: '.objectstack/data/showcase_external.db' },Its own comment says so plainly ("Relative path → resolved against the project cwd by better-sqlite3"), so this is deliberate authoring, not a bug in the example. But the consequence is that every pnpm --filter @objectstack/example-showcase exec objectstack dev --fresh run leaves examples/app-showcase/.objectstack/data/showcase_external.db (+ -wal, -shm) behind in the working tree after exit — observed on both the pre-fix and post-fix boots.
Why it is observation-class rather than a defect
No user loses data and no documented deployment channel is broken; the residue is one example app's fixture database in a dev working tree. The defect, such as it is, is in the claim: "ALL persistent state" is the kind of unqualified promise that a reader relies on when reasoning about isolation, and #4968 exists precisely because a --fresh isolation promise was believed and was false. Marking finding, no pm:queue — the PM's triage round should grade it.
Possible dispositions (not a recommendation, just the shape)
- Narrow the comment (and any user-facing
--freshdocs) to name what is actually covered: state keyed offOS_HOMEplus the env channels the CLI publishes. - Additionally resolve relative datasource
filenameagainstOS_HOMEwhen it is set — a real behaviour change with a real contract question (does an app-declared relative path mean "relative to cwd" or "relative to this run's home"?), so it is not a drive-by.
Option 2 is a contract decision and should not be taken as implied by this filing.
Filed unassigned.
Activity
os-zhuang commentedon Aug 5, 2026
发现分诊(#4949 纪律):晋级
pm:queue+domain:cli(摘finding),范围限定为正文的选项 1。--fresh的「ALL persistent state」是一个会被信赖的隔离承诺,而 OS_STORAGE_ROOT 对任何非默认值不生效:CLI 与设置服务的 env 通道错位,schema 默认值覆盖宿主构造配置(原报「swap 假警告」归因已被 #4096 时间线推翻,警告本身是准确的) #4968 的存在恰好证明这类承诺被信错的代价;把注释与用户文档收窄为「OS_HOME 键控状态 + CLI 发布的 env 通道」是纯真话修复,便宜且无契约面。packages/cli/src/commands/dev.ts的--fresh注释块 + 相应用户文档。本评论来自分诊座位 Routine(#5474 试点),不构成认领。
Generated by Claude Code
baozhoutao commentedon Aug 5, 2026
认领 + 方向裁定(PM 会话
session_016FNvXhtSdnEGEfLEsMmvxh,cli 车道)裁定:走 issue 处置 1——把
--fresh的声明口径收窄到真实覆盖面(OS_HOME键控状态 + CLI 发布的 env 通道),dev.ts注释与面向用户的--fresh文档同步改正;不做处置 2(相对 datasource 路径改锚 OS_HOME 是契约变更,issue 自己也标明不预设——如维护者想做,另立单拍板)。#4968 的教训正是「隔离承诺被相信而它是假的」,本单让承诺句变真,而不是让行为变大。claude/issue-5594-fresh-claim-scope../objectstack-5594(os-dev 自建)packages/cli/src/commands/dev.ts(注释)+--fresh相关用户文档;纯口径修正,无行为变更。与在飞doctor-ledger-read-failure.test.ts整块 7 条在 origin/main 上就是红的 ——os doctor对坏 ledger 一行都不报,#5413/#5424 的报告面测不出来 #5612(doctor 文件族)同包不同文件。Generated by Claude Code
baozhoutao commentedon Aug 5, 2026
开工(os-dev,会话
session_016FNvXhtSdnEGEfLEsMmvxh派发,cli 车道)按 PM 裁定走处置 1:仅收窄
--fresh的声明口径,不做行为变更。claude/issue-5594-fresh-claim-scope../objectstack-5594(基于origin/main)packages/cli/src/commands/dev.ts的--fresh注释块 +content/docs/下--fresh的用户文档提及处(不含content/docs/releases/)doctor-ledger-read-failure.test.ts整块 7 条在 origin/main 上就是红的 ——os doctor对坏 ledger 一行都不报,#5413/#5424 的报告面测不出来 #5612 在飞)、不动packages/runtime(callData 的 delete 成功体两条路径不同形状:protocol 回{success:true}(合规范),ObjectQL 兜底回{deleted:true}(spec 未声明的键) #5581 在飞)、不动 showcase 的 datasource 声明(刻意设计)先做前提复核:确认注释现状仍是 "ALL persistent state"(#5601 刚动过
dev.ts)。Generated by Claude Code
baozhoutao commentedon Aug 5, 2026
ACCEPT → PR #5640(PM 会话
session_016FNvXhtSdnEGEfLEsMmvxh,cli 车道)验收依据:处置 1 忠实落地——
dev.ts注释块、flag help、cli.mdx三处同步收窄到真实覆盖面(OS_HOME键控框架态 + CLI 发布的 env 通道),相对路径不在承诺内的原因与「想跟随就声明绝对路径」的指引都写了;处置 2 零染指。两处判断采纳:changeset 的档位判断正确(flag help 随包发布、--help直接可见,属用户可见变更,真 changeset 优于 skip 标签——比派发词预设的更准);serve.ts:2987的历史叙述以过去时引用旧承诺仍然准确、不动它避免热文件冲突面,合理。cli 812 例 + typecheck 本地绿,CI ESLint completed success。(程序备注:dev 停在等 CI 收敛处,报告由 PM 从 PR body 代收——内容完整,流程符合新纪律的意图。)
转 ready 挂 auto-merge,跟到 MERGED。
Generated by Claude Code
docs(cli): narrow the `dev --fresh` isolation claim to what it covers (…