@haaaiawd/second-nature 0.1.1 → 0.1.2
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/index.ts +64 -21
- package/package.json +8 -2
- package/runtime/cli/action-bridge.d.ts +11 -0
- package/runtime/cli/action-bridge.js +27 -0
- package/runtime/cli/commands/credential.d.ts +2 -0
- package/runtime/cli/commands/credential.js +40 -0
- package/runtime/cli/commands/index.d.ts +12 -0
- package/runtime/cli/commands/index.js +138 -0
- package/runtime/cli/commands/policy.d.ts +12 -0
- package/runtime/cli/commands/policy.js +43 -0
- package/runtime/cli/explain/format-explanation.d.ts +10 -0
- package/runtime/cli/explain/format-explanation.js +10 -0
- package/runtime/cli/explain/resolve-subject.d.ts +2 -0
- package/runtime/cli/explain/resolve-subject.js +26 -0
- package/runtime/cli/index.d.ts +25 -0
- package/runtime/cli/index.js +36 -0
- package/runtime/cli/read-models/index.d.ts +20 -0
- package/runtime/cli/read-models/index.js +161 -0
- package/runtime/cli/read-models/types.d.ts +75 -0
- package/runtime/cli/read-models/types.js +1 -0
- package/runtime/connectors/agent-network/evomap/adapter.d.ts +23 -0
- package/runtime/connectors/agent-network/evomap/adapter.js +69 -0
- package/runtime/connectors/agent-network/evomap/index.d.ts +2 -0
- package/runtime/connectors/agent-network/evomap/index.js +2 -0
- package/runtime/connectors/agent-network/evomap/manifest.d.ts +2 -0
- package/runtime/connectors/agent-network/evomap/manifest.js +7 -0
- package/runtime/connectors/base/channel-health.d.ts +29 -0
- package/runtime/connectors/base/channel-health.js +23 -0
- package/runtime/connectors/base/contract.d.ts +81 -0
- package/runtime/connectors/base/contract.js +71 -0
- package/runtime/connectors/base/failure-taxonomy.d.ts +13 -0
- package/runtime/connectors/base/failure-taxonomy.js +105 -0
- package/runtime/connectors/base/index.d.ts +6 -0
- package/runtime/connectors/base/index.js +6 -0
- package/runtime/connectors/base/manifest.d.ts +11 -0
- package/runtime/connectors/base/manifest.js +36 -0
- package/runtime/connectors/base/policy-layer.d.ts +27 -0
- package/runtime/connectors/base/policy-layer.js +213 -0
- package/runtime/connectors/base/route-planner.d.ts +10 -0
- package/runtime/connectors/base/route-planner.js +98 -0
- package/runtime/connectors/index.d.ts +4 -0
- package/runtime/connectors/index.js +4 -0
- package/runtime/connectors/social-community/instreet/adapter.d.ts +32 -0
- package/runtime/connectors/social-community/instreet/adapter.js +79 -0
- package/runtime/connectors/social-community/instreet/index.d.ts +2 -0
- package/runtime/connectors/social-community/instreet/index.js +2 -0
- package/runtime/connectors/social-community/instreet/manifest.d.ts +2 -0
- package/runtime/connectors/social-community/instreet/manifest.js +7 -0
- package/runtime/connectors/social-community/moltbook/adapter.d.ts +15 -0
- package/runtime/connectors/social-community/moltbook/adapter.js +48 -0
- package/runtime/connectors/social-community/moltbook/index.d.ts +2 -0
- package/runtime/connectors/social-community/moltbook/index.js +2 -0
- package/runtime/connectors/social-community/moltbook/manifest.d.ts +7 -0
- package/runtime/connectors/social-community/moltbook/manifest.js +12 -0
- package/runtime/core/second-nature/guidance/apply-guidance.d.ts +10 -0
- package/runtime/core/second-nature/guidance/apply-guidance.js +10 -0
- package/runtime/core/second-nature/guidance/request-guidance.d.ts +18 -0
- package/runtime/core/second-nature/guidance/request-guidance.js +22 -0
- package/runtime/core/second-nature/index.d.ts +14 -0
- package/runtime/core/second-nature/index.js +14 -0
- package/runtime/core/second-nature/orchestrator/effect-dispatcher.d.ts +100 -0
- package/runtime/core/second-nature/orchestrator/effect-dispatcher.js +139 -0
- package/runtime/core/second-nature/orchestrator/guard-layer.d.ts +2 -0
- package/runtime/core/second-nature/orchestrator/guard-layer.js +54 -0
- package/runtime/core/second-nature/orchestrator/intent-planner.d.ts +3 -0
- package/runtime/core/second-nature/orchestrator/intent-planner.js +92 -0
- package/runtime/core/second-nature/orchestrator/lease-manager.d.ts +14 -0
- package/runtime/core/second-nature/orchestrator/lease-manager.js +58 -0
- package/runtime/core/second-nature/orchestrator/resume-from-checkpoint.d.ts +32 -0
- package/runtime/core/second-nature/orchestrator/resume-from-checkpoint.js +23 -0
- package/runtime/core/second-nature/outreach/build-message.d.ts +16 -0
- package/runtime/core/second-nature/outreach/build-message.js +27 -0
- package/runtime/core/second-nature/outreach/evaluate-outreach.d.ts +13 -0
- package/runtime/core/second-nature/outreach/evaluate-outreach.js +41 -0
- package/runtime/core/second-nature/quiet/quiet-pipeline.d.ts +34 -0
- package/runtime/core/second-nature/quiet/quiet-pipeline.js +35 -0
- package/runtime/core/second-nature/reflection/run-narrative-reflection.d.ts +39 -0
- package/runtime/core/second-nature/reflection/run-narrative-reflection.js +29 -0
- package/runtime/core/second-nature/rhythm/rhythm-policy.d.ts +18 -0
- package/runtime/core/second-nature/rhythm/rhythm-policy.js +24 -0
- package/runtime/core/second-nature/rhythm/select-window.d.ts +3 -0
- package/runtime/core/second-nature/rhythm/select-window.js +50 -0
- package/runtime/core/second-nature/runtime/lifecycle-service.d.ts +26 -0
- package/runtime/core/second-nature/runtime/lifecycle-service.js +38 -0
- package/runtime/core/second-nature/runtime/service-entry.d.ts +36 -0
- package/runtime/core/second-nature/runtime/service-entry.js +44 -0
- package/runtime/core/second-nature/types.d.ts +37 -0
- package/runtime/core/second-nature/types.js +1 -0
- package/runtime/guidance/contracts.d.ts +48 -0
- package/runtime/guidance/contracts.js +54 -0
- package/runtime/guidance/fallback.d.ts +2 -0
- package/runtime/guidance/fallback.js +17 -0
- package/runtime/guidance/guidance-assembler.d.ts +5 -0
- package/runtime/guidance/guidance-assembler.js +62 -0
- package/runtime/guidance/index.d.ts +8 -0
- package/runtime/guidance/index.js +8 -0
- package/runtime/guidance/output-guard.d.ts +10 -0
- package/runtime/guidance/output-guard.js +29 -0
- package/runtime/guidance/persona-selection.d.ts +11 -0
- package/runtime/guidance/persona-selection.js +90 -0
- package/runtime/guidance/review-workflow.d.ts +15 -0
- package/runtime/guidance/review-workflow.js +60 -0
- package/runtime/guidance/template-registry.d.ts +3 -0
- package/runtime/guidance/template-registry.js +45 -0
- package/runtime/guidance/types.d.ts +72 -0
- package/runtime/guidance/types.js +1 -0
- package/runtime/observability/db/index.d.ts +10 -0
- package/runtime/observability/db/index.js +17 -0
- package/runtime/observability/db/schema/index.d.ts +946 -0
- package/runtime/observability/db/schema/index.js +70 -0
- package/runtime/observability/index.d.ts +12 -0
- package/runtime/observability/index.js +11 -0
- package/runtime/observability/projections/guidance-audit.d.ts +16 -0
- package/runtime/observability/projections/guidance-audit.js +35 -0
- package/runtime/observability/projections/outreach-quality-audit.d.ts +15 -0
- package/runtime/observability/projections/outreach-quality-audit.js +9 -0
- package/runtime/observability/projections/reflection-audit.d.ts +17 -0
- package/runtime/observability/projections/reflection-audit.js +9 -0
- package/runtime/observability/query/compose-evidence.d.ts +56 -0
- package/runtime/observability/query/compose-evidence.js +43 -0
- package/runtime/observability/query/evidence-query-engine.d.ts +17 -0
- package/runtime/observability/query/evidence-query-engine.js +166 -0
- package/runtime/observability/redaction/manifest.d.ts +18 -0
- package/runtime/observability/redaction/manifest.js +109 -0
- package/runtime/observability/redaction/policy.d.ts +19 -0
- package/runtime/observability/redaction/policy.js +71 -0
- package/runtime/observability/services/decision-ledger.d.ts +33 -0
- package/runtime/observability/services/decision-ledger.js +115 -0
- package/runtime/observability/services/execution-telemetry.d.ts +32 -0
- package/runtime/observability/services/execution-telemetry.js +126 -0
- package/runtime/observability/services/governance-audit.d.ts +27 -0
- package/runtime/observability/services/governance-audit.js +139 -0
- package/runtime/observability/services/redaction-store.d.ts +3 -0
- package/runtime/observability/services/redaction-store.js +20 -0
- package/runtime/shared/types/continuity.d.ts +69 -0
- package/runtime/shared/types/continuity.js +1 -0
- package/runtime/shared/types/credential.d.ts +22 -0
- package/runtime/shared/types/credential.js +1 -0
- package/runtime/shared/types/index.d.ts +3 -0
- package/runtime/shared/types/index.js +3 -0
- package/runtime/shared/types/outreach.d.ts +19 -0
- package/runtime/shared/types/outreach.js +1 -0
- package/runtime/storage/bootstrap/repair.d.ts +3 -0
- package/runtime/storage/bootstrap/repair.js +5 -0
- package/runtime/storage/db/index.d.ts +10 -0
- package/runtime/storage/db/index.js +17 -0
- package/runtime/storage/db/schema/assets.d.ts +140 -0
- package/runtime/storage/db/schema/assets.js +10 -0
- package/runtime/storage/db/schema/credentials.d.ts +178 -0
- package/runtime/storage/db/schema/credentials.js +12 -0
- package/runtime/storage/db/schema/index.d.ts +6 -0
- package/runtime/storage/db/schema/index.js +6 -0
- package/runtime/storage/db/schema/intent-commits.d.ts +161 -0
- package/runtime/storage/db/schema/intent-commits.js +11 -0
- package/runtime/storage/db/schema/policies.d.ts +81 -0
- package/runtime/storage/db/schema/policies.js +7 -0
- package/runtime/storage/db/schema/proposals.d.ts +216 -0
- package/runtime/storage/db/schema/proposals.js +14 -0
- package/runtime/storage/db/schema/provenance.d.ts +104 -0
- package/runtime/storage/db/schema/provenance.js +8 -0
- package/runtime/storage/index.d.ts +16 -0
- package/runtime/storage/index.js +16 -0
- package/runtime/storage/memory/workspace/paths.d.ts +62 -0
- package/runtime/storage/memory/workspace/paths.js +160 -0
- package/runtime/storage/memory/workspace/store.d.ts +26 -0
- package/runtime/storage/memory/workspace/store.js +153 -0
- package/runtime/storage/memory/workspace/types.d.ts +45 -0
- package/runtime/storage/memory/workspace/types.js +1 -0
- package/runtime/storage/repositories/asset-repository.d.ts +8 -0
- package/runtime/storage/repositories/asset-repository.js +19 -0
- package/runtime/storage/repositories/credential-repository.d.ts +8 -0
- package/runtime/storage/repositories/credential-repository.js +19 -0
- package/runtime/storage/repositories/index.d.ts +6 -0
- package/runtime/storage/repositories/index.js +6 -0
- package/runtime/storage/repositories/intent-commit-repository.d.ts +10 -0
- package/runtime/storage/repositories/intent-commit-repository.js +35 -0
- package/runtime/storage/repositories/policy-repository.d.ts +8 -0
- package/runtime/storage/repositories/policy-repository.js +19 -0
- package/runtime/storage/repositories/proposal-repository.d.ts +9 -0
- package/runtime/storage/repositories/proposal-repository.js +26 -0
- package/runtime/storage/repositories/provenance-repository.d.ts +20 -0
- package/runtime/storage/repositories/provenance-repository.js +41 -0
- package/runtime/storage/services/credential-vault.d.ts +8 -0
- package/runtime/storage/services/credential-vault.js +78 -0
- package/runtime/storage/services/daily-log-pipeline.d.ts +47 -0
- package/runtime/storage/services/daily-log-pipeline.js +86 -0
- package/runtime/storage/services/effect-commit-store.d.ts +11 -0
- package/runtime/storage/services/effect-commit-store.js +93 -0
- package/runtime/storage/services/governance-layer.d.ts +40 -0
- package/runtime/storage/services/governance-layer.js +103 -0
- package/runtime/storage/services/persona-candidate-loader.d.ts +5 -0
- package/runtime/storage/services/persona-candidate-loader.js +41 -0
- package/runtime/storage/services/provenance-service.d.ts +40 -0
- package/runtime/storage/services/provenance-service.js +43 -0
- package/runtime/storage/services/quiet-input-loader.d.ts +40 -0
- package/runtime/storage/services/quiet-input-loader.js +131 -0
- package/runtime/storage/services/repair-and-backup.d.ts +22 -0
- package/runtime/storage/services/repair-and-backup.js +73 -0
- package/runtime/storage/state-api.d.ts +46 -0
- package/runtime/storage/state-api.js +73 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { integer, sqliteTable, text, uniqueIndex, index } from "drizzle-orm/sqlite-core";
|
|
2
|
+
export const decisionLedger = sqliteTable("decision_ledger", {
|
|
3
|
+
id: text("id").primaryKey(),
|
|
4
|
+
tickId: text("tick_id").notNull(),
|
|
5
|
+
traceId: text("trace_id").notNull(),
|
|
6
|
+
intentId: text("intent_id"),
|
|
7
|
+
platformId: text("platform_id"),
|
|
8
|
+
verdict: text("verdict").notNull(),
|
|
9
|
+
mode: text("mode").notNull(),
|
|
10
|
+
reasons: text("reasons").notNull(),
|
|
11
|
+
reasonCodes: text("reason_codes").notNull(),
|
|
12
|
+
decisionBasis: text("decision_basis").notNull(),
|
|
13
|
+
evidenceRefs: text("evidence_refs").notNull(),
|
|
14
|
+
modelEvalRef: text("model_eval_ref"),
|
|
15
|
+
createdAt: text("created_at").notNull(),
|
|
16
|
+
}, (table) => [
|
|
17
|
+
index("decision_tick_idx").on(table.tickId),
|
|
18
|
+
uniqueIndex("decision_trace_idx").on(table.traceId),
|
|
19
|
+
]);
|
|
20
|
+
export const executionAttempts = sqliteTable("execution_attempts", {
|
|
21
|
+
id: text("id").primaryKey(),
|
|
22
|
+
traceId: text("trace_id").notNull(),
|
|
23
|
+
decisionId: text("decision_id").notNull(),
|
|
24
|
+
intentId: text("intent_id").notNull(),
|
|
25
|
+
platformId: text("platform_id").notNull(),
|
|
26
|
+
capability: text("capability").notNull(),
|
|
27
|
+
channel: text("channel").notNull(),
|
|
28
|
+
status: text("status").notNull(),
|
|
29
|
+
commitState: text("commit_state"),
|
|
30
|
+
failureClass: text("failure_class"),
|
|
31
|
+
retryPolicy: text("retry_policy"),
|
|
32
|
+
idempotencyKey: text("idempotency_key"),
|
|
33
|
+
startedAt: text("started_at"),
|
|
34
|
+
finishedAt: text("finished_at"),
|
|
35
|
+
}, (table) => [
|
|
36
|
+
uniqueIndex("attempt_trace_idx").on(table.traceId),
|
|
37
|
+
index("attempt_decision_idx").on(table.decisionId),
|
|
38
|
+
index("attempt_platform_idx").on(table.platformId),
|
|
39
|
+
]);
|
|
40
|
+
export const governanceAudit = sqliteTable("governance_audit", {
|
|
41
|
+
id: text("id").primaryKey(),
|
|
42
|
+
eventType: text("event_type").notNull(),
|
|
43
|
+
proposalId: text("proposal_id"),
|
|
44
|
+
targetAssetId: text("target_asset_id"),
|
|
45
|
+
assetPath: text("asset_path"),
|
|
46
|
+
statusFrom: text("status_from"),
|
|
47
|
+
statusTo: text("status_to").notNull(),
|
|
48
|
+
beforeHash: text("before_hash"),
|
|
49
|
+
afterHash: text("after_hash"),
|
|
50
|
+
supportingSources: text("supporting_sources"),
|
|
51
|
+
reason: text("reason"),
|
|
52
|
+
verificationDeadline: text("verification_deadline"),
|
|
53
|
+
attemptsRemaining: integer("attempts_remaining"),
|
|
54
|
+
createdAt: text("created_at").notNull(),
|
|
55
|
+
}, (table) => [
|
|
56
|
+
index("audit_proposal_idx").on(table.proposalId),
|
|
57
|
+
index("audit_asset_idx").on(table.targetAssetId),
|
|
58
|
+
index("audit_event_idx").on(table.eventType),
|
|
59
|
+
]);
|
|
60
|
+
export const redactionManifest = sqliteTable("redaction_manifest", {
|
|
61
|
+
id: text("id").primaryKey(),
|
|
62
|
+
eventId: text("event_id").notNull(),
|
|
63
|
+
eventType: text("event_type").notNull(),
|
|
64
|
+
fieldName: text("field_name").notNull(),
|
|
65
|
+
action: text("action").notNull(),
|
|
66
|
+
originalValueHash: text("original_value_hash"),
|
|
67
|
+
createdAt: text("created_at").notNull(),
|
|
68
|
+
}, (table) => [
|
|
69
|
+
index("redact_event_idx").on(table.eventId),
|
|
70
|
+
]);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { createObservabilityDatabase, type ObservabilityDatabase } from "./db/index.js";
|
|
2
|
+
export * as obsSchema from "./db/schema/index.js";
|
|
3
|
+
export { REDACTION_CONFIG, DEFAULT_REDACTION_POLICY, getFieldRedactionRule, type RedactionPolicy, type RedactionRule, type SensitivityLevel, } from "./redaction/policy.js";
|
|
4
|
+
export { redactEvent, createEmptyManifest, mergeManifests, type RedactionManifest, type RedactionResult, } from "./redaction/manifest.js";
|
|
5
|
+
export { DecisionLedger, type QuietLifecycleEvent, type OutreachDecision } from "./services/decision-ledger.js";
|
|
6
|
+
export { GovernanceAudit, type CredentialLifecycleAudit } from "./services/governance-audit.js";
|
|
7
|
+
export { ExecutionTelemetry, type ExecutionAttemptInput } from "./services/execution-telemetry.js";
|
|
8
|
+
export { EvidenceQueryEngine, } from "./query/evidence-query-engine.js";
|
|
9
|
+
export type { EvidenceQuery, EvidenceBundle, EvidenceResolutionPlan, GovernanceEvidenceRecord, ResolvedContentRef, ExplanationCapsule, } from "./query/compose-evidence.js";
|
|
10
|
+
export { projectReflectionAudit, type ReflectionAudit, type ReflectionAuditProjection, } from "./projections/reflection-audit.js";
|
|
11
|
+
export { projectOutreachQualityAudit, type OutreachQualityAudit, type OutreachQualityProjection, } from "./projections/outreach-quality-audit.js";
|
|
12
|
+
export { projectGuidanceParticipationAudit, type GuidanceParticipationAudit, type GuidanceParticipationProjection, } from "./projections/guidance-audit.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { createObservabilityDatabase } from "./db/index.js";
|
|
2
|
+
export * as obsSchema from "./db/schema/index.js";
|
|
3
|
+
export { REDACTION_CONFIG, DEFAULT_REDACTION_POLICY, getFieldRedactionRule, } from "./redaction/policy.js";
|
|
4
|
+
export { redactEvent, createEmptyManifest, mergeManifests, } from "./redaction/manifest.js";
|
|
5
|
+
export { DecisionLedger } from "./services/decision-ledger.js";
|
|
6
|
+
export { GovernanceAudit } from "./services/governance-audit.js";
|
|
7
|
+
export { ExecutionTelemetry } from "./services/execution-telemetry.js";
|
|
8
|
+
export { EvidenceQueryEngine, } from "./query/evidence-query-engine.js";
|
|
9
|
+
export { projectReflectionAudit, } from "./projections/reflection-audit.js";
|
|
10
|
+
export { projectOutreachQualityAudit, } from "./projections/outreach-quality-audit.js";
|
|
11
|
+
export { projectGuidanceParticipationAudit, } from "./projections/guidance-audit.js";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { GuidancePayload, GuidanceUnavailable, SceneContext } from "../../guidance/types.js";
|
|
2
|
+
export interface GuidanceParticipationAudit {
|
|
3
|
+
id: string;
|
|
4
|
+
sceneContext: SceneContext;
|
|
5
|
+
payload: GuidancePayload | GuidanceUnavailable;
|
|
6
|
+
usedFallback: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface GuidanceParticipationProjection {
|
|
9
|
+
eventId: string;
|
|
10
|
+
sceneType: SceneContext["sceneType"];
|
|
11
|
+
usedFallback: boolean;
|
|
12
|
+
guidanceAvailable: boolean;
|
|
13
|
+
blockSummary: string[];
|
|
14
|
+
snippetRationales: string[];
|
|
15
|
+
}
|
|
16
|
+
export declare function projectGuidanceParticipationAudit(input: GuidanceParticipationAudit): GuidanceParticipationProjection;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
function summarizePayloadBlocks(payload) {
|
|
2
|
+
if ("available" in payload) {
|
|
3
|
+
return [`unavailable:${payload.reason}`];
|
|
4
|
+
}
|
|
5
|
+
const blocks = [];
|
|
6
|
+
if (payload.atmosphere) {
|
|
7
|
+
blocks.push("atmosphere");
|
|
8
|
+
}
|
|
9
|
+
if (payload.impulses.length > 0) {
|
|
10
|
+
blocks.push(...payload.impulses.map((item) => `impulse:${item.kind}`));
|
|
11
|
+
}
|
|
12
|
+
if (payload.personaReinforcement.length > 0) {
|
|
13
|
+
blocks.push(`persona:${payload.personaReinforcement.length}`);
|
|
14
|
+
}
|
|
15
|
+
if (payload.outputGuard) {
|
|
16
|
+
blocks.push("output_guard");
|
|
17
|
+
}
|
|
18
|
+
return blocks;
|
|
19
|
+
}
|
|
20
|
+
function summarizeRationales(payload) {
|
|
21
|
+
if ("available" in payload) {
|
|
22
|
+
return [];
|
|
23
|
+
}
|
|
24
|
+
return payload.personaReinforcement.map((item) => item.rationale);
|
|
25
|
+
}
|
|
26
|
+
export function projectGuidanceParticipationAudit(input) {
|
|
27
|
+
return {
|
|
28
|
+
eventId: input.id,
|
|
29
|
+
sceneType: input.sceneContext.sceneType,
|
|
30
|
+
usedFallback: input.usedFallback,
|
|
31
|
+
guidanceAvailable: !(("available" in input.payload) && input.payload.available === false),
|
|
32
|
+
blockSummary: summarizePayloadBlocks(input.payload),
|
|
33
|
+
snippetRationales: summarizeRationales(input.payload),
|
|
34
|
+
};
|
|
35
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface OutreachQualityAudit {
|
|
2
|
+
id: string;
|
|
3
|
+
valueScore: number;
|
|
4
|
+
noveltyScore: number;
|
|
5
|
+
requiredUserAction: boolean;
|
|
6
|
+
suppressionReason?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface OutreachQualityProjection {
|
|
9
|
+
eventId: string;
|
|
10
|
+
valueScore: number;
|
|
11
|
+
noveltyScore: number;
|
|
12
|
+
requiredUserAction: boolean;
|
|
13
|
+
suppressionReason?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function projectOutreachQualityAudit(input: OutreachQualityAudit): OutreachQualityProjection;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface ReflectionAudit {
|
|
2
|
+
id: string;
|
|
3
|
+
modelEvalRef?: string;
|
|
4
|
+
claimCount: number;
|
|
5
|
+
unsupportedClaimCount: number;
|
|
6
|
+
sourceCoverageRatio: number;
|
|
7
|
+
reflectionDebt?: number;
|
|
8
|
+
starved?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface ReflectionAuditProjection {
|
|
11
|
+
eventId: string;
|
|
12
|
+
unsupportedClaimCount: number;
|
|
13
|
+
sourceCoverageRatio: number;
|
|
14
|
+
claimCount: number;
|
|
15
|
+
modelEvalRef?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function projectReflectionAudit(input: ReflectionAudit): ReflectionAuditProjection;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { DecisionRecord, ExecutionAttempt } from "../../shared/types/continuity.js";
|
|
2
|
+
export interface GovernanceEvidenceRecord {
|
|
3
|
+
id: string;
|
|
4
|
+
eventType: string;
|
|
5
|
+
proposalId?: string;
|
|
6
|
+
targetAssetId?: string;
|
|
7
|
+
assetPath?: string;
|
|
8
|
+
statusFrom?: string;
|
|
9
|
+
statusTo: string;
|
|
10
|
+
beforeHash?: string;
|
|
11
|
+
afterHash?: string;
|
|
12
|
+
supportingSources: string[];
|
|
13
|
+
reason?: string;
|
|
14
|
+
verificationDeadline?: string;
|
|
15
|
+
attemptsRemaining?: number;
|
|
16
|
+
createdAt: string;
|
|
17
|
+
}
|
|
18
|
+
export interface ResolvedContentRef {
|
|
19
|
+
ref: string;
|
|
20
|
+
resolved: boolean;
|
|
21
|
+
content?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface EvidenceResolutionPlan {
|
|
24
|
+
path: string[];
|
|
25
|
+
key: "decisionId" | "traceId" | "assetId" | "proposalId" | "sessionId";
|
|
26
|
+
}
|
|
27
|
+
export interface EvidenceQuery {
|
|
28
|
+
decisionId?: string;
|
|
29
|
+
traceId?: string;
|
|
30
|
+
assetId?: string;
|
|
31
|
+
proposalId?: string;
|
|
32
|
+
sessionId?: string;
|
|
33
|
+
includeContentRefs?: boolean;
|
|
34
|
+
}
|
|
35
|
+
export interface ExplanationCapsule {
|
|
36
|
+
conclusion: string;
|
|
37
|
+
keyFactors: string[];
|
|
38
|
+
evidenceRefs: string[];
|
|
39
|
+
}
|
|
40
|
+
export interface EvidenceBundle {
|
|
41
|
+
query: EvidenceQuery;
|
|
42
|
+
plan: EvidenceResolutionPlan;
|
|
43
|
+
decisions: DecisionRecord[];
|
|
44
|
+
attempts: ExecutionAttempt[];
|
|
45
|
+
governance: GovernanceEvidenceRecord[];
|
|
46
|
+
resolvedContentRefs: ResolvedContentRef[];
|
|
47
|
+
explanation: ExplanationCapsule;
|
|
48
|
+
}
|
|
49
|
+
export declare function composeEvidenceBundle(input: {
|
|
50
|
+
query: EvidenceQuery;
|
|
51
|
+
plan: EvidenceResolutionPlan;
|
|
52
|
+
decisions: DecisionRecord[];
|
|
53
|
+
attempts: ExecutionAttempt[];
|
|
54
|
+
governance: GovernanceEvidenceRecord[];
|
|
55
|
+
resolvedContentRefs: ResolvedContentRef[];
|
|
56
|
+
}): EvidenceBundle;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
function collectEvidenceRefs(decisions, governance) {
|
|
2
|
+
const refs = new Set();
|
|
3
|
+
for (const record of decisions) {
|
|
4
|
+
for (const ref of record.evidenceRefs) {
|
|
5
|
+
refs.add(ref);
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
for (const record of governance) {
|
|
9
|
+
for (const ref of record.supportingSources) {
|
|
10
|
+
refs.add(ref);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return [...refs];
|
|
14
|
+
}
|
|
15
|
+
export function composeEvidenceBundle(input) {
|
|
16
|
+
const { query, plan, decisions, attempts, governance, resolvedContentRefs } = input;
|
|
17
|
+
const evidenceRefs = collectEvidenceRefs(decisions, governance);
|
|
18
|
+
const keyFactors = [
|
|
19
|
+
...new Set([
|
|
20
|
+
...decisions.flatMap((d) => d.reasonCodes),
|
|
21
|
+
...attempts.map((a) => a.failureClass).filter((x) => Boolean(x)),
|
|
22
|
+
...governance.map((g) => g.eventType),
|
|
23
|
+
]),
|
|
24
|
+
];
|
|
25
|
+
const conclusion = decisions.length > 0
|
|
26
|
+
? `找到 ${decisions.length} 条决策证据与 ${attempts.length} 条执行证据。`
|
|
27
|
+
: governance.length > 0
|
|
28
|
+
? `找到 ${governance.length} 条治理证据。`
|
|
29
|
+
: "仅找到有限证据,建议补充查询键。";
|
|
30
|
+
return {
|
|
31
|
+
query,
|
|
32
|
+
plan,
|
|
33
|
+
decisions,
|
|
34
|
+
attempts,
|
|
35
|
+
governance,
|
|
36
|
+
resolvedContentRefs,
|
|
37
|
+
explanation: {
|
|
38
|
+
conclusion,
|
|
39
|
+
keyFactors,
|
|
40
|
+
evidenceRefs,
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ObservabilityDatabase } from "../db/index.js";
|
|
2
|
+
import { type EvidenceBundle, type EvidenceQuery, type EvidenceResolutionPlan } from "./compose-evidence.js";
|
|
3
|
+
interface ContentResolver {
|
|
4
|
+
resolve(ref: string): Promise<string | undefined>;
|
|
5
|
+
}
|
|
6
|
+
export declare class EvidenceQueryEngine {
|
|
7
|
+
private readonly db;
|
|
8
|
+
private readonly contentResolver;
|
|
9
|
+
constructor(db: ObservabilityDatabase, contentResolver?: ContentResolver);
|
|
10
|
+
resolveEvidencePath(query: EvidenceQuery): EvidenceResolutionPlan;
|
|
11
|
+
queryEvidence(query: EvidenceQuery): Promise<EvidenceBundle>;
|
|
12
|
+
private loadDecisions;
|
|
13
|
+
private loadAttempts;
|
|
14
|
+
private loadGovernance;
|
|
15
|
+
private resolveContentRefs;
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { eq } from "drizzle-orm";
|
|
2
|
+
import { decisionLedger, executionAttempts, governanceAudit } from "../db/schema/index.js";
|
|
3
|
+
import { composeEvidenceBundle, } from "./compose-evidence.js";
|
|
4
|
+
class NullContentResolver {
|
|
5
|
+
async resolve(_ref) {
|
|
6
|
+
return undefined;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export class EvidenceQueryEngine {
|
|
10
|
+
db;
|
|
11
|
+
contentResolver;
|
|
12
|
+
constructor(db, contentResolver = new NullContentResolver()) {
|
|
13
|
+
this.db = db;
|
|
14
|
+
this.contentResolver = contentResolver;
|
|
15
|
+
}
|
|
16
|
+
resolveEvidencePath(query) {
|
|
17
|
+
if (query.decisionId) {
|
|
18
|
+
return { key: "decisionId", path: ["decision", "attempts"] };
|
|
19
|
+
}
|
|
20
|
+
if (query.proposalId) {
|
|
21
|
+
return { key: "proposalId", path: ["anchor_audit"] };
|
|
22
|
+
}
|
|
23
|
+
if (query.assetId) {
|
|
24
|
+
return { key: "assetId", path: ["anchor_audit"] };
|
|
25
|
+
}
|
|
26
|
+
if (query.traceId) {
|
|
27
|
+
return { key: "traceId", path: ["telemetry", "decision"] };
|
|
28
|
+
}
|
|
29
|
+
throw new Error("evidence_query_requires_index_key");
|
|
30
|
+
}
|
|
31
|
+
async queryEvidence(query) {
|
|
32
|
+
if (query.sessionId) {
|
|
33
|
+
throw new Error("evidence_query_sessionId_unsupported");
|
|
34
|
+
}
|
|
35
|
+
const plan = this.resolveEvidencePath(query);
|
|
36
|
+
const decisions = await this.loadDecisions(query, plan);
|
|
37
|
+
const attempts = await this.loadAttempts(query, plan, decisions);
|
|
38
|
+
const governance = await this.loadGovernance(query, plan, decisions);
|
|
39
|
+
const resolvedContentRefs = await this.resolveContentRefs(query, decisions, governance);
|
|
40
|
+
return composeEvidenceBundle({
|
|
41
|
+
query,
|
|
42
|
+
plan,
|
|
43
|
+
decisions,
|
|
44
|
+
attempts,
|
|
45
|
+
governance,
|
|
46
|
+
resolvedContentRefs,
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
async loadDecisions(query, plan) {
|
|
50
|
+
if (!plan.path.includes("decision")) {
|
|
51
|
+
return [];
|
|
52
|
+
}
|
|
53
|
+
if (query.decisionId) {
|
|
54
|
+
const rows = await this.db.db.select().from(decisionLedger).where(eq(decisionLedger.id, query.decisionId));
|
|
55
|
+
return rows.map(mapDecisionRow);
|
|
56
|
+
}
|
|
57
|
+
if (query.traceId) {
|
|
58
|
+
const rows = await this.db.db.select().from(decisionLedger).where(eq(decisionLedger.traceId, query.traceId));
|
|
59
|
+
return rows.map(mapDecisionRow);
|
|
60
|
+
}
|
|
61
|
+
return [];
|
|
62
|
+
}
|
|
63
|
+
async loadAttempts(query, plan, _decisions) {
|
|
64
|
+
if (!plan.path.includes("attempts") && !plan.path.includes("telemetry")) {
|
|
65
|
+
return [];
|
|
66
|
+
}
|
|
67
|
+
if (query.traceId) {
|
|
68
|
+
const rows = await this.db.db.select().from(executionAttempts).where(eq(executionAttempts.traceId, query.traceId));
|
|
69
|
+
return rows.map(mapAttemptRow);
|
|
70
|
+
}
|
|
71
|
+
if (query.decisionId) {
|
|
72
|
+
const rows = await this.db.db.select().from(executionAttempts).where(eq(executionAttempts.decisionId, query.decisionId));
|
|
73
|
+
return rows.map(mapAttemptRow);
|
|
74
|
+
}
|
|
75
|
+
return [];
|
|
76
|
+
}
|
|
77
|
+
async loadGovernance(query, plan, _decisions) {
|
|
78
|
+
if (!plan.path.includes("anchor_audit")) {
|
|
79
|
+
return [];
|
|
80
|
+
}
|
|
81
|
+
if (query.proposalId) {
|
|
82
|
+
const rows = await this.db.db.select().from(governanceAudit).where(eq(governanceAudit.proposalId, query.proposalId));
|
|
83
|
+
return rows.map(mapGovernanceRow);
|
|
84
|
+
}
|
|
85
|
+
if (query.assetId) {
|
|
86
|
+
const rows = await this.db.db.select().from(governanceAudit).where(eq(governanceAudit.targetAssetId, query.assetId));
|
|
87
|
+
return rows.map(mapGovernanceRow);
|
|
88
|
+
}
|
|
89
|
+
return [];
|
|
90
|
+
}
|
|
91
|
+
async resolveContentRefs(query, decisions, governance) {
|
|
92
|
+
if (!query.includeContentRefs) {
|
|
93
|
+
return [];
|
|
94
|
+
}
|
|
95
|
+
const refs = new Set();
|
|
96
|
+
for (const decision of decisions) {
|
|
97
|
+
for (const ref of decision.evidenceRefs) {
|
|
98
|
+
refs.add(ref);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
for (const gov of governance) {
|
|
102
|
+
for (const ref of gov.supportingSources) {
|
|
103
|
+
refs.add(ref);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
const resolved = [];
|
|
107
|
+
for (const ref of refs) {
|
|
108
|
+
const content = await this.contentResolver.resolve(ref);
|
|
109
|
+
resolved.push({ ref, resolved: typeof content === "string", content });
|
|
110
|
+
}
|
|
111
|
+
return resolved;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
function mapDecisionRow(row) {
|
|
115
|
+
return {
|
|
116
|
+
id: row.id,
|
|
117
|
+
tickId: row.tickId,
|
|
118
|
+
traceId: row.traceId,
|
|
119
|
+
intentId: row.intentId ?? undefined,
|
|
120
|
+
platformId: row.platformId ?? undefined,
|
|
121
|
+
verdict: row.verdict,
|
|
122
|
+
mode: row.mode,
|
|
123
|
+
reasons: JSON.parse(row.reasons),
|
|
124
|
+
reasonCodes: JSON.parse(row.reasonCodes),
|
|
125
|
+
decisionBasis: row.decisionBasis,
|
|
126
|
+
evidenceRefs: JSON.parse(row.evidenceRefs),
|
|
127
|
+
modelEvalRef: row.modelEvalRef ?? undefined,
|
|
128
|
+
createdAt: row.createdAt,
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
function mapAttemptRow(row) {
|
|
132
|
+
return {
|
|
133
|
+
id: row.id,
|
|
134
|
+
traceId: row.traceId,
|
|
135
|
+
decisionId: row.decisionId,
|
|
136
|
+
intentId: row.intentId,
|
|
137
|
+
platformId: row.platformId,
|
|
138
|
+
capability: row.capability,
|
|
139
|
+
channel: row.channel,
|
|
140
|
+
status: row.status,
|
|
141
|
+
commitState: row.commitState,
|
|
142
|
+
failureClass: row.failureClass ?? undefined,
|
|
143
|
+
retryPolicy: row.retryPolicy ?? undefined,
|
|
144
|
+
idempotencyKey: row.idempotencyKey ?? undefined,
|
|
145
|
+
startedAt: row.startedAt ?? undefined,
|
|
146
|
+
finishedAt: row.finishedAt ?? undefined,
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
function mapGovernanceRow(row) {
|
|
150
|
+
return {
|
|
151
|
+
id: row.id,
|
|
152
|
+
eventType: row.eventType,
|
|
153
|
+
proposalId: row.proposalId ?? undefined,
|
|
154
|
+
targetAssetId: row.targetAssetId ?? undefined,
|
|
155
|
+
assetPath: row.assetPath ?? undefined,
|
|
156
|
+
statusFrom: row.statusFrom ?? undefined,
|
|
157
|
+
statusTo: row.statusTo,
|
|
158
|
+
beforeHash: row.beforeHash ?? undefined,
|
|
159
|
+
afterHash: row.afterHash ?? undefined,
|
|
160
|
+
supportingSources: JSON.parse(row.supportingSources ?? "[]"),
|
|
161
|
+
reason: row.reason ?? undefined,
|
|
162
|
+
verificationDeadline: row.verificationDeadline ?? undefined,
|
|
163
|
+
attemptsRemaining: row.attemptsRemaining ?? undefined,
|
|
164
|
+
createdAt: row.createdAt,
|
|
165
|
+
};
|
|
166
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type SensitivityLevel } from "./policy.js";
|
|
2
|
+
export interface RedactionManifest {
|
|
3
|
+
id: string;
|
|
4
|
+
sensitivityLevel: SensitivityLevel;
|
|
5
|
+
maskedFields: string[];
|
|
6
|
+
erasedFields: string[];
|
|
7
|
+
hashedFields: string[];
|
|
8
|
+
originalFieldCount: number;
|
|
9
|
+
redactedFieldCount: number;
|
|
10
|
+
createdAt: string;
|
|
11
|
+
}
|
|
12
|
+
export interface RedactionResult<T> {
|
|
13
|
+
redacted: T;
|
|
14
|
+
manifest: RedactionManifest;
|
|
15
|
+
}
|
|
16
|
+
export declare function redactEvent<T extends object>(event: T): RedactionResult<T>;
|
|
17
|
+
export declare function createEmptyManifest(): RedactionManifest;
|
|
18
|
+
export declare function mergeManifests(manifests: RedactionManifest[]): RedactionManifest;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import * as crypto from "crypto";
|
|
2
|
+
export function redactEvent(event) {
|
|
3
|
+
const maskedFields = [];
|
|
4
|
+
const erasedFields = [];
|
|
5
|
+
const hashedFields = [];
|
|
6
|
+
const output = structuredClone(event);
|
|
7
|
+
function joinPath(basePath, key) {
|
|
8
|
+
return basePath.length > 0 ? `${basePath}.${key}` : key;
|
|
9
|
+
}
|
|
10
|
+
function processObject(target, basePath) {
|
|
11
|
+
for (const key of Object.keys(target)) {
|
|
12
|
+
const lowerKey = key.toLowerCase();
|
|
13
|
+
const value = target[key];
|
|
14
|
+
const fieldPath = joinPath(basePath, key);
|
|
15
|
+
if (lowerKey === "token" ||
|
|
16
|
+
lowerKey === "access_token" ||
|
|
17
|
+
lowerKey === "refresh_token" ||
|
|
18
|
+
lowerKey === "api_key" ||
|
|
19
|
+
lowerKey === "apisecret" ||
|
|
20
|
+
lowerKey === "secret" ||
|
|
21
|
+
lowerKey === "password" ||
|
|
22
|
+
lowerKey === "bearer_token" ||
|
|
23
|
+
lowerKey === "authorization" ||
|
|
24
|
+
lowerKey === "node_secret") {
|
|
25
|
+
target[key] = "[MASKED]";
|
|
26
|
+
maskedFields.push(fieldPath);
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
if (lowerKey === "full_message" ||
|
|
30
|
+
lowerKey === "full_post" ||
|
|
31
|
+
lowerKey === "private_message" ||
|
|
32
|
+
lowerKey === "prompt" ||
|
|
33
|
+
lowerKey === "system_prompt" ||
|
|
34
|
+
lowerKey === "completion" ||
|
|
35
|
+
lowerKey === "response_content") {
|
|
36
|
+
delete target[key];
|
|
37
|
+
erasedFields.push(fieldPath);
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
if (lowerKey === "content_hash" ||
|
|
41
|
+
lowerKey === "trace_id" ||
|
|
42
|
+
lowerKey === "user_id" ||
|
|
43
|
+
lowerKey === "session_id") {
|
|
44
|
+
if (typeof value === "string") {
|
|
45
|
+
target[key] = crypto.createHash("sha256").update(value).digest("hex").slice(0, 16);
|
|
46
|
+
}
|
|
47
|
+
hashedFields.push(fieldPath);
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
51
|
+
processObject(value, fieldPath);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
processObject(output, "");
|
|
56
|
+
const originalFieldCount = Object.keys(event).length;
|
|
57
|
+
const redactedFieldCount = Object.keys(output).length;
|
|
58
|
+
return {
|
|
59
|
+
redacted: output,
|
|
60
|
+
manifest: {
|
|
61
|
+
id: `rm:${Date.now()}:${crypto.randomBytes(4).toString("hex")}`,
|
|
62
|
+
sensitivityLevel: "internal",
|
|
63
|
+
maskedFields,
|
|
64
|
+
erasedFields,
|
|
65
|
+
hashedFields,
|
|
66
|
+
originalFieldCount,
|
|
67
|
+
redactedFieldCount,
|
|
68
|
+
createdAt: new Date().toISOString(),
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
export function createEmptyManifest() {
|
|
73
|
+
return {
|
|
74
|
+
id: `rm:${Date.now()}:empty`,
|
|
75
|
+
sensitivityLevel: "internal",
|
|
76
|
+
maskedFields: [],
|
|
77
|
+
erasedFields: [],
|
|
78
|
+
hashedFields: [],
|
|
79
|
+
originalFieldCount: 0,
|
|
80
|
+
redactedFieldCount: 0,
|
|
81
|
+
createdAt: new Date().toISOString(),
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
export function mergeManifests(manifests) {
|
|
85
|
+
const merged = {
|
|
86
|
+
id: `rm:${Date.now()}:merged`,
|
|
87
|
+
sensitivityLevel: "internal",
|
|
88
|
+
maskedFields: [],
|
|
89
|
+
erasedFields: [],
|
|
90
|
+
hashedFields: [],
|
|
91
|
+
originalFieldCount: 0,
|
|
92
|
+
redactedFieldCount: 0,
|
|
93
|
+
createdAt: new Date().toISOString(),
|
|
94
|
+
};
|
|
95
|
+
for (const m of manifests) {
|
|
96
|
+
merged.maskedFields.push(...m.maskedFields);
|
|
97
|
+
merged.erasedFields.push(...m.erasedFields);
|
|
98
|
+
merged.hashedFields.push(...m.hashedFields);
|
|
99
|
+
merged.originalFieldCount += m.originalFieldCount;
|
|
100
|
+
merged.redactedFieldCount += m.redactedFieldCount;
|
|
101
|
+
if (m.sensitivityLevel === "restricted") {
|
|
102
|
+
merged.sensitivityLevel = "restricted";
|
|
103
|
+
}
|
|
104
|
+
else if (m.sensitivityLevel === "confidential" && merged.sensitivityLevel !== "restricted") {
|
|
105
|
+
merged.sensitivityLevel = "confidential";
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return merged;
|
|
109
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const REDACTION_CONFIG: {
|
|
2
|
+
readonly maskedFieldNames: readonly ["token", "access_token", "refresh_token", "api_key", "apiSecret", "secret", "password", "bearer_token", "authorization", "node_secret"];
|
|
3
|
+
readonly eraseFieldNames: readonly ["full_message", "full_post", "private_message", "prompt", "system_prompt", "completion", "response_content"];
|
|
4
|
+
readonly hashFieldNames: readonly ["user_id", "session_id", "trace_id", "content_hash"];
|
|
5
|
+
readonly sensitivityLevels: readonly ["public", "internal", "confidential", "restricted"];
|
|
6
|
+
};
|
|
7
|
+
export type SensitivityLevel = (typeof REDACTION_CONFIG)["sensitivityLevels"][number];
|
|
8
|
+
export interface RedactionRule {
|
|
9
|
+
fieldName: string;
|
|
10
|
+
action: "mask" | "erase" | "hash" | "keep";
|
|
11
|
+
pattern?: RegExp;
|
|
12
|
+
}
|
|
13
|
+
export interface RedactionPolicy {
|
|
14
|
+
defaultPolicy: RedactionRule[];
|
|
15
|
+
fieldOverrides: Record<string, RedactionRule[]>;
|
|
16
|
+
maxFieldLength: number;
|
|
17
|
+
}
|
|
18
|
+
export declare const DEFAULT_REDACTION_POLICY: RedactionPolicy;
|
|
19
|
+
export declare function getFieldRedactionRule(fieldName: string, policy?: RedactionPolicy): RedactionRule;
|