euthyna 0.1.1 → 0.3.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.
Files changed (33) hide show
  1. package/.agents/skills/euthyna/SKILL.md +256 -0
  2. package/.agents/skills/euthyna/references/bug-classes.md +130 -0
  3. package/.agents/skills/euthyna/references/change-audit.md +219 -0
  4. package/.agents/skills/euthyna/references/dependency-audit.md +116 -0
  5. package/.agents/skills/euthyna/references/fact-contract.md +129 -0
  6. package/.agents/skills/euthyna/references/fact-producers.md +274 -0
  7. package/.agents/skills/euthyna/references/meta-mechanisms.md +173 -0
  8. package/.agents/skills/euthyna/references/verification-gates.md +293 -0
  9. package/.agents/skills/euthyna-en/SKILL.md +285 -0
  10. package/.agents/skills/euthyna-en/references/bug-classes.md +130 -0
  11. package/.agents/skills/euthyna-en/references/change-audit.md +212 -0
  12. package/.agents/skills/euthyna-en/references/dependency-audit.md +116 -0
  13. package/.agents/skills/euthyna-en/references/fact-contract.md +129 -0
  14. package/.agents/skills/euthyna-en/references/fact-producers.md +258 -0
  15. package/.agents/skills/euthyna-en/references/meta-mechanisms.md +174 -0
  16. package/.agents/skills/euthyna-en/references/verification-gates.md +291 -0
  17. package/.claude/commands/euthyna.md +18 -0
  18. package/.opencode/commands/euthyna.md +8 -0
  19. package/LICENSE +202 -202
  20. package/README.md +55 -8
  21. package/__init__.py +91 -0
  22. package/bin/euthyna.js +13 -3
  23. package/cordis.patch.yml +4 -0
  24. package/package.json +28 -3
  25. package/plugin/index.js +89 -0
  26. package/plugin.yaml +8 -0
  27. package/src/cli.js +189 -41
  28. package/src/contract.js +20 -13
  29. package/src/facts/coverage.js +69 -23
  30. package/src/facts/deps.js +81 -24
  31. package/src/facts/history.js +89 -25
  32. package/src/gate.js +171 -43
  33. package/src/lang.js +55 -0
