alibabacloud-sysom-diagnosis
Use SysOM CLI and backend envelopes as the diagnosis source of truth. This Skill replaces the older SysOM diagnosis Skill and is the single entry point for SysOM ECS performance and stability diagnosis.
Immediate Route
When the user reports a symptom and has not provided fresh SysOM envelope output,
run the matching SysOM command from Domain Routing below before ad hoc Linux
inspection or manual probing. Then follow the returned agent.summary,
agent.findings[].detail/category, and agent.next_steps[]. Raw Linux commands
are bounded fallbacks only when a SysOM command is unavailable, outputs
contradict each other, or a required entity remains missing after the focused
SysOM command.
Credential Security
Never print, echo, or ask for AccessKey ID or AccessKey Secret values. Remote
commands perform their own authentication checks. If a command returns an
authentication or permission error, explain the error and point the user to
references/ram-policies.md; credential setup must happen outside the
conversation.
CLI Setup
Check whether the CLI is available:
command -v sysom-osops
If it is missing, install it. The installer runs on Linux or macOS — it does
not run on Windows. The target ECS being diagnosed must be Linux (see
references/supported-environments.md), but the control host can be either OS.
System-wide install (needs write access to /usr/local/bin, typically via
sudo):
curl -fsSL --connect-timeout 1000 https://sysom-prd-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/sysom_prd/skill_cli/install.sh \
| sudo bash
User-local install — no sudo, no root-owned paths. Works on both Linux and
macOS, and is the recommended path when you do not have administrator
privileges:
mkdir -p ~/.local/bin
curl -fsSL --connect-timeout 1000 https://sysom-prd-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/sysom_prd/skill_cli/install.sh \
| bash -s -- -d "$HOME/.local/bin"
Then make sure the install directory is on your PATH (e.g. ~/.bashrc /
~/.zshrc):
export PATH="$HOME/.local/bin:$PATH"
Then verify only the binary:
command -v sysom-osops
On macOS, the installer performs ad-hoc codesign and strips quarantine
attributes automatically. If you are on Apple Silicon running an x86_64 shell
under Rosetta, the installer detects the mismatch; pass -f to override only
when you know the binary will run under translation.
Command Visibility Depends On Credentials
Only local commands such as memory classify are always present. Every remote
deep command is discovered at runtime from the SysOM skills catalog, which needs
credentials. On a machine without credentials configured, expect:
sysom-osops memory --help to list only classify, with the deep memory
commands absent.
- The top-level
sysom-osops --help to omit the io, net, and load groups
entirely.
This is a visibility limitation, not a capability limitation. Treat
references/deep-actions.md as the authoritative command inventory for this
Skill, and never infer from --help output that a domain or command is
unsupported. Use sysom-osops precheck to report auth status.
Core Workflow
- Classify the user's symptom into one SysOM domain: memory, IO, load/CPU,
network, or Java (GC/memory/CPU).
- Run the smallest SysOM command that matches that domain. Prefer a local
memory classify for unclear memory symptoms; for other domains, use the
matching documented remote action.
- Read only the default envelope fields:
ok, error, command, and
agent.
- Load domain references before building the answer. This step is mandatory
and must not be skipped even when
agent.findings and agent.next_steps
appear complete. Which references to load depends on the domain:
- Java (any type: gc/memory/cpu) → read
references/java/README.md first
for symptom routing and parameter validation; then by type:
- gc:
references/java/gc/gc-guide.md
- memory:
references/java/memory/memory-guide.md (then glossary, envelope
guide, profiling playbook, decision tree under references/java/memory/)
- cpu:
references/java/cpu/cpu-guide.md
- Other domains → load the matching reference from the References table below.
References add interpretation rules, entity definitions, and answer-shaping
guidance that the envelope alone does not convey. Do not infer Java terms,
native memory categories, or profiling semantics from raw envelope text.
- Relay the hop as visible progress: present
agent.summary (plus key
findings) to the user, interpreted through the reference material loaded in
step 4. Keep evidence qualifiers that change interpretation, including
currentness, unavailable direct signals, fallback evidence, and remediation
preconditions.
- Branch on
agent.status:
concluded (or missing/unrecognized) → build the final answer from
agent.summary, agent.findings[].detail/category, and
agent.next_steps[], then stop the loop.
in_progress → the backend is requesting another collection hop: take
the kind=command entry from agent.next_steps[], apply the
confirmation rules below, run it, and feed the new envelope back into
step 4.
Guided-diagnosis loop hard rules (Java multi-hop sessions):
- Pace ownership: never skip
agent.next_steps[] to decide collection on
your own, and never run diagnostic commands outside the envelope.
- Run commands exactly as shown — the gateway has already injected
--session-id; never rewrite, add, or remove flags. If a command fails,
relay the error envelope as-is instead of retrying with tweaked parameters.
- Hop limit: stop the loop after 4 hops in the same session even if the
backend still says
in_progress; present the conclusions so far and state
the evidence limits (the backend force-concludes at the same ceiling —
double safety).
- User refusal: if the user declines a proposed command, stop the loop,
summarize from the evidence already collected, and state explicitly which
conclusions remain unconfirmed because that hop was not run.
Before executing a profiling or long-running follow-up command (e.g.,
java analyze --type memory --duration N, any command that injects an agent
into the target process, or any command expected to run for multiple minutes):
- Tell the user what the command does, how long it takes, and what performance
impact it may have on the target process (e.g., CPU overhead from sampling,
extra memory from the injected agent, potential safepoint pauses).
- Ask the user whether to proceed. Do not run the command until the user
confirms, or until the user has previously given a standing instruction to
auto-run follow-ups.
- Once the command starts, tell the user the expected wait time and keep them
informed if the operation is still in progress.
Read-only query commands (e.g. java analyze --type cpu) do not apply here —
see each domain guide's Execution Model for specifics.
When classify returns a command in agent.next_steps[] and no root-cause
finding already contains enough evidence to answer, run the first command next.
Do not replace an Agent-visible SysOM next step with manual shell probing. Raw
Linux checks are bounded fallbacks after the SysOM next step succeeds, fails, or
times out.
Use the documented commands exactly as shown by default. Do not add raw,
debug, or backend evidence expansion flags unless the user explicitly asks for
that view.
Final answers should name evidence, root cause, owner/scope, and operational
action targets. Do not add shell snippets for verification or remediation unless
the user explicitly asks for commands. Prefer phrases such as "review dependency
and disable or upgrade the leaking component in a change window" over raw module,
cgroup, sysctl, cache-drop, or process-kill commands.
Do not include command-looking inline snippets such as module inspection/removal,
memory summary commands, cgroup file writes, cache-drop controls, sysctl changes,
or process-kill commands as default final-answer steps.
The agent view must be self-contained for diagnosis. Structured evidence is a
backend/UI view and must not be treated as the default Agent source for required
entities.
Domain Routing
| User symptom |
First route |
| Unclear memory issue, OOM, high RSS, file cache, shmem/tmpfs, memory cgroup, socket memory, kernel memory |
sysom-osops memory classify |
| Java issue (symptom unclear) |
Follow the Symptom Triage rules in references/java/README.md — ask the user about the symptom, then route to the matching type |
| Java GC pause / frequent GC / low GC throughput |
sysom-osops java analyze --type gc |
| Java heap / OOM / heap leak / native leak |
sysom-osops java analyze --type memory — without a pid/pod it returns a candidate list; STOP and wait for the user to choose before retrying |
| Java CPU hotspot / high thread CPU / flame graph |
sysom-osops java analyze --type cpu --pid <PID> |
| Slow disk, high iowait, disk latency, blocked IO |
sysom-osops io iofsstat, then io iodiagnose if the overview points to slow IO |
| High load, runqueue backlog, task stuck waiting for CPU |
sysom-osops load loadtask or load delay based on the visible symptom |
| Packet loss, retransmits, network timeout, jitter |
sysom-osops net packetdrop for loss/drop symptoms; net netjitter for latency fluctuation |
For command parameters, read references/deep-actions.md and
references/parameter-guide.md. For OS and region support, read
references/supported-environments.md. These references are Skill material; do
not use remote target file tools to open .claude/skills paths on the diagnosed
host.
For Java symptom-to-type routing, consult references/java/README.md.
Memory Routing
Memory follows the same Core Workflow and Follow-up Rules as every domain: start
from sysom-osops memory classify, then pick the next action from visible output
or agent.next_steps[]. For choosing among memory deep actions or checking which
entity is still missing, load references/memory-triage.md (parallel to
references/non-memory-triage.md for other domains).
Note: Java-related memory symptoms (OOM in Java process, heap leak, native leak)
route to Java domain via sysom-osops java analyze --type memory, not through
memory classify. See Domain Routing table above.
Choose the next memory action from visible SysOM output. Do not infer a memory mechanism from symptom wording alone.
Envelope Contract
Default command output is the Agent contract:
{
"ok": true,
"command": "sysom-osops memory classify",
"agent": {
"status": "concluded",
"session_id": "a1b2c3d4e5f6",
"summary": "Concise diagnosis summary.",
"findings": [
{
"severity": "high",
"title": "Short finding title",
"detail": "Root cause, key entities, and evidence summary.",
"category": "root_cause"
}
],
"next_steps": [
{
"kind": "command",
"label": "Run focused deep diagnosis",
"command": "sysom-osops memory oom",
"reason": "The missing entity this command can fill."
}
]
}
}
agent.findings[] may contain only severity, title, detail, and
category. Required entities such as PID, cgroup, service, file path, OOM
victim, limit/current, residue, holder, or cleanup target must be written in
agent.summary or agent.findings[].detail.
Field semantics for guided diagnosis sessions:
agent.status: in_progress means the backend diagnosis agent requests
another collection hop; concluded means diagnosis has converged. Treat a
missing or unrecognized value as concluded. Legacy collector-level states
(success, warning, ...) may still appear on non-Java actions; interpret
them as before.
agent.session_id: backend-generated multi-hop session identifier. Never
generate or modify it; the gateway already injects it into command
strings, so run them verbatim.
agent.next_steps[].kind: command = backend-requested collection command
(subject to the confirmation rules above); info = user-side suggestion —
present it but never auto-run; warning = evidence or data-quality caveat.
Follow-up Rules
- Prefer
category=root_cause, then highest severity, then the finding that
best matches the user's reported symptom.
- Treat
root_cause as stop-ready when visible detail contains the entities
needed to explain the symptom and a safe next action.
- Treat
agent.next_steps[] as a priority plan, not a checklist.
- Run another SysOM command only when it can fill a named missing entity or
change remediation.
- For long-running Java collection commands —
java analyze --type memory --duration N (profiling; legacy memory javamem --duration N) and java analyze --type gc in collect mode (5–10 min JFR/GC collection) — the wait is
minutes-scale: tell the user, size the tool timeout accordingly, and never
re-fire the same command on client timeout. See
references/java/memory/profiling-playbook.md (memory) and
references/java/gc/gc-guide.md (gc).
- Preserve visible qualifiers that affect interpretation, such as current versus
historical evidence, unavailable direct signals, fallback evidence used to
close currentness, and safety preconditions for remediation.
- When a finding uses fallback evidence because a direct signal is unavailable,
state both parts in the final answer. Do not reduce the conclusion to the
fallback metric alone.
- After a focused SysOM command closes a root cause, answer from it. Do not run
extra commands to make the report comprehensive, and do not chase earlier
classify anomalies or observations unless they share the same entity and
expose a named evidence gap.
- Do not call backend-only collectors or private helper commands directly.
- Do not re-check a PID, cgroup, file, limit, or event that SysOM already named
in
summary or detail.
- After a SysOM deep command returns
category=root_cause with the required
entities visible, answer from that envelope. Raw Linux checks are only for
contradictions, command errors, or a clearly missing entity.
- In the final answer, do not turn already-closed entities into extra raw Linux
verification commands. Express remediation as dependency-aware action targets
and change-window plans unless the envelope itself provides an executable safe
next step.
- Avoid executable shell snippets in the final answer. If a command is useful
only for post-change verification, name the SysOM check or metric to re-run
instead of raw Linux commands.
- This includes inline command names for module inspection/removal, memory
summary commands, cgroup file writes, cache-drop controls, sysctl changes, and
process-kill actions; describe the dependency gate and operational action
target in prose.
- Pivot across domains when the current envelope does not explain the reported
symptom and another SysOM domain names a stronger root cause.
- During diagnosis, do not execute remediation commands that change target
state, such as killing processes, removing files, changing sysctl values, or
writing to cache-drop controls. Present those as recommendations unless the
user explicitly asks you to perform the repair.
- For non-memory findings, keep the same rule: one focused deep command, then
answer when the required entities are visible.
Error Handling
error.code |
Action |
Sysom.TargetRequired |
Ask for instance ID and region, or explain ECS metadata auto-detection requirements |
Sysom.FallbackClassify |
Present the local classify result and continue only if a focused next step is available |
Sysom.PermissionDenied |
Use references/ram-policies.md to explain required RAM permissions |
Sysom.AuthenticationFailure |
Ask the user to configure credentials outside this session |
Sysom.InvalidParameter |
Ask the user to correct the instance, region, or command parameter |
Sysom.DiagnosisVersionNotSupported |
Explain that the target instance diagnosis components need an update |
Sysom.DiagnosisJsonParseFailed |
Retry once only when the user still needs the same evidence |
Sysom.PollError |
Retry the same focused action once when the missing evidence is still required |
Empty Output Is Not an Envelope
A command can exit non-zero with no stdout and no stderr at all. This is not
an envelope, so do not parse it — parsing empty output as JSON will fail. The
dominant cause is an unsupported flag: the CLI rejects an undefined flag before
any envelope is produced, and currently swallows the message.
When a command produces no output:
- Do not retry the same command unchanged, and do not report a diagnosis result.
- Check the flags you passed against
references/parameter-guide.md, and
confirm with sysom-osops <group> <command> --help. Note that io, load,
and net commands accept only --region, --instance, and --scope.
- Re-run once with the unsupported flags removed.
- If the output is still empty, tell the user the command failed without a
diagnosable error, name the command and flags used, and treat it the same as
Sysom.InvalidParameter instead of inventing findings.
Help Text Is Not an Envelope
A domain subcommand can be missing rather than broken. Remote deep commands
are discovered at runtime from the SysOM skills catalog, which requires
credentials. When credentials are absent the catalog is unreachable, the
subcommand is never registered, and the CLI falls back to printing the domain
group's help text — with exit code 0.
Treat output that begins with Commands under "<domain>" are discovered at runtime as a missing command, never as a diagnosis result:
- Do not parse it as an envelope and do not report "no issue found". Exit code
0 here means the command never ran.
- Do not conclude that the domain is unsupported, or that this Skill only
offers
memory classify.
- Tell the user that deep diagnosis needs credentials. Point them to
sysom-osops precheck for auth status and sysom-osops configure to set it
up; credential setup happens outside the conversation.
- Re-run the command only after the user confirms credentials are configured.
References
| Reference |
Use when |
references/classify-output-guide.md |
Reading local memory classify output |
references/memory-triage.md |
Choosing a memory deep action or checking memory entity completeness |
references/non-memory-triage.md |
Routing IO, load/CPU, network diagnosis |
references/deep-actions.md |
Looking up SysOM commands by domain |
references/parameter-guide.md |
Validating command parameters |
references/report-interpretation.md |
Interpreting envelope fields and answer shape |
references/ram-policies.md |
Explaining RAM permissions |
references/supported-environments.md |
Checking OS, architecture, and region support |
Java Analysis References
| Reference |
Use when |
references/java/README.md |
Primary Java entry point: symptom triage, parameter guide, sub-domain index |
references/java/gc/gc-guide.md |
Running or interpreting --type gc results |
references/java/cpu/cpu-guide.md |
Running or interpreting --type cpu results |
references/java/memory/memory-guide.md |
--type memory interpretation and discovery-first flow entry |
references/java/memory/glossary.md |
Java memory terminology |
references/java/memory/javamem-envelope-guide.md |
Interpreting --type memory envelope structure |
references/java/memory/profiling-playbook.md |
Preparation and expected behavior before --duration collection |
references/java/memory/decision-tree.md |
Following backend next_steps in Java multi-hop sessions |
references/java/memory/case-library.md |
Case library and anti-patterns |
1---2name: alibabacloud-sysom-diagnosis3description: Use when troubleshooting Linux server performance or stability issues — CPU saturation, high load, scheduling delay, memory pressure, OOM events, high RSS, page cache / shared memory growth, memory cgroup residue, Java heap issues, disk IO saturation or latency, packet loss, network jitter, or a server that is slow, stuck, or unstable. Performs diagnosis and surfaces recommendations; does not apply fixes automatically.4license: Apache-2.05---6
7# alibabacloud-sysom-diagnosis
8
9Use SysOM CLI and backend envelopes as the diagnosis source of truth. This Skill replaces the older SysOM diagnosis Skill and is the single entry point for SysOM ECS performance and stability diagnosis.
10
11## Immediate Route
12
13When the user reports a symptom and has not provided fresh SysOM envelope output,
14run the matching SysOM command from **Domain Routing** below before ad hoc Linux
15inspection or manual probing. Then follow the returned `agent.summary`,
16`agent.findings[].detail/category`, and `agent.next_steps[]`. Raw Linux commands
17are bounded fallbacks only when a SysOM command is unavailable, outputs
18contradict each other, or a required entity remains missing after the focused
19SysOM command.
20
21## Credential Security
22
23Never print, echo, or ask for AccessKey ID or AccessKey Secret values. Remote
24commands perform their own authentication checks. If a command returns an
25authentication or permission error, explain the error and point the user to
26`references/ram-policies.md`; credential setup must happen outside the
27conversation.
28
29## CLI Setup
30
31Check whether the CLI is available:
32
33```bash
34command -v sysom-osops
35```
36
37If it is missing, install it. The installer runs on **Linux or macOS** — it does
38not run on Windows. The target ECS being diagnosed must be Linux (see
39`references/supported-environments.md`), but the control host can be either OS.
40
41System-wide install (needs write access to `/usr/local/bin`, typically via
42`sudo`):
43
44```bash
45curl -fsSL --connect-timeout 1000 https://sysom-prd-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/sysom_prd/skill_cli/install.sh \
46 | sudo bash
47```
48
49User-local install — no sudo, no root-owned paths. Works on both Linux and
50macOS, and is the recommended path when you do not have administrator
51privileges:
52
53```bash
54mkdir -p ~/.local/bin
55curl -fsSL --connect-timeout 1000 https://sysom-prd-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/sysom_prd/skill_cli/install.sh \
56 | bash -s -- -d "$HOME/.local/bin"
57```
58
59Then make sure the install directory is on your PATH (e.g. `~/.bashrc` /
60`~/.zshrc`):
61
62```bash
63export PATH="$HOME/.local/bin:$PATH"
64```
65
66Then verify only the binary:
67
68```bash
69command -v sysom-osops
70```
71
72On macOS, the installer performs ad-hoc codesign and strips quarantine
73attributes automatically. If you are on Apple Silicon running an x86_64 shell
74under Rosetta, the installer detects the mismatch; pass `-f` to override only
75when you know the binary will run under translation.
76
77## Command Visibility Depends On Credentials
78
79Only local commands such as `memory classify` are always present. Every remote
80deep command is discovered at runtime from the SysOM skills catalog, which needs
81credentials. On a machine without credentials configured, expect:
82
83- `sysom-osops memory --help` to list only `classify`, with the deep memory
84 commands absent.
85- The top-level `sysom-osops --help` to omit the `io`, `net`, and `load` groups
86 entirely.
87
88This is a visibility limitation, not a capability limitation. Treat
89`references/deep-actions.md` as the authoritative command inventory for this
90Skill, and never infer from `--help` output that a domain or command is
91unsupported. Use `sysom-osops precheck` to report auth status.
92
93## Core Workflow
94
951. Classify the user's symptom into one SysOM domain: memory, IO, load/CPU,
96 network, or Java (GC/memory/CPU).
972. Run the smallest SysOM command that matches that domain. Prefer a local
98 memory classify for unclear memory symptoms; for other domains, use the
99 matching documented remote action.
1003. Read only the default envelope fields: `ok`, `error`, `command`, and
101 `agent`.
1024. **Load domain references before building the answer.** This step is mandatory
103 and must not be skipped even when `agent.findings` and `agent.next_steps`
104 appear complete. Which references to load depends on the domain:
105 - Java (any type: gc/memory/cpu) → read `references/java/README.md` first
106 for symptom routing and parameter validation; then by type:
107 - gc: `references/java/gc/gc-guide.md`
108 - memory: `references/java/memory/memory-guide.md` (then glossary, envelope
109 guide, profiling playbook, decision tree under `references/java/memory/`)
110 - cpu: `references/java/cpu/cpu-guide.md`
111 - Other domains → load the matching reference from the References table below.
112 References add interpretation rules, entity definitions, and answer-shaping
113 guidance that the envelope alone does not convey. Do not infer Java terms,
114 native memory categories, or profiling semantics from raw envelope text.
1155. Relay the hop as visible progress: present `agent.summary` (plus key
116 findings) to the user, interpreted through the reference material loaded in
117 step 4. Keep evidence qualifiers that change interpretation, including
118 currentness, unavailable direct signals, fallback evidence, and remediation
119 preconditions.
1206. Branch on `agent.status`:
121 - `concluded` (or missing/unrecognized) → build the final answer from
122 `agent.summary`, `agent.findings[].detail/category`, and
123 `agent.next_steps[]`, then stop the loop.
124 - `in_progress` → the backend is requesting another collection hop: take
125 the `kind=command` entry from `agent.next_steps[]`, apply the
126 confirmation rules below, run it, and feed the new envelope back into
127 step 4.
128
129**Guided-diagnosis loop hard rules** (Java multi-hop sessions):
130
131- Pace ownership: never skip `agent.next_steps[]` to decide collection on
132 your own, and never run diagnostic commands outside the envelope.
133- Run commands **exactly as shown** — the gateway has already injected
134 `--session-id`; never rewrite, add, or remove flags. If a command fails,
135 relay the error envelope as-is instead of retrying with tweaked parameters.
136- Hop limit: stop the loop after 4 hops in the same session even if the
137 backend still says `in_progress`; present the conclusions so far and state
138 the evidence limits (the backend force-concludes at the same ceiling —
139 double safety).
140- User refusal: if the user declines a proposed command, stop the loop,
141 summarize from the evidence already collected, and state explicitly which
142 conclusions remain unconfirmed because that hop was not run.
143
144**Before executing a profiling or long-running follow-up command** (e.g.,
145`java analyze --type memory --duration N`, any command that injects an agent
146into the target process, or any command expected to run for multiple minutes):
147- Tell the user what the command does, how long it takes, and what performance
148 impact it may have on the target process (e.g., CPU overhead from sampling,
149 extra memory from the injected agent, potential safepoint pauses).
150- Ask the user whether to proceed. Do not run the command until the user
151 confirms, or until the user has previously given a standing instruction to
152 auto-run follow-ups.
153- Once the command starts, tell the user the expected wait time and keep them
154 informed if the operation is still in progress.
155
156Read-only query commands (e.g. `java analyze --type cpu`) do not apply here —
157see each domain guide's Execution Model for specifics.
158
159When classify returns a command in `agent.next_steps[]` and no root-cause
160finding already contains enough evidence to answer, run the first command next.
161Do not replace an Agent-visible SysOM next step with manual shell probing. Raw
162Linux checks are bounded fallbacks after the SysOM next step succeeds, fails, or
163times out.
164
165Use the documented commands exactly as shown by default. Do not add raw,
166debug, or backend evidence expansion flags unless the user explicitly asks for
167that view.
168
169Final answers should name evidence, root cause, owner/scope, and operational
170action targets. Do not add shell snippets for verification or remediation unless
171the user explicitly asks for commands. Prefer phrases such as "review dependency
172and disable or upgrade the leaking component in a change window" over raw module,
173cgroup, sysctl, cache-drop, or process-kill commands.
174Do not include command-looking inline snippets such as module inspection/removal,
175memory summary commands, cgroup file writes, cache-drop controls, sysctl changes,
176or process-kill commands as default final-answer steps.
177
178The `agent` view must be self-contained for diagnosis. Structured evidence is a
179backend/UI view and must not be treated as the default Agent source for required
180entities.
181
182## Domain Routing
183
184| User symptom | First route |
185|--------------|-------------|
186| Unclear memory issue, OOM, high RSS, file cache, shmem/tmpfs, memory cgroup, socket memory, kernel memory | `sysom-osops memory classify` |
187| Java issue (symptom unclear) | Follow the Symptom Triage rules in `references/java/README.md` — ask the user about the symptom, then route to the matching type |
188| Java GC pause / frequent GC / low GC throughput | `sysom-osops java analyze --type gc` |
189| Java heap / OOM / heap leak / native leak | `sysom-osops java analyze --type memory` — without a pid/pod it returns a candidate list; STOP and wait for the user to choose before retrying |
190| Java CPU hotspot / high thread CPU / flame graph | `sysom-osops java analyze --type cpu --pid <PID>` |
191| Slow disk, high iowait, disk latency, blocked IO | `sysom-osops io iofsstat`, then `io iodiagnose` if the overview points to slow IO |
192| High load, runqueue backlog, task stuck waiting for CPU | `sysom-osops load loadtask` or `load delay` based on the visible symptom |
193| Packet loss, retransmits, network timeout, jitter | `sysom-osops net packetdrop` for loss/drop symptoms; `net netjitter` for latency fluctuation |
194
195For command parameters, read `references/deep-actions.md` and
196`references/parameter-guide.md`. For OS and region support, read
197`references/supported-environments.md`. These references are Skill material; do
198not use remote target file tools to open `.claude/skills` paths on the diagnosed
199host.
200For Java symptom-to-type routing, consult `references/java/README.md`.
201
202## Memory Routing
203
204Memory follows the same Core Workflow and Follow-up Rules as every domain: start
205from `sysom-osops memory classify`, then pick the next action from visible output
206or `agent.next_steps[]`. For choosing among memory deep actions or checking which
207entity is still missing, load `references/memory-triage.md` (parallel to
208`references/non-memory-triage.md` for other domains).
209
210Note: Java-related memory symptoms (OOM in Java process, heap leak, native leak)
211route to Java domain via `sysom-osops java analyze --type memory`, not through
212memory classify. See Domain Routing table above.
213
214Choose the next memory action from visible SysOM output. Do not infer a memory mechanism from symptom wording alone.
215
216## Envelope Contract
217
218Default command output is the Agent contract:
219
220```json
221{
222 "ok": true,
223 "command": "sysom-osops memory classify",
224 "agent": {
225 "status": "concluded",
226 "session_id": "a1b2c3d4e5f6",
227 "summary": "Concise diagnosis summary.",
228 "findings": [
229 {
230 "severity": "high",
231 "title": "Short finding title",
232 "detail": "Root cause, key entities, and evidence summary.",
233 "category": "root_cause"
234 }
235 ],
236 "next_steps": [
237 {
238 "kind": "command",
239 "label": "Run focused deep diagnosis",
240 "command": "sysom-osops memory oom",
241 "reason": "The missing entity this command can fill."
242 }
243 ]
244 }
245}
246```
247
248`agent.findings[]` may contain only `severity`, `title`, `detail`, and
249`category`. Required entities such as PID, cgroup, service, file path, OOM
250victim, limit/current, residue, holder, or cleanup target must be written in
251`agent.summary` or `agent.findings[].detail`.
252
253Field semantics for guided diagnosis sessions:
254
255- `agent.status`: `in_progress` means the backend diagnosis agent requests
256 another collection hop; `concluded` means diagnosis has converged. Treat a
257 missing or unrecognized value as `concluded`. Legacy collector-level states
258 (`success`, `warning`, ...) may still appear on non-Java actions; interpret
259 them as before.
260- `agent.session_id`: backend-generated multi-hop session identifier. Never
261 generate or modify it; the gateway already injects it into `command`
262 strings, so run them verbatim.
263- `agent.next_steps[].kind`: `command` = backend-requested collection command
264 (subject to the confirmation rules above); `info` = user-side suggestion —
265 present it but never auto-run; `warning` = evidence or data-quality caveat.
266
267## Follow-up Rules
268
269- Prefer `category=root_cause`, then highest severity, then the finding that
270 best matches the user's reported symptom.
271- Treat `root_cause` as stop-ready when visible `detail` contains the entities
272 needed to explain the symptom and a safe next action.
273- Treat `agent.next_steps[]` as a priority plan, not a checklist.
274- Run another SysOM command only when it can fill a named missing entity or
275 change remediation.
276- For long-running Java collection commands — `java analyze --type memory
277 --duration N` (profiling; legacy `memory javamem --duration N`) and `java
278 analyze --type gc` in `collect` mode (5–10 min JFR/GC collection) — the wait is
279 minutes-scale: tell the user, size the tool timeout accordingly, and never
280 re-fire the same command on client timeout. See
281 `references/java/memory/profiling-playbook.md` (memory) and
282 `references/java/gc/gc-guide.md` (gc).
283- Preserve visible qualifiers that affect interpretation, such as current versus
284 historical evidence, unavailable direct signals, fallback evidence used to
285 close currentness, and safety preconditions for remediation.
286- When a finding uses fallback evidence because a direct signal is unavailable,
287 state both parts in the final answer. Do not reduce the conclusion to the
288 fallback metric alone.
289- After a focused SysOM command closes a root cause, answer from it. Do not run
290 extra commands to make the report comprehensive, and do not chase earlier
291 classify anomalies or observations unless they share the same entity and
292 expose a named evidence gap.
293- Do not call backend-only collectors or private helper commands directly.
294- Do not re-check a PID, cgroup, file, limit, or event that SysOM already named
295 in `summary` or `detail`.
296- After a SysOM deep command returns `category=root_cause` with the required
297 entities visible, answer from that envelope. Raw Linux checks are only for
298 contradictions, command errors, or a clearly missing entity.
299- In the final answer, do not turn already-closed entities into extra raw Linux
300 verification commands. Express remediation as dependency-aware action targets
301 and change-window plans unless the envelope itself provides an executable safe
302 next step.
303- Avoid executable shell snippets in the final answer. If a command is useful
304 only for post-change verification, name the SysOM check or metric to re-run
305 instead of raw Linux commands.
306- This includes inline command names for module inspection/removal, memory
307 summary commands, cgroup file writes, cache-drop controls, sysctl changes, and
308 process-kill actions; describe the dependency gate and operational action
309 target in prose.
310- Pivot across domains when the current envelope does not explain the reported
311 symptom and another SysOM domain names a stronger root cause.
312- During diagnosis, do not execute remediation commands that change target
313 state, such as killing processes, removing files, changing sysctl values, or
314 writing to cache-drop controls. Present those as recommendations unless the
315 user explicitly asks you to perform the repair.
316- For non-memory findings, keep the same rule: one focused deep command, then
317 answer when the required entities are visible.
318
319## Error Handling
320
321| `error.code` | Action |
322|--------------|--------|
323| `Sysom.TargetRequired` | Ask for instance ID and region, or explain ECS metadata auto-detection requirements |
324| `Sysom.FallbackClassify` | Present the local classify result and continue only if a focused next step is available |
325| `Sysom.PermissionDenied` | Use `references/ram-policies.md` to explain required RAM permissions |
326| `Sysom.AuthenticationFailure` | Ask the user to configure credentials outside this session |
327| `Sysom.InvalidParameter` | Ask the user to correct the instance, region, or command parameter |
328| `Sysom.DiagnosisVersionNotSupported` | Explain that the target instance diagnosis components need an update |
329| `Sysom.DiagnosisJsonParseFailed` | Retry once only when the user still needs the same evidence |
330| `Sysom.PollError` | Retry the same focused action once when the missing evidence is still required |
331
332### Empty Output Is Not an Envelope
333
334A command can exit non-zero with **no stdout and no stderr at all**. This is not
335an envelope, so do not parse it — parsing empty output as JSON will fail. The
336dominant cause is an unsupported flag: the CLI rejects an undefined flag before
337any envelope is produced, and currently swallows the message.
338
339When a command produces no output:
340
3411. Do not retry the same command unchanged, and do not report a diagnosis result.
3422. Check the flags you passed against `references/parameter-guide.md`, and
343 confirm with `sysom-osops <group> <command> --help`. Note that `io`, `load`,
344 and `net` commands accept only `--region`, `--instance`, and `--scope`.
3453. Re-run once with the unsupported flags removed.
3464. If the output is still empty, tell the user the command failed without a
347 diagnosable error, name the command and flags used, and treat it the same as
348 `Sysom.InvalidParameter` instead of inventing findings.
349
350### Help Text Is Not an Envelope
351
352A domain subcommand can be **missing** rather than broken. Remote deep commands
353are discovered at runtime from the SysOM skills catalog, which requires
354credentials. When credentials are absent the catalog is unreachable, the
355subcommand is never registered, and the CLI falls back to printing the domain
356group's help text — with **exit code 0**.
357
358Treat output that begins with `Commands under "<domain>" are discovered at
359runtime` as a missing command, never as a diagnosis result:
360
3611. Do not parse it as an envelope and do not report "no issue found". Exit code
362 0 here means the command never ran.
3632. Do not conclude that the domain is unsupported, or that this Skill only
364 offers `memory classify`.
3653. Tell the user that deep diagnosis needs credentials. Point them to
366 `sysom-osops precheck` for auth status and `sysom-osops configure` to set it
367 up; credential setup happens outside the conversation.
3684. Re-run the command only after the user confirms credentials are configured.
369
370## References
371
372| Reference | Use when |
373|-----------|----------|
374| `references/classify-output-guide.md` | Reading local memory classify output |
375| `references/memory-triage.md` | Choosing a memory deep action or checking memory entity completeness |
376| `references/non-memory-triage.md` | Routing IO, load/CPU, network diagnosis |
377| `references/deep-actions.md` | Looking up SysOM commands by domain |
378| `references/parameter-guide.md` | Validating command parameters |
379| `references/report-interpretation.md` | Interpreting envelope fields and answer shape |
380| `references/ram-policies.md` | Explaining RAM permissions |
381| `references/supported-environments.md` | Checking OS, architecture, and region support |
382
383### Java Analysis References
384
385| Reference | Use when |
386|-----------|----------|
387| `references/java/README.md` | **Primary Java entry point**: symptom triage, parameter guide, sub-domain index |
388| `references/java/gc/gc-guide.md` | Running or interpreting `--type gc` results |
389| `references/java/cpu/cpu-guide.md` | Running or interpreting `--type cpu` results |
390| `references/java/memory/memory-guide.md` | `--type memory` interpretation and discovery-first flow entry |
391| `references/java/memory/glossary.md` | Java memory terminology |
392| `references/java/memory/javamem-envelope-guide.md` | Interpreting `--type memory` envelope structure |
393| `references/java/memory/profiling-playbook.md` | Preparation and expected behavior before `--duration` collection |
394| `references/java/memory/decision-tree.md` | Following backend `next_steps` in Java multi-hop sessions |
395| `references/java/memory/case-library.md` | Case library and anti-patterns |