Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
OPENROUTER_API_KEY=
OPENROUTER_MODEL=google/gemini-3-flash-preview
OPENROUTER_SITE_URL=http://localhost:3000
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,15 @@ id_ed25519
# Local automation caches
/.cache/
/.cargo-audit/

# Oddly Exact web application
/node_modules/
/.next/
/.open-next/
/.wrangler/
/public/wasm/
/next-env.d.ts
/worker-configuration.d.ts
/tsconfig.tsbuildinfo
/test-results/
/playwright-report/
79 changes: 79 additions & 0 deletions .impeccable.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Oddly Exact web experience — design context

## Audience

The first audience is curious developers, technical professionals, and advanced
students who want to ask a mathematical question in natural language while
retaining an inspectable record of what was interpreted, computed, and
explained.

## Jobs to be done

- Ask a mathematical question without first translating it into calculator
syntax.
- See the interpretation, assumptions, selected operation, tool request,
deterministic result, and explanation as distinct stages.
- Understand why a mathematical procedure was chosen.
- Inspect or copy the exact calculator evidence rather than trusting prose.
- Receive a typed refusal when the request is ambiguous, unsupported, unsafe,
or exceeds declared resource limits.

## Personality

Precise, lucid, and quietly theatrical.

The experience should feel like a master teacher unfolding a proof in a
beautiful research notebook—not a chatbot, generic AI dashboard, or
science-fiction command center.

## Visual direction

- Light theme derived from psychologically tuned Radix Colors.
- Material-adjacent hierarchy and interaction clarity without imitating Google.
- Radix primitives and Radix Icons for accessible controls and consistent
symbolic language.
- Warm neutral paper-like foundation, mineral blue for interpretation,
botanical green for verified calculator evidence, amber for assumptions, and
restrained vermilion for challenge or refusal states.
- Mathematical typography and kinetic disclosure provide the visual identity.
- Avoid cyan-on-black AI styling, purple gradients, glassmorphism, chat bubbles,
mascot imagery, and generic card grids.

## Signature interaction

The submitted question unfolds into a vertical proof theater:

1. interpretation
2. assumptions
3. selected Oddly Exact operation
4. tool request
5. deterministic evidence
6. explanation

Each stage emerges from the previous one with spatial continuity. The result is
not streamed as undifferentiated prose. The interface reveals a typed event
sequence and keeps the calculator response inspectable.

## AI and trust boundary

- OpenRouter supplies the language model.
- The OpenRouter API key remains server-side.
- The model may interpret, select an allowlisted calculator operation, request
a tool call, and explain returned evidence.
- The model must not supply final arithmetic from its own reasoning.
- Every numerical claim in the final answer must be grounded in a returned
Oddly Exact result.
- Tool calls are schema validated, size limited, time bounded, turn bounded,
and executed without shell interpolation.
- User text is untrusted data and cannot alter system policy, tool schemas, or
runtime limits.
- Unsupported or ambiguous requests fail closed with a useful explanation.

## Accessibility and performance

- Responsive from mobile through wide desktop.
- Keyboard complete, visible focus, accessible names, and WCAG AA contrast.
- Respect `prefers-reduced-motion` with a composed static alternative.
- The core experience must remain functional without advanced motion APIs.
- Target smooth interaction on a mid-range phone; use transform and opacity for
motion and avoid permanent animation loops.
3 changes: 3 additions & 0 deletions .openai/hosting.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"project_id": "appgprj_6a645d90e0988191a89e9ea18e98f715"
}
100 changes: 92 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ exclude = [
"target/**",
]

[lib]
crate-type = ["cdylib", "rlib"]

[dependencies]
accurate = { version = "0.4", default-features = false }
argmin = { version = "0.11", default-features = false }
mutants = "0.0.4"
good_lp = { version = "1.15", default-features = false, features = ["microlp"] }
Expand All @@ -33,5 +37,12 @@ serde_json = "1"
statrs = { version = "0.18", default-features = false }
uom = { version = "0.38", default-features = false, features = ["f64", "si", "std"] }

[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen = "0.2"

[package.metadata.wasm-pack.profile.release]
wasm-opt = false

[dev-dependencies]
proptest = "1"
rug = { version = "1.30", default-features = false, features = ["float", "std"] }
Loading