Skip to content

DEV-7554: scheduled maintenance endpoints in the catalog and client (hub #9705) - #85

Open
borisd wants to merge 7 commits into
mainfrom
dev-7554-scheduled-maintenance-xyte-mcp-catalog-regen-customer-docs
Open

borisd wants to merge 7 commits into
mainfrom
dev-7554-scheduled-maintenance-xyte-mcp-catalog-regen-customer-docs

Conversation

@borisd

@borisd borisd commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Linear: DEV-7554 — sub-ticket 3 of DEV-7514.

Source: the hub public API on the branch of xyte-io/server#9705 (DEV-7552, scheduled maintenance backend + public API). Merge after that PR — the endpoints are not live before it.

What

The external-endpoint-updater checklist for the new Organization Core API surface:

  • src/api-catalog/public-endpoints.json — five organization.maintenanceSchedules.* entries (list, list for a space, create, update, delete) with path params, body examples and docs links; include_suppressed on organization.incidents.getIncidents; maintenance_scheduled_active and has_maintenance_schedules on organization.spaces.getSpaces.
  • npm run skills:sync — skills/xyte-cli/data/public-endpoints.json regenerated (byte-identical to the catalog).
  • Client — one method per new key in src/client/namespaces/organization.ts + src/types/client.ts.
  • Tests — tests/endpoints.test.ts and tests/namespaces.test.ts cover the new keys.
  • skills/xyte-cli/references/endpoints.md — filter-matrix rows for the new endpoints.
  • CHANGELOG.md — entry under [Unreleased] (no version bump in this PR; [Unreleased] already carries the 0.15.0 work; bump at release per docs/release.md).

Noted, not fixed (pre-existing): organization.spaces.getSpace is catalogued at /core/v1/organization/spaces without the :space_id segment.

Verification

  • Both catalogs parse; npm run skills:sync leaves no diff.
  • npm test -- tests/endpoints.test.ts tests/catalog.test.ts tests/namespaces.test.ts tests/skills-sync.test.ts tests/skills-notes-guidance.test.ts green; npm run typecheck clean.

@borisd borisd added the awaiting-reviewer Waiting on the reviewer: a new PR, or the author has answered every comment label Oct 28, 2026

@xyte-genie xyte-genie left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI: Adds the new scheduled-maintenance endpoints to the CLI's endpoint catalog and typed client: list, list per space, create, update and delete. Also documents the new incident and space filters so AI agents and scripts can hide or show suppressed incidents and find spaces under maintenance. Pure catalog, client and docs change; the endpoints go live only after the matching server change ships.

reviewed@d90de5866ea195cb6b107721a22bbe014c014037

Comment thread CHANGELOG.md Resolved
Comment thread skills/xyte-cli/references/endpoints.md Resolved
"page",
"per_page"
"per_page",
"include_suppressed"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI: [Low] include_suppressed is catalogued but not reachable from the TUI/headless incidents loader: src/tui/data-loaders.ts:265-275 buildQuery whitelists from/to/status/priority/title/issue/space_id, so even an explicit include_suppressed in options.query is dropped and operators cannot restore the old 'all active incidents' view there — Either pass include_suppressed through compactQuery in loadIncidentsData or document the gap; out of scope of a catalog PR, flag as follow-up
Evidence: src/tui/data-loaders.ts:265-275 buildQuery whitelists from/to/status/priority/title/issue/space_id, so include_suppressed in options.query is dropped. The file is unchanged vs origin/main and the PR only adds catalog/client entries: pre-existing, out of scope
Confidence: High

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI: Agreed: it's pre-existing and out of scope for a catalog PR. ops watch incidents already passes the flag through, because --query-json is merged over the watch defaults. So --query-json '{"include_suppressed":true}' works today, and the CHANGELOG now says so. Only the TUI/headless incidents loader whitelist (buildQuery in src/tui/data-loaders.ts) drops it. That stays a follow-up.

Comment thread src/api-catalog/public-endpoints.json Outdated
"Docs category: /branches/2.0/categories/reference/API Access",
"Docs parent: /branches/2.0/reference/incidents-1"
"Docs parent: /branches/2.0/reference/incidents-1",
"include_suppressed=true also returns incidents suppressed by a scheduled maintenance window; by default (false) they are left out, matching the Xyte portal. Each incident carries scheduled_maintenance: { suppressed, suppressed_until, announced_at }."

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI: [Low] The behavior is intended hub behavior and the note is accurate. At most, a clarification that closed incidents suppressed in a window stay hidden by default would help. The fleet-insights closed pass is a pre-existing, unchanged caller. — Optionally append 'this applies to closed incidents too (they stay suppressed)' to the getIncidents note.
Evidence: hub incident_refresher.rb skips non-active rows, so an incident that opens and closes in a window keeps suppressed=true, and incidents_controller.rb:49 hides it by default. That is deliberate and matches the portal (ui incidents_controller.rb:15). The catalog note says suppressed incidents are left out by default without qualifying status, which already covers closed ones. fleet-insights-loaders.ts:207-253 is unchanged by this PR
Confidence: Medium

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI: Leaving the note as is. It says suppressed incidents are left out by default without qualifying status, which already covers closed ones, and that matches the portal. The fleet-insights closed pass is unchanged by this PR.

"bodyType": "none",
"hasBody": false,
"sourceFile": "https://docs.xyte.io/reference/get-maintenance-schedules",
"notes": [

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI: [Low] The new entries' sourceFile/Docs page links (docs.xyte.io/reference/*-maintenance-schedule(s)) and Docs parent '/branches/2.0/reference/maintenance-schedules' point at pages that will not exist until server#9705 ships and the docs are published. The sibling parents use a '-1' suffix slug (incidents-1, spaces-1), so this parent slug is unverified. — Confirm the published docs.xyte.io slugs and parent path before merge (or after the docs publish) and update them if they differ.
Confidence: Medium

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI: Agreed, the slugs can't be checked until server#9705 ships and the docs are published. This PR stays a draft until then. Before it's marked ready, the sourceFile/Docs page links and the maintenance-schedules parent slug get checked against the published pages.

Comment thread src/api-catalog/public-endpoints.json Resolved
Comment thread src/types/client.ts Resolved
Comment thread tests/endpoints.test.ts Resolved
Comment thread tests/endpoints.test.ts Outdated
'per_page',
'include_suppressed'
]);
expect(getIncidents?.notes?.join(' ')).toContain('scheduled_maintenance: { suppressed, suppressed_until, announced_at }');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI: [Low] notes.join(' ').toContain locks prose fragments for include_suppressed / getSpaces maintenance shape rather than behaviour; acceptable sibling pattern (sendCommand, getModel) but nothing asserts the new maintenance-schedule notes (pagination, 422/404 semantics) at all — Optional: assert one key note per new maintenance entry (e.g. getMaintenanceSchedules notes contain 'next_page'), mirroring getModels line 266
Confidence: Medium

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI: Not adding per-entry note assertions. The notes are prose. The new docs test instead checks the parts agents rely on (filter-matrix query fields, the endpoint keys, the include_suppressed guidance) against the catalog.

