Skip to content
Back to skills

Rule Storage Split

ASecurity

Storage split: where each kind of data lives (YAML, settings.json, the Keychain, SQLite, userData folders) and what outlives a run's teardown. A repository rule for apps/daemon/src/**, apps/ui/src/main/**, apps/ui/src/shared/contracts*; read it before editing a file there.

  • 8 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 28, 2026
ai-agentsgosqlnodegit

Works with

  • cursor
  • cli
  • mcp

Security analysis

A100/100

Scanned December 5, 2026

npx -y skills add geniro-io/geniro-app --skill rule-storage-split --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Rule Storage Split?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Rule Storage Split
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/geniro-io-rule-storage-split/badge)](https://www.skillsdirectory.com/skills/geniro-io-rule-storage-split)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: rule-storage-split
description: "Storage split: where each kind of data lives (YAML, settings.json, the Keychain, SQLite, userData folders) and what outlives a run's teardown. A repository rule for apps/daemon/src/**, apps/ui/src/main/**, apps/ui/src/shared/contracts*; read it before editing a file there."
---
<!-- GENERATED by scripts/sync-agent-rules.mjs from .claude/rules/storage-split.md. DO NOT EDIT: edit the source, then run `pnpm sync:agent-rules`. -->
# Storage split

The root `AGENTS.md` → *Storage split* lists the kinds; this file holds the detail of each.

- **Team definitions → YAML.** Never in SQLite.
  - Team backups → `<userData>/teams/.backups/<slug>.<YYYY-MM-DDTHH-mm-ss>.yaml`, written before every save an analysis applies (`TeamChangeService`) and before an approved `propose_team` replaces a file (`TeamProposalService`), and before a version restore (`TeamVersionsService.restore`). Never named `*.team.yaml`, so the library never lists them; restore by copying one over `<slug>.team.yaml`.
  - Project overlays of a team → `<userData>/teams/overlays/<slug>/<projectId>.overlay.yaml` (`TeamOverlayStoreService`, schema `TeamOverlaySchema`), hash-guarded (`TEAM_OVERLAY_CHANGED`), each replace and delete backed up to `overlays/.backups/<slug>/<projectId>.<ts>.yaml`; removed (after a backup) with their team or project. Applied only to a run of the project's DEFAULT team (`Project.teamSlug`); never in SQLite and never in a team export.
  - The library lived in `<userData>/workflows/` as `*.geniro.yaml` before the rename; migration `0003-team-library-files` moved it and keeps the originals in `<userData>/workflows/.migrated/`.
- **Plugins → `<userData>/plugins/<slug>.plugin.yaml`**, the approved copy in `.approved/`, backups in `.backups/` (newest 20 per plugin); YAML files, never SQLite or settings.json (`.claude/rules/plugins.md`).
- **Settings → `settings.json`** in the Electron userData dir. The key list is `apps/ui/AGENTS.md` → **Settings keys (`settings.json`).**
  - Removing or renaming a schema key destroys what it held (`readSettings` keeps only known keys; `writeSettings` rewrites the file). Migrate or export the data first.
  - An unparseable file is copied aside to `settings.json.corrupt-<timestamp>` before any write; never write over a file that cannot be read.
  - Hand-managed lists (`fastActions`, `runConfigs`, `configProfiles`) are salvaged entry by entry on read and keep the user's order.
  - `archiveRetentionDays` defaults to `null` because it arms a sweep that permanently deletes archived chats. The daemon only executes it (`POST /v1/chats/sweep-archived`).
  - `sharing.autoRevokeAfterDays` defaults to `null` because it arms a sweep that revokes shared links. Unlike the archive sweep, the daemon owns its timer (`ShareService.revokeExpired`), so a paired device never runs it.
  - Values whose vocabulary belongs to the daemon stay opaque strings on the Electron side (`shared/contracts.ts` holds no daemon shapes, except the one twin recorded in `apps/ui/src/main/AGENTS.md`: `ShareDestination`).
- **MCP config → each CLI's own config files**, one of two exceptions to "geniro writes only its own files" (the other: an ARCHIVED run's own CLI session transcripts are deleted with it, `session-transcripts.service.ts`, `.claude/rules/daemon-agents-adapters.md`). Toggles and server definitions are written only on the user's press, through each CLI's own mechanism and lock, refusing an unparseable file and keeping no copy. Rules: `.claude/rules/daemon-mcp-config.md` → **MCP config writes**.
- **Secrets → the Keychain only.** Every CLI authenticates from its own login (a cursor named configuration's is the CLI's own file store in that directory: `.claude/rules/daemon-cursor-acp.md`). Share keys are the one secret geniro keeps in the Keychain; the in-app browser's per-chat cookie jars are the one kept outside it, in Chromium's own store (see `.claude/rules/network-constraints.md`).
- **SQLite (`geniro.db`) → runtime and history only**: `runs`, `items`, `node_state`, and the usage tables.
  - `ui_surfaces` holds each `show_ui` card's latest version, the user's saved field values (never an obscured field's) and its pressed one-shot buttons; its `show_ui` rows carry only `{surfaceId, version, op, title}`. Dropped with the run.
  - Archive uses its own `archivedAt` column, never `deletedAt`: the `softDelete` filter is global and default-on, so an archived row would vanish from the read that unarchives it.
  - `usage_events`, `usage_activity`, `line_baselines`, `team_versions` and the usage counters (`usage_counters`, `usage_subjects`, `usage_counter_backfill`) are exempt from run teardown so lifetime totals survive deleting a chat. `tool_call_events` is the one ledger pruned, to the retention the user picked, once its rows are in the counters (`.claude/rules/daemon-stats.md`). `usage_events` is append-only and denormalizes agent/model/folder at write time. A team run's `usage_activity` thread row also carries its graph version (`.claude/rules/daemon-stats.md`).
  - A team run keeps three copies: `Run.teamSnapshot` (the effective team it runs, its project overlay applied), `Run.teamBaseSnapshot` (the shared team, what every version and drift reader reads through `baseTeamSnapshotOf`) and `Run.teamOverlaySnapshot` (the overlay applied, or null). A project's own chat names its project in `Run.editsProjectId` with no `editsTeamSlug`; a builder chat bound to a project before project chats existed carries both.
  - `team_change_log` and `team_recommendations` are exempt too (an overlay write logs with `projectId` set and the overlay's hashes as its versions): a team analysis reads every change made to its team and every recommendation the analyses it replaced filed (`.claude/rules/daemon-thread-analysis.md`).
  - `lesson_proposals` is exempt too: every lesson a reflection filed or proposed, with what became of it (saved, undone, rejected, dropped by the check), so a lesson kept out of memory is not filed again in its project or team after its thread is gone (`.claude/rules/daemon-lessons.md`). `lesson_segments` is not: a thread's segments go with it.
  - `member_assessments` is exempt too: every member mark a team analysis, a builder chat or a thread analysis of a team run filed, with its judge and the user's own verdict on it, which the team's Statistics tab, the member sheet and the next analysis read after the chat is gone (`.claude/rules/daemon-thread-analysis.md`).
  - `project_instruction_changes` is exempt too: every change to a project's description or instructions, by the user or by an analysis applying `P-` items, which later analyses read through `view=project` (`.claude/rules/daemon-projects-tasks.md`).
  - `session_context_readings` (what a member's CLI said its fresh session held, asked once when the session opened, `FreshSessionContextRecorder`; read by the team analysis's `freshSessionBase`) is NOT exempt: purged with its run.
  - `review_comments` (the review screen's comments on a thread's changes, `ReviewCommentsService`) is NOT exempt: purged with its run. Comments never reach git or GitHub; a sent review is copied onto its user message row as `payload.review`, so the transcript card reads whole after a comment is edited or deleted.
  - `artifact_shares` is exempt from run teardown too: a shared link outlives its chat, and the row is the only way to revoke it. Only a share never uploaded (waiting on sign-in, or failed after it) is dropped with its run. Its key is in the Keychain, never the row. Accepted exception: an agent's `show_artifact(share: true)` receipt (or, after a sign-in wait, its `HostWakeBus` wake prompt) carries the whole link, so the key is also in that agent's transcript: the receipt's `items` row (readable from a paired device), the CLI's session file and the provider's copy. `shares_changed` and the sign-in notification never carry it.
  - `thread_messages` (the mailbox between threads, `ThreadInboxService`) is NOT exempt: a thread's incoming rows go with it, after each waiting one's sender is told. A row keeps its sender's title, so what a deleted thread sent still reads whole.
  - `memories` (the shared agent memory, `v1/memory`, with its FTS index `memories_fts`), its usage ledger `memory_usage_days`, the backfill's `memory_usage_backfill`, the cleanup check's `memory_review_findings` and agents' marks `memory_marks` are exempt from run teardown too: a memory, how agents used it, what they said of it and what a check found about it outlive the chat that wrote or read it. An entry forgotten by agents' marks (batch `marks-`) or by the auto-lesson expiry (`expired-lesson-`) is purged 30 days later unless restored. A purged entry stays as an empty tombstone (`deletedAt`; `purgedTextHash` for an imported one), so its handle is never reused and its usage stays; the findings quoting it go with its text. geniro never writes into any CLI's own memory store.
  - `knowledge_documents` and `knowledge_revisions` (the knowledge store, `v1/knowledge`, with its FTS index `knowledge_fts`) are exempt from run teardown too: a document outlives the chat that proposed it, and only a deleted project or team, or the user's permanent delete, removes one. Documents never leave for a project's repository; a Markdown export the user asks for is the one way out.
  - `agent_flags` (what agents flagged with `flag_issue`, `FlagBroker`) is exempt from run teardown too: every analysis reads a period's flags first, deleted threads included, so each row stamps its thread's kind, title, team and project at write time and masks its text with `redactSecrets`.
  - `run_goals` (the `goals` tool's and the user's goals, `GoalsService`) and `tool_call_events` (one row per finished tool call) are exempt from run teardown too, as are `usage_activity`'s `stage`, `call` and `thread_outcome` rows: a team's goals, stages and calls are counted over every run it ever had, and its tools over the runs inside the tool log's retention (`toolCallLogRetentionDays`; the usage counters keep every call). `Run.goals` and `Run.threadOutcome` are the run's projections of them, dropped with the run.
- **Persist-then-emit** for streamed, replayable data (chat and team-member items): allocate the monotonic `seq`, write the row, then publish. Clients replay through an `afterSeq` cursor, so nothing is emitted before it is durable.
- **Debug log → 0600 JSONL** under `<userData>/logs/`, rotated. Every entry is scrubbed of registered secrets (`v1/diagnostics/utils/redact.ts`).
  - Redaction is by registration, never by pattern: register a new credential at its mint site, before it can be logged (the launch token in `main.ts`, inherited CLI credentials in `AgentAdapterRegistry`, call tokens in `CallTokenRegistry.issue()`, share keys in `ShareKeychain` and the artifact key in `ArtifactStoreService`).
  - The `agent-stdio` channel records the user's raw CLI conversation, so it stays off unless switched on.
- **App update files → `<userData>/updates/` and `<userData>/logs/update.log`** (Electron main, `update-service.ts`): the scratch `update-*` and the resumable download `partial-<version>/` (removed once unpacked or when another version is downloaded), and `last-attempt.json`, the outcome of the last put-in-place at quit, read at the next launch. `update.log` is plain text, 0600, rotated at ~1 MB to `update.log.1`; it holds versions, steps, durations, errors and paths, never a secret.
- **In-app browser jars → `<userData>/Partitions/geniro-browser-<runId>/`** (Chromium's `persist:` partition, one per chat; user decision: plaintext on disk, like Cursor). An own-cookie tab's session is in memory only and goes with the tab. A cookie value an agent sets is never written to SQLite, settings.json, the debug log or a transcript row: `event-to-item` masks it before the `tool_call` or `approval_request` row is persisted and registers it with the redactor (the CLI's own session file and the provider still hold it, as with a share link). Archiving or deleting a chat closes its tabs and clears its jar; a launch removes the folder of every chat the daemon no longer has (its own 404, asked per run), before any browser session is created; an archived chat's folder stays, emptied, until the chat is deleted. Screenshots an agent takes are run attachments (below).
- **Search by meaning → `<userData>/models/<id>-<rev7>/` and `<userData>/embeddings.db`.** The model folder is Electron main's (`main/search-model/`): downloaded when the user turns the feature on, kept when it is turned off, deleted by the user (Settings → Search, Settings → Storage). `embeddings.db` is derived and rebuilt on demand: opened only by the daemon's embedding child through `node:sqlite` with sqlite-vec, never through MikroORM; a chat's vectors go when its run is torn down, and a daily sweep drops those of runs that no longer exist (`.claude/rules/daemon-embeddings.md`).
- **Pasted images → `<userData>/attachments/<runId>/`.** Only `{id, mediaType}` rides the item payload; never put blobs in the DB. A gallery picture downloaded from a URL is stored there too (`AttachmentStoreService.saveDownloaded`), its path in the `show_gallery` row, and is dropped with the run. A `show_ui` card's media (downloaded, or copied from the run's folder or the temp dirs) is stored there as `ui-<uuid>.<ext>` (`saveSurfaceMedia`), named in the card as `geniro-media:<file>`, removed when a later version of the card no longer shows it, and dropped with the run.
  - On ACP, send image blocks only to an agent that advertised `promptCapabilities.image`; otherwise send the text plus a `notice` naming what was withheld.
- **Member pictures → `<userData>/avatars/<sha256>.<ext>`** (`POST /v1/teams/avatars`, png/jpeg/webp/gif judged by bytes, at most 1 MB). The team YAML names the file (`avatar: {kind: picture, value}`); the renderer reads it back as a `data:` URI. A file is removed once no library team, team backup or run snapshot names it and it is over an hour old: after a library save or delete, for the pictures it dropped (`AvatarStoreService.sweep`), and after boot and then hourly for every file, so an upload no team ever saved goes too (`sweepAll`); team versions never record a face. A team export names the file only, so pictures stay on this Mac.
- **Uploaded files (phone) → `<userData>/chat-uploads/<uuid>/<name>`** (`POST /v1/chats/uploads`), collected by the teardown of the run whose user messages name them.
- **Published artifacts → `<userData>/artifacts/<runId>/<artifactId>/v<N>.html`** plus `meta.json` (version, serving key). The `show_artifact` row carries only the descriptor.
  - Beside a version whose pictures were rewritten: `v<N>.source.html` (the HTML the agent wrote, which `edits` match against) and `v<N>.images.json` (each local path → its stored copy, the fallback when the file is gone).
  - Every version is kept, because each transcript row opens the version it announced.
  - Local pictures are copied into `images/<sha256>.<ext>` and inlined as `data:` URIs; no route serves a picture to the page. Only png/jpeg/webp/gif/avif judged by bytes, only from `/tmp`, the system temp dir or the run's folder; a refused picture refuses the page. Only `<img src>` is copied; the page runtime repoints a local path in the `href` or `data-*` of an element holding that one picture to its `data:` URI when the page loads, so a click-to-enlarge written that way still opens.
  - Local audio and video in `<audio>`, `<video>` and `<source>` `src` are copied, from the same folders and judged by bytes, into `media/<sha256>.<ext>` (`v<N>.media.json` maps each path to its copy), and the served page points them at `GET /v1/artifacts/:runId/:artifactId/media/:file?key=` (Range answered `206`), on a paired device through the gateway's one cookie-free arm; a saved or shared copy carries no media.
  - What the user picked on the page is kept in `answers.json` beside the versions, for every version of it.
  - Limits refuse rather than truncate (512KB of HTML). Dropped with the run by `RunTeardownService`.
- **Configurations geniro made → `<userData>/agent-configs/<cli>/<slug>/`** (`apps/ui/src/main/config-profile-dir.ts`): the folder a "Sign in to a new configuration" creates; the CLI keeps that account's login in it. Removing the configuration leaves the folder, as it does a folder the user picked.
- **The practice's sample folder → `<userData>/practice/shop-website/`** (`apps/ui/src/main/practice-folder.ts`): the folder the practice's sample threads run in, with a one-line README. Removed only by the practice's Remove sample items, and never while a thread works there: main asks the daemon right before the delete and keeps the folder when it cannot tell.
- **Task worktrees → `<userData>/worktrees/<taskId>/`**, registry `<userData>/worktrees.json` (`apps/ui/src/main/worktree-service.ts`).
  - Every git call belongs to the Electron main process; the daemon runs no git and is only told the path. Lifetime, removal and branch rules: `apps/ui/src/main/AGENTS.md` → _Task worktrees_.
- **Schedules → SQLite** (`schedules`, deleted with their project) and **`schedule_fires`**, one row per time a schedule came due, kept as history after the schedule goes. A fire's run link reads as none once its chat is deleted.
- **Fire worktrees → `<userData>/worktrees/sched-<fireId>/`**, registry rows with `owner: 'schedule-fire'` in the same `worktrees.json`. The branch `geniro/sched-<name>-<date>` is kept when the worktree goes. Rules: `.claude/rules/daemon-schedules.md`.
- **What the data folder holds, and its clean-ups → Settings → Storage** (`v1/storage` in the daemon, `app-storage.ts` in main). Every delete is a press with a confirm; chats go only through the archive sweep's teardown.
- **Daemon inspector**: the `daemonInspect` setting (off by default) spawns the daemon with `--inspect=127.0.0.1:9229`. The flag goes before the entry script, or node passes it to the daemon as an argument.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.