@specatlas/core 0.1.22 → 0.1.25
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 +181 -1
- package/dist/index.js +688 -159
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -203,6 +203,7 @@ interface Change {
|
|
|
203
203
|
tasks?: TasksFile;
|
|
204
204
|
verify?: VerifyFile;
|
|
205
205
|
fix?: VerifyFile;
|
|
206
|
+
fixCovers?: string[];
|
|
206
207
|
planPath?: string;
|
|
207
208
|
reviewPath?: string;
|
|
208
209
|
presentationPath?: string;
|
|
@@ -1139,6 +1140,12 @@ declare function indexMarkdown(input: {
|
|
|
1139
1140
|
slug: string;
|
|
1140
1141
|
lane: Lane;
|
|
1141
1142
|
}>;
|
|
1143
|
+
fixes?: Array<{
|
|
1144
|
+
slug: string;
|
|
1145
|
+
date: string;
|
|
1146
|
+
result: string;
|
|
1147
|
+
domain?: string;
|
|
1148
|
+
}>;
|
|
1142
1149
|
archived: number;
|
|
1143
1150
|
}): string;
|
|
1144
1151
|
|
|
@@ -1701,6 +1708,7 @@ interface ArchiveResult {
|
|
|
1701
1708
|
slug: string;
|
|
1702
1709
|
domain?: string;
|
|
1703
1710
|
archivedTo?: string;
|
|
1711
|
+
livingFix?: string;
|
|
1704
1712
|
fold: FoldOutcome;
|
|
1705
1713
|
diagnostics: Diagnostic[];
|
|
1706
1714
|
dryRun: boolean;
|
|
@@ -1708,6 +1716,178 @@ interface ArchiveResult {
|
|
|
1708
1716
|
declare function archiveChange(opts: ArchiveOptions): Promise<ArchiveResult>;
|
|
1709
1717
|
declare function regenerateIndex(root: string, cfg?: AtlasConfig, now?: Date): Promise<void>;
|
|
1710
1718
|
|
|
1719
|
+
declare const SCHEMA_VERSION = 1;
|
|
1720
|
+
declare const BACKUP_DIRNAME = ".backup";
|
|
1721
|
+
declare const BACKUP_POINTER = ".latest";
|
|
1722
|
+
interface MigrationSpec {
|
|
1723
|
+
id: string;
|
|
1724
|
+
description: string;
|
|
1725
|
+
from: number;
|
|
1726
|
+
to: number;
|
|
1727
|
+
}
|
|
1728
|
+
declare const SCHEMA_MIGRATIONS: MigrationSpec[];
|
|
1729
|
+
interface UpgradeItem {
|
|
1730
|
+
artifact: string;
|
|
1731
|
+
path: string;
|
|
1732
|
+
from: number;
|
|
1733
|
+
to: number;
|
|
1734
|
+
migration: string;
|
|
1735
|
+
summary: string;
|
|
1736
|
+
}
|
|
1737
|
+
interface UpgradeIssue {
|
|
1738
|
+
artifact: string;
|
|
1739
|
+
path: string;
|
|
1740
|
+
reason: string;
|
|
1741
|
+
}
|
|
1742
|
+
interface UpgradePlan {
|
|
1743
|
+
root: string;
|
|
1744
|
+
currentVersion: number;
|
|
1745
|
+
pending: UpgradeItem[];
|
|
1746
|
+
newer: UpgradeIssue[];
|
|
1747
|
+
unreadable: UpgradeIssue[];
|
|
1748
|
+
upToDate: boolean;
|
|
1749
|
+
}
|
|
1750
|
+
interface FoundArtifact {
|
|
1751
|
+
artifact: string;
|
|
1752
|
+
path: string;
|
|
1753
|
+
}
|
|
1754
|
+
declare function collectVersionedArtifacts(root: string): Promise<FoundArtifact[]>;
|
|
1755
|
+
type ArtifactVersionState = {
|
|
1756
|
+
state: 'ok';
|
|
1757
|
+
version: number;
|
|
1758
|
+
} | {
|
|
1759
|
+
state: 'absent';
|
|
1760
|
+
} | {
|
|
1761
|
+
state: 'unreadable';
|
|
1762
|
+
reason: string;
|
|
1763
|
+
};
|
|
1764
|
+
declare function readArtifactVersion(content: string): ArtifactVersionState;
|
|
1765
|
+
declare function stampSchemaVersion(content: string, version: number): string | undefined;
|
|
1766
|
+
declare function planUpgrade(root: string): Promise<UpgradePlan>;
|
|
1767
|
+
interface UpgradeBackupInfo {
|
|
1768
|
+
name: string;
|
|
1769
|
+
dir: string;
|
|
1770
|
+
relativeDir: string;
|
|
1771
|
+
createdAt: string;
|
|
1772
|
+
files: string[];
|
|
1773
|
+
}
|
|
1774
|
+
interface UpgradeApplyReport {
|
|
1775
|
+
status: 'applied' | 'up-to-date' | 'failed';
|
|
1776
|
+
plan: UpgradePlan;
|
|
1777
|
+
applied: UpgradeItem[];
|
|
1778
|
+
backup?: UpgradeBackupInfo;
|
|
1779
|
+
failure?: {
|
|
1780
|
+
artifact: string;
|
|
1781
|
+
message: string;
|
|
1782
|
+
};
|
|
1783
|
+
}
|
|
1784
|
+
declare function applyUpgrade(root: string, now?: Date): Promise<UpgradeApplyReport>;
|
|
1785
|
+
interface UpgradeRollbackReport {
|
|
1786
|
+
status: 'restored' | 'no-backup' | 'failed';
|
|
1787
|
+
restored: string[];
|
|
1788
|
+
backup?: string;
|
|
1789
|
+
failure?: {
|
|
1790
|
+
artifact: string;
|
|
1791
|
+
message: string;
|
|
1792
|
+
};
|
|
1793
|
+
}
|
|
1794
|
+
declare function rollbackUpgrade(root: string): Promise<UpgradeRollbackReport>;
|
|
1795
|
+
interface UpgradeAdvisory {
|
|
1796
|
+
plan: UpgradePlan;
|
|
1797
|
+
diagnostics: Diagnostic[];
|
|
1798
|
+
}
|
|
1799
|
+
declare function upgradeAdvisory(root: string): Promise<UpgradeAdvisory>;
|
|
1800
|
+
|
|
1801
|
+
declare const LIVING_FIXES_DIR: string;
|
|
1802
|
+
interface LivingFix {
|
|
1803
|
+
slug: string;
|
|
1804
|
+
file: string;
|
|
1805
|
+
date: string;
|
|
1806
|
+
result: string;
|
|
1807
|
+
domain?: string;
|
|
1808
|
+
title?: string;
|
|
1809
|
+
covers: string[];
|
|
1810
|
+
content: string;
|
|
1811
|
+
}
|
|
1812
|
+
declare function parseFixCovers(content: string): string[];
|
|
1813
|
+
declare function parseLivingFix(content: string, file: string): LivingFix;
|
|
1814
|
+
declare function loadLivingFixes(root: string): Promise<LivingFix[]>;
|
|
1815
|
+
interface WriteLivingFixInput {
|
|
1816
|
+
slug: string;
|
|
1817
|
+
date: string;
|
|
1818
|
+
result?: string;
|
|
1819
|
+
domain?: string;
|
|
1820
|
+
title?: string;
|
|
1821
|
+
covers?: string[];
|
|
1822
|
+
content: string;
|
|
1823
|
+
}
|
|
1824
|
+
interface WriteLivingFixResult {
|
|
1825
|
+
file: string;
|
|
1826
|
+
relativePath: string;
|
|
1827
|
+
created: boolean;
|
|
1828
|
+
}
|
|
1829
|
+
declare function writeLivingFix(root: string, input: WriteLivingFixInput): Promise<WriteLivingFixResult>;
|
|
1830
|
+
|
|
1831
|
+
declare const SARIF_SCHEMA = "https://json.schemastore.org/sarif-2.1.0.json";
|
|
1832
|
+
declare const SARIF_VERSION = "2.1.0";
|
|
1833
|
+
declare const TOOL_NAME = "SpecAtlas";
|
|
1834
|
+
declare const TOOL_URL = "https://github.com/AlonsoAM/specatlas";
|
|
1835
|
+
interface SarifOptions {
|
|
1836
|
+
diagnostics: readonly Diagnostic[];
|
|
1837
|
+
root: string;
|
|
1838
|
+
version: string;
|
|
1839
|
+
failed?: boolean;
|
|
1840
|
+
}
|
|
1841
|
+
interface SarifRule {
|
|
1842
|
+
id: string;
|
|
1843
|
+
shortDescription: {
|
|
1844
|
+
text: string;
|
|
1845
|
+
};
|
|
1846
|
+
help?: {
|
|
1847
|
+
text: string;
|
|
1848
|
+
};
|
|
1849
|
+
}
|
|
1850
|
+
interface SarifLocation {
|
|
1851
|
+
physicalLocation: {
|
|
1852
|
+
artifactLocation: {
|
|
1853
|
+
uri: string;
|
|
1854
|
+
};
|
|
1855
|
+
region?: {
|
|
1856
|
+
startLine: number;
|
|
1857
|
+
};
|
|
1858
|
+
};
|
|
1859
|
+
}
|
|
1860
|
+
interface SarifResult {
|
|
1861
|
+
ruleId: string;
|
|
1862
|
+
level: 'error' | 'warning' | 'note';
|
|
1863
|
+
message: {
|
|
1864
|
+
text: string;
|
|
1865
|
+
};
|
|
1866
|
+
locations?: SarifLocation[];
|
|
1867
|
+
}
|
|
1868
|
+
interface SarifReport {
|
|
1869
|
+
$schema: string;
|
|
1870
|
+
version: string;
|
|
1871
|
+
runs: Array<{
|
|
1872
|
+
tool: {
|
|
1873
|
+
driver: {
|
|
1874
|
+
name: string;
|
|
1875
|
+
informationUri: string;
|
|
1876
|
+
version: string;
|
|
1877
|
+
rules: SarifRule[];
|
|
1878
|
+
};
|
|
1879
|
+
};
|
|
1880
|
+
results: SarifResult[];
|
|
1881
|
+
invocations: Array<{
|
|
1882
|
+
executionSuccessful: boolean;
|
|
1883
|
+
}>;
|
|
1884
|
+
}>;
|
|
1885
|
+
}
|
|
1886
|
+
declare function ruleDescription(code: string): string;
|
|
1887
|
+
declare function sarifLevel(severity: Diagnostic['severity']): SarifResult['level'];
|
|
1888
|
+
declare function toSarifReport(opts: SarifOptions): SarifReport;
|
|
1889
|
+
declare function toSarifText(opts: SarifOptions): string;
|
|
1890
|
+
|
|
1711
1891
|
interface DoctorReport {
|
|
1712
1892
|
findings: Diagnostic[];
|
|
1713
1893
|
summary: {
|
|
@@ -1747,4 +1927,4 @@ declare function livingRequirementsMap(specs: Array<{
|
|
|
1747
1927
|
}>): Map<string, Requirement>;
|
|
1748
1928
|
declare function runCiGate(opts: CiOptions): Promise<CiResult>;
|
|
1749
1929
|
|
|
1750
|
-
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, 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 Delta, type DeltaOp, type DeriveInput, type DerivedState, type DetectionResult, type Diagnostic, type DoctorReport, type Domain, type Evidence, type EvidenceMethod, type EvidenceResult, type ExecOptions, type ExecResult, type FoldOutcome, type FrontmatterResult, type GhRunner, type GitHubRepo, type GlossaryTerm, type ImpactEvidence, type ImpactReport, type ImpactTask, type InitOptions, type InitResult, type IssueBodyInput, type Lane, type Language, type LinkedIssue, type LintOptions, type LoadedConfig, 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, SCENARIO_HEAD_RE, SCENARIO_ID_RE, SDD_DIR, SLUG_RE, type Scenario, type Severity, type SignApprovalOptions, type SignApprovalResult, type SpecFile, type SpecRef, type StackProfile, type SyncGithubOptions, type SyncGithubResult, TASK_ID_RE, TASK_LINE_RE, type Task, type TaskBlock, type TasksFile, type TemplateSet, type TraceEdge, type TraceFinding, type TraceGraph, type TraceInput, type TraceNode, type TraceResult, type VerifyFile, type WalkEntry, type WavePlan, type Workspace, type WorkspaceMetrics, adoptWorkspace, appendRunEvent, approvalsSchema, approveFromGithub, archiveChange, artifactHash, atlasConfigSchema, buildTraceGraph, canonicalizeMarkdown, captureMockups, changeMarker, changeMetaSchema, changeMetaYaml, checkMockups, checkTrace, collectMetrics, commentIssue, compareTaskIds, computeInputsHash, configToYaml, copyFile, countBySeverity, createChange, createIssue, createRun, defaultConfig, deriveState, detectProfiles, detectRepo, detectionToYaml, diag, editIssue, emitFrontmatter, ensureDir, ensureSddDirs, esc, evaluatePacks, evidenceSummary, exists, findLinkedIssue, findWorkspaceRoot, firstToken, foldDelta, 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, loadProfileFile, loadProfilesFromDir, loadProjectPacks, loadSpecs, loadWorkspace, localCompact, localDate, localMonth, localOffset, localStamp, matchGlob, mockupManifestSchema, mockupsDir, mockupsReady, moveDirectory, packFindings, parseApprovals, parseChangeMeta, parseConfig, parseDelta, parseFrontmatter, parseGitHubRemote, parseGlossary, parseIssueUrl, parseRequirementBlocks, parseSpecFile, parseTasksFile, parseVerifyFile, patchChangeMeta, planBlock, planMockups, planWaves, profileSchema, readMockupManifest, readRun, readText, readTextIfExists, recordEvidence, regenerateIndex, renderMarkdown, renderRequirement, renderTemplate, requiresMockups, resolvePacks, runAnalyze, runCiGate, runDoctor, runProcess, setMockupRequirement, sha256, shortHash, signApproval, specHashOf, splitCommand, stateLabel, syncGithubIssue, templatesFor, toPosix, tokensFile, updateMockupScreenshots, updateRunStatus, verifyApproval, walkFiles, writeConfig, writeMockupManifest, writeMockupPlan, writeText };
|
|
1930
|
+
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 Delta, type DeltaOp, type DeriveInput, type DerivedState, type DetectionResult, type Diagnostic, type DoctorReport, type Domain, type Evidence, type EvidenceMethod, type EvidenceResult, type ExecOptions, type ExecResult, type FoldOutcome, type FrontmatterResult, 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, collectMetrics, collectVersionedArtifacts, commentIssue, compareTaskIds, computeInputsHash, configToYaml, copyFile, countBySeverity, createChange, createIssue, createRun, defaultConfig, deriveState, detectProfiles, detectRepo, detectionToYaml, diag, editIssue, emitFrontmatter, ensureDir, ensureSddDirs, esc, evaluatePacks, evidenceSummary, exists, findLinkedIssue, findWorkspaceRoot, firstToken, foldDelta, 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, 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 };
|