CHRONOS-AGENT

v1.8.1
io.github.ptai-eng/chronos-agent Checked 6 hours ago Published 12 days ago

5D living code graph, AST symbol editing, refactoring & blast-radius gate in 1 Rust binary

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

chronos_analyze_file

Parse a source file (.ts, .tsx, .js, .py, .rs, .go, .c, .cpp, .java) with CHRONOS's polyglot AST engine and insert all symbols, call edges, cross-language HTTP routes, test edges, and loop/complexity metrics into the 5D Code Graph.

ParameterTypeDescription
file_path *stringAbsolute or workspace-relative path to the source file to analyze
max_answer_charsintegerOptional maximum character budget for the response (default: 24000; <= 0 disables truncation)

chronos_query_hotspots

Query the 5D Code Graph for the top N performance bottlenecks and hot-path functions (using live telemetry or PageRank + O(N^2) loop fallback).

ParameterTypeDescription
filterstringFilter type (default: all)
max_answer_charsintegerOptional maximum character budget for the response (default: 24000; <= 0 disables truncation)
top_nintegerNumber of hotspots to return (default: 10)

chronos_blast_radius

Analyze the blast-radius (change impact) of modifying a specific function or symbol. Returns a risk zone (SAFE/MEDIUM/HIGH/CRITICAL), PageRank centrality, Git temporal co-change partners, confidence interval, coverage completeness, and residual unknowns.

ParameterTypeDescription
symbol_name *stringThe function/class/name_path symbol to analyze (e.g. 'getUser', 'OrderService/create')
contract_breakingbooleanSet true if this change modifies the public API signature
detailstringOutput verbosity: 'summary' (compact 30s glance) or 'complete' (writes full HTML dashboard)
file_pathstringFile containing the symbol (helps disambiguate same-name symbols)
max_answer_charsintegerOptional maximum character budget for the response (default: 24000; <= 0 disables truncation)

chronos_mutation_gate

Run targeted mutation testing on a specific file using CHRONOS's Mutation Arena. Generates mutants, selects covering tests via the 5D Code Graph, runs them in parallel sandboxes, and returns the mutation score.

ParameterTypeDescription
file_path *stringPath to the source file to mutation-test
max_answer_charsintegerOptional maximum character budget for the response (default: 24000; <= 0 disables truncation)
strictbooleanUse 90% threshold (release gate). Default false = 80% dev gate.
test_commandstringTest runner command (default: 'npx jest --passWithNoTests')

chronos_contract_status

Drain the Semantic Contract Broker's Pre-Tool Execution Gate. Returns any pending contract violation alerts detected since the last call.

ParameterTypeDescription
max_answer_charsintegerOptional maximum character budget for the response (default: 24000; <= 0 disables truncation)
watch_dirstringDirectory to index for contract changes (optional)

chronos_query_graph

Execute a Read-Only Cypher query directly against the embedded KuzuDB 5D Code Graph. Every ChronosNode has properties: id, name, qualified_name, kind, file, start_line, end_line, start_byte, end_byte, cognitive_load, cyclomatic, fan_in, fan_out, param_count, sloc, loop_count, loop_depth, transitive_loop_depth, linear_scan_in_loop, alloc_in_loop, is_recursive, is_hydrated, exec_time_p50, exec_time_p99, invocation_count, cpu_percent, is_hot_path, is_bottleneck. Relationship tables: CALLS, CONTAINS, TESTS, IMPORTS, CO_CHANGES_WITH.

ParameterTypeDescription
query *stringRead-only Cypher query (e.g. 'MATCH (f:ChronosNode) WHERE f.transitive_loop_depth >= 2 RETURN f.name, f.file, f.transitive_loop_depth')
max_answer_charsintegerOptional maximum character budget for the response (default: 24000; <= 0 disables truncation)
max_rowsintegerMaximum rows to return (default: 500, ceiling: 100000)

chronos_search_graph

Search the 5D Code Graph using BM25 ranked identifier tokenization (splits camelCase/snake_case), regex pattern matching, degree filtering, and nested-loop complexity filtering.

ParameterTypeDescription
file_patternstringSubstring or regex filter on file path
kindstringFilter by node kind: Function | Class | ApiRoute | TestCase
limitintegerMaximum results to return (default: 50)
max_answer_charsintegerOptional maximum character budget for the response (default: 24000; <= 0 disables truncation)
min_degreeintegerMinimum total degree (fan_in + fan_out)
min_loop_depthintegerMinimum interprocedural nested loop depth (transitive_loop_depth)
name_patternstringRegex pattern to match symbol name or qualified_name
offsetintegerPagination offset (default: 0)
querystringNatural-language or keyword query ranked by BM25 + structural boost + PageRank

chronos_get_snippet

Read the verbatim source code (start_line..=end_line) of a function/class from disk along with its callers, callees, covering tests, PageRank, and AST complexity metrics.

ParameterTypeDescription
symbol_name *stringFunction, method, class name, or 'Class/method' name_path to retrieve
file_pathstringOptional file path filter to disambiguate same-name symbols
max_answer_charsintegerOptional maximum character budget for the response (default: 24000; <= 0 disables truncation)

chronos_get_architecture

Get a high-level architecture overview: community clusters (Label Propagation + Cohesion score), language breakdown, entry points, top PageRank hubs, and hidden O(N^2) algorithmic hotspots.

