@gitgov/core 2.7.0 → 2.7.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.
@@ -1,8 +1,8 @@
1
1
  import { Octokit } from '@octokit/rest';
2
2
  export { Octokit, RestEndpointMethodTypes } from '@octokit/rest';
3
3
  import { h as FileLister, i as FileListOptions, j as FileStats, I as IGitModule, d as ChangedFile, e as GetCommitHistoryOptions, f as CommitInfo, g as CommitAuthor, E as ExecOptions, c as ExecResult, C as ConfigStore, G as GitGovConfig } from './index-LULVRsCZ.js';
4
- import { I as IdEncoder, R as RecordStore, a as IRecordProjector } from './record_projection.types-Dz9YU3r9.js';
5
- import { C as ConfigManager, q as IIdentityAdapter, I as ILintModule, e as ISyncStateModule, j as SyncStatePushOptions, k as SyncStatePushResult, l as SyncStatePullOptions, m as SyncStatePullResult, f as StateDeltaFile, g as ConflictDiff, n as SyncStateResolveOptions, o as SyncStateResolveResult, h as IntegrityViolation, A as AuditStateOptions, i as AuditStateReport } from './sync_state-Bn_LogJ2.js';
4
+ import { I as IdEncoder, R as RecordStore, a as IRecordProjector } from './record_projection.types-D9NkQbL_.js';
5
+ import { C as ConfigManager, q as IIdentityAdapter, I as ILintModule, e as ISyncStateModule, j as SyncStatePushOptions, k as SyncStatePushResult, l as SyncStatePullOptions, m as SyncStatePullResult, f as StateDeltaFile, g as ConflictDiff, n as SyncStateResolveOptions, o as SyncStateResolveResult, h as IntegrityViolation, A as AuditStateOptions, i as AuditStateReport } from './sync_state-C2a2RuBQ.js';
6
6
 
