ragtime userspace-spec.instructions.md

A set of repository instructions for implementing user-space features in the Ragtime codebase, including runtime, workspace, preview, and sharing behavior.

In plain words
What is it for?
Use it when working on user-space runtime, collaboration, sharing, workspace files, preview sessions, or related control-plane and worker code.
Why use it?
It gives an agent the project-specific boundaries and architecture needed to change these areas without inventing new user-interface or permission rules.

Instructions file for GitHub Copilot

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/mattv8/ragtime/userspace-spec
Clone the repo
git clone --depth 1 https://github.com/mattv8/ragtime

Made for: GitHub Copilot.

Per session 5,025 This file is loaded in full into every session.
When invoked 5,025 The same file — it is already loaded in full.
Security scan C 2 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.05025 $0.05025
Opus 5 $0.02513 $0.02513
Sonnet 5 $0.01005 $0.01005
Haiku 4.5 $0.00502 $0.00502

Measured 2d ago against content hash ed45c73de026, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

ragtime userspace-spec.instructions.md scanned grade C with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

docker exec runtime-dev sh -c 'rm -rf /data/_userspace/workspaces/<test_id>/rootfs'

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- Why the browser lane can never be write-enabled: `ExecuteComponentRequest.request` is client-supplied query/command text with no execution-time binding of `component_id` to a server-registered query. Write-enabling it
.github/instructions/userspace-spec.instructions.md · 204 lines

How it starts

The opening of the file, as written. The whole thing — 204 lines — stays where its author put it; the contents beside it link to each section on GitHub.

User Space Feature Implementation Instructions

Last updated: 2026-07-14 (codebase-scanned; concise agent-focused)

Scope

  • Apply to User Space runtime/collab/share work in ragtime/userspace/** and runtime/**.
  • Keep changes incremental; do not invent new UX or role semantics.
  • Endpoint details belong in /docs (do not maintain static route dumps here).

Big Picture (How User Space Actually Works)

  • Control plane is in Ragtime app code (ragtime/userspace/runtime_service.py, ragtime/userspace/runtime_routes.py).
  • Data plane runs in runtime manager/worker code (runtime/manager/**, runtime/worker/**).
  • runtime/main.py chooses service mode via RUNTIME_SERVICE_MODE; manager mode also mounts worker routes.
  • Workspace runtime files live under ${INDEX_DATA_PATH}/_userspace/workspaces/{workspace_id}/files.
  • Preview is runtime-only and now uses dedicated per-workspace preview origins dispatched by PreviewHostDispatchMiddleware in ragtime/userspace/preview_host.py.
  • Preview launch is an explicit API step: control-plane routes mint short-lived bootstrap grants and the preview host mints a preview session cookie on first load.
  • Browser-auth cookie surfaces are only for collab and runtime_pty; preview no longer uses capability cookies.

Workspace Code Index Queue

  • Hidden User Space code indexes run through WorkspaceCodeIndexService (ragtime/userspace/workspace_code_index_service.py), not the generic filesystem indexer.
  • Dirty paths, manual reindex, missing-baseline reconcile, and process_dirty_workspace() all converge on durable workspace_code_index_jobs rows. Do not reintroduce direct asyncio.create_task() indexing paths.
  • Queue state is DB-owned: pending rows carry waiting_for_job_id; the runner atomically claims rows with FOR UPDATE SKIP LOCKED, clears the wait pointer, then runs them as indexing.
  • userspace_code_index_max_concurrency controls active jobs (default 1, admin range 1..8), but one workspace must not have two active code-index jobs at once.
  • Pending jobs cancel immediately; running jobs set cancel_requested and trip the in-memory cancellation flag checked during processing. Keep cancelled distinct from failed.

Read the full file on GitHub · 204 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 204 lines · 5,025 tokens per session scan C ed45c73de026

Subscribe to this mod's changes

ragtime userspace-spec.instructions.md is an instructions file published in the GitHub repository mattv8/ragtime (33 stars, last pushed 5d ago), licensed MIT. It adds 5,025 tokens to every session, about $0.0251 per session on Opus 5. A static security scan graded it C with 2 findings (recursive force delete, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other instructions, from other repositories

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,182 tokens

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

next.js AGENTS.md

Instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,345 tokens