Skip to content

Commit 4fe37cb

Browse files
tae2089claude
andcommitted
docs: document cross-namespace refs, federated reads, and list_cross_refs
Update English and Korean guides (mcp-tools, annotations, architecture, counts in README/development/runtime-layout), CLAUDE.md, and the ccg-analyze / ccg-namespace skills for the new cross-namespace surface. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 7c51bee commit 4fe37cb

14 files changed

Lines changed: 68 additions & 33 deletions

File tree

CLAUDE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
Follow the global prompt rules first. This file adds project-specific skill routing for a project that uses the `agent-team` CLI (github.com/tae2089/agent-team) as its durable work ledger.
66

77
## MCP 서버
8-
`.mcp.json`에 등록된 ccg MCP 서버가 17개 도구를 제공합니다:
8+
`.mcp.json`에 등록된 ccg MCP 서버가 18개 도구를 제공합니다:
99

1010
- `parse_project`, `build_or_update_graph`, `run_postprocess`
1111
- `get_node`, `search`, `query_graph`, `list_graph_stats`, `list_namespaces`, `get_minimal_context`
12-
- `get_impact_radius`, `trace_flow`
12+
- `get_impact_radius`, `trace_flow`, `list_cross_refs`
1313
- `detect_changes`, `get_affected_flows`, `list_flows`
1414
- `get_annotation`
1515
- `get_doc_content`, `search_docs`
@@ -45,7 +45,7 @@ Graceful shutdown: SIGINT/SIGTERM 시 진행 중인 clone/build에 context cance
4545
상세 문서는 `guide/` 디렉토리를 참조하세요:
4646

4747
- [CLI Reference](guide/cli-reference.md) — 전체 명령어, 플래그, 설정 파일
48-
- [MCP Tools](guide/mcp-tools.md)17개 MCP 도구, Skills, AI-Driven Annotation
48+
- [MCP Tools](guide/mcp-tools.md)18개 MCP 도구, Skills, AI-Driven Annotation
4949
- [Annotations](guide/annotations.md) — 어노테이션 태그, 예시, 검색
5050
- [Webhook](guide/webhook.md) — Webhook sync, 브랜치 필터링, HMAC, graceful shutdown
5151
- [Docker](guide/docker.md) — Docker 빌드, MCP 서버, PostgreSQL 배포

guide/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ explore graph edges.
2020
|----------|-------------|
2121
| [CLI Reference](cli-reference.md) | Full CLI commands, options, and configuration file (`.ccg.yaml`) |
2222
| [Lint](lint.md) | Detailed `ccg lint` category reference, interpretation guide, and CI usage |
23-
| [MCP Tools](mcp-tools.md) | 17 MCP tools, agent skills, evidence-first routing, AI-driven annotation |
23+
| [MCP Tools](mcp-tools.md) | 18 MCP tools, agent skills, evidence-first routing, AI-driven annotation |
2424
| [Annotations](annotations.md) | Custom annotation system — tags, examples, and search quality |
2525
| [Webhook](webhook.md) | GitHub / Gitea webhook sync, branch filtering, graceful shutdown |
2626
| [Docker](docker.md) | Docker image build, MCP server setup, Wiki UI deployment, PostgreSQL integration |

guide/annotations.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ Use `ccg://{namespace}/{path}#{symbol}` in `@see` when a behavior depends on cod
6262

6363
The path and symbol are optional, so `ccg://auth-svc/internal/auth` can point at a package/path scope and `ccg://auth-svc/` can point at a whole namespace.
6464

65+
Every `@see ccg://` tag is materialized into the `cross_refs` table after each build or update: the target is resolved against the referenced namespace's current nodes and the row is marked `resolved` or `dead`. When either side rebuilds, refs are re-resolved automatically, so a `dead` ref recovers as soon as the target symbol appears. Materialized refs power `list_cross_refs` (repository dependency map) and the `cross_namespace: true` mode of `get_impact_radius`/`trace_flow`. Namespace-scope refs (`ccg://auth-svc/`) resolve without a node target and never appear in traversal, only in listings.
66+
6567
## Retrieval Quality
6668
6769
Annotations are retrieval features. `search_docs` and generated docs rank

guide/architecture.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ closure with deterministic `go list -json` checks.
6262
## Runtime and transports
6363

6464
Both `ccg serve` (stdio) and `ccg-server` (Streamable HTTP) use the same five
65-
grouped MCP dependency surfaces and expose exactly 17 tools plus four prompts.
65+
grouped MCP dependency surfaces and expose exactly 18 tools plus four prompts.
6666
The local binary does not link remote HTTP, Wiki, webhook, or remote runtime
6767
packages. See [Runtime Layout](runtime-layout.md).
6868

@@ -74,6 +74,16 @@ filters. SQLite and PostgreSQL share GORM-owned graph operations and backend-
7474
specific full-text search adapters. Application and inbound packages never issue
7575
SQL; backend-specific SQL remains encapsulated in outbound adapters and migration code.
7676

77+
The `cross_refs` table is the one deliberate bridge across namespaces: each row
78+
materializes an `@see ccg://` annotation with a symbolic target
79+
(`to_namespace`, `to_path`, `to_symbol`) plus derived state
80+
(`resolved_node_id`, `status`). Rows are rebuilt from annotations after every
81+
build/update of the source namespace and re-resolved when the target namespace
82+
rebuilds, because replace-style syncs regenerate node ids. Cross-namespace
83+
analysis reads go through a dedicated namespace-agnostic reader that merges
84+
resolved refs into traversal as synthetic `cross_ref` edges; regular
85+
single-namespace query paths remain strictly namespace-filtered.
86+
7787
## Reliability and security
7888

7989
- Repository sync verifies HMAC before trust, applies ordered allow rules, bounds

guide/development.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ internal/
103103
ctx/ — Request-context values (namespace isolation)
104104
docs/ — Documentation generation
105105
mcpruntime/ — Shared MCP runtime assembly, stdio runner, cache, telemetry
106-
mcp/ — MCP server (17 tools)
106+
mcp/ — MCP server (18 tools)
107107
wikiserver/ — ccg-server Wiki static serving and viewer API
108108
wikiindex/ — Wiki presentation index builder (`wiki-index.json`)
109109
model/ — DB models

guide/ko/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ DB-backed graph/annotation evidence를 사용하며, 시각적 Graph 탭은
2323
|------|------|
2424
| [CLI 레퍼런스](cli-reference.md) | 모든 CLI 명령어, 옵션 및 설정 파일(`.ccg.yaml`) 안내 |
2525
| [Lint](lint.md) | `ccg lint` 카테고리 상세 레퍼런스, 결과 해석 및 CI 활용법 |
26-
| [MCP 도구](mcp-tools.md) | 17개의 MCP 도구, 에이전트 스킬, evidence-first 라우팅, AI 기반 어노테이션 |
26+
| [MCP 도구](mcp-tools.md) | 18개의 MCP 도구, 에이전트 스킬, evidence-first 라우팅, AI 기반 어노테이션 |
2727
| [어노테이션](annotations.md) | 커스텀 어노테이션 시스템 — 태그, 예시, 검색 품질 |
2828
| [웹훅(Webhook)](webhook.md) | GitHub / Gitea 웹훅 동기화, 브랜치 필터링, Graceful Shutdown |
2929
| [Docker](docker.md) | Docker 이미지 빌드, MCP 서버 설정, Wiki UI 배포, PostgreSQL 연동 |

guide/ko/architecture.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ CLI / MCP / HTTP / Wiki / webhook -> application capability -> outbound port
6060
## 런타임과 전송 계층
6161

6262
`ccg serve`(stdio)와 `ccg-server`(Streamable HTTP)는 동일한 다섯 MCP 의존성
63-
그룹을 사용하며 정확히 17개 tool과 4개 prompt를 노출합니다. 로컬 바이너리는
63+
그룹을 사용하며 정확히 18개 tool과 4개 prompt를 노출합니다. 로컬 바이너리는
6464
원격 HTTP, Wiki, webhook, remote runtime 패키지를 링크하지 않습니다.
6565
자세한 내용은 [런타임 레이아웃](runtime-layout.md)을 참고하세요.
6666

guide/ko/development.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ internal/
105105
ctx/ — 요청 컨텍스트 값 (namespace 격리)
106106
docs/ — 문서 생성 로직
107107
mcpruntime/ — 공용 MCP runtime assembly, stdio runner, cache, telemetry
108-
mcp/ — MCP 서버 (17개 도구)
108+
mcp/ — MCP 서버 (18개 도구)
109109
wikiserver/ — ccg-server Wiki 정적 파일 서빙 및 viewer API
110110
wikiindex/ — Wiki 표시용 인덱스 생성기 (`wiki-index.json`)
111111
model/ — DB 모델

guide/ko/mcp-tools.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# MCP 도구
22

3-
code-context-graph는 로컬 `ccg serve`와 셀프호스트 `ccg-server` 런타임 모두에서 17개의 MCP 도구를 제공합니다.
3+
code-context-graph는 로컬 `ccg serve`와 셀프호스트 `ccg-server` 런타임 모두에서 18개의 MCP 도구를 제공합니다.
44

55
## 파싱 및 빌드
66

@@ -15,27 +15,28 @@ code-context-graph는 로컬 `ccg serve`와 셀프호스트 `ccg-server` 런타
1515
| 도구 | 용도 |
1616
| ---- | ---- |
1717
| `get_node` | qualified name으로 node 하나 조회 |
18-
| `search` | path scope를 선택적으로 적용하는 code node full-text search |
18+
| `search` | path scope를 선택적으로 적용하는 code node full-text search; `namespaces: []`로 여러 namespace 연합 검색 (결과에 namespace 라벨) |
1919
| `get_annotation` | node의 annotation과 문서 tag 조회 |
20-
| `query_graph` | callers, callees, imports, children, tests, inheritors, file summary 조회 |
21-
| `list_graph_stats` | node와 edge를 kind 및 language별로 집계 |
20+
| `query_graph` | callers, callees, imports, children, tests, inheritors, file summary 조회; `namespaces: []`는 namespace별 그룹 응답 |
21+
| `list_graph_stats` | node와 edge를 kind 및 language별로 집계; `namespaces: []`는 namespace별 그룹 응답 |
2222
| `list_namespaces` | graph data가 있는 namespace와 node count 목록 조회 |
2323

2424
## 분석
2525

2626
| 도구 | 용도 |
2727
| ---- | ---- |
28-
| `get_impact_radius` | node 주변의 제한된 BFS 영향 반경 계산 |
29-
| `trace_flow` | node에서 시작하는 제한된 call chain 추적 |
28+
| `get_impact_radius` | node 주변의 제한된 BFS 영향 반경 계산; `cross_namespace: true`면 resolved `ccg://` ref를 양방향으로 통과 |
29+
| `trace_flow` | node에서 시작하는 제한된 call chain 추적; `cross_namespace: true`면 resolved `ccg://` ref를 넘어 계속 추적 |
3030
| `detect_changes` | git diff 기반 변경 함수 탐지 및 risk score 계산 |
3131
| `get_affected_flows` | 최근 변경의 영향을 받는 저장 flow 조회 |
3232
| `list_flows` | 저장 flow를 페이지네이션해 조회 |
33+
| `list_cross_refs` | 실체화된 `ccg://` cross-namespace 참조 목록 (direction: outbound/inbound/both, status 필터) |
3334

3435
## 문서 및 컨텍스트
3536

3637
| 도구 | 용도 |
3738
| ---- | ---- |
38-
| `search_docs` | DB-backed 문서 후보와 graph evidence 검색 |
39+
| `search_docs` | DB-backed 문서 후보와 graph evidence 검색; `namespaces: []`는 namespace별 그룹 응답 |
3940
| `get_doc_content` | 선택한 생성 Markdown 파일을 안전하게 읽기 |
4041
| `get_minimal_context` | 작은 프로젝트/변경 요약과 다음 도구 제안 반환 |
4142

@@ -51,4 +52,4 @@ code-context-graph는 로컬 `ccg serve`와 셀프호스트 `ccg-server` 런타
5152

5253
`query_graph``list_flows`에는 명시적인 `limit`, `offset`을 사용하십시오. 50 또는 100개로 시작하고 페이지네이션 metadata를 따라 확장합니다.
5354

54-
로컬 MCP client는 stdio 방식의 `ccg serve`를 시작하고, 원격 client는 `ccg-server``/mcp` Streamable HTTP endpoint에 연결합니다. 두 런타임은 동일한 17개 도구를 등록합니다.
55+
로컬 MCP client는 stdio 방식의 `ccg serve`를 시작하고, 원격 client는 `ccg-server``/mcp` Streamable HTTP endpoint에 연결합니다. 두 런타임은 동일한 18개 도구를 등록합니다.

guide/ko/runtime-layout.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ HTTP host, Wiki HTTP, webhook adapter, remote runtime은 링크하지 않습니
2929
- `/wiki`, `/wiki/api/*` — 선택적인 CCG 내장 Wiki
3030
- `/webhook` — 선택적인 GitHub/Gitea repository sync
3131

32-
두 transport 모두 `Runtime.MCPComponents()`를 사용하므로 동일한 17개 tool과
32+
두 transport 모두 `Runtime.MCPComponents()`를 사용하므로 동일한 18개 tool과
3333
4개 prompt를 등록합니다.
3434

3535
## 리소스 소유권

0 commit comments

Comments
 (0)