AQIT 0.1.0
Loading...
Searching...
No Matches
aquin.command_log Namespace Reference

Functions

str _now_iso ()
None _ensure_dir ()
list[dict[str, Any]] _load_index ()
None _save_index (list[dict[str, Any]] rows)
str category_for_tool (str tool_name)
str cli_name_for_tool (str tool_name)
str _build_summary (*, str command, str tool_name, str|None model_id, Any result, dict[str, Any]|None card)
str append_record (*, str tool_name, str|None command=None, dict[str, Any]|None args=None, Any result=None, dict[str, Any]|None card=None, str|None model_id=None, int|None duration_ms=None, bool exit_ok=True)
dict[str, Any]|None load_record (str record_id)
datetime|None _parse_since (str value)
list[dict[str, Any]] list_records (*, int|None last=None, str|None since=None, str|None category=None, str|None model_id=None, str|None command=None)
int clear_records (*, str|None before=None)

Variables

str _COMMANDS_DIR = Path.home() / ".aquin" / "commands"
str _INDEX_PATH = _COMMANDS_DIR / "index.json"
dict _CATEGORY_BY_TOOL
dict _TOOL_TO_CLI

Function Documentation

◆ _build_summary()

str _build_summary ( * ,
str command,
str tool_name,
str | None model_id,
Any result,
dict[str, Any] | None card )
protected

Definition at line 100 of file command_log.py.

Referenced by append_record().

◆ _ensure_dir()

None _ensure_dir ( )
protected

Definition at line 72 of file command_log.py.

Referenced by _load_index(), _save_index(), and append_record().

◆ _load_index()

list[dict[str, Any]] _load_index ( )
protected

Definition at line 76 of file command_log.py.

References _ensure_dir().

Referenced by append_record(), clear_records(), and list_records().

◆ _now_iso()

str _now_iso ( )
protected

Definition at line 68 of file command_log.py.

Referenced by append_record().

◆ _parse_since()

datetime | None _parse_since ( str value)
protected

Definition at line 203 of file command_log.py.

Referenced by clear_records(), and list_records().

◆ _save_index()

None _save_index ( list[dict[str, Any]] rows)
protected

Definition at line 87 of file command_log.py.

References _ensure_dir().

Referenced by append_record(), and clear_records().

◆ append_record()

str append_record ( * ,
str tool_name,
str | None command = None,
dict[str, Any] | None args = None,
Any result = None,
dict[str, Any] | None card = None,
str | None model_id = None,
int | None duration_ms = None,
bool exit_ok = True )
Persist a command run locally. Returns record id.

Definition at line 130 of file command_log.py.

References _build_summary(), _ensure_dir(), _load_index(), _now_iso(), _save_index(), category_for_tool(), and cli_name_for_tool().

◆ category_for_tool()

str category_for_tool ( str tool_name)

Definition at line 92 of file command_log.py.

Referenced by append_record().

◆ clear_records()

int clear_records ( * ,
str | None before = None )

Definition at line 249 of file command_log.py.

References _load_index(), _parse_since(), and _save_index().

◆ cli_name_for_tool()

str cli_name_for_tool ( str tool_name)

Definition at line 96 of file command_log.py.

Referenced by append_record().

◆ list_records()

list[dict[str, Any]] list_records ( * ,
int | None last = None,
str | None since = None,
str | None category = None,
str | None model_id = None,
str | None command = None )

Definition at line 218 of file command_log.py.

References _load_index(), and _parse_since().

◆ load_record()

dict[str, Any] | None load_record ( str record_id)

Definition at line 193 of file command_log.py.

Variable Documentation

◆ _CATEGORY_BY_TOOL

dict aquin.command_log._CATEGORY_BY_TOOL
protected
Initial value:
= {
"run_full_inspection": "inspection",
"get_feature_logits": "inspection",
"get_feature_neighbors": "inspection",
"run_attention_routing": "inspection",
"run_layer_analysis": "inspection",
"run_perturbation_sensitivity": "inspection",
"check_weights": "inspection",
"run_simulation": "simulation",
"run_sae_stats": "sae",
"run_find_feature": "sae",
"run_confidence_analysis": "sae",
"run_sae_diff": "sae",
"run_sae_align": "sae",
"run_sae_train": "sae",
"run_capture_activations": "capture",
"run_weight_diff": "checkpoint",
"run_merge_analysis": "checkpoint",
"run_trajectory_analysis": "checkpoint",
"run_residual_drift": "checkpoint",
"ensure_umap_loaded": "inspection",
"run_steer_and_show": "sae",
"run_multi_steer": "sae",
"extract_steer_vector": "sae",
}

Definition at line 19 of file command_log.py.

◆ _COMMANDS_DIR

str aquin.command_log._COMMANDS_DIR = Path.home() / ".aquin" / "commands"
protected

Definition at line 16 of file command_log.py.

◆ _INDEX_PATH

str aquin.command_log._INDEX_PATH = _COMMANDS_DIR / "index.json"
protected

Definition at line 17 of file command_log.py.

◆ _TOOL_TO_CLI

dict aquin.command_log._TOOL_TO_CLI
protected
Initial value:
= {
"run_full_inspection": "trace",
"get_feature_logits": "feature logit",
"get_feature_neighbors": "feature neighbor",
"run_attention_routing": "check attention",
"run_layer_analysis": "check layer",
"run_perturbation_sensitivity": "check perturbation",
"check_weights": "check weight",
"run_simulation": "simulate",
"run_merge_analysis": "diff weight",
"run_trajectory_analysis": "check trajectory",
"run_residual_drift": "diff residue",
"run_sae_stats": "sae-stats",
"run_find_feature": "feature locate",
"run_confidence_analysis": "check confidence",
"run_capture_activations": "activations capture",
"run_custom_eval": "eval custom",
"run_consistency_eval": "eval consistency",
"run_suppression_eval": "eval suppress",
"run_boundary_eval": "eval boundary",
}

Definition at line 45 of file command_log.py.