From 758baf9f508541bcfe8fd99ab784887e8ed5189f Mon Sep 17 00:00:00 2001 From: Brian M Hunt Date: Mon, 20 Apr 2026 12:48:47 -0400 Subject: [PATCH 1/4] Pin AI PR reviewer config: CodeRabbit primary, Codex secondary, Copilot off MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Prior PRs (notably #337) ran with all three reviewers on defaults, producing duplicate findings with uneven signal. Codify the intended division of labor: - CodeRabbit — primary. New .coderabbit.yaml with: - auto_review on main, drafts skipped - TKO-specific path_instructions so it doesn't flag factory-function-as-constructor, Object.setPrototypeOf, module- level side effects, or pervasive `any` as anti-patterns - spec-path instructions explaining vitest globals + Mocha/Chai/Sinon - chill profile, no poem, review_status on - Codex (chatgpt-codex-connector) — secondary / adversarial. Leave its auto-review installed so convergence between Codex and CodeRabbit signals high-confidence findings. Useful as a second opinion rather than a primary. - Copilot — disabled at the repo level (UI setting; no repo file). Its contributions on #337 were stale (flagged an O(n²) pattern that was already fixed) and misdirected (suggested env-gating that the maintainer explicitly rejected). Adds an "AI PR review" section to AGENTS.md documenting the arrangement so contributors and future agents understand the intent. Co-Authored-By: Claude Opus 4.7 (1M context) --- .coderabbit.yaml | 55 ++++++++++++++++++++++++++++++++++++++++++++++++ AGENTS.md | 15 +++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 .coderabbit.yaml diff --git a/.coderabbit.yaml b/.coderabbit.yaml new file mode 100644 index 00000000..6a15b966 --- /dev/null +++ b/.coderabbit.yaml @@ -0,0 +1,55 @@ +# CodeRabbit configuration — primary AI reviewer for TKO PRs. +# Codex (chatgpt-codex-connector) is kept as a secondary, adversarial +# reviewer for deep reviews on demand. GitHub Copilot auto-review is +# disabled at the repo level. + +# See https://docs.coderabbit.ai/guides/configure-coderabbit for the +# full schema. + +language: "en-US" +early_access: false + +reviews: + profile: "chill" + request_changes_workflow: false + high_level_summary: true + poem: false + review_status: true + collapse_walkthrough: false + + auto_review: + enabled: true + drafts: false + base_branches: + - main + + # TKO-specific context. The architectural carve-outs live in AGENTS.md + # and tko.io/public/agents/. Surface them to CodeRabbit so it doesn't + # flag them as anti-patterns. + path_instructions: + - path: "packages/**/*.ts" + instructions: | + TKO is a TypeScript MVVM framework with intentional architectural + choices that can look like anti-patterns but are not: + - Factory-function-as-constructor (`Object.setPrototypeOf`, `.fn` + prototype wiring) is the core primitive pattern for observables, + computeds, subscribables. Do NOT flag. + - Module-level side effects (prototype chain wiring, Symbol + registration, defineOption calls) are essential, not a smell. + - Pervasive `any` is accepted tech debt — flag only in net-new + code where a better type is obvious. + - `prefer-const` is off in this repo; `let` for never-reassigned + vars is fine. + - For runtime options (`ko.options.*`), the pattern is + `defineOption` from @tko/utils inside the owning package; see + tko.io/public/agents/options.md. + + - path: "packages/**/spec/**/*.ts" + instructions: | + Tests use Mocha-style describe/it with Chai assertions and Sinon + fake timers/spies. Vitest runs them with globals enabled. Bare + `it()` and `describe()` are expected; they come from vitest's + global injection, not a missing import. + +chat: + auto_reply: true diff --git a/AGENTS.md b/AGENTS.md index e99b7811..40aca47d 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -153,6 +153,21 @@ Significant changes should have a plan file in `plans/` before implementation begins. Plans document the context, approach, and verification steps. Review existing plans in that directory for format examples. +## AI PR review + +TKO uses AI reviewers in layered roles — see `plans/dark-factory.md` for the +broader context. + +- **CodeRabbit** — primary, auto-reviews every non-draft PR against `main`. + Config in `.coderabbit.yaml`. Use `@coderabbitai` commands to re-request + or chat. +- **Codex (chatgpt-codex-connector)** — secondary, adversarial / validation. + Triggered on demand for deep reviews or second opinions. Leave the default + auto-review on if/when you want convergence confirmation on risky PRs. +- **GitHub Copilot** — **disabled** at the repo level. It flagged stale and + misdirected findings on prior PRs and the signal-to-noise wasn't worth it. + Do not re-enable without a specific reason. + ## Agent-First Documentation AI coding agents are first-class citizens of TKO. The docs site serves both From f8ce701127fc7983b559786a622fc462f1a8221a Mon Sep 17 00:00:00 2001 From: Brian M Hunt Date: Mon, 20 Apr 2026 13:39:13 -0400 Subject: [PATCH 2/4] AGENTS.md: trim AI PR review section to one-line pointer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Keep AGENTS.md lean — the rationale and config belong in .coderabbit.yaml. AGENTS.md just needs the breadcrumb. Co-Authored-By: Claude Opus 4.7 (1M context) --- AGENTS.md | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 40aca47d..c8c76f42 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -155,18 +155,8 @@ existing plans in that directory for format examples. ## AI PR review -TKO uses AI reviewers in layered roles — see `plans/dark-factory.md` for the -broader context. - -- **CodeRabbit** — primary, auto-reviews every non-draft PR against `main`. - Config in `.coderabbit.yaml`. Use `@coderabbitai` commands to re-request - or chat. -- **Codex (chatgpt-codex-connector)** — secondary, adversarial / validation. - Triggered on demand for deep reviews or second opinions. Leave the default - auto-review on if/when you want convergence confirmation on risky PRs. -- **GitHub Copilot** — **disabled** at the repo level. It flagged stale and - misdirected findings on prior PRs and the signal-to-noise wasn't worth it. - Do not re-enable without a specific reason. +CodeRabbit (primary) + Codex (secondary). Copilot disabled. Config and +rationale in `.coderabbit.yaml`. ## Agent-First Documentation From 5fa64f37345c47ccd5259c473b455e069b8714c5 Mon Sep 17 00:00:00 2001 From: Brian M Hunt Date: Mon, 20 Apr 2026 13:42:53 -0400 Subject: [PATCH 3/4] Simplify .coderabbit.yaml: prune defaults, fix glob overlap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove every field that just restates a CodeRabbit default (language, early_access, profile: chill, request_changes_workflow, high_level_summary, review_status, collapse_walkthrough, auto_review sub-fields, chat.auto_reply). Keep only `poem: false` (default is true). - Drop the "TKO-specific context" comment block — the instructions below are self-explanatory. - Fix glob overlap: `packages/**/*.ts` matched spec files too, so CodeRabbit would attach BOTH instruction sets to every spec review. Narrow to `packages/*/src/**/*.ts` so src and spec patterns don't overlap. Net: 55 lines → 35 lines, same behavior. Co-Authored-By: Claude Opus 4.7 (1M context) --- .coderabbit.yaml | 30 +++++------------------------- 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/.coderabbit.yaml b/.coderabbit.yaml index 6a15b966..d8432f71 100644 --- a/.coderabbit.yaml +++ b/.coderabbit.yaml @@ -2,32 +2,15 @@ # Codex (chatgpt-codex-connector) is kept as a secondary, adversarial # reviewer for deep reviews on demand. GitHub Copilot auto-review is # disabled at the repo level. - -# See https://docs.coderabbit.ai/guides/configure-coderabbit for the -# full schema. - -language: "en-US" -early_access: false +# +# Schema: https://docs.coderabbit.ai/guides/configure-coderabbit +# Anything not set here uses CodeRabbit's default. reviews: - profile: "chill" - request_changes_workflow: false - high_level_summary: true poem: false - review_status: true - collapse_walkthrough: false - auto_review: - enabled: true - drafts: false - base_branches: - - main - - # TKO-specific context. The architectural carve-outs live in AGENTS.md - # and tko.io/public/agents/. Surface them to CodeRabbit so it doesn't - # flag them as anti-patterns. path_instructions: - - path: "packages/**/*.ts" + - path: "packages/*/src/**/*.ts" instructions: | TKO is a TypeScript MVVM framework with intentional architectural choices that can look like anti-patterns but are not: @@ -44,12 +27,9 @@ reviews: `defineOption` from @tko/utils inside the owning package; see tko.io/public/agents/options.md. - - path: "packages/**/spec/**/*.ts" + - path: "packages/*/spec/**/*.ts" instructions: | Tests use Mocha-style describe/it with Chai assertions and Sinon fake timers/spies. Vitest runs them with globals enabled. Bare `it()` and `describe()` are expected; they come from vitest's global injection, not a missing import. - -chat: - auto_reply: true From d517543c944e67b67ca6ddd83d2511ff2efd0aac Mon Sep 17 00:00:00 2001 From: Brian M Hunt Date: Mon, 20 Apr 2026 13:46:59 -0400 Subject: [PATCH 4/4] Drop path_instructions: don't pre-filter the reviewer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `do NOT flag` list was gatekeeping masquerading as context. CodeRabbit is better off with a clear view of the repo than with a pre-filtered opinion of what it's allowed to notice. If it produces false positives on TKO's intentional patterns (factory-function-as- constructor, module-level side effects, etc.), we add narrow guidance reactively. Test-style instructions also gone — defensive against findings that probably weren't coming anyway. Config is now `poem: false` plus CodeRabbit defaults. Co-Authored-By: Claude Opus 4.7 (1M context) --- .coderabbit.yaml | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/.coderabbit.yaml b/.coderabbit.yaml index d8432f71..08e5124b 100644 --- a/.coderabbit.yaml +++ b/.coderabbit.yaml @@ -8,28 +8,3 @@ reviews: poem: false - - path_instructions: - - path: "packages/*/src/**/*.ts" - instructions: | - TKO is a TypeScript MVVM framework with intentional architectural - choices that can look like anti-patterns but are not: - - Factory-function-as-constructor (`Object.setPrototypeOf`, `.fn` - prototype wiring) is the core primitive pattern for observables, - computeds, subscribables. Do NOT flag. - - Module-level side effects (prototype chain wiring, Symbol - registration, defineOption calls) are essential, not a smell. - - Pervasive `any` is accepted tech debt — flag only in net-new - code where a better type is obvious. - - `prefer-const` is off in this repo; `let` for never-reassigned - vars is fine. - - For runtime options (`ko.options.*`), the pattern is - `defineOption` from @tko/utils inside the owning package; see - tko.io/public/agents/options.md. - - - path: "packages/*/spec/**/*.ts" - instructions: | - Tests use Mocha-style describe/it with Chai assertions and Sinon - fake timers/spies. Vitest runs them with globals enabled. Bare - `it()` and `describe()` are expected; they come from vitest's - global injection, not a missing import.