Skip to content

Add --workspace-root so file keys are repo-relative #219

Open

Description

@georgesafta

Goal

Add an optional --workspace-root <dir> flag, with the same behavior as codeanalyzer-java (codellm-devkit/codeanalyzer-java#274). When it's set, file keys are relative to the workspace root instead of --input, so a project at packages/web/ in a monorepo produces packages/web/src/app.ts.

Design: docs/design/specs/2026-10-24-workspace-root.md in codeanalyzer-java (branch feat/add-workspace-root). Artifact and @external ids are language-neutral, so both analyzers must give the same repo-relative id for the same file.

Goals

  • Add the --workspace-root option. Unset, the root is --input and output is byte-identical to today's.
  • Use the root for symbol_table keys (discovery.ts), module ids and every id below them, and artifact keys/paths/ids (artifacts/index.ts).
  • Keep the app segment as it is (--app-name, else the --input dir name). Artifact classification and on-disk reads stay relative to --input.
  • Hard error if --input isn't inside the workspace root.
  • Test that no key is absolute or contains ...

Definition of done

  • Nested-fixture tests cover L1, L2 (call-graph ids) and L3 overlay ids.
  • README documents the flag and that toggling it misses the cache.

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