@arcbridge/core 0.1.5 → 0.1.6
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 +14 -1
- package/dist/index.js +61 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -908,6 +908,19 @@ declare function addTaskToYaml(projectRoot: string, phaseId: string, task: {
|
|
|
908
908
|
* Update a phase's status in phases.yaml.
|
|
909
909
|
*/
|
|
910
910
|
declare function syncPhaseToYaml(projectRoot: string, phaseId: string, status: string, startedAt?: string | null, completedAt?: string | null): void;
|
|
911
|
+
/**
|
|
912
|
+
* Add a new phase to the phases.yaml file.
|
|
913
|
+
*/
|
|
914
|
+
declare function addPhaseToYaml(projectRoot: string, phase: {
|
|
915
|
+
id: string;
|
|
916
|
+
name: string;
|
|
917
|
+
phase_number: number;
|
|
918
|
+
description: string;
|
|
919
|
+
gate_requirements?: string[];
|
|
920
|
+
}): {
|
|
921
|
+
success: boolean;
|
|
922
|
+
warning?: string;
|
|
923
|
+
};
|
|
911
924
|
/**
|
|
912
925
|
* Update a quality scenario's status in 10-quality-scenarios.yaml.
|
|
913
926
|
*/
|
|
@@ -1123,4 +1136,4 @@ declare function loadConfig(projectRoot: string): {
|
|
|
1123
1136
|
error: string | null;
|
|
1124
1137
|
};
|
|
1125
1138
|
|
|
1126
|
-
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, 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, addTaskToYaml, applyInferences, 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 };
|
|
1139
|
+
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, 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, 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 };
|
package/dist/index.js
CHANGED
|
@@ -2978,7 +2978,7 @@ You are responsible for maintaining these sections in \`.arcbridge/arc42/\`. Upd
|
|
|
2978
2978
|
|
|
2979
2979
|
At the start of a project (after init), plan the full roadmap:
|
|
2980
2980
|
- **ArcBridge generates 4 phases as a starting template** (Setup, Foundation, Features, Polish). These are a baseline \u2014 adapt them to your project's actual scope and complexity.
|
|
2981
|
-
- **For larger projects, add more phases**
|
|
2981
|
+
- **For larger projects, add more phases** using \`arcbridge_create_phase\`. Split "Core Features" into multiple phases if needed (e.g., "Auth & Users", "Core Business Logic", "Integrations", "Polish").
|
|
2982
2982
|
- **Phase 0-1 tasks are ready to use** \u2014 they cover setup and foundation for this template
|
|
2983
2983
|
- **Phase 2+ tasks are examples** \u2014 replace them with real tasks derived from the project's requirements and specifications
|
|
2984
2984
|
- Review the phase plan with \`arcbridge_get_phase_plan\` and replace example tasks with project-specific ones
|
|
@@ -3213,6 +3213,7 @@ function phaseManagerTemplate() {
|
|
|
3213
3213
|
"arcbridge_update_task",
|
|
3214
3214
|
"arcbridge_delete_task",
|
|
3215
3215
|
"arcbridge_create_task",
|
|
3216
|
+
"arcbridge_create_phase",
|
|
3216
3217
|
"arcbridge_check_drift",
|
|
3217
3218
|
"arcbridge_verify_scenarios",
|
|
3218
3219
|
"arcbridge_update_scenario_status",
|
|
@@ -3250,7 +3251,7 @@ function phaseManagerTemplate() {
|
|
|
3250
3251
|
## Task Planning
|
|
3251
3252
|
|
|
3252
3253
|
Before starting any phase, ensure proper task planning:
|
|
3253
|
-
- **ArcBridge generates 4 phases as a starting template.** For larger projects, add more phases
|
|
3254
|
+
- **ArcBridge generates 4 phases as a starting template.** For larger projects, add more phases using \`arcbridge_create_phase\`.
|
|
3254
3255
|
- **Phase 0-1 tasks are concrete** \u2014 they cover project setup and foundation. Follow them as-is.
|
|
3255
3256
|
- **Phase 2+ tasks are examples only** \u2014 they show the *shape* of later phases but must be replaced with real tasks derived from the project's actual requirements and specs.
|
|
3256
3257
|
- **At project start, plan ALL phases** \u2014 review \`arcbridge_get_phase_plan\`, delete example tasks in Phase 2+ using \`arcbridge_delete_task\`, and create real tasks based on the product spec.
|
|
@@ -6627,6 +6628,63 @@ function syncPhaseToYaml(projectRoot, phaseId, status, startedAt, completedAt) {
|
|
|
6627
6628
|
if (completedAt) phase.completed_at = completedAt;
|
|
6628
6629
|
writeFileSync5(phasesPath, stringify4(phasesFile), "utf-8");
|
|
6629
6630
|
}
|
|
6631
|
+
function addPhaseToYaml(projectRoot, phase) {
|
|
6632
|
+
try {
|
|
6633
|
+
const phasesPath = join15(
|
|
6634
|
+
projectRoot,
|
|
6635
|
+
".arcbridge",
|
|
6636
|
+
"plan",
|
|
6637
|
+
"phases.yaml"
|
|
6638
|
+
);
|
|
6639
|
+
if (!existsSync8(phasesPath)) {
|
|
6640
|
+
return { success: false, warning: "phases.yaml not found" };
|
|
6641
|
+
}
|
|
6642
|
+
const raw = readFileSync8(phasesPath, "utf-8");
|
|
6643
|
+
const result = PhasesFileSchema.safeParse(parse2(raw));
|
|
6644
|
+
if (!result.success) {
|
|
6645
|
+
return { success: false, warning: "phases.yaml failed validation" };
|
|
6646
|
+
}
|
|
6647
|
+
const phasesFile = result.data;
|
|
6648
|
+
const existingById = phasesFile.phases.some((p) => p.id === phase.id);
|
|
6649
|
+
const existingByNumber = phasesFile.phases.some((p) => p.phase_number === phase.phase_number);
|
|
6650
|
+
if (existingByNumber && !existingById) {
|
|
6651
|
+
const conflicting = phasesFile.phases.find((p) => p.phase_number === phase.phase_number);
|
|
6652
|
+
return {
|
|
6653
|
+
success: false,
|
|
6654
|
+
warning: `Phase number ${phase.phase_number} already used by '${conflicting?.id}'`
|
|
6655
|
+
};
|
|
6656
|
+
}
|
|
6657
|
+
const tasksDir = join15(projectRoot, ".arcbridge", "plan", "tasks");
|
|
6658
|
+
mkdirSync5(tasksDir, { recursive: true });
|
|
6659
|
+
const taskFilePath = join15(tasksDir, `${phase.id}.yaml`);
|
|
6660
|
+
if (!existsSync8(taskFilePath)) {
|
|
6661
|
+
writeFileSync5(
|
|
6662
|
+
taskFilePath,
|
|
6663
|
+
stringify4({ schema_version: 1, phase_id: phase.id, tasks: [] }),
|
|
6664
|
+
"utf-8"
|
|
6665
|
+
);
|
|
6666
|
+
}
|
|
6667
|
+
if (existingById) {
|
|
6668
|
+
return { success: true };
|
|
6669
|
+
}
|
|
6670
|
+
phasesFile.phases.push({
|
|
6671
|
+
id: phase.id,
|
|
6672
|
+
name: phase.name,
|
|
6673
|
+
phase_number: phase.phase_number,
|
|
6674
|
+
status: "planned",
|
|
6675
|
+
description: phase.description,
|
|
6676
|
+
gate_requirements: phase.gate_requirements ?? []
|
|
6677
|
+
});
|
|
6678
|
+
phasesFile.phases.sort((a, b) => a.phase_number - b.phase_number);
|
|
6679
|
+
writeFileSync5(phasesPath, stringify4(phasesFile), "utf-8");
|
|
6680
|
+
return { success: true };
|
|
6681
|
+
} catch (err) {
|
|
6682
|
+
return {
|
|
6683
|
+
success: false,
|
|
6684
|
+
warning: `YAML write failed: ${err instanceof Error ? err.message : String(err)}`
|
|
6685
|
+
};
|
|
6686
|
+
}
|
|
6687
|
+
}
|
|
6630
6688
|
function syncScenarioToYaml(projectRoot, scenarioId, status, linkedTests, verification) {
|
|
6631
6689
|
const scenarioPath = join15(
|
|
6632
6690
|
projectRoot,
|
|
@@ -7660,6 +7718,7 @@ export {
|
|
|
7660
7718
|
QualityScenariosFileSchema,
|
|
7661
7719
|
TaskFileSchema,
|
|
7662
7720
|
TaskSchema,
|
|
7721
|
+
addPhaseToYaml,
|
|
7663
7722
|
addTaskToYaml,
|
|
7664
7723
|
applyInferences,
|
|
7665
7724
|
deleteTaskFromYaml,
|