Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .agents/plugins/marketplace.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "code-review-c",
"interface": {"displayName": "code-review-c"},
"plugins": [{
"name": "code-review-c",
"source": {"source": "local", "path": "./"},
"policy": {"installation": "AVAILABLE", "authentication": "ON_INSTALL"},
"category": "Developer Tools"
}]
}
9 changes: 9 additions & 0 deletions .codex-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "code-review-c",
"version": "0.1.0",
"description": "Adaptive focused Codex reviews with measured model onboarding.",
"author": {"name": "Dmitry Kropachev"},
"license": "MIT",
"repository": "https://github.com/dk-code-factory/code-review-c",
"skills": "./codex/skills/"
}
33 changes: 33 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: CI

on:
push:
pull_request:

permissions:
contents: read

concurrency:
group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
offline-checks:
name: Python ${{ matrix.python }}
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
python: ['3.11', '3.12', '3.13', '3.14', '3.15']
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
persist-credentials: false
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
with:
python-version: ${{ matrix.python }}
- name: Check package
run: python scripts/check.py
- name: Run offline tests
run: python scripts/test.py
13 changes: 13 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
code-review-c
Copyright (c) 2026 Dmitry Kropachev
Licensed under the MIT License; see LICENSE.

The generic evidence, inspection, and aspect guidance is adapted from:
https://github.com/dk-code-factory/code-review-ad
commit 5900df7e96463f0fc68a5c3c0d5e0dcfdf36cd95
Copyright (c) 2026 Dmitry Kropachev
MIT License (the complete notice and permission text is retained in LICENSE).

The adaptive controller, standard-library helpers, backend briefs, onboarding
harness and tests are new code-review-c work. No installed external skills,
private rules, model profiles, benchmark results or credentials are included.
44 changes: 44 additions & 0 deletions PROVENANCE.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"version": "0.1.0",
"sources": [
{
"repository": "https://github.com/dk-code-factory/code-review-ad",
"commit": "5900df7e96463f0fc68a5c3c0d5e0dcfdf36cd95",
"license": "MIT",
"notice": "NOTICE",
"sourceHashes": {
"common/inspection.md": "80582feb0b2ec1db49eb0618b959fc7395c4a451c6420a205cf7450e3b125cce",
"common/reporting.md": "89edeba76749bc006420d6d7f33440ee9c8df71432836c72c2e0e76c698cd5e6",
"common/codex/passes/toolkit.md": "5033c2cf052084219a0e7ff50770d9fdecd2a75fcdbf0a92357f154469a85c69",
"common/codex/passes/standards.md": "687efa713215b1acb3f838252873309d504e21abb6eee5491d70015e0f205393",
"common/codex/passes/spec.md": "6eeb4841110941a677012d546e629131e8182f7ce600fc5d1ba9438e2742e349",
"common/codex/passes/performance.md": "4a776a01a7d8742fe980ee36c2156797c68863e4ec386785a85c1ed8d4663cdc"
},
"adaptedInto": [
"codex/skills/code-review-c/references/evidence.md",
"codex/skills/code-review-c/references/generic.md",
"codex/skills/code-review-c/references/aspects/"
]
}
],
"ownedChanges": {
"description": "New adaptive controller, focused backend guidance, deterministic inventory/planning/gates, onboarding harness and offline tests",
"paths": [
"codex/skills/code-review-c",
"scripts",
"tests"
]
},
"documentation": [
{
"url": "https://developers.openai.com/blog/eval-skills",
"accessed": "2026-10-24",
"use": "Behavioral evaluation method; no copied code"
},
{
"url": "https://developers.openai.com/codex/noninteractive",
"accessed": "2026-10-24",
"use": "Isolated exec flags and structured output"
}
]
}
66 changes: 64 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,70 @@
# code-review-c

Standalone adaptive Codex review skill. MIT licensed. The implementation lives on
`feat/adaptive-review-controller`; `main` contains the public scaffold.
Standalone adaptive Codex review skill. Version 0.1.0, MIT licensed.

Review quality comes first. Initial workload limits are provisional, not measured
model capacities. The first release supplies onboarding tools and runs no paid
calibration campaigns.

## Use

Install the stable `v0.1.0` tag into your Codex skills directory:

```sh
git clone --branch v0.1.0 --depth 1 https://github.com/dk-code-factory/code-review-c.git
skill_parent="${CODEX_HOME:-$HOME/.codex}/skills"
mkdir -p "$skill_parent"
test ! -e "$skill_parent/code-review-c" && cp -R code-review-c/codex/skills/code-review-c "$skill_parent/"
```

If that skill already exists, move the old directory aside before installing;
keep it for rollback. Alternatively, add the tagged checkout as a local Codex
plugin marketplace. The package contains exactly one skill, `code-review-c`.
It needs no sibling checkout, external review plugin, or build step. Select it
in Codex and request:

- “Review PR URL with code-review-c.”
- “Preview a strategy for base REV and head REV.”
- “Prepare model onboarding; do not run trials.”

Linux is the first-release support target. CI covers CPython 3.11–3.15; other
platforms and Python versions are unverified. Git and native Codex agents support
review/preview; authenticated `gh` supports GitHub PR pinning. Docker is needed
only for isolated onboarding trials and container integration checks. Models and effort inherit the host selection. A missing or
incompatible profile uses a provisional 58,000-byte total visible-input budget.
No measured profiles are distributed. Binary, submodule and type changes remain
explicit gaps requiring separate inspection; indivisible oversized hunks also remain
gaps. Dirty worktrees are recorded, but evidence comes only from pinned commits.

The controller identifies semantic relationships and applicable aspects; deterministic
helpers enforce exact hunk/aspect assignment, byte budgets, task dependencies and
whole-PR essential gates. Tasks queue within native concurrency. Security and serious
resource/performance checks remain essential after correctness findings. Optional
improvements open only after complete, verified, clean essential coverage.

Read the [skill](codex/skills/code-review-c/SKILL.md),
[controller procedure](codex/skills/code-review-c/references/controller.md),
[record contracts](codex/skills/code-review-c/references/contracts.md), and
[onboarding procedure](codex/skills/code-review-c/references/onboarding.md), and
[operating guide](codex/skills/code-review-c/references/operations.md).

## Development

```sh
python3 scripts/check.py
python3 scripts/test.py
```

Runtime and tests use the Python standard library. Tests simulate reviewers and
calibration receipts; they make no model calls. Onboarding preparation freezes
fixtures and candidate strategies without inference. Model trials require explicit
call/time limits and an immutable Docker image with Codex installed. Trial containers
see only pinned source/evidence and temporary Codex authentication, keeping answer
keys outside the reviewer filesystem. Three matched repetitions, held-out fixtures,
critical-defect recall, precision and completion gates precede profile promotion.

Keep review artifacts, campaign data, local profiles, credentials, private rules,
caches and benchmark results outside the package and reviewed repository. Provenance
for adapted review guidance is pinned in [PROVENANCE.json](PROVENANCE.json), with
upstream license notices retained in [NOTICE](NOTICE). This package does not change
the source `code-review-ad` repository or its configured reviewers.
40 changes: 40 additions & 0 deletions codex/skills/code-review-c/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
name: code-review-c
description: Review a pull request or pinned local revisions with adaptive focused Codex agents, preview a review strategy, or onboard a model using isolated evaluation campaigns.
---

Use this session as the controller. Resolve bundled paths from this skill directory,
not the reviewed repository. Python 3.11+, Git, and native Codex agents are required;
PR pinning also uses authenticated `gh`. No other skill or plugin is required.

Choose the requested mode:

- Review or preview: read [the controller procedure](references/controller.md).
Preview stops after validated planning and reports the proposed strategy and gaps.
- Onboard a model or import prior measurements: read [the onboarding procedure](references/onboarding.md).
Preparation and comparison run no models. Paid trials require explicit limits.

In review mode, use fresh native agents without inherited conversation for each
task. Reviewers do not spawn agents. Inherit the host-selected model and reasoning
effort; never set reviewer overrides. Resolve the actual reviewer identity from host
metadata when available. The controller's identity does not establish it. Unknown
identity, changed instructions, or missing compatible measurements require the
provisional strategy: at most **58,000 bytes total visible input per task**, including
patch, instructions, evidence, framing, and host-visible instructions. This is an
initial safety budget, not an established capacity or a token count.

Cover every changed hunk and all essential aspects before optional improvements.
Keep security and serious resource/performance checks active when other reviewers
find defects. Verify essential candidates before opening later stages. A verified
essential defect, unresolved essential finding, or incomplete essential coverage
blocks optional reviews across the entire PR. Queue remaining work within available
host concurrency; never reduce coverage to fit the number of agents.

Use measured profiles only for their exact identity, instruction hash, language,
domain, and primary review aspect. Prefer quality; use tokens and latency to break
quality ties. Keep all campaign data, traces, local profiles, and review artifacts
outside this plugin and the reviewed repository.

