axiom audit foundation models

Engineering Community

Skill notes

Tool Use Is Mandatory

Run every Glob, Grep, and Read this prompt lists. Do not reason from training data instead of scanning. Run each Grep pattern as written; do not collapse them into one mega-regex. Run the Read verifications each section calls for. "Build a mental model" / "map the architecture" means with tool output in hand, not from memory.

Files to Exclude

Skip: *Tests.swift, *Previews.swift, */Pods/*, */Carthage/*, */.build/*, */DerivedData/*, */scratch/*, */docs/*, */.claude/*, */.claude-plugin/*

Step 5: Identify Inference and Error-Handling Surface

Search BOTH error spellings. The 27 SDK deprecated LanguageModelSession.GenerationError in favor of LanguageModelError, and split assetsUnavailable / concurrentRequests / decodingFailure out into SystemLanguageModel.Error, LanguageModelSession.Error, and GeneratedContent.ParsingError. A project written against the 27 API contains none of the old identifiers — grepping only for those reports a modern codebase as having no error handling at all, which is the opposite of the truth. See axiom-ai (skills/foundation-models-ref.md) for the full migration table.

Step 6: Read Key Files

Read 1-2 representative AI files (AIService / ChatViewModel / similar) to understand: Whether availability is checked once (at app/service init) AND before each session creation Whether sessions are owned by a long-lived service (good) or recreated per tap (bad) Whether respond() calls are wrapped in Task { ... } with loading-state UI Whether catch blocks distinguish guardrail/refusal, context-size exhaustion, and generic errors — in EITHER error-type spelling (LanguageModelError on 27, GenerationError on 26)

Output

Write a brief Foundation Models Map (5-10 lines) summarizing: Number of LanguageModelSession instances and their ownership pattern (service-level / view-level / per-tap) Number of @Generable types (and whether nested types are also @Generable) @Guide annotation coverage on numeric / collection properties Tool protocol implementations (count + their purpose)

Fluxly profile Runtime and permissions are inferred by Fluxly static checks, not author declarations or runtime test results.
Domain
Engineering
Author-declared agents
No explicit declaration found; this is not inferred or tested compatibility
Static check
94 / 100 · heuristic scan, not runtime safety proof
Runtime evidence
Not run; no isolated runtime test evidence is currently recorded
Author / version / license
@CharlesWiltgen · MIT
Token usage
Moderate
Setup complexity
Guided setup
External API key
Not required
Operating systems
macOS
Runtime requirements
No explicit requirements detected
Detected file/system behavior
  • Read-only
  • Write / modify
Network behavior
Local-only
Install commands
None (reference only)

Heads up: Tool permissions are not declared; actual access depends on the runtime.

Output preview axiom-audit-foundation-models.preview
# Pattern 3: Manual JSON Parsing of Model Output (CRITICAL/HIGH)

- `JSONDecoder.*respond` (within ~10 lines)
- `JSONSerialization.*response`
- `response\.content.*\.data\(using:` — common manual-parse pattern

Discussion

Powered by GitHub Discussions. Sign in with GitHub to comment, react, or subscribe.