Skip to content

Describe core's person, AI-chat and access-walk docs without Pro, tenant or cloud wording - #3407

Merged
mstomar125 merged 2 commits into
mainfrom
issue-3365-model-docs
Oct 1, 2026
Merged

mstomar125 merged 2 commits into
mainfrom
issue-3365-model-docs

Conversation

@mstomar125

@mstomar125 mstomar125 commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Closes #3365.

Rewords core's data-model and local-identity docs that explained core through Pro, Supabase, RLS, tenants, the Postgres schema, server-side RBAC or "the cloud walk". Each doc now gives the local meaning and names no consumer. Behaviour does not change.

Where Change
core_schemas.rs, the person schema's email description "Email address (optional)" (was "…required in practice for invited teammates")
behaviors/mod.rs, AiChatNodeBehavior doc Chats are nodes for identity, collection membership and traceability. Drops the "Stamped ACL permissions, cloud sync" claim.
behaviors/mod.rs, PersonNodeBehavior doc Pure identity; the role lives on the has_role edge. Drops the auth_status and tenant-role sentence.
core-plugins.ts, aiChatNodePlugin doc Linkable and groupable like any node; not embedded. Drops "semantic search, Stamped ACL permissions, and cloud sync", which were wrong: chats are never embedded.
node_service/mod.rs, seed_local_person_if_needed doc Drops the Supabase / auth_identities binding and the auth_status note
node_service/mod.rs, get_local_person doc "can hold more than one has_role edge" instead of "tenant roles … for upcoming RBAC work"
node_service/mod.rs, the multiple-has_role test comment "a non-owner role alongside the owner's" instead of "multiple tenant roles"
tests/it/person_seed_test.rs, module doc Drops "free included" and the Pro/Supabase sentence
sqlite_store/conflicts.rs, the archive-the-loser step Drops the ADR-042 cloud/Postgres tombstone clause
sqlite_store/embedding_roots.rs, docs of MAX_ACCESS_WALK_DEPTH, restricted_collection_sql and access_candidate_sql Local wording: a depth cap against a pathologically deep member_of chain; a text-stored flag still restricts; a person's member_of edges grant access and are not content membership
table-view-headers.test.ts, schema-field-label.test.ts Fixtures quote the new description. The queryByText regex matches the new text.

What is not a comment change

Everything except the following is comment-only. I checked this with a token-level diff of each file against origin/main, with comments and whitespace removed.

  • core_schemas.rs:
    • the email description string;
    • a new test_person_email_field_is_optional, which pins required: Some(false) and the new description;
    • rustfmt churn in get_core_schemas(). The old description line was too long for rustfmt to wrap, so rustfmt skipped the whole function. With the line shorter, cargo fmt now formats it. It collapses the collection schema's single-element fields: vec![…] (one indent level less, one trailing comma dropped) and rewraps three other long lines. That is whitespace and punctuation only. I realigned one \-continued string literal by hand, which leaves its value unchanged.
  • The two frontend test fixtures: string literals and one regex.

Deviations from the issue

  • The collection schema comment in core_schemas.rs is not touched. Rewrite the restrictedToMembers and member_of permission comments as storage contracts #3301 (merged in Rewrite the restrictedToMembers and member_of permission comments as storage contracts #3389) already rewrote it as ADR-083 §4's storage contracts, per the epic's plan correction 1. Main already meets that acceptance criterion.
  • BASELINES is not lowered. The drain's standing rule is not to edit BASELINES unless a count must rise, because parallel PRs collide on those lines and Drive every Pro-boundary ratchet count to zero and make the check a hard ban #3371 tightens them all. No count rises.
  • PersonNodeBehavior names first_name and last_name, not name. Those are the person schema's actual fields; the issue's suggested text said name.
  • conflicts.rs says "a third lifecycle value" instead of keeping "a fourth concept". With the cloud tombstone clause gone, "fourth" lost its referent (active, archived, then a new one makes three).
  • MAX_ACCESS_WALK_DEPTH is not called "a backstop against a member_of cycle", the issue's suggested text. The walk's seen set already stops cycles, so the cap bounds a pathologically deep chain. Review caught this.
  • Existing databases keep the old email description, because core schemas are seeded only when missing. This is cosmetic, and nothing parses it. There is no migration, per CLAUDE.md.

Left alone (other issues own them)

bun run scripts/check-pro-boundary.ts --changed still lists these hits in files this PR touches:

Ratchet

No count rises. Marker counts in the changed files, origin/main → this branch:

Marker Change
proWording 2 → 0 (−2)
cloudWording 2 → 0 (−2)
tenantWording 6 → 3 (−3)
cloudBindState 2 → 0 (−2)

check-pro-boundary.ts exits 0. check-code-references.ts: issue-number references 71 (baseline 71), doc-path references 0.

Test plan

  • cargo fmt -p nodespace-core --check
  • cargo clippy -p nodespace-core --all-targets -- -D warnings -D clippy::unused-async
  • core_schemas unit tests (nextest), including the new test_person_email_field_is_optional
  • Mutation: restoring the old email description fails test_person_email_field_is_optional
  • bun run --cwd packages/desktop-app test table-view-headers schema-field-label: 5 passed
  • Mutation: rendering the email description in a <span> beside the header label (table-view.svelte) fails table-view-headers.test.ts at the new queryByText(/Email address \(optional\)/) assertion. Reverted.
  • bun run --cwd packages/desktop-app quality:fix: 0 errors, 0 warnings
  • bun run test:changed (frontend, rust, scripts)
  • git grep -n 'invited teammates' -- packages returns nothing

🤖 Generated with Claude Code

@mstomar125

Copy link
Copy Markdown
Contributor Author

Review Type: Initial Review

Requirements Check:

  • ✅ None of the listed docs/strings contains Pro, RLS, Supabase, auth_identities, tenant, Postgres, cloud, server-side or invited teammates. Checked the added lines of the whole diff (no hits) and the touched symbols individually: person email field, AiChatNodeBehavior, PersonNodeBehavior, seed_local_person_if_needed, get_local_person, the multiple-has_role test comment, person_seed_test.rs lines 1-5, the conflicts.rs archive step, the three embedding_roots.rs docs, and the aiChatNodePlugin doc.
  • ✅ core_schemas.rs comment states both storage contracts. Already satisfied on main by Rewrite the restrictedToMembers and member_of permission comments as storage contracts #3389. The current text (core_schemas.rs:526-541) covers restrictedToMembers (path properties.collection.restrictedToMembers, JSON boolean, any value whose text form is not true is unrestricted) and permission (path properties.permission on a person's member_of edge, admin/modify/readOnly, absent = modify).
  • ✅ A new database's person schema reports Email address (optional) (core_schemas.rs:1327), and the new test_person_email_field_is_optional pins it plus required: Some(false).
  • ✅ The AI-chat docs no longer claim chats are embedded, searchable by meaning, or synced. This matches the code: AiChatNodeBehavior::get_embeddable_content returns None (behaviors/mod.rs ~1897) and its own Embedding section says so.
  • ✅ git grep -n -i 'invited teammates' -- packages returns nothing. I also grepped for required in practice / optional at schema level / Stamped ACL, and found no stragglers.
  • 🟡 BASELINES not lowered. The issue's literal step is not done. The script header (check-pro-boundary.ts:9-24) says decreases never fail and that tightening is encouraged "whenever it is cheap", but it also documents the parallel-PR collision problem the coordinator's standing rule is about. I ran the script: it exits 0 with the "some are below" notice. Accepting this deviation per the coordinator's rule.

