@ainova-systems/intelligence 0.11.0-rc.1 → 0.11.0-rc.11

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.
Files changed (72) hide show
  1. package/README.md +19 -16
  2. package/cli/commands/adapter.sh +153 -0
  3. package/cli/commands/init.sh +171 -34
  4. package/cli/commands/package.sh +30 -0
  5. package/cli/commands/registry.sh +65 -30
  6. package/cli/commands/status.sh +20 -11
  7. package/cli/commands/sync.sh +9 -4
  8. package/cli/commands/update.sh +80 -46
  9. package/cli/engine-package.yaml +14 -0
  10. package/cli/intelligence +37 -26
  11. package/cli/internal/align-project.sh +134 -0
  12. package/cli/internal/check.sh +128 -0
  13. package/cli/internal/convert-legacy.sh +400 -0
  14. package/cli/{commands/add.sh → internal/package-add.sh} +37 -19
  15. package/cli/{commands/list.sh → internal/package-list.sh} +10 -5
  16. package/cli/{commands/remove.sh → internal/package-remove.sh} +16 -4
  17. package/cli/internal/package-search.sh +83 -0
  18. package/cli/internal/package-update.sh +103 -0
  19. package/cli/internal/restore.sh +130 -0
  20. package/cli/internal/target-state.sh +57 -0
  21. package/cli/lib/cli-common.sh +213 -63
  22. package/cli/lib/lockfile.sh +15 -9
  23. package/cli/lib/manifest.sh +257 -4
  24. package/cli/lib/registry.sh +96 -47
  25. package/cli/lib/semver.sh +12 -4
  26. package/engine/ENGINE_SHA +1 -0
  27. package/engine/{scripts/adapters → adapters}/_template.sh +10 -9
  28. package/engine/{scripts/adapters → adapters}/agents.sh +20 -25
  29. package/engine/{scripts/adapters → adapters}/opencode.sh +1 -1
  30. package/engine/{scripts/lib → lib}/common.sh +30 -538
  31. package/engine/lib/contract.sh +120 -0
  32. package/engine/sync.sh +238 -0
  33. package/package.json +5 -5
  34. package/{engine → packages/sync}/agents/intelligence-architect.md +5 -3
  35. package/{engine → packages/sync}/agents/intelligence-operator.md +10 -13
  36. package/packages/sync/references/adapters.md +252 -0
  37. package/packages/sync/references/conventions.md +385 -0
  38. package/{engine → packages/sync}/rules/intelligence-authoring.md +7 -7
  39. package/{engine → packages/sync}/skills/intelligence-add-agent/SKILL.md +7 -7
  40. package/{engine → packages/sync}/skills/intelligence-add-rule/SKILL.md +5 -5
  41. package/{engine → packages/sync}/skills/intelligence-add-skill/SKILL.md +5 -5
  42. package/{engine → packages/sync}/skills/intelligence-extract-skill/SKILL.md +2 -2
  43. package/packages/sync/skills/intelligence-install-adapter/SKILL.md +38 -0
  44. package/{engine → packages/sync}/skills/intelligence-learn-from-context/SKILL.md +3 -3
  45. package/packages/sync/skills/intelligence-learn-from-repository/SKILL.md +55 -0
  46. package/{engine → packages/sync}/skills/intelligence-review-skills/SKILL.md +7 -7
  47. package/packages/sync/skills/intelligence-sync/SKILL.md +20 -0
  48. package/packages/sync/skills/intelligence-uninstall-adapter/SKILL.md +24 -0
  49. package/packages/sync/skills/intelligence-update/SKILL.md +43 -0
  50. package/cli/commands/doctor.sh +0 -100
  51. package/cli/commands/install.sh +0 -84
  52. package/cli/commands/migrate.sh +0 -251
  53. package/cli/commands/upgrade.sh +0 -27
  54. package/engine/INIT.md +0 -498
  55. package/engine/docs/ADAPTERS.md +0 -212
  56. package/engine/docs/CLI.md +0 -91
  57. package/engine/docs/CONVENTIONS.md +0 -440
  58. package/engine/scripts/lib/layout.sh +0 -51
  59. package/engine/scripts/lib/migrations.sh +0 -708
  60. package/engine/scripts/sync.sh +0 -311
  61. package/engine/scripts/update.sh +0 -237
  62. package/engine/skills/intelligence-install-adapter/SKILL.md +0 -31
  63. package/engine/skills/intelligence-sync/SKILL.md +0 -18
  64. package/engine/skills/intelligence-uninstall-adapter/SKILL.md +0 -42
  65. package/engine/skills/intelligence-update/SKILL.md +0 -159
  66. package/registry/index.yaml +0 -15
  67. /package/engine/{scripts/VERSION → VERSION} +0 -0
  68. /package/engine/{scripts/adapters → adapters}/claude.sh +0 -0
  69. /package/engine/{scripts/adapters → adapters}/codex.sh +0 -0
  70. /package/engine/{scripts/adapters → adapters}/copilot.sh +0 -0
  71. /package/engine/{scripts/adapters → adapters}/cursor.sh +0 -0
  72. /package/engine/{scripts/adapters → adapters}/pi.sh +0 -0
