acknowledge_notice
Acknowledge Notice
Mark a notice as delivered so it never fires again for this project. Writes to acknowledged_notices in user_preferences.db; the notice text itself lives in the read-only core database and is untouched. Call only AFTER acting on the notice — for an action_required notice that means after the user has actually answered, not merely been asked.
Parametersoutcomenotice_keyrequired
activate_user_directive
Activate User Directive
Set directive status to 'active' and record activated_at timestamp, only for a directive a person approved and that is unchanged since (approval content hash). Does NOT deploy services - AI handles deployment via directive workflow.
Parametersdirective_idrequired
add_completion_path
Add Completion Path
Add completion path stage
Parametersnamerequiredstatustheme_idsdescriptionorder_index
add_directive_preference
Add Directive Preference
Add/update user preference for directive
Parametersactivedescriptiondirective_namerequiredpreference_keyrequiredpreference_valuerequired
add_file_flows
Add File Flows
Batch-assign multiple files to flows. Skips existing links silently. More efficient than multiple add_file_to_flow calls.
Parameterslinksrequired
add_file_to_flow
Add File To Flow
Assign a finalized file to an architectural flow. Every finalized file needs at least one flow assignment to stay architecturally connected.
Parametersfile_idrequiredflow_idrequired
add_file_to_module
Add File To Module
Assign a file to a module. Creates module_files junction entry. Same pattern as add_file_to_flow.
Parametersfile_idrequiredmodule_idrequired
add_files_to_module
Add Files To Module
Batch assign multiple files to modules. More efficient than multiple add_file_to_module calls. Skips duplicates silently, fails fast on missing entities.
Parameterslinksrequired
Add a project flow (evolving behaviour/architecture description) linked to at least one theme. theme_ids is required: a flow never exists without a theme.
Parametersnamerequiredtheme_idsrequireddescriptionai_generatedconfidence_score
add_flow_themes
Add Flow Themes
Batch-link flows to themes (flow_themes). Every flow must belong to at least one theme; use this to fix theme-less flows or give a flow a second theme.
Parameterslinksrequired
add_interaction
Add Interaction
Record a dependency between two functions by name (call, chain, borrow, compose, pipe). Interactions are how the AI traces dependency graphs. An edge already tracked is not duplicated (already_existed=true).
Parameterssourcerequiredtargetrequireddescriptionis_indirectinteraction_typerequired
add_interactions
Add Interactions
Batch-record function dependencies by ID. More efficient than multiple add_interaction calls for tracking all cross-function dependencies. Edges already tracked (same source, target, type) are skipped and counted in skipped_count; ids stay in input order.
Parametersinteractionsrequired
Create a single work item under a task, subtask, or sidequest. Items are the smallest trackable units of work.
Parametersnamerequiredstatusdescriptionreference_idrequiredreference_tablerequired
Batch-create multiple work items under a single parent in one call. All items created with status 'pending'.
Parametersitemsrequiredreference_idrequiredreference_tablerequired
add_milestone
Add Milestone
Add milestone to completion path
Parametersnamerequiredstatusflow_idsdescriptioncompletion_path_idrequired
add_milestone_flows
Add Milestone Flows
Batch-link milestones to the flows (evolving behaviour) they build or change (milestone_flows). A milestone that introduces new behaviour should get a NEW flow (add_flow) rather than growing an existing flow's description.
Parameterslinksrequired
Create a new module (reusable code boundary). A module maps to a directory. Files are assigned explicitly via add_file_to_module. Use external_dependencies to record wrapped libraries.
Parametersnamerequiredpathrequiredpurposedescriptionexternal_dependencies
Record a decision, architecture change, or context event in the project's audit trail. Supports typed notes with optional directive linking.
Parameterssourcecontentrequiredseveritynote_typerequiredreference_iddirective_namereference_tablesend_with_directive
add_path_themes
Add Path Themes
Batch-link completion paths to the themes (stable project areas) they advance (completion_path_themes). Themes change rarely, like paths.
Parameterslinksrequired
add_project_entry
Add Project Entry
Add new entry to project database
Parametersdatarequiredtablerequired
add_settings_entry
Add Settings Entry
Add entry to user settings database
Parametersdatarequiredtablerequired
add_sidequest
Add Sidequest
Create an urgent interruption that pauses the current task. Use for bug fixes, blockers, or unexpected work discovered mid-task.
Parametersnamerequiredstatusflow_idsprioritydescriptionpaused_task_idrequiredpaused_subtask_id
Create a focused sub-unit of work under a parent task. The parent is paused until all subtasks complete.
Parametersnamerequiredstatusprioritydescriptionparent_task_idrequired
Create a task under a milestone with flow associations. Tasks are created ONE at a time as work progresses, not all at once.
Parametersnamerequiredstatusflow_idsprioritydescriptionmilestone_idrequired
Add project theme
Parametersnamerequireddescriptionai_generatedconfidence_score
add_tracking_note
Add Tracking Note
Add tracking note to user_preferences.db (only when tracking enabled)
Parameterscontentrequiredseveritynote_typerequiredreference_idmetadata_jsondirective_namereference_namereference_type
add_types_functions
Add Types Functions
Link tracked types to the functions that use them with a role (factory, transformer, validator, etc.). Enables 'what functions use TypeX?' queries. Links already tracked are skipped and counted in skipped_count instead of failing the batch.
Parametersrelationshipsrequired
add_user_custom_entry
Add User Custom Entry
Add entry to user_directives.db table. Returns inserted record with ID. Every key must be a column of the table; on user_directives the approval columns and status='active' are refused, so a new directive always starts unapproved.
Parametersdatarequiredtablerequired
add_user_directive_note
Add User Directive Note
Add note to user_directives.db notes table for AI record-keeping
Parameterscontentrequiredseveritynote_typerequiredreference_idmetadata_jsonreference_namereference_type
add_user_setting
Add User Setting
Add new project-wide user setting to user_settings table
Parametersscopedescriptionsetting_keyrequiredsetting_valuerequired
Session termination orchestrator. Gathers session audit data: reads watchdog state and final reminders, queries all files and functions from DB for AI to cross-reference, reads recent notes and task state. Stops watchdog process if running. Returns structured audit data for AI to interpret and act on. No analysis logic — AI determines what is stale or missing. Also runs the tracking audit (functions, interactions, descriptions) over the session's uncommitted changes (or the in-progress work item's files without git) and returns data.audit with counts, verdict and report_path.
Takes no parameters.
Phase 1 mechanical setup orchestrator for project initialization. Atomically creates directories, databases with schemas, and templates. No deep logic - pure mechanical operations.
Parametersproject_rootrequired
Main entry point orchestrator. Called on session start (is_new_session=true) for full context bundle, and at work checkpoints (is_new_session=false) for watchdog alerts only.
Parametersis_new_session
Project status in three tiers. Default 'quick' is the cheap position check for completion loops; 'summary' is the reload after lost or compacted context. Structure (themes/flows/modules) is attached to the work and files shown, never listed whole.
Parameterstype
apply_audit_fixes
Apply Audit Fixes
Apply audit findings in ONE call and ONE transaction, with a restore manifest written in the same transaction. Name report categories (report + apply) so thousands of IDs never pass through the conversation, hold back reviewed false positives for this call with exclude={category: [ids]} or for good with exempt=[...], and/or pass explicit changes. Every report finding is re-checked against its row first: an edge whose endpoints changed since the audit, or an entity already gone or renamed, is skipped with a reason. One entry_deletion note lists every deleted row (cascaded edges and type links included) and the old values of every changed row, so any change can be undone. Judgement categories (unconfirmed_interactions, dangling_mentions, missing_functions, untracked_files) are refused: they need prose, a mark, or reconcile_paths. Description review lists (unbaselined_needs_review, stale_descriptions) apply as baselines once reviewed: exclude the ones whose prose you are rewriting.
Parametersapplyexemptreasonrequiredreportcleanupdry_runexcludeunexempt_idsadd_type_linksdelete_type_idsadd_interactionsmark_indirect_ids+6 more
apply_state_changeset
Apply State Changeset
(For use with InterCommAIMFP) Apply a semantic changeset onto the current-main project.db as a 3-way merge (base@base_main_commit vs branch intent vs current main). Accepts EITHER the inline changeset object OR a changeset_id handle (loaded server-side). Auto-applies non-overlapping changes, mints canonical IDs for genuinely new entities, rewrites all references to canonical IDs, and returns EVERY conflict as structured data for the master/AI to review — it never guesses on a conflict. Mutates the working .aimfp-project/project.db in place after taking a backup; a genuine failure rolls back and restores the backup.
Parameterschangesetchangeset_id
audit_descriptions
Audit Descriptions
Audit function and type descriptions for drift from the code. Read-only. stale_descriptions: the function's code changed after its purpose/parameters/returns were written (functions.source_hash, recorded on every prose write, differs from the current code hash; formatting, comments and docstrings never change the hash). dangling_mentions: a description names a callable that exists nowhere — 'name()' or 'snake_name(...)' not defined, imported or called anywhere in the tracked Python files, not tracked, not a builtin or Python keyword, and not vocabulary the code writes in its string literals (a whole-string identifier or 'name(' in a string: DSL built-ins such as jsonencode, parse_json); attribute calls, ALLCAPS and 'file(s)' plurals are ignored. Described functions with no hash yet are triaged against the code: unbaselined_descriptions (info) pass and can be baselined in one call; unbaselined_needs_review (info) carry triage reasons (recorded parameter names or return type differing from the code, a purpose under three words, snake_case/backticked names in the prose that neither the function nor the rest of its file uses — names, imports, string words, plural or singular forms count), the recorded prose and a code excerpt; a name found nowhere in the repo (any file under the project root the exclusion stack keeps) ranks priority 'high' with signature mismatches, one found elsewhere ranks 'low', and lists are sorted high first. stale_descriptions carry the same triage, priority and excerpt. Warnings only — never blocks a task. Scope selectors combine as a union; with none, the whole project (tracked files plus untracked source files) is audited. Writes the full report to <project folder>/audit/ and returns counts + samples + report_path.
Parameterspathstask_idfile_idstask_typemodule_pathsince_commit
audit_functions
Audit Functions
Audit tracked files, functions and types against the source. Read-only. Python files (full fidelity): missing_functions (public, untracked), stale_functions (tracked, gone from the source; a module-level `f = partial(...)`, lambda or alias binding of the name counts as defined), incomplete_functions (purpose/parameters/returns empty), malformed_json (not one JSON encoding of a list/object; double-encoded is fixable), reserved_functions (never finalized), param_mismatch (recorded parameters vs the signature: names, order, required vs default), missing_types, stale_types (name defined nowhere in the file), incomplete_types, missing_type_links (a tracked type named in a signature with no types_functions link, role suggested), files_without_functions (informational). Every file: missing_files (tracked, gone from disk), untracked_files. Regex languages only report names_only_missing (warning) and never claim anything stale. Tracking _private functions is optional: untracked ones are never reported, tracked ones get every check. Scope selectors combine as a union; with none, the whole project (tracked files plus untracked source files) is audited. Writes the full report to <project folder>/audit/ and returns counts + samples + report_path.
Parameterspathstask_idfile_idstask_typemodule_pathsince_commit
audit_interactions
Audit Interactions
Audit tracked interactions against the call graph the code makes, for the callers in scope. Read-only. Expected edges: calls AND functions used as values (map(fn, xs), partial, dispatch dicts built in the body), credited through untracked same-file helpers, resolved through imports, aliases and re-exports. Categories: missing_interactions (code makes it, DB lacks it), stale_interactions (provably gone: every use of the target's name in the caller resolves to something else — another function, a local or loop variable, a method on a value — or there is none), repoint_interactions (a stale edge that is the same dependency moved: call moved to another function in the same file, or target moved under the same name — one change, not delete+add), unconfirmed_interactions (may be real but unprovable, each with a reason: name resolves ambiguously, called through a record field or factory several functions are stored under, a callback parameter of the target's name, the name as a string in a lookup position (call argument such as getattr's, subscript key, list/tuple/set element; never a dict-literal key, comparison or assignment), a non-Python target: mark indirect or delete), indirect_interactions (is_indirect edges) and non_call_interactions (chain/compose/pipe/borrow types): informational, never flagged. Confirmed without being expected (never reported, never asked to be added): self-recursion, functions held in a module-level table the caller reads (dispatch), a .field() call when the target is the only tracked function stored under that field anywhere (Rec(field=target)), a non-Python function called as name( in the caller's string literals (SQL). Python callers only (full fidelity); other files listed in unchecked_files. Scope selectors combine as a union; with none, the whole project (tracked files plus untracked source files) is audited. Writes the full report to <project folder>/audit/ and returns counts + samples + report_path.
Parameterspathstask_idfile_idstask_typemodule_pathsince_commit
audit_tracking
Audit Tracking
Run EVERY tracking audit over one scope with one code index and one report: files, functions, types, parameters, JSON encoding, type links (audit_functions), interactions with repoints (audit_interactions), stale prose and dangling mentions (audit_descriptions), plus modularity gaps (structure_gaps). Read-only. The same audit gates task/subtask/sidequest completion (over the item's linked files), runs in aimfp_end over uncommitted work, runs per changed file in the watchdog, and runs in CI as `aimfp audit`. Scope selectors combine as a union; with none, the whole project (tracked files plus untracked source files) is audited. Writes the full report to <project folder>/audit/ and returns counts + samples + block/warn verdict + report_path.
Parametersfullpathsincludetask_idfile_idstask_typemodule_pathsample_limitsince_commit
backfill_semantic_keys
Backfill Semantic Keys
(For use with InterCommAIMFP) Mint stable identity keys for any rows that lack one: slugs on work-hierarchy rows (milestones, tasks, subtasks, sidequests, items) and entity_key on functions/types — e.g. rows that predate those columns. OPTIONAL one-time prep: run once on main (and commit) only when a pre-v1.11 project is about to start multi-agent parallel work, so every clone inherits stable baseline keys that export_state_changeset can match. Unnecessary for solo projects (keys never read) and for projects started fresh on v1.11+ (keys minted at creation — no-op). Idempotent.
Takes no parameters.
batch_update_progress
Batch Update Progress
Update multiple project items atomically. Used after code generation or bulk operations to ensure consistency.
Parametersupdatesrequiredtransactioncontinue_on_error
blueprint_has_changed
Blueprint Has Changed
Check if ProjectBlueprint.md has changed using Git or filesystem timestamp
Parametersblueprint_pathrequired
catalog_files
Catalog Files
Register existing files in project.db in a single phase. For code already on disk: rows are written finalized (is_reserved=0) with ID naming off, because existing filenames are fixed and cannot carry an _id_ suffix. Use INSTEAD OF reserve_files/finalize_files when adopting an existing codebase. Idempotent on path; re-cataloging keeps a stored name or language that is omitted.
Parametersfilesrequired
catalog_functions
Catalog Functions
Register existing functions in project.db in a single phase. Use INSTEAD OF reserve_functions/finalize_functions when adopting an existing codebase. Idempotent on (file_id, name), so a re-scan after source changes refreshes signatures instead of duplicating them. Only supplied fields are overwritten: an omitted or blank purpose, parameters or returns keeps the stored value, so a refresh never erases prose.
Parametersfunctionsrequired
catalog_types
Catalog Types
Register existing type definitions in project.db in a single phase. Use INSTEAD OF reserve_types/finalize_types when adopting an existing codebase. Idempotent on (file_id, name); definition is always refreshed, an omitted description keeps the stored one.
Parameterstypesrequired
check_directive_health
Check Directive Health
Assess every user directive and report which need attention. The health states, in the order they are checked: 'unapproved' (status is active but no person approved it, so dispatch withholds it); 'needs_reapproval' (approved, but the trigger, action or implementation file changed since, or it was approved before schema 1.5 without a content hash; dispatch and activation refuse it until the user approves again); 'error' (the directive's own status is error); 'overdue' (next_scheduled_time is in the past, meaning the runner said when it would next fire and did not); 'skipping' (consecutive_skip_count is at or above skip_threshold with no run since the last skip, meaning the runner is alive but keeps skipping occurrences, usually because the host is down at the scheduled time); 'degraded' (error rate at or above the threshold); 'never_run' (active but never executed; when dispatch errors exist, the detail says the runner is running but refusing or failing to dispatch, otherwise that the runner may not be deployed); or 'ok'. Returns a verdict per directive with a one-line explanation and the skip fields, plus a count per state, designed to render as a single sentence at session start.
Parametersproject_rootskip_thresholderror_rate_threshold
check_scheduled_backup_due
Check Scheduled Backup Due
Check whether a scheduled backup is overdue, measured from the LAST BACKUP. Distinct from the inactivity rule (backup_duration), which measures time since the last project change and therefore only ever fires on dormant projects — an actively developed project would otherwise never be backed up. Governed by backup_interval_days; 0 disables scheduling. Called automatically by aimfp_run(is_new_session=true); available standalone for hosts that want the check on demand.
Takes no parameters.
clear_watchdog
Clear Watchdog
Clear watchdog reminders after they have been reviewed and handled. Reminders persist in .aimfp-project/watchdog/reminders.json until this is called. Call after addressing all watchdog findings (file deletions, unregistered files, etc.).
Takes no parameters.
core_allowed_check_constraints
Core Allowed Check Constraints
Returns list of allowed values for CHECK constraint enum fields in aimfp_core.db. Parses schema to extract CHECK(field IN (...)) constraints.
Parametersfieldrequiredtablerequired
create_project
Create Project
Initialize project entry (one per database)
Parametersnamerequiredgoalsrequiredstatuspurposerequiredversionuser_directives_status
create_project_backup
Create Project Backup
Create a backup of .aimfp-project/ right now, ignoring any threshold. Zips everything except backups/ and watchdog/, adds a generated backup_summary.md, and rotates old archives per the backup_count setting, naming every archive it deletes (rotated, plus a warning sentence). The on-demand counterpart to the automatic inactivity check — call this when aimfp_run reports a scheduled backup due, or before any risky operation.
Takes no parameters.
create_state_database
Create State Database
Create per-project state database (.state/runtime.db) from SQL schema. FP-compliant replacement for mutable global variables.
Parameterssource_directoryrequired
create_user_branch
Create User Branch
Create work branch following aimfp-{user}-{number} convention
Parametersuserrequiredpurposerequired
deactivate_user_directive
Deactivate User Directive
Set directive status to 'paused'. Does NOT stop services - AI handles service shutdown via directive workflow.
Parametersdirective_idrequired
delete_completion_path
Delete Completion Path
Delete completion path with milestone validation
Parametersidrequirednote_typenote_reasonrequirednote_sourcerequirednote_severityrequired
delete_custom_return_statement
Delete Custom Return Statement
Delete custom return statement(s) for a helper function. By ID, by text, or all for a helper.
Parametersstatementhelper_namerequiredstatement_id
Delete file with comprehensive cross-reference validation
Parametersfile_idrequirednote_typenote_reasonrequirednote_sourcerequirednote_severityrequired
Delete flow with file validation
Parametersflow_idrequirednote_typenote_reasonrequirednote_sourcerequirednote_severityrequired
delete_function
Delete Function
Delete a function, deciding explicitly what happens to its interactions: refused (with the edges listed) unless repoint_to moves them to the function that took over its job, or confirm_cascade removes them. Every moved or removed edge is recorded in the deletion note so it can be undone. Type relationships must be unlinked first.
Parametersnote_typerepoint_tofunction_idrequirednote_reasonrequirednote_sourcerequirednote_severityrequiredconfirm_cascade
delete_interaction
Delete Interaction
Delete interaction
Parametersnote_typenote_reasonrequirednote_sourcerequirednote_severityrequiredinteraction_idrequired
Delete item with status validation
Parametersidrequirednote_typenote_reasonrequirednote_sourcerequirednote_severityrequired
delete_milestone
Delete Milestone
Delete milestone with task validation
Parametersidrequirednote_typenote_reasonrequirednote_sourcerequirednote_severityrequired
delete_module
Delete Module
Delete a module. CASCADE removes module_files junction entries. Files themselves are NOT deleted.
Parametersmodule_idrequired
Delete note (discouraged)
Parametersidrequired
delete_project_entry
Delete Project Entry
Smart delete with automatic routing to specialized functions when needed
Parametersidrequiredtablerequirednote_typerequirednote_reasonrequirednote_sourcerequirednote_severityrequired
delete_reserved
Delete Reserved
Delete abandoned reserved entries (escape hatch for cancelled reserve operations)
Parametersidrequiredtablerequirednote_typenote_reasonrequirednote_sourcerequirednote_severityrequired
delete_settings_entry
Delete Settings Entry
Delete entry from user_preferences.db table
Parameterstablerequiredrecord_idrequired
delete_sidequest
Delete Sidequest
Delete sidequest with item validation (same logic as delete_task)
Parametersidrequirednote_typenote_reasonrequirednote_sourcerequirednote_severityrequired
delete_subtask
Delete Subtask
Delete subtask with item validation (same logic as delete_task)
Parametersidrequirednote_typenote_reasonrequirednote_sourcerequirednote_severityrequired
Delete task with item validation
Parametersidrequirednote_typenote_reasonrequirednote_sourcerequirednote_severityrequired
Delete theme with flow validation
Parameterstheme_idrequirednote_typenote_reasonrequirednote_sourcerequirednote_severityrequired
Delete type with relationship validation
Parameterstype_idrequirednote_typenote_reasonrequirednote_sourcerequirednote_severityrequired
delete_type_function
Delete Type Function
Remove type-function relationship
Parametersidrequirednote_typenote_reasonrequirednote_sourcerequirednote_severityrequired
delete_user_custom_entry
Delete User Custom Entry
Delete entry from user_directives.db table, writing an entry_deletion note in the same transaction
Parameterstablerequiredrecord_idrequirednote_reasonnote_source
detect_conflicts_before_merge
Detect Conflicts Before Merge
Dry-run merge analysis - retrieves potential conflict data for AI to evaluate
Parameterssource_branchrequired
detect_external_changes
Detect External Changes
Compare current Git HEAD with project.last_known_git_hash
Takes no parameters.
detect_state_conflicts
Detect State Conflicts
(For use with InterCommAIMFP) OPTIONAL pre-apply planning aid: export each pending worker branch and report where two or more branches touch the SAME semantic entity or edge, so the master can re-partition or deliberately order integration BEFORE applying any changeset. Pure read (built entirely from export_state_changeset). An overlap is a heuristic warning, not a verdict — the authoritative 3-way resolution still happens in apply_state_changeset.
Parametersbranchesrequired
execute_merge
Execute Merge
Execute git merge and return result. Updates work_branches table on success.
Parameterssource_branchrequired
export_state_changeset
Export State Changeset
(For use with InterCommAIMFP) Export a semantic changeset of project.db between two committed git states (branch point -> branch tip), expressed entirely in stable semantic keys (file path, file+function/type name, module/theme/flow/path name, and work-hierarchy slugs) with branch-local integer PKs stripped. Each entity is classified add/modify/delete and each edge add/remove. This is the integer-free artifact the master applies to merge a worker's project-state into main without binary-blob conflicts or PK collisions. The changeset is ALSO persisted server-side under .aimfp-project/changesets/ and a small changeset_id handle + counts summary are returned, so the master can drive apply by handle instead of re-transcribing the full object. Pure read of git blobs (the export itself never mutates project.db); persistence writes only a JSON file under .aimfp-project/.
Parametersbranchrequiredworker_idbase_commitrequired
file_has_changed
File Has Changed
Check if file changed using Git (if available) or filesystem timestamp
Parametersfile_idrequired
finalize_file
Finalize File
Mark a reserved file as tracked after writing it to disk. The path must be a regular file relative to the project root: '.', a directory, or a path leaving the project is refused. Triggers flow assignment and function/type tracking checks.
Parametersnamerequiredpathrequiredfile_idrequiredlanguagerequiredskip_id_naming
finalize_files
Finalize Files
Batch-finalize multiple reserved files after writing them to disk. All-or-nothing operation. Each path must be a regular file relative to the project root ('.' or a directory is refused).
Parametersfilesrequired
finalize_function
Finalize Function
Mark a reserved function as tracked after writing it. Triggers interaction and type-function relationship checks.
Parametersnamerequiredfile_idrequiredpurposereturnsparametersfunction_idrequiredskip_id_naming
finalize_functions
Finalize Functions
Batch-finalize multiple reserved functions after writing them. Triggers interaction and type-function checks for all.
Parametersfunctionsrequired
finalize_type
Finalize Type
Finalize reserved type after creation
Parametersnamerequiredlinksfile_idtype_idrequireddescriptionskip_id_namingdefinition_jsonrequired
finalize_types
Finalize Types
Finalize multiple reserved types
Parameterstypesrequired
find_directive_by_intent
Find Directive By Intent
Match a natural-language user request to the most relevant directive(s). Use when the user describes what they want and you need to find which directive handles it.
Parametersthresholduser_requestrequired
find_directives_by_intent_keyword
Find Directives By Intent Keyword
Find directive IDs matching one or more intent keywords (direct keyword lookup)
Parameterskeywordsrequiredmatch_mode
get_active_user_directives
Get Active User Directives
Get all user directives with status='active'. Convenience query for checking active directive count.
Takes no parameters.
get_all_completion_paths
Get All Completion Paths
Get the project's ordered completion roadmap (stages from setup through completion). Each path contains milestones which contain tasks.
Takes no parameters.
get_all_directive_keywords
Get All Directive Keywords
Get list of all unique intent keywords available for searching (simple list)
Takes no parameters.
get_all_directive_names
Get All Directive Names
Get list of all directive names (or filtered by types). Returns names only, NOT full directive data. AI queries by name when needs details.
Parameterstypes
get_all_directives
Get All Directives
Load all directives for caching (special orchestrator)
Takes no parameters.
get_all_flows
Get All Flows
Get project flows (architectural groupings describing intended behavior): all of them, or the ones in flow_ids. Lean by default (descriptions null); detail_level='full' for descriptions. Check BEFORE starting any task to understand the architecture.
Parametersflow_idsdetail_level
get_all_infrastructure
Get All Infrastructure
Get all infrastructure entries including standard fields (even if empty). Returns complete infrastructure table for session bundling and status reports.
Takes no parameters.
get_all_intent_keywords_with_counts
Get All Intent Keywords With Counts
Get all unique intent keywords with usage counts for analytics
Takes no parameters.
get_all_modules
Get All Modules
Get all modules in the project. Returns list of all module records sorted by name.
Takes no parameters.
get_all_themes
Get All Themes
Get all project themes (high-level architectural areas). Use to orient on project structure before starting work.
Takes no parameters.
get_categories
Get Categories
Get all directive categories
Takes no parameters.
get_category_by_name
Get Category By Name
Get category by name (fairly frequent)
Parameterscategory_namerequired
get_claude_permissions
Get Claude Permissions
Returns the Claude Code allowlist (.claude/settings.local.json contents) that pre-approves every AIMFP MCP tool, so the user is not prompted once per tool on first use. Allowlist is derived live from the tool registry so it can never drift. Does NOT write any file — returns ready-to-write JSON + target path; the AI writes/merges it, keeping AIMFP's 'never write outside .aimfp-project/' guarantee intact. Call when the user asks to set up AIMFP permissions or skip approval prompts.
Parametersexisting_settings
get_completion_loop_target
Get Completion Loop Target
Get where to loop back after completing directive
Parametersfrom_directiverequired
get_completion_paths_by_status
Get Completion Paths By Status
Get completion paths filtered by status
Parametersstatusrequired
get_core_fields
Get Core Fields
Get field names and types for a specific table
Parameterstablerequired
get_core_schema
Get Core Schema
Get complete schema for core database (all tables and fields)
Takes no parameters.
get_core_tables
Get Core Tables
List all tables in core database
Takes no parameters.
get_current_branch
Get Current Branch
Get current Git branch name
Takes no parameters.
get_current_commit_hash
Get Current Commit Hash
Get current Git HEAD commit hash
Takes no parameters.
get_current_progress
Get Current Progress
Single entry point for scoped project status queries. Replaces 5-10 separate helper calls with one flexible query.
Parametersscopefiltersdetail_level
get_databases
Get Databases
Get list of all available databases with metadata
Takes no parameters.
get_directive_by_name
Get Directive By Name
Load a directive's workflow steps, preferences, and linked notes by name. ALWAYS call BEFORE executing any workflow — directives are the authoritative source, not memory.
Parametersproject_rootdirective_namerequired
get_directive_content
Get Directive Content
Read and return the full MD documentation file for a directive. Resolves the md_file_path from aimfp_core.db to an absolute path within the installed package, reads the file, and returns content + absolute path + token estimate.
Parametersdirective_namerequired
get_directive_execution_stats
Get Directive Execution Stats
Read execution statistics from directive_executions joined to directive names and statuses, for one user directive or all of them. Includes a derived error_rate per row. This is how the AI sees what the user's automation did while no session was open — executions, successes, errors, average and maximum duration, and the last recorded error. On a database at schema 1.3 or later, each row also carries skip_count, consecutive_skip_count, last_skip_time, last_skip_reason, condition_latched and last_condition_eval_time.
Parametersdirective_idproject_root
get_directive_flows
Get Directive Flows
General-purpose query for directive flows by category, type, or directive names. Complements the navigation helpers (get_flows_from_directive, get_flows_to_directive, get_wildcard_flows), which answer where a specific directive routes.
Parametersflow_typeto_directiveflow_categoryfrom_directive
get_directive_keywords
Get Directive Keywords
Get all intent keywords for a specific directive
Parametersdirective_idrequired
get_directives_by_category
Get Directives By Category
Get all directives in a category
Parameterscategory_namerequired
get_directives_by_type
Get Directives By Type
Get all directives filtered by type (orchestration vs reference)
Parameterstyperequiredinclude_md_content
get_directives_for_helper
Get Directives For Helper
Get all directives that use a helper (reciprocal lookup)
Parametershelper_namerequired
get_directives_with_intent_keywords
Get Directives With Intent Keywords
Search directives by intent keywords and return full directive objects
Parameterskeywordsrequiredmatch_modeinclude_keyword_matches
get_file_by_name
Get File By Name
Look up a tracked file by name — use BEFORE reading source files. Returns metadata, path, and ID for follow-up queries.
Parametersfile_namerequired
get_file_by_path
Get File By Path
Look up a tracked file by path — use BEFORE reading source files. Returns file metadata and ID for follow-up queries.
Parametersfile_pathrequired
get_file_ids_from_flows
Get File Ids From Flows
Get all file IDs associated with flows
Parametersflow_idsrequired
get_files_by_flow
Get Files By Flow
Get all files for a flow
Parametersflow_idrequired
get_files_by_flow_context
Get Files By Flow Context
Get all files for a flow with functions embedded in each file dict.
Parametersflow_idrequired
get_flow_by_name
Get Flow By Name
Get flow by name (fairly frequent)
Parametersflow_namerequired
get_flows_for_file
Get Flows For File
Get all flows for a file
Parametersfile_idrequired
get_flows_for_milestone
Get Flows For Milestone
Get the flows a milestone builds or changes (id, name, description). Use for task flow_ids and before starting milestone work.
Parametersmilestone_idrequired
get_flows_for_theme
Get Flows For Theme
Get all flows for a theme
Parameterstheme_idrequired
get_flows_from_directive
Get Flows From Directive
Get all flows originating from a directive (what comes next?). Returns raw flow data - AI evaluates conditions.
Parametersfrom_directiverequired
get_flows_to_directive
Get Flows To Directive
Get all directive flows leading to a directive (what leads here?). Useful for understanding directive prerequisites.
Parametersto_directiverequired
get_fp_directive_index
Get Fp Directive Index
Get lightweight FP directive index grouped by category (names only, not full definitions)
Takes no parameters.
get_from_core
Get From Core
Get records by ID(s), or all records if empty array
Parameterstablerequiredid_arrayrequired
get_from_core_where
Get From Core Where
Flexible filtering with structured JSON conditions
Parameterslimittablerequiredorderbyconditionsrequired
get_from_project
Get From Project
Get records by ID(s) - **EMPTY ARRAY NOT ALLOWED**
Parameterstablerequiredid_arrayrequired
get_from_project_where
Get From Project Where
Flexible filtering with structured JSON conditions
Parameterslimittablerequiredorderbyconditionsrequired
get_from_settings
Get From Settings
Get records by ID(s) - **EMPTY ARRAY NOT ALLOWED**
Parameterstablerequiredid_arrayrequired
get_from_settings_where
Get From Settings Where
Flexible filtering with structured JSON conditions
Parameterstablerequiredconditionsrequired
get_from_user_custom
Get From User Custom
Get records by ID(s) from user_directives.db - **EMPTY ARRAY NOT ALLOWED**
Parameterstablerequiredid_arrayrequired
get_from_user_custom_where
Get From User Custom Where
Flexible filtering with structured JSON conditions on user_directives.db tables
Parameterstablerequiredconditionsrequired
get_function_by_name
Get Function By Name
Look up a tracked function by name with file location — use BEFORE reading source files. Returns purpose, parameters, returns, and file path.
Parametersfile_idfile_pathdetails_onlyfunction_namerequiredinclude_details
get_functions_by_file
Get Functions By File
Get all tracked function signatures for a file — use BEFORE reading source code. Often provides everything needed without opening the file.
Parametersfile_idrequireddetails_onlyinclude_details
get_git_status
Get Git Status
Get comprehensive Git state snapshot (orchestrator)
Takes no parameters.
get_helper_by_name
Get Helper By Name
Get specific helper function details (high-frequency)
Parametershelper_namerequired
get_helpers_are_sub
Get Helpers Are Sub
Get all sub-helpers (is_sub_helper=true)
Takes no parameters.
get_helpers_are_tool
Get Helpers Are Tool
Get all MCP tools (is_tool=true)
Takes no parameters.
get_helpers_by_database
Get Helpers By Database
Get all helpers for a specific database
Parameterstarget_databaserequired
get_helpers_for_directive
Get Helpers For Directive
Get the list of MCP tools available for a directive workflow. Use to discover which tools to call when executing a directive's steps.
Parametersdirective_namerequiredinclude_helpers_data
Get AIMFP's library surface for code running OUTSIDE AIMFP (src/aimfp/hooks/). Hooks are NOT MCP tools and you cannot call them — they are imported by code that is not AIMFP, such as a generated Use Case 2 automation runner firing from cron or systemd with no AI session open. Your relationship to a hook is that you WRITE CODE CALLING IT during user_directive_implement. Queries is_hook=1 affirmatively; it replaced get_helpers_not_tool_not_sub, which described hooks as the absence of two other flags and so returned an empty list silently for as long as nothing populated that gap.
Takes no parameters.
get_incomplete_completion_paths
Get Incomplete Completion Paths
Get all non-completed paths
Takes no parameters.
get_incomplete_items
Get Incomplete Items
Get incomplete items for any parent type
Parametersfor_idrequiredfor_tablerequired
get_incomplete_milestones
Get Incomplete Milestones
Get all non-completed milestones
Parametersdetail_levelinclude_task_counts
get_incomplete_sidequests
Get Incomplete Sidequests
Get all non-completed sidequests
Takes no parameters.
get_incomplete_subtasks
Get Incomplete Subtasks
Get all non-completed subtasks
Takes no parameters.
get_incomplete_subtasks_by_task
Get Incomplete Subtasks By Task
Get incomplete subtasks for specific task
Parameterstask_idrequired
get_incomplete_tasks
Get Incomplete Tasks
Get all unfinished tasks (pending, in_progress, blocked) as flat task rows. Does NOT include subtasks, sidequests or items: use get_open_work for the whole open tree (tasks with their open items and subtasks, plus sidequests) in one call.
Parametersdetail_level
get_incomplete_tasks_by_milestone
Get Incomplete Tasks By Milestone
Get open tasks for a milestone with related subtasks/sidequests
Parametersmilestone_idrequiredskip_pending
get_infrastructure_by_type
Get Infrastructure By Type
Get all infrastructure of specific type
Parameterstyperequired
get_interactions_by_file
Get Interactions By File
Get all interactions involving functions in a file or a set of files (file_ids), each with source and target function names and file paths — one call for a feature's whole dependency picture.
Parametersfile_idfile_ids
get_interactions_by_function
Get Interactions By Function
Get all interactions for a function (both as source and target) — trace dependency graphs
Parametersfile_pathfunction_idfunction_name
get_items_for_sidequest
Get Items For Sidequest
Get items for sidequest
Parametersstatussidequest_idrequired
get_items_for_subtask
Get Items For Subtask
Get items for subtask
Parametersstatussubtask_idrequired
get_items_for_task
Get Items For Task
Get items for task, optionally filtered by status
Parametersstatustask_idrequired
get_merge_history
Get Merge History
(For use with InterCommAIMFP) Read tool over the existing merge_history and work_branches tables: which branches were integrated, when, with how many conflicts, by whom. Lets the master answer 'has this branch already been applied?' (idempotency / resume after interruption) and gives a human an audit trail. Pure read; small surface over data merge_worker_branch records.
Parameterssincebranch
get_milestones_by_path
Get Milestones By Path
Get all milestones for a completion path
Parametersdetail_levelcompletion_path_idrequiredinclude_task_counts
get_milestones_by_status
Get Milestones By Status
Get milestones filtered by status
Parametersstatusrequireddetail_levelinclude_task_counts
get_module_by_name
Get Module By Name
Get module by name. Returns module record with path, purpose, and external_dependencies.
Parametersnamerequired
get_module_by_path
Get Module By Path
Get module by directory path.
Parameterspathrequired
get_module_dependencies
Get Module Dependencies
Get cross-module dependencies. Finds interactions where a function in this module calls a function in a different module via module_files junction. Returns aggregated counts per target module.
Parametersmodule_idrequired
get_module_files
Get Module Files
Get all files assigned to a module via module_files junction table.
Parametersmodule_idrequired
get_module_for_file
Get Module For File
Find which module a file belongs to. Reverse lookup via module_files junction table.
Parametersfile_idrequired
get_module_functions
Get Module Functions
Get all functions in module files. Joins through module_files junction to files to functions.
Parametersmodule_idrequired
get_module_types
Get Module Types
Get all types in module files. Joins through module_files junction to files to types.
Parametersmodule_idrequired
get_next_completion_path
Get Next Completion Path
Get lowest order_index with status != completed
Takes no parameters.
get_notes_comprehensive
Get Notes Comprehensive
Query notes with structured filters (id, type, reference, source, severity, directive). Use note_id to read one note in full, e.g. after search_notes returned a preview.
Parameterslimitsourcenote_idseveritynote_typereference_idpreview_charsdirective_namereference_tableexclude_note_types
get_open_work
Get Open Work
Every open task (pending, in_progress, blocked) with its open items and open subtasks (each with open items), plus open sidequests with their open items, in one read-only call. Ordered in_progress first, then by priority. Replaces get_incomplete_tasks followed by one get_items_for_task per task.
Parametersmilestone_idinclude_descriptions
get_pending_notices
Get Pending Notices
Get one-time release notices this project has not yet been shown. Returns ONLY unacknowledged notices, already filtered for applicability — a notice pinned to a schema version stays hidden until that database has actually reached it. An empty result is the normal steady state. Called automatically by aimfp_run(is_new_session=true), which puts the result in data.notices and omits the key entirely when nothing is pending, so you never need to call this yourself in a normal session.
Takes no parameters.
Get project metadata (single entry)
Takes no parameters.
get_project_fields
Get Project Fields
Get field names and types for a specific table
Parameterstablerequired
get_project_json_parameters
Get Project Json Parameters
Get available fields for table to use with generic add/update operations
Parameterstablerequired
get_project_root
Get Project Root
Get project root directory from infrastructure table
Takes no parameters.
get_project_schema
Get Project Schema
Get complete schema for project database
Takes no parameters.
get_project_tables
Get Project Tables
List all tables in project database
Takes no parameters.
get_recent_directive_errors
Get Recent Directive Errors
Tail the JSON-lines directive error log, newest first, optionally filtered to one directive. Each record carries directive_id, error_type, message, timestamp, and a full traceback when the failure came from a handler exception. The database keeps only the last error per directive (store_last_error_only defaults to 1), so this file is the only place error history survives.
Parameterslimitdirective_idproject_root
get_settings_fields
Get Settings Fields
Get field names and types for a specific table
Parameterstablerequired
get_settings_json_parameters
Get Settings Json Parameters
Get available fields for table to use with generic add/update operations
Parameterstablerequired
get_settings_schema
Get Settings Schema
Get complete schema for user settings database
Takes no parameters.
get_settings_tables
Get Settings Tables
List all tables in user settings database
Takes no parameters.
get_sidequest_files
Get Sidequest Files
Get the files worked on for a sidequest (task_files junction). Files are linked automatically when reserved, finalized, cataloged, or updated (and when their functions/types are finalized, cataloged, or updated) while a work item is in_progress — the most recent in_progress sidequest, else subtask, else task.
Parameterssidequest_idrequired
get_sidequest_flows
Get Sidequest Flows
Get flow IDs for a sidequest
Parameterssidequest_idrequired
get_sidequests_comprehensive
Get Sidequests Comprehensive
Advanced sidequest search
Parameterslimitstatustask_idprioritysubtask_iddate_range_createddate_range_updated
get_source_directory
Get Source Directory
Get project source directory from infrastructure table
Takes no parameters.
get_state_operations_template
Get State Operations Template
Return the Python state_operations.py template content for AI to adapt to the project's language. Use this to retrieve the CRUD helper template for .state/runtime.db.
Takes no parameters.
get_structure_health
Get Structure Health
Report the project's modularity layer and every gap in it: themes -> flows -> files, open paths -> themes, open milestones -> flows, module membership. Gaps: flows without theme, themes without flows, files without flow (and no no_flow_reason), files under a module path but in no module, open paths without themes, open milestones without flows, oversized flow descriptions (split candidates). The same report appears in aimfp_status, aimfp_end and watchdog reminders.
Parametersinclude_summary
get_subtasks_by_task
Get Subtasks By Task
Get subtasks for task, optionally filtered by status
Parametersstatustask_idrequired
get_subtasks_comprehensive
Get Subtasks Comprehensive
Advanced subtask search
Parameterslimitstatustask_idprioritydate_range_createddate_range_updated
get_supportive_context
Get Supportive Context
Returns supportive context reference documents by variant. All variants auto-provided: core + coding by aimfp_run(is_new_session=true) for initialized projects, case2 by aimfp_run when Case 2 active, init by aimfp_init(). Also callable on demand to reload stale context.
Parametersvariant
get_system_prompt
Get System Prompt
Returns the AIMFP system prompt (AIMFP's record-keeping backbone) plus where and how to place it. The user's FIRST move — especially for plugin installs where nothing was downloaded — is to ask the AI to add the AIMFP system prompt; the AI calls this and writes the file. Does NOT write anything: returns the prompt text + target path + placement policy; the AI does the write, keeping AIMFP's 'never write outside .aimfp-project/' guarantee. AIMFP content is always placed FIRST; if the existing instructions file is extensive the AI must review/consolidate with the user instead of blindly prepending.
Parametersexisting_content
get_task_context
Get Task Context
Get complete context for resuming work on a specific task/subtask/sidequest. Single call retrieves item + associated items + linked files + their functions and modules + flows + optionally interactions and notes. Files are linked automatically when reserved, finalized, cataloged, or updated (and when their functions/types are finalized, cataloged, or updated) while a work item is in_progress — the most recent in_progress sidequest, else subtask, else task. A task's context includes its subtasks' files. Uses cached project root internally.
Parameterstask_idrequiredtask_typedetail_levelinclude_historyinclude_interactions
get_task_files
Get Task Files
Get the files worked on for a task, including files linked to its subtasks (task_files junction). Files are linked automatically when reserved, finalized, cataloged, or updated (and when their functions/types are finalized, cataloged, or updated) while a work item is in_progress — the most recent in_progress sidequest, else subtask, else task.
Parameterstask_idrequired