@agentskit/code-review 0.1.0 → 0.4.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.
Files changed (76) hide show
  1. package/.doc-bridge/capabilities.json +34 -0
  2. package/.doc-bridge/index.json +94 -0
  3. package/.pre-commit-hooks.yaml +9 -0
  4. package/AGENTS.md +20 -0
  5. package/CHANGELOG.md +85 -0
  6. package/CONTRIBUTING.md +45 -0
  7. package/README.md +238 -33
  8. package/ROADMAP.md +20 -0
  9. package/SECURITY.md +16 -0
  10. package/action.yml +120 -0
  11. package/dist/agents/code-review/agent.js +453 -76
  12. package/dist/agents/code-review/agent.js.map +1 -1
  13. package/dist/agents/code-review/lenses.js +17 -1
  14. package/dist/agents/code-review/lenses.js.map +1 -1
  15. package/dist/agents/code-review/reporters.js +83 -7
  16. package/dist/agents/code-review/reporters.js.map +1 -1
  17. package/dist/agents/code-review/sources.js +324 -73
  18. package/dist/agents/code-review/sources.js.map +1 -1
  19. package/dist/src/acp-cli-adapter.js +127 -0
  20. package/dist/src/acp-cli-adapter.js.map +1 -0
  21. package/dist/src/batch-coverage.js +111 -0
  22. package/dist/src/batch-coverage.js.map +1 -0
  23. package/dist/src/claude-code-adapter.js +44 -60
  24. package/dist/src/claude-code-adapter.js.map +1 -1
  25. package/dist/src/cli.js +347 -50
  26. package/dist/src/cli.js.map +1 -1
  27. package/dist/src/codex-adapter.js +114 -69
  28. package/dist/src/codex-adapter.js.map +1 -1
  29. package/dist/src/github-review-state.js +134 -0
  30. package/dist/src/github-review-state.js.map +1 -0
  31. package/dist/src/grok-cli-adapter.js +27 -0
  32. package/dist/src/grok-cli-adapter.js.map +1 -0
  33. package/dist/src/headless-cli-adapter.js +78 -0
  34. package/dist/src/headless-cli-adapter.js.map +1 -0
  35. package/dist/src/local-cli-process.js +328 -0
  36. package/dist/src/local-cli-process.js.map +1 -0
  37. package/dist/src/local-cli-timeout.js +14 -0
  38. package/dist/src/local-cli-timeout.js.map +1 -0
  39. package/dist/src/ollama-adapter.js +155 -0
  40. package/dist/src/ollama-adapter.js.map +1 -0
  41. package/dist/src/opencode-cli-adapter.js +57 -0
  42. package/dist/src/opencode-cli-adapter.js.map +1 -0
  43. package/dist/src/provider-circuit-breaker.js +52 -0
  44. package/dist/src/provider-circuit-breaker.js.map +1 -0
  45. package/dist/src/provider-registry.js +168 -0
  46. package/dist/src/provider-registry.js.map +1 -0
  47. package/dist/src/review-config.js +145 -0
  48. package/dist/src/review-config.js.map +1 -0
  49. package/doc-bridge.config.json +116 -0
  50. package/docs/OPERATIONS.md +358 -0
  51. package/docs/assets/agentskit-mark.svg +10 -0
  52. package/docs/assets/code-review-terminal.png +0 -0
  53. package/docs/continuous-improvement.md +35 -0
  54. package/docs/for-agents/code-review-cli.md +70 -0
  55. package/docs/for-agents/index.md +5 -0
  56. package/docs/plans/ecosystem-doc-quality-code-review.md +61 -0
  57. package/docs/provider-compatibility.json +35 -0
  58. package/ecosystem-claims.json +187 -0
  59. package/ecosystem.json +277 -0
  60. package/examples/pull-request.yml +29 -0
  61. package/llms-full.txt +1049 -0
  62. package/llms.txt +24 -0
  63. package/package.json +53 -7
  64. package/scripts/generate-llms-full.mjs +68 -0
  65. package/scripts/run-cycle-benchmark.mjs +64 -0
  66. package/test/cli-smoke.test.mjs +507 -0
  67. package/test/continuous-improvement.test.mjs +20 -0
  68. package/test/documentation.test.mjs +238 -0
  69. package/test/release-workflow.test.mjs +31 -0
  70. package/dist/agents/code-review/agent.d.ts +0 -115
  71. package/dist/agents/code-review/lenses.d.ts +0 -10
  72. package/dist/agents/code-review/reporters.d.ts +0 -31
  73. package/dist/agents/code-review/sources.d.ts +0 -27
  74. package/dist/src/claude-code-adapter.d.ts +0 -4
  75. package/dist/src/cli.d.ts +0 -2
  76. package/dist/src/codex-adapter.d.ts +0 -4
