artifact-graph 0.10.0 → 0.11.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.
package/dist/index.d.cts CHANGED
@@ -48,6 +48,95 @@ declare function parseTargetSelector(value: string): ArtifactTarget;
48
48
  */
49
49
  declare function resolveCliTarget(flags: Record<string, string | boolean>, schema: ArtifactSchema): ArtifactTarget;
50
50
 
51
+ type ImpactMode = 'worktree' | 'staged' | 'base' | 'paths';
52
+ interface ImpactOptions {
53
+ mode?: ImpactMode;
54
+ base?: string;
55
+ paths?: string[];
56
+ schema?: ArtifactSchema;
57
+ }
58
+ interface ImpactNodeRef {
59
+ uid: string;
60
+ type: string;
61
+ code: string;
62
+ title: string;
63
+ path: string;
64
+ }
65
+ interface ImpactEdgeRef {
66
+ from: string;
67
+ to: string;
68
+ kind: string;
69
+ sourcePath: string;
70
+ sourceLine?: number;
71
+ attrs?: Record<string, unknown>;
72
+ }
73
+ interface ImpactReport {
74
+ schemaVersion: '1.0';
75
+ root: string;
76
+ mode: ImpactMode;
77
+ base?: string;
78
+ changedPaths: string[];
79
+ directNodes: ImpactNodeRef[];
80
+ relatedNodes: ImpactNodeRef[];
81
+ affectedEdges: ImpactEdgeRef[];
82
+ scopedUnresolvedPaths: string[];
83
+ graphControlPaths: string[];
84
+ unmappedPaths: string[];
85
+ writes: 'none';
86
+ }
87
+ declare function computeImpact(root: string, options?: ImpactOptions): Promise<ImpactReport>;
88
+ declare function renderImpactMarkdown(report: ImpactReport): string;
89
+
90
+ interface DeclaredVerificationReference {
91
+ from: string;
92
+ to: string;
93
+ kind: string;
94
+ sourcePath: string;
95
+ sourceLine: number;
96
+ }
97
+ interface CoverageBoundaryReport {
98
+ schemaVersion: '1.0';
99
+ root: string;
100
+ graphHealth: {
101
+ validateIssues: number;
102
+ errorCount: number;
103
+ lockIssues: number;
104
+ relationLocks: {
105
+ declared: number;
106
+ locked: number;
107
+ fresh: number;
108
+ };
109
+ assessment: 'healthy-with-declarations' | 'healthy-no-declarations' | 'issues';
110
+ };
111
+ scanCoverage: {
112
+ configuredTypes: string[];
113
+ scannedFiles: number;
114
+ mappedFiles: number;
115
+ changedPathScope: 'worktree' | 'unavailable';
116
+ scopedUnresolved: string[];
117
+ unmapped: string[];
118
+ };
119
+ behaviorVerification: {
120
+ status: 'not-evaluated';
121
+ declaredReferences: DeclaredVerificationReference[];
122
+ note: string;
123
+ };
124
+ releaseCoverage: {
125
+ source: 'caller' | 'none';
126
+ inputList?: string[];
127
+ mappedPaths: string[];
128
+ unmappedPaths: string[];
129
+ status: 'not-requested' | 'unknown';
130
+ evidence: [];
131
+ note: string;
132
+ };
133
+ }
134
+ declare function computeCoverageBoundary(root: string, opts?: {
135
+ schema?: ArtifactSchema;
136
+ releaseInput?: string[];
137
+ }): Promise<CoverageBoundaryReport>;
138
+ declare function renderCoverageBoundaryMarkdown(report: CoverageBoundaryReport): string;
139
+
51
140
  /**
52
141
  * packet-assembler.ts
53
142
  *
@@ -167,6 +256,8 @@ interface ImplementationPacket {
167
256
  validationCommands: string[];
168
257
  /** Explicit universal baseline policy: true=enabled, false=disabled. Absent=legacy (pre-0.5) packet. */
169
258
  baselinePolicy?: boolean;
259
+ /** Present only when context resolution used an explicit time view. */
260
+ viewSelection?: ViewSelection;
170
261
  }
171
262
  /**
172
263
  * Assemble an implementation packet from a context manifest.
@@ -1235,6 +1326,7 @@ interface ArtifactEdge {
1235
1326
  source: string;
1236
1327
  sourcePath: string;
1237
1328
  sourceLine: number;
1329
+ attrs?: Record<string, unknown>;
1238
1330
  }
1239
1331
  interface ValidationIssue {
1240
1332
  code: string;
@@ -1269,6 +1361,16 @@ interface ArtifactEdgeRule {
1269
1361
  to: string;
1270
1362
  kind: string;
1271
1363
  }
1364
+ type TimeBucket = 'current' | 'planned' | 'history';
1365
+ type TimeView = TimeBucket | 'all';
1366
+ interface RelationSemanticsSpec {
1367
+ label: string;
1368
+ targetTypes: string[];
1369
+ fields: string[];
1370
+ partial?: {
1371
+ sectionField: string;
1372
+ };
1373
+ }
1272
1374
  /** E2E test runner configuration */