📝 Deviations, each checked against the code:

  • collection comment untouched: justified (see above). The diff against main for that comment is empty.
  • first_name/last_name instead of name: correct and better than the issue text. The seeded person schema (core_schemas.rs:1271-1330) declares exactly first_name, last_name, email; there is no name field. PersonNodeBehavior::validate only checks email, matching "format-validated when present".
  • "third lifecycle value": reads correctly. LIFECYCLE_STATUSES is ["active", "archived"], so a new state would be the third value. Without the cloud-tombstone clause, "fourth concept" would have no referent. The sentence still scans.
  • Leftover markers (nodespaced-pro batch doc at node_service/mod.rs:5196 -> Reword core's batch-write, event and collision docs without naming the sync daemon #3364; "sync into one tenant" at node_service/mod.rs:1762 and 9324 -> Sweep the Pro and sync wording C7 leaves around replicated writes and AI-chat privacy #3367): reasonable scope discipline. check-pro-boundary.ts --changed output on this branch matches the PR body exactly (editionBranching 1, tenantWording 3, all others 0 in changed files). The third leftover is raised as finding 1 because, unlike the other two, nothing owns it.
  • Token-equivalence of the get_core_schemas() rustfmt churn: verified. I normalized main and HEAD versions of core_schemas.rs (dropped // comment lines, string-continuation backslash+whitespace, all whitespace, and trailing commas before ]/)/}) and diffed them. The only differences are the email description string and the new test. The collapsed single-element fields: vec![SchemaField {…}], the rewrapped first/last-name descriptions, and the DEFAULT_SKILL_MAX_ITERATIONS rewrap are whitespace/punctuation only. The hand-realigned \-continued restrictedToMembers description string has the same value (leading whitespace after \+newline is stripped by Rust).

Code Review Findings:

  1. 🟢 Suggestion: the DatabaseSettingsNodeBehavior "tenant role" doc is now orphaned.
    📁 packages/core/src/behaviors/mod.rs:2322 ("…→ DatabaseSettingsNode and carries the tenant role.")
    Replace DatabaseSettingsNode's Pro fields and accessors with a generic settings accessor #3340 merged without rewording it, and Sweep the Pro and sync wording C7 leaves around replicated writes and AI-chat privacy #3367's own body lists this doc under "Replace DatabaseSettingsNode's Pro fields and accessors with a generic settings accessor #3340" as out of scope, so after this PR no open issue owns it. It is 55 lines below the PersonNodeBehavior doc this PR rewrites to say the role "lives on the has_role edge", so the same file now describes one relationship in two vocabularies. It is a one-line change in a file this PR already edits, and "tenant role" is one of the three remaining tenantWording hits here. Recommendation: either change it here (e.g. "carries the owner's role"), or add it to Sweep the Pro and sync wording C7 leaves around replicated writes and AI-chat privacy #3367's scope or a new issue so it is not lost. Not a blocker. Principle: leave no orphaned work when splitting a sweep across issues.

  2. 🟢 Nit: MAX_ACCESS_WALK_DEPTH doc slightly overstates what the cap protects against.
    📁 packages/core/src/db/sqlite_store/embedding_roots.rs:16-17 ("a backstop against a member_of cycle")
    access_boundary already breaks cycles with the seen set (seen.insert(up.clone()) gates next), so a cycle empties the frontier and exits regardless of the cap; the cap only bounds the length of a legitimate chain. This is the issue's prescribed wording and matches the neighbouring MAX_PARENT_CHAIN_DEPTH doc, so it is not a regression. Optional rewording: "Upper bound on the upward access walk, a backstop against a pathologically deep member_of chain."

  3. 🟢 Nit: ragged comment reflow in three places. rustfmt does not reflow comments, so these stay short-lined.
    📁 packages/core/src/db/sqlite_store/conflicts.rs:361-365 (a lone "reversible). NOT" line)
    📁 packages/core/src/services/node_service/mod.rs:1990-1993 (get_local_person doc: "…has_role edge, so this filters on / role == "owner" rather than taking the first / has_role edge —")
    📁 packages/core/src/services/node_service/mod.rs:9674-9677 (test comment: "…alongside the / owner's. A naive / "first has_role edge" resolution…")
    Rewrap to the usual width.

  4. 🟢 Nit: get_local_person inline comments still speak of RBAC as future work, while the rewritten doc above now says the node can hold more than one has_role edge.
    📁 packages/core/src/services/node_service/mod.rs:2025 and 2042 ("Once multi-role RBAC lands…")
    RBAC is not one of the issue's listed markers, so this is optional. Consider "if a second owner edge is ever written" for consistency within the one function.

Verified accurate, no change needed:

  • access_candidate_sql doc: the SQL excludes cn.node_type != 'person' for member_of edges where the node is in_node, which is exactly "a person's member_of edges … do not classify the person node". "Grant access (their permission)" matches the admin edge that seed_personal_ai_chat_collection_if_needed writes.
  • restricted_collection_sql doc: json_type(...) = 'true' covers the JSON boolean and json_extract(...) = 'true' covers the string, matching "JSON true and the string "true" both count".
  • get_local_person and the has_role test comment: filter on role == "owner" and the test adds a member edge, so "a non-owner role alongside the owner's" is accurate.
  • AI-chat docs ("share the node model's identity, collection membership and development traceability", "linked and grouped into collections like any other node", "not embedded"): consistent with the behavior's get_embeddable_content() -> None and the personal AI-chat collection.
  • Tests: test_person_email_field_is_optional asserts both required == Some(false) and the exact description, so it is a meaningful guard on the seeded text (the issue asked for this). In table-view-headers.test.ts, getByText('Email') is an exact-string match, so it cannot match the description, and the substring regex queryByText(/Email address \(optional\)/) would match if the description leaked into a header; the author's reported mutation (rendering the description in a <span>) is consistent with that. The regex escapes the parentheses correctly. The schema-field-label.test.ts fixture is a plain string swap with the assertion unchanged.
  • No new Pro/tenant/cloud/RLS/Postgres/Supabase wording and no #NNNN references in any added line.
  • No behavior change outside the schema description string; the Rust diff is comment/format-only plus the new test.

Recommendation: APPROVE

@mstomar125 mstomar125 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated pragmatic-code-review: APPROVE (posted as a comment — GitHub blocks self-approval). Full findings in the review comment above.

@mstomar125

Copy link
Copy Markdown
Contributor Author

Address-review summary

Verdict addressed: APPROVE, with four 🟢 suggestions. Fix commit: 7c38c741 (comment-only).

✅ Addressed (2)

  • Create design system foundation #2 MAX_ACCESS_WALK_DEPTH wording (embedding_roots.rs:16-17). I verified this. access_boundary keeps a seen set (if seen.insert(up.clone())), so a member_of cycle ends the walk on its own. The doc now says the cap is "a backstop against a pathologically deep member_of chain (the walk's seen set stops cycles)". The issue's suggested text was inaccurate, and the PR body lists this as a deviation.
  • Desktop shell with resizable panels #3 Ragged reflow. I reflowed the three paragraphs this PR edited:
    • the archive-the-loser step in conflicts.rs;
    • the get_local_person doc;
    • the multiple-has_role test comment.

⏭️ Skipped (2), out of this issue's listed scope

Checks after the fix

  • A token-level diff against the previous head shows every change is in comments or whitespace.
  • cargo fmt -p nodespace-core --check passes.
  • check-pro-boundary.ts exits 0, with no count above its baseline.
  • No Pro, tenant, cloud, RLS, Postgres or Supabase wording and no issue numbers were added.

Re-Review Decision

Decision: NO RE-REVIEW NEEDED

Rationale: Both fixes are documentation-only: one doc sentence corrected to match code the reviewer already read, and comment reflow. No logic, test or string literal changed.

@mstomar125

Copy link
Copy Markdown
Contributor Author

Merge queue: #3407 was taken out of the queue — the merge gate failed on it, rebased onto main. Reproduce with git rebase origin/main and bun run test:changed, fix, push, and re-run bun run merge 3407.

test window_routing::tests::empty_database_id_is_treated_the_same_as_no_id ... ok
test window_routing::tests::no_database_id_and_no_focus_falls_back_to_the_first_label_deterministically ... ok
test window_routing::tests::no_database_id_routes_to_the_focused_window ... ok
test window_routing::tests::no_monitor_information_fails_open_rather_than_forcing_the_fallback ... ok
test window_routing::tests::no_windows_open_at_all_yields_no_targets ... ok
test window_routing::tests::only_a_sliver_of_overlap_does_not_count_as_onscreen ... ok
test window_routing::tests::registry_pin_returns_the_previous_value_and_unpin_removes_it ... ok
test window_routing::tests::resolve_focus_window_falls_back_deterministically_when_nothing_is_focused ... ok
test window_routing::tests::resolve_restore_geometry_applies_the_saved_geometry_unchanged_when_no_monitor_is_known_at_all ... ok
test window_routing::tests::resolve_restore_geometry_centers_an_offscreen_geometry_on_the_primary_monitor ... ok
test window_routing::tests::resolve_restore_geometry_falls_back_to_the_first_monitor_when_no_primary_is_identified ... ok
test window_routing::tests::resolve_restore_geometry_leaves_an_onscreen_geometry_unchanged ... ok
test window_state::tests::a_corrupt_file_is_treated_as_no_saved_state_rather_than_an_error ... ok
test window_state::tests::a_transient_non_missing_read_failure_refuses_to_save_rather_than_wiping_the_file ... ok
test window_state::tests::concurrent_saves_for_different_databases_all_survive ... ok
test window_state::tests::different_databases_do_not_clobber_each_other ... ok
test window_state::tests::is_plausible_rejects_degenerate_dimensions_but_allows_negative_position ... ok
test window_state::tests::missing_file_yields_no_saved_geometry ... ok
test window_state::tests::save_leaves_no_temp_file_behind ... ok
test window_state::tests::save_then_load_round_trips ... ok
test window_state::tests::saving_again_for_the_same_database_overwrites_its_entry ... ok
test shutdown_tests::close_requested_does_not_cancel_token_until_window_is_destroyed ... ok
failures:
---- daemon_setup::stale_socket_removal_tests::a_socket_nothing_answers_on_is_removed stdout ----
thread 'daemon_setup::stale_socket_removal_tests::a_socket_nothing_answers_on_is_removed' (11642146) panicked at packages/desktop-app/app-lib/src/daemon_setup.rs:3701:9:
assertion failed: !socket.exists()
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
failures:
    daemon_setup::stale_socket_removal_tests::a_socket_nothing_answers_on_is_removed
test result: FAILED. 279 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 2.89s
error: test failed, to rerun pass `-p nodespace-app-lib --lib`
error: script "rust:test:app-units" exited with code 101
error: script "rust:test" exited with code 101
[stage exited with code 101]

  full output: /var/folders/3w/y9kj522n1_j9wqmt6vl_sb6r0000gp/T/nodespace-gate-logs/_gate-merge-2026-10-01T07-30-27-830Z/rust-test-rust-workspace-nextest.log

✗ rust:test (Rust workspace, nextest) failed — merge blocked.
  Fix the failure, push, and re-run: bun run merge <PR#>

mstomar125 and others added 2 commits October 1, 2026 09:56
Reword the data-model and local-identity docs that explained core through
Pro, Supabase, RLS, tenants, the Postgres schema or the cloud walk:

- person schema: email description is now "Email address (optional)"
- PersonNodeBehavior / AiChatNodeBehavior docs and the aiChatNodePlugin
  doc: drop the ACL, cloud-sync and semantic-search claims
- seed_local_person_if_needed / get_local_person docs and the
  multiple-has_role test comment: drop the Supabase binding and tenant roles
- person_seed_test module doc, conflicts.rs archive-the-loser step and the
  embedding_roots.rs walk docs: state the local rule only

Add test_person_email_field_is_optional pinning the seeded description.
The shorter description line lets rustfmt format get_core_schemas(), which
rewraps a few unrelated lines (whitespace and one trailing comma only).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…omments

- MAX_ACCESS_WALK_DEPTH: the walk's `seen` set already stops a `member_of`
  cycle, so the cap bounds a pathologically deep chain, not a cycle
- Reflow the archive-the-loser step, the get_local_person doc and the
  multiple-has_role test comment, which the rewording left ragged

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@mstomar125
mstomar125 force-pushed the issue-3365-model-docs branch from 7c38c74 to ece3a1a Compare October 1, 2026 07:56
@mstomar125
mstomar125 merged commit 0e0f79a into main Oct 1, 2026
@mstomar125
mstomar125 deleted the issue-3365-model-docs branch October 1, 2026 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reword core data-model and identity docs that cite Pro, Supabase, RLS or tenants

1 participant