@ainova-systems/intelligence 0.17.3 → 0.18.0

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.
@@ -295,7 +295,8 @@ manifest="$root/intelligence.yaml"
295
295
  echo "# $content_dir/rules/context.md an always-on rule; describe the project,"
296
296
  echo "# its stack, and the constraints to respect"
297
297
  echo "# $content_dir/agents/<name>.md a persona (frontmatter: name, description,"
298
- echo "# tier: heavy|standard|light, access: full|readonly)"
298
+ echo "# tier: frontier|heavy|standard|light,"
299
+ echo "# access: full|readonly)"
299
300
  echo "# $content_dir/skills/<name>/SKILL.md a procedure invoked as /<name>"
300
301
  echo "# '.intelligence/' is CLI-managed (packages + engine content) — never edit it."
301
302
  echo "sources:"
package/engine/ENGINE_SHA CHANGED
@@ -1 +1 @@
1
- c7851685b484be141067e86ff826a1f16ffe9db6
1
+ 1bf045d314f2c2f58a70d5a74130b5f5376b56e4
package/engine/VERSION CHANGED
@@ -1 +1 @@
1
- 0.17.3
1
+ 0.18.0
@@ -103,7 +103,8 @@ sync_codex_agents() {
103
103
  name="${path##*/}"; name="${name%.md}"
104
104
  resolve_model_var "$tier"
105
105
  case "$tier" in
106
- heavy) effort="high" ;;
106
+ frontier) effort="xhigh" ;;
107
+ heavy|"") effort="high" ;;
107
108
  standard) effort="medium" ;;
108
109
  light) effort="low" ;;
109
110
  *) effort="medium" ;;
