Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
154 commits
Select commit Hold shift + click to select a range
3b27f14
Update serde-human-bytes to 0.1.2
kvinwang Dec 19, 2025
e533464
Update dcap-qvl 0.3.4
kvinwang Dec 19, 2025
b53de04
dstack-util: Refactor remove orphans
kvinwang Dec 19, 2025
e3fa46f
cvm: dstack-prepare depends on network-online.target
kvinwang Dec 19, 2025
a1ae983
cvm: re-structure the volatile dirs
kvinwang Dec 19, 2025
6334726
dstack-mr: Support for vvfat/vhd shared volume
kvinwang Dec 19, 2025
7fff019
cvm: Support for alternative host share modes
kvinwang Dec 19, 2025
8aab28f
Remove tdx-attest-sys
kvinwang Dec 19, 2025
4382970
tpm: Add tpm crates
kvinwang Dec 19, 2025
9ef4609
vmm: Support for config product info
kvinwang Dec 19, 2025
e9d2a73
Add key-provider kind tpm
kvinwang Dec 19, 2025
ab49844
vmm: Support for key-provider tpm (it doesn't work)
kvinwang Dec 19, 2025
f40384b
vmm: Support for quote_generation_socket
kvinwang Dec 19, 2025
4502f62
vmm-cli: Support for key provider
kvinwang Dec 19, 2025
9f771a1
eventlog: Refactor cc-eventlog
kvinwang Dec 19, 2025
b6deccb
eventlog: Add tpm in cc-eventlog
kvinwang Dec 19, 2025
c9fad02
cvm: Detect data disk by label
kvinwang Dec 19, 2025
85d4539
cvm: Skip loading tdx_guest if already exists
kvinwang Dec 19, 2025
609c43c
cvm: Mount tsm configfs in boot script
kvinwang Dec 19, 2025
ce639ea
cvm: Support for TPM key provider
kvinwang Dec 19, 2025
f47bd9f
kms: Use attestation v2
kvinwang Dec 19, 2025
d5a5856
gw: Use attestation v2
kvinwang Dec 19, 2025
d308c08
guest-agent: AttestationV2
kvinwang Dec 19, 2025
1600846
ratls: Attestation V2
kvinwang Dec 19, 2025
704364c
sdk: Add GetAttestation
kvinwang Dec 19, 2025
6f837a7
verifier: Attestation V2
kvinwang Dec 19, 2025
c56c5da
dstack-util: Add debug commands
kvinwang Dec 19, 2025
01f7c5f
mod tdx_guest: Compile on kernel 6.17
kvinwang Dec 19, 2025
8a186cd
Update Cargo.lock
kvinwang Dec 19, 2025
2bb190e
dstack-util: add attest subcommand
kvinwang Dec 20, 2025
6d35ba3
guest-agent: Implement fn attest
kvinwang Dec 19, 2025
f5d4aad
simulate Attestation
kvinwang Dec 20, 2025
83da3f2
Add tests for fn attest to sdk
kvinwang Dec 20, 2025
9dc7ce4
Remove unused code
kvinwang Dec 20, 2025
c221551
ra-tls: Refactor add_ext and strip code
kvinwang Dec 20, 2025
f4e4f48
dstack-util: add attest info subcommand
kvinwang Dec 20, 2025
bde5002
dstack-util: Add attest-json and attest-strip subcommands
kvinwang Dec 20, 2025
f5d4a23
Refactor cc eventlog
kvinwang Dec 20, 2025
25f68eb
Link tdx quote to tpm quote
kvinwang Dec 20, 2025
4ee124f
Fix cargo clippy
kvinwang Dec 20, 2025
3c75b2a
Use ppid hash as device_id
kvinwang Dec 20, 2025
a32f2fc
Remove tdx mrs from AppInfo and BootInfo
kvinwang Dec 20, 2025
a308135
Add back rtmrs in GetInfo api
kvinwang Dec 21, 2025
2d7d07c
Fix some tests
kvinwang Dec 21, 2025
4a8263e
eventlog: Encode runtime event payload to base64
kvinwang Dec 21, 2025
432d555
ra-tls: Change Attestation oid to .8
kvinwang Dec 21, 2025
5b3c7c7
Use PcrHandle::try_from for PCR Handle
kvinwang Dec 21, 2025
7718200
Fix unit tests
kvinwang Dec 21, 2025
2b885a3
Update attestation.bin
kvinwang Dec 21, 2025
76086bb
verifier: use hex_literal
kvinwang Dec 21, 2025
72ffe34
vmm-ui: Default to zfs in clone config
kvinwang Dec 22, 2025
678226c
cvm: Skip host notify on GCP
kvinwang Dec 22, 2025
328273a
Create containerd dir and let containerd start after dstack-prepare
kvinwang Dec 22, 2025
2361081
cvm: Print df -h on start
kvinwang Dec 22, 2025
bccc20d
remove-orphans: Don't print Docker containers directory does not exist
kvinwang Dec 22, 2025
3600ac9
dstack-mr: Add option --qemu-version
kvinwang Dec 22, 2025
ed57afa
Merge pull request #419 from Dstack-TEE/mr-qemu-ver
kvinwang Dec 22, 2025
7427b78
Update rust to 1.92.0
kvinwang Dec 22, 2025
26e4f0a
Fix reuse lint
kvinwang Dec 22, 2025
c613616
vmm: Minor comment update
kvinwang Dec 22, 2025
31def02
Pure Rust tpmp2 crate implementation
kvinwang Dec 22, 2025
39e1cd6
tpm: Add some tests
kvinwang Dec 23, 2025
585f10e
Remove unused field
kvinwang Dec 23, 2025
687af3c
tpm: Use scale codec to seal data
kvinwang Dec 23, 2025
805b554
Remove mod-tdx-guest
kvinwang Dec 23, 2025
b4a94a8
optional host_api_url
kvinwang Dec 24, 2025
8d2e2c5
verifier: Allow missing cpus and mem in vm_config for GCPP
kvinwang Dec 24, 2025
f1a49f0
Update path of user-config in docs
kvinwang Dec 24, 2025
448e606
Update simulator configs
kvinwang Dec 24, 2025
5f05fbb
Fix unit tests
kvinwang Dec 24, 2025
fb232ee
Add nitro TPM support (step 1)
kvinwang Dec 24, 2025
404ba25
ct_monitor: Use HTTP endpoint instead of pRPC for acme-info
h4x3rotab Dec 25, 2025
a153bc0
Add nsm-attest
kvinwang Dec 25, 2025
c2849c4
attestation: Use enum rather than option
kvinwang Dec 25, 2025
440d592
Add nsm-qvl
kvinwang Dec 26, 2025
349595a
Add nitro enclave attestation
kvinwang Dec 26, 2025
0fc0fde
Put crates in workspace
kvinwang Dec 26, 2025
7e3fb1a
Fix REUSE warn
kvinwang Dec 26, 2025
e7d5a94
nsm-qvl: More restriction verification
kvinwang Dec 26, 2025
1e5159d
nsm-qvl: Add optional crl check
kvinwang Dec 26, 2025
013be17
Align workspace deps
kvinwang Dec 26, 2025
b18b2a0
fix(ct_monitor): enable TLS certificate verification
h4x3rotab Dec 31, 2025
81cf2ef
build(deps): bump qs from 6.13.1 to 6.14.1 in /kms/auth-eth
dependabot[bot] Jan 1, 2026
09d10bc
Merge pull request #424 from Dstack-TEE/dependabot/npm_and_yarn/kms/a…
kvinwang Jan 4, 2026
ffb41d9
Add attestation doc for gpc and nitro
kvinwang Jan 4, 2026
10a6bbe
ct_monitor: Verify the quote of certs
kvinwang Jan 4, 2026
c122dd6
vmm-ui: Sync generated console_v1.html
kvinwang Jan 5, 2026
ec8aba4
Add CI for vmm-ui
kvinwang Jan 5, 2026
59b09a4
ci: More friendly error report
kvinwang Jan 5, 2026
b27f81c
ci: Add permissions
kvinwang Jan 5, 2026
36f4151
Merge pull request #421 from Dstack-TEE/fix-ct-monitor-endpoint
kvinwang Jan 5, 2026
cb2eddd
Merge pull request #426 from Dstack-TEE/ci-for-vmm-ui
kvinwang Jan 5, 2026
ffd0c48
chore(docs): remove unused path parameter from JS SDK docs
Olexandr88 Jan 7, 2026
753da65
feat(webui): add support for spesific IPs for port binding
barakeinav1 Dec 15, 2025
4a2b0a5
add support for dedicated IP
barakeinav1 Jan 6, 2026
09d791f
vmm-ui: update generated console_v1.html
barakeinav1 Jan 6, 2026
3c8c195
webui: revert app.html formatting changes
barakeinav1 Jan 8, 2026
b95a7e9
webui: add dedicated IP UI to app.html
barakeinav1 Jan 8, 2026
4826386
documentation cleanup
barakeinav1 Jan 8, 2026
6e5ef5e
update console_v1
barakeinav1 Jan 8, 2026
516940f
fix(sdk/js): isReachable not works for dstack v0.5.x
Leechael Jan 8, 2026
789a010
Merge pull request #427 from Olexandr88/master
Leechael Jan 8, 2026
5135060
build(deps-dev): bump @smithy/config-resolver in /kms/auth-eth
dependabot[bot] Jan 8, 2026
b235f69
Merge pull request #429 from Dstack-TEE/dependabot/npm_and_yarn/kms/a…
kvinwang Jan 9, 2026
70188f8
ci: Fix vmm-ui check
kvinwang Jan 9, 2026
c40311e
Fix whitespaces in console_v1.html
kvinwang Jan 9, 2026
6ce16c2
Merge pull request #425 from barakeinav1/barak/webui_enable_dedicated…
kvinwang Jan 9, 2026
c43e4d3
Update dcap-qvl to 0.3.8
kvinwang Jan 9, 2026
5074ce4
Update rust to 1.92.0
kvinwang Dec 22, 2025
66beec6
Merge pull request #428 from Dstack-TEE/sdk-fix-is-reachable-api
Leechael Jan 9, 2026
ed1383f
build(deps): bump hono from 4.10.3 to 4.11.4 in /kms/auth-eth-bun
dependabot[bot] Jan 13, 2026
77e432b
build(deps): bump github.com/ethereum/go-ethereum in /sdk/go
dependabot[bot] Jan 13, 2026
a75b377
build(deps): bump hono from 4.10.3 to 4.11.4 in /kms/auth-mock
dependabot[bot] Jan 13, 2026
5ffcb04
Merge pull request #431 from Dstack-TEE/dependabot/npm_and_yarn/kms/a…
h4x3rotab Jan 13, 2026
41105f7
Merge pull request #433 from Dstack-TEE/dependabot/npm_and_yarn/kms/a…
h4x3rotab Jan 13, 2026
7f436ed
Merge pull request #432 from Dstack-TEE/dependabot/go_modules/sdk/go/…
h4x3rotab Jan 13, 2026
9ceb85a
WIP: readme revamp and docs restructure
h4x3rotab Dec 25, 2025
21bb694
docs: improve on-chain governance guide
h4x3rotab Dec 27, 2025
9954cc2
feat(kms): add auth-simple config-based authorization server
h4x3rotab Dec 27, 2025
5a5da9b
fix(sdk/rust): add Host header for Unix socket requests
h4x3rotab Dec 28, 2025
380b5d2
docs: revamp SDK READMEs and update main documentation
h4x3rotab Dec 29, 2025
9c5ad07
docs: add consolidated confidential AI guide
h4x3rotab Dec 30, 2025
7b3487d
docs: update README links for consolidated docs
h4x3rotab Dec 30, 2025
763a1f2
docs: add GPU TEE deployment guide for agents
h4x3rotab Dec 30, 2025
a4d3c56
docs: consolidate security documentation and add landing page
h4x3rotab Dec 30, 2025
e8a6f86
docs: add 'What You Can Build' section to confidential AI guide
h4x3rotab Dec 31, 2025
b1b5676
Update "trusted by" section
h4x3rotab Dec 31, 2025
729d195
docs: add verification tutorial and reorganize documentation index
h4x3rotab Dec 31, 2025
dd8a480
docs: add FAQ section with comparison and collapsible content
h4x3rotab Dec 31, 2025
119b0c1
docs: add citation section with arXiv reference
h4x3rotab Dec 31, 2025
2f8fd79
chore: fix reuse lint errors for dependency files
h4x3rotab Dec 31, 2025
8f306f6
chore: restore ct_monitor to upstream state
h4x3rotab Jan 13, 2026
c329c58
Merge pull request #423 from Dstack-TEE/readme-revamp
h4x3rotab Jan 14, 2026
c043e66
build(deps): bump hono from 4.10.3 to 4.11.4 in /kms/auth-simple
dependabot[bot] Jan 14, 2026
eebaca0
Merge pull request #434 from Dstack-TEE/dependabot/npm_and_yarn/kms/a…
kvinwang Jan 14, 2026
562d597
Merge pull request #430 from Dstack-TEE/up-dcap-qvl
kvinwang Jan 14, 2026
ed4f9dd
Fix clippy errors
kvinwang Jan 14, 2026
b941fa4
Merge pull request #435 from Dstack-TEE/fix-clippy
kvinwang Jan 14, 2026
f900600
build(deps): bump tracing-subscriber from 0.3.19 to 0.3.20
dependabot[bot] Jan 14, 2026
b914214
Merge pull request #313 from Dstack-TEE/dependabot/cargo/tracing-subs…
kvinwang Jan 14, 2026
cec804b
Update comment
kvinwang Jan 14, 2026
db8356a
Update dcap-qvl to 0.3.8
kvinwang Jan 14, 2026
23ccf00
Update docs for agent.Attest
kvinwang Jan 15, 2026
d789e35
Add systemd drop-ins for dstack-prepare
kvinwang Jan 15, 2026
63f30ce
refactor attestation for multi-provider support
kvinwang Jan 15, 2026
73b05a5
Merge remote-tracking branch 'ds/master' into refactor-for-cloud-prov…
kvinwang Jan 15, 2026
736abd8
Fix clippy
kvinwang Jan 15, 2026
370bd67
Fix unit test
kvinwang Jan 15, 2026
841ff6e
Merge branch 'nitro-dev' into nitro
kvinwang Jan 15, 2026
709339c
Fix unit tests
kvinwang Jan 15, 2026
9df8aa1
Merge branch 'refactor-for-cloud-providers' into nitro
kvinwang Jan 15, 2026
0605259
dstack-util: Add --root-ca to get-key
kvinwang Jan 15, 2026
68558a9
kms: Fix the quote display in onboard page
kvinwang Jan 15, 2026
425ae9c
Switch LICENSE to BUSL-1.1
kvinwang Jan 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
235 changes: 235 additions & 0 deletions .agent/GPU_TEE_DEPLOYMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,235 @@
# GPU TEE Deployment Guide

Learnings from deploying GPU workloads to Phala Cloud TEE infrastructure.

## Instance Types

Query available instance types:
```bash
curl -s "https://cloud-api.phala.network/api/v1/instance-types" | jq
```

### CPU-only (Intel TDX)
- `tdx.small` through `tdx.8xlarge`

### GPU (H200 + TDX)
- `h200.small` — Single H200 GPU, suitable for inference
- `h200.16xlarge` — Multi-GPU for larger workloads
- `h200.8x.large` — High-memory configuration

## Deployment Commands

### GPU Deployment
```bash
phala deploy -n my-app -c docker-compose.yaml \
--instance-type h200.small \
--region US-EAST-1 \
--image dstack-nvidia-dev-0.5.4.1
```

Key flags:
- `--instance-type h200.small` — Required for GPU access
- `--image dstack-nvidia-dev-0.5.4.1` — NVIDIA development image with GPU drivers
- `--region US-EAST-1` — Region with GPU nodes (gpu-use2)

### Debugging
```bash
# Check CVM status
phala cvms list

# View serial logs (boot + container output)
phala cvms serial-logs <app_id> --tail 100

# Delete CVM
phala cvms delete <name-or-id> --force
```

## Docker Compose GPU Configuration

GPU devices must be explicitly reserved in docker-compose.yaml:

```yaml
services:
my-gpu-app:
image: my-image
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
```

Without the `deploy.resources.reservations.devices` section, the container will fail with:
```
libcuda.so.1: cannot open shared object file: No such file or directory
```

## vLLM Example

Working docker-compose.yaml for vLLM inference:

```yaml
services:
vllm:
image: vllm/vllm-openai:latest
volumes:
- /var/run/dstack.sock:/var/run/dstack.sock
environment:
- NVIDIA_VISIBLE_DEVICES=all
- HF_TOKEN=${HF_TOKEN:-}
ports:
- "8000:8000"
command: >
--model Qwen/Qwen2.5-1.5B-Instruct
--host 0.0.0.0
--port 8000
--max-model-len 4096
--gpu-memory-utilization 0.8
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
```

## Endpoint URLs

After deployment, the app is accessible at:
```
https://<app_id>-<port>.dstack-pha-<region>.phala.network
```

Example for vLLM on port 8000:
```bash
# List models
curl https://<app_id>-8000.dstack-pha-use2.phala.network/v1/models

# Chat completion
curl -X POST https://<app_id>-8000.dstack-pha-use2.phala.network/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"model": "Qwen/Qwen2.5-1.5B-Instruct", "messages": [{"role": "user", "content": "Hello"}]}'
```

## vllm-proxy (Response Signing)

vllm-proxy provides response signing and attestation for vLLM inference. It sits between clients and vLLM, signing responses with TEE-derived keys.

### Configuration

**IMPORTANT**: The authentication environment variable is `TOKEN`, not `AUTH_TOKEN`.

```yaml
services:
vllm:
image: vllm/vllm-openai:latest
environment:
- NVIDIA_VISIBLE_DEVICES=all
command: >
--model Qwen/Qwen2.5-1.5B-Instruct
--host 0.0.0.0
--port 8000
--max-model-len 4096
--gpu-memory-utilization 0.8
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]

proxy:
image: phalanetwork/vllm-proxy:v0.2.18
volumes:
- /var/run/dstack.sock:/var/run/dstack.sock # Required for TEE key derivation
environment:
- VLLM_BASE_URL=http://vllm:8000
- MODEL_NAME=Qwen/Qwen2.5-1.5B-Instruct
- TOKEN=your-secret-token # NOT AUTH_TOKEN
ports:
- "8000:8000"
depends_on:
- vllm
```

### API Endpoints

```bash
# List models (no auth required)
curl https://<endpoint>/v1/models

# Chat completion (requires auth)
curl -X POST https://<endpoint>/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your-secret-token" \
-d '{"model": "Qwen/Qwen2.5-1.5B-Instruct", "messages": [{"role": "user", "content": "Hello"}]}'

# Get response signature
curl https://<endpoint>/v1/signature/<chat_id> \
-H "Authorization: Bearer your-secret-token"

# Attestation report
curl https://<endpoint>/v1/attestation/report \
-H "Authorization: Bearer your-secret-token"
```

### Tested Configuration

- Image: `phalanetwork/vllm-proxy:v0.2.18`
- Instance: `h200.small`
- Region: `US-EAST-1`
- Model: `Qwen/Qwen2.5-1.5B-Instruct`

### vllm-proxy Issues

**"Invalid token" error**:
- Check that you're using `TOKEN` environment variable, not `AUTH_TOKEN`
- Verify the token value matches your request header

**"All connection attempts failed" from proxy**:
- vLLM is still loading the model (takes 1-2 minutes after container starts)
- Wait for vLLM to show "Uvicorn running on" in serial logs

**NVML error on attestation**:
- GPU confidential computing attestation may not be fully available
- This doesn't affect inference or response signing

## Common Issues

### "No available resources match your requirements"
- GPU nodes are limited. Wait for other CVMs to finish or try a different region.
- Ensure you're using the correct instance type (`h200.small`).

### Container crashes with GPU errors
- Add `deploy.resources.reservations.devices` section to docker-compose.yaml.
- Verify using NVIDIA development image (`dstack-nvidia-dev-*`).

### Image pull takes too long
- Large images (5GB+ for vLLM) take 3-5 minutes to download and extract.
- Check serial logs for progress.

## Testing Workflow

1. Deploy: `phala deploy -n test -c docker-compose.yaml --instance-type h200.small --region US-EAST-1 --image dstack-nvidia-dev-0.5.4.1`
2. Wait for status: `phala cvms list` (wait for "running")
3. Check logs: `phala cvms serial-logs <app_id> --tail 100`
4. Test API: `curl https://<app_id>-<port>.dstack-pha-use2.phala.network/...`
5. Cleanup: `phala cvms delete <name> --force`

## GPU Wrapper Script

For repeated GPU deployments, use a wrapper script:

```bash
#!/bin/bash
# phala-gpu.sh
source "$(dirname "$0")/.env"
export PHALA_CLOUD_API_KEY=$PHALA_CLOUD_API_GPU
phala "$@"
```

This allows maintaining separate API keys for CPU and GPU workspaces.
137 changes: 137 additions & 0 deletions .agent/WRITING_GUIDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
# Documentation Writing Guide

Guidelines for writing dstack documentation, README, and marketing content.

## Writing Style

- **Don't over-explain** why a framework is needed — assert the solution, hint at alternatives being insufficient
- **Avoid analogies as taglines** (e.g., "X for Y") — if it's a new category, don't frame it as a better version of something else
- **Problem → Solution flow** without explicit labels like "The problem:" or "The solution:"
- **Demonstrate features through actions**, not parenthetical annotations
- Bad: "Generates quotes (enabling *workload identity*)"
- Good: "Generates TDX attestation quotes so users can verify exactly what's running"

## Procedural Documentation (Guides & Tutorials)

### Test Before You Document
- **Run every command** before documenting it — reading code is not enough
- Commands may prompt for confirmation, require undocumented env vars, or fail silently
- Create a test environment and execute the full flow end-to-end

### Show What Success Looks Like
- **Add sample outputs** after commands so users can verify they're on track
- For deployment commands, show the key values users need to note (addresses, IDs)
- For validation commands, show both success and failure outputs

### Environment Variables
- **List all required env vars explicitly** — don't assume users will discover them
- If multiple tools use similar-but-different var names, clarify which is which
- Show the export pattern once, then reference it in subsequent commands

### Avoid Expert Blind Spots
- If you say "add the hash", explain how to compute the hash
- If you reference a file, explain where to find it
- If a value comes from a previous step, remind users which step

### Cross-Reference Related Docs
- Link to prerequisite guides (don't repeat content)
- Link to detailed guides for optional deep-dives
- Use anchor links for specific sections when possible

## Security Documentation

### Trust Model Framing

**Distinguish trust from verification:**
- "Trust" = cannot be verified, must assume correct (e.g., hardware)
- "Verify" = can be cryptographically proven (e.g., measured software)

**Correct framing:**
- Bad: "You must trust the OS" (when it's verifiable)
- Good: "The OS is measured during boot and recorded in the attestation quote. You verify it by..."

### Limitations: Be Honest, Not Alarmist

State limitations plainly without false mitigations:
- Bad: "X is a single point of failure. Mitigate by running your own X."
- Good: "X is protected by [mechanism]. Like all [category] systems, [inherent limitation]. We are developing [actual solution] to address this."

Don't suggest mitigations that don't actually help. If something is an inherent limitation of the technology, say so.

## Documentation Quality Checklist

From doc-requirements.md:

1. **No bullet point walls** — Max 3-5 bullets before breaking with prose
2. **No redundancy** — Don't present same info from opposite perspectives
3. **Conversational language** — Write like explaining to a peer
4. **Short paragraphs** — Max 4 sentences per paragraph
5. **Lead with key takeaway** — First sentence tells reader why this matters
6. **Active voice** — "TEE encrypts memory" not "Memory is encrypted by TEE"
7. **Minimal em-dashes** — Max 1-2 per page, replace with "because", "so", or separate sentences

### Redundancy Patterns to Avoid

These often say the same thing:
- "What we protect against" + "What you don't need to trust"
- "Security guarantees" + "What attestation proves"

Combine into single sections. One detailed explanation, brief references elsewhere.

## README Structure

### Order Matters
- **Quick Start before Prerequisites** — Lead with what it does, not setup
- **How It Works after Quick Start** — Users want to run it first, understand later
- Cleanup at the end, Further Reading last

### Don't Duplicate
- Link to conceptual docs instead of repeating content
- If an overview README duplicates an example README, cut the overview
- One detailed explanation, brief references elsewhere

### Remove Unrealistic Sections
- If most users can't actually do something (e.g., run locally without special hardware), don't include it
- Don't document workflows that require resources users don't have

### Match the Workflow to the User
- Use tools your audience already knows (e.g., Jupyter for ML practitioners)
- Prefer official/existing images when they exist — don't reinvent
- Make the correct path the default, mention alternatives briefly

## Code Examples

### Question Every Snippet
- Does this code actually demonstrate something meaningful?
- Would a reader understand what it does without the prose?
- `do_thing(b"magic-string")` means nothing — show real use or remove it

### Diagrams
- Mermaid over ASCII art — GitHub renders it nicely
- Keep diagrams simple — 3-5 nodes max
- Label edges with actions, not just arrows

## Conciseness

### Less is More
- 30 lines beats 150 if it says the same thing
- Cut sections that don't help users accomplish their goal
- Tables for reference, prose for explanation — don't over-table

### Performance and Benchmarks
- One memorable number + link to full report
- Don't overwhelm with data the reader didn't ask for

### Reader-First Writing
- Ask "what does the reader want to know?" not "what do I want to say?"
- If a section answers a question nobody asked, cut it

## Maintenance

### Consistency Checks
- After terminology changes, grep for related terms across all files
- Use correct industry/vendor terminology (e.g., "Confidential Computing" not "Encrypted Computing")

### Clean Up Old Files
- When approach changes, delete orphaned files (old scripts, Dockerfiles)
- Don't leave artifacts from previous implementations
2 changes: 1 addition & 1 deletion .github/workflows/gateway-release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SPDX-FileCopyrightText: © 2025 Phala Network <dstack@phala.network>
#
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: BUSL-1.1

name: Gateway Release

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/kms-release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SPDX-FileCopyrightText: © 2025 Phala Network <dstack@phala.network>
#
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: BUSL-1.1

name: KMS Release

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rust-sdk-release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SPDX-FileCopyrightText: © 2025 Phala Network <dstack@phala.network>
#
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: BUSL-1.1

name: Publish SDK to crates.io
on:
Expand Down
Loading
Loading