Skip to content

DL-13: Manage Axioms #35

@spuentesp

Description

@spuentesp

Category: data-layer | Epic: 0 | Priority: medium

Summary

Implement CRUD operations for Axiom nodes in Neo4j. Axioms are foundational
world rules and constraints tied to universes (e.g., "magic requires verbal
components", "vampires burn in sunlight"). Supports provenance via SUPPORTED_BY
edges to sources/snippets.

Acceptance Criteria

  • neo4j_create_axiom creates Axiom node linked to universe
  • neo4j_create_axiom validates universe_id exists
  • neo4j_create_axiom supports domain enum (physics, magic, society, metaphysics)
  • neo4j_create_axiom creates SUPPORTED_BY edges to sources/snippets
  • neo4j_get_axiom returns axiom with provenance chain
  • neo4j_list_axioms supports filtering by universe_id, domain, confidence
  • neo4j_update_axiom allows updating statement, confidence, canon_level
  • neo4j_delete_axiom removes axiom (soft-delete via canon_level='retconned')
  • All operations enforce CanonKeeper authority for writes
  • Unit tests achieve >= 80% coverage

Dependencies

This use case depends on:

  • DL-1
  • DL-8

Blocks

This use case blocks:

  • RS-1
  • CF-3

Implementation

Layer: 1

Files to create:

  • packages/data-layer/src/monitor_data/schemas/axioms.py
  • packages/data-layer/tests/test_tools/test_axiom_tools.py
    Files to modify:
  • packages/data-layer/src/monitor_data/tools/neo4j_tools.py
  • packages/data-layer/src/monitor_data/middleware/auth.py

NEO4J Operations:

  • neo4j_create_axiom (authority: CanonKeeper)
  • neo4j_get_axiom (authority: *)
  • neo4j_list_axioms (authority: *)
  • neo4j_update_axiom (authority: CanonKeeper)
  • neo4j_delete_axiom (authority: CanonKeeper)

Notes:

  • Axioms are world-building fundamentals (not specific facts)
  • Used by rules engine for consistency checking
  • Consider hierarchy (universal vs local axioms)
  • Retconned axioms remain for history but marked inactive

Testing Requirements

Minimum coverage: 80%

Unit tests:

  • test_create_axiom_success: valid params → Axiom node
  • test_create_axiom_with_provenance: source_ids → SUPPORTED_BY edges
  • test_create_axiom_domain: each domain value works
  • test_get_axiom_with_provenance: returns full chain
  • test_list_axioms_by_domain: domain filter works
  • ... and 3 more

Integration tests:

  • test_axiom_lifecycle: create → update → soft-delete
  • test_axiom_provenance: create with sources → verify chain

References

Documentation:


Generated from /home/sebas/monitor2/docs/use-cases/data-layer/DL-13.yml

Metadata

Metadata

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions