Bootstrap the skill packs from their own repos; docs for the split
scripts/bootstrap.sh now clones each pack (pack.<name>, listed in the new committed packs.json) into the gitignored packs/ BEFORE seeding config, so config-init still generates the pack config fragments; --pack-base overrides the base derived from the checkout's origin remote. README/AGENTS/PACKGEN/ CODEGEN and the packgen skill describe the per-pack repositories.
This commit is contained in:
1 parent
883c51de97
commit
1329de42c4
12 files changed
+142
-53
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: Pack Generation
|
name: Pack Generation
|
||||||
description: Author a new semif-agent skill pack (packs/<name>/) — the pack.json manifest, its skill leaves, its bridge reference, and its config schema. Use when adding a new concern/product bundle under packs/, or when adding a new bridge service to back one.
|
description: Author a new semif-agent skill pack (its own packs/<name>/ repository) — the pack.json manifest, its skill leaves, its bridge reference, and its config schema. Use when adding a new concern/product bundle as its own pack repo, or when adding a new bridge service to back one.
|
||||||
---
|
---
|
||||||
|
|
||||||
# Pack Generation
|
# Pack Generation
|
||||||
@@ -12,10 +12,10 @@ truth and this skill is only the workflow.
|
|||||||
|
|
||||||
## When to use
|
## When to use
|
||||||
|
|
||||||
- The user wants a new concern/product bundle under `packs/<name>/`.
|
- The user wants a new concern/product bundle (its own `packs/<name>/` repo).
|
||||||
- The user wants a new third-party service backed by a bridge in
|
- The user wants a new third-party service backed by a bridge in
|
||||||
`semif_agent/bridges/`.
|
`semif_agent/bridges/`.
|
||||||
- The user is adding skills that should ship as committed seeds rather than be
|
- The user is adding skills that should ship as a pack rather than be
|
||||||
authored at runtime.
|
authored at runtime.
|
||||||
|
|
||||||
## Workflow
|
## Workflow
|
||||||
@@ -27,9 +27,10 @@ truth and this skill is only the workflow.
|
|||||||
already fronts it in `semif_agent/bridges/registry.py` `CATALOG`. If not,
|
already fronts it in `semif_agent/bridges/registry.py` `CATALOG`. If not,
|
||||||
author the bridge first (see the "Authoring a new bridge" section of
|
author the bridge first (see the "Authoring a new bridge" section of
|
||||||
`PACKGEN.md`), register it in `CATALOG`, and give it a pack config block.
|
`PACKGEN.md`), register it in `CATALOG`, and give it a pack config block.
|
||||||
4. **Create `packs/<name>/pack.json`** with `name`, `title`, `concern`,
|
4. **Create the pack** (its own repository, `pack.<name>`):
|
||||||
`categories`, `bridges`, `requires`, `enabled_by_default`, and the `config`
|
`packs/<name>/pack.json` with `name`, `title`, `concern`, `categories`,
|
||||||
schema. Model it on `packs/essentials/pack.json` (bridge-less) or
|
`bridges`, `requires`, `enabled_by_default`, and the `config` schema. Model
|
||||||
|
it on `packs/essentials/pack.json` (bridge-less) or
|
||||||
`packs/simplex/pack.json` (bridge-backed).
|
`packs/simplex/pack.json` (bridge-backed).
|
||||||
5. **Add each leaf** under `skills/<category>/<leaf>/` — `skill.py`,
|
5. **Add each leaf** under `skills/<category>/<leaf>/` — `skill.py`,
|
||||||
`manifest.json`, `contract.json`, `skill.test.py` — following `CODEGEN.md`
|
`manifest.json`, `contract.json`, `skill.test.py` — following `CODEGEN.md`
|
||||||
@@ -44,11 +45,14 @@ truth and this skill is only the workflow.
|
|||||||
pack).
|
pack).
|
||||||
9. **Verify a real run** against the user's actual service — a passing hermetic
|
9. **Verify a real run** against the user's actual service — a passing hermetic
|
||||||
test proves mechanics only, never the live integration.
|
test proves mechanics only, never the live integration.
|
||||||
|
10. **Register and publish:** add the pack's name to the committed `packs.json`
|
||||||
|
in the agent repo, then commit and push the pack's own repository
|
||||||
|
(`pack.<name>`). `scripts/bootstrap.sh` clones it into `packs/`.
|
||||||
|
|
||||||
## Guardrails
|
## Guardrails
|
||||||
|
|
||||||
- A pack is declarative and committed; never put a credential in it (secrets
|
- A pack is declarative, committed in its own repository; never put a credential
|
||||||
live in the gitignored `secrets.json`).
|
in it (secrets live in the gitignored `secrets.json`).
|
||||||
- Bridge *code* stays in `semif_agent/bridges/`; a pack only references a bridge
|
- Bridge *code* stays in `semif_agent/bridges/`; a pack only references a bridge
|
||||||
by name. Never widen the gateway.
|
by name. Never widen the gateway.
|
||||||
- `concern` and `categories` are required; every category needs a description.
|
- `concern` and `categories` are required; every category needs a description.
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ config.py layered per-machine config: config.json is a thin index
|
|||||||
pack's `config` schema, GENERATES config.example.json
|
pack's `config` schema, GENERATES config.example.json
|
||||||
(check-config --write-example) and validates a live config
|
(check-config --write-example) and validates a live config
|
||||||
packs.py SkillPack + PackRegistry: discovers packs/ (a `pack.json`
|
packs.py SkillPack + PackRegistry: discovers packs/ (a `pack.json`
|
||||||
manifest + skills/<category>/<leaf>/), binds a concern to its
|
manifest + skills/<category>/<leaf>/; each pack is cloned from its own repo — see packs.json), binds a concern to its
|
||||||
categories, bridge(s), requirements, and config schema;
|
categories, bridge(s), requirements, and config schema;
|
||||||
merge_packs loads every enabled pack into the tree
|
merge_packs loads every enabled pack into the tree
|
||||||
scheduler.py no up-front gate: every input is dispatched
|
scheduler.py no up-front gate: every input is dispatched
|
||||||
@@ -139,8 +139,8 @@ skills.py tree + registry (hardcoded built-ins: the closed `response` canned
|
|||||||
(skill.py, skill.test.py, contract.json, config.json) and
|
(skill.py, skill.test.py, contract.json, config.json) and
|
||||||
materialize_skill / merge_skill_store
|
materialize_skill / merge_skill_store
|
||||||
hot-load runnable skills from data/skills/;
|
hot-load runnable skills from data/skills/;
|
||||||
merge_packs (semif_agent/packs.py) loads committed pack skills
|
merge_packs (semif_agent/packs.py) loads each pack's skills
|
||||||
from packs/<name>/skills/ with their recorded config read from
|
from packs/<name>/skills/ (each cloned from its own repo) with their recorded config read from
|
||||||
data/skills/ (each pack bundles its concern, category scope,
|
data/skills/ (each pack bundles its concern, category scope,
|
||||||
bridge, and config schema);
|
bridge, and config schema);
|
||||||
ActionResult.needs_input pauses a run for human input;
|
ActionResult.needs_input pauses a run for human input;
|
||||||
@@ -518,7 +518,7 @@ CLI, unit tests (24) + integration tests (2).
|
|||||||
deny-by-default Oct 2026): one setting governs whether the agent may author new
|
deny-by-default Oct 2026): one setting governs whether the agent may author new
|
||||||
skills/categories, as a three-way mode. **Global default** is the top-level
|
skills/categories, as a three-way mode. **Global default** is the top-level
|
||||||
`new_skill_creation` — **`"deny"` by default** (the agent leans on the
|
`new_skill_creation` — **`"deny"` by default** (the agent leans on the
|
||||||
committed packs, the primary way to extend functionality), with `"allow"` an
|
shipped packs, the primary way to extend functionality), with `"allow"` an
|
||||||
explicit opt-in for a host with the resources, or `"ask"`; a category overrides
|
explicit opt-in for a host with the resources, or `"ask"`; a category overrides
|
||||||
it with its own `new_skill_creation` in `data/skills/<category>/config.json`
|
it with its own `new_skill_creation` in `data/skills/<category>/config.json`
|
||||||
(absent = inherit the global). `allow` authors immediately; `deny` blocks authoring
|
(absent = inherit the global). `allow` authors immediately; `deny` blocks authoring
|
||||||
@@ -989,7 +989,9 @@ CLI, unit tests (24) + integration tests (2).
|
|||||||
check** (inline fixtures, loopback `http.server` for HTTP bodies, no external
|
check** (inline fixtures, loopback `http.server` for HTTP bodies, no external
|
||||||
network) that never certifies the live integration — only a real run does.
|
network) that never certifies the live integration — only a real run does.
|
||||||
The body owns no data; everything comes from the runner via `ctx.config`.
|
The body owns no data; everything comes from the runner via `ctx.config`.
|
||||||
- **Skill packs.** `packs/<name>/` bundles a concern with its skills: a
|
- **Skill packs.** Each pack lives in its own repository (`pack.<name>`, listed
|
||||||
|
in the committed `packs.json`); `scripts/bootstrap.sh` clones them into the
|
||||||
|
gitignored `packs/<name>/`. A pack bundles a concern with its skills: a
|
||||||
`pack.json` manifest (name, concern, `categories` → descriptions, `bridges`
|
`pack.json` manifest (name, concern, `categories` → descriptions, `bridges`
|
||||||
referenced by name, `requires`, and a `config` schema) plus
|
referenced by name, `requires`, and a `config` schema) plus
|
||||||
`skills/<category>/<name>/` in the exact generated-skill folder format
|
`skills/<category>/<name>/` in the exact generated-skill folder format
|
||||||
@@ -1001,7 +1003,7 @@ CLI, unit tests (24) + integration tests (2).
|
|||||||
pack follows `bridges.<bridge>.enabled`, else `enabled_by_default`. Disabling a
|
pack follows `bridges.<bridge>.enabled`, else `enabled_by_default`. Disabling a
|
||||||
pack drops its categories entirely (including generated bodies authored into
|
pack drops its categories entirely (including generated bodies authored into
|
||||||
one) and stops its bridge. Recorded config (credentials collected at first
|
one) and stops its bridge. Recorded config (credentials collected at first
|
||||||
fire) is written to the runtime store `data/skills/`, so the committed pack
|
fire) is written to the runtime store `data/skills/`, so a pack repo
|
||||||
never holds secrets, and a generated body with the same name replaces the pack
|
never holds secrets, and a generated body with the same name replaces the pack
|
||||||
skill. The shipped packs: `nextcloud`, `simplex`, `outlook`, `browser` (each
|
skill. The shipped packs: `nextcloud`, `simplex`, `outlook`, `browser` (each
|
||||||
owning its bridge), and `essentials` (the built-in local utilities `time` +
|
owning its bridge), and `essentials` (the built-in local utilities `time` +
|
||||||
@@ -1481,10 +1483,12 @@ CLI, unit tests (24) + integration tests (2).
|
|||||||
- **The contract.** `PACKGEN.md` is the authoritative spec for a new pack —
|
- **The contract.** `PACKGEN.md` is the authoritative spec for a new pack —
|
||||||
`pack.json`, its `config` schema, its bridge reference, and how to author a
|
`pack.json`, its `config` schema, its bridge reference, and how to author a
|
||||||
new bridge to back one. It is the sibling of `CODEGEN.md`/`TESTGEN.md`; read it
|
new bridge to back one. It is the sibling of `CODEGEN.md`/`TESTGEN.md`; read it
|
||||||
before adding anything under `packs/`.
|
before adding a pack (each pack is its own repository).
|
||||||
- **What they are.** A pack bundles a concern/product with the skills that serve
|
- **What they are.** A pack bundles a concern/product with the skills that serve
|
||||||
it, in `packs/<name>/`: a `pack.json` manifest plus
|
it, in `packs/<name>/`: a `pack.json` manifest plus
|
||||||
`skills/<category>/<leaf>/` folders (the exact generated-skill format). The
|
`skills/<category>/<leaf>/` folders (the exact generated-skill format). Each
|
||||||
|
pack is its own repository (`pack.<name>`, listed in `packs.json`), cloned by
|
||||||
|
`scripts/bootstrap.sh` into the gitignored `packs/<name>/`. The
|
||||||
manifest binds the pieces that used to be scattered by convention:
|
manifest binds the pieces that used to be scattered by convention:
|
||||||
`concern`/`title`, `categories` (id -> scope description, feeding
|
`concern`/`title`, `categories` (id -> scope description, feeding
|
||||||
`CATEGORY_DESCRIPTIONS`), `bridges` (names referencing `bridges/registry.py`
|
`CATEGORY_DESCRIPTIONS`), `bridges` (names referencing `bridges/registry.py`
|
||||||
@@ -1508,8 +1512,8 @@ CLI, unit tests (24) + integration tests (2).
|
|||||||
`semif_agent/config.py` `SHARED_BRIDGE_SCHEMA`.
|
`semif_agent/config.py` `SHARED_BRIDGE_SCHEMA`.
|
||||||
- **Shipped packs.** `nextcloud`, `simplex`, `outlook`, `browser` (each owning
|
- **Shipped packs.** `nextcloud`, `simplex`, `outlook`, `browser` (each owning
|
||||||
its bridge) and `essentials` (the built-in local utilities `time` +
|
its bridge) and `essentials` (the built-in local utilities `time` +
|
||||||
`calculator`; no bridge). Adding a concern means adding a pack, not editing
|
`calculator`; no bridge) — each in its own repository. Adding a concern means
|
||||||
`skills.py`.
|
adding a pack repo, not editing `skills.py`.
|
||||||
|
|
||||||
### bridges (third-party API services)
|
### bridges (third-party API services)
|
||||||
|
|
||||||
|
|||||||
+3
-2
@@ -30,7 +30,8 @@ A skill is three things:
|
|||||||
talks to and how) and the `CONTRACT` constant (the values the runner must
|
talks to and how) and the `CONTRACT` constant (the values the runner must
|
||||||
provide).
|
provide).
|
||||||
|
|
||||||
The committed seed `packs/nextcloud/skills/nextcloud/create_event/` is the **authoritative worked
|
The `nextcloud` pack's create_event skill
|
||||||
|
(`packs/nextcloud/skills/nextcloud/create_event/`, from its own repo) is the **authoritative worked
|
||||||
example** of all three. Read its `manifest.json`, its `skill.py` (which declares
|
example** of all three. Read its `manifest.json`, its `skill.py` (which declares
|
||||||
`INTEGRATION` and `CONTRACT`), and its `skill.test.py` alongside this file; a new
|
`INTEGRATION` and `CONTRACT`), and its `skill.test.py` alongside this file; a new
|
||||||
body should look and behave like it.
|
body should look and behave like it.
|
||||||
@@ -405,7 +406,7 @@ INTEGRATION = {
|
|||||||
skills that perform no external action at all (pure analysis/formatting); an
|
skills that perform no external action at all (pure analysis/formatting); an
|
||||||
action skill must not use it.
|
action skill must not use it.
|
||||||
- `config_vars` — the `ctx.config` keys the body reads for this integration. In
|
- `config_vars` — the `ctx.config` keys the body reads for this integration. In
|
||||||
the committed seeds this is exactly the body's `CONTRACT` key set; an empty
|
the shipped seeds this is exactly the body's `CONTRACT` key set; an empty
|
||||||
list is allowed for `compute`. Declaring a variable the body never reads is a
|
list is allowed for `compute`. Declaring a variable the body never reads is a
|
||||||
mismatch the fidelity check flags.
|
mismatch the fidelity check flags.
|
||||||
|
|
||||||
|
|||||||
+20
-14
@@ -6,7 +6,7 @@ skill's runnable **body**, `TESTGEN.md` governs its **test**, and this file
|
|||||||
governs the **pack** that bundles a concern, its skills, its bridge reference,
|
governs the **pack** that bundles a concern, its skills, its bridge reference,
|
||||||
and its settings into one thing.
|
and its settings into one thing.
|
||||||
|
|
||||||
Read this before adding anything under `packs/`. A pack is what makes a new
|
Read this before adding a pack. A pack is what makes a new
|
||||||
product/concern a first-class part of the agent instead of scattered edits to
|
product/concern a first-class part of the agent instead of scattered edits to
|
||||||
`skills.py` and `config.py`.
|
`skills.py` and `config.py`.
|
||||||
|
|
||||||
@@ -14,8 +14,10 @@ product/concern a first-class part of the agent instead of scattered edits to
|
|||||||
|
|
||||||
Semif-agent ships a set of starter integrations. Each is a **pack**: a folder
|
Semif-agent ships a set of starter integrations. Each is a **pack**: a folder
|
||||||
`packs/<name>/` holding a `pack.json` manifest plus a `skills/` store of leaves
|
`packs/<name>/` holding a `pack.json` manifest plus a `skills/` store of leaves
|
||||||
in the exact generated-skill format. The manifest binds the pieces that would
|
in the exact generated-skill format. Each pack lives in its **own repository**
|
||||||
otherwise be scattered by convention:
|
(`pack.<name>`, listed in the committed `packs.json`); `scripts/bootstrap.sh`
|
||||||
|
clones them into the gitignored `packs/<name>/`. The manifest binds the pieces
|
||||||
|
that would otherwise be scattered by convention:
|
||||||
|
|
||||||
- the **concern** (what product/job this is) and its **title**;
|
- the **concern** (what product/job this is) and its **title**;
|
||||||
- its **categories** (the tree buckets it owns, each with a scope description);
|
- its **categories** (the tree buckets it owns, each with a scope description);
|
||||||
@@ -39,9 +41,9 @@ Three boundaries must stay crisp:
|
|||||||
auth state), a native or heavy protocol, or one sanitized surface; a system
|
auth state), a native or heavy protocol, or one sanitized surface; a system
|
||||||
with a plain HTTP API needs no bridge — its skill calls the API directly. A
|
with a plain HTTP API needs no bridge — its skill calls the API directly. A
|
||||||
pack *references* a bridge by name; it never contains bridge code.
|
pack *references* a bridge by name; it never contains bridge code.
|
||||||
- A pack is **declarative structure** and is committed. Per-machine values are
|
- A pack is **declarative structure**, committed in its own repository.
|
||||||
the split config; credentials live in `secrets.json`. A committed pack never
|
Per-machine values are the split config; credentials live in `secrets.json`.
|
||||||
holds a secret.
|
A pack repo never holds a secret.
|
||||||
|
|
||||||
## Folder layout
|
## Folder layout
|
||||||
|
|
||||||
@@ -66,9 +68,9 @@ packs/<name>/
|
|||||||
skill gets from the `llm` provider.
|
skill gets from the `llm` provider.
|
||||||
- A root with no `pack.json` is treated as **one implicit, manifest-less pack**
|
- A root with no `pack.json` is treated as **one implicit, manifest-less pack**
|
||||||
whose store is the root itself (a plain skills directory still works), but a
|
whose store is the root itself (a plain skills directory still works), but a
|
||||||
committed pack should always have a manifest.
|
pack repo should always have a manifest.
|
||||||
|
|
||||||
The committed `packs/` are the authoritative worked examples: `essentials` is
|
The shipped packs are the authoritative worked examples: `essentials` is
|
||||||
the minimal bridge-less pack; `nextcloud`, `simplex`, `outlook`, and `browser`
|
the minimal bridge-less pack; `nextcloud`, `simplex`, `outlook`, and `browser`
|
||||||
are bridge-backed packs.
|
are bridge-backed packs.
|
||||||
|
|
||||||
@@ -307,9 +309,10 @@ A new pack is accepted only if:
|
|||||||
are clean.
|
are clean.
|
||||||
6. Nothing deployment-specific (hostname, address, username, absolute home
|
6. Nothing deployment-specific (hostname, address, username, absolute home
|
||||||
path, local model name) appears in any committed file —
|
path, local model name) appears in any committed file —
|
||||||
`tests/test_no_env_leaks.py` enforces this. Secrets live in `secrets.json`.
|
`tests/test_no_env_leaks.py` enforces this for the agent repo; keep a pack
|
||||||
|
repo clean too. Secrets live in `secrets.json`.
|
||||||
|
|
||||||
`tests/test_packs.py` enforces items 1–3 mechanically for every committed pack
|
`tests/test_packs.py` enforces items 1–3 mechanically for every shipped pack
|
||||||
(valid manifest, concern + categories, integration matches code, contract flat
|
(valid manifest, concern + categories, integration matches code, contract flat
|
||||||
and mirrored, manifest description, hermetic test passes) and keeps the shipped
|
and mirrored, manifest description, hermetic test passes) and keeps the shipped
|
||||||
pack ids present.
|
pack ids present.
|
||||||
@@ -355,7 +358,7 @@ packs/hello/
|
|||||||
```
|
```
|
||||||
|
|
||||||
The leaf's `skill.py` (a `compute`-transport body — no external action, empty
|
The leaf's `skill.py` (a `compute`-transport body — no external action, empty
|
||||||
`CONTRACT`) and `skill.test.py` follow `CODEGEN.md`/`TESTGEN.md`; the committed
|
`CONTRACT`) and `skill.test.py` follow `CODEGEN.md`/`TESTGEN.md`; the shipped
|
||||||
`packs/essentials/skills/time/now/` is the reference for exactly this shape.
|
`packs/essentials/skills/time/now/` is the reference for exactly this shape.
|
||||||
|
|
||||||
For a bridge-backed pack, start from `packs/simplex/pack.json` (bridge
|
For a bridge-backed pack, start from `packs/simplex/pack.json` (bridge
|
||||||
@@ -371,9 +374,9 @@ HTTP). For a bridge with top-level fallbacks, see `packs/nextcloud/`.
|
|||||||
heavy protocol, or one sanitized surface, author a bridge first (see
|
heavy protocol, or one sanitized surface, author a bridge first (see
|
||||||
"Authoring a new bridge") and register it in `CATALOG`. A system with a plain
|
"Authoring a new bridge") and register it in `CATALOG`. A system with a plain
|
||||||
HTTP API needs no bridge — the skill calls it directly.
|
HTTP API needs no bridge — the skill calls it directly.
|
||||||
3. Create `packs/<name>/pack.json` with `name`, `title`, `concern`,
|
3. Create the pack (its own repository, `pack.<name>`): `packs/<name>/pack.json`
|
||||||
`categories`, `bridges` (if any), `requires`, `enabled_by_default`, and the
|
with `name`, `title`, `concern`, `categories`, `bridges` (if any), `requires`,
|
||||||
`config` schema.
|
`enabled_by_default`, and the `config` schema.
|
||||||
4. Add each leaf under `skills/<category>/<leaf>/` following `CODEGEN.md` and
|
4. Add each leaf under `skills/<category>/<leaf>/` following `CODEGEN.md` and
|
||||||
`TESTGEN.md` (`skill.py`, `manifest.json`, `contract.json`, `skill.test.py`).
|
`TESTGEN.md` (`skill.py`, `manifest.json`, `contract.json`, `skill.test.py`).
|
||||||
5. Regenerate and validate config:
|
5. Regenerate and validate config:
|
||||||
@@ -386,3 +389,6 @@ HTTP). For a bridge with top-level fallbacks, see `packs/nextcloud/`.
|
|||||||
pack).
|
pack).
|
||||||
8. Verify a real run against the user's actual service — the only proof the
|
8. Verify a real run against the user's actual service — the only proof the
|
||||||
integration works.
|
integration works.
|
||||||
|
9. Add the pack's name to the committed `packs.json`, then commit and push the
|
||||||
|
pack's own repository (`pack.<name>`); `scripts/bootstrap.sh` clones it into
|
||||||
|
`packs/`.
|
||||||
@@ -404,8 +404,8 @@ semif_agent/
|
|||||||
Outlook, browser)
|
Outlook, browser)
|
||||||
config.py layered config: index includes + !secret + schema/example
|
config.py layered config: index includes + !secret + schema/example
|
||||||
packs.py SkillPack + PackRegistry (bundles skills by concern/bridge)
|
packs.py SkillPack + PackRegistry (bundles skills by concern/bridge)
|
||||||
packs/ committed skill packs: nextcloud, simplex, outlook, browser,
|
packs/ skill packs, each cloned from its own repo (pack.<name>)
|
||||||
essentials (a pack.json manifest + skills/<category>/<leaf>/)
|
into this gitignored dir — see packs.json + PACKGEN.md
|
||||||
scripts/ bootstrap.sh, simplex-address.py, systemd/*.in
|
scripts/ bootstrap.sh, simplex-address.py, systemd/*.in
|
||||||
requirements/ staging.txt — the pinned engine deps
|
requirements/ staging.txt — the pinned engine deps
|
||||||
tests/ stdlib unit tests + tests/integration (real engine + LLM)
|
tests/ stdlib unit tests + tests/integration (real engine + LLM)
|
||||||
@@ -418,6 +418,7 @@ config/ split config fragments (core, gateway, bridges, packs/*)
|
|||||||
secrets.json gitignored credentials, referenced as "!secret <key>"
|
secrets.json gitignored credentials, referenced as "!secret <key>"
|
||||||
config.example.json GENERATED per-machine config reference (from the schemas)
|
config.example.json GENERATED per-machine config reference (from the schemas)
|
||||||
pins.json committed pins: engine/GGUF/tokenizer/simplex-chat refs
|
pins.json committed pins: engine/GGUF/tokenizer/simplex-chat refs
|
||||||
|
packs.json committed list of skill-pack repos cloned into packs/
|
||||||
local/ gitignored: this deployment's notes (hosts, addresses, models)
|
local/ gitignored: this deployment's notes (hosts, addresses, models)
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -954,12 +955,14 @@ bodies, no external network, no `mock_data.json`. Passing it proves the code
|
|||||||
runs, not that the live integration works. That is what the real run and the
|
runs, not that the live integration works. That is what the real run and the
|
||||||
repair loop are for.
|
repair loop are for.
|
||||||
|
|
||||||
**Packs** (`packs/<name>/`) ship real starter integrations in the exact generated
|
**Packs** ship real starter integrations in the exact generated folder format,
|
||||||
folder format, plus a `manifest.json` and a `pack.json` manifest binding the
|
plus a `manifest.json` and a `pack.json` manifest binding the concern to its
|
||||||
concern to its categories, bridge, and config schema. `merge_packs` loads every
|
categories, bridge, and config schema. Each pack lives in its **own repository**
|
||||||
enabled pack into the tree at startup; recorded config is written to the runtime
|
(`pack.<name>`, listed in `packs.json`); `scripts/bootstrap.sh` clones them into
|
||||||
store, so the committed pack never holds secrets. `PACKGEN.md` is the
|
the gitignored `packs/<name>/`, and `merge_packs` loads every enabled pack into
|
||||||
authoritative contract for authoring a new pack (and a new bridge to back one).
|
the tree at startup. Recorded config is written to the runtime store, so a pack
|
||||||
|
repo never holds secrets. `PACKGEN.md` is the authoritative contract for
|
||||||
|
authoring a new pack (and a new bridge to back one).
|
||||||
|
|
||||||
- `nextcloud.create_event` — create an event on Nextcloud CalDAV (the
|
- `nextcloud.create_event` — create an event on Nextcloud CalDAV (the
|
||||||
authoritative worked example); resolves the target calendar with a SemIf
|
authoritative worked example); resolves the target calendar with a SemIf
|
||||||
|
|||||||
+10
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"_comment": "The skill packs that ship with the agent. Each lives in its own repository named pack.<name>; scripts/bootstrap.sh clones each into the gitignored packs/<name>/ from a sibling of this checkout's origin remote (override the base URL with --pack-base). The agent loads every pack under skill_packs (default 'packs'); PACKGEN.md is the contract for authoring a new one.",
|
||||||
|
"packs": [
|
||||||
|
"browser",
|
||||||
|
"essentials",
|
||||||
|
"nextcloud",
|
||||||
|
"outlook",
|
||||||
|
"simplex"
|
||||||
|
]
|
||||||
|
}
|
||||||
+64
-4
@@ -7,8 +7,11 @@
|
|||||||
# it); codegen may point at a remote ollama host. This script installs NO ollama.
|
# it); codegen may point at a remote ollama host. This script installs NO ollama.
|
||||||
#
|
#
|
||||||
# Must be run from a semif-agent checkout. The checkout is used as-is and never
|
# Must be run from a semif-agent checkout. The checkout is used as-is and never
|
||||||
# re-cloned — only the SemIf engine and the simplex-chat binary are fetched.
|
# re-cloned — only the SemIf engine, the simplex-chat binary, and the skill
|
||||||
# Clone the agent repo first (its SSH key must be registered on your git host).
|
# packs are fetched. Clone the agent repo first (its SSH key must be registered
|
||||||
|
# on your git host); each skill pack is then cloned from a sibling repository
|
||||||
|
# named pack.<name> on the same host (see packs.json) into the gitignored
|
||||||
|
# packs/ directory.
|
||||||
#
|
#
|
||||||
# config.json is the per-machine USER config (a thin index over config/*.json)
|
# config.json is the per-machine USER config (a thin index over config/*.json)
|
||||||
# and this script NEVER rewrites it. It seeds the split config via `config-init`
|
# and this script NEVER rewrites it. It seeds the split config via `config-init`
|
||||||
@@ -35,7 +38,7 @@
|
|||||||
# Usage:
|
# Usage:
|
||||||
# scripts/bootstrap.sh [--llm-url URL] [--codegen-url URL] [--llm-model MODEL]
|
# scripts/bootstrap.sh [--llm-url URL] [--codegen-url URL] [--llm-model MODEL]
|
||||||
# [--codegen-model MODEL] [--copy-data SRC] [--voice]
|
# [--codegen-model MODEL] [--copy-data SRC] [--voice]
|
||||||
# [--browser] [--gpu MODE] [-h]
|
# [--browser] [--gpu MODE] [--pack-base URL] [-h]
|
||||||
#
|
#
|
||||||
# Run as the human user; sudo is used internally for system bits.
|
# Run as the human user; sudo is used internally for system bits.
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
@@ -48,9 +51,10 @@ COPY_DATA=""
|
|||||||
VOICE=0
|
VOICE=0
|
||||||
BROWSER=0
|
BROWSER=0
|
||||||
GPU_MODE="auto"
|
GPU_MODE="auto"
|
||||||
|
PACK_BASE=""
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
sed -n '2,35p' "${BASH_SOURCE[0]}" | sed 's/^# \{0,1\}//'
|
sed -n '2,/^set -euo pipefail/p' "${BASH_SOURCE[0]}" | sed '$d' | sed 's/^# \{0,1\}//'
|
||||||
echo
|
echo
|
||||||
echo " --llm-url URL override llm.base_url from config.json for this run (else config.json, else http://127.0.0.1:11434)"
|
echo " --llm-url URL override llm.base_url from config.json for this run (else config.json, else http://127.0.0.1:11434)"
|
||||||
echo " --codegen-url URL override codegen.base_url from config.json for this run"
|
echo " --codegen-url URL override codegen.base_url from config.json for this run"
|
||||||
@@ -60,6 +64,7 @@ usage() {
|
|||||||
echo " --voice install the optional voice-gateway stack + download its models"
|
echo " --voice install the optional voice-gateway stack + download its models"
|
||||||
echo " --browser install the optional browser-bridge stack (Playwright + Chromium)"
|
echo " --browser install the optional browser-bridge stack (Playwright + Chromium)"
|
||||||
echo " --gpu MODE decision-engine llama.cpp backend: auto (default; a GPU build only when engine.gpu_layers is set), vulkan, rocm, cuda, cpu"
|
echo " --gpu MODE decision-engine llama.cpp backend: auto (default; a GPU build only when engine.gpu_layers is set), vulkan, rocm, cuda, cpu"
|
||||||
|
echo " --pack-base URL base URL of the skill-pack repos (default: derived from this checkout's origin remote)"
|
||||||
echo " -h this help"
|
echo " -h this help"
|
||||||
exit "${1:-0}"
|
exit "${1:-0}"
|
||||||
}
|
}
|
||||||
@@ -74,6 +79,7 @@ while [[ $# -gt 0 ]]; do
|
|||||||
--voice) VOICE=1; shift ;;
|
--voice) VOICE=1; shift ;;
|
||||||
--browser) BROWSER=1; shift ;;
|
--browser) BROWSER=1; shift ;;
|
||||||
--gpu) GPU_MODE="$2"; shift 2 ;;
|
--gpu) GPU_MODE="$2"; shift 2 ;;
|
||||||
|
--pack-base) PACK_BASE="$2"; shift 2 ;;
|
||||||
-h|--help) usage 0 ;;
|
-h|--help) usage 0 ;;
|
||||||
*) echo "unknown option: $1" >&2; usage 1 ;;
|
*) echo "unknown option: $1" >&2; usage 1 ;;
|
||||||
esac
|
esac
|
||||||
@@ -106,6 +112,57 @@ if [[ ! -f "$PINS" ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# --- skill packs ----------------------------------------------------------------
|
||||||
|
# Each pack ships in its own repository named pack.<name>, cloned into the
|
||||||
|
# gitignored packs/ directory; the agent loads every pack under skill_packs
|
||||||
|
# (default "packs"). The list lives in the committed packs.json; each repo is a
|
||||||
|
# sibling of this checkout's origin remote (pack.<name>) unless --pack-base
|
||||||
|
# overrides the base. This runs BEFORE the config is seeded so config-init sees
|
||||||
|
# the packs and generates their config/packs/*.json fragments. Idempotent:
|
||||||
|
# clone when absent, fast-forward when present.
|
||||||
|
PACK_MANIFEST="$REPO_ROOT/packs.json"
|
||||||
|
if [[ -f "$PACK_MANIFEST" ]]; then
|
||||||
|
if [[ -z "$PACK_BASE" ]]; then
|
||||||
|
ORIGIN_URL="$(git -C "$REPO_ROOT" remote get-url origin 2>/dev/null || true)"
|
||||||
|
PACK_BASE="${ORIGIN_URL%/*}"
|
||||||
|
fi
|
||||||
|
PACK_BASE="${PACK_BASE%/}"
|
||||||
|
if [[ -z "$PACK_BASE" ]]; then
|
||||||
|
echo "WARN: no 'origin' remote to derive the skill-pack repos from; clone them into packs/ or pass --pack-base URL" >&2
|
||||||
|
else
|
||||||
|
echo "== skill packs (from $PACK_BASE/pack.<name>)"
|
||||||
|
mkdir -p "$REPO_ROOT/packs"
|
||||||
|
while IFS= read -r pack_name; do
|
||||||
|
[[ -z "$pack_name" ]] && continue
|
||||||
|
pack_dst="$REPO_ROOT/packs/$pack_name"
|
||||||
|
pack_url="$PACK_BASE/pack.$pack_name.git"
|
||||||
|
if [[ -d "$pack_dst/.git" ]]; then
|
||||||
|
if git -C "$pack_dst" pull --ff-only --quiet 2>/dev/null; then
|
||||||
|
echo " $pack_name: up to date"
|
||||||
|
else
|
||||||
|
echo " WARN: could not update pack $pack_name (leaving the local checkout)" >&2
|
||||||
|
fi
|
||||||
|
elif [[ -e "$pack_dst" ]]; then
|
||||||
|
echo " WARN: packs/$pack_name exists but is not a git clone; leaving it" >&2
|
||||||
|
elif git clone --quiet "$pack_url" "$pack_dst" 2>/dev/null; then
|
||||||
|
echo " $pack_name: cloned"
|
||||||
|
else
|
||||||
|
echo " WARN: could not clone $pack_name from $pack_url" >&2
|
||||||
|
fi
|
||||||
|
done < <(python3 - "$PACK_MANIFEST" <<'PY'
|
||||||
|
import json, sys
|
||||||
|
try:
|
||||||
|
data = json.load(open(sys.argv[1]))
|
||||||
|
except Exception:
|
||||||
|
raise SystemExit(0)
|
||||||
|
for name in data.get("packs", []):
|
||||||
|
if str(name).strip():
|
||||||
|
print(str(name).strip())
|
||||||
|
PY
|
||||||
|
)
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# config.json is per-machine USER config. Seed it once (as a thin index plus the
|
# config.json is per-machine USER config. Seed it once (as a thin index plus the
|
||||||
# split config/ fragments + secrets.json), then never write it again — only a
|
# split config/ fragments + secrets.json), then never write it again — only a
|
||||||
# human edits it. The committed config.example.json is GENERATED from the pack +
|
# human edits it. The committed config.example.json is GENERATED from the pack +
|
||||||
@@ -642,6 +699,9 @@ Done. Next steps:
|
|||||||
codegen.model/codegen.base_url; put credentials in secrets.json.
|
codegen.model/codegen.base_url; put credentials in secrets.json.
|
||||||
bootstrap.sh seeded the config via config-init (if it was absent)
|
bootstrap.sh seeded the config via config-init (if it was absent)
|
||||||
and NEVER rewrites it; only you edit it.
|
and NEVER rewrites it; only you edit it.
|
||||||
|
2. Skill packs are cloned from their own repos into packs/ (see packs.json);
|
||||||
|
they are gitignored here. Update them with:
|
||||||
|
for d in packs/*/; do git -C "\$d" pull --ff-only; done
|
||||||
cd "$REPO_ROOT"
|
cd "$REPO_ROOT"
|
||||||
HF_HOME="$HF_CACHE" "$PYTHON" -m semif_agent.cli run
|
HF_HOME="$HF_CACHE" "$PYTHON" -m semif_agent.cli run
|
||||||
HF_HOME="$HF_CACHE" "$PYTHON" -m pytest tests/integration -q -s (needs real engine+LLM)
|
HF_HOME="$HF_CACHE" "$PYTHON" -m pytest tests/integration -q -s (needs real engine+LLM)
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ a host with the pinned engine:
|
|||||||
.runtime/venv/bin/python scripts/tune_navigation.py
|
.runtime/venv/bin/python scripts/tune_navigation.py
|
||||||
.runtime/venv/bin/python scripts/tune_navigation.py --level leaf --tau 0.6
|
.runtime/venv/bin/python scripts/tune_navigation.py --level leaf --tau 0.6
|
||||||
|
|
||||||
The tree is whatever the host currently has loaded (committed packs + the runtime
|
The tree is whatever the host currently has loaded (shipped packs + the runtime
|
||||||
`data/skills/`), so an expectation naming a skill that is not present is
|
`data/skills/`), so an expectation naming a skill that is not present is
|
||||||
reported as N/A rather than counted wrong. Labels are hand-written ground truth;
|
reported as N/A rather than counted wrong. Labels are hand-written ground truth;
|
||||||
self-labeled decision rows are not evidence. Nothing is written to the runtime
|
self-labeled decision rows are not evidence. Nothing is written to the runtime
|
||||||
|
|||||||
+1
-1
@@ -147,7 +147,7 @@ def load_config(path: str = "config.json") -> dict:
|
|||||||
|
|
||||||
Path-valued keys (`skill_packs`, `skill_bodies`, `category_registry`, `log`,
|
Path-valued keys (`skill_packs`, `skill_bodies`, `category_registry`, `log`,
|
||||||
`trace`) resolve against REPO_ROOT, not the process cwd, so a fresh clone
|
`trace`) resolve against REPO_ROOT, not the process cwd, so a fresh clone
|
||||||
loads its committed packs and writes runtime artifacts into the checkout no
|
loads its packs and writes runtime artifacts into the checkout no
|
||||||
matter where the CLI is invoked from. Absolute values pass through untouched.
|
matter where the CLI is invoked from. Absolute values pass through untouched.
|
||||||
"""
|
"""
|
||||||
config_path = Path(path)
|
config_path = Path(path)
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ CORE_SCHEMA: dict[str, Any] = {'tau': {'default': 0.6, 'type': 'float', 'doc': '
|
|||||||
'type': 'str',
|
'type': 'str',
|
||||||
'doc': 'Global tri-state new-skill mode: deny (default) | allow | ask (a '
|
'doc': 'Global tri-state new-skill mode: deny (default) | allow | ask (a '
|
||||||
'category config overrides it). Deny by default: the agent leans on '
|
'category config overrides it). Deny by default: the agent leans on '
|
||||||
'the committed packs, and a host opts in to live skill authoring by '
|
'the shipped packs, and a host opts in to live skill authoring by '
|
||||||
'setting allow.'},
|
'setting allow.'},
|
||||||
'verbosity': {'default': 'result',
|
'verbosity': {'default': 'result',
|
||||||
'type': 'str',
|
'type': 'str',
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ from .trace import TraceLog
|
|||||||
|
|
||||||
#: The tri-state governing whether a new skill (or category) may be authored.
|
#: The tri-state governing whether a new skill (or category) may be authored.
|
||||||
#: `allow` authors immediately, `deny` blocks creation outright (the default —
|
#: `allow` authors immediately, `deny` blocks creation outright (the default —
|
||||||
#: the agent leans on the committed packs), and `ask` authors only after the
|
#: the agent leans on the shipped packs), and `ask` authors only after the
|
||||||
#: human approves the proposal. Set globally with the top-level
|
#: human approves the proposal. Set globally with the top-level
|
||||||
#: `new_skill_creation` config value and overridden per category in
|
#: `new_skill_creation` config value and overridden per category in
|
||||||
#: `data/skills/<category>/config.json` (same key).
|
#: `data/skills/<category>/config.json` (same key).
|
||||||
@@ -369,7 +369,7 @@ class Scheduler:
|
|||||||
self._outbox: deque[SchedulerReply] = deque(maxlen=256)
|
self._outbox: deque[SchedulerReply] = deque(maxlen=256)
|
||||||
#: Global new-skill creation mode: "deny" (default), "allow", or "ask".
|
#: Global new-skill creation mode: "deny" (default), "allow", or "ask".
|
||||||
#: A category may override it in its category config. Deny by default
|
#: A category may override it in its category config. Deny by default
|
||||||
#: keeps the agent on the committed packs; live authoring is an opt-in.
|
#: keeps the agent on the shipped packs; live authoring is an opt-in.
|
||||||
self.new_skill_mode = (
|
self.new_skill_mode = (
|
||||||
normalize_new_skill_mode(config.get("new_skill_creation")) or "deny"
|
normalize_new_skill_mode(config.get("new_skill_creation")) or "deny"
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ class Skill:
|
|||||||
integration: dict = field(default_factory=dict)
|
integration: dict = field(default_factory=dict)
|
||||||
integration_source: str = "unknown"
|
integration_source: str = "unknown"
|
||||||
category_description: str = ""
|
category_description: str = ""
|
||||||
# Where the leaf came from: "builtin" (hardcoded), "seed" (a committed pack
|
# Where the leaf came from: "builtin" (hardcoded), "seed" (a shipped pack
|
||||||
# skill), or "generated" (codegen-authored). Built-ins are protected from
|
# skill), or "generated" (codegen-authored). Built-ins are protected from
|
||||||
# delete/restart/regen; pack and generated leaves are deletable (durably,
|
# delete/restart/regen; pack and generated leaves are deletable (durably,
|
||||||
# via a tombstone).
|
# via a tombstone).
|
||||||
@@ -310,7 +310,8 @@ class SkillStore:
|
|||||||
class DeletedSkills:
|
class DeletedSkills:
|
||||||
"""A persisted set of deleted skill refs (`category.name`).
|
"""A persisted set of deleted skill refs (`category.name`).
|
||||||
|
|
||||||
Committed pack skills reload from `packs/` on every startup, so deleting one
|
Pack skills (cloned from their own repos into `packs/`) reload on every
|
||||||
|
startup, so deleting one
|
||||||
from the running tree would be undone on the next boot. Recording the ref
|
from the running tree would be undone on the next boot. Recording the ref
|
||||||
here suppresses it (and any generated body of the same name) at load time,
|
here suppresses it (and any generated body of the same name) at load time,
|
||||||
making deletion durable. Restoring a skill means removing its ref.
|
making deletion durable. Restoring a skill means removing its ref.
|
||||||
|
|||||||
Reference in new issue
Block a user