@agentskit/code-review 0.1.0 → 0.4.2
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/.doc-bridge/capabilities.json +34 -0
- package/.doc-bridge/index.json +94 -0
- package/.pre-commit-hooks.yaml +9 -0
- package/AGENTS.md +20 -0
- package/CHANGELOG.md +91 -0
- package/CONTRIBUTING.md +45 -0
- package/README.md +238 -33
- package/ROADMAP.md +20 -0
- package/SECURITY.md +16 -0
- package/action.yml +120 -0
- package/dist/agents/code-review/agent.js +454 -76
- package/dist/agents/code-review/agent.js.map +1 -1
- package/dist/agents/code-review/lenses.js +17 -1
- package/dist/agents/code-review/lenses.js.map +1 -1
- package/dist/agents/code-review/reporters.js +83 -7
- package/dist/agents/code-review/reporters.js.map +1 -1
- package/dist/agents/code-review/sources.js +324 -73
- package/dist/agents/code-review/sources.js.map +1 -1
- package/dist/src/acp-cli-adapter.js +127 -0
- package/dist/src/acp-cli-adapter.js.map +1 -0
- package/dist/src/batch-coverage.js +111 -0
- package/dist/src/batch-coverage.js.map +1 -0
- package/dist/src/claude-code-adapter.js +44 -60
- package/dist/src/claude-code-adapter.js.map +1 -1
- package/dist/src/cli.js +347 -50
- package/dist/src/cli.js.map +1 -1
- package/dist/src/codex-adapter.js +114 -69
- package/dist/src/codex-adapter.js.map +1 -1
- package/dist/src/github-review-state.js +134 -0
- package/dist/src/github-review-state.js.map +1 -0
- package/dist/src/grok-cli-adapter.js +27 -0
- package/dist/src/grok-cli-adapter.js.map +1 -0
- package/dist/src/headless-cli-adapter.js +78 -0
- package/dist/src/headless-cli-adapter.js.map +1 -0
- package/dist/src/local-cli-process.js +328 -0
- package/dist/src/local-cli-process.js.map +1 -0
- package/dist/src/local-cli-timeout.js +14 -0
- package/dist/src/local-cli-timeout.js.map +1 -0
- package/dist/src/ollama-adapter.js +155 -0
- package/dist/src/ollama-adapter.js.map +1 -0
- package/dist/src/opencode-cli-adapter.js +57 -0
- package/dist/src/opencode-cli-adapter.js.map +1 -0
- package/dist/src/provider-circuit-breaker.js +52 -0
- package/dist/src/provider-circuit-breaker.js.map +1 -0
- package/dist/src/provider-registry.js +168 -0
- package/dist/src/provider-registry.js.map +1 -0
- package/dist/src/review-config.js +145 -0
- package/dist/src/review-config.js.map +1 -0
- package/doc-bridge.config.json +116 -0
- package/docs/OPERATIONS.md +358 -0
- package/docs/assets/agentskit-mark.svg +10 -0
- package/docs/assets/code-review-terminal.png +0 -0
- package/docs/continuous-improvement.md +35 -0
- package/docs/for-agents/code-review-cli.md +70 -0
- package/docs/for-agents/index.md +5 -0
- package/docs/plans/ecosystem-doc-quality-code-review.md +61 -0
- package/docs/provider-compatibility.json +35 -0
- package/ecosystem-claims.json +187 -0
- package/ecosystem.json +277 -0
- package/examples/pull-request.yml +29 -0
- package/llms-full.txt +1055 -0
- package/llms.txt +24 -0
- package/package.json +53 -7
- package/scripts/generate-llms-full.mjs +68 -0
- package/scripts/run-cycle-benchmark.mjs +64 -0
- package/test/cli-smoke.test.mjs +522 -0
- package/test/continuous-improvement.test.mjs +20 -0
- package/test/documentation.test.mjs +238 -0
- package/test/release-workflow.test.mjs +31 -0
- package/dist/agents/code-review/agent.d.ts +0 -115
- package/dist/agents/code-review/lenses.d.ts +0 -10
- package/dist/agents/code-review/reporters.d.ts +0 -31
- package/dist/agents/code-review/sources.d.ts +0 -27
- package/dist/src/claude-code-adapter.d.ts +0 -4
- package/dist/src/cli.d.ts +0 -2
- package/dist/src/codex-adapter.d.ts +0 -4
package/llms.txt
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
AgentsKit Code Review is a pre-v1 provider-neutral CLI and GitHub Action for low-noise review using seven lenses and adversarial verification. It intentionally has no Fumadocs site or embedded chat.
|
|
2
|
+
|
|
3
|
+
## Documentation surfaces
|
|
4
|
+
|
|
5
|
+
- Full corpus: llms-full.txt
|
|
6
|
+
- Public README: https://github.com/AgentsKit-io/code-review#readme
|
|
7
|
+
- Operations: docs/OPERATIONS.md
|
|
8
|
+
- For agents: docs/for-agents/index.md
|
|
9
|
+
- Raw sources: https://raw.githubusercontent.com/AgentsKit-io/code-review/main/
|
|
10
|
+
|
|
11
|
+
## AgentsKit ecosystem
|
|
12
|
+
|
|
13
|
+
- AgentsKit: https://www.agentskit.io/docs
|
|
14
|
+
- Registry: https://registry.agentskit.io/docs
|
|
15
|
+
- AgentsKit Chat: https://chat.agentskit.io/docs
|
|
16
|
+
- Playbook: https://playbook.agentskit.io/docs
|
|
17
|
+
- Doc Bridge: https://agentskit-io.github.io/doc-bridge/
|
|
18
|
+
- Code Review: https://github.com/AgentsKit-io/code-review#readme
|
|
19
|
+
- AKOS: https://akos.agentskit.io/docs
|
|
20
|
+
|
|
21
|
+
## Knowledge
|
|
22
|
+
|
|
23
|
+
- [Code Review CLI handoff](docs/for-agents/code-review-cli.md): Provider-neutral, low-noise AI code review for local Git diffs, files/stdin, and GitHub pull requests. Seven focused lenses propose findings; adversarial votes remove weak findings; reporters emit Markdown, GitHub reviews, and SARIF.
|
|
24
|
+
- [Code Review agent docs](docs/for-agents/index.md): - Code Review CLI handoff — ownership, change routes, security boundaries, and verification: https://raw.githubusercontent.com/AgentsKit-io/code-review/main/docs/for-agents/code-review-cli.md - Concise machine map — discovery, raw sources, and all seven ecosystem products: https://raw.githubusercontent.com/AgentsKit-io/code-review/main/llms.txt - Full machine corpus — public, operational,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentskit/code-review",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Provider-agnostic, low-noise AI code review for local development and GitHub Actions.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -10,14 +10,44 @@
|
|
|
10
10
|
"files": [
|
|
11
11
|
"dist",
|
|
12
12
|
"README.md",
|
|
13
|
-
"LICENSE"
|
|
13
|
+
"LICENSE",
|
|
14
|
+
"AGENTS.md",
|
|
15
|
+
".pre-commit-hooks.yaml",
|
|
16
|
+
"action.yml",
|
|
17
|
+
"examples/pull-request.yml",
|
|
18
|
+
"SECURITY.md",
|
|
19
|
+
"CONTRIBUTING.md",
|
|
20
|
+
"ROADMAP.md",
|
|
21
|
+
"CHANGELOG.md",
|
|
22
|
+
"doc-bridge.config.json",
|
|
23
|
+
".doc-bridge/index.json",
|
|
24
|
+
".doc-bridge/capabilities.json",
|
|
25
|
+
"ecosystem.json",
|
|
26
|
+
"ecosystem-claims.json",
|
|
27
|
+
"llms.txt",
|
|
28
|
+
"llms-full.txt",
|
|
29
|
+
"docs/OPERATIONS.md",
|
|
30
|
+
"docs/provider-compatibility.json",
|
|
31
|
+
"docs/for-agents",
|
|
32
|
+
"docs/plans",
|
|
33
|
+
"docs/assets",
|
|
34
|
+
"docs/continuous-improvement.md",
|
|
35
|
+
"test/cli-smoke.test.mjs",
|
|
36
|
+
"test/continuous-improvement.test.mjs",
|
|
37
|
+
"test/documentation.test.mjs",
|
|
38
|
+
"test/release-workflow.test.mjs",
|
|
39
|
+
"scripts/generate-llms-full.mjs",
|
|
40
|
+
"scripts/run-cycle-benchmark.mjs"
|
|
14
41
|
],
|
|
15
42
|
"repository": {
|
|
16
43
|
"type": "git",
|
|
17
|
-
"url": "git+https://github.com/AgentsKit-io/code-review
|
|
44
|
+
"url": "git+https://github.com/AgentsKit-io/code-review.git"
|
|
45
|
+
},
|
|
46
|
+
"homepage": "https://github.com/AgentsKit-io/code-review#readme",
|
|
47
|
+
"bugs": "https://github.com/AgentsKit-io/code-review/issues",
|
|
48
|
+
"publishConfig": {
|
|
49
|
+
"access": "public"
|
|
18
50
|
},
|
|
19
|
-
"homepage": "https://github.com/AgentsKit-io/code-review-cli#readme",
|
|
20
|
-
"bugs": "https://github.com/AgentsKit-io/code-review-cli/issues",
|
|
21
51
|
"keywords": [
|
|
22
52
|
"ai-code-review",
|
|
23
53
|
"code-review",
|
|
@@ -29,9 +59,20 @@
|
|
|
29
59
|
"review": "tsx src/cli.ts",
|
|
30
60
|
"build": "tsc -p tsconfig.build.json",
|
|
31
61
|
"typecheck": "tsc --noEmit",
|
|
32
|
-
"
|
|
62
|
+
"test": "npm run build && node --test --test-concurrency=1 test/*.test.mjs",
|
|
63
|
+
"benchmark:cycle": "npm run build && node scripts/run-cycle-benchmark.mjs",
|
|
64
|
+
"docs:full": "node scripts/generate-llms-full.mjs",
|
|
65
|
+
"docs:index": "ak-docs index && npm run docs:full",
|
|
66
|
+
"docs:gate": "ak-docs gate run && ak-docs conformance run documentation-standard-v1 --text && node scripts/generate-llms-full.mjs --check && node --test test/documentation.test.mjs",
|
|
67
|
+
"docs:doctor": "ak-docs doctor --text",
|
|
68
|
+
"changeset": "changeset",
|
|
69
|
+
"version-packages": "changeset version",
|
|
70
|
+
"check": "npm run typecheck && npm run test && npm run docs:gate && node dist/src/cli.js --help && npm run check:readme-standard",
|
|
33
71
|
"prepare": "npm run build",
|
|
34
|
-
"prepack": "npm run build"
|
|
72
|
+
"prepack": "npm run build && npm run docs:gate",
|
|
73
|
+
"check:readme-standard": "node scripts/check-readme-standard.mjs",
|
|
74
|
+
"test:readme-standard": "node --test scripts/readme-standard.test.mjs",
|
|
75
|
+
"readme:standard:refresh": "node scripts/refresh-readme-standard.mjs"
|
|
35
76
|
},
|
|
36
77
|
"dependencies": {
|
|
37
78
|
"@agentskit/adapters": "^0.12.2",
|
|
@@ -42,7 +83,12 @@
|
|
|
42
83
|
"zod": "^3.25.0",
|
|
43
84
|
"zod-to-json-schema": "^3.24.0"
|
|
44
85
|
},
|
|
86
|
+
"optionalDependencies": {
|
|
87
|
+
"@agentskit/doc-bridge": "^1.1.1"
|
|
88
|
+
},
|
|
45
89
|
"devDependencies": {
|
|
90
|
+
"@changesets/changelog-github": "^0.7.0",
|
|
91
|
+
"@changesets/cli": "^2.31.0",
|
|
46
92
|
"@types/json-schema": "^7.0.15",
|
|
47
93
|
"@types/node": "^22.10.0",
|
|
48
94
|
"tsx": "^4.19.0",
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { readFileSync, writeFileSync } from 'node:fs'
|
|
4
|
+
import { dirname, resolve } from 'node:path'
|
|
5
|
+
import { fileURLToPath } from 'node:url'
|
|
6
|
+
|
|
7
|
+
const root = resolve(dirname(fileURLToPath(import.meta.url)), '..')
|
|
8
|
+
const outputPath = resolve(root, 'llms-full.txt')
|
|
9
|
+
const rawBase = 'https://raw.githubusercontent.com/AgentsKit-io/code-review/main/'
|
|
10
|
+
const blobBase = 'https://github.com/AgentsKit-io/code-review/blob/main/'
|
|
11
|
+
const sources = [
|
|
12
|
+
['Public README', 'README.md'],
|
|
13
|
+
['Operations guide', 'docs/OPERATIONS.md'],
|
|
14
|
+
['Agent documentation index', 'docs/for-agents/index.md'],
|
|
15
|
+
['Code Review agent handoff', 'docs/for-agents/code-review-cli.md'],
|
|
16
|
+
['Security policy', 'SECURITY.md'],
|
|
17
|
+
['Contributing guide', 'CONTRIBUTING.md'],
|
|
18
|
+
['Roadmap', 'ROADMAP.md'],
|
|
19
|
+
['Changelog', 'CHANGELOG.md'],
|
|
20
|
+
]
|
|
21
|
+
|
|
22
|
+
const rebaseRelativeLinks = (markdown, sourcePath) => markdown
|
|
23
|
+
.replace(
|
|
24
|
+
/!\[([^\]]*)\]\((?!https?:\/\/|mailto:|#)([^)]+)\)/g,
|
|
25
|
+
(_match, alt, target) => `.href})`,
|
|
26
|
+
)
|
|
27
|
+
.replace(
|
|
28
|
+
/\]\((?!https?:\/\/|mailto:|#)([^)]+)\)/g,
|
|
29
|
+
(_match, target) => `](${new URL(target, `${blobBase}${sourcePath}`).href})`,
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
const ecosystem = JSON.parse(readFileSync(resolve(root, 'ecosystem.json'), 'utf8'))
|
|
33
|
+
const productLines = ecosystem.products
|
|
34
|
+
.sort((left, right) => left.navigation.order - right.navigation.order)
|
|
35
|
+
.map((product) => `- ${product.name}: ${product.surfaces.docs ?? product.surfaces.home}`)
|
|
36
|
+
|
|
37
|
+
const sections = sources.map(([title, path]) => [
|
|
38
|
+
`## ${title}`,
|
|
39
|
+
'',
|
|
40
|
+
`Canonical source: ${rawBase}${path}`,
|
|
41
|
+
'',
|
|
42
|
+
rebaseRelativeLinks(readFileSync(resolve(root, path), 'utf8').trim(), path),
|
|
43
|
+
].join('\n'))
|
|
44
|
+
|
|
45
|
+
const content = [
|
|
46
|
+
'# AgentsKit Code Review — full documentation corpus',
|
|
47
|
+
'',
|
|
48
|
+
'Generated from the public repository documentation. Prefer llms.txt for concise discovery and this file only when the full operating and ownership context is required.',
|
|
49
|
+
'',
|
|
50
|
+
'## AgentsKit ecosystem',
|
|
51
|
+
'',
|
|
52
|
+
...productLines,
|
|
53
|
+
'',
|
|
54
|
+
...sections,
|
|
55
|
+
'',
|
|
56
|
+
].join('\n')
|
|
57
|
+
|
|
58
|
+
if (process.argv.includes('--check')) {
|
|
59
|
+
const current = readFileSync(outputPath, 'utf8')
|
|
60
|
+
if (current !== content) {
|
|
61
|
+
console.error('llms-full.txt is stale; run npm run docs:full')
|
|
62
|
+
process.exit(1)
|
|
63
|
+
}
|
|
64
|
+
console.log('llms-full.txt is fresh.')
|
|
65
|
+
} else {
|
|
66
|
+
writeFileSync(outputPath, content)
|
|
67
|
+
console.log(`Generated llms-full.txt from ${sources.length} canonical sources.`)
|
|
68
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { spawnSync } from 'node:child_process'
|
|
3
|
+
import { mkdtempSync, readFileSync, rmSync } from 'node:fs'
|
|
4
|
+
import { tmpdir } from 'node:os'
|
|
5
|
+
import { dirname, join, resolve } from 'node:path'
|
|
6
|
+
import { fileURLToPath } from 'node:url'
|
|
7
|
+
|
|
8
|
+
const root = resolve(dirname(fileURLToPath(import.meta.url)), '..')
|
|
9
|
+
const fixtureBin = join(root, 'test/fixtures/bin')
|
|
10
|
+
const workdir = mkdtempSync(join(tmpdir(), 'agentskit-review-cycle-'))
|
|
11
|
+
const source = 'export const answer = 42\n'
|
|
12
|
+
|
|
13
|
+
function runCase(id, options = {}) {
|
|
14
|
+
const result = join(workdir, `${id}.json`)
|
|
15
|
+
const startedAt = Date.now()
|
|
16
|
+
const run = spawnSync(process.execPath, [
|
|
17
|
+
'dist/src/cli.js', '--provider', 'codex-cli', '--stdin', '--lang', 'ts',
|
|
18
|
+
'--profile', options.profile ?? 'full', '--health-check', 'off', '--deadline-ms', options.deadlineMs ?? '3000',
|
|
19
|
+
'--result', result, '--no-fail',
|
|
20
|
+
], {
|
|
21
|
+
cwd: root, input: source, encoding: 'utf8', timeout: 10_000,
|
|
22
|
+
env: { ...process.env, ...options.env, PATH: `${fixtureBin}:${process.env.PATH ?? ''}` },
|
|
23
|
+
})
|
|
24
|
+
let artifact
|
|
25
|
+
let artifactError
|
|
26
|
+
try { artifact = JSON.parse(readFileSync(result, 'utf8')) } catch (error) { artifactError = error instanceof Error ? error.message : String(error) }
|
|
27
|
+
return {
|
|
28
|
+
id, exitCode: run.status, elapsedMs: Date.now() - startedAt,
|
|
29
|
+
artifact: artifact && {
|
|
30
|
+
verdict: artifact.verdict, blocking: artifact.blocking, incomplete: artifact.incomplete,
|
|
31
|
+
execution: artifact.execution, evidence: artifact.evidence,
|
|
32
|
+
},
|
|
33
|
+
stderr: run.stderr.trim(),
|
|
34
|
+
artifactError,
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function requireCase(condition, message) {
|
|
39
|
+
if (!condition) throw new Error(`cycle benchmark failed: ${message}`)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
try {
|
|
43
|
+
const cases = [
|
|
44
|
+
runCase('clean'),
|
|
45
|
+
runCase('required-lens-failure', { env: { CODEX_FIXTURE_FAIL_CATEGORY: 'security' } }),
|
|
46
|
+
runCase('deadline', { profile: 'fast', deadlineMs: '50', env: { CODEX_FIXTURE_HANG: '1' } }),
|
|
47
|
+
]
|
|
48
|
+
const [clean, lensFailure, deadline] = cases
|
|
49
|
+
requireCase(clean.exitCode === 0 && clean.artifact?.verdict === 'APPROVE' && clean.artifact?.incomplete === false, 'clean review must complete as APPROVE')
|
|
50
|
+
requireCase(
|
|
51
|
+
Number.isInteger(clean.artifact?.execution?.attempted) &&
|
|
52
|
+
Number.isInteger(clean.artifact?.execution?.succeeded) &&
|
|
53
|
+
clean.artifact.execution.attempted > 0 &&
|
|
54
|
+
clean.artifact.execution.succeeded === clean.artifact.execution.attempted,
|
|
55
|
+
'clean review must retain complete execution evidence',
|
|
56
|
+
)
|
|
57
|
+
requireCase(lensFailure.exitCode === 2 && lensFailure.artifact?.incomplete === true, 'required lens failure must fail closed with an artifact')
|
|
58
|
+
requireCase((lensFailure.artifact?.execution?.failed ?? 0) > 0, 'required lens failure must retain failed-call evidence')
|
|
59
|
+
requireCase(deadline.exitCode === 2 && deadline.artifact?.incomplete === true && deadline.artifact?.blocking === true, 'deadline must create a blocking incomplete artifact')
|
|
60
|
+
requireCase(deadline.artifact?.evidence?.deadlineExceeded === true, 'deadline must retain deadline evidence')
|
|
61
|
+
process.stdout.write(`${JSON.stringify({ version: 1, cases }, null, 2)}\n`)
|
|
62
|
+
} finally {
|
|
63
|
+
rmSync(workdir, { recursive: true, force: true })
|
|
64
|
+
}
|