Skip to content

Commit 96879d3

Browse files
committed
feat: initial Parallax workspace scaffold
- 9 crates: core, store, graph, query, policy, ingest, connect, server, cli - parallax-core: EntityId, Entity, Relationship, Value, Timestamp, SourceTag - 15 passing tests in parallax-core - 9 architectural specs (00-vision through 08-policy-engine) - CLAUDE.md with YOLO + strict gitflow workflow modes - .claude/commands for dev automation - GitHub Actions CI (check, fmt, clippy, test)
0 parents  commit 96879d3

50 files changed

Lines changed: 5950 additions & 0 deletions

Some content is hidden

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

.claude/commands/build.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
description: Build the entire workspace or a specific crate
3+
---
4+
5+
Build the Parallax workspace.
6+
7+
If the user specifies a crate name (e.g., "store", "graph", "query"), build only that crate:
8+
```bash
9+
cargo build --package parallax-$CRATE_NAME
10+
```
11+
12+
Otherwise build the full workspace:
13+
```bash
14+
cargo build --workspace
15+
```
16+
17+
// turbo
18+
After the build, report:
19+
1. Whether it succeeded or failed
20+
2. Any warnings (summarize, don't dump raw output)
21+
3. If failed, identify the root error and suggest a fix

.claude/commands/check.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
description: Run full CI checks (clippy, fmt, test) like a pre-push gate
3+
---
4+
5+
Run the full Parallax CI check suite in order. Stop on first failure.
6+
7+
// turbo
8+
1. Format check:
9+
```bash
10+
cargo fmt --all -- --check
11+
```
12+
13+
// turbo
14+
2. Clippy lint:
15+
```bash
16+
cargo clippy --workspace --all-targets -- -D warnings
17+
```
18+
19+
// turbo
20+
3. Tests:
21+
```bash
22+
cargo test --workspace
23+
```
24+
25+
After all steps, report a summary:
26+
- ✓ or ✗ for each step
27+
- Total time elapsed
28+
- If any step failed, show the root cause and suggest a fix

.claude/commands/feat.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
description: Start a new feature branch (strict gitflow mode) with conventional commit setup
3+
---
4+
5+
Create a feature branch for a new piece of work. Strict gitflow mode only.
6+
7+
The user specifies type and name, e.g.:
8+
- `feat wal-group-commit`
9+
- `fix cyclic-traversal`
10+
- `refactor planner-cost-model`
11+
12+
Steps:
13+
14+
1. Verify we're on `develop` (or create it from `main` if it doesn't exist)
15+
16+
```bash
17+
git checkout develop 2>/dev/null || git checkout -b develop
18+
```
19+
20+
2. Pull latest
21+
22+
```bash
23+
git pull --rebase origin develop 2>/dev/null || true
24+
```
25+
26+
3. Create the feature branch
27+
28+
```bash
29+
git checkout -b <type>/<name>
30+
```
31+
32+
4. Report the branch name and remind the user of the conventional commit format:
33+
34+
```
35+
<type>(<scope>): <description>
36+
```
37+
38+
Valid scopes: core, store, graph, query, policy, ingest, connect, server, cli
39+
40+
5. When done, the user should run `/pr` to create the PR checklist.

