Skip to content

refactor: isolate lifecycle execution record projection - #513

Draft
Pigbibi wants to merge 1 commit into
mainfrom
refactor/arch04-lifecycle-record-projection
Draft

Pigbibi wants to merge 1 commit into
mainfrom
refactor/arch04-lifecycle-record-projection

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

AI assistance

Implemented with OpenAI Codex (GPT-6 family; the host does not expose a more specific model identifier). A separate Codex agent independently reviewed the complete source/test diff and reran the focused controls against the actual base and candidate.

What changed

Extract the final lifecycle recorder payload in run_strategy_cycle() into _build_platform_execution_record(result, *, settings) in the same module. The recorder remains at its original call site after persistence and notification handling. Preserve all 11 fields, insertion order, nested identities, getter order, truthiness fallback, repeated portfolio reads, exceptions, and early-return recording counts.

Add frozen public-cycle characterization covering synthetic dry-run/live-shaped results, early exits, falsey/malformed fields, equity fallback, every observed evaluation failure, callback ordering, repeated execution, adjacent tests, and normalized AST inlining equivalence.

How verified

Base: 79b0237d1a2aac2c602e86751e3064fe29b3ed97.
Candidate: d03c3c821bbba43a6e9bfa9e6d4dbe172a5bd0e7.
Reviewed tree: c3ed845b67405405ab9f7fc01bf1887c2880ab9a.

  • Full ordinary and coverage-instrumented baseline: each 1,790 passed / 118 subtests; no skips.
  • Full ordinary and coverage-instrumented candidate: each 1,800 passed / 118 subtests; no skips. Both retain the same existing warning.
  • Collection: exactly 10 added tests, no removed tests.
  • Frozen characterization: 10 passed before extraction and 10 after extraction; independent reviewer repeated both runs. Independent verdict: APPROVE, no blocking findings, bound to the candidate head/tree above. Two isolated negative mutations (field order and None-only equity fallback) were both detected by the public-cycle assertions.
  • Ruff, documentation check (zero blocking findings; one existing advisory), dependency compatibility, frozen lock consistency, QPK pin consistency, installed-import contract (3 passed), Dot review safety contracts (11 passed), sdist/wheel build, and redacted Gitleaks commit scan passed.
  • Tests ran with synthetic ports, network isolation, and hidden credential directories. Focused subprocesses also deny network/credential access before imports.
  • Focused loaded-module snapshots: 129 real shared modules at each boundary, QPK 5d0714201f3813f68a9833083cd21f6d61e5b702 and UES c31f28484b8489a1ecda8e595a6d2afd3bce8185; intentional doubles are attributes on the real orchestration module. These snapshots do not certify transient imports or the full suite, and do not extend ARCH-06's strict parser lane.

Hosted engineering results and the actual checkout/tree will be recorded separately after publication.

Why

ARCH-04A isolates the result projection without moving orchestration side effects or changing financial semantics. Current main and complete open-PR changed paths were refreshed; no target-file conflict or source fingerprint registration requirement was found. Notification/session proposals #505 and #491 do not alter this boundary.

Risk

This is a behavior-preserving source extraction in application/rebalance_service.py plus one characterization test file. No dependency, workflow, governance, fingerprint, notification, persistence, order, or entry-point changes. The helper preserves the existing zero/False equity fallback deliberately. No live service, provider transport, account, or credential was exercised. Rollback, if later adopted, is a normal revert with no migration.

Draft only. No labels, ready transition, merge, deployment, or operational action is requested by this PR. Governance checks remain separate from engineering validation.

@coderabbitai

coderabbitai Bot commented Nov 2, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

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