@@ -661,6 +661,7 @@ sync_open_skill_dirs() {
661
661
  # target gets it — not just this open-standard dir.
662
662
  if [ "$count" -gt 0 ]; then
663
663
  copy_skill_bundle_dirs "$output_dir" "${skill_dirs[@]}"
664
+ open_skill_invocation_policies "$output_dir" || return 1
664
665
  fi
665
666
 
666
667
  log+=" -> Skills: $count"$'\n'
@@ -670,6 +671,44 @@ sync_open_skill_dirs() {
670
671
  IS_OPEN_SKILLS_LOG="$log"
671
672
  }
672
673
 
674
+ # open_skill_invocation_policies <open_skills_dir> — `disable-model-invocation:
675
+ # true` keeps a skill out of automatic selection in Claude Code, Cursor and
676
+ # Copilot, but Codex ignores that key and reads the same intent from
677
+ # `agents/openai.yaml` beside SKILL.md. Source skills stay tool-neutral: the
678
+ # policy file is derived here, in the open-standard tree Codex reads, so every
679
+ # adapter sharing that tree writes the same bytes. A skill that ships its own
680
+ # `agents/openai.yaml` keeps it — that is the author configuring Codex directly.
681
+ open_skill_invocation_policies() {
682
+ local output_dir="$1" path flag rows
683
+ local -a skill_mds=() policy_dirs=() policies=()
684
+ for path in "$output_dir"/*/SKILL.md; do
685
+ [ -f "$path" ] && [ ! -L "$path" ] && skill_mds+=("$path")
686
+ done
687
+ [ "${#skill_mds[@]}" -gt 0 ] || return 0
688
+ # Captured, not streamed: a reader cut short must fail the render rather
689
+ # than quietly drop a policy and hand the skill back to the model.
690
+ rows="$(frontmatter_index "disable-model-invocation" "${skill_mds[@]}")" || {
691
+ echo "ERROR: could not read skill frontmatter under $output_dir" >&2
692
+ return 1
693
+ }
694
+ while IFS=$'\x1f' read -r path flag; do
695
+ [ "$flag" = "true" ] || continue
696
+ path="${path%/SKILL.md}/agents"
697
+ # A symlinked `agents` would carry the write outside the output tree.
698
+ [ -L "$path" ] && continue
699
+ [ -e "$path/openai.yaml" ] || [ -L "$path/openai.yaml" ] && continue
700
+ policy_dirs+=("$path")
701
+ policies+=("$path/openai.yaml")
702
+ done <<< "$rows"
703
+ [ "${#policies[@]}" -gt 0 ] || return 0
704
+ mkdir -p "${policy_dirs[@]}"
705
+ for path in "${policies[@]}"; do
706
+ printf '%s\n' '# Generated by intelligence-sync from disable-model-invocation in SKILL.md. Do not edit manually.' \
707
+ 'policy:' ' allow_implicit_invocation: false' > "$path"
708
+ done
709
+ finalize_output_files "${policies[@]}"
710
+ }
711
+
673
712
  # Lint YAML frontmatter for common pitfalls (unquoted colons, leading tabs).
674
713
  # Print warnings to stderr; do not fail. Strict consumers (Codex CLI) reject
675
714
  # these files with cryptic messages — catching them in sync gives better DX.
@@ -816,33 +855,47 @@ has_paths() {
816
855
 
817
856
  # --- Tier/Access Mappings ---
818
857
 
819
- # Hardcoded defaults: ide:tier -> model name.
858
+ # Hardcoded defaults: ide:tier -> model name. Where a tool has fewer models
859
+ # than there are tiers, tiers share one (decision 0013). cli/tests/unit-engine.sh
860
+ # pins this table independently, so a bump updates its expected matrix too.
820
861
  # When you bump these, re-run sync in projects; any project whose config.yaml
821
862
  # `models:` section diverges from these will print a drift warning so users
822
863
  # know their override is now stale.
823
864
  # get_model_default_var sets IS_MODEL_DEFAULT; get_model_default prints it.
824
865
  get_model_default_var() {
825
866
  case "$1:$2" in
867
+ # Haiku 4.5 retires no sooner than 2026-10-15 and has no successor, so
868
+ # light shares standard's Sonnet on every Claude-backed target.
869
+ claude:frontier) IS_MODEL_DEFAULT="fable" ;;
826
870
  claude:heavy) IS_MODEL_DEFAULT="opus" ;;
827
871
  claude:standard) IS_MODEL_DEFAULT="sonnet" ;;
828
- claude:light) IS_MODEL_DEFAULT="haiku" ;;
872
+ claude:light) IS_MODEL_DEFAULT="sonnet" ;;
873
+ # Cursor documents only `inherit` or a concrete model ID, so every
874
+ # tier follows the session model unless the manifest pins one.
875
+ cursor:frontier) IS_MODEL_DEFAULT="inherit" ;;
829
876
  cursor:heavy) IS_MODEL_DEFAULT="inherit" ;;
830
877
  cursor:standard) IS_MODEL_DEFAULT="inherit" ;;
831
- cursor:light) IS_MODEL_DEFAULT="fast" ;;
832
- copilot:heavy) IS_MODEL_DEFAULT="gpt-5.6-sol" ;;
833
- copilot:standard) IS_MODEL_DEFAULT="gpt-5.6-terra" ;;
834
- copilot:light) IS_MODEL_DEFAULT="gpt-5.6-luna" ;;
835
- codex:heavy) IS_MODEL_DEFAULT="gpt-5.6-sol" ;;
836
- codex:standard) IS_MODEL_DEFAULT="gpt-5.6-terra" ;;
837
- codex:light) IS_MODEL_DEFAULT="gpt-5.6-luna" ;;
838
- # Antigravity accepts only inherit|flash|pro, so standard and light
839
- # share `flash` — there is no third tier to map onto.
878
+ cursor:light) IS_MODEL_DEFAULT="inherit" ;;
879
+ # GPT-6 has no mid model, so frontier and heavy share Astra; Codex
880
+ # separates them by reasoning effort instead.
881
+ copilot:frontier) IS_MODEL_DEFAULT="gpt-6-astra" ;;
882
+ copilot:heavy) IS_MODEL_DEFAULT="gpt-6-astra" ;;
883
+ copilot:standard) IS_MODEL_DEFAULT="gpt-6.1-sol" ;;
884
+ copilot:light) IS_MODEL_DEFAULT="gpt-6-luna" ;;
885
+ codex:frontier) IS_MODEL_DEFAULT="gpt-6-astra" ;;
886
+ codex:heavy) IS_MODEL_DEFAULT="gpt-6-astra" ;;
887
+ codex:standard) IS_MODEL_DEFAULT="gpt-6.1-sol" ;;
888
+ codex:light) IS_MODEL_DEFAULT="gpt-6-luna" ;;
889
+ # Antigravity accepts only inherit|flash|pro, so frontier and heavy
890
+ # share `pro` and standard and light share `flash`.
891
+ antigravity:frontier) IS_MODEL_DEFAULT="pro" ;;
840
892
  antigravity:heavy) IS_MODEL_DEFAULT="pro" ;;
841
893
  antigravity:standard) IS_MODEL_DEFAULT="flash" ;;
842
894
  antigravity:light) IS_MODEL_DEFAULT="flash" ;;
843
- opencode:heavy) IS_MODEL_DEFAULT="anthropic/claude-opus-4-8" ;;
844
- opencode:standard) IS_MODEL_DEFAULT="anthropic/claude-sonnet-5" ;;
845
- opencode:light) IS_MODEL_DEFAULT="anthropic/claude-haiku-4-5-20251001" ;;
895
+ opencode:frontier) IS_MODEL_DEFAULT="anthropic/claude-fable-5-1" ;;
896
+ opencode:heavy) IS_MODEL_DEFAULT="anthropic/claude-opus-5-5" ;;
897
+ opencode:standard) IS_MODEL_DEFAULT="anthropic/claude-sonnet-5-5" ;;
898
+ opencode:light) IS_MODEL_DEFAULT="anthropic/claude-sonnet-5-5" ;;
846
899
  *) IS_MODEL_DEFAULT="" ;;
847
900
  esac
848
901
  }
@@ -925,25 +978,29 @@ get_model() {
925
978
  fi
926
979
  }
927
980
 
928
- # load_model_tiers <config_file> <ide> — resolve the three standard tiers
929
- # once per adapter run (IS_MODEL_HEAVY / IS_MODEL_STANDARD / IS_MODEL_LIGHT)
930
- # so per-file loops map tier -> model without forking. resolve_model_var
931
- # consumes them; a non-standard tier value still goes through get_model so a
932
- # `models:` override for it keeps working. One manifest pass reads all three.
981
+ # load_model_tiers <config_file> <ide> — resolve the four standard tiers
982
+ # once per adapter run (IS_MODEL_FRONTIER / IS_MODEL_HEAVY /
983
+ # IS_MODEL_STANDARD / IS_MODEL_LIGHT) so per-file loops map tier -> model
984
+ # without forking. resolve_model_var consumes them; a non-standard tier value
985
+ # still goes through get_model so a `models:` override for it keeps working.
986
+ # One manifest pass reads all four.
933
987
  load_model_tiers() {
934
- local config_file="$1" ide="$2" overrides="" tier val heavy="" standard="" light=""
988
+ local config_file="$1" ide="$2" overrides="" tier val frontier="" heavy="" standard="" light=""
935
989
  IS_MODEL_CFG="$config_file"
936
990
  IS_MODEL_IDE="$ide"
937
991
  if [ -n "$config_file" ] && [ -f "$config_file" ]; then
938
- overrides="$(_nested_yaml_values tagged "$config_file" "models" "$ide" heavy standard light)"
992
+ overrides="$(_nested_yaml_values tagged "$config_file" "models" "$ide" frontier heavy standard light)"
939
993
  fi
940
994
  while IFS=$'\037' read -r tier val; do
941
995
  case "$tier" in
996
+ frontier) frontier="$val" ;;
942
997
  heavy) heavy="$val" ;;
943
998
  standard) standard="$val" ;;
944
999
  light) light="$val" ;;
945
1000
  esac
946
1001
  done <<< "$overrides"
1002
+ get_model_default_var "$ide" frontier
1003
+ IS_MODEL_FRONTIER="${frontier:-$IS_MODEL_DEFAULT}"
947
1004
  get_model_default_var "$ide" heavy
948
1005
  IS_MODEL_HEAVY="${heavy:-$IS_MODEL_DEFAULT}"
949
1006
  get_model_default_var "$ide" standard
@@ -957,6 +1014,7 @@ load_model_tiers() {
957
1014
  # shellcheck disable=SC2034 # IS_MODEL is the return channel read by adapters
958
1015
  resolve_model_var() {
959
1016
  case "$1" in
1017
+ frontier) IS_MODEL="$IS_MODEL_FRONTIER" ;;
960
1018
  heavy|"") IS_MODEL="$IS_MODEL_HEAVY" ;;
961
1019
  standard) IS_MODEL="$IS_MODEL_STANDARD" ;;
962
1020
  light) IS_MODEL="$IS_MODEL_LIGHT" ;;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ainova-systems/intelligence",
3
- "version": "0.17.3",
3
+ "version": "0.18.0",
4
4
  "description": "Build, version and distribute AI agent intelligence across your organization — one CLI, versioned Intelligence Packages, and a sync engine for Claude Code, Cursor, Copilot, Codex, Pi and OpenCode.",
5
5
  "bin": {
6
6
  "intelligence": "bin/intelligence.js"
@@ -5,8 +5,6 @@ tier: standard
5
5
  access: full
6
6
  skills:
7
7
  - intelligence-sync
8
- - intelligence-upgrade
9
- - intelligence-manage-adapters
10
8
  ---
11
9
 
12
10
  # Intelligence operator
@@ -28,6 +26,11 @@ the operation in prose.
28
26
  - **Every flow goes through its skill.** The steps and their guards live in `intelligence-sync`,
29
27
  `intelligence-upgrade` and `intelligence-manage-adapters`;
30
28
  improvising around them produces an unverified version of the same work.
29
+ - **Upgrades and adapter changes are the owner's to start.** `intelligence-upgrade` moves CLI and
30
+ package versions, the lock and migrations; `intelligence-manage-adapters` adds or removes whole
31
+ tool outputs. Both are decisions about the layer, so they run only when the owner invokes them,
32
+ and a sync never previews an update or inspects adapters on its own. Name the command the owner
33
+ can run and stop there.
31
34
  - **Operating is not authoring.** A change to what an artifact says - a rule body, an agent persona,
32
35
  a skill's steps - belongs to `intelligence-architect` and the authoring meta-skills. This agent
33
36
  ships what exists and never decides what should exist.
@@ -152,12 +152,12 @@ Use the engine library instead of copying parsers or file-handling logic.
152
152
  | `frontmatter_index(keys, file...)` | Read several frontmatter scalars for many files in one pass (`\x1f`-separated rows; special key `paths#` counts `paths:` lines). |
153
153
  | `has_frontmatter(file)` / `has_paths(file)` | Inspect source shape. |
154
154
  | `strip_frontmatter(file)` | Emit the body without its first frontmatter block. |
155
- | `get_model(config, tool, tier)` | Resolve a `heavy`, `standard` or `light` model, including manifest overrides. |
155
+ | `get_model(config, tool, tier)` | Resolve a `frontier`, `heavy`, `standard` or `light` model, including manifest overrides. |
156
156
  | `get_model_default(tool, tier)` | Read the built-in model default. |
157
- | `load_model_tiers(config, tool)` / `resolve_model_var(tier)` | Resolve the three standard tiers once, then map per file without subprocesses. |
157
+ | `load_model_tiers(config, tool)` / `resolve_model_var(tier)` | Resolve the four standard tiers once, then map per file without subprocesses. |
158
158
  | `copy_skill_bundle(src, dest)` | Copy `SKILL.md` and all resources safely, normalize Markdown and quote free-text frontmatter. |
159
159
  | `copy_skill_bundle_dirs(dest_root, src...)` | Batch form: copy every skill directory into `dest_root/<name>` with one copy and one finalize pass. |
160
- | `sync_open_skill_dirs(root, config, dest)` | Own and populate a shared Agent Skills directory such as `.agents/skills/`. |
160
+ | `sync_open_skill_dirs(root, config, dest)` | Own and populate a shared Agent Skills directory such as `.agents/skills/`, deriving Codex's `agents/openai.yaml` for a skill with `disable-model-invocation: true`. |
161
161
  | `finalize_output_file(file)` | Expand layout tokens and normalize line endings; required for every emitted text file. |
162
162
  | `finalize_output_files(file...)` / `finalize_copy_files(dest, src...)` | Batch forms: finalize in place, or copy-and-finalize into a directory, in one process. |
163
163
  | `emit_wrapped_bodies(spec)` | Emit many header + source-body + tail outputs in one process (see `engine/lib/common.sh` for the spec format). |
@@ -185,11 +185,14 @@ Do not instruct an agent to read rules or restate their content. Claude loads it
185
185
 
186
186
  ### Tier mappings
187
187
 
188
- | Tier | Claude | Cursor | Copilot / Codex | OpenCode | Typical use |
189
- |---|---|---|---|---|---|
190
- | `heavy` | `opus` | `inherit` | `gpt-5.6-sol` | `anthropic/claude-opus-4-8` | implementation, complex reasoning, migration |
191
- | `standard` | `sonnet` | `inherit` | `gpt-5.6-terra` | `anthropic/claude-sonnet-5` | review, validation, analysis |
192
- | `light` | `haiku` | `fast` | `gpt-5.6-luna` | `anthropic/claude-haiku-4-5-20251001` | lookups and simple formatting |
188
+ | Tier | Claude | Cursor | Copilot / Codex | OpenCode | Antigravity | Typical use |
189
+ |---|---|---|---|---|---|---|
190
+ | `frontier` | `fable` | `inherit` | `gpt-6-astra` | `anthropic/claude-fable-5-1` | `pro` | long-horizon autonomous work, the hardest reasoning, where capability outweighs cost |
191
+ | `heavy` | `opus` | `inherit` | `gpt-6-astra` | `anthropic/claude-opus-5-5` | `pro` | implementation, complex reasoning, migration |
192
+ | `standard` | `sonnet` | `inherit` | `gpt-6.1-sol` | `anthropic/claude-sonnet-5-5` | `flash` | review, validation, analysis |
193
+ | `light` | `sonnet` | `inherit` | `gpt-6-luna` | `anthropic/claude-sonnet-5-5` | `flash` | lookups and simple formatting |
194
+
195
+ Codex also receives a reasoning effort per tier — `xhigh`, `high`, `medium`, `low` — which is what separates `frontier` from `heavy` in Codex. Copilot has no effort field, so its `frontier` and `heavy` agents are identical. Claude's Haiku 4.5 is retiring with no successor announced, so `light` shares `standard`'s Sonnet in Claude and OpenCode; Cursor and Antigravity have fewer native levels than there are tiers, so several tiers share one value there too.
193
196
 
194
197
  The vocabulary is tool-neutral. Adapters resolve it through `get_model()`. Override a default under `models.<tool>.<tier>` in `intelligence.yaml` only when the project needs a pin; sync reports drift when that override differs from the current default.
195
198
 
@@ -251,6 +254,8 @@ argument-hint: "<route-name>"
251
254
 
252
255
  Standard optional fields (`license`, `compatibility`, `metadata`, `allowed-tools`) and tool extensions pass through unchanged. A tool ignores fields it does not understand.
253
256
 
257
+ `disable-model-invocation: true` makes a skill one only the owner starts, as a slash command: use it for a procedure that changes versions, the lock or generated outputs, where an agent selecting it unasked is the failure. Claude Code, Cursor and Copilot read the field itself; Codex does not, so sync writes `agents/openai.yaml` with `allow_implicit_invocation: false` beside the skill in `.agents/skills/`. Keep the source to the field — a skill that ships its own `agents/openai.yaml` keeps it unchanged.
258
+
254
259
  These limits reject a skill instead of degrading it:
255
260
 
256
261
  | Field | Limit | Failure mode |
@@ -109,6 +109,6 @@ The goal is subtraction, above. These are only the line past which something is
109
109
 
110
110
  ## Verifying a change to this layer
111
111
 
112
- The per-artifact authoring checks belong to `intelligence-update-context`. Session learning, repository onboarding, and accepted review findings use that same procedure. Invoke `intelligence-learn-from-session` to capture a lesson or workflow, `intelligence-learn-from-repository` for initial migration and recovery, and `intelligence-review-context` for audits and reductions. Operational work uses `intelligence-sync`, `intelligence-upgrade`, or `intelligence-manage-adapters`.
112
+ The per-artifact authoring checks belong to `intelligence-update-context`. Session learning, repository onboarding, and accepted review findings use that same procedure. Invoke `intelligence-learn-from-session` to capture a lesson or workflow, `intelligence-learn-from-repository` for initial migration and recovery, and `intelligence-review-context` for audits and reductions. Operational work uses `intelligence-sync`. `intelligence-upgrade` and `intelligence-manage-adapters` change versions and generated outputs, so only the owner invokes them.
113
113
 
114
114
  A change to this layer is done when `<sync-cmd>` reports `IS_STATUS=ok` and the skill you invoked reports clean.
@@ -3,6 +3,7 @@ name: intelligence-manage-adapters
3
3
  description: "Enable, disable, or remove adapters and assess generated-output cleanup"
4
4
  argument-hint: "<enable|disable|remove> <adapter-name>"
5
5
  agent: intelligence-operator
6
+ disable-model-invocation: true
6
7
  ---
7
8
 
8
9
  # Manage adapters
@@ -4,9 +4,11 @@
4
4
  `<domain>-<role>` and determine its expertise from the source evidence.
5
5
  2. Select tier and access: implementation normally uses `heavy` and `full`;
6
6
  review or validation uses `standard` and `readonly`; simple lookup uses
7
- `light` and `readonly`. Check the target's actual permission mapping when
8
- external read tools are required. If native read-only restrictions exclude
9
- those tools, use `full` only with a clear read-only boundary in the body.
7
+ `light` and `readonly`. Reserve `frontier` for long-horizon work whose
8
+ difficulty justifies the most capable and most expensive model. Check the
9
+ target's actual permission mapping when external read tools are required.
10
+ If native read-only restrictions exclude those tools, use `full` only with a
11
+ clear read-only boundary in the body.
10
12
  3. Keep the body thin: Expertise, Boundaries, and Build & Verify. Carry its own
11
13
  completion criteria and limitations. Reference constraints by name instead
12
14
  of copying rules, and put reusable procedures in skills.
@@ -3,6 +3,7 @@ name: intelligence-upgrade
3
3
  description: "Upgrade Intelligence and installed packages with migration checks"
4
4
  argument-hint: "[@scope/name]"
5
5
  agent: intelligence-operator
6
+ disable-model-invocation: true
6
7
  ---
7
8
 
8
9
  # Upgrade Intelligence and packages