@@ -0,0 +1,34 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "type": "doc-bridge-capabilities",
4
+ "package": "@agentskit/doc-bridge",
5
+ "version": "1.1.1",
6
+ "project": {
7
+ "name": "AgentsKit Code Review",
8
+ "root": "."
9
+ },
10
+ "contentHash": "fc48bc555bbddf9102ae8fdbd4712da1e9cfa5bd2649dec2ac9cc7687994aa52",
11
+ "artifacts": {
12
+ "index": ".doc-bridge/index.json",
13
+ "llmsTxt": "llms.txt"
14
+ },
15
+ "capabilities": [
16
+ "index",
17
+ "query",
18
+ "search",
19
+ "agent-handoff",
20
+ "gates",
21
+ "mcp",
22
+ "human-docs"
23
+ ],
24
+ "surfaces": {
25
+ "cli": {
26
+ "bin": "ak-docs",
27
+ "defaultFormat": "text"
28
+ },
29
+ "mcp": {
30
+ "enabled": true,
31
+ "transport": "stdio"
32
+ }
33
+ }
34
+ }
@@ -0,0 +1,94 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "contentHash": "fc48bc555bbddf9102ae8fdbd4712da1e9cfa5bd2649dec2ac9cc7687994aa52",
4
+ "contentHashAlgo": "sha256-normalized-v1",
5
+ "generatedAt": "2026-09-05T21:26:44.865Z",
6
+ "project": {
7
+ "name": "AgentsKit Code Review",
8
+ "root": "."
9
+ },
10
+ "knowledge": [
11
+ {
12
+ "id": "code-review-cli",
13
+ "type": "agent-doc",
14
+ "title": "Code Review CLI handoff",
15
+ "path": "docs/for-agents/code-review-cli.md",
16
+ "description": "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.",
17
+ "body": "Code Review CLI handoff Purpose 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. Ownership map - src/cli.ts : public flags, source selection, provider selection, exit policy. - src/<provider -adapter.ts : logged-in local CLI adapters. - agents/code-review/ : review pipeline, lenses, input normalization, reporters. - action.yml : composite GitHub Action contract. - .github/workflows/release.yml : Changesets version-pull-request workflow. - .github/workflows/publish.yml : version-PR-gated npm Trusted Publishing and GitHub Release workflow. - examples/ : copy-ready Action workflows. - README.md and docs/OPERATIONS.md : public adoption and operations guidance. - ecosystem.json , llms.txt , and llms-full.txt : canonical product graph and machine-readable discovery/full-corpus surfaces. - test/ : credential-free CLI, Action, and documentation contract proofs. Boundaries - Depend on AgentsKit adapter/runtime/tool contracts; do not create a second model abstraction. - Preserve provider neutrality and advisory-by-default Action behavior. - Never expose provider keys in arguments, docs fixtures, logs, or PR output. - This product intentionally has no Fumadocs site and no embedded AgentsChat. - The vendored review agent tracks the AgentsKit Registry source; keep divergences explicit. Change routes - CLI flag/provider behavior: start at src/cli.ts , then update README, operations docs, and tests. - Local CLI subprocess behavior: start at the matching src/<provider -adapter.ts and add an offline fixture. - Review logic or noise reduction: start at agents/code-review/agent.ts and the relevant lens; prove both survival and rejection behavior. - GitHub comments/SARIF: start at agents/code-review/reporters.ts and verify permissions/failure docs. - Action input: update action.yml , examples/pull-request.yml , README, and contract tests together. - Release automation: update .github/workflows/release.yml , .github/workflows/publish.yml , Changesets configuration, and the automated publishing section in docs/OPERATIONS.md together. Verification npm run check includes typecheck, build, an end-to-end offline stdin review, Action/documentation tests, Doc Bridge gates, and CLI help. Ecosystem routes - AgentsKit — runtime, adapters, and custom review agents: https://www.agentskit.io/docs - Registry — ready-made agent source: https://registry.agentskit.io/docs - AgentsKit Chat — conversational delivery; do not embed a chat runtime here: https://chat.agentskit.io/docs - Playbook — engineering discipline before verification: https://playbook.agentskit.io/docs - Doc Bridge — documentation ownership, freshness, and handoff generation: https://agentskit-io.github.io/doc-bridge/ - AKOS — enterprise orchestration and production governance: https://akos.agentskit.io/docs Use llms.txt for discovery and llms-full.txt only when the complete public, operational, and agent-handoff context is required. Human guide - README: https://raw.githubusercontent.com/AgentsKit-io/code-review/main/README.md - Operations guide: https://raw.githubusercontent.com/AgentsKit-io/code-review/main/docs/OPERATIONS.md - Contributing: https://raw.githubusercontent.com/AgentsKit-io/code-review/main/CONTRIBUTING.md - Security: https://raw.githubusercontent.com/AgentsKit-io/code-review/main/SECURITY.md"
18
+ },
19
+ {
20
+ "id": "index",
21
+ "type": "agent-doc",
22
+ "title": "Code Review agent docs",
23
+ "path": "docs/for-agents/index.md",
24
+ "description": "- 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,",
25
+ "body": "Code Review agent docs - 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, governance, maturity, and agent handoffs: https://raw.githubusercontent.com/AgentsKit-io/code-review/main/llms-full.txt"
26
+ }
27
+ ],
28
+ "handoffs": {
29
+ "code-review-cli": {
30
+ "type": "agent-handoff",
31
+ "schemaVersion": 1,
32
+ "source": ".doc-bridge/index.json",
33
+ "target": {
34
+ "type": "package",
35
+ "id": "code-review-cli",
36
+ "path": "."
37
+ },
38
+ "startHere": "docs/for-agents/code-review-cli.md",
39
+ "readBeforeEditing": [
40
+ "docs/for-agents/code-review-cli.md",
41
+ "AGENTS.md"
42
+ ],
43
+ "editRoots": [
44
+ "."
45
+ ],
46
+ "checks": [
47
+ "npm run check",
48
+ "npm pack --dry-run"
49
+ ],
50
+ "humanDoc": "OPERATIONS",
51
+ "bridge": {
52
+ "humanDoc": "linked"
53
+ },
54
+ "notes": [
55
+ "Provider-neutral local and GitHub code review CLI, Action, reporters, and repository documentation."
56
+ ]
57
+ }
58
+ },
59
+ "lookup": {
60
+ "packages": [
61
+ "code-review-cli"
62
+ ],
63
+ "ownership": {
64
+ "code-review-cli": {
65
+ "id": "code-review-cli",
66
+ "path": ".",
67
+ "checks": [
68
+ "npm run check",
69
+ "npm pack --dry-run"
70
+ ],
71
+ "purpose": "Provider-neutral local and GitHub code review CLI, Action, reporters, and repository documentation.",
72
+ "humanDoc": "OPERATIONS",
73
+ "agentDoc": "docs/for-agents/code-review-cli.md"
74
+ }
75
+ },
76
+ "intents": {
77
+ "understand-or-run-code-review": {
78
+ "id": "understand-or-run-code-review",
79
+ "title": "Understand or run Code Review",
80
+ "paths": [
81
+ "README.md",
82
+ "docs/OPERATIONS.md"
83
+ ]
84
+ }
85
+ },
86
+ "changes": {
87
+ "change-cli-provider-or-action": {
88
+ "id": "change-cli-provider-or-action",
89
+ "title": "Change a CLI provider, flag, reporter, or Action input",
90
+ "startHere": "docs/for-agents/code-review-cli.md"
91
+ }
92
+ }
93
+ }
94
+ }
@@ -0,0 +1,9 @@
1
+ - id: agentskit-review
2
+ name: AgentsKit Code Review
3
+ description: Run provider-neutral, adversarial code review over the repository diff.
4
+ entry: agentskit-review
5
+ language: node
6
+ pass_filenames: false
7
+ always_run: true
8
+ require_serial: true
9
+ stages: [manual]
package/AGENTS.md ADDED
@@ -0,0 +1,20 @@
1
+ # AGENTS.md — AgentsKit Code Review
2
+
3
+ Read [`docs/for-agents/code-review-cli.md`](docs/for-agents/code-review-cli.md) before editing. It owns the module map, public boundaries, change routes, and verification commands.
4
+
5
+ ## Non-negotiable boundaries
6
+
7
+ - Keep provider behavior behind the AgentsKit adapter contract.
8
+ - Keep the GitHub Action advisory by default; blocking is explicit policy.
9
+ - Never place API keys in arguments, fixtures, logs, documentation examples, or review output.
10
+ - Keep this product repository-native: do not add Fumadocs or embedded AgentsChat.
11
+ - Update public docs and offline tests with any CLI, provider, reporter, or Action contract change.
12
+
13
+ ## Verification
14
+
15
+ Run both commands before shipping:
16
+
17
+ ```bash
18
+ npm run check
19
+ npm pack --dry-run
20
+ ```
package/CHANGELOG.md ADDED
@@ -0,0 +1,85 @@
1
+ # Changelog
2
+
3
+ ## 0.4.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#73](https://github.com/AgentsKit-io/code-review/pull/73) [`f99c9a3`](https://github.com/AgentsKit-io/code-review/commit/f99c9a37478440b7030c33ac480746db4204d0ef) Thanks [@EmersonBraun](https://github.com/EmersonBraun)! - Add a deterministic continuous-improvement benchmark for clean, required-lens-failure, and deadline review behavior.
8
+
9
+ - [#73](https://github.com/AgentsKit-io/code-review/pull/73) [`f99c9a3`](https://github.com/AgentsKit-io/code-review/commit/f99c9a37478440b7030c33ac480746db4204d0ef) Thanks [@EmersonBraun](https://github.com/EmersonBraun)! - Automate version pull requests, GitHub releases, and npm trusted publishing without a long-lived npm token. Stabilize OpenCode ACP protocol fixtures without weakening their timeout coverage.
10
+
11
+ All notable changes will be documented here. This project follows Semantic Versioning.
12
+
13
+ ## [Unreleased]
14
+
15
+ ## [0.4.0] - 2026-09-05
16
+
17
+ ### Added
18
+
19
+ - Added machine-readable preflight manifests for reviewable and unreviewed files, with stable file-batch planning for external orchestration.
20
+ - Added private JSON review-result artifacts and SHA/policy-bound batch-coverage primitives for safe Orca aggregation.
21
+ - Added fail-closed consolidation: every batch artifact must match the immutable PR/SHA/policy/file manifest and have complete lens evidence before a single review can be published.
22
+ - Added CLI consolidation and publication gates so Orca can create exactly one review only from a current, complete consolidated artifact.
23
+
24
+ ### Changed
25
+
26
+ - Expanded reviewable product files to include HTML, CSS, Markdown, and MDX.
27
+ - Made GitHub inline findings agent-actionable with correction rationale, required change, acceptance check, and verification confidence.
28
+ - Reworked the persistent PR walkthrough into a compact CodeRabbit-style status card; finding detail now lives only on the relevant inline review comments.
29
+
30
+ ### Security
31
+
32
+ - Reject GitHub publication from a partial review batch; only a complete consolidated review may post.
33
+ - Document the intentionally local, private batch-artifact writes so CodeQL does not misclassify serialized PR metadata as executable file access.
34
+
35
+ ## [0.3.0] - 2026-08-30
36
+
37
+ ### Added
38
+
39
+ - Added global cancellation deadlines, provider health preflight, a circuit breaker, and bounded execution evidence.
40
+ - Added the explicit `fast` profile with a single required-lens batch for lower latency and predictable calls.
41
+ - Added CI Action inputs for profile, deadline, and health-check policy.
42
+
43
+ ## [0.2.3] - 2026-08-30
44
+
45
+ ### Fixed
46
+
47
+ - Stop issuing additional provider calls after a terminal authentication failure; reviews still fail closed without spending one failed call per lens.
48
+
49
+ ## [0.2.2] - 2026-08-29
50
+
51
+ ### Added
52
+
53
+ - Added a GitHub Release workflow for tag-verified npm Trusted Publishing with OIDC and provenance.
54
+
55
+ ### Fixed
56
+
57
+ - Prevented Codex authentication, timeout, and process failures from being retried as output-schema compatibility failures.
58
+ - Documented and exposed explicit trusted-local mode for logged-in Codex/Claude CLI workflows.
59
+ - Raised the default Codex local-worker deadline to five minutes and made GitHub PR file budgets enforceable and fail-closed.
60
+ - Bounded GitHub Action calls, propagated Claude OAuth credentials, made review fingerprints version-aware, paginated comment reconciliation with a fail-closed cap, and bounded GitHub API responses.
61
+
62
+ ## [0.2.1] - 2026-08-29
63
+
64
+ ### Fixed
65
+
66
+ - Applied Codex timeout defaults in direct library usage, bounded GitHub PR metadata/content ingestion, and transient-only GitHub GET retries.
67
+ - Added Ollama request deadlines and integration coverage for rate limits, posting failures, stalled requests, and large PR limits.
68
+
69
+ ## [0.2.0] - 2026-08-29
70
+
71
+ ### Changed
72
+
73
+ - Added strict versioned `.agentskit-review.json` policy with lens coverage, budgets, thresholds, context, and safe CI precedence; incomplete profiles require explicit local opt-in.
74
+ - Hardened the shared local CLI worker with cancellation, process-tree cleanup, isolated temporary environments, bounded output, and redacted diagnostics.
75
+ - Added bounded source snapshots with infrastructure/configuration file support, denylisted sensitive paths, symlink checks, input limits, and data-boundary-aware secret redaction.
76
+ - Added provider-free `--plan`/`--dry-run` preflight with explicit file/byte/call budgets, bounded retries, CLI concurrency defaults, and fail-closed required-lens coverage.
77
+ - Made reviews fail closed when any reviewable file has no successful primary lens or cannot be ingested; advisory mode now suppresses finding-based failures only, never source/provider/execution failures.
78
+ - Added primary-lens execution coverage to review summaries so partial provider degradation is visible.
79
+ - Repositioned the CLI and GitHub Action as provider-neutral.
80
+ - Made provider selection explicit and removed provider-specific model defaults.
81
+ - Added bounded GitHub review reconciliation with SHA/policy fingerprints, incremental compare scope when the prior SHA is an ancestor, fork-safe skip behavior, and idempotent summary updates.
82
+ - Added experimental Grok Build CLI ACP support with isolated capability denial, versioned output validation, bounded invalid-output retry, and offline lifecycle fixtures.
83
+ - Added experimental OpenCode CLI ACP support with the same isolated, versioned, bounded worker contract and offline lifecycle fixtures.
84
+ - Added provider-specific Grok/OpenCode headless transports with explicit local-only ACP fallback via `--transport auto`.
85
+ - Added package metadata, CLI help, open-source governance, and contribution guidance.
@@ -0,0 +1,45 @@
1
+ # Contributing
2
+
3
+ Thanks for helping make AI code review more useful and less noisy.
4
+
5
+ ## Start here
6
+
7
+ 1. Fork and clone the repository.
8
+ 2. Create a focused branch from `main`.
9
+ 3. Run `npm install`.
10
+ 4. Make the smallest change that solves the issue.
11
+ 5. Run `npm run check` before opening a pull request.
12
+
13
+ Node.js 20 or newer is required.
14
+
15
+ ## Project map
16
+
17
+ - `src/cli.ts` — arguments, providers, review policy, and reporters.
18
+ - `src/*-adapter.ts` — adapters for logged-in local CLIs.
19
+ - `agents/code-review/` — vendored review agent, lenses, sources, and reporters.
20
+ - `action.yml` — GitHub Action interface.
21
+ - `examples/` — copy-ready workflows.
22
+
23
+ ## Good contributions
24
+
25
+ - Reduce a reproducible false positive.
26
+ - Add a provider through the existing adapter contract.
27
+ - Add a focused review lens with clear evidence requirements.
28
+ - Improve a reporter or source without tying it to one model.
29
+ - Add provider-neutral examples and documentation.
30
+
31
+ Please open an issue before a large architectural change. Small fixes and documentation improvements can go straight to a pull request.
32
+
33
+ ## Pull requests
34
+
35
+ - Keep one concern per PR.
36
+ - Explain the user-visible behavior and how you tested it.
37
+ - Add or update tests for behavior changes.
38
+ - Preserve provider neutrality: provider-specific behavior belongs in its adapter.
39
+ - Never commit API keys, model output containing private code, or review tokens.
40
+ - Update README or examples when changing the public CLI or Action interface.
41
+
42
+ Project decisions, maintainer responsibilities, and the release process are
43
+ documented in [GOVERNANCE.md](GOVERNANCE.md).
44
+
45
+ By participating, you agree to follow the [Code of Conduct](CODE_OF_CONDUCT.md).