- 21:07 PT: Created the
python-devworktree at/home/trentn/src/perfecthash-python-dev. - 21:10 PT: Switched work to the new worktree and confirmed no project ledgers existed there yet.
- 21:12 PT: Checked available tooling.
python3anduvare present;ruff,black, andpre-commitare not installed globally. - 21:14 PT: Chose the bootstrap structure: root-level Python project config,
python_src/source layout,hatchlingbackend,uv-managed dev tooling, and localpre-commithooks. - 21:20 PT: Added the initial scaffold files: project ledgers, root
pyproject.toml,README-python.md,.pre-commit-config.yaml,python_src/perfecthash/package skeleton,python_tests/, and Python-specific.gitignoreentries. - 21:21 PT: Ran
uv sync, which created.venvanduv.lockand installed the baseline dev toolchain (ruff,black,pytest,mypy,pre-commit,build). - 21:22 PT: First validation pass failed because an inherited
PYTHONPATHpointed at the legacy/home/trentn/src/perfecthash/pythontree, causing imports to resolve to the old package. - 21:24 PT: Hardened the scaffold against inherited
PYTHONPATHby updating README instructions and local pre-commit hook commands to invoke tooling viaenv -u PYTHONPATH. - 21:25 PT: Re-ran baseline validation in a clean environment;
pytest,ruff check,black --check, andmypyall passed. - 21:28 PT: Configured worktree-local hooks via
extensions.worktreeConfig=trueandcore.hooksPath=.githooks, added a tracked.githooks/pre-commitscript, and removed the shared common-dir hook created during the first install attempt. - 21:29 PT: Sanity-checked
.githooks/pre-commitdirectly. It ran successfully and correctly skipped work because the new files are not staged yet. - 21:31 PT: Traced the inherited
PYTHONPATHto the active zsh domain configuration:~/.zsh/desired_domainisnvidia, and~/.zsh/domains/nvidia/zshrcprepends~/src/tpn/liband~/src/perfecthash/python. - 21:40 PT: Recorded the current CLI-framework recommendation: use
Typerfor the new public CLI, usePydanticfor structured validation/models where helpful, and keep core runtime logic independent of both. - 21:48 PT: Verified the curated hash-function set is explicitly defined in
include/PerfectHash/PerfectHash.hviaPERFECT_HASH_GOOD_HASH_FUNCTION_TABLE_ENTRY()/IsGoodPerfectHashHashFunctionId(). Current set:MultiplyShiftR,MultiplyShiftRX,Mulshrolate1RX,Mulshrolate2RX,Mulshrolate3RX,Mulshrolate4RX. - 21:52 PT: Replaced the argparse bootstrap CLI with a
Typerapp and added a firstPydanticrequest model plus a smallPerfectHashCreateargv renderer that preserves hash-function spellings exactly as they appear in C. - 21:55 PT: Added tests covering version output,
ph create --help, curated hash-function exposure, and--emit-c-argvtranslation. - 21:57 PT: Ran
uv sync,pytest,ruff check,black, andmypy; adjusted the Typer entrypoint behavior and help text so all checks pass cleanly. - 22:05 PT: Inspected the existing online C surfaces and chose
PerfectHashOnlineRawdogas the first Python binding target because it exposes a small exported API and avoids the full internal interface. - 22:10 PT: Added
perfecthash.online.rawdogwith low-level ctypes bindings, development-oriented shared-library discovery, and aRawdogTablewrapper exposingindex()/indexes()plus deterministic resource cleanup. - 22:13 PT: Added focused tests for sorted and unsorted key sets, out-of-range key rejection, and missing-library behavior.
- 22:17 PT: Ran the full validation pass again; fixed the initial test, lint, formatting, and mypy issues. Final status for this slice is green:
pytest,ruff check,black, andmypyall pass. - 22:22 PT: Recorded the runtime design constraints from discussion: keep the fast path native, avoid requiring end-user compilers where possible, and prefer
rawdog_jitnaming for Python-facing code. - 22:29 PT: Renamed the preferred Python-facing low-level module to
rawdog_jit/RawdogJitTable, keptperfecthash.online.rawdogas a compatibility shim, and added a backend-neutralTable/build_table()layer inpython_src/perfecthash/table.py. - 22:33 PT: Added tests for the new
TableAPI and reran the full pass. Final status for the higher-level API slice is green:pytest,ruff check,black, andmypyall pass. - 22:38 PT: Recorded the architectural split from discussion:
ph createshould stay aligned with the offline creation workflow, while therawdog_jit/Tablepath is the programmatic in-process Python API story. - 22:45 PT: Added
python_src/perfecthash/c_cli.pywith offlinePerfectHashCreatebinary discovery, command formatting, and subprocess execution helpers. - 22:48 PT: Wired
ph createto the offline C create workflow:--emit-c-argvprints abstract argv,--dry-runprints the resolved executable command, and default behavior now shells out to the C create binary. - 22:51 PT: Added focused tests for create-binary discovery/rendering/execution helpers plus CLI dry-run/execution behavior.
- 22:53 PT: Ran the full validation pass again. Final status for the offline CLI execution slice is green:
pytest,ruff check,black, andmypyall pass. - 23:00 PT: Tightened the Typer help text so the root CLI and
createcommand describe the current semantics instead of calling themselves "bootstrap". - 23:03 PT: Expanded
README-python.mdwith user-facing CLI/API status, a workedph create --dry-runexample, a workedbuild_table()example, and the curated hash-function list. - 23:05 PT: Added
docs/python-cli-and-api.mdto document the offline CLI vs in-process API split, current command/API surfaces, limitations, and near-term direction. - 23:07 PT: Rechecked
ph --help,ph create --help,pytest,ruff check,black --check, andmypy. Final status for the docs/help slice is green. - 23:15 PT: Reverted a short-lived
Table.__getitem__()experiment after discussion. We are not using square-bracket semantics forTableright now; index lookup remains explicit viaindex()/index_many(). - 23:24 PT: Added the initial
ph bulk-createsurface:BulkCreateRequest, C-argv rendering, bulk-create binary discovery/execution helpers, Typer command wiring, and focused tests for dry-run/execution behavior. - 23:27 PT: Updated user-facing docs and project notes to include
ph bulk-create, then reran the full validation pass. Final status for this slice is green:pytest,ruff check,black, andmypyall pass. - 22:56 PT: Checked current Typer/docs wiring. Root and command help are working and useful, but user-facing documentation is still limited to inline help plus the developer-oriented
README-python.md. - 23:34 PT: Added shared discovery helpers that prefer package-native dirs and install prefixes (
PERFECTHASH_PREFIX,CONDA_PREFIX,sys.prefix) before falling back to development-tree build outputs. - 23:37 PT: Added focused tests for prefix-based binary and library discovery and reran the full validation pass. Final status for the installation-oriented discovery slice is green:
pytest,ruff check,black, andmypyall pass. - 23:41 PT: Recorded the current packaging recommendation: wheels should bundle native artifacts under
perfecthash/_native/, while conda should keep binaries/libraries in the environment prefix and let the Python package discover them there. - 23:44 PT: Recorded the editable-install recommendation: keep
pip install -e .supported, but drive native discovery through a repo-local install prefix such as.perfecthash-prefix/instead of relying on arbitrary build-tree fallbacks. - 23:49 PT: Added
scripts/install-python-native-prefix.sh, updated.gitignorefor.perfecthash-prefix/, and expanded README/docs to document the repo-local native-prefix editable-install workflow. - 23:51 PT: Re-ran the standard validation pass after the helper/docs updates. Final status remains green:
pytest,ruff check,black, andmypyall pass. - 23:58 PT: Committed the
python-devwork as67d9114(python: add initial package, CLI, and runtime bindings), pushed the branch, and opened PR #74:https://github.com/tpn/perfecthash/pull/74. - 00:10 PT: Monitored PR CI. An initial
macos-x86_64pull-request job failed duringSet up jobonly; all other PR checks progressed normally. Reran the failed macOS workflow once the run completed. - 00:22 PT: Current PR CI picture after the macOS rerun: 11 PR checks green, 0 failing, and 2
macos-x86_64checks still in progress (push + pull_request variants). No code-level CI failures from the Python changes have surfaced so far. - 14:18 PDT: Rechecked PR #74 after session restart. Current state: PR open, merge state clean, and all GitHub Actions workflows/checks for the current branch head are green.
- 14:33 PDT: Addressed PR feedback about source-tree fallback root detection. Replaced depth-based repo-root assumptions with a structural
source_checkout_root()helper and updated the regression tests so they no longer depend on the temporaryperfecthash-python-devworktree name.