Skip to content

feat: distribution hardening#11

Merged
raiderrobert merged 1 commit into
mainfrom
feat/distribution-hardening
Feb 12, 2026
Merged

feat: distribution hardening#11
raiderrobert merged 1 commit into
mainfrom
feat/distribution-hardening

Conversation

@raiderrobert

Copy link
Copy Markdown
Owner

Summary

  • Commit SHA pinning: clone_template() now resolves and returns the HEAD commit SHA. CacheMetadata stores it, get_or_clone() returns it on cache hit, and the answers file records source, ref, and commit_sha for full provenance tracking.
  • Hook trust model: generate() now wires up pre/post-generate Rhai hooks with --no-hooks support. Warns on stderr when remote templates contain hooks so users know code will execute.
  • diecut ready command: Validates a template for distribution readiness — checks for version, description, README, plus all standard check validations.
  • First-party example templates: rust-cli (Rust CLI with clap) and python-pkg (Python package with pyproject.toml). Both pass diecut ready.

Test plan

  • All 93 existing tests pass
  • New tests: cache_metadata_deserializes_without_commit_sha (backwards compat), get_or_clone_returns_commit_sha_from_cache, clone_result_has_expected_fields
  • diecut check examples/rust-cli passes
  • diecut ready examples/rust-cli passes
  • diecut ready tests/fixtures/basic-template correctly fails (missing README)
  • diecut new examples/rust-cli -o /tmp/test --defaults -d author=test generates valid project

…, example templates

- clone_template() now returns CloneResult with resolved commit SHA
- CacheMetadata stores commit_sha, get_or_clone returns it on cache hit
- Answers file records source URL, git ref, and commit SHA for provenance
- generate() wires up pre/post-generate hooks with --no-hooks support
- Warns on stderr when remote templates contain hooks
- New `diecut ready` command validates templates for distribution readiness
- HooksConfig.has_hooks() helper method
- First-party example templates: rust-cli and python-pkg
@raiderrobert raiderrobert force-pushed the feat/distribution-hardening branch from ab6a9fa to 91c72f6 Compare February 12, 2026 19:29
@raiderrobert raiderrobert merged commit b873aa9 into main Feb 12, 2026
5 checks passed
raiderrobert added a commit that referenced this pull request Feb 12, 2026
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