ParameterTypeDescription
auto_indexbooleanAutomatically scan and incrementally index workspace files (default: true)
max_answer_charsintegerOptional maximum character budget for the response (default: 24000; <= 0 disables truncation)
pathstringOptional directory prefix to scope architecture analysis

chronos_hydrate_telemetry

Hydrate the 4th Dimension (runtime telemetry) of the ChronosGraph from an offline profiler artifact (V8 .cpuprofile JSON, Speedscope/py-spy JSON, Folded Stack Flamegraph text, or OpenTelemetry OTLP trace JSON).

ParameterTypeDescription
max_answer_charsintegerOptional maximum character budget for the response (default: 24000; <= 0 disables truncation)
profile_contentstringOptional inline profile content string (alternative to profile_path)
profile_pathstringPath to the offline profile file (.cpuprofile, .speedscope.json, .folded, .otlp.json)

chronos_generate_agents_md

Synthesize live, data-driven context rules, skills, and MCP configs from the 5D Code Graph (AGENTS.md, CLAUDE.md, GEMINI.md, .agents/skills/chronos-agent/SKILL.md, .cursor/rules/chronos-5d.mdc) for OpenAI Codex CLI, Google Antigravity, Claude Code, OpenCode, Cursor, Windsurf, Copilot, and Cline.

ParameterTypeDescription
auto_indexbooleanAutomatically scan and incrementally index workspace files first (default: true)
max_answer_charsintegerOptional maximum character budget for the response (default: 24000; <= 0 disables truncation)
output_pathstringOptional relative workspace path override when writing a single context file
project_namestringOptional project title override for the synthesized header
scaffold_configsbooleanIf true (with write_to_disk=true), also scaffolds native MCP configs, skills, and slash commands for the target client
targetstringTarget AI CLI/IDE ecosystem: codex | antigravity | claude | opencode | cursor | windsurf | copilot | cline | all (default: 'codex')
with_hooksbooleanIf true (with write_to_disk=true), also scaffolds <20ms lifecycle hook configs (.agents/hooks.json, .claude/settings.json)
write_to_diskbooleanIf true, writes the synthesized file(s) directly into the workspace (default: false)

chronos_explore

1-Call Subagent Context Engine (<15ms). Answers code exploration questions in a single call by returning the top BM25/regex matching symbols, wildcard Class/* outlines, signature-only views (include_body=false), inline blast-radius, read-only Rhai 5D scripts, caller/callee chains, verification surfaces, and 4-angle review diagnostics.

ParameterTypeDescription
auto_indexbooleanAutomatically scan and incrementally index workspace on cold start (default: true)
depthintegerClass/module outline expansion depth (default: 1; >1 expands child methods for matched classes)
file_filterstringOptional file path substring or regex filter
include_blast_radiusbooleanWhen true, attaches compact inline RiskZone + caller counts per explored symbol (default: false)
include_bodybooleanWhen false, returns only signature + line/byte spans without full source body to save tokens (default: true)
max_answer_charsintegerOptional maximum character budget for the response (default: 24000; <= 0 disables truncation)
max_symbolsintegerMaximum number of symbol bundles to return (default: 3, ceiling: 20)
queriesarrayOptional batch list of symbol names or 'Class/*' paths to explore in a single round-trip
querystringNatural-language question, symbol name, 'Class/method' or 'Class/*' wildcard name_path, or regex pattern to explore
scriptstringOptional bounded ReadOnly Rhai 5D graph query script (no write functions available in MCP profile)

chronos_edit_symbol

Perform surgical AST-bounded edits (replace_body, insert_before, insert_after) against a fresh disk parse with leading trivia deduplication, indentation/CRLF/BOM preservation, and a 2-stage Tree-sitter syntax + contract blast-radius gate (blocked_requires_force on breaking signature changes with callers unless force=true).

ParameterTypeDescription
file *stringRelative or absolute path within workspace to the target source file
new_code *stringReplacement or inserted code block (indentation and CRLF/LF + BOM are auto-preserved)
operation *stringEdit operation: replace_body | insert_before | insert_after
symbol *stringTarget symbol name or 'Class/method' path to edit (resolved via fresh disk AST parse)
dry_runbooleanValidate syntax and contract impact without modifying disk (default: false)
forcebooleanOverride Stage 2 contract blast-radius block when changing a signature with callers (default: false)
max_answer_charsintegerOptional maximum character budget for the response (default: 24000; <= 0 disables truncation)

chronos_refactor_symbol

Perform graph-edge-verified multi-file refactoring (preview_usages, rename, safe_delete). Separates verified CALLS/TESTS/import edits from ambiguous member-access/shadowed candidate sites, enforces multi-file syntax validation + atomic rollback, and guards public/entrypoint/interface-impl deletions.

ParameterTypeDescription
action *stringRefactoring action: preview_usages | rename | safe_delete
symbol *stringTarget symbol name or 'Class/method' path to analyze, rename, or safely delete
dry_runbooleanPreview multi-file diff and candidate sites without writing disk (default: false)
filestringOptional defining source file path for symbol disambiguation
forcebooleanOverride ambiguity/homonym or dependent guards when applying rename/safe_delete (default: false)
max_answer_charsintegerOptional maximum character budget for the response (default: 24000; <= 0 disables truncation)
new_namestringNew identifier name (required when action == 'rename')
use_lspbooleanOpt-in hybrid compiler LSP reference resolution to disambiguate candidate_sites; falls back cleanly to AST if unavailable (default: false)