Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .harness/arch/baselines.json
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@
"violationIds": []
},
"module-size": {
"value": 57900,
"value": 58027,
"violationIds": [
"e5162f4bcf3fa5b14ca7535ace40b58e6a1b319b38dd7e794d64ea1b577fae67",
"c5b4c5a3ec42dfff0c1b6ecb8a0e2dc391925c3cef0645f6235b7b2ac2c03626",
Expand All @@ -322,7 +322,7 @@
]
},
"dependency-depth": {
"value": 269,
"value": 271,
"violationIds": []
}
}
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"docs:build": "pnpm --filter docs build",
"docs:preview": "pnpm --filter docs preview",
"generate-docs": "node scripts/generate-docs.mjs",
"generate-barrel-exports": "node scripts/generate-barrel-exports.mjs",
"changeset": "changeset",
"version": "changeset version",
"release": "pnpm build && changeset publish",
Expand Down
109 changes: 109 additions & 0 deletions packages/cli/src/commands/_registry.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
// AUTO-GENERATED — do not edit. Run `pnpm run generate-barrel-exports` to regenerate.

import type { Command } from 'commander';

import { createAddCommand } from './add';
import { createAgentCommand } from './agent';
import { createBlueprintCommand } from './blueprint';
import { createCheckArchCommand } from './check-arch';
import { createCheckDepsCommand } from './check-deps';
import { createCheckDocsCommand } from './check-docs';
import { createCheckPerfCommand } from './check-perf';
import { createCheckPhaseGateCommand } from './check-phase-gate';
import { createCheckSecurityCommand } from './check-security';
import { createCICommand } from './ci';
import { createCleanupCommand } from './cleanup';
import { createCreateSkillCommand } from './create-skill';
import { createDoctorCommand } from './doctor';
import { createFixDriftCommand } from './fix-drift';
import { createGenerateAgentDefinitionsCommand } from './generate-agent-definitions';
import { createGenerateCommand } from './generate';
import { createGenerateSlashCommandsCommand } from './generate-slash-commands';
import { createGraphCommand } from './graph';
import { createHooksCommand } from './hooks';
import { createImpactPreviewCommand } from './impact-preview';
import { createIngestCommand } from './graph/ingest';
import { createInitCommand } from './init';
import { createInstallCommand } from './install';
import { createInstallConstraintsCommand } from './install-constraints';
import { createIntegrationsCommand } from './integrations';
import { createLearningsCommand } from './learnings';
import { createLinterCommand } from './linter';
import { createMcpCommand } from './mcp';
import { createOrchestratorCommand } from './orchestrator';
import { createPerfCommand } from './perf';
import { createPersonaCommand } from './persona';
import { createPredictCommand } from './predict';
import { createQueryCommand } from './graph/query';
import { createRecommendCommand } from './recommend';
import { createScanCommand } from './graph/scan';
import { createScanConfigCommand } from './scan-config';
import { createSetupCommand } from './setup';
import { createSetupMcpCommand } from './setup-mcp';
import { createShareCommand } from './share';
import { createSkillCommand } from './skill';
import { createSnapshotCommand } from './snapshot';
import { createStateCommand } from './state';
import { createTaintCommand } from './taint';
import { createTraceabilityCommand } from './traceability';
import { createUninstallCommand } from './uninstall';
import { createUninstallConstraintsCommand } from './uninstall-constraints';
import { createUpdateCommand } from './update';
import { createUsageCommand } from './usage';
import { createValidateCommand } from './validate';

/**
* All discovered command creators, sorted alphabetically.
* Used by createProgram() to register commands without manual imports.
*/
export const commandCreators: Array<() => Command> = [
createAddCommand,
createAgentCommand,
createBlueprintCommand,
createCheckArchCommand,
createCheckDepsCommand,
createCheckDocsCommand,
createCheckPerfCommand,
createCheckPhaseGateCommand,
createCheckSecurityCommand,
createCICommand,
createCleanupCommand,
createCreateSkillCommand,
createDoctorCommand,
createFixDriftCommand,
createGenerateAgentDefinitionsCommand,
createGenerateCommand,
createGenerateSlashCommandsCommand,
createGraphCommand,
createHooksCommand,
createImpactPreviewCommand,
createIngestCommand,
createInitCommand,
createInstallCommand,
createInstallConstraintsCommand,
createIntegrationsCommand,
createLearningsCommand,
createLinterCommand,
createMcpCommand,
createOrchestratorCommand,
createPerfCommand,
createPersonaCommand,
createPredictCommand,
createQueryCommand,
createRecommendCommand,
createScanCommand,
createScanConfigCommand,
createSetupCommand,
createSetupMcpCommand,
createShareCommand,
createSkillCommand,
createSnapshotCommand,
createStateCommand,
createTaintCommand,
createTraceabilityCommand,
createUninstallCommand,
createUninstallConstraintsCommand,
createUpdateCommand,
createUsageCommand,
createValidateCommand,
];
106 changes: 9 additions & 97 deletions packages/cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,58 +10,15 @@