Return verified defects in priority order, then any separately labeled optional
improvements, material coverage gaps, and the reason optional stages were skipped.
Keep reports concise. Review does not authorize code edits or GitHub publication.
4 changes: 4 additions & 0 deletions codex/skills/code-review-c/agents/openai.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
interface:
display_name: "Adaptive Code Review"
short_description: "Focused reviews with measured model profiles"
default_prompt: "Use $code-review-c to review this branch against its base."
7 changes: 7 additions & 0 deletions codex/skills/code-review-c/references/aspects/concurrency.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Concurrency

Trace writers/readers, synchronization, ownership transfer, queue progress, and shutdown.
For every new wait, enumerate what settles it and whether peer I/O, cancellation or
abort is sequenced after the wait. Compare ordering with base. Verify lifecycle guards
cover setup and alternate writers; supported compile/runtime conditions matter. Show
a reachable interleaving and consequence rather than a hypothetical race.
7 changes: 7 additions & 0 deletions codex/skills/code-review-c/references/aspects/contracts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Interface contract

Inspect only the demonstrated relationship named in this task. Compare caller and
callee/schema/transport representations at the pinned revisions: types, names,
nullability, ordering, errors, ownership, authorization and completion semantics.
Use both endpoint hunk IDs and supplied evidence. Establish a concrete mismatch or
state that inspection was incomplete; shared directories are not evidence of a contract.
6 changes: 6 additions & 0 deletions codex/skills/code-review-c/references/aspects/correctness.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Correctness

Trace changed control flow, state transitions, boundary values, and supported failure
paths against base. Check early returns that bypass updates, ordering of completion,
stale state after failure, and assumptions made by callers. Read changed comments for
factual contradictions with those paths. Report supported defects, not alternative designs.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Data consistency

Follow transaction and state boundaries across persistence, caches, queues and APIs.
Check atomicity, isolation assumptions, retry/idempotency keys, migration ordering,
partial failure, and stale state while failures continue. Identify the concrete
invariant, reachable sequence, and observable violation, including recovery behavior.
7 changes: 7 additions & 0 deletions codex/skills/code-review-c/references/aspects/requirements.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Explicit requirements

Compare changed behavior with the pinned PR, supplied issues, user requirements and
acceptance criteria. Preserve quantifiers, configurations, and timing promises. Map
claims to actual branches and test stimuli. If no meaningful spec exists, state
`No spec available` as a gap; do not invent requirements. Distinguish a newly broken
promise from unchanged pre-existing behavior.
7 changes: 7 additions & 0 deletions codex/skills/code-review-c/references/aspects/resources.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Serious resource and performance defects (essential)

Trace acquisition/release, bounded queues and allocations, cancellation, error cleanup,
retry loops, shutdown, and work per request/item/retry. Show a realistic trigger and
consequential leak, exhaustion, unbounded growth, hot-path regression, or liveness
failure compared with base. Quantify work from code where possible. This check stays
active after other findings; optional scalability advice cannot replace it.
7 changes: 7 additions & 0 deletions codex/skills/code-review-c/references/aspects/rules.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Mandatory repository rules

Apply only documented guidance with matching scope. Cite the exact rule and predicate
violated, including exceptions. Compare changed setup/cleanup and public interfaces
with specific established conventions when the repository makes them mandatory.
Report evidenced maintenance defects only when named sites, coupled state, API
obligations or supported failure modes demonstrate a coordination consequence.
7 changes: 7 additions & 0 deletions codex/skills/code-review-c/references/aspects/scalability.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Scalability improvements (optional)

After the whole-PR essential gate is clean, inspect the named changed behavior for
growth in work, I/O, memory or contention under a stated realistic workload. Explain
the benefit and assumptions of an improvement. Do not present speculative scale as
an existing defect. If a serious defect appears, return incomplete and ask the
controller to reopen essential coverage.
7 changes: 7 additions & 0 deletions codex/skills/code-review-c/references/aspects/security.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Security

Follow changed trust boundaries: identity, authorization, tenant/object ownership,
untrusted input, filesystem/process/query sinks, credentials and logs. Verify that
validation occurs on every reachable supported path, including retries and alternate
APIs. Establish attacker-controlled input, a reachable sink, and impact. Keep this
check active even when correctness reviewers have findings; omit generic hardening.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Simplification improvements (optional)

After the whole-PR essential gate is clean, examine only the changed behavior named
by the controller. Identify concrete duplicated work, unnecessary state or coordination
and the supported behavior a simpler design must preserve. Avoid style preferences,
rewrites without benefit, or invented future requirements. New suspected defects
reopen essential coverage rather than becoming suggestions.
8 changes: 8 additions & 0 deletions codex/skills/code-review-c/references/aspects/tests.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Test defects

