dsh-plugin-dev-kb 1.0.0
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 +21 -0
- package/README.md +56 -0
- package/cordis.patch.yml +12 -0
- package/kb/INDEX.md +210 -0
- package/kb/README.md +69 -0
- package/kb/extra/AGENTS.md +75 -0
- package/kb/extra/api-gateway.md +164 -0
- package/kb/extra/api-gateway.zh.md +164 -0
- package/kb/extra/cookbook/adding-a-vendored-package.md +59 -0
- package/kb/extra/cookbook/adding-a-vendored-package.zh.md +59 -0
- package/kb/extra/cookbook/maintaining-dsh-code-review.md +64 -0
- package/kb/extra/cookbook/maintaining-dsh-code-review.zh.md +64 -0
- package/kb/extra/cookbook/responding-to-pr-review-on-a-stack.md +32 -0
- package/kb/extra/cookbook/responding-to-pr-review-on-a-stack.zh.md +32 -0
- package/kb/extra/defensive-patterns.md +33 -0
- package/kb/extra/defensive-patterns.zh.md +33 -0
- package/kb/extra/development.md +171 -0
- package/kb/extra/development.zh.md +171 -0
- package/kb/extra/event-producer-consumer.md +76 -0
- package/kb/extra/event-producer-consumer.zh.md +78 -0
- package/kb/extra/glossary.md +45 -0
- package/kb/extra/glossary.zh.md +45 -0
- package/kb/extra/graph-atlas.md +24 -0
- package/kb/extra/graph-atlas.zh.md +26 -0
- package/kb/extra/i18n/README.md +60 -0
- package/kb/extra/i18n/README.zh.md +60 -0
- package/kb/extra/i18n/style-samples.md +87 -0
- package/kb/extra/i18n/terminology.md +214 -0
- package/kb/extra/i18n/translation-prompt.md +263 -0
- package/kb/extra/i18n/translation-rules.md +69 -0
- package/kb/extra/i18n/translation-rules.zh.md +69 -0
- package/kb/extra/module-graph.md +1641 -0
- package/kb/extra/module-graph.zh.md +1643 -0
- package/kb/extra/postmortem/0001-acp-default-export-drops-inject.md +113 -0
- package/kb/extra/postmortem/0001-acp-default-export-drops-inject.zh.md +113 -0
- package/kb/extra/postmortem/0002-js-expression-disabled-filesystem-tools.md +47 -0
- package/kb/extra/postmortem/0002-js-expression-disabled-filesystem-tools.zh.md +47 -0
- package/kb/extra/postmortem/0003-web-agent-gui-feedback-loop.md +53 -0
- package/kb/extra/postmortem/0003-web-agent-gui-feedback-loop.zh.md +53 -0
- package/kb/extra/postmortem/0004-landlock-partial-notice-misclassified-child-failures.md +55 -0
- package/kb/extra/postmortem/0004-landlock-partial-notice-misclassified-child-failures.zh.md +55 -0
- package/kb/extra/postmortem/README.md +18 -0
- package/kb/extra/postmortem/README.zh.md +18 -0
- package/kb/extra/rescope.md +53 -0
- package/kb/extra/rescope.zh.md +53 -0
- package/kb/extra/subsystems/attachment.md +125 -0
- package/kb/extra/subsystems/attachment.zh.md +125 -0
- package/kb/extra/subsystems/extensions.md +364 -0
- package/kb/extra/subsystems/extensions.zh.md +364 -0
- package/kb/extra/subsystems/feedback.md +266 -0
- package/kb/extra/subsystems/feedback.zh.md +266 -0
- package/kb/extra/testing.md +49 -0
- package/kb/extra/testing.zh.md +49 -0
- package/kb/extra/web-styling.md +25 -0
- package/kb/extra/web-styling.zh.md +25 -0
- package/kb/meta/search-index.json +1328 -0
- package/kb/meta/site-pages.txt +168 -0
- package/kb/meta/source.json +13 -0
- package/kb/meta/topics.md +75 -0
- package/kb/site/develop/basic/config.md +108 -0
- package/kb/site/develop/basic/index.md +146 -0
- package/kb/site/develop/basic/publish.md +185 -0
- package/kb/site/develop/basic/tool.md +54 -0
- package/kb/site/develop/cordis-tutorial/01-first-plugin.md +95 -0
- package/kb/site/develop/cordis-tutorial/02-lifecycle-and-effects.md +98 -0
- package/kb/site/develop/cordis-tutorial/03-services.md +98 -0
- package/kb/site/develop/cordis-tutorial/04-events.md +144 -0
- package/kb/site/develop/cordis-tutorial/05-config.md +84 -0
- package/kb/site/develop/cordis-tutorial/06-composition-and-hmr.md +113 -0
- package/kb/site/develop/cordis-tutorial/07-into-the-harness.md +107 -0
- package/kb/site/develop/cordis-tutorial/index.md +62 -0
- package/kb/site/develop/framework/events.md +145 -0
- package/kb/site/develop/framework/index.md +139 -0
- package/kb/site/develop/framework/service.md +152 -0
- package/kb/site/develop/practice/index.md +157 -0
- package/kb/site/develop/practice/llm-adapter.md +190 -0
- package/kb/site/en/develop/basic/config.md +108 -0
- package/kb/site/en/develop/basic/index.md +146 -0
- package/kb/site/en/develop/basic/publish.md +185 -0
- package/kb/site/en/develop/basic/tool.md +54 -0
- package/kb/site/en/develop/cordis-tutorial/01-first-plugin.md +95 -0
- package/kb/site/en/develop/cordis-tutorial/02-lifecycle-and-effects.md +98 -0
- package/kb/site/en/develop/cordis-tutorial/03-services.md +98 -0
- package/kb/site/en/develop/cordis-tutorial/04-events.md +144 -0
- package/kb/site/en/develop/cordis-tutorial/05-config.md +84 -0
- package/kb/site/en/develop/cordis-tutorial/06-composition-and-hmr.md +113 -0
- package/kb/site/en/develop/cordis-tutorial/07-into-the-harness.md +107 -0
- package/kb/site/en/develop/cordis-tutorial/index.md +60 -0
- package/kb/site/en/develop/framework/events.md +145 -0
- package/kb/site/en/develop/framework/index.md +139 -0
- package/kb/site/en/develop/framework/service.md +150 -0
- package/kb/site/en/develop/practice/index.md +157 -0
- package/kb/site/en/develop/practice/llm-adapter.md +190 -0
- package/kb/site/en/guide/providers-custom-form.png +0 -0
- package/kb/site/en/guide/providers-models-page.png +0 -0
- package/kb/site/en/guide/providers.md +100 -0
- package/kb/site/en/guide/python-sdk.md +106 -0
- package/kb/site/en/guide/quickstart.md +32 -0
- package/kb/site/en/index.md +8 -0
- package/kb/site/en/reference/agent-lifecycle.md +86 -0
- package/kb/site/en/reference/capability-seams.md +475 -0
- package/kb/site/en/reference/config-catalog.md +3155 -0
- package/kb/site/en/reference/cookbook/adding-a-conversation-node.md +235 -0
- package/kb/site/en/reference/cookbook/adding-a-package.md +120 -0
- package/kb/site/en/reference/cookbook/adding-a-settings-card.md +102 -0
- package/kb/site/en/reference/cookbook/adding-a-tool.md +96 -0
- package/kb/site/en/reference/cookbook/adding-an-llm-adapter.md +45 -0
- package/kb/site/en/reference/cookbook/extension-cookbook.md +131 -0
- package/kb/site/en/reference/cordis-api/context.md +368 -0
- package/kb/site/en/reference/cordis-api/events.md +211 -0
- package/kb/site/en/reference/cordis-api/fiber.md +379 -0
- package/kb/site/en/reference/cordis-api/inherited.md +43 -0
- package/kb/site/en/reference/cordis-api/registry.md +156 -0
- package/kb/site/en/reference/cordis-api/service.md +106 -0
- package/kb/site/en/reference/cordis-primer.md +46 -0
- package/kb/site/en/reference/index.md +131 -0
- package/kb/site/en/reference/persistence-catalog.md +949 -0
- package/kb/site/en/reference/subsystems/approval.md +173 -0
- package/kb/site/en/reference/subsystems/client-modules.md +121 -0
- package/kb/site/en/reference/subsystems/code-runtime.md +194 -0
- package/kb/site/en/reference/subsystems/commands.md +190 -0
- package/kb/site/en/reference/subsystems/compaction.md +241 -0
- package/kb/site/en/reference/subsystems/core.md +1073 -0
- package/kb/site/en/reference/subsystems/credentials.md +136 -0
- package/kb/site/en/reference/subsystems/filesystem.md +498 -0
- package/kb/site/en/reference/subsystems/goal.md +280 -0
- package/kb/site/en/reference/subsystems/index.md +58 -0
- package/kb/site/en/reference/subsystems/invariants.md +91 -0
- package/kb/site/en/reference/subsystems/jobs.md +293 -0
- package/kb/site/en/reference/subsystems/llm-streaming.md +920 -0
- package/kb/site/en/reference/subsystems/lsp.md +205 -0
- package/kb/site/en/reference/subsystems/permission-presets.md +134 -0
- package/kb/site/en/reference/subsystems/persistence.md +388 -0
- package/kb/site/en/reference/subsystems/plan.md +90 -0
- package/kb/site/en/reference/subsystems/sandbox.md +221 -0
- package/kb/site/en/reference/subsystems/schedule.md +189 -0
- package/kb/site/en/reference/subsystems/scope.md +62 -0
- package/kb/site/en/reference/subsystems/session-projection.md +265 -0
- package/kb/site/en/reference/subsystems/session-query.md +498 -0
- package/kb/site/en/reference/subsystems/session-reference.md +111 -0
- package/kb/site/en/reference/subsystems/session-telemetry.md +197 -0
- package/kb/site/en/reference/subsystems/session-title.md +207 -0
- package/kb/site/en/reference/subsystems/session.md +852 -0
- package/kb/site/en/reference/subsystems/settings.md +313 -0
- package/kb/site/en/reference/subsystems/shell.md +306 -0
- package/kb/site/en/reference/subsystems/skills.md +334 -0
- package/kb/site/en/reference/subsystems/spill.md +120 -0
- package/kb/site/en/reference/subsystems/storage.md +232 -0
- package/kb/site/en/reference/subsystems/subagent.md +737 -0
- package/kb/site/en/reference/subsystems/subprocess.md +327 -0
- package/kb/site/en/reference/subsystems/system-prompt.md +210 -0
- package/kb/site/en/reference/subsystems/terminal.md +187 -0
- package/kb/site/en/reference/subsystems/token-meter.md +93 -0
- package/kb/site/en/reference/subsystems/tools.md +723 -0
- package/kb/site/en/reference/subsystems/typert.md +339 -0
- package/kb/site/en/reference/subsystems/user-questions.md +181 -0
- package/kb/site/en/reference/subsystems/web-server.md +111 -0
- package/kb/site/en/reference/subsystems/web.md +202 -0
- package/kb/site/en/reference/subsystems/workflow.md +281 -0
- package/kb/site/en/reference/subsystems/workspace.md +231 -0
- package/kb/site/en/reference/tool-catalog.md +1877 -0
- package/kb/site/en/reference/tool-execution-pipeline.md +66 -0
- package/kb/site/guide/providers-custom-form.zh.png +0 -0
- package/kb/site/guide/providers-models-page.zh.png +0 -0
- package/kb/site/guide/providers.md +100 -0
- package/kb/site/guide/python-sdk.md +106 -0
- package/kb/site/guide/quickstart.md +32 -0
- package/kb/site/index.md +8 -0
- package/kb/site/reference/agent-lifecycle.md +86 -0
- package/kb/site/reference/capability-seams.md +475 -0
- package/kb/site/reference/config-catalog.md +3154 -0
- package/kb/site/reference/cookbook/adding-a-conversation-node.md +235 -0
- package/kb/site/reference/cookbook/adding-a-package.md +120 -0
- package/kb/site/reference/cookbook/adding-a-settings-card.md +102 -0
- package/kb/site/reference/cookbook/adding-a-tool.md +98 -0
- package/kb/site/reference/cookbook/adding-an-llm-adapter.md +45 -0
- package/kb/site/reference/cookbook/extension-cookbook.md +133 -0
- package/kb/site/reference/cordis-api/context.md +368 -0
- package/kb/site/reference/cordis-api/events.md +211 -0
- package/kb/site/reference/cordis-api/fiber.md +379 -0
- package/kb/site/reference/cordis-api/inherited.md +43 -0
- package/kb/site/reference/cordis-api/registry.md +156 -0
- package/kb/site/reference/cordis-api/service.md +106 -0
- package/kb/site/reference/cordis-primer.md +52 -0
- package/kb/site/reference/index.md +135 -0
- package/kb/site/reference/persistence-catalog.md +949 -0
- package/kb/site/reference/subsystems/approval.md +173 -0
- package/kb/site/reference/subsystems/client-modules.md +121 -0
- package/kb/site/reference/subsystems/code-runtime.md +194 -0
- package/kb/site/reference/subsystems/commands.md +190 -0
- package/kb/site/reference/subsystems/compaction.md +241 -0
- package/kb/site/reference/subsystems/core.md +1081 -0
- package/kb/site/reference/subsystems/credentials.md +136 -0
- package/kb/site/reference/subsystems/filesystem.md +498 -0
- package/kb/site/reference/subsystems/goal.md +280 -0
- package/kb/site/reference/subsystems/index.md +58 -0
- package/kb/site/reference/subsystems/invariants.md +91 -0
- package/kb/site/reference/subsystems/jobs.md +293 -0
- package/kb/site/reference/subsystems/llm-streaming.md +926 -0
- package/kb/site/reference/subsystems/lsp.md +205 -0
- package/kb/site/reference/subsystems/permission-presets.md +134 -0
- package/kb/site/reference/subsystems/persistence.md +388 -0
- package/kb/site/reference/subsystems/plan.md +90 -0
- package/kb/site/reference/subsystems/sandbox.md +221 -0
- package/kb/site/reference/subsystems/schedule.md +189 -0
- package/kb/site/reference/subsystems/scope.md +62 -0
- package/kb/site/reference/subsystems/session-projection.md +265 -0
- package/kb/site/reference/subsystems/session-query.md +498 -0
- package/kb/site/reference/subsystems/session-reference.md +111 -0
- package/kb/site/reference/subsystems/session-telemetry.md +197 -0
- package/kb/site/reference/subsystems/session-title.md +207 -0
- package/kb/site/reference/subsystems/session.md +854 -0
- package/kb/site/reference/subsystems/settings.md +313 -0
- package/kb/site/reference/subsystems/shell.md +306 -0
- package/kb/site/reference/subsystems/skills.md +334 -0
- package/kb/site/reference/subsystems/spill.md +120 -0
- package/kb/site/reference/subsystems/storage.md +232 -0
- package/kb/site/reference/subsystems/subagent.md +739 -0
- package/kb/site/reference/subsystems/subprocess.md +327 -0
- package/kb/site/reference/subsystems/system-prompt.md +210 -0
- package/kb/site/reference/subsystems/terminal.md +187 -0
- package/kb/site/reference/subsystems/token-meter.md +93 -0
- package/kb/site/reference/subsystems/tools.md +723 -0
- package/kb/site/reference/subsystems/typert.md +339 -0
- package/kb/site/reference/subsystems/user-questions.md +181 -0
- package/kb/site/reference/subsystems/web-server.md +111 -0
- package/kb/site/reference/subsystems/web.md +202 -0
- package/kb/site/reference/subsystems/workflow.md +281 -0
- package/kb/site/reference/subsystems/workspace.md +231 -0
- package/kb/site/reference/tool-catalog.md +1880 -0
- package/kb/site/reference/tool-execution-pipeline.md +66 -0
- package/package.json +40 -0
- package/scripts/rebuild-index.mjs +88 -0
- package/skills/dsh-plugin-dev-kb.md +66 -0
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
---
|
|
2
|
+
editSource: "docs/subsystems/goal.md"
|
|
3
|
+
outline: [2,3]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Same-session goals
|
|
7
|
+
|
|
8
|
+
Types shared by the event-sourced goal service and its policy consumers. The [goal-domain Agent Note](https://github.com/deepseek-ai/deepseek-harness/blob/master/.agents/notes/implemented/feature/2026-07-19-persisted-same-session-goal-domain.md) owns the persistence and activation decisions; this page records the exact fields and variants from [`packages/goal/goal/src/types.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/goal/goal/src/types.ts).
|
|
9
|
+
|
|
10
|
+
## Identity and lifecycle
|
|
11
|
+
|
|
12
|
+
`GoalId` is a [branded id](./core.md#branded-ids). A caller mutates one exact revision through `GoalRef`; every accepted durable mutation increments the revision.
|
|
13
|
+
|
|
14
|
+
```ts type-equiv
|
|
15
|
+
/** Compare-and-set identity for one exact goal revision. */
|
|
16
|
+
interface GoalRef {
|
|
17
|
+
/** Stable goal identity. */
|
|
18
|
+
readonly id: GoalId
|
|
19
|
+
/** Positive revision; every durable mutation increments it. */
|
|
20
|
+
readonly revision: number
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
The durable phase answers what happened to the objective. Process-local activation separately answers whether a continuation consumer may start another round.
|
|
25
|
+
|
|
26
|
+
```ts type-equiv
|
|
27
|
+
/** Durable continuation phase. Activation is process-local and separate. */
|
|
28
|
+
type GoalPhase =
|
|
29
|
+
| 'active'
|
|
30
|
+
| 'paused'
|
|
31
|
+
| 'blocked'
|
|
32
|
+
| 'complete'
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Blocking is the single durable stopped-by-a-problem state. Its policy-owned reason carries a stable lower-kebab-case code for routing and a free-form explanation for humans and models.
|
|
36
|
+
|
|
37
|
+
```ts type-equiv
|
|
38
|
+
/** Machine-routable and human-readable explanation for a blocked goal. */
|
|
39
|
+
interface GoalBlockReason {
|
|
40
|
+
/** Stable lower-kebab-case classification chosen by the blocking policy. */
|
|
41
|
+
readonly code: string
|
|
42
|
+
/** Non-empty explanation shown to humans and models. */
|
|
43
|
+
readonly message: string
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
```ts type-equiv
|
|
48
|
+
/** Full durable state written by every non-clear goal mutation. */
|
|
49
|
+
interface GoalSnapshot extends GoalRef {
|
|
50
|
+
/** Human-requested completion objective. */
|
|
51
|
+
readonly objective: string
|
|
52
|
+
/** Durable lifecycle phase. */
|
|
53
|
+
readonly phase: GoalPhase
|
|
54
|
+
/** Present exactly while `phase` is `blocked`. */
|
|
55
|
+
readonly blockedReason?: GoalBlockReason
|
|
56
|
+
/** Total admitted goal-round cap. */
|
|
57
|
+
readonly maxGoalRounds: number
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
```ts type-equiv
|
|
62
|
+
/** Current goal projection, including values derived from the session log. */
|
|
63
|
+
interface GoalView extends GoalSnapshot {
|
|
64
|
+
/** Highest admitted round number for this goal. */
|
|
65
|
+
readonly roundsStarted: number
|
|
66
|
+
/** Epoch milliseconds of the create mutation. */
|
|
67
|
+
readonly createdAt: number
|
|
68
|
+
/** Epoch milliseconds of the latest mutation. */
|
|
69
|
+
readonly updatedAt: number
|
|
70
|
+
/** Process-local continuation eligibility; never persisted. */
|
|
71
|
+
readonly activation: GoalActivation
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Durable changes
|
|
76
|
+
|
|
77
|
+
Every mutation is a durable `goal/change` session event whose payload is either a complete post-mutation snapshot or a clear tombstone. The strict fold and persisted projection derive lifecycle state only from these events; inbox mutations do not affect goal state.
|
|
78
|
+
|
|
79
|
+
```ts type-equiv
|
|
80
|
+
/** Full-snapshot goal mutation committed by a durable `goal/change` event. */
|
|
81
|
+
interface GoalSnapshotChangeMeta {
|
|
82
|
+
readonly kind: 'goal/change'
|
|
83
|
+
readonly version: 1
|
|
84
|
+
readonly operation: Exclude<GoalOperation, 'clear'>
|
|
85
|
+
readonly goal: GoalSnapshot
|
|
86
|
+
readonly roundsStarted: number
|
|
87
|
+
readonly createdAt: number
|
|
88
|
+
readonly updatedAt: number
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
```ts type-equiv
|
|
93
|
+
/** Tombstone retained when the current goal is cleared. */
|
|
94
|
+
interface GoalClearChangeMeta {
|
|
95
|
+
readonly kind: 'goal/change'
|
|
96
|
+
readonly version: 1
|
|
97
|
+
readonly operation: 'clear'
|
|
98
|
+
readonly cleared: GoalRef
|
|
99
|
+
readonly clearedAt: number
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
A continuation consumer attributes each admitted user-message turn with a positive, sequential round number and the current revision; only these admitted `user/message` events advance `roundsStarted`. Replay rejects non-positive rounds, gaps, stale revisions, stopped phases, and cap overflow.
|
|
104
|
+
|
|
105
|
+
```ts type-equiv
|
|
106
|
+
/** Message attribution for admitted continuation rounds. */
|
|
107
|
+
interface GoalMessageSource {
|
|
108
|
+
readonly kind: 'goal'
|
|
109
|
+
readonly goalId: GoalId
|
|
110
|
+
readonly revision: number
|
|
111
|
+
/** Positive admitted continuation round. */
|
|
112
|
+
readonly round: number
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Requests and notifications
|
|
117
|
+
|
|
118
|
+
Creation separates caller omission from the deployment choice, which `create()` resolves internally. An edit is a partial replacement whose runtime validator requires at least one field. Every mutation notification carries the accepted operation and exact revision; clear omits `goal`.
|
|
119
|
+
|
|
120
|
+
```ts type-equiv
|
|
121
|
+
/** Input whose omitted round cap is resolved by the service configuration. */
|
|
122
|
+
interface CreateGoalRequest {
|
|
123
|
+
readonly objective: string
|
|
124
|
+
readonly maxGoalRounds?: number
|
|
125
|
+
}
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
```ts type-equiv
|
|
129
|
+
/** Fields changed by an edit; at least one must be present. */
|
|
130
|
+
interface EditGoalRequest {
|
|
131
|
+
readonly objective?: string
|
|
132
|
+
readonly maxGoalRounds?: number
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
```ts type-equiv
|
|
137
|
+
/** Live notification after one durable goal mutation commits. */
|
|
138
|
+
interface GoalChanged {
|
|
139
|
+
readonly operation: GoalOperation
|
|
140
|
+
readonly ref: GoalRef
|
|
141
|
+
/** Absent for a clear tombstone. */
|
|
142
|
+
readonly goal?: GoalView
|
|
143
|
+
}
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
## Service behavior
|
|
147
|
+
|
|
148
|
+
[`GoalService`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/goal/goal/src/index.ts) resolves creation defaults, folds strict replay from durable `goal/change` events, enforces exact-live-agent identity and compare-and-set mutations, and emits contained `goal/changed` notifications. The package [README](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/goal/goal/README.md) defines the callable API and model-visible contract.
|
|
149
|
+
|
|
150
|
+
<!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
|
|
151
|
+
|
|
152
|
+
<a id="cordis-surface"></a>
|
|
153
|
+
|
|
154
|
+
## Cordis API
|
|
155
|
+
|
|
156
|
+
Generated from source by `scripts/gen-cordis-catalog.ts` (verified fresh by `pnpm run verify-cordis-catalog` in doc-sync; regenerate with `pnpm run gen-cordis-catalog`) — this section is byte-identical in both language sides of the page. Signature blocks use a `ts cordis-catalog` fence and keep the original source JSDoc; dispatch modes are defined in the [primer](../cordis-primer.md#dispatch-modes), and the framework-inherited `ctx` API lives in [cordis-api/inherited.md](../cordis-api/inherited.md).
|
|
157
|
+
|
|
158
|
+
<a id="ctxgoals--goalservice"></a>
|
|
159
|
+
|
|
160
|
+
### `ctx.goals` — `GoalService`
|
|
161
|
+
|
|
162
|
+
Goal service (`ctx.goals`) backed exclusively by the owning session log.
|
|
163
|
+
|
|
164
|
+
```ts cordis-catalog
|
|
165
|
+
/**
|
|
166
|
+
* Read the current goal for one exact live agent.
|
|
167
|
+
* @param agent - owning live agent.
|
|
168
|
+
* @returns a fresh view or `undefined` when no goal is current.
|
|
169
|
+
* @throws {@link GoalError} when the agent is not the registry's live instance.
|
|
170
|
+
*/
|
|
171
|
+
get(agent: Agent): GoalView | undefined
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Remove process-local continuation authority without changing durable goal
|
|
175
|
+
* phase or revision. Lifecycle owners use this before unloading a driver;
|
|
176
|
+
* a later human-authorized {@link resume} records the new activation edge.
|
|
177
|
+
* @param agent - owning live agent.
|
|
178
|
+
* @returns a fresh disarmed view, or `undefined` when no goal is current.
|
|
179
|
+
*/
|
|
180
|
+
disarm(agent: Agent): GoalView | undefined
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Create and arm a goal. A completed goal may be replaced; every other
|
|
184
|
+
* current phase must be cleared or resumed instead.
|
|
185
|
+
* @param agent - owning live agent.
|
|
186
|
+
* @param request - objective and optional round cap.
|
|
187
|
+
* @returns the created live view.
|
|
188
|
+
*/
|
|
189
|
+
create(agent: Agent, request: CreateGoalRequest): GoalView
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Edit objective and/or round cap without changing phase.
|
|
193
|
+
* @param agent - owning live agent.
|
|
194
|
+
* @param ref - expected current revision.
|
|
195
|
+
* @param request - at least one replacement field.
|
|
196
|
+
* @returns the edited view.
|
|
197
|
+
*/
|
|
198
|
+
@Remote('edit') edit(agent: Agent, ref: GoalRef, request: EditGoalRequest): GoalView
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Pause an active goal and disarm automatic continuation.
|
|
202
|
+
* @param agent - owning live agent.
|
|
203
|
+
* @param ref - expected current revision.
|
|
204
|
+
* @returns the paused view.
|
|
205
|
+
*/
|
|
206
|
+
@Remote('pause') pause(agent: Agent, ref: GoalRef): GoalView
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Resume and arm a stopped goal, or rearm an active goal after a
|
|
210
|
+
* session-start edge, while its round budget still has capacity.
|
|
211
|
+
* @param agent - owning live agent.
|
|
212
|
+
* @param ref - expected current revision.
|
|
213
|
+
* @returns the active view.
|
|
214
|
+
*/
|
|
215
|
+
@Remote('resume') resume(agent: Agent, ref: GoalRef): GoalView
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Mark a current non-complete goal complete and disarm it.
|
|
219
|
+
* @param agent - owning live agent.
|
|
220
|
+
* @param ref - expected current revision.
|
|
221
|
+
* @returns the completed view.
|
|
222
|
+
*/
|
|
223
|
+
@Remote('complete') complete(agent: Agent, ref: GoalRef): GoalView
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Mark an active goal blocked and disarm it.
|
|
227
|
+
* @param agent - owning live agent.
|
|
228
|
+
* @param ref - expected current revision.
|
|
229
|
+
* @param reason - policy-owned stable code and human-readable explanation.
|
|
230
|
+
* @returns the blocked view with its durable reason.
|
|
231
|
+
*/
|
|
232
|
+
block(agent: Agent, ref: GoalRef, reason: GoalBlockReason): GoalView
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Clear the current goal while retaining a durable tombstone and history.
|
|
236
|
+
* @param agent - owning live agent.
|
|
237
|
+
* @param ref - expected current revision.
|
|
238
|
+
* @returns the tombstone ref whose revision is one past the cleared snapshot.
|
|
239
|
+
*/
|
|
240
|
+
@Remote('clear') clear(agent: Agent, ref: GoalRef): GoalRef
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Create one Goal through the remote boundary.
|
|
244
|
+
* @param agent - exact live Agent resolved from the wire identity.
|
|
245
|
+
* @param request - objective and optional round cap.
|
|
246
|
+
* @returns the created Goal identity.
|
|
247
|
+
*/
|
|
248
|
+
@Remote('create') remoteExportCreate(agent: Agent, request: CreateGoalRequest): CreateGoalResult
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
Types: [Agent](./core.md)
|
|
252
|
+
|
|
253
|
+
Source: [`packages/goal/goal/src/index.ts:183`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/goal/goal/src/index.ts)
|
|
254
|
+
|
|
255
|
+
<a id="goal-events"></a>
|
|
256
|
+
|
|
257
|
+
### `goal/*` events
|
|
258
|
+
|
|
259
|
+
<a id="goalchanged--emit"></a>
|
|
260
|
+
|
|
261
|
+
#### `goal/changed` — emit
|
|
262
|
+
|
|
263
|
+
Goal mutation accepted by one live agent. The matching `goal/change` session event has already committed. Listener failures are contained. Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): agent-scoped listeners receive only that agent.
|
|
264
|
+
|
|
265
|
+
```ts cordis-catalog
|
|
266
|
+
/**
|
|
267
|
+
* Goal mutation accepted by one live agent. The matching `goal/change`
|
|
268
|
+
* session event has already committed. Listener failures are contained.
|
|
269
|
+
* Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): agent-scoped listeners receive only that agent.
|
|
270
|
+
* @param payload.agent - agent whose session owns the goal.
|
|
271
|
+
* @param payload.change - fresh current projection or clear tombstone.
|
|
272
|
+
* @mode emit
|
|
273
|
+
*/
|
|
274
|
+
'goal/changed'(this: import('@deepseek-ai/dsh-scope').Scoped<Agent>, payload: { agent: Agent; change: GoalChanged }): void
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
Types: [Agent](./core.md) · [Scoped](./scope.md)
|
|
278
|
+
|
|
279
|
+
Source: [`packages/goal/goal/src/domain.ts:114`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/goal/goal/src/domain.ts)
|
|
280
|
+
<!-- END GENERATED cordis-surface -->
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
editSource: "docs/subsystems/README.md"
|
|
3
|
+
outline: [2,3]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Subsystems
|
|
7
|
+
|
|
8
|
+
One page per subsystem of the DeepSeek Harness: what it is, the data structures it moves, and — where a `ctx` service or event scope backs it — a generated **Cordis API** section carrying its service and event reference. The folder complements [architecture.md](../index.md), which describes *behavior* across subsystems (the service map, the session/turn/step lifecycle, the event taxonomy); each page here is the reference for one subsystem's vocabulary and wiring.
|
|
9
|
+
|
|
10
|
+
| Page | Owns |
|
|
11
|
+
|---|---|
|
|
12
|
+
| [core.md](./core.md) | how `packages/core` controls the agent loop: the package-by-package loop description, agent creation and ownership (`AgentHandle`), the `Agent` handle's delivery/cancellation/interception contracts, and the repo-wide type patterns (`…Map → derived-union`, branded ids) |
|
|
13
|
+
| [llm-streaming.md](./llm-streaming.md) | the `packages/llm` conversation types — `Message`/`ContentBlock`, the assembled model request, the `StreamChunk` wire protocol and adapter contract, `BlockAssembler`, and the `LlmAdapter` provider contract |
|
|
14
|
+
| [token-meter.md](./token-meter.md) | immutable scalar and positional replay measurements with consumed-log revisions |
|
|
15
|
+
| [scope.md](./scope.md) | scoped registration identity, dispatch carriers, and the owned `Scope` context |
|
|
16
|
+
| [typert.md](./typert.md) | Remote invocation descriptors, lookup/Context declarations, Typert registries, and the Host Gateway/Client API boundaries |
|
|
17
|
+
| [goal.md](./goal.md) | persisted goal identity, lifecycle snapshots, activation, change records, and round attribution |
|
|
18
|
+
| [schedule.md](./schedule.md) | Session-local reminder records, durable transitions, active views, and ordinary-conversation delivery |
|
|
19
|
+
| [commands.md](./commands.md) | the human-command registry service: definitions, adapter discovery, direct invocation, results, and parsing views |
|
|
20
|
+
| [session.md](./session.md) | the full `SessionEventMap` variant catalog, `TurnTrigger`/`TurnEndReason`, `deriveMessages()`, execution enclosure, and standalone events |
|
|
21
|
+
| [persistence.md](./persistence.md) | the durability seam: `SessionPersistence`, JSONL + SQLite backends, `session/flush`, crash recovery, `SessionHeader` |
|
|
22
|
+
| [settings.md](./settings.md) | the user-settings seam: `SettingsNamespace` registration, layered resolution (defaults → composition `base` → user document), owner scopes, hot commits |
|
|
23
|
+
| [credentials.md](./credentials.md) | the credential seam: `CredentialRef` references (never values) in configuration, per-operation resolution, UI-safe `CredentialInfo`, provider source layers |
|
|
24
|
+
| [session-query.md](./session-query.md) | logical records, bounded exact-event reads, relationship traces, semantic filters/documents, and full-text result pages |
|
|
25
|
+
| [feedback.md](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/subsystems/feedback.md) | lifecycle-bound per-message feedback records, optimistic versions, sidecar persistence, and the Host Remote contract |
|
|
26
|
+
| [session-title.md](./session-title.md) | durable title snapshots, cited source-message seqs, and the asynchronous provider contract |
|
|
27
|
+
| [session-reference.md](./session-reference.md) | structured cross-session references: `SessionReferenceInput`/`Candidate`, prepared message contexts, the stable error taxonomy |
|
|
28
|
+
| [system-prompt.md](./system-prompt.md) | per-assembly context, tool-provider results, prompt sections, and cooperative assembly |
|
|
29
|
+
| [tools.md](./tools.md) | `ToolDefinition` full fields, the schema DSL, `ToolExecution`/`ToolResult`, tool-presentation UI types, and the guarded execution pipeline |
|
|
30
|
+
| [user-questions.md](./user-questions.md) | the UI-backed human question/answer seam: `AskUserQuestionRequest`, answer/options vocabulary, provider API, error taxonomy |
|
|
31
|
+
| [approval.md](./approval.md) | the one-shot user-approval seam: `ApprovalRequest`, `ApprovalOutcome`, per-session policy, audit events, and answerer contracts |
|
|
32
|
+
| [attachment.md](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/subsystems/attachment.md) | durable image identity and metadata, validation inputs, verified reads, and the `AttachmentStore` seam |
|
|
33
|
+
| [shell.md](./shell.md) | the bash executor seam: `ShellExecRequest`/`Spec`, `ShellRunResult`, background `ShellProcess` handles |
|
|
34
|
+
| [subprocess.md](./subprocess.md) | the subprocess seam: fully-explicit `SubprocessSpawnSpec`, offset-based output readers, unclassified `SubprocessOutcome`, and the managed `DSH_*` environment vocabulary |
|
|
35
|
+
| [terminal.md](./terminal.md) | persistent terminal ids, backend/session contracts, send readiness, bounded reads, and owner-visible snapshots |
|
|
36
|
+
| [sandbox.md](./sandbox.md) | per-session policy resolution and the process-confinement seam: file-effect modes, execution/provider policies, `ConfinedArgv`, enforcement and fail-closed errors |
|
|
37
|
+
| [code-runtime.md](./code-runtime.md) | the code-execution seam: `CodeRunRequest`/`Result`, binding namespaces, captured logs, the `CodeRunFailure` taxonomy |
|
|
38
|
+
| [extensions.md](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/subsystems/extensions.md) | versioned dynamic Cordis Plugins and Packages, Host/Client activation, approval, runtime inspection, and lifecycle teardown |
|
|
39
|
+
| [filesystem.md](./filesystem.md) | the filesystem seam: `FsTarget`, read/write/edit outcomes, observed-file state, `FsErrorCode` |
|
|
40
|
+
| [lsp.md](./lsp.md) | the LSP navigation seam: `LspQueryRequest`/`Result`, `LspProvider`/`Service`, four operations, `LspError` |
|
|
41
|
+
| [skills.md](./skills.md) | the skill service: discovery priority, `SkillSummary`/`SkillDefinition`, session-prefix catalog, model-facing `skill` loading |
|
|
42
|
+
| [compaction.md](./compaction.md) | the compaction seam: the `compaction/*` session events, `CompactionResult`, the `CompactionEngine` interface |
|
|
43
|
+
| [subagent.md](./subagent.md) | the subagent seam: the named-provider registry, `SubagentStartRequest`/`Result`/`Run`, the start-time-vs-runtime capability split |
|
|
44
|
+
| [web.md](./web.md) | the web access seam: `WebSearchRequest`/`Result`, `WebFetchRequest`/`Result`, `WebFetchBody`, provider availability, `WebError` |
|
|
45
|
+
| [spill.md](./spill.md) | the spill storage seam: `SaveTextSpill`, `SpillOwner`/`SpillSource`, `SpillRef`, the branded `SpillLocator` |
|
|
46
|
+
| [workflow.md](./workflow.md) | the workflow seam: `WorkflowStartRequest`, `WorkflowMeta`, `WorkflowRun`/`Result`, the `workflow/*` event payloads, `WorkflowError` fatality |
|
|
47
|
+
| [jobs.md](./jobs.md) | the background-job runtime: branded `JobId`s, the producer contract, consumer views, and `ctx.jobs` service behavior |
|
|
48
|
+
| [permission-presets.md](./permission-presets.md) | the permission-preset layer: `PresetSpec`/`PresetOption`, the derived `custom` state, the log-only `permission/preset` event |
|
|
49
|
+
| [plan.md](./plan.md) | plan mode: the log-only `plan/mode` state, pending-selection flush, `PlanModeConfig`, the `exit_plan_mode` review arc |
|
|
50
|
+
| [invariants.md](./invariants.md) | the runtime-invariant registry: selection `Config`, `InvariantInstaller`/`InvariantFailure`, the empty-companion contract |
|
|
51
|
+
| [web-server.md](./web-server.md) | the HTTP carrier: `WebRouteKind`/`WebRoute`, match order, the claimable fallback seat, index taps |
|
|
52
|
+
| [storage.md](./storage.md) | the storage subsystem: the backend contract (`StorageBackend`), `StorageForms`, `DomainSpec`/`Domain`, `domain/changed` |
|
|
53
|
+
| [workspace.md](./workspace.md) | the workspace registry: `Workspace`/`WorkspaceId`, registration and resolution, the session `cwd` relationship |
|
|
54
|
+
| [client-modules.md](./client-modules.md) | the web plugin table: `dsh.client` declarations, `WebBootGraph` wire composition, the bundle route and index tap |
|
|
55
|
+
| [session-projection.md](./session-projection.md) | the projection seam: `SessionProjectionMap`, the pure `ProjectionDefinition` unit, `ProjectionSnapshot`'s consistent cut, the change feed |
|
|
56
|
+
| [session-telemetry.md](./session-telemetry.md) | the outbound session-reporting capability seam: `SessionTelemetryRecord`/`SessionTelemetrySeverity`, the `SessionTelemetrySink` contract, and the `session-telemetry/record` redact waterfall |
|
|
57
|
+
|
|
58
|
+
> Type declarations and their JSDoc on these pages are source-equivalent and drift-checked by `pnpm run verify-type-equiv` (see [development.md](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/development.md#documenting-types-verbatim-ts-type-equiv)). Ordinary blocks preserve complete declarations; `public-api` blocks preserve body-stripped public class declarations. Cordis services and events use each page's generated **Cordis API** section.
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
---
|
|
2
|
+
editSource: "docs/subsystems/invariants.md"
|
|
3
|
+
outline: [2,3]
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Runtime Invariants
|
|
7
|
+
|
|
8
|
+
[dsh-invariants](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/runtime-diagnostics/invariants) is the configurable registry service (`ctx.invariants`) for package-owned runtime invariant checks. It is one support-group package, not a three-package capability seam, and not part of the agent-loop spine: the registry owns selection, name reservation, child-fiber lifecycle, and package-attributed failure, while every workspace package publishes a `./invariant` companion plugin that registers checks under its exact npm package name. What a check may assert — authoritative event streams or mutable data, never service or method presence — is the runtime-invariants convention in [AGENTS.md](https://github.com/deepseek-ai/deepseek-harness/blob/master/AGENTS.md#conventions); the registry design is owned by the [invariant-service Agent Note](https://github.com/deepseek-ai/deepseek-harness/blob/master/.agents/notes/implemented/architecture/2026-07-19-package-owned-invariant-service.md).
|
|
9
|
+
|
|
10
|
+
Source: [`packages/runtime-diagnostics/invariants/src/index.ts`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/runtime-diagnostics/invariants/src/index.ts)
|
|
11
|
+
|
|
12
|
+
## Selection
|
|
13
|
+
|
|
14
|
+
```ts type-equiv
|
|
15
|
+
/** Runtime invariant selection configured on the service plugin. */
|
|
16
|
+
interface Config {
|
|
17
|
+
/** Global switch; defaults to `true`. */
|
|
18
|
+
readonly enabled?: boolean
|
|
19
|
+
/** Case-sensitive JavaScript regex sources that admit package names; empty admits all. */
|
|
20
|
+
readonly package_allowlist?: string[]
|
|
21
|
+
/** Case-sensitive JavaScript regex sources that exclude package names after allowlist matching. */
|
|
22
|
+
readonly package_blocklist?: string[]
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
A package is selected when the service is enabled, the allowlist is empty or at least one pattern matches its full npm name, and no blocklist pattern matches — a blocklist match overrides an allowlist match. Entries compile with `new RegExp(source)`: matching is unanchored unless the source supplies `^` and `$`, and `/pattern/flags` syntax is not parsed. Validation fails loud at service startup: a blank, whitespace-padded, duplicate, or invalid entry throws instead of being skipped. A valid pattern may match no currently loaded package, so later loading and HMR stay deterministic; filters are fixed for the service lifetime ([README](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/runtime-diagnostics/invariants/README.md)).
|
|
27
|
+
|
|
28
|
+
## The installer
|
|
29
|
+
|
|
30
|
+
```ts type-equiv
|
|
31
|
+
/**
|
|
32
|
+
* Throw a package-attributed invariant failure.
|
|
33
|
+
* @param message - violated package contract without the standard prefix.
|
|
34
|
+
* @returns never because reporting a violation throws.
|
|
35
|
+
*/
|
|
36
|
+
type InvariantFailure = (message: string) => never
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
```ts type-equiv
|
|
40
|
+
/** Install one package's checks into the registration's child context. */
|
|
41
|
+
interface InvariantInstaller {
|
|
42
|
+
/**
|
|
43
|
+
* Install the package contribution.
|
|
44
|
+
* @param ctx - child context owned by this invariant registration.
|
|
45
|
+
* @param fail - reporter bound to the registering package name.
|
|
46
|
+
* @returns nothing, or a promise settling after asynchronous checks finish.
|
|
47
|
+
*/
|
|
48
|
+
(ctx: Context, fail: InvariantFailure): void | Promise<void>
|
|
49
|
+
/** Services the child installer fiber may access. */
|
|
50
|
+
readonly inject?: Inject
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
An enabled installer runs in a dedicated child Cordis fiber; `installer.inject` declares the services that fiber may access, and synchronous or asynchronous installer completion is joined before the registration succeeds. `fail(message)` throws `InvariantError` — `extends Error` with stable `code: 'INVARIANT'`, the owning `packageName`, and a message prefixed `invariant violated by "<package>": …` — so a violation is attributable without the registry importing any product package.
|
|
55
|
+
|
|
56
|
+
## The service
|
|
57
|
+
|
|
58
|
+
`ctx.invariants.register(packageName, installer)` reserves one active registration for the full npm package name and returns its effect-scoped disposer. The reservation holds even when filters keep the installer inactive, so two plugins can never silently claim the same package name; a duplicate, blank, or whitespace-containing name throws. An installer failure disposes the child fiber and releases the reservation atomically. The service owns every registration fiber while the returned disposer also belongs to the companion fiber: unloading either side removes listeners, trace state, and the reservation, so a companion can reload and register the same name again without retained state.
|
|
59
|
+
|
|
60
|
+
## The companion contract
|
|
61
|
+
|
|
62
|
+
Every workspace package owns a `./invariant` companion ([package contract](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/AGENTS.md)); publication and registration are exhaustive, but assertions are deliberately not synthetic. A companion installs a check only when its package owns an observable event or mutable-data relationship; otherwise it exports an empty installer whose leading comment starts `No runtime invariant:` and explains, package-specifically, why nothing is checkable. `pnpm run verify-package-invariants` mechanically rejects generated markers, unexplained empty installers, non-empty installers that omit or ignore the reporter, incorrect registration names, and incomplete export, publication, dependency, or bundle wiring ([mechanical-rule Agent Note](https://github.com/deepseek-ai/deepseek-harness/blob/master/.agents/notes/implemented/architecture/2026-07-19-package-invariant-runtime-contracts.md)). The catalog of executable companions and the standard composition live in the [package README](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/runtime-diagnostics/invariants/README.md).
|
|
63
|
+
|
|
64
|
+
<!-- BEGIN GENERATED cordis-surface (gen-cordis-catalog.ts) — do not edit between markers -->
|
|
65
|
+
|
|
66
|
+
<a id="cordis-surface"></a>
|
|
67
|
+
|
|
68
|
+
## Cordis API
|
|
69
|
+
|
|
70
|
+
Generated from source by `scripts/gen-cordis-catalog.ts` (verified fresh by `pnpm run verify-cordis-catalog` in doc-sync; regenerate with `pnpm run gen-cordis-catalog`) — this section is byte-identical in both language sides of the page. Signature blocks use a `ts cordis-catalog` fence and keep the original source JSDoc; dispatch modes are defined in the [primer](../cordis-primer.md#dispatch-modes), and the framework-inherited `ctx` API lives in [cordis-api/inherited.md](../cordis-api/inherited.md).
|
|
71
|
+
|
|
72
|
+
<a id="ctxinvariants--invariantregistry"></a>
|
|
73
|
+
|
|
74
|
+
### `ctx.invariants` — `InvariantRegistry`
|
|
75
|
+
|
|
76
|
+
Package-owned invariant registry with global and regex-based selection.
|
|
77
|
+
|
|
78
|
+
```ts cordis-catalog
|
|
79
|
+
/**
|
|
80
|
+
* Register one package's invariant installer. The package name is reserved
|
|
81
|
+
* even when filtering disables its checks. Enabled installers run in a child
|
|
82
|
+
* fiber; failure disposes that fiber and releases the reservation.
|
|
83
|
+
* @param packageName - full npm package name that owns the contribution.
|
|
84
|
+
* @param installer - listener or startup-check installer for the child context.
|
|
85
|
+
* @returns an effect-scoped disposer for the registration.
|
|
86
|
+
*/
|
|
87
|
+
register(packageName: string, installer: InvariantInstaller): () => void
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Source: [`packages/runtime-diagnostics/invariants/src/index.ts:94`](https://github.com/deepseek-ai/deepseek-harness/blob/master/packages/runtime-diagnostics/invariants/src/index.ts)
|
|
91
|
+
<!-- END GENERATED cordis-surface -->
|