Skip to content

[codex] P0 scoped reads and completeness for 0.3.0 - #2

Merged
marcomc merged 10 commits into
release/0.3.0from
feat/p0-complete-reads
Sep 13, 2026
Merged

marcomc merged 10 commits into
release/0.3.0from
feat/p0-complete-reads

Conversation

@marcomc

@marcomc marcomc commented Sep 12, 2026 •

Copy link
Copy Markdown
Owner

P0 scoped reads and completeness

This is the P0 read dependency for MoneyWiz Tools 0.3.0. Reads now distinguish a
complete result from records or relationships that could not be interpreted,
instead of presenting silently omitted data as an empty or complete account.

Failed reloads preserve the previous published generation, including relationship
maps and completeness reports, while retained public manager objects remain
usable. Direct account constructors validate after their fields initialize.
Unrequested and fresh managers explicitly report unloaded; successful empty
loads remain distinguishable from absent observation. Transaction reports publish
only after row and relationship observation completes. All six direct manager
entrypoints share a transaction lifecycle; transaction rows and relationships
are observed together, and completed reports publish after successful exit.
Failed direct loads discard incomplete state and report unloaded, while failed
API reloads retain the previously published generation.
Unsupported category types now raise a static ValueError, producing the
structured invalid_value diagnostic without exposing source values.

Schema metadata, physical definitions and cached maps/profile now bind in one
initialization snapshot. Every cache-dependent reader checks that binding within
its read transaction. Metadata or physical-schema drift requires reopening the
reader; normal record updates and allocation-counter growth remain reloadable.
This prevents stale entity IDs or aliases from producing false-complete reads.
Every verified read also checks observed entity ancestry. Unmapped, NULL,
missing-parent or cyclic observed identities fail boundedly; unknown descendants
of all six manager roots become explicit skipped source rows. Legitimately absent
models and unrelated known malformed records remain isolated by scope.

Published reports, aggregates and snapshots now own immutable nested evidence.
Ordinary caller mutation cannot rewrite retained completeness; exported dictionary
and JSON values are detached and mutable. Live manager/model APIs stay mutable.

Scoped manager loading isolates unrelated malformed models. Source/parsed IDs and
identity-only diagnostics make skipped rows explicit. Category, refund and tag
relationships have separate storage/completeness reports; tag joins follow entity
metadata rather than one fixed table number. Incremental loads refresh the retained
and requested manager union in one SQLite transaction.
Category assignment counts are transaction-scoped: valid budget, scheduled and
history-only assignments are excluded, with regression controls for those cases.

Tag-table discovery and admission share one exact-shape classifier. Missing
metadata, ambiguous alternatives and expected-name hybrids remain explicitly
incomplete. Runtime validation uses explicit exceptions, preserving rejection
and diagnostics under normal Python, -O, -OO and PYTHONOPTIMIZE.

The change also validates models after full construction, closes connections on
schema initialization failure, handles nullable account metadata safely, and uses
per-consumer investment aliases. Database access remains read-only. New MoneyWiz
write capabilities are not enabled by this PR.

Local record IDs and relationship endpoints require exact integers, preserving
existing optional payee and category-parent references. Malformed identities are
excluded with safe diagnostics. Reconciliation accepts raw integer 0 or 1
before conversion to bool; unknown or unsupported values cannot silently become
unreconciled. Missing holding quantities remain explicitly refused rather than
being assumed zero.

Global IDs require nonempty exact strings. Supported name fields and nullable
account information reject non-text values without coercion. The public JSON
snapshot boundary recursively validates converted values and mapping keys,
rejecting unsupported binary/object values, non-finite floats and normalized-key
collisions with static errors. Legacy raw model dictionaries remain unchanged.
Supported field failures appear as skipped rows; unsupported remaining legacy
leaves cause an explicit snapshot-operation refusal rather than unsafe output.

Nested readers reuse admission only within an actively verified outer scope.
Every independent scope revalidates schema and source eligibility, including
caller-owned SQLite transactions. Continuity guards prevent reuse after a lost
transaction; one eager load now performs one admission rather than sixteen.

Validation

  • Independent local review and scoped remediation completed; confirmed findings
    closed with regressions, valid-case coverage and a shared-classifier review.
  • Python 3.10.21 and 3.11.13: 776 default tests passed and one opt-in group skipped
    on each runtime.
  • MoneyWiz Tools candidate-consumer check on Python 3.11: 214 tests passed,
    three installed-bundle checks skipped before the reviewed dependency is pinned.
  • Deterministic WAL migration controls cover initialization, first load and reload.
    The initialization regression passes normally and independently fails when its
    raw transaction protection is removed in the test process.
  • Direct transaction-manager WAL interleaves cover each component boundary and
    reject a missing-outer-transaction mutant. CLI regressions verify malformed
    identity and reconciliation rows produce partial results without payload leaks.
  • Ruff check and full format check, README Markdown lint, workflow YAML parsing,
    and diff checks passed.
  • The earlier opt-in historical fixture comparison found the same 40 failing test
    nodes at the pinned baseline and initial candidate. It was not repeated for
    this bounded classifier/validation remediation. This remains a classified
    existing limitation, not a full historical fixture suite pass.

Integration boundary

Targets this fork's release/0.3.0; does not change upstream or merge into main.
CI now runs for release-branch pull requests. After a current-head clean GitHub
Codex review and passing checks, the reviewed API commit will be pinned and tested
in MoneyWiz Tools' self-contained bundle. No live financial store was modified.

