feat(review 006 Unit 2): additive OperationSpec.description disclosed via discovery (E-02)

- OperationSpec gains description: Option<String> (builder
  with_description, defaults None; no struct-literal construction
  sites exist, so additive by construction)
- spec_to_json_pub emits description when set; rebuild_spec_for
  parses it back — the field survives from_call discovery and
  op/register announcement (same round-trip pattern as
  resource_id_path / publish_schema)
- services/list and the local-ops half of services/list-peers emit
  description when set; output-schema docs on both listing specs and
  operation_spec_schema advertise the field
- Tests: builder/default, emit/omit, listing emission, schema
  disclosure, schema-doc presence, round-trip + absent-stays-absent
  (8 new; 616 total)
- Docs: review 006 Unit 2 marked IMPLEMENTED; ADR-047 §6 amendment
  records the E-02 discovery decision (listing enrichment lands, the
  channel/resources/subscribe half stays deferred); OQ-40 gains the
  load-bearing note; operation-registry.md struct + listing docs;
  CHANGELOG

Verification: cargo test (616 pass), clippy -D warnings (host +
wasm32), fmt --check, cargo doc --no-deps, wasm32 check — all clean
This commit is contained in:
glm-5.3-flash committed 2026-09-06 19:26:51 +00:00
1 parent 2586c3b217
commit f8dad9dbc8
8 files changed
+294 -8

No files matched your search

+9
View File
@@ -39,6 +39,9 @@ pub struct OperationSpec {
pub output_schema: Value, // JSON Schema for output
pub error_schemas: Vec<ErrorDefinition>, // Declared domain errors (ADR-016)
pub access_control: AccessControl,
/// Human-readable op description (review 006 E-02). Disclosed by
/// `services/list` when set; `None` when the op declares none.
pub description: Option<String>,
/// JSON pointer into the input for the resource ID, when
/// `access_control.resource_type` is set and the operation targets a
/// specific runtime-spawned resource (ADR-011). e.g., `"$.containerId"`
@@ -829,6 +832,12 @@ These are read-only — no admin operations are exposed through the call protoco
}
```
Each listing entry also carries `description` (review 006 E-02) when
the op's spec declares one (`OperationSpec.description`, set via
`with_description`) — the field is additive and absent otherwise. It
describes the op, not the produced resource set: live resource
discovery stays with `channel/resources/subscribe` (ADR-047 §6, OQ-40).
`services/schema` accepts `{ "name": "fs/readFile" }` (no leading slash —
registry form, same as `OperationSpec.name`) and returns the full
`OperationSpec` including input/output JSON Schemas and declared