You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e4990e4
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: conformance/stack-encrypt/lifecycle-contract.md
+11-6Lines changed: 11 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,13 +10,13 @@ process. Python and TypeScript are explicitly not enrolled.
10
10
11
11
| Requirement | Native evidence | Go evidence and limits |
12
12
|---|---|---|
13
-
|`lifecycle-ownership-v1`| Actual record operations release fulfilment captures exactly once on success, provider failure and unpolled drop; an unpolled encrypt or decrypt makes no key request. Zipped fulfilments do not share key material. | Client keys are consumed/redacted; explicit close and unreachable-client cleanup release guest memory; calls on a closed client fail. GC cleanup is eventual, so callers should close explicitly. |
14
-
|`lifecycle-cancellation-v1`| Dropping an encrypt future paused in key generation, or a decrypt future paused in key retrieval, drops the provider future and operation captures; subsequent work on the cipher succeeds. Guest ABI abort spends the handle and drops the operation. | Cancellation before a call sends no request; cancellation between steps or during token fetch leaves unrelated operations usable. A guest step that overruns cancellation closes the client. Discarded late output is wiped. |
15
-
|`lifecycle-partial-output-v1`| A batch with a valid first row and a later authenticated type mismatch releases its decoded prefix without marked heap residue. Existing context cases reject late authentication failures without returning partial output. | Generated and raw batch APIs return no partial rows on failure; interrupted HTTP bodies fail; cancelled output is wiped. SDK conversion diagnostics contain no decrypted values. This does not assert erasure of partially populated caller-owned Go objects. |
16
-
|`lifecycle-buffer-cleanup-v1`| The existing allocator observer checks selected write/read/JSON parse paths and has a negative control. Guest ABI tests check buffer-registry cleanup, error-buffer release and protected text drop. | Request bodies survive until their owner closes them, then wipe; refused requests wipe; heap growth wipes abandoned backing arrays; guest runtime close releases memory. Post-encryption memory scans are supplementary observations. |
13
+
|`lifecycle-ownership-v1`| Actual record operations and owned `Vec<S>` to `Vec<T>` conversions release fulfilment captures exactly once on success, provider failure and unpolled drop; an unpolled encrypt or decrypt makes no key request. Zipped fulfilments do not share key material. | Client keys are consumed/redacted; explicit close and unreachable-client cleanup release guest memory; calls on a closed client fail. GC cleanup is eventual, so callers should close explicitly. |
14
+
|`lifecycle-cancellation-v1`| Dropping an encrypt future paused in key generation, or a decrypt future paused in key retrieval, drops the provider future and operation captures, for a record operation or an owned collection; subsequent work on the cipher succeeds. Guest ABI abort spends the handle and drops the operation. | Cancellation before a call sends no request; cancellation between steps or during token fetch leaves unrelated operations usable. A guest step that overruns cancellation closes the client. Discarded late output is wiped. |
15
+
|`lifecycle-partial-output-v1`| A batch with a valid first row and a later authenticated type mismatch releases its decoded prefix without marked heap residue. Tests check this for the dynamic record path and for the owned `Vec<Ciphertext>` to `Vec<String>` conversion. For owned collections, drop witnesses are test values that record whether they were wiped. They show that the prefix is wiped, not leaked, after a late failure or an element's panic. Existing context cases reject late authentication failures without returning partial output. | Generated and raw batch APIs return no partial rows on failure; interrupted HTTP bodies fail; cancelled output is wiped. SDK conversion diagnostics contain no decrypted values. This does not assert erasure of partially populated caller-owned Go objects. |
16
+
|`lifecycle-buffer-cleanup-v1`| The existing allocator observer checks selected write/read/JSON parse paths and has a negative control. One of those paths encrypts an owned `Vec<String>` collection through its guard. Drop witnesses show that an owned collection's source is wiped before its pending request is returned. That includes a refused context, and a context conversion that panics. Guest ABI tests check buffer-registry cleanup, error-buffer release and protected text drop. | Request bodies survive until their owner closes them, then wipe; refused requests wipe; heap growth wipes abandoned backing arrays; guest runtime close releases memory. Post-encryption memory scans are supplementary observations. |
17
17
|`lifecycle-diagnostics-v1`| Guest errors discard untrusted foreign cause messages; failed/successful exports do not hand over stale diagnostics. | Structured errors remain available after failures; SDK errors and redacted display/logging expose types or fields rather than plaintext values. |
18
18
|`lifecycle-validation-before-io-v1`| Existing runtime/read/context cases count provider calls. Wrong shape, independently detectable context mismatch and oversized descriptors fail before key I/O; lazy assembly stops after local failure. | Host refusals happen before entering the guest, and shared runtime/read cases exercise the uninitialised guest's preflight boundary. Go does not yet expose native provider counters. |
19
-
|`lifecycle-logical-batching-v1`| Instrumented `DataKeySource` calls establish one logical generation batch, retrieval grouping by keyset, descriptor ordering and no work for empty batches. | Go uses the same engine, but this profile does not claim independently instrumented Go key-request counts. |
19
+
|`lifecycle-logical-batching-v1`| Instrumented `DataKeySource` calls establish one logical generation batch, retrieval grouping by keyset, descriptor ordering and no work for empty batches, for record operations and for an owned `Vec<S>` collection of any length, including an empty one. | Go uses the same engine, but this profile does not claim independently instrumented Go key-request counts. |
20
20
|`lifecycle-provider-chunks-v1`| The actual KMS chunking helper preserves order, handles a final short chunk, fails the whole call on a chunk error, bounds in-flight chunks and releases their futures on cancellation. | This is a native algorithm observation, not a measurement of live HTTP request counts. |
21
21
22
22
The drop witnesses belong to fulfilment closures and provider futures in real
@@ -59,7 +59,12 @@ These entries in the index are limitations, not successful requirements:
59
59
sealing frame by backtrace and reports excluded frees. It scrubs stack residue
60
60
before observing heap frees; it does not prove stack erasure. Its JSON query
61
61
paths use borrowed/static path text because owned path copies have separate
62
-
cleanup limitations. The lifecycle runner preserves the observer's output.
62
+
cleanup limitations. The observer only scans blocks that are freed, so it
63
+
misses plaintext that is leaked and never freed. For the owned `Vec<S>`
64
+
conversion, the drop witnesses in `packages/stack-encrypt/tests/collections.rs`
65
+
record the wipe itself. A test there fails if a source or a decrypted prefix
66
+
is leaked. The lifecycle
67
+
runner preserves the observer's output.
63
68
-**`caller-owned-host-values` — outside the guarantee.** Caller-owned strings,
64
69
bytes, objects, returned plaintext, aliases and copies remain the caller's
65
70
responsibility. Ownership transfer or protected borrowing must be stated by
0 commit comments