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,61 +2,63 @@
|
|
|
2
2
|
|
|
3
3
|
[English](./polydeukes.md) · **한국어**
|
|
4
4
|
|
|
5
|
-
일반 사용자는 통합 패키지인 `polydeukes` 하나만 설치하면 됩니다.
|
|
6
|
-
모두 이 패키지가
|
|
5
|
+
일반 사용자는 통합 패키지인 `polydeukes` 하나만 설치하면 됩니다. `pdks` 실행 파일, 판정기,
|
|
6
|
+
두 표면의 조립 루트, 세션 표면 실행기 서브패스, 동봉된 스키마 자산을 모두 이 패키지가
|
|
7
|
+
맡습니다.
|
|
7
8
|
|
|
8
9
|
<a id="polydeukes-entry-points"></a>
|
|
9
10
|
## 진입점
|
|
10
11
|
|
|
11
|
-
| 지정자 |
|
|
12
|
+
| 지정자 | 무엇인가 |
|
|
12
13
|
|---|---|
|
|
13
|
-
| `polydeukes` |
|
|
14
|
-
| `polydeukes/claude-code` | `runClaudeCodeHook`과 입력·결과 타입 |
|
|
14
|
+
| `pdks` / `polydeukes` | 실행 파일입니다. `bin`에 이름 둘로 등록된 같은 CLI입니다 |
|
|
15
15
|
| `polydeukes/schema.json` | 동봉된 설정 JSON Schema |
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
`.` 진입점은 없습니다. `import 'polydeukes'`는 `ERR_PACKAGE_PATH_NOT_EXPORTED`로 실패합니다.
|
|
18
|
+
사용자가 닿는 것은 실행 파일과 스키마 파일입니다. 세션 표면도 셸과 같은 방법으로 이
|
|
19
|
+
패키지에 닿습니다. 즉 `pdks covenant check`를 스폰하므로, 에이전트 어댑터는 이 패키지를
|
|
20
|
+
import하지 않고 peer 의존으로 선언합니다.
|
|
18
21
|
|
|
19
22
|
<a id="polydeukes-bin"></a>
|
|
20
23
|
## CLI 명령
|
|
21
24
|
|
|
22
25
|
| 명령 | 목적 |
|
|
23
26
|
|---|---|
|
|
24
|
-
| `pdks covenant check` |
|
|
25
|
-
| `pdks init
|
|
26
|
-
| `pdks init grok` | Grok 세션 표면 설치 |
|
|
27
|
+
| `pdks covenant check` | 표준 입력의 입력 IR(기본, 세션 표면) 또는 통합 diff(`--diff`, 변경 집합 표면)를 판정 |
|
|
28
|
+
| `pdks init` | 프로젝트 초기 파일 생성. 설정 파일과 텔레메트리 제외 항목 |
|
|
27
29
|
| `pdks explain` | 조립된 등록표를 판정 없이 표시 |
|
|
28
30
|
| `pdks docs [topic]` | 동봉된 주제를 읽음 |
|
|
29
31
|
| `pdks docs search <query>` | 동봉된 문서를 검색 |
|
|
30
32
|
| `pdks docs show <document-id>` | 동봉된 문서 또는 절을 표시 |
|
|
31
33
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
+
세션 표면 설치기는 어댑터에 있습니다. `pdks-claude-code init`, `pdks-grok init`,
|
|
35
|
+
`pdks-codex init`입니다.
|
|
34
36
|
|
|
35
|
-
<a id="
|
|
36
|
-
|
|
37
|
+
<a id="surface-from-input-mode"></a>
|
|
38
|
+
### 입력 방식이 곧 표면이다
|
|
37
39
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
+
`covenant check`는 입력이 어떻게 도착했는지로 표면을 정하며, 입력 자신의 키로 정하지
|
|
41
|
+
않습니다. 표준 입력의 IR은 호스트가 실행 전에 관측한 호출 하나이므로 그 실행은 **세션
|
|
42
|
+
표면(session surface)**이고, `--diff`는 어떤 생산자가 끝낸 변경 집합이므로 그 실행은
|
|
43
|
+
**변경 집합 표면(change-set surface)**입니다. 표면마다 공용 목록에 자기 목록을 더해
|
|
44
|
+
컴파일합니다.
|
|
40
45
|
|
|
41
|
-
|
|
|
46
|
+
| 입력 | 표면 | 컴파일하는 목록 |
|
|
42
47
|
|---|---|---|
|
|
43
|
-
|
|
|
44
|
-
|
|
|
45
|
-
| `ResolvedConfig` | 타입 | `@polydeukes/core`에서 다시 내보냅니다. |
|
|
46
|
-
| `LoadConfigSpec`, `LoadedConfig` | 타입 | 설정 로더의 입력과 결과입니다. |
|
|
47
|
-
| `CovenantCheckSpec`, `CovenantCheckOutcome`, `CheckDomain` | 타입 | 커밋 실행기의 입력, 결과, 관측 범위입니다. |
|
|
48
|
+
| 표준 입력의 입력 IR | `session` | `disciplines` 다음 `sessionDisciplines` |
|
|
49
|
+
| `--diff`와 함께 오는 표준 입력의 통합 diff | `changeSet` | `disciplines` 다음 `changeSetDisciplines` |
|
|
48
50
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
+
IR의 `session` 키는 다른 것을 말합니다. 호스트가 그 호출에 대해 증명한 사실, 곧 증인 밸브가
|
|
52
|
+
읽는 사람의 턴과 대화 기록(transcript) 축, 그리고 셸 쓰기 증거에 필요한 변경 전 상태
|
|
53
|
+
통로입니다. 세션을 싣지 않는 호스트(Grok 어댑터)도 여전히 세션 표면에서 판정되며, 그 호스트에
|
|
54
|
+
없는 것은 표면이 아니라 그 셋이 읽는 증거입니다. `pdks explain`은 표면마다 목록 이름 둘과 그
|
|
55
|
+
개수를 함께 출력합니다.
|
|
51
56
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
| `runClaudeCodeHook` | 함수 | 세션 표면을 실행하고 `{ exitCode: 0 \| 2 }`를 반환합니다. |
|
|
55
|
-
| `ClaudeCodeHookSpec` | 타입 | 세션 실행기 입력입니다. |
|
|
56
|
-
| `ClaudeCodeHookOutcome` | 타입 | 세션 실행기 결과입니다. |
|
|
57
|
+
`pdks docs`는 오프라인입니다. 네트워크가 아니라 설치된 패키지를 읽습니다. 플래그, JSON,
|
|
58
|
+
종료 코드는 [`pdks docs`](../cli/docs.ko.md)에 있습니다.
|
|
57
59
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
+
<a id="polydeukes-export-map"></a>
|
|
61
|
+
## 공개 심볼
|
|
60
62
|
|
|
61
63
|
<a id="schema-export"></a>
|
|
62
64
|
### `./schema.json`
|
|
@@ -65,64 +67,124 @@
|
|
|
65
67
|
|---|---|
|
|
66
68
|
| `polydeukes.schema.json` | 통합 패키지에 동봉한 설정 스키마 사본입니다. |
|
|
67
69
|
|
|
68
|
-
<a id="
|
|
69
|
-
##
|
|
70
|
+
<a id="covenant-module"></a>
|
|
71
|
+
## 판정기(`covenant` 모듈)
|
|
70
72
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
+
판정기는 통합 패키지의 `src/covenant/` 모듈입니다. 선언된 약속(covenant)을 평가해 판정
|
|
74
|
+
결과를 내는 기능을 모두 여기서 구현하며, 두 조립 루트와 `pdks explain`이 이 모듈을 바로
|
|
75
|
+
가져옵니다. 따로 설치할 것도, 불러올 것도, 충족할 peer 의존도 없습니다. 사용자는 설정의
|
|
76
|
+
`disciplines:` 블록과 `.polydeukes/roi.log`의 기록을 통해 동작을 확인합니다.
|
|
73
77
|
|
|
74
|
-
|
|
78
|
+
<a id="ownership"></a>
|
|
79
|
+
### 모듈이 담당하는 기능
|
|
75
80
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
81
|
+
| 단위 | 하는 일 |
|
|
82
|
+
|---|---|
|
|
83
|
+
| `runCovenant` 래퍼 | 판정 본체를 실행하고, 비차단 `1`을 차단하는 `2`로 번역하고, 모든 호출을 기록합니다. 측정되지 않고 실행되는 약속은 없습니다 |
|
|
84
|
+
| 경로 라우팅 디스패처 | 보호 경로에 약속을 등록하고 일치하는 항목을 **모두** 실행합니다. 하나가 실패했다고 뒤의 판정을 생략하지 않습니다 |
|
|
85
|
+
| 메타 약속 | 판정 사슬 자신을 지키는 등록 셋 |
|
|
86
|
+
| TTL 증인 | 유효 시간이 있는 인간의 증인 밸브입니다. 차단 판정 뒤에만 확인합니다 |
|
|
87
|
+
| 델타 층 | 파일의 전후 쌍에 대한 신규 위반 전용 판정 |
|
|
88
|
+
| 규율(discipline) 라이브러리 | 설정의 `disciplines:` 항목을 별도 사용자 코드 없이 판정합니다 |
|
|
89
|
+
|
|
90
|
+
<a id="disciplines-and-meta-covenants"></a>
|
|
91
|
+
### 규율 계열과 메타 약속
|
|
92
|
+
|
|
93
|
+
**`disciplines:` 항목은 선언 하나입니다.** 관측한 증거를 입력으로 받아 `judge = relate ∘ extract`를 계산합니다. 선언의 소스가 무엇을 묶는지가
|
|
94
|
+
판정에 필요한 증거를 정하고, 그것이 곧 어느 표면에서
|
|
95
|
+
판정될 수 있는지를 정합니다.
|
|
96
|
+
|
|
97
|
+
| 소스 | 판정 대상 | 필요한 증거 | 목록 |
|
|
98
|
+
|---|---|---|---|
|
|
99
|
+
| 고정 이름 `target.path` · `pre` · `post` · `state` | 변경 자체 | 파일 변경 | `disciplines` |
|
|
100
|
+
| 고정 이름 `changes` | 관측의 변경 집합 전체 | 끝난 변경 집합 | `changeSetDisciplines` |
|
|
101
|
+
| 고정 이름 `command` | 셸 호출의 명령줄 | 셸 호출입니다. Edit에는 없습니다 | `sessionDisciplines` |
|
|
102
|
+
| 고정 이름 `actor` | 관측을 만든 주체 | 호스트가 증명한 주체 | `sessionDisciplines` |
|
|
103
|
+
| `{ transcript: true }` | 세션 이력입니다. 이 호출 **앞에** 자격을 갖춘 호출이 실제로 실행됐는가 | 세션 | `sessionDisciplines` |
|
|
104
|
+
| `{ file: … }` | 다른 파일 | 표면의 파일 리더 | `disciplines` |
|
|
105
|
+
| `{ sidecar: true }` | 스폰 기록 채널 | 표면의 채널 리더 | `sessionDisciplines` |
|
|
106
|
+
|
|
107
|
+
이 항목들을 쓰는 가이드는 [설정 레퍼런스의 `disciplines` 절](../configuration/index.ko.md#disciplines)에
|
|
108
|
+
있습니다. 선언 문법은 코어의 `algebra-declaration.schema.json`입니다.
|
|
109
|
+
|
|
110
|
+
**메타 약속 셋**이 판정 사슬을 지킵니다. 다른 약속과 똑같은 약속이고, 아래 어휘가 그대로
|
|
111
|
+
적용됩니다.
|
|
112
|
+
|
|
113
|
+
| 등록 | 축 | 판정 대상 |
|
|
114
|
+
|---|---|---|
|
|
115
|
+
| self-mod | 도구 | 편집 도구를 통한 보호 경로 변형입니다. 호출의 증명된 변형 대상만 대조하므로, 편집 **내용** 안의 보호 경로는 언급이고 통과합니다 |
|
|
116
|
+
| shell-mod | 셸 | 같은 것을 명령줄로 합니다. 보호 경로를 언급하는 명령은 첫 낱말이 읽기 전용임을 증명할 때만 통과합니다 |
|
|
117
|
+
| transcript-mod | 대화 기록 | 라이브 세션 대화 기록에 대한 쓰기입니다. 전체 경로 **등가**로 판정하고 보호 조상으로는 결코 보지 않습니다 |
|
|
108
118
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
119
|
+
**낱말 여섯**이 텔레메트리 계약입니다. 판정 결과 다섯과 관측 하나입니다. `.polydeukes/roi.log`의
|
|
120
|
+
한 행은 이 중 정확히 하나를 담고, CLI와 문서와 테스트가 같은 사건에 같은 낱말을 씁니다.
|
|
121
|
+
행을 읽는 법은 [문제 해결](../../troubleshooting.ko.md#reading-verdict)에 있습니다.
|
|
112
122
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
123
|
+
| 판정 결과 | 뜻 |
|
|
124
|
+
|---|---|
|
|
125
|
+
| `passed` | 호출이 판정됐고 약속을 지켰습니다 |
|
|
126
|
+
| `blocked` | 호출이 판정됐고 약속을 깼습니다 |
|
|
127
|
+
| `witnessed` | **차단된** 작업을 인간의 증언으로 허용했습니다. 위반이 없었다는 뜻이 아니며 허용 사실을 기록합니다 |
|
|
128
|
+
| `advised` | 호출을 멈추지 않고 위반을 기록했습니다. 항목이 `enforce: block`을 적지 않는 한 두 표면 모두에서 규율 항목의 기본 처분입니다 |
|
|
129
|
+
| `skipped` | 적용 범위가 일치했지만 판정할 수 없었습니다. **정상 판정이 아니라** 판정하지 못했다는 기록입니다 |
|
|
130
|
+
| `unattributed` | 보호 항목의 디스크 상태가 변했는데 그것을 설명하는 판정 기록이 없습니다. **판정이 아닙니다.** 이 행 때문에 차단되거나 통과하는 호출은 없으며, 세션 표면이 저장된 기준선과 상태를 대조한 뒤에 기록합니다 |
|
|
131
|
+
|
|
132
|
+
`unattributed`는 나머지 다섯이 답할 수 없는 물음에 답합니다. 다섯은 전부 판정기가 건네받은
|
|
133
|
+
호출에 관해 쓰는 낱말이라, 선언된 호출 없이 도착한 쓰기는 행을 하나도 남기지 않습니다.
|
|
134
|
+
인터프리터 안의 쓰기, 테스트 러너 자식 프로세스의 쓰기, 대상 경로를 자기 인자에서 조립하는
|
|
135
|
+
스크립트가 그런 경우입니다. 상태 대조는 철자가 아니라 결과를 관측하므로 그 쓰기를 사후에
|
|
136
|
+
기록합니다. 차단하지는 않습니다. 이미 일어난 쓰기이고, 대조는 판정의 양쪽 모두에서
|
|
137
|
+
fail-open입니다.
|
|
138
|
+
|
|
139
|
+
<a id="consumer-contract"></a>
|
|
140
|
+
### 사용자와의 접점
|
|
141
|
+
|
|
142
|
+
- **설정의 `disciplines:` 블록.** 항목 하나가 등록 하나로 컴파일되고 자기 텔레메트리
|
|
143
|
+
라벨을 답니다.
|
|
144
|
+
- **`protectedPaths`.** 경로 라우팅 디스패처가 여기에 대조합니다.
|
|
145
|
+
- **`witness` 블록.** TTL 증인 밸브를 설정합니다.
|
|
146
|
+
- **`.polydeukes/roi.log`.** 판정 기록을 추가하는 로그입니다.
|
|
147
|
+
|
|
148
|
+
직접 불러올 필요는 없습니다. 통합 패키지가 두 표면에 필요한 구성을 조립합니다.
|
|
149
|
+
|
|
150
|
+
<a id="limits"></a>
|
|
151
|
+
### 선언된 한계
|
|
152
|
+
|
|
153
|
+
- **셸 축은 `skipped` 행을 남기고, 그 행이 계약입니다.** 셸 명령의 대상을 텍스트에서
|
|
154
|
+
예측하는 일은 결정 불가능합니다. 그래서 이 축이 지키는 불변식은 "아무것도 빠져나가지
|
|
155
|
+
못한다"가 아니라 **기록 없이 통과하는 호출이 없다**입니다. 새로운 명령 형태가 `skipped`로 기록되면 판정하지 못한 한계를 확인할 수 있습니다. 행이 아예 없는
|
|
156
|
+
통과, 또는
|
|
157
|
+
판정하지 않고 `passed`로 기록된 통과가 결함입니다.
|
|
158
|
+
- **세션을 증명하지 못하는 호스트에서 세션 전용 선언은 `skipped`를 남깁니다.** 그 항목은
|
|
159
|
+
세션 표면에 있으므로 컴파일되지만, 선언이 묶는 대화 기록이 없고, 항목 자신의
|
|
160
|
+
`supply: pass`가 그 부재를 사유 `supply-pass`의 `skipped` 행으로 처리합니다. 정책이 없으면
|
|
161
|
+
없는 세션은 판정 불가(exit 2)이지 자동 건너뛰기가 아닙니다.
|
|
162
|
+
- **표면은 다른 표면의 목록을 등록하지 않습니다.** `command`나 대화 기록을 읽는 선언은 변경
|
|
163
|
+
집합에 대해 컴파일되지 않고, `changes`를 읽는 선언은 호출 하나에 대해 컴파일되지 않으므로,
|
|
164
|
+
관측하지 않는 표면에는 행도 남기지 않습니다. 표면이 어떤 항목을 지니는지는 텔레메트리
|
|
165
|
+
로그가 아니라 `pdks explain`과 설정 파일의 목록 이름에서 읽습니다.
|
|
166
|
+
- **컴파일러가 해석하지 못하는 선언은 스킵 등록으로 컴파일됩니다.** 라우팅은 그대로 두고
|
|
167
|
+
본체를 두지 않습니다. 등재 표 밖의 단계, 단계의 키 밖의 인자, 컴파일되지 않는 패턴,
|
|
168
|
+
쌍/단일 불일치가 그 경우입니다. 그래서 조립은 예외를 던지지 않습니다. 해소되지 않는 항목
|
|
169
|
+
하나가 형제 항목과 메타 약속과 밸브까지 무너뜨리면, 그것을 일으킨 설정을 고칠 길이
|
|
170
|
+
사라지기 때문입니다. 예약 기전, 또는 카탈로그가 거부하는 축·관계는 다른 단계입니다.
|
|
171
|
+
설정을 읽는 단계에서 파일을 거부하고(exit 2) skip 행은 남지 않습니다. 판정 시점에 세계에 없는
|
|
172
|
+
소스는 세 번째 경우입니다. 선언 자신의 `supply` 정책이 처분하고, 정책이 없으면 본체가
|
|
173
|
+
판정 불가(exit 2)로 답합니다. 통과로 답하지 않습니다.
|
|
174
|
+
- **완전 봉쇄는 목표가 아닙니다.** 여기에 차단 목록은 없습니다. 우회 철자를 열거하는 일은
|
|
175
|
+
언제나 한 걸음 뒤지므로 논리를 뒤집었습니다. 보호 경로를 언급하면 안전이 증명되지 않는
|
|
176
|
+
한 차단합니다. 간접 경로 계산 같은 잔여 벡터는 차단 대상이 아니라 텔레메트리 대상입니다.
|
|
177
|
+
마찰 밸브 둘, 곧 읽기 전용 허용 목록과 TTL 증인은 둘 다 측정 가능한 흔적을 남깁니다.
|
|
178
|
+
- **밸브는 판정 뒤에 확인합니다.** 실제로 차단한 판정만 증언으로 열 수 있고, 문장 중간의 토큰
|
|
179
|
+
언급은 밸브를 무장시키지 않으며, AI는 자기 밸브를 결코 스스로 열 수 없습니다.
|
|
117
180
|
|
|
118
181
|
<a id="polydeukes-failure-boundaries"></a>
|
|
119
182
|
## 실패 경계
|
|
120
183
|
|
|
121
|
-
- `
|
|
122
|
-
- `runCovenantCheck()`와 `runClaudeCodeHook()`는 예외를 던지지 않고 `{ exitCode: 0 \| 2 }`를 반환합니다.
|
|
184
|
+
- `runCovenantCheck()`는 예외를 던지지 않고 `{ exitCode: 0 \| 2 }`를 반환합니다.
|
|
123
185
|
- 숫자 코드는 `@polydeukes/core`의 `EXIT_UPHOLD`(`0`), `EXIT_BREAK_NON_BLOCKING`(`1`),
|
|
124
186
|
`EXIT_BREAK_BLOCKING`(`2`)입니다. 우산 실행기는 `0` 또는 `2`만 노출하며 `1`을 반환하지 않습니다.
|
|
125
|
-
- `pdks covenant check
|
|
187
|
+
- `pdks covenant check`는 사람에게 묻지 않습니다. 표준 입력을 읽고 종료 코드 0 또는 2를 내며, 그 종료 코드의 뜻은 호출한 쪽이 정합니다.
|
|
126
188
|
- `pdks docs`와 `pdks explain`은 실패 시 중간 출력 없이 끝납니다.
|
|
127
189
|
|
|
128
190
|
<a id="polydeukes-see-also"></a>
|
|
@@ -2,63 +2,62 @@
|
|
|
2
2
|
|
|
3
3
|
**English** · [한국어](./polydeukes.ko.md)
|
|
4
4
|
|
|
5
|
-
The umbrella package is the only package a consumer installs. It
|
|
6
|
-
|
|
7
|
-
artifact.
|
|
5
|
+
The umbrella package is the only package a consumer installs. It ships the `pdks` bin, the
|
|
6
|
+
judge, both surfaces' composition roots, the session-surface runner subpath, and the bundled
|
|
7
|
+
schema artifact.
|
|
8
8
|
|
|
9
9
|
<a id="polydeukes-entry-points"></a>
|
|
10
10
|
## Entry points
|
|
11
11
|
|
|
12
|
-
| Specifier | What it
|
|
12
|
+
| Specifier | What it is |
|
|
13
13
|
|---|---|
|
|
14
|
-
| `polydeukes` |
|
|
15
|
-
| `polydeukes/claude-code` | `runClaudeCodeHook` and its spec/outcome types |
|
|
14
|
+
| `pdks` / `polydeukes` | The executable. One CLI under two names in `bin` |
|
|
16
15
|
| `polydeukes/schema.json` | The bundled config JSON Schema |
|
|
17
16
|
|
|
18
|
-
|
|
17
|
+
There is no `.` entry point. `import 'polydeukes'` fails with `ERR_PACKAGE_PATH_NOT_EXPORTED`;
|
|
18
|
+
what a consumer reaches is the bin and the schema file. A session surface reaches this
|
|
19
|
+
package the same way a shell does — by spawning `pdks covenant check` — so an agent adapter
|
|
20
|
+
takes it as a peer dependency rather than importing it.
|
|
19
21
|
|
|
20
22
|
<a id="polydeukes-bin"></a>
|
|
21
23
|
## CLI surface
|
|
22
24
|
|
|
23
25
|
| Command | Purpose |
|
|
24
26
|
|---|---|
|
|
25
|
-
| `pdks covenant check` | Judge
|
|
26
|
-
| `pdks init
|
|
27
|
-
| `pdks init grok` | Install the Grok session surface |
|
|
27
|
+
| `pdks covenant check` | Judge an input IR (default, the session surface) or a unified diff (`--diff`, the change-set surface) from stdin |
|
|
28
|
+
| `pdks init` | Create the project scaffold: config file and telemetry ignore line |
|
|
28
29
|
| `pdks explain` | Render the assembled registration table without judging |
|
|
29
30
|
| `pdks docs [topic]` | Read a bundled topic |
|
|
30
31
|
| `pdks docs search <query>` | Search the bundled docs |
|
|
31
32
|
| `pdks docs show <document-id>` | Show one bundled document or section |
|
|
32
33
|
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
Session-surface installers live on the adapters: `pdks-claude-code init`, `pdks-grok init`, and
|
|
35
|
+
`pdks-codex init`.
|
|
35
36
|
|
|
36
|
-
<a id="
|
|
37
|
-
|
|
37
|
+
<a id="surface-from-input-mode"></a>
|
|
38
|
+
### The input mode is the surface
|
|
38
39
|
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
`covenant check` reads its surface off how the input arrived, never off the input's own keys.
|
|
41
|
+
An IR on stdin is one call a host observed before it ran, so the run is the **session surface**;
|
|
42
|
+
`--diff` is a finished change set from some producer, so the run is the **change-set surface**.
|
|
43
|
+
Each surface compiles the shared list plus its own:
|
|
41
44
|
|
|
42
|
-
|
|
|
45
|
+
| Input | Surface | Lists compiled |
|
|
43
46
|
|---|---|---|
|
|
44
|
-
|
|
|
45
|
-
|
|
|
46
|
-
| `ResolvedConfig` | type | Re-export from `@polydeukes/core`. |
|
|
47
|
-
| `LoadConfigSpec`, `LoadedConfig` | types | Configuration loader input and result. |
|
|
48
|
-
| `CovenantCheckSpec`, `CovenantCheckOutcome`, `CheckDomain` | types | Commit runner input, result, and observation selection. |
|
|
47
|
+
| an input IR on stdin | `session` | `disciplines`, then `sessionDisciplines` |
|
|
48
|
+
| a unified diff on stdin under `--diff` | `changeSet` | `disciplines`, then `changeSetDisciplines` |
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
The IR's `session` key says something else: what the host proved about the call — the witness
|
|
51
|
+
valve's human turns, the transcript axis, and the pre-state channel shell-write evidence needs.
|
|
52
|
+
A host that carries no session (the Grok adapter) is still judged on the session surface, and
|
|
53
|
+
what it lacks is the evidence those three read, not the surface. `pdks explain` prints each
|
|
54
|
+
surface with its two list names and counts.
|
|
52
55
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
| `runClaudeCodeHook` | function | Runs the session-surface runner and resolves to `{ exitCode: 0 \| 2 }`. |
|
|
56
|
-
| `ClaudeCodeHookSpec` | type | Input for the session runner. |
|
|
57
|
-
| `ClaudeCodeHookOutcome` | type | Session runner result. |
|
|
56
|
+
`pdks docs` is offline. It reads the installed package, not the network. Flags, JSON, and
|
|
57
|
+
exit codes are in [`pdks docs`](../cli/docs.md).
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
call that will never use them.
|
|
59
|
+
<a id="polydeukes-export-map"></a>
|
|
60
|
+
## Export map
|
|
62
61
|
|
|
63
62
|
<a id="schema-export"></a>
|
|
64
63
|
### `./schema.json`
|
|
@@ -67,67 +66,134 @@ call that will never use them.
|
|
|
67
66
|
|---|---|
|
|
68
67
|
| `polydeukes.schema.json` | The config schema copy that ships with the umbrella package. |
|
|
69
68
|
|
|
70
|
-
<a id="
|
|
71
|
-
##
|
|
69
|
+
<a id="covenant-module"></a>
|
|
70
|
+
## The judge (`covenant` module)
|
|
72
71
|
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
The judge is the umbrella's `src/covenant/` module. Everything that turns a declared promise
|
|
73
|
+
into a verdict lives there, and both composition roots plus `pdks explain` import it directly.
|
|
74
|
+
There is nothing to install, nothing to import, and no peer to satisfy: what you reach is its
|
|
75
|
+
behaviour, through the `disciplines:` block in your config and the rows it writes to
|
|
76
|
+
`.polydeukes/roi.log`.
|
|
75
77
|
|
|
76
|
-
|
|
78
|
+
<a id="ownership"></a>
|
|
79
|
+
### What the module owns
|
|
77
80
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
81
|
+
| Unit | What it does |
|
|
82
|
+
|---|---|
|
|
83
|
+
| `runCovenant` wrapper | Runs a judge body, translates its non-blocking `1` into the blocking `2`, and logs every call. No covenant runs unmeasured |
|
|
84
|
+
| Path-routing dispatcher | Registers covenants against protected paths and runs *every* matching one — no short-circuit, so the telemetry never under-counts |
|
|
85
|
+
| Meta-covenants | Three registrations that protect the judging chain itself |
|
|
86
|
+
| TTL witness | The time-boxed human valve, consulted only after a verdict blocked |
|
|
87
|
+
| Delta layer | New-violation-only judgment over a file's before/after pair |
|
|
88
|
+
| Discipline library | Config `disciplines:` entries become enforcement without a line of code |
|
|
89
|
+
|
|
90
|
+
<a id="disciplines-and-meta-covenants"></a>
|
|
91
|
+
### Discipline families and meta-covenants
|
|
92
|
+
|
|
93
|
+
**A `disciplines:` entry is one declaration** — `judge = relate ∘ extract` over the
|
|
94
|
+
observation as a world. What the declaration's sources bind decides what evidence the
|
|
95
|
+
judgment needs, which is also what decides whether it can be judged on a given surface.
|
|
96
|
+
|
|
97
|
+
| Sources | Judges | Evidence needed | List |
|
|
98
|
+
|---|---|---|---|
|
|
99
|
+
| the fixed names `target.path` · `pre` · `post` · `state` | The change itself | A file change | `disciplines` |
|
|
100
|
+
| the fixed name `changes` | The observation's whole change set | A finished change set | `changeSetDisciplines` |
|
|
101
|
+
| the fixed name `command` | The shell call's command line | A shell call — an Edit carries none | `sessionDisciplines` |
|
|
102
|
+
| the fixed name `actor` | Who made the observation | An actor the host proved | `sessionDisciplines` |
|
|
103
|
+
| `{ transcript: true }` | Session history — was a qualifying call actually executed *before* this one | A session | `sessionDisciplines` |
|
|
104
|
+
| `{ file: … }` | Another file | The surface's reader for it | `disciplines` |
|
|
105
|
+
| `{ sidecar: true }` | The spawn-record channel | The surface's channel reader | `sessionDisciplines` |
|
|
106
|
+
|
|
107
|
+
The writing guide for these entries is [the configuration reference's `disciplines`
|
|
108
|
+
section](../configuration/index.md#disciplines); the declaration grammar is the core's
|
|
109
|
+
`algebra-declaration.schema.json`.
|
|
110
|
+
|
|
111
|
+
**Three meta-covenants** protect the judging chain. They are covenants like any other; the
|
|
112
|
+
vocabulary below applies to them unchanged.
|
|
113
|
+
|
|
114
|
+
| Registration | Axis | Judges |
|
|
115
|
+
|---|---|---|
|
|
116
|
+
| self-mod | Tool | Mutations to protected paths through editing tools. Only the call's proven mutation target is compared — a protected path inside an edit's *content* is a mention and passes |
|
|
117
|
+
| shell-mod | Shell | The same, through a command line. A command mentioning a protected path passes only if its leading word proves it read-only |
|
|
118
|
+
| transcript-mod | Transcript | Writes to the live session transcript, judged by whole-path **equality** — never as a protected ancestor |
|
|
110
119
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
120
|
+
**Six words** are the telemetry contract — five verdicts and one observation. A row in
|
|
121
|
+
`.polydeukes/roi.log` carries exactly one of them, and the CLI, the docs, and the tests use
|
|
122
|
+
the same word for the same event. How to read a row is in
|
|
123
|
+
[troubleshooting](../../troubleshooting.md#reading-a-verdict).
|
|
114
124
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
125
|
+
| Verdict | Means |
|
|
126
|
+
|---|---|
|
|
127
|
+
| `passed` | The call was judged and upheld the covenant |
|
|
128
|
+
| `blocked` | The call was judged and broke it |
|
|
129
|
+
| `witnessed` | A **blocked** verdict a human opened in person. Never silent, never a clean call |
|
|
130
|
+
| `advised` | A break recorded without stopping the call — the default for every discipline entry on both surfaces, unless the entry itself says `enforce: block` |
|
|
131
|
+
| `skipped` | The call reached a registration that could not judge it. **Not a pass** — the recorded absence of a judgment |
|
|
132
|
+
| `unattributed` | A protected entry's on-disk state moved and no judgment row explains it. **Not a verdict** — no call is blocked or passed by it; the session surface writes it after comparing state against a stored baseline |
|
|
133
|
+
|
|
134
|
+
`unattributed` answers a question the other five cannot. They are all written by a judge
|
|
135
|
+
about a call it was handed, so a write that arrives without a declared call — through an
|
|
136
|
+
interpreter, a test runner's child process, a script that assembles the path from its own
|
|
137
|
+
arguments — leaves no row at all. The comparison observes the result rather than the
|
|
138
|
+
spelling, so it records that write after the fact. It never blocks: the write already
|
|
139
|
+
happened, and the comparison fails open on both sides of the verdict.
|
|
140
|
+
|
|
141
|
+
<a id="consumer-contract"></a>
|
|
142
|
+
### Where the consumer touches it
|
|
143
|
+
|
|
144
|
+
- **The `disciplines:` block** in your config. One entry compiles into one registration,
|
|
145
|
+
carrying its own telemetry label.
|
|
146
|
+
- **`protectedPaths`**, which the path-routing dispatcher matches against.
|
|
147
|
+
- **The `witness` block**, which arms the TTL valve.
|
|
148
|
+
- **`.polydeukes/roi.log`**, where every judgment lands as one row.
|
|
149
|
+
|
|
150
|
+
No import. The umbrella assembles the module for both surfaces.
|
|
151
|
+
|
|
152
|
+
<a id="limits"></a>
|
|
153
|
+
### Declared limits
|
|
154
|
+
|
|
155
|
+
- **The shell axis leaves `skipped` rows, and that row is the contract.** Predicting a
|
|
156
|
+
shell command's target from its text is undecidable, so the invariant this axis holds is
|
|
157
|
+
not "nothing gets through" — it is that **no call passes unrecorded**. A new spelling
|
|
158
|
+
landing in `skipped` is the declared limit showing itself. A pass with no row at all, or
|
|
159
|
+
one recorded `passed` without a judgment, is the defect class.
|
|
160
|
+
- **A session-only declaration on a host that proves no session records `skipped`.** The
|
|
161
|
+
entry is compiled — it is on the session surface — but the transcript the declaration binds
|
|
162
|
+
is absent, and the entry's own `supply: pass` disposes of that with a `skipped` row carrying
|
|
163
|
+
the reason `supply-pass`. With no policy the missing session is unjudgeable (exit 2), not an
|
|
164
|
+
automatic skip.
|
|
165
|
+
- **A surface never registers the other surface's list.** A `command` or transcript
|
|
166
|
+
declaration is not compiled for a change set, and a `changes` declaration is not compiled for
|
|
167
|
+
one call, so neither leaves a row on the surface that does not observe it. Which entries a
|
|
168
|
+
surface carries is read from `pdks explain` and from the config's own list names, not from
|
|
169
|
+
the telemetry log.
|
|
170
|
+
- **A declaration the compiler cannot resolve compiles to a skip registration** — routing
|
|
171
|
+
intact, no body: a step outside the registry, an argument outside a step's keys, a pattern
|
|
172
|
+
that does not compile, a paired/single mismatch. Assembly therefore never throws: one
|
|
173
|
+
unresolvable entry cannot take down its siblings, the meta-covenants, and the valve, which
|
|
174
|
+
would leave no way to fix the config that caused it. A reserved mechanism, or one whose
|
|
175
|
+
axes and relations the catalogue refuses, is a different stage: config loading rejects the
|
|
176
|
+
file (exit 2), and no skip row is written. A source the world lacks at judgment time is a
|
|
177
|
+
third case — the declaration's own `supply` policy disposes of it, and with no policy the
|
|
178
|
+
body answers unjudgeable (exit 2), never upheld.
|
|
179
|
+
- **Complete containment is a non-goal.** There are no blocklists here — enumerating bypass
|
|
180
|
+
spellings is always one step behind, so the logic is inverted: a mention of a protected
|
|
181
|
+
path blocks unless proven safe. Residual vectors such as indirect path computation are
|
|
182
|
+
telemetry targets, not block targets. The two friction valves — the read-only allowlist
|
|
183
|
+
and the TTL witness — both leave a measurable trace.
|
|
184
|
+
- **The valve stands after the verdict.** Only a judgment that actually blocked can be
|
|
185
|
+
witnessed open, a mid-sentence mention of the token does not arm it, and an AI can never
|
|
186
|
+
open the valve for itself.
|
|
119
187
|
|
|
120
188
|
<a id="polydeukes-failure-boundaries"></a>
|
|
121
189
|
## Failure boundaries
|
|
122
190
|
|
|
123
|
-
- `
|
|
124
|
-
- `runCovenantCheck()` and `runClaudeCodeHook()` never throw; they resolve to `{ exitCode: 0 \| 2
|
|
125
|
-
}`.
|
|
191
|
+
- `runCovenantCheck()` never throws; it resolves to `{ exitCode: 0 \| 2 }`.
|
|
126
192
|
- The numeric codes are `EXIT_UPHOLD` (`0`), `EXIT_BREAK_NON_BLOCKING` (`1`), and
|
|
127
193
|
`EXIT_BREAK_BLOCKING` (`2`) from `@polydeukes/core`. The umbrella runners expose only `0` or
|
|
128
194
|
`2`; they never return `1`.
|
|
129
|
-
- `pdks covenant check` prompts
|
|
130
|
-
|
|
195
|
+
- `pdks covenant check` never prompts. It reads stdin and exits 0 or 2; the caller decides what
|
|
196
|
+
that exit code means.
|
|
131
197
|
- `pdks docs` and `pdks explain` print nothing partial on failure.
|
|
132
198
|
|
|
133
199
|
<a id="polydeukes-see-also"></a>
|