Skip to content

Commit 953d82d

Browse files
tae2089claude
andcommitted
refactor: remove auto-rules.yaml / Twice Rule lint feature
The Twice Rule generated warn-only entries into .ccg/auto-rules.yaml, but generated rules were action:warn and lint only honors action:ignore, so they never suppressed findings, changed strict pass/fail, or surfaced as warnings. The feature's only observable effect was writing state files, while adding a second rules file, merge logic, a migration command, and consecutive-occurrence history tracking. Remove it entirely; lint now uses only manual action:ignore rules from .ccg.yaml. Drops autorules/history sources and the StateFiles port that existed solely for their state files, the --history-dir and --migrate-auto-rules flags, and updates the guide docs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent e75f978 commit 953d82d

18 files changed

Lines changed: 43 additions & 1123 deletions

File tree

guide/architecture.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ CLI / MCP / HTTP / Wiki / webhook -> application capabilities -> outbound ports
3838
and retrieval evidence. It also owns identifier tokenization shared by search
3939
documents, ranking, and query syntax. SQLite uses FTS5; PostgreSQL uses
4040
tsvector/GIN.
41-
- `app/docs`: deterministic Markdown generation, history, auto-rules, and lint.
41+
- `app/docs`: deterministic Markdown generation and lint.
4242
- `app/wiki`: CCG's built-in code-exploration tree and compatibility snapshot.
4343
This is a CCG capability, not the separate future OpenWiki product.
4444
- `app/reposync`: repository admission, branch policy, retry/queue policy, and

guide/cli-reference.md

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -244,22 +244,18 @@ Override with `ccg --config path/to/config.yaml`.
244244
| incomplete | Incomplete annotation |
245245
| drifted | Annotation not updated after code change |
246246

247-
For lint rule matching, both `drifted` and `drift` are accepted for the same category. User-facing reports use `drifted`, while generated state and internal normalization may use `drift`.
247+
For lint rule matching, both `drifted` and `drift` are accepted for the same category. User-facing reports use `drifted`, while internal normalization may use `drift`.
248248

249249
See [Lint Guide](lint.md) for the exact per-category rules, overlaps, and implementation-aligned semantics.
250250

251-
Per-category `action: ignore` can be set in `.ccg.yaml`'s `rules`. In `--strict` mode, `action: ignore` rules are applied.
251+
### Lint Rules
252252

253-
### Lint Policy vs Generated State
253+
Lint policy lives in `.ccg.yaml`'s `rules` section — a list of suppression rules:
254254

255-
CCG now separates human-managed lint policy from generated lint state:
255+
| Field | Purpose |
256+
|-------|---------|
257+
| `pattern` | Exact qualified name or regular expression to match |
258+
| `category` | Lint category the rule applies to (e.g. `unannotated`, `orphan`) |
259+
| `action` | `ignore` to suppress matching findings |
256260

257-
| Path | Owner | Purpose |
258-
|------|-------|---------|
259-
| `.ccg.yaml` | Human | Project policy: excludes, include paths, manual lint rules (`ignore`, etc.) |
260-
| `.ccg/lint-history.json` | Generated | Twice Rule consecutive-occurrence counters |
261-
| `.ccg/auto-rules.yaml` | Generated | Warn-only rules recorded by Twice Rule |
262-
263-
`ccg lint` no longer appends generated warn rules into `.ccg.yaml`. Repeated issues are recorded in `.ccg/auto-rules.yaml`, while `.ccg.yaml` remains the place for manual policy decisions.
264-
265-
If an older repository already has generated `auto: true` rules inside `.ccg.yaml`, run `ccg lint --migrate-auto-rules` once to move them into `.ccg/auto-rules.yaml`.
261+
`action: ignore` rules are applied in normal and `--strict` mode alike; findings they match are filtered from the report and excluded from the strict failure count.

guide/ko/architecture.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ CLI / MCP / HTTP / Wiki / webhook -> application capability -> outbound port
3636
- `app/search`: search document 생성, FTS retrieval, 구조 rerank, retrieval evidence,
3737
그리고 document/rank/query syntax가 공유하는 identifier tokenization을 소유합니다.
3838
SQLite는 FTS5, PostgreSQL은 tsvector/GIN을 사용합니다.
39-
- `app/docs`: 결정적 Markdown 생성, history, auto-rule, lint.
39+
- `app/docs`: 결정적 Markdown 생성 lint.
4040
- `app/wiki`: CCG 고유의 코드 탐색 tree와 compatibility snapshot. 별도 제품인
4141
향후 OpenWiki와 합치거나 추출하지 않습니다.
4242
- `app/reposync`: repository admission, branch 정책, retry/queue, checkout부터

guide/ko/cli-reference.md

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -224,22 +224,18 @@ rules:
224224
| incomplete | 불완전한 어노테이션 |
225225
| drifted | 코드 변경 후 업데이트되지 않은 어노테이션 |
226226

