lyingdocs 0.1.3__tar.gz → 0.1.4__tar.gz
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.
- {lyingdocs-0.1.3 → lyingdocs-0.1.4}/PKG-INFO +25 -206
- {lyingdocs-0.1.3 → lyingdocs-0.1.4}/README.md +23 -205
- {lyingdocs-0.1.3 → lyingdocs-0.1.4}/lyingdocs/argus_local.py +5 -2
- {lyingdocs-0.1.3 → lyingdocs-0.1.4}/lyingdocs/cli.py +90 -0
- {lyingdocs-0.1.3 → lyingdocs-0.1.4}/lyingdocs/config.py +35 -0
- {lyingdocs-0.1.3 → lyingdocs-0.1.4}/lyingdocs/hermes_agent.py +14 -6
- lyingdocs-0.1.4/lyingdocs/init_ci.py +357 -0
- lyingdocs-0.1.4/lyingdocs/llm.py +341 -0
- {lyingdocs-0.1.3 → lyingdocs-0.1.4}/pyproject.toml +2 -1
- lyingdocs-0.1.3/lyingdocs/llm.py +0 -94
- {lyingdocs-0.1.3 → lyingdocs-0.1.4}/.gitignore +0 -0
- {lyingdocs-0.1.3 → lyingdocs-0.1.4}/LICENSE +0 -0
- {lyingdocs-0.1.3 → lyingdocs-0.1.4}/lyingdocs/__init__.py +0 -0
- {lyingdocs-0.1.3 → lyingdocs-0.1.4}/lyingdocs/__main__.py +0 -0
- {lyingdocs-0.1.3 → lyingdocs-0.1.4}/lyingdocs/argus.py +0 -0
- {lyingdocs-0.1.3 → lyingdocs-0.1.4}/lyingdocs/argus_claude_code.py +0 -0
- {lyingdocs-0.1.3 → lyingdocs-0.1.4}/lyingdocs/codex.py +0 -0
- {lyingdocs-0.1.3 → lyingdocs-0.1.4}/lyingdocs/doctree.py +0 -0
- {lyingdocs-0.1.3 → lyingdocs-0.1.4}/lyingdocs/prompts/agent_system.txt +0 -0
- {lyingdocs-0.1.3 → lyingdocs-0.1.4}/lyingdocs/prompts/argus_local_system.txt +0 -0
- {lyingdocs-0.1.3 → lyingdocs-0.1.4}/lyingdocs/prompts/codex_task.txt +0 -0
- {lyingdocs-0.1.3 → lyingdocs-0.1.4}/lyingdocs/prompts/issue_generator.txt +0 -0
- {lyingdocs-0.1.3 → lyingdocs-0.1.4}/lyingdocs/prompts/report_synthesis.txt +0 -0
- {lyingdocs-0.1.3 → lyingdocs-0.1.4}/lyingdocs/tools.py +0 -0
- {lyingdocs-0.1.3 → lyingdocs-0.1.4}/lyingdocs/workspace.py +0 -0
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: lyingdocs
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.4
|
|
4
4
|
Summary: Autonomous documentation-code misalignment detection using LLM agents
|
|
5
5
|
License-Expression: MIT
|
|
6
6
|
License-File: LICENSE
|
|
7
7
|
Requires-Python: >=3.11
|
|
8
|
+
Requires-Dist: anthropic>=0.40
|
|
8
9
|
Requires-Dist: openai>=1.0
|
|
9
10
|
Requires-Dist: python-dotenv>=1.0
|
|
10
11
|
Provides-Extra: dev
|
|
@@ -157,6 +158,18 @@ This performs a full audit of your repository and produces a report describing w
|
|
|
157
158
|
|
|
158
159
|
---
|
|
159
160
|
|
|
161
|
+
## Documentation
|
|
162
|
+
|
|
163
|
+
| | |
|
|
164
|
+
| --- | --- |
|
|
165
|
+
| [Configuration](docs/configuration.md) | Config file schema, environment variables, layer resolution |
|
|
166
|
+
| [Argus Backends](docs/backends.md) | Setup for `local`, `codex`, and `claude_code` |
|
|
167
|
+
| [CLI Reference](docs/cli.md) | All flags, commands, and output artifacts |
|
|
168
|
+
| [GitHub Actions](docs/guides/github-actions.md) | CI integration, authentication, triggers, and approval gates |
|
|
169
|
+
| [GitHub Issues](docs/guides/github-issues.md) | Using `--gen-issue` to draft and post issues |
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
160
173
|
## Example use cases
|
|
161
174
|
|
|
162
175
|
Use LyingDocs when you want to answer questions like:
|
|
@@ -183,218 +196,24 @@ These categories represent different ways repository trust breaks down.
|
|
|
183
196
|
|
|
184
197
|
---
|
|
185
198
|
|
|
186
|
-
##
|
|
187
|
-
|
|
188
|
-
LyingDocs loads configuration from multiple sources, with later sources overriding earlier ones:
|
|
189
|
-
|
|
190
|
-
1. **Built-in defaults** (OpenAI API, gpt-5.4)
|
|
191
|
-
2. **Config file** — `lyingdocs.toml` in project root, or `~/.config/lyingdocs/config.toml`
|
|
192
|
-
3. **Environment variables** / `.env`
|
|
193
|
-
4. **CLI arguments**
|
|
194
|
-
|
|
195
|
-
Hermes and Argus are configured independently, so you can use:
|
|
196
|
-
|
|
197
|
-
* a cheaper planning model for Hermes
|
|
198
|
-
* a stronger coding / investigation model for Argus
|
|
199
|
-
* different providers or endpoints for each agent
|
|
200
|
-
|
|
201
|
-
### Config file example
|
|
202
|
-
|
|
203
|
-
Example configs live in [tests/configs](https://github.com/KMing-L/lying-docs/tree/main/tests/configs).
|
|
204
|
-
|
|
205
|
-
```toml
|
|
206
|
-
[hermes]
|
|
207
|
-
model = "gpt-5.4"
|
|
208
|
-
base_url = "https://api.openai.com/v1"
|
|
209
|
-
# api_key_env = "OPENAI_API_KEY" # optional — defaults to OPENAI_API_KEY
|
|
210
|
-
|
|
211
|
-
[argus]
|
|
212
|
-
backend = "local" # "codex" | "claude_code" | "local"
|
|
213
|
-
model = "gpt-5.4"
|
|
214
|
-
base_url = "https://api.openai.com/v1"
|
|
215
|
-
# api_key_env = "OPENAI_API_KEY"
|
|
216
|
-
|
|
217
|
-
# Only read when argus.backend = "codex"
|
|
218
|
-
[argus.codex]
|
|
219
|
-
provider = "openai"
|
|
220
|
-
wire_api = "responses"
|
|
221
|
-
# path = "/usr/local/bin/codex" # optional: explicit codex binary path
|
|
222
|
-
|
|
223
|
-
# Only read when argus.backend = "claude_code"
|
|
224
|
-
[argus.claude_code]
|
|
225
|
-
# path = "/usr/local/bin/claude" # optional: explicit claude binary path
|
|
226
|
-
|
|
227
|
-
# Only read when argus.backend = "local"
|
|
228
|
-
[argus.local]
|
|
229
|
-
max_iterations = 25 # per-task agent loop cap
|
|
230
|
-
max_read_bytes = 200000 # per read_file call
|
|
231
|
-
|
|
232
|
-
[limits]
|
|
233
|
-
max_dispatches = 20 # max Argus dispatches per Hermes run
|
|
234
|
-
max_iterations = 50 # max Hermes loop iterations
|
|
235
|
-
argus_task_timeout = 1200 # seconds per Argus task (codex / claude_code backends)
|
|
236
|
-
token_budget = 524288 # Hermes context budget before compression
|
|
237
|
-
```
|
|
238
|
-
|
|
239
|
-
### Environment variables
|
|
240
|
-
|
|
241
|
-
| Variable | Description |
|
|
242
|
-
| ------------------------ | ---------------------------------------------- |
|
|
243
|
-
| `OPENAI_API_KEY` | Required unless overridden via `api_key_env` |
|
|
244
|
-
| `HERMES_MODEL` | Hermes model name |
|
|
245
|
-
| `HERMES_BASE_URL` | Hermes API base URL |
|
|
246
|
-
| `ARGUS_BACKEND` | `codex`, `claude_code`, or `local` |
|
|
247
|
-
| `ARGUS_MODEL` | Argus model name |
|
|
248
|
-
| `ARGUS_BASE_URL` | Argus API base URL |
|
|
249
|
-
| `ARGUS_CODEX_PROVIDER` | Codex backend provider |
|
|
250
|
-
| `ARGUS_CODEX_WIRE_API` | Codex backend wire API (`responses` or `chat`) |
|
|
251
|
-
| `ARGUS_CODEX_PATH` | Explicit path to `codex` |
|
|
252
|
-
| `ARGUS_CLAUDE_CODE_PATH` | Explicit path to `claude` |
|
|
253
|
-
| `ARGUS_TASK_TIMEOUT` | Timeout per Argus task in seconds |
|
|
254
|
-
| `TOKEN_BUDGET` | Hermes context budget before compression |
|
|
255
|
-
|
|
256
|
-
---
|
|
257
|
-
|
|
258
|
-
## Argus backends
|
|
259
|
-
|
|
260
|
-
Argus is the deep code analysis side of the system.
|
|
261
|
-
|
|
262
|
-
### `local`
|
|
263
|
-
|
|
264
|
-
No external CLI required.
|
|
265
|
-
Uses a built-in agent loop with filesystem tools and an OpenAI-compatible API.
|
|
266
|
-
|
|
267
|
-
Good default for getting started.
|
|
268
|
-
|
|
269
|
-
```toml
|
|
270
|
-
[argus]
|
|
271
|
-
backend = "local"
|
|
272
|
-
model = "gpt-5.4"
|
|
273
|
-
base_url = "https://api.openai.com/v1"
|
|
274
|
-
```
|
|
275
|
-
|
|
276
|
-
### `codex`
|
|
277
|
-
|
|
278
|
-
Uses [OpenAI Codex CLI](https://github.com/openai/codex).
|
|
279
|
-
|
|
280
|
-
```bash
|
|
281
|
-
npm install -g @openai/codex
|
|
282
|
-
```
|
|
283
|
-
|
|
284
|
-
```toml
|
|
285
|
-
[argus]
|
|
286
|
-
backend = "codex"
|
|
287
|
-
|
|
288
|
-
[argus.codex]
|
|
289
|
-
provider = "openai"
|
|
290
|
-
wire_api = "responses"
|
|
291
|
-
```
|
|
292
|
-
|
|
293
|
-
Resolution order:
|
|
294
|
-
|
|
295
|
-
1. explicit path from config
|
|
296
|
-
2. system `PATH`
|
|
297
|
-
3. local `node_modules/.bin/codex`
|
|
298
|
-
|
|
299
|
-
### `claude_code`
|
|
300
|
-
|
|
301
|
-
Uses [Claude Code](https://docs.anthropic.com/claude/docs/claude-code).
|
|
302
|
-
|
|
303
|
-
```toml
|
|
304
|
-
[argus]
|
|
305
|
-
backend = "claude_code"
|
|
306
|
-
model = "claude-sonnet-4-6"
|
|
307
|
-
|
|
308
|
-
[argus.claude_code]
|
|
309
|
-
# path = "/usr/local/bin/claude"
|
|
310
|
-
```
|
|
311
|
-
|
|
312
|
-
Invoked as:
|
|
313
|
-
|
|
314
|
-
```bash
|
|
315
|
-
claude -p <prompt> --model <argus_model> --output-format text
|
|
316
|
-
```
|
|
317
|
-
|
|
318
|
-
with `cwd` set to your code root.
|
|
319
|
-
|
|
320
|
-
---
|
|
321
|
-
|
|
322
|
-
## CLI reference
|
|
323
|
-
|
|
324
|
-
```bash
|
|
325
|
-
# Full analysis
|
|
326
|
-
lyingdocs analyze --doc-path docs/ --code-path . -o output/audit
|
|
327
|
-
|
|
328
|
-
# Choose Argus backend
|
|
329
|
-
lyingdocs analyze --doc-path docs/ --code-path . --argus-backend=local
|
|
199
|
+
## GitHub Actions
|
|
330
200
|
|
|
331
|
-
|
|
332
|
-
lyingdocs analyze --doc-path docs/ --code-path . \
|
|
333
|
-
--hermes-model gpt-5.4 \
|
|
334
|
-
--argus-model gpt-5.4
|
|
335
|
-
|
|
336
|
-
# Resume interrupted analysis
|
|
337
|
-
lyingdocs analyze --doc-path docs/ --code-path . --resume
|
|
338
|
-
|
|
339
|
-
# Use an explicit config file
|
|
340
|
-
lyingdocs analyze --doc-path docs/ --code-path . --config myconfig.toml
|
|
341
|
-
|
|
342
|
-
# Generate GitHub issue drafts
|
|
343
|
-
lyingdocs analyze --doc-path docs/ --code-path . --gen-issue
|
|
344
|
-
|
|
345
|
-
# Show version
|
|
346
|
-
lyingdocs version
|
|
347
|
-
```
|
|
348
|
-
|
|
349
|
-
Available flags:
|
|
350
|
-
|
|
351
|
-
`--hermes-model`, `--hermes-base-url`, `--argus-backend {codex,claude_code,local}`, `--argus-model`, `--argus-base-url`, `--argus-codex-provider`, `--argus-codex-wire-api`, `--max-dispatches`, `--max-iterations`, `--config`, `--resume`, `--gen-issue`
|
|
352
|
-
|
|
353
|
-
---
|
|
354
|
-
|
|
355
|
-
## Generating GitHub issue drafts
|
|
356
|
-
|
|
357
|
-
Pass `--gen-issue` to automatically draft a GitHub issue after analysis:
|
|
201
|
+
LyingDocs runs natively in GitHub Actions as a trust gate for your CI pipeline.
|
|
358
202
|
|
|
359
203
|
```bash
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
LyingDocs uses Hermes to synthesize findings into a single, polite GitHub issue and saves it to `issue.json` in the output directory.
|
|
364
|
-
|
|
365
|
-
The file contains:
|
|
366
|
-
|
|
367
|
-
* **`title`** — a short issue title
|
|
368
|
-
* **`body`** — a GitHub-flavored Markdown issue body listing findings, code references, doc references, and a note acknowledging possible false positives
|
|
369
|
-
|
|
370
|
-
You can post it directly with the [`gh` CLI](https://cli.github.com/):
|
|
371
|
-
|
|
372
|
-
```bash
|
|
373
|
-
gh issue create \
|
|
374
|
-
--title "$(jq -r '.title' output/issue.json)" \
|
|
375
|
-
--body "$(jq -r '.body' output/issue.json)"
|
|
204
|
+
pip install lyingdocs
|
|
205
|
+
lyingdocs init-ci --doc-path docs/ --backend claude_code --claude-oauth --trigger tag,manual
|
|
376
206
|
```
|
|
377
207
|
|
|
378
|
-
This
|
|
379
|
-
|
|
380
|
-
---
|
|
381
|
-
|
|
382
|
-
## GitHub Actions direction
|
|
383
|
-
|
|
384
|
-
LyingDocs is moving toward a natural next step:
|
|
385
|
-
|
|
386
|
-
**continuous trust enforcement inside GitHub Actions**
|
|
208
|
+
This generates a workflow that:
|
|
387
209
|
|
|
388
|
-
|
|
389
|
-
|
|
210
|
+
* audits docs-vs-code alignment on every tag push (or on demand)
|
|
211
|
+
* posts findings as a PR comment
|
|
212
|
+
* optionally requires manual approval before merging
|
|
390
213
|
|
|
391
|
-
|
|
392
|
-
* comment on suspicious docs/code drift
|
|
393
|
-
* warn maintainers before release
|
|
394
|
-
* surface trust regressions early
|
|
395
|
-
* make repository truthfulness part of CI
|
|
214
|
+
Supports all three backends (`local`, `codex`, `claude_code`) and both API key and OAuth token authentication for Claude Code.
|
|
396
215
|
|
|
397
|
-
|
|
216
|
+
See the [full setup guide](docs/guides/github-actions.md) for trigger options, approval gates, and backend configuration.
|
|
398
217
|
|
|
399
218
|
---
|
|
400
219
|
|
|
@@ -402,7 +221,7 @@ That is where LyingDocs becomes most valuable: not only as an analyzer, but as i
|
|
|
402
221
|
|
|
403
222
|
* [x] **Multi-harness support** — Argus runs on Codex, Claude Code, or a built-in local agent
|
|
404
223
|
* [x] **Issue generation** — `--gen-issue` drafts GitHub issues from findings
|
|
405
|
-
* [
|
|
224
|
+
* [x] **GitHub Action integration** — `lyingdocs init-ci` generates a ready-to-use workflow with configurable triggers, backend selection, PR comments, and manual approval gates
|
|
406
225
|
* [ ] **One-session memory support** — Argus backends retain state across tasks for deeper multi-step investigations
|
|
407
226
|
* [ ] **Deeper analysis** — multi-hop reasoning across doc hierarchies and version-aware diffing to detect when code changed but docs did not
|
|
408
227
|
* [ ] **Paper mode** — treat academic papers as documentation and detect paper-to-code misalignment
|
|
@@ -142,6 +142,18 @@ This performs a full audit of your repository and produces a report describing w
|
|
|
142
142
|
|
|
143
143
|
---
|
|
144
144
|
|
|
145
|
+
## Documentation
|
|
146
|
+
|
|
147
|
+
| | |
|
|
148
|
+
| --- | --- |
|
|
149
|
+
| [Configuration](docs/configuration.md) | Config file schema, environment variables, layer resolution |
|
|
150
|
+
| [Argus Backends](docs/backends.md) | Setup for `local`, `codex`, and `claude_code` |
|
|
151
|
+
| [CLI Reference](docs/cli.md) | All flags, commands, and output artifacts |
|
|
152
|
+
| [GitHub Actions](docs/guides/github-actions.md) | CI integration, authentication, triggers, and approval gates |
|
|
153
|
+
| [GitHub Issues](docs/guides/github-issues.md) | Using `--gen-issue` to draft and post issues |
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
145
157
|
## Example use cases
|
|
146
158
|
|
|
147
159
|
Use LyingDocs when you want to answer questions like:
|
|
@@ -168,218 +180,24 @@ These categories represent different ways repository trust breaks down.
|
|
|
168
180
|
|
|
169
181
|
---
|
|
170
182
|
|
|
171
|
-
##
|
|
172
|
-
|
|
173
|
-
LyingDocs loads configuration from multiple sources, with later sources overriding earlier ones:
|
|
174
|
-
|
|
175
|
-
1. **Built-in defaults** (OpenAI API, gpt-5.4)
|
|
176
|
-
2. **Config file** — `lyingdocs.toml` in project root, or `~/.config/lyingdocs/config.toml`
|
|
177
|
-
3. **Environment variables** / `.env`
|
|
178
|
-
4. **CLI arguments**
|
|
179
|
-
|
|
180
|
-
Hermes and Argus are configured independently, so you can use:
|
|
181
|
-
|
|
182
|
-
* a cheaper planning model for Hermes
|
|
183
|
-
* a stronger coding / investigation model for Argus
|
|
184
|
-
* different providers or endpoints for each agent
|
|
185
|
-
|
|
186
|
-
### Config file example
|
|
187
|
-
|
|
188
|
-
Example configs live in [tests/configs](https://github.com/KMing-L/lying-docs/tree/main/tests/configs).
|
|
189
|
-
|
|
190
|
-
```toml
|
|
191
|
-
[hermes]
|
|
192
|
-
model = "gpt-5.4"
|
|
193
|
-
base_url = "https://api.openai.com/v1"
|
|
194
|
-
# api_key_env = "OPENAI_API_KEY" # optional — defaults to OPENAI_API_KEY
|
|
195
|
-
|
|
196
|
-
[argus]
|
|
197
|
-
backend = "local" # "codex" | "claude_code" | "local"
|
|
198
|
-
model = "gpt-5.4"
|
|
199
|
-
base_url = "https://api.openai.com/v1"
|
|
200
|
-
# api_key_env = "OPENAI_API_KEY"
|
|
201
|
-
|
|
202
|
-
# Only read when argus.backend = "codex"
|
|
203
|
-
[argus.codex]
|
|
204
|
-
provider = "openai"
|
|
205
|
-
wire_api = "responses"
|
|
206
|
-
# path = "/usr/local/bin/codex" # optional: explicit codex binary path
|
|
207
|
-
|
|
208
|
-
# Only read when argus.backend = "claude_code"
|
|
209
|
-
[argus.claude_code]
|
|
210
|
-
# path = "/usr/local/bin/claude" # optional: explicit claude binary path
|
|
211
|
-
|
|
212
|
-
# Only read when argus.backend = "local"
|
|
213
|
-
[argus.local]
|
|
214
|
-
max_iterations = 25 # per-task agent loop cap
|
|
215
|
-
max_read_bytes = 200000 # per read_file call
|
|
216
|
-
|
|
217
|
-
[limits]
|
|
218
|
-
max_dispatches = 20 # max Argus dispatches per Hermes run
|
|
219
|
-
max_iterations = 50 # max Hermes loop iterations
|
|
220
|
-
argus_task_timeout = 1200 # seconds per Argus task (codex / claude_code backends)
|
|
221
|
-
token_budget = 524288 # Hermes context budget before compression
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
### Environment variables
|
|
225
|
-
|
|
226
|
-
| Variable | Description |
|
|
227
|
-
| ------------------------ | ---------------------------------------------- |
|
|
228
|
-
| `OPENAI_API_KEY` | Required unless overridden via `api_key_env` |
|
|
229
|
-
| `HERMES_MODEL` | Hermes model name |
|
|
230
|
-
| `HERMES_BASE_URL` | Hermes API base URL |
|
|
231
|
-
| `ARGUS_BACKEND` | `codex`, `claude_code`, or `local` |
|
|
232
|
-
| `ARGUS_MODEL` | Argus model name |
|
|
233
|
-
| `ARGUS_BASE_URL` | Argus API base URL |
|
|
234
|
-
| `ARGUS_CODEX_PROVIDER` | Codex backend provider |
|
|
235
|
-
| `ARGUS_CODEX_WIRE_API` | Codex backend wire API (`responses` or `chat`) |
|
|
236
|
-
| `ARGUS_CODEX_PATH` | Explicit path to `codex` |
|
|
237
|
-
| `ARGUS_CLAUDE_CODE_PATH` | Explicit path to `claude` |
|
|
238
|
-
| `ARGUS_TASK_TIMEOUT` | Timeout per Argus task in seconds |
|
|
239
|
-
| `TOKEN_BUDGET` | Hermes context budget before compression |
|
|
240
|
-
|
|
241
|
-
---
|
|
242
|
-
|
|
243
|
-
## Argus backends
|
|
244
|
-
|
|
245
|
-
Argus is the deep code analysis side of the system.
|
|
246
|
-
|
|
247
|
-
### `local`
|
|
248
|
-
|
|
249
|
-
No external CLI required.
|
|
250
|
-
Uses a built-in agent loop with filesystem tools and an OpenAI-compatible API.
|
|
251
|
-
|
|
252
|
-
Good default for getting started.
|
|
253
|
-
|
|
254
|
-
```toml
|
|
255
|
-
[argus]
|
|
256
|
-
backend = "local"
|
|
257
|
-
model = "gpt-5.4"
|
|
258
|
-
base_url = "https://api.openai.com/v1"
|
|
259
|
-
```
|
|
260
|
-
|
|
261
|
-
### `codex`
|
|
262
|
-
|
|
263
|
-
Uses [OpenAI Codex CLI](https://github.com/openai/codex).
|
|
264
|
-
|
|
265
|
-
```bash
|
|
266
|
-
npm install -g @openai/codex
|
|
267
|
-
```
|
|
268
|
-
|
|
269
|
-
```toml
|
|
270
|
-
[argus]
|
|
271
|
-
backend = "codex"
|
|
272
|
-
|
|
273
|
-
[argus.codex]
|
|
274
|
-
provider = "openai"
|
|
275
|
-
wire_api = "responses"
|
|
276
|
-
```
|
|
277
|
-
|
|
278
|
-
Resolution order:
|
|
279
|
-
|
|
280
|
-
1. explicit path from config
|
|
281
|
-
2. system `PATH`
|
|
282
|
-
3. local `node_modules/.bin/codex`
|
|
283
|
-
|
|
284
|
-
### `claude_code`
|
|
285
|
-
|
|
286
|
-
Uses [Claude Code](https://docs.anthropic.com/claude/docs/claude-code).
|
|
287
|
-
|
|
288
|
-
```toml
|
|
289
|
-
[argus]
|
|
290
|
-
backend = "claude_code"
|
|
291
|
-
model = "claude-sonnet-4-6"
|
|
292
|
-
|
|
293
|
-
[argus.claude_code]
|
|
294
|
-
# path = "/usr/local/bin/claude"
|
|
295
|
-
```
|
|
296
|
-
|
|
297
|
-
Invoked as:
|
|
298
|
-
|
|
299
|
-
```bash
|
|
300
|
-
claude -p <prompt> --model <argus_model> --output-format text
|
|
301
|
-
```
|
|
302
|
-
|
|
303
|
-
with `cwd` set to your code root.
|
|
304
|
-
|
|
305
|
-
---
|
|
306
|
-
|
|
307
|
-
## CLI reference
|
|
308
|
-
|
|
309
|
-
```bash
|
|
310
|
-
# Full analysis
|
|
311
|
-
lyingdocs analyze --doc-path docs/ --code-path . -o output/audit
|
|
312
|
-
|
|
313
|
-
# Choose Argus backend
|
|
314
|
-
lyingdocs analyze --doc-path docs/ --code-path . --argus-backend=local
|
|
183
|
+
## GitHub Actions
|
|
315
184
|
|
|
316
|
-
|
|
317
|
-
lyingdocs analyze --doc-path docs/ --code-path . \
|
|
318
|
-
--hermes-model gpt-5.4 \
|
|
319
|
-
--argus-model gpt-5.4
|
|
320
|
-
|
|
321
|
-
# Resume interrupted analysis
|
|
322
|
-
lyingdocs analyze --doc-path docs/ --code-path . --resume
|
|
323
|
-
|
|
324
|
-
# Use an explicit config file
|
|
325
|
-
lyingdocs analyze --doc-path docs/ --code-path . --config myconfig.toml
|
|
326
|
-
|
|
327
|
-
# Generate GitHub issue drafts
|
|
328
|
-
lyingdocs analyze --doc-path docs/ --code-path . --gen-issue
|
|
329
|
-
|
|
330
|
-
# Show version
|
|
331
|
-
lyingdocs version
|
|
332
|
-
```
|
|
333
|
-
|
|
334
|
-
Available flags:
|
|
335
|
-
|
|
336
|
-
`--hermes-model`, `--hermes-base-url`, `--argus-backend {codex,claude_code,local}`, `--argus-model`, `--argus-base-url`, `--argus-codex-provider`, `--argus-codex-wire-api`, `--max-dispatches`, `--max-iterations`, `--config`, `--resume`, `--gen-issue`
|
|
337
|
-
|
|
338
|
-
---
|
|
339
|
-
|
|
340
|
-
## Generating GitHub issue drafts
|
|
341
|
-
|
|
342
|
-
Pass `--gen-issue` to automatically draft a GitHub issue after analysis:
|
|
185
|
+
LyingDocs runs natively in GitHub Actions as a trust gate for your CI pipeline.
|
|
343
186
|
|
|
344
187
|
```bash
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
LyingDocs uses Hermes to synthesize findings into a single, polite GitHub issue and saves it to `issue.json` in the output directory.
|
|
349
|
-
|
|
350
|
-
The file contains:
|
|
351
|
-
|
|
352
|
-
* **`title`** — a short issue title
|
|
353
|
-
* **`body`** — a GitHub-flavored Markdown issue body listing findings, code references, doc references, and a note acknowledging possible false positives
|
|
354
|
-
|
|
355
|
-
You can post it directly with the [`gh` CLI](https://cli.github.com/):
|
|
356
|
-
|
|
357
|
-
```bash
|
|
358
|
-
gh issue create \
|
|
359
|
-
--title "$(jq -r '.title' output/issue.json)" \
|
|
360
|
-
--body "$(jq -r '.body' output/issue.json)"
|
|
188
|
+
pip install lyingdocs
|
|
189
|
+
lyingdocs init-ci --doc-path docs/ --backend claude_code --claude-oauth --trigger tag,manual
|
|
361
190
|
```
|
|
362
191
|
|
|
363
|
-
This
|
|
364
|
-
|
|
365
|
-
---
|
|
366
|
-
|
|
367
|
-
## GitHub Actions direction
|
|
368
|
-
|
|
369
|
-
LyingDocs is moving toward a natural next step:
|
|
370
|
-
|
|
371
|
-
**continuous trust enforcement inside GitHub Actions**
|
|
192
|
+
This generates a workflow that:
|
|
372
193
|
|
|
373
|
-
|
|
374
|
-
|
|
194
|
+
* audits docs-vs-code alignment on every tag push (or on demand)
|
|
195
|
+
* posts findings as a PR comment
|
|
196
|
+
* optionally requires manual approval before merging
|
|
375
197
|
|
|
376
|
-
|
|
377
|
-
* comment on suspicious docs/code drift
|
|
378
|
-
* warn maintainers before release
|
|
379
|
-
* surface trust regressions early
|
|
380
|
-
* make repository truthfulness part of CI
|
|
198
|
+
Supports all three backends (`local`, `codex`, `claude_code`) and both API key and OAuth token authentication for Claude Code.
|
|
381
199
|
|
|
382
|
-
|
|
200
|
+
See the [full setup guide](docs/guides/github-actions.md) for trigger options, approval gates, and backend configuration.
|
|
383
201
|
|
|
384
202
|
---
|
|
385
203
|
|
|
@@ -387,7 +205,7 @@ That is where LyingDocs becomes most valuable: not only as an analyzer, but as i
|
|
|
387
205
|
|
|
388
206
|
* [x] **Multi-harness support** — Argus runs on Codex, Claude Code, or a built-in local agent
|
|
389
207
|
* [x] **Issue generation** — `--gen-issue` drafts GitHub issues from findings
|
|
390
|
-
* [
|
|
208
|
+
* [x] **GitHub Action integration** — `lyingdocs init-ci` generates a ready-to-use workflow with configurable triggers, backend selection, PR comments, and manual approval gates
|
|
391
209
|
* [ ] **One-session memory support** — Argus backends retain state across tasks for deeper multi-step investigations
|
|
392
210
|
* [ ] **Deeper analysis** — multi-hop reasoning across doc hierarchies and version-aware diffing to detect when code changed but docs did not
|
|
393
211
|
* [ ] **Paper mode** — treat academic papers as documentation and detect paper-to-code misalignment
|
|
@@ -9,7 +9,7 @@ import logging
|
|
|
9
9
|
import re
|
|
10
10
|
from pathlib import Path
|
|
11
11
|
|
|
12
|
-
from .llm import call_llm_with_tools, make_client
|
|
12
|
+
from .llm import LLMResponse, call_llm_with_tools, make_client
|
|
13
13
|
|
|
14
14
|
logger = logging.getLogger("lyingdocs")
|
|
15
15
|
|
|
@@ -126,9 +126,11 @@ class LocalArgus:
|
|
|
126
126
|
def __init__(self, config: dict, code_path: Path):
|
|
127
127
|
self.config = config
|
|
128
128
|
self.code_root = code_path.resolve()
|
|
129
|
+
self.provider = config.get("argus_provider", "openai")
|
|
129
130
|
self.client = make_client(
|
|
130
131
|
api_key=config["argus_api_key"],
|
|
131
132
|
base_url=config["argus_base_url"],
|
|
133
|
+
provider=self.provider,
|
|
132
134
|
)
|
|
133
135
|
self.model = config["argus_model"]
|
|
134
136
|
self.max_iterations = int(config.get("argus_local_max_iterations", 25))
|
|
@@ -149,7 +151,8 @@ class LocalArgus:
|
|
|
149
151
|
for iteration in range(1, self.max_iterations + 1):
|
|
150
152
|
logger.info(" Argus(local) iter %d/%d", iteration, self.max_iterations)
|
|
151
153
|
response = call_llm_with_tools(
|
|
152
|
-
self.client, self.model, messages, ARGUS_LOCAL_TOOL_SCHEMAS
|
|
154
|
+
self.client, self.model, messages, ARGUS_LOCAL_TOOL_SCHEMAS,
|
|
155
|
+
provider=self.provider,
|
|
153
156
|
)
|
|
154
157
|
messages.append(self._response_to_message(response))
|
|
155
158
|
|
|
@@ -159,6 +159,96 @@ examples:
|
|
|
159
159
|
)
|
|
160
160
|
analyze_parser.set_defaults(func=cmd_analyze)
|
|
161
161
|
|
|
162
|
+
# -- init-ci subcommand --
|
|
163
|
+
init_ci_parser = subparsers.add_parser(
|
|
164
|
+
"init-ci",
|
|
165
|
+
help="Generate a GitHub Actions workflow for LyingDocs CI",
|
|
166
|
+
formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
167
|
+
epilog="""\
|
|
168
|
+
examples:
|
|
169
|
+
lyingdocs init-ci --doc-path docs/ --code-path .
|
|
170
|
+
lyingdocs init-ci --doc-path docs/ --backend claude_code --trigger tag
|
|
171
|
+
lyingdocs init-ci --doc-path docs/ --trigger pr,tag --approval
|
|
172
|
+
lyingdocs init-ci --doc-path docs/ --trigger tag,manual -o .
|
|
173
|
+
""",
|
|
174
|
+
)
|
|
175
|
+
init_ci_parser.add_argument(
|
|
176
|
+
"--doc-path", default="docs/",
|
|
177
|
+
help="Documentation root directory (default: docs/)",
|
|
178
|
+
)
|
|
179
|
+
init_ci_parser.add_argument(
|
|
180
|
+
"--code-path", default=".",
|
|
181
|
+
help="Code repository root (default: .)",
|
|
182
|
+
)
|
|
183
|
+
init_ci_parser.add_argument(
|
|
184
|
+
"--backend", choices=("local", "codex", "claude_code"), default="local",
|
|
185
|
+
help="Argus backend (default: local)",
|
|
186
|
+
)
|
|
187
|
+
init_ci_parser.add_argument(
|
|
188
|
+
"--trigger", default="pr,tag",
|
|
189
|
+
help=(
|
|
190
|
+
"Comma-separated triggers: pr, tag, manual, schedule "
|
|
191
|
+
"(default: pr,tag)"
|
|
192
|
+
),
|
|
193
|
+
)
|
|
194
|
+
init_ci_parser.add_argument(
|
|
195
|
+
"--branch", default="main",
|
|
196
|
+
help="Target branch for PR trigger (default: main)",
|
|
197
|
+
)
|
|
198
|
+
init_ci_parser.add_argument(
|
|
199
|
+
"--cron", default="0 9 * * 1",
|
|
200
|
+
help="Cron expression for schedule trigger (default: '0 9 * * 1')",
|
|
201
|
+
)
|
|
202
|
+
init_ci_parser.add_argument(
|
|
203
|
+
"--approval", action="store_true",
|
|
204
|
+
help="Add a manual approval step (requires GitHub Environment setup)",
|
|
205
|
+
)
|
|
206
|
+
init_ci_parser.add_argument(
|
|
207
|
+
"--no-comment", action="store_true",
|
|
208
|
+
help="Disable automatic PR comment with findings",
|
|
209
|
+
)
|
|
210
|
+
init_ci_parser.add_argument(
|
|
211
|
+
"--claude-oauth", action="store_true",
|
|
212
|
+
help=(
|
|
213
|
+
"Use Claude OAuth token instead of API key for claude_code backend. "
|
|
214
|
+
"Pro/Max users can use subscription quota instead of per-API-call billing. "
|
|
215
|
+
"Generate token with: claude setup-token"
|
|
216
|
+
),
|
|
217
|
+
)
|
|
218
|
+
init_ci_parser.add_argument(
|
|
219
|
+
"--gen-issue", action="store_true",
|
|
220
|
+
help="Generate GitHub issue drafts from findings",
|
|
221
|
+
)
|
|
222
|
+
init_ci_parser.add_argument(
|
|
223
|
+
"--hermes-provider", choices=("openai", "anthropic"), default=None,
|
|
224
|
+
help=(
|
|
225
|
+
"LLM provider for Hermes: openai or anthropic. "
|
|
226
|
+
"Default: anthropic when backend=claude_code, otherwise openai"
|
|
227
|
+
),
|
|
228
|
+
)
|
|
229
|
+
init_ci_parser.add_argument(
|
|
230
|
+
"--hermes-model", default=None,
|
|
231
|
+
help="Override Hermes LLM model",
|
|
232
|
+
)
|
|
233
|
+
init_ci_parser.add_argument(
|
|
234
|
+
"--argus-model", default=None,
|
|
235
|
+
help="Override Argus LLM model",
|
|
236
|
+
)
|
|
237
|
+
init_ci_parser.add_argument(
|
|
238
|
+
"--action-ref", default="KMing-L/lyingdocs@v1",
|
|
239
|
+
help="GitHub Action reference (default: KMing-L/lyingdocs@v1)",
|
|
240
|
+
)
|
|
241
|
+
init_ci_parser.add_argument(
|
|
242
|
+
"--output", "-o", default=".",
|
|
243
|
+
help=(
|
|
244
|
+
"Output path. If a directory, writes to "
|
|
245
|
+
"<dir>/.github/workflows/lyingdocs.yml (default: .)"
|
|
246
|
+
),
|
|
247
|
+
)
|
|
248
|
+
|
|
249
|
+
from .init_ci import cmd_init_ci
|
|
250
|
+
init_ci_parser.set_defaults(func=cmd_init_ci)
|
|
251
|
+
|
|
162
252
|
# -- version subcommand --
|
|
163
253
|
version_parser = subparsers.add_parser("version", help="Show version")
|
|
164
254
|
version_parser.set_defaults(func=cmd_version)
|