Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
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
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .agents/rules/config-and-service-urls.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ startup loudly.
## Service URLs

- Stable service URLs and public OAuth/callback/app origins are typed in
`crates/macro_service_urls` (`service_url!` with `local`/`dev`/`prod`), chosen by `ENVIRONMENT`. Call
`crates/platform/macro_service_urls` (`service_url!` with `local`/`dev`/`prod`), chosen by `ENVIRONMENT`. Call
`XServiceUrl::new()`. Never declare a `FOO_SERVICE_URL` env var or match on
`Environment` to build a URL. Queue names follow the same pattern in
`crates/macro_queues`.
`crates/platform/macro_queues`.
- The only override is `OVERRIDE_<SNAKE_NAME>`, read from the process
environment, not from Doppler. Local in-network overrides live in
`xtask_local`'s `local_env.rs`; `local` defaults are host ports and do not
Expand Down
4 changes: 2 additions & 2 deletions .agents/rules/rust/code.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Type design, idioms, errors and observability, performance, and tests.
- **CS-19** Give third-party errors their own variant — don't collapse e.g. a
`jsonwebtoken` failure into a generic internal error. A provider outage
(5xx, 429, unreachable, undecodable) is an `upstream_error::UpstreamError`,
answered 502/503 — see `crates/upstream_error`.
answered 502/503 — see `crates/platform/upstream_error`.
- **CS-20** Depending on a rate-limited external provider requires a fallback
(fallback model, retry story, or documented degradation).
- **CS-21** Wire usage metering on every invocation path — MCP-triggered tool
Expand Down Expand Up @@ -62,7 +62,7 @@ Type design, idioms, errors and observability, performance, and tests.
mark documentation code blocks `ignore` to skip doctests unless explicitly
directed.
- **CS-55** AI spans follow the OpenTelemetry GenAI conventions (`gen_ai.*`, see
`crates/genai_telemetry`). Agent sessions of every harness are traced in one
`crates/platform/genai_telemetry`). Agent sessions of every harness are traced in one
place: the session actor projects each session's ACP frames onto
`invoke_agent` / `execute_tool` spans
(`crates/agent_session/src/domain/session/telemetry.rs`), so do not add GenAI
Expand Down
9 changes: 5 additions & 4 deletions .agents/rules/rust/libraries.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ them instead of their generic equivalents.
Ports expose `type Err: std::error::Error + Send + Sync + 'static`; services
map adapter errors with `rootcause::Report::new(e).into_dynamic()`. Binaries
return `Result<(), rootcause::Report>`. Never add `anyhow` to a crate that
doesn't use it (CS-46). Model: `crates/user_api_key`.
doesn't use it (CS-46). Model: `crates/accounts/user_api_key`.
- **CS-57** No panics outside tests and startup: no `.unwrap()`, `.expect()`,
`unreachable!`, `panic!`, `todo!`, or unchecked indexing on a path a request,
tool call, or message can reach. Return a typed error the caller can show
Expand Down Expand Up @@ -62,7 +62,8 @@ them instead of their generic equivalents.
- **CS-66** Never wait for a condition by polling: no `yield_now` or `sleep`
loops. Signal with `oneshot`, `Notify`, `watch`, `Barrier`, or a channel, and
use `#[tokio::test(start_paused = true)]` for time.
- **CS-67** Dependencies come from root `[workspace.dependencies]` as `x = {
workspace = true }`; after any `Cargo.toml` change run `just hakari` and
commit `crates/workspace-hack`. Check the workspace list before adding a
- **CS-67** Dependencies, workspace crates included, come from root
`[workspace.dependencies]` as `x = { workspace = true }`, never a relative
`path`; after any `Cargo.toml` change run `just hakari` (it adds a new
member's root entry and rewrites relative paths) and commit the result. Check the workspace list before adding a
crate, and don't add one that duplicates an existing choice.
2 changes: 1 addition & 1 deletion .agents/rules/rust/security.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Authorization and permission checks in backend code.
- **CS-39** Pin third-party GitHub Actions to a commit SHA, not a movable tag.
- **CS-72** Store user or third-party secrets (API keys, OAuth refresh tokens)
only as AWS KMS ciphertext, following `crates/cursor_api_key` (direct KMS) or
`crates/microsoft_oauth_grant_db_utils` (envelope: encrypted data key, KMS
`crates/accounts/microsoft_oauth_grant_db_utils` (envelope: encrypted data key, KMS
key id, encryption version). Bind the encryption context to the owner so a
copied row won't decrypt. Hold the plaintext in a type that redacts `Debug`
and zeroizes on drop, use it immediately (e.g. as a request header), and never
Expand Down
6 changes: 3 additions & 3 deletions .agents/skills/feature-flags/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: feature-flags
description: Add, read, or remove a feature flag in the web app (`defineFlag`, PostHog, `ENABLE_*` env flags, `useFeatureFlag`, `isFeatureEnabled`, `ShowFeatureFlag`) or the Rust backend (`crates/feature_flags`). Use when gating, rolling out, or killing a feature, or when asked to "flag it".
description: Add, read, or remove a feature flag in the web app (`defineFlag`, PostHog, `ENABLE_*` env flags, `useFeatureFlag`, `isFeatureEnabled`, `ShowFeatureFlag`) or the Rust backend (`crates/platform/feature_flags`). Use when gating, rolling out, or killing a feature, or when asked to "flag it".
---

# Feature flags
Expand Down Expand Up @@ -99,12 +99,12 @@ These are the mistakes past flagged launches had to fix:

## 5. Backend

- **Per-user remote flags** use `crates/feature_flags` (read its `README.md`):
- **Per-user remote flags** use `crates/platform/feature_flags` (read its `README.md`):
construct `PostHogFeatureFlags` once at the composition root, load one
`FlagSnapshot` per authenticated user id, and read it synchronously. A failed
load returns `Err`; the caller decides the fallback, explicitly. Wire the adapter and its config at the consuming service composition root.
- **Every backend rollout or feature gate**, per user or for everyone, is a
`crates/feature_flags` flag, never a `MacroConfig`/Doppler boolean.
`crates/platform/feature_flags` flag, never a `MacroConfig`/Doppler boolean.
`MacroConfig` holds real environment configuration (endpoints, credentials,
capacities), not switches that turn features on. Remove the gate once its
rollout is done.
Expand Down
2 changes: 1 addition & 1 deletion .agents/skills/instrumentation/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ enqueue time (`enqueuedAtMs`), so they survive reloads; when it is missing or
skewed, `mutation_queue.age_known` is false and the age is omitted rather than
zero. The runner sends inside it, so
`dssGraphqlFetch` injects `traceparent` and the DSS `graphql.execute` span and
the instrumented resolvers (`crates/graphql_entity_mutation`,
the instrumented resolvers (`crates/graphql/graphql_entity_mutation`,
`graphql_properties`, `graphql_notification`) join the same trace. A loop that
can repeat forever reports counters instead of lines: each item logs a failure
class once, and `graphql.mutation_queue.summary` flushes counters every five
Expand Down
2 changes: 1 addition & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
[alias]
x = "run -p xtask --"

# worker-rs-otel (wasm32-unknown-unknown) pulls getrandom 0.3 via OTLP types;
# worker_rs_otel (wasm32-unknown-unknown) pulls getrandom 0.3 via OTLP types;
# getrandom 0.3 needs its backend selected at
# build time. Harmless for wasm crates that don't use getrandom 0.3.
[target.wasm32-unknown-unknown]
Expand Down
2 changes: 1 addition & 1 deletion .config/hakari.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ workspace-members = [
"macro_sync_service_jwt",
"sync_service",
"sync_service_bebop_schema",
"worker-rs-otel",
"worker_rs_otel",
# maybe_send: zero-dep marker traits used by cache-core; must stay
# wasm-safe (workspace-hack pulls native-only deps like mio into wasm32).
"maybe_send",
Expand Down
Loading
Loading