You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: hoist installation-editing from 'soliplex-concierge' (#1)
... fixing its #79 bugs as the code was ported.
- 'sections' (new module) maps out sematncis of section types in a
Soliplex installation configl
- 'installer' (new module) provides mechanisms and a grammar for
performing edits (adding entries) respecting those semantics.
- 'rooms.install_room' and 'rooms.install_room_from' now take a required
'parent_path', and ensure that adding a room is done cleanly, without
e.g. hiding existing rooms or surfacing rooms which had been excluded.
See: soliplex/soliplex-concierge#79
The families: **discovery** lists default to a directory (`room_paths` →
26
+
`["./rooms"]`), so an entry beneath the default is already *covered* when the
27
+
section is absent; **collection** sections default to empty, so an absent section
28
+
is *created* to add an entry; **whitelist** (`skill_configs`) is permissive per
29
+
`kind` — empty/absent for a kind enables every discovered skill of it.
30
+
31
+
## `installation` — edit a stack's `installation.yaml`
32
+
33
+
Generic, comment-preserving, idempotent, stdlib-only line editors. Each is a
34
+
pure `text -> (new_text, TargetAction)` function. Scanning is **section-scoped**
35
+
and **comment-skipping**.
36
+
37
+
| Member | Purpose |
38
+
| --- | --- |
39
+
|`add_list_entry(text, *, section, block, probe)`| add `block` under a top-level collection `section:`; create it if absent |
40
+
|`add_nested_list_entry(text, *, parent, section, item, probe)`| add `item` under nested `parent.section:`; create parent/child if absent |
41
+
|`add_environment(text, var_name)`| add `var_name` to `environment:`|
42
+
|`add_secret(text, secret_name, *, env_var_name=None)`| add an `env_var`-sourced secret to `secrets:`|
43
+
|`add_meta_tool_config(text, class_path)`| register `class_path` under nested `meta.tool_configs:`|
44
+
|`add_skill_config(text, skill_name, *, kind="filesystem", confirm=False)`| whitelist a skill; `COVERED` when the kind is permissive; raises `WhitelistActive` when a kind's whitelist is active (unless `confirm`) |
45
+
|`resolve_stack(stack_dir, markers, error)`| resolve a stack root requiring every marker; `error(stack, marker)` builds the raised exception |
46
+
|`WhitelistActive(kind, entries)`| the one "stop and confirm" abort — a `skill_configs` kind already has an explicit whitelist |
|`TargetAction(StrEnum)` (`ADDED` / `UNCHANGED` / `COVERED`) | the action a helper reports |
49
+
50
+
## `rooms` — install a room into a Soliplex stack
51
+
52
+
Writes a room under an explicit `parent_path` (relative to the installation
53
+
config) and wires its `room_paths` entry line-based. Append-only: installing a
54
+
room never disables another (the `./rooms` default is materialized before any
55
+
non-default parent is added).
18
56
19
57
| Member | Purpose |
20
58
| --- | --- |
21
59
|`validate_room_id(room_id)`| enforce the room-id / path-segment rule (`ROOM_ID_RE`); raises `AddRoomError`|
22
60
|`resolve_project(project_dir)`| resolve + verify the stack root (has `COMPOSE_FILE` and `INSTALLATION_FILE`) |
23
61
|`resolve_package_name(project, override)`| the stack's own package (inferred from `src/<pkg>/tools.py`) or `DEFAULT_PACKAGE_NAME`|
24
-
|`add_room_path(text, room_id) -> (text, action)`| ensure `room_paths` loads the room; action is `ADDED` / `UNCHANGED` / `COVERED`|
25
-
|`install_room(project, room_id, *, config_text, prompt_text=None, force=False, dry_run=False)`| write the room dir + config (+ optional prompt) and apply the `room_paths` edit |
26
-
|`RoomInstalled(config_path, path_action)`| the `install_room` outcome (alias `RoomInstall` kept for back-compat) |
27
-
|`AddRoomError`| user-facing error with message-factory classmethods |
28
-
|`ADDED` / `UNCHANGED` / `COVERED` / `ROOMS_PARENT_ENTRY`| the `room_paths` action constants and the `./rooms` auto-discovery entry |
62
+
|`room_parent_candidates(project)`| the `room_paths` container entries a caller can offer as a `parent_path` (or `["./rooms"]` when absent) |
63
+
|`install_room(project, room_id, *, config_text, prompt_text=None, parent_path, force=False, dry_run=False)`| write the room dir from a rendered `config_text` (+ optional prompt) under `parent_path` and wire `room_paths`|
64
+
|`install_room_from(project, room_id, src_dir, *, parent_path, force=False, dry_run=False)`| the same, but *copy* the `src_dir` template tree (multi-file); the caller patches the copied files afterward |
65
+
|`RoomInstalled(config_path, path_action)`| the install outcome (alias `RoomInstall` kept for back-compat) |
66
+
|`AddRoomError`| user-facing error with message-factory classmethods (incl. `room_exists`, `parent_is_room`) |
67
+
|`ADDED` / `UNCHANGED` / `COVERED`| the `installation.TargetAction` members, re-exported |
68
+
|`ROOMS_PARENT_ENTRY`| the `./rooms` default-discovery container |
0 commit comments