Skip to content

fix(scan): finalize tier1 reachability scan from socket scan reach#1331

Open
Benjamin Barslev Nielsen (barslev) wants to merge 1 commit into
v1.xfrom
barslev/rea-454-scan-reach-finalize
Open

fix(scan): finalize tier1 reachability scan from socket scan reach#1331
Benjamin Barslev Nielsen (barslev) wants to merge 1 commit into
v1.xfrom
barslev/rea-454-scan-reach-finalize

Conversation

@barslev
Copy link
Copy Markdown
Contributor

@barslev Benjamin Barslev Nielsen (barslev) commented May 24, 2026

Summary

socket scan reach (standalone reachability analysis) spawns Coana, which registers a tier1 reachability scan row via the Socket backend. Until now socket-cli never followed that up with a finalize call from this flow — there was no full-scan id to bind to, so the row stayed at an intermediate post-Coana state forever and looked identical to a stuck scan create --reach.

With the tier1 reachability finalize endpoint now accepting a null report_run_id, socket scan reach can drive the row to its DONE terminal state directly. The intermediate post-Coana state becomes an unambiguous "something went wrong" signal again.

Changes

  • src/commands/scan/finalize-tier1-scan.mts — broaden the second argument from string to string | null (mirrors the finalize endpoint's relaxed schema). No-op for existing call sites that pass a real scan id.
  • src/commands/scan/handle-scan-reach.mts — after performReachabilityAnalysis returns successfully and yields a tier1ReachabilityScanId, POST /tier1-reachability-scan/finalize with report_run_id: null. Failure logs a warn and falls through to the normal output (this is metadata-only; never block the user-visible result on it).
  • src/commands/scan/handle-scan-reach.test.mts — mock the new dependency and add two focused tests: one verifying finalizeTier1Scan('tier1-id', null) is invoked when Coana emits a scan id, one verifying it is NOT called when Coana emits undefined.

Test plan

  • pnpm check:tsc clean
  • pnpm test:unit src/commands/scan/handle-scan-reach.test.mts — 6/6 (4 existing + 2 new)
  • pnpm test:unit src/commands/scan/ — 177/177

Note

Medium Risk
Replaces core build/lint/CI and packaging entrypoints, which can break releases or developer workflows if any config mismatch slips through. No direct product logic changes are evident, but the surface area touched (Rollup, ESLint, GitHub Actions, bins) is broad.

Overview
Reworks the project’s build + distribution pipeline by adding new Babel/Rollup configs (including dist bundling that copies/rewires external/ deps) and switching runtime entrypoints to new bin/*.js wrappers that execute the built dist outputs.

Overhauls developer tooling and CI: replaces legacy ESLint setup with a flat eslint.config.js, adds Biome/Oxlint configs, new .env.* profiles, Husky hooks (lint-staged + commit PII guard), and new GitHub Actions workflows for lint/typecheck/test/e2e and npm publish with provenance.

Repo hygiene/docs updates: expands .gitignore/.editorconfig, removes old cli.js + lib/ command implementation, drops Dependabot config, and refreshes README.md/CHANGELOG.md plus a new Claude skill for bumping @coana-tech/cli.

Reviewed by Cursor Bugbot for commit 129adae. Configure here.

`socket scan reach` invokes Coana which registers a tier1 reachability
scan row on the backend. Until now socket-cli never followed up with a
finalize call from this flow because there was no full-scan id to bind
to, so every standalone reachability run left the row at an
intermediate post-Coana state indistinguishable from a stuck run.

Now that the backend's `tier1-reachability-scan/finalize` endpoint
accepts a null `report_run_id` for flows that have no full scan, call
it from `handle-scan-reach.mts` once Coana has emitted the tier1
reachability scan id. The standalone reachability row reaches its DONE
terminal state, and "stuck at the intermediate state" becomes an
unambiguous signal of a real problem rather than a normal `scan reach`
outcome.

Broaden the `finalizeTier1Scan` wrapper signature so the second
argument is `string | null`. Best-effort: a finalize failure logs a
warning but does not block the user-visible reachability output.
@barslev Benjamin Barslev Nielsen (barslev) changed the base branch from main to v1.x May 24, 2026 05:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant