Add ProofLine criteria documentation and Strategy Catalog v1 implementation

- Add acceptance criteria documentation (AC-0013 through AC-0023)
- Add Line-0003 discovery documentation
- Implement Strategy Catalog v1 with new database migration
- Update portfolio API endpoints and schemas
- Refactor strategy and portfolio services
- Add strategy management CLI commands
- Update domain models with strategy catalog support
- Add comprehensive tests for v1 strategies
- Update design documentation (data model, interfaces, runtime flows)
This commit is contained in:
2026-08-15 11:18:31 +09:00
parent 5fc389dea8
commit 6e02d92282
48 changed files with 2114 additions and 393 deletions
+4 -10
View File
@@ -150,8 +150,7 @@ def create_portfolio(
asset_quantity: float = typer.Option(0.0, min=0.0, help="Starting asset quantity."),
asset_price: float = typer.Option(0.0, min=0.0, help="Starting asset price."),
profit_buffer: float = typer.Option(0.0, min=0.0, help="Initial profit buffer."),
strategy_name: str = typer.Option("target_value", help="Strategy name."),
strategy_params: str = typer.Option("{}", help="Strategy params as JSON object."),
strategy_id: str = typer.Option(..., "--strategy-id", help="Active strategy catalog ID."),
force: bool = typer.Option(False, "--force", help="Skip confirmation prompt."),
) -> None:
_validate_portfolio_name(name, ctx.obj.console)
@@ -179,8 +178,7 @@ def create_portfolio(
asset_quantity=asset_quantity,
asset_price=asset_price,
profit_buffer=profit_buffer,
strategy_name=strategy_name,
strategy_params=_parse_strategy_params(strategy_params),
strategy_id=strategy_id,
),
owner_user_id=owner.id,
)
@@ -198,8 +196,7 @@ def update_portfolio(
broker: str | None = typer.Option(None, help="Broker code."),
status: str | None = typer.Option(None, help="Portfolio status."),
new_name: str | None = typer.Option(None, "--new-name", help="New portfolio name (requires --force or confirm)."),
strategy_name: str | None = typer.Option(None, help="Strategy name."),
strategy_params: str | None = typer.Option(None, help="Strategy params as JSON object."),
strategy_id: str | None = typer.Option(None, "--strategy-id", help="New active strategy catalog ID."),
asset_price: float | None = typer.Option(None, min=0.0, help="Current asset price."),
daemon_id: str | None = typer.Option(None, "--daemon-id", help="Assign portfolio to this daemon (managed_by_daemon_id)."),
force: bool = typer.Option(False, "--force", help="Skip confirmation prompt."),
@@ -211,8 +208,6 @@ def update_portfolio(
else:
_confirm(force, f"Update portfolio {name!r} (user: {user})?")
parsed_strategy_params = None if strategy_params is None else _parse_strategy_params(strategy_params)
def _callback(service, repository, app_context):
portfolio_id = _resolve_portfolio_id(repository, name, user)
return service.update_portfolio(
@@ -221,8 +216,7 @@ def update_portfolio(
broker=broker,
status=status,
name=new_name,
strategy_name=strategy_name,
strategy_params=parsed_strategy_params,
strategy_id=strategy_id,
asset_price=asset_price,
managed_by_daemon_id=daemon_id,
),