package/LICENSE CHANGED
@@ -1,202 +1,202 @@
1
-
2
- Apache License
3
- Version 2.0, January 2004
4
- http://www.apache.org/licenses/
5
-
6
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
-
8
- 1. Definitions.
9
-
10
- "License" shall mean the terms and conditions for use, reproduction,
11
- and distribution as defined by Sections 1 through 9 of this document.
12
-
13
- "Licensor" shall mean the copyright owner or entity authorized by
14
- the copyright owner that is granting the License.
15
-
16
- "Legal Entity" shall mean the union of the acting entity and all
17
- other entities that control, are controlled by, or are under common
18
- control with that entity. For the purposes of this definition,
19
- "control" means (i) the power, direct or indirect, to cause the
20
- direction or management of such entity, whether by contract or
21
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
- outstanding shares, or (iii) beneficial ownership of such entity.
23
-
24
- "You" (or "Your") shall mean an individual or Legal Entity
25
- exercising permissions granted by this License.
26
-
27
- "Source" form shall mean the preferred form for making modifications,
28
- including but not limited to software source code, documentation
29
- source, and configuration files.
30
-
31
- "Object" form shall mean any form resulting from mechanical
32
- transformation or translation of a Source form, including but
33
- not limited to compiled object code, generated documentation,
34
- and conversions to other media types.
35
-
36
- "Work" shall mean the work of authorship, whether in Source or
37
- Object form, made available under the License, as indicated by a
38
- copyright notice that is included in or attached to the work
39
- (an example is provided in the Appendix below).
40
-
41
- "Derivative Works" shall mean any work, whether in Source or Object
42
- form, that is based on (or derived from) the Work and for which the
43
- editorial revisions, annotations, elaborations, or other modifications
44
- represent, as a whole, an original work of authorship. For the purposes
45
- of this License, Derivative Works shall not include works that remain
46
- separable from, or merely link (or bind by name) to the interfaces of,
47
- the Work and Derivative Works thereof.
48
-
49
- "Contribution" shall mean any work of authorship, including
50
- the original version of the Work and any modifications or additions
51
- to that Work or Derivative Works thereof, that is intentionally
52
- submitted to Licensor for inclusion in the Work by the copyright owner
53
- or by an individual or Legal Entity authorized to submit on behalf of
54
- the copyright owner. For the purposes of this definition, "submitted"
55
- means any form of electronic, verbal, or written communication sent
56
- to the Licensor or its representatives, including but not limited to
57
- communication on electronic mailing lists, source code control systems,
58
- and issue tracking systems that are managed by, or on behalf of, the
59
- Licensor for the purpose of discussing and improving the Work, but
60
- excluding communication that is conspicuously marked or otherwise
61
- designated in writing by the copyright owner as "Not a Contribution."
62
-
63
- "Contributor" shall mean Licensor and any individual or Legal Entity
64
- on behalf of whom a Contribution has been received by Licensor and
65
- subsequently incorporated within the Work.
66
-
67
- 2. Grant of Copyright License. Subject to the terms and conditions of
68
- this License, each Contributor hereby grants to You a perpetual,
69
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
- copyright license to reproduce, prepare Derivative Works of,
71
- publicly display, publicly perform, sublicense, and distribute the
72
- Work and such Derivative Works in Source or Object form.
73
-
74
- 3. Grant of Patent License. Subject to the terms and conditions of
75
- this License, each Contributor hereby grants to You a perpetual,
76
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
- (except as stated in this section) patent license to make, have made,
78
- use, offer to sell, sell, import, and otherwise transfer the Work,
79
- where such license applies only to those patent claims licensable
80
- by such Contributor that are necessarily infringed by their
81
- Contribution(s) alone or by combination of their Contribution(s)
82
- with the Work to which such Contribution(s) was submitted. If You
83
- institute patent litigation against any entity (including a
84
- cross-claim or counterclaim in a lawsuit) alleging that the Work
85
- or a Contribution incorporated within the Work constitutes direct
86
- or contributory patent infringement, then any patent licenses
87
- granted to You under this License for that Work shall terminate
88
- as of the date such litigation is filed.
89
-
90
- 4. Redistribution. You may reproduce and distribute copies of the
91
- Work or Derivative Works thereof in any medium, with or without
92
- modifications, and in Source or Object form, provided that You
93
- meet the following conditions:
94
-
95
- (a) You must give any other recipients of the Work or
96
- Derivative Works a copy of this License; and
97
-
98
- (b) You must cause any modified files to carry prominent notices
99
- stating that You changed the files; and
100
-
101
- (c) You must retain, in the Source form of any Derivative Works
102
- that You distribute, all copyright, patent, trademark, and
103
- attribution notices from the Source form of the Work,
104
- excluding those notices that do not pertain to any part of
105
- the Derivative Works; and
106
-
107
- (d) If the Work includes a "NOTICE" text file as part of its
108
- distribution, then any Derivative Works that You distribute must
109
- include a readable copy of the attribution notices contained
110
- within such NOTICE file, excluding those notices that do not
111
- pertain to any part of the Derivative Works, in at least one
112
- of the following places: within a NOTICE text file distributed
113
- as part of the Derivative Works; within the Source form or
114
- documentation, if provided along with the Derivative Works; or,
115
- within a display generated by the Derivative Works, if and
116
- wherever such third-party notices normally appear. The contents
117
- of the NOTICE file are for informational purposes only and
118
- do not modify the License. You may add Your own attribution
119
- notices within Derivative Works that You distribute, alongside
120
- or as an addendum to the NOTICE text from the Work, provided
121
- that such additional attribution notices cannot be construed
122
- as modifying the License.
123
-
124
- You may add Your own copyright statement to Your modifications and
125
- may provide additional or different license terms and conditions
126
- for use, reproduction, or distribution of Your modifications, or
127
- for any such Derivative Works as a whole, provided Your use,
128
- reproduction, and distribution of the Work otherwise complies with
129
- the conditions stated in this License.
130
-
131
- 5. Submission of Contributions. Unless You explicitly state otherwise,
132
- any Contribution intentionally submitted for inclusion in the Work
133
- by You to the Licensor shall be under the terms and conditions of
134
- this License, without any additional terms or conditions.
135
- Notwithstanding the above, nothing herein shall supersede or modify
136
- the terms of any separate license agreement you may have executed
137
- with Licensor regarding such Contributions.
138
-
139
- 6. Trademarks. This License does not grant permission to use the trade
140
- names, trademarks, service marks, or product names of the Licensor,
141
- except as required for reasonable and customary use in describing the
142
- origin of the Work and reproducing the content of the NOTICE file.
143
-
144
- 7. Disclaimer of Warranty. Unless required by applicable law or
145
- agreed to in writing, Licensor provides the Work (and each
146
- Contributor provides its Contributions) on an "AS IS" BASIS,
147
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
- implied, including, without limitation, any warranties or conditions
149
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
- PARTICULAR PURPOSE. You are solely responsible for determining the
151
- appropriateness of using or redistributing the Work and assume any
152
- risks associated with Your exercise of permissions under this License.
153
-
154
- 8. Limitation of Liability. In no event and under no legal theory,
155
- whether in tort (including negligence), contract, or otherwise,
156
- unless required by applicable law (such as deliberate and grossly
157
- negligent acts) or agreed to in writing, shall any Contributor be
158
- liable to You for damages, including any direct, indirect, special,
159
- incidental, or consequential damages of any character arising as a
160
- result of this License or out of the use or inability to use the
161
- Work (including but not limited to damages for loss of goodwill,
162
- work stoppage, computer failure or malfunction, or any and all
163
- other commercial damages or losses), even if such Contributor
164
- has been advised of the possibility of such damages.
165
-
166
- 9. Accepting Warranty or Additional Liability. While redistributing
167
- the Work or Derivative Works thereof, You may choose to offer,
168
- and charge a fee for, acceptance of support, warranty, indemnity,
169
- or other liability obligations and/or rights consistent with this
170
- License. However, in accepting such obligations, You may act only
171
- on Your own behalf and on Your sole responsibility, not on behalf
172
- of any other Contributor, and only if You agree to indemnify,
173
- defend, and hold each Contributor harmless for any liability
174
- incurred by, or claims asserted against, such Contributor by reason
175
- of your accepting any such warranty or additional liability.
176
-
177
- END OF TERMS AND CONDITIONS
178
-
179
- APPENDIX: How to apply the Apache License to your work.
180
-
181
- To apply the Apache License to your work, attach the following
182
- boilerplate notice, with the fields enclosed by brackets "[]"
183
- replaced with your own identifying information. (Don't include
184
- the brackets!) The text should be enclosed in the appropriate
185
- comment syntax for the file format. We also recommend that a
186
- file or class name and description of purpose be included on the
187
- same "printed page" as the copyright notice for easier
188
- identification within third-party archives.
189
-
190
- Copyright 2026 euthyna contributors
191
-
192
- Licensed under the Apache License, Version 2.0 (the "License");
193
- you may not use this file except in compliance with the License.
194
- You may obtain a copy of the License at
195
-
196
- http://www.apache.org/licenses/LICENSE-2.0
197
-
198
- Unless required by applicable law or agreed to in writing, software
199
- distributed under the License is distributed on an "AS IS" BASIS,
200
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
- See the License for the specific language governing permissions and
202
- limitations under the License.
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright 2026 euthyna contributors
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/README.md CHANGED
@@ -10,6 +10,8 @@
10
10
 