1273
1375
  interface E2eRunnerConfig {
1274
1376
  /** Runner name (e.g., 'playwright', 'vitest', 'jest') */
@@ -1301,6 +1403,10 @@ interface ArtifactSchema {
1301
1403
  start: number;
1302
1404
  end: number;
1303
1405
  }>>;
1406
+ /** Optional, domain-configured relation kinds and their frontmatter fields. */
1407
+ relationSemantics?: Record<string, RelationSemanticsSpec>;
1408
+ /** Optional mapping from domain status words to time-view buckets. */
1409
+ statusViews?: Record<string, TimeBucket>;
1304
1410
  /** Context resolution overrides */
1305
1411
  context?: {
1306
1412
  /** When false, skip universal baseline injection. Default: true. */
@@ -1353,11 +1459,36 @@ interface ArtifactGraph {
1353
1459
  root?: string;
1354
1460
  /** Scan-time diagnostics. Optional for backward compatibility with consumers that build graph literals without this field. */
1355
1461
  diagnostics?: ValidationIssue[];
1462
+ /** Present only for an explicit time-view query. */
1463
+ viewSelection?: ViewSelection;
1356
1464
  }
1357
1465
  interface QueryOptions {
1358
1466
  from?: string;
1359
1467
  to?: string;
1360
1468
  depth?: number;
1469
+ view?: TimeView;
1470
+ schema?: ArtifactSchema;
1471
+ }
1472
+ interface NodeTimeView {
1473
+ bucket: TimeBucket | 'uncategorized';
1474
+ basis: string;
1475
+ }
1476
+ interface ViewExcludedNode {
1477
+ uid: string;
1478
+ bucket: TimeBucket | 'uncategorized';
1479
+ basis: string;
1480
+ }
1481
+ interface PartialSupersedeAnnotation {
1482
+ targetUid: string;
1483
+ supersededBy: string;
1484
+ sections: string[];
1485
+ sourcePath: string;
1486
+ sourceLine: number;
1487
+ }
1488
+ interface ViewSelection {
1489
+ view: TimeBucket;
1490
+ excluded: ViewExcludedNode[];
1491
+ partialSupersedes: PartialSupersedeAnnotation[];
1361
1492
  }
1362
1493
  type ContextTier = 'baseline' | 'target' | 'direct' | 'matrix' | 'transitive';
1363
1494
  interface ContextItem {
@@ -1390,6 +1521,8 @@ interface ContextManifest {
1390
1521
  omitted?: ContextItem[];
1391
1522
  /** Explicit universal baseline policy: true=enabled, false=disabled. Used by validatePacket to prevent inferring opt-out from total=0. */
1392
1523
  baselinePolicy?: boolean;
1524
+ /** Present only when the caller explicitly selects a time view. */
1525
+ viewSelection?: ViewSelection;
1393
1526
  }
1394
1527
  type ContextMode = 'full' | 'implementation';
1395
1528
  interface ContextOptions {
@@ -1410,6 +1543,8 @@ interface ContextOptions {
1410
1543
  universalBaseline?: boolean;
1411
1544
  /** Project root for baseline file existence checks. Required when universalBaseline is true. */
1412
1545
  root?: string;
1546
+ view?: TimeView;
1547
+ schema?: ArtifactSchema;
1413
1548
  }
1414
1549
  declare const DEFAULT_SCHEMA: ArtifactSchema;
1415
1550
  declare function loadConfig(root: string): Promise<ArtifactSchema>;
@@ -1423,8 +1558,21 @@ declare function scanArtifacts(root: string, schema?: ArtifactSchema): Promise<A
1423
1558
  */
1424
1559
  declare function resolveMatrixEdges(graph: ArtifactGraph): ArtifactGraph;
1425
1560
  declare function validateGraph(graph: ArtifactGraph, schema?: ArtifactSchema): ValidationIssue[];
1561
+ interface ExternalEntryInfo {
1562
+ external: boolean;
1563
+ targetProject?: string;
1564
+ targetRef?: string;
1565
+ targetVersion?: string;
1566
+ }
1567
+ declare function getExternalEntryInfo(node: ArtifactNode): ExternalEntryInfo;
1426
1568
  declare function validateScenarioPrdLinks(graph: ArtifactGraph, schema?: ArtifactSchema): ValidationIssue[];
1427
1569
  declare function validateScenarioPrdLinkIndex(root: string, graph: ArtifactGraph): Promise<ValidationIssue[]>;
1570
+ declare function resolveNodeTimeView(node: ArtifactNode, graph: ArtifactGraph, schema?: ArtifactSchema): NodeTimeView;
1571
+ declare function filterGraphByView(graph: ArtifactGraph, view: TimeView | undefined, schema?: ArtifactSchema): {
1572
+ graph: ArtifactGraph;
1573
+ excluded: ViewExcludedNode[];
1574
+ partialSupersedes: PartialSupersedeAnnotation[];
1575
+ };
1428
1576
  declare function queryGraph(graph: ArtifactGraph, options: QueryOptions): ArtifactGraph;
1429
1577
  declare function renderMermaid(graph: ArtifactGraph): string;
1430
1578
  declare function nextId(graph: ArtifactGraph, schema: ArtifactSchema, type: string, rangeName: string): string;
@@ -1530,4 +1678,4 @@ declare function discoverTargets(graph: ArtifactGraph, options?: DiscoverOptions
1530
1678
  declare function resolveArtifactContext(graph: ArtifactGraph, opts: ContextOptions): ContextManifest;
1531
1679
  declare function formatContextMarkdown(manifest: ContextManifest): string;
1532
1680
 
1533
- export { ALWAYS_PRESENT_ITEMS as ALWAYS_PRESENT, type ArtifactChainDoctorReport, type ArtifactEdge, type ArtifactEdgeRule, type ArtifactExtraFieldSchema, type ArtifactGraph, type ArtifactGraphCliCandidate, type ArtifactGraphCliResolution, type ArtifactGraphCliSource, type ArtifactNode, type ArtifactSchema, type ArtifactTarget, type ArtifactTypeMetadata, type ArtifactTypeRole, type ArtifactTypeSchema, BASELINE_CONSTRAINTS, BASELINE_CONSTRAINTS_COUNT, BASELINE_ITEMS_COUNT, type BatchDefinition, CONTRACT_ERROR_CODES, type CanonicalIR, type CollectChangedPathsOptions, type ContextItem, type ContextManifest, type ContextMode, type ContextOptions, type ContextTier, ContractCatalog, type ContractCatalogEntry, type ContractDefinition, ContractError, type ContractErrorCode, type ContractIdentity, ContractRegistry, type ContractRegistryEntry, type ContractSchema, DEFAULT_MAX_CHARS, DEFAULT_SCHEMA, type DiscoverOptions, E2E_NORMALIZER_CONFIG, type E2eCoverageStats, type E2eCoverageThresholds, type E2eRegistry, type E2eRegistryBatch, type E2eRunnerConfig, type E2eWaiver, type Evidence, type EvidenceObject, type ExecutorType, type Finding, type FindingLocation, type FindingSeverity, type FindingStatus, type GitChangeMode, type GitChangeResult, type GitHookName, type HookInstallResult, type ImplementationBlueprintDraft, type ImplementationPacket, type LegacyFieldMapping, type LoadContractOptions, MIN_PROMPT_CHARS, type ManagedHookBlockOptions, type MissingDetail, type NormalizationResult, type NormalizerConfig, type PacketAuditEntry, type PacketAuditSummary, type PacketCategory, type PacketItem, type PacketOmittedItem, type PacketOptions, type PacketPromptError, type PacketPromptOptions, type PacketTarget, type PacketTargetType, type PacketValidationIssue, type PacketValidationResult, type PolicyCompatibilityResult, type PreparedManagedHookBlock, type Producer, type ProjectPolicy, type PromptValidationIssue, type PromptValidationResult, type QueryOptions, type RepairData, type RepairValidation, type ResolveArtifactGraphCliOptions, type ReviewData, type ReviewDecision, type ReviewMetrics, type ReviewOrderStep, type ReviewResult, type ReviewStatus, type RiskChecklistItem, type SchemaValidationResult, TARGET_ARTIFACT_TYPES, type TargetArtifactType, type TraceVersionResult, VALID_PACKET_TARGET_TYPES, VERSION_INDEX_SCHEMA_VERSION, VERSION_LOCK_PATH, VERSION_LOCK_SCHEMA_VERSION, type ValidationError, type ValidationIssue, type VersionEdgeKind, type VersionIndex, type VersionLockAuditMarkdownOptions, type VersionLockAuditResult, type VersionLockBootstrapOptions, type VersionLockEntry, type VersionLockFile, type VersionLockIssue, type VersionLockIssueSeverity, type VersionLockRef, type VersionLockRefreshOptions, type VersionLockRefreshResult, type VersionLockSourceRef, type VersionLockStatus, type VersionLockUpdateOptions, type VersionSourceKind, type VersionedEdge, type VersionedNode, applyPreparedManagedHookBlocks, assemblePacket, auditPackets, auditVersionLock, bootstrapVersionLock, buildGraph, buildVersionIndex, collectChangedPaths, computeE2eCoverageStats, computeRevisionDigest, discoverAndAuditPackets, discoverTargets, doctorArtifactChain, formatContextMarkdown, generateE2eRegistry, getArtifactTypeMetadata, getTargetArtifactTypes, installManagedHookBlock, isOfficialNamespace, isPacketTargetType, isPacketTargetTypeDynamic, isTargetArtifactType, isVersionLockIssueBlocking, loadConfig, loadContract, loadContractCatalog, loadContractsFromDirectory, matchesConfiguredArtifactPath, nextId, normalizeE2eLegacyArtifact, normalizeToCanonical, parseTargetSelector, parseTargetsFile, prepareManagedHookBlock, queryGraph, refreshVersionLock, renderDoctorMarkdown, renderMermaid, renderPacketMarkdown, renderPacketPrompt, renderTraceVersionMarkdown, renderVersionLockAuditMarkdown, renderVersionLockRefreshMarkdown, resolveArtifactContext, resolveArtifactGraphCli, resolveArtifactTypeName, resolveCliTarget, resolveGitHookPath, resolveMatrixEdges, scanArtifacts, traceVersion, updateVersionLock, validateContractAgainstSchema, validateExecutableTraceability, validateGraph, validateNamespaceAuthority, validatePacket, validatePacketMarkdown, validatePacketPrompt, validatePolicyCompatibility, validateReviewResult, validateScenarioPrdLinkIndex, validateScenarioPrdLinks, verifyDigest, versionLockIssueSeverity, writeGraphCache };
1681
+ export { ALWAYS_PRESENT_ITEMS as ALWAYS_PRESENT, type ArtifactChainDoctorReport, type ArtifactEdge, type ArtifactEdgeRule, type ArtifactExtraFieldSchema, type ArtifactGraph, type ArtifactGraphCliCandidate, type ArtifactGraphCliResolution, type ArtifactGraphCliSource, type ArtifactNode, type ArtifactSchema, type ArtifactTarget, type ArtifactTypeMetadata, type ArtifactTypeRole, type ArtifactTypeSchema, BASELINE_CONSTRAINTS, BASELINE_CONSTRAINTS_COUNT, BASELINE_ITEMS_COUNT, type BatchDefinition, CONTRACT_ERROR_CODES, type CanonicalIR, type CollectChangedPathsOptions, type ContextItem, type ContextManifest, type ContextMode, type ContextOptions, type ContextTier, ContractCatalog, type ContractCatalogEntry, type ContractDefinition, ContractError, type ContractErrorCode, type ContractIdentity, ContractRegistry, type ContractRegistryEntry, type ContractSchema, type CoverageBoundaryReport, DEFAULT_MAX_CHARS, DEFAULT_SCHEMA, type DeclaredVerificationReference, type DiscoverOptions, E2E_NORMALIZER_CONFIG, type E2eCoverageStats, type E2eCoverageThresholds, type E2eRegistry, type E2eRegistryBatch, type E2eRunnerConfig, type E2eWaiver, type Evidence, type EvidenceObject, type ExecutorType, type ExternalEntryInfo, type Finding, type FindingLocation, type FindingSeverity, type FindingStatus, type GitChangeMode, type GitChangeResult, type GitHookName, type HookInstallResult, type ImpactEdgeRef, type ImpactMode, type ImpactNodeRef, type ImpactOptions, type ImpactReport, type ImplementationBlueprintDraft, type ImplementationPacket, type LegacyFieldMapping, type LoadContractOptions, MIN_PROMPT_CHARS, type ManagedHookBlockOptions, type MissingDetail, type NodeTimeView, type NormalizationResult, type NormalizerConfig, type PacketAuditEntry, type PacketAuditSummary, type PacketCategory, type PacketItem, type PacketOmittedItem, type PacketOptions, type PacketPromptError, type PacketPromptOptions, type PacketTarget, type PacketTargetType, type PacketValidationIssue, type PacketValidationResult, type PartialSupersedeAnnotation, type PolicyCompatibilityResult, type PreparedManagedHookBlock, type Producer, type ProjectPolicy, type PromptValidationIssue, type PromptValidationResult, type QueryOptions, type RelationSemanticsSpec, type RepairData, type RepairValidation, type ResolveArtifactGraphCliOptions, type ReviewData, type ReviewDecision, type ReviewMetrics, type ReviewOrderStep, type ReviewResult, type ReviewStatus, type RiskChecklistItem, type SchemaValidationResult, TARGET_ARTIFACT_TYPES, type TargetArtifactType, type TimeBucket, type TimeView, type TraceVersionResult, VALID_PACKET_TARGET_TYPES, VERSION_INDEX_SCHEMA_VERSION, VERSION_LOCK_PATH, VERSION_LOCK_SCHEMA_VERSION, type ValidationError, type ValidationIssue, type VersionEdgeKind, type VersionIndex, type VersionLockAuditMarkdownOptions, type VersionLockAuditResult, type VersionLockBootstrapOptions, type VersionLockEntry, type VersionLockFile, type VersionLockIssue, type VersionLockIssueSeverity, type VersionLockRef, type VersionLockRefreshOptions, type VersionLockRefreshResult, type VersionLockSourceRef, type VersionLockStatus, type VersionLockUpdateOptions, type VersionSourceKind, type VersionedEdge, type VersionedNode, type ViewExcludedNode, type ViewSelection, applyPreparedManagedHookBlocks, assemblePacket, auditPackets, auditVersionLock, bootstrapVersionLock, buildGraph, buildVersionIndex, collectChangedPaths, computeCoverageBoundary, computeE2eCoverageStats, computeImpact, computeRevisionDigest, discoverAndAuditPackets, discoverTargets, doctorArtifactChain, filterGraphByView, formatContextMarkdown, generateE2eRegistry, getArtifactTypeMetadata, getExternalEntryInfo, getTargetArtifactTypes, installManagedHookBlock, isOfficialNamespace, isPacketTargetType, isPacketTargetTypeDynamic, isTargetArtifactType, isVersionLockIssueBlocking, loadConfig, loadContract, loadContractCatalog, loadContractsFromDirectory, matchesConfiguredArtifactPath, nextId, normalizeE2eLegacyArtifact, normalizeToCanonical, parseTargetSelector, parseTargetsFile, prepareManagedHookBlock, queryGraph, refreshVersionLock, renderCoverageBoundaryMarkdown, renderDoctorMarkdown, renderImpactMarkdown, renderMermaid, renderPacketMarkdown, renderPacketPrompt, renderTraceVersionMarkdown, renderVersionLockAuditMarkdown, renderVersionLockRefreshMarkdown, resolveArtifactContext, resolveArtifactGraphCli, resolveArtifactTypeName, resolveCliTarget, resolveGitHookPath, resolveMatrixEdges, resolveNodeTimeView, scanArtifacts, traceVersion, updateVersionLock, validateContractAgainstSchema, validateExecutableTraceability, validateGraph, validateNamespaceAuthority, validatePacket, validatePacketMarkdown, validatePacketPrompt, validatePolicyCompatibility, validateReviewResult, validateScenarioPrdLinkIndex, validateScenarioPrdLinks, verifyDigest, versionLockIssueSeverity, writeGraphCache };
package/dist/index.d.ts CHANGED
@@ -48,6 +48,95 @@ declare function parseTargetSelector(value: string): ArtifactTarget;
48
48
  */
49
49
  declare function resolveCliTarget(flags: Record<string, string | boolean>, schema: ArtifactSchema): ArtifactTarget;
50
50
 
51
+ type ImpactMode = 'worktree' | 'staged' | 'base' | 'paths';
52
+ interface ImpactOptions {
53
+ mode?: ImpactMode;
54
+ base?: string;
55
+ paths?: string[];
56
+ schema?: ArtifactSchema;
57
+ }
58
+ interface ImpactNodeRef {
59
+ uid: string;
60
+ type: string;
61
+ code: string;
62
+ title: string;
63
+ path: string;
64
+ }
65
+ interface ImpactEdgeRef {
66
+ from: string;
67
+ to: string;
68
+ kind: string;
69
+ sourcePath: string;
70
+ sourceLine?: number;
71
+ attrs?: Record<string, unknown>;
72
+ }
73
+ interface ImpactReport {
74
+ schemaVersion: '1.0';
75
+ root: string;
76
+ mode: ImpactMode;
77
+ base?: string;
78
+ changedPaths: string[];
79
+ directNodes: ImpactNodeRef[];
80
+ relatedNodes: ImpactNodeRef[];
81
+ affectedEdges: ImpactEdgeRef[];
82
+ scopedUnresolvedPaths: string[];
83
+ graphControlPaths: string[];
84
+ unmappedPaths: string[];
85
+ writes: 'none';
86
+ }
87
+ declare function computeImpact(root: string, options?: ImpactOptions): Promise<ImpactReport>;
88
+ declare function renderImpactMarkdown(report: ImpactReport): string;
89
+
90
+ interface DeclaredVerificationReference {
91
+ from: string;
92
+ to: string;
93
+ kind: string;
94
+ sourcePath: string;
95
+ sourceLine: number;
96
+ }
97
+ interface CoverageBoundaryReport {
98
+ schemaVersion: '1.0';
99
+ root: string;
100
+ graphHealth: {
101
+ validateIssues: number;
102
+ errorCount: number;
103
+ lockIssues: number;
104
+ relationLocks: {
105
+ declared: number;
106
+ locked: number;
107
+ fresh: number;
108
+ };
109
+ assessment: 'healthy-with-declarations' | 'healthy-no-declarations' | 'issues';
110
+ };
111
+ scanCoverage: {
112
+ configuredTypes: string[];
113
+ scannedFiles: number;
114
+ mappedFiles: number;
115
+ changedPathScope: 'worktree' | 'unavailable';
116
+ scopedUnresolved: string[];
117
+ unmapped: string[];
118
+ };
119
+ behaviorVerification: {
120
+ status: 'not-evaluated';
121
+ declaredReferences: DeclaredVerificationReference[];
122
+ note: string;
123
+ };
124
+ releaseCoverage: {
125
+ source: 'caller' | 'none';
126
+ inputList?: string[];
127
+ mappedPaths: string[];
128
+ unmappedPaths: string[];
129
+ status: 'not-requested' | 'unknown';
130
+ evidence: [];
131
+ note: string;
132
+ };
133
+ }
134
+ declare function computeCoverageBoundary(root: string, opts?: {
135
+ schema?: ArtifactSchema;
136
+ releaseInput?: string[];
137
+ }): Promise<CoverageBoundaryReport>;
138
+ declare function renderCoverageBoundaryMarkdown(report: CoverageBoundaryReport): string;
139
+
51
140
  /**
52
141
  * packet-assembler.ts
53
142
  *
@@ -167,6 +256,8 @@ interface ImplementationPacket {
167
256
  validationCommands: string[];
168
257
  /** Explicit universal baseline policy: true=enabled, false=disabled. Absent=legacy (pre-0.5) packet. */
169
258
  baselinePolicy?: boolean;
259
+ /** Present only when context resolution used an explicit time view. */
260
+ viewSelection?: ViewSelection;
170
261
  }
171
262
  /**
172
263
  * Assemble an implementation packet from a context manifest.
@@ -1235,6 +1326,7 @@ interface ArtifactEdge {
1235
1326
  source: string;
1236
1327
  sourcePath: string;
1237
1328
  sourceLine: number;
1329
+ attrs?: Record<string, unknown>;
1238
1330
  }
1239
1331
  interface ValidationIssue {
1240
1332
  code: string;
@@ -1269,6 +1361,16 @@ interface ArtifactEdgeRule {
1269
1361
  to: string;
1270
1362
  kind: string;
1271
1363
  }
1364
+ type TimeBucket = 'current' | 'planned' | 'history';
1365
+ type TimeView = TimeBucket | 'all';
1366
+ interface RelationSemanticsSpec {
1367
+ label: string;
1368
+ targetTypes: string[];
1369
+ fields: string[];
1370
+ partial?: {
1371
+ sectionField: string;
1372
+ };
1373
+ }
1272
1374
  /** E2E test runner configuration */
1273
1375
  interface E2eRunnerConfig {
1274
1376
  /** Runner name (e.g., 'playwright', 'vitest', 'jest') */
@@ -1301,6 +1403,10 @@ interface ArtifactSchema {
1301
1403
  start: number;
1302
1404
  end: number;
1303
1405
  }>>;
1406
+ /** Optional, domain-configured relation kinds and their frontmatter fields. */
1407
+ relationSemantics?: Record<string, RelationSemanticsSpec>;
1408
+ /** Optional mapping from domain status words to time-view buckets. */
1409
+ statusViews?: Record<string, TimeBucket>;
1304
1410
  /** Context resolution overrides */
1305
1411
  context?: {
1306
1412
  /** When false, skip universal baseline injection. Default: true. */
@@ -1353,11 +1459,36 @@ interface ArtifactGraph {
1353
1459
  root?: string;
1354
1460
  /** Scan-time diagnostics. Optional for backward compatibility with consumers that build graph literals without this field. */
1355
1461
  diagnostics?: ValidationIssue[];
1462
+ /** Present only for an explicit time-view query. */
1463
+ viewSelection?: ViewSelection;
1356
1464
  }
1357
1465
  interface QueryOptions {
1358
1466
  from?: string;
1359
1467
  to?: string;
1360
1468
  depth?: number;
1469
+ view?: TimeView;
1470
+ schema?: ArtifactSchema;
1471
+ }
1472
+ interface NodeTimeView {
1473
+ bucket: TimeBucket | 'uncategorized';
1474
+ basis: string;
1475
+ }
1476
+ interface ViewExcludedNode {
1477
+ uid: string;
1478
+ bucket: TimeBucket | 'uncategorized';
1479
+ basis: string;
1480
+ }
1481
+ interface PartialSupersedeAnnotation {
1482
+ targetUid: string;
1483
+ supersededBy: string;
1484
+ sections: string[];
1485
+ sourcePath: string;
1486
+ sourceLine: number;
1487
+ }
1488
+ interface ViewSelection {
1489
+ view: TimeBucket;
1490
+ excluded: ViewExcludedNode[];
1491
+ partialSupersedes: PartialSupersedeAnnotation[];
1361
1492
  }
1362
1493
  type ContextTier = 'baseline' | 'target' | 'direct' | 'matrix' | 'transitive';
1363
1494
  interface ContextItem {
@@ -1390,6 +1521,8 @@ interface ContextManifest {
1390
1521
  omitted?: ContextItem[];
1391
1522
  /** Explicit universal baseline policy: true=enabled, false=disabled. Used by validatePacket to prevent inferring opt-out from total=0. */
1392
1523
  baselinePolicy?: boolean;
1524
+ /** Present only when the caller explicitly selects a time view. */
1525
+ viewSelection?: ViewSelection;
1393
1526
  }
1394
1527
  type ContextMode = 'full' | 'implementation';
1395
1528
  interface ContextOptions {
@@ -1410,6 +1543,8 @@ interface ContextOptions {
1410
1543
  universalBaseline?: boolean;
1411
1544
  /** Project root for baseline file existence checks. Required when universalBaseline is true. */
1412
1545
  root?: string;
1546
+ view?: TimeView;
1547
+ schema?: ArtifactSchema;
1413
1548
  }
1414
1549
  declare const DEFAULT_SCHEMA: ArtifactSchema;
1415
1550
  declare function loadConfig(root: string): Promise<ArtifactSchema>;
@@ -1423,8 +1558,21 @@ declare function scanArtifacts(root: string, schema?: ArtifactSchema): Promise<A
1423
1558
  */
1424
1559
  declare function resolveMatrixEdges(graph: ArtifactGraph): ArtifactGraph;
1425
1560
  declare function validateGraph(graph: ArtifactGraph, schema?: ArtifactSchema): ValidationIssue[];
1561
+ interface ExternalEntryInfo {
1562
+ external: boolean;
1563
+ targetProject?: string;
1564
+ targetRef?: string;
1565
+ targetVersion?: string;
1566
+ }
1567
+ declare function getExternalEntryInfo(node: ArtifactNode): ExternalEntryInfo;
1426
1568
  declare function validateScenarioPrdLinks(graph: ArtifactGraph, schema?: ArtifactSchema): ValidationIssue[];
1427
1569
  declare function validateScenarioPrdLinkIndex(root: string, graph: ArtifactGraph): Promise<ValidationIssue[]>;
1570
+ declare function resolveNodeTimeView(node: ArtifactNode, graph: ArtifactGraph, schema?: ArtifactSchema): NodeTimeView;
1571
+ declare function filterGraphByView(graph: ArtifactGraph, view: TimeView | undefined, schema?: ArtifactSchema): {
1572
+ graph: ArtifactGraph;
1573
+ excluded: ViewExcludedNode[];
1574
+ partialSupersedes: PartialSupersedeAnnotation[];
1575
+ };
1428
1576
  declare function queryGraph(graph: ArtifactGraph, options: QueryOptions): ArtifactGraph;
1429
1577
  declare function renderMermaid(graph: ArtifactGraph): string;
1430
1578
  declare function nextId(graph: ArtifactGraph, schema: ArtifactSchema, type: string, rangeName: string): string;
@@ -1530,4 +1678,4 @@ declare function discoverTargets(graph: ArtifactGraph, options?: DiscoverOptions
1530
1678
  declare function resolveArtifactContext(graph: ArtifactGraph, opts: ContextOptions): ContextManifest;
1531
1679
  declare function formatContextMarkdown(manifest: ContextManifest): string;
1532
1680
 
1533
- export { ALWAYS_PRESENT_ITEMS as ALWAYS_PRESENT, type ArtifactChainDoctorReport, type ArtifactEdge, type ArtifactEdgeRule, type ArtifactExtraFieldSchema, type ArtifactGraph, type ArtifactGraphCliCandidate, type ArtifactGraphCliResolution, type ArtifactGraphCliSource, type ArtifactNode, type ArtifactSchema, type ArtifactTarget, type ArtifactTypeMetadata, type ArtifactTypeRole, type ArtifactTypeSchema, BASELINE_CONSTRAINTS, BASELINE_CONSTRAINTS_COUNT, BASELINE_ITEMS_COUNT, type BatchDefinition, CONTRACT_ERROR_CODES, type CanonicalIR, type CollectChangedPathsOptions, type ContextItem, type ContextManifest, type ContextMode, type ContextOptions, type ContextTier, ContractCatalog, type ContractCatalogEntry, type ContractDefinition, ContractError, type ContractErrorCode, type ContractIdentity, ContractRegistry, type ContractRegistryEntry, type ContractSchema, DEFAULT_MAX_CHARS, DEFAULT_SCHEMA, type DiscoverOptions, E2E_NORMALIZER_CONFIG, type E2eCoverageStats, type E2eCoverageThresholds, type E2eRegistry, type E2eRegistryBatch, type E2eRunnerConfig, type E2eWaiver, type Evidence, type EvidenceObject, type ExecutorType, type Finding, type FindingLocation, type FindingSeverity, type FindingStatus, type GitChangeMode, type GitChangeResult, type GitHookName, type HookInstallResult, type ImplementationBlueprintDraft, type ImplementationPacket, type LegacyFieldMapping, type LoadContractOptions, MIN_PROMPT_CHARS, type ManagedHookBlockOptions, type MissingDetail, type NormalizationResult, type NormalizerConfig, type PacketAuditEntry, type PacketAuditSummary, type PacketCategory, type PacketItem, type PacketOmittedItem, type PacketOptions, type PacketPromptError, type PacketPromptOptions, type PacketTarget, type PacketTargetType, type PacketValidationIssue, type PacketValidationResult, type PolicyCompatibilityResult, type PreparedManagedHookBlock, type Producer, type ProjectPolicy, type PromptValidationIssue, type PromptValidationResult, type QueryOptions, type RepairData, type RepairValidation, type ResolveArtifactGraphCliOptions, type ReviewData, type ReviewDecision, type ReviewMetrics, type ReviewOrderStep, type ReviewResult, type ReviewStatus, type RiskChecklistItem, type SchemaValidationResult, TARGET_ARTIFACT_TYPES, type TargetArtifactType, type TraceVersionResult, VALID_PACKET_TARGET_TYPES, VERSION_INDEX_SCHEMA_VERSION, VERSION_LOCK_PATH, VERSION_LOCK_SCHEMA_VERSION, type ValidationError, type ValidationIssue, type VersionEdgeKind, type VersionIndex, type VersionLockAuditMarkdownOptions, type VersionLockAuditResult, type VersionLockBootstrapOptions, type VersionLockEntry, type VersionLockFile, type VersionLockIssue, type VersionLockIssueSeverity, type VersionLockRef, type VersionLockRefreshOptions, type VersionLockRefreshResult, type VersionLockSourceRef, type VersionLockStatus, type VersionLockUpdateOptions, type VersionSourceKind, type VersionedEdge, type VersionedNode, applyPreparedManagedHookBlocks, assemblePacket, auditPackets, auditVersionLock, bootstrapVersionLock, buildGraph, buildVersionIndex, collectChangedPaths, computeE2eCoverageStats, computeRevisionDigest, discoverAndAuditPackets, discoverTargets, doctorArtifactChain, formatContextMarkdown, generateE2eRegistry, getArtifactTypeMetadata, getTargetArtifactTypes, installManagedHookBlock, isOfficialNamespace, isPacketTargetType, isPacketTargetTypeDynamic, isTargetArtifactType, isVersionLockIssueBlocking, loadConfig, loadContract, loadContractCatalog, loadContractsFromDirectory, matchesConfiguredArtifactPath, nextId, normalizeE2eLegacyArtifact, normalizeToCanonical, parseTargetSelector, parseTargetsFile, prepareManagedHookBlock, queryGraph, refreshVersionLock, renderDoctorMarkdown, renderMermaid, renderPacketMarkdown, renderPacketPrompt, renderTraceVersionMarkdown, renderVersionLockAuditMarkdown, renderVersionLockRefreshMarkdown, resolveArtifactContext, resolveArtifactGraphCli, resolveArtifactTypeName, resolveCliTarget, resolveGitHookPath, resolveMatrixEdges, scanArtifacts, traceVersion, updateVersionLock, validateContractAgainstSchema, validateExecutableTraceability, validateGraph, validateNamespaceAuthority, validatePacket, validatePacketMarkdown, validatePacketPrompt, validatePolicyCompatibility, validateReviewResult, validateScenarioPrdLinkIndex, validateScenarioPrdLinks, verifyDigest, versionLockIssueSeverity, writeGraphCache };
1681
+ export { ALWAYS_PRESENT_ITEMS as ALWAYS_PRESENT, type ArtifactChainDoctorReport, type ArtifactEdge, type ArtifactEdgeRule, type ArtifactExtraFieldSchema, type ArtifactGraph, type ArtifactGraphCliCandidate, type ArtifactGraphCliResolution, type ArtifactGraphCliSource, type ArtifactNode, type ArtifactSchema, type ArtifactTarget, type ArtifactTypeMetadata, type ArtifactTypeRole, type ArtifactTypeSchema, BASELINE_CONSTRAINTS, BASELINE_CONSTRAINTS_COUNT, BASELINE_ITEMS_COUNT, type BatchDefinition, CONTRACT_ERROR_CODES, type CanonicalIR, type CollectChangedPathsOptions, type ContextItem, type ContextManifest, type ContextMode, type ContextOptions, type ContextTier, ContractCatalog, type ContractCatalogEntry, type ContractDefinition, ContractError, type ContractErrorCode, type ContractIdentity, ContractRegistry, type ContractRegistryEntry, type ContractSchema, type CoverageBoundaryReport, DEFAULT_MAX_CHARS, DEFAULT_SCHEMA, type DeclaredVerificationReference, type DiscoverOptions, E2E_NORMALIZER_CONFIG, type E2eCoverageStats, type E2eCoverageThresholds, type E2eRegistry, type E2eRegistryBatch, type E2eRunnerConfig, type E2eWaiver, type Evidence, type EvidenceObject, type ExecutorType, type ExternalEntryInfo, type Finding, type FindingLocation, type FindingSeverity, type FindingStatus, type GitChangeMode, type GitChangeResult, type GitHookName, type HookInstallResult, type ImpactEdgeRef, type ImpactMode, type ImpactNodeRef, type ImpactOptions, type ImpactReport, type ImplementationBlueprintDraft, type ImplementationPacket, type LegacyFieldMapping, type LoadContractOptions, MIN_PROMPT_CHARS, type ManagedHookBlockOptions, type MissingDetail, type NodeTimeView, type NormalizationResult, type NormalizerConfig, type PacketAuditEntry, type PacketAuditSummary, type PacketCategory, type PacketItem, type PacketOmittedItem, type PacketOptions, type PacketPromptError, type PacketPromptOptions, type PacketTarget, type PacketTargetType, type PacketValidationIssue, type PacketValidationResult, type PartialSupersedeAnnotation, type PolicyCompatibilityResult, type PreparedManagedHookBlock, type Producer, type ProjectPolicy, type PromptValidationIssue, type PromptValidationResult, type QueryOptions, type RelationSemanticsSpec, type RepairData, type RepairValidation, type ResolveArtifactGraphCliOptions, type ReviewData, type ReviewDecision, type ReviewMetrics, type ReviewOrderStep, type ReviewResult, type ReviewStatus, type RiskChecklistItem, type SchemaValidationResult, TARGET_ARTIFACT_TYPES, type TargetArtifactType, type TimeBucket, type TimeView, type TraceVersionResult, VALID_PACKET_TARGET_TYPES, VERSION_INDEX_SCHEMA_VERSION, VERSION_LOCK_PATH, VERSION_LOCK_SCHEMA_VERSION, type ValidationError, type ValidationIssue, type VersionEdgeKind, type VersionIndex, type VersionLockAuditMarkdownOptions, type VersionLockAuditResult, type VersionLockBootstrapOptions, type VersionLockEntry, type VersionLockFile, type VersionLockIssue, type VersionLockIssueSeverity, type VersionLockRef, type VersionLockRefreshOptions, type VersionLockRefreshResult, type VersionLockSourceRef, type VersionLockStatus, type VersionLockUpdateOptions, type VersionSourceKind, type VersionedEdge, type VersionedNode, type ViewExcludedNode, type ViewSelection, applyPreparedManagedHookBlocks, assemblePacket, auditPackets, auditVersionLock, bootstrapVersionLock, buildGraph, buildVersionIndex, collectChangedPaths, computeCoverageBoundary, computeE2eCoverageStats, computeImpact, computeRevisionDigest, discoverAndAuditPackets, discoverTargets, doctorArtifactChain, filterGraphByView, formatContextMarkdown, generateE2eRegistry, getArtifactTypeMetadata, getExternalEntryInfo, getTargetArtifactTypes, installManagedHookBlock, isOfficialNamespace, isPacketTargetType, isPacketTargetTypeDynamic, isTargetArtifactType, isVersionLockIssueBlocking, loadConfig, loadContract, loadContractCatalog, loadContractsFromDirectory, matchesConfiguredArtifactPath, nextId, normalizeE2eLegacyArtifact, normalizeToCanonical, parseTargetSelector, parseTargetsFile, prepareManagedHookBlock, queryGraph, refreshVersionLock, renderCoverageBoundaryMarkdown, renderDoctorMarkdown, renderImpactMarkdown, renderMermaid, renderPacketMarkdown, renderPacketPrompt, renderTraceVersionMarkdown, renderVersionLockAuditMarkdown, renderVersionLockRefreshMarkdown, resolveArtifactContext, resolveArtifactGraphCli, resolveArtifactTypeName, resolveCliTarget, resolveGitHookPath, resolveMatrixEdges, resolveNodeTimeView, scanArtifacts, traceVersion, updateVersionLock, validateContractAgainstSchema, validateExecutableTraceability, validateGraph, validateNamespaceAuthority, validatePacket, validatePacketMarkdown, validatePacketPrompt, validatePolicyCompatibility, validateReviewResult, validateScenarioPrdLinkIndex, validateScenarioPrdLinks, verifyDigest, versionLockIssueSeverity, writeGraphCache };