feat(cli): add serve command for local metadata probes#20
Merged
Conversation
- 新增 serve 命令用于本地元数据服务 - 替换 repositoryRoot 和 filepath.Join 为 writeRootExampleService 函数 - 在根命令中注册 serve 子命令 - 添加本地元数据服务文档说明 - 移除 hello-http 示例相关文件 - 添加 agent codex 示例配置 - 添加 docker 部署示例文件
spelens-gud
approved these changes
Jun 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
nucleus serveas a first-class CLI command for local service metadata probes./healthz,/readyz, and/.well-known/nucleus.json, with--checksupport for non-listening preflight output.example/hello-httpfixture by generating stable temporary service fixtures, and add newexamples/*reference material for agent, deploy, service, worker, and library workflows.bridgeandcapsubmodule pointers to their capability updates already merged upstream.Motivation
nucleus describe,validate,lint, andverifyalready produce machine-readable evidence, but local runtime probes still lacked a small, predictable endpoint surface that agents and humans can inspect before wiring business handlers or provider SDKs.servefills that gap with a loopback-first metadata server and a--checkmode suitable for automation preflight.The command intentionally stays inside the CLI orchestration boundary: it reads service metadata and exposes evidence, but it does not auto-wire provider bridges, start generated business handlers, or introduce runtime defaults outside explicit user intent.
Affected Areas
nucleus servecommand undercmd/nucleus/internal/serve.serve.v1JSON envelope withresult_kind,schema_version,schema_ref,ok,mode,summary,diagnostics, andserverfields.cmd/nucleus/internal/rootnow uses generated temporary service fixtures instead of the deletedexample/hello-httptree.docs/concepts/serve-command.md, kernel concept docs, and newexamples/*references.bridgeandcappointers move to their latest capability commits;contractis unchanged in this root diff.Compatibility
This is an additive CLI feature. Existing commands and manifests are not changed. The server defaults to loopback (
127.0.0.1:8080), rejects non-local bind addresses unless--allow-non-localis explicit, and--checkdoes not open a listener.The new JSON schema reference is introduced as
contract/schema/serve.schema.json; reviewers should treat the exact field names as the new compatibility surface before this command is released.Validation
Clean detached worktree from
origin/feat/serve-commandat5cc047b:Generated service smoke path:
Compare scope:
gh api repos/nucleuskit/nucleus/compare/main...feat/serve-command # ahead_by=1, behind_by=0, files=50Review Notes / Residual Risks
validate/lint/verify --dir .is not meaningful evidence because the Nucleus repository root is not a service directory and has no rootnucleus.yaml; this PR validates a generated service instead.core,runtime/grpc,runtime/http,runtime/worker, and a checked-outcontractcommit that is not part of this root branch. Validation was run in a clean detached worktree to avoid mixing those local states into this PR.--checkso the command can terminate in CI-friendly fashion.