Skip to content

Harden versioned semantic history diffs#32

Merged
forhappy merged 3 commits into
mainfrom
fix/semantic-diff-hardening
Jul 25, 2026
Merged

Harden versioned semantic history diffs#32
forhappy merged 3 commits into
mainfrom
fix/semantic-diff-hardening

Conversation

@forhappy

@forhappy forhappy commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

What changed

  • make semantic diff total in both directions, including bounded impact traversal with explicit limitations instead of panics/errors
  • normalize graph, manifest, and checkout-root identity inputs so identical revision/profile rebuilds produce the same realization ID
  • reset every current Compass-owned persisted/fingerprinted contract to v1: history, node-link graph, store/root namespace, Program IR, provider, merger, analysis, and semantic-diff report/classifier
  • remove profile migration/comparison normalization, version-conditional realization roots, legacy GC roots, legacy job-field defaults, dual node-link serialization, and old-store opening
  • add explicit --limit behavior, genuinely exhaustive --all, visible truncation counts, and prominent public-surface additions
  • distinguish proven test gaps from partial/unavailable test mapping
  • classify additions/removals before digest comparisons and group API, behavior, dependency, impact, and test evidence into reviewer narratives
  • collapse routine dependency/test churn by default
  • resolve unique local/imported calls before assigning semantic confidence
  • model thrown exceptions structurally, including chained exceptions, rethrows, and dynamic expressions
  • document automatic multigraph promotion and update parity handling for Compass-superset metadata

Why

The previous history diff could panic or abort in reverse comparisons, emit non-deterministic realization IDs, silently truncate renderer output, overclaim test gaps and public APIs, and describe exception expressions such as result.error as if they were exception types. Reciprocal edges could also create invalid non-multigraph artifacts.

User impact

compass diff OLD NEW now leads with likely breaks, public API changes, behavior, affected consumers, and mapping completeness. Routine symbol/test/internal dependency churn stays collapsed unless --all is requested, while JSON and --all remain exhaustive.

History persistence has no backward-compatibility path in this early phase. Anything other than the current v1 contract fails closed; users archive or remove the repository's Compass history directory and rebuild fresh v1 realizations.

Validation

  • GRAPHIFY_REPO_ROOT=/Users/haipingfu/graphify CARGO_TARGET_DIR=/Volumes/Workspace/codex-compass-semantic-target cargo test --workspace --quiet
  • strict clippy for every changed crate with --all-targets --no-deps -- -D warnings
  • graphify update .
  • real CocoIndex history validation at 90571539fa29..71f9cc9dc693: 333 findings in both directions; forward reports 1 public addition, 7 behavior changes, 0 likely breaks; reverse completes with explicit depth-limit notes
  • --all emitted all 333 findings with no truncation marker; --limit 5 reported the 11 omitted section findings
  • identical unseeded and seeded HEAD rebuilds produced realization 4dd10563637031ac43f24390f14b2293109a0d47976e7c9937f68a499273e95d
  • fresh v1 acceptance built two Python revisions and validated history schema 1, networkx-node-link/v1, Program IR 1, merger 1, analysis schema/analyzer 1, semantic report /1, and sd1-... findings
  • the fresh semantic diff reported the added required parameter as a probable public-API break
  • the existing non-current CocoIndex store fails closed with compatible:false and exit code 1

Workspace-wide strict clippy is currently blocked by two pre-existing too_many_arguments lints in compass-output; all affected crates pass with only those two known lints allowed.

@forhappy
forhappy marked this pull request as ready for review July 25, 2026 05:06
@forhappy
forhappy merged commit 63f6e20 into main Jul 25, 2026
3 of 9 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