@productbrain/cli 0.1.0-beta.7395 → 0.1.0-beta.7400
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/dist/__tests__/handshake-dormancy.test.js +6 -64
- package/dist/__tests__/handshake-dormancy.test.js.map +1 -1
- package/dist/__tests__/handshake-preview.test.js +41 -651
- package/dist/__tests__/handshake-preview.test.js.map +1 -1
- package/dist/__tests__/handshake.e2e.test.js +3 -262
- package/dist/__tests__/handshake.e2e.test.js.map +1 -1
- package/dist/__tests__/perimeter.test.js +1 -1
- package/dist/__tests__/perimeter.test.js.map +1 -1
- package/dist/__tests__/route-latency-budget.test.js +3 -1
- package/dist/__tests__/route-latency-budget.test.js.map +1 -1
- package/dist/commands/admin/seed.test.js +4 -9
- package/dist/commands/admin/seed.test.js.map +1 -1
- package/dist/commands/admin/seedRegistryEntries.generated.d.ts.map +1 -1
- package/dist/commands/admin/seedRegistryEntries.generated.js +0 -18
- package/dist/commands/admin/seedRegistryEntries.generated.js.map +1 -1
- package/dist/commands/admin/seedRegistryEntries.test.js +10 -7
- package/dist/commands/admin/seedRegistryEntries.test.js.map +1 -1
- package/dist/commands/connect-context.d.ts +8 -10
- package/dist/commands/connect-context.d.ts.map +1 -1
- package/dist/commands/connect-context.js +6 -8
- package/dist/commands/connect-context.js.map +1 -1
- package/dist/commands/connect-context.test.js +15 -10
- package/dist/commands/connect-context.test.js.map +1 -1
- package/dist/commands/connect-screens.d.ts +5 -4
- package/dist/commands/connect-screens.d.ts.map +1 -1
- package/dist/commands/connect-screens.js +7 -7
- package/dist/commands/connect-screens.js.map +1 -1
- package/dist/commands/handshake.d.ts +0 -19
- package/dist/commands/handshake.d.ts.map +1 -1
- package/dist/commands/handshake.js +67 -746
- package/dist/commands/handshake.js.map +1 -1
- package/dist/generated/routeLatencyBudget.generated.d.ts.map +1 -1
- package/dist/generated/routeLatencyBudget.generated.js +0 -25
- package/dist/generated/routeLatencyBudget.generated.js.map +1 -1
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/{setup/perimeter.d.ts → lib/writePerimeter.d.ts} +11 -11
- package/dist/lib/writePerimeter.d.ts.map +1 -0
- package/dist/{setup/perimeter.js → lib/writePerimeter.js} +11 -11
- package/dist/lib/writePerimeter.js.map +1 -0
- package/package.json +1 -1
- package/dist/setup/perimeter.d.ts.map +0 -1
- package/dist/setup/perimeter.js.map +0 -1
- package/dist/surfaces/__tests__/pb-setup-passthrough.test.d.ts +0 -2
- package/dist/surfaces/__tests__/pb-setup-passthrough.test.d.ts.map +0 -1
- package/dist/surfaces/__tests__/pb-setup-passthrough.test.js +0 -131
- package/dist/surfaces/__tests__/pb-setup-passthrough.test.js.map +0 -1
|
@@ -1,20 +1,13 @@
|
|
|
1
1
|
import { describe, expect, test } from 'vitest';
|
|
2
2
|
import { relative, sep } from 'path';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
.toBe('/repo/.productbrain/skills/my-foo.md');
|
|
8
|
-
});
|
|
9
|
-
test('null authoringPath falls back to name-derivation (unchanged)', () => {
|
|
10
|
-
expect(__test.setupAuthoringPath('/repo', { entryId: 'SETUP-FOO', name: 'Foo Bar', assetKind: 'skill', authoringPath: null }))
|
|
11
|
-
.toBe('/repo/.productbrain/skills/Foo Bar.md');
|
|
12
|
-
});
|
|
13
|
-
});
|
|
3
|
+
// WP-776 S3d/S3f: the setupAuthoringPath precedence/traversal-rejection describe blocks that
|
|
4
|
+
// used to live here are deleted along with the setup-authoring sync machinery and its
|
|
5
|
+
// __test.setupAuthoringPath export (handshake.ts). What remains below is general — the
|
|
6
|
+
// perimeter guard's .dormant handling — and survives that deletion.
|
|
14
7
|
test('WP-426 E3 relative authoringPath is POSIX under .productbrain/, never absolute', () => {
|
|
15
8
|
expect(relative('/repo/.productbrain', '/repo/.productbrain/skills/foo.md').split(sep).join('/')).toBe('skills/foo.md');
|
|
16
9
|
});
|
|
17
|
-
// WP-426 doneWhen #10: perimeter is containment-based (
|
|
10
|
+
// WP-426 doneWhen #10: perimeter is containment-based (writePerimeter.ts),
|
|
18
11
|
// not extension-gated — lock that .dormant targets pass under a surface dir.
|
|
19
12
|
// DEC-1690 retired the handshake's own on-disk rename/restore machinery, but a
|
|
20
13
|
// leftover .dormant sibling from an older binary can still reach this guard via
|
|
@@ -22,61 +15,10 @@ test('WP-426 E3 relative authoringPath is POSIX under .productbrain/, never abso
|
|
|
22
15
|
// accept it.
|
|
23
16
|
describe('WP-426 E4 perimeter accepts .dormant', () => {
|
|
24
17
|
test('.md.dormant / .mdc.dormant under a surface dir do not throw', async () => {
|
|
25
|
-
const { assertSetupWritePath } = await import('../
|
|
18
|
+
const { assertSetupWritePath } = await import('../lib/writePerimeter.js');
|
|
26
19
|
const manifest = { surfaces: ['.codex', '.cursor', '.claude'] };
|
|
27
20
|
expect(() => assertSetupWritePath('/repo/.cursor/rules/Foo.mdc.dormant', manifest, { cwd: '/repo' })).not.toThrow();
|
|
28
21
|
expect(() => assertSetupWritePath('/repo/.codex/skills/Foo.md.dormant', manifest, { cwd: '/repo' })).not.toThrow();
|
|
29
22
|
});
|
|
30
23
|
});
|
|
31
|
-
// WP-426 doneWhen #10 + Codex P1 (traversal rejection): a malicious authoringPath like
|
|
32
|
-
// '../../etc/passwd' (or an absolute path) is probed via existsSync/readFileSync in the
|
|
33
|
-
// writeback loop BEFORE any assertSetupWritePath write guard runs. The write-time guard is
|
|
34
|
-
// therefore insufficient — setupAuthoringPath itself must reject traversal/absolute values
|
|
35
|
-
// and fall back to the safe name-derived path under .productbrain/, never returning a path
|
|
36
|
-
// that escapes the tree.
|
|
37
|
-
describe('WP-426 E3 traversal rejection in setupAuthoringPath', () => {
|
|
38
|
-
test("`..` traversal authoringPath falls back to the safe name-derived path", () => {
|
|
39
|
-
const resolved = __test.setupAuthoringPath('/repo', {
|
|
40
|
-
entryId: 'X',
|
|
41
|
-
name: 'X',
|
|
42
|
-
assetKind: 'skill',
|
|
43
|
-
authoringPath: '../../etc/passwd',
|
|
44
|
-
});
|
|
45
|
-
expect(resolved).toBe('/repo/.productbrain/skills/X.md');
|
|
46
|
-
});
|
|
47
|
-
test('absolute authoringPath falls back to the safe name-derived path', () => {
|
|
48
|
-
const resolved = __test.setupAuthoringPath('/repo', {
|
|
49
|
-
entryId: 'X',
|
|
50
|
-
name: 'X',
|
|
51
|
-
assetKind: 'skill',
|
|
52
|
-
authoringPath: '/etc/passwd',
|
|
53
|
-
});
|
|
54
|
-
expect(resolved).toBe('/repo/.productbrain/skills/X.md');
|
|
55
|
-
});
|
|
56
|
-
test('a contained nested authoringPath is still honored', () => {
|
|
57
|
-
const resolved = __test.setupAuthoringPath('/repo', {
|
|
58
|
-
entryId: 'X',
|
|
59
|
-
name: 'X',
|
|
60
|
-
assetKind: 'skill',
|
|
61
|
-
authoringPath: 'skills/nested/x.md',
|
|
62
|
-
});
|
|
63
|
-
expect(resolved).toBe('/repo/.productbrain/skills/nested/x.md');
|
|
64
|
-
});
|
|
65
|
-
// Codex P2: containment is not enough — only kind-appropriate <dir>/**/*.md is honored.
|
|
66
|
-
test.each([
|
|
67
|
-
['bare directory', 'skills'],
|
|
68
|
-
['internal sync file', '.authoring-sync.json'],
|
|
69
|
-
['internal manifest', 'manifest.yaml'],
|
|
70
|
-
['non-markdown under kind dir', 'skills/foo.txt'],
|
|
71
|
-
['wrong-kind dir for a skill', 'rules/foo.md'],
|
|
72
|
-
])('%s falls back to the safe name-derived path', (_label, authoringPath) => {
|
|
73
|
-
const resolved = __test.setupAuthoringPath('/repo', {
|
|
74
|
-
entryId: 'X',
|
|
75
|
-
name: 'X',
|
|
76
|
-
assetKind: 'skill',
|
|
77
|
-
authoringPath,
|
|
78
|
-
});
|
|
79
|
-
expect(resolved).toBe('/repo/.productbrain/skills/X.md');
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
24
|
//# sourceMappingURL=handshake-dormancy.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handshake-dormancy.test.js","sourceRoot":"","sources":["../../src/__tests__/handshake-dormancy.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"handshake-dormancy.test.js","sourceRoot":"","sources":["../../src/__tests__/handshake-dormancy.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAErC,6FAA6F;AAC7F,sFAAsF;AACtF,uFAAuF;AACvF,oEAAoE;AAEpE,IAAI,CAAC,gFAAgF,EAAE,GAAG,EAAE;IAC1F,MAAM,CAAC,QAAQ,CAAC,qBAAqB,EAAE,mCAAmC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;AAC1H,CAAC,CAAC,CAAC;AAEH,2EAA2E;AAC3E,6EAA6E;AAC7E,+EAA+E;AAC/E,gFAAgF;AAChF,+EAA+E;AAC/E,aAAa;AACb,QAAQ,CAAC,sCAAsC,EAAE,GAAG,EAAE;IACpD,IAAI,CAAC,6DAA6D,EAAE,KAAK,IAAI,EAAE;QAC7E,MAAM,EAAE,oBAAoB,EAAE,GAAG,MAAM,MAAM,CAAC,0BAA0B,CAAC,CAAC;QAC1E,MAAM,QAAQ,GAAG,EAAE,QAAQ,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,CAAC,EAAS,CAAC;QACvE,MAAM,CAAC,GAAG,EAAE,CAAC,oBAAoB,CAAC,qCAAqC,EAAE,QAAQ,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;QACpH,MAAM,CAAC,GAAG,EAAE,CAAC,oBAAoB,CAAC,oCAAoC,EAAE,QAAQ,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;IACrH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|