Skip to main content

cjm-context-graph-layer

Domain-neutral graph-aware layer for context graphs: deterministic node identity, spine and overlay grammar, spine-edit operations with effective-view projection, supersession resolution, idempotent emission/extension, and provenance-by-declaration.

Modules

  • cjm_context_graph_layer.declare — Provenance-by-declaration: host logic stays readable Python in the workflow core and DECLARES its provenance contributions as a Derivation event node (+ DERIVED_FROM input edges, PRODUCED output edges). This recovers audit completeness without the substrate executing host logic (pass-2 Thread 4's false-dichotomy resolution). The substrate stays untouched: declarations read composition/job ids from the outside.
  • cjm_context_graph_layer.edits — The spine-edit operation vocabulary (prune / replace_text / boundary_shift) + supersession resolution + the effective-view projection. These are generic operations on any NEXT-chained text spine; correction workflows carry them in overlay-node payloads, and the projection interprets them at read time (migrates correction-core C11/C16 onto the layer).
  • cjm_context_graph_layer.grammar — The domain-neutral context-graph grammar: spine relations (NEXT / PART_OF / STARTS_WITH, recurring fractally at every layer), overlay relations (SUPERSEDES / DERIVED_FROM / PRODUCED), root kinds, and the standardized attribution fields.
  • cjm_context_graph_layer.identity — Deterministic node/edge identity: UUIDv5 over canonical identity tuples (stage-5 ratified rule: a node's id derives from what makes it THE same node across re-derivation, never from its correctable content).
  • cjm_context_graph_layer.ops — Queue-touching layer operations: the shared graph_task helper (task channel), idempotent emission (emit-if-absent + verify-if-present), and extend_graph — the one primitive every graph-extending workflow commits through. Deterministic ids (see identity) make idempotency a presence check instead of a search.
  • tests_manual.stage5_decision_preservation_drill — Stage-5 stress item 5: decision-preservation drill across the Document->Source reset.
  • tests_manual.validate_stage5_layer_e2e — Stage-5 stress suite — the CR-18 graph-aware layer's standing validation.

API

cjm_context_graph_layer.declare

  • Derivation class — One host-logic transformation event, declared for the audit trail.
  • derivation_to_graph function — Materialize a declaration as one event node + DERIVED_FROM / PRODUCED edges.

cjm_context_graph_layer.edits

  • SpineEdit class — One spine-edit decision, as carried in an overlay node's payload.
  • SpineEditError class — A spine edit could not be validated or applied (loud, never silent).
  • SpineUnit class — Minimal projection unit: one spine position with its effective text.
  • project_effective_spine function — Project the effective view: layer-0 + active edits, resolved at read time.
  • resolve_active function — Resolve the active set under append-only supersession.

cjm_context_graph_layer.grammar

  • OverlayRelations class — Overlay/derivation relations — the trust grammar shared by every
  • SpineRelations class — Structural spine relations, reused fractally at every layer
  • attribution function — Standardized attribution fields for derived/asserted nodes.
  • grouped_spine_edges function — Spine edges for a fine layer grouped under coarse parents.
  • make_edge function — Build an edge wire dict with a deterministic id by default.
  • spine_edges function — The uniform spine pattern at any layer: PART_OF child->parent for each

cjm_context_graph_layer.identity

  • canonical_part function — Render one identity-tuple part canonically.
  • derive_edge_id function — Derive a deterministic edge id from (source, target, relation).
  • derive_node_id function — Derive a deterministic node id from a kind + identity tuple.

cjm_context_graph_layer.ops

  • ExtendResult class — Outcome of one idempotent extend_graph commit.
  • GraphIntegrityError class — An emitted node collided with an existing node of different identity content.
  • extend_graph function — Idempotently extend the graph: emit-if-absent + verify-if-present.
  • graph_task function — Invoke a graph-storage adapter method through the queue's task channel.
  • node_identity_mismatch function — Verify-if-present check: label + sources content-hash set must match.
  • partition_by_presence function — Split wire dicts into absent (to add) and present (to verify).

tests_manual.stage5_decision_preservation_drill

  • main function
  • node_props function

tests_manual.validate_stage5_layer_e2e

  • check function
  • main function
  • oracle_projection function — The pre-stage-5 in-core algorithm: prune set + text overrides (conflict-free input).
  • part_b_concurrent_supersession function
  • part_c_parity function

Dependencies

Depends on: cjm-context-graph-primitives, cjm-substrate, cjm-transcript-graph-schema

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cjm_context_graph_layer-0.0.8.tar.gz (19.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cjm_context_graph_layer-0.0.8-py3-none-any.whl (18.5 kB view details)

Uploaded Python 3

File details

Details for the file cjm_context_graph_layer-0.0.8.tar.gz.

File metadata

  • Download URL: cjm_context_graph_layer-0.0.8.tar.gz
  • Upload date:
  • Size: 19.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for cjm_context_graph_layer-0.0.8.tar.gz
Algorithm Hash digest
SHA256 b1c624e514745b61a3ca462dd6bc14bfa63dbf92fd755b331ee1548c27a2f7aa
MD5 81202571662d23cda4273c16a90f4db3
BLAKE2b-256 f1fc4c66f65e0a6035fb4f0bb8336bc2686e589636fc96d852a8e292c556b1e8

See more details on using hashes here.

File details

Details for the file cjm_context_graph_layer-0.0.8-py3-none-any.whl.

File metadata

File hashes

Hashes for cjm_context_graph_layer-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 d14ba1ed4c065d0fde65f5ccc9be3a1cb80ab9ba4e601685eeaebabd708c8618
MD5 c829b96d4f18fa08c8ff9095779890d4
BLAKE2b-256 fa78afe177ec36959201c6e9abdc123ee543b6ad9e579ec9c23dc74c2d60b5c5

See more details on using hashes here.

Release history Release notifications | RSS feed

0.0.12

2 files

0.0.11

2 files

0.0.10

2 files

0.0.9

2 files

This release

0.0.8 This release

2 files

0.0.7

2 files

0.0.6

2 files

0.0.5

2 files

0.0.4

2 files

0.0.3

2 files

0.0.2

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page