INNER CODE UNIT · Python
_unified_memory_command
OnePunchMonk/AgentQuant · src/cli.py:29
def _unified_memory_command(args: argparse.Namespace) -> int:
from src.memory import MemoryQuery, MemoryService
service = MemoryService(mode="read")
if args.stats:
_print_table([service.stats()])
return 0
if args.trials:
rows = []
for t in service.list_trials(strategy_type=args.strategy, asset=args.asset, limit=args.limit):
rows.append({
"Trial": t.trial_id[:8], "Run": t.run_id, "Asset": t.asset, "Strategy": t.strategy_type,
"Params": t.params, "Regime": t.regime_label, "Data End": t.data_end,
"IS Sharpe": t.is_sharpe, "OOS Sharpe": t.oos_sharpe, "OOS Src": t.oos_source,
"Outcome": t.outcome, "Failure": t.failure_mode, "Source": t.source,
})
_print_table(rows)
return 0