Skip to content

explore: say why a proposal failed, propose typescript-public-api per package, and mark what a proposal needs - #215

Open
agorischek wants to merge 2 commits into
mainfrom
feat/explore-reasons
Open

agorischek wants to merge 2 commits into
mainfrom
feat/explore-reasons

Conversation

@agorischek

@agorischek agorischek commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Agent assessment

Self-reported assessment, not an independent review.

Assessed revision: 860c8dae904924374f55a419686e101cdb54a4f3

Dimension Assessment Rationale
Change confidence 8.5/10 ↑ Unit tests: per-package typescript-public-api proposals with their tsconfig, the install and configuration needs, the extractor's own reason on the sweep's summary line, a definition without inputs no longer sending inputs: null, and the duplicate-name message.
↑ End to end on a clone of the downstream repository: explore lists one proposal per package with what it needs, and the sweep says why each failed.
↓ adopt's new note, for a projection that failed on every change, isn't covered by a test.

Item 6 of a downstream user's (Superego) feedback, as decided for v0.3.1. Explore proposed projections that then failed without saying why. On their pnpm monorepo: workspace-dependencies hit a duplicate package name, and typescript-public-api was proposed with no inputs and failed with inputs must be an object.

Why a proposal failed

  • The sweep's summary line ends with the reason, in the extractor's own words (its last line of standard error), with the lines before it underneath. It no longer repeats a generic "exited with exit status: 1".
  • adopt said a projection "showed no change … so nothing was bookmarked" when it had in fact failed on every change. It now says it failed, and why.

inputs must be an object was a bug. present_inputs (typescript-support) indexed definition["inputs"] mutably, which adds inputs: null to a definition without inputs, so every typescript-public-api definition without inputs failed. It now leaves such a request alone, and a test covers it.

Obvious inputs filled in. typescript-public-api is now proposed once per package that declares its API (exports, types or typings) beside a tsconfig.json, as typescript-public-api-<name> with inputs.tsconfig set. The extractor already derives a package's entrypoints from its exports, so the tsconfig is what selects the package. When no package qualifies, the single generic proposal remains.

What a proposal needs first. Candidates carry needs, shown in the text as (needs an install: …) or (needs configuration: …):

  • configuration, when no package declares an API;
  • an install, when the repository's own typescript isn't resolvable from the package, as Node resolves it.

The explore agent guide and the explore tool's description say so.

Duplicate workspace package names (conservative). workspace-dependencies identifies a member by its name, so a root and a member sharing one, which pnpm allows, still fails. The message now names both manifests and says to rename one. Accepting duplicates changes entity identity, so that is left as a design decision.

Tests: cargo test -p projections-cli --lib explore:: sweep::, cargo test -p projections-extractor-typescript-support, cargo test -p projections-extractor-workspace-dependencies --test managers duplicate.

…h its tsconfig, and what a proposal needs first

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Fallback package IDs are neither checked nor reserved for uniqueness, allowing collisions that prevent some packages from being adopted independently.

1 open issue
What changed in this PR

This PR improves Projections’ discovery and onboarding flow by explaining proposal failures, generating package-specific TypeScript API proposals, and identifying prerequisites.

Changes:

  • Propose TypeScript public APIs per package, with tsconfig inputs and install or configuration needs.
  • Surface extractor failure reasons in sweep and adoption output, and clarify duplicate workspace-name errors.
  • Preserve omitted TypeScript inputs and update regression tests, tool descriptions, and agent guidance.
File Description
tools/​scripts/​reference-docs/​agents.mjs Update generated guidance for prerequisites and failure reporting.
packages/​integrations/​vscode/​package.json Describe proposal prerequisites in the explore tool.
packages/​extractors/​workspace-dependencies/​tests/​managers.rs Test duplicate-name diagnostics naming both manifests.
packages/​extractors/​workspace-dependencies/​src/​workspace.rs Make duplicate-name errors actionable.
packages/​extractors/​typescript-support/​src/​lib.rs Preserve absent inputs and add a regression test.
packages/​extractors/​typescript-support/​Cargo.toml Enable SDK testing helpers.
packages/​cli/​src/​tools/​catalog.rs Document prerequisites in the explore tool description.
packages/​cli/​src/​sweep/​tests.rs Test extractor failure reasons and stderr formatting.
packages/​cli/​src/​sweep/​mod.rs Put extractor failure reasons on summary lines.
packages/​cli/​src/​explore/​typescript.rs Generate per-package proposals and prerequisite metadata.
packages/​cli/​src/​explore.rs Integrate TypeScript discovery and display prerequisites.
packages/​cli/​src/​commands/​explore.rs Distinguish all-failed adoption sweeps from unchanged results.
docs/​agents/​explore.md Explain prerequisite handling and failure reporting.

Review effort: Balanced

Comment thread packages/cli/src/explore/typescript.rs Resolved
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

This branch has not been deployed

No deployments
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.

2 participants