create-principles-disciple 1.133.0 → 1.133.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/codex-adapter/dist/ingestion/ingestion.js +3 -3
- package/codex-adapter/dist/ingestion/transcript-locate.d.ts +6 -11
- package/codex-adapter/dist/ingestion/transcript-locate.js +5 -73
- package/codex-adapter/dist/ingestion/transcript-path.d.ts +2 -2
- package/codex-adapter/dist/ingestion/transcript-path.js +4 -21
- package/codex-adapter/dist/worker/workspace-worker.d.ts +1 -12
- package/codex-adapter/dist/worker/workspace-worker.js +4 -34
- package/codex-adapter/package.json +1 -1
- package/console/dist/server/models/CodexGovernanceHealthModel.d.ts +97 -0
- package/console/dist/server/models/CodexGovernanceHealthModel.js +81 -0
- package/console/dist/server/models/EvidenceChainConsoleModel.js +16 -2
- package/console/dist/server/routes/health.js +59 -3
- package/console/dist/ui/i18n/en.json +4 -0
- package/console/dist/ui/i18n/zh-CN.json +4 -0
- package/console/dist/ui/pages/pain/PainPage.js +1 -1
- package/console/dist/ui/utils/validators.d.ts +2 -0
- package/console/dist/ui/utils/validators.js +7 -0
- package/console/dist/web/assets/app.js +15 -1
- package/core/dist/host/index.d.ts +2 -0
- package/core/dist/host/index.d.ts.map +1 -1
- package/core/dist/host/index.js +3 -0
- package/core/dist/host/index.js.map +1 -1
- package/core/dist/host/legacy-registration.d.ts +28 -0
- package/core/dist/host/legacy-registration.d.ts.map +1 -0
- package/core/dist/host/legacy-registration.js +49 -0
- package/core/dist/host/legacy-registration.js.map +1 -0
- package/core/dist/runtime-v2/__tests__/evidence-chain-host-kind.test.d.ts +2 -0
- package/core/dist/runtime-v2/__tests__/evidence-chain-host-kind.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/__tests__/evidence-chain-host-kind.test.js +49 -0
- package/core/dist/runtime-v2/__tests__/evidence-chain-host-kind.test.js.map +1 -0
- package/core/dist/runtime-v2/types/evidence-chain-contract.d.ts +6 -0
- package/core/dist/runtime-v2/types/evidence-chain-contract.d.ts.map +1 -1
- package/core/dist/runtime-v2/types/evidence-chain-contract.js +12 -0
- package/core/dist/runtime-v2/types/evidence-chain-contract.js.map +1 -1
- package/core/package.json +1 -1
- package/dist/installers/codex-host-installer.d.ts +17 -7
- package/dist/installers/codex-host-installer.d.ts.map +1 -1
- package/dist/installers/codex-host-installer.js +78 -194
- package/dist/installers/codex-host-installer.js.map +1 -1
- package/host-runtime/dist/codex-disclosure.d.ts +23 -0
- package/host-runtime/dist/codex-disclosure.js +60 -0
- package/host-runtime/dist/codex-ingestion-consent.d.ts +111 -0
- package/host-runtime/dist/codex-ingestion-consent.js +223 -0
- package/host-runtime/dist/codex-legacy-registration.d.ts +18 -0
- package/host-runtime/dist/codex-legacy-registration.js +34 -0
- package/host-runtime/dist/codex-transcript-locate.d.ts +16 -0
- package/host-runtime/dist/codex-transcript-locate.js +106 -0
- package/host-runtime/dist/codex-worker-status.d.ts +24 -0
- package/host-runtime/dist/codex-worker-status.js +52 -0
- package/host-runtime/dist/governance-observation-store.d.ts +77 -1
- package/host-runtime/dist/governance-observation-store.js +188 -3
- package/host-runtime/dist/governance-signal-admission.d.ts +26 -0
- package/host-runtime/dist/governance-signal-admission.js +47 -0
- package/host-runtime/dist/index.d.ts +5 -0
- package/host-runtime/dist/index.js +14 -0
- package/host-runtime/package.json +1 -1
- package/package.json +1 -1
- package/pd-cli/dist/commands/codex-ingest-quarantine.d.ts +12 -0
- package/pd-cli/dist/commands/codex-ingest-quarantine.d.ts.map +1 -0
- package/pd-cli/dist/commands/codex-ingest-quarantine.js +116 -0
- package/pd-cli/dist/commands/codex-ingest-quarantine.js.map +1 -0
- package/pd-cli/dist/commands/codex-setup.d.ts +46 -0
- package/pd-cli/dist/commands/codex-setup.d.ts.map +1 -0
- package/pd-cli/dist/commands/codex-setup.js +423 -0
- package/pd-cli/dist/commands/codex-setup.js.map +1 -0
- package/pd-cli/dist/commands/health-codex.d.ts.map +1 -1
- package/pd-cli/dist/commands/health-codex.js +350 -67
- package/pd-cli/dist/commands/health-codex.js.map +1 -1
- package/pd-cli/dist/index.js +51 -0
- package/pd-cli/dist/index.js.map +1 -1
- package/pd-cli/package.json +1 -1
- package/plugin/dist/bundle.js +331 -331
- package/release-manager/dist/installers/codex-host-installer.d.ts +17 -7
- package/release-manager/dist/installers/codex-host-installer.d.ts.map +1 -1
- package/release-manager/dist/installers/codex-host-installer.js +78 -194
- package/release-manager/dist/installers/codex-host-installer.js.map +1 -1
- package/release-manager/package.json +1 -1
|
@@ -23,13 +23,20 @@
|
|
|
23
23
|
* merge into it, never overwrite. The marker file is our own bookkeeping
|
|
24
24
|
* for precise uninstall.
|
|
25
25
|
*/
|
|
26
|
-
import { existsSync, readFileSync, writeFileSync
|
|
26
|
+
import { existsSync, readFileSync, writeFileSync } from 'fs';
|
|
27
27
|
import { execSync } from 'child_process';
|
|
28
28
|
import * as path from 'path';
|
|
29
29
|
import * as os from 'os';
|
|
30
30
|
import { createRequire } from 'module';
|
|
31
31
|
import { pathToFileURL } from 'url';
|
|
32
32
|
import { isNpmDependencyResolutionEnabled } from '../installer.js';
|
|
33
|
+
// NOTE (PRI-625 review round 3 / PRI-669 gate): this installer ships as the
|
|
34
|
+
// self-contained npx package — @principles/core is NOT in its dependencies,
|
|
35
|
+
// and type-only imports are erased at compile time, so the import above is
|
|
36
|
+
// safe. The legacy-registration PARSER must therefore NOT be value-imported
|
|
37
|
+
// here. Its single authority lives in @principles/core/host
|
|
38
|
+
// (parseLegacyCodexHooksRegistration); the local classification below is the
|
|
39
|
+
// npx-parity edge, and a CI parity test pins the two shapes together.
|
|
33
40
|
const requireFromModule = createRequire(import.meta.url);
|
|
34
41
|
// ─── Codex hook event names (SPEC v4.1 §5.7) ────────────────────────────────
|
|
35
42
|
const CODEX_EVENTS = ['PreToolUse', 'PostToolUse', 'UserPromptSubmit', 'SessionStart'];
|
|
@@ -129,73 +136,11 @@ export function resolvePdHookPath(deps = {}) {
|
|
|
129
136
|
return undefined;
|
|
130
137
|
}
|
|
131
138
|
/**
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
*
|
|
139
|
+
* Hook entry / matcher-group shapes (rc-2 typing for detectLegacyCodexHookRegistration).
|
|
140
|
+
* The builder that CREATED these groups was retired with the legacy installer
|
|
141
|
+
* (SPEC rev 2 §17); the shapes remain because uninstall and the legacy
|
|
142
|
+
* detector must still recognize what old installers wrote.
|
|
136
143
|
*/
|
|
137
|
-
function buildHookCommand(entryScriptPath, _workspaceDir) {
|
|
138
|
-
// Unix command: node <entry>
|
|
139
|
-
// workspaceDir is injected by the wrapper script (pd-hook-entry.cjs), not here.
|
|
140
|
-
void _workspaceDir;
|
|
141
|
-
return `node "${entryScriptPath}"`;
|
|
142
|
-
}
|
|
143
|
-
function buildHookCommandWindows(entryScriptPath, _workspaceDir) {
|
|
144
|
-
// Windows command — same node invocation; the entry script handles env internally
|
|
145
|
-
void _workspaceDir;
|
|
146
|
-
return `node "${entryScriptPath}"`;
|
|
147
|
-
}
|
|
148
|
-
function buildMatcherGroup(eventName, entryScriptPath, workspaceDir) {
|
|
149
|
-
const command = buildHookCommand(entryScriptPath, workspaceDir);
|
|
150
|
-
const commandWindows = buildHookCommandWindows(entryScriptPath, workspaceDir);
|
|
151
|
-
switch (eventName) {
|
|
152
|
-
case 'PreToolUse':
|
|
153
|
-
return {
|
|
154
|
-
matcher: 'Bash|apply_patch',
|
|
155
|
-
hooks: [{
|
|
156
|
-
type: 'command',
|
|
157
|
-
command,
|
|
158
|
-
commandWindows,
|
|
159
|
-
timeout: 5,
|
|
160
|
-
statusMessage: 'PD: checking tool call',
|
|
161
|
-
}],
|
|
162
|
-
};
|
|
163
|
-
case 'PostToolUse':
|
|
164
|
-
return {
|
|
165
|
-
matcher: '.*',
|
|
166
|
-
hooks: [{
|
|
167
|
-
type: 'command',
|
|
168
|
-
command,
|
|
169
|
-
commandWindows,
|
|
170
|
-
timeout: 5,
|
|
171
|
-
async: true,
|
|
172
|
-
statusMessage: 'PD: capturing pain signal',
|
|
173
|
-
}],
|
|
174
|
-
};
|
|
175
|
-
case 'UserPromptSubmit':
|
|
176
|
-
return {
|
|
177
|
-
hooks: [{
|
|
178
|
-
type: 'command',
|
|
179
|
-
command,
|
|
180
|
-
commandWindows,
|
|
181
|
-
timeout: 5,
|
|
182
|
-
additionalContextLimit: 10000,
|
|
183
|
-
statusMessage: 'PD: injecting principles',
|
|
184
|
-
}],
|
|
185
|
-
};
|
|
186
|
-
case 'SessionStart':
|
|
187
|
-
return {
|
|
188
|
-
hooks: [{
|
|
189
|
-
type: 'command',
|
|
190
|
-
command,
|
|
191
|
-
commandWindows,
|
|
192
|
-
timeout: 600,
|
|
193
|
-
additionalContextLimit: 10000,
|
|
194
|
-
statusMessage: 'PD: hydrating state',
|
|
195
|
-
}],
|
|
196
|
-
};
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
144
|
// ─── Wrapper script content ─────────────────────────────────────────────────
|
|
200
145
|
/**
|
|
201
146
|
* Generate the wrapper script that sets env vars and imports pd-hook.js.
|
|
@@ -221,144 +166,83 @@ export function buildWrapperScriptContent(pdHookPath, workspaceDir) {
|
|
|
221
166
|
'',
|
|
222
167
|
].join('\n');
|
|
223
168
|
}
|
|
169
|
+
// ─── Legacy registration detection (Slice D, SPEC rev 2 §17) ────────────────
|
|
170
|
+
// The single PARSING authority lives in @principles/core/host
|
|
171
|
+
// (parseLegacyCodexHooksRegistration — pure, no I/O). This installer is the
|
|
172
|
+
// npx-parity FS edge: same classification semantics, mirrored here because
|
|
173
|
+
// @principles/core is not a runtime dependency of this self-contained
|
|
174
|
+
// package. CI pins the two shapes together (codex-host-installer.test.ts →
|
|
175
|
+
// parseLegacyCodexHooksRegistration parity).
|
|
176
|
+
export function detectLegacyCodexHookRegistration(hooksJsonPathOverride) {
|
|
177
|
+
const hooksJsonPath = hooksJsonPathOverride ?? getCodexHooksJsonPath();
|
|
178
|
+
let parsed;
|
|
179
|
+
try {
|
|
180
|
+
parsed = JSON.parse(readFileSync(hooksJsonPath, 'utf-8'));
|
|
181
|
+
}
|
|
182
|
+
catch {
|
|
183
|
+
return { detected: false, legacyAsyncPostToolUse: false };
|
|
184
|
+
}
|
|
185
|
+
// npx-parity mirror of @principles/core/host parseLegacyCodexHooksRegistration
|
|
186
|
+
// (kept here because @principles/core is not a runtime dep of this package;
|
|
187
|
+
// parity with the core parser is enforced by codex-host-installer.test.ts).
|
|
188
|
+
if (!isRecord(parsed))
|
|
189
|
+
return { detected: false, legacyAsyncPostToolUse: false };
|
|
190
|
+
let detected = false;
|
|
191
|
+
let legacyAsyncPostToolUse = false;
|
|
192
|
+
for (const eventName of CODEX_EVENTS) {
|
|
193
|
+
const groups = parsed[eventName];
|
|
194
|
+
if (!isUnknownArray(groups))
|
|
195
|
+
continue;
|
|
196
|
+
for (const group of groups) {
|
|
197
|
+
if (!(isRecord(group) && Object.hasOwn(group, '__pd_marker') && group.__pd_marker === 'pd-owned'))
|
|
198
|
+
continue;
|
|
199
|
+
detected = true;
|
|
200
|
+
const entries = group.hooks;
|
|
201
|
+
if (!isUnknownArray(entries))
|
|
202
|
+
continue;
|
|
203
|
+
for (const entry of entries) {
|
|
204
|
+
if (isRecord(entry) && eventName === 'PostToolUse' && Object.hasOwn(entry, 'async') && entry.async === true) {
|
|
205
|
+
legacyAsyncPostToolUse = true;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
return { detected, legacyAsyncPostToolUse };
|
|
211
|
+
}
|
|
224
212
|
// ─── CodexHostInstaller ─────────────────────────────────────────────────────
|
|
225
213
|
export class CodexHostInstaller {
|
|
226
214
|
hostId = 'codex';
|
|
227
|
-
|
|
228
|
-
|
|
215
|
+
/**
|
|
216
|
+
* RETIRED for new registrations (Codex Governance Closure Slice D; SPEC rev
|
|
217
|
+
* 2 §17 — the Marketplace plugin is the only supported new install path;
|
|
218
|
+
* this legacy global-hook installer is migration/uninstall-only).
|
|
219
|
+
*
|
|
220
|
+
* This method NEVER writes hook registrations anymore. It returns a
|
|
221
|
+
* structured refusal that points at the supported path, and when a legacy
|
|
222
|
+
* PD global registration is detected it offers the explicit migration
|
|
223
|
+
* route (precise uninstall → Marketplace plugin → $pd-setup consent).
|
|
224
|
+
*/
|
|
225
|
+
async install(_ctx) {
|
|
229
226
|
const hooksJsonPath = getCodexHooksJsonPath();
|
|
230
|
-
const
|
|
231
|
-
|
|
232
|
-
const pdHookPath = resolvePdHookPath();
|
|
233
|
-
if (!pdHookPath) {
|
|
234
|
-
return {
|
|
235
|
-
success: false,
|
|
236
|
-
hostId: this.hostId,
|
|
237
|
-
configPath: hooksJsonPath,
|
|
238
|
-
configAction: 'skipped',
|
|
239
|
-
reason: '@principles/codex-adapter is not installed. The codex-adapter package provides the pd-hook.js entry Codex spawns.',
|
|
240
|
-
nextAction: 'Install it first: npm install -g @principles/codex-adapter, then re-run: npx create-principles-disciple install --host codex',
|
|
241
|
-
};
|
|
242
|
-
}
|
|
243
|
-
// 2. Write wrapper script to ~/.pd/codex/pd-hook-entry.cjs
|
|
244
|
-
// (marker file is written AFTER mergeHooksJson succeeds — see step 3.
|
|
245
|
-
// Writing the marker before the merge would make detect() report a
|
|
246
|
-
// failed install as installed, violating rc-3-fail-loud-missing.)
|
|
247
|
-
try {
|
|
248
|
-
if (!existsSync(pdCodexDir)) {
|
|
249
|
-
mkdirSync(pdCodexDir, { recursive: true });
|
|
250
|
-
}
|
|
251
|
-
const wrapperPath = path.join(pdCodexDir, 'pd-hook-entry.cjs');
|
|
252
|
-
const wrapperContent = buildWrapperScriptContent(pdHookPath, ctx.workspaceDir);
|
|
253
|
-
writeFileSync(wrapperPath, wrapperContent, { encoding: 'utf-8' });
|
|
254
|
-
// 3. Merge PD hook entries into ~/.codex/hooks.json (append, never overwrite).
|
|
255
|
-
// If hooks.json is malformed, mergeHooksJson returns 'preserved' without
|
|
256
|
-
// writing any PD entries. This MUST surface as a failure (rc-3 / rc-9)
|
|
257
|
-
// — otherwise the user would see "install succeeded" while Codex never
|
|
258
|
-
// triggers PD hooks. The marker is NOT written in this branch, so
|
|
259
|
-
// detect() correctly reports "not installed".
|
|
260
|
-
const configAction = this.mergeHooksJson(hooksJsonPath, wrapperPath, ctx.workspaceDir);
|
|
261
|
-
if (configAction === 'preserved') {
|
|
262
|
-
return {
|
|
263
|
-
success: false,
|
|
264
|
-
hostId: this.hostId,
|
|
265
|
-
configPath: hooksJsonPath,
|
|
266
|
-
configAction,
|
|
267
|
-
reason: `${hooksJsonPath} is malformed (not a JSON object). PD did not write any hook entries to avoid overwriting the user's config.`,
|
|
268
|
-
nextAction: `Manually fix ${hooksJsonPath} (must be a JSON object), then re-run: npx create-principles-disciple install --host codex`,
|
|
269
|
-
};
|
|
270
|
-
}
|
|
271
|
-
// 4. Merge succeeded — now safe to record the marker. detect() will
|
|
272
|
-
// only report installed when hooks.json actually contains PD entries.
|
|
273
|
-
writeFileSync(markerPath, JSON.stringify({
|
|
274
|
-
installedAt: new Date().toISOString(),
|
|
275
|
-
workspaceDir: ctx.workspaceDir,
|
|
276
|
-
pdHookPath,
|
|
277
|
-
wrapperPath,
|
|
278
|
-
events: CODEX_EVENTS,
|
|
279
|
-
}, null, 2), { encoding: 'utf-8' });
|
|
280
|
-
return {
|
|
281
|
-
success: true,
|
|
282
|
-
hostId: this.hostId,
|
|
283
|
-
configPath: hooksJsonPath,
|
|
284
|
-
configAction,
|
|
285
|
-
nextAction: 'Open Codex and run /hooks to trust PD hooks before they execute. Verify with: codex doctor (hooks feature should be ON).',
|
|
286
|
-
};
|
|
287
|
-
}
|
|
288
|
-
catch (err) {
|
|
289
|
-
const reason = err instanceof Error ? err.message : String(err);
|
|
227
|
+
const legacy = detectLegacyCodexHookRegistration();
|
|
228
|
+
if (legacy.detected) {
|
|
290
229
|
return {
|
|
291
230
|
success: false,
|
|
292
231
|
hostId: this.hostId,
|
|
293
232
|
configPath: hooksJsonPath,
|
|
294
233
|
configAction: 'skipped',
|
|
295
|
-
reason:
|
|
296
|
-
nextAction:
|
|
234
|
+
reason: 'A legacy PD global Codex hook registration was detected (async PostToolUse in ~/.codex/hooks.json). The legacy global installer is retired (SPEC rev 2 §17) and cannot update it.',
|
|
235
|
+
nextAction: 'Migrate to the Marketplace plugin: 1) npx create-principles-disciple uninstall --host codex (removes ONLY PD-owned entries; evidence is preserved); 2) codex plugin add principles-disciple@principles; 3) run the plugin setup ($pd-setup) — it presents the ingestion disclosure and records consent.',
|
|
297
236
|
};
|
|
298
237
|
}
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
mergeHooksJson(hooksJsonPath, wrapperPath, workspaceDir) {
|
|
308
|
-
const codexDir = getCodexDir();
|
|
309
|
-
if (!existsSync(codexDir)) {
|
|
310
|
-
mkdirSync(codexDir, { recursive: true });
|
|
311
|
-
}
|
|
312
|
-
let existing = {};
|
|
313
|
-
let action = 'created';
|
|
314
|
-
// CodeQL TOCTOU fix: try/catch read instead of existsSync+readFileSync.
|
|
315
|
-
// ENOENT → 'created' (file doesn't exist yet); other parse errors → 'preserved'.
|
|
316
|
-
try {
|
|
317
|
-
const raw = readFileSync(hooksJsonPath, 'utf-8');
|
|
318
|
-
const parsed = JSON.parse(raw);
|
|
319
|
-
if (isRecord(parsed)) {
|
|
320
|
-
existing = { ...parsed };
|
|
321
|
-
action = 'updated';
|
|
322
|
-
}
|
|
323
|
-
else {
|
|
324
|
-
// Malformed — back off, don't overwrite
|
|
325
|
-
action = 'preserved';
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
catch (err) {
|
|
329
|
-
const code = getErrorCode(err);
|
|
330
|
-
if (code === 'ENOENT') {
|
|
331
|
-
// File doesn't exist — 'created' (default action stays)
|
|
332
|
-
}
|
|
333
|
-
else {
|
|
334
|
-
// Malformed JSON — back off
|
|
335
|
-
action = 'preserved';
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
if (action === 'preserved') {
|
|
339
|
-
return action;
|
|
340
|
-
}
|
|
341
|
-
// For each Codex event, replace any existing PD-owned matcher groups
|
|
342
|
-
// with our fresh set (idempotent — re-install doesn't duplicate).
|
|
343
|
-
const PD_MARKER = 'pd-owned';
|
|
344
|
-
for (const eventName of CODEX_EVENTS) {
|
|
345
|
-
const group = buildMatcherGroup(eventName, wrapperPath, workspaceDir);
|
|
346
|
-
// Tag the group so uninstall can find PD-owned entries precisely.
|
|
347
|
-
group.__pd_marker = PD_MARKER;
|
|
348
|
-
const existingGroups = existing[eventName];
|
|
349
|
-
if (isUnknownArray(existingGroups)) {
|
|
350
|
-
// Filter out previously-PD-owned groups, then append the new one.
|
|
351
|
-
// rc-2: no `as` bypass — use Object.hasOwn to check marker presence.
|
|
352
|
-
const filtered = existingGroups.filter((g) => !(isRecord(g) && Object.hasOwn(g, '__pd_marker') && g.__pd_marker === PD_MARKER));
|
|
353
|
-
filtered.push(group);
|
|
354
|
-
existing[eventName] = filtered;
|
|
355
|
-
}
|
|
356
|
-
else {
|
|
357
|
-
existing[eventName] = [group];
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
writeFileSync(hooksJsonPath, JSON.stringify(existing, null, 2), { encoding: 'utf-8' });
|
|
361
|
-
return action;
|
|
238
|
+
return {
|
|
239
|
+
success: false,
|
|
240
|
+
hostId: this.hostId,
|
|
241
|
+
configPath: hooksJsonPath,
|
|
242
|
+
configAction: 'skipped',
|
|
243
|
+
reason: 'New Codex global hook registrations are retired (SPEC rev 2 §17). The Marketplace plugin is the only supported new install path for Codex.',
|
|
244
|
+
nextAction: 'Install the plugin: codex plugin add principles-disciple@principles — then run its setup ($pd-setup), which verifies Node/runtime/workspace/trust and records the conversation-ingestion consent.',
|
|
245
|
+
};
|
|
362
246
|
}
|
|
363
247
|
async uninstall(_ctx) {
|
|
364
248
|
const hooksJsonPath = getCodexHooksJsonPath();
|
|
@@ -1 +1 @@
|
|
|
1
|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Y,EAAE,CAAC;wBACrC,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;wBACjC,IAAI,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC;4BAC3B,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAC9B,QAAQ,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC,WAAW,KAAK,UAAU,CAC/E,CAAC;4BACF,IAAI,KAAK,EAAE,CAAC;gCACV,SAAS,GAAG,IAAI,CAAC;gCACjB,MAAM;4BACR,CAAC;wBACH,CAAC;oBACH,CAAC;gBACH,CAAC;YACH,CAAC;YAAC,MAAM,CAAC;gBACP,+EAA+E;YACjF,CAAC;QACH,CAAC;QAED,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;IAC9B,CAAC;CACF"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Codex conversation-ingestion consent disclosure — G2A frozen text (Slice D).
|
|
3
|
+
*
|
|
4
|
+
* The Chinese text below is copied VERBATIM from the Owner-approved decision
|
|
5
|
+
* package:
|
|
6
|
+
* docs/superpowers/specs/2026-08-28-codex-governance-closure-g0-g2a-decision.md
|
|
7
|
+
* § "Frozen consent disclosure text (setup will show this verbatim)"
|
|
8
|
+
*
|
|
9
|
+
* That document is the language SSoT. The frozen text "must not be weakened
|
|
10
|
+
* during implementation without a new Owner decision" — the guard test
|
|
11
|
+
* (codex-disclosure-g2a-guard.test.ts) re-extracts the frozen section from
|
|
12
|
+
* the document and asserts byte equality with this constant, so any drift
|
|
13
|
+
* here fails CI.
|
|
14
|
+
*
|
|
15
|
+
* The English rendering states the same facts; per the G2A binding note it is
|
|
16
|
+
* produced at setup implementation time from the frozen Chinese text. Setup
|
|
17
|
+
* surfaces always present the Chinese SSoT first.
|
|
18
|
+
*/
|
|
19
|
+
export declare const CODEX_INGESTION_DISCLOSURE_VERSION = "g2a-2026-08-28";
|
|
20
|
+
export type CodexIngestionDisclosureLanguage = 'zh' | 'en';
|
|
21
|
+
export declare const CODEX_INGESTION_DISCLOSURE_ZH = "### Principles Disciple \u2014 \u5BF9\u8BDD\u89C2\u5BDF\u4E0E\u6CBB\u7406\u95ED\u73AF\uFF08Codex\uFF09\n\n**\u5F00\u542F\u540E PD \u4F1A\u8BFB\u53D6\u4EC0\u4E48\uFF1F**\n\u8BFB\u53D6\u672C\u5DE5\u4F5C\u533A\u5185 Codex \u660E\u786E\u63D0\u4F9B\u7ED9 PD \u7684\u4F1A\u8BDD\u8BB0\u5F55\uFF08transcript\uFF09\u3002\u8FDB\u5165\u6CBB\u7406\u89C2\u5BDF\u7684\u53EA\u6709\u53EF\u89C1\u5185\u5BB9\uFF1A\u4F60\u53D1\u51FA\u7684\u6D88\u606F\u3001\u52A9\u624B\u7684\u53EF\u89C1\u56DE\u590D\u3001\u4EE5\u53CA\u5DE5\u5177\u8C03\u7528\u7684\u540D\u79F0/\u8F93\u5165/\u7ED3\u679C\uFF08\u7528\u4E8E\u8BC6\u522B\u53CD\u590D\u51FA\u73B0\u7684\u95EE\u9898\uFF09\u3002\u8BB0\u5F55\u4E2D\u540C\u65F6\u5B58\u5728\u7684\u9690\u85CF\u601D\u8003\u8FC7\u7A0B\uFF08Codex \u4EE5\u52A0\u5BC6\u5F62\u5F0F\u4FDD\u5B58\uFF09\u3001\u7CFB\u7EDF/\u5F00\u53D1\u8005\u63D0\u793A\u8BCD\u3001\u5BBF\u4E3B\u6CE8\u5165\u7684\u73AF\u5883\u4E0A\u4E0B\u6587\uFF0C\u4F1A\u5728\u89E3\u6790\u65F6\u88AB\u8BC6\u522B\u5E76\u4E22\u5F03\u2014\u2014\u4E0D\u4F1A\u88AB\u4FDD\u5B58\u3001\u4E0D\u4F1A\u8FDB\u5165\u65E5\u5FD7\u3001\u4E0D\u4F1A\u53D1\u9001\u7ED9\u8BCA\u65AD\u6A21\u578B\u3002\n\n**\u4E3A\u4EC0\u4E48\u8BFB\u53D6\uFF1F**\n\u4E3A\u4E86\u8BA9 PD \u5728 Codex \u4E0A\u5B8C\u6210\u5B83\u627F\u8BFA\u7684\u95ED\u73AF\uFF1A\u628A\u4F60\u53CD\u590D\u7EA0\u6B63\u7684\u5730\u65B9\u53D8\u6210\u4E00\u6761\u53EF\u5BA1\u67E5\u7684\u539F\u5219\u5019\u9009\u2014\u2014\u4F60\u9700\u8981\u5148\u770B\u5230\u8BC1\u636E\uFF0C\u518D\u51B3\u5B9A\u662F\u5426\u91C7\u7EB3\u3002\u4E0D\u89E3\u6790\u5BF9\u8BDD\uFF0CPD \u5C31\u53EA\u80FD\u7BA1\u5DE5\u5177\uFF0C\u5B66\u4E0D\u5230\u7EA0\u6B63\u3002\n\n**\u4FDD\u5B58\u591A\u5C11\u3001\u591A\u4E45\uFF1F**\n\u6BCF\u4E2A\u4F1A\u8BDD\u53EA\u4FDD\u7559\u6700\u8FD1 32 \u6761\u53EF\u89C1\u6D88\u606F\u3001\u6700\u591A 7 \u5929\uFF08\u5148\u5230\u671F\u5148\u5220\u9664\uFF09\u3002\u5F53\u67D0\u4E2A\u95EE\u9898\u88AB\u6B63\u5F0F\u7ACB\u4E3A pain \u65F6\uFF0C\u624D\u4F1A\u628A\u5B83\u7684\u524D 12 \u6761\u6D88\u606F + \u89E6\u53D1\u70B9 + \u52A9\u624B\u7684\u4E0B\u4E00\u6761\u5B8C\u6574\u56DE\u590D\u5347\u7EA7\u4E3A\u957F\u671F\u6CBB\u7406\u8BC1\u636E\uFF0C\u6309\u73B0\u6709\u6CBB\u7406\u6570\u636E\u7684\u751F\u547D\u5468\u671F\u7BA1\u7406\u3002\u4FDD\u5B58\u7684\u5DE5\u5177\u8BC1\u636E\u5728\u843D\u76D8\u524D\u4F1A\u7ECF\u8FC7\u65E2\u6709\u7684\u654F\u611F\u5B57\u6BB5\u4E0E\u5E38\u89C1\u5BC6\u94A5\u683C\u5F0F\u8131\u654F\uFF1B\u4F46\u8BF7\u6CE8\u610F\uFF1A\u5982\u679C\u4E00\u6BB5\u5BC6\u94A5\u770B\u8D77\u6765\u5C31\u50CF\u666E\u901A\u6587\u5B57\uFF0C\u4EFB\u4F55\u8FC7\u6EE4\u5668\u90FD\u65E0\u6CD5\u8BC6\u522B\u5B83\u2014\u2014\u8BF7\u4E0D\u8981\u8BA9 PD \u89C2\u5BDF\u5305\u542B\u6B64\u7C7B\u5185\u5BB9\u7684\u4F1A\u8BDD\u3002\n\n**\u6570\u636E\u4F1A\u79BB\u5F00\u672C\u673A\u5417\uFF1F**\n\u89C2\u5BDF\u6570\u636E\u672C\u8EAB\u53EA\u5B58\u5728\u672C\u673A\u5DE5\u4F5C\u533A\u3002\u88AB\u5347\u7EA7\u4E3A\u6CBB\u7406\u8BC1\u636E\u7684\u5BF9\u8BDD\u7247\u6BB5\uFF0C\u4F1A\u50CF\u73B0\u6709\u8BCA\u65AD\u6D41\u7A0B\u4E00\u6837\u53D1\u9001\u7ED9\u4F60\u914D\u7F6E\u7684 LLM API \u505A\u8BCA\u65AD\u2014\u2014\u8FD9\u662F\u552F\u4E00\u7684\u5916\u53D1\u8DEF\u5F84\uFF0C\u4E0E OpenClaw \u4E0A\u7684\u73B0\u6709\u884C\u4E3A\u4E00\u81F4\u3002\u4EA7\u54C1\u9065\u6D4B\u4E0D\u5305\u542B\u4EFB\u4F55\u6D88\u606F\u5185\u5BB9\u6216\u4F1A\u8BDD\u6807\u8BC6\u3002\n\n**\u5982\u4F55\u5173\u95ED\uFF1F\u968F\u65F6\u3002**\n\u5173\u95ED\u540E PD \u7ACB\u5373\u505C\u6B62\u8BFB\u53D6 transcript\uFF08\u4E0D\u662F\"\u8BFB\u4E86\u518D\u4E22\u5F03\"\uFF0C\u800C\u662F\u6839\u672C\u4E0D\u6253\u5F00\uFF09\u3002\u5DF2\u6709\u7684\u539F\u5219\u6CE8\u5165\u3001\u5DE5\u5177\u62E6\u622A\u3001\u65E2\u6709\u5DE5\u5177\u8BC1\u636E\u5B8C\u5168\u4E0D\u53D7\u5F71\u54CD\u3002\u5DF2\u4FDD\u5B58\u7684\u5185\u5BB9\u6309\u4E0A\u8FF0\u671F\u9650\u81EA\u7136\u8FC7\u671F\uFF1B\u5347\u7EA7\u8FC7\u7684\u8BC1\u636E\u53EA\u80FD\u7531\u4F60\u901A\u8FC7\u65E2\u6709\u6CBB\u7406\u6E05\u7406\u547D\u4EE4\u663E\u5F0F\u5220\u9664\u3002\u5378\u8F7D\u4E0D\u4F1A\u9759\u9ED8\u5220\u9664\u4EFB\u4F55\u8BC1\u636E\u3002\n\n**\u9ED8\u8BA4\u72B6\u6001\uFF1F**\n\u9ED8\u8BA4\u5173\u95ED\u3002\u53EA\u6709\u4F60\u5728\u770B\u5230\u672C\u8BF4\u660E\u540E\u660E\u786E\u9009\u62E9\u5F00\u542F\u624D\u4F1A\u751F\u6548\uFF1B\u5347\u7EA7 PD \u6C38\u8FDC\u4E0D\u4F1A\u66FF\u4F60\u5F00\u542F\u3002";
|
|
22
|
+
export declare const CODEX_INGESTION_DISCLOSURE_EN = "### Principles Disciple \u2014 Conversation Observation & Governance Closure (Codex)\n\n**What does PD read once enabled?**\nPD reads the Codex session transcripts that Codex explicitly provides to PD inside this workspace. Only visible content enters governance observation: the messages you send, the assistant's visible replies, and the names/inputs/results of tool calls (used to recognize recurring problems). The hidden reasoning process that Codex stores in encrypted form, system/developer prompts, and host-injected environment context present in the same records are recognized and discarded during parsing \u2014 never saved, never written to logs, never sent to the diagnosis model.\n\n**Why read at all?**\nSo that PD can deliver on its promised closed loop on Codex: turning the places you repeatedly correct into a reviewable principle candidate \u2014 you see the evidence first, then decide whether to adopt it. Without parsing conversations, PD can only govern tools and cannot learn your corrections.\n\n**How much is kept, and for how long?**\nPer session, only the most recent 32 visible messages are kept, for at most 7 days (expired first, deleted first). Only when a problem is formally established as a pain are its preceding 12 messages + the trigger point + the assistant's next complete reply promoted into long-term governance evidence, managed under the existing governance data lifecycle. Saved tool evidence passes through the existing sensitive-field and common-secret-format redaction before being written; but note: if a secret looks like ordinary text, no filter can recognize it \u2014 please do not let PD observe sessions containing such content.\n\n**Does data leave this machine?**\nObservation data itself lives only in the local workspace. Conversation fragments promoted into governance evidence are sent to your configured LLM API for diagnosis, exactly like the existing diagnosis flow \u2014 this is the only egress path, consistent with current behavior on OpenClaw. Product telemetry contains no message content and no session identifiers.\n\n**How do I turn it off? Anytime.**\nOnce off, PD immediately stops reading transcripts (not \"read then discard\" \u2014 the transcript is never opened at all). Existing principle injection, tool interception, and existing tool evidence are completely unaffected. Saved content expires naturally per the limits above; promoted evidence can only be deleted explicitly by you through the existing governance cleanup commands. Uninstall never silently deletes any evidence.\n\n**Default state?**\nOff by default. It takes effect only after you explicitly choose to enable it after seeing this disclosure; upgrading PD never enables it for you.";
|
|
23
|
+
export declare function getCodexIngestionDisclosureText(language: CodexIngestionDisclosureLanguage): string;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Codex conversation-ingestion consent disclosure — G2A frozen text (Slice D).
|
|
3
|
+
*
|
|
4
|
+
* The Chinese text below is copied VERBATIM from the Owner-approved decision
|
|
5
|
+
* package:
|
|
6
|
+
* docs/superpowers/specs/2026-08-28-codex-governance-closure-g0-g2a-decision.md
|
|
7
|
+
* § "Frozen consent disclosure text (setup will show this verbatim)"
|
|
8
|
+
*
|
|
9
|
+
* That document is the language SSoT. The frozen text "must not be weakened
|
|
10
|
+
* during implementation without a new Owner decision" — the guard test
|
|
11
|
+
* (codex-disclosure-g2a-guard.test.ts) re-extracts the frozen section from
|
|
12
|
+
* the document and asserts byte equality with this constant, so any drift
|
|
13
|
+
* here fails CI.
|
|
14
|
+
*
|
|
15
|
+
* The English rendering states the same facts; per the G2A binding note it is
|
|
16
|
+
* produced at setup implementation time from the frozen Chinese text. Setup
|
|
17
|
+
* surfaces always present the Chinese SSoT first.
|
|
18
|
+
*/
|
|
19
|
+
export const CODEX_INGESTION_DISCLOSURE_VERSION = 'g2a-2026-08-28';
|
|
20
|
+
export const CODEX_INGESTION_DISCLOSURE_ZH = `### Principles Disciple — 对话观察与治理闭环(Codex)
|
|
21
|
+
|
|
22
|
+
**开启后 PD 会读取什么?**
|
|
23
|
+
读取本工作区内 Codex 明确提供给 PD 的会话记录(transcript)。进入治理观察的只有可见内容:你发出的消息、助手的可见回复、以及工具调用的名称/输入/结果(用于识别反复出现的问题)。记录中同时存在的隐藏思考过程(Codex 以加密形式保存)、系统/开发者提示词、宿主注入的环境上下文,会在解析时被识别并丢弃——不会被保存、不会进入日志、不会发送给诊断模型。
|
|
24
|
+
|
|
25
|
+
**为什么读取?**
|
|
26
|
+
为了让 PD 在 Codex 上完成它承诺的闭环:把你反复纠正的地方变成一条可审查的原则候选——你需要先看到证据,再决定是否采纳。不解析对话,PD 就只能管工具,学不到纠正。
|
|
27
|
+
|
|
28
|
+
**保存多少、多久?**
|
|
29
|
+
每个会话只保留最近 32 条可见消息、最多 7 天(先到期先删除)。当某个问题被正式立为 pain 时,才会把它的前 12 条消息 + 触发点 + 助手的下一条完整回复升级为长期治理证据,按现有治理数据的生命周期管理。保存的工具证据在落盘前会经过既有的敏感字段与常见密钥格式脱敏;但请注意:如果一段密钥看起来就像普通文字,任何过滤器都无法识别它——请不要让 PD 观察包含此类内容的会话。
|
|
30
|
+
|
|
31
|
+
**数据会离开本机吗?**
|
|
32
|
+
观察数据本身只存在本机工作区。被升级为治理证据的对话片段,会像现有诊断流程一样发送给你配置的 LLM API 做诊断——这是唯一的外发路径,与 OpenClaw 上的现有行为一致。产品遥测不包含任何消息内容或会话标识。
|
|
33
|
+
|
|
34
|
+
**如何关闭?随时。**
|
|
35
|
+
关闭后 PD 立即停止读取 transcript(不是"读了再丢弃",而是根本不打开)。已有的原则注入、工具拦截、既有工具证据完全不受影响。已保存的内容按上述期限自然过期;升级过的证据只能由你通过既有治理清理命令显式删除。卸载不会静默删除任何证据。
|
|
36
|
+
|
|
37
|
+
**默认状态?**
|
|
38
|
+
默认关闭。只有你在看到本说明后明确选择开启才会生效;升级 PD 永远不会替你开启。`;
|
|
39
|
+
export const CODEX_INGESTION_DISCLOSURE_EN = `### Principles Disciple — Conversation Observation & Governance Closure (Codex)
|
|
40
|
+
|
|
41
|
+
**What does PD read once enabled?**
|
|
42
|
+
PD reads the Codex session transcripts that Codex explicitly provides to PD inside this workspace. Only visible content enters governance observation: the messages you send, the assistant's visible replies, and the names/inputs/results of tool calls (used to recognize recurring problems). The hidden reasoning process that Codex stores in encrypted form, system/developer prompts, and host-injected environment context present in the same records are recognized and discarded during parsing — never saved, never written to logs, never sent to the diagnosis model.
|
|
43
|
+
|
|
44
|
+
**Why read at all?**
|
|
45
|
+
So that PD can deliver on its promised closed loop on Codex: turning the places you repeatedly correct into a reviewable principle candidate — you see the evidence first, then decide whether to adopt it. Without parsing conversations, PD can only govern tools and cannot learn your corrections.
|
|
46
|
+
|
|
47
|
+
**How much is kept, and for how long?**
|
|
48
|
+
Per session, only the most recent 32 visible messages are kept, for at most 7 days (expired first, deleted first). Only when a problem is formally established as a pain are its preceding 12 messages + the trigger point + the assistant's next complete reply promoted into long-term governance evidence, managed under the existing governance data lifecycle. Saved tool evidence passes through the existing sensitive-field and common-secret-format redaction before being written; but note: if a secret looks like ordinary text, no filter can recognize it — please do not let PD observe sessions containing such content.
|
|
49
|
+
|
|
50
|
+
**Does data leave this machine?**
|
|
51
|
+
Observation data itself lives only in the local workspace. Conversation fragments promoted into governance evidence are sent to your configured LLM API for diagnosis, exactly like the existing diagnosis flow — this is the only egress path, consistent with current behavior on OpenClaw. Product telemetry contains no message content and no session identifiers.
|
|
52
|
+
|
|
53
|
+
**How do I turn it off? Anytime.**
|
|
54
|
+
Once off, PD immediately stops reading transcripts (not "read then discard" — the transcript is never opened at all). Existing principle injection, tool interception, and existing tool evidence are completely unaffected. Saved content expires naturally per the limits above; promoted evidence can only be deleted explicitly by you through the existing governance cleanup commands. Uninstall never silently deletes any evidence.
|
|
55
|
+
|
|
56
|
+
**Default state?**
|
|
57
|
+
Off by default. It takes effect only after you explicitly choose to enable it after seeing this disclosure; upgrading PD never enables it for you.`;
|
|
58
|
+
export function getCodexIngestionDisclosureText(language) {
|
|
59
|
+
return language === 'en' ? CODEX_INGESTION_DISCLOSURE_EN : CODEX_INGESTION_DISCLOSURE_ZH;
|
|
60
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Codex conversation-ingestion consent store — Codex Governance Closure
|
|
3
|
+
* Slice D (SPEC rev 2 §17; G2A frozen disclosure).
|
|
4
|
+
*
|
|
5
|
+
* Persists the Owner's recorded consent decision for enabling
|
|
6
|
+
* `codex_conversation_ingestion` in ONE workspace to
|
|
7
|
+
* `<workspace>/.pd/codex-ingestion-consent.json`.
|
|
8
|
+
*
|
|
9
|
+
* Authority model (P4): the FEATURE FLAG stays the runtime authority for
|
|
10
|
+
* whether ingestion runs (the hook gate reads only the flag — consent never
|
|
11
|
+
* sits on the hot path). This store is the GOVERNANCE RECORD that the flag
|
|
12
|
+
* may only be enabled THROUGH the disclosed consent flow (G2A); health uses
|
|
13
|
+
* it to report consent state and to flag `flag_on_without_grant` as a
|
|
14
|
+
* governance warning. Declining must never flip the flag off by side effect
|
|
15
|
+
* — the setup flow owns that ordering, not this store.
|
|
16
|
+
*
|
|
17
|
+
* Scope: per-workspace (the flag and the transcripts it gates are
|
|
18
|
+
* workspace-scoped). This file is consent control state — it never contains
|
|
19
|
+
* any captured conversation text (SPEC §15 "consent state without displaying
|
|
20
|
+
* captured text").
|
|
21
|
+
*
|
|
22
|
+
* Patterns mirror the product-telemetry consent store: missing file is the
|
|
23
|
+
* normal never-asked case; a malformed file fails loud (rc-3/rc-9) because
|
|
24
|
+
* silently treating it as "never asked" could re-prompt against a recorded
|
|
25
|
+
* Owner decision; writes are atomic (temp + rename); unknown/malformed
|
|
26
|
+
* fields are rejected via guards, never `as` (rc-1/rc-2/rc-5).
|
|
27
|
+
*/
|
|
28
|
+
export declare const CODEX_INGESTION_CONSENT_FILENAME = "codex-ingestion-consent.json";
|
|
29
|
+
export declare const CODEX_INGESTION_CONSENT_SCHEMA_VERSION = "2";
|
|
30
|
+
/**
|
|
31
|
+
* Consent transition states (review round 2, governance consistency):
|
|
32
|
+
*
|
|
33
|
+
* absent ──(disclosure shown, explicit decision)──▶ pending
|
|
34
|
+
* pending ──(flag enabled successfully)───────────▶ granted
|
|
35
|
+
* pending ──(declined / flag regularized off)─────▶ revoked
|
|
36
|
+
* pending ──(flag enable failed)──────────────────▶ failed (with reason)
|
|
37
|
+
* granted ──(explicit decline)────────────────────▶ revoked
|
|
38
|
+
*
|
|
39
|
+
* `granted` is only ever recorded AFTER the runtime flag activation has
|
|
40
|
+
* succeeded — consent can never become granted before activation, and a
|
|
41
|
+
* failed activation leaves an EXPLAINED `failed` state (reason + nextAction),
|
|
42
|
+
* never a silent granted/disabled mismatch. The flag remains the runtime
|
|
43
|
+
* authority; this record is the governance state machine that makes every
|
|
44
|
+
* observed flag/consent combination interpretable.
|
|
45
|
+
*/
|
|
46
|
+
export type CodexIngestionConsentDecision = 'pending' | 'granted' | 'revoked' | 'failed';
|
|
47
|
+
export type CodexIngestionConsentDecidedVia = 'pd_codex_setup' | 'codex_plugin_setup';
|
|
48
|
+
export interface CodexIngestionConsentRecord {
|
|
49
|
+
decision: CodexIngestionConsentDecision;
|
|
50
|
+
disclosureVersion: string;
|
|
51
|
+
decidedAt: string;
|
|
52
|
+
decidedVia: CodexIngestionConsentDecidedVia;
|
|
53
|
+
/** Populated when decision='failed': why the flag activation did not land. */
|
|
54
|
+
failureReason?: string;
|
|
55
|
+
schemaVersion: string;
|
|
56
|
+
}
|
|
57
|
+
export type CodexIngestionConsentRead = {
|
|
58
|
+
ok: true;
|
|
59
|
+
existed: boolean;
|
|
60
|
+
record: CodexIngestionConsentRecord | null;
|
|
61
|
+
} | {
|
|
62
|
+
ok: false;
|
|
63
|
+
reason: string;
|
|
64
|
+
nextAction: string;
|
|
65
|
+
};
|
|
66
|
+
export type CodexIngestionConsentWrite = {
|
|
67
|
+
ok: true;
|
|
68
|
+
record: CodexIngestionConsentRecord;
|
|
69
|
+
} | {
|
|
70
|
+
ok: false;
|
|
71
|
+
reason: string;
|
|
72
|
+
nextAction: string;
|
|
73
|
+
};
|
|
74
|
+
/** Health-surface consent state (SPEC §15). No captured text, ever. */
|
|
75
|
+
export type CodexIngestionConsentState = 'granted' | 'revoked' | 'pending' | 'failed' | 'not_present' | 'flag_on_without_grant';
|
|
76
|
+
export declare function getCodexIngestionConsentPath(workspaceDir: string): string;
|
|
77
|
+
/**
|
|
78
|
+
* Read the consent record. ENOENT is the normal never-asked case
|
|
79
|
+
* (existed=false, record=null). Anything unreadable/malformed fails loud —
|
|
80
|
+
* degrading to "never asked" could re-prompt or re-enable against the
|
|
81
|
+
* Owner's recorded decision.
|
|
82
|
+
*/
|
|
83
|
+
export declare function readCodexIngestionConsent(workspaceDir: string): CodexIngestionConsentRead;
|
|
84
|
+
/**
|
|
85
|
+
* Record an explicit consent decision made AFTER the disclosure was
|
|
86
|
+
* presented (the setup flow presents the frozen text before calling this).
|
|
87
|
+
* The flag itself is intentionally untouched — enabling it is the setup
|
|
88
|
+
* flow's explicit, ordered step.
|
|
89
|
+
*/
|
|
90
|
+
export declare function recordCodexIngestionConsent(workspaceDir: string, input: {
|
|
91
|
+
decision: CodexIngestionConsentDecision;
|
|
92
|
+
decidedVia: CodexIngestionConsentDecidedVia;
|
|
93
|
+
decidedAt?: string;
|
|
94
|
+
failureReason?: string;
|
|
95
|
+
}): CodexIngestionConsentWrite;
|
|
96
|
+
/**
|
|
97
|
+
* Combine the consent record with the ingestion flag into the health-surface
|
|
98
|
+
* state (SPEC §15). Every flag×record combination maps to exactly one
|
|
99
|
+
* interpretable state — none of them reads as silently healthy:
|
|
100
|
+
*
|
|
101
|
+
* record granted + flag any → 'granted' (activation succeeded)
|
|
102
|
+
* record revoked + flag any → 'revoked' (Owner said no; flag-off
|
|
103
|
+
* path also regularizes the flag)
|
|
104
|
+
* record failed + flag any → 'failed' (activation did not land;
|
|
105
|
+
* failureReason explains why)
|
|
106
|
+
* record pending + flag off → 'pending' (decision recorded, activation not yet applied)
|
|
107
|
+
* record pending + flag on → 'pending' (activation applied, terminal write pending)
|
|
108
|
+
* no record + flag on → 'flag_on_without_grant' (governance warning)
|
|
109
|
+
* no record + flag off → 'not_present'
|
|
110
|
+
*/
|
|
111
|
+
export declare function deriveCodexIngestionConsentState(record: CodexIngestionConsentRecord | null, ingestionFlagEnabled: boolean): CodexIngestionConsentState;
|