Repository navigation
docs: define thread overview inventories - #2522
Conversation
|
@Simon-He95, one point to clarify for the #2514 scope review: the existing |
eric8810
left a comment
There was a problem hiding this comment.
The owner split is appropriate for #2514: attachments and media reuse existing byte readers, while Collaboration keeps its own terminal facts. No client ledger or new store is needed. One contract needs to be settled in this owner design before the two implementations independently choose a paging policy.
A fixed cutoff must freeze row eligibility and ordering, not only raw event publication. The shared contract excludes facts published after the first page, but also permits an unresolved row to appear on “a later page/cutoff.” For example, if a row sorts ahead of the outgoing cursor but only becomes correlatable after page one, admitting it on page two silently loses it with keyset paging; replaying page one instead would produce different rows under the same cutoff. Please specify that eligibility (including all required correlation facts) and sort position are determined as of the original cutoff. A row that settles after that cutoff is visible only in a fresh bounded window. This does not require a new store; the implementation can choose how to represent the owner watermark and stable sort key. Shared contract
Please align verification item 1 with the lifecycle section: same-attachment retries prove replay of the same cutoff/cursor; reconnect deliberately opens a fresh window and must reject the old cursor. Add an acceptance case for a previously uncorrelatable row with a sort position ahead of the previous cursor: it cannot move into the old window, and a fresh window sees it once. Lifecycle and verification
I agree with the author's separate clarification that failed/cancelled results which were committed should still count as finished. This is a docs-only review; no runtime change is claimed.
yyhhyyyyyy
left a comment
There was a problem hiding this comment.
REQUEST_CHANGES
The design answers #2514's owner split and keeps method names, wire fields, cursor encoding and flow tests in #2511/#2512. I agree with eric8810 on freezing row eligibility and sort position at the cutoff and on fixing verification item 1 to match the reconnect rule, so I do not restate them. The author's comment already proposes keeping every committed result, including failed and cancelled outcomes; the document should still say so.
P2: The first-page cutoff cannot align with the display window.
Lines 46-49 make the first cutoff server-chosen. Existing owner inventories accept through? so a client can read them at the window's fixed head (crates/dim-app-server/src/collaboration/pending.rs:8-14, crates/dim-agent-capabilities/src/workspace_tools/pending.rs:157-162, docs/design/background-task-list.md:131-138). Scenario: a client pins session.history at attach sequence H, then reads the overview; the server picks H' > H. The inventory returns a row whose originating message is above H, and the live stream replays that message after H. The client cannot tell whether the row is a duplicate, and the sources read states no dedupe key. Fix: allow the first page to pin an optional through at or below the published head, defaulting to the head, and keep it immutable; state the row identity used against live events.
P2: The source read has no single owner or face.
Line 66 says "Attachments/SessionStore owner", line 34 says "SessionStore/Attachments projects source facts", and line 197 repeats the pair. The template asks each owner to answer §7.1 (docs/templates/design.md:17-21), and ADR 002 D1 assigns state to one owner. Scenario: #2511 cannot decide whether to register a Session method on Attachments, a process face on SessionStore, a built-in read, or a combined read; the two owners may each implement half. Fix: name the owner and face, for example Attachments owns the Session-scoped read and calls sessionFiles, and add the §7.1 answer.
P2: Two "existing" protocol members are not defined in this repository.
Lines 82-83 cite sessions.read_image_attachment; line 105 cites runningSubagents. rg -uuu and git log -S find both strings only in this PR. The published byte read is attachment.read (docs/design/plugins/Attachments.md:78, docs/design/appserver/session-files.md:420). The existing running-member read is session.collaboration.pending, whose items carry eventId (docs/design/collaboration-timeline.md:283-288, crates/dim-app-server/src/collaboration/pending.rs:133-150). The attach reply has no runningSubagents field (crates/dim-app-server/src/protocol.rs:1479-1509). Scenario: a client implementer cannot resolve the names; if runningSubagents is a private desktop field, the public design should not depend on it, and the merge by request/event identity needs an identity that field may not carry. Fix: use the public reads above or link the contract that defines each alternate name.
P3: The sources old-daemon fallback is missing.
Lines 111-115 define a fallback only for finished delegations; lines 143-146 do not say what a sources panel shows on a daemon without the new read. Issue #2511 requires the loaded-window history fallback. Scenario: an implementer falls back to a full history scan, which the design forbids. Fix: move the fallback to a shared paragraph and name the loaded-history fallback for sources.
P3: Rule check and citation gaps.
Line 184 says the check covers §4, §1, §5 and ADR 002 D1-D5, but the table has no §1 or §5 rows and no §7.1 or §7.2 owner answers. The template requires §4, §1 and §7.2 here (docs/templates/design.md:29-32) and §7.1 for each owner in the own contract section (docs/templates/design.md:17-21). Lines 89-90 say the fixed history window is described by CLI attachment input and Session files; the window contract is docs/design/appserver/session-history-window.md. Fix: add the missing owner rows and link the window document.
P3: The child Session wording overstates the authorization boundary.
Verification item 2 says a guessed child Session id cannot cross the boundary. The finished read returns child Session ids (docs/design/collaboration-timeline.md:288-292), and session.attach authorizes a real Session id by protocol version and availability, not by a parent-child relationship (crates/dim-app-server/src/connection.rs:1013-1041). Scenario: a client that can see the parent can attach to a child id the row returns; the wording implies a relationship check that does not exist. Fix: say the inventory itself does not read child content or file bytes, and that child content still goes through the existing Session attach/history authorization.
Verification: node scripts/adr-check.mjs --base origin/main passes; git diff --check passes. CI shows ci-ok passing and the docs-only jobs skipped. I did not run cargo; runtime behavior of the proposed reads and the private desktop names were not verified.
| identity before reading rows. It does not infer authorization from a file id, child Session id or | ||
| cursor supplied by the caller. | ||
|
|
||
| The first page establishes a server-chosen, immutable `through` cutoff. The response carries that |
There was a problem hiding this comment.
The first page is server-chosen here. Existing owner inventories accept through? so a client can read them at the display window's fixed head (crates/dim-app-server/src/collaboration/pending.rs:8-14, crates/dim-agent-capabilities/src/workspace_tools/pending.rs:157-162, docs/design/background-task-list.md:131-138). Without that option the overview can return rows above the loaded window and duplicate live events, and the sources read has no stated dedupe key. Allow an optional first-page through at or below the published head, defaulting to the head.
There was a problem hiding this comment.
The first page now accepts the display window’s through when it is valid for the requested scope. Row eligibility, correlation and ordering are frozen there. Later-settling rows appear once in a fresh window. Source occurrences have a stable origin and item key for reconciliation across history and live observations. Paging contract · Source identity
| row. The owner may omit a row whose required correlation is not yet settled and expose it after a | ||
| later page/cutoff. | ||
|
|
||
| ### Sources and outputs (Attachments/SessionStore owner) |
There was a problem hiding this comment.
This heading and line 197 leave the source read with two owners. The template asks each owner for resources, lifecycle and operations (docs/templates/design.md:17-21), and ADR 002 D1 assigns state to one owner. State whether Attachments owns the Session-scoped read and calls sessionFiles, or SessionStore provides the face. #2511 cannot choose safely otherwise.
There was a problem hiding this comment.
Attachments owns the proposed Session-scoped source inventory on its existing sessionMethods face. It projects the Session’s Timeline and uses SessionStore’s sessionFiles face for file data. SessionStore retains ownership of the files, IDs and storage lifecycle. Owner contract
| crawl or classify arbitrary message prose and does not include web/MCP result contents in this cut. | ||
|
|
||
| The returned reference is accepted by the already published `attachment.read` or | ||
| `sessions.read_image_attachment`-style operation. The inventory does not replace those operations, |
There was a problem hiding this comment.
sessions.read_image_attachment has no definition in this repository; git log -S shows the string is introduced by this PR. The published byte read is attachment.read (docs/design/plugins/Attachments.md:78, docs/design/appserver/session-files.md:420). Drop the second name or link its public owner contract.
There was a problem hiding this comment.
The source section now names the published byte read, attachment.read, and links to its contract. Generated media without a compatible recorded reference remains in its existing history representation. Source references
| child Session or completion time for a failed delivery that never created one. | ||
|
|
||
| Correlation is by the parent branch and the `collaboration/request` event identity. Two requests to | ||
| the same member are two rows. A client can merge these rows with the existing `runningSubagents` |
There was a problem hiding this comment.
runningSubagents is not defined by any public contract here; it appears first in this PR, and the attach reply has no such field (crates/dim-app-server/src/protocol.rs:1479-1509). The existing running-member owner read is session.collaboration.pending, whose items carry eventId (docs/design/collaboration-timeline.md:283-288, crates/dim-app-server/src/collaboration/pending.rs:133-150). Use that read or link the public contract; if runningSubagents is a private desktop field, the public design should not depend on it.
There was a problem hiding this comment.
The design now uses session.collaboration.pending as the public unfinished-request read. The request’s eventId, together with parent Session and branch, identifies the same request across pending, finished and live observations. Two requests to the same member retain separate rows. Delegation identity
|
Thanks, @eric8810 and @yyhhyyyyyy. The design now freezes eligibility, required correlations and sort position at the first cutoff. A row that settles after that cutoff appears in a fresh window only. The acceptance cases cover sparse pages, same-attachment replay, rejection of a pre-reconnect cursor and fresh visibility of a late row. The first page accepts an optional published cutoff for the requested scope so clients can align it with the display window. Paging contract · Verification Attachments owns the source inventory and retains This is a documentation update. The ADR freeze, whitespace and documentation link checks passed. Please re-review on the updated head. |
yyhhyyyyyy
left a comment
There was a problem hiding this comment.
REQUEST_CHANGES
The rewrite resolves the round-1 shape problems: one owner and face per read, a client-supplied first-page cutoff, a stated row identity, public contract names, both old-daemon fallbacks, and accurate child Session wording. One contract conflict and two smaller consistency gaps remain.
P2: The reconnect rule contradicts the stateless cursor and #2524.
Lines 49-50 require the server to reject a cursor from another connection authorization context and to reject one presented on a new connection; line 117 says a reconnect starts from a first page; verification item 1 at line 150 requires reconnect to reject the submitted old cursor. QueryCursor is "Continuation data bound to the query and logical scope, without server-side state" (crates/dim-agent-runtime/src/timeline_query/properties.rs:328-333), and line 39 already says a cursor conveys no authority. #2524, the open #2512 implementation, does the opposite: its new test drops the first client, creates a fresh connection, and resumes the saved through plus next successfully (crates/dim-app-server/tests/transport_flow/collaboration.rs, PR #2524 hunk at line 3155). Scenario: a client reconnects and continues a bounded finished-delegation read; this document requires rejection while the slice's flow test requires success. Fix: remove "connection authorization context" and the stale-on-reconnect sentence; allow a continuation on any authorized connection for the same Session, branch/scope and cutoff, and let a client that wants new facts start a first page. Update line 117 and verification item 1 to match. This withdraws my round-1 agreement with eric8810 on rejecting the old cursor; the stateless cursor makes resumption safe and simpler.
P3 (optional): The source read cites the mechanism caller's Session facade, not the Session-scoped read owner.
Line 71 projects source records through "the Session's Timeline read" and links docs/design/contracts/session-access.md#92-fixed-prefix-read, whose Session::sequence/Session::query is the RoutedSession/Line handle held by the mechanism caller (crates/dim-agent-runtime/src/route.rs:459-505). Attachments is a Session part: crates/dim-agent-attachments/Cargo.toml depends on dim-agent-capabilities and dim-agent-runtime, and crates/dim-app-server/Cargo.toml:31 depends on dim-agent-attachments, so it cannot take the mechanism caller's RoutedSession/Line path. The Session-scoped read operation is the timelineTree data face's read (docs/architecture/rust-agent/plugins/TimelineTree.md:26,49-52), which CollaborationSession already uses (crates/dim-app-server/src/collaboration/pending.rs:52,128). Scenario: #2511 follows the link and cannot wire the dependency, or adds a process path that ADR 021 rejects. Fix: link the timelineTree read face and name its read operation for the selected branch. The §7.2 row at line 191 says each call reaches the owning operation; this link is the one that does not.
P3 (optional): session.methods cannot detect an in-place paged extension.
Lines 133-136 tell clients to discover the proposed reads through session.methods and treat "the paged delegation read" as a separate support state from session.collaboration.finished. #2524 extends session.collaboration.finished in place with optional after and next (crates/dim-app-server/src/collaboration/pending.rs in PR #2524; docs/design/collaboration-timeline.md in that PR), so old and new daemons list the same method. Scenario: a client sees the method in session.methods and cannot tell whether a continuation exists. Fix: keep discovery for new methods, and for an extended read treat the reply's cursor as the signal, which lines 47-48 and 58-59 already make authoritative.
Round-1 dispositions:
- 4781390826, first-page cutoff and dedupe key: fixed at lines 41-63 and 85-89. The first page accepts an optional
through, freezes eligibility and order, and each read states its row identity. - 4781390837, source owner and face: fixed at lines 69-75. Attachments owns the Session method, uses
sessionFilesfor file data, and owns no durable state; the resources, lifecycle and operations answers are in that section and in lines 115-124. - 4781390842,
sessions.read_image_attachment: fixed. The name is gone and line 78 linksattachment.read. - 4781390848,
runningSubagents: fixed. The name is gone and lines 107-108 usesession.collaboration.pendingandeventId. - Sources old-daemon fallback: fixed at lines 133-139.
- Rule-check gaps: fixed for §1, §5 and §7.2 and for the window link at line 135. The Timeline owner citation above remains.
- Child Session wording: fixed at lines 110-111 and verification item 2.
Cross-PR: #2524 is the P2. The other open doc PRs do not touch this file; #2399, #1881 and #2513 edit docs/INDEX.md at different entries, and #2455, #2478 and #2480 do not change the contracts this design links. origin/main is still 5aef64f and is the merge base.
Verification: node scripts/adr-check.mjs --base origin/main passes; git diff --check passes. CI shows ci-ok passing and the docs-only jobs skipped. I did not run cargo; #2511 has no implementation PR, and #2524's current head may change.
| The first page fixes and returns `through`. When paging can continue, the response also returns an | ||
| opaque cursor. A continuation must supply both unchanged. The server rejects a cursor for another | ||
| inventory, Session, branch/scope, cutoff or connection authorization context. A cursor from before | ||
| reconnect is stale and is rejected if presented on the new connection. The client gets these values |
There was a problem hiding this comment.
A cursor is stateless here. QueryCursor is "Continuation data bound to the query and logical scope, without server-side state" (crates/dim-agent-runtime/src/timeline_query/properties.rs:328-333), and line 39 already says a cursor conveys no authority. #2524, the open #2512 implementation, drops the first client, creates a fresh connection, and resumes the saved through plus next successfully (crates/dim-app-server/tests/transport_flow/collaboration.rs, PR #2524 hunk at line 3155). Scenario: a reconnecting client continues a bounded read; this sentence requires the server to reject it. Fix: remove "connection authorization context" and this stale-reconnect sentence; a continuation may use any authorized connection for the same Session, branch/scope and cutoff. Update line 117 and verification item 1.
There was a problem hiding this comment.
@eric8810 @yyhhyyyyyy, the two reviews describe different observable results for the same request. After reconnect, a client passes normal Session admission and presents the original query, scope, cutoff and cursor. The first review asks the server to reject it and start at page one. The second asks the server to continue that fixed window.
I recommend allowing continuation after a fresh authorization check. QueryCursor is scoped to the logical query, the client can discard late replies from its old projection, and a new first page is still available when the client wants newer rows. A mismatched query, scope or cutoff must be rejected. A changed connection alone would not invalidate an otherwise valid cursor. The #2524 implementation tests this behavior for Collaboration. Current cursor contract · Earlier review · Proposed implementation
@eric8810, does authorized continuation at the identical cutoff meet your original consistency requirement, or is there a separate requirement for connection-bound invalidation? I have prepared the design and acceptance wording locally and will use the agreed behavior for both owner reads.
|
|
||
| [Attachments](../plugins/Attachments.md) owns the proposed Session-scoped inventory operation on | ||
| its existing `sessionMethods` face. It is a Session method provider with no durable state. It projects | ||
| committed source records through the Session's [Timeline read](../contracts/session-access.md#92-fixed-prefix-read) |
There was a problem hiding this comment.
This links the Session::sequence/Session::query facade held by the mechanism caller (crates/dim-agent-runtime/src/route.rs:459-505), not a read Attachments can wire: crates/dim-agent-attachments/Cargo.toml depends on dim-agent-capabilities and dim-agent-runtime, while crates/dim-app-server/Cargo.toml:31 depends on dim-agent-attachments. The Session-scoped operation is the timelineTree data face's read (docs/architecture/rust-agent/plugins/TimelineTree.md:26,49-52), which CollaborationSession uses (crates/dim-app-server/src/collaboration/pending.rs:52,128). Fix: link that face and name the read operation; otherwise #2511 has no dependency it can take.
There was a problem hiding this comment.
Confirmed against the provider: the Session-scoped timelineTree.read operation is the appropriate dependency for the selected branch. The pending documentation edit names it for both providers and keeps sessionFiles separate for file data. TimelineTree
| history and live notices by row identity. A terminal summary settles the matching pending request in | ||
| the client projection. | ||
|
|
||
| Discover proposed read support through [`session.methods`](../contracts/session-boundary.md#a1-method-contributions) |
There was a problem hiding this comment.
This cannot detect #2524's in-place paging: that slice extends session.collaboration.finished with optional after and next (PR #2524's crates/dim-app-server/src/collaboration/pending.rs and docs/design/collaboration-timeline.md), so old and new daemons list the same method. A client sees the method in session.methods but cannot tell whether a continuation exists. Fix: keep discovery for new methods, and for an extended read use the reply's cursor, which lines 47-48 and 58-59 already make authoritative.
There was a problem hiding this comment.
Agreed. session.methods identifies a newly named read. For an existing method extended in place, the client follows a cursor when the reply supplies one. An older reply without a cursor ends that bounded read. The pending documentation edit covers both forms. Session method discovery
|
请 @eric8810 和 @yyhhyyyyyy 复评 另两处评审意见也已处理。设计列出 Attachments 当前的三个方法,并明确它要提供来源清单时需声明 Session 的 本次只改设计文档。 |
|
Maintenance note on |
eric8810
left a comment
There was a problem hiding this comment.
Re-reviewed 823f8022. This supersedes my earlier Request changes. Eligibility, required correlations and ordering are frozen at the original cutoff. A late-settling row only appears in a fresh window. The reconnect contract now explicitly re-admits each call on the current connection and permits resuming the same logical scope, cutoff and cursor; requesting a new first page is how clients see newer facts. The acceptance cases distinguish both paths and discard delayed responses from the replaced client projection. That matches the continuation direction in #2524. Paging contract · Acceptance cases
Attachments and CollaborationSession have explicit ownership and the old-daemon fallbacks stay bounded. Approved for the owner design only. The docs-only CI passed; this is not a runtime approval of #2524.
yyhhyyyyyy
left a comment
There was a problem hiding this comment.
APPROVE
All three round-2 findings are resolved at 823f802, and the document remains consistent with the round-1 fixes and with #2524 at 6dc892d. No new blocking findings.
Round-2 dispositions
- 4781696867, reconnect rule: fixed at lines 49-51, 116-120 and 153-155. A continuation is admitted on the current connection's access and may resume the same cutoff and cursor on any authorized connection. This matches
QueryCursor(crates/dim-agent-runtime/src/timeline_query/properties.rs:328-333), #2524's contract (docs/design/collaboration-timeline.md:316-320in PR #2524) and its reconnect test (crates/dim-app-server/tests/transport_flow/collaboration.rs:3212-3252in PR #2524). - 4781696893, source read face: fixed at lines 71-73. The Session part declares the
timelineTreedata face and callsreadat the page cutoff, matchingdocs/architecture/rust-agent/plugins/TimelineTree.md:26,49-52. ADR 002 D3 permits this same-scope core dependency, and the Report and ImageUnderstanding designs use the same face. - 4781696907, method discovery: fixed at lines 136-139. Discovery covers the new
session.collaboration.history, and the reply'snextis now the paging signal. This matches #2524's registration and reply (crates/dim-app-server/src/collaboration/pending.rs:37-38,310,402,472in PR #2524).
Whole-document recheck
No new contradiction, duplication or scope creep. The first-page through, frozen eligibility and sort position, source owner and byte read, and session.collaboration.pending fixes are intact. #2524 and the design agree on the method name, summary rows, 50-row pages, through and next, fresh-connection resumption, cutoff rejection and the terminal row key. No disagreement found.
Verification
node scripts/adr-check.mjs --base origin/main passes; git diff --check passes. CI shows ci-ok passing and the docs-only jobs skipped. I did not run cargo. #2511 has no implementation PR; #2524's head may change.
Summary
Scope
This is the #2514 owner design. Concrete API names, fields, cursor encoding, and implementation flow tests remain in the independent #2511 and #2512 slices.
Refs #2514
Verification
git diff --checknode scripts/adr-check.mjs --base origin/main