Sprint 1: project skeleton, type system, and all architecture specs

- src/types.hpp: complete UCWM type system in C++20 — 19 enums, 11 facet
  data types, all core structs (CanonicalObject, Constraint, Facet,
  GateSignal, WorldState, etc.) with full JSON round-trip serialization
- src/main.cpp: smoke test — constructs apple-problem WorldState by hand,
  serializes to JSON
- tests/test_types.cpp: 19 tests, 123 assertions, all passing
- CMakeLists.txt: CMake + CPM build with nlohmann/json, spdlog, Catch2
- schemas/: JSON Schema contracts for all UCWM data types
- gates/, specialists/, resolver/, synthesis/: language-agnostic interface
  contracts and domain specs for all pipeline layers
- docs/: architecture, vocabulary, decision matrices, roadmap (6 phases,
  28 sprints), sprint_001, implementation_constraints

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-01 16:09:55 -07:00
commit b758d7ea60
35 changed files with 6344 additions and 0 deletions

331
schemas/facets.json Normal file
View File

@@ -0,0 +1,331 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "ucwm/schemas/facets.json",
"title": "Facets",
"description": "Typed partial views that attach to CanonicalObjects. Facets are optional and additive — not every object exists in every relation type.",
"$defs": {
"BaseFacet": {
"type": "object",
"required": ["facet_id", "facet_kind", "object_ref", "confidence", "source_module"],
"properties": {
"facet_id": {
"type": "string",
"description": "Unique identifier for this facet instance."
},
"facet_kind": {
"type": "string",
"enum": [
"temporal",
"spatial",
"causal",
"logical",
"syntactic",
"semantic",
"social",
"ownership",
"code_structure",
"quantity",
"planning"
]
},
"object_ref": {
"type": "string",
"description": "The object_id this facet is attached to."
},
"confidence": {
"type": "number",
"minimum": 0.0,
"maximum": 1.0
},
"source_module": {
"type": "string",
"description": "Specialist module that produced this facet."
},
"provenance_refs": {
"type": "array",
"items": { "type": "string" },
"default": []
}
}
},
"TemporalFacet": {
"allOf": [
{ "$ref": "#/$defs/BaseFacet" },
{
"type": "object",
"description": "Temporal description: when this object exists, begins, ends, or recurs.",
"properties": {
"facet_kind": { "const": "temporal" },
"time_point": {
"type": "string",
"description": "Absolute or relative time point. ISO 8601 when known."
},
"interval_start": { "type": "string" },
"interval_end": { "type": "string" },
"temporal_order_refs": {
"type": "array",
"items": { "type": "string" },
"description": "IDs of constraint records expressing before/after/during relations."
},
"is_recurring": { "type": "boolean", "default": false },
"recurrence_pattern": {
"type": "string",
"description": "Natural language or ISO 8601 recurrence expression."
},
"duration": { "type": "string" }
}
}
]
},
"SpatialFacet": {
"allOf": [
{ "$ref": "#/$defs/BaseFacet" },
{
"type": "object",
"description": "Spatial description: where this object is, was, or will be.",
"properties": {
"facet_kind": { "const": "spatial" },
"location_label": { "type": "string" },
"coordinates": {
"type": "object",
"properties": {
"x": { "type": "number" },
"y": { "type": "number" },
"z": { "type": "number" }
}
},
"containment_refs": {
"type": "array",
"items": { "type": "string" },
"description": "Constraint IDs expressing inside/outside/adjacent relations."
},
"reference_frame": {
"type": "string",
"description": "The coordinate system or reference object."
}
}
}
]
},
"CausalFacet": {
"allOf": [
{ "$ref": "#/$defs/BaseFacet" },
{
"type": "object",
"description": "Causal description: what caused or was caused by this object.",
"properties": {
"facet_kind": { "const": "causal" },
"cause_refs": {
"type": "array",
"items": { "type": "string" },
"description": "IDs of objects or events that caused this one."
},
"effect_refs": {
"type": "array",
"items": { "type": "string" },
"description": "IDs of objects or events caused by this one."
},
"enabling_refs": {
"type": "array",
"items": { "type": "string" }
},
"blocking_refs": {
"type": "array",
"items": { "type": "string" }
},
"causal_strength": {
"type": "string",
"enum": ["necessary", "sufficient", "contributing", "correlational"]
}
}
}
]
},
"LogicalFacet": {
"allOf": [
{ "$ref": "#/$defs/BaseFacet" },
{
"type": "object",
"description": "Logical description: truth value, negation, quantification, implication.",
"properties": {
"facet_kind": { "const": "logical" },
"truth_status": {
"type": "string",
"enum": ["true", "false", "unknown", "hypothetical", "negated", "asserted"]
},
"quantifier": {
"type": "string",
"enum": ["universal", "existential", "none"]
},
"implies_refs": {
"type": "array",
"items": { "type": "string" },
"description": "IDs of propositions this object implies."
},
"negates_refs": {
"type": "array",
"items": { "type": "string" }
},
"contradicts_refs": {
"type": "array",
"items": { "type": "string" }
}
}
}
]
},
"OwnershipFacet": {
"allOf": [
{ "$ref": "#/$defs/BaseFacet" },
{
"type": "object",
"description": "Ownership and possession description: who holds what, and when.",
"properties": {
"facet_kind": { "const": "ownership" },
"owner_ref": {
"type": "string",
"description": "object_id of the current owner."
},
"owned_ref": {
"type": "string",
"description": "object_id of the thing owned."
},
"quantity_ref": {
"type": "string",
"description": "object_id of a quantity object if ownership is of a counted resource."
},
"temporal_ref": {
"type": "string",
"description": "Facet ID providing temporal scope for this ownership."
},
"transfer_type": {
"type": "string",
"enum": ["give", "sell", "take", "lose", "receive", "initial", "final"]
}
}
}
]
},
"QuantityFacet": {
"allOf": [
{ "$ref": "#/$defs/BaseFacet" },
{
"type": "object",
"description": "Quantity description: numeric value, unit, precision.",
"properties": {
"facet_kind": { "const": "quantity" },
"value": {
"oneOf": [
{ "type": "number" },
{ "type": "string", "description": "Symbolic expression e.g. 'Q1 - 2'" }
]
},
"unit": { "type": "string" },
"precision": { "type": "number" },
"is_exact": { "type": "boolean" },
"derived_from_refs": {
"type": "array",
"items": { "type": "string" },
"description": "object_ids of quantities this was computed from."
}
}
}
]
},
"SyntacticFacet": {
"allOf": [
{ "$ref": "#/$defs/BaseFacet" },
{
"type": "object",
"description": "Syntactic description: role in sentence structure.",
"properties": {
"facet_kind": { "const": "syntactic" },
"grammatical_role": {
"type": "string",
"enum": ["subject", "object", "indirect_object", "adjunct", "predicate", "modifier", "other"]
},
"head_token": { "type": "string" },
"dependency_arc": { "type": "string" }
}
}
]
},
"SocialFacet": {
"allOf": [
{ "$ref": "#/$defs/BaseFacet" },
{
"type": "object",
"description": "Social and agentive description: beliefs, intentions, obligations, roles.",
"properties": {
"facet_kind": { "const": "social" },
"agent_ref": { "type": "string" },
"social_act": {
"type": "string",
"enum": ["assert", "request", "promise", "threaten", "deceive", "inform", "ask", "other"]
},
"belief_about_ref": { "type": "string" },
"belief_truth_status": {
"type": "string",
"enum": ["true", "false", "unknown"]
},
"obligation_refs": {
"type": "array",
"items": { "type": "string" }
},
"role": { "type": "string" }
}
}
]
},
"PlanningFacet": {
"allOf": [
{ "$ref": "#/$defs/BaseFacet" },
{
"type": "object",
"description": "Planning description: steps, goals, prerequisites, dependencies.",
"properties": {
"facet_kind": { "const": "planning" },
"step_index": { "type": "integer" },
"prerequisite_refs": {
"type": "array",
"items": { "type": "string" }
},
"goal_refs": {
"type": "array",
"items": { "type": "string" }
},
"blocks_refs": {
"type": "array",
"items": { "type": "string" }
},
"status": {
"type": "string",
"enum": ["pending", "in_progress", "complete", "blocked", "skipped"]
}
}
}
]
}
},
"oneOf": [
{ "$ref": "#/$defs/TemporalFacet" },
{ "$ref": "#/$defs/SpatialFacet" },
{ "$ref": "#/$defs/CausalFacet" },
{ "$ref": "#/$defs/LogicalFacet" },
{ "$ref": "#/$defs/OwnershipFacet" },
{ "$ref": "#/$defs/QuantityFacet" },
{ "$ref": "#/$defs/SyntacticFacet" },
{ "$ref": "#/$defs/SocialFacet" },
{ "$ref": "#/$defs/PlanningFacet" }
]
}