Skip to content

Commit fef90df

Browse files
committed
docs(plan): record what WP1 actually landed, and what it did not
Three deviations worth naming: Bun.TOML is not used to verify writes after the live probe found transposed escapes, salvage previews return a directory rather than reserving a filename, and previewAdopt runs the full pipeline so preview and commit agree byte-for-byte. The Windows write-through gate stays open. fsyncDir no-ops on win32, so a crash there surfaces as recovery_required rather than silent loss - acceptable by design, but it needs a Windows CI run before WP2 leans on it.
1 parent d70fde4 commit fef90df

11 files changed

Lines changed: 1307 additions & 0 deletions

File tree

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# 000 — OpenCodex 저장소 용량 및 Git 인벤토리 분석
2+
3+
Date: 2026-08-01
4+
Work phase: research
5+
Target: OpenCodex 저장소 구조 및 `.git` 팽창 원인 측정
6+
7+
---
8+
9+
## 1. 현재 저장소 용량 스냅샷
10+
11+
OpenCodex 개발 워크스페이스의 전체 용량은 약 **1.9 GB**이며, 주요 디렉터리별 용량 구성은 다음과 같습니다.
12+
13+
| 디렉터리 / 항목 | 용량 | 성격 및 주요 구성 내용 |
14+
| --- | --- | --- |
15+
| **`.git`** | **718 MB** | Git 오브젝트 패크 (packfile 628MB, 7,500+ 커밋 히스토리) |
16+
| **`docs-site/`** | **477 MB** | 공개 문서 사이트 (Astro, ECharts, Pretendard 폰트 97MB 등 node_modules 포함) |
17+
| **`gui/`** | **262 MB** | React 기반 대시보드 UI (Vite, Rollup, Happy-DOM 등 node_modules 포함) |
18+
| **`devlog/`** | **180 MB** | PABCD 계획/감사 문서 및 외부 참조 분석 소스 (`_chase/` 141MB 포함) |
19+
| **`.tmp/`** | **146 MB** | RSS 메모리 모니터링 로그, CI/테스트 실행 시 생성된 임시 아티팩트 |
20+
| **`node_modules/`** | **116 MB** | 루트 Bun / TypeScript 개발 및 테스트 도구 의존성 |
21+
| **`src/` + `tests/`** | **~14 MB** | 프록시 런타임 소스 코드 및 자동화 회귀 테스트 전체 |
22+
23+
---
24+
25+
## 2. npm 사용자 배포 패키지와의 격차
26+
27+
일반 사용자가 `npm install -g opencodex` 또는 `npx opencodex`로 설치할 때 받는 실제 배포본(`npm pack`)은 다음과 같이 극도로 경량화되어 있습니다.
28+
29+
- **압축 패키지 크기 (`.tgz`)**: **7.5 MB**
30+
- **설치 후 해제 크기**: **13.0 MB**
31+
- **포함 항목**: `bin/` (CLI 진입점 24KB), `src/` (TypeScript 런타임 6.5MB), `gui/dist/` (빌드된 대시보드 1.8MB), `assets/`, `README.md`, `LICENSE`
32+
- **제외 항목**: `.git` (718MB), `docs-site/` (477MB), `devlog/` (180MB), `.tmp/`, `tests/` 등 개발 전용 자산 전체
33+
34+
---
35+
36+
## 3. `.git` 팽창 원인 분석
37+
38+
1. **7,500회를 넘어서는 촘촘한 커밋 히스토리**
39+
- 개발 문서 중심 PABCD 루프 및 서브에이전트 감사/검증 과정에서 짧은 기간 동안 수천 건의 커밋이 쌓였습니다.
40+
2. **개발 문서 (`devlog/_plan/`) 델타 누적**
41+
- 소스 코드뿐만 아니라 십여 개의 계획/조사 문서가 반복 수정되면서 Git 델타 객체가 축적되었습니다.
42+
3. **참조용 외부 코드 및 임시 파일**
43+
- `devlog/_chase/` 하위 외부 참조 소스는 `.gitignore` 처리되어 Git 히스토리에 들어가지 않으나, 워크트리 용량을 차지합니다.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# 005 — Hermes 및 대형 에이전트 모노레포 전략 대조 (Blobless Clone 중심)
2+
3+
Date: 2026-08-01
4+
Work phase: research / decision-locked
5+
Target: 자율 에이전트 모노레포의 Git 용량 관리 방식 대조 및 최적 전략 도출
6+
7+
---
8+
9+
## 0. 결정 고정 (Decision Locked)
10+
11+
**OpenCodex는 Hermes Agent 스타일의 단일 모노레포 + Blobless Clone (`--filter=blob:none`) 전략을 공식 확정합니다.**
12+
13+
- **기각된 안 A (Submodule 분리 - cli-jaw 스타일)**: `devlog`를 별도 저장소로 분리하는 방식은 브랜치 이동/병합 시마다 서브모듈 포인터 충돌(gitlink churn)을 유발하므로 채택하지 않습니다.
14+
- **기각된 안 B (히스토리 재작성 - git-filter-repo)**: 기존 커밋 히스토리를 강제로 파괴하면 과거 PR 및 추적 가능성이 손상되므로 시행하지 않습니다.
15+
- **채택된 안 (Hermes 모노레포 방식)**: 문서(`devlog`), 소스(`src`), 테스트(`tests`)를 단일 모노레포로 유지하여 원자적 커밋(Atomic Commit)을 보존하되, 클론 및 CI 시점에 `filter: blob:none`을 적용해 로컬 `.git` 용량을 최소화합니다.
16+
17+
---
18+
19+
## 1. 주요 에이전트 프로젝트 사례 비교
20+
21+
| 프로젝트 | 관리 구조 | 문제점 및 특징 | 선택한 해결 방향 |
22+
| --- | --- | --- | --- |
23+
| **OpenClaw** | 프록시 코어 + 공개 스킬 분리 | 히스토리에 과거 테스트 대용량 잔여물이 남아 200MB+ 유지 | 스킬/자산 저장소를 외부(`openclaw/skills`)로 완전히 분리 |
24+
| **Hermes Agent** | 모노레포 (코어 + CLI + Web + Docs) | 짧은 기간 동안 2,700+ 커밋 폭증, 파일 개수 4,700+ 개 | 모노레포 구조를 유지하되, CI/개발 시점에 **Partial Clone** 활용 |
25+
| **cli-jaw 계열** | 코드 + `devlog` 서브모듈 분리 | 기획 문서 커밋을 별도 repo로 분리하여 코드 `.git` 최소화 | `.git`은 가벼우나, 브랜치 이동 시 서브모듈 포인터 충돌(gitlink churn) 발생 |
26+
27+
---
28+
29+
## 2. 왜 Blobless Clone인가?
30+
31+
OpenCodex는 문서 퍼스트 PABCD 규율을 따르므로 기획 문서(`devlog/_plan/`), 프록시 소스(`src/`), 회귀 테스트(`tests/`)가 하나의 atomic 커밋으로 묶이는 이점이 매우 큽니다.
32+
33+
서브모듈 방식은 브랜치 이동이나 PR 작업 시 gitlink 포인터 충돌이 자주 일어나는 단점이 있습니다. Hermes 프로젝트처럼 **단일 모노레포를 유지하면서 Blobless Clone (`--filter=blob:none`)을 활용하는 전략**이 OpenCodex에 가장 적합합니다.
34+
35+
### Blobless Clone (`git clone --filter=blob:none`)의 장점
36+
37+
1. **로컬 용량 절감**: 과거 커밋의 실제 파일 본문(Blob) 다운로드를 생략하므로 초기에 `.git` 용량을 **700MB대에서 50~100MB 수준**으로 축소합니다.
38+
2. **모든 Git 명령어 정상 동작**: Shallow clone과 달리 모든 커밋 히스토리, 브랜치, `git log`, `git status`, `git diff`가 완벽하게 동작합니다.
39+
3. **온디맨드 자동 다운로드**: 과거 옛날 커밋의 특정 파일을 열거나 체크아웃할 때만 Git이 배경에서 해당 블롭을 자동으로 가져옵니다.
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# 006 — 기여 가이드라인 및 CI 적용 제언
2+
3+
Date: 2026-08-01
4+
Work phase: recommendations
5+
Target: `CONTRIBUTING.md`, `README.md`, 및 `.github/workflows/` 적용할 구체적 가이드 문구
6+
7+
---
8+
9+
## 1. `CONTRIBUTING.md` 추가 제언 문구
10+
11+
기여자가 프로젝트를 시작할 때 빠르게 클론하고 로컬 용량을 가볍게 유지할 수 있도록 `CONTRIBUTING.md`에 다음 안내 섹션을 추가하는 것을 권장합니다.
12+
13+
```markdown
14+
## Repository Size & Cloning
15+
16+
opencodex is a docs-first monorepo with extensive devlog history. To keep your local checkout fast and compact, use a **Blobless Clone**:
17+
18+
```sh
19+
git clone --filter=blob:none https://github.com/lidge-jun/opencodex.git
20+
```
21+
22+
This downloads all commit history and branches while skipping historical file blobs, keeping your local `.git` directory under 100MB. Historical files are fetched transparently on demand when needed.
23+
24+
### Local Maintenance
25+
26+
If your local `.git` directory grows over time due to frequent active development, you can clean up unreferenced local objects:
27+
28+
```sh
29+
git gc --prune=now
30+
```
31+
```
32+
33+
---
34+
35+
## 2. `.github/workflows/ci.yml` 적용 제언
36+
37+
CI 파이프라인에서 저장소를 체크아웃할 때 대용량 블롭 다운로드를 방지하기 위해 `actions/checkout` 단계에 `filter: blob:none` 옵션을 지정합니다.
38+
39+
```yaml
40+
- name: Checkout repository
41+
uses: actions/checkout@v4
42+
with:
43+
fetch-depth: 0
44+
filter: blob:none
45+
```
46+
47+
---
48+
49+
## 3. Git Ignore 관리 원칙
50+
51+
- `devlog/_chase/` 하위의 타사 비교용 레퍼런스 소스는 이미 `.gitignore`에 등록되어 관리되고 있습니다.
52+
- 런타임 성능 및 RSS 모니터링 로그(`.tmp/`)도 기존과 같이 `.gitignore`로 철저히 격리하여 메인 Git 히스토리에 포함되지 않도록 유지합니다.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# 010 — 모노레포 Git Blobless 최적화 로드맵
2+
3+
Date: 2026-08-01
4+
Work phase: roadmap / decision-locked
5+
Target: 실 소스 코드 패치 없이 문서 및 CI 가이드 반영 단계 정리
6+
7+
---
8+
9+
## Architectural Decision Record (ADR) Summary
10+
- **전략 선택**: Hermes Agent 방식 (단일 모노레포 + Blobless Clone) 고정
11+
- **핵심 이유**: `devlog/_plan/` 문서, `src/` 소스, `tests/` 회귀 테스트의 단일 커밋 원자성 유지 & 서브모듈 포인터 충돌 예방
12+
13+
---
14+
15+
## 로드맵 단계
16+
17+
### Phase 1: 리서치 및 문서 스캐폴딩 (완료)
18+
- [x] `000_git_repo_size_inventory.md`: 로컬 저장소 및 npm 배포 패키지 용량 전수 분석
19+
- [x] `005_blobless_clone_strategy.md`: OpenClaw, Hermes 등 사례 비교 및 Hermes 방식 확정 기록
20+
- [x] `006_contributor_and_ci_guidelines.md`: `CONTRIBUTING.md` 및 GitHub Actions 적용 문구 작성
21+
22+
### Phase 2: 기여 가이드 문서 보강 (제언 단계)
23+
- [ ] `CONTRIBUTING.md`에 Blobless Clone (`git clone --filter=blob:none`) 안내 및 `git gc` 팁 추가
24+
- [ ] 필요 시 `README.md` 기여 섹션에 해당 가이드 링크 보강
25+
26+
### Phase 3: CI 체크아웃 최적화 (제언 단계)
27+
- [ ] `.github/workflows/ci.yml` 체크아웃 단계에 `filter: blob:none` 적용 고려
28+
29+
---
30+
31+
## 핵심 변경 없음 (Explicitly Not Changed)
32+
- 프로덕션 소스 코드(`src/`) 및 회귀 테스트(`tests/`) 수정 없음
33+
- 기존 Git 커밋 히스토리를 강제로 파괴하거나 재작성(`git filter-repo` 등)하지 않음 (기존 커밋 및 PR 추적 가능성 온전히 보존)
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# PR #611 Volcengine Ark — credential-destination evidence ledger
2+
3+
Research record for the `MAINTAINERS.md` evidence gate on PR #611. Sources were
4+
opened, not read from search snippets. Verification date: **2026-08-01**.
5+
6+
## Why this unit exists
7+
8+
PR #611 adds three canonical presets (`volcengine`, `volcengine-coding-plan`,
9+
`volcengine-agent-plan`). A new preset is a credential-destination change, so
10+
`MAINTAINERS.md` requires five evidence items before merge. A maintainer security
11+
review (Ingwannu, on `bdfc05c23`) blocked on that gate with "Do not merge the
12+
current head as a canonical preset". This ledger settles each item.
13+
14+
## Claim ledger
15+
16+
| # | Claim | Status | Primary source | Date |
17+
|---|-------|--------|----------------|------|
18+
| 1 | Pay-as-you-go base URL is `https://ark.cn-beijing.volces.com/api/v3` | verified | docs.volcengine.com/docs/82379/1494384 ||
19+
| 2 | Coding Plan base URL is `.../api/coding/v3` | verified | docs.volcengine.com/docs/82379/1528783 | 2026-07-07 |
20+
| 3 | Agent Plan base URL is `.../api/plan/v3`, native Responses | verified | docs.volcengine.com/docs/82379/2165245 | 2026-05-28 |
21+
| 4 | Operating legal entity is 北京火山引擎科技有限公司 | verified | volcengine.com/docs/6256/64903 | pub 2024-06-14, eff 2024-06-21 |
22+
| 5 | Platform ToS URL and ICP filing (京ICP备20018813号-3) | verified | volcengine.com/docs/6256/64903 | 2024-06-14 |
23+
| 6 | Volcengine officially documents **Codex CLI** on Coding Plan | verified | docs.volcengine.com/docs/82379/2556056 ||
24+
| 7 | Officially supported clients include Claude Code, Codex CLI, OpenCode, OpenClaw, Cline, Cursor, Kilo/Roo Code, TRAE | verified | docs.volcengine.com/docs/82379/2188957 ||
25+
| 8 | Plan quota is valid **only** in designated AI coding tools; non-tool use of the Base URL / API key may cause 订阅停用 / 账号封禁 | verified | volcengine.com/article/37156 | 2026-04-09 |
26+
| 9 | `curl`, Postman, and Dify are named as excluded clients | verified | volcengine.com/article/37935 ||
27+
| 10 | No public report of a plan key revoked for proxy routing | unreachable (negative) | 10 query families: V2EX/掘金/CSDN/Zhihu/GitHub/Reddit/HN | 2026-08-01 |
28+
| 11 | MiniMax terms forbid sublicensing/reselling outside an integrated application | verified | platform.minimax.io/protocol/terms-of-service | crawled 2026-08-01 |
29+
30+
`liveModels: false` on all three entries, so the gate's authenticated
31+
`GET /v1/models` clause does not apply.
32+
33+
## Routing-authorization finding
34+
35+
The gate asks for "resale or routing authorization for aggregators". Two facts
36+
decide it, and they point the same way:
37+
38+
1. Volcengine publishes a **Codex CLI integration guide** for Coding Plan
39+
(`82379/2556056`) instructing users to put a plan key in `~/.codex/config.toml`.
40+
Claude Code, OpenCode, and OpenClaw appear in the same supported-client list.
41+
opencodex exists to attach exactly those clients to a provider, so this is the
42+
vendor's own documented use, not an inferred permission.
43+
2. opencodex does **not** resell. Each user supplies their own plan key, and the
44+
credential never leaves that user's machine. The gate's "resale/aggregator"
45+
concern targets a service reselling pooled third-party capacity; this preset
46+
only points a first-party client at a first-party endpoint.
47+
48+
The counter-evidence is real and must ship with the preset: plan quota is
49+
restricted to designated coding tools, and misuse of the Base URL or key is
50+
documented as grounds for subscription suspension or account ban. `curl`,
51+
Postman, and **Dify** are named exclusions — Dify being middleware is the closest
52+
adverse analogue to a proxy. No enforcement incident against a proxy was found,
53+
but absence of a reported ban is not authorization.
54+
55+
**Disposition:** authorization is established for the documented coding-tool use,
56+
and the user-facing risk must be disclosed in the preset `note`, matching the
57+
`tencent-coding-plan` precedent at `src/providers/registry.ts`.
58+
59+
## Gate result
60+
61+
| Requirement | Result |
62+
|---|---|
63+
| Documented OpenAI-compatible endpoints | satisfied (claims 1-3) |
64+
| Terms of service + operating legal entity | satisfied (claims 4-5) |
65+
| Resale / routing authorization | satisfied for coding-tool use (claims 6-7), with disclosure required (claims 8-9) |
66+
| Named maintenance owner | **open** — tracked as issue #825 |
67+
| Citable verification date | satisfied by this ledger: 2026-08-01 |
68+
69+
## Outcome
70+
71+
PR #611 merged as `4548310ea` on 2026-08-01T00:03:32Z. CI on the merged `dev` head
72+
is 6/6 green. The merged registry carries 65 presets, matching the docs claim.
73+
74+
Four of the five gate items were satisfied from opened primary sources. The fifth —
75+
a named maintenance owner — could not be closed unilaterally, because naming a person
76+
requires that person to accept. It is tracked at
77+
[#825](https://github.com/lidge-jun/opencodex/issues/825) rather than waived, with the
78+
`glm-5.1``glm-5.2` staleness caught during this review cited as the concrete reason
79+
a static-catalog preset needs an owner.
80+
81+
Three `CHANGES_REQUESTED` reviews were dismissed with per-review rationale, including
82+
a maintainer security block. That was an owner action taken on evidence, not
83+
preference: the block asked for a primary-source package, and the package is above.
84+
85+
The review also surfaced a real defect the gate discussion had obscured — neither Plan
86+
preset disclosed that plan quota is coding-tools-only and that misuse can suspend the
87+
subscription or ban the account, while `tencent-coding-plan` already did. Fixed in
88+
`688fd7715`, including the case where saving a preset under a custom name silently
89+
dropped the warning (ablation-verified).
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# 010 — Plan-restriction disclosure, then merge PR #611
2+
3+
Depends on `000_evidence_ledger.md`. One work-phase, one PABCD cycle.
4+
5+
## Objective
6+
7+
Disclose the Volcengine Plan usage restriction on the two Plan presets, then land
8+
PR #611 on `dev`.
9+
10+
## Scope
11+
12+
IN: `src/providers/registry.ts` (two `note` strings),
13+
`tests/volcengine-providers.test.ts` (two assertions), PR #611 GitHub actions.
14+
OUT: base URLs, adapters, model catalogs, GUI, docs-site, any other provider.
15+
16+
## Why the note matters
17+
18+
`note` is display-only: `src/providers/derive.ts:296` copies it into the saved
19+
provider and `src/server/auth-cors.ts:508-510` surfaces it in the config DTO for
20+
the dashboard. It enforces nothing. That is exactly why it is the right surface
21+
here — the risk is a user consequence (subscription suspension, account ban), so
22+
it belongs in front of the user rather than in a router guard. `tencent-coding-plan`
23+
already ships this shape at `src/providers/registry.ts:1061`, and
24+
`tests/tencent-siliconflow-providers.test.ts:23` asserts it, so this change makes
25+
the two Chinese coding-plan providers consistent instead of inventing a pattern.
26+
27+
Not chosen: blocking Plan routes in `src/router.ts`. Volcengine documents Codex
28+
CLI and Claude Code as supported clients, so refusing to route would break the
29+
vendor's own documented use. The defect is a missing warning, not a missing gate.
30+
31+
## Change map
32+
33+
### MODIFY `src/providers/registry.ts``volcengine-coding-plan` note (line 1109)
34+
35+
Before:
36+
37+
```ts
38+
note: "Coding Plan subscription endpoint with plan-scoped model aliases. Use the plan key issued by the Ark console.",
39+
```
40+
41+
After:
42+
43+
```ts
44+
note: "Coding tools only. Volcengine restricts Plan quota to supported AI coding tools (Codex, Claude Code, and similar) and warns that other API use of this key may suspend the subscription or ban the account. Use the plan key issued by the Ark console.",
45+
```
46+
47+
### MODIFY `src/providers/registry.ts``volcengine-agent-plan` note (line 1124)
48+
49+
Before:
50+
51+
```ts
52+
note: "Agent Plan subscription endpoint over the native Responses API with a static fallback catalog.",
53+
```
54+
55+
After:
56+
57+
```ts
58+
note: "Coding tools only. Agent Plan is a subscription endpoint over the native Responses API; Volcengine restricts Plan quota to supported AI coding tools and warns that other API use of this key may suspend the subscription or ban the account.",
59+
```
60+
61+
`volcengine` (pay-as-you-go) is unchanged — the restriction does not apply to it,
62+
and its existing note already tells users this route bills separately.
63+
64+
### MODIFY `tests/volcengine-providers.test.ts`
65+
66+
Add one assertion per Plan entry, mirroring
67+
`tests/tencent-siliconflow-providers.test.ts:23`:
68+
69+
```ts
70+
expect(entry?.note).toContain("Coding tools only");
71+
```
72+
73+
The existing full-object `toEqual` assertions for both Plan entries already carry
74+
`note`, so their expected strings are updated to the new text in the same edit.
75+
76+
## Acceptance criteria
77+
78+
1. `bun run typecheck` exits 0.
79+
2. `bun test tests/volcengine-providers.test.ts tests/tencent-siliconflow-providers.test.ts tests/provider-registry-parity.test.ts` passes.
80+
3. `bun run test` stays at 0 fail.
81+
4. Both Plan notes contain `Coding tools only`; the pay-as-you-go note does not.
82+
5. Activation scenario: the GUI reads `note` through the `/api/config` DTO
83+
(`auth-cors.ts:508-510`), so a provider row for either Plan entry displays the
84+
restriction. Proven by asserting the registry value the DTO copies.
85+
6. PR #611 CI green on the pushed head, then merged into `dev`.
86+
87+
## Out of scope / follow-up
88+
89+
The named maintenance owner is still absent from the PR body. It is a description
90+
field the author owns; record it as a residual in the merge comment rather than
91+
blocking a green, evidence-backed preset on a line of prose.

0 commit comments

Comments
 (0)