@octavio.bot/review 0.1.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.md +119 -0
- package/dist/index.mjs +16021 -0
- package/package.json +33 -0
package/README.md
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# @octavio.bot/review
|
|
2
|
+
|
|
3
|
+
CI-first PR review CLI that returns a pass/fail result and writes report artifacts.
|
|
4
|
+
|
|
5
|
+
## What It Does
|
|
6
|
+
|
|
7
|
+
1. Builds PR context from changed files.
|
|
8
|
+
2. Instructs OpenCode to write artifacts directly to disk using an artifact schema.
|
|
9
|
+
3. Validates artifacts in host runtime.
|
|
10
|
+
4. Applies fail policy from profile config or instruction frontmatter.
|
|
11
|
+
|
|
12
|
+
No GitHub review comments are created or updated.
|
|
13
|
+
|
|
14
|
+
## Run Published CLI
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
bunx --bun @octavio.bot/review@latest review --owner acme --repo web --pr 123 --workdir .
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
CLI binary name: `octavio-review`.
|
|
21
|
+
|
|
22
|
+
## OpenCode Detection and Install
|
|
23
|
+
|
|
24
|
+
- The CLI checks for `opencode` before running reviews.
|
|
25
|
+
- Local default is detect-only. If missing, the CLI prints install steps and exits.
|
|
26
|
+
- CI default (`GITHUB_ACTIONS=true`) auto-installs OpenCode when missing.
|
|
27
|
+
- `--install-opencode` forces local auto-install.
|
|
28
|
+
|
|
29
|
+
Manual install command:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
curl -fsSL https://opencode.ai/install | bash
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Helpful commands:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
bunx --bun @octavio.bot/review@latest doctor
|
|
39
|
+
bunx --bun @octavio.bot/review@latest install-opencode
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Environment
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
GITHUB_TOKEN=...
|
|
46
|
+
OPENCODE_HOSTNAME=127.0.0.1
|
|
47
|
+
OPENCODE_PORT=4096
|
|
48
|
+
# OPENCODE_MODEL=... (optional; OpenCode default is used if omitted)
|
|
49
|
+
# OPENCODE_API_KEY=... (required for OpenCode Zen in CI)
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Free OpenCode Zen model options:
|
|
53
|
+
|
|
54
|
+
- `opencode/minimax-m2.5-free`
|
|
55
|
+
- `opencode/glm-5-free`
|
|
56
|
+
|
|
57
|
+
## Local Source Development
|
|
58
|
+
|
|
59
|
+
From repo root:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
bun install
|
|
63
|
+
bun run review-bot --owner acme --repo web --pr 123 --instructions-profile balanced --workdir .
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Optional flags:
|
|
67
|
+
|
|
68
|
+
- `--report-output path/to/review.md`
|
|
69
|
+
- `--findings-output path/to/confidence.json`
|
|
70
|
+
- `--result-output path/to/result.json`
|
|
71
|
+
- `--instructions-profile balanced`
|
|
72
|
+
- `--artifact-execution agent|host`
|
|
73
|
+
- `--install-opencode`
|
|
74
|
+
|
|
75
|
+
## Instruction Profiles
|
|
76
|
+
|
|
77
|
+
Instruction resolution order:
|
|
78
|
+
|
|
79
|
+
1. `--instructions` (explicit path)
|
|
80
|
+
2. `--instructions-profile` from `.octavio/review.config.json`
|
|
81
|
+
3. `defaultProfile` from `.octavio/review.config.json`
|
|
82
|
+
4. `@octavio.bot/prompts` package default (`balanced`)
|
|
83
|
+
|
|
84
|
+
Policy resolution order:
|
|
85
|
+
|
|
86
|
+
1. profile policy from `.octavio/review.config.json` (`policy.failOn`)
|
|
87
|
+
2. instruction frontmatter policy (`policy.fail_on`)
|
|
88
|
+
|
|
89
|
+
This repository includes three profiles in `.octavio/review.config.json`:
|
|
90
|
+
|
|
91
|
+
- `balanced`
|
|
92
|
+
- `styling`
|
|
93
|
+
- `security` (includes PR metadata/code mismatch checks)
|
|
94
|
+
|
|
95
|
+
## Artifact Outputs
|
|
96
|
+
|
|
97
|
+
Default artifact schema writes these files into `artifacts/`:
|
|
98
|
+
|
|
99
|
+
- `review.md` - human-readable review report
|
|
100
|
+
- `confidence.json` - machine-readable summary and findings
|
|
101
|
+
|
|
102
|
+
`confidence.json` requires:
|
|
103
|
+
|
|
104
|
+
- `summary` (string)
|
|
105
|
+
- `overallConfidence` (`low|medium|high`)
|
|
106
|
+
- `findings` (array with `id`, `severity`, `title`, `path`, `line`, `comment`)
|
|
107
|
+
- `meta` (object)
|
|
108
|
+
|
|
109
|
+
## Workflows
|
|
110
|
+
|
|
111
|
+
- Review workflow: `.github/workflows/review-check.yml`
|
|
112
|
+
- Runs profile matrix (`balanced`, `styling`, `security`) with `max-parallel: 1`
|
|
113
|
+
- Uses `bunx --bun @octavio.bot/review@latest`
|
|
114
|
+
- Uploads `review.md`, `confidence.json`, and `result.json`
|
|
115
|
+
- CI workflow: `.github/workflows/ci.yml`
|
|
116
|
+
- Includes smoke test: `bunx --bun @octavio.bot/review@latest doctor`
|
|
117
|
+
- Publish workflow: `.github/workflows/publish-review.yml`
|
|
118
|
+
- Manual only (`workflow_dispatch`)
|
|
119
|
+
- Publishes from `apps/review-bot-cli` using npm trusted publishing (OIDC)
|