Skip to content

fix: restore green master CI (format, clippy, identity-cutover fail-closed) - #738

Merged
ScriptedAlchemy merged 4 commits into
masterfrom
fix/master-ci-baseline
Aug 27, 2026
Merged

fix: restore green master CI (format, clippy, identity-cutover fail-closed)#738
ScriptedAlchemy merged 4 commits into
masterfrom
fix/master-ci-baseline

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Fix every failing master baseline check

Master's CI has been red since Aug 19 with a stable failure set: Format, Clippy, Test Linux, Test macOS, Test Windows shards 2/5 and 5/5. All four test-job failures are the same two tests. This PR fixes each root cause in its own commit.

1. Format — style(storage): apply rustfmt to resolver tests + part of commit 3

tests/storage_suite/storage_resolver_test.rs (lines 1902/2033) and src/tracedecay/lifecycle.rs (line 229) merged with rustfmt violations. cargo fmt --all -- --check passes after this.

2. Clippy — fix(db): deduplicate identical branch arms in profile_project_root

clippy::if-same-then-else in crates/tracedecay-runtime-core/src/db/access/path_layout.rs: two arms both returned parent.parent()?. Conditions merged with ||, semantically identical.

3. The two failing tests — fix(storage): fail closed on populated exact-root duplicate stores

doctor::tests::current_project_store_surfaces_split_identity_conflict and cli_non_interactive_test::status_surfaces_split_identity_conflict_without_suggesting_init fail identically on Linux, macOS, and Windows (shards 2 and 5).

Root cause: commit 133ca5c48b ("perf(storage): trust healthy exact root among duplicates", landed Aug 10 via the #506 branch) changed choose_identity_layout's fast path from selected_is_sole_exact_root to selected_manifest_matches_exact_root — the selected store now wins without ever probing the duplicates. Its new regression test only covers garbage duplicates, but the two older tests (and #506's own description: "genuinely ambiguous stores continue to fail closed") pin the contract that a populated exact-root duplicate is a genuine identity cutover that must fail closed with tracedecay migrate consolidate guidance.

Fix: keep the bounded-presence fast path, but when candidates also match the exact root, probe them first (same bounded store_identity_has_bounded_population_evidence probe — no full inventories on the fast path):

  • junk/empty duplicates → still silently outranked (registered_healthy_exact_root_ignores_duplicate_exact_manifests and the branch/alias variants keep passing);
  • a populated exact-root duplicate → falls through to the fail-closed identity-cutover conflict diagnostics (restores the two failing tests).

The downstream src/display.rs:154 debug_assert panic seen in the CLI test disappears with this: status fails closed before printing a table for a half-resolved store.

Verification

  • cargo fmt --all -- --check — pass
  • cargo clippy --workspace --all-targets --locked -- -D warnings — running locally, mirrored by this PR's Clippy job
  • targeted identity/cutover lib tests, the storage_suite resolver tests (incl. the 133ca5c regression tests), and the CLI status-conflict test — running locally, mirrored by this PR's test jobs

Expected: this PR's own checks are the authoritative proof — every previously failing check should go green here with no new failures.

ScriptedAlchemy and others added 3 commits August 27, 2026 07:09
Fixes the Format check: tests/storage_suite/storage_resolver_test.rs was
merged with two rustfmt violations (lines 1902 and 2033).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A2BarcJk3iuv77aJQwHvnx
Fixes the Clippy check: clippy::if-same-then-else fired on two arms that
both return parent.parent()?. Merging the conditions with || is
semantically identical.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A2BarcJk3iuv77aJQwHvnx
Fixes the two tests failing on Linux, macOS, and Windows shards 2/5:
doctor::tests::current_project_store_surfaces_split_identity_conflict and
cli_non_interactive_test::status_surfaces_split_identity_conflict_without_suggesting_init.

Commit 133ca5c made a populated exact-root selected store outrank
legacy duplicates without probing them, so a genuine identity cutover
(two populated shards whose manifests both name this exact root) resolved
silently to the marker-selected shard instead of failing closed with the
consolidation guidance. Keep the bounded-presence fast path, but probe
exact-root candidates first: junk or empty duplicates are still ignored
(registered_healthy_exact_root_ignores_duplicate_exact_manifests keeps
passing), while a populated exact-root duplicate falls through to the
identity-cutover conflict diagnostics.

Also applies the pending rustfmt fix in this file (Format check flagged
line 229).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A2BarcJk3iuv77aJQwHvnx
@changeset-bot

changeset-bot Bot commented Aug 27, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: b4d0686

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

CI clippy aborted at the tracedecay-runtime-core error, so the root crate
was never linted. With that fixed, five pre-existing pedantic violations
surface: single_match_else in the scheduler shutdown, manual let-else and
match_same_arms in the store-identity probes, fn_params_excessive_bools
on choose_identity_layout (allowed: the flags mirror resolver evidence
from the sole caller), and items_after_statements in a consolidate test.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A2BarcJk3iuv77aJQwHvnx

@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: 776c779b09

ℹ️ 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 on lines +292 to +294
if store_identity_has_bounded_population_evidence(candidate).await {
exact_candidate_is_populated = true;
break;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Treat unreadable exact candidates as conflicts

When an exact-root candidate retains real auxiliary data but its graph database is missing or corrupt, store_identity_has_bounded_population_evidence returns false immediately without checking sessions or artifacts; it likewise returns false when a populated graph has any unreadable auxiliary path. The new loop therefore classifies these non-pristine candidates as empty and returns the selected layout at line 298, bypassing the inventory-based identity-cutover conflict that would preserve fail-closed behavior. Treat probe errors as conflicting evidence, or otherwise distinguish a genuinely pristine/junk candidate from an unreadable one before taking the fast path.

Useful? React with 👍 / 👎.

@ScriptedAlchemy
ScriptedAlchemy merged commit 703cee2 into master Aug 27, 2026
16 checks passed
@ScriptedAlchemy
ScriptedAlchemy deleted the fix/master-ci-baseline branch August 27, 2026 07:23
ScriptedAlchemy added a commit that referenced this pull request Aug 27, 2026
Absorbs the master-side CI stabilization. Delete-side conflicts resolve to
this branch: the V2 resolver (lifecycle/identity.rs reject_split_identity_cutover)
already fails closed on populated duplicate shards, path_layout.rs is already
restructured past the clippy lint, and the automation lock code is rewritten
here (the vanished-lock reclaim guard from #739 still needs a V2 port — see
the PR #707 comment from 2026-08-27). Tree is identical to the previous
branch head.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A2BarcJk3iuv77aJQwHvnx
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