Skip to content

Bound oversized list output; route usage/quota and notification-count questions in the skill index - #179

Merged
ysyneu merged 4 commits into
mainfrom
feat/audit-fixes
Sep 5, 2026
Merged

Bound oversized list output; route usage/quota and notification-count questions in the skill index#179
ysyneu merged 4 commits into
mainfrom
feat/audit-fixes

Conversation

@ysyneu

@ysyneu ysyneu commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Release of two merged changes:

Both PRs passed full CI (build ×3 platforms, lint, CodeQL) before merging into this branch.

…in the domain index

Extend the SKILL.md Domain index so question types it previously did not
cover resolve to a card (or an explicit no-CLI answer) instead of a
--help sweep:

- usage/quota/billing 额度/用量/计费: route per product — RUM session
  usage/quota to reference/rum.md resource-info (free_cnt/used_cnt,
  session_limit_reached, billing window); AI-SRE token usage to
  safari session-list (token_usage is the account-billing source of
  truth); anything else (e.g. 语音通知额度) has no CLI verb — point to
  the console 费用中心 instead of sweeping --help.
- per-person notification counts 通知次数: route to insight responder
  (total_notifications); note that per-person delivery outcome detail
  is incident timeline i_notify entries (person_id + failed_reason
  only — there is no answer/接通 field).
- add aggregated-metrics (insight) vs raw-feed (incident timeline)
  disambiguation terms (通知量 / 通知明细) to the existing insight and
  incident rows, plus a matching line in insight.md's Route-here block.
…insight incidents

Generated list verbs printed their full response as unbounded dense
JSON/TOON; a large page could dump tens of kilobytes in one shot. Route
their structured output through the existing bounding machinery
(boundProjectedList, 16 KiB limit, stderr note) already used by the
curated incident/alert/alert-event projections:

- printGenericResult measures the encoded payload; anything under the
  limit takes the pre-existing printer path, byte-identical. Over-cap
  list payloads — a top-level object array, or an items/docs/list
  envelope whose siblings are scalar pagination metadata (the shape
  cligen's listEnvelope recognizes) — are reduced to the leading rows
  that fit, with envelope keys kept and the reduction announced on
  stderr. A single oversized row is shortened with "..." markers
  instead; identifier fields are never shortened.
- The typed response reaches the bounding machinery through a JSON
  round trip that decodes numbers as json.Number before narrowing to
  int64/float64, so integer IDs above 2^53 (channel_id, team_id, ...)
  keep full precision in bounded output. Rows inside an envelope are
  re-fit against the limit minus the observed envelope overhead, so the
  whole printed payload lands under it.
- Detail-shaped single objects are never reduced or rejected.

Curated insight incidents gains the incident-list treatment in json/toon
mode: a compact default projection
(incident_id,title,severity,channel_name,seconds_to_ack,seconds_to_close,notifications)
with a stderr note, a --fields flag to choose a different projection,
and the same bounding. Table mode is unchanged.

Tests: stub-driven end-to-end coverage for the bounded envelope and
top-level-array paths, >2^53 ID precision, oversized-detail passthrough,
and the single-row shorten path; insight incidents projection, --fields
override, bounding, and unchanged table output.
docs(skill): route usage/quota and per-person notification questions in the domain index
Bound oversized structured list output from generated list verbs and insight incidents
@ysyneu
ysyneu merged commit 17ac12c into main Sep 5, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant