Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
46eb3cc
chore: add oxlint hardened config and fix violations
Jul 18, 2026
b146301
chore: enable exactOptionalPropertyTypes and stricter tsconfig flags
Jul 18, 2026
338b5e6
chore: add prettier, editorconfig and lefthook hooks
Jul 18, 2026
a8a73a3
fix: strip inherited GIT_DIR/GIT_WORK_TREE from git subprocess env
Jul 18, 2026
9d7534c
fix: extract multi-statement click handlers in ReviewShell
Jul 18, 2026
75dc854
style: format codebase with prettier
Jul 18, 2026
df939a1
test: force non-interactive TTY state for sync push assertions
Jul 18, 2026
b29ab2a
ci: add quality workflow with lint, format, typecheck, tests and publint
Jul 18, 2026
5732e38
fix: restrict git env filtering to repo-targeting variables
Jul 18, 2026
56c1f20
Merge branch 'develop' into chore/durcissement-lint
Jul 31, 2026
f273600
ci: restrict quality workflow token to contents read
Jul 31, 2026
85617b7
Merge pull request #9 from getCodesema/chore/durcissement-lint
naashw Jul 31, 2026
1cd37cb
feat(cli): add best-effort server_context channel to review input
Aug 2, 2026
932b8c2
test(cli): cover server_context fetch, staleness and review wiring
Aug 2, 2026
98df8cc
merge: server context channel
Aug 2, 2026
bcb5de9
chore: init
Aug 2, 2026
afa5486
chore: init
Aug 2, 2026
550d85b
chore: init
Aug 2, 2026
501f7f2
chore: init
Aug 2, 2026
139800c
chore: init
Aug 2, 2026
49fec34
chore: init
Aug 2, 2026
45c744f
chore: init
Aug 2, 2026
ded179b
chore: init
Aug 2, 2026
8d015a6
chore: init
Aug 2, 2026
de5ea31
chore: init
Aug 2, 2026
3bcd6b1
chore: init
Aug 2, 2026
311e9e4
chore: init
Aug 2, 2026
c9d0f44
chore: init
Aug 2, 2026
5342ead
chore: init
Aug 2, 2026
5622ec1
chore: init
Aug 2, 2026
5d55ac2
chore: init
Aug 2, 2026
c397e67
chore: init
Aug 2, 2026
b5ccf59
chore: init
Aug 2, 2026
13f4cd9
chore: init
Aug 2, 2026
f4e3919
chore: init
Aug 2, 2026
3f7119b
chore: init
Aug 2, 2026
2148f1e
chore: init
Aug 2, 2026
8c48412
chore: init
Aug 2, 2026
c7b80be
chore: init
Aug 2, 2026
da0c484
chore: init
Aug 2, 2026
5e999c8
chore: init
Aug 2, 2026
9716943
chore: init
Aug 2, 2026
b3e014a
chore: init
Aug 2, 2026
d5f96c1
chore: init
Aug 2, 2026
7ff0236
chore: init
Aug 2, 2026
7455846
chore: init
Aug 2, 2026
bd6056d
chore: init
Aug 2, 2026
e6fd124
chore: init
Aug 2, 2026
4c90591
chore: init
Aug 2, 2026
9ebfc60
chore: init
Aug 2, 2026
75b75a8
chore: init
Aug 2, 2026
39dec1c
chore: init
Aug 2, 2026
fa784c0
chore: init
Aug 2, 2026
3c4735e
chore: init
Aug 2, 2026
08483ed
chore: init
Aug 2, 2026
c7bf234
chore: init
Aug 2, 2026
630bbf1
chore: init
Aug 2, 2026
39b73bf
chore: init
Aug 2, 2026
c6277d4
chore: init
Aug 2, 2026
d784da4
chore: init
Aug 2, 2026
95dbf6c
chore: init
Aug 2, 2026
a944c13
chore: init
Aug 2, 2026
f8764be
chore: init
Aug 2, 2026
ba1a8c3
chore: init
Aug 2, 2026
f90fed7
chore: init
Aug 2, 2026
9ac4362
chore: init
Aug 2, 2026
1186ffb
chore: init
Aug 2, 2026
d9d5504
chore: init
Aug 2, 2026
8d159ae
chore: init
Aug 2, 2026
2d402f7
chore: init
Aug 2, 2026
54fef66
chore: init
Aug 2, 2026
d4b4509
fix(cli): strip GIT_DIR/GIT_WORK_TREE in server-context test git helpers
Aug 2, 2026
7cd58bf
fix(cli): send remote_url query param to GET /api/cli/context
Aug 2, 2026
bdf726c
feat: send remote_url and match the real context endpoint
Aug 2, 2026
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
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Publish to npm
on:
push:
tags:
- "v*"
- 'v*'

