Skip to content

Commit 0ce88c1

Browse files
authored
Merge pull request coleam00#981 from dynamous-community/feat/move-docs-to-workspace
refactor: move docs site to packages/docs-web as workspace member
2 parents 92c85ae + cf86467 commit 0ce88c1

74 files changed

Lines changed: 4038 additions & 9554 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/rules/dx-quirks.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# DX Quirks
2+
3+
## Bun Log Elision
4+
5+
When running `bun dev` from repo root, `--filter` truncates logs to `[N lines elided]`.
6+
To see full logs: `cd packages/server && bun --watch src/index.ts` or `bun --cwd packages/server run dev`.
7+
8+
## mock.module() Pollution
9+
10+
`mock.module()` is process-global and irreversible — `mock.restore()` does NOT undo it.
11+
Never add `afterAll(() => mock.restore())` for `mock.module()` cleanup.
12+
Use `spyOn()` for internal modules (spy.mockRestore() DOES work).
13+
When adding tests with `mock.module()`, ensure package.json runs it in a separate `bun test` invocation.
14+
15+
## Worktree Port Allocation
16+
17+
Worktrees auto-allocate ports (3190-4089 range, hash-based on path). Same worktree always gets same port.
18+
Main repo defaults to 3090. Override: `PORT=4000 bun dev`.
19+
20+
## bun run test vs bun test
21+
22+
NEVER run `bun test` from repo root — it discovers all test files across packages in one process, causing ~135 mock pollution failures. Always use `bun run test` (which uses `bun --filter '*' test` for per-package isolation).
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Isolation Architecture Patterns
2+
3+
## Core Design
4+
5+
- ALL isolation logic is centralized in the orchestrator — adapters are thin
6+
- Every @mention auto-creates a worktree (simplicity > efficiency; worktrees are cheap)
7+
- Data model is work-centric (`isolation_environments` table), enabling cross-platform sharing
8+
- Cleanup is a separate service using git-first checks
9+
10+
## Directory Structure
11+
12+
```
13+
~/.archon/workspaces/owner/repo/
14+
├── source/ # Clone or symlink to local path
15+
├── worktrees/ # Git worktrees for this project
16+
├── artifacts/ # Workflow artifacts (NEVER in git)
17+
│ └── runs/{id}/ # Per-run artifacts ($ARTIFACTS_DIR)
18+
└── logs/ # Workflow execution logs
19+
```
20+
21+
## Resolution Flow
22+
23+
1. Adapter provides `IsolationHints` (conversationId, workflowId, branch preference)
24+
2. Orchestrator's `validateAndResolveIsolation()` resolves hints → environment
25+
3. WorktreeProvider creates worktree if needed, syncs with origin first
26+
4. Environment tracked in `isolation_environments` table
27+
28+
## Key Packages
29+
30+
- `@archon/isolation` (`packages/isolation/src/`) — types, providers, resolver, error classifiers
31+
- `@archon/git` (`packages/git/src/`) — branch, worktree, repo operations
32+
- `@archon/paths` (`packages/paths/src/`) — path resolution utilities
33+
34+
## Safety Rules
35+
36+
- NEVER run `git clean -fd` — permanently deletes untracked files
37+
- Use `classifyIsolationError()` to map git errors to user-friendly messages
38+
- Trust git's natural guardrails (refuse to remove worktree with uncommitted changes)
39+
- Use `execFileAsync` (not `exec`) when calling git directly

.github/workflows/deploy-docs.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Deploy Docs
33
on:
44
push:
55
branches: [main]
6-
paths: ['website/**']
6+
paths: ['packages/docs-web/**']
77
workflow_dispatch:
88

99
permissions:
@@ -20,15 +20,17 @@ jobs:
2020
runs-on: ubuntu-latest
2121
steps:
2222
- uses: actions/checkout@v4
23-
- uses: withastro/action@v3
23+
- uses: oven-sh/setup-bun@v2
2424
with:
25-
path: ./website
26-
node-version: 22
27-
package-manager: npm@11
25+
bun-version: 1.3.11
26+
- name: Install dependencies
27+
run: bun install --frozen-lockfile
28+
- name: Build docs
29+
run: bun run build:docs
2830
- name: Upload artifact
2931
uses: actions/upload-pages-artifact@v3
3032
with:
31-
path: ./website/dist
33+
path: ./packages/docs-web/dist
3234

3335
deploy:
3436
needs: build

.prettierignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ package-lock.json
2828
.archon/
2929

3030
# Website (Astro/Starlight - uses own formatting)
31-
website/
31+
packages/docs-web/
3232

3333
# GitHub templates (don't auto-format)
3434
.github/

CLAUDE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ async function createSession(conversationId: string, codebaseId: string) {
656656
2. **Workflows** (YAML-based):
657657
- Stored in `.archon/workflows/` (searched recursively)
658658
- Multi-step AI execution chains, discovered at runtime
659-
- **`nodes:` (DAG format)**: Nodes with explicit `depends_on` edges; independent nodes in the same topological layer run concurrently. Node types: `command:` (named command file), `prompt:` (inline prompt), `bash:` (shell script, stdout captured as `$nodeId.output`, no AI), `loop:` (iterative AI prompt until completion signal) — see docs/loop-nodes.md. Supports `when:` conditions, `trigger_rule` join semantics, `$nodeId.output` substitution, `output_format` for structured JSON output (Claude and Codex), `allowed_tools`/`denied_tools` for per-node tool restrictions (Claude only), `hooks` for per-node SDK hook callbacks (Claude only) — see docs/hooks.md, `mcp` for per-node MCP server config files (Claude only, env vars expanded at execution time) — see docs/mcp-servers.md, and `skills` for per-node skill preloading via AgentDefinition wrapping (Claude only) — see docs/skills.md
659+
- **`nodes:` (DAG format)**: Nodes with explicit `depends_on` edges; independent nodes in the same topological layer run concurrently. Node types: `command:` (named command file), `prompt:` (inline prompt), `bash:` (shell script, stdout captured as `$nodeId.output`, no AI), `loop:` (iterative AI prompt until completion signal) . Supports `when:` conditions, `trigger_rule` join semantics, `$nodeId.output` substitution, `output_format` for structured JSON output (Claude and Codex), `allowed_tools`/`denied_tools` for per-node tool restrictions (Claude only), `hooks` for per-node SDK hook callbacks (Claude only), `mcp` for per-node MCP server config files (Claude only, env vars expanded at execution time), and `skills` for per-node skill preloading via AgentDefinition wrapping (Claude only)
660660
- Provider inherited from `.archon/config.yaml` unless explicitly set; per-node `provider` and `model` overrides supported
661661
- Model and options can be set per workflow or inherited from config defaults
662662
- `interactive: true` at the workflow level forces foreground execution on web (required for approval-gate workflows in the web UI)
@@ -678,7 +678,7 @@ async function createSession(conversationId: string, codebaseId: string) {
678678
**Global workflows** (user-level, applies to every project):
679679
- Path: `~/.archon/.archon/workflows/` (or `$ARCHON_HOME/.archon/workflows/`)
680680
- Load priority: bundled < global < repo-specific (repo overrides global by filename)
681-
- See `docs/global-workflows.md` for details
681+
- See the docs site at `packages/docs-web/` for details
682682

683683
### Error Handling
684684

0 commit comments

Comments
 (0)