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
58 changes: 58 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,64 @@
Notable changes, newest first. Release notes on GitHub list every commit;
this file collects what users and scripts need to know.

## 0.25.0 (2026-11-06)

### New

- Norcube Monitor maintenance windows: `monitor maintenance list | get | create |
update | cancel | finish`. A window pauses alerts for its monitors, stays out
of their uptime, shows on every published status page displaying a target and
mails subscribers when it is scheduled, starts and finishes, unless you pass
`--notify-scheduled=false` and so on, or `--no-notify` for all three.
- `--start` and `--end` take an RFC 3339 timestamp, `now` or a span from now
(`+2h`, `+7d`). A bare `2h` is refused, because `--since` reads that as two
hours ago. `--duration` takes `15m`, `2h` or `7d`.
- Wrap a deploy: `id=$(nrc monitor maintenance create --monitor api --title
"Deploy" --duration 15m -o id)`, deploy, `nrc monitor maintenance finish
"$id"`. A window ends by itself if the deploy dies first.
- `cancel` takes a scheduled window and confirms (`--yes`); `finish` takes one
in progress and doesn't ask. Each one's refusal exits 8 and names the other.
- CI tokens change windows with the new `monitor.maintenance` scope, which no
other scope includes, and need `monitor.statuspages` too when a window shows
on a published page; a refusal names the page. `cancel` and `finish` need
only `monitor.maintenance`. Any Norcube Monitor scope reads them.
- The API's delete has no command: it takes only cancelled windows, and `nrc
api` reaches it, as it does the list of what a window could target.
- `-o id` prints only a result's id, one per line for a list, for capturing it in
a script. A result without an id is a usage error.

### Changes

- `monitor status` shows monitors whose problem a maintenance window holds under
"In maintenance" instead of "Problems", and doesn't count their incidents
towards the verdict or `--fail-on`. A certificate or domain running out isn't
held and stays a problem.
- `monitors run` says when a maintenance window holds the monitor. `--wait` still
fails on a critical result: it is there to tell whether the deploy worked.
- `monitors list` and `get` show until when a window holds a monitor, and
`incidents summary` how many open incidents are held.
- Refreshed the Norcube Monitor client and spec for maintenance windows and the
summary of each status page in the page list. The summary has no command yet;
`monitor status-pages list -o json` shows it.

### Changes for scripts

- The `-o` values and `nrc commands` `outputFormats` gain `id`.
- `monitor status` JSON and YAML: new `maintenance` list; a monitor whose problem
a window holds moves there from `problems`. `incidents.open` gains
`inMaintenance`, and the API leaves held incidents out of its other counts.
- `monitor status` `-o text`: two new columns at the end, the number of held
incidents and the monitors in maintenance.
- `monitors list` and `get` `-o text`: a new column at the end, the end of the
window holding the monitor. JSON and YAML: `maintenance` while one does.
- `monitors run` JSON, YAML and `job_failed` details: new `inMaintenance`.
`-o text`: a new column at the end, `yes` or `no`.
- `incidents summary` `-o text`: a new column at the end, the held incidents.
- From the API, additively: `monitors stats get`, `monitors availability get` and
results gain `maintenance` counts and `maintenanceMinutes`, incidents
`maintenanceHeld`, status changes `maintenanceWindowId`, and incident timelines
the event type `maintenance_hold`.

## 0.24.0 (2026-11-05)

### New
Expand Down
2 changes: 1 addition & 1 deletion docs/ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ cmd/norcube main: signals, exit codes, error rendering
│ ├─ auth token exchange, per-profile session, refresh lock
│ └─ transport timeouts, retries, User-Agent, --debug trace
├─ api/<service> generated clients (oapi-codegen); api/auth.go by hand
└─ cmdutil result → --query → output (table | json | yaml | text)
└─ cmdutil result → --query → output (table | json | yaml | text | id)
```