11
11
  <p align="center">
12
12
  <a href="https://github.com/slow-stack/euthyna/actions/workflows/ci.yml"><img src="https://github.com/slow-stack/euthyna/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
13
+ <a href="https://www.skills.sh/slow-stack/euthyna"><img src="https://skills.sh/b/slow-stack/euthyna.svg" alt="Agent skills installs"></a>
14
+ <a href="https://awesome-dsh-plugin.com/p/slow-stack/euthyna/"><img src="https://img.shields.io/badge/DSH%20plugin-listed-blue" alt="Listed in the awesome-dsh-plugin catalog"></a>
13
15
  </p>
14
16
 
15
17
  **euthyna is a code security audit framework for AI coding agents.** It is not another
@@ -93,13 +95,19 @@ the project is deliberately zero-dependency.
93
95
 
94
96
  | Host | The skill (audit discipline) | The CLI (fact producers) |
95
97
  |---|---|---|
96
- | **DSH** | Copy `.agents/skills/euthyna/` into `~/.agents/skills/` (user-wide) or `<project>/.agents/skills/`. Markdown hot-reloads; no restart needed. | `npm install -g euthyna` — runs in any terminal |
97
- | **Claude Code** | Copy the same folder into `~/.claude/skills/` | Same |
98
+ | **DSH** | `dsh plugin --profile web add euthyna` — the npm package mounts its own skill; or copy `.agents/skills/euthyna/` into `~/.agents/skills/` (user-wide) or `<project>/.agents/skills/`. Markdown hot-reloads; no restart needed. | `npm install -g euthyna` — runs in any terminal |
99
+ | **Claude Code** | `/plugin marketplace add slow-stack/euthyna` then `/plugin install euthyna@euthyna`, or copy `.agents/skills/euthyna/` into `~/.claude/skills/` | Same |
98
100
  | **Codex** | The same Markdown layer works; packaging goes through Codex's plugin/marketplace format | Same |
99
- | **Hermes** | Copy the same folder into `~/.hermes/skills/` under a category folder (Hermes reads the open skill standard; or install from a repo with `hermes skills install`) | Same |
100
- | **OpenCode** | Copy the same folder into `~/.agents/skills/` or `~/.config/opencode/skills/` (OpenCode loads both; unknown frontmatter fields are ignored) | Same |
101
+ | **Hermes** | Copy the same folder into `~/.hermes/skills/` under a category folder, or install from a repo with `hermes skills install` — and for the slash command, install the repo as a plugin (see below) | Same |
102
+ | **OpenCode** | Copy the same folder into `~/.agents/skills/` or `~/.config/opencode/skills/` (OpenCode loads both; unknown frontmatter fields are ignored). For a `/euthyna` slash command, copy `.opencode/commands/euthyna.md` into `~/.config/opencode/commands/` — it is a prompt template that tells the model to run the CLI | Same |
103
+ | **OpenClaw** | Copy the same folder into `~/.agents/skills/` (or `<workspace>/.agents/skills/`) — OpenClaw exposes every `user-invocable` skill as a slash command natively, so `/euthyna` works with no extra file | Same |
101
104
  | **Any terminal** | — | `npm install -g euthyna`, then `euthyna …` |
102
105
 
106
+ The skill ships in two languages. The directory above is the Chinese original (`euthyna`);
107
+ an English mirror lives at `.agents/skills/euthyna-en/` (skill name `euthyna-en`) — install
108
+ that one for an English-speaking agent, or translate the folder yourself. Both define the
109
+ same discipline, and `euthyna gate` accepts report markers in either language.
110
+
103
111
  Two honest notes:
104
112
 
105
113
  - **The skill is the instructions; the CLI is the measurement.** The skill directory
@@ -107,9 +115,47 @@ Two honest notes:
107
115
  keep this repository checked out; on a host without the CLI, the skill requires the
108
116
  unmeasurable criteria to be recorded as *not evaluated* rather than guessed at — that
109
117
  fallback is the design, not a gap.
110
- - **The skill text and the CLI's reports are currently written in Chinese.** The
111
- discipline is host-agnostic Markdown, but an English reader should expect Chinese
112
- output from the tool itself.
118
+ - **The CLI speaks Chinese by default, English on request.** Output is Chinese unless you
119
+ pass `--lang en` (any command) or set `EUTHYNA_LANG=en`; the default never changes for
120
+ existing users. The skill text and the CLI's reports exist in both languages — the
121
+ English reader should expect Chinese only from a run that did not ask for English.
122
+
123
+ ---
124
+
125
+ ## 🎯 First use
126
+
127
+ euthyna is **user-invoked, not auto-triggering**. The skill declares
128
+ `disable-model-invocation: true`, so the model will not load it on its own —
129
+ you have to ask for the audit explicitly. That is also how you tell it apart
130
+ from other security skills you may have installed: **if you did not name it,
131
+ it did not run.**
132
+
133
+ ### Triggering the audit
134
+
135
+ Say it plainly in conversation:
136
+
137
+ > 「用 euthyna 审计一下 `D:\some-project`,审完再交付」
138
+
139
+ The agent then loads the skill and runs the audit discipline: it produces the
140
+ deterministic facts (`history` / `coverage` / `deps`) first, walks every
141
+ suspect through the six gates, and writes a report file instead of only
142
+ replying in chat.
143
+
144
+ ### Slash commands
145
+
146
+ | Host | Command | Setup |
147
+ |---|---|---|
148
+ | Claude Code | `/euthyna <path>` | copy `.claude/commands/euthyna.md` from the package into `~/.claude/commands/` (user-wide) or `.claude/commands/` (project) |
149
+ | Codex | — | Codex's custom-prompt slash commands (`~/.codex/prompts/`) are deprecated upstream; the same Markdown can still be placed there manually |
150
+ | DSH | `/euthyna` | installed with the plugin; after a restart the command prints the usage manual (DSH slash commands run without reaching the model) |
151
+ | Hermes | `/euthyna <subcommand> <args…>` | install this repository as a Hermes plugin: `hermes plugins install slow-stack/euthyna` then `hermes plugins enable euthyna` (needs Node >= 20 on PATH; the repo root carries `plugin.yaml` + `__init__.py`). The command forwards to the CLI and prints its output without reaching the model. The skill itself can still be installed separately with `hermes skills install slow-stack/euthyna/.agents/skills/euthyna` |
152
+
153
+ ### How to tell it was euthyna that audited
154
+
155
+ - the report filename is `<PROJECT>_EUTHYNA_AUDIT_<YYYY-MM-DD>.md`
156
+ - verdicts use the three-state shape `BUG #N TRUE POSITIVE / FALSE POSITIVE / INCONCLUSIVE`
157
+ - every claim cites `path:L123` evidence and a reproduce command
158
+ - missing data is recorded as *not evaluated*, never as "clean"
113
159
 
