principles-disciple 1.238.0 → 1.239.0

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.
@@ -1,4 +1,4 @@
1
- import type { EventLogEntry, DailyStats, EmpathyEventStats, ToolCallEventData, PainSignalEventData, RulePromotionEventData, GovernanceActionEventData, HookExecutionEventData, GateBlockEventData, GateBypassEventData, EvolutionTaskEventData, EmpathyRollbackEventData, DiagnosisTaskEventData, HeartbeatDiagnosisEventData, DiagnosticianReportEventData, PrincipleCandidateEventData, RuleEnforcedEventData, RuleHostEvaluatedEventData, RuleHostBlockedEventData, RuleHostRequireApprovalEventData, RuleHostAutoCorrectProposedEventData, RuleHostAutoCorrectAppliedEventData, RuntimeV2PromptActivationsInjectedEventData, RuleHostUnhealthyEventData, RuleHostSkippedEventData, TrajectoryObservabilityFailureEventData } from '../types/event-types.js';
1
+ import type { EventLogEntry, DailyStats, EmpathyEventStats, ToolCallEventData, PainSignalEventData, RulePromotionEventData, GovernanceActionEventData, HookExecutionEventData, GateBlockEventData, GateBypassEventData, EmpathyRollbackEventData, DiagnosisTaskEventData, HeartbeatDiagnosisEventData, DiagnosticianReportEventData, PrincipleCandidateEventData, RuleEnforcedEventData, RuleHostEvaluatedEventData, RuleHostBlockedEventData, RuleHostRequireApprovalEventData, RuleHostAutoCorrectProposedEventData, RuleHostAutoCorrectAppliedEventData, RuntimeV2PromptActivationsInjectedEventData, RuleHostUnhealthyEventData, RuleHostSkippedEventData, TrajectoryObservabilityFailureEventData } from '../types/event-types.js';
2
2
  import type { PluginLogger } from '../openclaw-sdk.js';
3
3
  export declare class EventLog {
4
4
  private readonly logsDir;
@@ -27,8 +27,6 @@ export declare class EventLog {
27
27
  }): void;
28
28
  recordGateBlock(sessionId: string | undefined, data: GateBlockEventData): void;
29
29
  recordGateBypass(sessionId: string | undefined, data: GateBypassEventData): void;
30
- recordEvolutionTask(data: EvolutionTaskEventData): void;
31
- recordEvolutionTaskCompleted(data: EvolutionTaskEventData): void;
32
30
  recordEmpathyRollback(sessionId: string | undefined, data: EmpathyRollbackEventData): void;
33
31
  recordError(sessionId: string | undefined, message: string, context?: Record<string, unknown>): void;
34
32
  recordWarn(sessionId: string | undefined, message: string, context?: Record<string, unknown>): void;
@@ -1,17 +1,20 @@
1
1
  /**
2
- * Evolution Points System V2.0 - MVP
2
+ * Evolution domain type surface for the plugin.
3
3
  *
4
- * Canonical definitions moved to @principles/core/runtime-v2/evolution/
5
- * This file re-exports everything for backward compatibility.
4
+ * Canonical definitions live in @principles/core/runtime-v2 (evolution/).
5
+ * This file keeps the plugin-facing backward-compatible aliases.
6
6
  *
7
7
  * NOTE: Principle → EvolutionPrinciple, PrincipleStatus → EvolutionPrincipleStatus
8
8
  * to avoid collision with runtime-v2/types/principle-schema.ts Principle.
9
9
  * Backward-compatible aliases are provided below.
10
+ *
11
+ * PRI-770: the Evolution Points/Tier re-exports (tiers, scorecards, storage /
12
+ * config contracts) and the V2 queue item types were removed — their
13
+ * subsystems were retired (PRI-737) and no consumer remained.
10
14
  */
