Skip to content

Make source-policy gates cover every bundled source extension or ban JS under src #152

Description

@Brad-Edwards

Review finding

The source-policy scanner only walks .ts files under src, but the project tooling can bundle JavaScript if tracked JavaScript is added under the application source tree.

Evidence

  • tests/runtime/source-policy.ts:42 documents the scanner as returning every .ts file.
  • tests/runtime/source-policy.ts:47 implements walkTsFiles().
  • tests/runtime/source-policy.ts:59 includes only entries ending in .ts.
  • The file header describes the policy as a scan over src/**/*.ts, not over every source extension Vite may bundle.

Impact

Future tracked .js, .jsx, .mjs, .cjs, or .tsx files under src could bypass source-policy checks such as dynamic import, eval, or policy-boundary scans. There are no tracked JavaScript source files today, so this is a preventive process gap rather than a current exploit.

Recommended fix

Either formally ban bundled JavaScript source files under src, or expand the source-policy scanner to include every extension that can participate in the bundle.

Acceptance checks

  • The repository has an explicit test or policy gate that rejects tracked unsupported source extensions under src, or the scanner includes those extensions.
  • If JavaScript is allowed, Q007-style tests prove forbidden dynamic import/eval patterns are detected in .js fixtures.
  • Comments and test names no longer describe the protected surface as only src/**/*.ts unless that is the enforced rule.

Activity

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

    area:processWorkflow rules, ADR discipline, requirement lifecyclearea:validationValidation pass, actionable errors, CI gateenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions