Skip to content

fix(drift): resolve cited paths in every frame they are legitimately written in (0.1.0-alpha.14) - #44

Merged
jaruesink merged 3 commits into
mainfrom
fix/drift-path-resolution-frames
Aug 9, 2026
Merged

fix(drift): resolve cited paths in every frame they are legitimately written in (0.1.0-alpha.14)#44
jaruesink merged 3 commits into
mainfrom
fix/drift-path-resolution-frames

Conversation

@jaruesink

Copy link
Copy Markdown
Contributor

Takes asks 1–5. pathIssues is still NOT wired into the verdict — reasoning below.

Drift resolved every reference from the repo root plus two fixed ancestors; your measurement put the FP floor near 60%. scripts/lib/path-resolution.ts now collects the frames a reference may legitimately resolve in — workspace package roots (from workspaces / pnpm-workspace.yaml), ancestor roots, declared package names, tsconfig paths aliases — and reports only references that resolve nowhere.

Path issues on the fixture repos, 87 → 30

Repo before after
vision 6 1 must stay quiet ✓
watchtower 7 0 must stay quiet ✓
currychat 1 0 must stay quiet ✓
forge 1 1 see §3 below
lc-classic-starter 3 0
recall 11 1
360training 43 19 remainder is §3 illustrative + 1 real
atlas 15 9 scaffolded-but-absent

~ is matched against tsconfig aliases before $HOME, since both meanings are live in the fleet.

Two corrections to the diagnosis

Ask 4 is not about the scheme. PATH_PATTERN is \b-anchored, and there is no word boundary between a delimiter and a leading dot — so the dot is lost whether or not mdc: is stripped. My first attempt removed the scheme and changed nothing. Restoring a dropped leading dot at resolution time is what actually fixes it, and it covers every dot-prefixed path, not just Cursor's.

