@sparkelf/dsh-patch-session-format-legacy-restart 0.2.0-rc.10
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.i18n.yaml +6 -0
- package/README.md +15 -0
- package/README.zh.md +15 -0
- package/package.json +35 -0
- package/patches/session-format-legacy-restart.patch +35 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 DeepSeek
|
|
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.
|
package/README.i18n.yaml
ADDED
|
@@ -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 patches/npm/session-format-legacy-restart/README.md
|
|
5
|
+
README.md: 1b95ffe045d8db24afaabc216a12b0c8624cc990
|
|
6
|
+
README.zh.md: c2cb6f693f0cee146deb7ae836b85fae8d0756eb
|
package/README.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# @sparkelf/dsh-patch-session-format-legacy-restart
|
|
2
|
+
|
|
3
|
+
English | [中文](README.zh.md)
|
|
4
|
+
|
|
5
|
+
This data-only package admits the released interrupted-turn restart pattern by default when v0 sessions are migrated.
|
|
6
|
+
|
|
7
|
+
Official `46196d6f95` added the pattern behind `legacyInterruptedTurnRestart`: a `turn/start` whose immediately preceding event is an `agent/inbox/spliced` targeting `next-turn` belongs to a turn that already ended, so the migration closes the open turn and advances `nextTurn`. The flag gates the admission; the shipped `RELEASED_V2_RELATIONSHIP_EXTENSIONS` never sets it, so the pattern is rejected unless a caller opts in.
|
|
8
|
+
|
|
9
|
+
The patch changes the gate in two ways. The extension becomes `boolean` rather than `true`, and the condition becomes `!== false` rather than `=== true`. Together these make the admission the default and give a caller that needs the strict reading an explicit `false`. The predecessor lookup also changes from an array index to a search by `seq`, because sequence numbers are not guaranteed to be dense across remapping.
|
|
10
|
+
|
|
11
|
+
The deployment carries a session that needs this: `session-f6ab795c-0a7b-4287-b3e5-19229e412024` holds an `agent/inbox/spliced` insert targeting `next-turn`, and the strict gate refuses its `turn/start`. This package is that deployment change, moved from a mirror stash into a reviewed patch so a rebuild cannot drop it.
|
|
12
|
+
|
|
13
|
+
The target is the exact official source base `ddefc45fbc7f8e46dd73185e68295696d1297887`. The Plus apply command verifies the base ancestry and payload before applying it. This package has no JavaScript entry, Cordis lifecycle, install script, or capability implementation.
|
|
14
|
+
|
|
15
|
+
Retire this package when official session-format migrations admit the interrupted-turn restart pattern by default, or when the sessions it serves no longer exist.
|
package/README.zh.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# @sparkelf/dsh-patch-session-format-legacy-restart
|
|
2
|
+
|
|
3
|
+
[English](README.md) | 中文
|
|
4
|
+
|
|
5
|
+
该data-only package在migrate v0 sessions时默认admit released interrupted-turn restart pattern。
|
|
6
|
+
|
|
7
|
+
official `46196d6f95`在`legacyInterruptedTurnRestart`后面加入该pattern:某个`turn/start`的紧邻前一event是指向`next-turn`的`agent/inbox/spliced`时,该turn已经结束,因此migration关闭open turn并推进`nextTurn`。该flag对该admission做gate;shipped的`RELEASED_V2_RELATIONSHIP_EXTENSIONS`从不设置它,所以除非caller主动开启,否则该pattern被拒绝。
|
|
8
|
+
|
|
9
|
+
该patch从两方面改变gate。extension从`true`变为`boolean`,condition从`=== true`变为`!== false`。两者合起来使admission成为默认行为,并为需要strict reading的caller提供显式`false`。predecessor lookup也从array index改为按`seq`查找,因为sequence number在remapping后不保证连续。
|
|
10
|
+
|
|
11
|
+
本deployment有一个session需要它:`session-f6ab795c-0a7b-4287-b3e5-19229e412024`含一个指向`next-turn`的`agent/inbox/spliced` insert,strict gate拒绝它的`turn/start`。本package就是那项deployment change,从mirror stash移入reviewed patch,使rebuild不会丢掉它。
|
|
12
|
+
|
|
13
|
+
target是exact official source base `ddefc45fbc7f8e46dd73185e68295696d1297887`。Plus apply command在应用前验证base ancestry与payload。本package没有JavaScript entry、Cordis lifecycle、install script或capability implementation。
|
|
14
|
+
|
|
15
|
+
official session-format migration默认admit interrupted-turn restart pattern,或它服务的session不再存在后,retire本package。
|
package/package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "Data-only exact official-source patch admitting the released interrupted-turn restart pattern by default",
|
|
3
|
+
"dshPatch": {
|
|
4
|
+
"formatVersion": 1,
|
|
5
|
+
"variants": [
|
|
6
|
+
{
|
|
7
|
+
"dsh": ">=0.1.6-alpha.1",
|
|
8
|
+
"file": "./patches/session-format-legacy-restart.patch",
|
|
9
|
+
"id": "session-format-legacy-restart-default",
|
|
10
|
+
"target": {
|
|
11
|
+
"baseRevision": "ddefc45fbc7f8e46dd73185e68295696d1297887",
|
|
12
|
+
"kind": "dsh-source",
|
|
13
|
+
"paths": [
|
|
14
|
+
"packages/session/session-format-v0-to-v1/"
|
|
15
|
+
]
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"patches/*.patch"
|
|
22
|
+
],
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"name": "@sparkelf/dsh-patch-session-format-legacy-restart",
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"access": "public"
|
|
27
|
+
},
|
|
28
|
+
"repository": {
|
|
29
|
+
"directory": "patches/npm/session-format-legacy-restart",
|
|
30
|
+
"type": "git",
|
|
31
|
+
"url": "git+https://github.com/SparkElf/deepseek-harness-plus.git"
|
|
32
|
+
},
|
|
33
|
+
"type": "module",
|
|
34
|
+
"version": "0.2.0-rc.10"
|
|
35
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
diff --git a/packages/session/session-format-v0-to-v1/src/relationships.ts b/packages/session/session-format-v0-to-v1/src/relationships.ts
|
|
2
|
+
index ddd1a4b..5cf0c7c 100644
|
|
3
|
+
--- a/packages/session/session-format-v0-to-v1/src/relationships.ts
|
|
4
|
+
+++ b/packages/session/session-format-v0-to-v1/src/relationships.ts
|
|
5
|
+
@@ -35,7 +35,7 @@ export interface ReleasedRelationshipExtensions {
|
|
6
|
+
/** Title-request model input was source-validated and preserved across sequence remapping. */
|
|
7
|
+
readonly preservedSourceTitleRequestText?: true
|
|
8
|
+
/** Admit the released resume pattern whose next-turn inbox insert omitted the prior turn/end. */
|
|
9
|
+
- readonly legacyInterruptedTurnRestart?: true
|
|
10
|
+
+ readonly legacyInterruptedTurnRestart?: boolean
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
@@ -78,8 +78,8 @@ export function assertReleasedArtifactRelationships(
|
|
15
|
+
|
|
16
|
+
switch (event.type) {
|
|
17
|
+
case 'turn/start': {
|
|
18
|
+
- const previous = artifact.events[event.seq - 1]
|
|
19
|
+
- if (extensions.legacyInterruptedTurnRestart === true
|
|
20
|
+
+ const previous = artifact.events.find(candidate => candidate.seq === event.seq - 1)
|
|
21
|
+
+ if (extensions.legacyInterruptedTurnRestart !== false
|
|
22
|
+
&& openTurn !== null
|
|
23
|
+
&& openStep === null
|
|
24
|
+
&& data['turn'] === openTurn + 1
|
|
25
|
+
@@ -437,8 +437,8 @@ function assertTitleSources(
|
|
26
|
+
throw new SessionFormatError(`${event.type} ${event.seq} messageSeqs must cite earlier human user/message events`)
|
|
27
|
+
}
|
|
28
|
+
const sourceData = releasedV0Record(source.data, `${source.type} ${seq} data`)
|
|
29
|
+
- const messageSource = releasedV0Record(sourceData['source'], `${source.type} ${seq} source`)
|
|
30
|
+
- if (messageSource['kind'] !== 'user') {
|
|
31
|
+
+ const provenance = releasedV0Record(sourceData['source'], `${source.type} ${seq} source`)
|
|
32
|
+
+ if (provenance['kind'] !== 'user') {
|
|
33
|
+
throw new SessionFormatError(`${event.type} ${event.seq} messageSeqs must cite earlier human user/message events`)
|
|
34
|
+
}
|
|
35
|
+
const content = sourceData['content'] as readonly Record<string, SessionFormatJsonValue>[]
|