Map changed behavior to actual test stimuli. Check assertions do not already hold
before the action, both sides of interfaces are exercised, failure paths are reached,
waits have deadlines, and cleanup survives failed assertions/exceptions. Treat missing
deadlines and skipped cleanup as distinct mechanisms. Inspect build/configuration
coverage claimed by changed tests and comments. Missing tests alone is not a defect
without a claimed or mandatory coverage obligation or a demonstrable wrong assertion.
6 changes: 6 additions & 0 deletions codex/skills/code-review-c/references/backend/c.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# C backend

Trace bounds, integer overflow, ownership, allocation failure, aliasing, lifetime,
and all cleanup exits. Compare ABI/layout and compile-time feature guards with
callers. For concurrent paths verify synchronization and shutdown progress under
the actual memory model and supported build configurations.
10 changes: 10 additions & 0 deletions codex/skills/code-review-c/references/backend/common.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Backend evidence lenses

Use only lenses relevant to the task's primary purpose. Trace API input/output and
compatibility; authentication versus object/tenant authorization; persistence and
transaction boundaries; schema/migration compatibility during mixed-version deploys;
async ownership, retries, cancellation and shutdown; and resource cleanup after every
exit. For retries inspect stored state used by the next attempt, idempotency, backoff
and whether progress needs external change. For pooled resources inspect expiry and
reconfiguration. Evidence of an actual contract violation is required; retained desired
state or a delayed retry can be intentional.
6 changes: 6 additions & 0 deletions codex/skills/code-review-c/references/backend/cpp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# C++ backend

Trace RAII/lifetime and reference/iterator invalidation, move/copy ownership, exception
safety, bounds and integer conversion. Check new overrides against declarations and
supported compile guards. Follow futures, coroutine cancellation, pooled resources,
retry state and shutdown ordering; demonstrate progress or a reachable blocked path.
6 changes: 6 additions & 0 deletions codex/skills/code-review-c/references/backend/csharp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# C# backend

Trace Task ownership, async void boundaries, CancellationToken propagation, blocking
on async work, and disposal/IAsyncDisposable. Inspect DI scope and DbContext lifetime,
transaction boundaries, nullable contracts and serializer behavior. Check authorization
on alternate endpoints and background work as well as the main request path.
6 changes: 6 additions & 0 deletions codex/skills/code-review-c/references/backend/go.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Go backend

Trace goroutine exits, context cancellation, channel ownership, close/send order,
and WaitGroup progress. Check deferred cleanup placement, HTTP bodies, rows/errors,
transaction rollback, and error wrapping at callers. Compare shared state access and
slice/map aliasing under the module's actual Go version.
6 changes: 6 additions & 0 deletions codex/skills/code-review-c/references/backend/java.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Java backend

Trace executor/future ownership, interruption, blocking under locks, and exception
translation. Check try-with-resources and transaction/session lifetimes; equality,
nullability, collection mutation, and publication under actual concurrency. Verify
framework proxy/annotation boundaries when they control transactions or authorization.
6 changes: 6 additions & 0 deletions codex/skills/code-review-c/references/backend/javascript.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# JavaScript backend

Trace promise ownership, rejected async callbacks, cancellation/AbortSignal propagation,
event listeners/timers and stream backpressure. Check coercion, serialization and numeric
limits at APIs and storage; authorization must precede side effects on every route.
Distinguish a returned promise from fire-and-forget work using actual callers.
6 changes: 6 additions & 0 deletions codex/skills/code-review-c/references/backend/php.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# PHP backend

Check request/session and long-lived worker state separately; loose comparisons,
array/key coercion and null behavior at boundaries; prepared query parameters and
authorization before side effects. Trace transaction rollback, exception handling,
stream cleanup and retries under the pinned PHP/framework version.
6 changes: 6 additions & 0 deletions codex/skills/code-review-c/references/backend/python.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Python backend

Check async tasks are awaited/owned and cancellation reaches cleanup; context-manager
and generator lifetimes; shared mutable defaults/state; transaction/autocommit behavior;
and sync I/O inside event-loop paths. Verify exceptions do not silently turn failed
operations into success. Use the actual framework/runtime version from pinned evidence.
6 changes: 6 additions & 0 deletions codex/skills/code-review-c/references/backend/rust.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Rust backend

Trace future polling/ownership, dropped tasks, cancellation safety, lock guards across
awaits, channels and shutdown. Check error conversions and their display text against
all producing paths. Inspect unsafe contracts, lifetimes, atomics, transaction guards,
and pooled resource expiry/retry state under supported features and targets.
Loading
Loading