114
160
  ---
115
161
 
@@ -129,7 +175,7 @@ From a checkout instead (development):
129
175
 
130
176
  ```sh
131
177
  git clone https://github.com/slow-stack/euthyna
132
- cd euthyna && npm test # 167 tests; no install step exists
178
+ cd euthyna && npm test # 178 tests; no install step exists
133
179
  node bin/euthyna.js history --repo <path> --base main --head HEAD
134
180
  ```
135
181
 
@@ -258,6 +304,7 @@ This project tries to be explicit about the difference. Current state:
258
304
  euthyna/
259
305
  ├── bin/ src/ test/ Fact producers (zero dependencies, Node >= 20)
260
306
  ├── .agents/skills/euthyna/ The audit discipline, as a portable skill
307
+ ├── plugin.yaml __init__.py Hermes plugin: the /euthyna slash command
261
308
  ├── bench/ Blind recall benchmark + results
262
309
  ├── docs/ Design notes and case studies (English and Chinese)
263
310
  ├── tools/ Research and verification scripts
package/__init__.py ADDED
@@ -0,0 +1,91 @@
1
+ """The Hermes half of euthyna: in-session slash commands driving the CLI.
2
+
3
+ The CLI (``bin/euthyna.js``, installed by ``npm install -g euthyna``) produces
4
+ the deterministic facts; this plugin registers ``/euthyna`` so a user can invoke
5
+ the four CLI subcommands from inside a Hermes session without leaving chat. The
6
+ handler shells out to the real CLI and returns its output verbatim — it does not
7
+ reimplement any measurement, and it injects nothing into the conversation.
8
+
9
+ Like the DSH slash command, this runs without reaching the model: whatever the
10
+ CLI prints comes back as the command result.
11
+
12
+ @module euthyna_hermes
13
+ """
14
+
15
+ import shutil
16
+ import subprocess
17
+
18
+ # Ponytail: one flat dict, not a command framework — there are exactly four
19
+ # subcommands and the CLI already owns usage/exit codes.
20
+ _USAGE = """euthyna slash command — usage:
21
+
22
+ /euthyna history <path> [<path> <rev>...] deleted-code provenance & security classification
23
+ /euthyna coverage <path> symbol invocation counts from a coverage run
24
+ /euthyna deps <path> dependency pinned versions from lockfiles
25
+ /euthyna gate <report> [--verify] validate an audit report against the six gates
26
+
27
+ Args after the subcommand are passed to the CLI unchanged. Requires the CLI:
28
+ npm install -g euthyna (Node >= 20)."""
29
+
30
+
31
+ def _find_cli():
32
+ """Return the absolute path of the euthyna CLI, or None if not installed."""
33
+ for name in ("euthyna", "euthyna.cmd", "euthyna.exe"):
34
+ found = shutil.which(name)
35
+ if found:
36
+ return found
37
+ return None
38
+
39
+
40
+ def _run(raw_args: str):
41
+ """Handle /euthyna: forward <subcommand> <args...> to the CLI, return its output."""
42
+ argv = raw_args.split()
43
+ if not argv or argv[0] in ("help", "-h", "--help"):
44
+ return _USAGE
45
+ sub, rest = argv[0], argv[1:]
46
+ if sub not in ("history", "coverage", "deps", "gate"):
47
+ return f"unknown subcommand: {sub}\n\n{_USAGE}"
48
+
49
+ cli = _find_cli()
50
+ if cli is None:
51
+ return ("euthyna CLI not found. Install it first:\n"
52
+ " npm install -g euthyna\n"
53
+ f"then retry /euthyna {sub} …")
54
+
55
+ # Text mode with explicit utf-8: the CLI reports are written in Chinese and
56
+ # Windows decode would otherwise land on the system codepage.
57
+ proc = subprocess.run(
58
+ [cli, sub, *rest],
59
+ capture_output=True,
60
+ text=True,
61
+ encoding="utf-8",
62
+ errors="replace",
63
+ )
64
+ out = (proc.stdout or "").strip()
65
+ err = (proc.stderr or "").strip()
66
+ # The CLI's exit-code contract (0/10/1/2) is part of the interface; keep it visible.
67
+ header = f"[euthyna {sub} → exit {proc.returncode}]"
68
+ return "\n".join(part for part in (header, out, err) if part)
69
+
70
+
71
+ def register(ctx):
72
+ """Wire /euthyna into the session command registry."""
73
+ ctx.register_command(
74
+ "euthyna",
75
+ handler=_run,
76
+ description="euthyna security audit: run history/coverage/deps/gate fact producers",
77
+ args_hint="<history|coverage|deps|gate> <args…>",
78
+ )
79
+
80
+
81
+ if __name__ == "__main__":
82
+ # Self-check, no Hermes needed: usage path, unknown-subcommand path, and a
83
+ # real CLI run when euthyna is on PATH (skipped when it is not).
84
+ result = _run("")
85
+ assert result == _USAGE, "empty args must print usage"
86
+ assert "unknown subcommand" in _run("bogus"), "unknown subcommand must be rejected"
87
+ cli = _find_cli()
88
+ if cli:
89
+ probe = _run("deps .")
90
+ assert probe.startswith("[euthyna deps"), f"unexpected probe output: {probe[:80]}"
91
+ print("self-check ok", f"(cli={'found' if cli else 'absent'})")
package/bin/euthyna.js CHANGED
@@ -8,6 +8,7 @@
8
8
  import process from 'node:process';