Comment thread tests/namespaces.test.ts
});
});

it('maps organization maintenance schedule endpoints', async () => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI: [Low] New client methods are only tested against a mocked call; no end-to-end test drives createXyteClient through withPathParams/transport for the five keys (URL with encoded :space_id/:id, PATCH JSON body + Content-Type, DELETE/GET no body), unlike the sibling notes/models/merge cases in tests/auth-and-client.test.ts:250-340 — Add a transport-mock case in tests/auth-and-client.test.ts calling all five maintenance methods with 'space/one'/'sched/one' and asserting method, encoded URL, query string (space_id, active_now) and body/Content-Type
Evidence: tests/namespaces.test.ts:91-121 only mocks call. tests/endpoints.test.ts asserts method/path/params/bodyType for all five keys, but no transport case like the notes one in tests/auth-and-client.test.ts:246-345. Transport/withPathParams is shared, already-tested code, so the risk is small
Confidence: High

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI: Not adding a transport case here. The five entries are catalog data on the shared withPathParams/transport path. The sibling notes/models/merge cases in tests/auth-and-client.test.ts already cover path encoding, PATCH JSON bodies and bodyless GET/DELETE. tests/endpoints.test.ts checks each entry's method, path, params and bodyType, and the new parity test checks the client mapping.

@xyte-genie

Copy link
Copy Markdown

No description provided.

Comment thread skills/xyte-cli/references/endpoints.md Resolved
Comment thread skills/xyte-cli/references/endpoints.md Resolved
Comment thread skills/xyte-cli/references/endpoints.md Resolved
Comment thread src/api-catalog/public-endpoints.json Resolved
Comment thread src/api-catalog/public-endpoints.json Resolved

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI: [Low] getSpace is a pre-existing alias/mislabel of the getSpaces route, and it now lags behind getSpaces. The hub's actual single-space show also returns the maintenance block, which the catalog does not mention for getSpace. — Add the maintenance note (and the two filters, since the path is the index route) to getSpace, or note that it is an alias of getSpaces. (line 1270)
Evidence: src/api-catalog/public-endpoints.json:1260-1287 getSpace (title 'Get Spaces', path /core/v1/organization/spaces, no :id) is a pre-existing mis-catalogued duplicate of the index route. The hub's real Get Space (Get Space.bru, path param; spaces/show.json.jbuilder) also gained the maintenance block in server#9705
Confidence: Medium

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI: Leaving getSpace alone in this PR. It's a pre-existing, wrongly catalogued duplicate of the getSpaces index route (no :id), so adding the maintenance note or filters would build on the wrong entry. Fixing or removing it is a separate catalog cleanup.

Comment thread tests/endpoints.test.ts

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI: [Low] No catalog-wide invariant that every :token in pathTemplate appears in pathParams (and vice versa), or that key == namespace.group.action; a mismatched new entry would only be caught by hand-written per-entry expectations — Extend the 'maps every key uniquely' test to loop all endpoints and assert pathParams equals the :tokens of pathTemplate and key equals ${namespace}.${group}.${action} (line 6)
Confidence: Medium

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI: Not adding a catalog-wide invariant in this PR. The new namespace parity test already catches a catalog key with no client method, or a mistyped one. The pathTemplate/pathParams and key == namespace.group.action invariants fit better in a separate catalog test.

@xyte-genie xyte-genie Oct 28, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI: [Decision] Built-in incident views and watch follow the hub default: suppressed incidents hidden, no CLI toggle

  • Situation: The hub now hides incidents suppressed by a maintenance window unless asked. The CLI's own incident watch, TUI incident screens and fleet-insight reports call that listing without the new flag.
  • Chosen: Only the raw catalog and typed client learn the new flag; the built-in views, watch loop and reports keep calling with the hub default and gain no option to include suppressed incidents.
  • Alternative: Add an include-suppressed option to the watch and TUI incident views, or always request suppressed incidents there so operators keep seeing them marked as suppressed.
  • Impact: Operators watching incidents through the CLI don't see incidents suppressed by a maintenance window by default; still-open ones surface as new incidents when the window ends. ops watch incidents already accepts include_suppressed via --query-json '{"include_suppressed":true}' (merged over the watch defaults); only the TUI/headless incidents loader whitelist (buildQuery in src/tui/data-loaders.ts) drops it, which is a follow-up.
  • Decided by: reviewer bot (inferred)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI: Decision updated: the Impact line said there was no way to see suppressed incidents earlier, which isn't true for watch. ops watch incidents --query-json '{"include_suppressed":true}' already merges the flag over the watch defaults, and the CHANGELOG now says so. Only the TUI incidents loader whitelist drops it, which is a follow-up outside this catalog PR.

@xyte-genie xyte-genie added awaiting-author Waiting on the author: the reviewer left comments to address and removed awaiting-reviewer Waiting on the reviewer: a new PR, or the author has answered every comment labels Oct 28, 2026
@borisd borisd added the do-not-merge Blocked on another change label Oct 29, 2026
Boris Dinkevich added 2 commits November 11, 2026 13:05
…intenance-xyte-mcp-catalog-regen-customer-docs
…rows, timezone, next_end_at, maintenance.scheduled on incidents, PUT, 403
@borisd
borisd marked this pull request as ready for review November 16, 2026 19:57
Copilot AI balanced review requested due to automatic review settings November 16, 2026 19:57
@borisd borisd added awaiting-reviewer Waiting on the reviewer: a new PR, or the author has answered every comment and removed awaiting-author Waiting on the author: the reviewer left comments to address labels Nov 16, 2026
@borisd
borisd requested review from ariel-greenfeld and removed request for Copilot November 16, 2026 19:57

@ariel-greenfeld ariel-greenfeld left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI: Adds the five organization.maintenanceSchedules.* endpoints, include_suppressed on getIncidents and the two getSpaces maintenance filters to the catalog, skill data, typed client and skill docs. Checked every path, method, param, body rule and response shape against hub master (server#9705 merged 2026-11-16): routes, MaintenanceSchedulesController, jbuilder views and the Bruno docs all match; shipped skill data is byte-identical; no CLI command, TUI write or headless/NDJSON schema changes.
Blocks: 1 Mid (CHANGELOG entries sit under the already-released 0.16.0). CI: the security job is red on an npm audit advisory (zod <4.6.6) that main has too; this PR does not cause it, but it is still red. The docs.xyte.io pages for the new endpoints still 404, so the docs slugs stay unverified (open thread at public-endpoints.json:811). UX: not applicable (no UI change, no [UI Review] thread).
Counts: 0 Critical, 0 High, 1 Mid, 0 Low.
reviewed@00fb88d0699cf751006ff04613e0c1b3cd88d88d

Comment thread CHANGELOG.md Resolved
@ariel-greenfeld ariel-greenfeld added awaiting-author Waiting on the author: the reviewer left comments to address and removed awaiting-reviewer Waiting on the reviewer: a new PR, or the author has answered every comment labels Nov 17, 2026
Copilot AI balanced review requested due to automatic review settings November 17, 2026 15:42
@borisd
borisd dismissed ariel-greenfeld’s stale review November 17, 2026 15:42

AI: addressed in 6a57496 — changelog entries moved to Unreleased; see the thread reply.

@borisd borisd added the awaiting-reviewer Waiting on the reviewer: a new PR, or the author has answered every comment label Nov 17, 2026
@borisd borisd removed the awaiting-author Waiting on the author: the reviewer left comments to address label Nov 17, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The prerequisite backend PR xyte-io/server#9705 returned 404, leaving endpoint contracts and required merge ordering unverified and requiring review by someone with backend access.

No open issues 🎉

What changed in this PR

Adds scheduled maintenance support to the CLI’s endpoint catalog, typed client, and shipped agent guidance, preparing for the backend API in xyte-io/server#9705. This PR is intended to merge after that backend change.

Changes:

  • Adds five maintenance schedule endpoints and matching client methods.
  • Exposes maintenance-related filters and documents incident suppression behavior.
  • Updates bundled catalog data, usage guidance, changelog, and regression tests.
File Description
tests/​skills-notes-guidance.test.ts Checks filter documentation, endpoint coverage, and approval guidance.
tests/​namespaces.test.ts Tests maintenance methods and complete catalog-to-client mappings.
tests/​endpoints.test.ts Verifies new endpoint metadata, examples, filters, and response notes.
src/​types/​client.ts Declares five maintenance schedule client methods.
src/​client/​namespaces/​organization.ts Maps maintenance methods to catalog keys.
src/​api-catalog/​public-endpoints.json Adds maintenance endpoints, filters, and response documentation.
skills/​xyte-cli/​SKILL.md Explains how to include suppressed incidents.
skills/​xyte-cli/​references/​endpoints.md Adds filters, maintenance examples, and write-approval guidance.
skills/​xyte-cli/​data/​public-endpoints.json Synchronizes the shipped catalog with the main catalog.
CHANGELOG.md Records new endpoints and the backend’s incident suppression default.

Review effort: Balanced

@ariel-greenfeld ariel-greenfeld left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI: Re-review at 6a57496: the only new commit moves the four maintenance-schedule CHANGELOG entries into ## [Unreleased], so my [Mid] is fixed and its thread is resolved. The CHANGELOG diff against main is now additions under [Unreleased] only, and 0.16.0 matches main. No other files changed since 00fb88d. The catalog/client changes I checked against hub master last round are unchanged.
Not approving: the CI security job is still red. On this head it is the zod <4.6.6 advisory, which main has since fixed in #87, so a merge of main clears that one. Main's own security job is still red on other audit advisories (vitest, fast-uri, minimatch), so it stays red after the update too. This PR does not cause either one. The PR is also BEHIND main, and do-not-merge stays: the five docs.xyte.io/reference/*-maintenance-schedule(s) pages still returned 404 today.
UX: not applicable (no UI change, no [UI Review] thread).
Counts: 0 Critical, 0 High, 0 Mid, 0 Low.
reviewed@6a57496f521c2a932bbb02e1e0718a05366364c0

@ariel-greenfeld ariel-greenfeld left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI: Re-review at 0e1d285: the only new commit is a merge of main (#87, zod 4.6.7 plus data: z.unknown().optional() in src/contracts/call-envelope.ts). The PR's own diff against main is byte-identical to what I reviewed at 6a57496, so nothing new slipped in and there are no new findings.
The security job is green now. Not approving, for two reasons. First, windows-installer-package is red: PowerShell's Expand-Archive fails with "Cannot find an overload for ExtractToDirectory" while it unpacks the Node zip. The same job fails on release-0.17.0 and dev-8144 too, so it looks like a runner-image problem and not something this PR caused, but CI is still red. Second, do-not-merge stays: the five docs.xyte.io/reference/*-maintenance-schedule(s) pages and the /branches/2.0/reference/maintenance-schedules parent still return 404 today.
UX: not applicable (no UI change, no [UI Review] thread).
Counts: 0 Critical, 0 High, 0 Mid, 0 Low.
reviewed@0e1d285332558e6bba51c3013d5a48203bb55d92

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-reviewer Waiting on the reviewer: a new PR, or the author has answered every comment do-not-merge Blocked on another change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants