fix(packaging): ship the diagnosis prompt files in the wheel (regression from #80)#82
Merged
Merged
Conversation
…ion from #80) The multistage image (#80) switched to a non-editable `pip install .`. setuptools packages only *.py by default, so `sentinel/diagnosis/prompts/v1.md` (+ its `.sha256` baseline) — read at boot by PromptBundle.load via a package-relative path — was dropped from the wheel, and the production image crashed on startup: FileNotFoundError: .../site-packages/sentinel/diagnosis/prompts/v1.md The #80 verification used a build_app() import smoke, which doesn't run the lifespan where PromptBundle.load lives — so the crash only surfaced on a real container boot. - Declare the prompts as package-data so the wheel ships them. The eval corpus/cassettes are deliberately left out (dev/CI-only, run from source). - Contract test guards the declaration (CI never builds the wheel). Verified: `pip wheel .` now contains v1.md + v1.sha256; the rebuilt image boots healthy and the full webhook → diagnosis demo works end-to-end. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A regression introduced by #80. The multistage image switched to a non-editable
pip install ., and setuptools packages only*.pyby default — so the diagnosis prompt bundle (sentinel/diagnosis/prompts/v1.md+v1.sha256), read at boot byPromptBundle.loadvia a package-relative path, was dropped from the wheel. The production image crashed on startup:#80's verification used a
build_app()import smoke, which doesn't run the lifespan wherePromptBundle.loadlives — so it only surfaced on a real container boot (found while wiring up the README's live-demo path).Fix
[tool.setuptools.package-data]declares"sentinel.diagnosis" = ["prompts/*.md", "prompts/*.sha256"]so the wheel ships them. The eval corpus/cassettes (the other non-.pyfiles in the package) are deliberately not packaged — they're dev/CI-only and run from the source tree, never from the installed wheel (eval_modedefaults off; the production CMD issentinel-api).tests/unit/test_packaging.py) pins the declaration to the files it must cover, since CI never builds the wheel.Verified
pip wheel --no-deps .now produces a wheel containing bothprompts/v1.mdandv1.sha256.webhook → enrichment → diagnosisdemo works end-to-end (diagnosis served via the API).Follow-up (tracked, not in this PR)
A CI job that builds and boots the image would be the stronger guard than a source-only contract test — it's the gap that let this through. Deferred because it adds a slow Docker build to every PR.
🤖 Generated with Claude Code