From b449b3cf80707420846dfce6d42e9dda25f74d90 Mon Sep 17 00:00:00 2001 From: L Apple Date: Thu, 19 Nov 2026 00:30:13 +0100 Subject: [PATCH 01/19] docs(readme): rewrite README as a user-first guide with verified quickstart Reorients README.md so a fresh install succeeds without reading anything else, while keeping the contributor/maintainer content: - New order: what it is, install, commands, quickstart, generating a profile, command reference, language profilers, build from source, ecosystem map. - Quickstart is the verified validate path: rc profile validate rc-demos/artifacts/request-logger-http.profile.yaml -> "runtimeconditions: profile validated". - Generate section documents the three prerequisites with real error strings verified against the linked go-rc-profiler v0.8.0: Go toolchain on PATH, --dir must contain a go.mod, and published binding modules only (go.mod replace rejected by design with the exact message). - Example workload uses the published modules runtimeconditions.io/x/rc/common@v0.3.0 and .../env@v0.3.0; notes the verified current env v0.3.0 dependency-archive SHA-256 mismatch. - Install paths verified against the org: brew runtimeconditions/tools/rc-cli, https://runtimeconditions.io/packages/setup.sh + apt/dnf, npm @runtimeconditions/typescript-profiler, PyPI runtimeconditions-profiler. - All commands/flags checked against --help output of a binary built from this branch; existing command tables kept; build-from-source section preserves the schema-linker caveat and release-build notes. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe --- README.md | 428 ++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 301 insertions(+), 127 deletions(-) diff --git a/README.md b/README.md index 1fb1ad0..d67b78a 100644 --- a/README.md +++ b/README.md @@ -1,111 +1,291 @@ # rc-cli -Runtime Conditions commands for extension bindings and workload profiling. -## Build locally +`rc` is the Runtime Conditions CLI. It **generates** Runtime Conditions Profiles from your +workload's binding declarations and **validates** profiles against the spec — whether the +profile was written by hand, by an agent, or by a profiler. -From this repository's root, build the executable with the schema-aware helper: +- Guide and concepts: +- Profile specification: + +## Install + +The package is named `rc-cli`; the executable is named `rc`. + +**Homebrew (macOS and Linux):** ```sh -go run ./scripts/build.go --output ./rc -./rc --version -./rc profile generate --dir /path/to/go/workload --out profile.yaml +brew install runtimeconditions/tools/rc-cli ``` -The helper downloads the pinned core profile schema, verifies its SHA-256, -and embeds it alongside the linked Go profiler. Go profiling needs no runtime -schema download or separate profiler installation. Analyzing a workload requires -a working Go toolchain and its binding dependencies. CI builds with Go 1.26.5 -and tests workload analysis with Go 1.25.0. +**Linux packages (apt / dnf / yum):** configure the signed package source once, then install +with your package manager: -A plain `go build` or `go install` omits the schema linker value. Such a binary -can display help and version information, but profile generation fails with -`rc: installed profiler has no verified core profile schema`. -Rebuild it using the command above and run the resulting `./rc` executable. +```sh +curl -fsSL https://runtimeconditions.io/packages/setup.sh | sudo sh +sudo apt install rc-cli # Debian / Ubuntu +sudo dnf install rc-cli # Fedora / RHEL +``` -For a build using an already downloaded schema, supply the approved artifact: +**Language profilers are separate add-ons** — Go profiling is built into `rc`; TypeScript, +Java, and Python profilers install through their own channels. See +[Optional language profilers](#optional-language-profilers). + +**From source:** see [Build from source](#build-from-source). + +## Commands + +Check the installation and see which profilers are available: ```sh -go run ./scripts/build.go --output ./rc \ - --core-schema /path/to/runtimeconditions.profile.schema.yaml +rc --version ``` -The local schema must match the helper's pinned checksum. Release builds also -pass `--version ` and `--commit ` to embed provenance. +```text +rc v0.6.0 (a1b2c3d) +``` -## Built-in Go profiler commands +```sh +rc plugins list +``` -`rc profile` uses the built-in Go profiler by default. The same commands are -available under `rc profile go`, with identical flags and behavior: +```text +LANGUAGE STATUS VERSION PATH +go built-in v0.8.0 +typescript missing +java missing +python missing +``` -| Command | Purpose | -| --- | --- | -| `rc profile generate` | Generate a validated profile from Go binding declarations. | -| `rc profile validate-extensions` | Validate all imported generated binding packages. | -| `rc profile validate-extension` | Validate one imported binding package selected with `--package`. | -| `rc profile version` | Show the linked Go profiler version. | +`rc plugins list --output yaml` adds each missing add-on's install command. +`rc --help` lists all commands; `rc completion ` prints a shell +completion script. -A profile does not have to come from a profiler. To check one written by hand, or by an agent: +## Quickstart: your first profile — validating an existing one + +This works on a fresh install with no toolchain and no workload of your own: ```sh -./rc profile validate profile.yaml +git clone https://github.com/runtimeconditions/rc-demos.git +rc profile validate rc-demos/artifacts/request-logger-http.profile.yaml ``` -It is checked against the core profile schema embedded in rc and against the definitions of the -extensions it declares (downloaded from their ids, or read from `--catalog` directories). +```text +runtimeconditions: profile validated +``` -For command help: +`rc profile validate` checks any profile file against the core schema embedded in `rc` and +against the definitions of the extensions the profile declares. By default those definitions +are downloaded from the `https` ids the profile names. To work offline or against local +definitions instead, pass one or more catalog directories: ```sh -./rc profile --help -./rc profile go --help -./rc profile go generate --help +rc profile validate profile.yaml --catalog ./my-extensions +rc profile validate - < profile.yaml # read the profile from stdin +``` + +## Generating a profile + +`rc profile generate` reads the Go binding declarations in a workload and writes a validated +profile. It analyzes declarations statically — it never runs your code. Three prerequisites: + +1. **A Go toolchain on `PATH`.** Without one, generation fails with + `exec: "go": executable file not found in $PATH`. `rc` does not download Go for you. +2. **`--dir` must point at a directory containing a `go.mod`.** Current releases fail fast: + + ```text + rc: /path/to/dir: workload must have a go.mod: stat /path/to/dir/go.mod: no such file or directory + ``` + + Older releases (for example the Homebrew v0.6.0 build) fell back to GOPATH mode and scanned + your entire home directory, spraying `operation not permitted` errors for TCC-protected + paths. Always point `--dir` at a Go module. +3. **The workload must import published RC binding modules** (`runtimeconditions.io/x/rc/...`). + Bindings wired with `go.mod` `replace` directives to a local clone are rejected **by + design**: + + ```text + rc: github.com/runtimeconditions/extensions/catalog/rc/common-integrations/go uses a go.mod replace; generated bindings must resolve to a published module version + ``` + + This is why a fresh clone of `rc-demos/apps/request-logger-http` cannot be generated: its + `go.mod` replaces the binding modules with a sibling checkout of `extensions`. Generate + from a module that requires the published versions instead. + +### Example workload + +`go.mod`: + +```go +module example.com/my-service + +go 1.25.0 + +require ( + runtimeconditions.io/x/rc/common v0.3.0 + runtimeconditions.io/x/rc/env v0.3.0 +) +``` + +`main.go` — declare conditions with the published binding packages: + +```go +package main + +import ( + "runtimeconditions.io/x/rc/common" + "runtimeconditions.io/x/rc/env" +) + +var todosAPI = common.Api( + common.Http{ + Spec: &common.Spec{Format: common.FormatOpenapi, Uri: "catalog://api/default/todos-api"}, + Operations: common.HttpOperations{ + {Method: common.MethodGet, Path: "/todos/{id}", + ResponseSchema: common.ResponseSchemaMap{"id": common.SimpleSchemaStringInteger}}, + }, + }, + env.HttpConfiguration{ + Env: env.HttpConfigurationEnv{ + {Name: "TODOS_API_URL", Property: env.HttpConfigurationEnvPropertyBaseUrl}, + }, + }, +) + +var requestCache = common.Cache( + common.KeyValue{Engine: &[]common.KeyValueEngine{common.KeyValueEngineRedis}[0]}, + env.KeyValueConfiguration{ + Env: env.KeyValueConfigurationEnv{ + {Name: "REDIS_URL", Property: env.KeyValueConfigurationEnvPropertyUrl}, + }, + }, +) + +func main() {} ``` -Generate a profile using the default or explicit Go route: +Resolve dependencies, then generate: ```sh -./rc profile generate --dir /path/to/go/workload --out profile.yaml +go mod tidy +rc profile generate --dir ./my-service --out profile.yaml +``` + +Defaults: `--dir` is the current directory, `--out` is stdout, `--name` is the directory's +basename, `--workload-uri` is the enclosing Go module path, `--workload-version` is `dev`. +A failed generation leaves an existing `--out` file unchanged. You can set them explicitly: -./rc profile go generate \ - --dir /path/to/go/workload \ - --name my-workload \ - --workload-uri https://example.com/my-workload \ +```sh +rc profile generate \ + --dir ./my-service \ + --name my-service \ + --workload-uri https://example.com/my-service \ --workload-version 1.0.0 \ --out profile.yaml ``` -`--dir` defaults to the current directory. Generation writes YAML to stdout -when `--out` is omitted. The default profile name is the workload directory's -basename; the default workload URI is its enclosing Go module path, falling -back to the directory path. The workload version defaults to `dev`. +**Verified status today:** a workload importing only `runtimeconditions.io/x/rc/common@v0.3.0` +generates a profile that passes `rc profile validate`, end to end. Adding +`runtimeconditions.io/x/rc/env@v0.3.0` currently fails dependency artifact verification with: + +```text +rc: runtimeconditions.io/x/rc/env dependency runtimeconditions.io/x/rc/common: dependency Go module archive SHA-256 mismatch +``` + +The published-module pattern above is the supported direction; treat that error as a +known gap in the current published `env` release, not as a mistake in your workload. + +### Checking a workload's bindings + +```sh +rc profile validate-extensions --dir ./my-service +rc profile validate-extension --dir ./my-service --package runtimeconditions.io/x/rc/common +rc profile go version # linked Go profiler version, e.g. "go-rc-profiler v0.8.0 (linked into rc)" +``` + +## Command reference + +`rc profile` uses the built-in Go profiler by default. The same commands are available under +`rc profile go`, with identical flags and behavior: + +| Command | Purpose | +| --- | --- | +| `rc profile generate` | Generate a validated profile from Go binding declarations. Flags: `--dir` (default `.`), `--name`, `--workload-uri`, `--workload-version` (default `dev`), `--out` (default stdout). | +| `rc profile validate ` | Validate any profile against the embedded core schema and its extensions. Flags: `--catalog` (repeatable). | +| `rc profile validate-extensions` | Validate all imported generated binding packages. Flag: `--dir`. | +| `rc profile validate-extension` | Validate one imported binding package. Flags: `--dir`, `--package`. | +| `rc profile version` | Show the linked Go profiler version. | +| `rc plugins list [--output yaml]` | Show the Go profiler and each add-on's status, version, and path. | +| `rc version [--output text\|yaml]` | Show CLI build information. `rc --version` prints the same one-liner. | +| `rc completion ` | Print a shell completion script. | + +For full flag lists: + +```sh +rc profile --help +rc profile go --help +rc profile go generate --help +rc bindings --help +``` + +### Binding commands + +`rc bindings` resolves, generates, and verifies extension bindings. The command group +provides `resolve`, `normalize`, `generate`, `verify`, `package`, `plan-release`, `check`, +and `update`. Cobra owns help, completion, and flag parsing; execution uses the shared +binding library from `extensions`. + +Binding commands also require the shared YAML schemas. Installed layouts place them under +`share/rc/extension-bindings/model/`, alongside `bin/rc`. CI stages these files from the +exact `extensions` commit in `distribution/components.lock.yaml`. -Validate imported bindings or inspect the profiler version: +For local binding development, supply `--tooling-dir` pointing to matching schema resources, +such as the `tooling/extension-bindings` directory in a checkout of that pinned revision: ```sh -./rc profile go validate-extensions --dir /path/to/go/workload -./rc profile go validate-extension \ - --dir /path/to/go/workload \ - --package runtimeconditions.io/x/rc/common -./rc profile go version +rc bindings generate \ + --packages /path/to/binding-project/packages.yaml \ + --toolchain-lock /path/to/binding-project/toolchain.lock.yaml \ + --tooling-dir /path/to/extensions/tooling/extension-bindings \ + --core-schema /path/to/runtimeconditions.profile.schema.yaml \ + --output /tmp/generated-bindings ``` -Profiling analyzes declarations without executing the workload. Resolve the -workload's Go binding dependencies before running these commands. A failed -generation leaves an existing `--out` file unchanged. +`packages.yaml` selects extension roots, language targets, and native package versions. +`toolchain.lock.yaml` declares the applicable toolchain constraints. Use repeatable +`--target package-key:language` flags to limit the selected targets. `generate` requires a +new or empty output directory. `verify --input` accepts the generated tree; use the same +catalog and resource flags for these commands. `update` verifies candidates before changing +committed binding directories; `check` compares regenerated content without updating those +files. Other shared flags include `--cache`, `--work-dir`, `--catalog-root`, +`--dependency-lock`, `--extension-root`, and `--extension-override`; see +`rc bindings generate --help` for the full list. +The core schema must match the version declared in the package catalog. Without +`--core-schema`, normalization uses upstream core-schema resolution. Offline generation +also requires locally available extension definitions; native package verification and +profiling require resolved package dependencies and Go. + +The normalizer and Go emitter run as linked libraries. Explicit executable overrides for +those tools (`--normalizer`, `--go-emitter`) conflict with this mode. For binding +provenance, `--go-profiler /absolute/path/to/go-rc-profiler` selects a standalone profiler +file; otherwise the linked profiler's actual module version and checksum are recorded. The +`rc profile` commands always use the linked Go profiler. ## Optional language profilers Other languages run a separate add-on that `rc` finds on `PATH`. It can come from the -language's own tooling or from a system package, and `rc` does not care which. The -TypeScript profiler is on npm for developers who want it in their npm scripts: -`npm install --global @runtimeconditions/typescript-profiler`. The Java profiler is a jar that its -launcher, `rc-profiler-java`, runs; download it from the -[releases](https://github.com/runtimeconditions/java-rc-profiler/releases) of -`runtimeconditions/java-rc-profiler` and put the launcher on `PATH`. The Python profiler is on PyPI as -`runtimeconditions-profiler`; install it with `pip` into the workload's own virtual environment, because it finds -binding packages through that environment's metadata, and put the environment's `bin` directory on `PATH`. System packages for Homebrew, -apt, and yum, so that `rc` and its add-ons install the same way on a build server, are planned. +language's own tooling or from a system package, and `rc` does not care which: + +- **TypeScript:** `npm install --global @runtimeconditions/typescript-profiler`, or + `brew install runtimeconditions/tools/rc-profiler-typescript`. +- **Java:** download the launcher `rc-profiler-java` from the + [releases](https://github.com/runtimeconditions/java-rc-profiler/releases) of + `runtimeconditions/java-rc-profiler` and put it on `PATH`, or + `brew install runtimeconditions/tools/rc-profiler-java`. +- **Python:** `pip install runtimeconditions-profiler` into the workload's own virtual + environment — it finds binding packages through that environment's metadata — and put the + environment's `bin` directory on `PATH`. Do not use `pipx`, which would give it an + environment of its own. | Command | Purpose | | --- | --- | @@ -114,79 +294,73 @@ apt, and yum, so that `rc` and its add-ons install the same way on a build serve | `rc profile python [flags]` | Run the installed Python profiler. | | `rc plugins list [--output yaml]` | Show the Go profiler and each add-on's status, version, and path. | -Everything after `typescript`, `java`, or `python` goes to the add-on unchanged, so it keeps its own flags -(for example `--project` instead of `--dir`, and `--classpath` for Java). `rc` looks for -`rc-profiler-typescript`, then `runtimeconditions-typescript-profiler`, or `rc-profiler-java`, or -`runtimeconditions-python-profiler`, on `PATH`; `RC_TYPESCRIPT_PROFILER`, `RC_JAVA_PROFILER`, or -`RC_PYTHON_PROFILER` can name an absolute path instead. It runs the add-on only -if `--version --json` lists the core profile schema `rc` targets (0.4.0). The add-on's output and exit -status pass through. +Everything after `typescript`, `java`, or `python` goes to the add-on unchanged, so it keeps +its own flags (for example `--project` instead of `--dir`, and `--classpath` for Java). `rc` +looks for `rc-profiler-typescript`, then `runtimeconditions-typescript-profiler`, or +`rc-profiler-java`, or `runtimeconditions-python-profiler`, on `PATH`; +`RC_TYPESCRIPT_PROFILER`, `RC_JAVA_PROFILER`, or `RC_PYTHON_PROFILER` can name an absolute +path instead. It runs the add-on only if `--version --json` lists the core profile schema +`rc` targets (0.4.0). The add-on's output and exit status pass through. -The Java launcher chooses the JDK, not `rc`: `RC_JAVA_HOME`, then `JAVA_HOME`, then the runtime bundled -in its system package, then `java` on `PATH`. It needs JDK 17 or newer and says so when none is found. +The Java launcher chooses the JDK, not `rc`: `RC_JAVA_HOME`, then `JAVA_HOME`, then the +runtime bundled in its system package, then `java` on `PATH`. It needs JDK 17 or newer and +says so when none is found. -The Python profiler runs on the interpreter of the environment it is installed in (Python 3.11 or newer), and -sees the binding packages installed there. Install the profiler next to the bindings the workload imports, not -with `pipx`, which would give it an environment of its own. +The Python profiler runs on the interpreter of the environment it is installed in (Python +3.11 or newer), and sees the binding packages installed there. -## Binding commands +## Build from source + +From this repository's root, build the executable with the schema-aware helper: ```sh -./rc bindings --help -./rc bindings generate --help +go run ./scripts/build.go --output ./rc +./rc --version +./rc profile generate --dir /path/to/go/workload --out profile.yaml ``` -The command group provides `resolve`, `normalize`, `generate`, `verify`, -`package`, `plan-release`, `check`, and `update`. Cobra owns help, completion, -and flag parsing; execution uses the shared binding library from `extensions`. +The helper downloads the pinned core profile schema, verifies its SHA-256, and embeds it +alongside the linked Go profiler. Go profiling needs no runtime schema download or separate +profiler installation. Analyzing a workload requires a working Go toolchain and its binding +dependencies. CI builds with Go 1.26.5 and tests workload analysis with Go 1.25.0. -Binding commands also require the shared YAML schemas. Installed layouts place -them under `share/rc/extension-bindings/model/`, alongside `bin/rc`. CI stages -these files from the exact `extensions` commit in -`distribution/components.lock.yaml`; they remain ordinary YAML files. +A plain `go build` or `go install` omits the schema linker value. Such a binary can display +help and version information, but profile generation fails with +`rc: installed profiler has no verified core profile schema`. Rebuild it using the command +above and run the resulting `./rc` executable. -The local build helper builds the executable. For local binding development, -supply `--tooling-dir` pointing to matching schema resources, such as the -`tooling/extension-bindings` directory in a checkout of that pinned revision: +For a build using an already downloaded schema, supply the approved artifact: ```sh -./rc bindings generate \ - --packages /path/to/binding-project/packages.yaml \ - --toolchain-lock /path/to/binding-project/toolchain.lock.yaml \ - --tooling-dir /path/to/extensions/tooling/extension-bindings \ - --core-schema /path/to/runtimeconditions.profile.schema.yaml \ - --output /tmp/generated-bindings +go run ./scripts/build.go --output ./rc \ + --core-schema /path/to/runtimeconditions.profile.schema.yaml ``` -`packages.yaml` selects extension roots, language targets, and native package -versions. `toolchain.lock.yaml` declares the applicable toolchain constraints. -Use repeatable `--target package-key:language` flags to limit the selected targets. -`generate` requires a new or empty output directory. `verify --input` accepts the -generated tree; use the same catalog and resource flags for these commands. -`update` verifies candidates before changing committed binding -directories; `check` compares regenerated content without updating those files. +The local schema must match the helper's pinned checksum. Release builds also pass +`--version ` and `--commit ` to embed provenance. -The core schema must match the version declared in the package catalog. Without -`--core-schema`, normalization uses upstream core-schema resolution. Offline -generation also requires locally available extension definitions; native package -verification and profiling require resolved package dependencies and Go. - -The normalizer and Go emitter run as linked libraries. Explicit executable -overrides for those tools conflict with this mode. For binding provenance, -`--go-profiler /absolute/path/to/go-rc-profiler` selects a standalone profiler -file; otherwise the linked profiler's actual module version and checksum are -recorded. The `rc profile` commands always use the linked Go profiler. - -## CI coverage and distribution - -CI tests Linux and macOS on amd64 and arm64. It relocates the staged executable -and YAML resources, exercises all eight binding operations, installs a freshly -generated Go module through a local proxy, and profiles its declarations through -both Go command routes. Negative checks cover altered committed source, nonempty -output directories, and invalid declarations preserving existing profile output. -Only Go is available on the smoke test's subprocess PATH; Python is used by the -CI harness, and is not a runtime dependency of Go binding or profiling commands. - -The small extension fixture is checked in as YAML under `testdata/ci/bindings/`. -Generated packages, archives, profiles, and module caches remain temporary CI -outputs. Homebrew/APT packaging and optional profiler add-ons remain planned. +CI tests Linux and macOS on amd64 and arm64. It relocates the staged executable and YAML +resources, exercises all eight binding operations, installs a freshly generated Go module +through a local proxy, and profiles its declarations through both Go command routes. +Negative checks cover altered committed source, nonempty output directories, and invalid +declarations preserving existing profile output. The small extension fixture is checked in as +YAML under `testdata/ci/bindings/`; generated packages, archives, profiles, and module caches +remain temporary CI outputs. Homebrew and APT/RPM packaging live in +[`homebrew-tools`](https://github.com/runtimeconditions/homebrew-tools) and +[`packages`](https://github.com/runtimeconditions/packages). + +## Ecosystem map + +| Repository | What it is | +| --- | --- | +| [spec](https://github.com/runtimeconditions/spec) | The Runtime Conditions Profile specification and supporting docs. | +| [extensions](https://github.com/runtimeconditions/extensions) | First-party extension definitions and the shared binding tooling. | +| [rc-demos](https://github.com/runtimeconditions/rc-demos) | End-to-end demos, including the `request-logger-http` app and its committed profile. | +| [go-rc-profiler](https://github.com/runtimeconditions/go-rc-profiler) | Go AST profiler; linked into `rc`, also usable standalone. | +| [ts-rc-profiler](https://github.com/runtimeconditions/ts-rc-profiler) | TypeScript profiler add-on (`rc profile typescript`). | +| [java-rc-profiler](https://github.com/runtimeconditions/java-rc-profiler) | Java profiler add-on (`rc profile java`). | +| [python-rc-profiler](https://github.com/runtimeconditions/python-rc-profiler) | Python profiler add-on (`rc profile python`). | +| [ebpf-rc-profiler](https://github.com/runtimeconditions/ebpf-rc-profiler) | Infers external dependencies by watching syscall and network traffic instead of reading bindings. | +| [backstage-plugin](https://github.com/runtimeconditions/backstage-plugin) | Backstage plugin for Runtime Conditions Profiles. | +| [homebrew-tools](https://github.com/runtimeconditions/homebrew-tools) | Homebrew tap (`runtimeconditions/tools`). | +| [packages](https://github.com/runtimeconditions/packages) | Signed apt/dnf/yum package source and `setup.sh`. | From 2f71b55a637c11ea14e13344deb97136a6613f07 Mon Sep 17 00:00:00 2001 From: L Apple Date: Thu, 19 Nov 2026 18:41:36 +0100 Subject: [PATCH 02/19] docs(readme): rename quickstart heading to say what it does "Your first profile" implied the quickstart creates a profile; it only validates a committed demo one. Heading is now "validate an existing profile" with a one-line clarification. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d67b78a..a8b845b 100644 --- a/README.md +++ b/README.md @@ -60,9 +60,10 @@ python missing `rc --help` lists all commands; `rc completion ` prints a shell completion script. -## Quickstart: your first profile — validating an existing one +## Quickstart: validate an existing profile -This works on a fresh install with no toolchain and no workload of your own: +This is the one hands-on step that works on a fresh install — no toolchain, no workload of +your own. It checks a committed demo profile, it does not create a profile yet: ```sh git clone https://github.com/runtimeconditions/rc-demos.git From 8141d17437aa9af5ba1941495a285b10be75b50b Mon Sep 17 00:00:00 2001 From: somethings Date: Thu, 19 Nov 2026 18:59:20 +0100 Subject: [PATCH 03/19] Update README.md --- README.md | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index a8b845b..18e6101 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,15 @@ # rc-cli -`rc` is the Runtime Conditions CLI. It **generates** Runtime Conditions Profiles from your -workload's binding declarations and **validates** profiles against the spec — whether the -profile was written by hand, by an agent, or by a profiler. +`rc-cli` is the Runtime Conditions CLI. A Runtime Conditions Profile is a portable, machine-readable list of what one workload needs at runtime: the APIs, caches, datastores, and environment configuration it depends on. + +`rc-cli` generates Runtime Conditions Profiles from your workload's binding declarations and validates profiles against the spec and the extensions it declares, whether the profile was written by hand, by an agent, or by a profiler. The profile states the demand; platforms and adapters such as Kratix, Crossplane, and Radius decide how to fulfill it. - Guide and concepts: - Profile specification: ## Install -The package is named `rc-cli`; the executable is named `rc`. +The package is named `rc-cli`. The executable is named `rc`. **Homebrew (macOS and Linux):** @@ -26,9 +26,11 @@ sudo apt install rc-cli # Debian / Ubuntu sudo dnf install rc-cli # Fedora / RHEL ``` -**Language profilers are separate add-ons** — Go profiling is built into `rc`; TypeScript, -Java, and Python profilers install through their own channels. See -[Optional language profilers](#optional-language-profilers). +Language profilers are separate add-ons. A profiler reads your workload's code and +generates its profile: + +- Go profiling is built into `rc`, so Go workloads need nothing else. +- TypeScript, Java, and Python profilers install through their own channels; see [Optional language profilers](#optional-language-profilers). **From source:** see [Build from source](#build-from-source). @@ -62,8 +64,8 @@ completion script. ## Quickstart: validate an existing profile -This is the one hands-on step that works on a fresh install — no toolchain, no workload of -your own. It checks a committed demo profile, it does not create a profile yet: +This is the one hands-on step that works on a fresh install. It checks a committed demo profile. +It does not create a profile yet: ```sh git clone https://github.com/runtimeconditions/rc-demos.git From 88dda5d69f193f10896652d99c19da7533310fc4 Mon Sep 17 00:00:00 2001 From: somethings Date: Thu, 19 Nov 2026 23:21:59 +0100 Subject: [PATCH 04/19] Update README.md --- README.md | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 18e6101..7896e0a 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,9 @@ `rc-cli` is the Runtime Conditions CLI. A Runtime Conditions Profile is a portable, machine-readable list of what one workload needs at runtime: the APIs, caches, datastores, and environment configuration it depends on. -`rc-cli` generates Runtime Conditions Profiles from your workload's binding declarations and validates profiles against the spec and the extensions it declares, whether the profile was written by hand, by an agent, or by a profiler. The profile states the demand; platforms and adapters such as Kratix, Crossplane, and Radius decide how to fulfill it. +`rc-cli` **generates** Runtime Conditions Profiles from your workload's binding declarations and **validates** profiles against the spec and the extensions it declares, whether the profile was written by hand, by an agent, or by a profiler. The profile states the demand; platforms and adapters decide how to fulfill it. + +**Example scenario:** Your service depends on a Todos API reachable at `TODOS_API_URL` and a Redis cache at `REDIS_URL`. Today that knowledge lives in a wiki page or someone's head, and the platform team provisions from a guess. A Runtime Conditions Profile writes it down where the code lives: you declare the need once in your source, `rc profile generate` reads those declarations and emits the profile as YAML, and `rc profile validate` checks the profile is well-formed and matches the extensions it uses. Then Kratix, Crossplane, Radius, or Backstage can read the same file and fulfill the need. No re-explaining, no drift between docs and reality. - Guide and concepts: - Profile specification: @@ -36,7 +38,7 @@ generates its profile: ## Commands -Check the installation and see which profilers are available: +Verify the install and see which profilers `rc` can run: ```sh rc --version @@ -46,6 +48,8 @@ rc --version rc v0.6.0 (a1b2c3d) ``` +`rc version --output yaml` adds the Go toolchain, platform, and linked profiler components. + ```sh rc plugins list ``` @@ -58,7 +62,19 @@ java missing python missing ``` -`rc plugins list --output yaml` adds each missing add-on's install command. +`go` is the profiler linked into `rc` — nothing extra to install. `typescript`, `java`, and +`python` are add-ons: `missing` just means "not installed", which only matters if your +workload is in that language. `rc plugins list --output yaml` also prints each missing +add-on's install command, e.g. `install with: npm install --global @runtimeconditions/typescript-profiler`. + +`rc --help` lists all commands; `rc completion ` prints a shell +completion script. + +`go` is the profiler linked into `rc` — nothing extra to install. `typescript`, `java`, and +`python` are add-ons: `missing` just means "not installed", which only matters if your +workload is in that language. `rc plugins list --output yaml` also prints each missing +add-on's install command, e.g. `install with: npm install --global @runtimeconditions/typescript-profiler`. + `rc --help` lists all commands; `rc completion ` prints a shell completion script. @@ -89,7 +105,7 @@ rc profile validate - < profile.yaml # read the profile from stdin ## Generating a profile `rc profile generate` reads the Go binding declarations in a workload and writes a validated -profile. It analyzes declarations statically — it never runs your code. Three prerequisites: +profile. It analyzes declarations statically and never runs your code. Three prerequisites: 1. **A Go toolchain on `PATH`.** Without one, generation fails with `exec: "go": executable file not found in $PATH`. `rc` does not download Go for you. From 19cccddfbb97615af3b836de9b42b91736271ef1 Mon Sep 17 00:00:00 2001 From: L Apple Date: Thu, 19 Nov 2026 23:50:08 +0100 Subject: [PATCH 05/19] docs: restructure README into standard template, move details to docs/, add CONTRIBUTING.md - README.md (127 lines): what-it-is + example scenario, Install, Quickstart (validate an existing profile), Commands with full table, Documentation links, Ecosystem, Contributing, License - docs/: generating-profiles.md, language-profilers.md, bindings.md, build-from-source.md, command-reference.md - CONTRIBUTING.md: building, layout, testing (gofmt/vet/test -race/mod verify per ci.yml), PR expectations Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe --- CONTRIBUTING.md | 65 ++++++ README.md | 386 ++++++------------------------------ docs/bindings.md | 47 +++++ docs/build-from-source.md | 42 ++++ docs/command-reference.md | 18 ++ docs/generating-profiles.md | 121 +++++++++++ docs/language-profilers.md | 38 ++++ 7 files changed, 395 insertions(+), 322 deletions(-) create mode 100644 CONTRIBUTING.md create mode 100644 docs/bindings.md create mode 100644 docs/build-from-source.md create mode 100644 docs/command-reference.md create mode 100644 docs/generating-profiles.md create mode 100644 docs/language-profilers.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..fb8c485 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,65 @@ +# Contributing + +## Building from Source + +```bash +# Clone the repository +git clone https://github.com/runtimeconditions/rc-cli.git +cd rc-cli + +# Build the CLI with the schema-aware helper (plain `go build` omits the embedded schema) +go run ./scripts/build.go --output ./rc + +# Verify it works +./rc --version +``` + +See [docs/build-from-source.md](docs/build-from-source.md) for the schema checksum, +`--core-schema`, and release `--version`/`--commit` flags. + +## Development Workflow + +| Path | What lives there | +| --- | --- | +| `cmd/rc/` | Executable entry point: signals, streams, exit codes | +| `internal/cli/` | Cobra command tree (`root`, `profile`, `plugins`, `bindings`) and their tests | +| `internal/plugins/` | Language add-on discovery and compatibility checks | +| `internal/process/` | Subprocess runner for add-ons | +| `internal/validate/` | Profile validation against the embedded core schema | +| `scripts/` | Build, stage, smoke-test, and release helpers | +| `distribution/` | Component lock, nFPM config, Homebrew formula template, platform matrix | +| `testdata/` | CI fixtures (bindings, profiles) | + +To add or change a command: + +1. Add the Cobra command in `internal/cli/` — Go commands use native flags; language add-on + branches pass argv through unchanged +2. Add tests in the matching `*_test.go` file +3. Update `--help` examples and `README.md` / `docs/` when the user-visible surface changes + +Binding logic (resolve, normalize, generate, verify, …) lives in +[`extensions`](https://github.com/runtimeconditions/extensions), pinned in +`distribution/components.lock.yaml`; this repo calls it as a library, it does not reimplement it. + +## Testing + +```bash +gofmt -l . # CI fails if this prints anything +go vet ./... +go test -race ./... +go mod verify +``` + +CI runs these on Linux and macOS (amd64/arm64), then builds with `scripts/build.go`, relocates +the staged executable and YAML resources, and runs the smoke harnesses (`scripts/ci-smoke.go`, +`scripts/ci-bindings-smoke.py`) against `testdata/ci/` fixtures, including negative checks. +CI builds with Go 1.26.5 and tests workload analysis with Go 1.25.0. Releases are tag-driven +(`.github/workflows/release.yml`). + +## Pull Requests + +- Build with the schema-aware helper (`go run ./scripts/build.go --output ./rc`), not plain `go build` +- Keep `gofmt` clean and `go test -race ./...` passing +- Update `README.md` / `docs/` alongside any command, flag, or output change +- Keep error messages actionable: name the missing prerequisite and how to install it +- Don't commit generated bindings, profiles, or other CI outputs diff --git a/README.md b/README.md index 7896e0a..2f1fa17 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,29 @@ # rc-cli -`rc-cli` is the Runtime Conditions CLI. A Runtime Conditions Profile is a portable, machine-readable list of what one workload needs at runtime: the APIs, caches, datastores, and environment configuration it depends on. - -`rc-cli` **generates** Runtime Conditions Profiles from your workload's binding declarations and **validates** profiles against the spec and the extensions it declares, whether the profile was written by hand, by an agent, or by a profiler. The profile states the demand; platforms and adapters decide how to fulfill it. - -**Example scenario:** Your service depends on a Todos API reachable at `TODOS_API_URL` and a Redis cache at `REDIS_URL`. Today that knowledge lives in a wiki page or someone's head, and the platform team provisions from a guess. A Runtime Conditions Profile writes it down where the code lives: you declare the need once in your source, `rc profile generate` reads those declarations and emits the profile as YAML, and `rc profile validate` checks the profile is well-formed and matches the extensions it uses. Then Kratix, Crossplane, Radius, or Backstage can read the same file and fulfill the need. No re-explaining, no drift between docs and reality. +`rc-cli` is the Runtime Conditions CLI. A Runtime Conditions Profile is a portable, +machine-readable list of what one workload needs at runtime: the APIs, caches, datastores, +and environment configuration it depends on. + +`rc-cli` **generates** Runtime Conditions Profiles from your workload's binding declarations +and **validates** profiles against the spec and the extensions it declares, whether the +profile was written by hand, by an agent, or by a profiler. The profile states the demand; +platforms and adapters decide how to fulfill it. + +**Example scenario:** Your service depends on a Todos API reachable at `TODOS_API_URL` and a +Redis cache at `REDIS_URL`. Today that knowledge lives in a wiki page or someone's head, and +the platform team provisions from a guess. A Runtime Conditions Profile writes it down where +the code lives: you declare the need once in your source, `rc profile generate` reads those +declarations and emits the profile as YAML, and `rc profile validate` checks the profile is +well-formed and matches the extensions it uses. Then Kratix, Crossplane, Radius, or Backstage +can read the same file and fulfill the need. No re-explaining, no drift between docs and +reality. - Guide and concepts: - Profile specification: ## Install -The package is named `rc-cli`. The executable is named `rc`. +The package is named `rc-cli`; the executable is named `rc`. **Homebrew (macOS and Linux):** @@ -28,33 +40,36 @@ sudo apt install rc-cli # Debian / Ubuntu sudo dnf install rc-cli # Fedora / RHEL ``` -Language profilers are separate add-ons. A profiler reads your workload's code and -generates its profile: +Language profilers are separate add-ons: Go profiling is built into `rc`, so Go workloads +need nothing else. TypeScript, Java, and Python profilers install through their own channels +— see [Language profilers](docs/language-profilers.md). To build the CLI yourself, see +[Build from source](docs/build-from-source.md). -- Go profiling is built into `rc`, so Go workloads need nothing else. -- TypeScript, Java, and Python profilers install through their own channels; see [Optional language profilers](#optional-language-profilers). +## Quickstart -**From source:** see [Build from source](#build-from-source). - -## Commands +The one hands-on step that works on a fresh install — validating an existing profile, not +creating one yet: -Verify the install and see which profilers `rc` can run: - -```sh -rc --version +```console +$ git clone https://github.com/runtimeconditions/rc-demos.git +$ rc profile validate rc-demos/artifacts/request-logger-http.profile.yaml +runtimeconditions: profile validated ``` -```text -rc v0.6.0 (a1b2c3d) -``` +`rc profile validate` checks any profile against the core schema embedded in `rc` and the +definitions of the extensions it declares — downloaded from their `https` ids by default, or +read from local directories with `--catalog ` (repeatable). `-` reads the profile from +stdin. -`rc version --output yaml` adds the Go toolchain, platform, and linked profiler components. +## Commands -```sh -rc plugins list +```console +$ rc --version +rc v0.6.0 (a1b2c3d) ``` -```text +```console +$ rc plugins list LANGUAGE STATUS VERSION PATH go built-in v0.8.0 typescript missing @@ -62,169 +77,14 @@ java missing python missing ``` -`go` is the profiler linked into `rc` — nothing extra to install. `typescript`, `java`, and -`python` are add-ons: `missing` just means "not installed", which only matters if your -workload is in that language. `rc plugins list --output yaml` also prints each missing -add-on's install command, e.g. `install with: npm install --global @runtimeconditions/typescript-profiler`. - +`go` is the profiler linked into `rc` — nothing extra to install. `missing` add-ons only +matter for workloads in that language; `rc plugins list --output yaml` prints each one's +install command. `rc version --output yaml` adds platform and linked-component details. `rc --help` lists all commands; `rc completion ` prints a shell completion script. -`go` is the profiler linked into `rc` — nothing extra to install. `typescript`, `java`, and -`python` are add-ons: `missing` just means "not installed", which only matters if your -workload is in that language. `rc plugins list --output yaml` also prints each missing -add-on's install command, e.g. `install with: npm install --global @runtimeconditions/typescript-profiler`. - -`rc --help` lists all commands; `rc completion ` prints a shell -completion script. - -## Quickstart: validate an existing profile - -This is the one hands-on step that works on a fresh install. It checks a committed demo profile. -It does not create a profile yet: - -```sh -git clone https://github.com/runtimeconditions/rc-demos.git -rc profile validate rc-demos/artifacts/request-logger-http.profile.yaml -``` - -```text -runtimeconditions: profile validated -``` - -`rc profile validate` checks any profile file against the core schema embedded in `rc` and -against the definitions of the extensions the profile declares. By default those definitions -are downloaded from the `https` ids the profile names. To work offline or against local -definitions instead, pass one or more catalog directories: - -```sh -rc profile validate profile.yaml --catalog ./my-extensions -rc profile validate - < profile.yaml # read the profile from stdin -``` - -## Generating a profile - -`rc profile generate` reads the Go binding declarations in a workload and writes a validated -profile. It analyzes declarations statically and never runs your code. Three prerequisites: - -1. **A Go toolchain on `PATH`.** Without one, generation fails with - `exec: "go": executable file not found in $PATH`. `rc` does not download Go for you. -2. **`--dir` must point at a directory containing a `go.mod`.** Current releases fail fast: - - ```text - rc: /path/to/dir: workload must have a go.mod: stat /path/to/dir/go.mod: no such file or directory - ``` - - Older releases (for example the Homebrew v0.6.0 build) fell back to GOPATH mode and scanned - your entire home directory, spraying `operation not permitted` errors for TCC-protected - paths. Always point `--dir` at a Go module. -3. **The workload must import published RC binding modules** (`runtimeconditions.io/x/rc/...`). - Bindings wired with `go.mod` `replace` directives to a local clone are rejected **by - design**: - - ```text - rc: github.com/runtimeconditions/extensions/catalog/rc/common-integrations/go uses a go.mod replace; generated bindings must resolve to a published module version - ``` - - This is why a fresh clone of `rc-demos/apps/request-logger-http` cannot be generated: its - `go.mod` replaces the binding modules with a sibling checkout of `extensions`. Generate - from a module that requires the published versions instead. - -### Example workload - -`go.mod`: - -```go -module example.com/my-service - -go 1.25.0 - -require ( - runtimeconditions.io/x/rc/common v0.3.0 - runtimeconditions.io/x/rc/env v0.3.0 -) -``` - -`main.go` — declare conditions with the published binding packages: - -```go -package main - -import ( - "runtimeconditions.io/x/rc/common" - "runtimeconditions.io/x/rc/env" -) - -var todosAPI = common.Api( - common.Http{ - Spec: &common.Spec{Format: common.FormatOpenapi, Uri: "catalog://api/default/todos-api"}, - Operations: common.HttpOperations{ - {Method: common.MethodGet, Path: "/todos/{id}", - ResponseSchema: common.ResponseSchemaMap{"id": common.SimpleSchemaStringInteger}}, - }, - }, - env.HttpConfiguration{ - Env: env.HttpConfigurationEnv{ - {Name: "TODOS_API_URL", Property: env.HttpConfigurationEnvPropertyBaseUrl}, - }, - }, -) - -var requestCache = common.Cache( - common.KeyValue{Engine: &[]common.KeyValueEngine{common.KeyValueEngineRedis}[0]}, - env.KeyValueConfiguration{ - Env: env.KeyValueConfigurationEnv{ - {Name: "REDIS_URL", Property: env.KeyValueConfigurationEnvPropertyUrl}, - }, - }, -) - -func main() {} -``` - -Resolve dependencies, then generate: - -```sh -go mod tidy -rc profile generate --dir ./my-service --out profile.yaml -``` - -Defaults: `--dir` is the current directory, `--out` is stdout, `--name` is the directory's -basename, `--workload-uri` is the enclosing Go module path, `--workload-version` is `dev`. -A failed generation leaves an existing `--out` file unchanged. You can set them explicitly: - -```sh -rc profile generate \ - --dir ./my-service \ - --name my-service \ - --workload-uri https://example.com/my-service \ - --workload-version 1.0.0 \ - --out profile.yaml -``` - -**Verified status today:** a workload importing only `runtimeconditions.io/x/rc/common@v0.3.0` -generates a profile that passes `rc profile validate`, end to end. Adding -`runtimeconditions.io/x/rc/env@v0.3.0` currently fails dependency artifact verification with: - -```text -rc: runtimeconditions.io/x/rc/env dependency runtimeconditions.io/x/rc/common: dependency Go module archive SHA-256 mismatch -``` - -The published-module pattern above is the supported direction; treat that error as a -known gap in the current published `env` release, not as a mistake in your workload. - -### Checking a workload's bindings - -```sh -rc profile validate-extensions --dir ./my-service -rc profile validate-extension --dir ./my-service --package runtimeconditions.io/x/rc/common -rc profile go version # linked Go profiler version, e.g. "go-rc-profiler v0.8.0 (linked into rc)" -``` - -## Command reference - -`rc profile` uses the built-in Go profiler by default. The same commands are available under -`rc profile go`, with identical flags and behavior: +`rc profile` uses the built-in Go profiler by default; the same commands exist under +`rc profile go` with identical flags: | Command | Purpose | | --- | --- | @@ -237,149 +97,31 @@ rc profile go version # linked Go profiler version, e.g. "go-rc-profiler v0.8 | `rc version [--output text\|yaml]` | Show CLI build information. `rc --version` prints the same one-liner. | | `rc completion ` | Print a shell completion script. | -For full flag lists: - -```sh -rc profile --help -rc profile go --help -rc profile go generate --help -rc bindings --help -``` - -### Binding commands - -`rc bindings` resolves, generates, and verifies extension bindings. The command group -provides `resolve`, `normalize`, `generate`, `verify`, `package`, `plan-release`, `check`, -and `update`. Cobra owns help, completion, and flag parsing; execution uses the shared -binding library from `extensions`. - -Binding commands also require the shared YAML schemas. Installed layouts place them under -`share/rc/extension-bindings/model/`, alongside `bin/rc`. CI stages these files from the -exact `extensions` commit in `distribution/components.lock.yaml`. - -For local binding development, supply `--tooling-dir` pointing to matching schema resources, -such as the `tooling/extension-bindings` directory in a checkout of that pinned revision: +Full flag lists: [Command reference](docs/command-reference.md). -```sh -rc bindings generate \ - --packages /path/to/binding-project/packages.yaml \ - --toolchain-lock /path/to/binding-project/toolchain.lock.yaml \ - --tooling-dir /path/to/extensions/tooling/extension-bindings \ - --core-schema /path/to/runtimeconditions.profile.schema.yaml \ - --output /tmp/generated-bindings -``` - -`packages.yaml` selects extension roots, language targets, and native package versions. -`toolchain.lock.yaml` declares the applicable toolchain constraints. Use repeatable -`--target package-key:language` flags to limit the selected targets. `generate` requires a -new or empty output directory. `verify --input` accepts the generated tree; use the same -catalog and resource flags for these commands. `update` verifies candidates before changing -committed binding directories; `check` compares regenerated content without updating those -files. Other shared flags include `--cache`, `--work-dir`, `--catalog-root`, -`--dependency-lock`, `--extension-root`, and `--extension-override`; see -`rc bindings generate --help` for the full list. - -The core schema must match the version declared in the package catalog. Without -`--core-schema`, normalization uses upstream core-schema resolution. Offline generation -also requires locally available extension definitions; native package verification and -profiling require resolved package dependencies and Go. - -The normalizer and Go emitter run as linked libraries. Explicit executable overrides for -those tools (`--normalizer`, `--go-emitter`) conflict with this mode. For binding -provenance, `--go-profiler /absolute/path/to/go-rc-profiler` selects a standalone profiler -file; otherwise the linked profiler's actual module version and checksum are recorded. The -`rc profile` commands always use the linked Go profiler. - -## Optional language profilers - -Other languages run a separate add-on that `rc` finds on `PATH`. It can come from the -language's own tooling or from a system package, and `rc` does not care which: - -- **TypeScript:** `npm install --global @runtimeconditions/typescript-profiler`, or - `brew install runtimeconditions/tools/rc-profiler-typescript`. -- **Java:** download the launcher `rc-profiler-java` from the - [releases](https://github.com/runtimeconditions/java-rc-profiler/releases) of - `runtimeconditions/java-rc-profiler` and put it on `PATH`, or - `brew install runtimeconditions/tools/rc-profiler-java`. -- **Python:** `pip install runtimeconditions-profiler` into the workload's own virtual - environment — it finds binding packages through that environment's metadata — and put the - environment's `bin` directory on `PATH`. Do not use `pipx`, which would give it an - environment of its own. - -| Command | Purpose | -| --- | --- | -| `rc profile typescript [flags]` | Run the installed TypeScript profiler. | -| `rc profile java [flags]` | Run the installed Java profiler. | -| `rc profile python [flags]` | Run the installed Python profiler. | -| `rc plugins list [--output yaml]` | Show the Go profiler and each add-on's status, version, and path. | +## Documentation -Everything after `typescript`, `java`, or `python` goes to the add-on unchanged, so it keeps -its own flags (for example `--project` instead of `--dir`, and `--classpath` for Java). `rc` -looks for `rc-profiler-typescript`, then `runtimeconditions-typescript-profiler`, or -`rc-profiler-java`, or `runtimeconditions-python-profiler`, on `PATH`; -`RC_TYPESCRIPT_PROFILER`, `RC_JAVA_PROFILER`, or `RC_PYTHON_PROFILER` can name an absolute -path instead. It runs the add-on only if `--version --json` lists the core profile schema -`rc` targets (0.4.0). The add-on's output and exit status pass through. +- [Generating a profile](docs/generating-profiles.md) — prerequisites, example workload, flags +- [Command reference](docs/command-reference.md) — every command and flag +- [Language profilers](docs/language-profilers.md) — TypeScript, Java, Python add-ons +- [Binding commands](docs/bindings.md) — `rc bindings`, for extension authors +- [Build from source](docs/build-from-source.md) — building and hacking on `rc` itself -The Java launcher chooses the JDK, not `rc`: `RC_JAVA_HOME`, then `JAVA_HOME`, then the -runtime bundled in its system package, then `java` on `PATH`. It needs JDK 17 or newer and -says so when none is found. +## Ecosystem -The Python profiler runs on the interpreter of the environment it is installed in (Python -3.11 or newer), and sees the binding packages installed there. +- [spec](https://github.com/runtimeconditions/spec) — the profile specification and docs +- [extensions](https://github.com/runtimeconditions/extensions) — first-party extensions and binding tooling +- [rc-demos](https://github.com/runtimeconditions/rc-demos) — end-to-end demos with committed profiles +- [go-rc-profiler](https://github.com/runtimeconditions/go-rc-profiler) — Go profiler, linked into `rc` +- [ts-rc-profiler](https://github.com/runtimeconditions/ts-rc-profiler), [java-rc-profiler](https://github.com/runtimeconditions/java-rc-profiler), [python-rc-profiler](https://github.com/runtimeconditions/python-rc-profiler) — language add-ons +- [ebpf-rc-profiler](https://github.com/runtimeconditions/ebpf-rc-profiler) — infers dependencies from syscall/network traffic instead of bindings +- [backstage-plugin](https://github.com/runtimeconditions/backstage-plugin) — Backstage plugin for profiles +- [homebrew-tools](https://github.com/runtimeconditions/homebrew-tools), [packages](https://github.com/runtimeconditions/packages) — Homebrew tap and apt/dnf/yum source -## Build from source +## Contributing -From this repository's root, build the executable with the schema-aware helper: +See [CONTRIBUTING.md](CONTRIBUTING.md). -```sh -go run ./scripts/build.go --output ./rc -./rc --version -./rc profile generate --dir /path/to/go/workload --out profile.yaml -``` - -The helper downloads the pinned core profile schema, verifies its SHA-256, and embeds it -alongside the linked Go profiler. Go profiling needs no runtime schema download or separate -profiler installation. Analyzing a workload requires a working Go toolchain and its binding -dependencies. CI builds with Go 1.26.5 and tests workload analysis with Go 1.25.0. - -A plain `go build` or `go install` omits the schema linker value. Such a binary can display -help and version information, but profile generation fails with -`rc: installed profiler has no verified core profile schema`. Rebuild it using the command -above and run the resulting `./rc` executable. - -For a build using an already downloaded schema, supply the approved artifact: - -```sh -go run ./scripts/build.go --output ./rc \ - --core-schema /path/to/runtimeconditions.profile.schema.yaml -``` - -The local schema must match the helper's pinned checksum. Release builds also pass -`--version ` and `--commit ` to embed provenance. +## License -CI tests Linux and macOS on amd64 and arm64. It relocates the staged executable and YAML -resources, exercises all eight binding operations, installs a freshly generated Go module -through a local proxy, and profiles its declarations through both Go command routes. -Negative checks cover altered committed source, nonempty output directories, and invalid -declarations preserving existing profile output. The small extension fixture is checked in as -YAML under `testdata/ci/bindings/`; generated packages, archives, profiles, and module caches -remain temporary CI outputs. Homebrew and APT/RPM packaging live in -[`homebrew-tools`](https://github.com/runtimeconditions/homebrew-tools) and -[`packages`](https://github.com/runtimeconditions/packages). - -## Ecosystem map - -| Repository | What it is | -| --- | --- | -| [spec](https://github.com/runtimeconditions/spec) | The Runtime Conditions Profile specification and supporting docs. | -| [extensions](https://github.com/runtimeconditions/extensions) | First-party extension definitions and the shared binding tooling. | -| [rc-demos](https://github.com/runtimeconditions/rc-demos) | End-to-end demos, including the `request-logger-http` app and its committed profile. | -| [go-rc-profiler](https://github.com/runtimeconditions/go-rc-profiler) | Go AST profiler; linked into `rc`, also usable standalone. | -| [ts-rc-profiler](https://github.com/runtimeconditions/ts-rc-profiler) | TypeScript profiler add-on (`rc profile typescript`). | -| [java-rc-profiler](https://github.com/runtimeconditions/java-rc-profiler) | Java profiler add-on (`rc profile java`). | -| [python-rc-profiler](https://github.com/runtimeconditions/python-rc-profiler) | Python profiler add-on (`rc profile python`). | -| [ebpf-rc-profiler](https://github.com/runtimeconditions/ebpf-rc-profiler) | Infers external dependencies by watching syscall and network traffic instead of reading bindings. | -| [backstage-plugin](https://github.com/runtimeconditions/backstage-plugin) | Backstage plugin for Runtime Conditions Profiles. | -| [homebrew-tools](https://github.com/runtimeconditions/homebrew-tools) | Homebrew tap (`runtimeconditions/tools`). | -| [packages](https://github.com/runtimeconditions/packages) | Signed apt/dnf/yum package source and `setup.sh`. | +[MIT](LICENSE) — Copyright (c) 2026 Runtime Conditions. diff --git a/docs/bindings.md b/docs/bindings.md new file mode 100644 index 0000000..e6e1f5b --- /dev/null +++ b/docs/bindings.md @@ -0,0 +1,47 @@ +# Binding commands (`rc bindings`) + +This page is for extension authors and contributors who generate, verify, or release binding +packages. Users profiling a workload only need the `rc profile` commands — see the +[command reference](command-reference.md). + +`rc bindings` resolves, generates, and verifies extension bindings. The command group +provides `resolve`, `normalize`, `generate`, `verify`, `package`, `plan-release`, `check`, +and `update`. Cobra owns help, completion, and flag parsing; execution uses the shared +binding library from `extensions`. + +Binding commands also require the shared YAML schemas. Installed layouts place them under +`share/rc/extension-bindings/model/`, alongside `bin/rc`. CI stages these files from the +exact `extensions` commit in `distribution/components.lock.yaml`. + +For local binding development, supply `--tooling-dir` pointing to matching schema resources, +such as the `tooling/extension-bindings` directory in a checkout of that pinned revision: + +```sh +rc bindings generate \ + --packages /path/to/binding-project/packages.yaml \ + --toolchain-lock /path/to/binding-project/toolchain.lock.yaml \ + --tooling-dir /path/to/extensions/tooling/extension-bindings \ + --core-schema /path/to/runtimeconditions.profile.schema.yaml \ + --output /tmp/generated-bindings +``` + +`packages.yaml` selects extension roots, language targets, and native package versions. +`toolchain.lock.yaml` declares the applicable toolchain constraints. Use repeatable +`--target package-key:language` flags to limit the selected targets. `generate` requires a +new or empty output directory. `verify --input` accepts the generated tree; use the same +catalog and resource flags for these commands. `update` verifies candidates before changing +committed binding directories; `check` compares regenerated content without updating those +files. Other shared flags include `--cache`, `--work-dir`, `--catalog-root`, +`--dependency-lock`, `--extension-root`, and `--extension-override`; see +`rc bindings generate --help` for the full list. + +The core schema must match the version declared in the package catalog. Without +`--core-schema`, normalization uses upstream core-schema resolution. Offline generation +also requires locally available extension definitions; native package verification and +profiling require resolved package dependencies and Go. + +The normalizer and Go emitter run as linked libraries. Explicit executable overrides for +those tools (`--normalizer`, `--go-emitter`) conflict with this mode. For binding +provenance, `--go-profiler /absolute/path/to/go-rc-profiler` selects a standalone profiler +file; otherwise the linked profiler's actual module version and checksum are recorded. The +`rc profile` commands always use the linked Go profiler. diff --git a/docs/build-from-source.md b/docs/build-from-source.md new file mode 100644 index 0000000..b59a03d --- /dev/null +++ b/docs/build-from-source.md @@ -0,0 +1,42 @@ +# Build from source + +Everything on this page is for people building or modifying `rc` itself. Users who just +installed the CLI don't need any of it. + +From this repository's root, build the executable with the schema-aware helper: + +```sh +go run ./scripts/build.go --output ./rc +./rc --version +./rc profile generate --dir /path/to/go/workload --out profile.yaml +``` + +The helper downloads the pinned core profile schema, verifies its SHA-256, and embeds it +alongside the linked Go profiler. Go profiling needs no runtime schema download or separate +profiler installation. Analyzing a workload requires a working Go toolchain and its binding +dependencies. CI builds with Go 1.26.5 and tests workload analysis with Go 1.25.0. + +A plain `go build` or `go install` omits the schema linker value. Such a binary can display +help and version information, but profile generation fails with +`rc: installed profiler has no verified core profile schema`. Rebuild it using the command +above and run the resulting `./rc` executable. + +For a build using an already downloaded schema, supply the approved artifact: + +```sh +go run ./scripts/build.go --output ./rc \ + --core-schema /path/to/runtimeconditions.profile.schema.yaml +``` + +The local schema must match the helper's pinned checksum. Release builds also pass +`--version ` and `--commit ` to embed provenance. + +CI tests Linux and macOS on amd64 and arm64. It relocates the staged executable and YAML +resources, exercises all eight binding operations, installs a freshly generated Go module +through a local proxy, and profiles its declarations through both Go command routes. +Negative checks cover altered committed source, nonempty output directories, and invalid +declarations preserving existing profile output. The small extension fixture is checked in as +YAML under `testdata/ci/bindings/`; generated packages, archives, profiles, and module caches +remain temporary CI outputs. Homebrew and APT/RPM packaging live in +[`homebrew-tools`](https://github.com/runtimeconditions/homebrew-tools) and +[`packages`](https://github.com/runtimeconditions/packages). diff --git a/docs/command-reference.md b/docs/command-reference.md new file mode 100644 index 0000000..583c90c --- /dev/null +++ b/docs/command-reference.md @@ -0,0 +1,18 @@ +# Command reference + +The command table lives in the [README](../README.md#commands). This page has the full flag +lists and the binding-commands pointer. + +```sh +rc profile --help +rc profile go --help +rc profile go generate --help +rc bindings --help +``` + +## Binding commands + +`rc bindings` resolves, generates, and verifies extension bindings. The command group +provides `resolve`, `normalize`, `generate`, `verify`, `package`, `plan-release`, `check`, +and `update`. For schemas, flags, and local binding development, see +[docs/bindings.md](bindings.md). diff --git a/docs/generating-profiles.md b/docs/generating-profiles.md new file mode 100644 index 0000000..527a9ac --- /dev/null +++ b/docs/generating-profiles.md @@ -0,0 +1,121 @@ +# Generating a profile + +`rc profile generate` and its prerequisites, in detail. For the one-step quickstart see the +[README](../README.md#quickstart). + +`rc profile generate` reads the Go binding declarations in a workload and writes a validated +profile. It analyzes declarations statically and never runs your code. Three prerequisites: + +1. **A Go toolchain on `PATH`.** Without one, generation fails with + `exec: "go": executable file not found in $PATH`. `rc` does not download Go for you. +2. **`--dir` must point at a directory containing a `go.mod`.** Current releases fail fast: + + ```text + rc: /path/to/dir: workload must have a go.mod: stat /path/to/dir/go.mod: no such file or directory + ``` + + Older releases (for example the Homebrew v0.6.0 build) fell back to GOPATH mode and scanned + your entire home directory, spraying `operation not permitted` errors for TCC-protected + paths. Always point `--dir` at a Go module. +3. **The workload must import published RC binding modules** (`runtimeconditions.io/x/rc/...`). + Bindings wired with `go.mod` `replace` directives to a local clone are rejected **by + design**: + + ```text + rc: github.com/runtimeconditions/extensions/catalog/rc/common-integrations/go uses a go.mod replace; generated bindings must resolve to a published module version + ``` + + This is why a fresh clone of `rc-demos/apps/request-logger-http` cannot be generated: its + `go.mod` replaces the binding modules with a sibling checkout of `extensions`. Generate + from a module that requires the published versions instead. + +## Example workload + +`go.mod`: + +```go +module example.com/my-service + +go 1.25.0 + +require ( + runtimeconditions.io/x/rc/common v0.3.0 + runtimeconditions.io/x/rc/env v0.3.0 +) +``` + +`main.go` — declare conditions with the published binding packages: + +```go +package main + +import ( + "runtimeconditions.io/x/rc/common" + "runtimeconditions.io/x/rc/env" +) + +var todosAPI = common.Api( + common.Http{ + Spec: &common.Spec{Format: common.FormatOpenapi, Uri: "catalog://api/default/todos-api"}, + Operations: common.HttpOperations{ + {Method: common.MethodGet, Path: "/todos/{id}", + ResponseSchema: common.ResponseSchemaMap{"id": common.SimpleSchemaStringInteger}}, + }, + }, + env.HttpConfiguration{ + Env: env.HttpConfigurationEnv{ + {Name: "TODOS_API_URL", Property: env.HttpConfigurationEnvPropertyBaseUrl}, + }, + }, +) + +var requestCache = common.Cache( + common.KeyValue{Engine: &[]common.KeyValueEngine{common.KeyValueEngineRedis}[0]}, + env.KeyValueConfiguration{ + Env: env.KeyValueConfigurationEnv{ + {Name: "REDIS_URL", Property: env.KeyValueConfigurationEnvPropertyUrl}, + }, + }, +) + +func main() {} +``` + +Resolve dependencies, then generate: + +```sh +go mod tidy +rc profile generate --dir ./my-service --out profile.yaml +``` + +Defaults: `--dir` is the current directory, `--out` is stdout, `--name` is the directory's +basename, `--workload-uri` is the enclosing Go module path, `--workload-version` is `dev`. +A failed generation leaves an existing `--out` file unchanged. You can set them explicitly: + +```sh +rc profile generate \ + --dir ./my-service \ + --name my-service \ + --workload-uri https://example.com/my-service \ + --workload-version 1.0.0 \ + --out profile.yaml +``` + +**Verified status today:** a workload importing only `runtimeconditions.io/x/rc/common@v0.3.0` +generates a profile that passes `rc profile validate`, end to end. Adding +`runtimeconditions.io/x/rc/env@v0.3.0` currently fails dependency artifact verification with: + +```text +rc: runtimeconditions.io/x/rc/env dependency runtimeconditions.io/x/rc/common: dependency Go module archive SHA-256 mismatch +``` + +The published-module pattern above is the supported direction; treat that error as a +known gap in the current published `env` release, not as a mistake in your workload. + +## Checking a workload's bindings + +```sh +rc profile validate-extensions --dir ./my-service +rc profile validate-extension --dir ./my-service --package runtimeconditions.io/x/rc/common +rc profile go version # linked Go profiler version, e.g. "go-rc-profiler v0.8.0 (linked into rc)" +``` diff --git a/docs/language-profilers.md b/docs/language-profilers.md new file mode 100644 index 0000000..dccc857 --- /dev/null +++ b/docs/language-profilers.md @@ -0,0 +1,38 @@ +# Optional language profilers + +Go profiling is built into `rc`. Other languages run a separate add-on that `rc` finds on +`PATH`. It can come from the language's own tooling or from a system package, and `rc` does +not care which: + +- **TypeScript:** `npm install --global @runtimeconditions/typescript-profiler`, or + `brew install runtimeconditions/tools/rc-profiler-typescript`. +- **Java:** download the launcher `rc-profiler-java` from the + [releases](https://github.com/runtimeconditions/java-rc-profiler/releases) of + `runtimeconditions/java-rc-profiler` and put it on `PATH`, or + `brew install runtimeconditions/tools/rc-profiler-java`. +- **Python:** `pip install runtimeconditions-profiler` into the workload's own virtual + environment — it finds binding packages through that environment's metadata — and put the + environment's `bin` directory on `PATH`. Do not use `pipx`, which would give it an + environment of its own. + +| Command | Purpose | +| --- | --- | +| `rc profile typescript [flags]` | Run the installed TypeScript profiler. | +| `rc profile java [flags]` | Run the installed Java profiler. | +| `rc profile python [flags]` | Run the installed Python profiler. | +| `rc plugins list [--output yaml]` | Show the Go profiler and each add-on's status, version, and path. | + +Everything after `typescript`, `java`, or `python` goes to the add-on unchanged, so it keeps +its own flags (for example `--project` instead of `--dir`, and `--classpath` for Java). `rc` +looks for `rc-profiler-typescript`, then `runtimeconditions-typescript-profiler`, or +`rc-profiler-java`, or `runtimeconditions-python-profiler`, on `PATH`; +`RC_TYPESCRIPT_PROFILER`, `RC_JAVA_PROFILER`, or `RC_PYTHON_PROFILER` can name an absolute +path instead. It runs the add-on only if `--version --json` lists the core profile schema +`rc` targets (0.4.0). The add-on's output and exit status pass through. + +The Java launcher chooses the JDK, not `rc`: `RC_JAVA_HOME`, then `JAVA_HOME`, then the +runtime bundled in its system package, then `java` on `PATH`. It needs JDK 17 or newer and +says so when none is found. + +The Python profiler runs on the interpreter of the environment it is installed in (Python +3.11 or newer), and sees the binding packages installed there. From 6be2dc976b7d4be60f427faa77df2b0b58664690 Mon Sep 17 00:00:00 2001 From: L Apple Date: Fri, 20 Nov 2026 00:03:26 +0100 Subject: [PATCH 06/19] docs: delete docs/command-reference.md, restore verbatim text in docs pages - command-reference.md duplicated the README command table; its --help block now lives inline in README Commands - build-from-source.md is word-identical to the original Build locally + CI coverage sections (restored dropped smoke-test PATH sentence) - restored dropped sentences in generating-profiles.md and bindings.md Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe --- README.md | 10 ++++++++-- docs/bindings.md | 8 +++++--- docs/build-from-source.md | 12 +++++++----- docs/command-reference.md | 18 ------------------ docs/generating-profiles.md | 3 ++- 5 files changed, 22 insertions(+), 29 deletions(-) delete mode 100644 docs/command-reference.md diff --git a/README.md b/README.md index 2f1fa17..ede272f 100644 --- a/README.md +++ b/README.md @@ -97,12 +97,18 @@ completion script. | `rc version [--output text\|yaml]` | Show CLI build information. `rc --version` prints the same one-liner. | | `rc completion ` | Print a shell completion script. | -Full flag lists: [Command reference](docs/command-reference.md). +For full flag lists: + +```sh +rc profile --help +rc profile go --help +rc profile go generate --help +rc bindings --help +``` ## Documentation - [Generating a profile](docs/generating-profiles.md) — prerequisites, example workload, flags -- [Command reference](docs/command-reference.md) — every command and flag - [Language profilers](docs/language-profilers.md) — TypeScript, Java, Python add-ons - [Binding commands](docs/bindings.md) — `rc bindings`, for extension authors - [Build from source](docs/build-from-source.md) — building and hacking on `rc` itself diff --git a/docs/bindings.md b/docs/bindings.md index e6e1f5b..5676074 100644 --- a/docs/bindings.md +++ b/docs/bindings.md @@ -2,7 +2,7 @@ This page is for extension authors and contributors who generate, verify, or release binding packages. Users profiling a workload only need the `rc profile` commands — see the -[command reference](command-reference.md). +[command table](../README.md#commands). `rc bindings` resolves, generates, and verifies extension bindings. The command group provides `resolve`, `normalize`, `generate`, `verify`, `package`, `plan-release`, `check`, @@ -11,9 +11,11 @@ binding library from `extensions`. Binding commands also require the shared YAML schemas. Installed layouts place them under `share/rc/extension-bindings/model/`, alongside `bin/rc`. CI stages these files from the -exact `extensions` commit in `distribution/components.lock.yaml`. +exact `extensions` commit in `distribution/components.lock.yaml`; they remain ordinary YAML +files. -For local binding development, supply `--tooling-dir` pointing to matching schema resources, +The local build helper builds the executable. For local binding development, supply +`--tooling-dir` pointing to matching schema resources, such as the `tooling/extension-bindings` directory in a checkout of that pinned revision: ```sh diff --git a/docs/build-from-source.md b/docs/build-from-source.md index b59a03d..0113d34 100644 --- a/docs/build-from-source.md +++ b/docs/build-from-source.md @@ -35,8 +35,10 @@ CI tests Linux and macOS on amd64 and arm64. It relocates the staged executable resources, exercises all eight binding operations, installs a freshly generated Go module through a local proxy, and profiles its declarations through both Go command routes. Negative checks cover altered committed source, nonempty output directories, and invalid -declarations preserving existing profile output. The small extension fixture is checked in as -YAML under `testdata/ci/bindings/`; generated packages, archives, profiles, and module caches -remain temporary CI outputs. Homebrew and APT/RPM packaging live in -[`homebrew-tools`](https://github.com/runtimeconditions/homebrew-tools) and -[`packages`](https://github.com/runtimeconditions/packages). +declarations preserving existing profile output. Only Go is available on the smoke test's +subprocess PATH; Python is used by the CI harness, and is not a runtime dependency of Go +binding or profiling commands. + +The small extension fixture is checked in as YAML under `testdata/ci/bindings/`. Generated +packages, archives, profiles, and module caches remain temporary CI outputs. Homebrew/APT +packaging and optional profiler add-ons remain planned. diff --git a/docs/command-reference.md b/docs/command-reference.md deleted file mode 100644 index 583c90c..0000000 --- a/docs/command-reference.md +++ /dev/null @@ -1,18 +0,0 @@ -# Command reference - -The command table lives in the [README](../README.md#commands). This page has the full flag -lists and the binding-commands pointer. - -```sh -rc profile --help -rc profile go --help -rc profile go generate --help -rc bindings --help -``` - -## Binding commands - -`rc bindings` resolves, generates, and verifies extension bindings. The command group -provides `resolve`, `normalize`, `generate`, `verify`, `package`, `plan-release`, `check`, -and `update`. For schemas, flags, and local binding development, see -[docs/bindings.md](bindings.md). diff --git a/docs/generating-profiles.md b/docs/generating-profiles.md index 527a9ac..1bdc576 100644 --- a/docs/generating-profiles.md +++ b/docs/generating-profiles.md @@ -4,7 +4,8 @@ [README](../README.md#quickstart). `rc profile generate` reads the Go binding declarations in a workload and writes a validated -profile. It analyzes declarations statically and never runs your code. Three prerequisites: +profile. Profiling analyzes declarations without executing the workload. Resolve the +workload's Go binding dependencies before running these commands. Three prerequisites: 1. **A Go toolchain on `PATH`.** Without one, generation fails with `exec: "go": executable file not found in $PATH`. `rc` does not download Go for you. From 550d2e13b54b9fa68b00d2f22131f3af5b427e57 Mon Sep 17 00:00:00 2001 From: L Apple Date: Fri, 20 Nov 2026 00:13:06 +0100 Subject: [PATCH 07/19] docs(readme): link todos-api demo, split dense paragraphs into lists - Example scenario links the demo Todos API in rc-demos - Quickstart validate paragraph rewritten as short sentences - Install and Commands explanations converted to bullet lists Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe --- README.md | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index ede272f..094150c 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,8 @@ and **validates** profiles against the spec and the extensions it declares, whet profile was written by hand, by an agent, or by a profiler. The profile states the demand; platforms and adapters decide how to fulfill it. -**Example scenario:** Your service depends on a Todos API reachable at `TODOS_API_URL` and a +**Example scenario:** Your service depends on a [Todos API](https://github.com/runtimeconditions/rc-demos/tree/main/apps/todos-api) +reachable at `TODOS_API_URL` and a Redis cache at `REDIS_URL`. Today that knowledge lives in a wiki page or someone's head, and the platform team provisions from a guess. A Runtime Conditions Profile writes it down where the code lives: you declare the need once in your source, `rc profile generate` reads those @@ -40,10 +41,12 @@ sudo apt install rc-cli # Debian / Ubuntu sudo dnf install rc-cli # Fedora / RHEL ``` -Language profilers are separate add-ons: Go profiling is built into `rc`, so Go workloads -need nothing else. TypeScript, Java, and Python profilers install through their own channels -— see [Language profilers](docs/language-profilers.md). To build the CLI yourself, see -[Build from source](docs/build-from-source.md). +Also: + +- Language profilers are separate add-ons. Go profiling is built into `rc`, so Go workloads + need nothing else. TypeScript, Java, and Python profilers install through their own + channels — see [Language profilers](docs/language-profilers.md). +- To build the CLI yourself, see [Build from source](docs/build-from-source.md). ## Quickstart @@ -56,10 +59,10 @@ $ rc profile validate rc-demos/artifacts/request-logger-http.profile.yaml runtimeconditions: profile validated ``` -`rc profile validate` checks any profile against the core schema embedded in `rc` and the -definitions of the extensions it declares — downloaded from their `https` ids by default, or -read from local directories with `--catalog ` (repeatable). `-` reads the profile from -stdin. +`rc profile validate` checks a profile against the core schema embedded in `rc` and against +the definitions of the extensions it declares. By default those definitions are downloaded +from the `https` ids the profile names. Pass `--catalog ` (repeatable) to read them from +local directories instead. Use `-` to read the profile from stdin. ## Commands @@ -77,11 +80,12 @@ java missing python missing ``` -`go` is the profiler linked into `rc` — nothing extra to install. `missing` add-ons only -matter for workloads in that language; `rc plugins list --output yaml` prints each one's -install command. `rc version --output yaml` adds platform and linked-component details. -`rc --help` lists all commands; `rc completion ` prints a shell -completion script. +- `go` is the profiler linked into `rc` — nothing extra to install. +- `missing` add-ons only matter for workloads in that language; + `rc plugins list --output yaml` prints each one's install command. +- `rc version --output yaml` adds platform and linked-component details. +- `rc --help` lists all commands; `rc completion ` prints a shell + completion script. `rc profile` uses the built-in Go profiler by default; the same commands exist under `rc profile go` with identical flags: From e9afcba9b7e72e7be5381228cd886a0dcc4baa1d Mon Sep 17 00:00:00 2001 From: L Apple Date: Fri, 20 Nov 2026 00:18:10 +0100 Subject: [PATCH 08/19] docs(readme): dedupe Commands section Table now lists only the rc profile commands; version/plugins/completion are covered by the console examples and bullets above it. The --help block collapses to one line. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe --- README.md | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 094150c..bf0319f 100644 --- a/README.md +++ b/README.md @@ -97,18 +97,9 @@ python missing | `rc profile validate-extensions` | Validate all imported generated binding packages. Flag: `--dir`. | | `rc profile validate-extension` | Validate one imported binding package. Flags: `--dir`, `--package`. | | `rc profile version` | Show the linked Go profiler version. | -| `rc plugins list [--output yaml]` | Show the Go profiler and each add-on's status, version, and path. | -| `rc version [--output text\|yaml]` | Show CLI build information. `rc --version` prints the same one-liner. | -| `rc completion ` | Print a shell completion script. | -For full flag lists: - -```sh -rc profile --help -rc profile go --help -rc profile go generate --help -rc bindings --help -``` +Every command has `--help` for its full flag list, e.g. `rc profile go generate --help` and +`rc bindings --help`. ## Documentation From 6e100bc355cfc12a246f113e3be0242803534ac0 Mon Sep 17 00:00:00 2001 From: L Apple Date: Fri, 20 Nov 2026 00:42:28 +0100 Subject: [PATCH 09/19] docs(readme): clarify spec role, dedupe spec from ecosystem list The spec repo owns the profile schema (pinned + checksum-verified from its release assets at build time); state that once at the top link and drop the repeated spec bullet from the Ecosystem section. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe --- README.md | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index bf0319f..40cd80d 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,9 @@ can read the same file and fulfill the need. No re-explaining, no drift between reality. - Guide and concepts: -- Profile specification: +- Profile specification: — defines the profile + format. `rc` pins the spec's core schema (checksum-verified) at build time and validates + every profile against it. ## Install @@ -50,25 +52,30 @@ Also: ## Quickstart -The one hands-on step that works on a fresh install — validating an existing profile, not -creating one yet: +This works on a fresh install. It validates a committed demo profile; it does not create +one: ```console +# Check a profile against the core schema embedded in rc and the +# definitions of the extensions it declares: $ git clone https://github.com/runtimeconditions/rc-demos.git $ rc profile validate rc-demos/artifacts/request-logger-http.profile.yaml runtimeconditions: profile validated -``` -`rc profile validate` checks a profile against the core schema embedded in `rc` and against -the definitions of the extensions it declares. By default those definitions are downloaded -from the `https` ids the profile names. Pass `--catalog ` (repeatable) to read them from -local directories instead. Use `-` to read the profile from stdin. +# Definitions download from the https ids the profile names by default; +# use --catalog (repeatable) to read them from local directories: +$ rc profile validate profile.yaml --catalog ./my-extensions +# Use - to read the profile from stdin: +$ rc profile validate - < profile.yaml +``` ## Commands ```console $ rc --version rc v0.6.0 (a1b2c3d) +# rc version --output yaml adds platform and linked-component details: +$ rc version --output yaml ``` ```console @@ -78,14 +85,12 @@ go built-in v0.8.0 typescript missing java missing python missing +# --output yaml prints each missing add-on's install command: +$ rc plugins list --output yaml ``` - `go` is the profiler linked into `rc` — nothing extra to install. -- `missing` add-ons only matter for workloads in that language; - `rc plugins list --output yaml` prints each one's install command. -- `rc version --output yaml` adds platform and linked-component details. -- `rc --help` lists all commands; `rc completion ` prints a shell - completion script. +- `missing` add-ons only matter for workloads in that language. `rc profile` uses the built-in Go profiler by default; the same commands exist under `rc profile go` with identical flags: @@ -99,7 +104,8 @@ python missing | `rc profile version` | Show the linked Go profiler version. | Every command has `--help` for its full flag list, e.g. `rc profile go generate --help` and -`rc bindings --help`. +`rc bindings --help`. `rc completion ` prints a shell completion +script. ## Documentation @@ -110,7 +116,6 @@ Every command has `--help` for its full flag list, e.g. `rc profile go generate ## Ecosystem -- [spec](https://github.com/runtimeconditions/spec) — the profile specification and docs - [extensions](https://github.com/runtimeconditions/extensions) — first-party extensions and binding tooling - [rc-demos](https://github.com/runtimeconditions/rc-demos) — end-to-end demos with committed profiles - [go-rc-profiler](https://github.com/runtimeconditions/go-rc-profiler) — Go profiler, linked into `rc` From 55044250d9de5c9d4c2420f09a8e211e1f95a842 Mon Sep 17 00:00:00 2001 From: L Apple Date: Fri, 20 Nov 2026 00:48:02 +0100 Subject: [PATCH 10/19] docs(readme): make Commands section self-explanatory Lead-in labels the console blocks as install-check demos; the table is now the full command list (version, plugins list, completion rows restored); bullets only interpret output. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe --- README.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 40cd80d..acc8507 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,8 @@ $ rc profile validate - < profile.yaml ## Commands +Check the install — real output: + ```console $ rc --version rc v0.6.0 (a1b2c3d) @@ -93,7 +95,7 @@ $ rc plugins list --output yaml - `missing` add-ons only matter for workloads in that language. `rc profile` uses the built-in Go profiler by default; the same commands exist under -`rc profile go` with identical flags: +`rc profile go` with identical flags. Full command list: | Command | Purpose | | --- | --- | @@ -102,10 +104,12 @@ $ rc plugins list --output yaml | `rc profile validate-extensions` | Validate all imported generated binding packages. Flag: `--dir`. | | `rc profile validate-extension` | Validate one imported binding package. Flags: `--dir`, `--package`. | | `rc profile version` | Show the linked Go profiler version. | +| `rc plugins list [--output yaml]` | Show the Go profiler and each add-on's status, version, and path. | +| `rc version [--output text\|yaml]` | Show CLI build information. `rc --version` prints the same one-liner. | +| `rc completion ` | Print a shell completion script. | Every command has `--help` for its full flag list, e.g. `rc profile go generate --help` and -`rc bindings --help`. `rc completion ` prints a shell completion -script. +`rc bindings --help`. ## Documentation From 2002e53775ed85354a865201e00378b6fbbd0fe9 Mon Sep 17 00:00:00 2001 From: somethings Date: Fri, 20 Nov 2026 00:52:02 +0100 Subject: [PATCH 11/19] Update README.md --- README.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index acc8507..5ababb0 100644 --- a/README.md +++ b/README.md @@ -53,17 +53,19 @@ Also: ## Quickstart This works on a fresh install. It validates a committed demo profile; it does not create -one: +one. + +Check a profile against the core schema embedded in rc and the definitions of the extensions it declares: ```console -# Check a profile against the core schema embedded in rc and the -# definitions of the extensions it declares: $ git clone https://github.com/runtimeconditions/rc-demos.git $ rc profile validate rc-demos/artifacts/request-logger-http.profile.yaml runtimeconditions: profile validated +``` -# Definitions download from the https ids the profile names by default; -# use --catalog (repeatable) to read them from local directories: +Definitions download from the https ids the profile names by default. Use `--catalog ` (repeatable) to read them from local directories: + +```console $ rc profile validate profile.yaml --catalog ./my-extensions # Use - to read the profile from stdin: $ rc profile validate - < profile.yaml @@ -71,7 +73,7 @@ $ rc profile validate - < profile.yaml ## Commands -Check the install — real output: +Verify the install: ```console $ rc --version @@ -91,7 +93,7 @@ python missing $ rc plugins list --output yaml ``` -- `go` is the profiler linked into `rc` — nothing extra to install. +- `go` is the profiler linked into `rc`; nothing extra to install. - `missing` add-ons only matter for workloads in that language. `rc profile` uses the built-in Go profiler by default; the same commands exist under From d8afa94d9edac10640def27734c80ef2550a9518 Mon Sep 17 00:00:00 2001 From: somethings Date: Fri, 20 Nov 2026 01:05:52 +0100 Subject: [PATCH 12/19] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5ababb0..bc49799 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ can read the same file and fulfill the need. No re-explaining, no drift between reality. - Guide and concepts: -- Profile specification: — defines the profile +- Profile specification: defines the profile format. `rc` pins the spec's core schema (checksum-verified) at build time and validates every profile against it. @@ -47,7 +47,7 @@ Also: - Language profilers are separate add-ons. Go profiling is built into `rc`, so Go workloads need nothing else. TypeScript, Java, and Python profilers install through their own - channels — see [Language profilers](docs/language-profilers.md). + channels; see [Language profilers](docs/language-profilers.md). - To build the CLI yourself, see [Build from source](docs/build-from-source.md). ## Quickstart From d209c3cc4c084ade0ee773e4a1cdfa39250d6c14 Mon Sep 17 00:00:00 2001 From: L Apple Date: Fri, 20 Nov 2026 01:03:03 +0100 Subject: [PATCH 13/19] docs(readme): explain how each ecosystem repo connects to the CLI Ecosystem list now states the relationship per repo (linked library, compiled-in module, PATH add-ons, demos, distribution channels) and labels ebpf-rc-profiler as legacy/experimental per its own README. Also: Commands lead-in simplified to "Verify the install:". Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe --- README.md | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index bc49799..e39711a 100644 --- a/README.md +++ b/README.md @@ -122,13 +122,27 @@ Every command has `--help` for its full flag list, e.g. `rc profile go generate ## Ecosystem -- [extensions](https://github.com/runtimeconditions/extensions) — first-party extensions and binding tooling -- [rc-demos](https://github.com/runtimeconditions/rc-demos) — end-to-end demos with committed profiles -- [go-rc-profiler](https://github.com/runtimeconditions/go-rc-profiler) — Go profiler, linked into `rc` -- [ts-rc-profiler](https://github.com/runtimeconditions/ts-rc-profiler), [java-rc-profiler](https://github.com/runtimeconditions/java-rc-profiler), [python-rc-profiler](https://github.com/runtimeconditions/python-rc-profiler) — language add-ons -- [ebpf-rc-profiler](https://github.com/runtimeconditions/ebpf-rc-profiler) — infers dependencies from syscall/network traffic instead of bindings -- [backstage-plugin](https://github.com/runtimeconditions/backstage-plugin) — Backstage plugin for profiles -- [homebrew-tools](https://github.com/runtimeconditions/homebrew-tools), [packages](https://github.com/runtimeconditions/packages) — Homebrew tap and apt/dnf/yum source +Independently versioned repos around `rc-cli`. How each connects to the CLI: + +- [extensions](https://github.com/runtimeconditions/extensions) — `rc bindings` calls its + tooling as a library pinned to an exact commit in `distribution/components.lock.yaml` +- [go-rc-profiler](https://github.com/runtimeconditions/go-rc-profiler) — compiled into `rc` + as a Go module, so Go profiling needs no separate install +- [ts-rc-profiler](https://github.com/runtimeconditions/ts-rc-profiler), + [java-rc-profiler](https://github.com/runtimeconditions/java-rc-profiler), + [python-rc-profiler](https://github.com/runtimeconditions/python-rc-profiler) — add-ons + that `rc` finds on `PATH` and runs via `rc profile ...` (see + [Language profilers](docs/language-profilers.md)) +- [rc-demos](https://github.com/runtimeconditions/rc-demos) — demos with committed profiles; + the [quickstart](#quickstart) validates one of them +- [backstage-plugin](https://github.com/runtimeconditions/backstage-plugin) — consumes + profiles in Backstage; independent of `rc` +- [ebpf-rc-profiler](https://github.com/runtimeconditions/ebpf-rc-profiler) — legacy, + experimental eBPF prototype (watches syscalls/network traffic); kept for reference, not + wired into `rc` +- [homebrew-tools](https://github.com/runtimeconditions/homebrew-tools) and + [packages](https://github.com/runtimeconditions/packages) — distribution channels that + ship `rc` itself: the Homebrew tap and the apt/dnf/yum source ## Contributing From 07bdc7c2c423c2ee3642648f6245dbee70a2bff4 Mon Sep 17 00:00:00 2001 From: somethings Date: Fri, 20 Nov 2026 18:35:10 +0100 Subject: [PATCH 14/19] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e39711a..87c4a2d 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ platforms and adapters decide how to fulfill it. **Example scenario:** Your service depends on a [Todos API](https://github.com/runtimeconditions/rc-demos/tree/main/apps/todos-api) reachable at `TODOS_API_URL` and a Redis cache at `REDIS_URL`. Today that knowledge lives in a wiki page or someone's head, and -the platform team provisions from a guess. A Runtime Conditions Profile writes it down where +the platform team provisions based on often incomplete or outdated information. A Runtime Conditions Profile writes it down where the code lives: you declare the need once in your source, `rc profile generate` reads those declarations and emits the profile as YAML, and `rc profile validate` checks the profile is well-formed and matches the extensions it uses. Then Kratix, Crossplane, Radius, or Backstage From 32649a627533ba9448b62bbeca5a4b12b838062b Mon Sep 17 00:00:00 2001 From: somethings Date: Fri, 20 Nov 2026 18:59:22 +0100 Subject: [PATCH 15/19] Update language-profilers.md --- docs/language-profilers.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/docs/language-profilers.md b/docs/language-profilers.md index dccc857..24eb957 100644 --- a/docs/language-profilers.md +++ b/docs/language-profilers.md @@ -4,14 +4,13 @@ Go profiling is built into `rc`. Other languages run a separate add-on that `rc` `PATH`. It can come from the language's own tooling or from a system package, and `rc` does not care which: -- **TypeScript:** `npm install --global @runtimeconditions/typescript-profiler`, or - `brew install runtimeconditions/tools/rc-profiler-typescript`. -- **Java:** download the launcher `rc-profiler-java` from the - [releases](https://github.com/runtimeconditions/java-rc-profiler/releases) of - `runtimeconditions/java-rc-profiler` and put it on `PATH`, or - `brew install runtimeconditions/tools/rc-profiler-java`. +- **TypeScript:** `brew install runtimeconditions/tools/rc-profiler-typescript`, + `apt install rc-profiler-typescript` (Debian/Ubuntu), or `dnf`/`yum install rc-profiler-typescript` + (Fedora/RHEL). apt/dnf/yum need the [package source setup](../README.md#install) first. +- **Java:** `brew install runtimeconditions/tools/rc-profiler-java`, + `apt install rc-profiler-java`, or `dnf`/`yum install rc-profiler-java`. - **Python:** `pip install runtimeconditions-profiler` into the workload's own virtual - environment — it finds binding packages through that environment's metadata — and put the + environment (it finds binding packages through that environment's metadata) and put the environment's `bin` directory on `PATH`. Do not use `pipx`, which would give it an environment of its own. From a3738a25db126c0564e37999d5f92558d8966e62 Mon Sep 17 00:00:00 2001 From: somethings Date: Fri, 20 Nov 2026 19:11:05 +0100 Subject: [PATCH 16/19] Update generating-profiles.md --- docs/generating-profiles.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/generating-profiles.md b/docs/generating-profiles.md index 1bdc576..db65151 100644 --- a/docs/generating-profiles.md +++ b/docs/generating-profiles.md @@ -1,7 +1,10 @@ # Generating a profile `rc profile generate` and its prerequisites, in detail. For the one-step quickstart see the -[README](../README.md#quickstart). +[README](../README.md#quickstart). + +This page covers Go, the profiler built into `rc`; TypeScript, Java, and Python workloads use add-on profilers instead. See +[Language profilers](language-profilers.md). `rc profile generate` reads the Go binding declarations in a workload and writes a validated profile. Profiling analyzes declarations without executing the workload. Resolve the From bbaf27ff22f2a64f3c288d0e88c9d70a5a48128d Mon Sep 17 00:00:00 2001 From: somethings Date: Fri, 20 Nov 2026 21:10:00 +0100 Subject: [PATCH 17/19] Update generating-profiles.md --- docs/generating-profiles.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/docs/generating-profiles.md b/docs/generating-profiles.md index db65151..30fd882 100644 --- a/docs/generating-profiles.md +++ b/docs/generating-profiles.md @@ -10,20 +10,18 @@ This page covers Go, the profiler built into `rc`; TypeScript, Java, and Python profile. Profiling analyzes declarations without executing the workload. Resolve the workload's Go binding dependencies before running these commands. Three prerequisites: -1. **A Go toolchain on `PATH`.** Without one, generation fails with +1. A Go toolchain on `PATH`. Without one, generation fails with `exec: "go": executable file not found in $PATH`. `rc` does not download Go for you. -2. **`--dir` must point at a directory containing a `go.mod`.** Current releases fail fast: +2. `--dir` must point at a directory containing a `go.mod`. Current releases fail fast: ```text rc: /path/to/dir: workload must have a go.mod: stat /path/to/dir/go.mod: no such file or directory ``` - Older releases (for example the Homebrew v0.6.0 build) fell back to GOPATH mode and scanned - your entire home directory, spraying `operation not permitted` errors for TCC-protected - paths. Always point `--dir` at a Go module. -3. **The workload must import published RC binding modules** (`runtimeconditions.io/x/rc/...`). - Bindings wired with `go.mod` `replace` directives to a local clone are rejected **by - design**: + Always point `--dir` at a Go module. +3. The workload must import published RC binding modules (`runtimeconditions.io/x/rc/...`). + Bindings wired with `go.mod` `replace` directives to a local clone are rejected by + design: ```text rc: github.com/runtimeconditions/extensions/catalog/rc/common-integrations/go uses a go.mod replace; generated bindings must resolve to a published module version From 9f8cea5b923de30444355f6838c6469d97b5489d Mon Sep 17 00:00:00 2001 From: somethings Date: Fri, 20 Nov 2026 21:25:05 +0100 Subject: [PATCH 18/19] Update generating-profiles.md --- docs/generating-profiles.md | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/docs/generating-profiles.md b/docs/generating-profiles.md index 30fd882..519c8cd 100644 --- a/docs/generating-profiles.md +++ b/docs/generating-profiles.md @@ -20,16 +20,6 @@ workload's Go binding dependencies before running these commands. Three prerequi Always point `--dir` at a Go module. 3. The workload must import published RC binding modules (`runtimeconditions.io/x/rc/...`). - Bindings wired with `go.mod` `replace` directives to a local clone are rejected by - design: - - ```text - rc: github.com/runtimeconditions/extensions/catalog/rc/common-integrations/go uses a go.mod replace; generated bindings must resolve to a published module version - ``` - - This is why a fresh clone of `rc-demos/apps/request-logger-http` cannot be generated: its - `go.mod` replaces the binding modules with a sibling checkout of `extensions`. Generate - from a module that requires the published versions instead. ## Example workload From e4af7dd457642e5884364c8d185d3b3bf0e6f784 Mon Sep 17 00:00:00 2001 From: somethings Date: Fri, 20 Nov 2026 21:37:34 +0100 Subject: [PATCH 19/19] Update generating-profiles.md --- docs/generating-profiles.md | 8 -------- 1 file changed, 8 deletions(-) diff --git a/docs/generating-profiles.md b/docs/generating-profiles.md index 519c8cd..386b85e 100644 --- a/docs/generating-profiles.md +++ b/docs/generating-profiles.md @@ -93,14 +93,6 @@ rc profile generate \ --out profile.yaml ``` -**Verified status today:** a workload importing only `runtimeconditions.io/x/rc/common@v0.3.0` -generates a profile that passes `rc profile validate`, end to end. Adding -`runtimeconditions.io/x/rc/env@v0.3.0` currently fails dependency artifact verification with: - -```text -rc: runtimeconditions.io/x/rc/env dependency runtimeconditions.io/x/rc/common: dependency Go module archive SHA-256 mismatch -``` - The published-module pattern above is the supported direction; treat that error as a known gap in the current published `env` release, not as a mistake in your workload.