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.graphdiff— Two graphs compared element for element, streamed: the one standing check for every lane (ruling f8b9c728).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).CompactionPlanclass — A compaction scanned and resolved, nothing written (ruling 6683f49e (3)): what moves, whereDanglingRefclass — 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_familyfunction — A db-backed family's compaction, THE OP FIRST (ruling 6683f49e (3)): under the writer'scompact_journalfunction — Move every wire on the retired ids out of the journal family into ONE new archive segmentmove_compactionfunction — THE STORAGE MOVE: write the archive segment + manifest, then rewrite each changed segmentnext_archive_pathfunctionplan_compactionfunction — THE SCAN: classify every op of the family's cold segments -- moved whole, split, kept --scan_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.graphdiff
IdAttributionclass — The elements a known cause accounts for, by id: every difference on them is the cause's.KindDiffclass — The comparison of one element kind, fed one id-aligned pair at a time (either side mayLagAttributionclass — A time field whose A value precedes B's by undermax_lagseconds, on an element writtenMarkAttributionclass — A property carrying a copy of its element's own time column in A, where B holds anamerge_sortedfunction —merge_sortedover two async streams.compared_fieldsfunction — The compared fields of one element: its structural fields, each property key on itsdiff_graphsfunction — The comparison over elements already in memory (tests, small graphs): sorted by id,diff_storesfunction — Compare two graphs element for element, streamed: O(page) memory per side (plus, withmerge_sortedfunction — Merge two id-ordered element streams into (A, B) pairs, None where a side lacks the id.normalizefunction — Rewrite mapped path prefixes in every string, recursively (keys stay as they are).render_difffunction — Markdown (the verdict, the two graphs, the drift map by kind), or JSON for agents.render_headfunction — The verdict line: CLEAN or DIFFERENCES, and what each cause accounts for.render_kindsfunction — The drift map by kind, class and field; rows a cause accounts for print under each kindstream_elementsfunction — Every node (or edge) of a graph through the storage capability, in id-ordered keysetwirefunction — The wire dict of a typed graph element (task results may arrive typed or as dicts).
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
MissingRegistryclass — The env lacks a replay registry the workflow lane declares: refused when a writer opens,UnjournaledWriteclass — A write on a journal-sourced graph with no journal path and no explicitunjournaled=Trueapply_opfunction — Apply ONE journaled op -- the dispatch replay runs per op and a live writer runs after itsapply_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.graph_writerfunction — The write order on a workflow graph (design detail 65f4a6c9): a JournalWriter whose cursorsjournal_extendfunction — Idempotent extend + journal the DELTA — the pipeline-write append-through, on the writereplay_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.workflow_handlersfunction — The workflow lane's replay registry (ruling 6683f49e (2)): the composed union, checked
cjm_context_graph_layer.ops
ExtendPlanclass — What an extend would write, read off the graph and written nowhere (ruling 6683f49e (1)):ExtendResultclass — Outcome of one idempotent extend_graph commit.GraphCursorStoreclass — A graph store's applied cursors as a writer's CursorStore (design detail 65f4a6c9 (2c)): theGraphIntegrityErrorclass — 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).plan_extendfunction — The read half ofextend_graph: one batched presence check per kind. Present nodes arestamp_op_timefunction — Stamp the op clock's time onto an element about to be added — the one function livestore_covariatesfunction — The store half of the instrument's growth covariates (design detail 681604c1): the nodes,
cjm_context_graph_layer.rebuild
AdoptRefusalclass — An adoption refused: the live db is not the journal's projection, or the drop list does notGraphStoreclass — A started graph: the queue + the capability id to address it.adopt_dbfunction — THE ADOPTION (ruling 6683f49e (4), a verb by e35be447): a db written before its appliedadopt_mainfunction — Thecjm-workflow-adoptconsole entrypoint -- a live workflow db adopts its journaldiff_dbsfunction — Compare two workflow dbs element for element, both read-only, streamed side by side.diff_mainfunction — Thecjm-workflow-diffconsole entrypoint — two existing workflow dbs, comparedmainfunction — Thecjm-workflow-rebuildconsole entrypoint — one command, fresh db from journal.open_storefunction — Stand up the graph capability ondb_pathand a started queue — the cores' own runtimerebuild_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-decomp-qt, cjm-transcript-graph-schema, cjm-transcription-core, cjm-workflow-hub-qt
Metadata
Release files for cjm-context-graph-layer 0.0.23
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.23.tar.gz | 69.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cjm_context_graph_layer-0.0.23-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 124.2 kB
Release files / cjm_context_graph_layer-0.0.23.tar.gz
| Download URL | cjm_context_graph_layer-0.0.23.tar.gz |
|---|---|
| Size | 69.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
32f182515431c036e76b85df4656c8342bb06957ed0d14143bd65009cf55def6
|
|
BLAKE2b-256 checksum How to use checksums |
76465bbd81381c9b8e352f53f2dbd4e1f8bb3d1027ee82127459f7dc0198a986
|
| 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.23-py3-none-any.whl
| Download URL | cjm_context_graph_layer-0.0.23-py3-none-any.whl |
|---|---|
| Size | 54.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a8873fa8186a2ba6b1de8d2a58b73755acd7c95bf31942ccabf1eb48f400574c
|
|
BLAKE2b-256 checksum How to use checksums |
bb0d7dde99528d48a2f3b585e02922137d4c4b817e10c2e29b58f4e03806c629
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.12
|