From e7ef63469449ce5f6230eb37933d59a0d4efc149 Mon Sep 17 00:00:00 2001 From: elkaix Date: Tue, 11 Aug 2026 22:33:34 -0400 Subject: [PATCH 1/2] chore: add Greptile code review configuration --- .greptile/config.json | 39 +++++++++++++++++++++++++++++++++++++++ .greptile/files.json | 33 +++++++++++++++++++++++++++++++++ .greptile/rules.md | 23 +++++++++++++++++++++++ 3 files changed, 95 insertions(+) create mode 100644 .greptile/config.json create mode 100644 .greptile/files.json create mode 100644 .greptile/rules.md diff --git a/.greptile/config.json b/.greptile/config.json new file mode 100644 index 000000000..716004c49 --- /dev/null +++ b/.greptile/config.json @@ -0,0 +1,39 @@ +{ + "strictness": 2, + "commentTypes": ["logic", "syntax"], + "triggerOnUpdates": true, + "includeBranches": ["main"], + "ignoreKeywords": "WIP\nDO NOT REVIEW", + "ignorePatterns": "node_modules/**\ndist/**\nbuild/**\n**/*.min.js\npnpm-lock.yaml\nflake.lock\n**/*.snap\nreports/**\n**/*.webp\n**/*.png\n**/*.gif", + "instructions": "TypeScript pnpm monorepo for pythinker-code, a provider-agnostic AI coding agent. packages/* are published libraries; apps/* are the CLI/TUI, web UI, and dashboard. The root AGENTS.md is the authoritative contributor guide; nearest sub-directory AGENTS.md files add local rules.", + "rules": [ + { + "id": "no-type-weakening", + "rule": "Do not weaken types to silence errors: no `any`, unconstrained `unknown`, `@ts-ignore`, or type assertions added only to make a type error go away.", + "scope": ["packages/**", "apps/**"], + "severity": "high" + }, + { + "id": "flake-workspace-sync", + "rule": "When a workspace package is added or removed in pnpm-workspace.yaml, flake.nix workspacePaths and workspaceNames must be updated in the same PR. A missing path silently drops files from the Nix build.", + "severity": "high" + }, + { + "id": "tests-can-fail", + "rule": "Tests must be able to fail. Flag vacuous assertions: empty-set matches, missing awaits on async expectations, and mocked units asserting on the mock itself.", + "scope": ["**/*.test.ts", "**/*.test.tsx"], + "severity": "medium" + }, + { + "id": "tui-reactivity", + "rule": "Solid signals must not be destructured, rendering must stay allocation-light, and no blocking I/O on the render path.", + "scope": ["apps/pythinker-code/src/tui/**"], + "severity": "high" + }, + { + "id": "changeset-required", + "rule": "PRs that change published package behavior need a changeset. Default to minor or patch; a major bump requires explicit maintainer confirmation.", + "severity": "medium" + } + ] +} diff --git a/.greptile/files.json b/.greptile/files.json new file mode 100644 index 000000000..ad2e1bf2d --- /dev/null +++ b/.greptile/files.json @@ -0,0 +1,33 @@ +{ + "files": [ + { + "path": "AGENTS.md", + "description": "Repository-wide contributor guide: product identity, project map, coding rules, and PR workflow" + }, + { + "path": "apps/pythinker-code/AGENTS.md", + "description": "CLI / terminal UI app rules", + "scope": ["apps/pythinker-code/**"] + }, + { + "path": "apps/pythinker-web/AGENTS.md", + "description": "Browser UI (Vue 3) rules", + "scope": ["apps/pythinker-web/**"] + }, + { + "path": "packages/server/AGENTS.md", + "description": "Server package rules (REST + WS /api/v1)", + "scope": ["packages/server/**"] + }, + { + "path": "packages/server-e2e/AGENTS.md", + "description": "E2E test suite rules", + "scope": ["packages/server-e2e/**"] + }, + { + "path": "docs/AGENTS.md", + "description": "Documentation rules", + "scope": ["docs/**"] + } + ] +} diff --git a/.greptile/rules.md b/.greptile/rules.md new file mode 100644 index 000000000..bcc5f2d2f --- /dev/null +++ b/.greptile/rules.md @@ -0,0 +1,23 @@ +# Review Rules + +## TypeScript conventions + +- `user?: User`, never `user?: User | undefined`. +- Pass `undefined` directly for optional props — no conditional spread. +- Single-param internal methods stay single-param — no options-object wrapping. +- Non-root `index.ts` files: prefer `export * from './module'`. +- Prefer `import ... from '#/...'` over deep relative paths (equivalent to `@/...`). + +## Architecture boundaries + +- `apps/pythinker-code` and `apps/pythinker-web` must not depend on `packages/agent-core`. They consume the SDK (`@pythoughts/pythinker-code-sdk`) or the server REST/WS API. +- The `Agent` class in `packages/agent-core` stays standalone: no mandatory `Session` or `agentId`; optional `sessionId` is a provider hint only. +- `packages/acp-adapter` pins `@agentclientprotocol/sdk` to `^0.23.0` — flag any bump to 0.24+ (it broke the session-model API). +- Experimental features are gated behind flags in `packages/agent-core/src/flags/registry.ts`, not shipped unguarded. + +## Hygiene + +- English-only code, comments, and identifiers. Unicode tests use ASCII/Latin fixtures (e.g. `café`). +- No backward-compatibility shims; implement the current requirement directly. +- Prefer adding tests to existing test files over creating new ones. +- Internal identifiers must not appear in public text or test data — use neutral placeholders. From 0cd20ee54f3fef9fbb6c83a3735382c6cba87ba5 Mon Sep 17 00:00:00 2001 From: elkaix Date: Tue, 11 Aug 2026 22:40:27 -0400 Subject: [PATCH 2/2] chore: address review feedback on Greptile configuration --- .greptile/config.json | 6 +++--- .greptile/files.json | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.greptile/config.json b/.greptile/config.json index 716004c49..16d746e76 100644 --- a/.greptile/config.json +++ b/.greptile/config.json @@ -1,11 +1,11 @@ { "strictness": 2, - "commentTypes": ["logic", "syntax"], + "commentTypes": ["logic", "syntax", "style"], "triggerOnUpdates": true, "includeBranches": ["main"], "ignoreKeywords": "WIP\nDO NOT REVIEW", "ignorePatterns": "node_modules/**\ndist/**\nbuild/**\n**/*.min.js\npnpm-lock.yaml\nflake.lock\n**/*.snap\nreports/**\n**/*.webp\n**/*.png\n**/*.gif", - "instructions": "TypeScript pnpm monorepo for pythinker-code, a provider-agnostic AI coding agent. packages/* are published libraries; apps/* are the CLI/TUI, web UI, and dashboard. The root AGENTS.md is the authoritative contributor guide; nearest sub-directory AGENTS.md files add local rules.", + "instructions": "TypeScript pnpm monorepo for pythinker-code, a provider-agnostic AI coding agent. The published user-facing package is the CLI (@pythoughts/pythinker-code); packages/node-sdk is the public TypeScript SDK; packages/agent-core, kosong, kaos, oauth, and telemetry are internal engine packages. apps/* are the CLI/TUI, web UI, and dashboard. The root AGENTS.md is the authoritative contributor guide; nearest sub-directory AGENTS.md files add local rules.", "rules": [ { "id": "no-type-weakening", @@ -32,7 +32,7 @@ }, { "id": "changeset-required", - "rule": "PRs that change published package behavior need a changeset. Default to minor or patch; a major bump requires explicit maintainer confirmation.", + "rule": "Every PR that affects release artifacts (code, behavior, or public API) must include a changeset; only docs-only, test-only, or CI-only PRs may skip one. Default to minor or patch; a major bump requires explicit maintainer confirmation.", "severity": "medium" } ] diff --git a/.greptile/files.json b/.greptile/files.json index ad2e1bf2d..28e6b6493 100644 --- a/.greptile/files.json +++ b/.greptile/files.json @@ -14,6 +14,11 @@ "description": "Browser UI (Vue 3) rules", "scope": ["apps/pythinker-web/**"] }, + { + "path": "packages/agent-core/src/services/AGENTS.md", + "description": "Service layer rules: naming, layout, and registration conventions", + "scope": ["packages/agent-core/src/services/**"] + }, { "path": "packages/server/AGENTS.md", "description": "Server package rules (REST + WS /api/v1)",