Skip to content

fix: exempt bundled dist artifacts from no-cloud self-scan (0.4.2)#14

Open
andrei-hasna wants to merge 1 commit into
mainfrom
fix/no-cloud-self-scan-dist
Open

fix: exempt bundled dist artifacts from no-cloud self-scan (0.4.2)#14
andrei-hasna wants to merge 1 commit into
mainfrom
fix/no-cloud-self-scan-dist

Conversation

@andrei-hasna

Copy link
Copy Markdown
Contributor

Problem

@hasna/contracts failed its own no_cloud_guard conformance check (and bun test had 3 failures). The no-cloud scanner whitelisted a hardcoded set of dist/ files carrying the forbidden-runtime pattern strings as bundled declaration literals. When service-contract, mode, and conformance were added as build entrypoints, the bundler inlined those declarations into their dist outputs, but the whitelist was not updated — so the package flagged itself.

Fix

Match the two declaration source modules (src/no-cloud.ts, src/schemas.ts) explicitly and treat any dist/ build artifact generically. Still gated by the >=2 declaration-marker check and the @hasna/contracts package guard, so downstream packages cannot bypass the scan.

Also bumped CONTRACTS_PACKAGE_VERSION to 0.4.2 to match package.json (caught by the dist smoke test).

Verification

  • bun run verify:release green: typecheck, 142 tests (0 fail), conformance, build, dist smoke, pack.
  • Published @hasna/contracts@0.4.2; fresh bun add resolves and the published CLI self-scan returns verdict: passed.

The no-cloud scanner whitelisted a hardcoded set of dist/ files that carry
the forbidden-runtime pattern strings as bundled declaration literals. When
service-contract, mode, and conformance were added as build entrypoints, the
bundler inlined those declarations into their dist outputs, but the whitelist
was not updated, so the package failed its own no_cloud_guard conformance
check. Match the two declaration source modules explicitly and treat any dist/
build artifact generically, still gated by the >=2 declaration-marker check
and the @hasna/contracts package guard so downstream packages cannot bypass.
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