Skip to content

Add a composite service-operator example spanning the NCC cluster - #3

Merged
imattau merged 1 commit into
mainfrom
feat/service-operator-example
Sep 27, 2026
Merged

imattau merged 1 commit into
mainfrom
feat/service-operator-example

Conversation

@imattau

@imattau imattau commented Sep 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • Every existing NCC example exercises one convention in isolation. examples/service-operator-bot.ns instead composes the whole service cluster this codebase has landed — NCC-02, 05, 06, 07, 09, 10, 11 and 13 — the way a real operator would actually use them together: advertise capabilities and endpoints, delegate scoped operator authority instead of a signing key, cut a signed software release, judge operator-claimed status against the grant that is supposed to authorise it, and decide whether a peer's endpoints are worth depending on.
  • Deliberately out of scope: NCC-00, NCC-03, and NCC-08 already have their own dedicated examples and are orthogonal to a service's ongoing operation.
  • Real defect found and fixed: composing NCC-10 and NCC-13 in one program triggered E4003 (ambiguous export) — NCC-13's module declared operator_for_tag/operator_project/operator_application, identical names to NCC-10's own exports. Renamed NCC-13's three functions to release_operator_for/release_operator_project/release_operator_application (nothing else depends on the names NCC-13 shipped with days ago), and updated spec/nostr.md/NCC-PLAN.md accordingly.
  • Added a CLI test (the_service_operator_bot_composes_the_full_ncc_service_cluster) exercising every path documented in the example's header comment.
  • Linked the example from README.md.

Test plan

  • cargo build --workspace — clean
  • cargo test --workspace — all tests pass (249 + 69 CLI tests, 1 ignored)
  • cargo fmt --check — clean
  • cargo clippy --workspace --tests -- -D warnings — clean
  • Manually ran every path documented in examples/service-operator-bot.ns's header comment (nscript check + nscript run with each event) and confirmed the printed output

🤖 Generated with Claude Code

https://claude.ai/code/session_01D95PWA2fdNfg7nUvUHBeMi


Generated by Claude Code

Every existing NCC example exercises one convention in isolation.
examples/service-operator-bot.ns composes the whole service cluster
this codebase has landed instead — NCC-02, 05, 06, 07, 09, 10, 11 and
13 — the way a real operator would actually use them together:
advertise capabilities and endpoints, delegate scoped operator
authority instead of a signing key, cut a signed software release,
judge operator-claimed status against the grant that is supposed to
authorise it, and decide whether a peer's endpoints are worth
depending on.

Building it surfaced a real cross-module defect: NCC-13's module
declared operator_for_tag/operator_project/operator_application,
colliding with NCC-10's identically-named exports (E4003) the moment
both modules are imported in the same program. Renamed NCC-13's three
functions to release_operator_for/release_operator_project/
release_operator_application, since nothing else depends on the names
NCC-13 shipped with days ago.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D95PWA2fdNfg7nUvUHBeMi
@imattau
imattau merged commit 1ba96aa into main Sep 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants