@warmdrift/kgauto-compiler 2.0.0-alpha.14 → 2.0.0-alpha.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/profiles.js CHANGED
@@ -644,6 +644,420 @@ var PROFILES_RAW = [
644
644
  hunt: 4
645
645
  // sequential tools — same as V4-Flash
646
646
  }
647
+ },
648
+ // ── OpenAI ──
649
+ // alpha.16 (2026-05-17): close the half-supported provider gap. env.ts
650
+ // already registered OPENAI_API_KEY + executeOpenAI + normalizeOpenAILike
651
+ // + lowerOpenAI all existed; profile entries were missing, so the
652
+ // alpha.10 auto-filter would mark openai-keyed models reachable but
653
+ // there were no profiles to filter IN. Half-supported is now fully
654
+ // supported. PB request `openai-provider-profiles` (2026-05-16).
655
+ //
656
+ // Profile data verified against developers.openai.com/api/docs/pricing
657
+ // + per-model pages 2026-05-17. L-049/L-081 step-zero: no AI-trained
658
+ // numbers — fetched live from OpenAI's docs. As of 2026-05, OpenAI's
659
+ // current flagship is gpt-5.5 (2025-12 cutoff); gpt-5.4-{base,mini,nano}
660
+ // are the workhorse family. gpt-4.1 + gpt-4o are legacy.
661
+ //
662
+ // Both 5.5 and 5.4 carry a 272K input-token pricing cliff (2x input,
663
+ // 1.5x output beyond that). Modeled as a `downgrade_quality_warning`
664
+ // cliff because it ranks the model down at large-context shapes — the
665
+ // semantics of "this model is now 2x more expensive" map onto the
666
+ // existing penalty mechanism. Cost-watcher will catch high-context
667
+ // spikes empirically; the cliff prevents naive routing into the doubled
668
+ // pricing zone.
669
+ {
670
+ id: "gpt-5.5",
671
+ verifiedAgainstDocs: "2026-05-17",
672
+ provider: "openai",
673
+ status: "current",
674
+ maxContextTokens: 105e4,
675
+ maxOutputTokens: 128e3,
676
+ maxTools: 64,
677
+ parallelToolCalls: true,
678
+ structuredOutput: "native",
679
+ systemPromptMode: "inline",
680
+ streaming: true,
681
+ cliffs: [
682
+ {
683
+ metric: "input_tokens",
684
+ threshold: 272e3,
685
+ action: "downgrade_quality_warning",
686
+ reason: "OpenAI pricing tier shift: >272K input tokens billed at 2x input + 1.5x output rates"
687
+ }
688
+ ],
689
+ costInputPer1m: 5,
690
+ costOutputPer1m: 30,
691
+ lowering: {
692
+ system: { mode: "inline" },
693
+ // OpenAI caching is implicit (auto-applied to repeated prefixes
694
+ // ≥1024 tokens for prompt_tokens_details.cached_tokens). No
695
+ // wire-format marker. Discount: 10x for cached input ($0.50/$5.00).
696
+ cache: { strategy: "unsupported", minTokens: 1024, discount: 0.1 },
697
+ tools: { format: "openai" }
698
+ },
699
+ recovery: [
700
+ { signal: "rate_limit", action: "escalate", reason: "429 \u2014 escalate to fallback chain" },
701
+ { signal: "model_not_found", action: "escalate", reason: "Model deprecated/renamed \u2014 escalate (L-061)" }
702
+ ],
703
+ strengths: ["reasoning", "agentic_coding", "long_context", "structured_output", "reliable_tool_use", "reasoning_effort_knob"],
704
+ weaknesses: ["cost", "pricing_cliff_at_272k"],
705
+ notes: "OpenAI frontier (2026-05). 1M context (1.05M total), 128K max output, 2025-12 cutoff. Reasoning effort knob (none/low/medium/high/xhigh). Pricing cliff at 272K input.",
706
+ // Frontier-tier perf hypothesis. Anchored to Opus 4.7 row (similar
707
+ // price/positioning). Brain evidence will refine; no telemetry yet.
708
+ archetypePerf: {
709
+ critique: 9,
710
+ plan: 9,
711
+ generate: 9,
712
+ ask: 9,
713
+ extract: 9,
714
+ transform: 9,
715
+ hunt: 8,
716
+ // parallel tool support good but cliff at 272K hurts deep multi-step
717
+ summarize: 7,
718
+ // overkill for tolerant archetype
719
+ classify: 7
720
+ // overkill; cheaper models cover this
721
+ }
722
+ },
723
+ {
724
+ id: "gpt-5.4",
725
+ verifiedAgainstDocs: "2026-05-17",
726
+ provider: "openai",
727
+ status: "current",
728
+ maxContextTokens: 105e4,
729
+ maxOutputTokens: 128e3,
730
+ maxTools: 64,
731
+ parallelToolCalls: true,
732
+ structuredOutput: "native",
733
+ systemPromptMode: "inline",
734
+ streaming: true,
735
+ cliffs: [
736
+ {
737
+ metric: "input_tokens",
738
+ threshold: 272e3,
739
+ action: "downgrade_quality_warning",
740
+ reason: "OpenAI pricing tier shift: >272K input tokens billed at 2x input + 1.5x output rates"
741
+ }
742
+ ],
743
+ costInputPer1m: 2.5,
744
+ costOutputPer1m: 15,
745
+ lowering: {
746
+ system: { mode: "inline" },
747
+ cache: { strategy: "unsupported", minTokens: 1024, discount: 0.1 },
748
+ tools: { format: "openai" }
749
+ },
750
+ recovery: [
751
+ { signal: "rate_limit", action: "escalate", reason: "429 \u2014 escalate to fallback chain" },
752
+ { signal: "model_not_found", action: "escalate", reason: "Model deprecated/renamed \u2014 escalate (L-061)" }
753
+ ],
754
+ strengths: ["reasoning", "long_context", "structured_output", "reliable_tool_use"],
755
+ weaknesses: ["pricing_cliff_at_272k"],
756
+ notes: "OpenAI workhorse (2026-05). 1M context (1.05M total), 128K max output, 2025-08 cutoff. Pricing cliff at 272K input. Pairs cleanly with Sonnet 4.6 on cost ($2.50/$15.00 vs $3.00/$15.00).",
757
+ // Anchored to Sonnet 4.6 row (similar price/positioning). Slight
758
+ // anthropic-side edge on agentic coding per master plan vibe.
759
+ archetypePerf: {
760
+ critique: 8,
761
+ plan: 8,
762
+ generate: 8,
763
+ ask: 8,
764
+ extract: 8,
765
+ transform: 8,
766
+ hunt: 7,
767
+ summarize: 7,
768
+ classify: 7
769
+ }
770
+ },
771
+ {
772
+ id: "gpt-5.4-mini",
773
+ verifiedAgainstDocs: "2026-05-17",
774
+ provider: "openai",
775
+ status: "current",
776
+ maxContextTokens: 4e5,
777
+ maxOutputTokens: 128e3,
778
+ maxTools: 64,
779
+ parallelToolCalls: true,
780
+ structuredOutput: "native",
781
+ systemPromptMode: "inline",
782
+ streaming: true,
783
+ cliffs: [],
784
+ costInputPer1m: 0.75,
785
+ costOutputPer1m: 4.5,
786
+ lowering: {
787
+ system: { mode: "inline" },
788
+ cache: { strategy: "unsupported", minTokens: 1024, discount: 0.1 },
789
+ tools: { format: "openai" }
790
+ },
791
+ recovery: [
792
+ { signal: "rate_limit", action: "escalate", reason: "429 \u2014 escalate to fallback chain" },
793
+ { signal: "model_not_found", action: "escalate", reason: "Model deprecated/renamed \u2014 escalate (L-061)" }
794
+ ],
795
+ strengths: ["cost", "speed", "agentic_coding", "structured_output", "reliable_tool_use"],
796
+ weaknesses: ["reasoning_depth"],
797
+ notes: "OpenAI mini-tier (2026-05). 400K context, 128K max output, 2025-08 cutoff. OpenAI describes as 'strongest mini model for coding, computer use, subagents.' Cache discount 10x ($0.075 input).",
798
+ // Mini-tier hypothesis. Anchored to Haiku 4.5 + Flash row pricing.
799
+ // Cost is slightly higher than Haiku ($0.75 vs $0.50 input) but
800
+ // OpenAI claims strong coding/subagent perf.
801
+ archetypePerf: {
802
+ ask: 7,
803
+ generate: 7,
804
+ extract: 7,
805
+ transform: 7,
806
+ classify: 7,
807
+ summarize: 7,
808
+ hunt: 7,
809
+ plan: 6,
810
+ critique: 5
811
+ // reasoning depth gap — frontier models handle this
812
+ }
813
+ },
814
+ {
815
+ id: "gpt-5.4-nano",
816
+ verifiedAgainstDocs: "2026-05-17",
817
+ provider: "openai",
818
+ status: "current",
819
+ maxContextTokens: 4e5,
820
+ maxOutputTokens: 128e3,
821
+ maxTools: 64,
822
+ parallelToolCalls: true,
823
+ structuredOutput: "native",
824
+ systemPromptMode: "inline",
825
+ streaming: true,
826
+ cliffs: [],
827
+ costInputPer1m: 0.2,
828
+ costOutputPer1m: 1.25,
829
+ lowering: {
830
+ system: { mode: "inline" },
831
+ cache: { strategy: "unsupported", minTokens: 1024, discount: 0.1 },
832
+ tools: { format: "openai" }
833
+ },
834
+ recovery: [
835
+ { signal: "rate_limit", action: "escalate", reason: "429 \u2014 escalate to fallback chain" },
836
+ { signal: "model_not_found", action: "escalate", reason: "Model deprecated/renamed \u2014 escalate (L-061)" }
837
+ ],
838
+ strengths: ["cost", "speed", "volume", "structured_output"],
839
+ weaknesses: ["reasoning_depth", "no_computer_use"],
840
+ notes: "OpenAI nano-tier (2026-05). 400K context, 128K max output, 2025-08 cutoff. 'Cheapest GPT-5.4-class for simple high-volume tasks.' No fine-tuning, no computer-use tools. Cache discount 10x.",
841
+ // Nano-tier. Anchored to Flash-Lite row ($0.10/$0.40 vs nano's
842
+ // $0.20/$1.25). Slightly more expensive than Flash-Lite but with
843
+ // OpenAI brand reliability. Good fit for classify/summarize floor.
844
+ archetypePerf: {
845
+ classify: 7,
846
+ summarize: 6,
847
+ ask: 6,
848
+ transform: 6,
849
+ extract: 6,
850
+ generate: 5,
851
+ hunt: 5,
852
+ plan: 4,
853
+ critique: 3
854
+ // not for reasoning archetypes
855
+ }
856
+ },
857
+ // ── Auto-onboarded (UNVERIFIED) ──
858
+ // Cloned by scripts/auto-onboard-models.mjs from a same-family template.
859
+ // Each entry's pricing/context/cliffs/lowering reflects the template, NOT
860
+ // provider docs. Verify before promoting status to 'current' (L-049/L-081).
861
+ {
862
+ id: "gemini-3-flash-preview",
863
+ verifiedAgainstDocs: "UNVERIFIED-AUTO-ONBOARD",
864
+ provider: "google",
865
+ status: "preview",
866
+ maxContextTokens: 1048576,
867
+ maxOutputTokens: 65535,
868
+ maxTools: 128,
869
+ parallelToolCalls: true,
870
+ structuredOutput: "native",
871
+ systemPromptMode: "separate",
872
+ streaming: true,
873
+ cliffs: [
874
+ {
875
+ metric: "input_tokens",
876
+ threshold: 8e3,
877
+ action: "downgrade_quality_warning",
878
+ reason: "Quality degrades significantly above ~8K context tokens"
879
+ },
880
+ {
881
+ metric: "tool_count",
882
+ threshold: 20,
883
+ action: "drop_to_top_relevant",
884
+ reason: "Tool reliability drops above ~20 tools (despite 128 hard limit)"
885
+ },
886
+ {
887
+ metric: "thinking_with_short_output",
888
+ threshold: 1,
889
+ action: "force_thinking_budget_zero",
890
+ reason: "Thinking tokens consume maxOutputTokens \u2014 empty response if drained"
891
+ },
892
+ {
893
+ // s11 trust artifact (2026-05-02): brain showed 5/5 empty rate on
894
+ // tt-intelligence/summarize/gemini-2.5-flash with tools offered.
895
+ // v1's disable_thinking_for_short_output already fired and didn't
896
+ // help — disabling thinking is necessary but not sufficient. Tools
897
+ // present + summarize intent confuses Flash into a no-output state
898
+ // (likely tool-decision purgatory). Strip tools entirely for this
899
+ // archetype on this model.
900
+ metric: "tool_count",
901
+ threshold: 1,
902
+ whenIntent: "summarize",
903
+ action: "strip_tools",
904
+ reason: "Gemini Flash returns empty when summarize intent has tools offered (5/5 empty rate observed in v1 prod 2026-04-19, replayed into v2 brain 2026-04-29)"
905
+ }
906
+ ],
907
+ costInputPer1m: 0.3,
908
+ costOutputPer1m: 2.5,
909
+ lowering: {
910
+ ...GOOGLE_LOWERING_BASE,
911
+ thinking: { field: "generationConfig.thinkingConfig.thinkingBudget", default: "auto" }
912
+ },
913
+ recovery: [
914
+ {
915
+ signal: "empty_response_after_tool",
916
+ action: "retry_with_params",
917
+ retryParams: { "generationConfig.thinkingConfig.thinkingBudget": 0 },
918
+ maxRetries: 1,
919
+ reason: "Known: empty after tool result \u2014 retry with thinking off"
920
+ },
921
+ {
922
+ signal: "empty_response",
923
+ action: "retry_with_params",
924
+ retryParams: { "generationConfig.thinkingConfig.thinkingBudget": 0 },
925
+ maxRetries: 1,
926
+ reason: "Empty response \u2014 try with thinking off"
927
+ },
928
+ {
929
+ signal: "malformed_function_call",
930
+ action: "escalate",
931
+ reason: "MALFORMED_FUNCTION_CALL maps to stop \u2014 escalate to next target"
932
+ }
933
+ ],
934
+ strengths: ["speed", "volume", "classification", "1m_context", "cost"],
935
+ weaknesses: ["complex_schemas", "large_tool_sets", "high_context_quality"],
936
+ notes: "AUTO-ONBOARDED 2026-05-16 from `gemini-2.5-flash`. Pricing, context, cliffs are template-cloned and UNVERIFIED \u2014 confirm against provider docs before promoting status to 'current'.",
937
+ // Master plan §6.2 anchor. Tier 0 for hunt (parallel tool throughput
938
+ // 15-75 calls/step beats Sonnet — L-040), summarize, classify.
939
+ archetypePerf: {
940
+ hunt: 9,
941
+ // L-040: parallel tool throughput 15-75/step
942
+ classify: 7,
943
+ // brain-validated, 218 rows
944
+ summarize: 7,
945
+ // brain-validated; cliff strips tools when present
946
+ transform: 7,
947
+ ask: 7,
948
+ generate: 6,
949
+ plan: 5,
950
+ extract: 6,
951
+ // alpha.8 MAX_TOKENS history on structured output
952
+ critique: 4
953
+ // reasoning shallower than Sonnet/Opus
954
+ }
955
+ },
956
+ {
957
+ // ── Gemini 2.5 Flash-Lite ──
958
+ // Onboarded 2026-05-13 (s22) after the model-release watcher surfaced
959
+ // it as a UNREGISTERED + NEW candidate. Released by Google July 2025,
960
+ // stable. Positioned BELOW Flash on the cost/perf frontier:
961
+ // input $0.10/M (Flash $0.30/M) — 3× cheaper
962
+ // output $0.40/M (Flash $2.50/M) — 6× cheaper
963
+ // cache $0.01/M — 1/10 of input (vs Flash 0.25 discount)
964
+ // Cliffs are HYPOTHESIZED from Flash's known failure modes — Flash-Lite
965
+ // is a smaller sibling, so we inherit Flash's cliffs at equal-or-tighter
966
+ // thresholds. The brain will validate/relax these as evidence accumulates
967
+ // per (archetype, model) tuple. Currently ZERO brain rows for this model.
968
+ id: "gemini-3.1-flash-lite",
969
+ verifiedAgainstDocs: "UNVERIFIED-AUTO-ONBOARD",
970
+ provider: "google",
971
+ status: "preview",
972
+ maxContextTokens: 1048576,
973
+ maxOutputTokens: 65536,
974
+ maxTools: 128,
975
+ parallelToolCalls: true,
976
+ structuredOutput: "native",
977
+ systemPromptMode: "separate",
978
+ streaming: true,
979
+ cliffs: [
980
+ {
981
+ metric: "input_tokens",
982
+ threshold: 8e3,
983
+ action: "downgrade_quality_warning",
984
+ reason: "Inherited from Flash: quality degrades above ~8K. Smaller model \u2014 likely degrades faster. Re-tune from brain after n\u226520."
985
+ },
986
+ {
987
+ metric: "tool_count",
988
+ threshold: 10,
989
+ action: "drop_to_top_relevant",
990
+ reason: "Conservative: Flash drops at 20, Flash-Lite is smaller \u2014 assume tighter ceiling until brain proves otherwise."
991
+ },
992
+ {
993
+ metric: "thinking_with_short_output",
994
+ threshold: 1,
995
+ action: "force_thinking_budget_zero",
996
+ reason: "Thinking enabled per Google API (thinking: true). Same drain risk as Flash \u2014 thinking tokens consume maxOutputTokens."
997
+ },
998
+ {
999
+ // Strong prior: Flash hit 5/5 empty rate on summarize+tools (s11
1000
+ // trust artifact, kgauto commit 3872832). Flash-Lite shares the
1001
+ // same architectural family — almost certainly inherits this cliff.
1002
+ // Ship the guard preemptively; brain telemetry confirms or relaxes.
1003
+ metric: "tool_count",
1004
+ threshold: 1,
1005
+ whenIntent: "summarize",
1006
+ action: "strip_tools",
1007
+ reason: "Inherited from Flash s11 cliff: summarize+tools \u2192 empty response. Preemptive guard until brain evidence on Flash-Lite specifically."
1008
+ }
1009
+ ],
1010
+ costInputPer1m: 0.1,
1011
+ costOutputPer1m: 0.4,
1012
+ lowering: {
1013
+ ...GOOGLE_LOWERING_BASE,
1014
+ // Cache discount 10× (vs Flash 4×) — Google's spec is $0.01/M cache vs
1015
+ // $0.10/M input. Material for repeat-prompt workloads (classify shape).
1016
+ cache: { ...GOOGLE_LOWERING_BASE.cache, discount: 0.1 },
1017
+ thinking: { field: "generationConfig.thinkingConfig.thinkingBudget", default: "auto" }
1018
+ },
1019
+ recovery: [
1020
+ {
1021
+ signal: "empty_response_after_tool",
1022
+ action: "retry_with_params",
1023
+ retryParams: { "generationConfig.thinkingConfig.thinkingBudget": 0 },
1024
+ maxRetries: 1,
1025
+ reason: "Known on Flash family: empty after tool result \u2014 retry with thinking off."
1026
+ },
1027
+ {
1028
+ signal: "empty_response",
1029
+ action: "retry_with_params",
1030
+ retryParams: { "generationConfig.thinkingConfig.thinkingBudget": 0 },
1031
+ maxRetries: 1,
1032
+ reason: "Empty response \u2014 try with thinking off."
1033
+ },
1034
+ {
1035
+ signal: "malformed_function_call",
1036
+ action: "escalate",
1037
+ reason: "MALFORMED_FUNCTION_CALL maps to stop \u2014 escalate to next target."
1038
+ }
1039
+ ],
1040
+ strengths: ["lowest_cost", "speed", "volume", "classification", "summarize", "1m_context", "cache_friendly"],
1041
+ weaknesses: ["complex_reasoning", "large_tool_sets", "complex_schemas", "structured_output_unproven", "long_context_quality"],
1042
+ notes: "AUTO-ONBOARDED 2026-05-16 from `gemini-2.5-flash-lite`. Pricing, context, cliffs are template-cloned and UNVERIFIED \u2014 confirm against provider docs before promoting status to 'current'.",
1043
+ // Tier 3 emergency floor for summarize/classify chains. ZERO brain
1044
+ // rows — all values are starter hypotheses anchored to "smaller
1045
+ // sibling of Flash, at-or-below Flash perf on every archetype." The
1046
+ // first 50 brain rows per archetype will validate or relax these.
1047
+ archetypePerf: {
1048
+ classify: 6,
1049
+ // starter hypothesis — verify (Flash is 7, lite likely ≤)
1050
+ summarize: 6,
1051
+ // starter hypothesis — verify; cliff strips tools
1052
+ transform: 6,
1053
+ // starter hypothesis — verify
1054
+ ask: 5,
1055
+ hunt: 5,
1056
+ generate: 4,
1057
+ extract: 4,
1058
+ plan: 3,
1059
+ critique: 3
1060
+ }
647
1061
  }
648
1062
  ];
649
1063
  var ALIASES = {
package/dist/profiles.mjs CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  getProfile,
7
7
  profilesByProvider,
8
8
  tryGetProfile
9
- } from "./chunk-DICCTQLG.mjs";
9
+ } from "./chunk-7MTHFSNY.mjs";
10
10
  export {
11
11
  ALIASES,
12
12
  _setProfileBrainHook,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@warmdrift/kgauto-compiler",
3
- "version": "2.0.0-alpha.14",
3
+ "version": "2.0.0-alpha.16",
4
4
  "description": "Prompt compiler + central learning brain for multi-model AI apps. Swap models without rewriting prompts.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",