fix: allow guarded production Flow v2 shadow rebuild
This commit is contained in:
@@ -530,6 +530,8 @@ def collect(
|
||||
*, expected_database: str = "clientflow_codex_shadow",
|
||||
expected_user: str | None = "clientflow_codex",
|
||||
require_read_only: bool = True,
|
||||
expected_opportunity_count: int | None = None,
|
||||
require_opportunities: bool = False,
|
||||
) -> dict[str, Any]:
|
||||
data = _load(
|
||||
expected_database=expected_database,
|
||||
@@ -537,8 +539,12 @@ def collect(
|
||||
require_read_only=require_read_only,
|
||||
)
|
||||
opportunities = data["opportunities"]
|
||||
if len(opportunities) != 328:
|
||||
raise RuntimeError(f"expected 328 opportunities, found {len(opportunities)}")
|
||||
if expected_opportunity_count is not None and len(opportunities) != expected_opportunity_count:
|
||||
raise RuntimeError(
|
||||
f"expected {expected_opportunity_count} opportunities, found {len(opportunities)}"
|
||||
)
|
||||
if require_opportunities and not opportunities:
|
||||
raise RuntimeError("Flow v2 projection requires at least one opportunity")
|
||||
ids = [_s(opp["id"]) for opp in opportunities]
|
||||
v1_decisions = get_opportunity_next_actions(ids)
|
||||
operations = get_operations_summary(limit=200)
|
||||
|
||||
Reference in New Issue
Block a user