@hy-sde-org/dsh-graph-projection 0.1.2-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 hy-sde
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,6 @@
1
+ # Bilingual-pair consistency record (docs/i18n/README.md): the git blob hash of each
2
+ # side as of the last confirmed-consistent state. Both languages carry equal authority;
3
+ # after editing either side, bring the other along and re-record with:
4
+ # pnpm run verify-translation-pairing --write packages/graph/graph-projection/README.md
5
+ README.md: a12567eb83de02288a179d6432fbde36012caf05
6
+ README.zh.md: fa6f55aba703e5faf89752658dd0aeb298e75951
package/README.md ADDED
@@ -0,0 +1,139 @@
1
+ ---
2
+ description: "Serves the session's standing agent-graph snapshot from the host's graph/change publishes for clients and maintainers composing or debugging the graph projection unit."
3
+ kind: "package-reference"
4
+ ---
5
+
6
+ # @hy-sde-org/dsh-graph-projection
7
+
8
+ English | [中文](README.zh.md)
9
+
10
+ ## Summary
11
+
12
+ `dsh-graph-projection` serves the session's standing agent-graph snapshot — the whole bounded `SessionGraphProjection` (graph identity, closed/active status, revision, bounded work list, omitted counts, pending wake) — as the `graph` projection unit. The host (P7) owns graph state and publishes a complete post-change snapshot per graph movement as a `graph/change` session event; this unit folds those publishes into the session-projection seam (registry snapshot, change feed, every projection carrier) with no store coupling. Choose it in compositions that already mount the projection registry, such as the web app bundle whose graph rail is the reference consumer; assemblies without the registry are unaffected and their consumers read no graph key. Setup and publish semantics come first; the fold internals live in a collapsible developer section below.
13
+
14
+ ## Table of Contents
15
+
16
+ - [Use this package](#use-this-package)
17
+ - [Understand the implementation](#understand-the-implementation)
18
+ - [Further Exploration](#further-exploration)
19
+ - [Model Experience](#model-experience)
20
+ - [Known Limitations and Deferred Work](#known-limitations-and-deferred-work)
21
+ - [Dev Note](#dev-note)
22
+
23
+ -----
24
+
25
+ <a id="use-this-package"></a>
26
+ ## Use this package
27
+
28
+ Mount the plugin beside the session store and the projection registry when clients should render the session's agent graph from whole published values without coupling to the graph control store. The unit registers only when the registry is present.
29
+
30
+ ### Composition
31
+
32
+ ```yaml
33
+ - name: '@deepseek-ai/dsh-session'
34
+ - name: '@deepseek-ai/dsh-session-projection'
35
+ - name: '@hy-sde-org/dsh-graph-projection'
36
+ ```
37
+
38
+ ### What the value means
39
+
40
+ | Field | Meaning |
41
+ |---|---|
42
+ | `schemaVersion` | Wire format version; `1` for this projection. |
43
+ | `graphId` | The graph the snapshot belongs to. |
44
+ | `status` | `active` while the graph runs, `closed` after a finish. |
45
+ | `revision` | Host-assigned publish revision, strictly increasing per graph; the fold gates stale re-publishes on it. |
46
+ | `closed` | Mirror of the terminal state for consumers that branch on it. |
47
+ | `work` | Bounded work list: `workId`, execution-lifetime `status` (`requested`/`claimed`/`executing`/`stopped`/`finished`/`failed`), bounded `instruction` (≤300 chars), optional `operatorId`, `inputCount`. |
48
+ | `omitted` | Rail-budget overflows the host capped away: work, records, and inputs counts. |
49
+ | `pendingWake` | Whether a supervisor wake is pending delivery to the root session. |
50
+ | `updatedAt` | Host publish timestamp. |
51
+
52
+ The wire value is a whole post-change snapshot (whole-value rule): consumers replace, never merge. The host appends one `graph/change` event per graph state change with `session.append('graph/change', graphSnapshotToEvent(graphId, snapshot, revision))` — the helper exported here builds the exact payload, keeping publish revision and snapshot revision aligned. Before the first publish the unit serves `null`: the session hosts no graph yet, and consumers treat it as not-yet-available rather than an empty graph.
53
+
54
+ <a id="graph-chip"></a>
55
+ ### Graph chip
56
+
57
+ The web chat UI reads the value through the session-projection standard seat, `useProjection('graph')`; the typed key comes from a type-only import of `@hy-sde-org/dsh-graph-projection/types`, a client dev-dependency erased at runtime (no client-to-graph runtime edge). The transcript renders the chip while the projection is present and the rail has work (`work.length > 0`) or the graph is still `active`; an absent key, `null` before the first publish, or a closed graph with an empty rail renders nothing. The row reads `Continued by Agent Graph` with the summary `N work item(s) · active|closed` (`由 Agent Graph 继续` / `N 个工作项` in the Chinese UI), styled like the compaction chip. The chip is view-layer state; the chat snapshot never carries projection values.
58
+
59
+ ### Failures and recovery
60
+
61
+ The unit is inert without the projection registry: `inject` keeps the fiber pending and nothing registers, so other assemblies lack the `graph` key. Unmounting the plugin removes the key, because registrations are effects on the mounting fiber. Persisted-cache rows are schema-validated on restore — including the version-positive revision and the ≤300-character instruction bound — so a corrupt row is discarded instead of seeding a broken fold.
62
+
63
+ -----
64
+
65
+ <a id="understand-the-implementation"></a>
66
+ ## Understand the implementation
67
+
68
+ <details>
69
+ <summary>Implementation internals — click to expand</summary>
70
+
71
+ This section explains the fold behind the snapshot; the observable behavior is fully covered in [Use this package](#use-this-package).
72
+
73
+ ### Design concept
74
+
75
+ The unit is a pure fold over committed `graph/change` events. One DSH session owns one graph, so the fold replaces its state only for the graph it already hosts: a publish naming a different `graphId` keeps the standing snapshot (reference preserved, so the registry's identity gate keeps the change feed quiet) while the watermark records the observed event — the session's graph never flips mid-life. A publish whose revision does not advance past the last folded one is a stale re-publish and returns the same state reference, so repeated deliveries push nothing. The wire view is the event payload's snapshot reference itself (identity), which is exactly why the feed stays quiet across internal-only changes: no clone, no re-render.
76
+
77
+ ### Source map
78
+
79
+ | File | Role |
80
+ |---|---|
81
+ | [`src/index.ts`](src/index.ts) | Plugin entry: `inject`, unit registration on the mounting fiber |
82
+ | [`src/projection.ts`](src/projection.ts) | The fold: state schema, revision gate, wire view, publish helper, instruction bound |
83
+ | [`src/types.ts`](src/types.ts) | One home of the `graph` projection-key declaration, `graph/change` event augmentation, and wire types |
84
+ | — | No runtime invariant companion is published: the package owns one pure projection fold, `session-projection` schema-validates its served values, and re-folding the same log would duplicate the implementation instead of comparing independently maintained observations; graph-control owns the durable rows the host publishes from. |
85
+
86
+ ### Fold rules
87
+
88
+ - Uninteresting events return the same state reference; the registry's two `Object.is` gates then hold the feed to actual snapshot changes only.
89
+ - The first publish adopts any graph id (no standing graph yet); every later publish for a different id is recorded in the watermark only.
90
+ - A stale (non-advancing) revision returns the same state; a matching-graph publish replaces snapshot, watermark, and revision atomically.
91
+ - The served value is the payload snapshot by reference — the projection performs no copy, truncation, or re-derivation; bounds are the host's publish contract, validated at the persisted-state boundary here.
92
+
93
+ </details>
94
+
95
+ -----
96
+
97
+ <a id="further-exploration"></a>
98
+ ## Further Exploration
99
+
100
+ Read these pages when the unit's contract is not enough. They move from the registry that drives units to the graph packages the host publishes from.
101
+
102
+ - [Session projection subsystem](../../../docs/subsystems/session-projection.md) — the registry that drives units and serves snapshot and change-feed values.
103
+ - [Session projection registry package](../../session/session-projection/README.md) — the registry contract units register against.
104
+ - [Graph stream package](../graph-stream/README.md) — the derived stream layer whose schedule and records feed the host's published snapshots.
105
+ - [Tool graph package](../tool-graph/README.md) — the bounded model-visible snapshot vocabulary the client projection reuses with a tighter rail budget.
106
+
107
+ -----
108
+
109
+ <a id="model-experience"></a>
110
+ ## Model Experience
111
+
112
+ None, as the `graph` unit folds already-published host snapshots into a client-facing read model and registers nothing model-facing.
113
+
114
+ #### KV Cache effect
115
+
116
+ None; the package never assembles or sends provider requests.
117
+
118
+ ## Known Limitations and Deferred Work
119
+
120
+ <a id="known-limitations-and-deferred-work"></a>
121
+
122
+
123
+ These limits define what the projection serves and when the unit is absent. They are current package constraints.
124
+
125
+ - **The wire value carries the whole snapshot on every push** — ignored by the identity gate for internal-only changes, but a real re-publish delivers the complete work list (whole-value rule); splitting work into an on-demand read is deferred until sessions with many hundreds of work items need it.
126
+ - **One graph per session** — a foreign `graphId` publish never displaces the standing snapshot, so a session cannot host two graphs concurrently; multi-graph sessions would need a key per graph.
127
+ - **Status and bounds are host-trusted** — the projection validates the persisted shape and the ≤300-character instruction bound, but the live publish path trusts the host to assign execution-lifetime statuses and truncate instructions before appending.
128
+ - **`null` until the first publish** — mounting the plugin registers the key immediately, but the value stays `null` until the host publishes; consumers must handle the not-yet-available state.
129
+ - **Mounted only where the projection registry is composed** — other assemblies serve no `graph` key, and their consumers read the absence as no graph capability.
130
+
131
+ <a id="dev-note"></a>
132
+ ### Dev Note
133
+
134
+ <details>
135
+ <summary>Working context for maintainers — click to expand</summary>
136
+
137
+ None.
138
+
139
+ </details>
package/README.zh.md ADDED
@@ -0,0 +1,139 @@
1
+ ---
2
+ description: "从宿主的 graph/change 发布提供会话当前 Agent Graph 快照;面向组合或调试 graph 投影单元的客户端与维护者。"
3
+ kind: "package-reference"
4
+ ---
5
+
6
+ # @hy-sde-org/dsh-graph-projection
7
+
8
+ [English](README.md) | 中文
9
+
10
+ ## 概述
11
+
12
+ `dsh-graph-projection` 以 `graph` 投影单元提供会话当前的 Agent Graph 快照——完整且有界的 `SessionGraphProjection`(图身份、closed/active 状态、版本、有界工作列表、省略计数、待投递 wake)。宿主(P7)拥有图状态,并在每次图状态变化时以 `graph/change` 会话事件发布一份完整的变更后快照;本单元把这类发布折叠进会话投影接缝(注册表快照、变更流、每条投影载体),与存储无耦合。在已挂载投影注册表的组合中选择它,例如以图导航栏为参考消费者的 Web 应用包;没有注册表的装配不受影响,其消费者读不到 `graph` 键。装配与发布语义在前;折叠内部细节放在下方可折叠的开发者章节中。
13
+
14
+ ## 目录
15
+
16
+ - [使用本包](#use-this-package)
17
+ - [理解实现](#understand-the-implementation)
18
+ - [进一步探索](#further-exploration)
19
+ - [模型体验](#model-experience)
20
+ - [已知限制与延期工作](#known-limitations-and-deferred-work)
21
+ - [开发备注](#dev-note)
22
+
23
+ -----
24
+
25
+ <a id="use-this-package"></a>
26
+ ## 使用本包
27
+
28
+ 当客户端需要从完整发布值渲染会话的 Agent Graph 而不耦合图控制存储时,在会话存储与投影注册表旁挂载此插件。只有存在注册表时单元才会注册。
29
+
30
+ ### 组合
31
+
32
+ ```yaml
33
+ - name: '@deepseek-ai/dsh-session'
34
+ - name: '@deepseek-ai/dsh-session-projection'
35
+ - name: '@hy-sde-org/dsh-graph-projection'
36
+ ```
37
+
38
+ ### 各字段含义
39
+
40
+ | 字段 | 含义 |
41
+ |---|---|
42
+ | `schemaVersion` | 线格式版本;本投影为 `1`。 |
43
+ | `graphId` | 快照所属的图。 |
44
+ | `status` | 图运行中为 `active`,finish 后为 `closed`。 |
45
+ | `revision` | 宿主分配的发布版本,每个图严格递增;折叠以它拦截过期重复发布。 |
46
+ | `closed` | 终态镜像,供按终态分支的消费者使用。 |
47
+ | `work` | 有界工作列表:`workId`、执行期 `status`(`requested`/`claimed`/`executing`/`stopped`/`finished`/`failed`)、有界 `instruction`(≤300 字符)、可选 `operatorId`、`inputCount`。 |
48
+ | `omitted` | 宿主裁掉的导航栏预算溢出:work、records、inputs 计数。 |
49
+ | `pendingWake` | 是否有一条监督者 wake 待投递到根会话。 |
50
+ | `updatedAt` | 宿主发布时刻。 |
51
+
52
+ wire 值是完整的变更后快照(整值规则):消费者整体替换,从不合并。宿主每次图状态变化追加一条 `graph/change` 事件:`session.append('graph/change', graphSnapshotToEvent(graphId, snapshot, revision))` ——此处导出的辅助函数构造精确载荷,保证发布版本与快照版本一致。首次发布前单元提供 `null`:会话尚无图,消费者按“尚未可用”而非“空图”处理。
53
+
54
+ <a id="graph-chip"></a>
55
+ ### Graph 标签
56
+
57
+ Web 聊天 UI 通过投影标准席位 `useProjection('graph')` 读取该值;类型化键来自对 `@hy-sde-org/dsh-graph-projection/types` 的仅类型导入——客户端开发期依赖,运行时被擦除(无客户端到 graph 的运行时边)。当投影存在且导航栏有工作项(`work.length > 0`)或图仍为 `active` 时,对话记录渲染该标签;键缺失、首次发布前的 `null`、或已关闭且导航栏为空的图不渲染任何内容。该行显示「由 Agent Graph 继续」,摘要为 `N 个工作项 · active|closed`,样式与压缩标签一致。该标签仅是视图层状态;会话快照从不携带投影值。
58
+
59
+ ### 失败与恢复
60
+
61
+ 没有投影注册表时单元是惰性的:`inject` 使 fiber 保持挂起,不注册任何内容,因此其他装配缺少 `graph` 键。卸载插件会移除该键,因为注册是挂载 fiber 上的 effect。持久缓存行在恢复时经受 schema 校验——包括取值为正的版本与 ≤300 字符的指令界限——损坏的行被丢弃而不会喂坏折叠。
62
+
63
+ -----
64
+
65
+ <a id="understand-the-implementation"></a>
66
+ ## 理解实现
67
+
68
+ <details>
69
+ <summary>实现细节——点击展开</summary>
70
+
71
+ 本节解释快照背后的折叠;可观察行为已在[使用本包](#use-this-package)中完整说明。
72
+
73
+ ### 设计理念
74
+
75
+ 该单元是对已提交 `graph/change` 事件的纯折叠。一个 DSH 会话拥有一个图,因此折叠只对已承载的图替换状态:命名不同 `graphId` 的发布保留既有快照(引用不变,注册表身份门据此让变更流保持安静),仅以水位记录被观察事件——会话的图在生命周期内不切换。版本未推进到已折叠值之上的发布是过期重复发布,返回同一状态引用,重复投递因此零推送。wire 视图就是事件载荷中的快照引用本身(恒等),这正是纯内部变化保持安静的来源:无克隆、无重渲染。
76
+
77
+ ### 源码地图
78
+
79
+ | 文件 | 职责 |
80
+ |---|---|
81
+ | [`src/index.ts`](src/index.ts) | 插件入口:`inject`、在挂载 fiber 上注册单元 |
82
+ | [`src/projection.ts`](src/projection.ts) | 折叠:状态 schema、版本门、wire 视图、发布辅助函数、指令界限 |
83
+ | [`src/types.ts`](src/types.ts) | `graph` 投影键声明、`graph/change` 事件增广与 wire 类型的唯一归属 |
84
+ | — | 不发布运行时不变式伴生入口:本包仅拥有一个纯投影折叠,`session-projection` 会对其对外值执行 schema 校验;用同一实现重新折叠同一日志只会复制实现,无法比较独立维护的观测;宿主据以发布的持久行由 graph-control 负责。 |
85
+
86
+ ### 折叠规则
87
+
88
+ - 不相关事件返回同一状态引用;注册表的两道 `Object.is` 门由此把变更流压到真正的快照变化。
89
+ - 首次发布采纳任意图 id(尚无承载图);此后不同 id 的发布只记入水位。
90
+ - 过期(未推进)版本返回同一状态;匹配图的发布原子地替换快照、水位与版本。
91
+ - 对外值是载荷快照的引用——不复制、不截断、不重推导;界限是宿主的发布约定,在此处仅于持久状态边界校验。
92
+
93
+ </details>
94
+
95
+ -----
96
+
97
+ <a id="further-exploration"></a>
98
+ ## 进一步探索
99
+
100
+ 当单元约定不够用时阅读以下页面。它们从驱动单元的注册表逐步进入宿主据以发布的图包。
101
+
102
+ - [会话投影子系统](../../../docs/subsystems/session-projection.zh.md)——驱动单元并提供快照与变更流值的注册表。
103
+ - [会话投影注册表包](../../session/session-projection/README.zh.md)——单元注册所依据的注册表约定。
104
+ - [图流包](../graph-stream/README.zh.md)——派生态流层,其计划与记录供宿主构建发布快照。
105
+ - [工具图包](../tool-graph/README.zh.md)——有界模型可见快照词汇,客户端投影以更紧的导航栏预算复用它。
106
+
107
+ -----
108
+
109
+ <a id="model-experience"></a>
110
+ ## 模型体验
111
+
112
+ 无,因为 `graph` 单元把已发布的宿主快照折叠成面向客户端的读模型,不注册任何面向模型的内容。
113
+
114
+ #### KV Cache 影响
115
+
116
+ 无;本包从不组装或发送提供方请求。
117
+
118
+ ## 已知限制与延期工作
119
+
120
+ <a id="known-limitations-and-deferred-work"></a>
121
+
122
+
123
+ 这些限制说明投影提供什么、单元何时缺失。它们是当前包约束。
124
+
125
+ - **wire 值在每次推送中携带完整快照**——纯内部变化被身份门忽略,但真实重发布仍投递整个工作列表(整值规则);把工作拆成按需读取推迟到数百个工作条目的会话真正需要时。
126
+ - **每会话一个图**——不同 `graphId` 的发布不会替换既有快照,会话无法同时承载两个图;多图会话需要按图分键。
127
+ - **状态与界限信任宿主**——投影校验持久形状与 ≤300 字符指令界限,但实时发布路径信任宿主在追加前分配执行期状态并截断指令。
128
+ - **首次发布前为 `null`**——挂载插件即注册键,但值在宿主发布前保持 `null`;消费者必须处理“尚未可用”状态。
129
+ - **仅在组合了投影注册表时挂载**——其他装配不提供 `graph` 键,其消费者把不存在读取为无图能力。
130
+
131
+ <a id="dev-note"></a>
132
+ ### 开发备注
133
+
134
+ <details>
135
+ <summary>维护者的工作上下文——点击展开</summary>
136
+
137
+ 无。
138
+
139
+ </details>
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Function plugin registering the `graph` projection unit: the session's
3
+ * standing agent-graph snapshot served through the session-projection seam —
4
+ * registry snapshot, change feed, and every projection carrier — so a client
5
+ * can render the graph rail from whole published values without coupling to
6
+ * the graph control store. The plugin owns only the fold; delivery is the
7
+ * seam's, and the host (P7) publishes `graph/change` events.
8
+ *
9
+ * @module @hy-sde-org/dsh-graph-projection
10
+ */
11
+ import type { Context } from '@deepseek-ai/cordis';
12
+ export type * from './types.ts';
13
+ /** Cordis plugin name. */
14
+ export declare const name = "graph-projection";
15
+ /** The projection registry is the plugin's whole purpose; without it the fiber stays pending. */
16
+ export declare const inject: string[];
17
+ /**
18
+ * Register the `graph` unit; the registration is an effect on this plugin's
19
+ * fiber, so unloading removes the key.
20
+ * @param ctx - registrant context carrying the projection registry.
21
+ */
22
+ export declare function apply(ctx: Context): void;
23
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAGlD,mBAAmB,YAAY,CAAA;AAE/B,0BAA0B;AAC1B,eAAO,MAAM,IAAI,qBAAqB,CAAA;AACtC,iGAAiG;AACjG,eAAO,MAAM,MAAM,UAAyB,CAAA;AAE5C;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAExC"}
package/dist/index.js ADDED
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Function plugin registering the `graph` projection unit: the session's
3
+ * standing agent-graph snapshot served through the session-projection seam —
4
+ * registry snapshot, change feed, and every projection carrier — so a client
5
+ * can render the graph rail from whole published values without coupling to
6
+ * the graph control store. The plugin owns only the fold; delivery is the
7
+ * seam's, and the host (P7) publishes `graph/change` events.
8
+ *
9
+ * @module @hy-sde-org/dsh-graph-projection
10
+ */
11
+ import { graphProjectionDefinition } from "./projection.js";
12
+ /** Cordis plugin name. */
13
+ export const name = 'graph-projection';
14
+ /** The projection registry is the plugin's whole purpose; without it the fiber stays pending. */
15
+ export const inject = ['sessionProjections'];
16
+ /**
17
+ * Register the `graph` unit; the registration is an effect on this plugin's
18
+ * fiber, so unloading removes the key.
19
+ * @param ctx - registrant context carrying the projection registry.
20
+ */
21
+ export function apply(ctx) {
22
+ ctx.sessionProjections.register(graphProjectionDefinition);
23
+ }
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAA;AAI3D,0BAA0B;AAC1B,MAAM,CAAC,MAAM,IAAI,GAAG,kBAAkB,CAAA;AACtC,iGAAiG;AACjG,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,oBAAoB,CAAC,CAAA;AAE5C;;;;GAIG;AACH,MAAM,UAAU,KAAK,CAAC,GAAY;IAChC,GAAG,CAAC,kBAAkB,CAAC,QAAQ,CAAC,yBAAyB,CAAC,CAAA;AAC5D,CAAC"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * The `graph` projection unit: a pure fold of the host's `graph/change`
3
+ * publishes into the session's standing agent-graph snapshot.
4
+ *
5
+ * The host (P7) owns graph state and publishes the complete post-change
6
+ * `SessionGraphProjection` whenever the graph moves — the projection unit is
7
+ * a normal event fold with no store coupling. The fold replaces its state
8
+ * only for the graph it already hosts: one DSH session owns one graph, so a
9
+ * publish naming a different `graphId` keeps the standing snapshot (the
10
+ * watermark still advances). A publish whose revision does not advance past
11
+ * the last folded one is a stale re-publish: `apply` returns the same state
12
+ * reference, and the registry's `Object.is` gates then hold the change feed
13
+ * quiet. Because the served view is the event payload's snapshot reference,
14
+ * a foreign-graph publish also stays quiet through the identity gate.
15
+ *
16
+ * @module @hy-sde-org/dsh-graph-projection/projection
17
+ */
18
+ import { z } from 'zod';
19
+ import type { SessionEventMap } from '@deepseek-ai/dsh-session/types';
20
+ import type { SessionGraphProjection, SessionGraphProjectionState } from './types.ts';
21
+ /** Rail-card instruction budget: the host truncates with an ellipsis before publishing. */
22
+ export declare const GRAPH_PROJECTION_MAX_INSTRUCTION_CHARS = 300;
23
+ /**
24
+ * Build the `graph/change` payload for one publish. The host appends it with
25
+ * `session.append('graph/change', graphSnapshotToEvent(graphId, snapshot, revision))`
26
+ * after committing the graph state, so the projection unit folds exactly what
27
+ * the rest of the log already carries.
28
+ * @param graphId - the graph the snapshot belongs to.
29
+ * @param snapshot - the whole current client view at the publish.
30
+ * @param revision - the host raise counter for this publish; strictly
31
+ * increasing per graph and equal to `snapshot.revision`.
32
+ * @returns the `graph/change` event payload.
33
+ */
34
+ export declare function graphSnapshotToEvent(graphId: string, snapshot: SessionGraphProjection, revision: number): SessionEventMap['graph/change'];
35
+ /** The `graph` unit registered on `ctx.sessionProjections` (exported for the unit spec). */
36
+ export declare const graphProjectionDefinition: {
37
+ key: "graph";
38
+ /** Persisted-cache invalidation version: bump whenever the serialized state fields or the fold semantics change. */
39
+ stateVersion: number;
40
+ stateSchema: z.ZodType<SessionGraphProjectionState, unknown, z.core.$ZodTypeInternals<SessionGraphProjectionState, unknown>>;
41
+ init: () => SessionGraphProjectionState;
42
+ apply: (state: NoInfer<SessionGraphProjectionState>, event: import("@deepseek-ai/dsh-session").SessionEvent) => SessionGraphProjectionState;
43
+ wire: {
44
+ viewSchema: z.ZodNullable<z.ZodType<SessionGraphProjection, unknown, z.core.$ZodTypeInternals<SessionGraphProjection, unknown>>>;
45
+ view: (state: NoInfer<SessionGraphProjectionState>) => SessionGraphProjection | null;
46
+ };
47
+ };
48
+ //# sourceMappingURL=projection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"projection.d.ts","sourceRoot":"","sources":["../src/projection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,OAAO,KAAK,EAAE,eAAe,EAAoB,MAAM,gCAAgC,CAAA;AAEvF,OAAO,KAAK,EACV,sBAAsB,EACtB,2BAA2B,EAE5B,MAAM,YAAY,CAAA;AAEnB,2FAA2F;AAC3F,eAAO,MAAM,sCAAsC,MAAM,CAAA;AAiDzD;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,sBAAsB,EAChC,QAAQ,EAAE,MAAM,GACf,eAAe,CAAC,cAAc,CAAC,CAEjC;AAED,4FAA4F;AAC5F,eAAO,MAAM,yBAAyB;;IAEpC,oHAAoH;;;;;;;;;CAiChD,CAAA"}
@@ -0,0 +1,114 @@
1
+ /**
2
+ * The `graph` projection unit: a pure fold of the host's `graph/change`
3
+ * publishes into the session's standing agent-graph snapshot.
4
+ *
5
+ * The host (P7) owns graph state and publishes the complete post-change
6
+ * `SessionGraphProjection` whenever the graph moves — the projection unit is
7
+ * a normal event fold with no store coupling. The fold replaces its state
8
+ * only for the graph it already hosts: one DSH session owns one graph, so a
9
+ * publish naming a different `graphId` keeps the standing snapshot (the
10
+ * watermark still advances). A publish whose revision does not advance past
11
+ * the last folded one is a stale re-publish: `apply` returns the same state
12
+ * reference, and the registry's `Object.is` gates then hold the change feed
13
+ * quiet. Because the served view is the event payload's snapshot reference,
14
+ * a foreign-graph publish also stays quiet through the identity gate.
15
+ *
16
+ * @module @hy-sde-org/dsh-graph-projection/projection
17
+ */
18
+ import { z } from 'zod';
19
+ import { SessionSeq } from '@deepseek-ai/dsh-session';
20
+ /** Rail-card instruction budget: the host truncates with an ellipsis before publishing. */
21
+ export const GRAPH_PROJECTION_MAX_INSTRUCTION_CHARS = 300;
22
+ const workEntrySchema = z.object({
23
+ workId: z.string().min(1),
24
+ status: z.enum([
25
+ 'requested',
26
+ 'claimed',
27
+ 'executing',
28
+ 'stopped',
29
+ 'finished',
30
+ 'failed',
31
+ ]),
32
+ instruction: z.string().max(GRAPH_PROJECTION_MAX_INSTRUCTION_CHARS),
33
+ // `?: string | undefined` pairs with zod's Optional output under
34
+ // `exactOptionalPropertyTypes`; readers see the same `string | undefined`.
35
+ operatorId: z.string().min(1).optional(),
36
+ inputCount: z.number().int().nonnegative(),
37
+ }).strict();
38
+ const sessionGraphProjectionSchema = z.object({
39
+ schemaVersion: z.literal(1),
40
+ graphId: z.string().min(1),
41
+ status: z.enum(['active', 'closed']),
42
+ revision: z.number().int().positive(),
43
+ closed: z.boolean(),
44
+ work: z.array(workEntrySchema),
45
+ omitted: z.object({
46
+ work: z.number().int().nonnegative(),
47
+ records: z.number().int().nonnegative(),
48
+ inputs: z.number().int().nonnegative(),
49
+ }).strict(),
50
+ pendingWake: z.boolean(),
51
+ updatedAt: z.number().nonnegative(),
52
+ }).strict();
53
+ /** One session-event-seq cursor: -1 for the empty log, branded seqs afterwards. */
54
+ const cursorSchema = z.number().int().min(-1).transform((value) => value === -1 ? -1 : SessionSeq(value));
55
+ const graphProjectionStateSchema = z.object({
56
+ snapshot: sessionGraphProjectionSchema.nullable(),
57
+ asOfSeq: cursorSchema,
58
+ // 0 before the first accepted publish (revisions start at 1).
59
+ revision: z.number().int().nonnegative(),
60
+ }).strict();
61
+ const EMPTY_STATE = { snapshot: null, asOfSeq: -1, revision: 0 };
62
+ /**
63
+ * Build the `graph/change` payload for one publish. The host appends it with
64
+ * `session.append('graph/change', graphSnapshotToEvent(graphId, snapshot, revision))`
65
+ * after committing the graph state, so the projection unit folds exactly what
66
+ * the rest of the log already carries.
67
+ * @param graphId - the graph the snapshot belongs to.
68
+ * @param snapshot - the whole current client view at the publish.
69
+ * @param revision - the host raise counter for this publish; strictly
70
+ * increasing per graph and equal to `snapshot.revision`.
71
+ * @returns the `graph/change` event payload.
72
+ */
73
+ export function graphSnapshotToEvent(graphId, snapshot, revision) {
74
+ return { graphId, snapshot, revision };
75
+ }
76
+ /** The `graph` unit registered on `ctx.sessionProjections` (exported for the unit spec). */
77
+ export const graphProjectionDefinition = {
78
+ key: 'graph',
79
+ /** Persisted-cache invalidation version: bump whenever the serialized state fields or the fold semantics change. */
80
+ stateVersion: 1,
81
+ stateSchema: graphProjectionStateSchema,
82
+ init: () => EMPTY_STATE,
83
+ apply: (state, event) => {
84
+ switch (event.type) {
85
+ case 'graph/change': {
86
+ const payload = event.data;
87
+ if (state.snapshot !== null) {
88
+ if (payload.graphId !== state.snapshot.graphId) {
89
+ // A foreign graph never displaces the standing one: the snapshot
90
+ // keeps its reference (the identity gate then keeps the change
91
+ // feed quiet) while the watermark records the observed event.
92
+ return { ...state, asOfSeq: event.seq };
93
+ }
94
+ // A stale re-publish (same revision) or a regressive one holds the
95
+ // standing state; the host bumps the revision per publish.
96
+ if (payload.revision <= state.revision)
97
+ return state;
98
+ }
99
+ return {
100
+ snapshot: payload.snapshot,
101
+ asOfSeq: event.seq,
102
+ revision: payload.revision,
103
+ };
104
+ }
105
+ default:
106
+ return state;
107
+ }
108
+ },
109
+ wire: {
110
+ viewSchema: sessionGraphProjectionSchema.nullable(),
111
+ view: state => state.snapshot,
112
+ },
113
+ };
114
+ //# sourceMappingURL=projection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"projection.js","sourceRoot":"","sources":["../src/projection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AASrD,2FAA2F;AAC3F,MAAM,CAAC,MAAM,sCAAsC,GAAG,GAAG,CAAA;AAEzD,MAAM,eAAe,GAAmC,CAAC,CAAC,MAAM,CAAC;IAC/D,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACzB,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC;QACb,WAAW;QACX,SAAS;QACT,WAAW;QACX,SAAS;QACT,UAAU;QACV,QAAQ;KACT,CAAC;IACF,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,sCAAsC,CAAC;IACnE,iEAAiE;IACjE,2EAA2E;IAC3E,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACxC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;CAC3C,CAAC,CAAC,MAAM,EAAE,CAAA;AAEX,MAAM,4BAA4B,GAAoC,CAAC,CAAC,MAAM,CAAC;IAC7E,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1B,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACpC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAA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AAK,CAAC,QAAQ;KAC9B;CACmE,CAAA"}
@@ -0,0 +1,96 @@
1
+ /**
2
+ * Pure types of the graph-projection domain: the ONE home of the `graph`
3
+ * projection-key declaration and the `graph/change` session event, free of
4
+ * this package's host-side value imports (zod, the projection definition).
5
+ * Host consumers import `./types` for the wire contract; the session log
6
+ * stores the event this package augments.
7
+ *
8
+ * @module @hy-sde-org/dsh-graph-projection/types
9
+ */
10
+ import type { SessionSeqCursor } from '@deepseek-ai/dsh-session/types';
11
+ export {};
12
+ /** Execution-lifetime status of one graph work item as the host reports it. */
13
+ export type SessionGraphWorkStatus = 'requested' | 'claimed' | 'executing' | 'stopped' | 'finished' | 'failed';
14
+ /** One bounded work item on the graph rail. */
15
+ export interface SessionGraphWorkEntry {
16
+ readonly workId: string;
17
+ readonly status: SessionGraphWorkStatus;
18
+ /** Bounded instruction preview (≤300 chars, ellipsis when clipped) — the host truncates before publishing. */
19
+ readonly instruction: string;
20
+ /** The operator binding once the work is provisioned; absent while merely requested. */
21
+ readonly operatorId?: string | undefined;
22
+ readonly inputCount: number;
23
+ }
24
+ /**
25
+ * The client view of one session's agent graph: the complete published
26
+ * snapshot, plain JSON. `status` is the closed/open summary derived by the
27
+ * host; `closed` mirrors its terminal state for consumers that branch on it.
28
+ */
29
+ export interface SessionGraphProjection {
30
+ readonly schemaVersion: 1;
31
+ readonly graphId: string;
32
+ readonly status: 'active' | 'closed';
33
+ /** Host-assigned publish revision, strictly increasing per graph. */
34
+ readonly revision: number;
35
+ readonly closed: boolean;
36
+ readonly work: readonly SessionGraphWorkEntry[];
37
+ /** Bounded-view overflows the host capped away from the rail. */
38
+ readonly omitted: {
39
+ readonly work: number;
40
+ readonly records: number;
41
+ readonly inputs: number;
42
+ };
43
+ /** Whether a supervisor wake is pending delivery to the root session. */
44
+ readonly pendingWake: boolean;
45
+ readonly updatedAt: number;
46
+ }
47
+ /**
48
+ * Fold state: the last accepted `graph/change` payload plus the fold
49
+ * watermark. `snapshot` is `null` before the first event, and the registry
50
+ * serves `null` through the client view — the session hosts no graph yet.
51
+ * `asOfSeq` advances on every `graph/change` event the unit observes
52
+ * (including a foreign-graph publish, which keeps the standing snapshot);
53
+ * `revision` is the revision of the last ACCEPTED payload.
54
+ */
55
+ export interface SessionGraphProjectionState {
56
+ /** The standing graph snapshot; `null` before the first matching event. */
57
+ readonly snapshot: SessionGraphProjection | null;
58
+ /** Seq of the last `graph/change` event folded; -1 before any. */
59
+ readonly asOfSeq: SessionSeqCursor;
60
+ /** Revision of the last folded graph/change payload; 0 before any. */
61
+ readonly revision: number;
62
+ }
63
+ declare module '@deepseek-ai/dsh-session-projection/types' {
64
+ interface SessionProjectionStateMap {
65
+ /** Agent-graph fold state for one session (last graph snapshot plus watermark). */
66
+ graph: SessionGraphProjectionState;
67
+ }
68
+ interface SessionProjectionMap {
69
+ /**
70
+ * The session's current agent-graph snapshot, or `null` before the first
71
+ * `graph/change` event (no graph hosted yet). The host publishes whole
72
+ * post-change values; consumers replace, never merge.
73
+ */
74
+ graph: SessionGraphProjection | null;
75
+ }
76
+ }
77
+ declare module '@deepseek-ai/dsh-session/types' {
78
+ interface SessionEventMap {
79
+ /**
80
+ * Complete post-publish agent-graph snapshot. Log-only (not a
81
+ * {@link SurfaceEventType}); the host appends one per graph state change
82
+ * so the projection stays a normal event fold with no store coupling.
83
+ * @mode emit
84
+ * @param graphId - the graph the snapshot belongs to.
85
+ * @param snapshot - the whole current client view at the publish.
86
+ * @param revision - the host raise counter for this publish; strictly
87
+ * increasing per graph.
88
+ */
89
+ 'graph/change': {
90
+ graphId: string;
91
+ snapshot: SessionGraphProjection;
92
+ revision: number;
93
+ };
94
+ }
95
+ }
96
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AAEtE,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,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAA;IAClC,sEAAsE;IACtE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAC1B;AAED,OAAO,QAAQ,2CAA2C,CAAC;IACzD,UAAU,yBAAyB;QACjC,mFAAmF;QACnF,KAAK,EAAE,2BAA2B,CAAA;KACnC;IACD,UAAU,oBAAoB;QAC5B;;;;WAIG;QACH,KAAK,EAAE,sBAAsB,GAAG,IAAI,CAAA;KACrC;CACF;AAED,OAAO,QAAQ,gCAAgC,CAAC;IAC9C,UAAU,eAAe;QACvB;;;;;;;;;WASG;QACH,cAAc,EAAE;YACd,OAAO,EAAE,MAAM,CAAA;YACf,QAAQ,EAAE,sBAAsB,CAAA;YAChC,QAAQ,EAAE,MAAM,CAAA;SACjB,CAAA;KACF;CACF"}
package/dist/types.js ADDED
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Pure types of the graph-projection domain: the ONE home of the `graph`
3
+ * projection-key declaration and the `graph/change` session event, free of
4
+ * this package's host-side value imports (zod, the projection definition).
5
+ * Host consumers import `./types` for the wire contract; the session log
6
+ * stores the event this package augments.
7
+ *
8
+ * @module @hy-sde-org/dsh-graph-projection/types
9
+ */
10
+ export {};
11
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
package/package.json ADDED
@@ -0,0 +1,61 @@
1
+ {
2
+ "name": "@hy-sde-org/dsh-graph-projection",
3
+ "description": "Session projection unit: the standing agent-graph snapshot folded from the host's graph/change publishes (Maka port, slice P6a)",
4
+ "version": "0.1.2-rc.1",
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/deepseek-ai/deepseek-harness.git",
11
+ "directory": "packages/graph/graph-projection"
12
+ },
13
+ "type": "module",
14
+ "main": "lib/index.js",
15
+ "types": "lib/types/index.d.ts",
16
+ "exports": {
17
+ ".": {
18
+ "types": "./dist/index.d.ts",
19
+ "default": "./dist/index.js"
20
+ },
21
+ "./package.json": "./package.json",
22
+ "./types": {
23
+ "types": "./dist/types.d.ts",
24
+ "default": "./dist/types.js"
25
+ },
26
+ "./projection": {
27
+ "types": "./dist/projection.d.ts",
28
+ "default": "./dist/projection.js"
29
+ }
30
+ },
31
+ "files": [
32
+ "dist",
33
+ "README.md",
34
+ "LICENSE"
35
+ ],
36
+ "license": "MIT",
37
+ "peerDependencies": {
38
+ "@deepseek-ai/cordis": "^4.0.2",
39
+ "@deepseek-ai/dsh-session": "^0.1.2-rc.1",
40
+ "@deepseek-ai/dsh-session-projection": "^0.1.2-rc.1"
41
+ },
42
+ "dependencies": {
43
+ "zod": "^4.4.3"
44
+ },
45
+ "devDependencies": {
46
+ "@deepseek-ai/cordis": "^4.0.2",
47
+ "@deepseek-ai/cordis-plugin-include": "^1.0.7",
48
+ "@deepseek-ai/cordis-plugin-loader": "^1.0.3",
49
+ "@deepseek-ai/dsh-session": "^0.1.2-rc.1",
50
+ "@deepseek-ai/dsh-session-projection": "^0.1.2-rc.1",
51
+ "@types/node": "^24.0.0",
52
+ "typescript": "^5.9.3",
53
+ "vitest": "^3.2.7"
54
+ },
55
+ "scripts": {
56
+ "clean": "rm -rf dist",
57
+ "build": "tsc -p tsconfig.build.json",
58
+ "check": "tsc -p tsconfig.json --noEmit",
59
+ "test": "vitest run"
60
+ }
61
+ }