227-
lint 규칙 매칭에서는 `drifted`와 `drift`를 같은 카테고리로 모두 받을 수 있습니다. 사용자에게 보이는 리포트 이름은 `drifted`이고, 내부 정규화나 generated state에서는 `drift`가 사용될 수 있습니다.
227+
lint 규칙 매칭에서는 `drifted`와 `drift`를 같은 카테고리로 모두 받을 수 있습니다. 사용자에게 보이는 리포트 이름은 `drifted`이고, 내부 정규화에서는 `drift`가 사용될 수 있습니다.
228228

229229
각 카테고리별 규칙, 중복 및 구현 정렬 의미에 대한 자세한 내용은 [Lint 가이드](lint.md)를 참조하십시오.
230230

231-
카테고리별 `action: ignore`는 `.ccg.yaml`의 `rules`에서 설정할 수 있습니다. `--strict` 모드에서는 `action: ignore` 규칙이 적용됩니다.
231+
### Lint 규칙
232232

233-
### Lint Policy vs Generated State
233+
린트 정책은 `.ccg.yaml`의 `rules` 섹션에 억제 규칙 목록으로 저장됩니다.
234234

235-
CCG는 이제 사람이 관리하는 린트 정책과 생성된 린트 상태를 분리합니다.
235+
| 필드 | 용도 |
236+
|------|------|
237+
| `pattern` | 매칭할 정확한 정규화 이름 또는 정규식 |
238+
| `category` | 규칙이 적용되는 린트 카테고리 (예: `unannotated`, `orphan`) |
239+
| `action` | 매칭된 결과를 억제하려면 `ignore` |
236240

237-
| 경로 | 소유자 | 용도 |
238-
|------|-------|---------|
239-
| `.ccg.yaml` | 사람 | 프로젝트 정책: 제외, 포함 경로, 수동 린트 규칙(`ignore` 등) |
240-
| `.ccg/lint-history.json` | 생성됨 | Twice Rule 연속 발생 카운터 |
241-
| `.ccg/auto-rules.yaml` | 생성됨 | Twice Rule에 의해 기록된 경고 전용 규칙 |
242-
243-
`ccg lint`는 더 이상 생성된 경고 규칙을 `.ccg.yaml`에 추가하지 않습니다. 반복되는 문제는 `.ccg/auto-rules.yaml`에 기록되며, `.ccg.yaml`은 수동 정책 결정을 위한 장소로 남습니다.
244-
245-
이전 버전의 저장소에 이미 `.ccg.yaml` 내부에 생성된 `auto: true` 규칙이 있는 경우, `ccg lint --migrate-auto-rules`를 한 번 실행하여 `.ccg/auto-rules.yaml`로 이동하십시오.
241+
`action: ignore` 규칙은 일반 모드와 `--strict` 모드에서 동일하게 적용됩니다. 매칭된 결과는 리포트에서 필터링되고 strict 실패 카운트에서도 제외됩니다.

guide/ko/lint.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -244,13 +244,9 @@ rules:
244244
action: ignore
245245
```
246246
247-
생성된 린트 상태는 수동 정책과 별도로 저장됩니다:
247+
`action: ignore` 규칙은 매칭되는 결과를 억제하며, `--strict` 모드에서도 동일하게 적용됩니다. 패턴은 정확한 정규화 이름 또는 정규식일 수 있습니다.
248248

249-
- `.ccg.yaml` — 수동 린트 정책
250-
- `.ccg/lint-history.json` — 생성된 발생 카운터
251-
- `.ccg/auto-rules.yaml` — 생성된 경고 전용 규칙
252-
253-
정확한 규칙 흐름은 [CLI 레퍼런스](cli-reference.md#lint-policy-vs-generated-state)를 참조하십시오.
249+
전체 규칙 레퍼런스는 [CLI 레퍼런스](cli-reference.md#lint-categories)를 참조하십시오.
254250

255251
## CI 및 Strict 모드
256252

guide/lint.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -242,13 +242,9 @@ rules:
242242
action: ignore
243243
```
244244
245-
Generated lint state is stored separately from human policy:
245+
Rules with `action: ignore` suppress matching findings, including under `--strict`. Patterns may be exact qualified names or regular expressions.
246246

247-
- `.ccg.yaml` — manual lint policy
248-
- `.ccg/lint-history.json` — generated occurrence counters
249-
- `.ccg/auto-rules.yaml` — generated warn-only rules
250-
251-
See [CLI Reference](cli-reference.md#lint-policy-vs-generated-state) for the exact rule flow.
247+
See [CLI Reference](cli-reference.md#lint-categories) for the full rule reference.
252248

253249
## CI and Strict Mode
254250

internal/adapters/inbound/cli/init.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ exclude:
2121
docs:
2222
out: docs
2323
24-
# lint policy lives in .ccg.yaml.
25-
# generated lint state such as Twice Rule history and auto warn rules lives under .ccg/.
24+
# lint policy (suppression rules) lives in .ccg.yaml under the rules section.
2625
2726
parse:
2827
max_file_bytes: 0

0 commit comments

Comments
 (0)