Skip to content

Send dashboard and app guidance through the dashboard API, not the Public API - #117

Closed
anth-volk wants to merge 3 commits into
dashboard-api-skillfrom
skills-public-api-browser-guidance
Closed

anth-volk wants to merge 3 commits into
dashboard-api-skillfrom
skills-public-api-browser-guidance

Conversation

@anth-volk

@anth-volk anth-volk commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #114

Stacked on #116 (policyengine-api-access), which it points to. Its base is that PR's branch.

Summary

The Public API (api.policyengine.org) is becoming callable only by PolicyEngine's servers. This stops the catalog telling browser code to call it, and points dashboard and app guidance to policyengine-api-access.

Changes

  • skills/policyengine-api: says who may call v1 (servers with their own credential) and that pages use the dashboard API; drops "JS frontends" from when to use REST; lists /health and /v2/openapi.json instead of /specification and the liveness and readiness checks, which the Public API removed (policyengine_api/migration_flags.py).
  • skills/policyengine-tools: Pattern B is the dashboard API through @policyengine/api-client, with its four operations. A Pattern C backend that calls the Public API needs its own client and cached token; one that runs policyengine in its own process needs neither.
  • skills/policyengine-app: the calculator's direct browser calls through BASE_URL are moving to app.policyengine.org's own route, /api/policyengine/{Public API path}, which forwards only the operations in app/src/libs/publicApiRoute/allowList.ts. New calculator code goes through that route.
  • targets/claude/agents/dashboard/backend-builder.md and targets/claude/commands/new-tool.md: the Pattern B client wraps @policyengine/api-client instead of fetching https://api.policyengine.org. The types are type aliases, because the client takes Record<string, unknown> and a TypeScript interface is not assignable to it.
  • The dashboard planner, scaffold and integrator load policyengine-api-access and describe Pattern B by what the dashboard API offers. The data_pattern value stays policyengine-api, so existing plan.yaml files still validate.
  • The policyengine skill, targets/codex/agents/policyengine-app-v2/AGENTS.md and docs/when-to-use.md point to policyengine-api-access; the guide's catalog counts are current (25 skills).

Left as they are

These call the Public API from an analyst's or agent's own machine, not from a browser. None sends a credential, so each stops working once the credential requirement is on:

  • targets/claude/agents/microsim-runner.md: Python requests to /us/policy, /us/economy/… and …/budget-window (its default "API path").
  • targets/claude/agents/model-corroborator.md: curl to /us/policy and /us/economy/….
  • targets/claude/agents/parameter-locator.md: curl to /us/metadata.
  • targets/claude/commands/text-to-reform.md: names the Public API as where a user might submit a reform.
  • dashboard/src/pages/Guides.tsx: guide text describing microsim-runner's API path; it makes no request.
  • analyses/*.md: dated records, kept as written.

Tests

tests/test_public_api_browser_guidance.py: TypeScript and JavaScript examples in skills/, targets/ and docs/ may not name a Public API host (the household API and v2 hosts are not matched); no NEXT_PUBLIC_ or VITE_ variable may be set to one or named like a credential; eleven files that guide dashboard and app work must point to policyengine-api-access; the API skill's public routes; and the tools skill's Pattern B.

🤖 Generated with Claude Code

anth-volk and others added 3 commits November 10, 2026 22:07
… API

Adds tests/test_public_api_browser_guidance.py. It fails until the guidance
is updated: TypeScript and JavaScript examples in skills/, targets/ and
docs/ may not name a Public API host (api.policyengine.org or its Cloud Run
addresses; the household API and the v2 alpha hosts are not matched), no
NEXT_PUBLIC_ or VITE_ variable may be set to one or named like a
credential, the skills, agents and commands that guide dashboard and app
work must point to policyengine-api-access, the policyengine-api skill
must list /health and /v2/openapi.json instead of the removed
/specification and liveness and readiness checks, and the tools skill's
Pattern B must use @policyengine/api-client.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…blic API

The Public API is becoming callable only by PolicyEngine's servers, so the
catalog stops telling browser code to call api.policyengine.org:

- policyengine-api says who may call v1 (servers with their own
  credential), that pages use the dashboard API, and lists /health and
  /v2/openapi.json instead of the removed /specification and liveness and
  readiness checks;
- policyengine-tools' Pattern B is the dashboard API through
  @policyengine/api-client, and a Pattern C backend that calls the Public
  API gets its own client and cached token;
- policyengine-app says the calculator's direct browser calls are moving to
  app.policyengine.org's own allow-listed route, and new code goes through
  it;
- backend-builder and new-tool build Pattern B on @policyengine/api-client;
  the dashboard planner, scaffold and integrator load policyengine-api-access
  and describe the pattern by what the dashboard API offers;
- the policyengine skill, the app-v2 Codex routing and docs/when-to-use.md
  point to policyengine-api-access; the guide's catalog counts are current.

The data_pattern value policyengine-api is kept, so existing plan.yaml
files still validate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…i-browser-guidance

Brings in the rebuilt dashboard manifest, which the when-to-use guide test
reads, and the skill's description of the firewall's 429.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@anth-volk anth-volk closed this Nov 10, 2026
anth-volk added a commit that referenced this pull request Nov 10, 2026
Folds the former #117 into #116, so one PR adds the skill and stops the
existing skills, agents and commands telling browser code to call the
Public API.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant