@lornatang/dsh-codex-security 0.1.7 → 0.1.8

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.
Files changed (55) hide show
  1. package/CHANGELOG.md +118 -103
  2. package/README.md +196 -189
  3. package/README.zh.md +196 -189
  4. package/docs/ARCHITECTURE.md +59 -53
  5. package/docs/ARTIFACTS.md +49 -46
  6. package/docs/CODEX-COMPATIBILITY.md +17 -0
  7. package/docs/SPEC.md +43 -43
  8. package/docs/TOOLS.md +364 -341
  9. package/docs/VALIDATION.md +33 -31
  10. package/docs/superpowers/plans/2026-11-16-deep-scan.md +71 -0
  11. package/docs/superpowers/specs/2026-11-16-deep-scan-design.md +31 -0
  12. package/lib/constants.js +3 -3
  13. package/lib/contracts.js +114 -34
  14. package/lib/deep-coordinator.js +599 -0
  15. package/lib/deep-host.js +36 -0
  16. package/lib/deep-worker.js +254 -0
  17. package/lib/git.js +24 -22
  18. package/lib/index.js +23 -1
  19. package/lib/secure-read.js +229 -0
  20. package/lib/service.js +403 -62
  21. package/lib/state-lock.js +71 -0
  22. package/lib/store.js +33 -15
  23. package/lib/target.js +33 -13
  24. package/lib/tools.js +54 -19
  25. package/lib/types/constants.d.ts +1 -1
  26. package/lib/types/contracts.d.ts +5 -2
  27. package/lib/types/deep-coordinator.d.ts +70 -0
  28. package/lib/types/deep-host.d.ts +32 -0
  29. package/lib/types/deep-worker.d.ts +110 -0
  30. package/lib/types/git.d.ts +10 -10
  31. package/lib/types/index.d.ts +1 -1
  32. package/lib/types/secure-read.d.ts +15 -0
  33. package/lib/types/service.d.ts +20 -4
  34. package/lib/types/state-lock.d.ts +9 -0
  35. package/lib/types/store.d.ts +5 -2
  36. package/lib/types/target.d.ts +1 -0
  37. package/lib/types/tools.d.ts +3 -2
  38. package/lib/types/types.d.ts +42 -7
  39. package/lib/types/util.d.ts +4 -0
  40. package/lib/types/worker-preset.d.ts +18 -0
  41. package/lib/util.js +27 -4
  42. package/lib/worker-preset.js +8 -0
  43. package/package.json +131 -123
  44. package/schemas/coverage.schema.json +136 -134
  45. package/skills/README.md +122 -116
  46. package/skills/assess-patch-risk/SKILL.md +10 -0
  47. package/skills/attack-path-analysis/SKILL.md +10 -0
  48. package/skills/deep-security-scan/SKILL.md +15 -116
  49. package/skills/define-security-policy/SKILL.md +10 -0
  50. package/skills/finding-discovery/SKILL.md +10 -0
  51. package/skills/fix-finding/SKILL.md +14 -112
  52. package/skills/propose-security-hardening/SKILL.md +10 -0
  53. package/skills/track-findings/SKILL.md +12 -113
  54. package/skills/validation/SKILL.md +10 -0
  55. package/skills/verify-fix/SKILL.md +14 -108
package/package.json CHANGED
@@ -1,123 +1,131 @@
1
- {
2
- "name": "@lornatang/dsh-codex-security",
3
- "version": "0.1.7",
4
- "description": "Agent-native security review workbench for DeepSeek Harness, modeled on OpenAI codex-security: sealed scans, findings contract, deep-scan orchestration and SARIF/JSON export.",
5
- "type": "module",
6
- "license": "Apache-2.0",
7
- "author": "Lornatang",
8
- "keywords": [
9
- "deepseek-harness",
10
- "dsh",
11
- "dsh-plugin",
12
- "security",
13
- "code-security",
14
- "appsec",
15
- "sast",
16
- "codex-security",
17
- "security-scan",
18
- "sarif"
19
- ],
20
- "engines": {
21
- "node": ">=22.19",
22
- "dsh": "*"
23
- },
24
- "main": "lib/index.js",
25
- "types": "lib/types/index.d.ts",
26
- "exports": {
27
- ".": {
28
- "types": "./lib/types/index.d.ts",
29
- "default": "./lib/index.js"
30
- },
31
- "./client": {
32
- "types": "./lib/types/client/index.d.ts",
33
- "default": "./lib/client.js"
34
- },
35
- "./cordis.patch.yml": "./cordis.patch.yml",
36
- "./package.json": "./package.json"
37
- },
38
- "files": [
39
- "lib",
40
- "cordis.patch.yml",
41
- "skills",
42
- "references",
43
- "schemas",
44
- "docs",
45
- "examples",
46
- "README.md",
47
- "README.zh.md",
48
- "CHANGELOG.md",
49
- "LICENSE",
50
- "NOTICE"
51
- ],
52
- "scripts": {
53
- "clean": "node -e \"require('node:fs').rmSync('lib',{recursive:true,force:true})\"",
54
- "build:host": "tsc -p tsconfig.json",
55
- "build:client": "tsc -p tsconfig.client.json",
56
- "build:bundle": "node scripts/bundle-client.mjs",
57
- "build": "npm run clean && npm run build:host && npm run build:client && npm run build:bundle",
58
- "typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.client.json --noEmit",
59
- "test": "npm run build && node --test tests/*.test.mjs",
60
- "prepack": "npm test"
61
- },
62
- "dsh": {
63
- "bundle": {
64
- "patch": "./cordis.patch.yml"
65
- },
66
- "client": {
67
- "inject": [
68
- "@deepseek-ai/dsh-client-ui-slots",
69
- "@deepseek-ai/dsh-client-ui-settings"
70
- ],
71
- "platform": "web"
72
- }
73
- },
74
- "dependencies": {
75
- "@deepseek-ai/schemastery": "~3.19.0",
76
- "ajv": "^8.20.0",
77
- "ajv-formats": "^3.0.1"
78
- },
79
- "peerDependencies": {
80
- "@deepseek-ai/cordis": "~4.1.0",
81
- "@deepseek-ai/dsh-skill": ">=0.2.2-rc.2 <0.3.0"
82
- },
83
- "devDependencies": {
84
- "@deepseek-ai/dsh-skill": "0.2.2-rc.2",
85
- "@deepseek-ai/dsh-tools": "0.2.2-rc.2",
86
- "@types/node": "^22.18.0",
87
- "@types/react": "^18.3.31",
88
- "typescript": "^5.9.0"
89
- },
90
- "repository": {
91
- "type": "git",
92
- "url": "git+https://github.com/Lornatang/dsh-codex-security.git"
93
- },
94
- "homepage": "https://github.com/Lornatang/dsh-codex-security#readme",
95
- "bugs": {
96
- "url": "https://github.com/Lornatang/dsh-codex-security/issues"
97
- },
98
- "publishConfig": {
99
- "access": "public"
100
- },
101
- "optionalDependencies": {
102
- "@koromix/koffi-android-arm64": "3.3.8",
103
- "@koromix/koffi-android-x64": "3.3.8",
104
- "@koromix/koffi-darwin-arm64": "3.3.8",
105
- "@koromix/koffi-darwin-x64": "3.3.8",
106
- "@koromix/koffi-freebsd-arm64": "3.3.8",
107
- "@koromix/koffi-freebsd-ia32": "3.3.8",
108
- "@koromix/koffi-freebsd-x64": "3.3.8",
109
- "@koromix/koffi-linux-arm": "3.3.8",
110
- "@koromix/koffi-linux-arm64": "3.3.8",
111
- "@koromix/koffi-linux-ia32": "3.3.8",
112
- "@koromix/koffi-linux-loong64": "3.3.8",
113
- "@koromix/koffi-linux-ppc64": "3.3.8",
114
- "@koromix/koffi-linux-riscv64": "3.3.8",
115
- "@koromix/koffi-linux-x64": "3.3.8",
116
- "@koromix/koffi-openbsd-arm64": "3.3.8",
117
- "@koromix/koffi-openbsd-ia32": "3.3.8",
118
- "@koromix/koffi-openbsd-x64": "3.3.8",
119
- "@koromix/koffi-win32-arm64": "3.3.8",
120
- "@koromix/koffi-win32-ia32": "3.3.8",
121
- "@koromix/koffi-win32-x64": "3.3.8"
122
- }
123
- }
1
+ {
2
+ "name": "@lornatang/dsh-codex-security",
3
+ "version": "0.1.8",
4
+ "description": "Agent-native security review workbench for DeepSeek Harness, modeled on OpenAI codex-security: sealed scans, findings contract, deep-scan orchestration and SARIF/JSON export.",
5
+ "type": "module",
6
+ "license": "Apache-2.0",
7
+ "author": "Lornatang",
8
+ "keywords": [
9
+ "deepseek-harness",
10
+ "dsh",
11
+ "dsh-plugin",
12
+ "security",
13
+ "code-security",
14
+ "appsec",
15
+ "sast",
16
+ "codex-security",
17
+ "security-scan",
18
+ "sarif"
19
+ ],
20
+ "engines": {
21
+ "node": ">=22.19",
22
+ "dsh": "*"
23
+ },
24
+ "main": "lib/index.js",
25
+ "types": "lib/types/index.d.ts",
26
+ "exports": {
27
+ ".": {
28
+ "types": "./lib/types/index.d.ts",
29
+ "default": "./lib/index.js"
30
+ },
31
+ "./client": {
32
+ "types": "./lib/types/client/index.d.ts",
33
+ "default": "./lib/client.js"
34
+ },
35
+ "./worker-preset": {
36
+ "types": "./lib/types/worker-preset.d.ts",
37
+ "default": "./lib/worker-preset.js"
38
+ },
39
+ "./cordis.patch.yml": "./cordis.patch.yml",
40
+ "./package.json": "./package.json"
41
+ },
42
+ "files": [
43
+ "lib",
44
+ "cordis.patch.yml",
45
+ "skills",
46
+ "references",
47
+ "schemas",
48
+ "docs",
49
+ "examples",
50
+ "README.md",
51
+ "README.zh.md",
52
+ "CHANGELOG.md",
53
+ "LICENSE",
54
+ "NOTICE"
55
+ ],
56
+ "scripts": {
57
+ "clean": "node -e \"require('node:fs').rmSync('lib',{recursive:true,force:true})\"",
58
+ "build:host": "tsc -p tsconfig.json",
59
+ "build:client": "tsc -p tsconfig.client.json",
60
+ "build:bundle": "node scripts/bundle-client.mjs",
61
+ "build": "npm run clean && npm run build:host && npm run build:client && npm run build:bundle",
62
+ "typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.client.json --noEmit",
63
+ "test": "npm run build && node --test tests/*.test.mjs",
64
+ "prepack": "npm test"
65
+ },
66
+ "dsh": {
67
+ "bundle": {
68
+ "patch": "./cordis.patch.yml"
69
+ },
70
+ "client": {
71
+ "inject": [
72
+ "@deepseek-ai/dsh-client-ui-slots",
73
+ "@deepseek-ai/dsh-client-ui-settings"
74
+ ],
75
+ "platform": "web"
76
+ }
77
+ },
78
+ "dependencies": {
79
+ "@deepseek-ai/schemastery": "~3.19.0",
80
+ "ajv": "^8.20.0",
81
+ "ajv-formats": "^3.0.1"
82
+ },
83
+ "peerDependencies": {
84
+ "@deepseek-ai/cordis": "~4.1.0",
85
+ "@deepseek-ai/dsh-skill": ">=0.2.2-rc.2 <0.3.0"
86
+ },
87
+ "devDependencies": {
88
+ "@deepseek-ai/dsh-agent-preset-registry": "0.2.2-rc.2",
89
+ "@deepseek-ai/dsh-skill": "0.2.2-rc.2",
90
+ "@deepseek-ai/dsh-subagent": "0.2.2-rc.2",
91
+ "@deepseek-ai/dsh-subagent-spawn-in-process": "0.2.2-rc.2",
92
+ "@deepseek-ai/dsh-tool-executor-native": "0.2.2-rc.2",
93
+ "@deepseek-ai/dsh-tools": "0.2.2-rc.2",
94
+ "@types/node": "^22.18.0",
95
+ "@types/react": "^18.3.31",
96
+ "typescript": "^5.9.0"
97
+ },
98
+ "repository": {
99
+ "type": "git",
100
+ "url": "git+https://github.com/Lornatang/dsh-codex-security.git"
101
+ },
102
+ "homepage": "https://github.com/Lornatang/dsh-codex-security#readme",
103
+ "bugs": {
104
+ "url": "https://github.com/Lornatang/dsh-codex-security/issues"
105
+ },
106
+ "publishConfig": {
107
+ "access": "public"
108
+ },
109
+ "optionalDependencies": {
110
+ "@koromix/koffi-android-arm64": "3.3.8",
111
+ "@koromix/koffi-android-x64": "3.3.8",
112
+ "@koromix/koffi-darwin-arm64": "3.3.8",
113
+ "@koromix/koffi-darwin-x64": "3.3.8",
114
+ "@koromix/koffi-freebsd-arm64": "3.3.8",
115
+ "@koromix/koffi-freebsd-ia32": "3.3.8",
116
+ "@koromix/koffi-freebsd-x64": "3.3.8",
117
+ "@koromix/koffi-linux-arm": "3.3.8",
118
+ "@koromix/koffi-linux-arm64": "3.3.8",
119
+ "@koromix/koffi-linux-ia32": "3.3.8",
120
+ "@koromix/koffi-linux-loong64": "3.3.8",
121
+ "@koromix/koffi-linux-ppc64": "3.3.8",
122
+ "@koromix/koffi-linux-riscv64": "3.3.8",
123
+ "@koromix/koffi-linux-x64": "3.3.8",
124
+ "@koromix/koffi-openbsd-arm64": "3.3.8",
125
+ "@koromix/koffi-openbsd-ia32": "3.3.8",
126
+ "@koromix/koffi-openbsd-x64": "3.3.8",
127
+ "@koromix/koffi-win32-arm64": "3.3.8",
128
+ "@koromix/koffi-win32-ia32": "3.3.8",
129
+ "@koromix/koffi-win32-x64": "3.3.8"
130
+ }
131
+ }
@@ -1,134 +1,136 @@
1
- {
2
- "$id": "https://openai.com/codex-security/schemas/coverage.schema.json",
3
- "title": "Codex Security scan coverage",
4
- "$schema": "https://json-schema.org/draft/2020-12/schema",
5
- "type": "object",
6
- "properties": {
7
- "documentType": { "const": "codex-security.coverage" },
8
- "schemaVersion": { "const": "1.0" },
9
- "scanId": { "type": "string", "minLength": 1 },
10
- "mode": {
11
- "enum": [
12
- "repository",
13
- "scoped_path",
14
- "diff",
15
- "commit",
16
- "branch_diff",
17
- "working_tree",
18
- "deep_repository"
19
- ]
20
- },
21
- "inventoryStrategy": {
22
- "enum": ["repository", "scoped_path", "diff", "directory", "custom"]
23
- },
24
- "includePaths": { "type": "array", "items": { "type": "string" } },
25
- "excludePaths": { "type": "array", "items": { "type": "string" } },
26
- "surfaces": {
27
- "type": "array",
28
- "items": {
29
- "type": "object",
30
- "properties": {
31
- "id": { "type": "string", "minLength": 1 },
32
- "label": { "type": "string", "minLength": 1 },
33
- "disposition": {
34
- "enum": [
35
- "reported",
36
- "no_issue_found",
37
- "rejected",
38
- "not_applicable",
39
- "needs_follow_up"
40
- ]
41
- },
42
- "receiptRefs": {
43
- "type": "array",
44
- "items": {
45
- "type": "string",
46
- "minLength": 1,
47
- "pattern": "^(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*\\\\)artifacts/.+$"
48
- }
49
- },
50
- "riskArea": { "type": "string", "minLength": 1 },
51
- "notes": { "type": "string", "minLength": 1 }
52
- },
53
- "required": ["id", "label", "disposition", "receiptRefs"]
54
- }
55
- },
56
- "explicitExclusions": {
57
- "type": "array",
58
- "items": {
59
- "type": "object",
60
- "properties": {
61
- "pattern": { "type": "string", "minLength": 1 },
62
- "reason": { "type": "string", "minLength": 1 }
63
- },
64
- "required": ["pattern", "reason"]
65
- }
66
- },
67
- "deferred": {
68
- "type": "array",
69
- "items": {
70
- "type": "object",
71
- "properties": {
72
- "id": { "type": "string", "minLength": 1 },
73
- "reason": { "type": "string", "minLength": 1 },
74
- "paths": {
75
- "type": "array",
76
- "items": {
77
- "type": "string",
78
- "minLength": 1,
79
- "oneOf": [
80
- {},
81
- {
82
- "type": "string",
83
- "$comment": "invalidSealedDeferredPath",
84
- "pattern": "^(?:/|[A-Za-z]:)|(?:^|/)\\.\\.(?:/|$)|[\\\\\\x00-\\x1f]|[\\ud800-\\udbff](?![\\udc00-\\udfff])|(?:^|[^\\ud800-\\udbff])[\\udc00-\\udfff]"
85
- }
86
- ]
87
- }
88
- },
89
- "surfaceIds": {
90
- "type": "array",
91
- "items": { "type": "string", "minLength": 1 }
92
- }
93
- },
94
- "required": ["id", "reason"]
95
- }
96
- },
97
- "resolvedDeferred": {
98
- "type": "array",
99
- "items": {
100
- "type": "object",
101
- "properties": {
102
- "id": { "type": "string", "minLength": 1 },
103
- "reason": { "type": "string", "minLength": 1 }
104
- },
105
- "required": ["id", "reason"],
106
- "additionalProperties": false
107
- },
108
- "description": "Completed generic review tasks, with their saved IDs and completion reasons."
109
- },
110
- "openQuestions": {
111
- "type": "array",
112
- "items": {
113
- "type": "object",
114
- "properties": {
115
- "question": { "type": "string", "minLength": 1 },
116
- "followUpPrompt": { "type": "string", "minLength": 1 }
117
- },
118
- "required": ["question"]
119
- }
120
- }
121
- },
122
- "required": [
123
- "documentType",
124
- "schemaVersion",
125
- "scanId",
126
- "mode",
127
- "inventoryStrategy",
128
- "includePaths",
129
- "excludePaths",
130
- "surfaces",
131
- "explicitExclusions",
132
- "deferred"
133
- ]
134
- }
1
+ {
2
+ "$id": "https://openai.com/codex-security/schemas/coverage.schema.json",
3
+ "title": "Codex Security scan coverage",
4
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
5
+ "type": "object",
6
+ "properties": {
7
+ "documentType": { "const": "codex-security.coverage" },
8
+ "schemaVersion": { "const": "1.0" },
9
+ "scanId": { "type": "string", "minLength": 1 },
10
+ "completeness": { "enum": ["complete", "partial", "unknown"] },
11
+ "mode": {
12
+ "enum": [
13
+ "repository",
14
+ "scoped_path",
15
+ "diff",
16
+ "commit",
17
+ "branch_diff",
18
+ "working_tree",
19
+ "deep_repository"
20
+ ]
21
+ },
22
+ "inventoryStrategy": {
23
+ "enum": ["repository", "scoped_path", "diff", "directory", "custom"]
24
+ },
25
+ "includePaths": { "type": "array", "items": { "type": "string" } },
26
+ "excludePaths": { "type": "array", "items": { "type": "string" } },
27
+ "surfaces": {
28
+ "type": "array",
29
+ "items": {
30
+ "type": "object",
31
+ "properties": {
32
+ "id": { "type": "string", "minLength": 1 },
33
+ "label": { "type": "string", "minLength": 1 },
34
+ "disposition": {
35
+ "enum": [
36
+ "reported",
37
+ "no_issue_found",
38
+ "rejected",
39
+ "not_applicable",
40
+ "needs_follow_up"
41
+ ]
42
+ },
43
+ "receiptRefs": {
44
+ "type": "array",
45
+ "items": {
46
+ "type": "string",
47
+ "minLength": 1,
48
+ "pattern": "^(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*\\\\)artifacts/.+$"
49
+ }
50
+ },
51
+ "riskArea": { "type": "string", "minLength": 1 },
52
+ "notes": { "type": "string", "minLength": 1 }
53
+ },
54
+ "required": ["id", "label", "disposition", "receiptRefs"]
55
+ }
56
+ },
57
+ "explicitExclusions": {
58
+ "type": "array",
59
+ "items": {
60
+ "type": "object",
61
+ "properties": {
62
+ "pattern": { "type": "string", "minLength": 1 },
63
+ "reason": { "type": "string", "minLength": 1 }
64
+ },
65
+ "required": ["pattern", "reason"]
66
+ }
67
+ },
68
+ "deferred": {
69
+ "type": "array",
70
+ "items": {
71
+ "type": "object",
72
+ "properties": {
73
+ "id": { "type": "string", "minLength": 1 },
74
+ "reason": { "type": "string", "minLength": 1 },
75
+ "paths": {
76
+ "type": "array",
77
+ "items": {
78
+ "type": "string",
79
+ "minLength": 1,
80
+ "oneOf": [
81
+ {},
82
+ {
83
+ "type": "string",
84
+ "$comment": "invalidSealedDeferredPath",
85
+ "pattern": "^(?:/|[A-Za-z]:)|(?:^|/)\\.\\.(?:/|$)|[\\\\\\x00-\\x1f]|[\\ud800-\\udbff](?![\\udc00-\\udfff])|(?:^|[^\\ud800-\\udbff])[\\udc00-\\udfff]"
86
+ }
87
+ ]
88
+ }
89
+ },
90
+ "surfaceIds": {
91
+ "type": "array",
92
+ "items": { "type": "string", "minLength": 1 }
93
+ }
94
+ },
95
+ "required": ["id", "reason"]
96
+ }
97
+ },
98
+ "resolvedDeferred": {
99
+ "type": "array",
100
+ "items": {
101
+ "type": "object",
102
+ "properties": {
103
+ "id": { "type": "string", "minLength": 1 },
104
+ "reason": { "type": "string", "minLength": 1 }
105
+ },
106
+ "required": ["id", "reason"],
107
+ "additionalProperties": false
108
+ },
109
+ "description": "Completed generic review tasks, with their saved IDs and completion reasons."
110
+ },
111
+ "openQuestions": {
112
+ "type": "array",
113
+ "items": {
114
+ "type": "object",
115
+ "properties": {
116
+ "question": { "type": "string", "minLength": 1 },
117
+ "followUpPrompt": { "type": "string", "minLength": 1 }
118
+ },
119
+ "required": ["question"]
120
+ }
121
+ }
122
+ },
123
+ "required": [
124
+ "documentType",
125
+ "schemaVersion",
126
+ "scanId",
127
+ "mode",
128
+ "completeness",
129
+ "inventoryStrategy",
130
+ "includePaths",
131
+ "excludePaths",
132
+ "surfaces",
133
+ "explicitExclusions",
134
+ "deferred"
135
+ ]
136
+ }