diff --git a/bundles/facilitator/k8s/base/kustomization.yaml b/bundles/facilitator/k8s/base/kustomization.yaml index f761daa..e3e2a87 100644 --- a/bundles/facilitator/k8s/base/kustomization.yaml +++ b/bundles/facilitator/k8s/base/kustomization.yaml @@ -24,4 +24,4 @@ configMapGenerator: images: # The node image of this release; an overlay or a deployment changes only newTag (or newName for a registry mirror). - name: ghcr.io/nabil-becker/facilitator-node - newTag: 0.9.6 + newTag: 0.9.7 diff --git a/bundles/facilitator/k8s/base/statefulset.yaml b/bundles/facilitator/k8s/base/statefulset.yaml index 4d70fbe..937b0ef 100644 --- a/bundles/facilitator/k8s/base/statefulset.yaml +++ b/bundles/facilitator/k8s/base/statefulset.yaml @@ -29,7 +29,7 @@ spec: type: RuntimeDefault containers: - name: hub - image: ghcr.io/nabil-becker/facilitator-node:0.9.6 # the tag is set by `images:` in kustomization.yaml + image: ghcr.io/nabil-becker/facilitator-node:0.9.7 # the tag is set by `images:` in kustomization.yaml imagePullPolicy: IfNotPresent # the image's entrypoint is `facilitator node run`; the role comes from the mounted mesh.yml env: diff --git a/bundles/facilitator/k8s/overlays/ssh-agent/agent-sidecar.yaml b/bundles/facilitator/k8s/overlays/ssh-agent/agent-sidecar.yaml index 84cedc7..f36fa8a 100644 --- a/bundles/facilitator/k8s/overlays/ssh-agent/agent-sidecar.yaml +++ b/bundles/facilitator/k8s/overlays/ssh-agent/agent-sidecar.yaml @@ -10,7 +10,7 @@ spec: volumeMounts: - {name: ca-agent, mountPath: /run/ssh-ca} - name: ca-agent - image: ghcr.io/nabil-becker/facilitator-node:0.9.6 + image: ghcr.io/nabil-becker/facilitator-node:0.9.7 imagePullPolicy: IfNotPresent command: [ssh-agent, -D, -a, /run/ssh-ca/agent.sock] env: diff --git a/src/facilitator/CHANGELOG.md b/src/facilitator/CHANGELOG.md index c770e22..ff0d791 100644 --- a/src/facilitator/CHANGELOG.md +++ b/src/facilitator/CHANGELOG.md @@ -6,6 +6,17 @@ of the Feature and whether they must act (an option renamed, a task removed, a r The version in `devcontainer-feature.json` is bumped in the same change that adds its entry here; `task lint` fails when the entry is missing. +## [0.9.7] - 2026-12-01 + +**The one-line `expose` entry in NOTES now works.** `build: { policies: [private], approval: none }` was refused by +`facilitator check` (`bad-yaml: a flow map is {key: value, ...} with plain values`), and a node whose `mesh.yml` has a +finding runs standalone, so copying the docs cut it off the mesh. A flow map may now hold a flow list of plain values +(`{ policies: [private, public], approval: none }`) and means the same as the block form. A nested map inside a flow +map is still refused (use the block form). Rebuild (a hub: its image) to take it; a `mesh.yml` that already works is +unchanged. +- `bundleVersion` defaults to `0.9.7`; the node bundle `facilitator-bundle-v0.9.7` is pinned in `digests.txt` once the + release publishes it. + ## [0.9.6] - 2026-12-01 **A reply to a public node is no longer lost.** When a node held back a conversation from a node at copy `addressed` diff --git a/src/facilitator/README.md b/src/facilitator/README.md index 7362a58..27aa0a8 100644 --- a/src/facilitator/README.md +++ b/src/facilitator/README.md @@ -18,7 +18,7 @@ The communication layer between agents of any vendor running in the devcontainer | installTaskfile | Install this Feature's Taskfile into /usr/local/share/go-task/includes.d so its tasks appear under facilitator: in a root Taskfile that includes /usr/local/share/go-task/features.yml (the go-task Feature). | boolean | true | | backend | What carries the directory and delivery: agntcy (the AGNTCY Agent Directory and SLIM). lean (packet-relay) is refused in this version: not yet, slice 5. FACILITATOR_BACKEND overrides. | string | agntcy | | mode | node (the default): the whole bundle, and the Directory, the SLIM node and the facilitator's ssh-agent run here (autostart). leaf: the thin client only (facilitator mcp and what it needs; no slimctl): no daemon is started, infra up and node run are refused; a leaf reaching a node over the network is not built yet (slice N3 built hubs and spokes). FACILITATOR_MODE. | string | node | -| bundleVersion | The facilitator node bundle to install (a release asset of this repository, facilitator-bundle-v), verified against the SHA-256 pinned in digests.txt. latest means the bundle this Feature version was made with (0.9.6). With no pin for it, the bundle is built from the Feature's own source, every upstream download checked against the SHA-256 pinned in bundle-build.sh. | string | 0.9.6 | +| bundleVersion | The facilitator node bundle to install (a release asset of this repository, facilitator-bundle-v), verified against the SHA-256 pinned in digests.txt. latest means the bundle this Feature version was made with (0.9.7). With no pin for it, the bundle is built from the Feature's own source, every upstream download checked against the SHA-256 pinned in bundle-build.sh. | string | 0.9.7 | | dirVersion | Deprecated in 0.3.0 (removed in 1.0.0): use bundleVersion. The bundle fixes dirctl's version (1.9.1); 1.9.1 or latest are accepted, with a deprecation line from install, version and check, and any other version is refused. | string | - | | slimVersion | Deprecated in 0.3.0 (removed in 1.0.0): use bundleVersion. The bundle fixes slimctl's version (3.4.6); 3.4.6 or latest are accepted, with a deprecation line from install, version and check, and any other version is refused. | string | - | | hopLimit | Hops since the message that began the chain (a person's later messages count too) before the conversation pauses; a person's continue resumes it. The default of the local and private trust levels; mesh.yml limits override it per level. FACILITATOR_HOP_LIMIT. | string | 6 | @@ -656,7 +656,7 @@ The communication layer between agents of any vendor running in the devcontainer | installTaskfile | Install this Feature's Taskfile into /usr/local/share/go-task/includes.d so its tasks appear under facilitator: in a root Taskfile that includes /usr/local/share/go-task/features.yml (the go-task Feature). | boolean | true | | backend | What carries the directory and delivery: agntcy (the AGNTCY Agent Directory and SLIM). lean (packet-relay) is refused in this version: not yet, slice 5. FACILITATOR_BACKEND overrides. | string | agntcy | | mode | node (the default): the whole bundle, and the Directory, the SLIM node and the facilitator's ssh-agent run here (autostart). leaf: the thin client only (facilitator mcp and what it needs; no slimctl): no daemon is started, infra up and node run are refused; a leaf reaching a node over the network is not built yet (slice N3 built hubs and spokes). FACILITATOR_MODE. | string | node | -| bundleVersion | The facilitator node bundle to install (a release asset of this repository, facilitator-bundle-v), verified against the SHA-256 pinned in digests.txt. latest means the bundle this Feature version was made with (0.9.6). With no pin for it, the bundle is built from the Feature's own source, every upstream download checked against the SHA-256 pinned in bundle-build.sh. | string | 0.9.6 | +| bundleVersion | The facilitator node bundle to install (a release asset of this repository, facilitator-bundle-v), verified against the SHA-256 pinned in digests.txt. latest means the bundle this Feature version was made with (0.9.7). With no pin for it, the bundle is built from the Feature's own source, every upstream download checked against the SHA-256 pinned in bundle-build.sh. | string | 0.9.7 | | dirVersion | Deprecated in 0.3.0 (removed in 1.0.0): use bundleVersion. The bundle fixes dirctl's version (1.9.1); 1.9.1 or latest are accepted, with a deprecation line from install, version and check, and any other version is refused. | string | - | | slimVersion | Deprecated in 0.3.0 (removed in 1.0.0): use bundleVersion. The bundle fixes slimctl's version (3.4.6); 3.4.6 or latest are accepted, with a deprecation line from install, version and check, and any other version is refused. | string | - | | hopLimit | Hops since the message that began the chain (a person's later messages count too) before the conversation pauses; a person's continue resumes it. The default of the local and private trust levels; mesh.yml limits override it per level. FACILITATOR_HOP_LIMIT. | string | 6 | @@ -1653,6 +1653,17 @@ CLI for real, and a leaf client otherwise; `test_http.py` and `test_http_endpoin ## Changes +### [0.9.7] - 2026-12-01 + +**The one-line `expose` entry in NOTES now works.** `build: { policies: [private], approval: none }` was refused by +`facilitator check` (`bad-yaml: a flow map is {key: value, ...} with plain values`), and a node whose `mesh.yml` has a +finding runs standalone, so copying the docs cut it off the mesh. A flow map may now hold a flow list of plain values +(`{ policies: [private, public], approval: none }`) and means the same as the block form. A nested map inside a flow +map is still refused (use the block form). Rebuild (a hub: its image) to take it; a `mesh.yml` that already works is +unchanged. +- `bundleVersion` defaults to `0.9.7`; the node bundle `facilitator-bundle-v0.9.7` is pinned in `digests.txt` once the + release publishes it. + ### [0.9.6] - 2026-12-01 **A reply to a public node is no longer lost.** When a node held back a conversation from a node at copy `addressed` @@ -1673,60 +1684,6 @@ older node only if that node has a level of that name. - `bundleVersion` defaults to `0.9.5`: the Feature installs the published node bundle `facilitator-bundle-v0.9.5` (amd64 and arm64), pinned by SHA-256 in `digests.txt`. -### [0.9.4] - 2026-11-30 - -**A node's trust comes from named policies in its own `mesh.yml`.** Rebuild the container (a hub: its image) to take it. A `mesh.yml` -with no `policies:` block quietly means the starter (`private` and `public`); an existing `expose` entry that named `public` now means -exposed through `public` **only** (see Changed). Version 0.9.3 (per-agent approval) is unpublished; consumers adopting 0.9.4 take both. - -#### Added - -- **Policies.** `policies:` in `mesh.yml` defines the node's named policies: each a group of settings (`hops`, `budget`, `rate`, - `copy`, `approval`, `approval_ttl`, `svid_ttl`, `max_packet`, `http_receive_wait`), with its own SLIM listener (`node.listen`) - and CA bundle (the domains `trust` maps to it). Policies are not ordered and have no rank. `local` is built in and means no - policy: the node's own agents. `trust`, `expose`, `limits` and `node.listen` name policies; a name the node does not define is - refused by `check` with its line. Lock one (a listener and CA bundle per policy) and lock two (the SPIFFE ID against `trust` and - `expose`) work for any policy. Only the node's own `mesh.yml` defines policies: a message from a sender at a policy the receiver - does not define is refused with the policies it has. -- **One place for a policy's rules.** `limits:` is folded into `policies:`: a policy's approval and limits live only in its - `policies:` entry, and the built-in `local` takes its settings in `policies.local` (settings only, no marks). A top-level `limits:` - block (and `limits.local`) **still loads in 0.9.4**, merged over the matching policy, and `check` warns `limits. is - deprecated: move it into policies.` with the line; **a later version drops it**. `explain` shows the source of each value. -- **Many-to-many exposure.** `expose: {handle: policy | [policy, ...]}` (or `{ policies: [...], approval }`): an agent is exposed - through one or more policies and a policy holds many agents. An agent is reachable through a policy only if exposed there. -- **A starter.** `policies: starter` (or `include: starter` beside policies of your own, or no `policies:` block) gives `private` - and `public`, shipped as data (`facilitator/starters.py`), optional and subject to change. A policy of the same name replaces a - starter one. -- Two marks: `stranger: true` (a policy of nodes you do not run) and `http: true` (the policy HTTP clients get). -- `facilitator check` lists the policies; `facilitator explain` prints each policy's marks, approval and limits; - `node invite --policy ` takes any policy of the node. - -#### Fixed - -- **A message that the receiving node would refuse is refused where it is written.** A conversation shared with another node - whose members on this node include one not exposed through the policy that node gets from this node (for example the person - `you`, not exposed by default) used to be accepted here and refused only in the other node's `refused.log`, so the message - vanished silently. Now the write (and the opening of a group) is refused on this node, to the writer, with the reason and the - fix (expose it in `mesh.yml`, or leave it out of the conversation), and recorded in this node's `refused.log`. The receiver's - lock two is unchanged. No action needed; expose the member or drop it from the conversation when you see the refusal. - -#### Changed - -- **Reach is membership, not order.** Before, an agent exposed `public` was also reachable by `private` callers (wider covered - narrower). Now list every policy: `expose: jester: [private, public]`. An agent with no entry is exposed through no policy. -- An empty `policies:` block is a node with no policies: `check` says what is missing and the node runs standalone. No `mesh.yml` - at all behaves as before. -- `node join` and the pairing map the new domain to the node's own member policy (or stranger policy). `node join` refuses a - `mesh.yml` that exists with no `policies:` block, saying so; it never edits your policies (a new file gets none written). -- A card lists only what is exposed through the receiver's policy; each entry's `exposure` is now the sender's list of policy names, - for information (the receiver does not check it). The persisted `level` key of a card and the join replies keep their name. -- A policy that sets nothing gets the most restrictive defaults (`copy: addressed`, `approval: first-contact`, 2 hops, 1 h - certificates), never another policy's values. A conversation that crossed several policies gets the tightest limits of them. -- The join endpoints are called `token` and `request` in the status file (`join_open_kinds`); per-policy CA bundle files are - `policy-.pem` (were `level-.pem`). -- `bundleVersion` defaults to `0.9.4`: the Feature installs the published node bundle `facilitator-bundle-v0.9.4` - (amd64 and arm64), pinned by SHA-256 in `digests.txt`. - The full history is in [CHANGELOG.md](https://github.com/nabil-becker/devcontainer-features/blob/main/src/facilitator/CHANGELOG.md). --- diff --git a/src/facilitator/devcontainer-feature.json b/src/facilitator/devcontainer-feature.json index 19fab02..e3525a6 100644 --- a/src/facilitator/devcontainer-feature.json +++ b/src/facilitator/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "facilitator", - "version": "0.9.6", + "version": "0.9.7", "name": "facilitator (conversations between agents of any vendor, on AGNTCY)", "description": "The communication layer between agents of any vendor running in the devcontainer: an MCP server each participant's CLI starts (receive, reply, say, who) and a person's own Claude Code or Copilot session attaches to (say, mail, transcript, continue, who), one shared entry with the handle from FACILITATOR_HANDLE, deterministic routing by @handle with hop, budget and rate limits, every message a sign-packet packet in a register-engine conversation register, verified back to the human who began it. Installs the facilitator node bundle (its own CPython, dirctl, slimctl and the application, checksummed; the same bundle as the server image) and runs the AGNTCY Agent Directory and a SLIM node on loopback, started as infrastructure (mode node), or only the thin client (mode leaf); never starts, stops or configures a participant. A node is standalone (nothing open) unless its mesh.yml (FACILITATOR_MESH_FILE) makes it a hub or a spoke: nodes link over SLIM with mutual TLS, certificates from an OpenBao PKI per trust domain, a listener per trust level and the application's SPIFFE ID check (local and private trust; join tokens, revoke). Serves its MCP tools over HTTP to CLIs with static bearer tokens and to cloud AIs with OAuth 2.1 access tokens (facilitator.http.listen in facilitator.yml; off by default, refused under the preset solo; the node is a resource server only: it accepts tokens from the issuers in facilitator.http.issuers and publishes the protected-resource metadata; a person approves each client; the node signs for it and every packet says so), and holds what crosses between nodes for a person's approval where mesh.yml's limits..approval says so (every-message, per-conversation, first-contact) and includes a local-model wrapper for any OpenAI-compatible endpoint and a turn hook line for Claude Code ('Facilitator: N new messages').", "documentationURL": "https://github.com/nabil-becker/devcontainer-features/tree/main/src/facilitator", @@ -25,9 +25,9 @@ }, "bundleVersion": { "type": "string", - "proposals": ["0.9.6", "0.9.5", "0.9.4", "0.9.3", "0.9.2", "0.9.0", "0.8.0", "0.7.0", "0.6.0", "0.5.0", "0.4.0", "0.3.0", "latest"], - "default": "0.9.6", - "description": "The facilitator node bundle to install (a release asset of this repository, facilitator-bundle-v), verified against the SHA-256 pinned in digests.txt. latest means the bundle this Feature version was made with (0.9.6). With no pin for it, the bundle is built from the Feature's own source, every upstream download checked against the SHA-256 pinned in bundle-build.sh." + "proposals": ["0.9.7", "0.9.6", "0.9.5", "0.9.4", "0.9.3", "0.9.2", "0.9.0", "0.8.0", "0.7.0", "0.6.0", "0.5.0", "0.4.0", "0.3.0", "latest"], + "default": "0.9.7", + "description": "The facilitator node bundle to install (a release asset of this repository, facilitator-bundle-v), verified against the SHA-256 pinned in digests.txt. latest means the bundle this Feature version was made with (0.9.7). With no pin for it, the bundle is built from the Feature's own source, every upstream download checked against the SHA-256 pinned in bundle-build.sh." }, "dirVersion": { "type": "string", diff --git a/src/facilitator/facilitator/__init__.py b/src/facilitator/facilitator/__init__.py index b9a7ebf..12e0757 100644 --- a/src/facilitator/facilitator/__init__.py +++ b/src/facilitator/facilitator/__init__.py @@ -1,2 +1,2 @@ """facilitator: the communication layer between agents of any vendor (the facilitator Feature's NOTES).""" -__version__ = "0.9.6" +__version__ = "0.9.7" diff --git a/src/facilitator/facilitator/yamlite.py b/src/facilitator/facilitator/yamlite.py index 2554cc8..3c5e355 100644 --- a/src/facilitator/facilitator/yamlite.py +++ b/src/facilitator/facilitator/yamlite.py @@ -1,6 +1,6 @@ """The small subset of YAML the participant list and facilitator.yml are written in (the participant component's subset, components/participant/agents.sh): block maps and lists by indentation, plain, -single- and double-quoted scalars, flow lists `[a, b]`, one-level flow maps `{k: v, k2: v2}` (0.9.3: mesh.yml's `expose` entry), comments. No anchors, +single- and double-quoted scalars, flow lists `[a, b]`, one-level flow maps `{k: v, k2: v2}` whose values are scalars or flow lists of scalars (0.9.3: mesh.yml's `expose` entry; 0.9.7: `{ policies: [private], approval: none }`), comments. No anchors, no multi-line strings, no nested flow maps. Keys are plain (letters, digits, `_ - . *`) or quoted. Errors name the file and line. Python's standard library has no YAML reader.""" from __future__ import annotations @@ -35,9 +35,9 @@ def _strip_comment(s: str) -> str: return "".join(out).rstrip() -def _split_flow(inner: str) -> list[str]: - """The comma-separated items of a flow list or map, commas inside quotes kept.""" - items, cur, q = [], [], None +def _split_flow(inner: str, brackets: bool = False) -> list[str]: + """The comma-separated items of a flow list or map, commas inside quotes kept (and, with `brackets`, commas inside [...]).""" + items, cur, q, depth = [], [], None, 0 for c in inner: if q: cur.append(c) @@ -46,7 +46,10 @@ def _split_flow(inner: str) -> list[str]: elif c in "'\"": q = c cur.append(c) - elif c == ",": + elif brackets and c in "[]": + depth += 1 if c == "[" else -1 + cur.append(c) + elif c == "," and depth <= 0: items.append("".join(cur)) cur = [] else: @@ -76,9 +79,11 @@ def scalar(v: str, where: str, line: int): if not v.endswith("}"): raise YamlError(where, line, f"a flow map must close on its line: {v}") inner, out = v[1:-1].strip(), {} - for item in _split_flow(inner) if inner else []: + for item in _split_flow(inner, brackets=True) if inner else []: m = KEY_RE.fullmatch(item.strip()) - if not m or m[2] is None or m[2].lstrip().startswith(("{", "[")): + val = m[2].strip() if m and m[2] is not None else "" + # a value is a plain scalar or a flow list of scalars (`policies: [private, public]`); no nesting beyond that + if not m or m[2] is None or val.startswith("{") or (val.startswith("[") and ("[" in val[1:] or "{" in val)): raise YamlError(where, line, f"a flow map is {{key: value, ...}} with plain values: {v}") out[_key(m[1])] = scalar(m[2], where, line) return out diff --git a/test/facilitator/unit/test_mesh.py b/test/facilitator/unit/test_mesh.py index 250aead..8dd13ec 100644 --- a/test/facilitator/unit/test_mesh.py +++ b/test/facilitator/unit/test_mesh.py @@ -422,4 +422,24 @@ def test_directory_per_role(): e.close() +def test_a_one_line_expose_entry_with_policies_means_the_block_form(): + from facilitator import yamlite + block = yamlite.parse("expose:\n support:\n policies: [private]\n approval: none\n", "m") + one = yamlite.parse("expose:\n support: { policies: [private], approval: none }\n", "m") + assert one == block == {"expose": {"support": {"policies": ["private"], "approval": "none"}}} + two = yamlite.parse("expose:\n build: { policies: [private, public], approval: none }\n", "m") + assert two["expose"]["build"] == {"policies": ["private", "public"], "approval": "none"} + assert yamlite.parse("x: { policies: [a] }\n", "m") == {"x": {"policies": ["a"]}} + + +def test_a_nested_map_or_list_in_a_flow_map_is_still_refused(): + from facilitator import yamlite + for bad in ("x: { a: { b: c } }", "x: { a: [{b: c}] }", "x: { a: [[b], c] }", "x: { a: [b }"): + try: + yamlite.parse(bad + "\n", "m") + except yamlite.YamlError: + continue + raise AssertionError(f"accepted: {bad}") + + helpers.run_tests(globals())