Repository navigation
Conversation
… 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/healthand/v2/openapi.jsoninstead of/specificationand 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 runspolicyenginein its own process needs neither.skills/policyengine-app: the calculator's direct browser calls throughBASE_URLare moving to app.policyengine.org's own route,/api/policyengine/{Public API path}, which forwards only the operations inapp/src/libs/publicApiRoute/allowList.ts. New calculator code goes through that route.targets/claude/agents/dashboard/backend-builder.mdandtargets/claude/commands/new-tool.md: the Pattern B client wraps@policyengine/api-clientinstead of fetchinghttps://api.policyengine.org. The types aretypealiases, because the client takesRecord<string, unknown>and a TypeScriptinterfaceis not assignable to it.policyengine-api-accessand describe Pattern B by what the dashboard API offers. Thedata_patternvalue stayspolicyengine-api, so existingplan.yamlfiles still validate.policyengineskill,targets/codex/agents/policyengine-app-v2/AGENTS.mdanddocs/when-to-use.mdpoint topolicyengine-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: Pythonrequeststo/us/policy,/us/economy/…and…/budget-window(its default "API path").targets/claude/agents/model-corroborator.md:curlto/us/policyand/us/economy/….targets/claude/agents/parameter-locator.md:curlto/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 inskills/,targets/anddocs/may not name a Public API host (the household API and v2 hosts are not matched); noNEXT_PUBLIC_orVITE_variable may be set to one or named like a credential; eleven files that guide dashboard and app work must point topolicyengine-api-access; the API skill's public routes; and the tools skill's Pattern B.29b87d2: 15 failed on their assertions, 2 passed (no public-prefix violations existed, and the patterns' self-test); exit code 1.b6f3e85: 17 passed; exit code 0.tests/pipeline/test_when_to_use_guide.py::test_skills_section_references_real_skills: the guide namespolicyengine-api-access, and Add policyengine-api-access and stop sending browser code to the Public API #116 had not rebuilt the dashboard manifest that the test reads. Add policyengine-api-access and stop sending browser code to the Public API #116 now rebuilds it, and this branch merges Add policyengine-api-access and stop sending browser code to the Public API #116's branch (e8d9a50).🤖 Generated with Claude Code