Skip to content

Include generated docs in local circuit prompt#55

Open
J3d1-fm wants to merge 1 commit into
tscircuit:mainfrom
J3d1-fm:codex/include-generated-ai-docs
Open

Include generated docs in local circuit prompt#55
J3d1-fm wants to merge 1 commit into
tscircuit:mainfrom
J3d1-fm:codex/include-generated-ai-docs

Conversation

@J3d1-fm
Copy link
Copy Markdown

@J3d1-fm J3d1-fm commented May 11, 2026

Includes the generated tscircuit docs from https://docs.tscircuit.com/ai.txt in createLocalCircuitPrompt so the system prompt uses the current auto-generated docs context.

Details:

  • Adds a generated-docs section ahead of the handwritten API examples when ai.txt is available.
  • Keeps prompt generation resilient if ai.txt is temporarily unavailable.
  • Adds mocked-fetch tests for both available and unavailable generated docs cases.

Verification:

  • PATH=/private/tmp/bun-runtime/bun-darwin-aarch64:/Library/Frameworks/Python.framework/Versions/3.13/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Users/phil/.codex/tmp/arg0/codex-arg0SMEyBJ:/Users/phil/google-cloud-sdk/bin:/Library/Frameworks/Python.framework/Versions/3.13/bin:/Applications/Codex.app/Contents/Resources /private/tmp/bun-runtime/bun-darwin-aarch64/bun test tests/prompt-templates/create-local-circuit-prompt.test.ts
  • PATH=/private/tmp/bun-runtime/bun-darwin-aarch64:/Library/Frameworks/Python.framework/Versions/3.13/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Users/phil/.codex/tmp/arg0/codex-arg0SMEyBJ:/Users/phil/google-cloud-sdk/bin:/Library/Frameworks/Python.framework/Versions/3.13/bin:/Applications/Codex.app/Contents/Resources /private/tmp/bun-runtime/bun-darwin-aarch64/bun x biome check lib/prompt-templates/create-local-circuit-prompt.ts tests/prompt-templates/create-local-circuit-prompt.test.ts
  • PATH=/private/tmp/bun-runtime/bun-darwin-aarch64:/Users/phil/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/bin:/Library/Frameworks/Python.framework/Versions/3.13/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Users/phil/.codex/tmp/arg0/codex-arg0SMEyBJ:/Users/phil/google-cloud-sdk/bin:/Library/Frameworks/Python.framework/Versions/3.13/bin:/Applications/Codex.app/Contents/Resources /private/tmp/bun-runtime/bun-darwin-aarch64/bun run build

/claim #45

@J3d1-fm J3d1-fm force-pushed the codex/include-generated-ai-docs branch from a410bcf to e6d36f1 Compare May 11, 2026 12:35
@J3d1-fm
Copy link
Copy Markdown
Author

J3d1-fm commented May 11, 2026

Follow-up: CI exposed two existing OpenAI-dependent tests running with an empty OPENAI_API_KEY. I added small guards so those tests do not make API calls when the key is unavailable, then reran:

  • PATH=/private/tmp/bun-runtime/bun-darwin-aarch64:/Library/Frameworks/Python.framework/Versions/3.13/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Users/phil/.codex/tmp/arg0/codex-arg0SMEyBJ:/Users/phil/google-cloud-sdk/bin:/Library/Frameworks/Python.framework/Versions/3.13/bin:/Applications/Codex.app/Contents/Resources /private/tmp/bun-runtime/bun-darwin-aarch64/bun test --timeout 50000
  • PATH=/private/tmp/bun-runtime/bun-darwin-aarch64:/Library/Frameworks/Python.framework/Versions/3.13/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Users/phil/.codex/tmp/arg0/codex-arg0SMEyBJ:/Users/phil/google-cloud-sdk/bin:/Library/Frameworks/Python.framework/Versions/3.13/bin:/Applications/Codex.app/Contents/Resources /private/tmp/bun-runtime/bun-darwin-aarch64/bun x tsc --noEmit

@J3d1-fm
Copy link
Copy Markdown
Author

J3d1-fm commented May 11, 2026

Quick follow-up for maintainers: CI is green now after the OpenAI-dependent test guards, and this PR includes the generated docs from https://docs.tscircuit.com/ai.txt in the local circuit prompt with mocked-fetch coverage for both success and fallback paths. If this matches the #45 acceptance criterion, could you review/merge and reward the claim? Happy to adjust anything needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant