polydeukes 0.6.1 → 0.8.0
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/README.ko.md +16 -28
- package/README.md +16 -28
- package/dist/baseline.d.ts +37 -1
- package/dist/baseline.js +68 -1
- package/dist/bin.d.ts +3 -4
- package/dist/bin.js +73 -90
- package/dist/covenant/bash-line.d.ts +130 -0
- package/dist/covenant/bash-line.js +566 -0
- package/dist/covenant/declaration-engine.d.ts +108 -0
- package/dist/covenant/declaration-engine.js +415 -0
- package/dist/covenant/discipline.d.ts +109 -0
- package/dist/covenant/discipline.js +667 -0
- package/dist/covenant/dispatch.d.ts +156 -0
- package/dist/covenant/dispatch.js +250 -0
- package/dist/covenant/extract-steps.d.ts +122 -0
- package/dist/covenant/extract-steps.js +0 -0
- package/dist/covenant/mention.d.ts +117 -0
- package/dist/covenant/mention.js +209 -0
- package/dist/covenant/module.d.ts +25 -0
- package/dist/covenant/module.js +23 -0
- package/dist/covenant/mutation-rules.d.ts +40 -0
- package/dist/covenant/mutation-rules.js +146 -0
- package/dist/covenant/relations.d.ts +46 -0
- package/dist/covenant/relations.js +68 -0
- package/dist/covenant/run-covenant.d.ts +95 -0
- package/dist/covenant/run-covenant.js +164 -0
- package/dist/covenant/self-mod.d.ts +55 -0
- package/dist/covenant/self-mod.js +84 -0
- package/dist/covenant/shell-evidence.d.ts +38 -0
- package/dist/covenant/shell-evidence.js +247 -0
- package/dist/covenant/shell-mod.d.ts +84 -0
- package/dist/covenant/shell-mod.js +213 -0
- package/dist/covenant/supply.d.ts +54 -0
- package/dist/covenant/supply.js +50 -0
- package/dist/covenant/transcript-mod.d.ts +60 -0
- package/dist/covenant/transcript-mod.js +254 -0
- package/dist/covenant/ttl-witness.d.ts +47 -0
- package/dist/covenant/ttl-witness.js +80 -0
- package/dist/covenant-check.d.ts +74 -41
- package/dist/covenant-check.js +372 -129
- package/dist/diff-ir.d.ts +28 -0
- package/dist/diff-ir.js +310 -0
- package/dist/docs/README.ko.md +10 -9
- package/dist/docs/README.md +10 -9
- package/dist/docs/catalog.json +76 -28
- package/dist/docs/concepts/judgment.ko.md +2 -2
- package/dist/docs/concepts/judgment.md +2 -2
- package/dist/docs/how-to/configure-project.ko.md +16 -16
- package/dist/docs/how-to/configure-project.md +15 -12
- package/dist/docs/how-to/connect-surfaces.ko.md +67 -34
- package/dist/docs/how-to/connect-surfaces.md +67 -34
- package/dist/docs/how-to/write-disciplines.ko.md +64 -7
- package/dist/docs/how-to/write-disciplines.md +65 -7
- package/dist/docs/index.json +744 -362
- package/dist/docs/reference/cli/covenant-check.ko.md +112 -65
- package/dist/docs/reference/cli/covenant-check.md +114 -59
- package/dist/docs/reference/cli/docs.ko.md +2 -2
- package/dist/docs/reference/cli/docs.md +2 -2
- package/dist/docs/reference/cli/explain.ko.md +20 -15
- package/dist/docs/reference/cli/explain.md +22 -15
- package/dist/docs/reference/cli/init.ko.md +91 -52
- package/dist/docs/reference/cli/init.md +81 -55
- package/dist/docs/reference/configuration/index.ko.md +182 -71
- package/dist/docs/reference/configuration/index.md +188 -76
- package/dist/docs/reference/packages/adapter-claude-code.ko.md +39 -11
- package/dist/docs/reference/packages/adapter-claude-code.md +40 -14
- package/dist/docs/reference/packages/adapter-codex.ko.md +99 -0
- package/dist/docs/reference/packages/adapter-codex.md +100 -0
- package/dist/docs/reference/packages/adapter-grok.ko.md +81 -0
- package/dist/docs/reference/packages/adapter-grok.md +83 -0
- package/dist/docs/reference/packages/core.ko.md +50 -4
- package/dist/docs/reference/packages/core.md +55 -6
- package/dist/docs/reference/packages/polydeukes.ko.md +139 -77
- package/dist/docs/reference/packages/polydeukes.md +147 -81
- package/dist/docs/reference/packages/sdk-ts.ko.md +164 -0
- package/dist/docs/reference/packages/sdk-ts.md +167 -0
- package/dist/docs/troubleshooting.ko.md +51 -19
- package/dist/docs/troubleshooting.md +53 -17
- package/dist/docs/tutorials/first-judgment.ko.md +6 -4
- package/dist/docs/tutorials/first-judgment.md +6 -4
- package/dist/explain.d.ts +1 -1
- package/dist/explain.js +37 -22
- package/dist/load-config.d.ts +25 -1
- package/dist/load-config.js +21 -3
- package/dist/pre-state-reader.d.ts +1 -1
- package/dist/pre-state-reader.js +1 -1
- package/dist/scaffold-project.d.ts +2 -2
- package/dist/scaffold-project.js +12 -4
- package/dist/schema/polydeukes.schema.json +12 -0
- package/dist/worktree-reader.d.ts +19 -0
- package/dist/worktree-reader.js +30 -0
- package/package.json +5 -18
- package/dist/claude-code-hook.d.ts +0 -79
- package/dist/claude-code-hook.js +0 -372
- package/dist/claude-code.d.ts +0 -6
- package/dist/claude-code.js +0 -6
- package/dist/covenant-module.d.ts +0 -25
- package/dist/covenant-module.js +0 -42
- package/dist/docs/reference/packages/adapter-git.ko.md +0 -101
- package/dist/docs/reference/packages/adapter-git.md +0 -108
- package/dist/docs/reference/packages/covenant.ko.md +0 -115
- package/dist/docs/reference/packages/covenant.md +0 -123
- package/dist/index.d.ts +0 -22
- package/dist/index.js +0 -21
- package/dist/init-claude-code.d.ts +0 -52
- package/dist/init-claude-code.js +0 -586
- package/dist/init-grok.d.ts +0 -51
- package/dist/init-grok.js +0 -242
|
@@ -2,85 +2,118 @@
|
|
|
2
2
|
|
|
3
3
|
[English](./init.md) · **한국어**
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
`pdks init`은 에이전트와 무관한 초기 파일을 만듭니다. 설정 파일과 텔레메트리 제외 항목
|
|
6
|
+
둘입니다. 이 명령은 어느 에이전트도 알지 못합니다. 세션 표면 등록은 그 에이전트의 어댑터가
|
|
7
|
+
맡는 별도 명령입니다. Claude Code는 `pdks-claude-code init`, Grok는 `pdks-grok init`,
|
|
8
|
+
Codex는 `pdks-codex init`입니다.
|
|
7
9
|
|
|
8
10
|
<a id="init-syntax"></a>
|
|
9
11
|
## 구문
|
|
10
12
|
|
|
11
13
|
```sh
|
|
12
|
-
pdks init
|
|
13
|
-
pdks init grok
|
|
14
|
+
pdks init
|
|
14
15
|
```
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
사전 검사에 실패하면 파일을 쓰지 않고 종료 코드 `2`를 반환합니다.
|
|
17
|
+
다른 인자를 주면 사용법을 출력하고 종료 코드 `2`를 반환합니다. 이미 있는 산출물은 보존하고
|
|
18
|
+
`skipped`로 보고하며, 사전 검사에 실패하면 파일을 쓰지 않고 종료 코드 `2`를 반환합니다.
|
|
18
19
|
|
|
19
20
|
<a id="init-common"></a>
|
|
20
|
-
##
|
|
21
|
+
## `pdks init` — 초기 파일
|
|
21
22
|
|
|
22
|
-
|
|
23
|
+
이 명령의 순서는 다음과 같습니다.
|
|
23
24
|
|
|
24
25
|
1. 대상 프로젝트에서 `polydeukes`를 찾을 수 있는지 확인합니다.
|
|
25
26
|
2. 공통 설정과 텔레메트리 제외 항목을 만듭니다.
|
|
26
|
-
3. 표면별 등록 파일을 추가합니다.
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
어느 표면이든 여기서 출발합니다.
|
|
29
|
+
|
|
30
|
+
- `polydeukes.config.yaml`
|
|
31
|
+
- `.gitignore`의 `.polydeukes/` 항목
|
|
32
|
+
|
|
33
|
+
설정 파일에는 언어 블록, 보호 목록, 증인(witness) 블록, 주석으로 된 규율(discipline) 예제가
|
|
34
|
+
있습니다. 완성된 정책이 아니라 프로젝트에 맞춰 고칠 출발점입니다.
|
|
31
35
|
|
|
32
36
|
<a id="init-claude-code"></a>
|
|
33
|
-
## `pdks
|
|
37
|
+
## Claude Code — `pdks-claude-code init`
|
|
38
|
+
|
|
39
|
+
Claude Code 세션 표면은
|
|
40
|
+
[`@polydeukes/adapter-claude-code`](../packages/adapter-claude-code.ko.md)가 설치합니다. 이
|
|
41
|
+
어댑터에는 자체 실행 파일이 있습니다.
|
|
42
|
+
|
|
43
|
+
```sh
|
|
44
|
+
npm install --save-dev polydeukes @polydeukes/core @polydeukes/adapter-claude-code
|
|
45
|
+
npx pdks-claude-code init
|
|
46
|
+
```
|
|
34
47
|
|
|
35
|
-
|
|
48
|
+
이 명령은 먼저 `pdks init`으로 초기 파일을 만든 뒤 Claude Code 등록 산출물을 씁니다.
|
|
36
49
|
|
|
37
50
|
- `.claude/hooks/covenant-pretooluse.mjs`
|
|
38
51
|
- `.claude/settings.json`
|
|
39
52
|
- `.claude/rules/polydeukes.md`
|
|
40
53
|
- `.claude/skills/discipline-draft/SKILL.md`
|
|
41
|
-
- `polydeukes.config.yaml`
|
|
42
|
-
- `.gitignore`
|
|
43
54
|
|
|
44
|
-
|
|
45
|
-
문서 안내 파일은 AI 파트너가 웹 검색 대신 `pdks docs`를 쓰도록 알려 줍니다.
|
|
46
|
-
스킬은 설명된 규율 문제를 설정 항목으로 바꾸는 절차를 제공합니다.
|
|
55
|
+
산출물별 동작은 [표면 연결하기](../../how-to/connect-surfaces.ko.md#claude-code)에 있습니다.
|
|
47
56
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
수도 있으므로 재실행이 언제나 아무것도 바꾸지 않는 것은 아닙니다.
|
|
57
|
+
<a id="init-grok"></a>
|
|
58
|
+
## Grok — `pdks-grok init`
|
|
51
59
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
60
|
+
Grok 세션 표면은
|
|
61
|
+
[`@polydeukes/adapter-grok`](../packages/adapter-grok.ko.md)가 설치합니다. 이
|
|
62
|
+
어댑터에는 자체 실행 파일이 있습니다.
|
|
55
63
|
|
|
56
|
-
|
|
57
|
-
|
|
64
|
+
```sh
|
|
65
|
+
npm install --save-dev polydeukes @polydeukes/core @polydeukes/adapter-grok
|
|
66
|
+
npx pdks-grok init
|
|
67
|
+
```
|
|
58
68
|
|
|
59
|
-
|
|
69
|
+
이 명령은 먼저 `pdks init`으로 초기 파일을 만든 뒤 Grok 등록 산출물을 씁니다.
|
|
60
70
|
|
|
61
71
|
- `.grok/hooks/covenant-pretooluse.mjs`
|
|
62
72
|
- `.grok/hooks/covenant-pretooluse.json`
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
- Claude 위임 훅이 이미 있으면 새 훅을 만들지 않고 Grok JSON에서 기존 파일을 지정합니다.
|
|
70
|
-
- 새 등록의 제한 시간은 60초입니다. Grok 호스트 기본값은 5초이며, 훅 실행이 시간 초과로
|
|
71
|
-
끝나면 해당 호출을 차단하지 않습니다(fail-open). Claude 설정에 같은 명령이 등록돼 있으면
|
|
72
|
-
Grok의 매칭 조건도 맞춰
|
|
73
|
-
명령과 조건이 모두 같게 만듭니다.
|
|
74
|
-
- 어느 설치기를 다시 실행하든, 설치기가 만든 Grok 훅 명령을 기존 Claude 파일로 바꾸고
|
|
75
|
-
매칭 조건을 맞출 수 있습니다. 사용자가 다른 곳을 지정한 명령은 그대로 두며 기존 제한
|
|
76
|
-
시간도 유지합니다.
|
|
77
|
-
- 나중에 Claude 설정을 제거했다면 Grok JSON을 다시 만들어 Grok 기본 매칭 조건을 복원하세요.
|
|
78
|
-
사용자 설정부터 백업해야 합니다. 변경 뒤에는 Grok의 Hooks 탭을 다시 불러오거나 새 세션을
|
|
79
|
-
시작합니다.
|
|
80
|
-
|
|
81
|
-
Grok는 Claude 세션 증인 밸브가 요구하는 인간 메시지 증거를 제공하지 않습니다.
|
|
73
|
+
|
|
74
|
+
`.claude/` 파일을 만들거나 고치지 않습니다. 새 등록의 제한 시간은 60초입니다. Grok 호스트
|
|
75
|
+
기본값은 5초이며, 훅 실행이 시간 초과로 끝나면 해당 호출을 차단하지 않습니다(fail-open).
|
|
76
|
+
세션 어댑터를 한 프로젝트에 둘 이상 설치하면 호출마다 판정기가 두 번 실행될 수 있습니다.
|
|
77
|
+
|
|
78
|
+
Grok는 Claude 세션 증인(witness) 밸브가 요구하는 인간 메시지 증거를 제공하지 않습니다.
|
|
82
79
|
대화 기록은 Claude JSONL이 아니라 ACP `updates.jsonl`입니다.
|
|
83
|
-
[Grok 복구 안내](../../troubleshooting.ko.md#grok-witness)를 참고하세요.
|
|
80
|
+
[Grok 복구 안내](../../troubleshooting.ko.md#grok-witness)를 참고하세요. 산출물별 동작은
|
|
81
|
+
[표면 연결하기](../../how-to/connect-surfaces.ko.md#grok)에 있습니다.
|
|
82
|
+
|
|
83
|
+
<a id="init-codex"></a>
|
|
84
|
+
## Codex — `pdks-codex init`
|
|
85
|
+
|
|
86
|
+
Codex 세션 표면은
|
|
87
|
+
[`@polydeukes/adapter-codex`](../packages/adapter-codex.ko.md)가 설치합니다. 이
|
|
88
|
+
어댑터에는 자체 실행 파일이 있습니다.
|
|
89
|
+
|
|
90
|
+
```sh
|
|
91
|
+
npm install --save-dev polydeukes @polydeukes/core @polydeukes/adapter-codex
|
|
92
|
+
npx pdks-codex init
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
이 명령은 먼저 `pdks init`으로 초기 파일을 만든 뒤 Codex 등록 산출물을 씁니다.
|
|
96
|
+
|
|
97
|
+
- `.codex/hooks/covenant-pretooluse.mjs`
|
|
98
|
+
- `.codex/hooks.json`
|
|
99
|
+
|
|
100
|
+
`hooks.json`은 덮어쓰지 않고 병합합니다. 다른 이벤트, 다른 matcher, 설치기가 모르는 키는
|
|
101
|
+
그대로 둡니다. 초기 설정은 기본적으로 `.codex/hooks`를 보호하므로, 이 설치기가 만드는 등록
|
|
102
|
+
파일은 같은 설치가 만든 설정이 지킵니다.
|
|
103
|
+
|
|
104
|
+
**훅 승인까지가 설치입니다.** Codex는 훅 정의의 해시로 신뢰를 기록하므로, 생성된 훅은 검토
|
|
105
|
+
대상으로 표시되고 `/hooks`에서 승인하기 전까지 건너뛰어집니다. 누군가 승인하기 전까지는
|
|
106
|
+
아무것도 판정되지 않습니다. `init`이 실행할 때마다 바이트가 같은 명령 문자열을 쓰는 이유가
|
|
107
|
+
이것입니다. 문자열이 바뀌면 다시 승인해야 합니다.
|
|
108
|
+
|
|
109
|
+
Codex는 모든 파일 편집을 `apply_patch` 하나로 정규화하고, 경로 인자가 아니라 패치 텍스트를
|
|
110
|
+
보냅니다. `Edit`과 `Write`는 `.codex/hooks.json`에 적을 수 있는 matcher 별칭이며 도구 이름으로
|
|
111
|
+
도착하지 않습니다. 패치 하나가 여러 파일을 건드리면 파일마다 IR 원소 하나가 실리고, 그중
|
|
112
|
+
하나라도 차단되면 호출 전체가 차단됩니다.
|
|
113
|
+
|
|
114
|
+
Codex에는 대화 기록 채널이 없어서 세션 증인(witness) 밸브가 읽을 사람 메시지 증거가
|
|
115
|
+
없습니다. 의도한 편집이 차단되면 자신의 터미널에서 수행하세요. 산출물별 동작은
|
|
116
|
+
[표면 연결하기](../../how-to/connect-surfaces.ko.md#codex)에 있습니다.
|
|
84
117
|
|
|
85
118
|
<a id="init-results"></a>
|
|
86
119
|
## 결과와 실패 조건
|
|
@@ -103,16 +136,22 @@ Grok는 Claude 세션 증인 밸브가 요구하는 인간 메시지 증거를
|
|
|
103
136
|
## 예제
|
|
104
137
|
|
|
105
138
|
```sh
|
|
106
|
-
pdks init
|
|
107
|
-
pdks init
|
|
139
|
+
pdks init
|
|
140
|
+
npx pdks-claude-code init
|
|
141
|
+
npx pdks-grok init
|
|
142
|
+
npx pdks-codex init
|
|
108
143
|
```
|
|
109
144
|
|
|
110
|
-
설치기는 CLI 명령입니다. `polydeukes
|
|
111
|
-
아닙니다.
|
|
145
|
+
설치기는 CLI 명령입니다. `polydeukes` 계약의 공개 심볼이 아닙니다.
|
|
112
146
|
|
|
113
147
|
<a id="init-see-also"></a>
|
|
114
148
|
## 함께 보기
|
|
115
149
|
|
|
150
|
+
- [`@polydeukes/adapter-claude-code`](../packages/adapter-claude-code.ko.md) — Claude Code 설치
|
|
151
|
+
단위와 그 실행 파일
|
|
152
|
+
- [`@polydeukes/adapter-grok`](../packages/adapter-grok.ko.md) — Grok 설치 단위와 그 실행 파일
|
|
153
|
+
- [`@polydeukes/adapter-codex`](../packages/adapter-codex.ko.md) — Codex 설치 단위와 그 실행
|
|
154
|
+
파일
|
|
116
155
|
- [`pdks docs`](./docs.ko.md)
|
|
117
156
|
- [`pdks explain`](./explain.ko.md)
|
|
118
157
|
- [설정 참조](../configuration/index.ko.md)
|
|
@@ -2,31 +2,30 @@
|
|
|
2
2
|
|
|
3
3
|
**English** · [한국어](./init.ko.md)
|
|
4
4
|
|
|
5
|
-
`pdks init`
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
`pdks init` creates the agent-neutral project scaffold: the config file and the telemetry ignore
|
|
6
|
+
line. It knows no agent. Registering a session surface is a separate command owned by that
|
|
7
|
+
agent's adapter — `pdks-claude-code init` for Claude Code, `pdks-grok init` for Grok, and
|
|
8
|
+
`pdks-codex init` for Codex.
|
|
8
9
|
|
|
9
10
|
<a id="init-syntax"></a>
|
|
10
11
|
## Syntax
|
|
11
12
|
|
|
12
13
|
```sh
|
|
13
|
-
pdks init
|
|
14
|
-
pdks init grok
|
|
14
|
+
pdks init
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
failure writes nothing and exits `2`.
|
|
17
|
+
Any other argument prints usage and exits `2`. The command is idempotent: existing artifacts are
|
|
18
|
+
left in place and reported as skipped, and a preflight failure writes nothing and exits `2`.
|
|
19
19
|
|
|
20
20
|
<a id="init-common"></a>
|
|
21
|
-
##
|
|
21
|
+
## `pdks init` — the scaffold
|
|
22
22
|
|
|
23
|
-
The
|
|
23
|
+
The command does two things in order:
|
|
24
24
|
|
|
25
25
|
1. Resolve `polydeukes` from the target project.
|
|
26
26
|
2. Create the shared project-side scaffold: config and telemetry ignore line.
|
|
27
|
-
3. Add the surface-specific registration artifacts.
|
|
28
27
|
|
|
29
|
-
The
|
|
28
|
+
The scaffold is the same one every surface starts from:
|
|
30
29
|
|
|
31
30
|
- `polydeukes.config.yaml`
|
|
32
31
|
- `.gitignore` with `.polydeukes/`
|
|
@@ -35,64 +34,85 @@ The config file starts with the language block, a protection list, a witness blo
|
|
|
35
34
|
discipline examples. It is a starter policy, not a complete project policy.
|
|
36
35
|
|
|
37
36
|
<a id="init-claude-code"></a>
|
|
38
|
-
## `pdks
|
|
37
|
+
## Claude Code — `pdks-claude-code init`
|
|
39
38
|
|
|
40
|
-
|
|
39
|
+
The Claude Code session surface is installed by
|
|
40
|
+
[`@polydeukes/adapter-claude-code`](../packages/adapter-claude-code.md), which ships its own bin:
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
```sh
|
|
43
|
+
npm install --save-dev polydeukes @polydeukes/core @polydeukes/adapter-claude-code
|
|
44
|
+
npx pdks-claude-code init
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
That command runs `pdks init` for the scaffold, then writes the Claude Code registration
|
|
48
|
+
artifacts:
|
|
43
49
|
|
|
44
50
|
- `.claude/hooks/covenant-pretooluse.mjs`
|
|
45
51
|
- `.claude/settings.json`
|
|
46
52
|
- `.claude/rules/polydeukes.md`
|
|
47
53
|
- `.claude/skills/discipline-draft/SKILL.md`
|
|
48
|
-
- `polydeukes.config.yaml`
|
|
49
|
-
- `.gitignore`
|
|
50
|
-
|
|
51
|
-
What each artifact does:
|
|
52
|
-
|
|
53
|
-
- The hook file is a delegator that imports `polydeukes/claude-code`.
|
|
54
|
-
- The settings file merges a PreToolUse registration instead of replacing the whole file.
|
|
55
|
-
- The discovery file tells the AI partner to use `pdks docs` instead of web search.
|
|
56
|
-
- The skill file turns a described discipline problem into a config entry.
|
|
57
|
-
- The config and ignore line come from the shared scaffold.
|
|
58
54
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
Grok registration as described below; it is not an unconditional no-op.
|
|
62
|
-
|
|
63
|
-
Package upgrades do not overwrite a customized skill. Generate a fresh copy in a disposable
|
|
64
|
-
project, compare it with the existing file, and merge the selected changes after taking a backup.
|
|
65
|
-
Do not delete the working project's skill merely to force regeneration.
|
|
55
|
+
Details and the per-artifact behaviour are in
|
|
56
|
+
[Connect the surfaces](../../how-to/connect-surfaces.md#claude-code).
|
|
66
57
|
|
|
67
58
|
<a id="init-grok"></a>
|
|
68
|
-
## `pdks init
|
|
59
|
+
## Grok — `pdks-grok init`
|
|
60
|
+
|
|
61
|
+
The Grok session surface is installed by
|
|
62
|
+
[`@polydeukes/adapter-grok`](../packages/adapter-grok.md), which ships its own bin:
|
|
69
63
|
|
|
70
|
-
|
|
64
|
+
```sh
|
|
65
|
+
npm install --save-dev polydeukes @polydeukes/core @polydeukes/adapter-grok
|
|
66
|
+
npx pdks-grok init
|
|
67
|
+
```
|
|
71
68
|
|
|
72
|
-
|
|
69
|
+
That command runs `pdks init` for the scaffold, then writes the Grok registration artifacts:
|
|
73
70
|
|
|
74
71
|
- `.grok/hooks/covenant-pretooluse.mjs`
|
|
75
72
|
- `.grok/hooks/covenant-pretooluse.json`
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
- It does not create `.claude/` files.
|
|
82
|
-
- It writes a Grok hook JSON registration instead of `.claude/settings.json`.
|
|
83
|
-
- If a Claude delegator already exists, the Grok JSON names it instead of creating another
|
|
84
|
-
delegator.
|
|
85
|
-
- Generated registrations use a timeout of 60 seconds. The Grok host default is 5 seconds, and a
|
|
86
|
-
timed-out hook fails open. When Claude settings register the same command, the Grok matcher
|
|
87
|
-
follows that registration so command and matcher agree.
|
|
88
|
-
- Re-running either installer can retarget a generated Grok-delegator command to the existing
|
|
89
|
-
Claude file and reconcile its matcher. A custom command is left alone; an existing timeout stays.
|
|
90
|
-
- If you later remove Claude settings, regenerate the Grok JSON to restore the Grok-native matcher.
|
|
91
|
-
Back up custom settings first. Reload Grok's Hooks tab or start a new session after changes.
|
|
73
|
+
|
|
74
|
+
It does not create or rewrite `.claude/` files. Generated registrations use a timeout of 60
|
|
75
|
+
seconds. The Grok host default is 5 seconds, and a timed-out hook fails open. Installing more
|
|
76
|
+
than one session adapter in one project can run the judge twice per call.
|
|
92
77
|
|
|
93
78
|
Grok does not supply the human-message evidence required by the Claude session witness valve.
|
|
94
79
|
The session log is ACP `updates.jsonl`, not Claude's JSONL.
|
|
95
|
-
See [Grok recovery](../../troubleshooting.md#grok-witness).
|
|
80
|
+
See [Grok recovery](../../troubleshooting.md#grok-witness). Details are in
|
|
81
|
+
[Connect the surfaces](../../how-to/connect-surfaces.md#grok).
|
|
82
|
+
|
|
83
|
+
<a id="init-codex"></a>
|
|
84
|
+
## Codex — `pdks-codex init`
|
|
85
|
+
|
|
86
|
+
The Codex session surface is installed by
|
|
87
|
+
[`@polydeukes/adapter-codex`](../packages/adapter-codex.md), which ships its own bin:
|
|
88
|
+
|
|
89
|
+
```sh
|
|
90
|
+
npm install --save-dev polydeukes @polydeukes/core @polydeukes/adapter-codex
|
|
91
|
+
npx pdks-codex init
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
That command runs `pdks init` for the scaffold, then writes the Codex registration artifacts:
|
|
95
|
+
|
|
96
|
+
- `.codex/hooks/covenant-pretooluse.mjs`
|
|
97
|
+
- `.codex/hooks.json`
|
|
98
|
+
|
|
99
|
+
`hooks.json` is merged rather than overwritten: other events, other matchers, and keys the
|
|
100
|
+
installer does not know are left in place. The scaffold config protects `.codex/hooks` by
|
|
101
|
+
default, so the registration this installer writes is covered by the config it writes.
|
|
102
|
+
|
|
103
|
+
**Approving the hook is part of the install.** Codex records trust against the hash of a hook's
|
|
104
|
+
definition, so the generated hook is listed for review and skipped until you approve it with
|
|
105
|
+
`/hooks`. Until someone does, nothing is judged. This is why `init` writes a byte-identical
|
|
106
|
+
command string on every run — a changed string needs approving again.
|
|
107
|
+
|
|
108
|
+
Codex normalises every file edit into one tool, `apply_patch`, and delivers the patch text
|
|
109
|
+
rather than a path argument. `Edit` and `Write` are matcher aliases you may write in
|
|
110
|
+
`.codex/hooks.json`; they never arrive as the tool name. One patch that touches several files
|
|
111
|
+
carries one IR element per file, and any one of them blocking blocks the whole call.
|
|
112
|
+
|
|
113
|
+
Codex supplies no transcript channel, so the session witness valve has no human-message
|
|
114
|
+
evidence to read. For an intentional blocked edit, use your own terminal. Details are in
|
|
115
|
+
[Connect the surfaces](../../how-to/connect-surfaces.md#codex).
|
|
96
116
|
|
|
97
117
|
<a id="init-results"></a>
|
|
98
118
|
## Results and failure conditions
|
|
@@ -114,16 +134,22 @@ filesystem problem, and rerun rather than assuming every failed installation lef
|
|
|
114
134
|
## Examples
|
|
115
135
|
|
|
116
136
|
```sh
|
|
117
|
-
pdks init
|
|
118
|
-
pdks init
|
|
137
|
+
pdks init
|
|
138
|
+
npx pdks-claude-code init
|
|
139
|
+
npx pdks-grok init
|
|
140
|
+
npx pdks-codex init
|
|
119
141
|
```
|
|
120
142
|
|
|
121
|
-
The
|
|
122
|
-
`polydeukes/claude-code` contract.
|
|
143
|
+
The installers are CLI commands. They are not symbols on the `polydeukes` contract.
|
|
123
144
|
|
|
124
145
|
<a id="init-see-also"></a>
|
|
125
146
|
## See also
|
|
126
147
|
|
|
148
|
+
- [`@polydeukes/adapter-claude-code`](../packages/adapter-claude-code.md) — the Claude Code
|
|
149
|
+
install unit and its bin.
|
|
150
|
+
- [`@polydeukes/adapter-grok`](../packages/adapter-grok.md) — the Grok install unit and its bin.
|
|
151
|
+
- [`@polydeukes/adapter-codex`](../packages/adapter-codex.md) — the Codex install unit and its
|
|
152
|
+
bin.
|
|
127
153
|
- [`pdks docs`](../packages/polydeukes.md#polydeukes-bin) — the installed documentation reader lives
|
|
128
154
|
in the same package.
|
|
129
155
|
- [`pdks explain`](./explain.md)
|