7
7
  /**
8
8
  * Types for GitHubFileLister module.
@@ -1,8 +1,8 @@
1
- import { A as ActorPayload, d as ActorRecord, e as AgentPayload, f as AgentRecord, C as ChangelogPayload, g as ChangelogRecord, h as CustomRecord, i as CyclePayload, j as CycleRecord, E as EmbeddedMetadataHeader, k as EmbeddedMetadataRecord, l as ExecutionPayload, m as ExecutionRecord, F as FeedbackPayload, n as FeedbackRecord, o as GitGovActorRecord, p as GitGovAgentRecord, q as GitGovChangelogRecord, r as GitGovCycleRecord, s as GitGovError, t as GitGovExecutionRecord, u as GitGovFeedbackRecord, G as GitGovRecord, v as GitGovRecordPayload, w as GitGovRecordType, x as GitGovTaskRecord, S as Signature, T as TaskPayload, y as TaskRecord, D as DEFAULT_ID_ENCODER, I as IdEncoder, R as RecordStore, z as RecordStores, B as CollaborationMetrics, H as IRecordMetrics, J as ProductivityMetrics, K as RecordMetrics, L as RecordMetricsDependencies, M as SystemStatus, N as TaskHealthReport, O as ActivityEvent, Q as ActorCreatedEvent, U as ActorRevokedEvent, V as AgentRegisteredEvent, W as BaseEvent, X as ChangelogCreatedEvent, Y as CycleCreatedEvent, Z as CycleStatusChangedEvent, _ as EventHandler, $ as EventMetadata, a0 as EventSubscription, a1 as ExecutionCreatedEvent, a2 as FeedbackCreatedEvent, a3 as GitGovEvent, a4 as SystemDailyTickEvent, a5 as TaskCreatedEvent, a6 as TaskStatusChangedEvent, a as IRecordProjector, a7 as RecordProjectorDependencies, c as IndexData, a8 as IndexGenerationReport, a9 as IntegrityReport, aa as AllRecords, ab as DerivedStates, ac as EnrichedTaskRecord, ad as DerivedStateSets, b as IRecordProjection, ae as IntegrityError, af as IntegrityWarning, P as ProjectionContext } from './record_projection.types-Dz9YU3r9.js';
2
- import { C as ConfigManager, E as EventBus, p as IEventStream, r as eventBus, s as publishEvent, t as subscribeToEvent, q as IIdentityAdapter, u as IdentityAdapterDependencies, I as ILintModule, v as LintModuleDependencies, c as LintRecordContext, d as LintResult, L as LintOptions, a as LintReport$1, F as FixRecordOptions, b as FixReport, w as FixResult, x as LintSummary, y as RecordEntry, R as RecordStores$1, V as ValidationContext$1, z as ValidatorType, e as ISyncStateModule, B as AuditScope$1, A as AuditStateOptions, i as AuditStateReport, g as ConflictDiff, D as ConflictFileDiff, G as ConflictInfo, H as ConflictType, J as ExpectedFilesScope, h as IntegrityViolation, f as StateDeltaFile, S as SyncStateModuleDependencies, l as SyncStatePullOptions, m as SyncStatePullResult, j as SyncStatePushOptions, k as SyncStatePushResult, n as SyncStateResolveOptions, o as SyncStateResolveResult } from './sync_state-Bn_LogJ2.js';
1
+ import { A as ActorPayload, d as ActorRecord, e as AgentPayload, f as AgentRecord, C as ChangelogPayload, g as ChangelogRecord, h as CyclePayload, i as CycleRecord, E as EmbeddedMetadataHeader, j as EmbeddedMetadataRecord, k as ExecutionPayload, l as ExecutionRecord, F as FeedbackPayload, m as FeedbackRecord, n as GitGovActorRecord, o as GitGovAgentRecord, p as GitGovChangelogRecord, q as GitGovCycleRecord, r as GitGovError, s as GitGovExecutionRecord, t as GitGovFeedbackRecord, G as GitGovRecord, u as GitGovRecordPayload, v as GitGovRecordType, w as GitGovTaskRecord, S as Signature, T as TaskPayload, x as TaskRecord, D as DEFAULT_ID_ENCODER, I as IdEncoder, R as RecordStore, y as RecordStores, z as CollaborationMetrics, B as IRecordMetrics, H as ProductivityMetrics, J as RecordMetrics, K as RecordMetricsDependencies, L as SystemStatus, M as TaskHealthReport, N as ActivityEvent, O as ActorCreatedEvent, Q as ActorRevokedEvent, U as AgentRegisteredEvent, V as BaseEvent, W as ChangelogCreatedEvent, X as CycleCreatedEvent, Y as CycleStatusChangedEvent, Z as EventHandler, _ as EventMetadata, $ as EventSubscription, a0 as ExecutionCreatedEvent, a1 as FeedbackCreatedEvent, a2 as GitGovEvent, a3 as SystemDailyTickEvent, a4 as TaskCreatedEvent, a5 as TaskStatusChangedEvent, a as IRecordProjector, a6 as RecordProjectorDependencies, c as IndexData, a7 as IndexGenerationReport, a8 as IntegrityReport, a9 as AllRecords, aa as DerivedStates, ab as EnrichedTaskRecord, ac as DerivedStateSets, b as IRecordProjection, ad as IntegrityError, ae as IntegrityWarning, P as ProjectionContext } from './record_projection.types-D9NkQbL_.js';
2
+ import { C as ConfigManager, E as EventBus, p as IEventStream, r as eventBus, s as publishEvent, t as subscribeToEvent, q as IIdentityAdapter, u as IdentityAdapterDependencies, I as ILintModule, v as LintModuleDependencies, c as LintRecordContext, d as LintResult, L as LintOptions, a as LintReport$1, F as FixRecordOptions, b as FixReport, w as FixResult, x as LintSummary, y as RecordEntry, R as RecordStores$1, V as ValidationContext$1, z as ValidatorType, e as ISyncStateModule, B as AuditScope$1, A as AuditStateOptions, i as AuditStateReport, g as ConflictDiff, D as ConflictFileDiff, G as ConflictInfo, H as ConflictType, J as ExpectedFilesScope, h as IntegrityViolation, f as StateDeltaFile, S as SyncStateModuleDependencies, l as SyncStatePullOptions, m as SyncStatePullResult, j as SyncStatePushOptions, k as SyncStatePushResult, n as SyncStateResolveOptions, o as SyncStateResolveResult } from './sync_state-C2a2RuBQ.js';
3
3
  import { A as ActorState, a as GitGovSession, k as ISessionManager, S as SyncPreferencesUpdate, l as SyncStatus, m as AuditState, n as AuditStateUpdate, G as GitGovConfig, o as IConfigManager, p as SyncConfig, q as SyncDefaults, K as KeyProvider, r as KeyProviderError, s as KeyProviderErrorCode, i as FileListOptions, h as FileLister, j as FileStats, F as FsFileListerOptions, M as MemoryFileListerOptions, I as IGitModule } from './index-LULVRsCZ.js';
4
4
  export { C as ConfigStore, t as Git } from './index-LULVRsCZ.js';
5
- import { S as SessionManager, g as IdentityAdapter, h as IExecutionAdapter, i as ExecutionAdapterDependencies, E as EnvironmentValidation, I as IProjectInitializer, d as FsKeyProvider, e as FsKeyProviderOptions, f as FsFileLister, D as DEFAULT_STATE_BRANCH, j as AgentExecutionContext, k as AgentOutput, c as AgentResponse, A as AgentRunnerDependencies, l as AgentRunnerEvent, m as ApiEngine, n as AuthConfig, o as AuthType, C as CustomEngine, p as Engine, q as EngineType, r as IAgentLoader, b as IAgentRunner, L as LocalEngine, M as McpEngine, s as ProtocolHandler, P as ProtocolHandlerRegistry, R as RunOptions, t as RuntimeHandler, u as RuntimeHandlerRegistry } from './agent_runner-CHDkBfPZ.js';
5
+ import { S as SessionManager, g as IdentityAdapter, h as IExecutionAdapter, i as ExecutionAdapterDependencies, E as EnvironmentValidation, I as IProjectInitializer, d as FsKeyProvider, e as FsKeyProviderOptions, f as FsFileLister, D as DEFAULT_STATE_BRANCH, j as AgentExecutionContext, k as AgentOutput, c as AgentResponse, A as AgentRunnerDependencies, l as AgentRunnerEvent, m as ApiEngine, n as AuthConfig, o as AuthType, C as CustomEngine, p as Engine, q as EngineType, r as IAgentLoader, b as IAgentRunner, L as LocalEngine, M as McpEngine, s as ProtocolHandler, P as ProtocolHandlerRegistry, R as RunOptions, t as RuntimeHandler, u as RuntimeHandlerRegistry } from './agent_runner-DijNVjaF.js';
6
6
  import { E as EnvKeyProvider, a as EnvKeyProviderOptions, M as MockKeyProvider, b as MockKeyProviderOptions, c as MemoryFileLister } from './memory_file_lister-BCY4ZYGW.js';
7
7
  import { ValidateFunction } from 'ajv';
8
8
  import './session_store-I4Z6PW2c.js';
@@ -190,7 +190,6 @@ declare const index$q_AgentPayload: typeof AgentPayload;
190
190
  declare const index$q_AgentRecord: typeof AgentRecord;
191
191
  declare const index$q_ChangelogPayload: typeof ChangelogPayload;
192
192
  declare const index$q_ChangelogRecord: typeof ChangelogRecord;
193
- declare const index$q_CustomRecord: typeof CustomRecord;
194
193
  declare const index$q_CyclePayload: typeof CyclePayload;
195
194
  declare const index$q_CycleRecord: typeof CycleRecord;
196
195
  declare const index$q_EmbeddedMetadataHeader: typeof EmbeddedMetadataHeader;
@@ -215,7 +214,7 @@ declare const index$q_TaskPayload: typeof TaskPayload;
215
214
  declare const index$q_TaskRecord: typeof TaskRecord;
216
215
  type index$q_WorkflowRecord = WorkflowRecord;
217
216
  declare namespace index$q {
218
- export { index$q_ActorPayload as ActorPayload, index$q_ActorRecord as ActorRecord, index$q_AgentPayload as AgentPayload, index$q_AgentRecord as AgentRecord, index$q_ChangelogPayload as ChangelogPayload, index$q_ChangelogRecord as ChangelogRecord, index$q_CustomRecord as CustomRecord, index$q_CyclePayload as CyclePayload, index$q_CycleRecord as CycleRecord, index$q_EmbeddedMetadataHeader as EmbeddedMetadataHeader, index$q_EmbeddedMetadataRecord as EmbeddedMetadataRecord, index$q_ExecutionPayload as ExecutionPayload, index$q_ExecutionRecord as ExecutionRecord, index$q_FeedbackPayload as FeedbackPayload, index$q_FeedbackRecord as FeedbackRecord, index$q_GitGovActorRecord as GitGovActorRecord, index$q_GitGovAgentRecord as GitGovAgentRecord, index$q_GitGovChangelogRecord as GitGovChangelogRecord, index$q_GitGovCycleRecord as GitGovCycleRecord, index$q_GitGovError as GitGovError, index$q_GitGovExecutionRecord as GitGovExecutionRecord, index$q_GitGovFeedbackRecord as GitGovFeedbackRecord, index$q_GitGovRecord as GitGovRecord, index$q_GitGovRecordPayload as GitGovRecordPayload, index$q_GitGovRecordType as GitGovRecordType, index$q_GitGovTaskRecord as GitGovTaskRecord, index$q_Signature as Signature, index$q_TaskPayload as TaskPayload, index$q_TaskRecord as TaskRecord, type index$q_WorkflowRecord as WorkflowRecord };
217
+ export { index$q_ActorPayload as ActorPayload, index$q_ActorRecord as ActorRecord, index$q_AgentPayload as AgentPayload, index$q_AgentRecord as AgentRecord, index$q_ChangelogPayload as ChangelogPayload, index$q_ChangelogRecord as ChangelogRecord, index$q_CyclePayload as CyclePayload, index$q_CycleRecord as CycleRecord, index$q_EmbeddedMetadataHeader as EmbeddedMetadataHeader, index$q_EmbeddedMetadataRecord as EmbeddedMetadataRecord, index$q_ExecutionPayload as ExecutionPayload, index$q_ExecutionRecord as ExecutionRecord, index$q_FeedbackPayload as FeedbackPayload, index$q_FeedbackRecord as FeedbackRecord, index$q_GitGovActorRecord as GitGovActorRecord, index$q_GitGovAgentRecord as GitGovAgentRecord, index$q_GitGovChangelogRecord as GitGovChangelogRecord, index$q_GitGovCycleRecord as GitGovCycleRecord, index$q_GitGovError as GitGovError, index$q_GitGovExecutionRecord as GitGovExecutionRecord, index$q_GitGovFeedbackRecord as GitGovFeedbackRecord, index$q_GitGovRecord as GitGovRecord, index$q_GitGovRecordPayload as GitGovRecordPayload, index$q_GitGovRecordType as GitGovRecordType, index$q_GitGovTaskRecord as GitGovTaskRecord, index$q_Signature as Signature, index$q_TaskPayload as TaskPayload, index$q_TaskRecord as TaskRecord, type index$q_WorkflowRecord as WorkflowRecord };
219
218
  }
220
219
 
221
220
  declare const index$p_DEFAULT_ID_ENCODER: typeof DEFAULT_ID_ENCODER;
@@ -479,6 +478,11 @@ declare class LintModule implements ILintModule {
479
478
  * @returns Array of lint results
480
479
  */