A command's `RunE` builds its client with `service.New`, calls the API,
Expand Down
18 changes: 13 additions & 5 deletions docs/DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ meaning across the tree:
| `summary` | Counts over a whole resource, not a list | `monitor incidents summary` |
| `publish` / `unpublish` | Make a thing public, or take it offline keeping everything on it | `monitor status-pages publish` |
| `preview-link` | Print a short-lived link to see a thing as the public would | `monitor status-pages preview-link` |
| `finish` | End something in progress now, as opposed to `cancel`, which calls off something that hasn't started | `monitor maintenance finish` |
| `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 @@ -160,14 +161,15 @@ pipeline downstream, silently.

### P3. Stable output formats and `--query`

**Commitment.** Every command supports four formats:
**Commitment.** Every command supports these formats:

| Format | Contract |
| --- | --- |
| `table` | For people. Columns and wording may change in any release. Local time. Pages through `$NORCUBE_PAGER` / `$PAGER` on a terminal. |
| `json` | The API's own resource and field names. Lists are arrays. Changes are additive only. |
| `yaml` | The same data and field names as `json`. |
| `text` | Tab-separated, no header, one record per line, times in RFC 3339 UTC. Column order is part of the contract; a new column is a "change for scripts". |
| `id` | Only the result's `id`, one per line for a list, for `id=$(... -o id)`. `--query` applies first, so it can name another field. A result without an id is a usage error (exit 2) and, for a write, comes after the change was made. Not settable with `configure`: it isn't a sensible default. |

`--query` is a JMESPath expression applied to what `-o json` would print,
before formatting, so it composes with every format. An invalid
Expand All @@ -182,7 +184,8 @@ thing everywhere.
**Enforced.**
- [`golden_test.go`](../internal/cli/golden_test.go): about 54 commands
and query cases, each pinned in all four formats
(`testdata/golden/*.{json,yaml,txt,tsv}`) against a fake backend.
(`testdata/golden/*.{json,yaml,txt,tsv}`) against a fake backend;
`id` follows from the JSON and is pinned in `output/id_test.go`.
- `--query` is compiled in the root `PersistentPreRunE` and again in
`cmdutil.Run`, both as usage errors.
- Known exception to fix before v1.0: some write commands return ad-hoc
Expand Down Expand Up @@ -521,6 +524,7 @@ and product packages use it instead of their own:
| Reading items or text from args, a file or stdin | `cmdutil.ReadItems`, `cmdutil.ReadText` |
| Writing a file | `cmdutil.SaveStream` |
| Time arguments (`--since`) | `cmdutil.ParseTimeArg` |
| Times ahead and lengths (`--start`, `--duration`) | `cmdutil.ParseFutureTimeArg`, `cmdutil.ParseDurationArg` |
| Server-sent event streams with reconnect | `internal/sse` |
| Usage errors | `clierr.Usage` |
| What a command changes, a flag's allowed values, a platform command's service | `cmdutil.Reads` / `Writes` / `Local`, `cmdutil.FlagEnum`, `cmdutil.AnnotationService` (read by `nrc commands`) |
Expand Down Expand Up @@ -728,7 +732,7 @@ 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`; `status-pages list | get | create | update | delete | publish | unpublish | preview-link`, `status-pages layout get | set`, `status-pages incidents list | get | create | update`, `status-pages incidents updates create`, `status-pages subscribers list | delete` |
| `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`; `status-pages list | get | create | update | delete | publish | unpublish | preview-link`, `status-pages layout get | set`, `status-pages incidents list | get | create | update`, `status-pages incidents updates create`, `status-pages subscribers list | delete`; `maintenance list | get | create | update | cancel | finish` |
| PromptHub | No command group; `nrc api prompthub ...` |
| CMS | None (CMS has no public API) |

Expand All @@ -743,7 +747,9 @@ sends and verification codes; not included in `monitor.write`, because
channels hold credentials and sends cost money), `monitor.statuspages` (manage status pages, post
incidents on them and manage their subscribers; not included in any other
scope, because what it changes is public and subscribers' addresses are
personal data).
personal data), `monitor.maintenance` (manage maintenance windows; not included
in any other scope, because a window silences alerts, and one that shows on a
published page also takes `monitor.statuspages`).

Installation channels: Homebrew cask (with `nrc`), `.deb` / `.rpm` /
`.apk`, `install.sh`, release archives (darwin and linux amd64/arm64,
Expand Down Expand Up @@ -793,6 +799,8 @@ changelog, and the owner's decisions in the planning sessions of
| 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 |
| 2026-11-05 | Status page subscribers in the CLI: `status-pages subscribers list` and `delete`. A subscriber is named by id only. `delete <page> <subscriber>` completes the page but not the subscriber, because completion candidates are cached on disk and addresses have no place there. The CLI words the scope refusal itself: the API's sentence is shared with the page's other writes and speaks of changing pages, which misleads on a list | Owner's brief. The API's `count` and `export` have no commands yet; `nrc api` reaches them | owner |
| 2026-11-06 | Maintenance windows in the CLI: `monitor maintenance`. The resource is a mass noun, an exception to the plural rule of P1, because "maintenances" isn't a word and "maintenance windows" is long to type for something used in deploy scripts; `maintenance-windows` is an alias. A window is named by id only: titles repeat by design. `--state` filters on the field the result calls `state` (the API's query parameter is `status`), with the API's values. There is no `delete`: the API deletes only a cancelled window, a completed one explains a gap in uptime and goes by itself after two years, and `cancel` already takes a window out of everything people see; `nrc api` reaches the endpoint. `finish` is a new verb, because `cancel` would say the work didn't happen. `cancel` confirms, since it mails whoever was told; `finish` doesn't and has no `--yes`, because ending a silence is the safe direction and it must run unattended at the end of a deploy. Notifications are explicit in the request, because the API takes no defaults: the flags default to on, as the owner decided, and `--no-notify` turns off all three. `monitor status` keeps a monitor among `problems` when what is wrong is a calendar condition or a watched aspect, because a window doesn't hold those | Owner's brief. Rejected: a bare `2h` meaning two hours ahead, since `ParseTimeArg` reads the same spelling as two hours ago | owner |
| 2026-11-06 | `-o id` prints only the result's id. Deploy scripts capture what they create with `id=$(... -o id)`, and `-o text` prints the state as well, so it would need `cut`. It is a global output value rather than a flag of one command, so it means the same everywhere (P1, P13) | Named in the owner's maintenance windows plan. Rejected: `--query id -o text` as the documented form, which still works but is too long for the one thing every script needs | owner |
| 2026-11-05 | `--auto-post` is the one page setting `create` doesn't require: the flag came after 0.23.0, so requiring it would break scripts that create pages, and the API keeps it off unless asked. `--notify` is sent only when given, and exists only on writes that add an update | Compatibility rule P10; owner's brief | owner |

---
Expand Down Expand Up @@ -869,7 +877,7 @@ it with the same guarantees as every other product. The steps, in order:
| Step | State |
| --- | --- |
| 1 Audience | `monitor` exists in Norcube Auth (sign-in audience list, CI token exchange) |
| 2 Scopes | `monitor.read`, `monitor.check`, `monitor.write`, `monitor.channels`, `monitor.statuspages` in the CI token catalog (and so the CLI sign-in catalog), with IAM actions; channel changes and sends only with `monitor.channels`, status page changes, posts and subscribers only with `monitor.statuspages`, neither of which `monitor.write` includes; not on the MCP consent screen until the MCP redesign |
| 2 Scopes | `monitor.read`, `monitor.check`, `monitor.write`, `monitor.channels`, `monitor.statuspages`, `monitor.maintenance` in the CI token catalog (and so the CLI sign-in catalog), with IAM actions; channel changes and sends only with `monitor.channels`, status page changes, posts and subscribers only with `monitor.statuspages`, neither of which `monitor.write` includes; 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 |
Expand Down
18 changes: 7 additions & 11 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/charmbracelet/huh v1.0.0
github.com/charmbracelet/lipgloss v1.1.0
github.com/creativeprojects/go-selfupdate v1.5.2
github.com/getkin/kin-openapi v0.138.0
github.com/getkin/kin-openapi v0.148.0
github.com/gofrs/flock v0.13.0
github.com/google/uuid v1.6.0
github.com/jmespath-community/go-jmespath v1.1.1
Expand Down Expand Up @@ -45,34 +45,30 @@ require (
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect
github.com/go-fed/httpsig v1.1.0 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect
github.com/go-openapi/swag v0.23.0 // indirect
github.com/go-openapi/jsonpointer v0.22.5 // indirect
github.com/go-openapi/swag/jsonname v0.25.5 // indirect
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/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
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-localereader v0.0.1 // indirect
github.com/mattn/go-runewidth v0.0.16 // indirect
github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect
github.com/muesli/cancelreader v0.2.2 // indirect
github.com/muesli/termenv v0.16.0 // indirect
github.com/oasdiff/yaml v0.0.9 // indirect
github.com/oasdiff/yaml3 v0.0.12 // indirect
github.com/perimeterx/marshmallow v1.1.5 // indirect
github.com/oasdiff/yaml v0.1.1 // indirect
github.com/oasdiff/yaml3 v0.0.14 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/rogpeppe/go-internal v1.16.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 // indirect
github.com/santhosh-tekuri/jsonschema/v6 v6.0.3 // indirect
github.com/ulikunitz/xz v0.5.15 // indirect
github.com/woodsbury/decimal128 v1.3.0 // indirect
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
gitlab.com/gitlab-org/api/client-go v1.9.1 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
Expand Down
Loading
Loading