Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 38 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Notable changes, newest first. Release notes on GitHub list every commit;
this file collects what users and scripts need to know.

## Unreleased
## 0.22.0 (2026-11-04)

### New

Expand All @@ -20,12 +20,49 @@ this file collects what users and scripts need to know.
- Shell completion offers the allowed values of `-o`, `auth token
--audience`, `langsync init --seed` and `backup datasources update
--region`.
- Norcube Monitor (formerly PulseCheck) commands: `norcube monitor`
covers every operation of the Norcube Monitor API an organization
member has.
- `monitor status` shows open incidents, monitors by status and every
monitor that needs attention; `--fail-on critical` (or `warning`)
fails a CI job while such an incident is open.
- `monitors list | get | create | update | delete | pause | resume`,
with typed flags per type (`--type http | keyword | ssl | domain`) or
the API's JSON body with `--from-file`; secret header values only from
a file or stdin (`--secret-headers-file`). Monitors are named by id or
exact name.
- `monitors run <monitor>` runs a check now; with `--wait` a critical or
inconclusive result (or a warning with `--fail-on warning`) exits 1
with `job_failed`, for deploy pipelines.
- `monitors bulk pause | resume | delete` by ids, a file, or the list
filters, in batches of 100.
- `monitors results list`, `status-changes list` (alias `history`),
`stats get`, `availability get`, `certificate get`, `alerts get | set`.
- `incidents list` (every API filter), `get` (timeline and alerts),
`acknowledge` (alias `ack`), `summary`.
- `channels list | get | create | update | delete | test | verify` and
`channels deliveries list`. A webhook's signing secret is written to
`--secret-file` and never printed; Slack and Discord URLs are read
from a file or stdin; `verify` asks for the code on a terminal or
reads it with `--code-file`.
- Completion for monitor, channel and incident ids; `nrc api monitor`
and `auth token --audience monitor`; CI tokens with the
`monitor.read`, `monitor.check`, `monitor.write` and
`monitor.channels` scopes (alert channels need the last one;
`monitor.write` doesn't include it).
- Errors of services that answer RFC 9457 problems (Norcube Monitor) show
the problem's detail and invalid fields, and `-o json` errors carry its
`reason`, field `errors` and `data` in `details`.

### Changes for scripts

- The `norcube commands` document is a contract: within `schemaVersion` 1
fields, values and commands are only ever added. A breaking change
bumps `schemaVersion`.
- New error code `unhealthy` (exit 1): `monitor status --fail-on`
found what it was told to fail on; `details` holds the report.
- `--endpoint-url`, `NORCUBE_MONITOR_URL` and the `endpoints` table of
a profile accept the new service key `monitor`.

## 0.21.4 (2026-10-30)

Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ What it's best at: proving you're never locked in to Norcube Backup. `norcube ba

<sub>Scripted demo with sanitized names: whoami, Backup health, scripting with `-o json --query`, any endpoint with `norcube api`, and your CLI sessions. The tape and stub live in [`demo/`](demo/).</sub>

> **Status**: pre-1.0. Norcube Backup (data sources, backups on demand and downloads, restores, restore tests and their settings, health, policies), LangSync (namespaces, terms, translations, languages, prompts, glossary, API keys, CSV import, audit log, project sync), DomainRadar (domain checks, bulk checks, saved domains, brand monitoring, name generation), Billing (status, subscriptions, usage, invoices, spending caps), organizations, profiles, and `norcube api` for everything else. See the [changelog](CHANGELOG.md).
> **Status**: pre-1.0. Norcube Backup (data sources, backups on demand and downloads, restores, restore tests and their settings, health, policies), LangSync (namespaces, terms, translations, languages, prompts, glossary, API keys, CSV import, audit log, project sync), DomainRadar (domain checks, bulk checks, saved domains, brand monitoring, name generation), Norcube Monitor (uptime, SSL and domain expiry monitors, check history, incidents, alert channels, a CI status gate), Billing (status, subscriptions, usage, invoices, spending caps), organizations, profiles, and `norcube api` for everything else. See the [changelog](CHANGELOG.md).

## Install

Expand Down Expand Up @@ -169,6 +169,7 @@ norcube backup jobs list # every backup job in the organization
norcube backup health # which backups actually restore
norcube langsync namespaces list # LangSync namespaces
norcube domainradar check acme.dev # is a domain free?
norcube monitor status # open incidents and monitors that need attention
norcube billing usage estimate # this month's charges so far
norcube doctor # something not working? start here
```
Expand Down
6 changes: 3 additions & 3 deletions docs/ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ maps them to stable codes and exit codes.
| `internal/clierr` | Error codes, exit codes and the JSON error shape. |
| `internal/completion` | Dynamic shell completion with a one-second budget and a one-minute cache. |
| `internal/orgs` | Organization slug resolution and its cache. |
| `internal/api/<service>` | Generated clients. Never edit `*.gen.go`; run `make codegen`. |
| `internal/api/<service>` | Generated clients. Never edit `*.gen.go`; run `make codegen`. `internal/api/apierror` turns any error response (the `{type, msg}` shape and RFC 9457 problems) into a `clierr.Error`. |

`internal/cli/commands.go` is `nrc commands`: it walks the cobra tree and
prints the machine-readable command tree (schema in
Expand Down Expand Up @@ -126,7 +126,7 @@ secrets and the one-time setup.
help text and an effect, nothing writes to stdout outside the result
path, and no two sibling commands share a name or alias.
`commands_test.go` pins the `nrc commands` schema (golden
`commands-billing.*`) and checks that it lists every visible command,
sorted, offline.
`commands-billing.*`; `commands-monitor.json` pins a whole product
group) and checks that it lists every visible command, sorted, offline.
- `go test -race ./...`, `go vet` and golangci-lint (pinned in CI) must
pass.
53 changes: 30 additions & 23 deletions docs/DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ stale; either way, fix one of them in the same change.

One open-source (Apache 2.0) binary that drives every Norcube product
from a terminal, a script or a CI job: Norcube Backup, LangSync,
DomainRadar, Billing and the platform itself (sign-in, organizations,
CLI sessions, CI tokens). It is a client of the products' public HTTP
DomainRadar, Norcube Monitor, Billing and the platform itself (sign-in,
organizations, CLI sessions, CI tokens). It is a client of the products' public HTTP
APIs and nothing else: it holds no business logic the API does not have,
and every typed client in it is generated from the backend's Swagger
specs.
Expand Down Expand Up @@ -113,6 +113,9 @@ meaning across the tree:
| `pause` / `resume` | Stop and restart a schedule without deleting it | `backup datasources pause`, `backup policies resume` |
| `download` / `export` | Write server data to a file or stdout | `backup jobs download`, `billing invoices download`, `domainradar bulk export` |
| `sync` / `pull` / `init` | LangSync project files | `langsync sync` |
| `acknowledge` | Mark something as being handled without changing it otherwise | `monitor incidents acknowledge` (alias `ack`) |
| `verify` | Confirm a contact with a code sent to it | `monitor channels verify` |
| `summary` | Counts over a whole resource, not a list | `monitor incidents summary` |
| `cancel`, `watch`, `results`, `status`, `check`, `generate`, `import`, `set`, `revoke`, `use` | As named | `domainradar bulk watch`, `langsync terms import status` |

`rm` is an alias of `remove` only, never of `delete`.
Expand Down Expand Up @@ -196,7 +199,7 @@ exit codes may not.
| Exit | Codes | Meaning |
| --- | --- | --- |
| 0 | | Success |
| 1 | `error`, `server_error`, `job_failed` | General failure; a waited-for job ended unsuccessfully (`details` holds the job) |
| 1 | `error`, `server_error`, `job_failed`, `unhealthy` | General failure; a waited-for job ended unsuccessfully (`details` holds the job); a `--fail-on` state was found (`monitor status`, `details` holds the report) |
| 2 | `usage_error`, `validation_failed`, `org_not_found` | Fix the command line or input; also any prompt without a terminal |
| 3 | `not_found` | The API answered 404 |
| 4 | `login_required` | Not signed in, session expired or revoked, CI token expired, revoked or unknown |
Expand Down Expand Up @@ -368,7 +371,8 @@ is declared where the command is defined, with the annotations of P13.
**Enforced.** `TestEveryCommandHasAnExample`, `TestHelpTextIsComplete`
and `TestEveryCommandDeclaresAnEffect` in
[`contract_test.go`](../internal/cli/contract_test.go); the schema golden
`commands-billing.*` and the tree tests in
`commands-billing.*` (and `commands-monitor.json` for a whole product
group) and the tree tests in
[`commands_test.go`](../internal/cli/commands_test.go) (every visible
command listed, hidden ones only with `--all`, sorted output, offline);
the [`docs-reference`](../.github/workflows/docs-reference.yaml) workflow
Expand Down Expand Up @@ -573,8 +577,8 @@ generated package). Each entry gives:
| `spec`, `package` | `make codegen` input and output |

Today the registry holds Auth, the web app, Backup (`snapdb`), LangSync,
DomainRadar, Billing and PromptHub (callable with `nrc api`, no command
group yet).
DomainRadar, Billing, Norcube Monitor (`monitor`) and PromptHub (callable
with `nrc api`, no command group yet).

Not yet derived from the registry, and therefore also edited by hand when
a service is added: the per-service fields and `switch` statements of
Expand Down Expand Up @@ -709,7 +713,7 @@ or the field is left out. The stability rule is in P9.

---

## 4. Feature inventory (v0.21.4)
## 4. Feature inventory (v0.21.4, plus Unreleased)

What exists, per command group. The [command
reference](https://docs.norcube.com/platform/cli-reference) has every
Expand All @@ -722,14 +726,19 @@ flag; [CHANGELOG.md](../CHANGELOG.md) says when each arrived.
| `langsync` | `init`, `sync`, `pull`; `namespaces list | create | update | delete`; `terms list | add | update | delete | import`, `terms import status`; `translations get | set | suggest | translate-missing`; `languages list | add | remove | create | delete`; `prompts list | get | create | update | delete`; `glossary get`, `glossary items list | get | create | translate | delete`, `glossary languages attach`; `api-keys list | create | revoke`; `audit list` |
| `domainradar` | `check`; `bulk create | list | get | results | watch | export | cancel | delete`; `saved list | add | remove`; `watchers list | get | create | update | delete`; `hits list | get`; `names generate | list | get | results | check | delete` |
| `billing` | `status`; `subscriptions list`; `usage estimate | metrics`; `invoices list | download`; `budget get | set` |
| `monitor` | `status` (`--fail-on`); `monitors list | get | create | update | delete | pause | resume | run` (`--wait`), `monitors bulk pause | resume | delete`, `monitors results list`, `monitors status-changes list`, `monitors stats get`, `monitors availability get`, `monitors certificate get`, `monitors alerts get | set`; `incidents list | get | acknowledge | summary`; `channels list | get | create | update | delete | test | verify`, `channels deliveries list` |
| PromptHub | No command group; `nrc api prompthub ...` |
| CMS, PulseCheck | None (CMS has no public API; PulseCheck is not in the registry yet, section 6.1) |
| CMS | None (CMS has no public API) |

CI token scopes, as defined by Norcube Auth and listed by
`nrc auth ci-token scopes`: `backup.read`, `backup.write` (run backups
now), `backup.verify` (restore tests), `domainradar.check`,
`langsync.read`, `langsync.sync`, `langsync.write`, `billing.read`,
`cms.read`, `cms.write`.
`cms.read`, `cms.write`, `monitor.read`, `monitor.check` (run a
monitor's check now), `monitor.write` (manage monitors, alert routing,
acknowledge incidents), `monitor.channels` (manage alert channels, test
sends and verification codes; not included in `monitor.write`, because
channels hold credentials and sends cost money).

Installation channels: Homebrew cask (with `nrc`), `.deb` / `.rpm` /
`.apk`, `install.sh`, release archives (darwin and linux amd64/arm64,
Expand Down Expand Up @@ -774,7 +783,9 @@ changelog, and the owner's decisions in the planning sessions of
| 2026-10-29 | The CLI becomes a first-party OAuth client of Norcube Auth (PKCE, scoped logins, Connected apps, revocation) | Owner: "i want the proper way". Rejected: scopes on today's CLI sessions, which keeps the refresh token passing through dashboard JavaScript and three token models | owner |
| 2026-10-30 | Pin the Go toolchain, check `go mod tidy`, run govulncheck in CI with documented acceptances | Releases had been built with a Go patch with reachable stdlib advisories | 3b2e964 (v0.21.4) |
| 2026-10-30 | Engineering reviews are written down as reports and fixed in separate, deliberate changes, not by automatic fix agents | Owner's instruction | owner |
| 2026-11-04 | Norcube Monitor in the CLI. Monitors and channels are named by id or exact name (a name matching several is a usage error, never a guess); sub-resources of a monitor are nested resources with standard verbs (`monitors results list`, `monitors stats get`) rather than new verbs; `monitors run --wait` makes the synchronous check's verdict the exit code (`job_failed` on critical or inconclusive, `--fail-on warning`); `monitor status --fail-on` exits 1 with the new code `unhealthy` and prints the report either way (default `none`); bulk actions are their own subgroup (`monitors bulk ...`) so one command's output shape never depends on how many ids it got; a webhook's signing secret is written to `--secret-file` and never printed, Slack and Discord URLs and secret headers come from files or stdin; `output.Object.Text` keeps `-o text` columns fixed for objects whose fields depend on the resource; RFC 9457 problems (`code`, `reason`, `errors`) are parsed by the shared error formatter. No short alias: no product has an abbreviation, and P13 asks for one name. Alert channels get their own scope (`monitor.channels`), granted explicitly and not implied by `monitor.write` (owner: "everything should be well scoped") | Owner's brief: every Norcube Monitor operation, robust, scriptable. Rejected: `--wait` polling a check that is already synchronous; printing the webhook secret once like a CI token (the owner asked that webhook secrets never be printed); `monitors pause a b c` switching to the bulk endpoint and its shape with two or more ids | owner |
| 2026-11-04 | `nrc commands`: the whole command tree as one versioned, offline document; what the tree cannot reveal is declared with annotations (`effect`, flag enums, service), never inferred from verbs | Agents should not crawl dozens of `--help` pages. Prior art: `kubectl api-resources` / `explain` (verbs per resource, offline schema), `aws ... --generate-cli-skeleton` (machine-readable input), cobra's doc generation (`tools/gendocs` already walks the tree). Global flags listed once rather than on every command, to keep the document small; a verb-based guess of the effect was rejected because domain verbs like `check`, `suggest` or `init` don't say whether they change anything | owner |
| 2026-11-04 | PulseCheck is renamed Norcube Monitor before its first release, every technical name included: command group `monitor` (`nrc monitor monitors list`), registry key, OAuth audience and generated package `monitor`, scopes `monitor.read`, `monitor.check`, `monitor.write`, `monitor.channels`, endpoint `https://monitor.api.norcube.com/app/v1`, `NORCUBE_MONITOR_URL`. No `pulsecheck` alias or `cmdutil.Renamed` entry | The old name was never in a release, so no script, config file or token depends on it and P10 has nothing to keep; the backend renamed its service, audience and scopes in the same change. Rejected: keeping `pulsecheck` as a hidden alias, which would be a second name for one thing (P13) with no user to serve | owner |

---

Expand Down Expand Up @@ -845,21 +856,17 @@ it with the same guarantees as every other product. The steps, in order:
add the product there.
14. **Changelog** under `## Unreleased`, then release (section 6.6).

**Worked example: PulseCheck (state on 2026-11-03).**
**Worked example: Norcube Monitor (state on 2026-11-04).**

| Step | State |
| --- | --- |
| 1 Audience | `pulsecheck` exists in Norcube Auth (in the sign-in audience list; the dashboard token endpoint mints it on staging, not yet in production) |
| 2 Scopes | None. Norcube Auth's comment: "PulseCheck ... has no OAuth scopes yet: only a full sign-in reaches it"; PulseCheck refuses every scoped token |
| 3 Enforcement | Refuses scoped tokens outright; needs a route-to-scope table once scopes exist |
| 4 Contract | Swagger with `@Id` annotations exists in the service |
| 5 to 10 CLI | Not started: no registry entry, client, commands or tests |
| 11 MCP | No tools |
| 12 to 14 | No CLI docs, no website mention, no changelog entry |

The smallest useful first step is step 5 alone (registry entry plus
production endpoint), which makes `nrc api pulsecheck ...` work for
signed-in people; CI use waits for steps 2 and 3.
| 1 Audience | `monitor` exists in Norcube Auth (sign-in audience list, CI token exchange) |
| 2 Scopes | `monitor.read`, `monitor.check`, `monitor.write`, `monitor.channels` in the CI token catalog (and so the CLI sign-in catalog), with IAM actions; channel changes and sends only with `monitor.channels`, which `monitor.write` doesn't include; not on the MCP consent screen until the MCP redesign |
| 3 Enforcement | Default-closed route table (`internal/routers/app/scopes.go`) after the token middleware, coverage and matrix tests, and IAM refusing a scoped request the table never checked |
| 4 Contract | Every operation has a verb-noun `@Id`, `@Security Bearer`, 401/403 problems and `x-norcube-scopes`; the status route is tagged `Status` and excluded here |
| 5 to 10 CLI | Registry entry, hand-kept tables, client, `nrc monitor` commands, completion, command and golden tests |
| 11 MCP | No tools yet |
| 12 to 14 | Changelog entry; the product's CLI guide page and the website mention are still to write |

### 6.2 Adding a command

Expand Down Expand Up @@ -1054,8 +1061,8 @@ observable contract and will be announced in the changelog.
- **First-party OAuth sign-in** (P12): in development; scoped logins
(`nrc login --scopes`), Connected apps, RFC 7009 revocation; the current
exchange endpoint retires two releases after it ships.
- **PulseCheck** (section 6.1 table): scopes and enforcement in the
backend, then the registry entry, client and commands.
- **Norcube Monitor**: a docs guide page (`/monitor/cli`), the website
demo, MCP tools (section 6.1 table).
- **Coverage still missing in the CLI:** organization members and IAM
(`org members ...`), Backup destinations beyond `list`, notifications
and audit, resumable downloads, PromptHub commands.
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ require (
github.com/creativeprojects/go-selfupdate v1.5.2
github.com/getkin/kin-openapi v0.138.0
github.com/gofrs/flock v0.13.0
github.com/google/uuid v1.6.0
github.com/jmespath-community/go-jmespath v1.1.1
github.com/oapi-codegen/runtime v1.4.0
github.com/pelletier/go-toml/v2 v2.3.1
Expand Down Expand Up @@ -49,7 +50,6 @@ require (
github.com/godbus/dbus/v5 v5.2.2 // indirect
github.com/google/go-github/v74 v74.0.0 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-retryablehttp v0.7.8 // indirect
github.com/hashicorp/go-version v1.8.0 // indirect
Expand Down
Loading
Loading