Skip to content

feat(models,analytics): GPT-6 and Claude 5.5 families, prompts tuned for both - #54

Merged
laithalsaadoon merged 3 commits into
mainfrom
feature/prompts-gpt6-claude55
Oct 12, 2026
Merged

laithalsaadoon merged 3 commits into
mainfrom
feature/prompts-gpt6-claude55

Conversation

@laithalsaadoon

@laithalsaadoon laithalsaadoon commented Oct 12, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • The registry moves to GPT-6 (Luna, 6.1 Sol, Astra) and Claude 5.5 (Haiku, Sonnet, Opus), with list pricing, the long-context price steps, and a measured chars-per-token ratio per family.
  • The anthropic family is runnable through a new AnthropicBedrockProvider (output_config.format on invoke_model), selected with ATIF_SQL_LLM_FAMILY=anthropic. The default family stays openai.
  • The four classifier prompts are rewritten against the current OpenAI and Anthropic prompting guides: one provider-neutral text, content first in id-fenced tags, request last, JSON examples, and a think-first line on the three judgment prompts.
  • Tool-result bodies stay out of the transcripts sent to Bedrock by default. Each result renders as a size stub, tool calls keep their arguments, and ATIF_SQL_SESSION_TEXT_TOOL_RESULT_BODIES=true restores the bodies.

Evidence

  • mise run check passes: 2661 tests passed, 1 skipped, 1 xfailed.
  • scripts/dev/smoke_llm_models.py returns a parsed structured output from all six model ids in us-east-1.
  • An A/B eval over a 19-session, 63-message sample from a local corpus compared the old and new prompts across both families (about 650 classifier calls, 0 refusals, 0 invented turn ids). Opus 5.5 and GPT-6 Astra judged every emitted row and every disputed label. The sample is small, so treat the precision figures as direction, not rates.
Pipeline Arm Cost Result
friction old prompt, GPT-5.6 Luna (baseline) $0.039 10 of 15 disputed labels match both judges
friction new prompt, GPT-6 Luna $0.017 13 of 15
friction new prompt, Haiku 5.5 $0.025 9 of 15 (old prompt: 3 of 15)
classify old prompt, GPT-5.6 Luna (baseline) $0.077 5 of 7
classify new prompt, GPT-6 Luna $0.039 5 of 7
conflicts old prompt, GPT-5.6 Sol (baseline) $1.79 7 rows, 2 valid, 3 invalid, 2 contested
conflicts new prompt, GPT-6 Astra $4.32 4 rows, 2 valid, 0 invalid, 2 contested
conflicts new prompt, GPT-6.1 Sol $0.86 3 rows, 2 valid, 0 invalid, 1 contested
conflicts new prompt, Opus 5.5 $2.53 3 rows, 2 valid, 0 invalid, 1 contested
perceived old prompt, GPT-5.6 Terra (baseline) $0.90 6 rows, 1 valid, 3 invalid, 2 contested
perceived new prompt, GPT-6.1 Sol $0.91 6 rows, 2 valid, 1 invalid, 3 contested
perceived new prompt, Sonnet 5.5 $1.33 2 rows, 1 valid, 1 invalid

The perceived anchoring rule changed after the first judge pass: the two judges disagreed on 7 of 9 rows, mostly over which user turn an acknowledged_mistake belongs to, because rule 2 and its own example pointed at different turns. With the rule fixed, they agree on 8 of 11.

Tool results

Across three local corpora (537 interactive sessions sampled), tool results were 88-91% of rendered transcript characters, and 210 of the 537 sessions hit the 800K-character cap, so the model never saw how they ended. In the 212-session Claude Code corpus the mean rendered session drops from about 1.09M characters to 127K with stubs.

The same 19-session eval, re-run with stubs in place of result bodies:

Pipeline Model Input tokens, full → stub Result
classify GPT-6 Luna 366K → 146K 17 of 19 labels match the full run; a repeat of the identical full run matched 15 of 19
classify Haiku 5.5 551K → 226K 18-19 of 19 match; the repeat matched 18 of 19
conflicts GPT-6.1 Sol 405K → 185K the same 3 rows as the full run, once the prompt says what a stub line is (2 rows without that line)
conflicts Opus 5.5 614K → 289K 2 rows, both judged valid (full run: 2 valid, 1 contested)
perceived GPT-6.1 Sol 419K → 199K 5 of the full run's 6 rows; the dropped row was the one judged invalid
perceived Sonnet 5.5 634K → 308K 3 rows: the full run's 2 plus 1 new row judged valid

