polydeukes 0.8.0 → 0.10.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/dist/covenant/shell-mod.d.ts +15 -4
- package/dist/covenant/shell-mod.js +63 -8
- package/dist/covenant/transcript-mod.js +8 -5
- package/dist/docs/README.ko.md +43 -18
- package/dist/docs/README.md +39 -17
- package/dist/docs/catalog.json +50 -162
- package/dist/docs/concepts/judgment.ko.md +2 -0
- package/dist/docs/concepts/judgment.md +2 -0
- package/dist/docs/how-to/connect-surfaces.ko.md +19 -7
- package/dist/docs/how-to/connect-surfaces.md +24 -12
- package/dist/docs/how-to/write-disciplines.ko.md +68 -31
- package/dist/docs/how-to/write-disciplines.md +69 -32
- package/dist/docs/index.json +577 -231
- package/dist/docs/reference/cli/init.ko.md +10 -7
- package/dist/docs/reference/cli/init.md +16 -11
- package/dist/docs/reference/configuration/index.ko.md +14 -20
- package/dist/docs/reference/configuration/index.md +16 -24
- package/dist/docs/reference/declaration-language/index.ko.md +280 -0
- package/dist/docs/reference/declaration-language/index.md +277 -0
- package/dist/docs/reference/packages/adapter-claude-code.ko.md +1 -1
- package/dist/docs/reference/packages/adapter-claude-code.md +1 -1
- package/dist/docs/reference/packages/adapter-codex.ko.md +34 -17
- package/dist/docs/reference/packages/adapter-codex.md +39 -21
- package/dist/docs/reference/packages/core.ko.md +2 -2
- package/dist/docs/reference/packages/core.md +2 -2
- package/dist/docs/reference/packages/polydeukes.ko.md +2 -2
- package/dist/docs/reference/packages/polydeukes.md +3 -3
- package/dist/docs/reference/packages/sdk-ts.ko.md +15 -18
- package/dist/docs/reference/packages/sdk-ts.md +14 -17
- package/dist/docs/troubleshooting.ko.md +18 -10
- package/dist/docs/troubleshooting.md +19 -11
- package/package.json +2 -2
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
[English](sdk-ts.md) · **한국어**
|
|
4
4
|
|
|
5
|
-
> **TypeScript에서
|
|
6
|
-
> `pdks covenant check
|
|
5
|
+
> **TypeScript에서 판정기를 호출합니다.** `checkCovenant`에 약속(covenant) 입력 IR을
|
|
6
|
+
> 전달하면 `pdks covenant check`의 판정 결과를 값으로 반환합니다.
|
|
7
7
|
>
|
|
8
8
|
> 베타입니다. `polydeukes` · `@polydeukes/core`와 함께 설치하며, 둘 다 이 패키지의
|
|
9
9
|
> `peerDependencies`입니다.
|
|
@@ -11,18 +11,16 @@
|
|
|
11
11
|
<a id="ownership"></a>
|
|
12
12
|
## 담당하는 기능
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
코드는 여기에 없습니다. 분기는 우산 패키지를 찾았는지와 자식이 어떤 상태로 끝났는지뿐입니다.
|
|
14
|
+
판정받는 프로젝트에서 `polydeukes`를 찾고, 실행 파일의 표준 입력으로 IR을 전달한 뒤
|
|
15
|
+
자식 프로세스의 종료 코드를 판정 결과로 변환합니다. 실제 판정은 자식 프로세스가 수행합니다.
|
|
17
16
|
|
|
18
17
|
| 단위 | 하는 일 |
|
|
19
18
|
|---|---|
|
|
20
19
|
| `checkCovenant` | 판정받는 프로젝트에서 `pdks covenant check`를 스폰하고 판정 결과를 돌려줍니다 |
|
|
21
|
-
| 우산
|
|
20
|
+
| 우산 패키지 찾기 | `repoRoot`의 설치 그래프에서 `polydeukes`를 찾아 `pdks` 실행 파일을 읽습니다 |
|
|
22
21
|
| 판정 결과 변환 | 종료 코드 `0`은 `upheld`, `2`는 `blocked`, 그 밖은 모두 `unjudged`입니다 |
|
|
23
22
|
|
|
24
|
-
|
|
25
|
-
프로세스가 쓰므로, 호출 하나에 행 하나는 그대로입니다.
|
|
23
|
+
텔레메트리는 자식 프로세스가 판정 중에 기록합니다. SDK는 중복 행을 추가하지 않습니다.
|
|
26
24
|
|
|
27
25
|
<a id="install"></a>
|
|
28
26
|
## 설치
|
|
@@ -31,11 +29,12 @@
|
|
|
31
29
|
pnpm add @polydeukes/sdk-ts polydeukes @polydeukes/core
|
|
32
30
|
```
|
|
33
31
|
|
|
34
|
-
|
|
32
|
+
별도의 초기화 명령은 필요하지 않습니다. 우산 패키지가 SDK가 스폰할 판정기를 공급하고, 코어가
|
|
35
33
|
호출자가 채우는 `CovenantInput` 타입을 공급합니다.
|
|
36
34
|
|
|
35
|
+
<a id="동사"></a>
|
|
37
36
|
<a id="verb"></a>
|
|
38
|
-
##
|
|
37
|
+
## `checkCovenant`
|
|
39
38
|
|
|
40
39
|
이 패키지는 ESM 전용입니다(`"type": "module"`, `import` 조건만 있고 `require`는 없음).
|
|
41
40
|
호출하는 파일이 `.mjs`이거나 그 `package.json`이 `"type": "module"`을 선언해야 합니다.
|
|
@@ -90,7 +89,7 @@ type CheckCovenantSpawnSpec = { command: string; args: string[]; cwd: string; st
|
|
|
90
89
|
| `repoRoot` | 판정받는 프로젝트입니다. 설정 발견, 세계 축, 자식의 cwd, 우산 패키지를 찾는 설치 그래프가 모두 여기 걸립니다 |
|
|
91
90
|
| `input` | 호출자 자신의 IR이며 자식의 표준 입력으로 원문 그대로 갑니다 |
|
|
92
91
|
| `enforce` | 실행 전체에 대한 관측자의 기본 자세입니다. **적지 않으면 `block`입니다** |
|
|
93
|
-
| `spawn` |
|
|
92
|
+
| `spawn` | 자식 프로세스 실행 함수를 지정합니다. 생략하면 현재 프로세스의 Node.js 실행 파일을 사용합니다 |
|
|
94
93
|
|
|
95
94
|
**`enforce`의 기본값은 `block`입니다.** 이것은 표면의 강제 수준이지 항목의 것이 아닙니다.
|
|
96
95
|
보호 경로와 `enforce: block`을 단 항목이 호출을 멈추고, 나머지 위반은 종료 코드 0에
|
|
@@ -118,17 +117,15 @@ type CheckCovenantVerdict =
|
|
|
118
117
|
| `blocked` | `2` | 호출이 판정을 받았고 무언가 막았습니다. `reason`은 자식의 stderr 원문입니다. 진행하지 않습니다 |
|
|
119
118
|
| `unjudged` | 그 밖의 상태이거나 우산 패키지가 없음 | 판정이 일어나지 않았습니다. `reason`이 어느 쪽인지 말합니다. 이것을 통과로 읽으면 판정기가 설치되지 않은 프로젝트에서 모든 호출이 지나갑니다 |
|
|
120
119
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
[규율 작성하기](../../how-to/write-disciplines.ko.md#posture)에 있습니다.
|
|
120
|
+
SDK는 `blocked.reason`과 `upheld.advisories`를 데이터로 반환합니다. 소비자는 이 내용을
|
|
121
|
+
모델에게 전달하거나 이슈 또는 로그에 기록할 수 있습니다. SDK는 별도의 증인 인자를 받지 않습니다.
|
|
122
|
+
무인 루프에서 결과를 처리하는 방법은
|
|
123
|
+
[규율 작성하기](../../how-to/write-disciplines.ko.md#posture)를 참고하세요.
|
|
126
124
|
|
|
127
125
|
<a id="failure"></a>
|
|
128
126
|
## 실패 예제
|
|
129
127
|
|
|
130
|
-
프로젝트에 `polydeukes`가 설치돼 있지 않으면
|
|
131
|
-
그 사실을 말합니다.
|
|
128
|
+
프로젝트에 `polydeukes`가 설치돼 있지 않으면 `checkCovenant`는 `unjudged`를 반환합니다.
|
|
132
129
|
|
|
133
130
|
```ts
|
|
134
131
|
const verdict = await checkCovenant({ repoRoot: '/tmp/project-without-polydeukes', input });
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
**English** · [한국어](sdk-ts.ko.md)
|
|
4
4
|
|
|
5
|
-
> **
|
|
6
|
-
> `pdks covenant check`
|
|
5
|
+
> **Call the judge from TypeScript.** Pass a covenant input IR to `checkCovenant`
|
|
6
|
+
> and receive the verdict from `pdks covenant check` as a value.
|
|
7
7
|
>
|
|
8
8
|
> Beta. Install it next to `polydeukes` and `@polydeukes/core`, which it names as
|
|
9
9
|
> `peerDependencies`.
|
|
@@ -11,10 +11,9 @@
|
|
|
11
11
|
<a id="ownership"></a>
|
|
12
12
|
## What this package owns
|
|
13
13
|
|
|
14
|
-
The
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
umbrella resolved and what status the child left with.
|
|
14
|
+
The package finds `polydeukes` in the project being judged, runs its bin with the input on
|
|
15
|
+
stdin, and converts the child process's exit status into a verdict. The child process performs
|
|
16
|
+
the judgment.
|
|
18
17
|
|
|
19
18
|
| Unit | What it does |
|
|
20
19
|
|---|---|
|
|
@@ -22,8 +21,7 @@ umbrella resolved and what status the child left with.
|
|
|
22
21
|
| Umbrella resolution | Finds `polydeukes` in the install graph of `repoRoot` and reads its `pdks` bin |
|
|
23
22
|
| Verdict translation | Exit `0` is `upheld`, exit `2` is `blocked`, everything else is `unjudged` |
|
|
24
23
|
|
|
25
|
-
|
|
26
|
-
where the judgment happened, so one call still leaves one row.
|
|
24
|
+
The child process writes telemetry during judgment. The SDK does not add duplicate rows.
|
|
27
25
|
|
|
28
26
|
<a id="install"></a>
|
|
29
27
|
## Install
|
|
@@ -32,11 +30,12 @@ where the judgment happened, so one call still leaves one row.
|
|
|
32
30
|
pnpm add @polydeukes/sdk-ts polydeukes @polydeukes/core
|
|
33
31
|
```
|
|
34
32
|
|
|
35
|
-
|
|
33
|
+
No separate initialization command is needed. The umbrella supplies the judge the SDK spawns, and the
|
|
36
34
|
core supplies the `CovenantInput` type the caller fills in.
|
|
37
35
|
|
|
36
|
+
<a id="the-verb"></a>
|
|
38
37
|
<a id="verb"></a>
|
|
39
|
-
##
|
|
38
|
+
## `checkCovenant`
|
|
40
39
|
|
|
41
40
|
The package is ESM only (`"type": "module"`, an `import` condition and no `require`): the calling
|
|
42
41
|
file is a `.mjs`, or its `package.json` declares `"type": "module"`.
|
|
@@ -120,17 +119,15 @@ type CheckCovenantVerdict =
|
|
|
120
119
|
| `blocked` | `2` | The call was judged and something blocked it. `reason` is the child's stderr verbatim. Do not proceed |
|
|
121
120
|
| `unjudged` | anything else, or no umbrella | No judgment happened. `reason` says which. Reading it as an uphold would let an uninstalled judge pass every call |
|
|
122
121
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
author and for a consumer are in [write disciplines](../../how-to/write-disciplines.md#posture).
|
|
122
|
+
The SDK returns `blocked.reason` and `upheld.advisories` as data. The consumer decides where
|
|
123
|
+
to send them: to the model, an issue, or a log. The SDK accepts no separate witness argument.
|
|
124
|
+
See [write disciplines](../../how-to/write-disciplines.md#posture) for handling these results
|
|
125
|
+
in an unattended loop.
|
|
128
126
|
|
|
129
127
|
<a id="failure"></a>
|
|
130
128
|
## A failure example
|
|
131
129
|
|
|
132
|
-
|
|
133
|
-
rather than answering `upheld`:
|
|
130
|
+
If the project has no `polydeukes` installed, `checkCovenant` returns `unjudged`:
|
|
134
131
|
|
|
135
132
|
```ts
|
|
136
133
|
const verdict = await checkCovenant({ repoRoot: '/tmp/project-without-polydeukes', input });
|
|
@@ -67,11 +67,15 @@ Git에서 원래 파일을 복원하세요. 새 프로젝트라면 `pdks init`,
|
|
|
67
67
|
바뀌면 `/hooks`에서 승인하기 전까지 신뢰하지 않으므로, 설치기가 성공해도 실행되는 훅이
|
|
68
68
|
없을 수 있습니다. 실제 도구를 호출하고 텔레메트리를 확인하세요.
|
|
69
69
|
- Codex는 대화 기록 경로를 알려 주지만 그 형식을 안정된 것으로 문서화하지 않으므로 어떤
|
|
70
|
-
판정도 읽지
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
판정도 읽지 않습니다. 대신 어댑터가 `UserPromptSubmit`과 `PostToolUse`를 자기 세션 증거
|
|
71
|
+
파일에 기록하고 `SessionEnd`에서 지웁니다. IR은 이 `session`을 싣되 `actor`를 합성하지
|
|
72
|
+
않습니다.
|
|
73
|
+
- 의도한 차단 뒤에는 설정된 증인 토큰을 첫 줄에 단독으로 보내고 다시 시도합니다. stderr가
|
|
74
|
+
`UserPromptSubmit` 증거가 없다고 알리면 생명주기 항목 넷이 모두 승인됐는지 확인합니다.
|
|
75
|
+
그래도 증거가 없다면 토큰을 반복해도 관측되지 않은 호출을 풀 수 없으므로 본인의 터미널에서
|
|
76
|
+
작업합니다.
|
|
73
77
|
|
|
74
|
-
커밋 증인은
|
|
78
|
+
커밋 증인은 스테이징 검사만 허용하며 Codex 세션 증인을 대신하지 않습니다.
|
|
75
79
|
|
|
76
80
|
<a id="config-fault"></a>
|
|
77
81
|
## 선언을 판정으로 구성하지 못할 때
|
|
@@ -149,13 +153,17 @@ covenant check failed closed: invalid config in polydeukes.config.yaml: … —
|
|
|
149
153
|
<a id="skipped-rows-on-the-change-set-surface"></a>
|
|
150
154
|
## 변경 집합 표면의 미판정 기록
|
|
151
155
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
있습니다. 모든 자료 부재를 같은 실패로 취급하지 말고 등록 내용과 사유를 확인하세요.
|
|
156
|
+
변경 집합 표면은 `disciplines`와 `changeSetDisciplines`를 컴파일합니다.
|
|
157
|
+
대화 기록이나 명령줄을 읽는 항목은 `sessionDisciplines`에 속하며 diff 판정에는 포함되지
|
|
158
|
+
않습니다. 이런 항목을 공용 목록이나 변경 집합 목록에 넣으면 설정 오류가 발생합니다.
|
|
156
159
|
|
|
157
|
-
|
|
158
|
-
|
|
160
|
+
변경 집합 항목이 읽는 소스가 없고 `supply` 정책이 `pass`이면 `supply-pass`를 기록합니다.
|
|
161
|
+
선언을 컴파일할 수 없으면 `config-fault`를 기록합니다. `pdks explain`과 로그의 사유를
|
|
162
|
+
확인하세요. 미판정은 규율을 지켰다는 증거가 아닙니다.
|
|
163
|
+
|
|
164
|
+
세션 표면에서는 호스트가 대화 기록을 공급하지 않을 때
|
|
165
|
+
`supply: { session: 'pass' }`로 건너뛸 수 있습니다.
|
|
166
|
+
[규율 목록 셋](./reference/configuration/index.ko.md#three-lists)을 참고하세요.
|
|
159
167
|
|
|
160
168
|
<a id="local-state"></a>
|
|
161
169
|
## 다른 컴퓨터로 프로젝트를 옮길 때
|
|
@@ -65,12 +65,16 @@ The same two problems are distinct here, and the first has its own cause:
|
|
|
65
65
|
- After `pdks-codex init`, hook trust is bound to the hash of the hook definition. A changed
|
|
66
66
|
`.codex/hooks.json` is not trusted until you approve it through `/hooks`, so an installer that
|
|
67
67
|
succeeded can still leave no hook running. Verify an actual call and its telemetry.
|
|
68
|
-
- Codex names a transcript path but documents the format as unstable, so no judgment reads it
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
- Codex names a transcript path but documents the format as unstable, so no judgment reads it.
|
|
69
|
+
The adapter records `UserPromptSubmit` and `PostToolUse` into its own session evidence file
|
|
70
|
+
and removes it at `SessionEnd`; the IR carries that `session` without synthesizing `actor`.
|
|
71
|
+
- After an intentional block, send the configured witness token alone on the first line and
|
|
72
|
+
retry. If stderr says no `UserPromptSubmit` evidence was recorded, confirm all four lifecycle
|
|
73
|
+
entries are approved. If evidence is still unavailable, perform the repair from your own
|
|
74
|
+
terminal; repeating the token cannot release an unobserved call.
|
|
72
75
|
|
|
73
|
-
A commit witness
|
|
76
|
+
A commit witness authorizes only its staged check; it does not substitute for the Codex session
|
|
77
|
+
witness.
|
|
74
78
|
|
|
75
79
|
<a id="config-fault"></a>
|
|
76
80
|
## Config-fault
|
|
@@ -148,13 +152,17 @@ from the hook command rather than editing the config — the row is still writte
|
|
|
148
152
|
<a id="skipped-rows-on-the-change-set-surface"></a>
|
|
149
153
|
## `skipped` rows on the change-set surface
|
|
150
154
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
reason instead of treating every missing source as the same failure.
|
|
155
|
+
The change-set surface compiles `disciplines` and `changeSetDisciplines`.
|
|
156
|
+
Transcript- and command-reading entries belong in `sessionDisciplines` and are not compiled
|
|
157
|
+
for a diff. Putting either kind in a shared or change-set list causes a configuration error.
|
|
155
158
|
|
|
156
|
-
A
|
|
157
|
-
|
|
159
|
+
A change-set entry can record `supply-pass` when a source it reads is absent and its `supply`
|
|
160
|
+
policy is `pass`, or `config-fault` when the declaration cannot compile. Check `pdks explain`
|
|
161
|
+
and the log's reason field. A skip does not establish that the discipline was upheld.
|
|
162
|
+
|
|
163
|
+
On the session surface, a transcript-reading entry can use `supply: { session: 'pass' }`
|
|
164
|
+
when a host supplies no session history. See the [three discipline
|
|
165
|
+
lists](./reference/configuration/index.md#three-lists).
|
|
158
166
|
|
|
159
167
|
<a id="local-state"></a>
|
|
160
168
|
## Moving a project between machines
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "polydeukes",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "A development discipline framework for building alongside an AI coding partner — deterministic covenants, a verifiable work ledger, local memory, and adversarial verification. Beta.",
|
|
5
5
|
"author": "huskyhoochu <dfg1499@gmail.com>",
|
|
6
6
|
"keywords": [
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"yaml": "2.9.0",
|
|
47
|
-
"@polydeukes/core": "^0.
|
|
47
|
+
"@polydeukes/core": "^0.10.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@types/node": "^24.0.0",
|