Repository navigation
Implement ProjectNodeBehavior and the project core schema (#134) - #1753
Merged
Merged
Conversation
Add `project` as a core node type: a `project` SchemaNode in core_schemas.rs (status enum Core, default "planning", indexed; optional priority enum + start_date/end_date) and a ProjectNodeBehavior registered in NodeBehaviorRegistry::new(). Universal Graph model: the project name is the node `content`, typed data lives under `properties.project.*`, and children / ownership are graph edges — no side table, no owner_id/team_members blob. Validation splits as TaskNodeBehavior does: the behavior type-checks fields and enforces start_date <= end_date (ISO dates); the schema system validates enum membership. Projects are embeddable roots (name/description), unlike Task. Updates the type/schema enumeration tests (registry 18->19, core schemas 17->18) and renames a schema_test example from "Project" to "Campaign", since `project` is now a reserved core type (a user schema can no longer shadow it — verified by that test still creating successfully). Closes #134. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Contributor
Author
|
APPROVE Independent adversarial review — correct and complete for the core-only scope:
973 core lib tests pass, clippy clean, doctest passes, pre-push gate green. Residual (out of scope, filed #1754): frontend first-class registration ( |
12 tasks
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
Adds
projectas a core node type (Universal Graph model): aprojectSchemaNodeincore_schemas.rs+ aProjectNodeBehaviorregistered inNodeBehaviorRegistry::new().status(enum, Core, defaultplanning, indexed, required),priority(enum, User, indexed, optional),start_date/end_date(date, User, optional).is_core: true. Mirrors thetaskschema.content; typed data underproperties.project.*; children arehas_childedges; ownership/membership are graph edges — no side table, no owner_id/team_members blob.TaskNodeBehavior): the behavior TYPE-checks fields and enforces the cross-fieldstart_date <= end_daterule (only when both parse as ISOYYYY-MM-DD); the schema system validates enum membership/values (not duplicated here). Empty name →MissingField; non-stringstatus/priority/date →InvalidProperties.can_have_children→ true,supports_markdown→ true,default_metadataseedsproject.status = "planning". Projects are embeddable roots (name/description) —get_embeddable_content/get_parent_contributionreturn the content, unlike Task which returnsNone(intentional divergence, stated explicitly).Tests
5 behavior tests + a doctest: valid full project, minimal (name only), empty-name rejection, non-string field rejection, inverted date range rejection (+ non-ISO dates skip the range check, equal dates allowed), and
default_metadatashape. Updated the enumeration tests (test_registry_get_all_types18→19,test_get_core_schemas_returns_all17→18) and renamed aschema_testexample from "Project"→"Campaign", sinceprojectis now a reserved core type a user schema can't shadow.973 core lib tests pass; clippy clean; doctest passes; pre-push gate green.
Scope
Type only — no project UI/viewers, no status-transition workflows (#334), no
on_delete(the trait has none). Per ADR corrections in the issue (Universal Graph; noprojectstable).Closes #134.