# rae Implementations

This file is the running implementation memory for `rae`, the reusable Rust design/widget/shader crate used by `xrae` and future codebases.

## Current Naming

- Crate/package: `rae`.
- Repository: `../KnottRustDesign/` / `https://github.com/Tknott95/KnottRustDesign`.
- Former temporary in-app crate name has been retired; use `rae` everywhere in new code.
- Current release target: `rae 0.1.1`.
- `rae` is intended to be publishable as a standalone crates.io package when the API and ownership are ready.

## Reference Memory

- Primary app consumer: `../Aevtop/apps/xrae`.
- Behavioral reference: `../KnottCode/**`.
- Important concepts to support: OpenCode-like prompt/transcript/sidebar shell, Build/Plan mode, thinking modes, context picker, command palette, provider setup, agent-flow cockpit, Kanban, validation profiles, loop DONE/BLOCKED gates, resource caps, and safe workspace-scoped writes.
- Safety baseline: renderer-neutral library only; never read provider token files; expose safe sidecar command models instead of shell execution; validate write target paths before any app applies model-generated file edits.

## Done

- Split the reusable library out of the Aevtop app repo into standalone `../KnottRustDesign`.
- Renamed the package and public app-facing dependency to `rae`.
- Added standalone Cargo package metadata and repository docs.
- Added `.gitignore` so build outputs are not committed.
- Added modules for color, layout, math, shader, state, transcript, deck, flow, sidecar, theme, and widget models.
- Added heavy GLSL shader sources for curl nebula, hex lattice panes, prompt beam field, aurora curtains, knot raymarch field, terminal rain, and agent-flow beams.
- Added `effect` primitives for Flutter/Material-style ripples, glow, elevation, focus rings, disabled alpha, interaction state, and motion curves.
- Added shader families/descriptors so consuming apps can choose effects by use case and complexity.
- Added more GLSL sources: interaction ripples, bloom glow fields, code-lens scan, reaction-diffusion, Voronoi crystal facets, and plasma graph networks.
- Added more math helpers for CPU-side shader/effect work: `Vec3`, cross products, Catmull-Rom interpolation, remap, and HSV-to-RGB.
- Added transcript viewport materialization with scroll clamping.
- Added command palette/context/provider/theme/status deck data models.
- Added agent phases, edit plans, Kanban, run records, validation profiles, and completion gate helpers.
- Added sidecar command previews and write-target safety validation.

## Blockers

- Actual crates.io publication has not been performed yet in this increment. User confirmed ownership and requested a version bump, so publish target is `rae 0.1.1` after final verification and commit/push.
- `rae` is renderer-neutral; desktop drawing remains in consuming apps like `xrae`.
- Provider execution, OAuth, runtime command execution, and model calls are intentionally out of scope for this crate.

## Recommendations

- Next: add renderer-neutral hit testing and pane mouse routing.
- Next: add retained effect cache keys and shader pass descriptors.
- Next: add richer transcript/code-block tokenization without binding to a specific renderer.
- Next: add more tests around write guards, validation gates, transcript wrapping, and command palette filtering.
- Later: add examples that render the shader catalog in wgpu/macroquad/egui shells.

## Verification Log

- Passed during split: `cargo check`.
- Passed final gate: `cargo fmt --all --check`.
- Passed final gate: `cargo test`.
- Passed final gate: `cargo package --allow-dirty`.
- Passed package verification dry-run: `cargo publish --dry-run --allow-dirty`.
- Publish warning: crates.io reports `rae@0.1.0` already exists; actual upload is intentionally not run until ownership/version are confirmed.
- Passed `0.1.1` gate: `cargo fmt --all`.
- Passed `0.1.1` gate: `cargo test` with 18 tests.
- Passed `0.1.1` gate: `cargo package --allow-dirty`.
- Passed `0.1.1` publish dry-run: `cargo publish --dry-run --allow-dirty` reached upload and aborted as expected.
