crupier 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. crupier-0.1.0/.env.example +7 -0
  2. crupier-0.1.0/CHANGELOG.md +95 -0
  3. crupier-0.1.0/CONTRIBUTING.md +108 -0
  4. crupier-0.1.0/LICENSE +21 -0
  5. crupier-0.1.0/MANIFEST.in +15 -0
  6. crupier-0.1.0/PKG-INFO +869 -0
  7. crupier-0.1.0/README.md +820 -0
  8. crupier-0.1.0/SECURITY.md +76 -0
  9. crupier-0.1.0/examples/_example_support.py +52 -0
  10. crupier-0.1.0/examples/agentic_pr_review.py +70 -0
  11. crupier-0.1.0/examples/customer_support_triage.py +58 -0
  12. crupier-0.1.0/examples/drop_in_agent_boundary.py +143 -0
  13. crupier-0.1.0/examples/model-compare-eval.json +40 -0
  14. crupier-0.1.0/examples/multimodal_claim_review.py +68 -0
  15. crupier-0.1.0/examples/routing-eval.json +84 -0
  16. crupier-0.1.0/examples/sdk_dry_run.py +50 -0
  17. crupier-0.1.0/examples/workflow_operations_hub.py +134 -0
  18. crupier-0.1.0/pyproject.toml +61 -0
  19. crupier-0.1.0/setup.cfg +4 -0
  20. crupier-0.1.0/src/crupier/__init__.py +178 -0
  21. crupier-0.1.0/src/crupier/__main__.py +6 -0
  22. crupier-0.1.0/src/crupier/adapters/__init__.py +14 -0
  23. crupier-0.1.0/src/crupier/adapters/anthropic.py +267 -0
  24. crupier-0.1.0/src/crupier/adapters/base.py +83 -0
  25. crupier-0.1.0/src/crupier/adapters/common.py +130 -0
  26. crupier-0.1.0/src/crupier/adapters/factory.py +29 -0
  27. crupier-0.1.0/src/crupier/adapters/google.py +453 -0
  28. crupier-0.1.0/src/crupier/adapters/ollama.py +419 -0
  29. crupier-0.1.0/src/crupier/adapters/openai.py +366 -0
  30. crupier-0.1.0/src/crupier/adapters/openrouter.py +60 -0
  31. crupier-0.1.0/src/crupier/autopatch.py +44 -0
  32. crupier-0.1.0/src/crupier/capabilities.py +53 -0
  33. crupier-0.1.0/src/crupier/cli.py +2690 -0
  34. crupier-0.1.0/src/crupier/client.py +240 -0
  35. crupier-0.1.0/src/crupier/compat/__init__.py +5 -0
  36. crupier-0.1.0/src/crupier/compat/openai.py +503 -0
  37. crupier-0.1.0/src/crupier/config.py +421 -0
  38. crupier-0.1.0/src/crupier/costs.py +116 -0
  39. crupier-0.1.0/src/crupier/default_cards.py +234 -0
  40. crupier-0.1.0/src/crupier/errors.py +59 -0
  41. crupier-0.1.0/src/crupier/evals.py +985 -0
  42. crupier-0.1.0/src/crupier/executor.py +547 -0
  43. crupier-0.1.0/src/crupier/feedback.py +811 -0
  44. crupier-0.1.0/src/crupier/models.py +515 -0
  45. crupier-0.1.0/src/crupier/multimodal.py +514 -0
  46. crupier-0.1.0/src/crupier/orchestrator.py +520 -0
  47. crupier-0.1.0/src/crupier/planner.py +51 -0
  48. crupier-0.1.0/src/crupier/policy.py +184 -0
  49. crupier-0.1.0/src/crupier/probes.py +555 -0
  50. crupier-0.1.0/src/crupier/project_audit.py +3277 -0
  51. crupier-0.1.0/src/crupier/py.typed +1 -0
  52. crupier-0.1.0/src/crupier/registry.py +733 -0
  53. crupier-0.1.0/src/crupier/release.py +2336 -0
  54. crupier-0.1.0/src/crupier/route_schema.py +102 -0
  55. crupier-0.1.0/src/crupier/selector.py +234 -0
  56. crupier-0.1.0/src/crupier/server.py +353 -0
  57. crupier-0.1.0/src/crupier/structured.py +165 -0
  58. crupier-0.1.0/src/crupier/tools.py +296 -0
  59. crupier-0.1.0/src/crupier/trace_store.py +290 -0
  60. crupier-0.1.0/src/crupier/version.py +3 -0
  61. crupier-0.1.0/src/crupier.egg-info/PKG-INFO +869 -0
  62. crupier-0.1.0/src/crupier.egg-info/SOURCES.txt +64 -0
  63. crupier-0.1.0/src/crupier.egg-info/dependency_links.txt +1 -0
  64. crupier-0.1.0/src/crupier.egg-info/entry_points.txt +2 -0
  65. crupier-0.1.0/src/crupier.egg-info/requires.txt +32 -0
  66. crupier-0.1.0/src/crupier.egg-info/top_level.txt +1 -0
@@ -0,0 +1,7 @@
1
+ OPENAI_API_KEY=
2
+ ANTHROPIC_API_KEY=
3
+ GOOGLE_API_KEY=
4
+ GEMINI_API_KEY=
5
+ OLLAMA_API_KEY=
6
+ OLLAMA_HOST=https://ollama.com/api
7
+ OPENROUTER_API_KEY=
@@ -0,0 +1,95 @@
1
+ # Changelog
2
+
3
+ All notable changes to Crupier will be documented here.
4
+
5
+ ## 0.1.0 - 2026-06-20
6
+
7
+ - Added multi-provider routing core with dry-run and real execution paths.
8
+ - Added OpenAI, Anthropic Claude, Google Gemini, and Ollama Cloud adapters with explicit local-host override support.
9
+ - Added a real optional OpenRouter BYOK adapter using OpenAI-compatible SDK calls, explicit default host configuration, and onboarding env-key coverage.
10
+ - Added model discovery, capability probes, readiness checks, and registry snapshots.
11
+ - Added bounded provider-call retries with backoff, trace-visible failed attempts, per-request retry overrides, and fallback-compatible retry accounting.
12
+ - Added provider timeout handling for OpenAI, Anthropic Claude, Ollama, OpenRouter, and Google Gemini client configuration.
13
+ - Added OpenAI unsupported-parameter repair so models that reject optional parameters such as `temperature` can retry once without the unsupported field.
14
+ - Added structured output validation/repair, native JSON-schema request formatting for OpenAI/OpenRouter, Google, and Ollama, tool execution, multimodal file planning, and local trace storage.
15
+ - Added OpenAI-compatible client, optional autopatch, and HTTP proxy surfaces.
16
+ - Added project adoption audit, adoption doctor, production readiness gates, code comments, compare evals, and human feedback signals.
17
+ - Added adoption `review_contract` summaries that separate technical readiness from human approval and block auto-approval while human gates remain open.
18
+ - Hardened the OpenAI-compatible local server defaults so non-loopback binds require explicit opt-in and browser CORS is disabled unless an origin is configured.
19
+ - Added config-free `adopt doctor`, `adopt plan`, `adopt patches`, and offline `adopt handoff` so freshly cloned repos can get non-destructive adoption guidance before `crupier init`.
20
+ - Added `.env.example` creation and safe `.gitignore` entries to `crupier init` for new project onboarding.
21
+ - Added a release gate for safe public onboarding defaults, including Ollama Cloud as the default Ollama host and opt-in prompt/response storage.
22
+ - Added one-command `adopt package` to write the full human review bundle and persistent package index for an existing project.
23
+ - Tightened programmer credential comments to reduce false positives from redaction regexes, short identifiers, generated output, and dependency trees.
24
+ - Added human review packets for compare reports with ready-to-run feedback commands.
25
+ - Added editable human decision templates and feedback import for reviewer-filled verdicts.
26
+ - Added dry-run feedback source guards so simulated compare reports cannot satisfy production human-feedback gates by accident.
27
+ - Added programmer code-comment review acknowledgements for adoption doctor gates.
28
+ - Added PR/review-comment packets for programmer code comments.
29
+ - Added SARIF export for programmer code comments and adoption packages.
30
+ - Added editable programmer code-comment decision templates and import so partial human review keeps unresolved comments pending.
31
+ - Classified credential-like test fixtures as P3 reviewer notes instead of P1 production credential blockers.
32
+ - Added an executable offline SDK dry-run example for first-run onboarding without provider SDKs or API keys.
33
+ - Added workplace-style offline examples for customer support triage, agentic pull-request review, multimodal claim review, drop-in AI boundary adoption, and a larger multi-workflow operations hub, plus fuller routing/model-compare datasets.
34
+ - Added adoption handoff reports for reviewer-facing rollout actions, decision templates, and artifacts.
35
+ - Added project-level adoption signoff records and production gates for human rollout approval/rejection.
36
+ - Added production doctor checks for human feedback applied to capability cards.
37
+ - Added release readiness checks and CI workflow.
38
+ - Reworked README.md as a developer-first guide covering installation, SDK usage, provider setup, routing, adoption paths, multimodal input, operations, and release gates.
39
+ - Clarified developer-facing adoption language so Crupier is positioned as a multi-provider AI orchestration layer, with OpenAI-compatible proxy/client support as an optional adoption path rather than the core scope.
40
+ - Clarified multimodal README guidance to include Google Gemini native image execution support alongside OpenAI, Anthropic Claude, and Ollama adapters.
41
+ - Kept the public repository and built distributions focused on package code, README, examples, changelog, issues, and onboarding artifacts rather than exposing internal planning documents or extra community policy files.
42
+ - Added release checks that block reintroducing internal `docs/`, extra community policy files, or blank public issue forms before publication.
43
+ - Added release checks for broken public Markdown code fences and relative links before publication.
44
+ - Added public GitHub YAML syntax checks for workflows, Dependabot, and issue templates before publication.
45
+ - Added a tracked-file secret pattern scan so provider-key shaped credentials cannot silently enter the public repository.
46
+ - Added a repository `.gitignore` release check so local keys, caches, builds, and generated Crupier artifacts stay protected before public release.
47
+ - Added a release check that keeps README links absolute for PyPI rendering.
48
+ - Added PyPI publish workflow tag/manual-version matching and documented the final public release order.
49
+ - Hardened the PyPI publish workflow so draft or non-final GitHub Releases cannot publish the final package.
50
+ - Hardened the PyPI publish workflow so GitHub Release and manual publish paths only run from `main`.
51
+ - Hardened the PyPI publish workflow so the checked-out release/manual commit must match `origin/main` before building or uploading distributions.
52
+ - Serialized PyPI publish workflow runs per ref so duplicate release/manual triggers cannot race each other.
53
+ - Scoped PyPI trusted-publishing permissions to the publish job and linked the `pypi` environment to the package page.
54
+ - Hardened the PyPI publish workflow so the first `0.1.0` upload requires an available project name while later releases allow the already-owned PyPI project.
55
+ - Aligned the repository development allowlist with currently verified OpenAI, Anthropic Claude, and Ollama Cloud models, and clarified the provider-readiness remediation path when real checks need capability probes.
56
+ - Aligned the repository development provider config with the final OpenAI, Anthropic Claude, Google Gemini, and Ollama Cloud readiness gate.
57
+ - Added public package discovery metadata for AI-oriented PyPI classification and GitHub repository topics.
58
+ - Added Trove classifier validation to the dev release path so invalid PyPI classifiers are caught before upload.
59
+ - Added a release guard requiring public PyPI classifiers for every Python version tested in CI.
60
+ - Added release-guide guards so final provider-readiness commands include Google Gemini alongside OpenAI, Anthropic Claude, and Ollama Cloud.
61
+ - Added a global `--env-file` CLI option for loading local ignored provider keys during real-provider checks without passing secrets as command arguments.
62
+ - Added a public model-example release guard so README and CLI examples stay aligned with the current default allowlist.
63
+ - Added public repository settings guidance for focused GitHub surfaces, squash-only merges, vulnerability reporting, and secret scanning before opening the project.
64
+ - Added public branch-protection guidance for `main` after the final single release commit, with required CI and no force pushes before accepting public changes.
65
+ - Tightened the PyPI publishing workflow so trusted publishing runs through the `pypi` environment and repeats the first-upload PyPI name preflight.
66
+ - Added CONTRIBUTING.md with local development, provider-key handling, PR, public onboarding, and release-gate expectations.
67
+ - Added MIT license metadata for package release readiness.
68
+ - Tightened public PyPI metadata checks for keywords and classifiers without using legacy license classifiers rejected by modern setuptools.
69
+ - Added a non-blocking project URL readiness warning so public PyPI uploads do not ship with placeholder or missing repository links by accident.
70
+ - Added sdist + wheel build, artifact content inspection, `twine check`, py.typed packaging, and wheel/sdist install/import/CLI/`crupier init`/dry-run route/Python SDK quickstart smoke validation to release checks.
71
+ - Added built wheel/sdist PyPI metadata inspection for name, version, summary, Python requirement, license, project URLs, classifiers, and extras.
72
+ - Excluded the repository-local `crupier.toml` from release artifacts and added a guard so local project config cannot leak into PyPI distributions.
73
+ - Excluded repository tests from PyPI distributions and added an artifact guard so package uploads stay focused on runtime code, public examples, and onboarding files.
74
+ - Kept Ollama Cloud/local REST support dependency-free in the base package and added release guards against incomplete provider extras or reintroducing the unused Ollama Python SDK dependency.
75
+ - Added `crupier release check --strict-public` so PyPI publishing blocks on warnings such as missing public project URLs and on skipped build/install smoke checks.
76
+ - Added opt-in `crupier release check --verify-providers` for final public release gates with real provider discovery, readiness, and smoke validation.
77
+ - Increased real-provider smoke output budget to avoid false negatives on reasoning-heavy models that spend some tokens before emitting text.
78
+ - Added release artifact inspection for the offline SDK example so the sdist keeps first-run onboarding examples.
79
+ - Added release smoke validation for public examples from the built sdist so packaged examples stay executable without provider keys.
80
+ - Added wheel/sdist install smoke validation for exported public API names in `crupier.__all__`.
81
+ - Added `crupier --version` and release smoke validation for installed CLI version output.
82
+ - Added release smoke validation for installed `python -m crupier --version` module execution.
83
+ - Added release checks and artifact inspection for CONTRIBUTING.md so public development guidance is shipped and maintained.
84
+ - Added a PyPI publish workflow for GitHub Release based publishing.
85
+ - Added a release-language guard so final `0.1.0` package metadata and public onboarding files do not regress into non-final release labels.
86
+ - Added optional `crupier release check --check-pypi-name` with `--allow-existing-pypi-project` for first-upload and maintenance-release PyPI name preflights.
87
+ - Added `crupier release check --verify-project-urls` for public package-link reachability checks before PyPI upload.
88
+ - Added public collaboration templates and release checks for bug reports, feature requests, and pull requests.
89
+ - Added required issue-template safety confirmations so public bug reports and feature requests ask reporters to remove keys, prompts, provider responses, customer data, `.env`, and `.crupier/` artifacts before posting.
90
+ - Added Dependabot configuration for Python tooling and GitHub Actions plus release checks for dependency-update automation and minimal CI permissions.
91
+ - Added public repository guidance and release-check coverage for enabling Dependabot security updates before opening the repository.
92
+ - Updated CI/publish workflows to current GitHub Actions majors and added checked distribution artifact upload before PyPI publishing.
93
+ - Expanded SECURITY.md with scope, private reporting, supported versions, disclosure process, and secret-handling guidance, and added release checks for that content.
94
+ - Added `pip-audit` to the development workflow plus CI and publish dependency vulnerability audit steps.
95
+ - Added Ruff critical lint (`E9,F63,F7,F82`) to dev, CI, publish, and release-readiness checks.
@@ -0,0 +1,108 @@
1
+ # Contributing to Crupier
2
+
3
+ Thanks for helping make Crupier reliable for real AI projects. Keep changes small,
4
+ reviewable, and backed by tests or documented manual verification.
5
+
6
+ ## Development Setup
7
+
8
+ Use Python 3.11 or newer:
9
+
10
+ ```bash
11
+ python -m venv .venv
12
+ . .venv/bin/activate
13
+ python -m pip install --upgrade pip
14
+ python -m pip install -e ".[dev]"
15
+ python -m pytest
16
+ ```
17
+
18
+ Run the offline SDK example before changing public onboarding behavior:
19
+
20
+ ```bash
21
+ python examples/sdk_dry_run.py
22
+ ```
23
+
24
+ ## Provider Keys
25
+
26
+ Never commit provider keys, prompts, responses, customer data, traces, or local
27
+ `.crupier/` artifacts. Use environment variables or a local `.env` file ignored
28
+ by git:
29
+
30
+ ```bash
31
+ OPENAI_API_KEY=
32
+ ANTHROPIC_API_KEY=
33
+ GOOGLE_API_KEY=
34
+ GEMINI_API_KEY=
35
+ OLLAMA_API_KEY=
36
+ OLLAMA_HOST=https://ollama.com/api
37
+ ```
38
+
39
+ Use real provider checks only when keys are intentionally loaded:
40
+
41
+ ```bash
42
+ crupier --env-file .env release check --verify-providers --provider openai --provider anthropic --provider google --provider ollama
43
+ ```
44
+
45
+ `--env-file` loads missing variables only; exported shell or CI variables keep precedence.
46
+
47
+ ## Pull Request Checklist
48
+
49
+ Before opening a PR, run:
50
+
51
+ ```bash
52
+ python -m pytest
53
+ python -m ruff check src tests --select E9,F63,F7,F82
54
+ python -m pip_audit --skip-editable --progress-spinner off
55
+ crupier release check
56
+ ```
57
+
58
+ For release-facing changes, also run:
59
+
60
+ ```bash
61
+ crupier release check --strict-public
62
+ crupier release check --strict-public --verify-project-urls --check-pypi-name
63
+ ```
64
+
65
+ `--strict-public` fails if real public `[project.urls]` are missing.
66
+ Use the combined `--verify-project-urls --check-pypi-name` gate before publishing so package metadata
67
+ links are reachable and first-upload package-name availability is checked against PyPI.
68
+ Do not bypass those checks for a public PyPI upload.
69
+
70
+ ## Public Onboarding
71
+
72
+ Update `README.md`, `CHANGELOG.md`, package metadata, and examples whenever behavior changes.
73
+ Public examples must be executable without secrets unless they are explicitly marked as real-provider checks.
74
+
75
+ ## Public Repository Settings
76
+
77
+ Before changing repository visibility to public, keep the public surface focused:
78
+
79
+ - Issues enabled; wiki and projects disabled unless there is an active maintainer workflow for them.
80
+ - GitHub topics set for AI, agents, LLM routing, orchestration, and Python discoverability.
81
+ - Pull requests merged with squash commits and head branches deleted after merge.
82
+ - Dependabot security updates enabled and unpaused for dependency vulnerability remediation.
83
+ - Protect `main` after the final single release commit is accepted: require the CI workflow, require pull-request review for public changes, and disallow force pushes.
84
+ - Private vulnerability reporting enabled once GitHub exposes it for the public repository.
85
+ - Secret scanning and push protection enabled once available for the repository visibility/account.
86
+
87
+ After the visibility change, rerun:
88
+
89
+ ```bash
90
+ crupier release check --strict-public --verify-project-urls --check-pypi-name
91
+ crupier release check --strict-public --verify-providers --provider openai --provider anthropic --provider google --provider ollama
92
+ ```
93
+
94
+ Publish `0.1.0` from a GitHub Release tagged `v0.1.0` or `0.1.0` only after
95
+ PyPI trusted publishing is configured for this repository and the `pypi`
96
+ environment. The publish workflow checks the release tag against the package
97
+ version before building or uploading distributions. Manual workflow dispatch
98
+ must provide `version=0.1.0` and `confirm_publish=true`; use it only to retry an
99
+ intentional release operation.
100
+ For `0.1.0`, the workflow requires the PyPI project name to be unclaimed. For
101
+ later package versions, the workflow allows the existing PyPI project name so
102
+ maintenance releases can publish after the first upload establishes ownership.
103
+
104
+ ## Release Discipline
105
+
106
+ Crupier public releases use final numeric versions such as `0.1.0`. Do not
107
+ publish non-final, development, or local build versions unless the release
108
+ policy is intentionally changed.
crupier-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Crupier contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,15 @@
1
+ include README.md
2
+ include CONTRIBUTING.md
3
+ include LICENSE
4
+ include SECURITY.md
5
+ include CHANGELOG.md
6
+ include .env.example
7
+ recursive-include examples *.json *.py
8
+ prune .crupier
9
+ prune .venv
10
+ prune dist
11
+ prune build
12
+ prune tests
13
+ global-exclude __pycache__/*
14
+ global-exclude *.py[cod]
15
+ global-exclude .DS_Store