Repository navigation
Description
Overview
Some properties denote state on a particular machine — a resume handle under ~/.claude/, an absolute path, a device identifier, a local port. Transporting them either means nothing or means something false on another machine. NodeSpace currently handles exactly one such property, by name, in prose, and — as it turns out — not at all in code.
This issue introduces a general property-level localOnly classification in the schema system and applies it to PTY capture, replacing a per-field intention that was never enforced.
Problem Statement
Two concrete defects:
1. capture.sync is a setting nothing consults. CaptureConfig { enabled, sync, content } in packages/daemon/src/services/settings_service.rs defines sync: bool defaulting to false, documented as "local only even when enabled." It is exposed over the settings RPC (update_capture_settings writes config.capture.sync) and persisted to daemon.toml. The capture write path never reads it: build_capture_properties in packages/daemon/src/services/capture_service.rs emits capture:session_id, capture:summary, and capture:transcript as ordinary node properties, and those sync like any other property. The stated local-only guarantee does not exist. A setting that promises local-only behavior and is enforced by nothing is worse than no setting — it reads as a guarantee.
2. The exclusion is a per-field special case. "Never sync agent_session_id" is a rule about one field name. Machine-boundness is a general property, and every future machine-bound field would need its own hand-maintained exclusion, invisible in the schema and discoverable only by reading sync code.
There is also a content-risk dimension that is not about machine-boundness at all: raw terminal scrollback is the highest-risk content in the system. It plausibly contains environment variables, tokens printed by tooling, machine-describing absolute paths, and output from unrelated repositories. Capture stores raw bytes via from_utf8_lossy — ANSI stripping is documented as aspirational and is unbuilt. NodeSpace has no secret-scrubbing design anywhere. Today that content syncs.
On the apparent ADR-034 / ADR-032 contradiction
ADR-034 said all four provider modes "sync identically," while ADR-032 said capture.sync defaults to false and agent_session_id is never synced. These are not in conflict, and the docs have been clarified rather than one being reversed: ADR-034's statement is about node type and shape — one node type, one sync path, no per-mode branch in the sync layer — made in the same sentence that says the modes differ in how much is captured. ADR-032 governs which fields exist to be synced. Both stand; what was missing was the mechanism making ADR-032's field-level claim structurally true.
Proposed Solution
A property-level localOnly classification
A property marked localOnly in its schema:
- is persisted locally and behaves like any other property for local reads, writes, and UI;
- is never included in a sync push;
- is ignored if it arrives in a pull (so a client that pushes it anyway cannot inject machine-bound values onto another device);
- survives the device's own restarts, and is simply absent on other devices — a device reading it gets nothing, never a stale value from elsewhere.
The decision rule: a property is localOnly when its value denotes state on a particular machine, such that transporting it either means nothing or means something false elsewhere.
The classification is visible in the schema where a reader can see it, rather than buried in sync code, and it generalizes to future machine-bound properties instead of accumulating exclusions.
Applied to PTY capture
| Syncs | Local-only | |
|---|---|---|
| 2a / 2b / 2c | node + structured messages[] |
— |
| 2d (pty) | node: title, provider, agent, timestamps, status, derived summary | raw transcript, agent session id |
- Agent session id →
localOnlyon machine-boundness grounds: it names state under~/.claude/or~/.codex/sessions/, and resumption is agent-local and cannot transfer. - Raw transcript →
localOnlyon content-risk grounds, not machine-boundness. The bar for reclassifying it is a scrubbing design — at minimum ANSI stripping (which the summary path already requires) plus secret detection — not a settings toggle. - Derived summary → syncs. It is the intended cross-device artifact: locally generated prose rather than raw output, carrying the traceability value without the buffer's risk. Where no summarizer is available, mode 2d syncs reference and metadata only, which is the already-specified fallback.
Remove capture.sync
Delete the field, its RPC surface, and its persistence. What it appeared to offer is now structural. A toggle here would let a user opt into pushing unscrubbed terminal scrollback, including secrets, into a shared tenant — not a decision a checkbox should carry. capture.enabled and capture.content remain the controls over what is captured at all.
Architecture Impact
- ADR-061 (
../nodespace-docs/decisions/061-ai-chat-private-by-default-and-machine-bound-properties.md) §6 and §7 are the governing decision. This issue implements them. - ADR-032 (
../nodespace-docs/decisions/032-pty-agent-session-architecture.md) has been amended:capture.syncis removed from the configuration block, and theagent_session_idexclusion is reframed as an instance of thelocalOnlyclassification rather than a per-field rule. This is a removal of a documented setting — a small reversal of ADR-032's configuration surface, recorded there explicitly. - ADR-034 (
../nodespace-docs/decisions/034-aichat-provider-modes.md) has been clarified on "same sync path" vs. which fields travel; not reversed. architecture/ai-chat-node.mdhas a new "Machine-Bound and Local-Only Properties" section.- Schema system: this adds a property-level classification, so it touches the schema/namespace rules in
../nodespace-docs/components/schema-management.md. No prior ADR defines a per-property sync classification — this is the first. - The companion
nodespace-docschanges are already committed; no further docs work is required.
Acceptance Criteria
- The schema system supports a property-level
localOnlyclassification - A
localOnlyproperty is readable and writable locally and behaves normally in the UI - A
localOnlyproperty is never included in a sync push - A
localOnlyproperty arriving in a pull is ignored, not applied - A
localOnlyproperty survives daemon and app restarts on its own device - The agent session id is classified
localOnlyand does not appear in any pushed payload - The raw PTY transcript is classified
localOnlyand does not appear in any pushed payload - The derived summary, agent type, timestamps, exit code, and status still sync
-
capture.syncis removed fromCaptureConfig, the settings RPC, anddaemon.tomlhandling — with no remaining references -
capture.enabledandcapture.contentbehavior is unchanged - Test asserts a mode-2d capture with
content: fullpushes no transcript and no session id - Tests pass (
bun run test:all) - Code passes
bun run quality:fix
Technical Specifications
Reference Files
- Capture properties:
packages/daemon/src/services/capture_service.rs—build_capture_properties(session, capture, content_level),finalize_capture - Settings:
packages/daemon/src/services/settings_service.rs—CaptureConfig(lines around 78–95),capture_to_response,update_capture_settings - Session launch:
packages/daemon/src/services/agent_session_service.rs— readsCaptureConfigonce at launch - PTY capture buffer:
packages/agent/src/pty/capture.rs— raw bytes viafrom_utf8_lossy; ANSI stripping unbuilt - Schema system:
packages/core/src/schema/ - Sync push: the property-serialization path in
nodespace-sync(src/push/) that assembles node payloads
Implementation Details
- Capture properties already use the
capture:namespace prefix per the project's schema rules (capture:agent_type,capture:session_id,capture:summary,capture:transcript). ThelocalOnlyclassification is orthogonal to the namespace and must not be inferred from the prefix — mostcapture:properties do sync. - Enforce the exclusion at the push serialization boundary, not at the call sites that write the property. A call-site rule is one that every future writer must remember; a serialization-boundary rule holds for all of them. Ignoring the property on pull is the paired defense so the guarantee does not depend on every client honoring it.
- There is currently exactly one assertion touching this area — a test confirming
build_capture_propertiesdoes not emit a bareagent_session_idkey. Note that this passes trivially: the code emitscapture:session_id, a different key, so the test does not actually pin the exclusion. Replace it with an assertion against the pushed payload. - The proto surface for capture settings loses a field. Per the project's no-backward-compatibility stance, remove it outright rather than reserving or deprecating it.
- Deciding where
localOnlyis declared is the main design choice: schema-node property definitions are the natural home, but core node types have hardcoded behaviors, andai-chatis a core type — so the classification needs to be expressible for both hardcoded and schema-driven properties.
Related Issues
- AI chats private by default: seeded personal collection, transactional membership, and implement the non-embeddable revision #1740 (AI chat private by default — the other half of ADR-061)
Activity
mstomar125 commentedon Jul 31, 2026
Done — shipped across two coordinated PRs (ADR-061 §6/§7 property-level localOnly).
nodespace-core#1854 (classification): added a
localOnlyflag toSchemaField(Rust + TS) and applied it to PTY capture on the ai-chat schema —capture:session_id+capture:transcriptare localOnly (machine-bound resume handle / content-risk raw scrollback),capture:summarysyncs. Removed the inertcapture.syncsetting end-to-end (proto, daemon, Tauri, frontend + tests) — the guarantee is now structural, not a toggle.nodespace-sync#394 (enforcement): the sync engine consults the classification via
get_core_schemas(). Push strips localOnly properties before a node's row leaves the device; pull reconciles incoming properties — drops any localOnly value that arrived from a peer, and carries the local device's own localOnly values forward so a pulled edit to a synced field can't clobber them. All three push paths (live, connect-heal sweep, Core→Pro migration) route through one stripping row builder so none can bypass it.Verification: full pre-push gate green on the core side (frontend 4113 + full Rust workspace + nodespace-app + e2e); sync
cargo test --workspace218+115 + localOnly unit tests. Adversarial review caught two real issues before merge — a transcript leak via the migration/sweep push paths, and a half-committed module move leaving dead code — both fixed.Deferred to a Mac session: live 2-device convergence validation (owner's localOnly value survives a peer's synced-field edit; foreign localOnly never applied).