Skip to content

fix(IPO-014): bind evidence approval and editing to source revisions - #157

Open
DoRmAmMu1997 wants to merge 8 commits into
codex/scanner-database-verificationfrom
codex/scanner-ipo-approval
Open

DoRmAmMu1997 wants to merge 8 commits into
codex/scanner-database-verificationfrom
codex/scanner-ipo-approval

Conversation

@DoRmAmMu1997

@DoRmAmMu1997 DoRmAmMu1997 commented Oct 18, 2026 •

Copy link
Copy Markdown
Owner

An extraction proposal could outlive a human correction, and queue order could let older filing evidence supersede the current source. This binds proposals and manual drafts to an explicit manual revision and source identity, then checks that authority again under the issue lock before committing. Unknown legacy baselines and stale proposals require fresh review; neither confidence nor an approval click bypasses later human edits.

Automatic approval selects at most one current candidate per issue: the latest unambiguous dated RHP, otherwise the latest dated DRHP. Unknown/tied chronology, conflicting current terms and competing same-date verified cap claims require review. A failed or unavailable current candidate never falls back to an older filing. Source/date/cache writers share the lock, while PDF verification stays outside transactions.

Manual forms retain their loaded revision, clear source-bound fields on source changes, and expose explicit reload/copy actions. Copying values clears citations and requires verification against the newly selected PDF. Stale drafts remain inspectable with Save disabled. Reload discards that draft and clears its warning. Immutable history, receipt checks, proposal CAS and atomic rollback remain intact.

Dependency: stacks on #155 (codex/scanner-database-verification), which stacks on #150. Migration 20260927ipo014 follows 20260921ipo013; the schema and corresponding ORM change ship together. Historical proposals are backfilled with an unknown baseline, never silently trusted or rewritten.

Validation on 5baf0ef, including current main 9ded279 and the database verification branch:

  • Python 3.12: 2,443 passed, 19 skipped; 90.83% coverage including app.py, across twelve commit-locked groups. Pre-commit validation, compileall, Ruff, full mypy, Bandit, pinned dependency audit and diff checks passed.
  • Python 3.13 and 3.14: 142 focused cases passed and 12 PostgreSQL cases skipped on each, covering approval, manual edits, models, migration upgrades and real Streamlit AppTest transitions. Full-suite skips comprise 17 PostgreSQL cases requiring the hosted disposable server and two platform/optional cases.
  • Added dedicated PostgreSQL authority checks: the same two-proposal, stale/unknown-baseline, human-save-during-verification and pre-lock source-mutation scenarios run on both databases. Three PostgreSQL-only tests hold a real approval lock and require the server's lock-unavailable SQLSTATE for competing date/cache/insert writes. Independent review of this follow-up found no actionable issue; actual hosted execution remains required and is not inferred from local skips.
  • Independent correctness/security review covered all 24 changed paths. Its competing-cap finding was reproduced, fixed and independently reverified; no outstanding finding remains in that review's scope. Detailed Google-style contracts, Beginner notes and safety/concurrency comments were reviewed explicitly.
  • Actual browser checks use the production renderer with synthetic repository facades: source switching, retained stale drafts, disabled stale saves, explicit reload and copied values were exercised. The final Streamlit 1.65 recheck confirmed reload clears both values and warning and makes no save call. Providers and application databases were not contacted.

Hosted run 39584117954 passed 2,460 tests with two platform skips on each supported Python, including all PostgreSQL approval-race cases, and passed Docker/Compose smoke. The quality jobs subsequently failed only the dependency audit, which now reports eight advisories in Pillow 12.3.0 with 13.0.0 as the listed fix. The PostgreSQL tests did execute; their local skips are not used as proof.

The shared dependency gate remains unresolved: as verified October 21, latest stable Streamlit 1.66.0 requires Pillow below 13. Its official Pillow 13 compatibility change has merged upstream but is not yet in a stable release. No advisory suppression, conflicting install or development-framework substitution has been applied. This package does not complete the broader modernization or final integrated security review. No merge or production deployment is included.

Co-authored-by: Codex codex@openai.com

DoRmAmMu1997 and others added 6 commits October 10, 2026 14:49
Capture a manual-only generation before extraction and browser editing. Reject
unknown or stale approval authority under the shared issue lock, select at most
one current automatic candidate, and reverify copied manual citations against
the selected PDF. Preserve immutable history through IPO-014 migration.

Co-authored-by: Codex <codex@openai.com>
Retain source-bound manual approval changes while integrating the reviewed
scoring receipt reuse fix and current dependency baseline.

Co-authored-by: Codex <codex@openai.com>
Compare same-date pending HIGH cap claims through a shared cohort policy in
queue selection and final locked approval. Preserve equal/missing terms,
older-draft precedence, rejected history and the manual-baseline boundary.
Cover public proposal insertion before and after the approval state lock.

Co-authored-by: Codex <codex@openai.com>
…oval

Stack IPO-014 on IPO-013 plus the database-verification package so hosted PostgreSQL and image checks exercise the combined migration chain and shared transaction contracts.

Co-authored-by: Codex <codex@openai.com>
Document nested failure and concurrency fixtures, including why verification barriers, one-shot insertion guards and before-cursor events protect the tested authority boundaries. Executable AST is unchanged; the IPO teaching policy now passes.

Co-authored-by: Codex <codex@openai.com>
…sions

Render the stale-evidence warning after the explicit reload action so fresh forms do not display outdated guidance. Update AppTest scenarios to submit invalid forms before inspecting retained server widget state, preserving unsaved-draft checks under Streamlit 1.65 form batching. Real-browser checks separately confirm unsent input retention.

Co-authored-by: Codex <codex@openai.com>
@DoRmAmMu1997
DoRmAmMu1997 marked this pull request as ready for review October 18, 2026 18:08
DoRmAmMu1997 and others added 2 commits October 19, 2026 17:36
Reconcile the reviewed package with main 9ded279 and its current dependency pins. Fresh verification follows this merge.

Co-authored-by: Codex <codex@openai.com>
Run the same manual-baseline and source-race assertions on both disposable databases. Add a real PostgreSQL row-lock probe for date, cache and insertion writers, plus a human save during verification. Keep PDF parsing deterministic while using production verification and persistence.

Local current-pin focused run: 72 passed, 12 PostgreSQL cases skipped; full mypy281 files and Ruff pass. Hosted PostgreSQL execution remains required.

Co-authored-by: Codex <codex@openai.com>
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