permissions:
id-token: write
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Quality

on:
pull_request:
push:
branches:
- main
- develop

permissions:
contents: read

jobs:
quality:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: oven-sh/setup-bun@v2

- run: bun install --frozen-lockfile

- run: bun run lint

- run: bun run format:check

- run: bun run typecheck

- run: bun run build

- run: bun run test

- run: bunx publint packages/cli

- run: bunx publint packages/contract
65 changes: 65 additions & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"categories": {
"correctness": "error",
"perf": "error",
"suspicious": "error"
},
"rules": {
"complexity": ["warn", 10],
"curly": ["error", "all"],
"eqeqeq": ["error", "always", { "null": "ignore" }],
"max-depth": ["warn", 3],
"max-lines": ["warn", { "max": 400, "skipBlankLines": true, "skipComments": true }],
"max-lines-per-function": ["warn", { "max": 60, "skipBlankLines": true, "skipComments": true }],
"max-nested-callbacks": ["warn", 3],
"max-params": ["error", { "max": 4 }],
"no-await-in-loop": "off",
"no-else-return": ["error", { "allowElseIf": false }],
"no-lonely-if": "error",
"no-param-reassign": "error",
"no-underscore-dangle": [
"error",
{ "allow": ["__CODESEMA_VERSION__", "__CODESEMA_LOCALE__", "__CODESEMA_FIX_TOKEN__"] }
],
"oxc/no-map-spread": "off",
"typescript/consistent-type-definitions": ["error", "type"],
"typescript/no-explicit-any": "error",
"typescript/no-non-null-assertion": "error",
"typescript/no-require-imports": "error",
"unicorn/consistent-function-scoping": "warn",
"unicorn/filename-case": ["error", { "case": "kebabCase" }],
"unicorn/prefer-node-protocol": "error"
},
"overrides": [
{
"files": ["**/*.test.ts"],
"rules": {
"max-lines": "off",
"max-lines-per-function": "off",
"max-nested-callbacks": ["warn", 5],
"typescript/no-non-null-assertion": "off"
}
},
{
"files": ["**/*.vue"],
"rules": {
"unicorn/filename-case": ["error", { "case": "pascalCase" }]
}
},
{
"files": ["packages/web/src/composables/**"],
"rules": {
"unicorn/filename-case": ["error", { "case": "camelCase" }]
}
},
{
"files": ["**/*.d.ts"],
"rules": {
"typescript/consistent-type-definitions": "off",
"unicorn/require-module-specifiers": "off"
}
}
],
"ignorePatterns": ["node_modules", "dist", "web-dist", "coverage"]
}
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
dist
web-dist
coverage
bun.lock
CHANGELOG.md
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
All notable changes to `codesema` (the npm package in `packages/cli`) are documented here.
Format: [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). Versioning: [SemVer](https://semver.org).

## [0.11.0] - 2026-08-02

### Added

- Server context download: `codesema review` fetches `GET /api/cli/context` (conventions, learned rules, facts, last-scan freshness) for the current repo and hands it to the agent alongside the diff. The origin remote (`git remote get-url origin`) is sent as the `remote_url` query param the route requires to resolve the repo. Strictly best-effort and never blocking, same contract as auto-sync: no stored workspace credentials, no origin remote, offline, an unlinked workspace (403) or any malformed response all silently degrade to no server context, and the local review runs unchanged. `.codesema/RULES.md` stays local and always takes precedence.
- Staleness warning: when the server's last scan commit is not an ancestor of the current `HEAD`, the context is prefixed with an explicit warning naming the scan date, so the agent treats the conventions, learned rules and facts as advisory rather than ground truth about the current diff.

## [0.10.0] - 2026-07-29

### Added
Expand Down
48 changes: 24 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ npx -y codesema config

Interactive: language → agent → model → effort, then where to save. Two levels, field by field:

| Level | File | When |
| ------ | -------------------------------- | -------------------------------------- |
| Global | `~/.config/codesema/config.json` | Your default, every repo (onboarding) |
| Level | File | When |
| ------ | -------------------------------- | --------------------------------------- |
| Global | `~/.config/codesema/config.json` | Your default, every repo (onboarding) |
| Repo | `.codesema/config.json` | Team/project override, wins over global |

CLI flags always win over both. `target`, `port`, `timeout` and `language` can also be set in either file.
Expand Down Expand Up @@ -121,7 +121,7 @@ Then, in any repo, on your feature branch, ask your agent: `/codesema`. It uses
## Customize

- `.codesema/PROMPT.md`: your team's review instructions, merged into the agent prompt.
- `.codesema/RULES.md`: your team's review rules, one per line, hunted first by the reviewer. Put the highest-yield rules on top; each line may extend the rule with optional `|`-separated segments the reviewer knows how to use: `(category) rule | Scope: where in the repo it applies | Where to look: files, imports or code shapes to inspect | Bad: literal rejected form | Good: literal expected form | Exceptions: tolerated legacy, never flagged`. Rules are cited as `[C1]`, `[C2]`, ... (file order) in convention findings. Telling the reviewer *where to look* is what makes a rule catch violations.
- `.codesema/RULES.md`: your team's review rules, one per line, hunted first by the reviewer. Put the highest-yield rules on top; each line may extend the rule with optional `|`-separated segments the reviewer knows how to use: `(category) rule | Scope: where in the repo it applies | Where to look: files, imports or code shapes to inspect | Bad: literal rejected form | Good: literal expected form | Exceptions: tolerated legacy, never flagged`. Rules are cited as `[C1]`, `[C2]`, ... (file order) in convention findings. Telling the reviewer _where to look_ is what makes a rule catch violations.
- `.codesema-ignore`: glob patterns excluded from the diff (lockfiles, minified files and sourcemaps are excluded by default).

## Troubleshooting
Expand All @@ -135,33 +135,33 @@ Then, in any repo, on your feature branch, ask your agent: `/codesema`. It uses

## Environment variables

| Variable | Effect |
| -------------------------- | --------------------------------------------------------------------------------- |
| `CODESEMA_CONFIG_DIR` | Override the global config directory (default `~/.config/codesema`). |
| `CODESEMA_NO_UPDATE_CHECK` | Set to `1` to skip the startup npm version check (also skipped when not a TTY). |
| `CODESEMA_SYNC_URL` | Point `sync`/`link` at a different codesema.com host (self-hosted or staging). |
| Variable | Effect |
| -------------------------- | ------------------------------------------------------------------------------- |
| `CODESEMA_CONFIG_DIR` | Override the global config directory (default `~/.config/codesema`). |
| `CODESEMA_NO_UPDATE_CHECK` | Set to `1` to skip the startup npm version check (also skipped when not a TTY). |
| `CODESEMA_SYNC_URL` | Point `sync`/`link` at a different codesema.com host (self-hosted or staging). |

## Files

| Path | Contents |
| --------------------------------- | ---------------------------------------------------------------------------- |
| `~/.config/codesema/config.json` | Global config (language, agent, model, effort, sync credentials), mode `0600`. |
| `.codesema/config.json` | Repo config, overrides the global one. |
| `.codesema/input.json` | The prepared MR diff handed to the agent (`prep`). |
| `.codesema/review.json` | The latest review written by the agent. |
| `.codesema/reviews/` | Archived reviews (5 kept per branch, used for incremental re-review). |
| `.codesema/PROMPT.md` | Your team's extra review instructions, merged into the prompt. |
| `.codesema/RULES.md` | Your team's review rules (one `[Cn]` grid line each), hunted first. |
| `.codesema-ignore` | Glob patterns excluded from the diff. |
| Path | Contents |
| -------------------------------- | ------------------------------------------------------------------------------ |
| `~/.config/codesema/config.json` | Global config (language, agent, model, effort, sync credentials), mode `0600`. |
| `.codesema/config.json` | Repo config, overrides the global one. |
| `.codesema/input.json` | The prepared MR diff handed to the agent (`prep`). |
| `.codesema/review.json` | The latest review written by the agent. |
| `.codesema/reviews/` | Archived reviews (5 kept per branch, used for incremental re-review). |
| `.codesema/PROMPT.md` | Your team's extra review instructions, merged into the prompt. |
| `.codesema/RULES.md` | Your team's review rules (one `[Cn]` grid line each), hunted first. |
| `.codesema-ignore` | Glob patterns excluded from the diff. |

## Exit codes

| Code | Meaning |
| ----- | ---------------------------------------------------------------------------------------------- |
| `0` | Success (review completed; with `--fail-on`, nothing tripped the gate). |
| `1` | Error (bad invocation, agent failure, unusable output, or a blocked secret sync). |
| Code | Meaning |
| ----- | ------------------------------------------------------------------------------------------------ |
| `0` | Success (review completed; with `--fail-on`, nothing tripped the gate). |
| `1` | Error (bad invocation, agent failure, unusable output, or a blocked secret sync). |
| `2` | `review --fail-on <level>` gate tripped (a finding at or above the level, or changes requested). |
| `130` | Interrupted with Ctrl-C. |
| `130` | Interrupted with Ctrl-C. |

## Development

Expand Down
Loading
Loading