The sample was drawn from sessions of 8K-120K characters, so it understates the token cut on real corpora and cannot show the truncation benefit.

Notes

  • Claude 5.5 spends about 1.5x GPT-6's input tokens on the same transcript (2.2 vs 3.3 characters per token), so the same pipeline costs more on Claude than the list prices suggest. The dry-run plans now use each family's ratio.
  • RefusalError stays terminal. In the eval, one judge call on Opus 5.5 returned stop_reason: refusal on a security-themed user message, so an anthropic run should expect a few refusal rows on coding transcripts that discuss security work.
  • No size assignment changes in this PR. On this sample, GPT-6.1 Sol matched Astra on conflicts at about a fifth of the cost, which makes ATIF_SQL_LLM_SIZE_CONFLICTS=medium worth a larger trial.

…for both

The registry resolves each size to the current model of each family:
GPT-6 Luna, GPT-6.1 Sol, and GPT-6 Astra for openai, and Claude Haiku,
Sonnet, and Opus 5.5 for anthropic, all GLOBAL inference profiles that
answered a structured-output call in us-east-1 on 2026-10-12. Each spec
carries list pricing, the vendor's long-context step (GPT-6 over 272K
input tokens, Haiku 5.5 over 100K), and the family's measured
chars-per-token ratio, which the dry-run plans now use in place of a flat
4 (GPT-6 measured 3.3 and Claude 5.5 measured 2.2 on rendered transcripts).

The anthropic family is runnable. AnthropicBedrockProvider sends the
Messages body with output_config.format json_schema, passes the schema
through anthropic.transform_schema because Claude 5.5 rejects numeric and
length constraints, reads text blocks after any thinking block, folds a
case-variant enum value onto the declared member, maps stop_reason refusal
to RefusalError, and retries a max_tokens stop once at one effort step
lower. build_structured_provider picks the adapter per family; the retry
codes, effort ladder, and client construction both adapters use live in
bedrock_common.

The four classifier prompts follow the current OpenAI and Anthropic
prompting guides:
- one provider-neutral text per pipeline that describes the corpus as
  sessions with an AI coding agent and names no schema mechanism
- the transcript or message first, fenced in tags whose id hashes the
  content so the content cannot close its own fence, then a one-line
  request
- a shared appendix for the offline operating context, the quality bar,
  and the output format
- examples written as JSON the schema accepts, pinned by a test
- "Think the problem through before you answer." on the three judgment
  prompts, and no prompt asks for reasoning in the output
- perceived anchors acknowledged_mistake and contradictory_response on
  the first user turn after the quoted agent text, and keeps one row per
  mistake across signals
…fault

The transcript renderer writes each tool result as a size stub,
"[tool_result <id> <ts>] (5120 chars omitted)", with a note when the step
holds a failed result. Tool calls keep their name and 400-character
argument preview, because the file paths and commands they carry are the
classifier's best evidence of the work. What a tool returned stays in the
materialized corpus on disk and never reaches Bedrock.
ATIF_SQL_SESSION_TEXT_TOOL_RESULT_BODIES=true restores the bodies, clipped
at 50K characters each.

Tool results made up 88-91% of rendered transcript characters across three
local corpora (537 interactive sessions), and they pushed 210 of those
sessions past the 800K-character cap, so the model never saw how those
sessions ended. With stubs, the mean rendered session drops from about
1.1M characters to 127K in the largest corpus.

The classify and transcript-role prompt lines now describe tool calls as
the evidence and say a result can appear as only its size.
…e docs tree

README, AGENTS.md, the CLI reference, and the site's home page say that
analyze runs on GPT-6 by default or Claude 5.5 with
ATIF_SQL_LLM_FAMILY=anthropic, and that tool results reach the model as
size stubs unless ATIF_SQL_SESSION_TEXT_TOOL_RESULT_BODIES=true.

The architecture, behavior, reference, diagram, analysis, and insights
pages cover the Anthropic adapter, the shared Bedrock module, the provider
factory, long-context pricing, the per-family chars_per_token ratio, and
the fenced prompts, and every path:line citation into a file this branch
changed points at the line it names. The atif-embed RETRY_CODES comment
names the module that defines the atif-models twin. The Vale baseline
drops to 269 warnings.
@laithalsaadoon
laithalsaadoon merged commit b3248ad into main Oct 12, 2026
18 checks passed
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