Skip to content

Add deterministic import-policy compatibility classifier#5

Open
rsuresh-retool wants to merge 1 commit into
rohansuresh/retool-import-two-step-handofffrom
rohansuresh/import-policy-module
Open

Add deterministic import-policy compatibility classifier#5
rsuresh-retool wants to merge 1 commit into
rohansuresh/retool-import-two-step-handofffrom
rohansuresh/import-policy-module

Conversation

@rsuresh-retool

Copy link
Copy Markdown

What

Adds plugins/retool-import/references/import-policy.mjs — a self-contained, runnable Node ESM module that is a faithful mirror of Retool's pre-agent appImportClassifier (rules.ts + classifier.ts).

  • Same signal lists, bucket tables, mapToVerdict, and user-facing copy as upstream.
  • classifyImportedApp() stays verbatim (pass / hard_no, Next.js carve-out).
  • localGateVerdict() layers a three-way verdict on top: hard_no / soft_no / supported.
  • CLI walks a repo root (skipping node_modules / build dirs), inspects manifest files only (package.json deps, app.json shape, config-file presence — never source code), and prints { verdict, identifiedAs, reasons } as JSON.

This is the deterministic engine; the skill wiring that consumes it is in the stacked PR on top of this one.

Why

Lets the retool-import skills block unsupported app types locally, before any discovery work or handoff to the R2 agent — parity with the browser import's pre-agent validation. The R2 agent's evaluate_app_compatibility remains the second line of defense for the non-skills path.

Testing

  • node --check passes.
  • 17 synthetic fixtures classify correctly, including precedence (mobile beats Next.js; Next.js carve-out beats Python), Expo app.json-key disambiguation, and node_modules exclusion.

Keep import-policy.mjs in sync with upstream appImportClassifier/rules.ts + classifier.ts.

🤖 Generated with Claude Code

Self-contained, runnable Node ESM mirror of Retool's appImportClassifier
(rules.ts + classifier.ts). Walks a repo's manifest files and prints a
hard_no / soft_no / supported verdict, so the retool-import skills can
block unsupported app types locally before handing off to the R2 agent.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@frankyj3578 frankyj3578 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.

Quick question: Did you auto-generate this? How do we keep it in sync with the upstream once we start introducing gated vs free 2-tier approach, for example?

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