logs
View redacted approved diagnostic logs
connected 1.0.0 Apache-2.0
Install
docsloth component add @docsloth/logs@1.0.0 \
--registry https://registry.docsloth.devRun it in a project that has a docsloth.config.json (docsloth init writes one). The docsloth CLI is not on npm yet: it runs from a checkout of the Docsloth engine, and the quickstart shows the setup. Every official component already renders in Docsloth sites; installing one vendors its props schema and specification and pins this exact version and digest.
What the CLI checks
docsloth component add reads this entry from index.json, recomputes the package digest from the manifest and the digest of every file, and writes nothing if one differs.
index.json, lines 547–564547 {548 "name": "@docsloth/logs",549 "version": "1.0.0",550 "kind": "block",551 "description": "View redacted approved diagnostic logs",552 "license": "Apache-2.0",553 "engine": ">=1 <2",554 "publisher": "docsloth",555 "digest": "sha256:ab7d4448c13820a9f6a9a6d8fa00cd07a37884dd142754f531cb34fbd78fb9c7",556 "blocks": [557 "logs"558 ],559 "capabilities": [560 "render.html"561 ],562 "manifest_path": "packages/@docsloth/logs/1.0.0/manifest.json",563 "files_base": "packages/@docsloth/logs/1.0.0/files"564 },Trust signals
- Runtime trust class (catalog)
- connected. Reaches a service only through a capability the host grants explicitly, and never receives raw credentials.
- Install trust class
- interactive, derived from the declared
render.html. This is the classdocsloth component addanddocsloth component listreport; it installs under the default policy, with no trust policy. - Package
@docsloth/logs, version1.0.0- Package digest
sha256:ab7d4448c13820a9f6a9a6d8fa00cd07a37884dd142754f531cb34fbd78fb9c7- Files
- 2 files, each pinned by its own sha256 digest (listed under Package files)
- Capabilities declared
render.html. A declaration, never a grant; every official package declares the same.- Publisher
docsloth, a publisher id rather than a verified identity- Licence
Apache-2.0- Engine range
>=1 <2- Index signature
- Not signed. Digests prove the bytes match the index, not who published them.
- Tools
query,filter- Built from
packages/contracts/component-props/logs.schema.jsonandpackages/contracts/component-specs/logs.mdin docsloth-registry
Props
The props schema is packages/contracts/component-props/logs.schema.json; props it does not list are rejected.
| Prop | Type | Required | Notes |
|---|---|---|---|
title | string | no | maxLength: 160 |
resource | object | yes | additionalProperties: false |
resource.resource_id | string | yes | format: uuid |
resource.operation | string | yes | maxLength: 160 |
resource.environment | "test" | "staging" | "production" | yes | |
query_template_id | string | yes | maxLength: 256 |
max_rows | integer | yes | |
redaction_profile | string | yes | maxLength: 256 |
Required: resource, query_template_id, max_rows, redaction_profile.
Example props generated from the schema
{
"title": "example-title",
"resource": {
"resource_id": "00000000-0000-4000-8000-000000000000",
"operation": "example-operation",
"environment": "test"
},
"query_template_id": "example-query_template_id",
"max_rows": 1,
"redaction_profile": "example-redaction_profile"
}Preview
Rendered by @docsloth/renderer from a document block whose props are generated from the schema, so the values are placeholders.
Document block
{
"type": "logs",
"props": {
"title": "example-title",
"resource": {
"resource_id": "00000000-0000-4000-8000-000000000000",
"operation": "example-operation",
"environment": "test"
},
"query_template_id": "example-query_template_id",
"max_rows": 1,
"redaction_profile": "example-redaction_profile"
}
}example-title
- Query
example-query_template_id- Row limit
- 1
- Redaction profile
example-redaction_profile- Runs
example-operationin the test environment
Querying logs needs the live documentation site.
This is the renderer's real HTML with this registry's styles. Links and controls in the preview are inactive.
Rendered HTML
<section class="ds-block ds-logs" data-component="logs" aria-labelledby="b-title">
<h3 class="ds-block-title" id="b-title">example-title</h3>
<dl class="ds-facts">
<div>
<dt>Query</dt>
<dd>
<code>example-query_template_id</code>
</dd>
</div>
<div>
<dt>Row limit</dt>
<dd>1</dd>
</div>
<div>
<dt>Redaction profile</dt>
<dd>
<code>example-redaction_profile</code>
</dd>
</div>
<div>
<dt>Runs</dt>
<dd>
<code>example-operation</code> in the test environment</dd>
</div>
</dl>
<p class="ds-live-note" role="note">Querying logs needs the live documentation site.</p>
</section>Specification
From packages/contracts/component-specs/logs.md.
Contract
Production props are normative in ../contracts/component-props/logs.schema.json. The corresponding component-fixtures manifest is only a minimal protocol fixture; use the production props schema when building the published package. The packaged artifact ships exactly its generated component-package.json manifest plus props.schema.json (the production props schema, copied byte-for-byte) and spec.md (this spec, copied byte-for-byte); it contains no executable payload, fallback implementation, Storybook, test suite, SSR harness or README. Rendering behavior and the acceptance cases below belong to the renderer and the repository tests, not to the package. Installation pins the package version and the digest of every shipped byte.
Intended behavior
Approved parameterized log queries only; no general SQL or unrestricted production log access.
Failure and fallback
Timeout exposes redacted error; log lines treated as untrusted text.
The React component resolves ComponentContentProvider.logQueries using logQueryKey(resource, query_template_id, redaction_profile, max_rows). An available adapter is pinned to the release, actor session, query version and all key fields. It may supply a redacted snapshot and an explicit query action; no query runs during rendering, hydration or local level filtering. General SQL, arbitrary query strings and legacy inline lines props are not accepted.
The host authorizes and budgets each query, enforces the approved template and row limit, and applies its redaction profile before sending data to the client. Snapshots must identify the complete scope, capture time, immutable snapshot ID, truncation and applied redaction. The client admits at most the requested 1–500 rows, 4,096 UTF-16 code units per message and 131,072 total code units of row identifiers/messages. Identifiers are bounded and unique, severity is typed, and timestamp dates/times must be valid and explicitly zoned. Extra response fields are discarded. Host serialization and transport need independent byte limits; these in-memory checks do not bound an untrusted network response.
Common credential, email and IP patterns are additionally masked for display, and markup is rendered as text. This is not complete PII detection and cannot protect data already delivered. Failed queries show a fixed public-safe error, never raw server details. Denial or malformed results clear prior rows. Stop waiting aborts the adapter signal and discards late replies, without claiming server cancellation. Scope and supplied snapshot changes reset displayed data. No browser persistence, polling, model or executor dispatch occurs. Production core/cloud transport and server protections remain host integration work.
Required acceptance cases
Stored XSS and PII token fixtures never rendered raw. Also test empty data, loading, denied access, browser without JS, mobile 360px, keyboard navigation, dark mode and an explicit constrained agent tool call. The server independently authorizes capability requests; a package manifest cannot grant authority.
Data and maintenance
Data bindings resolve from a specific publication/release vector and permitted fact/evidence graph. Configuration edits create versioned component patches. Update invalidation uses dependency IDs, never indiscriminate whole-page regeneration. Human-owned props survive automatic updates unless invalidated with an explicit conflict. Missing optional resources leave an honest inert/readable fallback, not a broken page or fake success.
Cost and tools
Pure/local interaction must never invoke a model by accident. Any model, remote query or executor call must reserve approved budget before dispatch. Public visitors do not inherit owner resources. The component may call only named tools in its signed manifest with valid typed inputs. A cancelled job stops polling and closes resources. No component gets platform administration, raw credentials or an unlimited execution loop.
Runtime contract
The protocol fixture packages/contracts/component-fixtures/logs.json records what this component may ask of a host when it runs. It is a contract, not a shipped runtime: the installable package contains no executable code.
| Field | Value |
|---|---|
| Network hosts | none |
| Production writes | not allowed |
| Longest run | 120 seconds |
| Recording | blocked |
| Fallback output | html, markdown, json |
| Tool | Effect | Needs confirmation |
|---|---|---|
query | reads only | no |
filter | reads only | no |
Package files
Served under packages/@docsloth/logs/1.0.0/. The package digest covers manifest.json, which lists each file with its digest.
| File | sha256 digest | Bytes |
|---|---|---|
props.schema.json | sha256:d1abaf540dd64822e09c6c9562d3cd41a155ff3528fe9c27f43af83632182be7 | 1182 |
spec.md | sha256:685d3fff42ed2871e49592350b4e7274fa3dac4cdd13c4dbebd4287380c8a201 | 4028 |
Sources
| Source | Location |
|---|---|
| Markdown twin | https://registry.docsloth.dev/docs/logs.md |
| JSON metadata | https://registry.docsloth.dev/api/v1/components/logs.json |
| Specification | packages/contracts/component-specs/logs.md |
| Props schema | packages/contracts/component-props/logs.schema.json |
| Protocol fixture | packages/contracts/component-fixtures/logs.json |
| Catalog | packages/contracts/component-catalog.json |