feat(dist): self-contained wheel — assets ship, paths resolve, privacy is structural (Event 177)#161
Merged
Merged
Conversation
…y is structural (Event 177) The distribution truth run, then the fix class it named. Measured findings: the wheel shipped src/episteme ONLY; REPO_ROOT=parents[2] resolved into lib/python3.X when installed (doctor's own wire probe said 'wheel-shaped install?'); SIX modules duplicated the same pattern; sync's E166 origin guard refused site-packages as 'a temp-root checkout'; and a naive asset bundling would have PUBLISHED the operator's personal memory. Fixes, bounded to that class: - episteme/_assets.py: ONE definition of asset resolution — checkout wins (markers walk; dev behavior unchanged, verified), wheel-shipped episteme/_assets otherwise, legacy parents[2] as diagnosable last resort. All six definition sites + viewer rewired to it. - setup.py build_py: bundles core/kernel/skills/templates into the wheel with PRIVACY AS STRUCTURE: core/memory/global ships examples/ ONLY (live operator memory excluded by construction), skills/private, *.jsonl, key-shaped files, caches dropped anywhere. Pinned field-by-field in tests/test_wheel_assets.py; also gated in CI against the built artifact. - sync origin guard learns the 'installed package' origin class (versioned immutable-by-install assets are not a throwaway checkout). - CI clean-install job (macos-latest): wheel → fresh-HOME venv install → doctor '0 warn · 0 fail' → sync → every hook script path resolves → workflow_guard FIRES from site-packages assets. The E155 reproducibility gap, closed with evidence. - docs/SETUP.md: the no-checkout install path, told truthfully. Measured acceptance (isolated HOME, zero checkout): doctor 0 warn · sync completes, 21 hooks wired to installed paths · targeted DOC ADVISORY fired from _assets · viewer live with doc map. Suite 1832+91.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…mes its one allowed failure Python 3.12 CI lane has no bundled setuptools and importing setup.py broke collection — the shipping/privacy contract now lives in episteme/_packaging.py (pure, testable everywhere); setup.py is a thin consumer that binds the ignore to an explicit repo root, and a new test pins that an sdist-staged build keeps the memory/global exclusion (an unmatched root must not silently disable privacy rules). The macos clean-install doctor step asserts 0 warnings and exactly one permitted failure line — 'missing tool: claude', the one thing a runner cannot have — instead of demanding a clean exit it can never produce. Suite 1833+91; rebuilt wheel re-verified private.
… evolution lane dropped, boundary fails closed, gitignore↔packaging cross-checked Blocker (empirically reproduced by review): gitignored runtime core/memory/evolution/episodes/*.json shipped from LOCAL wheel builds while the CI gate stayed green — a fresh checkout has no untracked files, so the leak was unobservable exactly where the gate ran; the episode schema can embed diffs of operator-PRIVATE memory. Fixes, as a class not a patch: - core/memory/evolution dropped like substrates; and a new test parses the REAL .gitignore and asserts every rule under a shipped tree has a corresponding drop — a future runtime lane cannot leak by omission. - The privacy boundary now FAILS CLOSED: an unrelatable staging dir raises instead of silently disabling every rule (the old except-ValueError default-open was the wrong posture for the one function guarding memory). - setup.py fails loudly when asset trees are missing (an sdist-staged build previously shipped an asset-less wheel silently; in-tree Processing /Users/junlee/episteme Installing build dependencies: started Installing build dependencies: finished with status 'done' Getting requirements to build wheel: started Getting requirements to build wheel: finished with status 'done' Preparing metadata (pyproject.toml): started Preparing metadata (pyproject.toml): finished with status 'done' Building wheels for collected packages: episteme Building wheel for episteme (pyproject.toml): started Building wheel for episteme (pyproject.toml): finished with status 'done' Created wheel for episteme: filename=episteme-1.10.0rc1-py3-none-any.whl size=893707 sha256=89630d1f013bf8392d9c83afe20c58a024ab8816f03f7830baa2215eb34140ae Stored in directory: /private/var/folders/yy/7c1vkn4j6yd5w4s3wjy3lj9c0000gn/T/pip-ephem-wheel-cache-irs065ml/wheels/2f/5e/6e/08a4c02ca1b39d4fe2f96e53b00624d782a8e5f970077d4919 Successfully built episteme is the supported path and now the only one that can succeed). - episteme init refuses in installed context (was: writes into read-only site-packages — the documented personalization path was broken; honest refusal + E178 pointer; SETUP.md told the truth accordingly). - Installed sync records the 'installed-package' sentinel, not its site-packages path (a later checkout sync would have tripped rule-3 against a meaningless origin). - CI privacy grep covers python_runtime_policy.md + memory runtime lanes + .p12; site-packages path computed, not hardcoded. Verified: rebuilt wheel has 0 memory/evolution files, 0 episodes; installed init exits 2 with the refusal; suite 1836+91.
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.
The truth run (all measured, not reasoned)
src/epistemeonly — no hooks, kernel, skills, templates (unzip).REPO_ROOT = parents[2]resolves intolib/python3.Xwhen installed — doctor's own probe flagged it ('wheel-shaped install?').syncrefused site-packages as 'a checkout under a temp root' — the E166 guard lacked an 'installed package' origin class.core/memory/global).The fix class
episteme/_assets.py— one resolver: checkout wins (dev unchanged, verified), packagedepisteme/_assetsotherwise. All six sites + viewer rewired.setup.py— assets into the wheel with privacy as structure: memory shipsexamples/only; private skills,*.jsonl, key-shaped files, caches dropped everywhere. Pinned per-field intests/test_wheel_assets.pyand gated in CI against the built artifact.installed packageorigin class.clean-installjob (macos-latest) — the acceptance bar as automation: wheel → fresh-HOME install → doctor0 warn · 0 fail→ sync → all hook paths resolve →workflow_guardfires from site-packages. The E155 gap, closed with evidence.Measured acceptance (isolated HOME, zero checkout)
doctor 0 warn/0 fail · sync completes with 21 hooks wired to installed asset paths · targeted DOC ADVISORY fired from
_assets· viewer dashboard + control-plane defense live · wheel 2.5MB/225 files, privacy checks clean.Notes for the operator
clean-installis a NEW CI context — add to required checks when you're ready.