Skip to content

feat(dist): self-contained wheel — assets ship, paths resolve, privacy is structural (Event 177)#161

Merged
junjslee merged 3 commits into
masterfrom
feat/event177-distribution-truth
Jul 21, 2026
Merged

feat(dist): self-contained wheel — assets ship, paths resolve, privacy is structural (Event 177)#161
junjslee merged 3 commits into
masterfrom
feat/event177-distribution-truth

Conversation

@junjslee

Copy link
Copy Markdown
Owner

The truth run (all measured, not reasoned)

  1. The wheel shipped src/episteme only — no hooks, kernel, skills, templates (unzip).
  2. REPO_ROOT = parents[2] resolves into lib/python3.X when installed — doctor's own probe flagged it ('wheel-shaped install?').
  3. Six modules duplicated the same pattern (E171's incident class).
  4. sync refused site-packages as 'a checkout under a temp root' — the E166 guard lacked an 'installed package' origin class.
  5. Naive bundling would have published the operator's personal memory (core/memory/global).

The fix class

  • episteme/_assets.py — one resolver: checkout wins (dev unchanged, verified), packaged episteme/_assets otherwise. All six sites + viewer rewired.
  • setup.py — assets into the wheel with privacy as structure: memory ships examples/ only; private skills, *.jsonl, key-shaped files, caches dropped everywhere. Pinned per-field in tests/test_wheel_assets.py and gated in CI against the built artifact.
  • sync gains the installed package origin class.
  • CI clean-install job (macos-latest) — the acceptance bar as automation: wheel → fresh-HOME install → doctor 0 warn · 0 fail → sync → all hook paths resolve → workflow_guard fires 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-install is a NEW CI context — add to required checks when you're ready.
  • Distribution channel (PyPI publish vs GitHub release asset) remains your call — PyPI publish was removed in E143; nothing here re-adds it.

…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.
@vercel

vercel Bot commented Jul 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
episteme Ready Ready Preview, Comment Jul 21, 2026 3:54pm

…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.
@junjslee
junjslee merged commit 2948295 into master Jul 21, 2026
6 checks passed
@junjslee
junjslee deleted the feat/event177-distribution-truth branch July 21, 2026 15:55
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