@specatlas/core 0.1.27 → 0.1.28

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.ts CHANGED
@@ -44,8 +44,41 @@ interface Scenario {
44
44
  reqId: string;
45
45
  when: string[];
46
46
  then: string[];
47
+ contracts?: string[];
47
48
  line: number;
48
49
  }
50
+ type ContractFormat = 'openapi' | 'graphql' | 'protobuf' | 'unsupported';
51
+ interface ContractOperation {
52
+ id: string;
53
+ kind: ContractFormat;
54
+ file: string;
55
+ line: number;
56
+ }
57
+ interface ContractFile {
58
+ path: string;
59
+ format: ContractFormat;
60
+ operations: ContractOperation[];
61
+ }
62
+ interface ContractsState {
63
+ files: ContractFile[];
64
+ operations: ContractOperation[];
65
+ findings: Diagnostic[];
66
+ }
67
+ interface LinkEntry {
68
+ name: string;
69
+ path: string;
70
+ }
71
+ interface LinkStatus extends LinkEntry {
72
+ available: boolean;
73
+ requirements: number;
74
+ domains: string[];
75
+ error?: string;
76
+ }
77
+ interface LinksState {
78
+ entries: LinkStatus[];
79
+ specs: SpecRef[];
80
+ unavailable: string[];
81
+ }
49
82
  interface Requirement {
50
83
  id: string;
51
84
  title: string;
@@ -218,6 +251,7 @@ interface Change {
218
251
  clarify?: ClarifyFile;
219
252
  clarifyPath?: string;
220
253
  docsPaths?: string[];
254
+ contracts?: ContractsState;
221
255
  planPath?: string;
222
256
  reviewPath?: string;
223
257
  presentationPath?: string;
@@ -234,7 +268,8 @@ interface Workspace {
234
268
  sddDir: string;
235
269
  specs: SpecRef[];
236
270
  changes: Change[];
237
- archived?: Change[];
271
+ archived: Change[];
272
+ links?: LinksState;
238
273
  diagnostics: Diagnostic[];
239
274
  }
240
275
 
@@ -323,6 +358,13 @@ declare const atlasConfigSchema: z.ZodObject<{
323
358
  }, {
324
359
  mode?: "off" | "advisory" | "blocking" | undefined;
325
360
  }>>;
361
+ contracts: z.ZodDefault<z.ZodObject<{
362
+ mode: z.ZodDefault<z.ZodEnum<["off", "advisory", "blocking"]>>;
363
+ }, "strip", z.ZodTypeAny, {
364
+ mode: "off" | "advisory" | "blocking";
365
+ }, {
366
+ mode?: "off" | "advisory" | "blocking" | undefined;
367
+ }>>;
326
368
  mockup: z.ZodDefault<z.ZodObject<{
327
369
  require_approval: z.ZodDefault<z.ZodBoolean>;
328
370
  compare_in_verify: z.ZodDefault<z.ZodBoolean>;
@@ -353,6 +395,9 @@ declare const atlasConfigSchema: z.ZodObject<{
353
395
  docs: {
354
396
  mode: "off" | "advisory" | "blocking";
355
397
  };
398
+ contracts: {
399
+ mode: "off" | "advisory" | "blocking";
400
+ };
356
401
  mockup: {
357
402
  require_approval: boolean;
358
403
  compare_in_verify: boolean;
@@ -377,6 +422,9 @@ declare const atlasConfigSchema: z.ZodObject<{
377
422
  docs?: {
378
423
  mode?: "off" | "advisory" | "blocking" | undefined;
379
424
  } | undefined;
425
+ contracts?: {
426
+ mode?: "off" | "advisory" | "blocking" | undefined;
427
+ } | undefined;
380
428
  mockup?: {
381
429
  require_approval?: boolean | undefined;
382
430
  compare_in_verify?: boolean | undefined;
@@ -498,6 +546,9 @@ declare const atlasConfigSchema: z.ZodObject<{
498
546
  docs: {
499
547
  mode: "off" | "advisory" | "blocking";
500
548
  };
549
+ contracts: {
550
+ mode: "off" | "advisory" | "blocking";
551
+ };
501
552
  mockup: {
502
553
  require_approval: boolean;
503
554
  compare_in_verify: boolean;
@@ -567,6 +618,9 @@ declare const atlasConfigSchema: z.ZodObject<{
567
618
  docs?: {
568
619
  mode?: "off" | "advisory" | "blocking" | undefined;
569
620
  } | undefined;
621
+ contracts?: {
622
+ mode?: "off" | "advisory" | "blocking" | undefined;
623
+ } | undefined;
570
624
  mockup?: {
571
625
  require_approval?: boolean | undefined;
572
626
  compare_in_verify?: boolean | undefined;
@@ -884,6 +938,8 @@ interface ImpactReport {
884
938
  target: string;
885
939
  kind: 'requirement' | 'file';
886
940
  exists: boolean;
941
+ external?: boolean;
942
+ origin?: string;
887
943
  scenarios: string[];
888
944
  tasks: ImpactTask[];
889
945
  requirements: string[];
@@ -934,6 +990,10 @@ interface TraceInput {
934
990
  specs: SpecRef[];
935
991
  change: Change;
936
992
  requireEvidence: boolean;
993
+ linked?: {
994
+ ids: string[];
995
+ unavailable: string[];
996
+ };
937
997
  }
938
998
  declare function buildTraceGraph(input: TraceInput): TraceGraph;
939
999
  declare function checkTrace(input: TraceInput): TraceResult;
@@ -1888,6 +1948,40 @@ interface WriteLivingFixResult {
1888
1948
  }
1889
1949
  declare function writeLivingFix(root: string, input: WriteLivingFixInput): Promise<WriteLivingFixResult>;
1890
1950
 
1951
+ declare const CONTRACTS_DIR = "contracts";
1952
+ declare function formatOf(file: string, content: string): ContractFormat;
1953
+ declare function parseContract(file: string, content: string): ContractFile & {
1954
+ findings: Diagnostic[];
1955
+ };
1956
+ declare function loadContracts(changeDir: string): Promise<ContractsState>;
1957
+ declare function contractCoverage(change: Change, mode: AtlasConfig['gates']['contracts']['mode']): Diagnostic[];
1958
+ declare function contractsAdvisory(change: Change, cfg: AtlasConfig): Diagnostic[];
1959
+
1960
+ declare const LINKS_FILE = "links.yaml";
1961
+ declare function resolveLinkPath(root: string, linkPath: string): string;
1962
+ declare function loadLinks(root: string): Promise<LinksState>;
1963
+ interface AddLinkResult {
1964
+ entry?: LinkEntry;
1965
+ diagnostics: Diagnostic[];
1966
+ }
1967
+ declare function addLink(root: string, opts: {
1968
+ path: string;
1969
+ name?: string;
1970
+ }): Promise<AddLinkResult>;
1971
+ interface RemoveLinkResult {
1972
+ removed?: string;
1973
+ diagnostics: Diagnostic[];
1974
+ }
1975
+ declare function removeLink(root: string, ref: string): Promise<RemoveLinkResult>;
1976
+ declare function linkedRequirementIds(state: LinksState | undefined): string[];
1977
+ declare function linkedTraceInput(workspace: {
1978
+ links?: LinksState;
1979
+ }): {
1980
+ ids: string[];
1981
+ unavailable: string[];
1982
+ } | undefined;
1983
+ declare function ensureLinksFile(root: string): Promise<void>;
1984
+
1891
1985
  type DocsTipo = 'tecnica' | 'manual' | 'all';
1892
1986
  declare const DOCS_MARKER_START = "<!-- specatlas:generado:inicio -->";
1893
1987
  declare const DOCS_MARKER_END = "<!-- specatlas:generado:fin -->";
@@ -2008,4 +2102,4 @@ declare function livingRequirementsMap(specs: Array<{
2008
2102
  }>): Map<string, Requirement>;
2009
2103
  declare function runCiGate(opts: CiOptions): Promise<CiResult>;
2010
2104
 
2011
- export { type AdoptDomain, type AdoptOptions, type AdoptResult, type AgingBucket, type AnalyzeOptions, type AnalyzePackSummary, type AnalyzeResult, type Approval, type ApprovalStatus, type ApprovalsFile, type ApprovalsIndex, type ApproveFromGithubOptions, type ApproveFromGithubResult, type ArchiveOptions, type ArchiveResult, type AtlasConfig, type AttentionItem, BACKUP_DIRNAME, BACKUP_POINTER, BLOCK_HEAD_RE, BUILTIN_PACKS, type BlockWavePlan, CONFIG_FILE, CORE_VERSION, type CaptureResult, type Change, type ChangeMeta, type ChangeMetrics, type ChangeState, type CiCheck, type CiExtraCheck, type CiOptions, type CiResult, type ClarifyFile, type ClarifyItem, DOCS_MARKER_END, DOCS_MARKER_START, type Delta, type DeltaOp, type DeriveInput, type DerivedState, type DetectionResult, type Diagnostic, type DocsTipo, type DoctorReport, type Domain, type Evidence, type EvidenceMethod, type EvidenceResult, type ExecOptions, type ExecResult, type FoldOutcome, type FrontmatterResult, type GenerateDocsOptions, type GenerateDocsResult, type GeneratedDoc, type GhRunner, type GitHubRepo, type GlossaryTerm, type ImpactEvidence, type ImpactReport, type ImpactTask, type InitOptions, type InitResult, type IssueBodyInput, LIVING_FIXES_DIR, type Lane, type Language, type LinkedIssue, type LintOptions, type LivingFix, type LoadedConfig, type MigrationSpec, type MockupCheckResult, type MockupManifest, type MockupPlan, type MockupPlanScreen, type MockupScreen, type MoveOps, type NewChangeOptions, type NewChangeResult, type NextAction, type Override, type Pack, type PackCheck, type PackCheckResult, type PackCheckType, type PackEvaluation, type ParsedGlossary, type PresentOptions, type PresentResult, type ProfileMatch, REQ_HEAD_RE, REQ_ID_RE, RULE_ID_RE, RULE_RE, RUN_EVENT_TYPES, type RecordEvidenceOptions, type RecordEvidenceResult, type Rename, type Requirement, type RiskLevel, type Rule, type RunEvent, type RunEventType, type RunRecord, type RunState, type RunStatus, SARIF_SCHEMA, SARIF_VERSION, SCENARIO_HEAD_RE, SCENARIO_ID_RE, SCHEMA_MIGRATIONS, SCHEMA_VERSION, SDD_DIR, SLUG_RE, type SarifLocation, type SarifOptions, type SarifReport, type SarifResult, type SarifRule, type Scenario, type Severity, type SignApprovalOptions, type SignApprovalResult, type SpecFile, type SpecRef, type StackProfile, type SyncGithubOptions, type SyncGithubResult, TASK_ID_RE, TASK_LINE_RE, TOOL_NAME, TOOL_URL, type Task, type TaskBlock, type TasksFile, type TemplateSet, type TraceEdge, type TraceFinding, type TraceGraph, type TraceInput, type TraceNode, type TraceResult, type UpgradeAdvisory, type UpgradeApplyReport, type UpgradeBackupInfo, type UpgradeIssue, type UpgradeItem, type UpgradePlan, type UpgradeRollbackReport, type VerifyFile, type WalkEntry, type WavePlan, type Workspace, type WorkspaceMetrics, type WriteLivingFixInput, type WriteLivingFixResult, adoptWorkspace, appendRunEvent, applyUpgrade, approvalsSchema, approveFromGithub, archiveChange, artifactHash, atlasConfigSchema, buildTraceGraph, canonicalizeMarkdown, captureMockups, changeMarker, changeMetaSchema, changeMetaYaml, checkMockups, checkTrace, clarifyAdvisory, collectMetrics, collectVersionedArtifacts, commentIssue, compareTaskIds, computeInputsHash, configToYaml, copyFile, countBySeverity, createChange, createIssue, createRun, defaultConfig, deriveState, detectProfiles, detectRepo, detectionToYaml, diag, docsAdvisory, docsReady, editIssue, emitFrontmatter, ensureDir, ensureSddDirs, esc, evaluatePacks, evidenceSummary, exists, findLinkedIssue, findWorkspaceRoot, firstToken, foldDelta, generateDocs, generatePresentation, generateRunId, getNumber, getString, ghAuthStatus, ghAvailable, hasErrors, hasShellMetacharacters, impactOfFile, impactOfRequirement, indexMarkdown, initWorkspace, inline, isCommandAllowed, isDirectory, issueBody, issueLabels, laneOrDefault, lintDelta, lintMockupHtml, lintMockupManifest, lintPlan, lintRequirement, lintSpec, lintTasks, lintVerify, listChangeSlugs, listDir, listDirs, listRuns, livingRequirementsMap, loadActiveProfile, loadApprovals, loadChange, loadConfig, loadDetectedBest, loadLivingFixes, loadProfileFile, loadProfilesFromDir, loadProjectPacks, loadSpecs, loadWorkspace, localCompact, localDate, localMonth, localOffset, localStamp, matchGlob, mockupManifestSchema, mockupsDir, mockupsReady, moveDirectory, packFindings, parseApprovals, parseChangeMeta, parseClarify, parseConfig, parseDelta, parseFixCovers, parseFrontmatter, parseGitHubRemote, parseGlossary, parseIssueUrl, parseLivingFix, parseRequirementBlocks, parseSpecFile, parseTasksFile, parseVerifyFile, patchChangeMeta, planBlock, planMockups, planUpgrade, planWaves, profileSchema, readArtifactVersion, readMockupManifest, readRun, readText, readTextIfExists, recordEvidence, regenerateIndex, renderMarkdown, renderRequirement, renderTemplate, requiresMockups, resolvePacks, rollbackUpgrade, ruleDescription, runAnalyze, runCiGate, runDoctor, runProcess, sarifLevel, setMockupRequirement, sha256, shortHash, signApproval, specHashOf, splitCommand, stampSchemaVersion, stateLabel, syncGithubIssue, templatesFor, toPosix, toSarifReport, toSarifText, tokensFile, updateMockupScreenshots, updateRunStatus, upgradeAdvisory, verifyApproval, walkFiles, writeConfig, writeLivingFix, writeMockupManifest, writeMockupPlan, writeText };
2105
+ export { type AddLinkResult, type AdoptDomain, type AdoptOptions, type AdoptResult, type AgingBucket, type AnalyzeOptions, type AnalyzePackSummary, type AnalyzeResult, type Approval, type ApprovalStatus, type ApprovalsFile, type ApprovalsIndex, type ApproveFromGithubOptions, type ApproveFromGithubResult, type ArchiveOptions, type ArchiveResult, type AtlasConfig, type AttentionItem, BACKUP_DIRNAME, BACKUP_POINTER, BLOCK_HEAD_RE, BUILTIN_PACKS, type BlockWavePlan, CONFIG_FILE, CONTRACTS_DIR, CORE_VERSION, type CaptureResult, type Change, type ChangeMeta, type ChangeMetrics, type ChangeState, type CiCheck, type CiExtraCheck, type CiOptions, type CiResult, type ClarifyFile, type ClarifyItem, type ContractFile, type ContractFormat, type ContractOperation, type ContractsState, DOCS_MARKER_END, DOCS_MARKER_START, type Delta, type DeltaOp, type DeriveInput, type DerivedState, type DetectionResult, type Diagnostic, type DocsTipo, type DoctorReport, type Domain, type Evidence, type EvidenceMethod, type EvidenceResult, type ExecOptions, type ExecResult, type FoldOutcome, type FrontmatterResult, type GenerateDocsOptions, type GenerateDocsResult, type GeneratedDoc, type GhRunner, type GitHubRepo, type GlossaryTerm, type ImpactEvidence, type ImpactReport, type ImpactTask, type InitOptions, type InitResult, type IssueBodyInput, LINKS_FILE, LIVING_FIXES_DIR, type Lane, type Language, type LinkEntry, type LinkStatus, type LinkedIssue, type LinksState, type LintOptions, type LivingFix, type LoadedConfig, type MigrationSpec, type MockupCheckResult, type MockupManifest, type MockupPlan, type MockupPlanScreen, type MockupScreen, type MoveOps, type NewChangeOptions, type NewChangeResult, type NextAction, type Override, type Pack, type PackCheck, type PackCheckResult, type PackCheckType, type PackEvaluation, type ParsedGlossary, type PresentOptions, type PresentResult, type ProfileMatch, REQ_HEAD_RE, REQ_ID_RE, RULE_ID_RE, RULE_RE, RUN_EVENT_TYPES, type RecordEvidenceOptions, type RecordEvidenceResult, type RemoveLinkResult, type Rename, type Requirement, type RiskLevel, type Rule, type RunEvent, type RunEventType, type RunRecord, type RunState, type RunStatus, SARIF_SCHEMA, SARIF_VERSION, SCENARIO_HEAD_RE, SCENARIO_ID_RE, SCHEMA_MIGRATIONS, SCHEMA_VERSION, SDD_DIR, SLUG_RE, type SarifLocation, type SarifOptions, type SarifReport, type SarifResult, type SarifRule, type Scenario, type Severity, type SignApprovalOptions, type SignApprovalResult, type SpecFile, type SpecRef, type StackProfile, type SyncGithubOptions, type SyncGithubResult, TASK_ID_RE, TASK_LINE_RE, TOOL_NAME, TOOL_URL, type Task, type TaskBlock, type TasksFile, type TemplateSet, type TraceEdge, type TraceFinding, type TraceGraph, type TraceInput, type TraceNode, type TraceResult, type UpgradeAdvisory, type UpgradeApplyReport, type UpgradeBackupInfo, type UpgradeIssue, type UpgradeItem, type UpgradePlan, type UpgradeRollbackReport, type VerifyFile, type WalkEntry, type WavePlan, type Workspace, type WorkspaceMetrics, type WriteLivingFixInput, type WriteLivingFixResult, addLink, adoptWorkspace, appendRunEvent, applyUpgrade, approvalsSchema, approveFromGithub, archiveChange, artifactHash, atlasConfigSchema, buildTraceGraph, canonicalizeMarkdown, captureMockups, changeMarker, changeMetaSchema, changeMetaYaml, checkMockups, checkTrace, clarifyAdvisory, collectMetrics, collectVersionedArtifacts, commentIssue, compareTaskIds, computeInputsHash, configToYaml, contractCoverage, contractsAdvisory, copyFile, countBySeverity, createChange, createIssue, createRun, defaultConfig, deriveState, detectProfiles, detectRepo, detectionToYaml, diag, docsAdvisory, docsReady, editIssue, emitFrontmatter, ensureDir, ensureLinksFile, ensureSddDirs, esc, evaluatePacks, evidenceSummary, exists, findLinkedIssue, findWorkspaceRoot, firstToken, foldDelta, formatOf, generateDocs, generatePresentation, generateRunId, getNumber, getString, ghAuthStatus, ghAvailable, hasErrors, hasShellMetacharacters, impactOfFile, impactOfRequirement, indexMarkdown, initWorkspace, inline, isCommandAllowed, isDirectory, issueBody, issueLabels, laneOrDefault, linkedRequirementIds, linkedTraceInput, lintDelta, lintMockupHtml, lintMockupManifest, lintPlan, lintRequirement, lintSpec, lintTasks, lintVerify, listChangeSlugs, listDir, listDirs, listRuns, livingRequirementsMap, loadActiveProfile, loadApprovals, loadChange, loadConfig, loadContracts, loadDetectedBest, loadLinks, loadLivingFixes, loadProfileFile, loadProfilesFromDir, loadProjectPacks, loadSpecs, loadWorkspace, localCompact, localDate, localMonth, localOffset, localStamp, matchGlob, mockupManifestSchema, mockupsDir, mockupsReady, moveDirectory, packFindings, parseApprovals, parseChangeMeta, parseClarify, parseConfig, parseContract, parseDelta, parseFixCovers, parseFrontmatter, parseGitHubRemote, parseGlossary, parseIssueUrl, parseLivingFix, parseRequirementBlocks, parseSpecFile, parseTasksFile, parseVerifyFile, patchChangeMeta, planBlock, planMockups, planUpgrade, planWaves, profileSchema, readArtifactVersion, readMockupManifest, readRun, readText, readTextIfExists, recordEvidence, regenerateIndex, removeLink, renderMarkdown, renderRequirement, renderTemplate, requiresMockups, resolveLinkPath, resolvePacks, rollbackUpgrade, ruleDescription, runAnalyze, runCiGate, runDoctor, runProcess, sarifLevel, setMockupRequirement, sha256, shortHash, signApproval, specHashOf, splitCommand, stampSchemaVersion, stateLabel, syncGithubIssue, templatesFor, toPosix, toSarifReport, toSarifText, tokensFile, updateMockupScreenshots, updateRunStatus, upgradeAdvisory, verifyApproval, walkFiles, writeConfig, writeLivingFix, writeMockupManifest, writeMockupPlan, writeText };