Skip to content

fix(analysis): type and fixture-prove path-dependency edge capture (#3037) - #3134

Merged
EffortlessSteven merged 7 commits into
mainfrom
fix/3037-path-dependency-edge-capture
Aug 11, 2026
Merged

EffortlessSteven merged 7 commits into
mainfrom
fix/3037-path-dependency-edge-capture

Conversation

@EffortlessSteven

@EffortlessSteven EffortlessSteven commented Aug 11, 2026 •

Copy link
Copy Markdown
Member

Summary

Fixes #3037. Makes the path-dependency edge capture landed in #3018 (squash
992e594e) typed, complete against an explicit denominator, and directly
fixture-proven, ahead of the #2969/#2970 consumers.

Typed edge record. The positional Vec<(String, String, String)> is
replaced by a named internal record in
crates/ripr/src/analysis/seam_cache.rs:

PathDependencyEdge {
    from_manifest: String,                      // repo-relative, `/`-separated
    section: PathDependencySection,             // Dependencies | DevDependencies | BuildDependencies
    target: Option<String>,                     // [target.<spec>...] key, if any
    dependency_name: String,
    declared_path: Option<String>,              // as spelled at the path authority
    resolved_path: Option<String>,              // lexical repo-relative identity
    resolution: PathDependencyResolution,       // Resolved | ResolvedOutsideWorkspace | TargetMissing | UnsupportedAbsolutePath | UnresolvedWorkspaceInheritance | InvalidDeclaration
    source: PathDependencySource,               // Package | WorkspaceInherited
}

Typed limitation record. path_dependency_limitations on
WorkspaceGraphProvenance is Vec<PathDependencyLimitation> with a
machine-visible PathDependencyLimitationKind
(NonUtf8ManifestPath | UnfollowedWorkspaceRedirect) plus a human-readable
detail string, so #2969/#2970 can branch on the kind instead of matching
prose. A non-empty list means path_dependency_edges is a partial inventory
and must not be treated as a complete path-dependency graph.

Exact V1 edge denominator. An edge is recorded for every path-bearing
dependency declaration visible in a scanned manifest:

  • dep = { path = "...", ... } inline tables in package [dependencies],
    [dev-dependencies], [build-dependencies] (target = None);
  • the same inline-table form under [target.<spec>.<section>]
    (target = Some(spec));
  • dep = { workspace = true } in any of those scopes whose nearest ancestor
    workspace root declares dep with a path in [workspace.dependencies]
    (source = WorkspaceInherited, resolved relative to the workspace root
    manifest directory, per Cargo).

Coverage / rejection matrix:

Cargo form V1 behavior
package [dependencies] / [dev-dependencies] / [build-dependencies] inline path handled (Package)
[target.<spec>.<section>] inline path handled, target scope recorded
[workspace.dependencies] entries authority only — no consumer, never edges
workspace = true with workspace path entry handled (WorkspaceInherited)
workspace = true with version-only workspace entry registry inheritance — no edge (not unresolved)
workspace = true with no authority found typed UnresolvedWorkspaceInheritance edge (visible gap, not silent)
string-form dep = "1.0" / table without path or workspace registry/git — out of denominator
duplicate declarations impossible within one TOML table (parse error); same dep across sections stays distinct edges; full sort + exact-record dedup is deterministic
path escaping the scan root ResolvedOutsideWorkspace, leading .. preserved
missing / non-directory target TargetMissing (checked with is_dir)
absolute POSIX or Windows path UnsupportedAbsolutePath, no fabricated repo-relative identity
non-UTF-8 manifest path no lossy conversion; edge capture skipped and one typed NonUtf8ManifestPath limitation added
[package] workspace = "..." redirect not followed; nearest-ancestor [workspace] manifest only, and a manifest whose workspace = true dependencies are affected contributes a typed UnfollowedWorkspaceRedirect limitation
entry with both path and workspace = true Cargo-invalid (verified against cargo metadata: Cargo rejects it when the name is absent from [workspace.dependencies], and otherwise the workspace entry's path wins — never the member's); retained as a typed InvalidDeclaration edge with no resolved identity
cycles preserved as distinct records; only exact duplicate records dedup — capture never erases a cycle

Differential proof against Cargo. A test builds a synthetic workspace in
a temporary directory, runs cargo metadata --no-deps --format-version 1 --offline, and asserts the resolver's extracted edge set (name, kind,
target, resolved directory identity) agrees with Cargo's path dependencies
for direct, workspace-inherited, dev, build, and target-specific
declarations. The test skips (does not fail) when no cargo binary is
available. The two test-only Command::new spawns are allowlisted in
policy/process_allowlist.txt with owner and reason.

Hash/currentness contract. package_graph_hash intentionally excludes
the edges (the hash predates the field and covers package/feature facts
only). Edges are recomputed on every provenance build; a discriminating test
pins that changing only a path value — or adding a target-specific path
dep — changes the edges while leaving package_graph_hash byte-identical.
The field doc records that consumers must not read hash stability as edge
stability.

No new dependencies (existing toml and serde_json crates only) and
no output-shape change: the records are pub(crate) and are not
projected into any CLI/JSON surface, so no goldens were re-blessed (zero
drift — see Proof).

Swarm / Source Boundary

  • ordinary feature, analyzer, editor, docs, spec, fixture, badge, dependency, or repo-ops development for ripr-swarm

Source-of-truth Links

Scope

  • Typed path-dependency edge capture plus typed capture limitations in
    crates/ripr/src/analysis/seam_cache.rs, with direct unit/fixture tests
    and one cargo metadata differential test; one policy allowlist entry
    for the two test-only cargo spawns.

Scope Classification

This PR is scoped by:

  • One production behavior

Production delta:

  • workspace_graph_provenance emits typed PathDependencyEdge records and
    typed PathDependencyLimitation records; { path, workspace = true }
    declarations are typed InvalidDeclaration edges instead of silently
    honoring the member's path; an unfollowed [package] workspace = "..."
    redirect on a manifest with workspace = true dependencies surfaces a
    typed UnfollowedWorkspaceRedirect limitation.

Evidence/support delta:

  • New direct tests over temporary workspaces plus one cargo metadata
    differential test; no golden or rendered-output change.

Single acceptance criterion:

  • For every path-bearing dependency declaration in a scanned manifest, the
    inventory carries a typed edge whose resolution matches Cargo semantics,
    and every capture gap is a typed, machine-visible limitation.

Non-goals:

Support-tier Impact

  • none

Claim/proof notes:

  • Internal pub(crate) records only; no README, release, docs, CLI, JSON,
    editor, CI, or package claim changes.

Policy Impact

  • process/network

Ledger or exception notes:

  • policy/process_allowlist.txt: two test-only Command::new spawns
    (cargo --version availability probe and cargo metadata --no-deps --offline) for the differential test, owned analysis/seam-cache. No
    production spawn, no new dependency, no network surface.

Proof

All run in an isolated branch worktree with RUSTC_WRAPPER="" and a private
CARGO_TARGET_DIR (the tested binary is provably built from this branch):

  • cargo test -p ripr --lib analysis::seam_cache — 64 passed, 0 failed,
    including the direct tests (package/dev/build sections, workspace
    inheritance resolved + unresolved + version-only exclusion, target-specific
    sections, governed forms distinct + deterministic, separator/space/
    non-ASCII normalization, absolute paths, outside-workspace + missing
    targets, cycles, non-UTF-8 manifest + workspace-authority boundary,
    hash exclusion) and the new tests: registry string/table forms exclusion,
    workspace-inherited absolute/outside/missing boundary statuses,
    workspace = true with no authority, path + workspace = true typed
    as InvalidDeclaration, unfollowed workspace redirect typed limitation,
    target dev-dependencies plus malformed target-table skips, and the
    cargo metadata differential test.
  • cargo test -p ripr --lib — 4175 passed, 0 failed.
  • cargo clippy -p ripr --all-targets -- -D warnings — clean.
  • cargo fmt --check — clean.
  • git diff --check — clean.
  • cargo xtask goldens check — exit 0, zero golden drift (no re-bless;
    the change touches no rendered output surface).
  • cargo xtask dogfood — exit 0.
  • cargo xtask precommit — exit 0 (includes check-no-panic-family,
    check-allow-attributes, check-file-policy, check-process-policy,
    check-network-policy, check-dependencies).
  • cargo xtask check-pr — exit 0.

Cargo-semantics confirmation (manual, cargo 1.95.0): on a synthetic manifest,
cargo metadata rejects { path = "../other", workspace = true } with
"error inheriting ... was not found in workspace.dependencies" when the
name has no workspace entry, and resolves the workspace entry's path
(ignoring the member's own path) when it does — so "explicit path wins" is
wrong in both cases and the form is typed InvalidDeclaration.

Claim Boundary

May be claimed after this PR: the V1 path-dependency inventory is typed,
total over its documented denominator, differentially proven against
cargo metadata for the supported forms, and every capture gap is a typed
limitation. Must not be claimed yet: any graph traversal, reachability, or
support decision derived from these edges (#2969/#2970 consume the records);
the records remain internal and are not a public output contract.

Rollback

Revert the branch commits touching
crates/ripr/src/analysis/seam_cache.rs and
policy/process_allowlist.txt. The records are pub(crate) with no
serialized, golden, schema, or output projection, so a plain revert restores
the prior behavior with no data migration or re-blessing.

Spec-Test-Code Traceability

  • Spec: n/a (internal capture contract documented on PathDependencyEdge)
  • Tests: analysis::seam_cache unit/fixture tests including the
    cargo metadata differential test
  • Code: crates/ripr/src/analysis/seam_cache.rs
  • Golden outputs: none (zero drift confirmed by goldens check)
  • Metrics: n/a
  • ADR/learning: n/a

Static Language Check

  • Static output avoids killed, survived, untested, proven, and adequate.
  • Unknowns include stop reasons where applicable.

CI Economics

n/a — no workflow, policy gate, branch protection, artifact, or CI cost
change.

Engineering Check

  • No new panic, unwrap, expect, todo, or unimplemented in production code.
  • No new panic, unwrap, expect, todo, or unimplemented in tests.
  • New non-Rust programming files are allowlisted with owner, surface, and reason. (none added)
  • New generated, dependency, process-spawn, or network surfaces are allowlisted with owner and reason. (two test-only cargo spawns allowlisted in policy/process_allowlist.txt; no network surface — --offline)
  • Errors are reported with actionable context.
  • Public JSON/schema changes are documented. (no public JSON/schema change)

Gates

  • cargo fmt --check
  • cargo test -p ripr --lib (4175 passed; workspace-wide cargo test --workspace not run — no other crate changed)
  • cargo clippy -p ripr --all-targets -- -D warnings
  • cargo xtask check-no-panic-family (via precommit)
  • cargo xtask check-allow-attributes (via precommit)
  • cargo xtask check-file-policy (via precommit)
  • cargo xtask check-process-policy (via precommit)
  • cargo xtask check-network-policy (via precommit)
  • cargo xtask check-dependencies (via precommit)
  • cargo xtask goldens check
  • cargo xtask dogfood
  • cargo xtask precommit
  • cargo xtask check-pr

Extension changes: none.

Held for the 0.11 release freeze; do not merge until the maintainer lifts the
hold.

Candidate head: 1fb677b

…3037)

Replace the positional (from_manifest, dep_name, resolved_path) tuple
landed in #3018 with a named PathDependencyEdge record carrying section
scope, target scope, declared/resolved repo-relative paths, a resolution
status, and a Package vs WorkspaceInherited source.

Define the exact V1 denominator: inline-table path dependencies in
package dependencies/dev-dependencies/build-dependencies, the same form
under target-specific sections, and workspace = true inheritance resolved
against the nearest ancestor workspace root's [workspace.dependencies].
Registry forms stay out of the denominator; unresolvable inheritance is a
typed UnresolvedWorkspaceInheritance edge; paths escaping the scan root
or missing on disk get explicit statuses; non-UTF-8 manifest paths
surface in a new path_dependency_limitations list instead of a
lossy-corrupted identity. Edges are fully sorted and exact-duplicate
deduplicated, so capture is deterministic and preserves cycles as
distinct records for later traversal (#2969/#2970).

Pin by discriminating tests that package_graph_hash excludes the
additive edges, and fixture-prove population, normalization, ordering,
workspace inheritance, target-specific sections, resolution statuses,
and the non-UTF-8 boundary over temporary multi-package workspaces.

Closes #3037.
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Aug 11, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@EffortlessSteven, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 32 minutes

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

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 319c273f-df90-40b7-9de7-58c17472a20d

📥 Commits

Reviewing files that changed from the base of the PR and between 1fb677b and 203fbc8.

📒 Files selected for processing (1)
  • crates/ripr/src/analysis/seam_cache.rs

Summary by CodeRabbit

  • New Features

    • Enhanced workspace provenance tracking for path-based dependencies.
    • Captures direct, inherited, and target-specific dependency relationships with richer metadata.
    • Reports resolved, missing, outside-workspace, absolute, and invalid dependency paths.
    • Records limitations for unsupported manifest path cases.
  • Reliability

    • Added deterministic sorting and duplicate removal for dependency relationships.
    • Improved path normalization and workspace inheritance handling.
    • Expanded validation for malformed declarations and resolution edge cases.

Walkthrough

Workspace provenance now captures typed Cargo path-dependency edges across direct, inherited, and target-specific declarations. It resolves paths lexically, records unsupported outcomes and limitations, sorts and deduplicates results, and validates behavior with focused workspace fixtures.

Changes

Path-dependency capture

Layer / File(s) Summary
Typed edge contract
crates/ripr/src/analysis/seam_cache.rs
Adds typed enums, PathDependencyEdge, and typed limitation records. WorkspaceGraphProvenance stores the new edge and limitation data while excluding path edges from package_graph_hash.
Manifest resolution and edge collection
crates/ripr/src/analysis/seam_cache.rs
Parses manifests before collection, builds workspace inheritance tables, captures direct and target-specific declarations, resolves paths lexically, and records invalid, missing, outside-workspace, absolute, and unresolved outcomes.
Capture behavior validation
crates/ripr/src/analysis/seam_cache.rs, policy/process_allowlist.txt
Tests coverage, normalization, ordering, deduplication, resolution states, encoding and redirect limitations, Cargo metadata parity, and hash exclusion. The test process-spawn entry is allowlisted.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CargoManifests
  participant WorkspaceAuthority
  participant PathEdgeCollector
  participant WorkspaceGraphProvenance
  CargoManifests->>WorkspaceAuthority: parse manifests and build inheritance tables
  WorkspaceAuthority->>PathEdgeCollector: provide direct and inherited declarations
  PathEdgeCollector->>WorkspaceGraphProvenance: store typed edges and limitations
Loading

Suggested labels: full-ci

Poem

Poem

A rabbit checks each manifest line,
And marks each path with types that shine.
Inherited trails and targets meet,
Missing roads get statuses neat.
Sorted edges rest in view,
While tests confirm the paths are true.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The implementation satisfies issue #3037 with typed edges, an explicit denominator, boundary handling, direct fixtures, deterministic results, and hash-currentness proof.
Out of Scope Changes check ✅ Passed The changes remain within issue #3037; the policy allowlist entry supports the added cargo metadata differential test.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The description follows the required template and provides scope, proof, limitations, rollback, policy impact, and release-freeze status.
Title check ✅ Passed The title clearly and concisely identifies the typed, fixture-proven path-dependency edge-capture fix.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/3037-path-dependency-edge-capture

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.

@coderabbitai coderabbitai 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.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/ripr/src/analysis/seam_cache.rs`:
- Around line 3050-3098: Add a dedicated cycle fixture test near path dependency
edge coverage, creating two packages where package a declares b via path="../b"
and package b declares a via path="../a". Invoke workspace_graph_provenance and
assert path_dependency_edges contains both distinct directed edges, confirming
cycle records are preserved without deduplication.
- Around line 1906-1927: Add a fixture covering nested workspaces where the
inner workspace lacks the requested dependency entry while an outer workspace
declares it, and assert that workspace_dependency_path preserves
nearest-workspace authority by returning unresolved inheritance rather than
falling back to the outer workspace. Use the existing fixture and assertion
conventions around workspace_dependency_path.
- Around line 1879-1898: Update resolve_repo_relative and its callers to detect
POSIX-absolute and Windows drive-prefixed declared paths before normalizing
components, and represent them as an explicit unsupported/boundary outcome
rather than a repo-relative identity. Preserve explicit evidence for the skipped
or unsupported dependency, and add a fixture covering both absolute path forms
using the chosen PathDependencyResolution or path_dependency_limitations
behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 01d0b0a5-f0ed-4e35-89f3-02581f69ab00

📥 Commits

Reviewing files that changed from the base of the PR and between 7bffa52 and 79be274.

📒 Files selected for processing (1)
  • crates/ripr/src/analysis/seam_cache.rs

Comment thread crates/ripr/src/analysis/seam_cache.rs Resolved
Comment thread crates/ripr/src/analysis/seam_cache.rs Resolved
Comment thread crates/ripr/src/analysis/seam_cache.rs Resolved
@codecov

codecov Bot commented Aug 11, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.75673% with 58 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/ripr/src/analysis/seam_cache.rs 93.75% 58 Missing ⚠️

📢 Thoughts on this report? Let us know!

@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: 79be2741a4

ℹ️ 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 crates/ripr/src/analysis/seam_cache.rs Resolved

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Exact-head review record (review-pr) — held for the release freeze, not a merge signal:

reviewed_head_sha: 79be274
integration_basis: origin/main c8e3e18
claim_boundary: type and fixture-prove the #3018 path-dependency edge inventory per #3037; no output-surface or hash-contract change
changed_surfaces_and_semantic_owners_inspected: crates/ripr/src/analysis/seam_cache.rs only (+753/−29): PathDependencyEdge/Source/Resolution types, two-pass collection, 9 direct tests, WorkspaceGraphProvenance field docs
blocking_findings: none
non_blocking_suggestions: none
refuted_or_stale_findings: none
proof_and_ci_observed: reviewer-verified at the exact head in the candidate worktree — the V1 denominator doc (seam_cache.rs:1620-1655) matches the issues acceptance matrix including the never-silent boundaries (UnresolvedWorkspaceInheritance / ResolvedOutsideWorkspace / TargetMissing / non-UTF-8 limitation path); cargo test -p ripr --lib analysis::seam_cache54/54; the hash-exclusion discriminatorpackage_graph_hash_excludes_path_dependency_edgespasses (pins that edge changes do not move package_graph_hash);cargo xtask goldens checkexit 0 with target/ripr/reports/goldens.md Status: pass (zero drift, additive-only field); builder full lib 4165/4165 and clippy clean corroborate proof_or_review_missing: required CI lane pending on this head affected_currentness_dimensions: none since push residual_assumptions_and_non_claims:[package] workspace = "..."` redirect is a documented V1 non-goal; exact-duplicate dedup is covered by determinism tests since duplicate TOML keys are parse errors; edges are not yet walked by #2969/#2970 consumers, as intended
disposition: REVIEW_READY (merge held by the 0.11 release transaction freeze)

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Reviewed the repair from four angles: (1) data integrity — absolute POSIX and drive-prefixed paths no longer acquire fabricated repo-relative identities; (2) semantic correctness — the edge remains visible with UnsupportedAbsolutePath and resolved_path = None; (3) coverage — both absolute forms, nearest-workspace authority, and a two-edge dependency cycle are now fixture-backed; (4) compatibility — relative, outside-root, missing-target, inherited, target-specific, hash-exclusion, and non-UTF-8 cases remain covered. The change is narrow and does not project this internal record into output surfaces. Awaiting the exact-head hosted gates before approval/merge.

@EffortlessSteven

Copy link
Copy Markdown
Member Author

Release hold disposition (2026-08-11): this PR is outside the selected 0.11.0 transaction. It is not one of the required W4 proof-oracle repairs or the post-W3 recovery lane, and it was not included in rejected W3 (14ba3a45c633a5dba19c4b3e4acd4add98ff80a8). It must remain out until the history-preserving J/K sync and back-sync complete. Closing this PR only; its branch is retained for reopening/restacking after K.

Copy link
Copy Markdown
Member Author

Failure disposition and verification update:

  • The first repair head failed Test Analytics because the absolute Windows fixture literally contained C:/shared; check-local-context correctly rejected that source spelling as local machine state. This was a fixture defect, not a production or semantic test failure.
  • The fixture now assembles the drive-prefixed path at runtime, preserving the assertion without tripping repository policy.
  • The next head also received the exact rustfmt normalization required by cargo fmt --check.
  • Replacement evidence is green for Test Analytics, Coverage, Security, Source of Truth, PR Plan, and the routed job's required Rust gates. UB review is still running; the PR remains under the explicit 0.11 release-freeze hold in its description.

The path-resolution defect and all review-requested coverage gaps are addressed; no merge is being forced through the active release hold.

@EffortlessSteven

Copy link
Copy Markdown
Member Author

Correction to the prior hold comment: this PR remains open. It is still outside the pinned 0.11.0 candidate and must not merge during the release hold, but its branch is intentionally preserved in its current PR for post-K/back-sync reopening or restacking.

…ainst cargo metadata (#3037)

- treat { path, workspace = true } as a typed InvalidDeclaration edge
  (cargo rejects the form without a workspace entry and otherwise the
  workspace path wins; the member's explicit path never wins)
- emit a typed UnfollowedWorkspaceRedirect limitation when a manifest
  with [package] workspace = "..." declares workspace = true deps
- change path_dependency_limitations to typed PathDependencyLimitation
  records (NonUtf8ManifestPath | UnfollowedWorkspaceRedirect + detail)
- add a cargo metadata --no-deps --offline differential test over a
  synthetic workspace (direct, workspace-inherited, dev, build, and
  target-specific path deps), skipping when cargo is unavailable
- cover the remaining untested branches: registry string/table forms,
  workspace-inherited absolute/outside/missing statuses, workspace=true
  with no authority, target dev-dependencies and malformed target
  tables, non-UTF-8 workspace authority skip, stacked .. resolution
- allowlist the two test-only Command::new cargo spawns in
  policy/process_allowlist.txt
@coderabbitai coderabbitai Bot added the full-ci Run required, advisory, and release-like CI lanes. label Aug 11, 2026

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/ripr/src/analysis/seam_cache.rs`:
- Around line 3744-3756: Update path_dependency_edges_match_cargo_metadata so a
missing or unusable cargo binary returns an error by default instead of Ok(()).
Allow the existing skip only when an explicit environment-variable opt-out is
set, and keep the skip reason visible; use the test’s existing error result type
and clearly identify the opt-out configuration.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: d6693579-0ed1-48c5-a829-c6f62550d1a9

📥 Commits

Reviewing files that changed from the base of the PR and between 79be274 and 1fb677b.

📒 Files selected for processing (2)
  • crates/ripr/src/analysis/seam_cache.rs
  • policy/process_allowlist.txt

Comment thread crates/ripr/src/analysis/seam_cache.rs Resolved

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Exact-head review — REVIEW_READY

reviewed_head_sha: 1fb677b00004204a4c5ee877f1132366a608e44d
integration_basis: main (rolling; outside pinned W4 candidate — does not retarget 0.11.0)
claim_boundary: finish the proof and limitation contract for typed path-dependency
  edge capture (#3037). No seam_cache.rs module extraction (deliberate follow-up).
changed_surfaces_and_semantic_owners_inspected:
  - crates/ripr/src/analysis/seam_cache.rs (+560/−33 incl. tests)
  - policy/process_allowlist.txt (+1: two test-only cargo spawns, owner
    analysis/seam-cache, reason recorded; no production spawn, no network — --offline)
blocking_findings: none
non_blocking_suggestions: none
refuted_or_stale_findings:
  - The codecov "35 missed lines" was not reproducible: the patch upload marks
    long-covered lines as missed (stale/erroneous instrument). Fallback branch audit
    was performed instead; every identified branch was reachable-semantic and got a
    test — none classified defensive without reason. codecov/patch now passes on this head.
  - "Cargo rejects {path, workspace = true}": refined by direct experiment — Cargo
    rejects it only when the name is absent from [workspace.dependencies]; otherwise
    the workspace entry wins. The decided semantics (InvalidDeclaration, member path
    never honored) are correct in both cases and the code comment records both.
proof_and_ci_observed:
  - Required check `Ripr Rust Small Result` pass on the exact head. Substantive lanes
    terminal-pass: rust-tests-junit, rust-coverage, ub-review, source-of-truth,
    windows-advisory, codecov/patch. Two advisory/duplicate attempts (`rust` CI job,
    a re-triggered Ripr Rust Small run) remain pending at merge time — the required
    discriminator on the exact head is green; pendings are not failures.
  - Independent reviewer verification (not builder self-report): semantic hunks read
    at the exact head — UnfollowedWorkspaceRedirect emitted only when a redirect is
    declared AND inherited > 0; {path, workspace=true} yields InvalidDeclaration with
    declared_path retained and resolved_path None; string-form and non-path table
    deps correctly skipped. 64/64 analysis::seam_cache tests re-run green in the
    isolated worktree, including the live `cargo metadata --no-deps --offline`
    differential over direct/workspace-inherited/dev/build/target-specific forms.
  - Builder gates: ripr lib 4175 passed, clippy -D warnings clean, goldens check
    zero drift, dogfood pass, precommit pass, check-pr pass, fmt/diff clean.
proof_or_review_missing: workspace-wide `cargo test --workspace` not run by builder
  (only -p ripr; no other crate changed) — accepted, CI workspace lanes are green.
affected_currentness_dimensions: production implementation, test stimulus, test
  oracle, policy metadata — all refreshed at 1fb677b0.
residual_assumptions_and_non_claims:
  - PathDependencyLimitation is pub(crate) and not projected into any public
    JSON/schema surface — no output-contract change.
  - Follow-up required before #2969: extract the path-dependency parser/resolver
    into an owned submodule so seam_cache.rs does not absorb the path-graph programme.
disposition: REVIEW_READY

EffortlessSteven added a commit that referenced this pull request Aug 11, 2026
…3171)

* Revert "docs(schema): reference the central output::schemas registry from OUTPUT_SCHEMA.md (#2975) (#3144)"

This reverts commit 9f0682f.

* Revert "feat(output): introduce central output::schemas registry for agent-artifact versions (#2973) (#3125)"

This reverts commit 1ee2d7d.

* Revert "fix(analysis): type and fixture-prove path-dependency edge capture (#3037) (#3134)"

This reverts commit 7e0c662.

* Revert "fix(specs): judge proposed-spec age from Git history, not mtime (#3035) (#3127)"

This reverts commit 1487477.
EffortlessSteven added a commit that referenced this pull request Aug 28, 2026
)

* fix(analysis): re-land typed path-dependency edge capture (#3037)

Re-lands the reverted #3134 on current main with the reviewed V1
denominator intact:

- PathDependencyEdge replaces positional (from, dep, path) tuples with
  typed section/target/resolution/source fields;
- workspace-inherited and target-specific declarations are captured or
  visibly limited (UnresolvedWorkspaceInheritance,
  UnfollowedWorkspaceRedirect, NonUtf8ManifestPath);
- absolute/outside-workspace/missing targets stay explicit edges, never
  silently dropped or lossy-converted;
- edges sort deterministically and dedupe; cycles survive capture;
- package_graph_hash deliberately excludes the edge inventory and the
  contract is pinned by a discriminating test;
- direct fixture matrix proves every denominator row against emitted
  records, including a cargo-metadata offline differential.

Fixes #3037

* docs(analysis): separate path-dep helper doc comments

Review repair on the re-land candidate: the resolve_repo_relative doc
block had fused into is_absolute_declared_path's, leaving the resolver
undocumented. No behavior change; 62/62 seam_cache tests still pass.

* fix: preserve host path semantics for dependency edges

* test: pin Unix dependency path semantics

* docs: clarify cargo differential opt-out

* fix: disclose incomplete dependency captures

* test: make absolute path fixture host-aware

* fix(analysis): make path-dependency resolution host-honest

The seam-cache path-dependency capture normalized backslashes in every
declared path before recording it, which misrecorded the manifest's raw
declaration on Windows-style spellings and applied Unix separator rules
on Windows hosts. is_absolute_declared_path also relied on host Path
semantics alone, so a POSIX-rooted /opt/shared was treated as
repo-relative on Windows hosts and misclassified TargetMissing.

Record the declaration exactly as spelled in the manifest, resolve
through a host resolution form (backslashes normalized to slashes only
on Windows hosts), and recognize /-rooted paths as absolute on every
host. Pins the documented contract:
path_dependency_edges_normalize_separators_spaces_and_non_ascii,
path_dependency_edges_workspace_inherited_boundary_statuses, and
path_dependency_edges_keep_absolute_paths_explicit now pass on Windows
and Unix.

* test(analysis): fix backslash escaping in unix-only path expectations

The normalize test's non-Windows expectation spelled two literal
backslashes where the TOML declaration decodes to one, and the unix
helper test paired a two-backslash input with a one-backslash
expectation. Both are escape-count typos in the test literals; the
contract is unchanged: a declared backslash is a literal filename
character on Unix and resolves as a separator only on Windows hosts.

* test(analysis): build the drive-rooted fixture path at runtime

check-local-context rejects drive-letter path literals in source, and
the allowlist validator categorically refuses to permit them, so the
declared-path and unix resolved-path assertions now reuse the same
runtime-constructed fixture value the manifest already uses. No
contract change.

* docs(analysis): clarify InvalidDeclaration source wording

The edge still records where the declaration was seen (source =
Package); what it never becomes is a resolvable package path edge.
State that explicitly so the taxonomy cannot be read as contradicting
the recorded source.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full-ci Run required, advisory, and release-like CI lanes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(analysis): make landed path-dependency edge capture complete, typed, and fixture-proven

1 participant