@360training/ui is not a false positive. That workspace publishes @t360/*; the only @360training/* package is cloudflare-proxy. It's a stale specifier and stays flagged, correctly. Ask 2 clears the genuinely-declared names (@wt/ui etc.) and leaves this one.

§3 calls

  • Prescriptive paths in pattern docs — declined. A golden test already encodes the opposite contract: pattern docs skip cross-project examples but keep missing local doc refs. One forge example isn't enough to overturn a tested decision, so data/action-log.md stays flagged.
  • Illustrative filenames — left as issues; not mechanically separable from real refs.
  • Cross-repo root refs — now resolve via ancestor roots, so they're silent.
  • Scaffolded-but-absent (atlas) — agree, real.

Why not wire scoring

28 of the 30 remaining sit in two repos, in exactly the classes §4 says are unsorted. Wiring now would import that.

Verify

lint · format:check · release:pin --check · typecheck · 513 pass / 0 fail · verify:self-audit-proof.

🤖 Generated with Claude Code

jaruesink and others added 2 commits August 9, 2026 14:10
…written in

Drift resolved every reference from the repo root plus two fixed ancestors, and
measurement put the false-positive floor near 60%. Instruction files cite paths
in frames that resolution never tried.

scripts/lib/path-resolution.ts collects those frames — workspace package roots
read from package.json `workspaces` and pnpm-workspace.yaml, ancestor roots,
declared package names, and tsconfig `paths` aliases — and a reference is only
reported when it resolves NOWHERE.

Measured on the eight fixture repos, path issues 87 -> 30:

  vision              6 -> 1     watchtower          7 -> 0
  currychat           1 -> 0     lc-classic-starter  3 -> 0
  360training        43 -> 19    atlas              15 -> 9
  recall             11 -> 1     forge               1 -> 1

All four must-stay-quiet repos are quiet. `~` is matched against tsconfig
aliases BEFORE $HOME, because both meanings are live: currychat's is an alias,
lc-classic-starter's is a home, and expanding unconditionally only trades one
false-positive class for another.

Two corrections to the brief's diagnosis, both found by measuring:

The `mdc:` fix is not about the scheme. PATH_PATTERN is `\b`-anchored and there
is no word boundary between a delimiter and a leading dot, so the dot is lost
whether or not `mdc:` is stripped — my first attempt removed the scheme and
changed nothing. Restoring a dropped leading dot at resolution time is what
actually fixes it, and it covers every dot-prefixed path, not just Cursor's.

`@360training/ui` is not a declared package name and so is not a false positive.
That workspace publishes `@t360/*`; the only `@360training/*` package is
cloudflare-proxy. It is a stale specifier and stays flagged, correctly.

Not taken: making pattern-doc references non-issues. A golden test already
encodes the opposite contract — pattern docs skip cross-project examples but
KEEP missing local doc refs — and one forge example is not enough to overturn a
tested decision. forge's `data/action-log.md` therefore stays flagged.

pathIssues is still NOT wired into the verdict. 28 of the remaining 30 sit in
two repos and belong to classes nobody has sorted yet.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 52 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 80a4f3de-276c-41dc-96ad-cd61f122ff2b

📥 Commits

Reviewing files that changed from the base of the PR and between f5e2ae7 and 9b61830.

📒 Files selected for processing (2)
  • scripts/lib/path-resolution.test.ts
  • scripts/lib/path-resolution.ts
📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Improved path validation across workspace, package, alias, absolute, and extensionless references.
    • Added support for recognizing paths in excluded directories and scanner-normalized references.
  • Bug Fixes

    • Reduced false positives when validating legitimate paths that were previously reported as missing.
    • Improved handling of unresolved or inaccessible configuration and filesystem paths.
  • Documentation

    • Updated setup, CLI, verification, and proof guidance to reference version 0.1.0-alpha.14.
    • Clarified pinned-version validation for retained proof packets.
  • Release

    • Advanced the package version to 0.1.0-alpha.14.

Walkthrough

The package version changes to 0.1.0-alpha.14. Proof documentation uses the new version. Drift detection gains shared path resolution for workspaces, aliases, packages, skipped directories, and normalized references, with comprehensive tests.

Changes

Alpha.14 release and path drift resolution

Layer / File(s) Summary
Update alpha.14 release references
package.json, README.md, docs/*, docs-site/*
Package metadata and proof documentation now reference 0.1.0-alpha.14.
Build shared path-resolution context
scripts/lib/path-resolution.ts
The resolver recognizes repository roots, workspaces, package specifiers, TypeScript aliases, skipped directories, home paths, and common file extensions.
Use resolution during drift detection
scripts/drift-detect.ts, scripts/lib/path-resolution.test.ts
Drift detection excludes skipped or resolvable references. Tests cover valid, aliased, package-based, normalized, and missing paths.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

  • lambda-curry/anvil#26: Related CLI documentation and drift-detection documentation changes.
  • lambda-curry/anvil#27: Directly related changes to prevent false-positive path drift for skipped or unresolvable paths.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the drift path-resolution fix and includes the relevant release version.
Description check ✅ Passed The description gives a detailed change summary, verification results, scope decisions, and follow-up risk information.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/drift-path-resolution-frames

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: 2

🤖 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 `@scripts/lib/path-resolution.ts`:
- Around line 129-139: Update ancestorRoots to retain only ancestor directories
containing a repository or workspace marker, such as package.json or .git,
instead of adding every parent. Preserve the existing depth and
filesystem-boundary limits, and add a fixture covering an intermediate non-root
parent with a matching path so it remains reported as drift.
- Around line 154-183: Update collectAliases to process every declared
compilerOptions.paths alias, not only tilde-prefixed entries, and resolve each
target relative to compilerOptions.baseUrl when set or the containing tsconfig
directory otherwise. Preserve alias prefixes and add fixtures covering both an
explicit baseUrl and the unset-baseUrl fallback.
🪄 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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: cce5bbb0-c7c9-4ec5-8790-fec40a4070a0

📥 Commits

Reviewing files that changed from the base of the PR and between 0858a53 and f5e2ae7.

📒 Files selected for processing (12)
  • README.md
  • docs-site/public/llms-full.txt
  • docs-site/src/content/docs/reference/cli.md
  • docs/byok-trust-model.md
  • docs/first-user-proof-packet.md
  • docs/first-user-proof.md
  • docs/getting-started.md
  • docs/proofs/current-outside-tester-send-packet.md
  • package.json
  • scripts/drift-detect.ts
  • scripts/lib/path-resolution.test.ts
  • scripts/lib/path-resolution.ts

Comment thread scripts/lib/path-resolution.ts
Comment thread scripts/lib/path-resolution.ts
Two CodeRabbit findings on #44, both valid.

ancestorRoots accepted every parent for four levels while its own comment
claimed a package.json/.git test. On these hosts ~/projects holds many repos, so
a genuinely missing path could resolve against an unrelated sibling and vanish
from the report — trading a false positive for a false negative, which is the
worse direction. The documented test is now the implemented one.

resolvesSomewhere applied only tilde-prefixed aliases, so `@/file.ts` and
`#/lib/y` were still reported as drift, and collectAliases ignored baseUrl.
Every declared alias now applies, resolved against baseUrl when set. `~` is
still tried as a home directory, but only after aliases.

Neither cost coverage: fixture totals 30 -> 29, with 360training 19 -> 17 from
the alias generalization and no repo regressing.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@jaruesink
jaruesink merged commit 4295f8f into main Aug 9, 2026
3 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