volcengine-tls
Use when operating Volcengine TLS (日志服务) through volclog in agent or CI sessions and you need a contract-first workflow for runtime selector resolution, discover/describe/exec routing, App resource or Topic resolution, envelope reading, large-result delivery, and error recovery without guessing commands, fields, or shortcut flows. 当用户提到火山引擎日志服务 TLS、volclog、日志检索/分析/导入/导出、 日志项目或日志主题等操作时调用。
Documentation & Preview
Best Practices
Use this file only for runtime semantics, recovery posture, and credential handling. Routing belongs in routing.md; multi-step execution order belongs in sops.md.
Do not use this file to reopen surface selection once routing is already clear. This file refines the quick recovery map in SKILL.md; it does not override the main skill's default first response.
Contents
- Runtime Signals
- Contract View And Recovery Precedence
- Dry-Run Scope
- Envelope Filtering
- Search, Histogram, And Analysis
- Error Object
- Profile And Credential Selection
- Doctor Boundary
- Thin Client Boundary
- Recovery Signals
- Known Traps
Runtime Signals
Read these signals in this order after routing is already clear:
- keep the chosen
tool / workflow / rawsurface fixed - let CLI decide how the result is delivered
- inspect the flat
errorobject only if the call failed
Key rules:
- Keep surface choice and delivery choice separate. Skill decides
tool / workflow / raw; CLI decides stdout vs file delivery. - Do not let shortcut-oriented help or examples change the runtime reading order described here.
- Let CLI
deliveryModedecide stdout vsfile_auto. - For
log.search, let CLIdeliveryModedecide stdout vsfile_autoafter the surface is already chosen. - Treat
outputModeas caller intent anddeliveryModeas runtime result: - explicit file request ->
deliveryMode=file_forced - auto spill because the envelope is too large ->
deliveryMode=file_auto - normal stdout ->
deliveryMode=stdout - For large responses, prefer
--output-mode file --output-dir <writable-dir>. - If auto spill fails because no writable directory was provided, rerun with
--output-dir <writable-dir>instead of inventing a filename. tool / workflow / rawwrite a full JSON envelope when file delivery is used, even if stdout format preference wasjsonl.log.exportandlog.export-analysisare the exception: their files contain exported data rows, while stdout keeps the envelope and points to the file throughartifacts.
Contract View And Recovery Precedence
- Use compact
tool describeoutput for discovery and ordinary flat requests. - Run
volclog tool describe <group.action> --view fullbefore authoring nested objects or whenever an expected optional field is absent from compact output. - Treat full view as the request-authoring schema; do not infer omitted optional fields from compact view.
- Read
risk,recovery, andusage_constraintsbefore executing or recovering a mutating operation. These operation-specific fields override the generic recovery tables in this skill. - Interpret
high-risk-retryas “retrying is high risk,” not as permission to retry automatically. - After an ambiguous high-risk result, use a get/describe/list reconciliation action only when the contract names one. If it does not, stop and escalate with the request ID and business error evidence.
Dry-Run Scope
--dry-runapplies toraw,tool exec, andworkflow exec. It does not apply totool describe,workflow describe, or shortcut groups.- For
tool execandworkflow exec,--dry-runvalidates contract shape and execution plan without sending the real mutating call. - For
raw,--dry-runonly validates the transport/local plan. It does not validate API-required fields the waytool execorworkflow execcan. - Treat any dry-run success as transport or contract confidence only. It is not proof that the business query or time window is semantically correct.
Envelope Filtering
--jmes-filterruns on the complete CLI envelope.--jmes-filteris stdout-only; do not combine it with file delivery.execution.projectionis different: it runs on the raw result before envelope wrapping.- Use
--jmes-filterfor envelope fields such asdata,summary, orerror. - Use
execution.projectiononly for raw service-result fields. - If
--jmes-filtertargets an existing envelope field whose value isnull, stdout returns literalnulland the command still succeeds. filter matched no valuemeans the path was wrong, not that a null field was returned.filter matched no valueandinvalid --jmes-filteraredecodefailures and return exit 3.- If the original envelope already failed, keep the original non-zero exit and
error.kind; a filter miss only adds a warning instead of replacing the failure.
Search, Histogram, And Analysis
Use this section to interpret result semantics after the surface has already been chosen.
log.searchitself supports plain search and SQL/analysis queries inQuery.- Use
log.searchfor interactive analysis, small previews, and quick iteration. log.describe-histogram-v1is for time-distribution preview and total-hit estimation only for pure search queries.log.export-analysisuses the same SearchLogs SQL/analysisQuerysyntax aslog.search; it does not add a new server-side analysis API or another pagination model.- Choose
log.export-analysiswhen the user needs the full analysis row set written as an export file for offline reading, downstream processing, or token-safe handoff. - Stay on
log.searchwhen the user is still validating SQL, iterating on the query, or only needs a small interactive preview. raw --inputis only a compatibility alias for--body; it does not dotool execstyle smart mapping for GET requests.HitCountis only the count returned in the currentSearchLogsresponse window.Histogram.TotalCountis the better whole-window total only for pure search when histogram is the correct surface.ResultStatus=incompletemeans the service returned only a partial scan. This can happen for SearchLogs in both search and analysis mode, so narrow the time range and rerun before trusting counts, rows, empty results, or bucket distribution.- For search+analysis or pure analysis queries, do not use histogram as the analysis row count. Use SQL such as
select count(*)when the user asks for analysis totals.
Error Object
Failed envelopes use one flat error object.
Read it in this order:
error.sourceerror.kinderror.hinterror.codeerror.statusCodeerror.messageerror.detailserror.requestId
Interpretation rules:
- For upstream service failures,
error.codeis already the business error code such asProjectAlreadyExist. - If the service embeds extra JSON details, the CLI lifts them into
error.details; do not parseerror.messageagain unlessdetailsis absent. - Use
error.kindto choose the smallest recovery action: validation: fix input or selector shape firstunsupported_feature: remove the unsupported capability, or switch surfaceincompatible_flags: remove one of the conflicting flags and rerunfilesystem: fix--output-dir, path, or local permissions before retrying
Profile And Credential Selection
Credential selection is a host/runtime concern, not a business-input concern.
- Discover saved profiles with
volclog configure list. - Omit
profileto use the active CLI profile. - Set
context.profileonly when switching tenant or environment inside one session. - For stateless service assistants and CI, keep long-lived credentials on the host. Let the host choose the local profile, then inject one-shot credentials with
--secrets-fileorcontext.secrets_file.
Preferred order:
- non-secret selector such as profile or environment label
--secrets-filecontext.secrets_file- process-scoped
VOLCENGINE_ACCESS_KEY_ID/VOLCENGINE_ACCESS_KEY_SECRETonly as fallback
Hard rule:
- Environment credentials override profile resolution. If a stateless run must target a specific local profile, use host-generated secrets files instead of sandbox-wide env injection.
--profile/context.profileand--secrets-file/context.secrets_fileare mutually exclusive runtime selectors; conflicting selectors fail fast instead of silently overriding each other.
Doctor Boundary
volclog doctoris for host/runtime diagnosis: credentials, config, selector visibility, endpoint reachability, and similar local setup issues.- Use
volclog doctorforerror.kind=config, and for stubborn401/credential problems after selector and endpoint checks. - Do not use
volclog doctoras a replacement fortool describeorworkflow describe. - Do not expect
volclog doctorto prove that a business query, time window, or SQL expression is semantically correct.
Thin Client Boundary
The CLI validates contract shape and runtime preconditions. It does not validate business semantics for you.
What the CLI does validate:
- required fields and JSON shape
- conflicting runtime selectors or output flags
- local output path / writable directory constraints
What the CLI does not try to judge:
- whether a timestamp is business-valid
- whether a query is semantically reasonable
- whether an empty result is surprising for the workload
If the command reached the service without a local validation/decode/filesystem error, debug the business query and time window before assuming the CLI blocked something.
Recovery Signals
When the command already failed, follow the smallest next action:
| Signal | Smallest next action | | --- | --- | | unknown tool | Re-run tool list or workflow list for the group before guessing aliases or fallback names. | | missing --input | Re-read input_schema and input_encoding_hint, then resend inline JSON, stdin, or file input using the documented shape. | | filter matched no value | Inspect one unfiltered response first, then correct the --jmes-filter or execution.projection path. | | jmes filter returned literal null | Treat literal null as a successful projection result; only debug further if the command returned a real filter error instead. | | 401 Unauthorized | Run volclog doctor, then inspect credentials, region, and endpoint. | | 403 Forbidden | Check tenant/profile alignment first, then verify resource permissions before retrying. | | error.kind=server or 5xx | Read error.code, error.requestId, and error.statusCode first. Retry with backoff only when the operation contract permits it and the failure is clearly transient; otherwise reconcile or escalate with those identifiers. | | IndexNotExists | Inspect or create the index, then wait for readiness before retrying search. | | TopicAlreadyExist | Re-list topics in the target project, then switch to get or modify instead of repeating create. | | ProjectAlreadyExist | Re-list projects, then switch to get or modify instead of repeating create. | | ResultStatus=incomplete | Narrow the time range and rerun before trusting counts, rows, or empty results. | | search returned empty after write | Confirm selector, topic, time range, and index readiness before widening the query. | | huge stdout payload | Rerun with --output-mode file --output-dir <writable-dir>, or reduce stdout with --jmes-filter or execution.projection. | | unsupported_feature | Remove the unsupported capability such as page.all, or switch to a surface whose contract explicitly supports it. | | filesystem | Supply a writable --output-dir, or fix the local path and permissions before retrying. |
Known Traps
page-all-is-not-compression:page.allincreases completeness and payload size; combine it with file delivery instead of expecting smaller stdout.jmes-filter-and-projection-have-different-scope: usesummary.*ordata.*under--jmes-filter, and raw keys only underexecution.projection.jmes-filter-null-is-still-success: literalnullmeans the sele