docs: document artifact reject rules

This commit is contained in:
Haitao Pan 2026-06-08 07:13:51 +08:00
parent 261d49cf9a
commit 70bcd12037

View File

@ -5,15 +5,29 @@ working but should not be synced as user-visible artifacts.
## File Location ## File Location
Place `artifact-ignore.md` at the root of the current XWorkmate/OpenClaw artifact Global rules are declared at the root of the current XWorkmate/OpenClaw artifact
scope: scope:
```text ```text
tasks/<session>/<run>/artifact-ignore.md tasks/<session>/<run>/artifact-ignore.md
``` ```
Rules are evaluated relative to that artifact scope. They do not apply to files Skill-specific rules are declared under the selected skill key:
outside the current run directory.
```text
tasks/<session>/<run>/skills/<skill-key>/artifact-ignore.md
```
Examples:
```text
tasks/<session>/<run>/skills/video-production/it-infra-evolution-video-v2/artifact-ignore.md
tasks/<session>/<run>/skills/workflows/content-pdf-with-images/artifact-ignore.md
```
The app loads the global file first, then the `artifact-ignore.md` files for the
skills selected on the current task. Rules are evaluated relative to the current
artifact scope. They do not apply to files outside the current run directory.
## Contract ## Contract
@ -53,6 +67,34 @@ Rule syntax:
Keep the rule set small and explicit. Prefer listing known intermediate Keep the rule set small and explicit. Prefer listing known intermediate
directories over broad patterns such as `**/*`. directories over broad patterns such as `**/*`.
## Content Reject Rules
Use a fenced `artifact-reject` block when a generated artifact is known to be a
placeholder or guard file that must not appear as a user-visible final
deliverable. The app loads these rules from the current artifact scope and
applies them during artifact sync/export.
```artifact-reject
path=exports/final.pdf
contentType=application/pdf
contains=XWorkmate Task Artifact
contains=Required extensions: pdf
contains=TaskThread workspace context:
contains=Workspace isolation rules:
```
Supported fields:
| Field | Meaning |
|---|---|
| `path` | Optional relative path or extension glob, for example `exports/final.pdf`, `*.pdf`, or `**/*.pdf` |
| `contentType` | Optional substring match against the artifact content type |
| `contains` | Required. Repeat for every text fragment that must be present in the artifact body |
Rules match only when every supplied field matches. Keep reject rules narrow:
they are for explicit placeholder/guard signatures, not for broad file-type
blocking. A real requested deliverable must not be rejected by policy.
## Recommended Intermediate Rules ## Recommended Intermediate Rules
These paths are normally safe to ignore when they exist only as build or scratch These paths are normally safe to ignore when they exist only as build or scratch