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
Copy file name to clipboardExpand all lines: docs/ADDING_A_TOOL.md
+27Lines changed: 27 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -174,6 +174,33 @@ dev:
174
174
175
175
Write the keys idempotently (replace in place rather than appending) so repeated `just dev` runs don't accumulate duplicate lines. Off-chain/devnet consumers read these and never need to know which tool wrote them.
176
176
177
+
**Infrastructure providers are added as data, not a new template.** The infra role is backed by a single shared `cardano-up` driver (`templates/_infra/cardano-up`), and all selected providers aggregate into one `infra/` component. To add a provider (e.g. `dolos`), you write only a `registry/tools/<provider>.toml` — no template:
178
+
179
+
```toml
180
+
[tool]
181
+
id = "dolos"
182
+
name = "Dolos"
183
+
description = "…"
184
+
website = "https://…"
185
+
languages = [] # infra providers have no user-facing language
186
+
system_deps = ["docker", "cardano-up"]
187
+
detect = [] # infra is scanned by a driver marker, not per-tool
188
+
189
+
[roles.infrastructure]
190
+
template = "_infra/cardano-up"# always the shared driver
191
+
192
+
[infra]
193
+
cardano_up_package = "dolos"# the `cardano-up install` package id
194
+
# Map cardano-up's `context env` outputs → contract .env keys. A mapping for an
195
+
# existing key (e.g. NODE_SOCKET_PATH) overrides the default at generation time.
196
+
env = [{ from = "DOLOS_SOCKET_PATH", to = "NODE_SOCKET_PATH" }]
197
+
```
198
+
199
+
If a mapping targets a contract `.env` key that isn't seeded yet (a brand-new
200
+
connection var), promote it: add a `contract::ENV_*` constant and a seeded
201
+
`KEY=` line in `templates/_base/env.jinja` so every project always carries it.
202
+
See `docs/proposals/infra-via-cardano-up.md` for the full model.
203
+
177
204
**Devnet tools** provision a local throwaway chain. They should read both the blueprint and the `.env` if they are present, but must work if neither exists, and write the connection vars above during `dev` — that is how off-chain components reach the devnet, and it composes with any off-chain tool without per-pair code.
178
205
179
206
**Formal-methods tools** have no extra contract beyond the four Justfile targets.
`TemplateContext` is `Serialize` and is the entire surface templates can see. It carries `has_*` booleans per role, an `Option<RoleContext>` per single-tool role, `infra_tools: Vec<RoleContext>`, the contract constants (`blueprint_path`, `env_vars`), and Nix info. `render` is derived from the `.jinja` extension.
148
+
`TemplateContext` is `Serialize` and is the entire surface templates can see. It carries `has_*` booleans per role, an `Option<RoleContext>` per single-tool role, `infra_tools: Vec<InfraToolContext>` plus `infra_context_name` and the resolved `infra_env` (the aggregated infra component, TECH_SPEC §4.6), the contract constants (`blueprint_path`, `env_vars`), and Nix info. `render` is derived from the `.jinja` extension.
149
149
150
150
---
151
151
@@ -225,7 +225,7 @@ Walks `selection.assignments`, resolves each tool against the registry, and buil
2.**Blueprint dir**: `blueprint/.gitkeep`, emitted whenever the selection includes any blueprint-producing-or-consuming role: i.e., any role **except** infrastructure (equivalently: present unless the project is infrastructure-only).
228
-
3.**Role layers**: for each assignment, read the template's `manifest.toml` and add its files. Infrastructure tools each nest under `infra/<tool_id>/`.
228
+
3.**Role layers**: for each assignment, read the template's `manifest.toml` and add its files. **Infrastructure is special — it aggregates**: all selected infra tools share one driver template (`_infra/cardano-up`) emitted **once** at `infra/`, rendered over the full set (`TemplateContext.infra_tools`). This is because the infra engine (`cardano-up`) manages the whole stack as a single unit, not per service. Every other role is one tool → one directory. See `docs/proposals/infra-via-cardano-up.md`.
229
229
4.**Optional layer**: `flake.nix` + `.envrc` when `nix` is set.
230
230
231
231
No I/O: only embedded assets are read. `render` is set from the `.jinja` extension.
Copy file name to clipboardExpand all lines: docs/ROADMAP.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,7 @@ Deliverables below are tracked as checklists (`[ ]` = not yet done).
33
33
**The tool: all five roles present, four building green, formal-methods preview:**
34
34
-[ ]**On-chain:** Aiken; make the template genuinely `build`+`test` green (blueprint at canonical path).
35
35
-[ ]**Off-chain:** MeshJS + Tx3; both generate and build.
36
-
-[]**Infrastructure:**no tool ships yet — the role is present in the vocabulary but unfilled (a real deployable service such as Kupo+Ogmios or a node provider is a follow-up). Yaci DevKit fills the **devnet** role instead (it is a dev/test kit, never deployed).
36
+
-[x]**Infrastructure:**filled via `cardano-up` — **Kupo, Ogmios, Dolos, Tx Submit API, Cardano Node, Cardano Node API, and Dingo** ship as selectable providers that aggregate into a single `infra/` component (one cardano-up context per project). Adding further providers is pure data (a registry TOML, no template). Uses `cardano-up`'s released `--context` flag (blinklabs-io#294; see `docs/proposals/infra-via-cardano-up.md`). Yaci DevKit remains in the **devnet** role (it is a dev/test kit, never deployed).
37
37
-[ ]**Devnet:** Yaci DevKit (local devnet — its `dev` starts a Blockfrost-compatible devnet and writes the standard `.env` connection vars, so off-chain connects to it automatically; `test` runs an integration smoke test).
38
38
-[ ]**Formal-methods:** preview; visible in the registry/UI as "coming soon"; the Blaster placeholder is not a build-green deliverable yet (made real at DX.05).
-`dest` is resolved **relative to the role dir** (`on-chain/`, `off-chain/`, `test/`, `formal-methods/`); for infrastructure, relative to `infra/<tool_id>/`.
225
+
-`dest` is resolved **relative to the role dir** (`on-chain/`, `off-chain/`, `test/`, `formal-methods/`); for infrastructure, relative to `infra/` (the aggregated component — no per-tool subdir, §6.1).
210
226
-`dest` MUST be relative and MUST NOT contain `..` or a leading `/` (no escaping the project root). Enforced + tested. (Manifests are first-party today, but the check is cheap insurance and required if templates ever become third-party.)
211
227
- Base/optional layer dests are fixed (§6).
212
228
@@ -228,10 +244,13 @@ struct TemplateContext {
228
244
229
245
on_chain:Option<RoleContext>,
230
246
off_chain:Option<RoleContext>,
231
-
infra_tools:Vec<RoleContext>, // 0..n, canonical order (§11)
247
+
infra_tools:Vec<InfraToolContext>, // 0..n, canonical order (§11); aggregated infra component
232
248
devnet:Option<RoleContext>,
233
249
formal_methods:Option<RoleContext>,
234
250
251
+
infra_context_name:String, // cardano-up context the infra driver targets (= project_name)
252
+
infra_env:Vec<EnvMapping>, // resolved, key-unique .env emissions for infra (proposal §5.4)
2.**Blueprint dir**: `blueprint/.gitkeep`, **if any non-infrastructure role is present** (§6.2). Source is `TemplateSource::Inline(empty)`.
265
-
3.**Role layers**: assignments processed in **`Role::ALL` order** (not flag order). For each, read the template manifest and append its files (rendered per §4.2). Infra tools nested under `infra/<tool_id>/`, **tools sorted by `tool_id`**(§11).
286
+
3.**Role layers**: assignments processed in **`Role::ALL` order** (not flag order). For each, read the template manifest and append its files (rendered per §4.2). **Infrastructure aggregates**: all selected infra tools share one driver template (`_infra/cardano-up`), emitted **once** at `infra/` on the first infra assignment (the rest are contiguous after the canonical sort and skipped); they are still sorted by `tool_id` for the rendered `infra_tools`/`infra_env` order (§11). All infra tools must resolve to the same template path, else `ScaffoldError::InfraTemplateMismatch`. See `docs/proposals/infra-via-cardano-up.md`.
`--dry-run` returns this `FilePlan` (no rendering, no I/O).
@@ -311,7 +332,7 @@ The top level aggregates only the tasks that **terminate and compose**:
311
332
312
333
### 7.2 No top-level `dev`
313
334
314
-
There is **no top-level `dev` target**. Long-running / interactive tasks (watch modes, local devnets, REPLs) do not aggregate into one foreground command — that is exactly why a multi-service launcher is awkward — so they are **per-component**: the developer runs `just -f <role>/Justfile dev` (or `just -f infra/<tool>/Justfile dev`) directly, documented in the README.
335
+
There is **no top-level `dev` target**. Long-running / interactive tasks (watch modes, local devnets, REPLs) do not aggregate into one foreground command — that is exactly why a multi-service launcher is awkward — so they are **per-component**: the developer runs `just -f <role>/Justfile dev` (or `just -f infra/Justfile dev` for the aggregated infra stack) directly, documented in the README.
315
336
316
337
`dev` is **optional per component** (§7): a tool provides it only when it has a genuine watch/daemon/devnet mode. Because the top level never aggregates `dev`, a component without one costs nothing — and we don't ship no-op `dev` targets just to fill the slot.
317
338
@@ -507,6 +528,8 @@ The standalone `cardano-init doctor` takes **no flags describing the project**:
507
528
3. A tool matches if **any** of its `detect` signatures matches. Exactly one match ⇒ the component is identified; zero (or an ambiguous multiple) ⇒ the directory is reported as **unrecognized** (renamed, modified, or a foreign project). A renamed *directory* simply isn't found, so that role is absent.
508
529
4. The required set is `{just}` ∪ the `system_deps` of every identified tool (§9.1), fed to the resolver (§9.4).
509
530
531
+
**Infrastructure is the exception.** The aggregated `infra/` component has no per-tool subdirs (it's the single cardano-up driver), so it is *not* matched against per-tool `detect` signatures. Instead the scan recognizes it by a driver marker — `infra/Justfile` referencing `cardano-up` — and reports a synthetic `cardano-up` component (`doctor::INFRA_DRIVER_ID`). Its contribution to the required set is the **union of all registered infra tools' `system_deps`** (`{docker, cardano-up}`), data-driven from the registry. So infra tools carry `detect = []`.
532
+
510
533
**Detect signatures (`detect` in `registry/tools/<tool>.toml`).** A list; each entry is either:
511
534
- a **bare path** (relative to the role dir) — matches if the file exists; or
512
535
- a **table**`{ file = "<path>", contains = "<substring>" }` — matches if the file exists *and* its text contains the substring.
0 commit comments