Skip to content

feat: MCP direct tools, local-model eval, uncertainty, calc sheets, calculator app, new domains - #10

Merged
evangress merged 3 commits into
mainfrom
feat/roadmap-next
Nov 7, 2026
Merged

evangress merged 3 commits into
mainfrom
feat/roadmap-next

Conversation

@evangress

Copy link
Copy Markdown
Collaborator

Re-opens #9 against main: #9 was merged into feat/ai-registry-mcp-pypi after #8 had already landed, so these commits never reached main.

Builds the rest of ROADMAP sections 9-11. Stacked on #8: merge #8 first, and GitHub retargets this PR to main automatically.

What's new

  • MCP direct tools: fpc-mcp --domains fluids,thermo also serves each calculation in those domains as its own tool, with the registry's JSON Schema.

  • Local-model evaluation: scripts/try_local_model.py asks an Ollama model six mixed-unit engineering questions through fpc-mcp and checks the answers against fpc. The results are in docs/ai.md:

    Model 5 general tools Direct tools
    qwen3:14b, thinking off 6/6 6/6
    qwen3:14b, thinking on 3/6 3/6
    qwen2.5:7b 5/6 4/6
    qwen2.5-coder:14b 0/6 0/6
    • With thinking on, qwen3's tool calls were right but its answer came back empty: after a tool call, Ollama puts the answer in the thinking field.
    • qwen2.5-coder writes tool calls as text, so they never run.
    • qwen2.5:7b sometimes returns an empty reply. With direct tools it once also forgot to convert a cm result to the mm asked for.
  • calculate tool fix: a model that puts the inputs beside key (qwen2.5:7b did) now gets back the exact call shape to send, instead of a validation error it retried indefinitely.

  • Uncertainty: fpc.uncertainty and fpc uncertainty run Monte Carlo on any calculation. Inputs can be Normal, Uniform or Triangular. The result gives the mean, standard deviation, percentiles, a 95 % interval and each input's share of the spread.

  • Calc sheets: fpc.report and fpc report write a Markdown sheet with the method, inputs with units, defaults, result, library version, an optional uncertainty section and a review checklist.

  • Web calculator: apps/calculator.py is a Streamlit form for every calculation, generated from the registry, with uncertainty and calc-sheet tabs.

  • New domains:

    • MachineElements: bolts, shafts, springs, bearings, welds.
    • Fatigue: Marin factors; Goodman, Soderberg, Gerber and ASME-elliptic safety factors; S-N curve.
    • Psychrometrics: saturation pressure, humidity ratio, relative humidity, dew point, enthalpy, specific volume, wet bulb.
    • Material: Johnson buckling and an Euler/Johnson chooser.
    • Tests check published ASHRAE Fundamentals 2017 and Shigley Table 6-5 values; the rest check against hand calculations.
  • Stricter types: mypy now uses disallow_untyped_defs and disallow_incomplete_defs across fpc/.

  • Docs and bookkeeping:

    • New guide: docs/trusting-results.md.
    • New API pages, a building-tools section, and README, CHANGELOG, CLAUDE.md and ROADMAP updates. New follow-ups are listed in ROADMAP.

Checks run locally

  • Tests: pytest 419 passed on Python 3.14 and on 3.11.
  • ruff check and ruff format --check pass.
  • mypy with the stricter settings passes.
  • scripts/python_support.py check passes.
  • mkdocs build --strict passes.
  • pre-commit passes.

Needs a human

  • Some Shigley and ASHRAE equation numbers in the new modules' citations were written from memory. The values were checked; the numbers are worth a spot-check.
  • Checking w_shapes.csv against AISC needs the spreadsheet downloaded by hand: aisc.org returns 403 to scripts.
  • "Consistent result objects" (ROADMAP §9) is still a maintainer decision.

🤖 Generated with Claude Code

evangress and others added 3 commits November 7, 2026 13:44
…y calculator app

- fpc-mcp --domains fluids,thermo: also serve each calculation as its own
  tool, with the registry's JSON Schema (synthesized signature adapter).
- calculate tool: explain the nesting when a model sends inputs next to
  "key" (seen with qwen2.5:7b); clearer example in its description.
- scripts/try_local_model.py: run engineering questions through fpc-mcp
  with an Ollama model and check the answers against fpc.
- fpc.uncertainty: Normal/Uniform/Triangular inputs, monte_carlo() on any
  registry calculation or function, intervals and sensitivity;
  fpc uncertainty command.
- fpc.report: Markdown calc sheets (method, inputs with units, defaults,
  result, optional uncertainty, review checklist); fpc report command.
- apps/calculator.py: Streamlit form for every calculation, generated from
  the registry, with uncertainty and calc-sheet tabs; AppTest coverage.
- mypy: disallow untyped/incomplete defs across fpc/ (annotated the
  remaining helpers in beam, design, modal, cli).
- docs: trusting-results guide, API pages, building-tools section.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ROADMAP section 11 "domain gaps engineers hit daily" plus cited tests:

- MachineElements: bolt torque/preload/stiffness/joint constant and load
  sharing, static (von Mises) and DE-Goodman shaft diameter, spring rate
  and Wahl/Bergstrasser shear stress, bearing L10 life and required rating,
  fillet weld throat shear (Shigley 10th ed.).
- Fatigue: Se' for steels, Marin factors (surface, size, load,
  reliability), Goodman/Soderberg/Gerber/ASME-elliptic safety factors,
  Basquin S-N line and cycles to failure.
- Material: radius of gyration, slenderness and transition ratios, Johnson
  buckling load, and critical_buckling_load choosing Euler or Johnson.
- Psychrometrics: Hyland-Wexler saturation pressure, humidity ratio, RH,
  dew point and wet bulb (brentq), enthalpy, specific volume, altitude
  pressure (ASHRAE Fundamentals 2017 Ch. 1).

Exported, preloaded in the GUI, documented (API pages, README), llms.txt
regenerated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- scripts/try_local_model.py: --think on|off; report when a reasoning
  model's answer lands only in the thinking field.
- docs/ai.md: --domains section and a results table for qwen3:14b,
  qwen2.5:7b and qwen2.5-coder:14b, with the failure modes found.
- ROADMAP: tick sections 9-11 items done on this branch; new follow-ups
  (AISC download is manual, equation-number spot check, enhancement
  factor, older-domain citations, LM Studio/Open WebUI apps).
- CHANGELOG, CLAUDE.md: new domains, uncertainty, reports, app.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@evangress
evangress merged commit 275e14d into main Nov 7, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant