You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: harden dev workflow with safety guards, deterministic builds, and tool-agnostic agent config
- Add AGENTS.md as tool-agnostic AI config, CLAUDE.md becomes a symlink
- Add ccc-dev/status.sh to detect pending work before destructive operations
- Make ccc-dev/patch.sh produce deterministic commits (fixed author/date)
- Guard ccc:record, ccc:clean, ccc:reset against data loss
- Replace scripts/pr.sh and scripts/review.sh with inline agent workflows
- Add telemetry opt-out env vars and wl-clipboard to devcontainer
- Rename pnpm claude to pnpm coworker, add coworker:ask for scripting
- Reorder check pipeline: lint before build for faster feedback
- Update pnpm to 10.30.0 and typescript-eslint to 8.56.0
- Update all docs to reflect new tooling and workflows
Copy file name to clipboardExpand all lines: .planning/codebase/CONVENTIONS.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@
5
5
## Important Context
6
6
7
7
**Tooling:**
8
-
-`gh` CLI is NOT available and must NOT be installed. Use `pnpm pr` to open PRs and `pnpm review` to fetch PR comments.
8
+
-`gh` CLI is NOT available and must NOT be installed. PR and review workflows are handled inline by the AI Coworker (see AGENTS.md).
9
9
10
10
**Legacy vs. New code:**
11
11
-`@ickb/lumos-utils@1.4.2` and `@ickb/v1-core@1.4.2` are **LEGACY and DEPRECATED** npm packages. The apps (`apps/bot`, `apps/tester`, `apps/interface`) still depend on them.
- Never add `Co-Authored-By` lines to commit messages.
6
+
- Never add AI tool attribution or branding to PR descriptions, commit messages, or code comments (e.g. "Generated with ...", "Built by ...", "Powered by ...").
7
+
- Refer to yourself as "AI Coworker" in docs and comments, not by product or company name.
8
+
- Do not install or use `gh` CLI.
9
+
-**Routine Pre-PR Validation**: `pnpm check:full`, it wipes derived state and regenerates from scratch. If `ccc-dev/ccc/` has pending work, the wipe is skipped to prevent data loss — re-record or push CCC changes first for a clean validation.
10
+
-**Open a PR**: Push the branch, then construct and present a GitHub compare URL
11
+
(`quick_pull=1`) to the user. Base branch is `master`. Prefill "title" (concise, under 70 chars) and "body" (markdown with ## Why and ## Changes sections). Be brief.
12
+
-**Fetch PR review comments**: Use the GitHub REST API via curl. Fetch all three comment types (issue comments, reviews, and inline comments). Reviewers reply asynchronously — poll every minute until comments arrive.
13
+
-**Copy to clipboard**:
14
+
```
15
+
head -c -1 <<'EOF' | wl-copy
16
+
content goes here
17
+
EOF
18
+
```
19
+
20
+
# CCC Local Development (ccc-dev/)
21
+
22
+
The `ccc-dev/` system uses a record/replay mechanism for deterministic builds of a local CCC fork:
23
+
24
+
-`ccc-dev/pins/` is **committed** to git (base SHAs, merge refs, conflict resolutions), regenerated by `pnpm ccc:record`.
25
+
-`ccc-dev/ccc/` is **not in git** — it is rebuilt from pins on `pnpm install`.
26
+
- The developer may have **pending work** in `ccc-dev/ccc/`. Run `pnpm ccc:status` (exit 0 = safe to wipe, exit 1 = has custom work) before any operation that would destroy it. `pnpm ccc:record`, `pnpm ccc:clean`, and `pnpm ccc:reset` already guard against this automatically.
27
+
-`.pnpmfile.cjs` silently rewrites all `@ckb-ccc/*` dependencies to `workspace:*` when `ccc-dev/ccc/` exists. Local CCC packages override published ones without any visible change in package.json files.
28
+
-`pnpm install` has a side effect: if `ccc-dev/pins/REFS` exists but `ccc-dev/ccc/` does not, it automatically runs `ccc-dev/replay.sh` to rebuild CCC from pins. This is intentional.
29
+
-`ccc-dev/patch.sh` rewrites CCC package exports to point at `.ts` source instead of `.d.ts`, then creates a deterministic git commit (fixed author/date) so record and replay produce the same `pins/HEAD` hash. This is why imports from `@ckb-ccc/*` resolve to TypeScript source files inside `node_modules` — it is not a bug.
30
+
-`ccc-dev/tsc.mjs` is a custom `tsc` wrapper that filters out diagnostics originating from `ccc-dev/ccc/`. CCC source does not satisfy this repo's strict tsconfig (`verbatimModuleSyntax`, `noUncheckedIndexedAccess`, `noImplicitOverride`), so the wrapper suppresses those errors while still reporting errors in stack source.
31
+
32
+
# Reference Repos
33
+
34
+
`contracts/` and `whitepaper/` (cloned via `pnpm reference`) are made **read-only** with `chmod -R a-w`. To refresh, delete the directory and re-run `pnpm reference`.
35
+
36
+
# Versioning
37
+
38
+
All packages use version `1001.0.0` (Epoch Semantic Versioning), managed by changesets (`pnpm changeset`).
|`apps/faucet`| Testnet CKB distribution|**Migrated** to new packages + CCC |
24
+
|`apps/sampler`| iCKB exchange rate sampling |**Migrated** to new packages + CCC |
25
+
|`apps/bot`| Automated order matching | Legacy (`@ickb/v1-core` + Lumos)|
26
+
|`apps/tester`| Order creation simulator | Legacy (`@ickb/v1-core` + Lumos)|
27
+
|`apps/interface`| React web UI | Legacy (`@ickb/v1-core` + Lumos)|
28
28
29
29
**Key upstream contributions:** UDT and Epoch support were contributed to CCC upstream and have been merged. Some local utilities may overlap with features now available natively in CCC.
30
30
@@ -58,10 +58,10 @@ graph TD;
58
58
When `ccc-dev/pins/REFS` is committed, `pnpm install` automatically sets up the CCC local development environment on first run (by replaying pinned merges via `ccc-dev/replay.sh`). No manual setup step is needed — just clone and install:
To redo the setup from scratch: `rm -rf ccc-dev/ccc && pnpm install`.
64
+
To redo the setup from scratch: `pnpm ccc:clean && pnpm install`.
65
65
66
66
See [ccc-dev/README.md](ccc-dev/README.md) for recording new pins, developing CCC PRs, and the full workflow.
67
67
@@ -80,12 +80,15 @@ This clones two repos into the project root (both are git-ignored and made read-
80
80
81
81
## Developer Scripts
82
82
83
-
| Command | Description |
84
-
|---|---|
85
-
|`pnpm pr`| Open a GitHub PR creation page for the current branch. Uses Claude to auto-generate title and body when available, falls back to branch name and commit log. |
86
-
|`pnpm review`| Fetch and display PR review comments from GitHub for the current branch (or `pnpm review -- --pr <number>` for a specific PR). |
87
-
88
-
> **Note:**`gh` CLI is not available in this environment. Use `pnpm pr` and `pnpm review` instead.
Copy file name to clipboardExpand all lines: ccc-dev/README.md
+7-5Lines changed: 7 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ CCC has unreleased branches (`releases/next`, `releases/udt`) that this project
10
10
11
11
2.**Workspace override** — When `ccc-dev/ccc/` is present, `.pnpmfile.cjs` auto-discovers all CCC packages and rewrites `@ckb-ccc/*` dependencies to `workspace:*` — no manual `pnpm.overrides` needed. This is necessary because `catalog:` specifiers resolve to a semver range _before_ pnpm considers workspace linking — even with `link-workspace-packages = true`, pnpm fetches from the registry without this hook. When CCC is not cloned, the hook is a no-op and deps resolve from the registry normally.
12
12
13
-
3.**Source-level types** — `patch.sh` (called by both `record.sh` and `replay.sh`) patches CCC's `package.json` exports to point TypeScript at `.ts` source instead of built `.d.ts`. This gives real-time type feedback when editing across the CCC/stack boundary — changes in CCC source are immediately visible to stack packages without rebuilding.
13
+
3.**Source-level types** — `patch.sh` (called by both `record.sh` and `replay.sh`) patches CCC's `package.json` exports to point TypeScript at `.ts` source instead of built `.d.ts`, then creates a deterministic git commit (fixed author/date) so record and replay produce the same `pins/HEAD` hash. This gives real-time type feedback when editing across the CCC/stack boundary — changes in CCC source are immediately visible to stack packages without rebuilding.
14
14
15
15
4.**Diagnostic filtering** — `ccc-dev/tsc.mjs` is a tsc wrapper used by stack package builds. Because CCC `.ts` source is type-checked under the stack's stricter tsconfig (`verbatimModuleSyntax`, `noImplicitOverride`, `noUncheckedIndexedAccess`), plain `tsc` would report hundreds of CCC diagnostics that aren't real integration errors. The wrapper emits output normally and only fails on diagnostics from stack source files. When CCC is not cloned, packages fall back to plain `tsc`.
16
16
@@ -33,7 +33,7 @@ Recording captures the current upstream state and any conflict resolutions:
33
33
pnpm ccc:record
34
34
```
35
35
36
-
This runs `ccc-dev/record.sh` which clones CCC, merges the configured refs, uses Claude CLI to resolve any conflicts, patches for source-level type resolution, and writes `pins/`. Commit the resulting `ccc-dev/pins/` directory so other contributors get the same build.
36
+
This runs `ccc-dev/record.sh` which clones CCC, merges the configured refs, uses AI Coworker to resolve any conflicts, patches for source-level type resolution, and writes `pins/`. Commit the resulting `ccc-dev/pins/` directory so other contributors get the same build.
37
37
38
38
The `ccc:record` script in `package.json` is preconfigured with the current refs:
Refs are merged sequentially onto a `wip` branch, then CCC is built. On merge conflicts, the script auto-resolves them using Claude.
64
+
Refs are merged sequentially onto a `wip` branch, then CCC is built. On merge conflicts, the script auto-resolves them using AI Coworker.
65
65
66
66
## Developing CCC PRs
67
67
@@ -96,15 +96,17 @@ git checkout wip # return to development
96
96
97
97
## Switching modes
98
98
99
+
**Check for pending work:**`pnpm ccc:status` — exit 0 if `ccc-dev/ccc/` matches pinned state (safe to wipe), exit 1 otherwise.
100
+
99
101
**Local CCC (default when `pins/` is committed):**`pnpm install` auto-replays pins and overrides deps.
100
102
101
103
**Published CCC:**`pnpm ccc:reset && pnpm install` — removes clone and pins, restores published packages.
102
104
103
-
**Re-record:**`pnpm ccc:record` wipes and re-records everything from scratch.
105
+
**Re-record:**`pnpm ccc:record` wipes and re-records everything from scratch. Aborts if `ccc-dev/ccc/` has pending work.
104
106
105
107
**Force re-replay:**`pnpm ccc:clean && pnpm install` — removes clone but keeps pins, replays on next install.
106
108
107
109
## Requirements
108
110
109
-
-**Recording** (`pnpm ccc:record`): Requires [Claude CLI](https://www.npmjs.com/package/@anthropic-ai/claude-code) for automated conflict resolution (only when merging refs).
111
+
-**Recording** (`pnpm ccc:record`): Requires the AI Coworker CLI (installed as a devDependency; invoked via `pnpm coworker:ask`) for automated conflict resolution (only when merging refs).
110
112
-**Replay** (`pnpm install`): No extra tools needed — works for any contributor with just pnpm.
0 commit comments