Repository navigation
feat(branch): give a line an optional title - #2550
yyhhyyyyyy wants to merge 39 commits into
Conversation
A branch line takes an optional `title`, one non-empty line, which names it in the Session's directory and in its opener's roster; `prompt` stays the line's first input and its purpose. The branch tool and `session.branch_create` accept it, and the tool no longer refuses the field that `exec` and `collaboration` already take. `branch/create` carries the title as an optional event field, and the v58 marker step keeps a v57 daemon from opening a store whose events it cannot decode. A title that is blank or carries a line break is refused by the tool, the RPC and `TimelineTree::create_child` before any fact is written. A line without a title is named by the first line of its prompt on creation and after restore, and `session.branches`, `session.branch.get` and the roster return that name. The v1 and v2 encodings stay frozen: v1 through its own event view, v2 through the event projection and the cleared title on the frozen `session.branch_create` reply. The readers decode the new field only; the terminal and Web wiring follow separately. Refs #2000 #2070.
…n a new test The existing branch_create reply test returns to its main version byte for byte; the title round trip and the refusal of a non-string title move to a new test.
The `BranchCreateData` literal in `sqlite_import_rolls_back_retries_and_keeps_history_and_shared_files` gains the new optional `title` field as `None`; the test's assertions are unchanged.
|
在
|
eric8810
left a comment
There was a problem hiding this comment.
评审 ec111d0。可选 title 与首条输入分开,保留无标题时从 prompt 首行取名,符合 #2549。阻塞是老 v3/v4 客户端仍会收到它们无法读取的 branch/create:新 ProductEvent 只对 v2 去掉 title,现有 v3/v4 客户端可协商相同版本,而且把该事件直接反序列化成 deny_unknown_fields 的旧 BranchCreateData。新端或模型一旦创建有标题的分支,同 Session 的旧客户端收到实时事件或重新读历史时就会拒绝这条事件。目录用的新字段单独看是可加的;可保留 title 在兼容的目录/详情结果里,将实时与历史的事件投影保持旧形状,或用连接显式 opt-in。补一个用旧严格类型读取真实分支创建的实时事件与重新连接后的历史、以及新端仍能读标题的测试。zerob13 已另列 SQLite→PG 导入及 PG 降版本,两条与这个 wire 问题独立。CI 47144584668 通过;上述 wire 行为是源码核查,未独立跑混版本。旧解码 · 旧类型 · 本 PR 事件投影
zerob13
left a comment
There was a problem hiding this comment.
Request changes. The tool and RPC now accept an optional title while keeping the child’s prompt verbatim, and the SQLite tests cover restoring explicit titles and the first-line fallback. The remaining issues concern existing databases and clients. Tool flow · RPC flow · Restart flow
-
Preserve read-only v57 import and recovery. A v57 source now fails the equality check against
STORE_FORMAT58 before the importer can look for a matching PostgreSQL receipt. If the old importer already committed to PostgreSQL but stopped before completing the local binding, startup refuses the pending import and the new importer cannot complete it. Please admit validated v57 and v58 sources through the existing read-only path. Verify that a v57 source can import directly and that restarting an already committed v57 import completes the binding without rewriting SQLite or duplicating PostgreSQL records. Earlier review comment · Import gate · Receipt recovery · Startup binding guard -
Version PostgreSQL’s stored event encoding. PostgreSQL saves the full event body, including
title, but still admits and writes format 1. An old daemon accepts that marker and then fails when it first encounters a titledbranch/create. Give PostgreSQL a format transition under its existing startup transaction. Verify that a format-1 store upgrades with the samestore_idand existing history, a titled line keeps its title and full prompt after reopen, and the pre-change daemon rejects the upgraded store at open. Earlier review comment · Format gate · Payload write · Payload read · Pre-change decoder -
Keep titled events readable by existing v3 and v4 clients. The server only strips
data.titlefrom v2 events. Existing Rust clients negotiate v3 or v4 and decode the knownbranch/createevent with a type that rejects unknown fields. When another caller creates a titled line, an existing client can fail a history page or live notification despite a successful handshake. Please keep the legacy eventdatashape for existing clients, either by making the field opt-in or by putting it in an extensible part of the event envelope. Verify that the pre-change decoder can read the event in history and live delivery while updated clients can retrieve the title. The directory and create reply can carry their optional field. Event projection · History · Live delivery · Pre-change Rust reader
Optional
The TimelineInfo.title documentation could clarify that an untitled child already carries its derived display name in the populated directory. Current field documentation · Restore projection
CI was green on this head. The focused Web RPC reader tests passed, and the PostgreSQL compatibility findings are from source review.
No formal reviews were recorded when this draft was prepared.
Merge remains gated on resolving these compatibility issues and obtaining the required approvals. TUI and Web interaction work is tracked separately. Accepted scope · TUI #2551 · Web #2552
A v3 or v4 client decodes the `branch/create` event data with a type that refuses unknown fields, so a title inside it fails a live notification or a history page even though the handshake succeeded. The event projection now keeps that data shape for existing clients and carries the title as the optional top-level `title` of the event envelope, which a client that predates the field ignores; v2 keeps its frozen shape and carries none, and an event without a title keeps its previous bytes. The Rust client and the Web reader decode the envelope member, and the directory, detail and `session.branch_create` reply keep their optional field. Refs #2000 #2070.
Simon-He95
left a comment
There was a problem hiding this comment.
Request changes on ec111d0e.
The direction is right: title is separate from prompt, prompt stays the child's first input verbatim, the roster/directory fall back to the first prompt line, and the tool/RPC/schema boundaries validate one non-empty line before writing any fact. The title belongs on the branch/create event, TimelineInfo/BranchOptions, session.branch_create and the directory reply. The remaining issues are compatibility and versioning.
P1. Existing v3/v4 clients still receive a branch/create they cannot decode
ProductEvent::new clears title only for protocol v2. An existing Rust client negotiates v3 or v4 and decodes branch/create into dim_agent_types::BranchCreateData, whose deserializer denies unknown fields and has no title on main. When another caller opens a titled line, the old client fails the live notification or history page after a successful handshake. The directory/detail additions are additive and safe; the event projection is not. Projection strip only v2 · Event field
Keep the v3/v4 event-data shape unchanged (derive the title from the directory/reply for old readers) or put the field behind an explicit connection opt-in/protocol version, and verify a pre-change decoder reads both live and replayed events while an updated reader can still retrieve the title.
P1. The request boundary has no negotiated capability
session.branch_create now accepts title, but nothing in hello.features or the protocol version tells a new client whether an older daemon accepts it. A pre-change daemon's BranchCreate request denies unknown fields, so a TUI/Desktop that starts sending title against an older v4 daemon gets invalid_params. Clients either have to fall back on failure or cannot use the field at all. #2549 explicitly wants the TUI and Web line-creation entry points to use this field. Request · Advertised features
Add a hello feature (for example session.branch_create.title) and have clients send the member only when it is advertised, or bump the protocol version; document the fallback. Current dim-electron does not send title yet, so this is not an immediate break, but it is a required guarantee before the Desktop/TUI adopt it.
P1. v57 import and PostgreSQL still need the format transition
These are the two peer findings and I confirm them from the source:
- The importer compares the source format to
STORE_FORMAT58 and refuses a v57 source before it can look for an already committed PostgreSQL receipt. A v57 import that stopped between the PostgreSQL commit and the local binding cannot be completed. Admit validated v57 and v58 sources on the read-only import path. Import gate - PostgreSQL writes the full event body, including
title, while still admitting format 1. An old daemon accepts that marker and fails at the first titledbranch/create. Give PostgreSQL a format transition (samestore_id, existing history preserved) and verify a format-1 store upgrades and a pre-change daemon rejects the upgraded store at open. PostgreSQL marker
P2. Format 58 collides with #2530
#2530 proposes v58 for its input-file representation. If both directions are ever selected, one must move to v59 with an explicit upgrade step. This is not a blocker for this PR on its own, but the format number must be coordinated before merge. v58 decision · #2530 format
Optional
- The title has
minLength: 1but no maximum, while the roster/directory truncates the fallback at 120 characters. State or enforce the intended title bound so a huge single-line title does not enter the directory verbatim.
Verification: source, event/projection, importer and PostgreSQL review; CI at this head is green. I did not run the storage/import flows locally.
Verdict: REQUEST_CHANGES.
PostgreSQL stores now carry format 2. Opening a format 1 store upgrades it in place inside the startup transaction, keeping the store id and every Session record; a reader that admits only format 1 refuses the upgraded store at open. The SQLite importer admits validated v57 and v58 sources through the same read-only path, so an interrupted import from the previous version can finish its local binding without rewriting the source.
zerob13
left a comment
There was a problem hiding this comment.
Requesting changes on ec111d0ef92aa44b7167e420f7c7d7b016592534. The title is separated from the prompt, the prompt stays the child's first input verbatim, and the tool, RPC and schema boundaries validate one non-empty line. Those parts match the accepted #2549 scope. Four compatibility items remain, plus a merge conflict with current main. Accepted scope
- Existing v3/v4 readers still cannot decode a titled
branch/create.ProductEvent::newclearstitlefor v2 only, and a client frommainnegotiates v3/v4 and decodes the event withBranchCreateData, which denies unknown fields. Another caller opening a titled line fails that client's live stream or history page. Keep the v3/v4 event data unchanged, or gate the field behind an explicit connection capability, and verify a pre-change decoder reads both live delivery and a replayed page while an updated reader still sees the title. Projection · Event field - The create request member has no negotiated capability.
BranchCreatenow acceptstitle, buthello.featuresadvertisessession.branch_createas a method and nothing that names this member. A pre-change daemon decodes the request withdeny_unknown_fieldsand notitle, so a client that sends it getsinvalid_params. The catalog contract states that a feature names a method or a request member an older daemon would refuse, which is the precedent this member falls under. Advertise a member feature and have clients sendtitleonly when it is offered, or add the equivalent version gate, and document the no-title fallback. Sender wiring stays with #2551, #2552 and Desktop. Request · Advertised features · Pre-change request · Feature contract - Read-only v57 import and pending-import recovery are refused. The importer still compares the source format with
STORE_FORMAT58 before it can look for a matching PostgreSQL receipt, so a v57 source cannot be imported and an import that stopped between the PostgreSQL commit and the local binding cannot be completed. Admit validated v57 and v58 sources on the read-only path and verify both cases against a disposable database. Import gate - PostgreSQL still writes titled events under format 1. The full event body, including
title, is stored while the marker stays 1, so an older daemon accepts the store and fails at the first titledbranch/create. Give PostgreSQL a format transition under its existing startup transaction with the samestore_id, verify that existing history upgrades, that a titled line keeps its title and prompt after reopen, and that the pre-change daemon rejects the store at open. Format gate · Payload write
main has moved to 4b1a783f, and tree_protocol.rs, dim-client/tests/connection.rs and web/src/rpc/read.test.mjs conflict with it. The conflict is mechanical, but it must be resolved before the compatibility items can be verified at the final head.
Optional
titlehasminLength: 1but no maximum, while the roster and directory truncate the derived name at 120 characters; state or enforce the intended bound.- #2530 was withdrawn as the competing implementation, so v58 stays available for this PR's own storage change; item 3's format decision no longer waits on that choice. Owner decision
CI passed on this head. CI run
|
I resolved the three conflicts with |
eric8810
left a comment
There was a problem hiding this comment.
Follow-up on the conflict resolution at a901a2fc. The event constructor retains main's negotiated MCP identity projection and the branch's v2 title omission. That integration does not resolve the earlier mixed-version finding: v3/v4 still receive the new event field. The negotiated request member and PostgreSQL import/format findings from the other reviews also remain open.
There is one new compiler failure from the merge: the interrupted-branch restore fixture on main constructs BranchCreateData without the new field. Both Linux and native macOS report E0063 at branch_flow.rs:15005. Set title: None in that fixture to keep its untitled behavior, then rerun the full selected checks. This is separate from the compatibility work. My prior Request changes stands.
zerob13
left a comment
There was a problem hiding this comment.
Request changes on a901a2fc. The merge resolved the three content conflicts and preserved both main’s MCP identity projection and the branch’s v2 title omission. It also brought in an interrupted-create fixture whose BranchCreateData initializer lacks title. Set title: None to preserve the untitled fixture, then verify that capabilities_flow builds and that both CI jobs pass. The earlier focused checks did not compile this target. Linux workspace Clippy and the macOS native test build both report E0063 at the same initializer. Fixture · Linux · macOS
The four previous compatibility findings still need fixes. Previous review
- Accept validated SQLite v57 sources through the read-only importer, including a retry that must find an existing PostgreSQL receipt and finish the local binding. Import gate
- Add a PostgreSQL format transition so old daemons reject the upgraded store at open. Preserve the store identity and existing history, and verify that a titled line and its original prompt survive reopen. PostgreSQL admission
- Keep titled
branch/createevents readable by existing v3/v4 clients in live delivery and history, while letting updated clients retrieve the title. The merged projection still strips the field only below v3. Event projection - Advertise support for the
titlerequest member and document the prompt-only fallback so a client can omittitlewhen it connects to an older daemon. The method advertisement is present on both. Request schema · Feature list
CI failed on this head. Eric independently confirmed the fixture failure and the outstanding compatibility findings. Merge remains gated on the fixes, green checks, and required approvals. CI run · Eric’s follow-up
The daemon lists session.branch_create.title beside session.branch_create in hello.features and exports the name as a protocol constant, because an older daemon's request type refuses the member; a client sends title only when it is offered and otherwise the daemon names the line by the prompt's first line. is_valid_branch_title bounds a title at 120 Unicode scalar values, the bound the branch tool's schema declares and a prompt-derived name stops at, so storage, the event envelope, the directory and the roster carry the same title. The tool's title description and the three rejection messages state the bound, and the English and Chinese branch designs document the advertised member and the fallback.
eric8810
left a comment
There was a problem hiding this comment.
Request changes on c9291bf662452f0edc3fa6e98dcbf86091fce414. The last review's final-title validation and TypeScript omission-or-string fix now appear in source. Rows with a stored name also avoid the creation read at normal cold resume. Moving names into the directory is the right direction. The migration now makes startup depend on a different, wider read.
Structure · Blocking: bound the format-1 PostgreSQL upgrade so a line title cannot stall opening an entire store. The store opener acquires the startup advisory lock, fetches every non-root creation's full payload into a single result, deserializes it in the daemon and awaits one UPDATE per child before committing the format marker. The cost and peak memory depend on all prior creation prompts across all Sessions, including ended ones. Even a healthy format-1 store with many Sessions now pays that cost before it can open any Session. Locked upgrade
Acceptance: use a bounded backfill or another directory-owned approach with bounded transfer/memory and without a round trip per child. In a disposable format-1 store with many existing ended lines and large legacy prompts, show the migration preserves title fallback, the store identity, and atomic format publication. A second open should not re-read the creation bodies. Clarify the paired SQLite path in the resume contract: old rows without a stored name still query the creation's title and prompt, including for ended lines, unlike the new-row test. Verify the v57 fallback separately rather than treating the new-row test as covering upgraded rows. Legacy lookup · Resume contract
Compared the earlier compatibility findings, revised creation/projection/restore paths, SDK types and the PostgreSQL upgrade. This is source-based; I did not benchmark the migration or rerun a real PostgreSQL store. Exact-head Linux CI was still running; macOS-native, Windows CLI and Web passed.
zerob13
left a comment
There was a problem hiding this comment.
Request changes on c9291bf. The ended-directory restore, post-transform validation, and SDK null-handling changes satisfy the three items in the previous review. The new PostgreSQL directory migration still needs a storage fix. Previous review · Author’s response
Preserve every name the branch contract allows in PostgreSQL. The new directory column is TEXT, which cannot store U+0000. The previous format accepted branch prompts as Rust strings and stored their event bodies as BYTEA. Its RPC checked that the prompt was nonblank. That narrows the set of existing names the upgrade can preserve and can prevent a valid format-1 store from reopening. The same representation affects new creates and SQLite imports, which use the PostgreSQL branch insert. Please use a storage representation that round-trips the accepted title and fallback strings, including existing prompts. Verify that upgrade preserves the store identity and history, and that create, import, and fork preserve the same directory name after reopen. Old prompt check · Old payload format · Upgrade · New writes · PostgreSQL character types
The same upgrade fetches every creation payload across the store into one result and issues one update per child while holding the startup lock. Please backfill in bounded batches with batched writes, keeping schema, names, and marker publication atomic. Verify the first open on a disposable format-1 store with many ended lines and large prompts, and verify a second open skips the backfill. The v57 SQLite fallback remains a separate path that selects title and prompt when a row lacks its stored name. Locked backfill · Eric’s review
All six existing disposable PostgreSQL upgrade and import tests passed, including v57 direct import and committed-receipt recovery. The representation failure and the backfill’s scaling follow from source review and the documented PostgreSQL type contract. Migration latency was not benchmarked. macOS, Windows and Web passed on this head, and Linux verification was still running when checked. CI
zerob13
left a comment
There was a problem hiding this comment.
请求修改 c9291bf。新增一个 SQLite 冷恢复阻塞。上一轮的已结束分支正文读取、before 改写后的标题校验和 SDK 的 title: null 三项已解决。同头正式意见里的 PostgreSQL 名称存储和升级回填问题仍成立。上一轮评审 · 同头 PostgreSQL 评审
Structure · Blocking — 一个未完成子线的标题读取可以阻断整个会话恢复。 v57 目录行缺少名称。父线仍活动、子线没有完成打开、父线也尚未记录 branch/create-failed 时,恢复先读取 data.title 和 data.prompt,之后才判断创建是否完成。这条子线将被剔除,写入失败事实只需要目录锚点,既有恢复契约也允许来源读取失败。此时名称读取失败会提前退出,连 main 都无法加载。已有 create-failed 的行和未打开的 inactive 父线子行已跳过名称读取。缺口在第一次重启收尾。名称读取及错误传播 · 中断创建的收尾 · 既有恢复用例
验证与验收。 在临时副本中,把现有 v57 传输测试对中断行创建正文的损坏提前到第一次重启。会话操作返回 -32603。保持同一损坏数据,仅让该目录行已有名称,相同测试通过。请验证无目录名称时也能首次恢复 main、目录排除该子线、父线恰好写入一次 branch/create-failed,再次重启仍只有一条。同时保留正常活动、已结束及 fork 复制行的名称。现有测试的两次重启顺序
Blocks inspected 已核对完整 diff 中的创建入口和事实写入、目录和名册、恢复和 fork、三种存储及升级导入、实时和历史协议、Rust/Web/SDK 读端、设计文档和替换的测试。旧拒绝 title 的断言由创建与读取的流程测试接替。原始 head 上本地 App Server 分支传输测试 21/21、Web 协议读取测试 15/15 通过。隔离 PostgreSQL 17.12 确认 TEXT 写入 U+0000 返回 22021。
Not verified 本地未跑全工作区和端到端 PostgreSQL 升级,未测量回填耗时。GitHub 上 Linux、macOS、Windows、Web、静态检查、脚本及汇总检查 ci-ok 已通过。CI
Simon-He95
left a comment
There was a problem hiding this comment.
Reviewed c9291bf6 (feat(branch): give a line an optional title, fixes #2549). 82 files, +2950 −130.
Scope: contract/state/multi-subsystem.
Direction: aligned with #2549. The title stays separate from prompt, the owner validates one non-empty line before any fact, and the storage/import steps are explicit.
Architecture: held in the owner path; the remaining problems are storage migration and cold restore.
App Server surface: additive.
App Server surface
- Changed:
session.branch_createtakes an optionaltitle(crates/dim-app-server/src/protocol.rs:982-989); hello advertisessession.branch_create.title(crates/dim-app-server/src/protocol.rs:337,crates/dim-app-server/src/transport.rs:732);branch/createkeeps its olddatashape for every version and carries the title only in the v3/v4 envelope (crates/dim-app-server/src/tree_protocol.rs:178-195); directory/detail replies add an optional title; SQLite format 58 is a marker-only step; PostgreSQL is format 2 and the read-only import admits v57/v58 (crates/dim-app-server/src/storage/postgres/import.rs:354-358). - Consumers: TUI/CLI and Web read paths are updated in this PR; ACP has no
branch/createconsumer path; dim-electron reads known directory keys and sendssession.branch_createwithouttitle, so it is unwired for the field but not broken; older strict v3/v4 decoders see the olddatashape. - Classification: additive/backward-compatible for the wire; the PostgreSQL format transition is a storage change, not a wire break.
- Required: none for the wire; the storage representation/backfill and the SQLite restore path are the peer blockers below.
Prior finding status
- Resolved: the v3/v4 event-shape break.
ProductEvent::with_identitiesremovestitlefromdatafor every version and emits it only as the v3+ envelope member (crates/dim-app-server/src/tree_protocol.rs:178-195);a_v2_branch_create_carries_no_title, the v3 envelope test, and the live/history legacy v3 decoder tests pin it. - Resolved: the request capability.
BRANCH_CREATE_TITLE_FEATUREis advertised besidesession.branch_create(crates/dim-app-server/src/protocol.rs:337,crates/dim-app-server/src/transport.rs:732), and the request accepts the optional member (protocol.rs:982-989). - Resolved: the v57 import and PostgreSQL format transition.
import_lockedadmits 57 and the current format (crates/dim-app-server/src/storage/postgres/import.rs:354-358), and PostgreSQL format 2 upgrades under the advisory lock (crates/dim-app-server/src/storage/postgres.rs:99-155). - Resolved: the merged fixture compile failure;
branch_flow.rs:14782,:14902and:15199now constructtitle: None, and CI is green at this head. - Resolved: the optional title bound.
BRANCH_TITLE_LIMIT = 120is enforced at the tool, the RPC and the tree. - Withdrawn: the format-58/#2530 collision; #2530 is closed and the SQLite step is marker-only.
Carried peer blockers
The current-head reviews (6189479231, 6189532593, 6189644626) carry the remaining storage issues:
- PostgreSQL stores the directory name in
TEXT(crates/dim-app-server/src/storage/postgres.rs:102), which cannot represent U+0000 that a legacy prompt may contain in a valid format-1 store; use a representation that round-trips the accepted prompt/title. - The format-1 backfill fetches every creation body into one result and updates one row per child while holding the startup lock (
crates/dim-app-server/src/storage/postgres.rs:110-149); bound it. - SQLite cold restore reads
data.title/data.promptfor an interrupted child before deciding the creation failed (crates/dim-agent-capabilities/src/timeline_tree.rs:3398-3405); a failed read aborts the whole Session restore instead of writingbranch/create-failedand dropping the line.
Verified
- Read the
a901a2fc..c9291bf6delta and the event, request, hello, import, PostgreSQL, SQLite restore and test paths atc9291bf6; the full PR was reviewed ata901a2fc. - Blocks inspected: event projection, request/hello, storage formats, import, cold restore, SDK declarations, docs.
- CI at
c9291bf6: 8 success, 2 skipped. - Cross-PR / consumer checks: dim-electron's
branch-directory.tsreads known keys andservice.tsdoes not sendtitle; #2530 remains closed.
Not verified
- Did not run the PostgreSQL upgrade, import or storage flows locally; the peer's disposable PostgreSQL run and the source paths are the evidence.
Verdict: REQUEST_CHANGES — the wire compatibility findings are resolved, but the PostgreSQL representation/backfill and the SQLite restore path still block.
A branch title accepts U+0000, which PostgreSQL text cannot hold, so the directory column holds the name's UTF-8 bytes like stored Session titles and previews; the format 1 upgrade adds the bytea column, and the directory read and the SQLite import validate UTF-8 before returning a name.
Opening a format 1 store reads each child's creation body in keyset pages of 64 rows and writes each page back with one array update, so peak memory and round trips no longer grow with every stored creation; the format marker still moves last, inside the same startup transaction, so a failed backfill leaves the column and the marker untouched.
A directory row written before rows carried names projects its creation title and prompt at the point the restore keeps the line, not before it decides whether to drop it; an interrupted creation whose body is unreadable is settled with one branch/create-failed fact on its parent instead of failing the Session restore.
PostgreSQL tests cover a U+0000 title and prompt through the format 1 upgrade, a new creation, both SQLite import formats and a fork, and a large format 1 store whose failed backfill leaves the marker at 1; the SQLite flow corrupts an interrupted creation before the first restart and keeps the names of open, ended and fork-copied lines.
PostgreSQL storage documents the bytea representation, the paged backfill and the marker publication; the branch design states which legacy rows still read a creation body and which rows a restore drops unread.
|
Fixed in 5ced606, b02c0a1, 5de017b, 911b8ad, 216ac64, merged with main in 29d0a13. Bound the format 1 upgrade. The backfill now reads directory rows in keyset pages of 64, joins each page to its Clarify the SQLite fallback. Represent a name as UTF-8 bytes. Keep the backfill bounded. The keyset paging and the single array Read a legacy name only where the line is kept. The unconditional read before the completion decision is gone. A row written before rows carried names is named by Verify the first restart. The three items in this review are the same changes described above, with the same commits and tests:
|
zerob13
left a comment
There was a problem hiding this comment.
Approve on 29d0a13d. The PostgreSQL migration and SQLite restart findings are resolved. Previous review · Author response
- PostgreSQL now stores directory names as UTF-8 bytes. The new fixture verifies explicit and derived names across upgrade, create, SQLite v57/v58 import, and fork/reopen. The format-1 backfill reads up to 64 rows per page and applies one update per page. The 130-line fixture confirms that a failed backfill rolls back the schema and marker together, a successful upgrade preserves identity and names, and a second open uses the persisted names. Backfill · Round trip · Upgrade fixture
- SQLite restore looks up a missing name only when it keeps the line. The v57 fixtures verify that main publishes on the first restart despite an unreadable creation body for an interrupted child, that the failure fact is written once across restarts, and that open, ended, and fork-copied lines retain their names. Restore helper · Legacy flows
All eight disposable PostgreSQL tests and 22 branch transport tests passed. The previously accepted wire compatibility, request discovery, final title validation, and SDK contract remain satisfied. CI and independent approvals remain merge gates. CI
# Conflicts: # crates/dim-app-server/src/storage/postgres.rs # crates/dim-app-server/src/storage/sqlite.rs # crates/dim-app-server/src/tree_protocol.rs # docs/design/appserver/native-storage-format.md
Simon-He95
left a comment
There was a problem hiding this comment.
Reviewed 29d0a13d5a3c453ad1d3457c19a458b08bb94181 (feat(branch): give a line an optional title, fixes #2549). 82 files, +3530 −150.
Scope: state/persistence/multi-subsystem — the reviewed delta is the PostgreSQL directory column and its format-1 upgrade, the legacy SQLite name reads in cold restore, their tests and docs.
Direction: right level for all three prior items. The directory owns the name, the upgrade stays inside the existing startup transaction, and a restore reads a creation body only where it keeps the line.
Architecture: held for the fixes — one stored name per row, one derivation (dim_agent_types::branch_title), no second name source and no restore-side cache. The format decision is the problem below.
App Server surface: no wire change in this delta; the v3/v4 envelope member, the hello feature and the reply fields are as reviewed at c9291bf6.
App Server surface
- Changed: nothing on the wire in
5ced6067d..29d0a13d5.session.branch_create.title,hello.featuressession.branch_create.title, the v2 frozenbranch/createdata shape and the optional reply title are unchanged;npm/branch-services.d.tsis not regenerated in this range because no service type changed. - Consumers: TUI/CLI, Web and dim-electron read the directory as before. The reviewed delta changes only how a name is stored in PostgreSQL and when a legacy SQLite row is read during restore.
- Classification: no wire change; the storage format numbers are the blocking item below.
- Required: none for the wire.
Prior findings
- Resolved · Structure — the PostgreSQL name representation.
timeline_branches.titleisBYTEAholding UTF-8 bytes (schema.sql:19, postgres.rs:195), writes encode the same way (timeline.rs:228), and both the directory read and the import validate UTF-8 before returning a name (timeline.rs:436-451, import.rs:212-229). AU+0000title and prompt now round-trip through the upgrade, a new creation, both SQLite source formats and a fork (postgres_import.rs:744-910). - Resolved · Structure — the unbounded format-1 backfill. Bodies are read in keyset pages of 64 rows and written back with one
UNNESTupdate per page (postgres.rs:53-140), the marker still moves last inside the same transaction (postgres.rs:193-205), a page that misses its rows aborts, and the child count is rechecked at the end. The 130-line fixture crosses pages, corrupts a payload after the first page, and asserts the failed open leaves both the marker at 1 and notitlecolumn, then that a second open reads the persisted names without touching bodies (postgres_import.rs:943-1117). - Resolved · Structure — the SQLite interrupted-creation read.
ensure_titlenow runs only at the five points where the restore keeps the line (timeline_tree.rs:2048-2060, call sites at :3360, :3385, :3414, :3460, :3487); the interrupted child reachesrecord_create_failedwith an unreadable body,mainstill publishes, and the failure fact is written once across two restarts (branches.rs:2029-2090). The resume contract now states which legacy rows read and which are dropped unread (timeline-branches.md:988). - Carried · Optional (PostgreSQL tests) — below.
Blocking · Structure — SQLite format 58 and PostgreSQL format 2 now each name two different changes
Root cause & same-source scope. Main moved while this branch did not. b20fabc7b (2026-12-05, ancestor of current main 6f18b1f8, not of this branch's merge parent 8a1bb897) took SQLite format 58 for #1835, "two model-output event kinds and optional fields that a v57 daemon cannot decode", and PostgreSQL format 2 for the same marker-only step: main sqlite.rs:22, :552-557, main postgres.rs:100-108, :133. This head uses the same two numbers for the title: sqlite.rs:22 with the title step at :552-554, and postgres.rs:29 with the column, backfill and marker at :193-205. The PR body's "the format stays 58" and "the store marker moves to 2" were true against 8a1bb897 and are now wrong. Both numbers are marker-only guards whose whole purpose is "an older daemon must refuse this store at open", so reusing them silently disables the guard in both directions.
Failure path. (a) A store current main wrote at 58, holding step/provider-tool or step/source or input/message.web_search, is opened by this daemon: open sees version == FORMAT and upgrades nothing; this head's EventKind has no such variants (grep: 0 matches for provider-tool/ProviderTool in crates/dim-agent-types/src/events.rs at this head), so the first event read fails exactly as the 57 comment predicts. (b) A store this daemon wrote at 58, holding a branch/create with data.title, is opened by a current-main daemon: it accepts 58, and BranchCreateData there has deny_unknown_fields and no title, so the first titled creation fails to decode and the line is unusable. (c) PostgreSQL is worse because the schema differs, not only the decoding: a main-written format 2 store has no timeline_branches.title. This head accepts version 2 without adding the column, then every directory read (timeline.rs:436) and every creation insert (timeline.rs:228) references a missing column, so the store opens and then fails on use instead of refusing at open. (d) A titled format 2 store read by a main daemon keeps working but silently loses every name. The same renumbering also decides the read-only import range, which currently admits "v57 and v58 sources" (import.rs:354-361): after merging, a v58 source may carry #1835 events that this head cannot decode.
Acceptance. Merge current main and give each format step its own number — SQLite 59 and PostgreSQL 3 for the title, with FORMAT, schema_of/format_table, the upgrade admission and the import range stated in the merged numbering — so no store can be admitted under a version it was not written with. Cover both directions: a store written at main's 58/2 (with #1835 content) opens and upgrades on this daemon, and a store written by this daemon at 59/3 is refused at open by a daemon that knows only 58/2. Keep the bounded pages, the last-marker ordering and the rollback assertions in the moved test. The head also conflicts with current main in crates/dim-app-server/src/storage/postgres.rs, crates/dim-app-server/src/storage/sqlite.rs, crates/dim-app-server/src/tree_protocol.rs and docs/design/appserver/native-storage-format.md, so this decision is unavoidable before merge.
Optional · Implementation — the PostgreSQL upgrade, backfill and import tests never run in CI
Every PostgreSQL case is #[ignore = "requires a disposable PostgreSQL database URI in DIM_TEST_POSTGRES_URL_FILE"], and no workflow sets that variable (grep of .github/workflows). The upgrade, the page crossing, the rollback and the U+0000 round trip are therefore evidenced only by the author's local run. Wire the group into a job with a service container, or record the gap on the issue.
Optional · Implementation — a legacy mount reads the same creation position twice
For a pre-name row the mount path calls ensure_title and then creation_source at the same anchor, two projection reads for one creation (timeline_tree.rs:1987-2060, :1931-1985). One field selection returning data.title, data.prompt and data.source would do both. Not blocking.
Verified
- Read
c9291bf6..29d0a13d5commit by commit (5ced6067d,b02c0a1de,5de017b9c,911b8ade5,216ac643c, merge29d0a13d5) and the resulting files at the exact head. - Blocks inspected: the PostgreSQL schema, startup upgrade, paged backfill and its failure/last-marker ordering, the directory read, the creation insert, the fork copy of the column, the SQLite import checks, the SQLite restore loop and its five naming points, the resume contract in both languages, the new PostgreSQL and transport tests, and
npm/branch-services.d.tsagainstcontracts.rs. - Format check:
origin/mainat6f18b1f8carries SQLite 58 / PostgreSQL 2 fromb20fabc7b(#1835); this head carries SQLite 58 / PostgreSQL 2 for the title.git merge-base --is-ancestor b20fabc7b 8a1bb897fails, which is why the branch never saw it. - Merge check:
git merge-treeagainstorigin/main6f18b1f8reports content conflicts inpostgres.rs,sqlite.rs,tree_protocol.rsandnative-storage-format.md; GitHub reports the PRCONFLICTING/DIRTY. - Generated bindings: no service type changed in this delta and
branch-services.d.ts:1233and:1379declaretitle?: string, matchingOption<String>, so no regeneration is due.
Not verified
- No GitHub check runs exist for this head:
gh pr checks 2550reports none, andcommits/29d0a13d5/check-runsand the branch's workflow runs are empty, so the "22 commands pass" in the PR body is author-reported only. - Did not run any Rust test locally, including the ignored PostgreSQL group; the upgrade, the page crossing and the
U+0000round trip are source-read plus the author's evidence. - Did not run the TUI, Web or dim-electron against a titled or upgraded store; the client compatibility conclusion is from the prior head's review and unchanged code.
Verdict: REQUEST_CHANGES — the three prior storage and restore blockers are fixed, but the title now shares SQLite format 58 and PostgreSQL format 2 with main's #1835, which defeats the very guard those markers exist for.
Open a PostgreSQL format 2 store, as the daemon before the title step writes it, through the 2-to-3 step: the title column and its CHECK arrive, the child names are filled from the untitled creations, the #1835 event reads back unchanged, a failed backfill rolls the whole step back, and a second open reads the filled names. Open a SQLite format 58 store, as that daemon writes it, through the v59 marker step: the marker moves, no business row changes, the #1835 event reads back, and a cold restore names the child line from its creation prompt. Refuse format 4 on the upgraded PostgreSQL store with AgentError::Storage, the error kind the same gate returns on a daemon that only knows format 2.
Use qualified paths for the error kind and the provider-tool types so the new tests leave the file's import block byte-identical and the round's unittest diff stays purely additive.
|
Fixed in 45832e9, 0d2f9fa, 7278fa1, merged with main in 47814b5, 7a03aba, 403b97f. SQLite keeps main's v58 marker-only step for #1835 and gives the title its own v59 marker-only step: PostgreSQL keeps main's marker-only 1 to 2 step and adds the title as 2 to 3: The read-only import admits v57 through v59; a v57 or v58 source carries no title and a v59 source may (import.rs:L361). A PostgreSQL format 2 store as main writes it, with a A SQLite v58 store as main writes it, with a A store above the daemon's format is refused at open: the SQLite FORMAT+1 case asserts The bounded pages, the last-marker ordering and the rollback assertions stay in |
zerob13
left a comment
There was a problem hiding this comment.
Approved 7278fa1213ab050a7e26c4099da2756f96b819e5. This resolves the format collision with main. SQLite retains v58 for the provider-output events and introduces v59 for branch titles. PostgreSQL retains format 2 and introduces format 3. Its upgrade adds the title column, fills it in bounded pages, and advances the marker after backfill in the same transaction. Previous finding · SQLite steps · PostgreSQL upgrade
I ran 15 focused tests on this commit: three SQLite storage tests, two cold-restore tests, and ten import and upgrade tests against disposable PostgreSQL 17.12. All passed. The format-2 fixture retains an existing provider-tool event and the store ID through upgrade. A failed backfill rolls back the column and marker and permits a clean retry. The tests also cover U+0000 titles, v57/v58 SQLite imports, and reopening a store after a multi-page backfill. I inspected the older daemon’s format gates for downgrade refusal; I did not run an old binary. PostgreSQL fixture · SQLite fixture
The merge tree is clean against main at 7643bd66cf65b82210dc16aff41d1db6fce6bcb1. Windows and macOS passed, and Linux was still running at verification. CI
Fixes #2549
Refs #2000 #2070
branchcreateandsession.branch_createnow take an optionaltitle: one non-empty line of at most 120 characters that names the line.promptstays the child line's first input exactly as written, and a line without a title is named by the first line of its prompt. The daemon advertises the new request member inhello.features, and a titled creation still reaches older v3 and v4 clients with the event data they already decode.What changed
BranchCreateDatacarries an optionaltitlethat is omitted when absent and rejects an explicit null (events.rs:L1176);is_valid_branch_titleaccepts one non-empty line of at most 120 Unicode scalar values (events.rs:L1188). The event projection leavesbranch/createdatain the shape earlier clients decode:titleis removed fromdatafor every protocol version and travels only as the optional top-level envelope member of v3 and v4 events (tree_protocol.rs:L201, tree_protocol.rs:L345). The native store format keeps main's v58 marker-only step for Support DeepSeek's first-party web search in the native provider runtime #1835 and gives the title its own v59 marker-only step,(58, &[]), with no table or row rewrite; a new line's directory row stores the name it is shown by, in the same transaction as itsbranch/create, while a row written before that keeps no name (sqlite.rs:L22, sqlite.rs:L560). The frozenv1types and the event fixtures are unchanged.branch_contract::a_branch_title_is_optional_and_never_null(branch_contract.rs:L247),storage_flow::a_format_57_store_is_migrated_by_the_title_marker_alone(storage_flow.rs:L10434),tree_protocol::tests::a_v2_branch_create_carries_no_title(tree_protocol.rs:L719) andtree_protocol::tests::a_v3_branch_create_carries_its_title_in_the_envelope(tree_protocol.rs:L750) pin the event, the upgrade and both projections.branch/createbody for a line that enters the directory.timeline_branches.infocarries the name from the write that created the row (timeline.rs:L3635). A row written before the row carried a name is read byensure_titleonly at the five points where the restore keeps the line, and before that point's side effect: an ended line (timeline_tree.rs:L3360), an ended parent's opened child (timeline_tree.rs:L3385), a line whose own end the restore completes (timeline_tree.rs:L3414), a copied line it closes (timeline_tree.rs:L3460), and a line it mounts (timeline_tree.rs:L3487); the helper projects onlydata.titleanddata.prompt(timeline_tree.rs:L2048). The four dropped cases read nothing: a recorded failed creation, a child of an inactive line that never opened, an ended parent's child that never opened, and an interrupted creation.branches::a_cold_restore_names_ended_lines_without_reading_their_creationscorrupts both ended lines' creation bodies and checks that the Session still publishes and the directory names them (branches.rs:L1741);branches::a_cold_restore_drops_legacy_rows_without_reading_their_creationscorrupts an interrupted creation before the first restart and checks thatmainpublishes, the directory excludes it, its parent records onebranch/create-failed, and a second restart still finds one (branches.rs:L1970);branches::a_format_57_directory_keeps_names_for_open_ended_and_copied_lineskeeps the names of an open line, an ended line and a fork-copied line (branches.rs:L1877), andbranches::a_format_57_ended_line_is_named_by_its_prompt_after_upgradecovers the older ended row (branches.rs:L1808).BranchInputhas an optionaltitle(timeline_tree.rs:L5712) and refuses it on any action other thancreate(timeline_tree.rs:L5773);titlemust be one non-empty line of at most 120 characters at the tool (timeline_tree.rs:L5776), atsession.branch_create(connection/tree.rs:L961), and atTimelineTree::create_child(timeline_tree.rs:L2841), before any fact is written, through the one shared function. The schema addstitlewithminLength: 1andmaxLengthset to that bound, and restores thepromptdescription tocreate: the purpose of the new line.(timeline_tree.rs:L6750).branch_flow::a_branch_title_must_name_one_line_before_any_fact(branch_flow.rs:L5665),branch_flow::a_branch_title_at_the_limit_passes_and_one_more_character_is_refused(branch_flow.rs:L5804),branch_flow::the_tree_takes_a_title_at_the_limit_and_refuses_one_more(branch_flow.rs:L5851) andbranches::a_branch_title_at_the_rpc_limit_passes_and_one_more_is_refused(branches.rs:L1616) cover the three boundaries and the bound with multi-byte characters. The same check runs on the title a registeredbeforeproduced, inside the creation callback and before the appended fact and its reservation exist (timeline_tree.rs:L2840): a rewritten title that names no single line writes no creation fact and reserves no line, while a valid one is the name in both the fact and the directory and the child still receives the prompt.branch_flow::a_rewritten_title_is_validated_before_the_fact_and_names_the_line(branch_flow.rs:L3319) covers both rewrites in one creation flow.session.branch_createtakes the optional member (protocol.rs:L992), and the hello advertisessession.branch_create.titlebeside the method through one shared constant (protocol.rs:L336, transport.rs:L733). A client sendstitleonly when the feature is offered; otherwise it omits the member and the daemon names the line by the first line ofprompt(timeline-branches.md:L687).branches::branch_create_title_is_advertised_beside_the_method(branches.rs:L1594) asserts both feature strings on a real hello.first_inputandrecorded_purposestill usedata.promptverbatim (timeline_tree.rs:L6533, timeline_tree.rs:L5308); the roster and the directory name a line by itstitleand fall back tofirst_line(prompt)at 120 characters (timeline_tree.rs:L4467).branch_flow::a_load_names_a_titleless_line_by_its_prompts_first_line_in_the_roster(branch_flow.rs:L5915),branches::a_line_without_a_title_is_named_by_its_prompts_first_line(branches.rs:L1297) andbranches::a_restarted_session_keeps_titles_and_names_untitled_lines_by_their_prompts(branches.rs:L1676) cover the roster, the fallback and restore.TimelineInfoandBranchOptionscarry the optional title (contracts.rs:L158, contracts.rs:L211);session.branch_createaccepts it (protocol.rs:L992), andsession.branchesandsession.branch.getreturn it throughBranchInfo(tree_protocol.rs:L27). Protocol v3 and later replies carry the title; a frozen v2branch/createclears it.branches::branch_create_and_the_directory_carry_a_lines_title(branches.rs:L1221) andbranches::a_v2_branch_create_reply_carries_no_title(branches.rs:L1359) cover both directions. The generated declarations publish the optional title for creation options and directory rows astitle?: string(branch-services.d.ts:L1546, branch-services.d.ts:L1400), narrowed from the generator's present-or-absent table (types.rs:L841), which refuses a declaration that no longer carries a nullable member to narrow (types.rs:L846); the stored directory row follows the same shape (plugin.d.ts:L818).runtime/plugin-sdk.test.mjstype-checks the packed declarations, where omission and a string compile and an explicitnullis an error, andruntime/fixtures/timeline-store.tschecks the stored name on the wire (timeline-store.ts:L70).datain the shape it already decodes and the title in the envelope:branches::a_legacy_v3_client_decodes_a_titled_creation_live(branches.rs:L1405) andbranches::a_legacy_v3_client_decodes_a_titled_creation_in_history(branches.rs:L1465) decode the real events with a copy of the pre-change strict type.dim-client'sBranchEntrydecodes the field (wire.rs:L630) and its event decoder reads the envelope member (wire.rs:L192),npm/client-protocol.d.tsdeclares both (client-protocol.d.ts:L197, client-protocol.d.ts:L367), andweb/src/rpc/read.tsreads it for directory rows and creation facts (read.ts:L321, read.ts:L713).a_branch_create_reads_the_lines_title_from_the_event_envelope(connection.rs:L243) covers the client. This change adds no TUI or Web UI wiring.timeline_branches.title BYTEAwith the root-null check (schema.sql:L19, postgres.rs:L211) and filling each existing child's title from its storedbranch/createin keyset pages of 64 rows, each page written back with one arrayUPDATE(postgres.rs:L54, postgres.rs:L217), before the marker moves (postgres.rs:L219). A child without its creation body fails the upgrade, so the column, the names and the marker roll back together, and a second open skips the backfill. A PostgreSQL format 2 store written before this change, with astep/provider-toolevent and untitled creations, opens and moves to 3 with its child names filled from the creation prompts and the event unchanged (postgres_import.rs:L684); a SQLite v58 store does the same at 59 (storage_flow.rs:L10495). A store above this daemon's format is refused at open by the same gate: SQLite by the existing FORMAT+1 case (storage_flow.rs:L4926) and PostgreSQL by the format 4 assertion above. A daemon that knows only 58/2 meets a 59/3 store at those same gates and refuses it at open. A new creation inserts the name's UTF-8 bytes and the directory read validates UTF-8 (timeline.rs:L228, timeline.rs:L444); a fork copies the column unchanged, and the import validates the target name the same way (import.rs:L215). Any other version is refused at open (postgres.rs:L226). The read-only import admits v57, v58 and v59 sources after the source opens read-only (import.rs:L361), and a retry that finds the committed receipt completes the local binding instead of transferring again (import.rs:L281, binding.rs:L109).postgres_upgrades_a_format_one_store_and_keeps_titled_lines(postgres_import.rs:L530),postgres_keeps_nul_titles_across_upgrade_create_import_and_fork(postgres_import.rs:L989),postgres_backfills_format_one_titles_in_batches_and_a_second_open_skips_them(postgres_import.rs:L1175),sqlite_v57_source_imports_directly(postgres_import.rs:L1356),sqlite_v57_pending_import_completes_the_local_binding(postgres_import.rs:L1506) andsqlite_other_source_formats_are_rejected_explicitly(postgres_import.rs:L1591) cover the upgrade, both import paths and the rejected formats against a disposable instance.titleoncreate, in the schema, in the roster name and in the event envelope, with the hello feature and the fallback (docs/design/timeline-branches.md:L441, docs/design/timeline-branches.md:L446, docs/design/timeline-branches.md:L687), with the Chinese translation (docs/zh/design/timeline-branches.md:L416, docs/zh/design/timeline-branches.md:L421, docs/zh/design/timeline-branches.md:L570); the native storage format records v59 as the title's marker-only step above main's v58 (native-storage-format.md:L3), and the PostgreSQL storage design records the format transition and the import range (the bytea representation and bounded backfill at postgres-session-storage.md:L19, the import range at postgres-session-storage.md:L45); the resume contract states which legacy rows still read a creation body (timeline-branches.md:L988, timeline-branches.md:L857).Interface change
hello.featuresgainssession.branch_create.title. A client sends the request member only when the feature is offered.branchtool andsession.branch_createlimittitleto 120 characters, declared asmaxLengthin the tool schema.timeline_branches.titleasBYTEAUTF-8 bytes withCHECK (branch_id <> 'main' OR title IS NULL); a format 1 store first passes the marker-only format 2 step, and a format 1 or format 2 store then adds the column, fills it in keyset pages of 64 rows with one arrayUPDATEper page, and moves the marker last, and a daemon that knows only format 1 or format 2 refuses the upgraded store at open.titleintimeline_branches.info; the format moves to 59 by a marker-only step, and neither the v58 step nor the v59 step rewrites a row.nullis a type error.Existing tests
branch_flow::a_title_is_refused_with_what_names_a_line(branch_flow.rs:L5535) now asserts that a first call carryingtitleopens the line, thatBranchCreateData.titleand the roster entry carry the title, and that the child's first input is still the prompt; its schema assertion addstitleand the restoredpromptdescription, and the no-title fallback assertion stays. The interrupted-branch restore fixture thatmainbrings intobranch_flow.rsconstructsBranchCreateDataand gainstitle: None(branch_flow.rs:L15571), keeping its untitled behaviour. Every other change to an existing test is an additivetitle: Nonein a construction literal forBranchOptions,BranchCreateDataorBranchEntry. The existingweb/src/rpc/read.test.mjsround-trip test keeps its main version byte for byte; title decoding and the refusal of a non-string title are covered by the newbranch_create replies keep a line title and refuse a non-string(read.test.mjs:L150) andbranch titles are decoded on directory rows and creation facts(read.test.mjs:L160). The postgres import test thatmainbrings in,sqlite_import_rolls_back_retries_and_keeps_history_and_shared_files, gainstitle: Nonein its construction literal (postgres_import.rs:L113), and now publishes a titled creation (postgres_import.rs:L138); its original assertions are unchanged.Design rule checklist
branch/createfact (events.rs:L1176), the tool and request entries stay in TimelineTree and the App Server (timeline_tree.rs:L5712, protocol.rs:L992), and the directory row is written by the session store that already owns it (storage/timeline.rs:L3635).branch/createevent.beforecallbacks only transform the draft synchronously: they never block the write or wait for external work (ask the event owner for a generic field when the draft cannot express it). Entries validate only shape and authorization; feature checks belong to the feature owner. A registeredbeforemay rewrite the creation, so the same single-line and length check runs on the rewritten draft inside the creation callback, before the fact and its reservation exist, and it awaits no external work (timeline_tree.rs:L2838); the tool and request entries check only their own input shape (timeline_tree.rs:L5773, connection/tree.rs:L961).datathere so v2, v3 and v4 clients decode what they already know (tree_protocol.rs:L201).branch/create(storage/timeline.rs:L3635), the PostgreSQL path inserts the row inside the append transaction (postgres/timeline.rs:L228), and the format steps write no fact (sqlite.rs:L560).data.titleanddata.promptfrom that line's creation (timeline_tree.rs:L1987); it consults no other part's state.injectsandprovidesare unchanged.branch/create, the fact the roster, the directory and a cold restore read, and the directory row is written by its storage owner; no UI-only state enters the Timeline (timeline-branches.md:L687).Documentation
adr-erratum(ADR 008). No ADR is touched; the branch, storage and export designs and the Chinese mirrors that exist are updated for the title (timeline-branches.md:L441).Verification
On commit 7278fa1, the 25 commands of the gate list for this change pass:
node scripts/adr-check.mjs --base origin/main,cargo fmt --all -- --check --config error_on_line_overflow=true,cargo clippy --locked -p xtask-check --all-targets -- -D warnings,cargo clippy --workspace --all-targets --locked -- -D warnings,cargo run --locked -p xtask-check,cargo run --locked -p xtask -- check,cargo run --locked -p xtask -- typesfollowed bygit diff --exit-code -- npm/branch-services.d.ts, eightcargo testcommands, the plugin SDK type check, the ignored PostgreSQL group and seven focused runs. The full workspace regression runs in CI.cargo test --locked -p xtask-check: 127 passed;-p dim-agent-types: 10 lib tests and 54 contract tests passed;-p dim-agent-runtime --lib: 14 passed;-p dim-agent-capabilities --test capabilities_flow: 786 passed, 1 ignored;-p dim-app-server --lib: 166 passed, 12 ignored;-p dim-app-server --test app_server_flow: 622 passed, 12 ignored;-p dim-app-server --test transport_flow: 812 passed, 87 ignored;-p dim-migration --test migration_flow: 19 passed.node --test runtime/plugin-sdk.test.mjs: the packed declarations compile the author guide and enforce the public call shapes, 2 tests passed.postgres_upgrades_a_format_one_store_and_keeps_titled_lines,postgres_upgrades_a_format_two_store_written_before_the_title_step,a_format_one_line_is_named_by_its_prompt_on_a_cold_restore,postgres_keeps_nul_titles_across_upgrade_create_import_and_fork,postgres_backfills_format_one_titles_in_batches_and_a_second_open_skips_them,sqlite_v57_source_imports_directly,sqlite_v58_source_imports_directly,sqlite_v57_pending_import_completes_the_local_bindingandsqlite_other_source_formats_are_rejected_explicitly.postgres_timeline_flow::a_v1_store_upgrades_to_v2_keeping_its_id_and_facts,postgres_keeps_nul_titles_across_upgrade_create_import_and_fork,postgres_backfills_format_one_titles_in_batches_and_a_second_open_skips_them,branches::a_cold_restore_drops_legacy_rows_without_reading_their_creationsandbranches::a_format_57_directory_keeps_names_for_open_ended_and_copied_lines.capabilities_flowrun hithost_platform_flow::a_slow_reader_frees_space_and_the_pipe_resumes(TaskRunning); the case is registered in the known-failures table, passed alone in 0.23 s and passed in the full rerun.