dsh-project-flow 0.9.1 → 0.9.2
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/CHANGELOG.md
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-project-flow",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Four-stage project workflow: requirement, plan, build, QA, with an intent gate, a rework loop, self-healing recovery, a watchdog that stops runaway runs, snapshot rollback with a retention cap, a single status light, and a machine-readable Completion_Evidence.json.",
|
|
6
6
|
"type": "module",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
},
|
|
47
47
|
"files": [
|
|
48
48
|
"bench/",
|
|
49
|
-
"tests
|
|
49
|
+
"tests/*.mjs",
|
|
50
50
|
"index.js",
|
|
51
51
|
"client.js",
|
|
52
52
|
"gate.mjs",
|
package/tests/paths.mjs
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import { existsSync } from 'node:fs'
|
|
11
11
|
import { join, dirname } from 'node:path'
|
|
12
|
+
import { tmpdir } from 'node:os'
|
|
12
13
|
import { fileURLToPath } from 'node:url'
|
|
13
14
|
|
|
14
15
|
export const HERE = dirname(fileURLToPath(import.meta.url))
|
|
@@ -30,8 +31,13 @@ export const LIVE_DIR = (() => {
|
|
|
30
31
|
return 'C:/Users/ASUS/.dsh/profiles/desktop/node_modules/dsh-project-flow'
|
|
31
32
|
})()
|
|
32
33
|
|
|
33
|
-
/**
|
|
34
|
-
|
|
34
|
+
/**
|
|
35
|
+
* 临时产物目录。放跑测试时的中间文件,不放被验的对象。
|
|
36
|
+
*
|
|
37
|
+
* 以前是 join(HERE, '_trial')——建在 tests/ 里,而 tests/ 随包发布,
|
|
38
|
+
* 跑一次测试就在包目录里留下 _trial/。改成系统临时目录。
|
|
39
|
+
*/
|
|
40
|
+
export const TRIAL = join(tmpdir(), 'pf-trial')
|
|
35
41
|
|
|
36
42
|
/** 被验的 index.js 绝对路径。 */
|
|
37
43
|
export function targetIndex() {
|
|
@@ -11,12 +11,16 @@ import { sibling } from './paths.mjs'
|
|
|
11
11
|
import { pathToFileURL } from 'node:url'
|
|
12
12
|
import assert from 'node:assert/strict'
|
|
13
13
|
import { join, dirname } from 'node:path'
|
|
14
|
+
import { tmpdir } from 'node:os'
|
|
14
15
|
import { mkdir } from 'node:fs/promises'
|
|
15
16
|
import { fileURLToPath } from 'node:url'
|
|
16
17
|
const { BudgetBreaker, Watchdog } = await import(pathToFileURL(sibling('watchdog.mjs')).href + `?t=${Date.now()}`)
|
|
17
18
|
|
|
18
19
|
const here = dirname(fileURLToPath(import.meta.url))
|
|
19
|
-
|
|
20
|
+
// 沙箱必须建在系统临时目录:这里以前是 join(here, '_wd_sandbox'),
|
|
21
|
+
// 而 tests/ 会随包发布——跑一次测试就把 .project-flow/demo/run.log 这类
|
|
22
|
+
// 运行时产物留在包里,下次 npm publish 一起发出去。
|
|
23
|
+
const sandbox = join(tmpdir(), 'pf-wd-sandbox')
|
|
20
24
|
|
|
21
25
|
test('BudgetBreaker 暴露累计 token 数', () => {
|
|
22
26
|
const budget = new BudgetBreaker({ limitUsd: 10 })
|
package/tests/watchdog.test.mjs
CHANGED
|
@@ -3,6 +3,7 @@ import { pathToFileURL } from 'node:url'
|
|
|
3
3
|
import assert from 'node:assert/strict'
|
|
4
4
|
import { mkdir, writeFile, rm, utimes } from 'node:fs/promises'
|
|
5
5
|
import { join, dirname } from 'node:path'
|
|
6
|
+
import { tmpdir } from 'node:os'
|
|
6
7
|
import { fileURLToPath } from 'node:url'
|
|
7
8
|
const {
|
|
8
9
|
fingerprint,
|
|
@@ -25,7 +26,10 @@ if (_gateWatchdog !== _liveWatchdog) {
|
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
const here = dirname(fileURLToPath(import.meta.url))
|
|
28
|
-
|
|
29
|
+
// 沙箱必须建在系统临时目录:这里以前是 join(here, '_wd_sandbox'),
|
|
30
|
+
// 而 tests/ 会随包发布——跑一次测试就把 .project-flow/demo/run.log 这类
|
|
31
|
+
// 运行时产物留在包里,下次 npm publish 一起发出去。
|
|
32
|
+
const sandbox = join(tmpdir(), 'pf-wd-sandbox')
|
|
29
33
|
|
|
30
34
|
// ── 指纹 ────────────────────────────────────────────
|
|
31
35
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
正在跑
|
package/tests/_wd_sandbox/a.txt
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
x
|