Add structured record and relationship completeness, metadata-derived schema aliases, consistent scoped reloads, and safe model construction. Cover malformed layouts and supported Python versions, and enable the release branch CI checks.
@marcomc
marcomc marked this pull request as ready for review September 12, 2026 16:05
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 12, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-13T12:46:26.958075Z cf3f68a Manual request
🔒 Security Review ✅ Completed 2026-09-12T16:10:02.914668Z a0cc124 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@marcomc

marcomc commented Sep 12, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@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: a0cc124a6c

ℹ️ 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 thread src/moneywiz_api/database_accessor.py Outdated
Comment thread src/moneywiz_api/database_accessor.py Outdated
Share exact tag-table shape classification across discovery and admission, reject metadata/storage contradictions, and preserve validation under optimized Python. Add synthetic shape matrices and optimization parity regressions.
@marcomc

marcomc commented Sep 12, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@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: b2ecd54d4e

ℹ️ 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 thread src/moneywiz_api/moneywiz_api.py Outdated
Comment thread src/moneywiz_api/model/account.py
Comment thread src/moneywiz_api/managers/record_manager.py
Stage manager generations before publication, retain public manager identity on success and failure, validate account constructors after owned fields initialize, and classify unsupported category values precisely. Cover failure boundaries, retry, direct constructors and optimized diagnostics.
@marcomc

marcomc commented Sep 13, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@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: 45b7a9730d

ℹ️ 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 thread src/moneywiz_api/moneywiz_api.py
Capture complete entity metadata and physical schema in one initialization transaction. Verify schema before every cache-dependent public read, reject drift without altering published state, and require reopen. Cover metadata and DDL migrations, nested ownership, normal growth, and mutation-sensitive initialization races.
@marcomc

marcomc commented Sep 13, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@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: 737694e9c4

ℹ️ 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 thread src/moneywiz_api/database_accessor.py
Comment thread src/moneywiz_api/managers/record_manager.py Outdated
Publish manager completeness only after observation finishes, preserving atomic API reload behavior and existing report serialization. Cover fresh, scoped, failed and retried loads, and document transaction-only category assignment counts with alternative-owner controls.
@marcomc

marcomc commented Sep 13, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@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: 09bfe2cda6

ℹ️ 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 thread src/moneywiz_api/database_accessor.py
Comment thread src/moneywiz_api/managers/record_manager.py
Comment thread src/moneywiz_api/read_result.py
Validate observed entity ancestry within each verified read transaction and discover descendants for all manager roots. Own nested completeness and snapshot containers immutably while exporting detached mutable JSON values. Preserve scoped isolation, valid empty models, atomic reloads and dataclass compatibility with paired regression matrices.
@marcomc

marcomc commented Sep 13, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@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: 129d876d94

ℹ️ 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 thread src/moneywiz_api/model/investment_holding.py
Comment thread src/moneywiz_api/database_accessor.py
Comment thread src/moneywiz_api/managers/transaction_manager.py Outdated
Comment thread src/moneywiz_api/model/transaction.py
Share one transaction lifecycle across all manager entrypoints and publish reports only after successful exit. Validate integer identities and raw reconciliation state before conversion, retaining optional references and safe diagnostics. Cover real WAL interleaves, nested ownership and mutation-sensitive failure regressions.
@marcomc

marcomc commented Sep 13, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@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: 3264256979

ℹ️ 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 thread src/moneywiz_api/model/record.py
Comment thread src/moneywiz_api/database_accessor.py Outdated
Reject malformed global IDs and supported text metadata without coercion. Validate recursive snapshot values and keys before publication while preserving raw model output. Admit each active outer read scope once, reverify independent scopes and latch transaction loss. Cover identity, serialization, WAL, external ownership and unsafe admission mutants.
@marcomc

marcomc commented Sep 13, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: cd1f8b5b81

ℹ️ 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".

@marcomc

marcomc commented Sep 13, 2026

Copy link
Copy Markdown
Owner Author

Recovering a GitHub Actions run stuck queued with no jobs; reopening immediately at the unchanged validated head.

@marcomc marcomc closed this Sep 13, 2026
@marcomc marcomc reopened this Sep 13, 2026
@marcomc

marcomc commented Sep 13, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@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: cd1f8b5b81

ℹ️ 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 thread src/moneywiz_api/model/investment_holding.py
Comment thread src/moneywiz_api/model/account.py
Comment thread src/moneywiz_api/managers/record_manager.py Outdated
Reject invalid persisted scalar shapes before coercion and discard incomplete read state when initialization is interrupted. Add regression coverage for optimized validation, schema discovery, diagnostics, and cancellation.
@marcomc

marcomc commented Sep 13, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@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: 3020435cef

ℹ️ 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 thread src/moneywiz_api/managers/record_manager.py Outdated
Seed supported account and transaction entities during descendant discovery so incomplete migrated hierarchies report unknown source rows rather than false completeness.
@marcomc

marcomc commented Sep 13, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: cf3f68a1ce

ℹ️ 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".

@marcomc
marcomc merged commit 634b535 into release/0.3.0 Sep 13, 2026
2 checks passed
@marcomc
marcomc deleted the feat/p0-complete-reads branch September 26, 2026 10:03
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