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.__init__cjm_context_graph_layer.compact— Journal COMPACTION — move retired wires out of the active journal family into an archive (ruling a7617bd4).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.journal— Journal replay for workflow graphs — the genesis baseline + the pluggable verb registry.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.cjm_context_graph_layer.rebuild— Rebuild a workflow graph db from its journal — the runnable disaster-recovery driver.
API
cjm_context_graph_layer.compact
CompactRefusalclass — Compaction refused before writing: a kept op still references a retired idCompactReportclass — What a compaction did (or, dry-run, would do).DanglingRefclass — One kept op that names a retired id — the reason a compaction refuses.archive_segmentsfunction — The archive family beside a journal:<stem>.retired.NNNN.jsonlunderarchive_dir.compact_journalfunction — Move every wire on the retired ids out of the journal family into ONE new archive segment.next_archive_pathfunctionscan_referencesfunction — The post-compaction static check: the family names none of the retired ids.
cjm_context_graph_layer.declare
Derivationclass — One host-logic transformation event, declared for the audit trail.derivation_to_graphfunction — Materialize a declaration as one event node + DERIVED_FROM / PRODUCED edges.
cjm_context_graph_layer.edits
SpineEditclass — One spine-edit decision, as carried in an overlay node's payload.SpineEditErrorclass — A spine edit could not be validated or applied (loud, never silent).SpineUnitclass — Minimal projection unit: one spine position with its effective text.project_effective_spinefunction — Project the effective view: layer-0 + active edits, resolved at read time.resolve_activefunction — Resolve the active set under append-only supersession.
cjm_context_graph_layer.grammar
OverlayRelationsclass — Overlay/derivation relations — the trust grammar shared by everySpineRelationsclass — Structural spine relations, reused fractally at every layerattributionfunction — Standardized attribution fields for derived/asserted nodes.grouped_spine_edgesfunction — Spine edges for a fine layer grouped under coarse parents.make_edgefunction — Build an edge wire dict with a deterministic id by default.spine_edgesfunction — The uniform spine pattern at any layer: PART_OF child->parent for each
cjm_context_graph_layer.identity
canonical_partfunction — Render one identity-tuple part canonically.derive_edge_idfunction — Derive a deterministic edge id from (source, target, relation).derive_node_idfunction — Derive a deterministic node id from a kind + identity tuple.
cjm_context_graph_layer.journal
apply_wiresfunction — The generic replay handler for wire-carrying ops (the single wires-replay authority).composed_replay_handlersfunction — Union every installed core's replay registry (DEC 426658f1 — the d066826a fix).genesis_exportfunction — One-time whole-db GENESIS BASELINE: journal every node + edge as genesis ops.journal_extendfunction — Idempotent extend + journal the DELTA — the pipeline-write append-through.replay_journalfunction — Re-apply every journaled op in append order — the db-from-journal rebuild.sidecar_journal_pathfunction — The db's sidecar journal path (DEC ccbab9f5 point 3: placement is per-workflow,wires_handlersfunction — Convenience registry: every named verb replays viaapply_wires.
cjm_context_graph_layer.ops
ExtendResultclass — Outcome of one idempotent extend_graph commit.GraphIntegrityErrorclass — An emitted node collided with an existing node of different identity content.extend_graphfunction — Idempotently extend the graph: emit-if-absent + verify-if-present.graph_taskfunction — Invoke a graph-storage adapter method through the queue's task channel.node_identity_mismatchfunction — Verify-if-present check: label + sources content-hash set must match.observe_writesfunction — Collect every storage write made inside the block, one record per write:partition_by_presencefunction — Split wire dicts into absent (to add) and present (to verify).stamp_op_timefunction — Stamp the op clock's time onto an element about to be added — the one function live
cjm_context_graph_layer.rebuild
digests_equalfunction — True when twoidset_digestresults describe the same projection.idset_digestfunction — The rebuild-acceptance digest (craft P-49: ID-SET MD5 EQUALITY, never counts).mainfunction — Thecjm-workflow-rebuildconsole entrypoint — one command, fresh db from journal.rebuild_dbfunction — Rebuilddb_pathfrom the journal — substrate standup + composed replay.
Dependencies
Depends on: cjm-context-graph-primitives, cjm-substrate
Used by: cjm-context-graph-projection, cjm-dev-graph-schema, cjm-markdown-decompose-core, cjm-notebook-decompose-core, cjm-session-scratchpad-qt, cjm-transcript-correction-core, cjm-transcript-correction-qt, cjm-transcript-decomp-core, cjm-transcript-graph-schema, cjm-transcription-core, cjm-workflow-hub-qt
Metadata
Release files for cjm-context-graph-layer 0.0.16
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cjm_context_graph_layer-0.0.16.tar.gz | 42.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cjm_context_graph_layer-0.0.16-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 77.6 kB
Release files / cjm_context_graph_layer-0.0.16.tar.gz
| Download URL | cjm_context_graph_layer-0.0.16.tar.gz |
|---|---|
| Size | 42.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cec34987e7361890f42eb5b2380bb8a3e6a26950fb3868a54457e5c8741be0fe
|
|
BLAKE2b-256 checksum How to use checksums |
a60c4064f20c72d4a53b5f694934f94eeeba772fa49ca2d1ca342b7452ddf03a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.12
|
Release files / cjm_context_graph_layer-0.0.16-py3-none-any.whl
| Download URL | cjm_context_graph_layer-0.0.16-py3-none-any.whl |
|---|---|
| Size | 35.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8ea5dc3438cbf133c5ed70da261d39763e44fed2220112a040369e169bf1d158
|
|
BLAKE2b-256 checksum How to use checksums |
571f2500ca05ad1fc4cb5be58e90e986933f78b318e7b20faa3ab1c4e91763fc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.12
|