481
480
  lintRecord(record: GitGovRecord, context: LintRecordContext): LintResult[];
481
+ /**
482
+ * Validates typed references by prefix (pure, no I/O).
483
+ * Delegates to private validateTypedReferencesByPrefix.
484
+ */
485
+ lintRecordReferences(record: GitGovRecord, context: LintRecordContext): LintResult[];
482
486
  /**
483
487
  * Validates all records from stores.
484
488
  * Iterates this.stores to collect records, then validates each one.
@@ -508,6 +512,14 @@ declare class LintModule implements ILintModule {
508
512
  * @private
509
513
  */
510
514
  private validateTimestamps;
515
+ /**
516
+ * [EARS-E2] Validates typed references by prefix.
517
+ * Valid prefixes: file:, task:, cycle:, adapter:, url:, commit:, pr:
518
+ * Reports a warning for unknown prefixes and an error for empty values after known prefix.
519
+ * Pure — does not resolve actual references.
520
+ * @private
521
+ */
522
+ private validateTypedReferencesByPrefix;
511
523
  /**
512
524
  * [EARS-E1] through [EARS-E6] Validates references.
513
525
  * Uses Store<T> for lookups.
@@ -551,15 +563,15 @@ declare class LintModule implements ILintModule {
551
563
  */
552
564
  private fixChecksum;
