Skip to content

tech-detect: merge the local whole-bundle scan into the signed-in cloud technologies section #1406

Closed

Description

@nc9

What

Follow-up to #1387 (PR #1392). A signed-in audit shows the cloud technologies section, built from a payload cut to 64 KB per bundle, 512 KB per page and 1 MB per audit, so it still misses what the free local scan now finds in whole bundles (for example posthog, svelte and vue development builds, and a framework deep in a large Vite bundle). #1392 only makes that cut visible (technologies.truncated carries the byte reasons on the cloud section). The local scan runs only when the cloud one is off or skipped.

Acceptance Criteria

  • A signed-in audit (cloud technologies on) reports the technologies the local whole-bundle scan finds, as well as what the cloud service found, in one section.
  • The cross-scan history (added, removed, firstScan) of the cloud section is kept, and a technology found only locally is marked as such where the history applies (it has no scan diff).
  • The local scan's bytes are not sent to the cloud service: only its result is merged (the payload caps stay).
  • technologies.truncated describes the merged section honestly: the cloud payload's cut no longer reads as a limit once the local scan covered those bundles.
  • A test with a bundle past the payload cap (a fingerprint at 400 KB) shows it detected on a signed-in audit with the cloud client stubbed.
  • Docs (docs/cloud/technologies.mdx) describe the merge.

nik

Activity

  1. added
    enhancement
    size: M
    on Oct 31, 2026
  2. added theissue type on Oct 31, 2026
  3. nc9 commented on Nov 4, 2026

    @nc9
    ContributorAuthor

    Acceptance check against main 26432b6 (merge landed as e417b7f, 3a908ef, 0540a2c and 9a914c3, first released in v0.0.166):

    # Criterion Result Evidence
    1 Signed-in audit reports local whole-bundle finds beside the cloud's, one section PASS apps/cli/src/controllers/audit.ts builds report.technologies with resolveTechnologiesSection(techResult?.technologies ?? null, ...), which always runs the local scan and calls mergeLocalTechnologies (apps/cli/src/audit/cloud.ts). tech-detect-merge-local-1406.test.ts "a technology only the local scan found is added, marked local, and has no scan diff"
    2 Cloud history kept; local-only marked PASS Same test asserts added, removed, firstScan, scannedAt come from the cloud and the local-only item is not in added. Marker in every format: tech-local-origin-1406.test.ts "every human-readable format marks a local-only technology" (text, markdown, html, llm and xml), console-tech-local-origin-1406.test.ts, JSON origin: "local" with schema 1.6 (JSON_REPORT_SCHEMA_VERSION), hostile values never emitted
    3 Local bytes not sent; payload caps stay PASS mergeLocalTechnologies takes only the local ReportTechnologies result. The 400 KB test asserts the stubbed client received under 200,000 bundle bytes of an 800 KB bundle and still has truncated.reasons containing bundle-bytes
    4 truncated describes the merged section PASS "the cloud payload's cut stops being a limit once the local scan read the bundles; the local scan's own cut is reported" (both branches), "with no local result the cloud section is returned as it was, cut included", and "a signed-in merge keeps script-limit instead of deleting the cloud's disclosure"
    5 Test: fingerprint at 400 KB detected on a signed-in audit, cloud client stubbed NOT TICKED The case "the local scan finds it, the merged section lists it beside the cloud's, and the bytes are not sent" is real: the stubbed client, runCloudTechDetect, the local scan and the merge, with the fingerprint 400 KB into an 800 KB bundle, asserting origin local, cloud items intact and no truncated. But it is not a signed-in audit. It calls detectLocalTechnologies and mergeLocalTechnologies by hand instead of resolveTechnologiesSection (the function the audit command calls), and no test runs the audit command with a stubbed cloud client. If the controller stopped passing the local scan or the cloud result, every #1406 test would stay green
    6 Docs describe the merge PASS docs/cloud/technologies.mdx (the truncated bullet) describes the one merged section, the kept history, the origin: "local" marker per format, no scan diff, bytes never sent, and the new truncated meaning; docs/configuration/output.mdx documents schema 1.6 and technologies.items[].origin

    Ran on main, sequentially: tech-detect-merge-local-1406.test.ts, console-tech-local-origin-1406.test.ts, tech-local-origin-1406.test.ts and json-pages-1260.test.ts, 30 pass, 0 fail (local bun 1.4.3).

    Gap for box 5: either point the 400 KB case at resolveTechnologiesSection(cloud.technologies, { baseUrl, siteContext, scripts }) so it exercises the exact composition the audit uses, or add a stubbed-cloud audit-level test that asserts report.technologies contains the local-only item. Either closes the box.

    Also noticed, not graded: the table in docs/cloud/technologies.mdx still says the local scan runs only "where the cloud scan did not run", which contradicts the merge text lower on the page (the local scan now always runs). Worth a one-line fix with the test change.

    nik

  4. nc9 commented on Nov 11, 2026

    @nc9
    ContributorAuthor

    Box 5 is covered on main by d65019d: the controller-path test in tech-detect-merge-local-1406.test.ts runs runCloudTechDetect with a stubbed client and then resolveTechnologiesSection with the audit command's limits, on a bundle with a fingerprint 400 KB in, and asserts the local origin, an intact cloud list and no truncation (9 pass). The same commit fixed the docs table row.

    nik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    clienhancementsize: M

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions