Title: id: design: Querying local and remote ID servers v1 · Issue #5675 · developing-today/code · GitHub
Open Graph Title: id: design: Querying local and remote ID servers v1 · Issue #5675 · developing-today/code
X Title: id: design: Querying local and remote ID servers v1 · Issue #5675 · developing-today/code
Description: Summary ID servers hold data in tables; there should be a first-class, designed way to query those tables — on a local server and on remote servers — from scripts, from agents, and from the human CLI, with the same semantics in all three...
Open Graph Description: Summary ID servers hold data in tables; there should be a first-class, designed way to query those tables — on a local server and on remote servers — from scripts, from agents, and from the human C...
X Description: Summary ID servers hold data in tables; there should be a first-class, designed way to query those tables — on a local server and on remote servers — from scripts, from agents, and from the human C...
Opengraph URL: https://github.com/developing-today/code/issues/5675
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"id: design: Querying local and remote ID servers v1","articleBody":"## Summary\n\nID servers hold data in tables; there should be a first-class, designed way to **query** those tables — on a local server and on remote servers — from scripts, from agents, and from the human CLI, with the same semantics in all three. Remote queries are filtered by the data's sensitivity classification; the owner of a server keeps a deliberate override for their *own* server's unencrypted data. This design defines the query surfaces, the filtering model and its hard boundary, and result shaping.\n\nRelates: #2048 (ID data/zettelkasten layer — the tables being queried), and composes with the selective-sharing grants model (grants decide *whether* a peer may reach data; sensitivity filtering decides *what a query returns* — the design must state how the two compose).\n\n## Feature set (expanded)\n\n### 1. Query surfaces\n\n- **Local queries:** querying tables on a local ID server — in-process/embedded where possible, no network round trip, full local performance.\n- **Remote queries:** querying tables on a remote ID server over ID transport (including over fallback transports), with the remote server executing the query — not \"replicate everything and query locally\" as the only option.\n- Query language/shape: define what a query is in v1 (table selection, filters, projections, ordering, joins or explicitly no joins) — powerful enough for real use, constrained enough to be safe to execute on someone else's server.\n- The same query, unchanged, should be runnable against local and remote targets; only the target and the filtering outcome differ.\n\n### 2. Sensitivity classification & filtered remote queries\n\n- Every table/collection (and where needed, object/row or field) carries a sensitivity classification; the design defines the classification levels, who assigns them, and the default for unclassified data (default must be safe, not permissive).\n- A remote query executes **under the requester's clearance**: results are filtered to what the requester's identity is cleared for, server-side, before anything leaves the server. Filtering is not client-side cosmetics.\n- Filtered-result honesty: does the requester learn that results were withheld (count of withheld rows, existence of withheld fields) or not? Pick per classification level and state it — silent filtering and existence leaks are both failure modes.\n- Field-level behavior: redaction vs. whole-row exclusion vs. query rejection, per classification and query shape.\n- Audit: remote queries (who, what query, what classification levels were touched/withheld) are logged on the serving server, visible to its owner.\n\n### 3. The owner override — and its hard boundary\n\n- The local owner may **override sensitivity filtering for data on their OWN server**: when querying their own server, the owner can see past classification filtering.\n- **Boundary (state it exactly):** the override applies only when the data is **not encrypted**. Encryption defeats the override — if data is encrypted under keys the querying identity does not hold, no override, admin flag, or local access returns plaintext. Classification is a policy filter; encryption is a cryptographic boundary, and policy never outranks cryptography.\n- Override mechanics: explicit, deliberate, and audited (an override flag/mode, never a silent default; override use appears in the server's audit log). Override is per-query or per-session, not a permanent server setting that quietly stays on.\n- Override scope: own server only. Being owner of server A grants no override on server B, even for data A originally shared to B.\n- Multi-principal servers: if a server hosts data for more than one owner, whose override applies to whose data must be defined — an operator must not gain override over other people's unencrypted data merely by hosting it, if the model can prevent it; where it cannot, say so honestly.\n\n### 4. Parity: scripts, agents, humans\n\n- One query model, three front doors: a scripting/API surface, an agent-facing surface (structured in/out, machine-readable errors, stable result schema), and the human CLI — all executing the same queries with the same filtering.\n- No privileged back door: agents and scripts get no broader access than their identity's clearance; the CLI gets no magic local bypass except the explicit owner override above.\n- Non-interactive safety: scripts/agents can run read-only queries without prompts; mutating operations (below) require explicit intent that is visible in audit.\n\n### 5. Read-only vs. mutating surfaces\n\n- The query surface is **read-only by default and by design**; v1 query language must not be able to mutate data as a side effect.\n- Mutating operations, if exposed at all, are a *separate* surface (distinct commands/endpoints, distinct permissions, distinct audit), designed explicitly — not \"query language plus write verbs when you're local.\"\n- Remote mutation: whether a remote principal may ever mutate via this surface, and under what grants (compose with selective sharing), is decided here even if the v1 answer is \"no.\"\n\n### 6. Result shaping & pagination\n\n- Projection (choose fields), ordering, limits — pushed to the executing server, not done client-side over a full dump.\n- Pagination: stable cursor-based pagination for large results (no offset drift under concurrent writes), with page-size limits enforced server-side.\n- Result formats: structured (JSON/rows) for scripts/agents; human-readable tables for the CLI; a SQLite-shaped result is a candidate format for composability (see the foreign-adapter design's query-Redis-get-SQLite pattern).\n- Truncation honesty: when a result is cut (page size, server cap, sensitivity filtering), the result says so and how to continue — never a silent partial answer presented as complete.\n- Cost limits: server-side guardrails for expensive queries (timeout, scan cap) so a remote query cannot DoS the serving server.\n\n## Non-goals (v1)\n\n- A general SQL engine over arbitrary foreign stores (adapters are a separate design; this covers ID tables).\n- Analytics/aggregation beyond what the v1 query shape explicitly includes.\n- Weakening encryption for operability — the override boundary above is absolute.\n\n## Acceptance for this design\n\nA follow-on reader can break this into the decomposition tickets below without re-deciding: the filtering model, the override boundary, surface parity, or pagination/result rules.\n\n## Decomposition sketch\n\n1. Design: ID query language/shape v1 (local + remote execution model, local/remote parity).\n2. Design: sensitivity classification model (levels, assignment, defaults, field vs. row behavior).\n3. Design: server-side filtered remote query execution + withheld-result honesty + audit.\n4. Design: owner override mechanics (scope, audit, multi-principal servers) and the encryption boundary.\n5. Design: client surfaces parity — scripting/API, agent, and CLI front doors over one model.\n6. Design: result shaping & cursor pagination (formats, truncation honesty, server cost limits).\n7. Design: mutating surface separation (permissions, audit) — or an explicit v1 \"read-only only\" decision record.\n\n## Open questions\n\n- Classification levels: how many, named how, and can owners define their own?\n- Withheld-result signaling: counts, yes/no, or nothing — per level?\n- Is the query language a new ID-specific shape, a SQL subset, or both (SQL compiled to the ID shape)?\n- How do grants (selective sharing) and classification compose when they disagree — deny-wins?\n- On multi-principal servers, can the model technically separate operator from data owner for override purposes?\n- Cursor stability: snapshot semantics per query, or best-effort with documented drift?\n- Should a SQLite-formatted result be a v1 format or a follow-on?\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-11-04T23:08:05Z","url":"https://github.com/developing-today/code/issues/5675"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:9dfb0165-c64d-79e0-de82-23f64d20cccf |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A5FC:A3002:29AB04:3815BE:6B0616FA |
| html-safe-nonce | 898c9874960b020a07c9045484a52ba906e9d6b9d5ea8ca8fbf109bd29d764fd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNUZDOkEzMDAyOjI5QUIwNDozODE1QkU6NkIwNjE2RkEiLCJ2aXNpdG9yX2lkIjoiMTUwMjgxMjk1ODQ5NjI2NTk3OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 2ffe022d19e2dee88e7453ece00fa034a8fa2c8c40012500e799d2dcee5b631b |
| hovercard-subject-tag | issue:6213131538 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/developing-today/code/5675/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c77bcd36eb2ddc364277df0618426a0ff1c70ef0989b115cb5b2f6774cb1c654/developing-today/code/issues/5675 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c77bcd36eb2ddc364277df0618426a0ff1c70ef0989b115cb5b2f6774cb1c654/developing-today/code/issues/5675 |
| og:image:alt | Summary ID servers hold data in tables; there should be a first-class, designed way to query those tables — on a local server and on remote servers — from scripts, from agents, and from the human C... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dezren39 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 97d4714e567728e1f85f88b0cf68c89f0f8a3dc41e8869af7aeb8195ad990374 |
| turbo-cache-control | no-preview |
| go-import | github.com/developing-today/code git https://github.com/developing-today/code.git |
| octolytics-dimension-user_id | 26439447 |
| octolytics-dimension-user_login | developing-today |
| octolytics-dimension-repository_id | 627308783 |
| octolytics-dimension-repository_nwo | developing-today/code |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 627308783 |
| octolytics-dimension-repository_network_root_nwo | developing-today/code |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 866f202ebf7ac5aff8f633417d9fd8a53818a977 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width