polydeukes 0.6.0 → 0.6.1
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 +54 -80
- package/README.md +55 -94
- package/dist/bin.js +8 -5
- package/dist/docs/README.ko.md +60 -0
- package/dist/docs/README.md +64 -0
- package/dist/docs/catalog.json +464 -0
- package/dist/docs/concepts/judgment.ko.md +113 -0
- package/dist/docs/concepts/judgment.md +113 -0
- package/dist/docs/how-to/configure-project.ko.md +99 -0
- package/dist/docs/how-to/configure-project.md +95 -0
- package/dist/docs/how-to/connect-surfaces.ko.md +115 -0
- package/dist/docs/how-to/connect-surfaces.md +118 -0
- package/dist/docs/how-to/write-disciplines.ko.md +124 -0
- package/dist/docs/how-to/write-disciplines.md +125 -0
- package/dist/docs/index.json +2046 -0
- package/dist/docs/reference/cli/covenant-check.ko.md +101 -0
- package/dist/docs/reference/cli/covenant-check.md +98 -0
- package/dist/docs/reference/cli/docs.ko.md +97 -0
- package/dist/docs/reference/cli/docs.md +95 -0
- package/dist/docs/reference/cli/explain.ko.md +79 -0
- package/dist/docs/reference/cli/explain.md +84 -0
- package/dist/docs/reference/cli/init.ko.md +119 -0
- package/dist/docs/reference/cli/init.md +131 -0
- package/dist/docs/reference/configuration/index.ko.md +448 -0
- package/dist/docs/reference/{configuration.md → configuration/index.md} +48 -30
- package/dist/docs/reference/packages/adapter-claude-code.ko.md +83 -0
- package/dist/docs/reference/{adapter-claude-code.md → packages/adapter-claude-code.md} +10 -6
- package/dist/docs/reference/packages/adapter-git.ko.md +101 -0
- package/dist/docs/reference/{adapter-git.md → packages/adapter-git.md} +20 -12
- package/dist/docs/reference/packages/core.ko.md +128 -0
- package/dist/docs/reference/{core.md → packages/core.md} +21 -8
- package/dist/docs/reference/packages/covenant.ko.md +115 -0
- package/dist/docs/reference/{covenant.md → packages/covenant.md} +18 -11
- package/dist/docs/reference/packages/polydeukes.ko.md +134 -0
- package/dist/docs/reference/packages/polydeukes.md +139 -0
- package/dist/docs/troubleshooting.ko.md +142 -0
- package/dist/docs/troubleshooting.md +98 -150
- package/dist/docs/tutorials/first-judgment.ko.md +82 -0
- package/dist/docs/tutorials/first-judgment.md +81 -0
- package/dist/docs-catalog.d.ts +25 -0
- package/dist/docs-catalog.js +450 -0
- package/dist/docs-library.d.ts +23 -0
- package/dist/docs-library.js +347 -0
- package/dist/docs-markdown.d.ts +32 -0
- package/dist/docs-markdown.js +150 -0
- package/dist/docs-query.d.ts +11 -40
- package/dist/docs-query.js +28 -122
- package/dist/docs-types.d.ts +105 -0
- package/dist/docs-types.js +2 -0
- package/dist/init-claude-code.d.ts +1 -1
- package/dist/init-claude-code.js +159 -42
- package/package.json +5 -5
- package/dist/docs/configuration.md +0 -103
- package/dist/docs/installation.md +0 -241
- package/dist/docs/reference/polydeukes.md +0 -315
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# Write disciplines
|
|
2
|
+
|
|
3
|
+
**English** · [한국어](../how-to/write-disciplines.ko.md)
|
|
4
|
+
|
|
5
|
+
A discipline describes a practice you want checked. Choose the observed files or session evidence,
|
|
6
|
+
write an extraction and relation, then exercise both a violation and a valid case. Leave enforcement
|
|
7
|
+
at `advise` until you decide that the observed results justify blocking.
|
|
8
|
+
|
|
9
|
+
<a id="locale-key-pairing"></a>
|
|
10
|
+
## Locale key pairing
|
|
11
|
+
|
|
12
|
+
This declaration compares the key sets of two JSON translation files, including nested keys.
|
|
13
|
+
Save the complete YAML below as `polydeukes.config.yaml` in an **example project**, not over an
|
|
14
|
+
existing project's configuration. In an existing project, copy only the discipline entry.
|
|
15
|
+
The [first-judgment tutorial](../tutorials/first-judgment.md) supplies installation steps.
|
|
16
|
+
|
|
17
|
+
```yaml
|
|
18
|
+
languages:
|
|
19
|
+
json:
|
|
20
|
+
productionGlob: 'locales/**/*.json'
|
|
21
|
+
testCmd: 'pnpm test'
|
|
22
|
+
telemetry:
|
|
23
|
+
logPath: '.polydeukes/roi.log'
|
|
24
|
+
disciplines:
|
|
25
|
+
- id: 'locale-key-parity'
|
|
26
|
+
why: 'the ko and en locales must carry the same keys'
|
|
27
|
+
declare:
|
|
28
|
+
mechanism: 'pairing'
|
|
29
|
+
sources:
|
|
30
|
+
ko: { file: 'locales/ko.json' }
|
|
31
|
+
en: { file: 'locales/en.json' }
|
|
32
|
+
supply: { ko: 'error', en: 'error' }
|
|
33
|
+
scope: { source: 'target.path', include: ['^locales/(ko|en)\.json$'] }
|
|
34
|
+
extract:
|
|
35
|
+
koKeys:
|
|
36
|
+
- { op: 'source', of: 'ko' }
|
|
37
|
+
- { op: 'json' }
|
|
38
|
+
- { op: 'flattenKeys' }
|
|
39
|
+
enKeys:
|
|
40
|
+
- { op: 'source', of: 'en' }
|
|
41
|
+
- { op: 'json' }
|
|
42
|
+
- { op: 'flattenKeys' }
|
|
43
|
+
relate:
|
|
44
|
+
- id: 'parity'
|
|
45
|
+
relation: { op: 'equal', of: ['koKeys', 'enKeys'] }
|
|
46
|
+
messageBySide:
|
|
47
|
+
left: '{key} is in ko only'
|
|
48
|
+
right: '{key} is in en only'
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
`flattenKeys` extracts keys, not translation values. `equal` compares both directions and
|
|
52
|
+
`messageBySide` reports which file has an unmatched key. The default enforcement is `advise`.
|
|
53
|
+
Both source files must exist and contain valid JSON. The commit surface reads them from the
|
|
54
|
+
chosen observation; a session edit uses that edit's proposed new contents for the file it changes.
|
|
55
|
+
|
|
56
|
+
From the example project's root, prepare matching tracked files. The commit below requires your
|
|
57
|
+
usual local git identity; it creates the baseline for the worktree comparison.
|
|
58
|
+
|
|
59
|
+
```sh
|
|
60
|
+
mkdir -p locales
|
|
61
|
+
printf '{"home":"Home"}\n' > locales/en.json
|
|
62
|
+
printf '{"home":"홈"}\n' > locales/ko.json
|
|
63
|
+
git add locales/en.json locales/ko.json
|
|
64
|
+
git commit -m 'docs: prepare locale example'
|
|
65
|
+
printf '{"home":"Home","settings":"Settings"}\n' > locales/en.json
|
|
66
|
+
pnpm exec pdks covenant check --worktree
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Expect an `advised` diagnostic for `locale-key-parity` naming `settings` as present only in English.
|
|
70
|
+
The command still exits 0. Fix the mismatch and run the same observation again:
|
|
71
|
+
|
|
72
|
+
```sh
|
|
73
|
+
printf '{"home":"홈","settings":"설정"}\n' > locales/ko.json
|
|
74
|
+
pnpm exec pdks covenant check --worktree
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
The parity diagnostic should disappear. The values differ intentionally; the keys now match.
|
|
78
|
+
Restore the two example files to their committed baseline when finished:
|
|
79
|
+
|
|
80
|
+
```sh
|
|
81
|
+
git restore -- locales/en.json locales/ko.json
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
`--worktree` also includes untracked, non-ignored files as additions. This example commits a
|
|
85
|
+
baseline to exercise modifications and make cleanup predictable. A declaration does not run
|
|
86
|
+
merely because its source exists: at least one observed change must match its scope.
|
|
87
|
+
|
|
88
|
+
<a id="when-to-draft"></a>
|
|
89
|
+
## When to draft instead of declaring
|
|
90
|
+
|
|
91
|
+
If the promise is real but the grammar cannot express it yet, write a draft.
|
|
92
|
+
|
|
93
|
+
```yaml
|
|
94
|
+
languages:
|
|
95
|
+
json:
|
|
96
|
+
productionGlob: 'locales/**/*.json'
|
|
97
|
+
testCmd: 'pnpm test'
|
|
98
|
+
disciplines:
|
|
99
|
+
- id: 'benchmark-supports-performance-claim'
|
|
100
|
+
why: 'a performance claim must be supported by a fresh benchmark run during judgment.'
|
|
101
|
+
draft: true
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Use `draft: true` only for a promise the current engine cannot judge. A draft does not produce a
|
|
105
|
+
verdict or telemetry. It is still part of the config, so the file remains loadable.
|
|
106
|
+
|
|
107
|
+
<a id="proof-runs"></a>
|
|
108
|
+
## Verify both outcomes
|
|
109
|
+
|
|
110
|
+
After you save the config, run the judgment path that can actually see it.
|
|
111
|
+
|
|
112
|
+
- `pdks covenant check --worktree` shows the same entry against the current tree.
|
|
113
|
+
- `pdks explain` shows the registration and whether it is a declare or a draft.
|
|
114
|
+
- A one-sided edit to `locales/en.json` or `locales/ko.json` is a good smoke test for the pairing
|
|
115
|
+
example.
|
|
116
|
+
|
|
117
|
+
If no judgment appears, first check the observation: is the file included rather than ignored,
|
|
118
|
+
did it change in the selected comparison, does the scope match, and can the surface supply the
|
|
119
|
+
evidence? Inspect
|
|
120
|
+
`pdks explain` and the telemetry log for `config-fault`, `no-observation`, or `supply-pass`.
|
|
121
|
+
Do not treat a missing diagnostic as proof that the declaration works.
|
|
122
|
+
|
|
123
|
+
The draft above is deliberately different from key pairing. The current engine does not run a
|
|
124
|
+
new benchmark during judgment. It can compare supplied evidence, but that is not the same promise.
|
|
125
|
+
See [declarations and their limits](../concepts/judgment.md#declarations).
|