@@ -1,159 +0,0 @@
1
- ---
2
- name: intelligence-update
3
- description: "Update or migrate intelligence-sync: discover engine, read changelog, run migration chain, verify"
4
- argument-hint: "[--yes]"
5
- agent: intelligence-operator
6
- ---
7
-
8
- # Update intelligence-sync
9
-
10
- You are the **intelligent driver** of an update. The bash engine is
11
- deterministic and fail-closed — it never guesses; on any state it cannot
12
- resolve it prints `IS_STATUS=<code>` and stops. Your job: discover the engine,
13
- understand what is changing (read the CHANGELOG across the version gap), run
14
- the migration chain, branch on the status, and **verify afterward**. Ask the
15
- user only when genuinely ambiguous.
16
-
17
- Trigger: the user says something like *"update / migrate intelligence-sync"*.
18
- They never run shell commands by hand — you do.
19
-
20
- ## Key facts
21
-
22
- - **Umbrella** = whatever directory holds `config.yaml` (`intelligence/`,
23
- `Intelligence/`, …). Never assume the name — find it.
24
- - **Engine = a module discovered by ROLE, not by name**: a directory under
25
- the umbrella whose `scripts/sync.sh` **and** `scripts/VERSION` both exist
26
- (conventionally `sync/`, but never assume the folder name).
27
- - **Applied schema version** is the frozen contract key
28
- `sync_version` in `config.yaml` (a permanent top-level scalar;
29
- absent ⇒ pre-0.3.1). **Engine version** is `<module>/scripts/VERSION`.
30
- The gap between them is the set of breaking changes to apply.
31
- - Pre-0.3.1 projects have the engine flat at `<umbrella>/scripts/` and **no**
32
- `sync_version` key. Their frozen `update.sh` fails closed
33
- against the modular upstream (changes nothing) — you bootstrap the first hop.
34
- - The `intelligence-` skill prefix is **reserved** for upstream meta-skills.
35
-
36
- ## Steps
37
-
38
- ### 1. Locate the umbrella & discover the engine
39
- Find the dir containing `config.yaml` → `<umbrella>`. Then find the engine by
40
- role: search `<umbrella>` (one level deep) for a directory `<M>` with both
41
- `<M>/scripts/sync.sh` and `<M>/scripts/VERSION`.
42
-
43
- - Several candidates → pick the one with the highest `scripts/VERSION`.
44
- - A module engine exists → use it; **never** fall back to a flat
45
- `<umbrella>/scripts/` even if present (that's stale legacy).
46
- - No module engine, only flat `<umbrella>/scripts/` (or nothing) → this is a
47
- pre-0.3.1 / un-bootstrapped project; go to step 2's bootstrap.
48
- - No `config.yaml` at all → not bootstrapped; point the user at upstream
49
- `INIT.md` and stop.
50
-
51
- ### 2. Fetch upstream (read-only) — do NOT write into the project yet
52
- Clone upstream into a temp dir (default
53
- `https://github.com/ainova-systems/intelligence-sync`, or the user's
54
- `REPO_URL`/fork). The upstream module is always `intelligence/sync/`.
55
-
56
- ```
57
- git clone --depth=1 <repo> <tmp>
58
- ```
59
-
60
- **Make no changes to the project before step 3's confirmation.** In
61
- particular do not copy anything into `<umbrella>/sync` yet — that would
62
- modify (and could downgrade) an already-modular project even if the user then
63
- declines. The temp clone is only for reading the CHANGELOG and as the source
64
- for the eventual write.
65
-
66
- ### 3. Understand what is changing (changelog-aware)
67
- Determine the project's current version = the `sync_version`
68
- value in `config.yaml`, or `0.0.0` if the key is absent (pre-0.3.1). The
69
- engine version = `<tmp>/intelligence/sync/scripts/VERSION`.
70
-
71
- Read `<tmp>/CHANGELOG.md`. For every release in the range
72
- **`current < release <= engine`** (inclusive of the target release — its
73
- entry holds the destination's breaking post-conditions), read its entry. Pay
74
- special attention to any **`### Breaking`** subsection (the
75
- machine-distinguishable marker). Build a short list of breaking items, new
76
- migrations, and anything to verify afterward. Surface it to the user; without
77
- `--yes`, let them confirm before any write.
78
-
79
- ### 3a. Ensure the engine to run (only now, post-confirmation)
80
- - **Modular project** (a module engine was discovered in step 1): run *its*
81
- `update.sh` — at the discovered module dir, whatever its name. `update.sh`
82
- re-clones upstream internally, shows the diff, and is authoritative; do not
83
- hand-copy over the module.
84
- - **No module engine** (pre-0.3.1 flat or un-bootstrapped): only here create
85
- the module from the temp clone, and only after confirmation:
86
- ```
87
- mkdir -p <umbrella>/sync
88
- cp -r <tmp>/intelligence/sync/. <umbrella>/sync/
89
- ```
90
- then run `<umbrella>/sync/scripts/update.sh`.
91
-
92
- ### 4. Run the engine
93
- Run the `update.sh` of the engine determined in 3a — the **discovered module
94
- dir** for a modular project (whatever its name), or the just-created
95
- `<umbrella>/sync` for the legacy bootstrap path:
96
-
97
- ```
98
- bash <engine-module>/scripts/update.sh --yes # omit --yes to confirm the diff
99
- ```
100
- Capture stdout; find the last `IS_STATUS=<code> [IS_DETAIL=...]` line.
101
-
102
- ### 5. Branch on `IS_STATUS`
103
-
104
- | Code | Meaning | Action |
105
- |---|---|---|
106
- | `ok` | Already current | Go to step 6. |
107
- | `migrated` | Migration chain applied | Go to step 6; note the relocation/changes. |
108
- | `aborted-incomplete` | Staged module incomplete; legacy intact (safe) | Re-run step 2–4 once (clone hiccup). Persists → show output, stop, don't hand-fix. |
109
- | `ahead-of-engine` | Project schema newer than this engine | Do **not** downgrade. Point `REPO_URL` at the correct/newer upstream, or accept it's already ahead. Stop. |
110
- | `needs-update` | Pending breaking changes (sync refused) | Expected pre-migration; proceed — `update.sh` is the migrator. If it persists *after* update, investigate. |
111
- | `config-missing` | No `config.yaml` | Not bootstrapped — direct user to `<umbrella>/sync/INIT.md`. Stop. |
112
- | `error` | Engine couldn't proceed | Show message; check `REPO_URL`. Stop. |
113
- | *(no status)* | Engine crashed before contract | Show full output; don't modify the tree. Stop. |
114
-
115
- On any failure code, first re-read the upstream `CHANGELOG.md` entries for `current < release <= engine` (esp. `### Breaking`) — the breaking change usually explains the error and what the user must do — before retrying or escalating.
116
-
117
- Genuinely **ambiguous** tree (e.g. both a legacy flat `<umbrella>/scripts/`
118
- and a populated module, no clear `sync_version`): inspect both,
119
- summarize the difference, ask the user which is authoritative, apply their
120
- choice. Never guess.
121
-
122
- ### 6. Verify (always, after `ok`/`migrated`)
123
-
124
- Structural — always:
125
- - No `intelligence-*` directory directly under `<umbrella>/skills/`
126
- (meta-skills live only in the module's `skills/`).
127
- - Project content intact: `<umbrella>/{rules,agents}/` and any
128
- non-`intelligence-` skills untouched.
129
- - `config.yaml` has `sync_version` equal to the engine
130
- `scripts/VERSION`, and `sources.skills` includes the module skills path
131
- exactly once.
132
-
133
- Changelog-driven — per release crossed:
134
- - For each **`### Breaking`** item in the crossed range, verify its stated
135
- post-condition actually holds (e.g. a removed/renamed file is gone, a
136
- config-schema change is reflected). If a breaking item has no verifiable
137
- post-condition, state that you could not auto-verify it.
138
-
139
- Then regenerate IDE outputs:
140
- ```
141
- bash <umbrella>/sync/scripts/sync.sh
142
- ```
143
- Relay any model-drift report. Finally summarize: versions before→after, the
144
- breaking changes applied, verification result, anything the user must act on.
145
- Clean up the temp clone.
146
-
147
- ## Notes
148
-
149
- - Everything is **idempotent**. Re-running on a current project is a safe
150
- no-op (`IS_STATUS=ok`).
151
- - Correctness rests on the engine's idempotent structural preconditions, not
152
- on the version stamp — a missing/wrong `sync_version` cannot
153
- cause a needed migration to be skipped; it only weakens the
154
- `ahead-of-engine` guard until re-stamped.
155
- - Never touch `config.yaml` beyond what the engine does (the idempotent
156
- `sources.skills` line and the `sync_version` key). Never
157
- move/delete project skills, rules, or agents.
158
- - Sibling modules beside the engine module are independent — only operate on
159
- the discovered engine module.
@@ -1,15 +0,0 @@
1
- # The default Intelligence Registry index, bundled with the CLI.
2
- #
3
- # Maps a package name to the git repo (and path inside it) the package lives
4
- # in. Needed exactly when a name is not the repo — monorepos like
5
- # intelligence-dev-packs. A name absent here falls through to the convention:
6
- # @org/name -> https://github.com/org/name.git, content at the repo root.
7
- # Organizations override or extend this per scope with `intelligence registry
8
- # add @scope <registry-repo-url>`.
9
- packages:
10
- "@ainova-systems/core":
11
- url: "https://github.com/ainova-systems/intelligence-dev-packs.git"
12
- path: "packs/core"
13
- "@ainova-systems/spec":
14
- url: "https://github.com/ainova-systems/intelligence-dev-packs.git"
15
- path: "packs/spec"
File without changes
File without changes
File without changes
File without changes
File without changes