11
- import type { TaskKind, TaskPriority } from './trajectory-types.js';
12
15
  import type { EvolutionPrinciple as EvolutionPrincipleType, EvolutionPrincipleStatus as EvolutionPrincipleStatusType, EvolutionPrincipleSuggestedRule as EvolutionPrincipleSuggestedRuleType, EvolutionPrincipleValueMetricsSnapshot as EvolutionPrincipleValueMetricsSnapshotType, EvolutionPainDetectedData as EvolutionPainDetectedDataType } from '@principles/core/runtime-v2';
13
- export { EvolutionTier, TIER_DEFINITIONS, getTierDefinition, getTierByPoints, TASK_DIFFICULTY_CONFIG, DEFAULT_EVOLUTION_CONFIG, isCompleteDetectorMetadata, } from '@principles/core/runtime-v2';
14
- export type { TierPermissions, TierDefinition, TaskDifficulty, TaskDifficultyConfig, EvolutionEventType, EvolutionEvent, EvolutionScorecard, EvolutionStats, EvolutionStorage, EvolutionConfig, ArchivedEventStats, GateDecision, ToolCallContext, TierPromotionEvent, EvolutionPrincipleStatus, PrincipleEvaluatorLevel, Evaluability, PrincipleDetectorSpec, EvolutionPrinciple, EvolutionPrincipleSuggestedRule, EvolutionPrincipleValueMetricsSnapshot, EvolutionLoopEventType, EvolutionPainDetectedData, CandidateCreatedData, PrinciplePromotedData, PrincipleDeprecatedData, PrincipleRolledBackData, CircuitBreakerOpenedData, LegacyImportData, EvolutionLoopEvent, } from '@principles/core/runtime-v2';
16
+ export { isCompleteDetectorMetadata, } from '@principles/core/runtime-v2';
17
+ export type { EvolutionPrincipleStatus, PrincipleEvaluatorLevel, Evaluability, PrincipleDetectorSpec, EvolutionPrinciple, EvolutionPrincipleSuggestedRule, EvolutionPrincipleValueMetricsSnapshot, EvolutionLoopEventType, EvolutionPainDetectedData, CandidateCreatedData, PrinciplePromotedData, PrincipleDeprecatedData, PrincipleRolledBackData, CircuitBreakerOpenedData, LegacyImportData, EvolutionLoopEvent, } from '@principles/core/runtime-v2';
15
18
  /** @deprecated Use EvolutionPrinciple instead. Alias for backward compatibility. */
16
19
  export type Principle = EvolutionPrincipleType;
17
20
  /** @deprecated Use EvolutionPrincipleStatus instead. Alias for backward compatibility. */
@@ -22,29 +25,3 @@ export type PrincipleSuggestedRule = EvolutionPrincipleSuggestedRuleType;
22
25
  export type PrincipleValueMetricsSnapshot = EvolutionPrincipleValueMetricsSnapshotType;
23
26
  /** @deprecated Use EvolutionPainDetectedData instead. Alias for backward compatibility. */
24
27
  export type PainDetectedData = EvolutionPainDetectedDataType;
25
- export type QueueStatus = 'pending' | 'in_progress' | 'completed' | 'failed' | 'canceled';
26
- export type TaskResolution = 'marker_detected' | 'auto_completed_timeout' | 'failed_max_retries' | 'runtime_unavailable' | 'canceled' | 'late_marker_principle_created' | 'late_marker_no_principle' | 'stub_fallback' | 'skipped_thin_violation' | 'success' | 'failure' | 'skipped' | 'noise_classified' | 'retired';
27
- export interface EvolutionQueueItem {
28
- id: string;
29
- taskKind: TaskKind;
30
- priority: TaskPriority;
31
- source: string;
32
- traceId?: string;
33
- task?: string;
34
- score: number;
35
- reason: string;
36
- timestamp: string;
37
- enqueued_at?: string;
38
- started_at?: string;
39
- completed_at?: string;
40
- assigned_session_key?: string;
41
- trigger_text_preview?: string;
42
- status: QueueStatus;
43
- resolution?: TaskResolution;
44
- session_id?: string;
45
- agent_id?: string;
46
- retryCount: number;
47
- maxRetries: number;
48
- lastError?: string;
49
- resultRef?: string;
50
- }
@@ -1,4 +1,4 @@
1
- import type { CorrectionSampleReviewStatus, CorrectionExportMode, TrajectoryDataStats, TrajectoryAssistantTurnInput, TrajectoryUserTurnInput, TrajectoryToolCallInput, TrajectoryPainEventInput, TrajectoryGateBlockInput, TrajectoryTrustChangeInput, TrajectoryPrincipleEventInput, TrajectoryTaskOutcomeInput, TrajectorySessionInput, EvolutionTaskInput, EvolutionEventInput, EvolutionTaskRecord, EvolutionEventRecord, EvolutionTaskFilters, AssistantTurnRecord, CorrectionSampleRecord, TrajectoryExportResult, TrajectoryDatabaseOptions, RuleHostContextResult, RuleHostEvidenceRow } from './trajectory-types.js';
1
+ import type { CorrectionSampleReviewStatus, CorrectionExportMode, TrajectoryDataStats, TrajectoryAssistantTurnInput, TrajectoryUserTurnInput, TrajectoryToolCallInput, TrajectoryPainEventInput, TrajectoryGateBlockInput, TrajectoryTrustChangeInput, TrajectoryPrincipleEventInput, TrajectoryTaskOutcomeInput, TrajectorySessionInput, EvolutionTaskRecord, EvolutionEventRecord, EvolutionTaskFilters, AssistantTurnRecord, CorrectionSampleRecord, TrajectoryExportResult, TrajectoryDatabaseOptions, RuleHostContextResult, RuleHostEvidenceRow } from './trajectory-types.js';
2
2
  export type { CorrectionSampleReviewStatus, CorrectionExportMode, TrajectoryDataStats, TrajectoryAssistantTurnInput, TrajectoryUserTurnInput, TrajectoryToolCallInput, TrajectoryPainEventInput, TrajectoryGateBlockInput, DailyMetricRow, TrajectoryTrustChangeInput, TrajectoryPrincipleEventInput, TrajectoryTaskOutcomeInput, TrajectorySessionInput, TaskKind, TaskPriority, EvolutionTaskInput, EvolutionEventInput, EvolutionTaskRecord, EvolutionEventRecord, EvolutionTaskFilters, AssistantTurnRecord, CorrectionSampleRecord, TrajectoryExportResult, TrajectoryDatabaseOptions, RuleHostContextRow, RuleHostContextResult, RuleHostEvidenceRow, } from './trajectory-types.js';
3
3
  /**
4
4
  * Initialize trajectory.db schema at the given workspace directory.
@@ -47,9 +47,15 @@ export declare class TrajectoryDatabase {
47
47
  recordTrustChange(input: TrajectoryTrustChangeInput): void;
48
48
  recordPrincipleEvent(input: TrajectoryPrincipleEventInput): void;
49
49
  recordTaskOutcome(input: TrajectoryTaskOutcomeInput): void;
50
- recordEvolutionTask(input: EvolutionTaskInput): void;
51
- updateEvolutionTask(taskId: string, updates: Partial<Omit<EvolutionTaskInput, 'taskId' | 'traceId' | 'source'>>): void;
52
- recordEvolutionEvent(input: EvolutionEventInput): void;
50
+ /**
51
+ * PRI-770: fresh workspaces no longer create the evolution tables (the
52
+ * writer path was retired with the evolution worker in PRI-737), while
53
+ * historical workspaces keep theirs. Readers degrade to empty results on a
54
+ * missing table instead of throwing — the same contract as the SDK readers'
55
+ * "DB does not exist → empty array" behaviour. This is an expected,
56
+ * observable state for new workspaces, not a silent failure.
57
+ */
58
+ private evolutionTableMissing;
53
59
  /**
54
60
  * List evolution tasks with optional filtering.
55
61
  *