Skip to content

feat(licensing): compile licensing + cloud_license to C extensions with integrity guards#37

Merged
Coding-Dev-Tools merged 4 commits into
mainfrom
feat/compiled-licensing
Jul 21, 2026
Merged

feat(licensing): compile licensing + cloud_license to C extensions with integrity guards#37
Coding-Dev-Tools merged 4 commits into
mainfrom
feat/compiled-licensing

Conversation

@Coding-Dev-Tools

Copy link
Copy Markdown
Owner

Compile engraphis/licensing.py and engraphis/cloud_license.py into native C extensions (.pyd/.so) via Cython to prevent trivial source-code patching that bypasses paid-feature gates.

  • Add Cython build configuration (setup.py, pyproject.toml build-system)
  • Add _verify_module_integrity() guards that detect .py source replacement when a compiled .pyd/.so exists alongside (ENGRAPHIS_DEV=1 skips in dev)
  • Create cibuildwheel CI workflow for multi-platform compiled wheel builds
  • Add .gitattributes for binary file handling
  • Add test_compiled_integrity.py with 6 guard-verification tests
  • Set ENGRAPHIS_DEV=1 in tests/conftest.py before any licensing import

Resolves F401 (unused import sys at line 32) and E402 (late import sys as _sys
at line 661). The integrity guard now uses the existing top-level sys import.
Cython enforces the :dict annotation at runtime, raising TypeError
before the internal isinstance check can handle non-dict payloads.
The function intentionally accepts non-dict payloads to create
malformed signed values for verifier tests. Changing to :object
preserves the internal validation while allowing test composition.
Repository owner deleted a comment from chatgpt-codex-connector Bot Jul 21, 2026
# Conflicts:
#	engraphis/cloud_license.py
#	setup.py
@Coding-Dev-Tools
Coding-Dev-Tools merged commit c021f54 into main Jul 21, 2026
@Coding-Dev-Tools
Coding-Dev-Tools deleted the feat/compiled-licensing branch July 21, 2026 13:26
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