Skip to content

naming-conventions.md has no SQL or JSON wire-key section, the layer where #2788/#2801 both occurred #2810

Closed

Description

@malibio

Summary

development/standards/naming-conventions.md covers files, components, TypeScript, Rust, branches and commits — but says nothing about SQL or about JSON payload keys, which is where the two most recent naming bugs (#2788, #2801) both live. It also carries two stale entries of its own.

1. The missing layer table

The convention is real and consistently implemented; it just isn't written down in one place. ADR-024 states it for parent-child params specifically (parentId/containerNodeId on the operations layer, no such columns in storage), but nothing generalizes it.

Layer Case Example Source of truth
SQL columns, tables, indexes snake_case node_type, lifecycle_status, reverse_relationship_type packages/core/src/db/schema.rs — all 39 columns, zero exceptions
Schema field names (inside the properties JSON blob) snake_case due_date, company_name ADR-063; json_extract(properties, '$.task.due_date') in the DDL
Schema field metadata keys (wire) camelCase friendlyName, coreValues, uniqueCaseInsensitive packages/nodespace-types/src/schema.rs:147-148 (rename_all = "camelCase")
Rust structs/fields snake_case unique_case_insensitive existing Rust section

Why the gap causes real bugs

Layers 2 and 3 sit side by side in one payload, both legitimately:

{ "name": "due_date", "type": "text", "uniqueCaseInsensitive": true }

A snake_case key next to a camelCase key is correct here. That means neither eyeballing nor "match the surrounding keys" catches a wrong key — only deny_unknown_fields does, at runtime. #2788 (doc text) and #2801 (the in-app agent's own tool JSON schema) are both exactly this: a Rust field name (unique_case_insensitive) written into the wire layer, in a payload where snake_case neighbours made it look right.

An external agent using the skill reached the opposite conclusion from the same evidence — reporting that the snake_case spelling "reads as a typo rather than a convention" because it coexisted with first_name. Both spellings were legitimate; they were different layers.

Worth noting one deliberate wrinkle the table should call out: top-level params structs (CreateSchemaParams, UpdateSchemaParams — packages/core/src/schema/mod.rs:994, 1352) are deny_unknown_fields without rename_all, so schema_id/title_template/add_fields are snake_case while the SchemaField entries nested inside them are camelCase. This is consistent with layers 1/2/4 and was left as-is through both #2788 and #2800; documenting it prevents it being re-litigated as a bug. It does produce one asymmetry worth a note: schema update accepts top-level title_template, but schema get returns it as properties.titleTemplate.

2. Two stale entries

  • Branch pattern (:49-54) — documents feature/issue-<N>-brief-description. CLAUDE.md:42 says explicitly: "terse, no feature/ prefix, e.g. issue-1122-agent-tools". The doc contradicts the agent guide, and EnterWorktree owns the branch name in practice.
  • Attribution (:60-62) — Co-Authored-By: Claude <[email protected]> is the old line.

Suggested fix

Add a "SQL" section and a "JSON / wire keys" section carrying the layer table above, cross-referencing ADR-024 and ADR-063. Fix the two stale entries. Keep it descriptive of what the code already does — no code changes are implied by this issue.

Found via

External agent session using the nodespace skill, which hit #2788's wrong key and misdiagnosed the convention. Filed after tracing why that class of mistake keeps recurring: the convention that governs it is the one convention not written down.

Activity

  1. added
    documentation
    on Sep 22, 2026
  2. malibio commented on Sep 22, 2026

    @malibio
    CollaboratorAuthor

    Fixed in nodespace-docs@0c18dac.

    Added both missing sections to development/standards/naming-conventions.md: a SQL section and a JSON / wire keys section carrying the layer table, cross-referencing ADR-024 and ADR-063.

    The table includes the deliberate wrinkle you flagged — top-level params structs are deny_unknown_fields without rename_all, so schema_id/title_template/add_fields stay snake_case while nested SchemaField entries are camelCase — documented explicitly as intended rather than a bug, along with the title_template vs properties.titleTemplate asymmetry.

    Both stale entries fixed: the branch pattern dropped the feature/ prefix (and now notes that EnterWorktree owns the name in practice), and the attribution line was updated.

    No code changes, as specified. Note ADR-024's actual filename is 024-parent-child-operation-parameters.md, not the -parameter-naming spelling in the issue body.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions