Skip to content

Preserve policy safety when a malformed manifest hides the npm workspace root #240

Description

@LadyBluenotes

Problem

While fixing #230, a separate workspace-boundary case reproduced: an npm workspace root with malformed package.json is skipped by workspace discovery. A nested app can then be treated as standalone, dropping the root's inherited restrictions.

Reproduction

Create a workspace root with workspaces: ["packages/*"] and intent.exclude: ["@tanstack/query"], and a nested app with an allowlist permitting that package. Corrupt the root JSON while keeping the app's manifest valid. Without a separate workspace marker such as pnpm-workspace.yaml, listIntentSkills({ cwd: appDir }) and the load path can miss the inherited restriction.

Verified against main 206e987 plus the strict resolved-policy reader proposed for #230. The corresponding pnpm fixture rejects the root manifest because its workspace boundary remains discoverable.

Design constraint

Workspace discovery also checks ancestor manifests outside the eventual project boundary. Rejecting every malformed ancestor could make an unrelated parent file block a standalone app. Decide how Intent establishes a trustworthy boundary before changing that behavior.

Acceptance criteria

  • Define which evidence establishes the project/workspace policy boundary when the root manifest cannot be parsed.
  • A malformed workspace-root manifest cannot silently broaden a nested app's effective policy.
  • Define and test how malformed unrelated ancestor manifests affect standalone projects.
  • Cover npm-style workspaces without a separate pnpm workspace marker, nested app allowlists, inherited exclusions, and core/CLI outcomes.

Priority: High. Follow-up to #230; do not broaden selector grammar or change interactive installation.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions