Skip to content

Commit ca3154c

Browse files
V37 Gate 7: Conversation persistence privacy
Adds package-owned ConversationPersistencePrivacyRedaction canon source and generated artifact. Redacts conversation message content, attachment metadata, and execution payloads before durable storage. Wires source-safe persistence privacy UI, tests, docs, and gate/canon workflow validation.
1 parent 0a4f52b commit ca3154c

30 files changed

Lines changed: 4429 additions & 45 deletions

.bitcode/v37-conversation-persistence-privacy-redaction.json

Lines changed: 2158 additions & 0 deletions
Large diffs are not rendered by default.

.github/workflows/bitcode-canon-quality.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@ jobs:
124124
if [ -f scripts/check-v37-gate6-conversation-terminal-handoff.mjs ]; then
125125
node scripts/check-v37-gate6-conversation-terminal-handoff.mjs --skip-branch-check
126126
fi
127+
if [ -f scripts/check-v37-gate7-conversation-persistence-privacy-redaction.mjs ]; then
128+
node scripts/check-v37-gate7-conversation-persistence-privacy-redaction.mjs --skip-branch-check
129+
fi
127130
fi
128131
else
129132
echo "Unexpected BITCODE_SPEC.txt pointer: $POINTER" >&2

.github/workflows/bitcode-gate-quality.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,9 @@ jobs:
253253
if [ -f scripts/check-v37-gate6-conversation-terminal-handoff.mjs ]; then
254254
node scripts/check-v37-gate6-conversation-terminal-handoff.mjs --skip-branch-check
255255
fi
256+
if [ -f scripts/check-v37-gate7-conversation-persistence-privacy-redaction.mjs ]; then
257+
node scripts/check-v37-gate7-conversation-persistence-privacy-redaction.mjs --skip-branch-check
258+
fi
256259
fi
257260
else
258261
echo "Unexpected BITCODE_SPEC.txt pointer: $POINTER" >&2
@@ -325,7 +328,7 @@ jobs:
325328
pnpm --filter @bitcode/pipeline-hosts exec jest --config jest.config.cjs --runTestsByPath src/__tests__/distributed-execution-runtime-receipt.test.ts --runInBand --forceExit
326329
pnpm --filter @bitcode/pipeline-asset-pack exec jest --config jest.config.cjs --runTestsByPath src/__tests__/reading-pipeline-observability.test.ts src/__tests__/reading-pipeline-contract.test.ts src/__tests__/v32-reading-pipeline-proof-coverage.test.ts --runInBand --forceExit
327330
pnpm --filter @bitcode/pipeline-asset-pack exec jest --config jest.config.cjs --runTestsByPath src/__tests__/asset-pack-disclosure.test.ts src/__tests__/postprocess.test.ts src/__tests__/read-need.test.ts --runInBand --forceExit
328-
pnpm --filter @bitcode/api exec jest --config jest.config.cjs --runTestsByPath src/conversations/__tests__/stream-events.test.ts --runInBand --forceExit
331+
pnpm --filter @bitcode/api exec jest --config jest.config.cjs --runTestsByPath src/conversations/__tests__/stream-events.test.ts src/conversations/__tests__/privacy.test.ts --runInBand --forceExit
329332
pnpm --filter @bitcode/protocol test
330333
331334
- name: Test staged Reading route and Terminal harness contracts
@@ -343,6 +346,8 @@ jobs:
343346
tests/api/conversationStreamEventContract.test.ts \
344347
tests/conversationStreamPipelineLog.test.tsx \
345348
tests/conversationTerminalHandoff.test.tsx \
349+
tests/api/conversationPersistencePrivacyRedaction.test.ts \
350+
tests/conversationPersistencePrivacyPanel.test.tsx \
346351
tests/conversationSourceSelector.test.tsx \
347352
tests/conversationWritingWorkspace.test.tsx \
348353
tests/auxillariesExternalsPane.test.tsx \

BITCODE_SPEC_V37.md

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
## Status
44

55
- Version: `V37`
6-
- V37 state: draft implementation; Gate 6 closes ConversationTerminalHandoff transaction handoff over active V36 Exchange canon
6+
- V37 state: draft implementation; Gate 7 closes ConversationPersistencePrivacyRedaction durable storage privacy over active V36 Exchange canon
77
- Current canonical/latest target: `V36`
88
- Prior canonical anchor: `BITCODE_SPEC_V36.md`
99
- Prior generated proof appendix: `BITCODE_SPEC_V36_PROVEN.md`
10-
- Generated structured artifact inventory: draft `.bitcode/v37-spec-family-report.json`, `.bitcode/v37-canonical-input-report.json`, `.bitcode/v37-canon-posture-drift-report.json`, `.bitcode/v37-conversation-session-route-history.json`, `.bitcode/v37-conversation-stream-event-contract.json`, `.bitcode/v37-conversation-writing-workspace.json`, `.bitcode/v37-conversation-source-selector.json`, and `.bitcode/v37-conversation-terminal-handoff.json`
11-
- Source parity state: V37 source parity includes Gate 1 spec family, roadmap, docs, workflow, and checker posture, Gate 2 package-owned ConversationSession route-history contracts, Gate 3 package-owned ConversationStreamEvent stream UI/event contracts, Gate 4 package-owned ConversationWritingWorkspace fullscreen writing contracts, Gate 5 package-owned ConversationSourceSelector source/context policy contracts, and Gate 6 package-owned ConversationTerminalHandoff transaction handoff contracts
10+
- Generated structured artifact inventory: draft `.bitcode/v37-spec-family-report.json`, `.bitcode/v37-canonical-input-report.json`, `.bitcode/v37-canon-posture-drift-report.json`, `.bitcode/v37-conversation-session-route-history.json`, `.bitcode/v37-conversation-stream-event-contract.json`, `.bitcode/v37-conversation-writing-workspace.json`, `.bitcode/v37-conversation-source-selector.json`, `.bitcode/v37-conversation-terminal-handoff.json`, and `.bitcode/v37-conversation-persistence-privacy-redaction.json`
11+
- Source parity state: V37 source parity includes Gate 1 spec family, roadmap, docs, workflow, and checker posture, Gate 2 package-owned ConversationSession route-history contracts, Gate 3 package-owned ConversationStreamEvent stream UI/event contracts, Gate 4 package-owned ConversationWritingWorkspace fullscreen writing contracts, Gate 5 package-owned ConversationSourceSelector source/context policy contracts, Gate 6 package-owned ConversationTerminalHandoff transaction handoff contracts, and Gate 7 package-owned ConversationPersistencePrivacyRedaction durable storage privacy contracts
1212
- Active canonical pointer during draft opening: `BITCODE_SPEC.txt` -> `V36`
1313
- Notes companion: `BITCODE_SPEC_V37_NOTES.md`
1414
- Delta companion: `BITCODE_SPEC_V37_DELTA.md`
@@ -35,6 +35,7 @@ V37 adds Website Conversations product contracts over inherited V36 canon:
3535
- `ConversationWritingWorkspace`: fullscreen writing mode for drafting Read Requests, Need feedback, AssetPack review notes, and Terminal handoff summaries without source leakage.
3636
- `ConversationSourceSelector`: repository, branch, commit, deposit, BTD range, AssetPack preview, document, and prior conversation source selectors governed by policy, rights, and disclosure posture.
3737
- `ConversationTerminalHandoff`: source-safe handoff from conversation context into `/terminal` transactions for Depositing, Reading, Finding Fits, Exchange, settlement, and delivery workflows.
38+
- `ConversationPersistencePrivacyRedaction`: durable conversation storage, visibility tier separation, export, delete, retention, replay, and incident repair posture for source-safe persisted history.
3839

3940
V37 does not replace the V28 ChatGPT App, V33 interface contracts, V35 telemetry/docs, or V36 Exchange law.
4041
It turns the website conversation surface into a route-owned user experience that consumes those contracts and emits proof-rooted source-safe telemetry.
@@ -189,6 +190,43 @@ source, generated artifact freshness, package tests, UI tests, Terminal route
189190
tests, docs, workflow wiring, workflow coverage, authority boundaries,
190191
proof roots, event ids, and source-safe handoff metadata.
191192

193+
## V37 Gate 7 ConversationPersistencePrivacyRedaction canon
194+
195+
Gate 7 implements `ConversationPersistencePrivacyRedaction` as the
196+
package-owned durable storage privacy and redaction contract for Website
197+
Conversations. It owns the visibility tier separation for public,
198+
user-visible, organization-visible, buyer-visible, reviewer-visible, and
199+
operator-only data. It emits
200+
`.bitcode/v37-conversation-persistence-privacy-redaction.json` with
201+
`source-safe-conversation-persistence-privacy-redaction-metadata`,
202+
deterministic row roots, deterministic detail roots, operation ids, visibility
203+
tier ids, retention postures, required field ids, proof roots, event ids,
204+
source evidence roots, and source-safe disclosure limits.
205+
206+
Conversation persistence is durable route-local projection state, not global
207+
ledger truth. The persisted write path may store source-safe message content,
208+
source context references, redaction posture, retention posture, proof roots,
209+
and event ids. It must redact or block protected prompts, protected model
210+
responses with source, protected source payloads, provider tokens, wallet
211+
private material, settlement private payloads, private payment credentials,
212+
operator private notes, unpaid AssetPack source, ledger write authority, and
213+
wallet signing authority before durable storage, telemetry, export, replay, or
214+
incident repair.
215+
216+
Gate 7 covers seven persistence operations: persist message, restore history,
217+
export history, delete history, retain history, replay history, and incident
218+
repair. Export may only include source-safe data visible to the requesting
219+
principal. Delete leaves only a source-safe tombstone proof. Retention applies
220+
the correct visibility tier without escalating disclosure. Replay reconstructs
221+
prompt template ids and parsed result shapes, never raw protected prompts or
222+
raw protected model responses. Incident repair may inspect proof roots and
223+
redaction verdicts but cannot expose protected source or private wallet
224+
material. `check:v37-gate7` validates package source, generated artifact
225+
freshness, package tests, API storage redaction tests, UI tests, docs,
226+
workflow wiring, visibility tier coverage, retention posture coverage, export
227+
posture, delete posture, replay posture, incident repair posture, proof roots,
228+
event ids, and source-safe persisted metadata.
229+
192230
## Inherited V36 Exchange canon
193231

194232
The promoted V36 sections below remain inherited canonical law for Exchange.

BITCODE_SPEC_V37_DELTA.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,16 @@ UI tests, Terminal route tests, workflow wiring, and `check:v37-gate6`.
159159

160160
Gate 7 defines durable storage and privacy controls.
161161

162+
Gate 7 closure adds package-backed `ConversationPersistencePrivacyRedaction`
163+
source, `.bitcode/v37-conversation-persistence-privacy-redaction.json`,
164+
`source-safe-conversation-persistence-privacy-redaction-metadata`, public,
165+
user-visible, organization-visible, buyer-visible, reviewer-visible, and
166+
operator-only visibility tier separation, persist/restore/export/delete/
167+
retention/replay/incident repair operation rows, API storage redaction for
168+
messages, attachment metadata, execution input, and execution metadata,
169+
source-safe UI preview controls, package tests, API tests, UI tests, workflow
170+
wiring, and `check:v37-gate7`.
171+
162172
Closure acceptance:
163173

164174
- conversation persistence separates public, user-visible, organization-visible, buyer-visible, reviewer-visible, and operator-only data;

BITCODE_SPEC_V37_NOTES.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,20 @@ material, settlement private payloads, unpaid AssetPack source, ledger write
122122
authority, wallet signing authority, or a Terminal authority bypass. The
123123
Terminal remains the transaction cockpit.
124124

125+
Gate 7 adds `ConversationPersistencePrivacyRedaction` so durable conversation
126+
storage has a precise visibility tier boundary. Public, user-visible,
127+
organization-visible, buyer-visible, reviewer-visible, and operator-only data
128+
are separated before persistence, export, delete, retention, replay, and
129+
incident repair. Message content, attachment metadata, execution input, and
130+
execution metadata pass through redaction before storage. Protected prompts,
131+
protected model responses, protected source payloads, secrets, provider
132+
tokens, wallet private material, settlement private payloads, unpaid AssetPack
133+
source, ledger write authority, and wallet signing authority are blocked or
134+
redacted. Export is source-safe, delete leaves only a tombstone proof,
135+
retention never escalates visibility, replay uses prompt template ids and
136+
parsed result shapes, and incident repair operates over proof roots and
137+
redaction verdicts.
138+
125139
## V37 gate plan
126140

127141
- Gate 1: V37 Conversations Roadmap And Spec Opening

0 commit comments

Comments
 (0)