Skip to content

fix(main): repair post-consolidation merge fallout across gates - #224

Merged
seonghobae merged 2 commits into
mainfrom
fix/main-red-readme-fence-dedupe
Aug 25, 2026
Merged

fix(main): repair post-consolidation merge fallout across gates#224
seonghobae merged 2 commits into
mainfrom
fix/main-red-readme-fence-dedupe

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Protected main is currently red: the serial scheduler merges fused conflicting hunks across several gates. This PR is a superset repair (includes #219) that restores every parent's intended semantics:

Python quality tooling

  • check_coverage.py: restore lost return True in the match-guard branch; remove shadowed duplicate load_union_branch_totals and _is_multiline_match_guard definitions (dead code with uncoverable branches).
  • check_workspace_contract.py: dedupe episode_membership/analysis_engine in EXPECTED_CRATES (54 unique).

Rust compilation and contracts

  • event_core/src/error.rs: split union-fused four-tuples back into (variant, message) pairs.
  • episode_membership/src/window.rs: unfuse identity_recovery_rate; keep the exact-tally usize path (count_matching_decisions + recovery_rate_from_tally) per its overflow documentation.
  • analysis_engine/src/lib.rs: keep the checked-arithmetic eligible-count fold (fail-closed ArithmeticOverflow) over the plain-fold duplicate; fix 3-arg unit() call sites to the 4-arg helper; rustfmt clean.
  • evidence_core/src/image_unit.rs: fix intra-doc link to private constant so cargo doc -D warnings passes.

Workspace registries and docs

  • Cargo.toml: dedupe members/default-members to the canonical 54-crate set.
  • README: rebalance the crate-list fence around all 54 unique crates, remove interleaved prose.
  • ARCHITECTURE: dedupe location_membership/validation_core/tepp_api rows.

Verification at this head

  • cargo nextest run --workspace --all-features: 1209 passed
  • cargo fmt --all -- --check, cargo clippy -D warnings, cargo doc: clean
  • python3 -m pytest tests/quality: 158 passed (+67 subtests)
  • validate_documentation.py, check_workspace_contract.py, check_docstrings.py: PASS

Supersedes #222's scope (README fence + duplicate helper + architecture rows) on a current base; supersedes #219 by inclusion.


Open in Devin Review

The production branch gate reported 2028/2030 after the consolidation
vehicle landed: validate_entity_label and validate_project_label never
observed an uppercase byte that passes the alphanumeric clause yet fails
the lowercase clause, so the final || operand stayed uncovered. The
quality suite likewise missed three Python arcs in scripts/
check_coverage.py: the previous-line scan exhausting over blank-only
history (211->215, 212->211) and the escaped-character arc inside char
literal scanning (318->311). Add exact red-to-green cases for each.
Protected main went red after the serial scheduler merges fused
conflicting hunks:

- check_coverage.py lost a 'return True' in the match-guard branch and
  carried shadowed duplicate load_union_branch_totals and
  _is_multiline_match_guard definitions whose branches can never execute;
- EXPECTED_CRATES and the Cargo members/default-members arrays contained
  duplicate episode_membership and analysis_engine entries, failing the
  no-duplicate workspace contract;
- event_core's error-message table fused two (variant, message) pairs
  into four-tuples that do not compile;
- episode_membership::window fused two identity_recovery_rate bodies into
  an unreachable statement after Ok(...);
- analysis_engine duplicated the eligible-count block (plain fold vs the
  required checked-arithmetic fold) and left 3-arg unit() call sites;
- evidence_core documented a private constant via intra-doc link,
  breaking cargo doc -D warnings;
- README held five fences with interleaved prose inside the crate list;
  ARCHITECTURE held duplicate foundation-crate rows.

This restores each parent's intended semantics, keeps the exact-tally
usize path for identity_recovery_rate, keeps checked arithmetic for
eligible counts, dedupes registries to the canonical 54-crate set, and
rebalances the README fence. Includes the #219 uppercase-label and
scanner-arc coverage cases so the branch gate is satisfiable at this
head.
@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 10 minutes.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 461801e7-0a08-43de-950e-1982ed105f53

📥 Commits

Reviewing files that changed from the base of the PR and between b957817 and 416d92d.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (13)
  • ARCHITECTURE.md
  • CHANGELOG.md
  • Cargo.toml
  • README.md
  • crates/analysis_engine/src/lib.rs
  • crates/episode_membership/src/window.rs
  • crates/event_core/src/error.rs
  • crates/evidence_core/src/image_unit.rs
  • crates/persistence_postgres/src/entity_sql.rs
  • crates/persistence_postgres/src/project_sql.rs
  • scripts/check_coverage.py
  • scripts/check_workspace_contract.py
  • tests/quality/test_check_coverage.py

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

Comment @coderabbitai help to get the list of available commands.

@devin-ai-integration devin-ai-integration 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.

Devin Review found 2 potential issues.

Open in Devin Review

Comment thread README.md
Comment on lines +28 to +31
The repository currently implements 54 independently documented crates rather
than a full commercial release. The implemented crates include topic
measurement, the analysis engine, and psychometric input/recovery gates; they
do not claim a complete commercial estimator,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 README states two different crate counts

The updated text says the repository implements 54 crates, while README.md still says the workspace contains 50. The enumerated fence lists 54, so the older count is stale and the two statements contradict each other.

Prompt for agents
README.md contains two conflicting crate counts. Line 21 says "The current workspace contains 50 independently documented Rust crates" while line 28 (updated in this PR) says "The repository currently implements 54 independently documented crates". The alphabetical crate-list fence enumerates 54 crates, matching the deduplicated Cargo.toml and check_workspace_contract.py EXPECTED_CRATES. Update the stale "50" on line 21 to "54" so the document is internally consistent.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment thread scripts/check_coverage.py
Comment on lines 264 to 268
or text.startswith("if(")
or " if(" in text
):
if text.startswith("if ") or text.startswith("if("):
return True
return _is_multiline_match_guard(lines, line_number)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📝 Info: Shadowed-definition removal is behavior-preserving

The removed first copies of load_union_branch_totals and _is_multiline_match_guard were always shadowed by later definitions, so they were dead. The surviving definitions at check_coverage.py and check_coverage.py retain the active logic, and the call at check_coverage.py and the tests still resolve. No behavior change.

(Refers to this code)

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@seonghobae
seonghobae merged commit 2014023 into main Aug 25, 2026
24 of 28 checks passed
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