Gordian Envelope cryptographic primitives for Promptyst. Granular elision, selective disclosure, and verifiable privacy — down to one character.
#import "@preview/contextcloak:0.1.0": *#import "@preview/contextcloak:0.1.0": *
// Any dictionary — typically a Promptyst prompt dict
#let my-prompt = (
id: "deploy-service",
version: "1.0.0",
role: "You are a deployment orchestrator.",
steps: ("Validate.", "Deploy.", "Verify."),
)
// Wrap it in an envelope (computes SHA-256 digests)
#let env = cc-wrap(my-prompt)
// Elide sensitive fields — root digest stays the same
#let redacted = cc-elide(env, fields: ("role",))
// Render as Markdown with elision placeholders
#raw(render-envelope(redacted), lang: "markdown")| Constructor | Returns |
|---|---|
cc-digest(value) |
SHA-256 hex string |
cc-wrap(dict) |
envelope dict |
cc-salt(envelope, salt: str) |
salted envelope dict |
cc-elide(envelope, fields: array) |
envelope with elided fields |
cc-granular-wrap(text, grain: str) |
granular Merkle tree |
cc-granular-elide(granular, indices: array) |
granular with elided nodes |
| Function | Returns |
|---|---|
render-envelope(e) |
Markdown with [ELIDED] placeholders |
render-digest-tree(e) |
audit digest table |
render-granular(g) |
string with █ for elided units |
#let g = cc-granular-wrap("secret key here", grain: "word")
#let redacted = cc-granular-elide(g, indices: (1,))
#render-granular(redacted)
// Output: "secret █ here"See PLANNING.md for the full project design, Gordian Envelope mapping, dependency analysis, and phased delivery plan.
ContextCloak is an opinionated layer on top of Promptyst, following the Boundary Contract:
- Imports only Promptyst's public API
- Uses
cc-prefix for all symbols - Defines its own
_typenamespace ("cc-envelope","cc-elided","cc-granular") - Zero modifications to upstream Promptyst
- digestify — WASM SHA-256 hashing
MIT