@sparkelf/dsh-patch-mobile-journal-generation 0.1.0-rc.26
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 +9 -0
- package/README.zh.md +9 -0
- package/package.json +36 -0
- package/patches/mobile-journal-generation.patch +59 -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/mobile-journal-generation/README.md
|
|
5
|
+
README.md: 4d0f76dae4c3e4c833574c1d36d2c7f3840919b2
|
|
6
|
+
README.zh.md: 79c24c9a0b91fa7a5a327dadbc58abd08103325b
|
package/README.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# @sparkelf/dsh-patch-mobile-journal-generation
|
|
2
|
+
|
|
3
|
+
English | [中文](README.zh.md)
|
|
4
|
+
|
|
5
|
+
This data-only package keeps a replaced Mobile Bridge journal generation closed until its opening snapshot arrives. Buffered live entries from the new carrier cannot replace the published Session window before that snapshot establishes the generation cursor.
|
|
6
|
+
|
|
7
|
+
The target is exact official source revision `fb2c4b9e698e30edb738bca4cf0618587db7d203`. The payload changes the API Gateway journal stream and its existing Client test only; responsive layout, Sidebar, Composer, and Mobile Bridge transport remain in their current owners.
|
|
8
|
+
|
|
9
|
+
Retire this package when official DSH ships the replacement-generation ordering behavior.
|
package/README.zh.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# @sparkelf/dsh-patch-mobile-journal-generation
|
|
2
|
+
|
|
3
|
+
[English](README.md) | 中文
|
|
4
|
+
|
|
5
|
+
该data-only package让被替换的Mobile Bridge journal generation保持关闭,直到opening snapshot到达。来自新carrier的buffered live entries不能在snapshot建立generation cursor之前替换已发布Session window。
|
|
6
|
+
|
|
7
|
+
target是exact official source revision `fb2c4b9e698e30edb738bca4cf0618587db7d203`。payload只修改API Gateway journal stream及其既有Client test;responsive layout、Sidebar、Composer与Mobile Bridge transport仍由当前owner持有。
|
|
8
|
+
|
|
9
|
+
official DSH发布replacement-generation ordering behavior后,retire本package。
|
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "Wait for a replacement mobile journal generation opening snapshot before consuming its buffered live entries",
|
|
3
|
+
"dshPatch": {
|
|
4
|
+
"formatVersion": 1,
|
|
5
|
+
"variants": [
|
|
6
|
+
{
|
|
7
|
+
"dsh": ">=0.1.5-rc.2",
|
|
8
|
+
"file": "./patches/mobile-journal-generation.patch",
|
|
9
|
+
"id": "mobile-journal-opening-generation",
|
|
10
|
+
"target": {
|
|
11
|
+
"baseRevision": "fb2c4b9e698e30edb738bca4cf0618587db7d203",
|
|
12
|
+
"kind": "dsh-source",
|
|
13
|
+
"paths": [
|
|
14
|
+
"packages/api/gateway/src/client/",
|
|
15
|
+
"packages/api/gateway/tests/"
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"patches/*.patch"
|
|
23
|
+
],
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"name": "@sparkelf/dsh-patch-mobile-journal-generation",
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
},
|
|
29
|
+
"repository": {
|
|
30
|
+
"directory": "patches/npm/mobile-journal-generation",
|
|
31
|
+
"type": "git",
|
|
32
|
+
"url": "git+https://github.com/SparkElf/deepseek-harness-plus.git"
|
|
33
|
+
},
|
|
34
|
+
"type": "module",
|
|
35
|
+
"version": "0.1.0-rc.26"
|
|
36
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
diff --git a/packages/api/gateway/src/client/journal-stream.ts b/packages/api/gateway/src/client/journal-stream.ts
|
|
2
|
+
index ab013abdf3..25e415747e 100644
|
|
3
|
+
--- a/packages/api/gateway/src/client/journal-stream.ts
|
|
4
|
+
+++ b/packages/api/gateway/src/client/journal-stream.ts
|
|
5
|
+
@@ -241,6 +241,10 @@ export abstract class RemoteJournalStream<
|
|
6
|
+
if (next.done) return
|
|
7
|
+
const item = next.value
|
|
8
|
+
if (item.generation !== this.generation) {
|
|
9
|
+
+ // A replaced mobile carrier can surface buffered live entries before
|
|
10
|
+
+ // its opening snapshot. The snapshot subsumes them, so retain the
|
|
11
|
+
+ // published window and wait for that generation's opening cursor.
|
|
12
|
+
+ if (item.value.type !== 'opened') continue
|
|
13
|
+
this.replaceGeneration(item, true)
|
|
14
|
+
continue
|
|
15
|
+
}
|
|
16
|
+
diff --git a/packages/api/gateway/tests/journal-stream.client.spec.ts b/packages/api/gateway/tests/journal-stream.client.spec.ts
|
|
17
|
+
index 498f5a033b..226340fee9 100644
|
|
18
|
+
--- a/packages/api/gateway/tests/journal-stream.client.spec.ts
|
|
19
|
+
+++ b/packages/api/gateway/tests/journal-stream.client.spec.ts
|
|
20
|
+
@@ -788,7 +788,7 @@ describe('RemoteJournalStream', () => {
|
|
21
|
+
await fixture.journal.dispose()
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
- it('reports a resumed generation that emits an entry before its cursor', async () => {
|
|
25
|
+
+ it('drops resumed entries before the replacement opening cursor', async () => {
|
|
26
|
+
const finish = Promise.withResolvers<undefined>()
|
|
27
|
+
const fixture = journalFixture(
|
|
28
|
+
[
|
|
29
|
+
@@ -797,17 +797,26 @@ describe('RemoteJournalStream', () => {
|
|
30
|
+
waitAfterFrames: finish.promise,
|
|
31
|
+
terminal: new RemoteStreamCarrierError('lost'),
|
|
32
|
+
},
|
|
33
|
+
- { frames: [{ type: 'entry', entry: { seq: 1 } }] },
|
|
34
|
+
+ {
|
|
35
|
+
+ frames: [
|
|
36
|
+
+ { type: 'entry', entry: { seq: 1 } },
|
|
37
|
+
+ opened(1, page('replacement', [0, 1])),
|
|
38
|
+
+ ],
|
|
39
|
+
+ hold: true,
|
|
40
|
+
+ },
|
|
41
|
+
],
|
|
42
|
+
[],
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
await fixture.journal.open({})
|
|
46
|
+
finish.resolve(undefined)
|
|
47
|
+
- await vi.waitFor(() => { expect(fixture.failed).toHaveBeenCalledOnce() })
|
|
48
|
+
- expect(fixture.failed.mock.calls[0]?.[0]).toMatchObject({
|
|
49
|
+
- message: 'resumed fixture journal emitted an entry before its opening cursor',
|
|
50
|
+
+ await vi.waitFor(() => { expect(fixture.changes).toHaveLength(2) })
|
|
51
|
+
+ expect(fixture.changes.at(-1)).toMatchObject({
|
|
52
|
+
+ type: 'replace',
|
|
53
|
+
+ page: { marker: 'replacement' },
|
|
54
|
+
+ entries: [{ seq: 0 }, { seq: 1 }],
|
|
55
|
+
})
|
|
56
|
+
+ expect(fixture.failed).not.toHaveBeenCalled()
|
|
57
|
+
await fixture.journal.dispose()
|
|
58
|
+
})
|
|
59
|
+
|