553
565
  /**
554
- * Fixes signature structure issues.
555
- * @private
556
- */
557
- /**
558
- * [EARS-F9] Fixes signature structure issues.
566
+ * [EARS-F9] [EARS-F10] Fixes signature structure issues.
559
567
  *
560
568
  * Preserves valid keyId and role from existing signature if present,
561
569
  * only using options.keyId as fallback when no existing signature exists.
562
570
  *
571
+ * [EARS-F10] When the ONLY problem is a missing `notes` field (no other
572
+ * signature errors exist for this record), adds `notes` WITHOUT regenerating
573
+ * the signature — preserving the existing cryptographic value.
574
+ *
563
575
  * @private
564
576
  */
565
577
  private fixSignature;
@@ -1861,7 +1873,7 @@ type SignatureConfig = Partial<Pick<Signature, 'keyId' | 'role' | 'notes'>> & {
1861
1873
  */
1862
1874
  type CreateEmbeddedMetadataOptions = {
1863
1875
  /** Header configuration (partial override, excludes auto-generated fields) */
1864
- header?: Partial<Pick<EmbeddedMetadataHeader, 'version' | 'type' | 'schemaUrl' | 'schemaChecksum'>>;
1876
+ header?: Partial<Pick<EmbeddedMetadataHeader, 'version' | 'type'>>;
1865
1877
  /** Signature configuration (if not provided, uses default test signature) */
1866
1878
  signature?: SignatureConfig;
1867
1879
  /** Custom signatures array (if provided, overrides signature config) */
@@ -2809,15 +2821,6 @@ declare const Schemas: {
2809
2821
  enum: string[];
2810
2822
  description: string;
2811
2823
  };
2812
- schemaUrl: {
2813
- type: string;
2814
- description: string;
2815
- };
2816
- schemaChecksum: {
2817
- type: string;
2818
- pattern: string;
2819
- description: string;
2820
- };
2821
2824
  payloadChecksum: {
2822
2825
  type: string;
2823
2826
  pattern: string;
@@ -2873,7 +2876,7 @@ declare const Schemas: {
2873
2876
  };
2874
2877
  required: string[];
2875
2878
  additionalProperties: boolean;
2876
- oneOf: ({
2879
+ oneOf: {
2877
2880
  if: {
2878
2881
  properties: {
2879
2882
  header: {
@@ -2891,34 +2894,10 @@ declare const Schemas: {
2891
2894
  payload: {
2892
2895
  $ref: string;
2893
2896
  };
2894
- header?: never;
2895
- };
2896
- };
2897
- else: boolean;
2898
- } | {
2899
- if: {
2900
- properties: {
2901
- header: {
2902
- type: string;
2903
- properties: {
2904
- type: {
2905
- const: string;
2906
- };
2907
- };
2908
- };
2909
- };
2910
- };
2911
- then: {
2912
- properties: {
2913
- header: {
2914
- type: string;
2915
- required: string[];
2916
- };
2917
- payload?: never;
2918
2897
  };
2919
2898
  };
2920
2899
  else: boolean;
2921
- })[];
2900
+ }[];
2922
2901
  examples: ({
2923
2902
  header: {
2924
2903
  version: string;
@@ -4500,15 +4479,6 @@ declare function getSchema(name: SchemaName): {
4500
4479
  enum: string[];
4501
4480
  description: string;
4502
4481
  };
4503
- schemaUrl: {
4504
- type: string;
4505
- description: string;
4506
- };
4507
- schemaChecksum: {
4508
- type: string;
4509
- pattern: string;
4510
- description: string;
4511
- };
4512
4482
  payloadChecksum: {
4513
4483
  type: string;
4514
4484
  pattern: string;
@@ -4564,7 +4534,7 @@ declare function getSchema(name: SchemaName): {
4564
4534
  };
4565
4535
  required: string[];
4566
4536
  additionalProperties: boolean;
4567
- oneOf: ({
4537
+ oneOf: {
4568
4538
  if: {
4569
4539
  properties: {
4570
4540
  header: {
@@ -4582,34 +4552,10 @@ declare function getSchema(name: SchemaName): {
4582
4552
  payload: {
4583
4553
  $ref: string;
4584
4554
  };
4585
- header?: never;
4586
4555
  };
4587
4556
  };
4588
4557
  else: boolean;
4589
- } | {
4590
- if: {
4591
- properties: {
4592
- header: {
4593
- type: string;
4594
- properties: {
4595
- type: {
4596
- const: string;
4597
- };
4598
- };
4599
- };
4600
- };
4601
- };
4602
- then: {
4603
- properties: {
4604
- header: {
4605
- type: string;
4606
- required: string[];
4607
- };
4608
- payload?: never;
4609
- };
4610
- };
4611
- else: boolean;
4612
- })[];
4558
+ }[];
4613
4559
  examples: ({
4614
4560
  header: {
4615
4561
  version: string;
@@ -7127,4 +7073,4 @@ declare namespace index {
7127
7073
  export { type index_ActiveWaiver as ActiveWaiver, type index_AuditContentsInput as AuditContentsInput, type index_AuditOptions as AuditOptions, type index_AuditResult as AuditResult, type index_AuditScope as AuditScope, type index_AuditSummary as AuditSummary, type index_AuditTarget as AuditTarget, type index_CodeScope as CodeScope, type index_CreateWaiverOptions as CreateWaiverOptions, type index_FailOnSeverity as FailOnSeverity, type index_FileContent as FileContent, type index_GitgovScope as GitgovScope, type index_GroupByOption as GroupByOption, type index_IWaiverReader as IWaiverReader, type index_JiraScope as JiraScope, type index_OutputFormat as OutputFormat, type index_ScopeConfig as ScopeConfig, index_ScopeSelector as ScopeSelector, index_ScoringEngine as ScoringEngine, type index_SourceAuditorDependencies as SourceAuditorDependencies, index_SourceAuditorModule as SourceAuditorModule, type index_WaiverMetadata as WaiverMetadata, index_WaiverReader as WaiverReader, type index_WaiverStatus as WaiverStatus, index_WaiverWriter as WaiverWriter };
7128
7074
  }
7129
7075
 
7130
- export { ActivityEvent, ActorRecord, ActorState, index$c as Adapters, AgentRecord, AgentResponse, AllRecords, AuditState, AuditStateReport, index$f as BacklogAdapter, index$g as ChangelogAdapter, ChangelogRecord, CollaborationMetrics, index$r as Config, index$b as Crypto, CustomRecord, CycleRecord, DerivedStates, index$2 as DiagramGenerator, EmbeddedMetadataRecord, EnrichedTaskRecord, EnvironmentValidation, index$n as EventBus, index$j as ExecutionAdapter, ExecutionRecord, index$a as Factories, index$i as FeedbackAdapter, FeedbackRecord, index$8 as FileLister, index$1 as FindingDetector, FixReport, GitGovActorRecord, GitGovAgentRecord, GitGovChangelogRecord, GitGovConfig, GitGovCycleRecord, GitGovExecutionRecord, GitGovFeedbackRecord, GitGovRecord, GitGovRecordPayload, GitGovRecordType, GitGovTaskRecord, type IAgentAdapter, IAgentRunner, type IBacklogAdapter, IConfigManager, IExecutionAdapter, type IFeedbackAdapter, FileLister as IFileLister, IIdentityAdapter, KeyProvider as IKeyProvider, ILintModule, IRecordMetrics, IRecordProjection, IRecordProjector, ISessionManager, ISyncStateModule, IdEncoder, index$l as IdentityAdapter, IndexData, IndexGenerationReport, IntegrityReport, index$9 as KeyProvider, index$k as Lint, LintOptions, LintReport$1 as LintReport, LintResult, index$7 as Logger, ProductivityMetrics, index$d as ProjectAdapter, type ProjectInitResult, index$e as ProjectInitializer, ProjectionContext, index$o as RecordMetrics, RecordMetricsDependencies, index$m as RecordProjection, RecordProjectorDependencies, RecordStore, RecordStores$1 as RecordStores, index$q as Records, RunOptions, index$3 as Runner, index$6 as Schemas, index$s as Session, Signature, index as SourceAuditor, index$p as Store, index$5 as SyncState, SyncStatePullResult, SyncStatePushResult, SyncStateResolveResult, SyncStatus, SystemStatus, TaskHealthReport, TaskRecord, index$4 as Validation, ValidatorType, index$h as WorkflowAdapter, type WorkflowRecord };
7076
+ export { ActivityEvent, ActorRecord, ActorState, index$c as Adapters, AgentRecord, AgentResponse, AllRecords, AuditState, AuditStateReport, index$f as BacklogAdapter, index$g as ChangelogAdapter, ChangelogRecord, CollaborationMetrics, index$r as Config, index$b as Crypto, CycleRecord, DerivedStates, index$2 as DiagramGenerator, EmbeddedMetadataRecord, EnrichedTaskRecord, EnvironmentValidation, index$n as EventBus, index$j as ExecutionAdapter, ExecutionRecord, index$a as Factories, index$i as FeedbackAdapter, FeedbackRecord, index$8 as FileLister, index$1 as FindingDetector, FixReport, GitGovActorRecord, GitGovAgentRecord, GitGovChangelogRecord, GitGovConfig, GitGovCycleRecord, GitGovExecutionRecord, GitGovFeedbackRecord, GitGovRecord, GitGovRecordPayload, GitGovRecordType, GitGovTaskRecord, type IAgentAdapter, IAgentRunner, type IBacklogAdapter, IConfigManager, IExecutionAdapter, type IFeedbackAdapter, FileLister as IFileLister, IIdentityAdapter, KeyProvider as IKeyProvider, ILintModule, IRecordMetrics, IRecordProjection, IRecordProjector, ISessionManager, ISyncStateModule, IdEncoder, index$l as IdentityAdapter, IndexData, IndexGenerationReport, IntegrityReport, index$9 as KeyProvider, index$k as Lint, LintOptions, LintReport$1 as LintReport, LintResult, index$7 as Logger, ProductivityMetrics, index$d as ProjectAdapter, type ProjectInitResult, index$e as ProjectInitializer, ProjectionContext, index$o as RecordMetrics, RecordMetricsDependencies, index$m as RecordProjection, RecordProjectorDependencies, RecordStore, RecordStores$1 as RecordStores, index$q as Records, RunOptions, index$3 as Runner, index$6 as Schemas, index$s as Session, Signature, index as SourceAuditor, index$p as Store, index$5 as SyncState, SyncStatePullResult, SyncStatePushResult, SyncStateResolveResult, SyncStatus, SystemStatus, TaskHealthReport, TaskRecord, index$4 as Validation, ValidatorType, index$h as WorkflowAdapter, type WorkflowRecord };
package/dist/src/index.js CHANGED
@@ -985,20 +985,10 @@ var embedded_metadata_schema_default = {
985
985
  "execution",
986
986
  "changelog",
987
987
  "feedback",
988
- "cycle",
989
- "custom"
988
+ "cycle"
990
989
  ],
991
990
  description: "The type of the record contained in the payload."
992
991
  },
993
- schemaUrl: {
994
- type: "string",
995
- description: "Optional URL to a custom schema for the payload."
996
- },
997
- schemaChecksum: {
998
- type: "string",
999
- pattern: "^[a-fA-F0-9]{64}$",
1000
- description: "Optional SHA-256 checksum of the custom schema."
1001
- },
1002
992
  payloadChecksum: {
1003
993
  type: "string",
1004
994
  pattern: "^[a-fA-F0-9]{64}$",
@@ -1222,32 +1212,6 @@ var embedded_metadata_schema_default = {
1222
1212
  }
1223
1213
  },
1224
1214
  else: false
1225
- },
1226
- {
1227
- if: {
1228
- properties: {
1229
- header: {
1230
- type: "object",
1231
- properties: {
1232
- type: {
1233
- const: "custom"
1234
- }
1235
- }
1236
- }
1237
- }
1238
- },
1239
- then: {
1240
- properties: {
1241
- header: {
1242
- type: "object",
1243
- required: [
1244
- "schemaUrl",
1245
- "schemaChecksum"
1246
- ]
1247
- }
1248
- }
1249
- },
1250
- else: false
1251
1215
  }
1252
1216
  ],
1253
1217
  examples: [
@@ -6915,7 +6879,7 @@ function inferTypeFromPayload(payload) {
6915
6879
  if ("status" in payload && "taskIds" in payload) return "cycle";
6916
6880
  if ("priority" in payload && "description" in payload) return "task";
6917
6881
  if ("displayName" in payload && "publicKey" in payload) return "actor";
6918
- return "custom";
6882
+ return "task";
6919
6883
  }
6920
6884
  function createEmbeddedMetadataRecord(payload, options = {}) {
6921
6885
  const inferredType = inferTypeFromPayload(payload);
@@ -6940,11 +6904,7 @@ function createEmbeddedMetadataRecord(payload, options = {}) {
6940
6904
  // Always 1.0 (schema enforces this)
6941
6905
  type,
6942
6906
  payloadChecksum,
6943
- signatures,
6944
- ...type === "custom" && {
6945
- schemaUrl: options.header?.schemaUrl,
6946
- schemaChecksum: options.header?.schemaChecksum
6947
- }
6907
+ signatures
6948
6908
  };
6949
6909
  const embeddedRecord = {
6950
6910
  header,
@@ -7693,6 +7653,22 @@ var LintModule = class {
7693
7653
  }
7694
7654
  return results;
7695
7655
  }
7656
+ /**
7657
+ * Validates typed references by prefix (pure, no I/O).
7658
+ * Delegates to private validateTypedReferencesByPrefix.
7659
+ */
7660
+ lintRecordReferences(record, context) {
7661
+ const payload = record.payload;
7662
+ if (!Array.isArray(payload.references) || payload.references.length === 0) {
7663
+ return [];
7664
+ }
7665
+ return this.validateTypedReferencesByPrefix(
7666
+ payload.references,
7667
+ context.recordId,
7668
+ context.filePath || `unknown/${context.recordId}.json`,
7669
+ context.entityType
7670
+ );
7671
+ }
7696
7672
  /**
7697
7673
  * Validates all records from stores.
7698
7674
  * Iterates this.stores to collect records, then validates each one.
@@ -7810,7 +7786,7 @@ var LintModule = class {
7810
7786
  fixedRecord = this.fixChecksum(fixedRecord);
7811
7787
  break;
7812
7788
  case "SIGNATURE_STRUCTURE":
7813
- fixedRecord = this.fixSignature(fixedRecord, result, options);
7789
+ fixedRecord = this.fixSignature(fixedRecord, result, options, fixableResults);
7814
7790
  break;
7815
7791
  // BIDIRECTIONAL_CONSISTENCY requires modifying OTHER records
7816
7792
  // This must be handled by FsLintModule which can write multiple files
@@ -7909,6 +7885,45 @@ var LintModule = class {
7909
7885
  }
7910
7886
  return results;
7911
7887
  }
7888
+ /**
7889
+ * [EARS-E2] Validates typed references by prefix.
7890
+ * Valid prefixes: file:, task:, cycle:, adapter:, url:, commit:, pr:
7891
+ * Reports a warning for unknown prefixes and an error for empty values after known prefix.
7892
+ * Pure — does not resolve actual references.
7893
+ * @private
7894
+ */
7895
+ validateTypedReferencesByPrefix(references, recordId, filePath, entityType) {
7896
+ const VALID_PREFIXES = ["file:", "task:", "cycle:", "adapter:", "url:", "commit:", "pr:"];
7897
+ const results = [];
7898
+ for (const ref of references) {
7899
+ const matchedPrefix = VALID_PREFIXES.find((p) => ref.startsWith(p));
7900
+ if (!matchedPrefix) {
7901
+ results.push({
7902
+ level: "warning",
7903
+ filePath,
7904
+ validator: "REFERENTIAL_INTEGRITY",
7905
+ message: `Reference '${ref}' has an unknown prefix. Valid prefixes: ${VALID_PREFIXES.join(", ")}`,
7906
+ entity: { type: entityType, id: recordId },
7907
+ fixable: false,
7908
+ context: { field: "references", actual: ref, expected: "reference with valid prefix" }
7909
+ });
7910
+ } else {
7911
+ const value = ref.slice(matchedPrefix.length);
7912
+ if (!value) {
7913
+ results.push({
7914
+ level: "error",
7915
+ filePath,
7916
+ validator: "REFERENTIAL_INTEGRITY",
7917
+ message: `Reference '${ref}' has prefix '${matchedPrefix}' but no value after it`,
7918
+ entity: { type: entityType, id: recordId },
7919
+ fixable: false,
7920
+ context: { field: "references", actual: ref, expected: `${matchedPrefix}<non-empty-value>` }
7921
+ });
7922
+ }
7923
+ }
7924
+ }
7925
+ return results;
7926
+ }
7912
7927
  /**
7913
7928
  * [EARS-E1] through [EARS-E6] Validates references.
7914
7929
  * Uses Store<T> for lookups.
@@ -7917,6 +7932,16 @@ var LintModule = class {
7917
7932
  async validateReferences(record, recordId, filePath, entityType) {
7918
7933
  const results = [];
7919
7934
  const payload = record.payload;
7935
+ const payloadWithRefs = payload;
7936
+ if (Array.isArray(payloadWithRefs.references) && payloadWithRefs.references.length > 0) {
7937
+ const prefixResults = this.validateTypedReferencesByPrefix(
7938
+ payloadWithRefs.references,
7939
+ recordId,
7940
+ filePath,
7941
+ entityType
7942
+ );
7943
+ results.push(...prefixResults);
7944
+ }
7920
7945
  const taskStore = this.stores.tasks;
7921
7946
  const cycleStore = this.stores.cycles;
7922
7947
  if (entityType === "execution" && isExecutionPayload(payload) && payload.taskId && taskStore) {
@@ -8119,23 +8144,59 @@ var LintModule = class {
8119
8144
  };
8120
8145
  }
8121
8146
  /**
8122
- * Fixes signature structure issues.
8123
- * @private
8124
- */
8125
- /**
8126
- * [EARS-F9] Fixes signature structure issues.
8147
+ * [EARS-F9] [EARS-F10] Fixes signature structure issues.
8127
8148
  *
8128
8149
  * Preserves valid keyId and role from existing signature if present,
8129
8150
  * only using options.keyId as fallback when no existing signature exists.
8130
8151
  *
8152
+ * [EARS-F10] When the ONLY problem is a missing `notes` field (no other
8153
+ * signature errors exist for this record), adds `notes` WITHOUT regenerating
8154
+ * the signature — preserving the existing cryptographic value.
8155
+ *
8131
8156
  * @private
8132
8157
  */
8133
- fixSignature(record, result, options) {
8158
+ fixSignature(record, result, options, allResults) {
8134
8159
  if (!options.privateKey) {
8135
8160
  throw new Error("privateKey is required to fix signature");
8136
8161
  }
8137
- const payloadChecksum = calculatePayloadChecksum(record.payload);
8138
8162
  const existingSig = record.header?.signatures?.[0];
8163
+ const isOnlyMissingNotes = (() => {
8164
+ if (!result.message.includes("must have required property 'notes'")) {
8165
+ return false;
8166
+ }
8167
+ if (allResults) {
8168
+ const otherSigErrors = allResults.filter(
8169
+ (r) => r !== result && r.validator === "SIGNATURE_STRUCTURE" && r.entity.id === result.entity.id && r.fixable
8170
+ );
8171
+ if (otherSigErrors.length > 0) {
8172
+ return false;
8173
+ }
8174
+ }
8175
+ const sigValue = existingSig?.signature;
8176
+ if (!sigValue || !/^[A-Za-z0-9+/]{86}==$/.test(sigValue)) {
8177
+ return false;
8178
+ }
8179
+ return true;
8180
+ })();
8181
+ if (isOnlyMissingNotes && existingSig) {
8182
+ const fixedSig = {
8183
+ keyId: existingSig.keyId,
8184
+ role: existingSig.role,
8185
+ notes: "Signature notes added by lint fix",
8186
+ signature: existingSig.signature,
8187
+ timestamp: existingSig.timestamp
8188
+ };
8189
+ const payloadChecksum2 = calculatePayloadChecksum(record.payload);
8190
+ return {
8191
+ header: {
8192
+ ...record.header,
8193
+ payloadChecksum: payloadChecksum2,
8194
+ signatures: [fixedSig]
8195
+ },
8196
+ payload: record.payload
8197
+ };
8198
+ }
8199
+ const payloadChecksum = calculatePayloadChecksum(record.payload);
8139
8200
  const keyId = existingSig?.keyId || options.keyId || result.entity.id;
8140
8201
  const role = existingSig?.role || "author";
8141
8202
  const notes = existingSig?.notes || "Signature regenerated by lint fix";