Initial Commit
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
# OpenSpec Change: enterprise-gaming-r3f-physics-cascade
|
||||
|
||||
- **Change ID**: enterprise-gaming-r3f-physics-cascade
|
||||
- **Package**: `@suaveplan/r3f-physics-cascade`
|
||||
- **Category**: gaming/physics
|
||||
- **Target path**: `gaming/physics/r3f-physics-cascade`
|
||||
- **Status**: PROPOSED
|
||||
- **Date**: 2026-04-24
|
||||
|
||||
---
|
||||
|
||||
## Summary
|
||||
|
||||
Deliver `@suaveplan/r3f-physics-cascade` on the genesis branch from scratch at enterprise quality. The package provides cascading physics effects for React Three Fiber: chain-reaction impulse propagation (impact → impulse list → rigid bodies receive forces), structural collapse simulation (rigid-body sleep/wake thresholds), and `CascadeZone` spatial boundaries that limit propagation extent. Wires to `@suaveplan/r3f-physics-rapier` via the core `PhysicsBackend` interface. Genesis adds structured errors, OTel cascade-event counter, and 100% coverage.
|
||||
|
||||
---
|
||||
|
||||
## Available workspace deps
|
||||
|
||||
`@suaveplan/error`, `@suaveplan/types`, `@suaveplan/events`, `@suaveplan/r3f-physics-core`, react, `@react-three/fiber`, three.
|
||||
|
||||
---
|
||||
|
||||
## Public API surface
|
||||
|
||||
```ts
|
||||
function CascadeZone(props: CascadeZoneProps): JSX.Element
|
||||
// center, radius, maxPropagations
|
||||
|
||||
function useCascade(): CascadeController
|
||||
// trigger(origin, force, radius): void
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## File layout
|
||||
|
||||
```text
|
||||
gaming/physics/r3f-physics-cascade/
|
||||
package.json / tsconfig.json / vitest.config.ts
|
||||
src/
|
||||
index.ts / error-codes.ts
|
||||
types/common.ts + md
|
||||
core/
|
||||
cascade-propagator/ (ts + md + types + test + index)
|
||||
context/cascade-provider.tsx + md + test
|
||||
hooks/use-cascade.ts + md + test
|
||||
components/
|
||||
CascadeZone/ (tsx + md + test + stories + index)
|
||||
tests/integration.test.ts
|
||||
```
|
||||
@@ -0,0 +1,24 @@
|
||||
# Tasks: enterprise-gaming-r3f-physics-cascade
|
||||
|
||||
## 0. Pre-flight (non-negotiable)
|
||||
|
||||
- [ ] 0.1 Confirm clean working tree (`git status` reports nothing) and no in-flight worktrees with uncommitted work (`git worktree list` then `git status` in each)
|
||||
- [ ] 0.2 If any worktrees exist under `.claude/worktrees/`, account for each one: still-active agent, work-pending-merge, or stale-and-prune. Stale worktrees MUST be removed (`git worktree remove`) before opening a new one — code that has been lost twice on main is the failure mode this guards against.
|
||||
- [ ] 0.3 Confirm the package set in `MANIFEST.md` matches `find packages -maxdepth 3 -name package.json` count. Drift here means a prior change archived without regenerating the manifest.
|
||||
|
||||
## Phase 1 — Scaffold + types
|
||||
|
||||
## Phase 2 — Cascade propagator
|
||||
|
||||
- [ ] BFS impulse propagation with max-depth and zone boundary clamping
|
||||
- [ ] Tests + docs
|
||||
|
||||
## Phase 3 — Provider + `useCascade` hook
|
||||
|
||||
## Phase 4 — `CascadeZone` component + story
|
||||
|
||||
## Phase 5 — Pre-publish gate
|
||||
|
||||
- [ ] `bunx turbo lint typecheck test --filter=@suaveplan/r3f-physics-cascade` green
|
||||
- [ ] 100% coverage
|
||||
- [ ] Publish: `bun scripts/publish.ts --package @suaveplan/r3f-physics-cascade`
|
||||
Reference in New Issue
Block a user