chore(release): prepare v0.7.0

This commit is contained in:
Hermes Agent
2026-09-13 17:01:20 +09:00
parent 3569d864c9
commit adf131f19c
14 changed files with 145 additions and 14 deletions
+4
View File
@@ -1 +1,5 @@
"""trex-core — shared core for the trex product family."""
from trex_core.version import __version__
__all__ = ["__version__"]
+7 -6
View File
@@ -4,7 +4,8 @@ Live portfolio-hub contract (verified against openapi, REQ-017 CHG-04):
POST /v1/portfolios/{portfolio_id}/ledger/trades
body keys: side, quantity, price, fee_amount, tax_amount, executed_at,
execution_id, order_id
- 2xx (201) => recorded (or duplicate accepted idempotently)
- 201/status=new => recorded
- 200/status=duplicate => duplicate accepted idempotently
- 409 => LedgerConflictError (operator resolution)
- 404/400/422 => LedgerPermanentError (dcy-015/REQ-017 — retry can't fix:
portfolio not registered / malformed trade)
@@ -94,18 +95,18 @@ class PortfolioHubLedger:
raise LedgerRetryableError(f"portfolio-hub network error: {exc!s}") from exc
if 200 <= resp.status_code < 300:
# orbit convention: response body may carry a "duplicate" flag when
# the server has already recorded this execution_id idempotently.
# portfolio-hub returns status="duplicate" for an idempotent replay.
# Keep the former boolean marker compatible with older deployments.
try:
body = resp.json() if resp.content else {}
except ValueError:
body = {}
if not isinstance(body, dict):
body = {}
result = (
LedgerWriteResult.DUPLICATE_OK if body.get("duplicate") is True
else LedgerWriteResult.NEW
is_duplicate = (
body.get("status") == "duplicate" or body.get("duplicate") is True
)
result = LedgerWriteResult.DUPLICATE_OK if is_duplicate else LedgerWriteResult.NEW
# dcy-018 / REQ-017 (option D, portfolio-hub#8): root flat authoritative
# cash/quantity after the write — present on new(201) + duplicate(200).
return LedgerWriteOutcome(
+2
View File
@@ -55,6 +55,7 @@ from trex_core.application.alarm_emitter import AlarmEmitter
from trex_core.application.ledger_outbox import LedgerWriter, OutboxOutcome
from trex_core.application.ledger_port import LedgerTrade
from trex_core.application.ledger_skip import ledger_skip_alarm_fields, publish_ledger_skip_alarm
from trex_core.version import __version__
from trex_core.runtime.config import (
DaemonConfig,
DaemonInstanceConfig,
@@ -563,6 +564,7 @@ def _add_intent_guards(p) -> None:
def _build_parser() -> argparse.ArgumentParser:
parser = argparse.ArgumentParser(prog="trex-core", description="trex-core admin CLI")
parser.add_argument("--version", action="version", version=f"%(prog)s {__version__}")
sub = parser.add_subparsers(dest="cmd", required=True)
p_pause = sub.add_parser("pause", help="Pause a portfolio_id")
+2
View File
@@ -600,8 +600,10 @@ def main() -> None: # pragma: no cover - process entrypoint
import argparse
from trex_core.runtime.logging_setup import configure_logging
from trex_core.version import __version__
configure_logging(level=logging.INFO) # REQ-084: ISO8601(KST)+level+json+cid
parser = argparse.ArgumentParser(prog="trex-core-daemon")
parser.add_argument("--version", action="version", version=f"%(prog)s {__version__}")
parser.add_argument(
"--config", required=True,
help="per-instance TOML name (resolved within --config-path) or explicit "
+2
View File
@@ -160,6 +160,7 @@ def main(argv: Optional[list[str]] = None) -> int: # pragma: no cover - CLI she
from trex_core.runtime.config import DaemonConfig, resolve_config_toml
from trex_core.runtime.logging_setup import configure_logging
from trex_core.version import __version__
configure_logging(level=logging.INFO) # REQ-084
parser = argparse.ArgumentParser(
@@ -168,6 +169,7 @@ def main(argv: Optional[list[str]] = None) -> int: # pragma: no cover - CLI she
"the DB to the asset-centric schema (dry-run by default). "
"Destructive and DB-wide — back up first.",
)
parser.add_argument("--version", action="version", version=f"%(prog)s {__version__}")
parser.add_argument("--config", required=True, help="instance TOML name/path (DSN source)")
parser.add_argument("--config-path", default=None)
parser.add_argument("--env-file", default=None)
+5
View File
@@ -0,0 +1,5 @@
"""Installed package version exposed to runtime entry points."""
from importlib.metadata import version
__version__ = version("trex-core")