import { Command } from 'commander';
import { CLI_VERSION } from './version';
import { createValidateCommand } from './commands/validate';
import { createCheckDepsCommand } from './commands/check-deps';
import { createCheckPerfCommand } from './commands/check-perf';
import { createCheckSecurityCommand } from './commands/check-security';
import { createPerfCommand } from './commands/perf';
import { createCheckDocsCommand } from './commands/check-docs';
import { createInitCommand } from './commands/init';
import { createCleanupCommand } from './commands/cleanup';
import { createFixDriftCommand } from './commands/fix-drift';
import { createAgentCommand } from './commands/agent';
import { createAddCommand } from './commands/add';
import { createLinterCommand } from './commands/linter';
import { createPersonaCommand } from './commands/persona';
import { createSkillCommand } from './commands/skill';
import { createStateCommand } from './commands/state';
import { createCheckPhaseGateCommand } from './commands/check-phase-gate';
import { createCreateSkillCommand } from './commands/create-skill';
import { createSetupMcpCommand } from './commands/setup-mcp';
import { createSetupCommand } from './commands/setup';
import { createDoctorCommand } from './commands/doctor';
import { createGenerateSlashCommandsCommand } from './commands/generate-slash-commands';
import { createCICommand } from './commands/ci';
import { createHooksCommand } from './commands/hooks';
import { createUpdateCommand } from './commands/update';
import { createGenerateAgentDefinitionsCommand } from './commands/generate-agent-definitions';
import { createGenerateCommand } from './commands/generate';
import { createScanCommand } from './commands/graph/scan';
import { createIngestCommand } from './commands/graph/ingest';
import { createQueryCommand } from './commands/graph/query';
import { createGraphCommand } from './commands/graph/index';
import { createMcpCommand } from './commands/mcp';
import { createImpactPreviewCommand } from './commands/impact-preview';
import { createCheckArchCommand } from './commands/check-arch';
import { createBlueprintCommand } from './commands/blueprint';
import { createShareCommand } from './commands/share';
import { createInstallCommand } from './commands/install';
import { createInstallConstraintsCommand } from './commands/install-constraints';
import { createUninstallConstraintsCommand } from './commands/uninstall-constraints';
import { createUninstallCommand } from './commands/uninstall';
import { createOrchestratorCommand } from './commands/orchestrator';
import { createLearningsCommand } from './commands/learnings';
import { createIntegrationsCommand } from './commands/integrations/index';
import { createUsageCommand } from './commands/usage';
import { createTaintCommand } from './commands/taint';
import { createScanConfigCommand } from './commands/scan-config';
import { createSnapshotCommand } from './commands/snapshot';
import { createPredictCommand } from './commands/predict';
import { createRecommendCommand } from './commands/recommend';
import { commandCreators } from './commands/_registry';

/**
* Creates and configures the main Harness CLI program.
*
* Commands are auto-discovered from the commands/ directory via _registry.ts.
* To add a new command: create it in commands/, export a createXXXCommand()
* function, then run `pnpm run generate-barrel-exports` to regenerate the registry.
*
* @returns A Commander instance with all subcommands registered.
*/
export function createProgram(): Command {
Expand All @@ -76,55 +33,10 @@ export function createProgram(): Command {
.option('--verbose', 'Verbose output')
.option('--quiet', 'Minimal output');

// Register commands
program.addCommand(createValidateCommand());
program.addCommand(createCheckDepsCommand());
program.addCommand(createCheckDocsCommand());
program.addCommand(createCheckPerfCommand());
program.addCommand(createCheckSecurityCommand());
program.addCommand(createPerfCommand());
program.addCommand(createInitCommand());
program.addCommand(createCleanupCommand());
program.addCommand(createFixDriftCommand());
program.addCommand(createAgentCommand());
program.addCommand(createAddCommand());
program.addCommand(createLinterCommand());
program.addCommand(createPersonaCommand());
program.addCommand(createSkillCommand());
program.addCommand(createStateCommand());
program.addCommand(createLearningsCommand());
program.addCommand(createCheckPhaseGateCommand());
program.addCommand(createCreateSkillCommand());
program.addCommand(createSetupMcpCommand());
program.addCommand(createSetupCommand());
program.addCommand(createDoctorCommand());
program.addCommand(createGenerateSlashCommandsCommand());
program.addCommand(createGenerateAgentDefinitionsCommand());
program.addCommand(createGenerateCommand());
program.addCommand(createCICommand());
program.addCommand(createHooksCommand());
program.addCommand(createUpdateCommand());
program.addCommand(createScanCommand());
program.addCommand(createIngestCommand());
program.addCommand(createQueryCommand());
program.addCommand(createGraphCommand());
program.addCommand(createMcpCommand());
program.addCommand(createImpactPreviewCommand());
program.addCommand(createCheckArchCommand());
program.addCommand(createBlueprintCommand());
program.addCommand(createShareCommand());
program.addCommand(createInstallCommand());
program.addCommand(createInstallConstraintsCommand());
program.addCommand(createUninstallConstraintsCommand());
program.addCommand(createUninstallCommand());
program.addCommand(createOrchestratorCommand());
program.addCommand(createIntegrationsCommand());
program.addCommand(createUsageCommand());
program.addCommand(createTaintCommand());
program.addCommand(createScanConfigCommand());
program.addCommand(createSnapshotCommand());
program.addCommand(createPredictCommand());
program.addCommand(createRecommendCommand());
// Register all discovered commands
for (const creator of commandCreators) {
program.addCommand(creator());
}

return program;
}
Expand Down
3 changes: 3 additions & 0 deletions packages/core/src/roadmap/sync-engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ import { serializeRoadmap } from './serialize';
import type { TrackerSyncAdapter, ExternalSyncOptions } from './tracker-sync';
import { resolveReverseStatus } from './tracker-sync';
import { isRegression } from './status-rank';
// Known adapters: adapters/github-issues.ts (GitHubIssuesSyncAdapter).
// This module consumes adapters via the TrackerSyncAdapter interface.
// Changes to the interface contract require updating both this file and all adapters.

function emptySyncResult(): SyncResult {
return { created: [], updated: [], assignmentChanges: [], errors: [] };
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/state/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type { Result } from '../shared/result';
import { Ok, Err } from '../shared/result';
import { getStateDir } from './state-shared';
import { EVENTS_FILE } from './constants';
import { computeContentHash } from './learnings';
import { computeContentHash } from './learnings-content';

/** Event types emitted at skill lifecycle points. */
export type EventType =
Expand Down
46 changes: 29 additions & 17 deletions packages/core/src/state/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,31 +21,43 @@ export type { HarnessState, FailureEntry, Handoff, GateResult, GateConfig } from
export { loadState, saveState } from './state-persistence';

/**
* Learning accumulation and retrieval.
* Learning content parsing and deduplication.
*/
export {
clearLearningsCache,
appendLearning,
loadRelevantLearnings,
loadBudgetedLearnings,
parseFrontmatter,
extractIndexEntry,
parseDateFromEntry,
normalizeLearningContent,
computeContentHash,
analyzeLearningPatterns,
} from './learnings-content';
export type {
LearningsFrontmatter,
LearningsIndexEntry,
LearningPattern,
} from './learnings-content';

/**
* Learning file loader with mtime-based cache.
*/
export { clearLearningsCache, loadRelevantLearnings } from './learnings-loader';

/**
* Learning CRUD operations: append, load index, budgeted retrieval.
*/
export { appendLearning, loadBudgetedLearnings, loadIndexEntries } from './learnings';
export type { BudgetedLearningsOptions } from './learnings';

/**
* Learning lifecycle: archival, pruning, session promotion.
*/
export {
archiveLearnings,
pruneLearnings,
promoteSessionLearnings,
countLearningEntries,
parseFrontmatter,
extractIndexEntry,
loadIndexEntries,
} from './learnings';
export type {
BudgetedLearningsOptions,
LearningPattern,
PruneResult,
PromoteResult,
LearningsFrontmatter,
LearningsIndexEntry,
} from './learnings';
} from './learnings-lifecycle';
export type { PruneResult, PromoteResult } from './learnings-lifecycle';

/**
* Failure tracking, loading, and archival.
Expand Down
Loading
Loading