Skip to content

feat(python): walking skeleton for the Python SDK - #1405

Draft
yujiyokoo wants to merge 3 commits into
feat/python-sdk-tracer-adrfrom
feat/python-sdk-skeleton
Draft

yujiyokoo wants to merge 3 commits into
feat/python-sdk-tracer-adrfrom
feat/python-sdk-skeleton

Conversation

@yujiyokoo

Copy link
Copy Markdown
Contributor

Summary

The first piece of the Python SDK, stackencrypt. It installs into a
virtualenv and exposes two facts: its version (0.1.0) and the commit of
the Rust encryption engine it was built from. It encrypts nothing yet.
The point is the build path: a Rust extension built by maturin, over
the stack-encrypt crate in this repository, importable from Python.

Changes

  • languages/python: a fourth Cargo workspace with two crates. core
    has no Python dependency, so its tests run without an interpreter.
    engine is the pyo3 extension module. A pure-Python package wraps it.
  • Local tasks in languages/python/mise.toml: build, test, test:cargo.
  • Root Cargo.toml, Dependabot, and two repo guards know the new workspace.
    The Dependabot guard now also reads path dependencies declared at a
    workspace root, which it missed before.
  • Docs: ADR-0001 marked accepted with its open items listed, a Python row
    in ADR-0002, and a first Python section in the SDK design principles.

Verification

Run locally on macOS, Python 3.14: mise run test (four pytest tests) and
mise run test:cargo (two Rust tests) in languages/python.
cargo metadata --locked passes in all four workspaces. The repo guard
suite and the supply-chain e2e test pass.

Not verified: Python 3.9, and any CI run. Both are #1383.

Related

Closes #1382. Refs #1341 (the spec). Stacked on #1284; retarget to next
after that merges.

Review notes

No Python lockfile yet, and no CI workflow: both are deferred to #1383.
The engine commit ends in -dirty when a packages/stack-* crate has
uncommitted changes.

🤖 Generated with Claude Code

@changeset-bot

changeset-bot Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: a0ae3fc

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@yujiyokoo
yujiyokoo changed the base branch from main to next October 27, 2026 08:30
yujiyokoo and others added 3 commits October 27, 2026 17:32
Add the fourth Cargo workspace at languages/python with two crates:
stackencrypt-core (no pyo3, depends on stack-encrypt by path) and
stackencrypt-engine (the `_engine` cdylib, pyo3 0.29, abi3-py39).
The pure-Python package `stackencrypt` exposes `__version__` (0.1.0,
from the engine crate's manifest through maturin) and `__engine__`
(the checkout's commit, `-dirty` when packages/stack-encrypt has
local edits). `extension-module` is set only by maturin, so
`cargo test --locked` links libpython.

Tasks live in languages/python/mise.toml: build, test, test:cargo.
The Cargo.lock is seeded from the root one because stack-encrypt
requires a yanked cllw-ore pre-release a fresh resolve cannot select.

Exclude the workspace from the root Cargo.toml; add it to the
Dependabot cargo entry and the publish opt-out and lock freshness
guards; update AGENTS.md and SECURITY.md.

Mark ADR-0001 accepted, add the Python row to ADR-0002's host-language
table, and start the Python section of docs/sdk-design-principles.md,
the doc edits the spec says ride with the first PR.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… comments

`-dirty` only watched packages/stack-encrypt, but the engine also takes
stack-kms and stack-encrypt-derive by path, so an edit there shipped
under a clean SHA. The check now covers every packages/stack-* crate.
The comments listing core's future responsibilities now point at the
spec instead, so they cannot drift into a second one.

Refs #1382

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
ADR-0001 is recorded as accepted, with its open items listed and its
kind rule amended to the spec's. ADR-0002 cites the spec, not the ADR,
for the value rules. The glossary records the `_engine` naming. The
Dependabot guard now reads [workspace.dependencies], which hid the
Python edge. The dirty check skips fuzz corpora. The unasked release
profile and rlib are gone.

Refs #1382

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@yujiyokoo
yujiyokoo force-pushed the feat/python-sdk-skeleton branch from 30e4646 to a0ae3fc Compare October 27, 2026 08:34
@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Mutation testing (cargo-mutants, --in-diff, stack-auth + stack-encrypt)

No mutants were generated for the changed lines.

@yujiyokoo
yujiyokoo changed the base branch from next to feat/python-sdk-tracer-adr October 27, 2026 08:41

This branch has not been deployed

No deployments
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.

python: walking skeleton — workspace, two crates, importable wheel

1 participant