9
9
  import { main } from '../src/cli.js';
10
10
  import { safeTextLines } from '../src/contract.js';
11
+ import { resolveLang } from '../src/lang.js';
11
12
 
12
13
  try {
13
14
  process.exitCode = await main(process.argv.slice(2));
@@ -18,8 +19,17 @@ try {
18
19
  // stderr boundary: an error message inherits repo-controlled text (git embeds
19
20
  // filenames and refs in its stderr), so the stack is made terminal-safe at
20
21
  // this write, exactly once, like the report channel at its render boundary.
21
- process.stderr.write(
22
- safeTextLines(`euthyna: 测量过程抛出异常,结果不可用\n${error?.stack ?? error}\n`)
23
- );
22
+ //
23
+ // The language for this line is read from the environment and a bare --lang
24
+ // scan of argv: main() has already consumed --lang by the time a throw
25
+ // reaches here, so this entry point re-reads it from the raw arguments.
26
+ const argv = process.argv.slice(2);
27
+ const langIndex = argv.indexOf('--lang');
28
+ const lang = resolveLang({ flag: langIndex >= 0 ? argv[langIndex + 1] : undefined });
29
+ const headline =
30
+ lang === 'en'
31
+ ? 'euthyna: measurement threw an exception; the result is unusable'
32
+ : 'euthyna: 测量过程抛出异常,结果不可用';
33
+ process.stderr.write(safeTextLines(`${headline}\n${error?.stack ?? error}\n`));
24
34
  process.exitCode = 2;
25
35
  }
@@ -0,0 +1,4 @@
1
+ # dsh bundle patch: inserts the euthyna skill provider into a profile's layer stack.
2
+ - insert:
3
+ - id: euthyna
4
+ name: 'euthyna'