1. guides
temper
  • Temper documentation
  • 2026-07-06-cogmap-telos-differentiation
  • handoffs
  • plans
    • archived
    • evidence
  • reviews
  • specs
  • spikes
  • agents
  • auth
    • Temper auth & security
    • The authorization seam (`temper-services::auth`)
    • Cognitive-map & resource authoring authorization
    • JWT verification
    • The issuer / resource-server boundary & the machine-token contract
    • The internal reconcile channel
  • code-reviews
  • cognitive-maps
  • decisions
  • development
  • guides
    • Building a cognitive map from a large corpus
    • Using temper from Claude Desktop (and claude.ai)
    • Cloud Agent Development Guide
    • Ingesting a corpus into a context
    • Development setup
    • Drain operator queries (TraceQL)
    • Enterprise Install — Ground Up
    • Operator guide: read-only GitHub credential via a BYO App + Vercel Connect
    • Operator guide: provisioning a GitHub connection in temper
    • Installing Temper
    • Delivering L0 Kernel Cogmap Content
    • Machine Credentials
    • OpenTelemetry Setup
    • Operational Memory
    • Bootstrapping a Temper org
    • Releasing Temper
    • Self-Hosting Temper with Okta
    • Self-Hosting Temper with a SAML IdP
    • Self-Hosting Temper
    • The Slack Integration — identity, credentials, and what revocation actually means
    • Operator guide: `@temper` on Slack — end-to-end setup
    • Bootstrapping a team's self-cognition cognitive map
    • Working with Teams
    • Integrating Ruby with temper-rb
    • Deploying an Eve agent to Vercel (the steward and the citation auditor)
    • WS6 Collapsed-Schema Dev Environment
  • research
  • security
  • specs
  • doors
    • Building against Temper
    • Running Temper
    • Using Temper
  • Temper /api/query — the compositional read surface
    • Run a declared composition of situated acts.
    • Schemas
      • Composition
      • OutcomeDeclaration
      • ReturnSpec
      • Intention
      • StageNode
      • ActInvocation
      • CombineNode
      • StageInput
      • StageRelation
      • Disclosure
      • QueryResponse
      • StageResult
      • StageOutput
      • ScoreKind
      • Scoring
      • ResourceHit
      • CompositionTrace
      • StageTrace
      • InputSource
      • NarrowedBy
      • StageName
      • ActName
      • IdKind
      • IdSet
      • BoundTerm
      • Extent
      • StageDisposition
      • ActRefusal
      • PlanRefusal
      • RefusalReason
      • ActQuantity
      • QuantityScale
      • ResourceFilter
      • EdgeFilter
      • PropertyPredicate
      • PropertyOp
      • ResourceSection
      • EdgeKind
      • OrdOp
      • CogmapId
      • ContextId
      • IdProvenance
      • FacetPredicate
      • CombineOp
      • BlockId
      • MatchLocation
      • BodyStorage
      • ResourceId
      • IngestState
      • ManagedMeta
      • ProfileId
      • ResourceView
      • Polarity
      • ViaEntry
      • LensId
      • RegionId
      • CogmapRegionRow
      • RegionHit
      • StageInputTrace
      • Standing
      • ActorAuthority
      • Refusal
      • SystemAccessDetails
      • PlanRefusalDetails
      • ErrorDetails
      • ErrorDetail
      • ErrorBody
  • Temper Cloud API
    • Access
      • POST /api/access/requests — submit a join request for the gating team.
      • GET /api/access/requests/me — check own join request status.
      • DELETE /api/access/requests/me — withdraw a pending join request.
      • POST /api/access/reviews — a revoked principal asks an admin to reconsider (spec D15).
      • GET /api/access/settings — read public system settings.
    • Slack Link
      • Disconnect any principal. Operator path — offboarding and stuck users.
      • Disconnect EVERY Slack principal bound to the caller's own profile.
    • Auditor
      • auditor_dispatch
      • auditor_sweep
      • complete_auditor_job
    • Graph
      • POST /api/cogmaps/{id}/graph/slice — R4 cogmap-scoped neighborhood slice.
      • GET /api/graph/cogmaps/{id}/panorama — enter-a-cogmap Tier-0 interior.
      • GET /api/graph/contexts/composition — Beat E Tier-1: the force-graph composition of a container's (or a residual bucket's) members.
      • GET /api/graph/contexts/panorama — Beat E Tier-0: goal-container territories + residual tray.
      • GET /api/graph/home — the you→teams→cogmaps membership home.
      • GET /api/graph/regions/composition — Beat D region→resources composition drill.
    • Cognitive Maps
      • list_cognitive_maps
      • genesis
      • get_cognitive_map
      • reconcile
      • analytics
      • grant_cogmap_access
      • revoke_cogmap_access
      • materialize
      • materialize_delta
      • region_metrics
      • shape
      • bind_team
      • unbind_team
    • Contexts
      • list_contexts
      • create_context
      • get_context
      • context_materialize
      • reassign
      • context_region_metrics
      • rename
      • context_shape
      • share_team
      • unshare_team
    • Events
      • cursor
      • GET /api/graph/elements/{kind}/{id}/trail — R5 element event-trail. kind ∈ {node, edge}.
    • Facets
      • set_facet
      • Read the live facets of one edge.
      • Set a facet whose owner is an **edge** rather than a resource.
      • Read the live facets of one resource — the confirming read for a write that steers region formation and Atlas grouping.
    • Health
      • health_check
    • Ingest
      • create_ingest
      • update_ingest
      • list_blocks
      • append_block
      • finalize_resource
    • Invitations
      • accept
      • decline
      • list_mine
      • list_team_invitations
      • revoke_team_invitation
      • create_team_invitation
    • Invocations
      • list_invocations
      • open
      • show
      • close
    • Profile
      • get_profile
      • update_profile
      • list_auth_links
    • Query
      • `POST /api/query`.
    • Relationships
      • assert
      • fold
      • retype
      • reweight
    • Resources
      • `GET /api/resources` — **one response type, unconditionally.**
      • create_resource
      • get_resource
      • delete_resource
      • update_resource
      • List the finding at `{id}`'s citation-audit trail — one row per audit, each naming its auditor.
      • Record an auditor's signed defensibility verdict on one `(block, source)` citation of the finding at `{id}`. CONFORM to `handlers::edges::assert` (the sibling authored-write handler): thin — build the command, dispatch it, map the error. No persistence he
      • get_content
      • list_resource_edges
      • resource_evidence
      • grant_resource_access
      • revoke_resource_access
      • resource_lineage
      • provenance
      • annotate_resource
    • Meta
      • get_meta
      • update_meta
    • Reassign
      • reassign_resource
      • reassign_team
    • Search
      • `POST /api/search`.
    • Steward
      • candidates
      • dispatch
      • sweep
      • delta
      • advance
    • Teams
      • list_teams
      • create_team
      • detail
      • delete_team
      • update_team
      • add_member
      • remove_member
      • change_role
    • Schemas
      • AcceptInvitationResponse
      • ActInput
      • ActInvocation
      • ActName
      • ActQuantity
      • ActRefusal
      • ActorAuthority
      • AddMemberRequest
      • AdvanceWatermarkAck
      • AdvanceWatermarkRequest
      • AgentAuthorship
      • AppendBlockPayload
      • AssertRelationshipRequest
      • AtlasEdge
      • AtlasHome
      • AtlasNode
      • AtlasSubgraph
      • AuditCitation
      • AuditSweepRow
      • AuditorDispatchTickRequest
      • AuditorDispatchTickResponse
      • AuditorJobCompleteAck
      • BindTeamOutcome
      • BindTeamRequest
      • BlockId
      • BlockProvenanceRow
      • BlocksResponse
      • BodyStorage
      • Bridge
      • BulkReassignAck
      • BulkReassignRequest
      • ChangeRoleRequest
      • CharterBlock
      • CharterDisposition
      • CitationAuditRequest
      • CitationAuditRow
      • ClaimedAuditJob
      • ClaimedJob
      • CloseInvocationRequest
      • CogmapAnalyticsRow
      • CogmapDetail
      • CogmapFoundationRow
      • CogmapGrantBody
      • CogmapId
      • CogmapRegionMetricsRow
      • CogmapRegionRow
      • CogmapRegulationRow
      • CogmapRevokeBody
      • CogmapRow
      • CogmapStaleness
      • CombineNode
      • CombineOp
      • Composition
      • CompositionTrace
      • ConfidenceBand
      • ContentResponse
      • ContextCreateRequest
      • ContextId
      • ContextOwnerRef
      • ContextPanorama
      • ContextRow
      • ContextRowWithCounts
      • CorrelationId
      • CreateCogmapOutcome
      • CreateCogmapRequest
      • CreateInvitationRequest
      • CreateRequestBody
      • CreateReviewBody
      • DeleteResponse
      • DeviceOverrides
      • DispatchTickRequest
      • DispatchTickResponse
      • Disposition
      • DriftSweepRow
      • EdgeFacetRow
      • EdgeFacetSetRequest
      • EdgeFacetsResponse
      • EdgeFilter
      • EdgeId
      • EdgeKind
      • ElementEvent
      • ElementKind
      • EmbedDispatchSummary
      • Entitlements
      • ErrorBody
      • ErrorDetail
      • ErrorDetails
      • EventCursorResponse
      • EventTrail
      • ExactArm
      • ExactHit
      • Extent
      • FacetAck
      • FacetPredicate
      • FacetSetRequest
      • FinalizePayload
      • FoldRelationshipRequest
      • GrantOutcome
      • GraphEdgeRow
      • GroupKeyMeta
      • HealthResponse
      • HomeCogmap
      • HomeContext
      • IdKind
      • IdProvenance
      • IdSet
      • IdpRevocation
      • IngestCreateResponse
      • IngestDelta
      • IngestPayload
      • IngestState
      • InheritedReadGrant
      • InheritedShare
      • InputSource
      • Intention
      • InvitationStatus
      • InvitationTokenRequest
      • InviteeInvitation
      • InvocationAck
      • InvocationActRow
      • InvocationCloseAck
      • InvocationId
      • InvocationSummary
      • InvocationView
      • JoinRequest
      • JoinRequestStatus
      • LensId
      • LineageNode
      • ManagedMeta
      • MatchLocation
      • MaterializeAck
      • MaterializeDelta
      • MaterializeRequest
      • MergePolicy
      • MetaUpdatePayload
      • NarrowedBy
      • NodeHome
      • OpenInvocationRequest
      • OrdOp
      • OrphanNode
      • OutcomeDeclaration
      • PlanRefusal
      • PlanRefusalDetails
      • Polarity
      • Profile
      • ProfileAuthLink
      • ProfileId
      • ProfileUpdateRequest
      • ProfileWithEntitlements
      • PropertyOp
      • PropertyPredicate
      • ProvenanceSource
      • PublicSystemSettings
      • QuantityScale
      • QueryResponse
      • ReassignAck
      • ReassignContextOutcome
      • ReassignContextRequest
      • ReassignResourceRequest
      • ReconcileCogmapRequest
      • ReconcileEdge
      • ReconcileEdgeTombstone
      • ReconcileEntry
      • ReconcileOutcome
      • ReconcileTelos
      • ReconcileTelosBlock
      • ReconcileTombstone
      • Refusal
      • RefusalReason
      • RegionHit
      • RegionId
      • RelationshipAck
      • RemoveMemberOutcome
      • RenameContextOutcome
      • RenameContextRequest
      • ResidualBucket
      • ResidualContext
      • ResidualGroups
      • ResidualOwnedReach
      • ResourceAnnotateRequest
      • ResourceCreateRequest
      • ResourceFacetRow
      • ResourceFacets
      • ResourceFacetsResponse
      • ResourceFilter
      • ResourceGrantBody
      • ResourceHit
      • ResourceId
      • ResourceLineage
      • ResourceListResponse
      • ResourceRevokeBody
      • ResourceSection
      • ResourceSortField
      • ResourceUpdateRequest
      • ResourceView
      • ReturnSpec
      • RetypeRelationshipRequest
      • RevokeOutcome
      • ReweightRelationshipRequest
      • ScoreKind
      • Scoring
      • SearchParams
      • SearchReason
      • SearchResponse
      • SearchResultRow
      • SearchScope
      • SearchScopeInfo
      • SegmentInfo
      • SegmentedBegin
      • SegmentedBeginResponse
      • ShareContextOutcome
      • ShareContextRequest
      • SlackDisconnectRequest
      • SlackDisconnectResponse
      • SlackDisconnectedPrincipal
      • SliceRequest
      • SortOrder
      • StageDisposition
      • StageInput
      • StageInputTrace
      • StageName
      • StageNode
      • StageOutput
      • StageRelation
      • StageResult
      • StageTrace
      • Standing
      • StandingShape
      • Subscription
      • SubscriptionOverride
      • SystemAccessDetails
      • TeamCreateRequest
      • TeamDetail
      • TeamInvitation
      • TeamMemberDetail
      • TeamMemberRow
      • TeamMemberSource
      • TeamRole
      • TeamRow
      • TeamUpdateRequest
      • Territory
      • TerritoryKind
      • TerritoryOverview
      • UnbindTeamOutcome
      • UnshareContextOutcome
      • VaultConfig
      • ViaEntry
      • WideArm
      • WideHit
  1. guides

Cloud Agent Development Guide

This document describes how to prepare tasks for and work as a cloud-based Claude Code agent on the temper project. Cloud agents run in Anthropic's remote infrastructure without access to the local projection cache, IDE, or persistent filesystem.

What is a Cloud Agent?#

A cloud agent is a Claude Code session running on Anthropic's cloud infrastructure (not the developer's local machine). These sessions are launched for focused implementation tasks — typically a single migration, service change, or feature — and produce a PR or set of commits that are reviewed and merged by the project owner.
Cloud agents have access to:
The git repository (cloned into the remote environment)
Docker for PostgreSQL
Cargo, Rust toolchain, and standard dev tools (installed via setup scripts)
The .sqlx/ offline query cache (allows compilation without a live database in degraded mode)
Context provided in the task prompt
Cloud agents do NOT have access to:
The local projection cache (~/projects/kb-vault — a derivative of cloud state)
~/.config/temper/config.toml or other local config
The Temper MCP server (can't use it to help build it)
External URLs (can't curl production endpoints to verify)
Previous conversation history

Environment Variables for Ephemeral Sessions#

Cloud and ephemeral sessions can bootstrap temper without running the browser OAuth flow by exporting the following variables. See the design spec at internal/superpowers/specs/2026-04-18-cloud-mode-and-portable-memory-design.md for the broader cloud-mode design these env vars belong to.
VariablePurposeNotes
TEMPER_TOKENJWT access token for the temper APIWhen set, the client uses this in-memory and does not read ~/.config/temper/auth.json. Malformed tokens error rather than silently falling through.
TEMPER_PROVIDERAuth0 provider name that issued the tokenDefaults to auth0. Typically only needed when a non-default provider is configured.
TEMPER_DEVICE_IDStable device id for this sessionWhen unset, a fresh UUIDv7 is generated per session. Set explicitly if you want a stable device id across session restarts.
TEMPER_API_URLAPI base URL overrideExisting variable; takes precedence over config.
For a SessionStart hook (.claude/settings.local.json), export TEMPER_TOKEN alongside cargo install --path crates/temper-cli --locked, and the temper CLI will authenticate without any interactive step or disk state.

Environment Setup Scripts#

The project provides setup scripts for cloud agent environments:

tools/bin/setup-claude-web.sh (lightweight, runs on SessionStart)#

Configures PATH, environment variables, git hooks
Generates root .env with Rust/API dev values
Generates packages/temper-ui/.env with SvelteKit stub values (so
bun run check / build resolve $env/static/private imports — real
credentials come from your local .env or Vercel project env in prod)
Runs bun install at the workspace root to populate node_modules
Wired via the SessionStart hook in the committed .claude/settings.json
— applies to every cloud session automatically. Per-user overrides go
in the gitignored .claude/settings.local.json.
Must complete in seconds

tools/bin/setup-claude-web-full.sh (heavy, run manually)#

Installs system dependencies, Rust toolchain, cargo tools
Starts PostgreSQL via Docker (pgvector on port 5437)
Runs database migrations
Run this when the task requires database access or integration tests

Individual setup modules (tools/cargo-make/scripts/claude-web/)#

setup-common.sh — shared helpers (log_ok, log_warn, persist_env, command_exists)
setup-system-deps.sh — apt packages
setup-rust.sh — rustup, stable toolchain
setup-cargo-tools.sh — cargo-make, sqlx-cli, cargo-nextest
setup-postgres.sh — Docker PostgreSQL with pgvector
setup-db-migrations.sh — runs sqlx migrations
setup-gh.sh — GitHub CLI

Writing a Cloud Agent Task#

A well-structured task prompt has two parts: the task description (what to build and why) and the Cloud Agent Context section (everything needed to build it without vault access).

Cloud Agent Context Section#

Include the following in every cloud agent task:

1. Project Overview#

Brief description of temper and where this task fits. The cloud agent starts cold — it doesn't know the project.

2. Repository Layout#

Show the relevant crate structure. Don't include the full tree — focus on the directories the agent will touch.
crates/
  temper-api/src/
    handlers/         # Axum route handlers (thin: extract, call service, respond)
    services/         # Business logic (SQL queries, transactions)
    middleware/       # JWT auth, CORS
    routes.rs         # Router wiring
    state.rs          # AppState (PgPool, config)
    error.rs          # ApiError enum → HTTP status codes
  temper-core/src/
    types/            # Shared domain types (serde + sqlx::FromRow + optional ts-rs)
  temper-mcp/src/     # MCP server (rmcp, Streamable HTTP transport)
    tools/            # Tool implementations
    discovery.rs      # OAuth well-known endpoints + DCR
    middleware.rs     # JWT validation for MCP
    service.rs        # TemperMcpService handler
    router.rs         # Axum router assembly
migrations/           # sqlx migrations (sequential timestamps)
api/
  axum.rs             # Vercel entry point for temper-api
  mcp.rs              # Vercel entry point for temper-mcp

3. Database Schema#

Include CREATE TABLE statements for every table the task touches. Include relevant indexes, constraints, and SQL functions. The agent can't query the live database to discover the schema.

4. Existing Code Patterns#

Show the patterns the agent should follow. Include actual code snippets from the codebase — transaction patterns, error handling, query-as patterns, hash computation, etc. The agent should produce code that looks like it belongs in the project.

5. Services and Types to Modify#

List every file that needs changes, with the current function signatures and what needs to change. Include enough context that the agent can find the right insertion point.

6. Build and Test Commands#

7. Feature Flags#

test-db — enables database integration tests
web-api — enables utoipa OpenAPI derives (temper-core)
typescript — enables ts-rs type generation (temper-core)
mcp — enables schemars JsonSchema derives for MCP tool parameters (temper-core)

8. Migration Conventions#

File name: YYYYMMDDHHMMSS_description.sql (e.g., 20260406000001_resource_audits.sql)
Place in migrations/ directory
Pure SQL, no procedural wrappers
Tables use kb_ prefix
Indexes named idx_tablename_column
UUIDs: gen_random_uuid() for non-time-sorted, application-side Uuid::now_v7() for time-sorted
After migration, run cargo sqlx prepare --workspace to update .sqlx/ offline cache

9. Acceptance Criteria#

Numbered list of specific, verifiable outcomes. Include compilation, clippy, test requirements.

Example Structure#

Key Project Conventions#

Deployment#

Two separate Vercel projects: temperkb.io (SvelteKit UI) and temper-cloud.vercel.app (Rust API + MCP)
UI vercel.json at packages/temper-ui/vercel.json contains rewrites proxying /api/*, /mcp, /.well-known/*, /oauth/* to the API project
Root vercel.json at repo root routes to the Rust binaries (/api/axum, /api/mcp)

Auth#

Auth0 at temperkb.us.auth0.com is the sole OAuth provider
Neon Auth references in old .env files are stale — ignore them
AUTH_PROVIDER_NAME should be auth0
MCP uses a static DCR proxy (returns pre-registered client_id) at /oauth/register

UUIDs#

All entity IDs use UUIDv7 (time-sortable). Generate with Uuid::now_v7().

Error handling#

Transaction pattern#

SQLx offline mode#

The .sqlx/ directory contains cached query metadata. When a live database isn't available, sqlx compiles queries against this cache. Always run cargo sqlx prepare --workspace after changing any SQL queries to keep the cache in sync.

Communicating Results#

Cloud agents should:
1.
Create a feature branch with descriptive name
2.
Make atomic commits with clear messages
3.
Run cargo make check before considering the task complete
4.
If tests require a live database and Docker isn't available, ensure compilation passes with the .sqlx/ offline cache and note which tests remain to be run
5.
Create a PR with a description that references the task

Revision History#

When a task is written and then the codebase changes (e.g., PRs merge that affect the same files), add a Revision Notes section to the task documenting what changed and confirming whether the original design still holds. This prevents the cloud agent from working against stale assumptions.
Modified at 2026-08-19 17:59:46
Previous
Using temper from Claude Desktop (and claude.ai)
Next
Ingesting a corpus into a context
Built with