initLogger() | function | Initialize the root logger. Call once at startup. Uses pino-roll for automat… |
getLogger() | function | Get a child logger bound to a subsystem name. Safe to call before initLogger… |
getLogDir() | function | Get the current log directory path. Useful for read APIs that need to scan lo… |
closeLogger() | function | Flush and close the logger. Call during graceful shutdown. Returns a Promise… |
getPlatformPaths() | function | Get OS-appropriate paths for CLEO’s global directories. Cached after first ca… |
getSystemInfo() | function | Get a cached system information snapshot. Captured once and reused for the pr… |
_resetPlatformPathsCache() | function | Invalidate the path and system info caches. Use in tests after mutating CLEO_… |
isProjectInitialized() | function | Check if a CLEO project is initialized at the given root. Checks for tasks.db. |
getCleoHome() | function | Get the global CLEO home directory. Respects CLEO_HOME env var; otherwise use… |
getCleoTemplatesDir() | function | Get the global CLEO templates directory. |
getCleoSchemasDir() | function | Get the global CLEO schemas directory. |
getCleoDocsDir() | function | Get the global CLEO docs directory. |
getCleoDir() | function | Get the project CLEO data directory (relative). Respects CLEO_DIR env var, de… |
getCleoDirAbsolute() | function | Get the absolute path to the project CLEO directory. |
getProjectRoot() | function | Get the project root from the CLEO directory. Respects CLEO_ROOT env var, the… |
resolveProjectPath() | function | Resolve a project-relative path to an absolute path. |
getTaskPath() | function | Get the path to the project’s tasks.db file (SQLite database). |
getConfigPath() | function | Get the path to the project’s config.json file. |
getSessionsPath() | function | Get the path to the project’s sessions.json file. |
getArchivePath() | function | Get the path to the project’s archive file. |
getLogPath() | function | Get the path to the project’s log file. Canonical structured runtime log path… |
getBackupDir() | function | Get the backup directory for operational backups. |
getGlobalConfigPath() | function | Get the global config file path. |
getCleoGlobalRecipesDir() | function | Get the Global Justfile Hub directory. The hub stores cross-project recipe l… |
getCleoGlobalJustfilePath() | function | Get the absolute path to the primary global justfile. |
getCleoPiExtensionsDir() | function | Get the Global Pi Extensions Hub directory. Houses the Pi extensions that dr… |
getCleoCantWorkflowsDir() | function | Get the Global CANT Workflows Hub directory. Stores compiled and parsed… |
getCleoGlobalAgentsDir() | function | Get the Global CLEO Agents directory. Holds globally-available CANT agent de… |
getAgentOutputsDir() | function | Get the agent outputs directory (relative path) from config or default. Conf… |
getAgentOutputsAbsolute() | function | Get the absolute path to the agent outputs directory. |
getManifestPath() | function | Get the absolute path to the legacy agent-outputs flat-file (deprecated per ADR-027). Checks config.agentOutputs… |
getManifestArchivePath() | function | Get the absolute path to the MANIFEST.archive.jsonl file. |
isAbsolutePath() | function | Check if a path is absolute (POSIX or Windows). |
getCleoLogDir() | function | Get the OS log directory for CLEO global logs. Linux: ~/.local/state/cleo | m… |
getCleoCacheDir() | function | Get the OS cache directory for CLEO. Linux: ~/.cache/cleo | macOS: ~/Library/… |
getCleoTempDir() | function | Get the OS temp directory for CLEO ephemeral files. |
getCleoConfigDir() | function | Get the OS config directory for CLEO. Linux: ~/.config/cleo | macOS: ~/Librar… |
getCleoTemplatesTildePath() | function | Get the CLEO templates directory as a tilde-prefixed path for use in @ refe… |
getAgentsHome() | function | Get the global agents hub directory. Respects AGENTS_HOME env var, defaults t… |
getClaudeAgentsDir() | function | Get the Claude Code agents directory (~/.claude/agents by default). |
getClaudeMemDbPath() | function | Get the claude-mem SQLite database path. |
tableExists() | function | Check whether a table exists in a SQLite database. |
isSqliteBusy() | function | Check if an error is a SQLite BUSY error (database locked by another process)… |
createSafetyBackup() | function | Create a pre-migration safety backup of the database file. Only creates the… |
reconcileJournal() | function | Bootstrap and reconcile the Drizzle migration journal. Handles three scenari… |
migrateWithRetry() | function | |
ensureColumns() | function | Ensure all required columns exist on a table. Uses PRAGMA table_info to insp… |
vacuumIntoBackup() | function | Create a VACUUM INTO snapshot of the SQLite database. Debounced by default (… |
listSqliteBackups() | function | List existing SQLite backup snapshots, newest first. |
getBrainDbPath() | function | Get the path to the brain.db SQLite database file. |
resolveBrainMigrationsFolder() | function | Resolve the path to the drizzle-brain migrations folder. Works from both src/… |
isBrainVecLoaded() | function | Check whether the sqlite-vec extension is loaded for the current brain.db. |
getBrainDb() | function | Initialize the brain.db SQLite database (lazy, singleton). Creates the databa… |
closeBrainDb() | function | Close the brain.db database connection and release resources. |
resetBrainDbState() | function | Reset brain.db singleton state without saving. Used during tests or when data… |
getBrainNativeDb() | function | Get the underlying node:sqlite DatabaseSync instance for brain.db. Useful for… |
getNexusDbPath() | function | Get the path to the nexus.db SQLite database file. nexus.db lives in the glob… |
resolveNexusMigrationsFolder() | function | Resolve the path to the drizzle-nexus migrations folder. Works from both src/… |
getNexusDb() | function | Initialize the nexus.db SQLite database (lazy, singleton). Creates the databa… |
closeNexusDb() | function | Close the nexus.db database connection and release resources. |
resetNexusDbState() | function | Reset nexus.db singleton state without saving. Used during tests or when data… |
getNexusNativeDb() | function | Get the underlying node:sqlite DatabaseSync instance for nexus.db. Useful for… |
openNativeDatabase() | function | Open a node:sqlite DatabaseSync with CLEO standard pragmas. CRITICAL: WAL mo… |
getDbPath() | function | Get the path to the SQLite database file. |
getDb() | function | Initialize the SQLite database (lazy, singleton). Creates the database file a… |
resolveMigrationsFolder() | function | Resolve the path to the drizzle migrations folder. Works from both src/ (dev… |
closeDb() | function | Close the database connection and release resources. |
resetDbState() | function | Reset database singleton state without saving. Used during migrations when da… |
getSchemaVersion() | function | Get the schema version from the database. |
dbExists() | function | Check if the database file exists. |
getNativeDb() | function | Get the underlying node:sqlite DatabaseSync instance. Useful for direct PRAGM… |
getNativeTasksDb() | function | Get the underlying node:sqlite DatabaseSync instance for tasks.db. Alias for… |
closeAllDatabases() | function | Close ALL database singletons (tasks.db, brain.db, nexus.db). Must be called… |
safeParseJson() | function | Parse a JSON string, returning undefined on null/undefined input or parse error. |
safeParseJsonArray() | function | Parse a JSON string expected to contain an array. Returns undefined for null/… |
rowToTask() | function | Convert a database TaskRow to a domain Task object. |
taskToRow() | function | Convert a domain Task to a database row for insert/upsert. |
archivedTaskToRow() | function | Convert a domain Task to a row suitable for archived tasks. |
rowToSession() | function | Convert a SessionRow to a domain Session. |
getSignaldockDbPath() | function | Get the path to the signaldock.db SQLite database file. |
ensureSignaldockDb() | function | Ensure signaldock.db exists and has the full schema applied. Idempotent — sa… |
checkSignaldockDbHealth() | function | Check signaldock.db health — table count, WAL mode, schema version. Used by… |
cleanupBrainRefsOnTaskDelete() | function | Clean up brain.db references after a task is deleted from tasks.db. Handles:… |
cleanupBrainRefsOnSessionDelete() | function | Clean up brain.db references after a session is deleted from tasks.db. Handl… |
taskExistsInTasksDb() | function | Verify a task ID exists in tasks.db before writing a cross-DB reference to br… |
reconcileOrphanedRefs() | function | Reconcile orphaned cross-DB references in brain.db. Scans brain.db for refer… |
sessionExistsInTasksDb() | function | |
agentExistsInSignaldockDb() | function | Verify an agent exists in signaldock.db before creating cross-DB references… |
getErrorDefinition() | function | Look up an error definition by exit code. |
getErrorDefinitionByLafsCode() | function | Look up an error definition by LAFS string code. |
getAllErrorDefinitions() | function | Get all error definitions as an array. |
CleoError | class | Structured error class for CLEO operations. Carries an exit code, human-reada… |
upsertTask() | function | Upsert a single task row into the tasks table. Handles both active task upser… |
upsertSession() | function | Upsert a single session row into the sessions table. |
updateDependencies() | function | Update dependencies for a task: delete existing, then re-insert. Optionally f… |
batchUpdateDependencies() | function | Batch-update dependencies for multiple tasks in two bulk SQL operations. Repl… |
loadDependenciesForTasks() | function | Batch-load dependencies for a list of tasks and apply them in-place. Uses inA… |
loadRelationsForTasks() | function | Batch-load relations for a list of tasks and apply them in-place. Mirrors loa… |
generateAgentId() | function | Generate a unique agent instance ID. Format: agt_{YYYYMMDDHHmmss}_{6hex} |
registerAgent() | function | Register a new agent instance in the database. Sets initial status to ‘starti… |
deregisterAgent() | function | Deregister (stop) an agent instance. Sets status to ‘stopped’ and records the… |
heartbeat() | function | Record a heartbeat for an agent instance. Updates last_heartbeat and return… |
updateAgentStatus() | function | Update agent status with optional error tracking. When status is ‘error’ or ’… |
incrementTasksCompleted() | function | Increment the completed task count for an agent. |
listAgentInstances() | function | List agent instances with optional filters. |
getAgentInstance() | function | Get a single agent instance by ID. |
classifyError() | function | Classify an error as retriable, permanent, or unknown. Retriable errors are… |
getAgentErrorHistory() | function | Get the error history for a specific agent. |
checkAgentHealth() | function | Check agent health by finding instances whose last heartbeat exceeds the thre… |
markCrashed() | function | Mark an agent instance as crashed. Increments error count and sets status to… |
getHealthReport() | function | Generate a health report summarizing all agent instances. Includes counts by… |
setMetaValue() | function | Write a JSON blob to the schema_meta table by key. |
createSqliteDataAccessor() | function | Create a SQLite-backed DataAccessor. Opens (or creates) the SQLite database… |
atomicWrite() | function | Write data to a file atomically. Creates parent directories if they don’t exi… |
safeReadFile() | function | Read a file and return its contents. Returns null if the file does not exist. |
atomicWriteJson() | function | Write JSON data atomically with consistent formatting. |
atomicDatabaseMigration() | function | Perform atomic database migration using rename operations. Pattern: 1. Wri… |
restoreDatabaseFromBackup() | function | Restore database from backup after failed migration. |
cleanupMigrationArtifacts() | function | Clean up migration artifacts after successful migration. |
validateSqliteDatabase() | function | Validate SQLite database integrity by attempting to open it. |
createBackup() | function | Create a numbered backup of a file. Rotates existing backups (file.1 - file.2… |
listBackups() | function | List existing backups for a file, sorted by number (newest first). |
restoreFromBackup() | function | Restore a file from its most recent backup. Returns the path of the backup th… |
acquireLock() | function | Acquire an exclusive lock on a file. Returns a release function that must be… |
isLocked() | function | Check if a file is currently locked. |
withLock() | function | Execute a function while holding an exclusive lock on a file. The lock is aut… |
isProviderHookEvent() | function | Type guard for CAAMP/provider-discoverable canonical hook events. |
isInternalHookEvent() | function | Type guard for CLEO-local coordination hook events. |
HookRegistry | class | Central registry for hook handlers. Manages registration, priority-based ord… |
readJson() | function | Read and parse a JSON file. Returns null if the file does not exist. |
readJsonRequired() | function | Read a JSON file, throwing if it doesn’t exist. |
computeChecksum() | function | Compute a truncated SHA-256 checksum of a value. Used for integrity verificat… |
saveJson() | function | Save JSON data with optional locking, backup, and validation. Follows the CLE… |
appendJsonl() | function | Append a line to a JSONL file atomically. Used for manifest entries and audit… |
readLogEntries() | function | Read log entries from a hybrid JSON/JSONL file. Handles three formats: 1. P… |
makeCleoGitEnv() | function | Build environment variables that point git at the isolated .cleo/.git repo… |
cleoGitCommand() | function | Run a git command against the isolated .cleo/.git repo, suppressing errors… |
isCleoGitInitialized() | function | Check whether the isolated .cleo/.git repo has been initialized. T4872 |
loadStateFileAllowlist() | function | Load additional state file paths from config.json… |
loadCheckpointConfig() | function | Load checkpoint configuration from config.json. T4552 |
shouldCheckpoint() | function | Check whether a checkpoint should be performed. Evaluates: enabled, .cleo/.gi… |
gitCheckpoint() | function | Stage .cleo/ state files and commit to the isolated .cleo/.git repo. Never fa… |
gitCheckpointStatus() | function | Show checkpoint configuration and status. T4552 T4872 |
gitCheckpointDryRun() | function | Show what files would be committed (dry-run). T4552 T4872 |
DataSafetyError | class | Safety violation error |
getSafetyStats() | function | Get current safety statistics |
resetSafetyStats() | function | Reset safety statistics (for testing) |
safeSaveSessions() | function | Safe wrapper for DataAccessor.saveSessions() |
safeSaveArchive() | function | Safe wrapper for DataAccessor.saveArchive() |
safeSingleTaskWrite() | function | Safe wrapper for single-task write operations (T5034). Performs: 1. Sequence… |
safeAppendLog() | function | Safe wrapper for DataAccessor.appendLog() Note: Log appends are fire-and-for… |
runDataIntegrityCheck() | function | Run comprehensive data integrity check. Validates all data files and sequence… |
forceSafetyCheckpoint() | function | Force immediate checkpoint. Use before destructive operations. |
disableSafety() | function | Disable all safety for current process. DANGEROUS - only use for recovery ope… |
enableSafety() | function | Re-enable safety after being disabled. |
SafetyDataAccessor | class | Safety-enabled DataAccessor wrapper. Wraps any DataAccessor implementation a… |
wrapWithSafety() | function | Wrap a DataAccessor with safety. This is the internal factory helper that wr… |
isSafetyEnabled() | function | Check if safety is currently enabled. |
getSafetyStatus() | function | Get safety status information. |
createDataAccessor() | function | Create a DataAccessor for the given working directory. Always creates a SQLit… |
getAccessor() | function | Convenience: get a DataAccessor with auto-detected engine. |
showSequence() | function | Show current sequence state. |
checkSequence() | function | Check sequence integrity. |
repairSequence() | function | Repair sequence if behind. |
allocateNextTaskId() | function | Atomically allocate the next task ID via SQLite. Uses BEGIN IMMEDIATE to gua… |
SafetyError | class | Safety violation error. |
checkTaskExists() | function | Check if a task ID already exists (collision detection). |
verifyTaskWrite() | function | Verify a task was actually written to the database. |
validateAndRepairSequence() | function | Validate and repair sequence if necessary. |
triggerCheckpoint() | function | Trigger auto-checkpoint after successful write. |
safeCreateTask() | function | Safely create a task with all safety mechanisms. Wraps the actual createTask… |
safeUpdateTask() | function | Safely update a task with all safety mechanisms. |
safeDeleteTask() | function | Safely delete a task with all safety mechanisms. |
verifySessionWrite() | function | Verify session write. |
safeCreateSession() | function | Safely create a session with all safety mechanisms. |
forceCheckpointBeforeOperation() | function | Force a checkpoint before destructive operations. Use this before migrations,… |
runDataIntegrityCheck() | function | Run comprehensive data integrity check. Reports all issues found. |
getTask() | function | Get a task by ID, including its dependencies. |
updateTask() | function | Update an existing task. |
deleteTask() | function | Delete a task by ID. |
listTasks() | function | List tasks with optional filters. |
findTasks() | function | Find tasks by fuzzy text search. |
archiveTask() | function | Archive a task (sets status to ‘archived’ with metadata). |
addDependency() | function | Add a dependency between tasks. |
removeDependency() | function | Remove a dependency. |
addRelation() | function | Add a relation between tasks. |
getRelations() | function | Get relations for a task. |
getBlockerChain() | function | Get the dependency chain (blockers) for a task using recursive CTE. |
getChildren() | function | Get children of a task (hierarchy). |
getSubtree() | function | Build a tree from a root task using recursive CTE. |
countByStatus() | function | Count tasks by status. |
countTasks() | function | Get total task count (excluding archived). |
createTask() | function | Create a task with full safety protections. Includes: collision detection, wr… |
updateTaskSafe() | function | Update a task with full safety protections. Includes: write verification, aut… |
deleteTaskSafe() | function | Delete a task with full safety protections. Includes: delete verification, au… |
taskShowNext() | function | Build _next directives for a full task detail result (tasks.show). |
taskListItemNext() | function | Build _next directives for a task in a list or find result. |
sessionListItemNext() | function | Build _next directives for a session in a list or find result. |
sessionStartNext() | function | Build _next directives for a session start result. |
memoryFindHitNext() | function | Build _next directives for a memory search (find) hit. |
showTask() | function | Get a task by ID with enriched details. Checks active tasks first, then archi… |
createPage() | function | Create an LAFSPage object from pagination parameters. Returns mode:“none” wh… |
paginate() | function | Apply pagination to an array of items and return the sliced result with page… |
toCompact() | function | Convert a full Task to compact representation with _next directives. |
listTasks() | function | List tasks with optional filtering and pagination. T4460 |
fuzzyScore() | function | Calculate fuzzy match score between query and text. Higher score = better mat… |
findTasks() | function | Search tasks by fuzzy matching, ID prefix, or exact title. Returns minimal fi… |
extractAdrId() | function | Extract ADR ID from filename (e.g., ‘ADR-007-domain-consolidation.md’ - ‘ADR-… |
parseFrontmatter() | function | Parse bold-key frontmatter pattern: Key: value |
extractTitle() | function | Extract H1 title from markdown |
parseAdrFile() | function | Parse a single ADR markdown file into an AdrRecord |
linkPipelineAdr() | function | Link ADRs to a pipeline task when the architecture_decision stage completes. |
syncAdrsToDb() | function | Sync all ADR markdown files into the architecture_decisions table AND regener… |
recordEvidence() | function | Record an evidence artifact linked to a lifecycle stage. Writes to the SQLit… |
getEvidence() | function | Query evidence records for an epic, optionally filtered by stage. |
linkProvenance() | function | Convenience wrapper to record a file as provenance evidence. Converts the fi… |
getEvidenceSummary() | function | Aggregate evidence counts per stage for an epic. |
normalizeEpicId() | function | Strip suffixes from epic directory names. E.g. T4881_install-channels -… |
getRcasdBaseDir() | function | Get the absolute path to the .cleo/rcasd/ base directory. |
getEpicDir() | function | Get the absolute path to .cleo/rcasd/{epicId}/. Uses the normalized epic ID… |
findEpicDir() | function | Search both rcasd/ and legacy rcsd/ for an existing epic directory. Also… |
getStagePath() | function | Get the stage subdirectory path for an epic. Uses STAGE_SUBDIRS mapping, fall… |
ensureStagePath() | function | Get the stage subdirectory path, creating it if it does not exist. |
getManifestPath() | function | Get the manifest path for an epic under the default rcasd directory. |
findManifestPath() | function | Search both rcasd/ and rcsd/ for an existing manifest file. Checks suffix… |
getLooseResearchFiles() | function | Scan the rcasd root directory for loose T####_*.md files that are not insid… |
listEpicDirs() | function | List all epic directories across rcasd/ and rcsd/. |
parseFrontmatter() | function | Parse YAML frontmatter from a markdown string. Finds the YAML block delimite… |
serializeFrontmatter() | function | Convert a FrontmatterMetadata object to a YAML frontmatter string. Output fo… |
addFrontmatter() | function | Add or replace YAML frontmatter in markdown content. If the content already… |
buildFrontmatter() | function | Convenience builder for common frontmatter patterns. Auto-sets updated to… |
getBacklinks() | function | Scan all markdown files in .cleo/rcasd/ for files that reference the given… |
getStageOrder() | function | Get the order/index of a stage (1-based). |
isStageBefore() | function | Check if stage A comes before stage B in the pipeline. |
isStageAfter() | function | Check if stage A comes after stage B in the pipeline. |
getNextStage() | function | Get the next stage in the pipeline. |
getPreviousStage() | function | Get the previous stage in the pipeline. |
getStagesBetween() | function | Get all stages between two stages (inclusive). |
getPrerequisites() | function | Get prerequisites for a stage. |
isPrerequisite() | function | Check if one stage is a prerequisite of another. |
getDependents() | function | Get all stages that depend on a given stage. |
isValidStage() | function | Check if a stage name is valid. |
validateStage() | function | Validate a stage name and throw if invalid. |
isValidStageStatus() | function | Check if a stage status is valid. |
getStagesByCategory() | function | Get stages by category. |
getSkippableStages() | function | Get skippable stages. |
checkTransition() | function | Check if a transition is allowed. |
ensureStageArtifact() | function | Ensure stage artifact exists and frontmatter/backlinks are up to date. |
getSkillSearchPaths() | function | Build the CAAMP skill search paths in priority order. Uses CAAMP’s canonical… |
getSkillsDir() | function | Get the primary skills directory (app-embedded). T4516 |
getSharedDir() | function | Get the shared skills resources directory. T4516 |
mapSkillName() | function | Map a user-friendly skill name to the canonical ct-prefixed directory name. S… |
listCanonicalSkillNames() | function | List all known canonical skill names (unique values from the map). T4516 |
parseFrontmatter() | function | Parse YAML-like frontmatter from a SKILL.md file. Handles the --- delimited h… |
discoverSkill() | function | Discover a single skill from a directory. Tries CAAMP’s parseSkillFile first,… |
discoverSkillsInDir() | function | Discover all skills in a single directory. Scans for subdirectories containin… |
discoverAllSkills() | function | Discover all skills across CAAMP search paths. Returns skills in priority ord… |
findSkill() | function | Find a specific skill by name across all search paths. T4516 |
toSkillSummary() | function | Convert a Skill to a lightweight SkillSummary. T4516 |
generateManifest() | function | Generate a skill manifest from discovered skills. T4516 |
resolveTemplatePath() | function | Resolve a skill template path (SKILL.md) by name. T4516 |
loadPlaceholders() | function | Load token definitions from placeholders.json. T4521 |
buildDefaults() | function | Build the full default values map (merging placeholders.json with hardcoded d… |
validateTokenValue() | function | Validate a single token value against its pattern. T4521 |
validateRequired() | function | Validate all required tokens are present and valid. T4521 |
validateAllTokens() | function | Validate all tokens in a values map (required + optional). T4521 |
injectTokens() | function | Inject token values into a template string. Replaces all TOKEN_NAME patterns… |
hasUnresolvedTokens() | function | Check if a template has unresolved tokens after injection. T4521 |
loadAndInject() | function | Load a skill template and inject tokens. T4521 |
setFullContext() | function | Build a complete TokenValues map from a task, resolving all standard tokens… |
autoDispatch() | function | Auto-dispatch a task to the most appropriate skill. Tries strategies in prior… |
dispatchExplicit() | function | Dispatch with explicit skill override. Verifies the skill exists before retur… |
getProtocolForDispatch() | function | Get the protocol type for a dispatch result. T4517 |
prepareSpawnContext() | function | Prepare spawn context for a dispatched skill. Returns the skill name and prot… |
prepareSpawnMulti() | function | Compose multiple skills into a single prompt with progressive disclosure. Por… |
buildStageGuidance() | function | Build structured stage guidance for a given pipeline stage. Resolves the pri… |
formatStageGuidance() | function | Format stage guidance as a Markdown-wrapped system prompt. Since… |
renderStageGuidance() | function | Convenience wrapper: build AND format in a single call. |
getLifecycleState() | function | Get the current lifecycle state for an epic. T4467 |
startStage() | function | Start a lifecycle stage. T4467 |
completeStage() | function | Complete a lifecycle stage. T4467 |
skipStage() | function | Skip a lifecycle stage. T4467 |
checkGate() | function | Check lifecycle gate before starting a stage. T4467 |
getLifecycleStatus() | function | Get lifecycle status for an epic from SQLite. Returns stage progress, current… |
getLifecycleHistory() | function | Get lifecycle history for an epic. Returns stage transitions and gate events… |
getLifecycleGates() | function | Get all gate statuses for an epic. T4785 |
getStagePrerequisites() | function | Get prerequisites for a target stage. Pure data function, no I/O. T4785 |
checkStagePrerequisites() | function | Check if a stage’s prerequisites are met for an epic. T4785 |
recordStageProgress() | function | Record a stage status transition (progress/record). SQLite-native implementat… |
skipStageWithReason() | function | Skip a stage with a reason (engine-compatible). T4785 |
resetStage() | function | Reset a stage to pending (emergency). T4785 |
passGate() | function | Mark a gate as passed. SQLite-native implementation - T4801 T4785 T4801 |
failGate() | function | Mark a gate as failed. SQLite-native implementation - T4801 T4785 T4801 |
listEpicsWithLifecycle() | function | List all epic IDs that have lifecycle data. T4785 |
getCurrentSessionId() | function | Get the current session ID. |
getContextStatePath() | function | Get context state file path for a session. |
readContextState() | function | Read context state for a session. Returns null if stale or missing. |
getThresholdLevel() | function | Determine the threshold level for a given percentage. |
shouldAlert() | function | Determine if we should alert based on threshold crossing. Returns the alert l… |
getRecommendedAction() | function | Get recommended action for an alert level. |
checkContextAlert() | function | Main function to check and determine if an alert should fire. Non-blocking -… |
pushWarning() | function | Push a deprecation or informational warning into the current envelope. Warnin… |
formatSuccess() | function | Format a successful result as a full LAFS-conformant envelope. Always produc… |
formatError() | function | Format an error as a full LAFS-conformant envelope. Always produces the full… |
formatOutput() | function | Format any result (success or error) as LAFS JSON. |
getRegistryEntry() | function | Look up a registry entry by CLEO exit code. T4671 T4663 |
getRegistryEntryByLafsCode() | function | Look up a registry entry by LAFS string code. T4671 T4663 |
getCleoErrorRegistry() | function | Get the full CLEO error registry for conformance testing. T4671 T4663 |
isCleoRegisteredCode() | function | Check if a LAFS code is registered in the CLEO error registry. T4671 T4663 |
createTestDb() | function | Create a temporary directory with an initialized tasks.db. Usage: |
makeTasks() | function | Build full Task objects from a list of task partials. Useful for seeding test… |
seedTasks() | function | Seed tasks into the test database via the accessor. Uses a two-pass approach… |
getChildren() | function | Get direct children of a task. |
getChildIds() | function | Get direct child IDs. |
getDescendants() | function | Get all descendants of a task (recursive). |
getDescendantIds() | function | Get all descendant IDs (flat list). |
getParentChain() | function | Get the parent chain (ancestors) from a task up to the root. Returns ordered… |
getParentChainIds() | function | Get the parent chain as IDs. |
getDepth() | function | Calculate depth of a task in the hierarchy (0-based). Root tasks have depth 0… |
getRootAncestor() | function | Get the root ancestor of a task. |
isAncestorOf() | function | Check if a task is an ancestor of another. |
isDescendantOf() | function | Check if a task is a descendant of another. |
getSiblings() | function | Get sibling tasks (same parent). |
validateHierarchy() | function | |
wouldCreateCircle() | function | Detect circular reference if parentId were set. |
buildTree() | function | |
flattenTree() | function | Flatten a tree back to a list (depth-first). |
resolveHierarchyPolicy() | function | Resolve a full HierarchyPolicy from config, starting with a profile preset an… |
assertParentExists() | function | Assert that a parent task exists in the task list. Returns an error result if… |
assertNoCycle() | function | Assert that re-parenting would not create a cycle. Returns an error result if… |
countActiveChildren() | function | Count active (non-done, non-cancelled, non-archived) children of a parent. |
validateHierarchyPlacement() | function | Validate whether a new task can be placed under the given parent according to… |
loadConfig() | function | Load and merge configuration from all sources. Priority: defaults global con… |
getConfigValue() | function | Get a single config value with source tracking. Returns the value and which s… |
getRawConfigValue() | function | Get a raw config value from the project config file only (no cascade). Return… |
getRawConfig() | function | Get the full raw project config (no cascade). Returns null if no config file… |
parseConfigValue() | function | Parse a string value into its appropriate JS type. Handles booleans, null, in… |
setConfigValue() | function | Set a config value in the project or global config file (dot-notation support… |
applyStrictnessPreset() | function | Apply a strictness preset to the project (or global) config. Merges preset va… |
listStrictnessPresets() | function | List all available presets with their descriptions and values. Used by the CL… |
isMissingBrainSchemaError() | function | Return true when the error is the “no such table: brain_*” SQLite error throw… |
isAutoCaptureEnabled() | function | Return true when brain.autoCapture is enabled for the given project. Resol… |
recordDecision() | function | Record a decision to the audit trail. Appends a JSON line to… |
getDecisionLog() | function | Read the decision log, optionally filtered by sessionId and/or taskId. |
computeHandoff() | function | Compute handoff data for a session. Gathers all session statistics and auto-c… |
persistHandoff() | function | Persist handoff data to a session. |
getHandoff() | function | Get handoff data for a session. |
getLastHandoff() | function | Get handoff data for the most recent ended session. Filters by scope if provi… |
computeDebrief() | function | Compute rich debrief data for a session. Builds on computeHandoff() and adds… |
BrainDataAccessor | class | |
getBrainAccessor() | function | Factory: get a BrainDataAccessor backed by the brain.db singleton. |
typedAll() | function | Type-safe wrapper for StatementSync.all — centralizes the as unknown as c… |
typedGet() | function | Type-safe wrapper for StatementSync.get — centralizes the as unknown as c… |
LocalEmbeddingProvider | class | Local embedding provider backed by xenova/transformers. Produces 384-dimensi… |
getLocalEmbeddingProvider() | function | Get or create the shared LocalEmbeddingProvider singleton. |
setEmbeddingProvider() | function | Register an embedding provider for the brain system. Validates that the provi… |
getEmbeddingProvider() | function | Get the currently registered embedding provider, or null. |
clearEmbeddingProvider() | function | Clear the current embedding provider (useful for testing). |
embedText() | function | Embed text into a float vector using the registered provider. Returns null wh… |
isEmbeddingAvailable() | function | Check whether embedding is currently available. |
initDefaultProvider() | function | Initialize the default local embedding provider. Loads the LocalEmbeddingPro… |
searchSimilar() | function | Search for entries similar to a query string using vector similarity. 1. Emb… |
ensureFts5Tables() | function | Create FTS5 virtual tables and content-sync triggers if they don’t exist. Us… |
rebuildFts5Index() | function | Rebuild FTS5 indexes from the content tables. Useful after bulk inserts that… |
searchBrain() | function | Unified search across all BRAIN memory tables. Uses FTS5 MATCH for full-text… |
resetFts5Cache() | function | Reset the cached FTS5 availability flag. Used in tests to force re-detection. |
hybridSearch() | function | Hybrid search across FTS5, vector similarity, and graph neighbors. 1. Runs F… |
generateMemoryBridgeContent() | function | Generate memory bridge content from brain.db. Returns the markdown string (do… |
writeMemoryBridge() | function | Write memory bridge content to .cleo/memory-bridge.md. |
refreshMemoryBridge() | function | Best-effort refresh: call from session.end, tasks.complete, or memory.observe… |
generateContextAwareContent() | function | Generate context-aware memory bridge content and write to disk. When… |
maybeRefreshMemoryBridge() | function | Refresh the memory bridge if autoRefresh is enabled and the debounce window h… |
searchBrainCompact() | function | Token-efficient compact search across BRAIN tables. Returns index-level hits… |
timelineBrain() | function | Get chronological context around an anchor entry. Fetches the anchor’s full d… |
fetchBrainEntries() | function | Batch-fetch full details by IDs. Groups IDs by prefix to query the correct ta… |
observeBrain() | function | Save an observation to the BRAIN observations table. Replaces the external cl… |
populateEmbeddings() | function | Backfill embeddings for existing observations that lack them. Iterates throu… |
queryAudit() | function | Query audit entries from SQLite audit_log table. Used by session-grade.ts for… |
storeLearning() | function | Store a new learning. T4769, T5241 |
searchLearnings() | function | Search learnings by criteria. Results sorted by confidence (highest first)… |
learningStats() | function | Get learning statistics. T4769, T5241 |
gradeSession() | function | Grade a session by sessionId using the 5-dimension behavioral rubric. |
readGrades() | function | Read past grade results from .cleo/metrics/GRADES.jsonl |
isValidAdapter() | function | Validate that a loaded module export implements the CLEOProviderAdapter inter… |
loadAdapterFromManifest() | function | Dynamically load and instantiate an adapter from its manifest. Uses the mani… |
discoverAdapterManifests() | function | Scan the packages/adapters/ directory for adapter packages. Each adapter must… |
detectProvider() | function | Detect whether a provider is active in the current environment by checking it… |
AdapterManager | class | Central adapter manager. Singleton per process. Lifecycle: 1. discover() —… |
bridgeSessionToMemory() | function | Bridge session end data to brain.db as an observation. Builds a summary text… |
storeDecision() | function | Store a new decision or update an existing one if a duplicate is found. Dupli… |
recallDecision() | function | Recall a specific decision by ID. T5155 |
searchDecisions() | function | Search decisions by type, confidence, outcome, and/or free-text query. Query… |
listDecisions() | function | List decisions with pagination. T5155 |
updateDecisionOutcome() | function | Update the outcome of a decision after learning from results. T5155 |
storePattern() | function | Store a new pattern. If a similar pattern already exists (same type + matchin… |
searchPatterns() | function | Search patterns by criteria. T4768, T5241 |
patternStats() | function | Get pattern statistics. T4768, T5241 |
extractTaskCompletionMemory() | function | Extract and store memory entries when a task is completed. - Always stores a… |
extractSessionEndMemory() | function | Extract and store memory entries when a session ends. - Stores a process dec… |
resolveTaskDetails() | function | Resolve an array of task IDs to their full Task objects. Tasks that cannot be… |
extractFromTranscript() | function | Extract key observations from a provider session transcript and store them in… |
handleSessionStart() | function | Handle SessionStart - capture initial session context T138: Refresh memory b… |
handleSessionEnd() | function | Handle SessionEnd - capture session summary T138: Refresh memory bridge afte… |
handleToolStart() | function | Handle PreToolUse (maps to task.start in CLEO, canonical: was onToolStart) |
handleToolComplete() | function | Handle PostToolUse (maps to task.complete in CLEO, canonical: was onToolCompl… |
handleError() | function | Handle PostToolUseFailure — capture operation errors to BRAIN. Includes an i… |
handleFileChange() | function | Handle Notification (file-change variant) - capture file changes to BRAIN Ga… |
handleSystemNotification() | function | Handle Notification — capture system notifications as BRAIN observations. On… |
handleWorkPromptSubmit() | function | Handle PromptSubmit — log incoming mutation intents to BRAIN. Only fires for… |
handleWorkResponseComplete() | function | Handle ResponseComplete — capture completed mutations to BRAIN. Only fires f… |
handleSubagentStart() | function | Handle SubagentStart — log subagent spawn as a BRAIN observation. Records th… |
handleSubagentStop() | function | Handle SubagentStop — log subagent completion result as a BRAIN observation… |
handlePreCompact() | function | Handle PreCompact — snapshot current session memory context to BRAIN. Fires… |
handlePostCompact() | function | Handle PostCompact — record compaction completion to BRAIN. Fires immediatel… |
recordAssumption() | function | Record an assumption made during a session. Appends to .cleo/audit/assumption… |
linkMemoryToTask() | function | Link a memory entry to a task. T5156 |
unlinkMemoryFromTask() | function | Remove a link between a memory entry and a task. T5156 |
getTaskLinks() | function | Get all memory entries linked to a specific task. T5156 |
getMemoryLinks() | function | Get all tasks linked to a specific memory entry. T5156 |
bulkLink() | function | Batch create multiple links at once. T5156 |
getLinkedDecisions() | function | Get all decisions linked to a task. Convenience method that fetches full deci… |
getLinkedPatterns() | function | Get all patterns linked to a task. Convenience method that fetches full patte… |
getLinkedLearnings() | function | Get all learnings linked to a task. Convenience method that fetches full lear… |
extractMemoryItems() | function | Extract memory-worthy items from debrief data. Pure function — no side effec… |
persistSessionMemory() | function | Main entry point — called from session.end handler. Extracts memory-worthy c… |
buildSummarizationPrompt() | function | Build a summarization prompt from debrief data. Returns a formatted prompt s… |
ingestStructuredSummary() | function | Ingest a structured session summary directly into brain.db. Stores each fiel… |
getSessionMemoryContext() | function | Retrieve session memory for a given scope. Used by briefing/handoff to enrich… |
depsReady() | function | Check if all dependencies of a task are satisfied. |
initializePipeline() | function | Initialize a new pipeline for a task. Creates a new pipeline record in the d… |
getPipeline() | function | Retrieve a pipeline by task ID. Returns the complete pipeline state includin… |
advanceStage() | function | Advance a pipeline to the next stage. Performs atomic stage transition with… |
getCurrentStage() | function | Get the current stage of a pipeline. Convenience method to quickly check whi… |
listPipelines() | function | List pipelines with optional filtering. |
completePipeline() | function | Complete a pipeline (mark all stages done). Marks the pipeline as completed… |
cancelPipeline() | function | Cancel a pipeline before completion. Marks the pipeline as cancelled (user-i… |
pipelineExists() | function | Check if a pipeline exists for a task. |
getPipelineStatistics() | function | Get pipeline statistics. Returns aggregate counts of pipelines by status and… |
getPipelineStages() | function | Get all stages for a pipeline. |
computeBriefing() | function | Compute the complete session briefing. Aggregates data from all 6+ sources. |
findSessions() | function | Find sessions with minimal field projection. Loads all sessions, applies fil… |
archiveSessions() | function | Archive old/ended sessions. Identifies ended and suspended sessions older tha… |
cleanupSessions() | function | Remove orphaned sessions, auto-end stale active sessions, and clean up stale… |
getContextDrift() | function | Compute context drift score for the current session. Compares session progres… |
getSessionHistory() | function | List session history with focus changes and completed tasks. If sessionId is… |
showSession() | function | Show a specific session. Looks in active sessions first, then session history… |
getSessionStats() | function | Compute session statistics, optionally for a specific session. Throws CleoErr… |
suspendSession() | function | Suspend an active session. Sets status to ‘suspended’ and records the reason… |
switchSession() | function | Switch to a different session. Suspends the current active session and activa… |
SessionView | class | |
selectRuntimeProviderContext() | function | |
detectRuntimeProviderContext() | function | |
resetRuntimeProviderContextCache() | function | |
parseScope() | function | Parse a scope string into a SessionScope. T4463 |
readSessions() | function | Read sessions from accessor or JSON file. T4463 |
saveSessions() | function | Save sessions via accessor or JSON file. T4463 |
startSession() | function | Start a new session. T4463 |
endSession() | function | End a session. T4463 |
sessionStatus() | function | Get current session status. T4463 |
resumeSession() | function | Resume an existing session. T4463 |
listSessions() | function | List sessions with optional filtering. T4463 |
gcSessions() | function | Garbage collect old sessions. Marks orphaned sessions that have been active t… |
getEnforcementMode() | function | Get the current enforcement mode. |
isSessionEnforcementEnabled() | function | Check if session enforcement is enabled. |
getActiveSessionInfo() | function | Get active session info. Returns null if no active session. |
requireActiveSession() | function | Require an active session for write operations. In strict mode, throws if no… |
validateTaskInScope() | function | Validate that a task is within the current session’s scope. Only enforced whe… |
createAcceptanceEnforcement() | function | |
isValidPipelineStage() | function | Check whether a string is a valid pipeline stage name. |
validatePipelineStage() | function | Validate a pipeline stage name and throw a CleoError on failure. |
resolveDefaultPipelineStage() | function | Determine the default pipeline stage for a new task. Rules (in priority orde… |
getPipelineStageOrder() | function | Get the numeric order of a pipeline stage (1-based). |
isPipelineTransitionForward() | function | Check whether transitioning from currentStage to newStage is forward-only… |
validatePipelineTransition() | function | Validate a pipeline stage transition and throw if it would move backward. |
getLifecycleMode() | function | Read lifecycle.mode from config. Falls back to “strict” when unset (matche… |
validateEpicCreation() | function | Validate that a new epic satisfies creation requirements. In strict mode… |
validateChildStageCeiling() | function | Validate that a child task’s pipeline stage does not exceed its epic’s stage… |
findEpicAncestor() | function | Find the nearest epic ancestor for a given task. Walks the ancestor chain (r… |
validateEpicStageAdvancement() | function | Validate that an epic can advance its pipeline stage. An epic is blocked… |
buildDefaultVerification() | function | Build the default verification metadata applied to every new task. Gates are… |
validateTitle() | function | Validate a task title. T4460 |
validateStatus() | function | Validate task status. T4460 |
normalizePriority() | function | Normalize priority to canonical string format. Accepts both string names (“cr… |
validatePriority() | function | Validate task priority. T4460 T4572 |
validateTaskType() | function | Validate task type. T4460 |
validateSize() | function | Validate task size. T4460 |
validateLabels() | function | Validate label format. T4460 |
validatePhaseFormat() | function | Validate phase slug format. T4460 |
validateDepends() | function | Validate dependency IDs exist. T4460 |
validateParent() | function | Validate parent hierarchy constraints. T4460 |
getTaskDepth() | function | Get the depth of a task in the hierarchy. T4460 |
inferTaskType() | function | Infer task type from parent context. T4460 |
getNextPosition() | function | Get the next position for a task within a parent scope. T4460 |
logOperation() | function | Log an operation to the audit log. T4460 |
findRecentDuplicate() | function | Check for recent duplicate task. T4460 |
addTask() | function | Add a new task to the todo file. T4460 |
listPhases() | function | List all phases with status summaries. T4464 |
showPhase() | function | Show the current phase details. T4464 |
setPhase() | function | Set the current project phase. T4464 |
startPhase() | function | Start a phase (pending - active). T4464 |
completePhase() | function | Complete a phase (active - completed). T4464 |
advancePhase() | function | Advance to the next phase. T4464 |
renamePhase() | function | Rename a phase and update all task references. T4464 |
deletePhase() | function | Delete a phase with optional task reassignment. T4464 |
pruneAuditLog() | function | Prune old audit_log rows from tasks.db. 1. If auditRetentionDays is 0 or und… |
generateProjectHash() | function | Canonical project identity hash. SHA-256 of absolute path, first 12 hex chars… |
validateAgainstSchema() | function | Validate data against a JSON Schema object. Throws CleoError on validation fa… |
validateAgainstSchemaFile() | function | Load a JSON Schema file and validate data against it. |
checkSchema() | function | Check if data is valid against a schema without throwing. Returns an array of… |
resolveSchemaPath() | function | Resolve the absolute path to a schema file at runtime. Priority: 1. Global… |
getSchemaVersion() | function | Read the schema version from a resolved schema file. Checks schemaVersion… |
ensureGlobalSchemas() | function | Copy ALL bundled schemas from package schemas/ to ~/.cleo/schemas/. - Create… |
checkGlobalSchemas() | function | Verify that global schemas are installed and not stale. |
checkSchemaStaleness() | function | Compare global schema versions against bundled package versions. |
listInstalledSchemas() | function | List all schemas installed in ~/.cleo/schemas/. |
cleanProjectSchemas() | function | Backup and remove deprecated .cleo/schemas/ directory from a project. Schema… |
readSchemaVersionFromFile() | function | Read the top-level schemaVersion field from a schema file. Delegates to the… |
checkSchemaIntegrity() | function | Check integrity of all active JSON files in a CLEO project. |
detectProjectType() | function | Detect project type from directory contents. Returns a schema-compliant Proje… |
getInjectionTemplateContent() | function | Get the CLEO-INJECTION.md template content from the package templates/ direct… |
ensureInjection() | function | Full injection refresh: strip legacy blocks, inject CAAMP content, install gl… |
buildContributorInjectionBlock() | function | Build a smart, contextual contributor block for AGENTS.md injection. Returns… |
checkInjection() | function | Verify injection health: AGENTS.md exists, has CAAMP markers, markers are bal… |
fileExists() | function | Check if a file exists and is readable. |
stripCLEOBlocks() | function | Strip legacy CLEO:START/CLEO:END blocks from a file. Called before CAAMP inje… |
removeCleoFromRootGitignore() | function | Remove .cleo/ or .cleo entries from the project root .gitignore. |
getPackageRoot() | function | Resolve the package root directory (where schemas/ and templates/ live). scaf… |
getGitignoreContent() | function | Load the gitignore template from the package’s templates/ directory. Falls ba… |
getCleoVersion() | function | Read CLEO version from package.json. |
createDefaultConfig() | function | Create default config.json content. |
ensureCleoStructure() | function | Create .cleo/ directory and all required subdirectories. Idempotent: skips di… |
ensureGitignore() | function | Create or repair .cleo/.gitignore from template. Idempotent: skips if file al… |
ensureConfig() | function | Create default config.json if missing. Idempotent: skips if file already exists. |
ensureProjectInfo() | function | Create or refresh project-info.json. Idempotent: skips if file already exists… |
ensureContributorMcp() | function | No-op. Kept for API compatibility. |
ensureProjectContext() | function | Detect and write project-context.json. Idempotent: skips if file exists and i… |
ensureCleoGitRepo() | function | Initialize isolated .cleo/.git checkpoint repository. Idempotent: skips if .c… |
ensureSqliteDb() | function | Create SQLite database if missing. Idempotent: skips if tasks.db already exists. |
checkCleoStructure() | function | Verify all required .cleo/ subdirectories exist. |
checkGitignore() | function | Verify .cleo/.gitignore exists and matches template. |
checkConfig() | function | Verify config.json exists and is valid JSON. |
checkProjectInfo() | function | Verify project-info.json exists with required fields. |
checkProjectContext() | function | Verify project-context.json exists and is not stale (default: 30 days). |
checkCleoGitRepo() | function | Verify .cleo/.git checkpoint repository exists. |
checkSqliteDb() | function | Verify .cleo/tasks.db exists and is non-empty. |
ensureBrainDb() | function | Create brain.db if missing. Idempotent: skips if brain.db already exists. |
checkBrainDb() | function | Verify .cleo/brain.db exists and is non-empty. |
checkMemoryBridge() | function | Verify .cleo/memory-bridge.md exists. Warning level if missing (not failure)… |
ensureGlobalHome() | function | Ensure the global ~/.cleo/ home directory and its required subdirectories exi… |
ensureGlobalTemplates() | function | Ensure the global CLEO injection template is installed. Delegates to injectio… |
ensureGlobalScaffold() | function | Perform a complete global scaffold operation: ensure home and templates are a… |
ensureCleoOsHub() | function | Ensure the CleoOS Hub subdirectories exist under the global CLEO home, and se… |
checkGlobalHome() | function | Check that the global ~/.cleo/ home and its required subdirectories exist. Re… |
checkGlobalTemplates() | function | Check that the global injection template is present and current. Read-only: n… |
checkLogDir() | function | Check that the project log directory exists. Read-only: no side effects. |
classifyProject() | function | Classify a project directory as greenfield or brownfield. Read-only — never… |
ensureGitHooks() | function | Install or update managed git hooks from templates/git-hooks/ into .git/hooks… |
checkGitHooks() | function | Verify managed hooks are installed and current. Compares installed hooks in… |
detectLegacyAgentOutputs() | function | Detect legacy agent-output directories in a project. Read-only check — never… |
migrateAgentOutputs() | function | Run the full agent-outputs migration. Copies files from all legacy locations… |
migrateJsonToSqlite() | function | Migrate projects from legacy JSON registry to nexus.db. For each project ent… |
getNexusHome() | function | Get path to the NEXUS home directory (cache, etc.). |
getNexusCacheDir() | function | Get path to the NEXUS cache directory. |
getRegistryPath() | function | Get path to the legacy projects registry JSON file. |
readRegistry() | function | Read all projects from nexus.db and return as a NexusRegistryFile. Compatibil… |
readRegistryRequired() | function | Read the global registry, throwing if not initialized. |
nexusInit() | function | Initialize the NEXUS directory structure and nexus.db. Idempotent — safe to… |
nexusRegister() | function | Register a project in the global registry (nexus.db). |
nexusUnregister() | function | Unregister a project from the global registry. |
nexusList() | function | List all registered projects. |
nexusGetProject() | function | Get a project by name or hash. Returns null if not found. |
nexusProjectExists() | function | Check if a project exists in the registry. |
nexusSync() | function | Sync project metadata (task count, labels) for a registered project. |
nexusSyncAll() | function | Sync all registered projects. |
nexusSetPermission() | function | Update a project’s permission level in the registry. Used by permissions.ts t… |
nexusReconcile() | function | Reconcile the current project’s identity with the global nexus registry. 4-s… |
analyzeStack() | function | |
analyzeArchitecture() | function | |
analyzeStructure() | function | |
analyzeConventions() | function | |
analyzeTesting() | function | |
analyzeIntegrations() | function | |
analyzeConcerns() | function | |
storeMapToBrain() | function | |
mapCodebase() | function | |
initAgentDefinition() | function | Install cleo-subagent agent definition to ~/.agents/agents/. T4685 |
initMcpServer() | function | No-op. Kept for API compatibility. T4706 |
initCoreSkills() | function | Install CLEO core skills to the canonical skills directory via CAAMP. T4707… |
initNexusRegistration() | function | Register/reconcile project with NEXUS. Uses nexusReconcile for idempotent han… |
installGitHubTemplates() | function | Install GitHub issue and PR templates to .github/ if a git repo exists but .g… |
updateDocs() | function | Run update-docs only: refresh all injections without reinitializing. Re-injec… |
initProject() | function | Run full project initialization. Creates the .cleo/ directory structure, ins… |
isAutoInitEnabled() | function | Check if auto-init is enabled via environment variable. T4789 |
ensureInitialized() | function | Check if a project is initialized and auto-init if configured. Returns initi… |
getVersion() | function | Get the current CLEO/project version. Checks VERSION file, then package.json… |
bootstrapGlobalCleo() | function | Bootstrap the global CLEO directory structure and install templates. Creates… |
installMcpToProviders() | function | No-op. Kept for API compatibility. |
installSkillsGlobally() | function | Install CLEO core skills globally via CAAMP. |
bootstrapCaamp() | function | |
exportTasks() | function | Export tasks to a portable format. Returns the formatted content and metadata. |
importTasks() | function | Import tasks from an export file. |
recordAgentExecution() | function | Record an agent execution event to brain_decisions. Each event becomes a… |
_recordAgentExecutionWithAccessor() | function | Internal implementation that accepts a pre-constructed accessor. Separated fo… |
getAgentPerformanceHistory() | function | Retrieve agent execution performance history from brain_decisions. Queries a… |
_getAgentPerformanceHistoryWithAccessor() | function | Internal implementation with injected accessor for testability. |
recordFailurePattern() | function | Record a task failure pattern to brain_patterns. When a task fails, the (age… |
_recordFailurePatternWithAccessor() | function | Internal implementation with injected accessor. |
storeHealingStrategy() | function | Store a healing strategy observation to brain_observations. When a failure p… |
_storeHealingStrategyWithAccessor() | function | Internal implementation with injected accessor. |
getSelfHealingSuggestions() | function | Get self-healing suggestions for a given agent type and task type. Queries b… |
_getSelfHealingSuggestionsWithAccessor() | function | Internal implementation with injected accessor. |
processAgentLifecycleEvent() | function | Full agent lifecycle event processor. Convenience function that: 1. Records… |
getAgentCapacity() | function | Get task-count-based remaining capacity for an agent. Remaining capacity =… |
getAgentsByCapacity() | function | List all non-terminal agents sorted by remaining task capacity (descending)… |
getAgentSpecializations() | function | Get the specialization/skills list for an agent. Specializations are stored… |
updateAgentSpecializations() | function | Update the specializations list stored in an agent’s metadata. Merges the ne… |
recordAgentPerformance() | function | Record agent performance metrics to the BRAIN execution history. Translates… |
updateCapacity() | function | Update the capacity value for an agent instance. |
getAvailableCapacity() | function | Get the total available capacity across all active agents. Only considers ag… |
findLeastLoadedAgent() | function | Find the agent with the most available capacity. |
isOverloaded() | function | Check if the system is overloaded (total capacity below threshold). |
getCapacitySummary() | function | Get a capacity summary across the entire agent pool. |
recordHeartbeat() | function | Record a heartbeat for an agent instance. Updates last_heartbeat to the cu… |
checkAgentHealth() | function | Check the health of a specific agent instance by ID. Queries the agent’s cur… |
detectStaleAgents() | function | Find all non-terminal agents whose last heartbeat is older than thresholdMs… |
detectCrashedAgents() | function | Find agents with status active whose heartbeat has been silent for longer t… |
createRetryPolicy() | function | Create a retry policy by merging overrides with the default policy. |
calculateDelay() | function | Calculate the delay for a given retry attempt using exponential backoff. |
shouldRetry() | function | Determine whether an error should be retried based on its classification and… |
withRetry() | function | Wrap an async function with retry logic using configurable exponential backoff. |
recoverCrashedAgents() | function | Attempt to recover crashed agents. Finds all agents with status ‘crashed’ an… |
calculateTaskRisk() | function | Calculate the risk score for a task based on multiple contributing factors… |
predictValidationOutcome() | function | Predict the likelihood of a task passing a lifecycle validation gate. Combin… |
gatherLearningContext() | function | Gather applicable learnings for a task from brain_learnings. |
suggestGateFocus() | function | Suggest which verification gates to focus on for a task, ordered by risk. Us… |
scoreVerificationConfidence() | function | Compute a confidence score for a completed verification round and persist it… |
storePrediction() | function | Store a validation prediction as a brain observation for future learning. Sa… |
predictAndStore() | function | Compute a prediction for a task and immediately persist it to brain. Conveni… |
detectCircularDeps() | function | Detect circular dependencies using DFS. Returns the cycle path if found, empt… |
wouldCreateCycle() | function | Check if adding a dependency would create a cycle. |
getBlockedTasks() | function | Get tasks that are blocked (have unmet dependencies). |
getReadyTasks() | function | Get tasks that are ready (all dependencies met). |
getDependents() | function | Get tasks that depend on a given task. |
getDependentIds() | function | Get dependent IDs. |
getUnresolvedDeps() | function | Get unresolved dependencies for a task (deps that are not done/cancelled). |
validateDependencyRefs() | function | Validate dependencies for missing references. |
validateDependencies() | function | Full dependency graph validation. |
topologicalSort() | function | Topological sort of tasks by dependencies. Returns sorted task IDs or null if… |
getTransitiveBlockers() | function | Walk upstream recursively through a task’s dependency chain. Returns all non-… |
getLeafBlockers() | function | From the transitive blockers, return only “leaf” blockers — those whose own d… |
computeDependencyWaves() | function | Compute dependency waves for parallel execution. Tasks in the same wave can r… |
getNextTask() | function | Get the next task to work on (highest priority ready task). |
getCriticalPath() | function | Calculate the critical path (longest dependency chain). Returns task IDs alon… |
getTaskOrder() | function | Get task ordering by dependency + priority. |
getParallelTasks() | function | Get parallelizable tasks (tasks with no unmet dependencies). |
analyzeTaskImpact() | function | Analyze the full downstream impact of a task. Computes direct and transitive… |
analyzeChangeImpact() | function | Analyze the downstream effects of a specific change to a task. Predicts what… |
calculateBlastRadius() | function | Calculate the blast radius for a task. Quantifies how many tasks, epics, and… |
predictImpact() | function | Predict the downstream impact of a free-text change description. Uses fuzzy… |
extractPatternsFromHistory() | function | Analyze brain_observations and task history to find recurring patterns. Dete… |
matchPatterns() | function | Find which known patterns from brain_patterns apply to a given task. Compare… |
storeDetectedPattern() | function | Save a detected pattern to the brain_patterns table. Uses the existing brain… |
updatePatternStats() | function | Update the frequency and success_rate of an existing pattern after an outcome… |
validateSyntax() | function | Validate a query string matches expected syntax. |
parseQuery() | function | Parse a query string into its components. |
getCurrentProject() | function | Get the current project name from context. Reads .cleo/project-info.json or f… |
resolveProjectPath() | function | Resolve a project name to its filesystem path. Handles special cases: ”.” (cu… |
resolveTask() | function | Resolve a query to task data. For wildcard queries, returns an array of match… |
getProjectFromQuery() | function | Extract the project name from a query without full resolution. Useful for per… |
extractKeywords() | function | Extract meaningful keywords from text (filters stop words and short tokens). |
discoverRelated() | function | Discover tasks related to a given task query across projects. Returns a stru… |
searchAcrossProjects() | function | Search for tasks across all registered projects. Returns a structured result… |
permissionLevel() | function | Convert a permission string to its numeric level. Returns 0 for invalid/unkno… |
getPermission() | function | Get the permission level for a registered project. Returns ‘read’ as default… |
checkPermission() | function | Check if a project has sufficient permissions (non-throwing). Uses hierarchic… |
requirePermission() | function | Require a permission level or throw CleoError. Used as a guard at the start o… |
checkPermissionDetail() | function | Full permission check returning a structured result. |
setPermission() | function | Set the permission level for a project. Validates the permission value and up… |
canRead() | function | Convenience: check read access. |
canWrite() | function | Convenience: check write access. |
canExecute() | function | Convenience: check execute access. |
matchesPattern() | function | Match a file path against a glob-like pattern. Supports: ’*’ (single segment… |
getSharingStatus() | function | Get the sharing status: which .cleo/ files are tracked vs ignored, plus git s… |
syncGitignore() | function | Sync the project .gitignore to match the sharing config. Adds/updates a manag… |
currentTask() | function | Show current task work state. T4462 T4750 |
startTask() | function | Start working on a specific task. T4462 T4750 |
stopTask() | function | Stop working on the current task. T4462 T4750 |
getWorkHistory() | function | Get task work history from session notes. T4462 T4750 |
completeTask() | function | Complete a task by ID. Handles dependency checking and optional auto-completi… |
validateTitleDescription() | function | Validate that title and description are both present and different. This is a… |
validateTimestamps() | function | Validate that timestamps are not in the future |
validateIdUniqueness() | function | Validate ID uniqueness across all tasks (todo + archive) |
validateNoDuplicateDescription() | function | Validate no duplicate task descriptions |
validateHierarchy() | function | Validate hierarchy constraints. Accepts optional limits to override defaults… |
validateStatusTransition() | function | Validate status transition |
validateNewTask() | function | Run all validation rules on a task being created |
hasErrors() | function | Check if violations contain any errors (not just warnings) |
updateTask() | function | Update a task’s fields. T4461 |
parseDirective() | function | Parse a Conduit message into a structured directive. Extracts directive verb… |
routeDirective() | function | Route a Conduit directive to the correct project’s CLEO instance. Resolves w… |
workspaceStatus() | function | Get aggregated task status across all registered projects. Returns per-proje… |
workspaceAgents() | function | Get all agents registered across all projects. Queries each project’s agent_… |
invalidateDepsCache() | function | Invalidate the cached TaskFile (call after writes). T4659 T4654 |
buildGraph() | function | Build an adjacency graph from task dependencies. T4464 |
getDepsOverview() | function | Get dependency overview for all tasks. T4464 |
getTaskDeps() | function | Get dependencies for a specific task. T4464 |
topologicalSort() | function | Topological sort of tasks respecting dependencies. Returns tasks in execution… |
getExecutionWaves() | function | Group tasks into parallelizable execution waves. T4464 |
getCriticalPath() | function | Find the critical path (longest dependency chain) from a task. T4464 |
getImpact() | function | Find all tasks affected by changes to a given task. T4464 |
detectCycles() | function | Detect circular dependencies in the task graph. T4464 |
getTaskTree() | function | Build task hierarchy tree. T4464 |
addRelation() | function | Manage task relationships (relates/blocks). T4464 |
buildDependencyGraph() | function | Build a dependency graph for a set of tasks. Returns a Map from task ID to t… |
detectCircularDependencies() | function | Detect circular dependencies using DFS traversal. |
findMissingDependencies() | function | Find missing dependencies — deps that reference tasks outside the epic that a… |
analyzeDependencies() | function | Perform full dependency analysis for an epic’s children. Combines dependency… |
countManifestEntries() | function | Count manifest entries from pipeline_manifest (ADR-027). |
estimateContext() | function | Estimate context usage for orchestration. |
OrchestrationHierarchyImpl | class | Concrete implementation of OrchestrationHierarchyAPI. |
computeWaves() | function | Compute execution waves using topological sort. |
getEnrichedWaves() | function | Get enriched wave data for an epic. |
countByStatus() | function | Count tasks by status. |
computeEpicStatus() | function | Compute epic-specific status. |
computeOverallStatus() | function | Compute overall orchestration status across all tasks. |
computeProgress() | function | Compute progress metrics for all tasks. |
computeStartupSummary() | function | Compute startup summary for an epic. |
startOrchestration() | function | Start an orchestrator session for an epic. T4466 |
analyzeEpic() | function | Analyze an epic’s dependency structure. T4466 |
getReadyTasks() | function | Get parallel-safe ready tasks for an epic. T4466 |
getNextTask() | function | Get the next task to work on for an epic. T4466 |
prepareSpawn() | function | Prepare a spawn context for a subagent. T4466 |
validateSpawnOutput() | function | Validate a subagent’s output. T4466 |
getOrchestratorContext() | function | Get orchestrator context summary. T4466 |
autoDispatch() | function | Auto-dispatch: determine the protocol for a task based on metadata. T4466 |
resolveTokens() | function | Resolve tokens in a prompt string. T4466 |
getLinksByProvider() | function | Find all links for a given provider. |
getLinkByExternalId() | function | Find a link by provider + external ID. |
getLinksByTaskId() | function | Find all links for a given CLEO task. |
createLink() | function | Create a new external task link. |
touchLink() | function | Update the lastSyncAt and optionally the title/metadata for an existing link. |
removeLinksByProvider() | function | Remove all links for a provider (used during provider deregistration). |
reconcile() | function | Reconcile external task state with CLEO’s authoritative task store. |
getArtifactHandler() | function | Get handler for an artifact type. T4552 |
hasArtifactHandler() | function | Check if a handler is registered for an artifact type. T4552 |
buildArtifact() | function | Build an artifact using the appropriate handler. T4552 |
validateArtifact() | function | Validate an artifact using the appropriate handler. T4552 |
publishArtifact() | function | Publish an artifact using the appropriate handler. T4552 |
getSupportedArtifactTypes() | function | Get all supported artifact types. T4552 |
parseChangelogBlocks() | function | Parse [custom-log]…[/custom-log] blocks from a CHANGELOG section. Returns t… |
writeChangelogSection() | function | Write or update a CHANGELOG.md section for a specific version. - If ## [VERS… |
loadReleaseConfig() | function | Load release configuration with defaults. |
validateReleaseConfig() | function | Validate release configuration. |
getArtifactType() | function | Get artifact type from config. |
getReleaseGates() | function | Get release gates from config. |
getChangelogConfig() | function | Get changelog configuration. |
getDefaultGitFlowConfig() | function | Return the default GitFlow branch configuration. |
getGitFlowConfig() | function | Merge caller-supplied GitFlow config with defaults. |
getDefaultChannelConfig() | function | Return the default channel configuration. |
getChannelConfig() | function | Merge caller-supplied channel config with defaults. |
getPushMode() | function | Return the configured push mode, defaulting to ‘auto’. |
getDefaultChannelConfig() | function | Return the default branch-to-channel mapping. |
resolveChannelFromBranch() | function | Resolve the release channel for a given Git branch name. Resolution order: 1… |
channelToDistTag() | function | Map a release channel to its npm dist-tag string. Kept as an explicit functi… |
validateVersionChannel() | function | Validate that a version string satisfies the pre-release conventions for the… |
describeChannel() | function | Return a human-readable description of the given release channel. |
getPlatformPath() | function | Get the output path for a CI platform. |
detectCIPlatform() | function | Detect the CI platform from the project. |
generateCIConfig() | function | Generate CI config for a platform. |
writeCIConfig() | function | Write CI config to the appropriate path. |
validateCIConfig() | function | Validate an existing CI config. |
isGhCliAvailable() | function | Check if the gh CLI is available by attempting to run gh --version. Does… |
extractRepoOwnerAndName() | function | Parse a GitHub remote URL (HTTPS or SSH) into owner and repo components. Retu… |
detectBranchProtection() | function | Detect whether a branch has protection rules enabled. Strategy 1 (preferred)… |
buildPRBody() | function | Build the markdown body for a GitHub pull request. |
formatManualPRInstructions() | function | Format human-readable instructions for creating a PR manually. |
createPullRequest() | function | Create a GitHub pull request using the gh CLI, or return manual instruction… |
checkEpicCompleteness() | function | Check epic completeness for a set of release task IDs. Verifies all children… |
checkDoubleListing() | function | Check if any tasks are listed in multiple releases. |
validateVersionFormat() | function | Validate version format (semver X.Y.Z or CalVer YYYY.M.patch, with optional p… |
isCalVer() | function | Check if a version string is CalVer format. |
calculateNewVersion() | function | Calculate new version from current + bump type. |
getVersionBumpConfig() | function | Get version bump configuration, mapping config field names to VersionBumpTarget. |
isVersionBumpConfigured() | function | Check if version bump is configured. |
bumpVersionFromConfig() | function | Bump version in all configured files. |
prepareRelease() | function | Prepare a release (create a release manifest entry). T4788 |
generateReleaseChangelog() | function | Generate changelog for a release. T4788 |
listManifestReleases() | function | List all releases. T4788 |
showManifestRelease() | function | Show release details. T4788 |
commitRelease() | function | Mark release as committed (metadata only). T4788 |
tagRelease() | function | Mark release as tagged (metadata only). T4788 |
runReleaseGates() | function | Run release validation gates. T4788 T5586 |
cancelRelease() | function | Cancel and remove a release in draft or prepared state. Only releases that ha… |
rollbackRelease() | function | Rollback a release. T4788 |
pushRelease() | function | Push release to remote via git. Respects config.release.push policy: - remot… |
markReleasePushed() | function | Update release status after push, with optional provenance fields. T4788 T5580 |
migrateReleasesJsonToSqlite() | function | One-time migration: read .cleo/releases.json and insert each release into the… |
serializeSession() | function | Serialize a session into a complete snapshot. Captures the full session stat… |
restoreSession() | function | Restore a session from a snapshot. Hydrates a session from a previously seri… |
archiveSticky() | function | Archive a sticky note. |
convertStickyToTask() | function | Convert a sticky note to a task. |
convertStickyToMemory() | function | Convert a sticky note to a memory observation. |
convertStickyToTaskNote() | function | Convert a sticky note to a task note. |
convertStickyToSessionNote() | function | Convert a sticky note to a session note. |
generateStickyId() | function | Generate the next sticky note ID. Finds the highest existing SN-XXX ID and i… |
addSticky() | function | Create a new sticky note. |
listStickies() | function | List sticky notes with optional filters. |
purgeSticky() | function | Purge (permanently delete) a sticky note. |
getSticky() | function | Get a sticky note by ID. |
archiveTasks() | function | Archive completed (and optionally cancelled) tasks. Moves them from active ta… |
deleteTask() | function | Delete a task (soft delete - moves to archive). T4461 |
Cleo | class | |
calculateExportChecksum() | function | Calculate SHA-256 checksum for export integrity (truncated to 16 hex chars). |
verifyExportChecksum() | function | Verify export package checksum. |
buildIdMap() | function | Build ID map from tasks. |
buildRelationshipGraph() | function | Build relationship graph from tasks. |
buildExportPackage() | function | Build a complete export package. |
exportSingle() | function | Export a single task. |
exportSubtree() | function | Export a subtree (task + all descendants). |
exportTasksPackage() | function | Export tasks to a portable cross-project package. |
getCostHint() | function | Determine cost hint for an operation based on domain and operation name. |
groupOperationsByDomain() | function | Group operations by domain into a compact format. |
buildVerboseOperations() | function | Build verbose operation entries with cost hints. |
computeHelp() | function | Compute the help result for the admin.help operation. Accepts the full OPERA… |
getNextAvailableId() | function | Get the next available task ID number from existing tasks. |
generateRemapTable() | function | Generate a remap table for importing tasks. Maps source task IDs to new seque… |
validateRemapTable() | function | Validate that a remap table is complete and consistent. |
remapTaskId() | function | Remap a single task ID, returning original if not in table. |
remapTaskReferences() | function | Remap all ID references in a task. |
detectDuplicateTitles() | function | Detect duplicate titles between import and target. |
resolveDuplicateTitle() | function | Resolve duplicate title by appending suffix. |
importFromPackage() | function | Import tasks from an in-memory ExportPackage with ID remapping. Core logic ex… |
importTasksPackage() | function | Import tasks from a cross-project export package file with ID remapping. Thin… |
findAdrs() | function | |
listAdrs() | function | List ADRs from .cleo/adrs/ directory with optional status filter |
showAdr() | function | Retrieve a single ADR by ID (e.g., ‘ADR-007’) |
validateAllAdrs() | function | Validate all ADRs in .cleo/adrs/ against the schema |
providerList() | function | List all registered providers. T4332 |
providerGet() | function | Get a single provider by ID or alias. T4332 |
providerDetect() | function | Detect all providers installed on the system. T4332 |
providerInstalled() | function | Get providers that are installed on the system. T4332 |
providerCount() | function | Get count of registered providers. T4332 |
registryVersion() | function | Get CAAMP registry version. T4332 |
injectionCheck() | function | Check injection status for a single file. T4332 |
injectionCheckAll() | function | Check injection status across all providers. T4332 |
injectionUpdate() | function | Inject or update content in a single file. T4332 |
injectionUpdateAll() | function | Inject content to all providers’ instruction files. T4332 |
batchInstallWithRollback() | function | Install multiple skills atomically with rollback on failure. T4705 T4663 |
checkProviderCapability() | function | Check if provider supports a specific capability |
checkProviderCapabilities() | function | Check multiple capabilities at once |
detectLanguage() | function | Detect tree-sitter language from a file path. |
grammarPackage() | function | Get the npm grammar package name for a language. |
isTreeSitterAvailable() | function | Check if tree-sitter CLI is available and executable. Cached after first call. |
parseFile() | function | Parse a single file and extract code symbols. |
batchParse() | function | Batch-parse multiple files, grouping by language for efficiency. Files with… |
smartOutline() | function | Generate a smart outline for a source file. Returns a tree of symbols with s… |
smartSearch() | function | Search for symbols across a codebase. Walks the directory tree, batch-parses… |
smartUnfold() | function | Extract a symbol’s complete source from a file. Finds the symbol by name (su… |
getComplianceJsonlPath() | function | Resolve COMPLIANCE.jsonl path for a project root. |
readComplianceJsonl() | function | Read COMPLIANCE.jsonl entries. Invalid JSON lines are skipped to preserve app… |
appendComplianceJsonl() | function | Append one entry to COMPLIANCE.jsonl, creating directories as needed. |
getComplianceSummary() | function | Get compliance summary. |
listComplianceViolations() | function | List compliance violations. |
getComplianceTrend() | function | Get compliance trend. |
auditEpicCompliance() | function | Audit epic compliance. |
syncComplianceMetrics() | function | Sync compliance metrics to a summary file. |
getSkillReliability() | function | Get skill reliability stats. |
getValueMetrics() | function | Get value metrics (T2833). |
ConduitClient | class | ConduitClient wraps a Transport, adding high-level messaging semantics. |
HttpTransport | class | HTTP transport with automatic primary/fallback failover. |
LocalTransport | class | In-process SQLite transport for fully offline agent messaging. |
SseTransport | class | SseTransport — real-time SSE with HTTP polling fallback. |
resolveTransport() | function | Resolve the best available transport for a credential. Cloud-backed agents (… |
createConduit() | function | Create a Conduit instance from the agent registry. |
getContextStatus() | function | Get context status. |
checkContextThreshold() | function | Check context threshold (returns exit code info). |
listContextSessions() | function | List all context state files. |
validatePayload() | function | Validate a hook payload against its event-specific Zod schema. Falls back to… |
injectTasks() | function | Inject tasks for external consumption. |
collectDiagnostics() | function | Collect system diagnostics for bug reports. |
formatDiagnosticsTable() | function | Format diagnostics as markdown table. |
parseIssueTemplates() | function | Parse all issue templates from available sources. Priority: 1. Packaged tem… |
getTemplateConfig() | function | Get template configuration - tries live parse, cache, then fallback. |
getTemplateForSubcommand() | function | Get the template for a specific subcommand (bug, feature, etc.). |
cacheTemplates() | function | Cache parsed templates to .cleo/issue-templates.json. |
validateLabelsExist() | function | Validate that labels referenced in issue templates are consistent. Collects… |
buildIssueBody() | function | Build structured issue body with template sections. |
checkGhCli() | function | Check that gh CLI is installed and authenticated. |
addIssue() | function | Add a GitHub issue for a given type (bug, feature, help). Returns structured… |
withRetry() | function | Execute an async function with automatic retry and exponential backoff. |
computeDelay() | function | Compute the wait time before the next attempt. |
applyTemporalDecay() | function | Apply temporal decay to brain_learnings confidence values. Entries older tha… |
consolidateMemories() | function | Consolidate old observations by keyword similarity. Groups observations olde… |
migrateBrainData() | function | Migrate BRAIN memory data from JSONL files to brain.db. Reads: - .cleo/memor… |
addResearch() | function | Add a research entry. |
showResearch() | function | Show a specific research entry. |
listResearch() | function | List research entries with optional filtering. |
pendingResearch() | function | List pending research entries. |
linkResearch() | function | Link a research entry to a task. |
updateResearch() | function | Update research findings. |
statsResearch() | function | Get research statistics. |
linksResearch() | function | Get research entries linked to a specific task. |
archiveResearch() | function | Archive old research entries by status. Moves ‘complete’ entries to an archiv… |
readManifest() | function | Read manifest entries from the legacy agent-outputs flat-file (deprecated per ADR-027). |
appendManifest() | function | Append a manifest entry. |
queryManifest() | function | Query manifest entries with filtering. |
readExtendedManifest() | function | Read all manifest entries as extended entries. |
filterManifestEntries() | function | Filter manifest entries by criteria. |
showManifestEntry() | function | Show a manifest entry by ID with optional file content. |
searchManifest() | function | Search manifest entries by text with relevance scoring. |
pendingManifestEntries() | function | Get pending manifest entries (partial, blocked, or needing followup). |
manifestStats() | function | Get manifest-based research statistics. |
linkManifestEntry() | function | Link a manifest entry to a task (adds taskId to linked_tasks array). |
appendExtendedManifest() | function | Append an extended manifest entry. Validates required fields before appending. |
archiveManifestEntries() | function | Archive manifest entries older than a date. |
findContradictions() | function | Find manifest entries with overlapping topics but conflicting key_findings. |
findSuperseded() | function | Identify research entries replaced by newer work on same topic. |
readProtocolInjection() | function | Read protocol injection content for a given protocol type. |
compactManifest() | function | Compact the legacy agent-outputs flat-file by removing duplicate/stale entries. |
validateManifestEntries() | function | Validate research entries for a task. |
ensureMetricsDir() | function | Ensure metrics directory exists, returning its path. |
getCompliancePath() | function | Get compliance log path. |
getViolationsPath() | function | Get violations log path. |
getSessionsMetricsPath() | function | Get sessions metrics log path. |
isoTimestamp() | function | Generate ISO 8601 UTC timestamp. |
isoDate() | function | Generate ISO 8601 date only. |
readJsonlFile() | function | Read a JSONL file into an array of parsed objects. |
getComplianceSummaryBase() | function | Get compliance summary from log file. |
isOtelEnabled() | function | Check if OTel telemetry is enabled. |
getOtelSetupCommands() | function | Get environment variable commands for OTel capture setup. |
parseTokenMetrics() | function | Parse OTel token metrics from collected data. |
getSessionTokens() | function | Get aggregated token counts from OTel data. |
recordSessionStart() | function | Record token counts at session start. |
recordSessionEnd() | function | Record token counts at session end. |
compareSessions() | function | Compare token usage between two sessions. |
getTokenStats() | function | Get statistics about token usage across sessions. |
logABEvent() | function | Log an A/B test event. |
startABTest() | function | Start an A/B test session. |
endABTest() | function | End an A/B test session with summary. |
getABTestResults() | function | Get results for a specific test variant. |
listABTests() | function | List all A/B tests. |
compareABTest() | function | Compare two variants of the same test. |
getABTestStats() | function | Get aggregate statistics of all A/B tests. |
syncMetricsToGlobal() | function | Sync project metrics to global aggregation file. |
getProjectComplianceSummary() | function | Get compliance summary for the current project. |
getGlobalComplianceSummary() | function | Get compliance summary across all projects. |
getComplianceTrend() | function | Get compliance trend over time. |
getSkillReliability() | function | Get reliability stats per skill/agent. |
logSessionMetrics() | function | Log session metrics to SESSIONS.jsonl. |
getSessionMetricsSummary() | function | Get summary of session metrics. |
isValidEnumValue() | function | Validate that a value is a member of a given enum. |
estimateTokens() | function | Estimate token count from text. ~4 characters per token. |
estimateTokensFromFile() | function | Estimate token count from a file. |
logTokenEvent() | function | Log a token usage event to the JSONL file. |
trackFileRead() | function | Track a file read with token estimate. |
trackManifestQuery() | function | Track a manifest query (partial read). |
trackSkillInjection() | function | Track skill injection with tokens. |
trackPromptBuild() | function | Track final prompt size. |
trackSpawnOutput() | function | Track subagent output tokens. |
trackSpawnComplete() | function | Track complete spawn cycle (prompt + output). |
startTokenSession() | function | Start tracking tokens for a session. |
endTokenSession() | function | End token tracking session with summary. |
getTokenSummary() | function | Get token usage summary for a time period. |
compareManifestVsFull() | function | Compare manifest vs full file token usage strategies. |
getTrackingStatus() | function | Get tracking status. |
computeChecksum() | function | Compute SHA-256 checksum of a file. |
verifyBackup() | function | Verify that a backup file matches the source file and is a valid SQLite datab… |
compareChecksums() | function | Quick checksum comparison without SQLite verification. Use when you only need… |
MigrationLogger | class | Structured logger for migration operations |
createMigrationLogger() | function | Create a migration logger for the given cleo directory. Convenience function… |
readMigrationLog() | function | Read and parse a migration log file. |
logFileExists() | function | Check if a log file exists and is readable. |
getLatestMigrationLog() | function | Get the most recent migration log file for a cleo directory. |
checkStorageMigration() | function | Check whether legacy JSON data needs to be migrated to SQLite. Returns a dia… |
createMigrationState() | function | Create initial migration state at the start of migration. Captures source fi… |
updateMigrationState() | function | Update migration state with partial updates. Merges updates with existing st… |
updateMigrationPhase() | function | Update just the migration phase. Convenience wrapper for common phase transit… |
updateMigrationProgress() | function | Update progress counters during import. |
addMigrationError() | function | Add an error to the migration state. |
addMigrationWarning() | function | Add a warning to the migration state. |
loadMigrationState() | function | Load existing migration state. |
isMigrationInProgress() | function | Check if a migration is in progress. |
canResumeMigration() | function | Check if migration can be resumed. |
completeMigration() | function | Mark migration as complete. |
failMigration() | function | Mark migration as failed with error details. |
clearMigrationState() | function | Clear migration state file. Safe to call even if state doesn’t exist. |
getMigrationSummary() | function | Get a summary of migration state for display. |
verifySourceIntegrity() | function | Verify source files haven’t changed since migration started. Compares curren… |
validateSourceFiles() | function | Validate all JSON source files before migration. This function MUST be calle… |
formatValidationResult() | function | Format validation result for human-readable output. |
checkTaskCountMismatch() | function | Check for task count mismatch between existing database and JSON. This helps… |
detectVersion() | function | Detect schema version from a data file. T4468 |
compareSemver() | function | Compare two version strings (X.Y.Z format, works for both semver and CalVer)… |
getMigrationStatus() | function | Get migration status for all data files. T4468 |
runMigration() | function | Run migrations on a data file. T4468 |
runAllMigrations() | function | Run all pending migrations. T4468 |
invalidateGraphCache() | function | Invalidate the in-memory graph cache. |
buildGlobalGraph() | function | Build the global dependency graph from all registered projects. Uses checksum… |
nexusDeps() | function | Show dependencies for a task across projects. Supports forward (what this dep… |
resolveCrossDeps() | function | Resolve an array of dependencies (local or cross-project). |
criticalPath() | function | Calculate the critical path across project boundaries. Returns the longest de… |
blockingAnalysis() | function | Analyze the blocking impact of a task across all projects. Uses BFS to find a… |
orphanDetection() | function | Detect orphaned cross-project dependencies. Finds tasks with dependency refer… |
previewTransfer() | function | Preview a transfer without writing any data. Validates projects, permissions,… |
executeTransfer() | function | Execute a cross-project task transfer. Pipeline: 1. Validate source/target… |
compareLevels() | function | Compare two pino levels numerically. Returns negative if a b, 0 if equal, po… |
matchesFilter() | function | Check if a single entry matches the filter criteria. All specified fields mus… |
filterEntries() | function | Filter an array of parsed log entries against criteria. Returns entries match… |
paginate() | function | Apply pagination (limit/offset) to a result set. |
isValidLevel() | function | Validate that a string is a valid PinoLevel. |
parseLogLine() | function | Parse a single JSONL line into a PinoLogEntry. Returns null for empty lines,… |
parseLogLines() | function | Parse multiple JSONL lines into PinoLogEntry array. Skips malformed lines. |
getProjectLogDir() | function | Get the project log directory path. Uses getLogDir() from logger if available… |
getGlobalLogDir() | function | Get the global log directory path (~/.cleo/logs/). |
discoverLogFiles() | function | Discover all log files in the specified scope. Returns file info sorted by da… |
readLogFileLines() | function | Read all lines from a log file synchronously. Returns raw JSON strings (one p… |
streamLogFileLines() | function | Create an async iterable over lines of a log file. Suitable for large files -… |
queryLogs() | function | High-level query: discover files, parse, filter, paginate. Convenience wrappe… |
streamLogs() | function | Stream-based query for large log datasets. Yields matching entries one at a t… |
getLogSummary() | function | Get a summary of log activity (counts by level, date range, subsystems). Read… |
getOtelStatus() | function | Get token tracking status. |
getOtelSummary() | function | Get combined token usage summary. |
getOtelSessions() | function | Get session-level token data. |
getOtelSpawns() | function | Get spawn-level token data. |
getRealTokenUsage() | function | Get real token usage from Claude Code API. |
clearOtelData() | function | Clear token tracking data with backup. |
listPhases() | function | List all phases with status summaries. T5326 |
showPhase() | function | Show phase details by slug or current phase. T5326 |
getCurrentBranch() | function | Get the current branch name in .cleo/.git. T4884 |
addRemote() | function | Add a git remote to .cleo/.git. T4884 |
removeRemote() | function | Remove a git remote from .cleo/.git. T4884 |
listRemotes() | function | List configured remotes in .cleo/.git. T4884 |
push() | function | Push .cleo/.git to a remote. T4884 |
pull() | function | Pull from a remote into .cleo/.git. Uses rebase strategy to maintain clean hi… |
getSyncStatus() | function | Get the sync status between local .cleo/.git and remote. T4884 |
getRoadmap() | function | Get roadmap from pending epics and CHANGELOG history. |
getOperationMode() | function | Lookup the execution mode for a specific operation |
canRunNatively() | function | Check if an operation can run natively (without CLI) |
requiresCLI() | function | Check if an operation requires CLI |
getNativeOperations() | function | Get all native-capable operations for a domain |
generateCapabilityReport() | function | Generate a capability report for system.doctor |
getCapabilityMatrix() | function | Get the full capability matrix (for testing/introspection) |
findHighestId() | function | Find the highest existing task ID number |
generateNextIdFromSet() | function | Generate the next ID given an explicit set of existing IDs. Useful when calle… |
isValidTaskId() | function | Validate that a task ID matches the expected format |
normalizeTaskId() | function | Normalize a task ID input to canonical T#### format. Accepts various loose f… |
SecurityError | class | Security validation error thrown when input fails sanitization |
sanitizeTaskId() | function | Sanitize and validate a task ID |
sanitizePath() | function | Sanitize and validate a file path |
sanitizeContent() | function | Sanitize content string |
validateEnum() | function | Validate that a value is in an allowed enum set |
RateLimiter | class | In-memory sliding window rate limiter |
ensureArray() | function | Normalize a value to an array of strings. Handles external clients sending co… |
sanitizeParams() | function | Sanitize all params in a request before routing |
getAgentsDir() | function | Get the agents directory path. T4518 |
parseAgentConfig() | function | Parse an AGENT.md file into an AgentConfig. AGENT.md uses the same YAML front… |
loadAgentConfig() | function | Load agent configuration by name. Searches in the agents/ directory. T4518 |
getSubagentConfig() | function | Get the cleo-subagent configuration (universal executor). T4518 |
agentExists() | function | Check if an agent definition exists. T4518 |
installAgent() | function | Install a single agent via symlink. T4518 |
installAllAgents() | function | Install all agents from the project agents/ directory. T4518 |
uninstallAgent() | function | Uninstall a single agent by removing its symlink. T4518 |
getRegistryPath() | function | Get the agent registry file path. T4518 |
readRegistry() | function | Read the agent registry, creating if needed. T4518 |
saveRegistry() | function | Save the agent registry. T4518 |
registerAgent() | function | Register an agent in the registry. T4518 |
unregisterAgent() | function | Unregister an agent from the registry. T4518 |
getAgent() | function | Get an agent from the registry by name. T4518 |
listAgents() | function | List all registered agents. T4518 |
syncRegistry() | function | Scan the agents/ directory and register all found agents. T4518 |
loadProtocolBase() | function | Load the subagent protocol base content. T4521 |
buildTaskContext() | function | Build task context block for injection into a subagent prompt. T4521 |
filterProtocolByTier() | function | Filter protocol content by MVI tier. Extracts sections based on !— TIER:X —… |
injectProtocol() | function | Inject the subagent protocol into skill content. Composes: skill content + pr… |
orchestratorSpawnSkill() | function | Full orchestrator spawn workflow (skill-based). High-level function that load… |
prepareTokenValues() | function | Prepare standard token values for a task spawn. T4521 |
installSkill() | function | Install a single skill via CAAMP. |
generateContributionId() | function | Generate a unique contribution ID. T4520 |
validateContributionTask() | function | Validate that a task is suitable for contribution protocol. T4520 |
getContributionInjection() | function | Generate the contribution injection block for a subagent prompt. T4520 |
detectConflicts() | function | Detect conflicts between two sets of decisions. T4520 |
computeConsensus() | function | Compute weighted consensus from multiple agent decisions. T4520 |
createContributionManifestEntry() | function | Create a manifest entry for a contribution. T4520 |
ensureOutputs() | function | Ensure agent outputs directory and manifest file exist. T4520 |
readManifest() | function | Read all manifest entries. T4520 |
appendManifest() | function | Append a manifest entry (atomic JSONL append). T4520 |
findEntry() | function | Find a manifest entry by ID. T4520 |
filterEntries() | function | Filter manifest entries by criteria. T4520 |
getPendingFollowup() | function | Get entries with pending follow-ups. T4520 |
getFollowupTaskIds() | function | Get unique follow-up task IDs from all manifest entries. T4520 |
taskHasResearch() | function | Check if a task has linked research. T4520 |
archiveEntry() | function | Archive a manifest entry (move to archive status). T4520 |
rotateManifest() | function | Rotate manifest by archiving old entries. T4520 |
isCacheFresh() | function | Check if the cached manifest is fresh (within TTL). T4520 |
invalidateCache() | function | Invalidate the cache (delete the cached manifest). T4520 |
resolveManifest() | function | Resolve the skills manifest. Returns a cached version if fresh, otherwise gen… |
regenerateCache() | function | Force regenerate the cache. T4520 |
loadConfig() | function | Load SkillsMP configuration from skillsmp.json. T4521 |
searchSkills() | function | Search the skills marketplace. Delegates to CAAMP’s searchSkills for the actu… |
getSkill() | function | Get a specific skill from the marketplace. Uses CAAMP’s MarketplaceClient for… |
isEnabled() | function | Check if the marketplace is enabled and reachable. T4521 |
buildPrompt() | function | Build a fully-resolved prompt for spawning a subagent. T4519 |
spawn() | function | Generate full spawn command with metadata. T4519 |
canParallelize() | function | Check if tasks can be spawned in parallel (no inter-dependencies). T4519 |
spawnBatch() | function | Spawn prompts for multiple tasks in a batch. Ports orchestrator_spawn_batch f… |
getThresholds() | function | Get orchestrator context thresholds from config or defaults. T4519 |
getContextState() | function | Read the current context state from session-aware files. T4519 |
sessionInit() | function | Initialize orchestrator session state. Determines the recommended action base… |
shouldPause() | function | Check if orchestrator should pause based on context usage. T4519 |
analyzeDependencies() | function | Analyze dependency graph and compute execution waves. T4519 |
getNextTask() | function | Get the next task ready to spawn for an epic. T4519 |
getReadyTasks() | function | Get all tasks ready to spawn in parallel (no inter-dependencies). T4519 |
generateHitlSummary() | function | Generate a Human-in-the-Loop summary for session handoff. T4519 |
validateSubagentOutput() | function | Validate a subagent’s manifest entry for protocol compliance. T4519 |
validateManifestIntegrity() | function | Validate the entire manifest file integrity. T4519 |
verifyCompliance() | function | Verify previous agent completed protocol compliance before spawning next. T4519 |
validateOrchestratorCompliance() | function | Validate orchestrator compliance (post-hoc behavioral checks). T4519 |
getSkillSearchPaths() | function | Get ordered skill search paths based on configuration. Priority: 1. CLEO_SKI… |
resolveSkillPath() | function | Resolve a skill directory containing SKILL.md. Searches all paths from getSki… |
resolveProtocolPath() | function | Resolve a protocol .md file. Search order: 1… |
resolveSharedPath() | function | Resolve a shared resource .md file. Search order per base path:… |
getSkillSourceType() | function | Classify the source of a skill directory. Determines where a skill directory… |
formatIsoDate() | function | Format a date string in ISO 8601 format. Converts a YYYY-MM-DD date string to… |
getCurrentTimestamp() | function | Get current timestamp in ISO 8601 format. Returns the current UTC time as an… |
isValidIsoDate() | function | Validate that a string is a valid ISO 8601 date. T4552 |
formatDateYMD() | function | Format a Date object to a YYYY-MM-DD string. T4552 |
validateSkill() | function | Validate a skill directory structure and content. T4517 |
validateSkills() | function | Validate multiple skills at once. T4517 |
validateReturnMessage() | function | Validate a return message against protocol-compliant patterns. T4517 |
getInstalledVersionAsync() | function | Get the installed version of a skill from CAAMP lock state. |
checkSkillUpdateAsync() | function | Check if a specific skill needs an update via CAAMP. |
checkAllSkillUpdatesAsync() | function | Check all installed skills for available updates via CAAMP. |
exportSnapshot() | function | Export current task state to a snapshot. T4882 |
writeSnapshot() | function | Write a snapshot to a file. T4882 |
readSnapshot() | function | Read a snapshot from a file. T4882 |
getDefaultSnapshotPath() | function | Generate a default snapshot file path. T4882 |
importSnapshot() | function | Import a snapshot into the local task database. Uses last-write-wins strategy… |
SpawnAdapterRegistry | class | Registry to manage spawn adapters. Maintains mappings between adapter IDs, p… |
getProvidersWithSpawnCapability() | function | Get providers by specific spawn capability Queries CAAMP for providers that… |
hasParallelSpawnProvider() | function | Check if any provider supports parallel spawn |
initializeSpawnAdapters() | function | Initialize spawn adapters dynamically from discovered adapter manifests. Sca… |
initializeDefaultAdapters() | function | Initialize the registry with default adapters. Legacy entry point that disco… |
getWorkflowComplianceReport() | function | Compute workflow compliance metrics from existing task, session, and audit da… |
getProjectStats() | function | Get project statistics. |
rankBlockedTask() | function | Compute a ranking score for a blocked task. Higher score = more urgent = sort… |
getDashboard() | function | Get project dashboard data. |
getCompletionHistory() | function | Get completion history data. |
filterByDate() | function | Filter tasks by date range on archivedAt. |
summaryReport() | function | Generate summary statistics. |
byPhaseReport() | function | Group tasks by phase with cycle time averages. |
byLabelReport() | function | Group tasks by label frequency. |
byPriorityReport() | function | Group tasks by priority with cycle time averages. |
cycleTimesReport() | function | Compute cycle time statistics with distribution buckets. |
trendsReport() | function | Compute archive trends by day and month. |
analyzeArchive() | function | Analyze archived tasks and produce a report. This is the primary entry point… |
getArchiveStats() | function | Get archive statistics. |
auditData() | function | Audit data integrity. |
createBackup() | function | Create a backup of CLEO data files. |
listSystemBackups() | function | List all available system backups (snapshot, safety, migration types). Reads… |
restoreBackup() | function | Restore from a backup. |
cleanupSystem() | function | Cleanup stale data (sessions, backups, logs). |
writeJsonFileAtomic() | function | Write a JSON file atomically with backup rotation. Pattern: write temp - bac… |
readJsonFile() | function | Read a JSON file, returning parsed content or null if not found. |
getDataPath() | function | Get the path to a CLEO data file within a project root. |
resolveProjectRoot() | function | Resolve the project root directory. Checks CLEO_ROOT env, then falls back to… |
withLock() | function | Read and write a JSON file with exclusive locking. Acquires a cross-process… |
withFileLock() | function | Acquire a file lock and execute an operation. Unlike withLock, this doesn’t r… |
withMultiLock() | function | Acquire locks on multiple files in correct order. Used for operations that ne… |
isProjectInitialized() | function | Check if a CLEO project directory exists at the given path |
listBackups() | function | List backup files for a given data file |
detectPlatform() | function | Detect the current platform. |
commandExists() | function | Check if a command exists on PATH. |
requireTool() | function | Require a tool to be available, returning an error message if missing. |
checkRequiredTools() | function | Check all required tools. |
getIsoTimestamp() | function | Get ISO 8601 UTC timestamp. |
isoToEpoch() | function | Convert ISO timestamp to epoch seconds. |
dateDaysAgo() | function | Get ISO date for N days ago. |
getFileSize() | function | Get file size in bytes. |
getFileMtime() | function | Get file modification time as ISO string. |
generateRandomHex() | function | Generate N random hex characters. |
sha256() | function | Compute SHA-256 checksum of a string. |
createTempFilePath() | function | Create a temporary file path. |
getNodeVersionInfo() | function | Get Node.js version info. |
getNodeUpgradeInstructions() | function | Get platform-specific Node.js upgrade instructions. Returns actionable instal… |
getSystemInfo() | function | Gather a snapshot of the host system. This is the SSoT for system informatio… |
checkCliInstallation() | function | T4525 |
checkCliVersion() | function | T4525 |
checkDocsAccessibility() | function | T4525 |
checkAtReferenceResolution() | function | T4525 |
checkAgentsMdHub() | function | Check that AGENTS.md exists in project root and contains the CAAMP:START mark… |
checkRootGitignore() | function | Check if project root .gitignore is blocking the entire .cleo/ directory. Thi… |
checkCleoGitignore() | function | Check if .cleo/.gitignore exists and matches the template. T4700 |
checkVitalFilesTracked() | function | Check that vital CLEO configuration files are tracked by git. Only checks con… |
checkCoreFilesNotIgnored() | function | Check that core CLEO files are not being ignored by .gitignore. Uses… |
checkSqliteNotTracked() | function | Check that SQLite databases (.cleo/tasks.db) are NOT tracked by project git… |
checkLegacyAgentOutputs() | function | Check if any legacy output directories still exist. Delegates detection to th… |
checkCaampMarkerIntegrity() | function | Verify balanced CAAMP:START/END markers in CLAUDE.md and AGENTS.md. T5153 |
checkAtReferenceTargetExists() | function | Parse references from AGENTS.md CAAMP block and verify each target file exis… |
checkTemplateFreshness() | function | Compare templates/CLEO-INJECTION.md vs ~/.cleo/templates/CLEO-INJECTION.md… |
checkTierMarkersPresent() | function | Verify all 3 tier markers exist with matching close tags in deployed template… |
checkNodeVersion() | function | Check that Node.js meets the minimum required version. Provides OS-specific u… |
checkGlobalSchemaHealth() | function | Check that global schemas at ~/.cleo/schemas/ are installed and not stale. De… |
checkNoLocalSchemas() | function | Warn if deprecated .cleo/schemas/ directory still exists in the project. Sche… |
checkJsonSchemaIntegrity() | function | Check that active JSON files (config.json, project-info.json, etc.) are valid… |
runAllGlobalChecks() | function | Run all global health checks and return results array. T4525 |
calculateHealthStatus() | function | Calculate overall status from check results. Returns: 0=passed, 50=warning, 5… |
getSystemHealth() | function | Run system health checks (SQLite-first per ADR-006). |
getSystemDiagnostics() | function | Run extended diagnostics with fix suggestions. |
coreDoctorReport() | function | Run comprehensive doctor diagnostics combining dependency checks, directory c… |
runDoctorFixes() | function | Run auto-fix for failed doctor checks by calling the corresponding ensure* fu… |
startupHealthCheck() | function | Unified startup health check for CLI entry points. This is the single entry… |
generateInjection() | function | Generate Minimum Viable Injection (MVI) markdown. |
getLabels() | function | Get all labels with counts and task IDs per label. |
getSystemMetrics() | function | Get system metrics: token usage, compliance summary, session counts. |
getMigrationStatus() | function | Check/report schema migration status. |
getRuntimeDiagnostics() | function | |
safestop() | function | Safe stop: signal clean shutdown for agents. |
uncancelTask() | function | Uncancel a cancelled task (restore to pending). |
parseIssueTemplates() | function | Parse all templates from the repo’s .github/ISSUE_TEMPLATE/ directory. Reads… |
getTemplateForSubcommand() | function | Get template config for a specific subcommand (bug/feature/help). Performs a… |
generateTemplateConfig() | function | Generate and cache the config as .cleo/issue-templates.json. Performs a live… |
validateLabels() | function | Validate that labels exist on a GitHub repo. Compares the template labels ag… |
getCurrentShell() | function | Detect the current shell. |
getRcFilePath() | function | Get the RC file path for a shell. |
detectAvailableShells() | function | Detect which shells are available on the system. |
generateBashAliases() | function | Generate bash/zsh alias content. |
generatePowershellAliases() | function | Generate PowerShell alias content. |
hasAliasBlock() | function | Check if aliases are already injected in a file. |
getInstalledVersion() | function | Get the installed alias version from an RC file. |
injectAliases() | function | Inject aliases into a shell RC file. |
removeAliases() | function | Remove aliases from a shell RC file. |
checkAliasesStatus() | function | Get alias status for the current shell. |
discoverReleaseTasks() | function | Discover task IDs for a release from completed tasks. Optionally filtered by… |
groupTasksIntoSections() | function | Group tasks into changelog sections. |
generateChangelogMarkdown() | function | Generate changelog markdown for a version. |
formatChangelogJson() | function | Format changelog data as JSON. |
writeChangelogFile() | function | Write changelog content to a file. |
appendToChangelog() | function | Append a new release section to an existing CHANGELOG.md. |
generateChangelog() | function | Full changelog generation: discover tasks, group, generate, write. |
parseCommandHeader() | function | Parse a ###CLEO header block from a script file. |
scanAllCommands() | function | Scan a scripts directory and build a command registry. Returns a map of comma… |
validateHeader() | function | Validate a command header has required fields. |
getCommandScriptMap() | function | Get command-to-script mapping. |
getCommandsByCategory() | function | Group commands by category. |
getCommandsByRelevance() | function | Filter commands by relevance level. |
defaultFlags() | function | Default flag values. |
parseCommonFlags() | function | Parse common CLI flags from an argument array. Returns flags and remaining po… |
resolveFormat() | function | Resolve output format based on flags and TTY detection. Returns ‘json’ for no… |
isJsonOutput() | function | Check if output should be JSON. |
checkManifestEntry() | function | Verify a manifest entry for a task has valid required fields. T4524 |
checkReturnFormat() | function | Check if a response matches the expected return format. T4524 |
scoreSubagentCompliance() | function | Calculate comprehensive compliance score for a subagent. T4524 |
calculateTokenEfficiency() | function | Calculate token efficiency metrics. T4524 |
calculateOrchestrationOverhead() | function | Calculate orchestration overhead metrics. T4524 |
getScriptCommands() | function | Get command names from scripts directory. Returns sorted list of script basen… |
getIndexScripts() | function | Get script names from COMMANDS-INDEX.json. T4527 |
getIndexCommands() | function | Get command names from COMMANDS-INDEX.json. T4527 |
checkCommandsSync() | function | Check commands index vs scripts directory for sync. T4527 |
checkWrapperSync() | function | Check wrapper template sync with COMMANDS-INDEX. T4527 |
detectDrift() | function | Run full drift detection across scripts, index, wrapper, and README. T4527 |
shouldRunDriftDetection() | function | Check if drift detection should run automatically based on config. T4527 |
getCacheFilePath() | function | Get cache file path. T4525 |
initCacheFile() | function | Initialize empty cache file. T4525 |
loadCache() | function | Load cache file or return null if missing/invalid. T4525 |
getFileHash() | function | Get file hash for cache invalidation. T4525 |
getCachedValidation() | function | Check if project validation is cached and valid. Returns the cache entry if v… |
cacheValidationResult() | function | Cache project validation results. T4525 |
clearProjectCache() | function | Clear cache for a specific project. T4525 |
clearEntireCache() | function | Clear entire cache. T4525 |
isTempProject() | function | Check if a project path is a temporary/test directory. T4525 |
categorizeProjects() | function | Filter projects into categories: active, temp, orphaned. T4525 |
getProjectCategoryName() | function | Get human-readable project category name. T4525 |
formatProjectHealthSummary() | function | Format project health summary for display. T4525 |
getProjectGuidance() | function | Get actionable guidance for project issues. T4525 |
getUserJourneyStage() | function | Check user journey stage based on system state. T4525 |
getJourneyGuidance() | function | Get journey-specific guidance text. T4525 |
sanitizeFilePath() | function | Sanitize a file path for safe shell usage. Prevents command injection via mal… |
validateTitle() | function | Validate a task title. Checks for emptiness, newlines, invisible characters,… |
validateDescription() | function | T4523 |
validateNote() | function | T4523 |
validateBlockedBy() | function | T4523 |
validateSessionNote() | function | T4523 |
validateCancelReason() | function | Validate a cancellation reason. T4523 |
validateStatusTransition() | function | Validate that a status transition is allowed. T4523 |
isValidStatus() | function | Check if a status string is valid. T4523 |
checkTimestampSanity() | function | Check timestamp format and sanity. T4523 |
isMetadataOnlyUpdate() | function | Check if an update contains only metadata fields (safe for done tasks). T4523 |
normalizeLabels() | function | Deduplicate and normalize labels. T4523 |
checkIdUniqueness() | function | Check ID uniqueness within and across files. T4523 |
validateTask() | function | Validate a single task object. T4523 |
validateNoCircularDeps() | function | Check for circular dependencies using DFS. T4523 |
validateSingleActivePhase() | function | Validate only one phase is active. T4523 |
validateCurrentPhaseConsistency() | function | Validate currentPhase matches an active phase. T4523 |
validatePhaseTimestamps() | function | Validate phase timestamp ordering. T4523 |
validatePhaseStatusRequirements() | function | Validate phase status requirements (e.g., active phases must have startedAt)… |
validateAll() | function | Run all validation checks on a TaskFile. T4523 |
parseManifest() | function | Parse a manifest JSONL content string into entries. Skips invalid JSON lines gracefully… |
findReviewDocs() | function | Find documents in review status. T4524 |
extractTopics() | function | Extract markdown headings from file content. T4524 |
searchCanonicalCoverage() | function | Search for topic coverage in a docs directory. Returns count of matching file… |
analyzeCoverage() | function | Analyze documentation coverage for review documents. T4524 |
formatGapReport() | function | Format a gap report for human-readable display. T4524 |
findManifestEntry() | function | Find a manifest entry for a task ID in a JSONL file. T4526 |
validateManifestEntry() | function | Run validation on a manifest entry for a specific task. T4526 |
logRealCompliance() | function | Log validation results to the compliance JSONL file. T4526 |
validateAndLog() | function | Find, validate, and log compliance for a task in one call. T4526 |
checkOutputFileExists() | function | Check if expected output file exists. T4527 |
checkDocumentationSections() | function | Check if file contains required documentation sections. T4527 |
checkReturnMessageFormat() | function | Check if return message follows protocol format. Expected: ” . See MANIFEST.j… |
checkManifestFieldPresent() | function | Check if manifest entry has a required field (non-null, non-empty). T4527 |
checkManifestFieldType() | function | Check if manifest field has expected type. T4527 |
checkKeyFindingsCount() | function | Check if key_findings array has valid count (3-7). T4527 |
checkStatusValid() | function | Check if status is valid enum value. T4527 |
checkAgentType() | function | Check if agent_type matches expected value. T4527 |
checkLinkedTasksPresent() | function | Check if linked_tasks array contains required task IDs. T4527 |
checkProvenanceTags() | function | Check if file contains provenance tag. T4527 |
validateCommonManifestRequirements() | function | Validate common manifest requirements across all protocols. When protocolTyp… |
isValidGateName() | function | T4526 |
isValidAgentName() | function | T4526 |
getGateOrder() | function | T4526 |
getGateIndex() | function | T4526 |
getDownstreamGates() | function | T4526 |
initVerification() | function | Initialize a new verification object with default values. T4526 |
computePassed() | function | Compute whether verification has passed based on required gates. T4526 |
setVerificationPassed() | function | Update the passed field on a verification object. T4526 |
updateGate() | function | Update a single gate value. T4526 |
resetDownstreamGates() | function | Reset all downstream gates to null after a gate failure. T4526 |
incrementRound() | function | Increment the round counter. Returns null if max rounds exceeded. T4526 |
logFailure() | function | Log a failure to the failureLog array. T4526 |
checkAllGatesPassed() | function | Check if all required gates have passed. T4526 |
isVerificationComplete() | function | Check if verification is complete (passed = true). T4526 |
getVerificationStatus() | function | Get verification status for display. T4526 |
shouldRequireVerification() | function | Check if a task type should require verification. T4526 |
getMissingGates() | function | Get gate names that are not yet true. T4526 |
getGateSummary() | function | Get gate summary for display. T4526 |
checkCircularValidation() | function | Check for circular validation (self-approval prevention). Prevents: creator v… |
allEpicChildrenVerified() | function | Check if all children of an epic have verification.passed = true. T4526 |
allSiblingsVerified() | function | Check if all siblings of a task are verified. T4526 |
getProjectInfo() | function | Read project-info.json and return a typed ProjectInfo. Falls back gracefully… |
getProjectInfoSync() | function | Synchronous variant for use in hot paths where async is not feasible. Returns… |
updateProjectName() | function | Update the project name in project-info.json. Used by cleo upgrade --name a… |
generateAcFromDescription() | function | Generate 3 baseline acceptance criteria from a task description. Uses simple… |
backfillTasks() | function | Retroactively populate AC and verification metadata for tasks that lack them. |
ProtocolEnforcer | class | Main protocol enforcement class |
getHookCapableProviders() | function | Get all providers that support a specific hook event |
getSharedHookEvents() | function | Get hook events supported by all specified providers |
toNativeHookEvent() | function | Translate a canonical hook event to a provider-native event name. |
toCanonicalHookEvent() | function | Translate a provider-native event name back to its canonical equivalent. |
providerSupportsHookEvent() | function | Check if a provider supports a specific canonical hook event. |
validateChainShape() | function | Validate the topology/DAG of a chain shape. Checks: - All link source/target… |
validateGateSatisfiability() | function | Validate that all gates in a chain reference valid stages and gate names. Ch… |
validateChain() | function | Validate a complete WarpChain definition. Orchestrates shape validation and… |
addChain() | function | Store a validated WarpChain definition. Validates the chain before storing… |
showChain() | function | Retrieve a WarpChain definition by ID. T5403 |
listChains() | function | List all stored WarpChain definitions. T5403 |
findChains() | function | Find WarpChain definitions by criteria. T5403 |
createInstance() | function | Create a chain instance binding a chain to an epic. T5403 |
showInstance() | function | Retrieve a chain instance by ID. T5403 |
listInstanceGateResults() | function | Read persisted gate results for a chain instance. |
advanceInstance() | function | Advance a chain instance to the next stage, recording gate results. T5403 |
validateResearchProtocol() | function | T4499 |
validateConsensusProtocol() | function | T4499 |
validateSpecificationProtocol() | function | T4499 |
validateDecompositionProtocol() | function | T4499 |
validateImplementationProtocol() | function | T4499 |
validateContributionProtocol() | function | T4499 |
validateReleaseProtocol() | function | T4499 |
validateArtifactPublishProtocol() | function | T4499 |
validateProvenanceProtocol() | function | T4499 |
validateArchitectureDecisionProtocol() | function | Validate an Architecture Decision Record manifest entry. Enforces the 8 MUST… |
validateValidationProtocol() | function | Validate a manifest entry against the validation stage protocol. Enforces VA… |
validateTestingProtocol() | function | Validate a manifest entry against the testing protocol. This validator is **… |
validateProtocol() | function | Validate a manifest entry against a specific protocol. Throws CleoError with… |
buildDefaultChain() | function | Build the canonical 9-stage RCASD-IVTR+C WarpChain. - Each PIPELINE_STAGE be… |
buildDefaultTessera() | function | Build the default RCASD Tessera template. Wraps buildDefaultChain() with tem… |
instantiateTessera() | function | Instantiate a Tessera template into a concrete WarpChainInstance. Steps: 1… |
listTesseraTemplates() | function | List all registered Tessera templates. T5409 |
showTessera() | function | Find a Tessera template by ID. T5409 |
runBrainMaintenance() | function | Run a combined brain maintenance pass: decay, consolidation, and embeddings… |
migrateClaudeMem() | function | Migrate observations from claude-mem’s SQLite database into CLEO brain.db. R… |
reasonWhy() | function | Build a causal trace for why a task is blocked. Walks upstream through… |
reasonSimilar() | function | Find entries similar to a given brain.db entry. 1. Loads the source entry’s… |
memoryShow() | function | Look up a brain.db entry by ID. |
memoryBrainStats() | function | Aggregate stats from brain.db across all tables. |
memoryDecisionFind() | function | Search decisions in brain.db. |
memoryDecisionStore() | function | Store a decision to brain.db. |
memoryFind() | function | Token-efficient brain search returning compact results. |
memoryTimeline() | function | Chronological context around a brain entry anchor. |
memoryFetch() | function | Batch fetch brain entries by IDs. |
memoryObserve() | function | Save an observation to brain.db. |
memoryPatternStore() | function | Store a pattern to BRAIN memory. |
memoryPatternFind() | function | Search patterns in BRAIN memory. |
memoryPatternStats() | function | Get pattern memory statistics. |
memoryLearningStore() | function | Store a learning to BRAIN memory. |
memoryLearningFind() | function | Search learnings in BRAIN memory. |
memoryLearningStats() | function | Get learning memory statistics. |
memoryContradictions() | function | Find contradictory entries in brain.db. |
memorySuperseded() | function | Find superseded entries in brain.db. Identifies entries that have been super… |
memoryLink() | function | Link a brain entry to a task. |
memoryUnlink() | function | Remove a link between a brain entry and a task. |
memoryGraphAdd() | function | Add a node or edge to the PageIndex graph. |
memoryGraphShow() | function | Get a node and its edges from the PageIndex graph. |
memoryGraphNeighbors() | function | Get neighbor nodes from the PageIndex graph. |
memoryReasonWhy() | function | Causal trace through task dependency chains. |
memoryReasonSimilar() | function | Find semantically similar entries. |
memorySearchHybrid() | function | Hybrid search across FTS5, vector, and graph. |
memoryGraphRemove() | function | Remove a node or edge from the PageIndex graph. |
pipelineManifestShow() | function | pipeline.manifest.show - Get manifest entry details by ID |
pipelineManifestList() | function | pipeline.manifest.list - List manifest entries with filters |
pipelineManifestFind() | function | pipeline.manifest.find - Find manifest entries by text (LIKE search on conten… |
pipelineManifestPending() | function | pipeline.manifest.pending - Get pending manifest items |
pipelineManifestStats() | function | pipeline.manifest.stats - Manifest statistics |
pipelineManifestRead() | function | pipeline.manifest.read - Read manifest entries with optional filter |
pipelineManifestAppend() | function | pipeline.manifest.append - Append entry to pipeline_manifest table |
pipelineManifestArchive() | function | pipeline.manifest.archive - Archive old manifest entries by date |
pipelineManifestCompact() | function | pipeline.manifest.compact - Dedup by contentHash (keep newest by createdAt) |
pipelineManifestValidate() | function | pipeline.manifest.validate - Validate manifest entries for a task |
pipelineManifestContradictions() | function | pipeline.manifest.contradictions - Find entries with overlapping topics but c… |
pipelineManifestSuperseded() | function | pipeline.manifest.superseded - Identify entries replaced by newer work on sam… |
pipelineManifestLink() | function | pipeline.manifest.link - Link manifest entry to a task |
readManifestEntries() | function | Read all manifest entries from the pipeline_manifest table. Replaces readMani… |
filterEntries() | function | Filter manifest entries by criteria (alias for backward compatibility). |
distillManifestEntry() | function | Distill a manifest entry to brain.db observation (Phase 3, pending). |
migrateManifestJsonlToSqlite() | function | Migrate existing legacy flat-file entries into the pipeline_manifest table… |
resolveProviderFromModelIndex() | function | |
resolveProviderFromModelRegistry() | function | |
resetModelsDevCache() | function | |
measureTokenExchange() | function | |
recordTokenExchange() | function | |
showTokenUsage() | function | |
listTokenUsage() | function | |
summarizeTokenUsage() | function | |
deleteTokenUsage() | function | |
clearTokenUsage() | function | |
autoRecordDispatchTokenUsage() | function | |
getLatestTokenRecord() | function | |
getTokenUsageAggregateSql() | function | |
startParallelExecution() | function | Start parallel execution for a wave. |
endParallelExecution() | function | End parallel execution for a wave. |
getParallelStatus() | function | Get current parallel execution state. |
listSkills() | function | List available skills from canonical and project-local directories. |
getSkillContent() | function | Read skill content for injection into agent context. Checks project-local ski… |
getUnblockOpportunities() | function | Analyze dependency graph for unblocking opportunities. |
validateSpawnReadiness() | function | Validate spawn readiness for a task. |
injectContext() | function | Read protocol injection content for a given protocol type. Core logic for ses… |
generateSessionId() | function | Generate a canonical session ID. Format: ses_YYYYMMDDHHmmss_6hex Example: se… |
isValidSessionId() | function | Check if a string is a valid session ID (any format). |
isCanonicalSessionId() | function | Check if a session ID uses the canonical format. |
extractSessionTimestamp() | function | Extract an approximate timestamp from any valid session ID format. Returns nu… |
createSession() | function | Create a new session. |
getSession() | function | Get a session by ID. |
updateSession() | function | Update a session. |
listSessions() | function | List sessions with optional filters. |
endSession() | function | End a session. |
startTask() | function | Start working on a task within a session. |
getCurrentTask() | function | Get current task for a session. |
stopTask() | function | Stop working on the current task for a session. |
workHistory() | function | Get work history for a session. |
gcSessions() | function | Garbage collect old sessions (mark ended sessions as orphaned after threshold). |
getActiveSession() | function | Get the currently active session (if any). |
suggestRelated() | function | Suggest related tasks based on shared attributes. |
addRelation() | function | Add a relation between tasks. |
discoverRelated() | function | Discover related tasks using various methods. |
listRelations() | function | List existing relations for a task. |
canCancel() | function | Check if a task can be cancelled. |
cancelTask() | function | Cancel a task in the tasks array (returns updated array). Does NOT handle chi… |
cancelMultiple() | function | Batch cancel multiple tasks. |
coreTaskNext() | function | Suggest next task to work on based on priority, phase, age, and deps. |
coreTaskBlockers() | function | Show blocked tasks and analyze blocking chains. |
coreTaskTree() | function | Build hierarchy tree for tasks. |
coreTaskDeps() | function | Show dependencies for a task. |
coreTaskRelates() | function | Show task relations. |
coreTaskRelatesAdd() | function | Add a relation between two tasks. |
coreTaskAnalyze() | function | Analyze tasks for priority and leverage. |
coreTaskRestore() | function | Restore a cancelled task back to pending. |
coreTaskCancel() | function | Cancel a task (sets status to ‘cancelled’, a soft terminal state). Use restor… |
coreTaskUnarchive() | function | Move an archived task back to active tasks. |
coreTaskReorder() | function | Change task position within its sibling group. |
coreTaskReparent() | function | Move task under a different parent. |
coreTaskPromote() | function | Promote a subtask to task or task to root. |
coreTaskReopen() | function | Reopen a completed task. |
coreTaskComplexityEstimate() | function | Deterministic complexity scoring from task metadata. |
coreTaskDepsOverview() | function | Overview of all dependencies across the project. |
coreTaskDepsCycles() | function | Detect circular dependencies across the project. |
coreTaskDepends() | function | List dependencies for a task in a given direction. |
coreTaskStats() | function | Compute task statistics. |
coreTaskExport() | function | Export tasks as JSON or CSV. |
coreTaskHistory() | function | Get task history from the audit log. |
coreTaskLint() | function | Lint tasks for common issues. |
coreTaskBatchValidate() | function | Validate multiple tasks at once. |
coreTaskImport() | function | Import tasks from a JSON source string. |
analyzeTaskPriority() | function | Analyze task priority with leverage scoring. |
listLabels() | function | List all labels with task counts. |
showLabelTasks() | function | Show tasks with a specific label. |
getLabelStats() | function | Get detailed label statistics. |
createStoreProvider() | function | Create a store provider. Always creates SQLite provider (ADR-006). T4647 |
getStore() | function | Get a StoreProvider instance for the given working directory. Convenience wra… |
countJsonRecords() | function | Count records in JSON source files. |
migrateJsonToSqliteAtomic() | function | Migrate JSON data to SQLite with atomic rename pattern. Writes to a temporary… |
migrateJsonToSqlite() | function | |
exportToJson() | function | Export SQLite data back to JSON format (for inspection or emergency recovery). |
repairMissingSizes() | function | Set size=‘medium’ on tasks that have no size value. Operates directly on the… |
repairMissingCompletedAt() | function | Set completedAt=now() on done/cancelled tasks that are missing a completedAt… |
repairMissingColumns() | function | Detect and add missing required columns on the tasks table. Uses PRAGMA table… |
runAllRepairs() | function | Run all repair functions. Returns all actions taken (or previewed in dry-run… |
runUpgrade() | function | Run a full upgrade pass on the project .cleo/ directory. Steps: 1. Pre-fli… |
diagnoseUpgrade() | function | Deep diagnostic inspection of schema and migration state. Unlike bare… |
VerificationGate | class | Main Verification Gate class Orchestrates 4-layer validation and determines… |
createVerificationGate() | function | Factory function for creating verification gates |
WorkflowGateTracker | class | WorkflowGateTracker Tracks the status of all 6 workflow verification gates f… |
isValidWorkflowGateName() | function | Validate a workflow gate name string |
getWorkflowGateDefinition() | function | Get the definition for a workflow gate |
validateLayer1Schema() | function | Layer 1: Schema Validation Validates operation parameters against JSON Schem… |
validateLayer2Semantic() | function | Layer 2: Semantic Validation Validates business rules and logical constraints. |
validateLayer3Referential() | function | Layer 3: Referential Validation Validates cross-entity references and relati… |
validateLayer4Protocol() | function | Layer 4: Protocol Validation Validates RCASD-IVTR+C lifecycle compliance and… |
isFieldRequired() | function | Helper to check if a field is required for an operation |
validateWorkflowGateName() | function | Validate a workflow gate name T3141 |
validateWorkflowGateStatus() | function | Validate a workflow gate status value per Section 7.3 T3141 |
validateWorkflowGateUpdate() | function | Validate a gate update operation. T3141 |
buildMcpInputSchema() | function | Build a JSON Schema input_schema object from an OperationDef. Algorithm:… |
buildCommanderArgs() | function | Split OperationDef.params into positional arguments and option flags, suita… |
buildCommanderOptionString() | function | Build the Commander option string for a single non-positional ParamDef. Exam… |
camelToKebab() | function | Convert a camelCase string to kebab-case. e.g. ‘includeArchive’ → ‘include-ar… |
validateRequiredParamsDef() | function | Validates that all required parameters are present in the request. Returns an… |
findManifestEntry() | function | Locate the manifest line for a given task ID, reading from the end of the fil… |
loadManifestEntryByTaskId() | function | Load a manifest entry by task ID from the canonical manifest file. T260 |
loadManifestEntryFromFile() | function | Load a manifest entry from an arbitrary JSON file (used by the manifest dis… |
throwIfStrictFailed() | function | Throw a CleoError with the protocol’s canonical exit code when strict validat… |
validateArchitectureDecisionTask() | function | Validate architecture-decision protocol for a task. |
checkArchitectureDecisionManifest() | function | Validate architecture-decision protocol from a manifest file. |
validateArtifactPublishTask() | function | Validate artifact-publish protocol for a task. |
checkArtifactPublishManifest() | function | Validate artifact-publish protocol from a manifest file. |
validateConsensusTask() | function | Validate consensus protocol for a task. |
checkConsensusManifest() | function | Validate consensus protocol from a manifest file. |
validateContributionTask() | function | Validate contribution protocol for a task. |
checkContributionManifest() | function | Validate contribution protocol from a manifest file. |
validateDecompositionTask() | function | Validate decomposition protocol for a task. |
checkDecompositionManifest() | function | Validate decomposition protocol from a manifest file. |
validateImplementationTask() | function | Validate implementation protocol for a task. |
checkImplementationManifest() | function | Validate implementation protocol from a manifest file. |
validateProvenanceTask() | function | Validate provenance protocol for a task. |
checkProvenanceManifest() | function | Validate provenance protocol from a manifest file. |
validateReleaseTask() | function | Validate release protocol for a task. |
checkReleaseManifest() | function | Validate release protocol from a manifest file. |
validateResearchTask() | function | Validate research protocol for a task. |
checkResearchManifest() | function | Validate research protocol from a manifest file. |
validateSpecificationTask() | function | Validate specification protocol for a task. |
checkSpecificationManifest() | function | Validate specification protocol from a manifest file. |
validateTestingTask() | function | Validate testing protocol for a task. |
checkTestingManifest() | function | Validate testing protocol from a manifest file. |
validateValidationTask() | function | Validate validation-stage protocol for a task. |
checkValidationManifest() | function | Validate validation-stage protocol from a manifest file. |
validateSchema() | function | Validate data against a CLEO schema |
validateTask() | function | Validate a single task object against the drizzle-zod insert schema. Uses dri… |
clearSchemaCache() | function | Clear the schema cache (useful for testing) |
coreValidateReport() | function | Run comprehensive validation report on tasks database — checks business rules… |
coreValidateAndFix() | function | Run validation report, then apply data repairs for fixable issues. Calls runA… |
coreValidateSchema() | function | Validate data against a schema type. For SQLite-backed types (todo, archive,… |
coreValidateTask() | function | Validate a single task against anti-hallucination rules. T4786 |
coreValidateProtocol() | function | Check basic protocol compliance for a task. T4786 |
coreValidateManifest() | function | Validate manifest JSONL entries for required fields. T4786 |
coreValidateOutput() | function | Validate an output file for required sections. T4786 |
coreComplianceSummary() | function | Get aggregated compliance metrics. T4786 |
coreComplianceViolations() | function | List compliance violations. T4786 |
coreComplianceRecord() | function | Record a compliance check result to COMPLIANCE.jsonl. T4786 |
coreTestStatus() | function | Check test suite availability. T4786 |
coreCoherenceCheck() | function | Cross-validate task graph for consistency. T4786 |
coreTestRun() | function | Execute test suite via subprocess. T4786 |
coreBatchValidate() | function | Batch validate all tasks against schema and rules. T4786 |
coreTestCoverage() | function | Get test coverage metrics. T4786 |
buildBrainState() | function | Build brain state for agent bootstrapping. |
getCriticalPath() | function | Find the critical path (longest dependency chain) in the task graph. |
resolveSkillPathsForProvider() | function | Get effective skill paths for a provider considering precedence |
getProvidersWithPrecedence() | function | Get all providers that use a specific precedence mode |
getSkillsMapWithPrecedence() | function | Build complete skills map with precedence information |
determineInstallationTargets() | function | Determine target installation paths for a skill |
supportsAgentsPath() | function | Check if provider supports agents path |
coreTaskPlan() | function | Build composite planning view. T4914 |
encrypt() | function | Encrypt a plaintext string using AES-256-GCM with a per-project key. Output… |
decrypt() | function | Decrypt a base64-encoded ciphertext using AES-256-GCM with a per-project key. |
AgentRegistryAccessor | class | signaldock.db implementation of the AgentRegistryAPI. |
buildIndex() | function | Scan .cleo/rcasd/ and legacy .cleo/rcsd/ directories and build the RCASD inde… |
writeIndex() | function | Write RCASD-INDEX.json to disk. |
readIndex() | function | Read RCASD-INDEX.json from disk. |
rebuildIndex() | function | Rebuild and write the index from current disk state. |
getTaskAnchor() | function | Get task anchor by task ID. |
findByStage() | function | Find tasks by pipeline stage. |
findByStatus() | function | Find tasks by status. |
getIndexTotals() | function | Get index summary statistics. |
ApprovalManager | class | Manages approval tokens for CANT workflow gates. Tokens are stored in-memory… |
createScope() | function | Creates a new root execution scope with initial variable bindings. |
createChildScope() | function | Creates a child scope that inherits from a parent. Lookups in the child scop… |
resolveVariable() | function | Resolves a variable name in the scope chain. Searches the current scope firs… |
setVariable() | function | Sets a variable in the current scope (does not affect parent scopes). |
resolveTemplate() | function | Resolves {variable} placeholders in a template string against the scope. P… |
mergeStepOutput() | function | Merges step output into the current scope. Binds <stepName>.stdout,… |
flattenScope() | function | Collects all variable bindings visible from the given scope (including parent… |
DefaultDiscretionEvaluator | class | Default discretion evaluator that always returns true. This is a stub impl… |
MockDiscretionEvaluator | class | Mock discretion evaluator with configurable responses for testing. Responses… |
RateLimitedDiscretionEvaluator | class | Wraps a discretion evaluator with rate limiting. Enforces a configurable max… |
executeParallel() | function | Executes parallel arms according to the specified join strategy. |
WorkflowExecutor | class | Executes CANT workflow definitions. The executor processes each statement in… |
generateCodebaseMapSummary() | function | |
sequenceChains() | function | Sequence two chains: connect A’s exit points to B’s entry point. B’s stage I… |
parallelChains() | function | Compose chains in parallel with a common fork entry and join stage. Creates… |
resolveEpicFromContent() | function | Extract an epic/task ID from file content by searching for: 1… |
resolveEpicFromFilename() | function | Extract an epic ID from a filename pattern like T####-* or T####_*. |
normalizeDirectoryNames() | function | Rename suffixed epic directories (e.g. T4881_install-channels → T4881). |
migrateConsensusFiles() | function | Migrate .cleo/consensus/ files to appropriate epic’s consensus/ subdirector… |
migrateContributionFiles() | function | Migrate .cleo/contributions/ files to appropriate epic’s contributions/ sub… |
migrateLooseFiles() | function | Migrate loose T####_*.md files from .cleo/rcasd/ root into… |
consolidateRcasd() | function | Consolidate all provenance files into the unified .cleo/rcasd/{epicId}/ str… |
findResumablePipelines() | function | Query active pipelines that can be resumed. Searches the lifecycle_pipelines… |
loadPipelineContext() | function | Load complete pipeline context for session resume. Uses SQL JOINs to efficie… |
resumeStage() | function | Resume a specific stage in a pipeline. Updates the stage status from ‘blocke… |
autoResume() | function | Auto-detect where to resume across all active pipelines. Finds the best cand… |
checkSessionResume() | function | Check for resumable work on session start. Integrates with session initializ… |
formatResumeSummary() | function | Get resume summary for display to user. Formats resumable pipelines into a h… |
handleCompletedStage() | function | Handle completed stage edge case. If the current stage is completed, suggest… |
handleBlockedStage() | function | Handle blocked stage edge case. Provides information about why a stage is bl… |
checkBlockedStageDetails() | function | Handle blocked stage edge case - async version with database lookup. |
checkPrerequisites() | function | Check if prerequisites are met for a stage. Validates that all prerequisite… |
validateTransition() | function | Validate a stage transition. Comprehensive validation that checks both trans… |
executeTransition() | function | Execute a state transition. Applies the transition to the state machine cont… |
setStageStatus() | function | Set the status of a stage. Updates stage status with validation of allowed s… |
getStageStatus() | function | Get the status of a stage. |
isValidStatusTransition() | function | Check if a status transition is valid. State transitions: not_started → in… |
createInitialContext() | function | Create initial state machine context for a pipeline. |
getValidNextStages() | function | Get stages that can be transitioned to from the current stage. |
getCurrentStageState() | function | Get the current stage state. |
isTerminalState() | function | Check if the pipeline is in a terminal state. |
isBlocked() | function | Check if the pipeline is blocked. |
validateTransitions() | function | Validate multiple transitions. |
canSkipStage() | function | Check if a stage can be skipped. |
skipStage() | function | Skip a stage with validation. |
EmbeddingQueue | class | Singleton embedding queue. Batches embedding requests and processes them via… |
getEmbeddingQueue() | function | Get or create the shared EmbeddingQueue singleton. Registers a process… |
resetEmbeddingQueue() | function | Reset the singleton (for testing only). Shuts down the existing queue before… |
getContextStatusFromPercentage() | function | Determine status from percentage. |
processContextInput() | function | Process context window input and write state file. Returns the status line st… |
isHITLEnabled() | function | Check if HITL warnings are enabled. |
generateHITLWarnings() | function | Generate HITL warnings based on lock state. |
getHighestLevel() | function | Get highest warning level from warnings. |
getConcurrencyJson() | function | Get concurrency data for analyze JSON output. |
checkStatuslineIntegration() | function | Check if statusline integration is configured. Returns the current integratio… |
getStatuslineConfig() | function | Get the statusline setup command for Claude Code settings. |
getSetupInstructions() | function | Get human-readable setup instructions. |
getPreferredChannel() | function | Look up the preferred channel for a given domain + operation. Reads from the… |
getRoutingForDomain() | function | Get routing entries for a specific domain. Derives entries from the capabili… |
getOperationsByChannel() | function | Get all operations that prefer a specific channel. Derives entries from the… |
generateMemoryProtocol() | function | Generate dynamic memory protocol instructions based on provider capabilities. |
generateRoutingGuide() | function | Generate a dynamic routing guide based on operation preferences. |
generateDynamicSkillContent() | function | Generate complete dynamic skill content for the current provider. |
TaskCache | class | In-memory cache for task indices with checksum-based staleness detection. |
extractPackageMeta() | function | Extract package metadata from an export file. T4552 |
logImportStart() | function | Log import operation start with package metadata. T4552 |
logImportSuccess() | function | Log import operation completion with full metadata. T4552 |
logImportError() | function | Log import operation error with diagnostic details. T4552 |
logImportConflict() | function | Log import conflict detection and resolution. T4552 |
topologicalSortTasks() | function | Topological sort for task import order using Kahn’s algorithm. Ensures tasks… |
detectCycles() | function | Detect cycles in task dependency graph. Returns true if no cycles, false if c… |
findActivePipelinesWithStagesAndTasks() | function | Find active pipelines joined with their stages and tasks. Optionally filters… |
findPipelineWithCurrentStageAndTask() | function | Find a pipeline with its current stage and task by taskId. Matches stages whe… |
findPipelineWithStage() | function | Find a pipeline and a specific stage by taskId and stageName. |
updatePipelineCurrentStage() | function | Update pipeline’s currentStageId. |
getStagesByPipelineId() | function | Get all stages for a pipeline, ordered by sequence. |
activateStage() | function | Update a stage’s status to ‘in_progress’ and clear block fields. |
findPipelineWithCurrentStage() | function | Find pipeline with current stage (no task join) by taskId. Used by checkBlock… |
getGateResultsByStageId() | function | Get gate results for a stage, ordered by checkedAt descending. |
getGateResultsByStageIdUnordered() | function | Get gate results for a stage without ordering (for simple checks). |
getEvidenceByStageId() | function | Get evidence for a stage, ordered by recordedAt descending. |
getRecentTransitions() | function | Get recent transitions for a pipeline, ordered by createdAt descending. |
insertTransition() | function | Insert a new transition record. |
checkAtomicity() | function | Check task atomicity using 6-point heuristic test. Default threshold: 4 (pass… |
extractTaskRefs() | function | Extract task IDs from text content. Scans for patterns like T1234, T001, T42… |
createRelatesEntries() | function | Create relates entries from extracted task IDs. |
mergeRelatesArrays() | function | Merge new relates entries with existing ones. Existing entries take precedenc… |
validateRelatesRefs() | function | Validate that referenced task IDs exist. Returns array of invalid (non-existe… |
extractAndCreateRelates() | function | Convenience: extract task refs from text and create relates entries. |
calculateAffectedTasks() | function | Calculate which tasks would be affected by a delete operation. |
calculateImpact() | function | Calculate impact of deletion. |
generateWarnings() | function | Generate warnings based on impact analysis. |
previewDelete() | function | Main preview function - coordinates all preview calculations. |
isValidStrategy() | function | Validate a strategy name. |
handleChildren() | function | Handle children using the specified strategy. Returns the modified tasks arra… |
GraphCache | class | Graph cache for expensive dependency calculations. Automatically invalidates… |
discoverByLabels() | function | Discover related tasks by shared labels. |
discoverByDescription() | function | Discover related tasks by description similarity (keyword-based Jaccard). |
discoverByFiles() | function | Discover related tasks by shared files. |
discoverByHierarchy() | function | Discover related tasks by hierarchical proximity (siblings and cousins). |
discoverRelatedTasks() | function | Discover related tasks using all methods combined. |
suggestRelates() | function | Suggest relates entries filtered by threshold. |
getCurrentPhase() | function | Get the current active phase from project metadata. |
getTasksByPhase() | function | Get tasks belonging to a specific phase. |
calculatePhaseProgress() | function | Calculate progress for a phase. |
getAllPhaseProgress() | function | Get progress for all phases. |
validatePhaseTransition() | function | |
createPhaseTransition() | function | Create a phase transition record. |
applyPhaseTransition() | function | Apply a phase transition to project metadata. Returns updated project data. |
getNextPhase() | function | Get the next phase in order. |
allPhasesComplete() | function | Check if all phases are complete. |
getSizeWeight() | function | Get weight for a task size. |
getPriorityWeight() | function | Get weight for a task priority. |
calculateTaskScore() | function | Calculate a composite score for task ordering. Higher score = should be worke… |
sortByWeight() | function | Sort tasks by weighted score (highest first). |
calculateTotalEffort() | function | Calculate total weighted effort for a set of tasks. |
calculateWeightedProgress() | function | Calculate completion percentage by weight. |
calculateRemainingEffort() | function | Estimate remaining effort (weighted sum of non-complete tasks). |
getLastActivity() | function | Get the most recent activity timestamp for a task. |
classifyStaleness() | function | Classify staleness level for a task. |
getStalenessInfo() | function | Get staleness info for a single task. |
findStaleTasks() | function | Find all stale tasks (stale, critical, or abandoned). |
getStalenessSummary() | function | |