Skip to content

[DIT-13468]: Send scanned path scope in the CLI scan - #156

Open
laurakoye wants to merge 3 commits into
masterfrom
laura/dit-13468-send-scanned-path-scope-in-the-cli-scan
Open

[DIT-13468]: Send scanned path scope in the CLI scan#156
laurakoye wants to merge 3 commits into
masterfrom
laura/dit-13468-send-scanned-path-scope-in-the-cli-scan

Conversation

@laurakoye

@laurakoye laurakoye commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Overview

ditto scan now tells the server where it looked, so a later scan only reconciles code links inside the scanned scope instead of assuming everything it didn't see was deleted.

Two fields on POST /v2/scan, alongside the repoRelativeRoot that shipped in #155:

scan target repoRelativeRoot scannedAllPaths scannedPaths
repo root "" true omitted
subdirectory src "src" false ["src"]
not a git repo omitted omitted omitted

scannedPaths entries are relative to the repo root, matching what ditto-app #9391 validates. Where the scope is omitted, the server's scannedAllPaths: false default applies, so such a scan can never mark a code link removed.

ditto scan takes one path, so scannedPaths is always a one-element list restating repoRelativeRoot. Sent anyway so DIT-13449's reconcile has one shape to code against.

Bumps the package to 5.8.1 — nothing user-visible changes.

Context

  • DIT-13468
  • Needs ditto-app #9391 to verify — until it merges, zod strips both fields at the API boundary. Safe to merge before that; the server just ignores them.

Test Plan

Against a local app on the #9391 branch. Records checked in Compass: ditto_db_v2producttextdetections, filter { repoKey: { $exists: true } }.

  • yarn test lib/src/http/scan.test.ts
  • yarn scan ~/Desktop/Ditto/v0-demorepoRelativeRoot: "", scannedAllPaths: true, no scannedPaths
  • yarn scan ~/Desktop/Ditto/v0-demo/srcrepoRelativeRoot: "src", scannedAllPaths: false, scannedPaths: ["src"]
  • yarn scan /tmp/not-a-repo → no git fields on the record

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.

2 participants