Skip to content

[codex] add strategy lifecycle CLI#160

Merged
Pigbibi merged 1 commit into
mainfrom
codex/add-lifecycle-cli
Jul 1, 2026
Merged

[codex] add strategy lifecycle CLI#160
Pigbibi merged 1 commit into
mainfrom
codex/add-lifecycle-cli

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add quant-lifecycle console script as the shared strategy lifecycle CLI.
  • Implement the CLI with stdlib argparse to avoid a new production dependency.
  • Document domain-repo scheduling guidance in both READMEs.
  • Add tests for command delegation and compatibility wrapper behavior.

Validation

  • python3 -m pytest tests/test_lifecycle_cli.py tests/test_lifecycle_drift.py tests/test_lifecycle_reviewer.py -q
  • python3 -m ruff check src/quant_platform_kit/strategy_lifecycle/cli.py tests/test_lifecycle_cli.py
  • PYTHONPATH=src python3 -m quant_platform_kit.strategy_lifecycle.cli --help
  • editable install smoke: quant-lifecycle --help from a temporary venv
  • git diff --check

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 17b51a082b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +118 to +120
for step in steps:
_print(f"[lifecycle] Step: {step}")
_print(f"[lifecycle] -> {step} complete")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Run the lifecycle steps instead of only logging completion

When a schedule invokes the new quant-lifecycle lifecycle command, this handler only prints each step as complete and returns success; it never calls run_monitor, run_drift_detection, optimization, or build_dashboard. That makes the advertised “full lifecycle pipeline” a no-op while still exiting 0, so production jobs can silently skip snapshot generation, drift checks, and dashboard updates.

Useful? React with 👍 / 👎.

"quant_platform_kit.strategy_lifecycle.drift_detector",
"run_drift_detection",
)
results = run_drift_detection(domain=args.domain, strategy_profile=args.strategy)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Publish drift alerts from the drift command

For direct schedules that run quant-lifecycle drift, this only calls run_drift_detection, which saves drift results but does not build or publish notification events; the existing alert path is in strategy_lifecycle.drift_alerts (build_drift_alert/publish_drift_alerts). Because the new subcommand help says it emits alerts, operators can end up with critical/review drift persisted but no Telegram/email/webhook alert sent.

Useful? React with 👍 / 👎.

)
result = process_update(proposal_path=args.proposal, auto_approve=args.auto_approve)
_print(f"[update] Result: stage={result.get('stage')}, reason={result.get('reason', '')}")
return 0

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Return non-zero when update processing reports an error

If process_update returns an error result instead of raising, this command still exits successfully. For example, process_update returns {"stage": "error", ...} for proposal sources it cannot load such as gs:// paths, so a scheduled quant-lifecycle update can be marked successful even though no proposal was applied; map at least stage == "error" to a non-zero exit code.

Useful? React with 👍 / 👎.

- Add quant-lifecycle console script backed by QuantPlatformKit lifecycle modules
- Keep the CLI dependency-free by using argparse
- Cover command delegation and compatibility wrapper behavior

Co-Authored-By: Codex <noreply@openai.com>
@Pigbibi Pigbibi force-pushed the codex/add-lifecycle-cli branch from 17b51a0 to 12b02be Compare July 1, 2026 16:31
@Pigbibi Pigbibi merged commit b0eacd2 into main Jul 1, 2026
2 checks passed
@Pigbibi Pigbibi deleted the codex/add-lifecycle-cli branch July 1, 2026 16:32

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 12b02be4bc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

drift_status = _run_drift(
argparse.Namespace(
domain=args.domain,
strategy=None,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Propagate the lifecycle strategy filter

When a domain schedule runs quant-lifecycle lifecycle --domain us_equity --strategy foo, this hard-codes the drift stage to strategy=None (and the monitor stage above does the same), so the lifecycle still processes and can publish drift alerts for every strategy in the domain while only optimizing foo. The standalone monitor and drift commands already pass --strategy through, so a strategy-scoped lifecycle run can produce unrelated snapshots/alerts and extra work; pass args.strategy into these stages or clarify/remove the option.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant