@arcbridge/core 0.6.1 → 0.6.2

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
@@ -779,9 +779,24 @@ interface GenerateDatabaseResult {
779
779
  db: Database;
780
780
  warnings: string[];
781
781
  }
782
+ /**
783
+ * Thrown when a top-level source file exists but fails parsing or schema
784
+ * validation during populate/refresh. Aborting (instead of warning) lets the
785
+ * surrounding transaction roll back, so the database keeps its previous
786
+ * state rather than committing with the corresponding tables wiped.
787
+ */
788
+ declare class RefreshValidationError extends Error {
789
+ readonly file: string;
790
+ constructor(file: string, detail: string);
791
+ }
782
792
  /**
783
793
  * Re-read arc42 files from disk and update the database.
784
794
  * Uses INSERT OR REPLACE to pick up changes made since initial generation.
795
+ *
796
+ * Throws RefreshValidationError (rolling back the transaction, leaving the
797
+ * database unchanged) when a top-level source file exists but is malformed:
798
+ * 05-building-blocks.md, 10-quality-scenarios.yaml, or phases.yaml.
799
+ * Missing files and invalid individual task/ADR files only produce warnings.
785
800
  */
786
801
  declare function refreshFromDocs(db: Database, targetDir: string): string[];
787
802
  declare function generateDatabase(targetDir: string, input: InitProjectInput): GenerateDatabaseResult;
@@ -1167,4 +1182,25 @@ declare function loadConfig(projectRoot: string): {
1167
1182
  error: string | null;
1168
1183
  };
1169
1184
 
1170
- export { type ActivityRow, type AdrFrontmatter, AdrFrontmatterSchema, type AgentRole, AgentRoleSchema, type AggregatedRow, type ArcBridgeConfig, ArcBridgeConfigSchema, type BuildingBlock, BuildingBlockSchema, type BuildingBlocksFrontmatter, BuildingBlocksFrontmatterSchema, CURRENT_SCHEMA_VERSION, type ChangedFile, type Database, type DotnetProjectInfo, type DriftEntry, type DriftKind, type DriftOptions, type DriftSeverity, type ExportFormat, type ExtractedSymbol, type GenerateDatabaseResult, type GitRef, type IndexResult, type IndexerOptions, type InitProjectInput, type InsertActivityParams, type LatestQualitySnapshot, type LoadRolesResult, type MetricsResult, type Phase, PhaseSchema, type PhasesFile, PhasesFileSchema, type ProjectLanguage, QUALITY_PRIORITIES_DESCRIPTION, QualityCategorySchema, QualityPrioritySchema, type QualityScenario, QualityScenarioSchema, QualityScenarioStatusSchema, type QualityScenariosFile, QualityScenariosFileSchema, type QueryMetricsParams, type ScenarioTestResult, type Service, type SessionTotals, type SymbolKind, type Task, type TaskFile, TaskFileSchema, type TaskInferenceResult, TaskSchema, type TestOutcome, type VerifyResult, addPhaseToYaml, addTaskToYaml, applyInferences, deletePhaseFromYaml, deleteTaskFromYaml, detectDrift, detectProjectLanguage, discoverDotnetServices, exportMetrics, generateAgentRoles, generateArc42, generateConfig, generateDatabase, generatePlan, generateSyncFiles, getChangedFiles, getHeadSha, getSessionTotals, getUncommittedChanges, indexPackageDependencies, indexProject, inferTaskStatuses, initializeSchema, insertActivity, loadConfig, loadRole, loadRoles, migrate, openDatabase, openMemoryDatabase, queryMetrics, refreshFromDocs, resolveRef, scopeToProject, setSyncCommit, suppressSqliteWarning, syncPhaseToYaml, syncScenarioToYaml, syncTaskToYaml, transaction, verifyScenarios, writeDriftLog };
1185
+ /**
1186
+ * Write a file atomically: write to a temp file in the same directory,
1187
+ * then rename over the target. A crash or full disk mid-write leaves the
1188
+ * original file untouched instead of truncated or half-written.
1189
+ *
1190
+ * Matches writeFileSync semantics that a bare rename would break:
1191
+ * - symlinks are resolved first, so the rename replaces the link's target,
1192
+ * not the link itself
1193
+ * - an existing target's permission bits are preserved
1194
+ *
1195
+ * The temp file lives next to the resolved target — rename is only atomic
1196
+ * within a filesystem.
1197
+ */
1198
+ declare function atomicWriteFileSync(filePath: string, content: string): void;
1199
+
1200
+ /**
1201
+ * Log a non-fatal warning to stderr. stdout is reserved for command output
1202
+ * (--json) and MCP stdio framing, so diagnostics must go to stderr.
1203
+ */
1204
+ declare function logWarn(context: string, err?: unknown): void;
1205
+
1206
+ export { type ActivityRow, type AdrFrontmatter, AdrFrontmatterSchema, type AgentRole, AgentRoleSchema, type AggregatedRow, type ArcBridgeConfig, ArcBridgeConfigSchema, type BuildingBlock, BuildingBlockSchema, type BuildingBlocksFrontmatter, BuildingBlocksFrontmatterSchema, CURRENT_SCHEMA_VERSION, type ChangedFile, type Database, type DotnetProjectInfo, type DriftEntry, type DriftKind, type DriftOptions, type DriftSeverity, type ExportFormat, type ExtractedSymbol, type GenerateDatabaseResult, type GitRef, type IndexResult, type IndexerOptions, type InitProjectInput, type InsertActivityParams, type LatestQualitySnapshot, type LoadRolesResult, type MetricsResult, type Phase, PhaseSchema, type PhasesFile, PhasesFileSchema, type ProjectLanguage, QUALITY_PRIORITIES_DESCRIPTION, QualityCategorySchema, QualityPrioritySchema, type QualityScenario, QualityScenarioSchema, QualityScenarioStatusSchema, type QualityScenariosFile, QualityScenariosFileSchema, type QueryMetricsParams, RefreshValidationError, type ScenarioTestResult, type Service, type SessionTotals, type SymbolKind, type Task, type TaskFile, TaskFileSchema, type TaskInferenceResult, TaskSchema, type TestOutcome, type VerifyResult, addPhaseToYaml, addTaskToYaml, applyInferences, atomicWriteFileSync, deletePhaseFromYaml, deleteTaskFromYaml, detectDrift, detectProjectLanguage, discoverDotnetServices, exportMetrics, generateAgentRoles, generateArc42, generateConfig, generateDatabase, generatePlan, generateSyncFiles, getChangedFiles, getHeadSha, getSessionTotals, getUncommittedChanges, indexPackageDependencies, indexProject, inferTaskStatuses, initializeSchema, insertActivity, loadConfig, loadRole, loadRoles, logWarn, migrate, openDatabase, openMemoryDatabase, queryMetrics, refreshFromDocs, resolveRef, scopeToProject, setSyncCommit, suppressSqliteWarning, syncPhaseToYaml, syncScenarioToYaml, syncTaskToYaml, transaction, verifyScenarios, writeDriftLog };