.claude/commands/impl.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
description: Implement a type or function from a spec, following all architectural constraints
3+
---
4+
5+
Implement a specific type, trait, or function from the Parallax specs.
6+
7+
The user will say something like:
8+
- `impl EntityId` → implement the EntityId type from spec 01
9+
- `impl WAL append` → implement the WAL append method from spec 02
10+
- `impl BFS traversal` → implement the BFS traversal from spec 03
11+
- `impl PQL parser` → implement the PQL lexer+parser from spec 04
12+
13+
Steps:
14+
15+
1. Read the relevant spec file to get the type signature, invariants, and design constraints.
16+
2. Read the target crate's existing code to understand what already exists.
17+
3. Implement the type/function following:
18+
- Exact type signatures from the spec (they are the contract)
19+
- Ownership patterns described in the spec (Matsakis's rules)
20+
- Error handling: `thiserror` in libraries, propagate with `?`
21+
- No `unwrap()` — use `expect("reason")` or `?`
22+
- Every `unsafe` block gets a `// SAFETY:` comment
23+
- Add `#[cfg(test)] mod tests` with at least one happy-path and one error-path test
24+
4. After implementation:
25+
26+
// turbo
27+
```bash
28+
cargo check --package parallax-<crate>
29+
```
30+
31+
// turbo
32+
```bash
33+
cargo test --package parallax-<crate>
34+
```
35+
36+
5. Report which invariants (INV-*) are covered by the implementation and tests.

.claude/commands/invariants.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
description: List all invariants or check which invariants a code change affects
3+
---
4+
5+
Two modes:
6+
7+
**List all:** `invariants list`
8+
- Read all spec files (00-08) and extract every `INV-*` code
9+
- Display as a table: Code | Spec | Description
10+
11+
**Check impact:** `invariants check <file_or_crate>`
12+
- Read the specified file or all files in the specified crate
13+
- Cross-reference against the invariant list
14+
- Report which invariants the code touches or could violate
15+
- Flag any potential violations with specific line numbers
16+
17+
This is the pre-commit safety check. Run it before any PR in strict gitflow mode.

.claude/commands/pr.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
---
2+
description: Generate a PR description and run the pre-merge checklist (strict gitflow)
3+
---
4+
5+
Generate a pull request for the current feature branch. Strict gitflow mode.
6+
7+
Steps:
8+
9+
1. Get the current branch name and diff against develop:
10+
11+
```bash
12+
git branch --show-current
13+
```
14+
15+
```bash
16+
git log develop..HEAD --oneline
17+
```
18+
19+
```bash
20+
git diff develop --stat
21+
```
22+
23+
2. Run the full CI check suite (same as /check):
24+
25+
// turbo
26+
```bash
27+
cargo fmt --all -- --check
28+
```
29+
30+
// turbo
31+
```bash
32+
cargo clippy --workspace --all-targets -- -D warnings
33+
```
34+
35+
// turbo
36+
```bash
37+
cargo test --workspace
38+
```
39+
40+
3. Check for forbidden patterns:
41+
42+
```bash
43+
grep -rn "unwrap()" crates/ --include="*.rs" | grep -v "test" | grep -v "#\[cfg(test)\]" || echo "No unwrap() in library code"
44+
```
45+
46+
```bash
47+
grep -rn "TODO(yolo)" crates/ connectors/ --include="*.rs" || echo "No TODO(yolo) markers"
48+
```
49+
50+
4. Generate the PR description in this format:
51+
52+
```markdown
53+
## Summary
54+
<one paragraph describing the change>
55+
56+
## Type
57+
<feat|fix|refactor|perf|test|docs|ci|chore>(<scope>)
58+
59+
## Changes
60+
<bulleted list of files changed and what changed in each>
61+
62+
## Invariants
63+
<list any INV-* codes affected by this change>
64+
65+
## Checklist
66+
- [ ] Branch is up to date with `develop`
67+
- [ ] `cargo check --workspace` passes
68+
- [ ] `cargo test --workspace` passes
69+
- [ ] `cargo clippy --workspace --all-targets -- -D warnings` passes
70+
- [ ] `cargo fmt --all -- --check` passes
71+
- [ ] New public APIs have doc comments
72+
- [ ] Invariants from specs are preserved
73+
- [ ] No `unwrap()` in library crates
74+
- [ ] No `TODO(yolo)` markers remain
75+
76+
## Testing
77+
<describe what was tested and how>
78+
```
79+
80+
5. Report pass/fail status for each checklist item.

.claude/commands/scaffold.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
description: Scaffold a new crate or connector with correct structure
3+
---
4+
5+
Scaffold a new Parallax component. The user will specify one of:
6+
7+
**Crate:** `scaffold crate <name>`
8+
- Create `crates/parallax-<name>/Cargo.toml` with workspace dependency on `parallax-core`
9+
- Create `crates/parallax-<name>/src/lib.rs` with module doc comment and basic structure
10+
- Add the crate to the workspace `Cargo.toml` members list
11+
- Follow the dependency rules from `specs/07-crate-structure.md` — never create upward dependencies
12+
13+
**Connector:** `scaffold connector <source>`
14+
- Create `connectors/connector-<source>/Cargo.toml` depending on `parallax-connect`
15+
- Create `connectors/connector-<source>/src/lib.rs` implementing the `Connector` trait skeleton
16+
- Include one example step with TODO markers
17+
- Add to workspace members
18+
19+
For both, after scaffolding:
20+
21+
// turbo
22+
```bash
23+
cargo check --workspace
24+
```
25+
26+
Report what was created and confirm it compiles.

.claude/commands/spec.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
description: Look up a spec by number or keyword and summarize relevant sections
3+
---
4+
5+
Read and summarize a Parallax spec. The user will specify either:
6+
7+
- A spec number: `spec 02` → read `specs/02-storage-engine.md`
8+
- A keyword: `spec traversal` → find the most relevant spec and section
9+
10+
Read the spec file and provide:
11+
1. A one-paragraph summary of the spec's purpose
12+
2. The key invariants (INV-* codes) defined in the spec
13+
3. The open questions listed at the end
14+
4. Any code types/signatures relevant to the user's current work
15+
16+
If the user asks about a specific topic (e.g., "spec MVCC"), search across all specs for the relevant sections rather than reading a single file end-to-end.

.claude/commands/yolo.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
description: Quick commit in YOLO mode — add all, commit with message, no ceremony
3+
---
4+
5+
Fast commit for YOLO mode. The user provides a short message.
6+
7+
// turbo
8+
```bash
9+
cargo check --workspace
10+
```
11+
12+
If check passes:
13+
14+
```bash
15+
git add -A && git commit -m "$ARGUMENTS"
16+
```
17+
18+
If check fails, fix the error first, then commit.
19+
20+
Never run this in strict gitflow mode. Check CLAUDE.md for active mode.

.claude/settings.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"cargo build*",
5+
"cargo check*",
6+
"cargo test*",
7+
"cargo clippy*",
8+
"cargo fmt*",
9+
"cargo bench*",
10+
"cargo doc*",
11+
"cargo run --package parallax-cli*",
12+
"cargo tree*",
13+
"cargo metadata*",
14+
"rg *",
15+
"fd *",
16+
"cat *",
17+
"head *",
18+
"tail *",
19+
"wc *",
20+
"git status",
21+
"git log*",
22+
"git diff*",
23+
"git branch*",
24+
"git show*",
25+
"git stash list"
26+
],
27+
"deny": [
28+
"rm -rf /",
29+
"cargo publish*",
30+
"git push --force*",
31+
"git reset --hard*",
32+
"sudo *"
33+
]
34+
},
35+
"model": {
36+
"temperature": 0
37+
}
38+
}

0 commit comments

Comments
 (0)