coreason-human-layer
Project description
coreason-human-layer
Domain: HITL, Durable Execution, & RLHF Data Capture Role: The "Switchboard" & "Labeling Factory"
coreason-human-layer is the dedicated bridge between autonomous execution and human oversight, operationalizing Online Alignment through a Multiverse Branching Strategy. Instead of a simple "Stop/Go" model, it allows humans to fork agent reality, capturing decisions as DPO Triplets to fuel the model improvement loop.
Features
1. The Stasis Engine (Durable Execution)
Implements an event-sourcing pattern for durable execution.
- Snapshot: Stores a pointer to the last event ID rather than a massive state blob.
- Rehydration: Replays events to rebuild context.
- Storage: Hot storage in Redis Streams, cold archival in S3.
2. The Branch Manager (Cognitive Forking)
Manages the tree topology of execution branches.
- Forking:
create_forkAPI allows instantiating new execution paths with human overrides. - Prefix Caching: Optimizes costs and latency by reusing the KV Cache of the shared prefix (
cached_prefix_id) on the LLM backend. - Topology: Exposes the conversation tree structure for visualization.
3. The Super-Prompt Injector (System Injection)
Ensures the model obeys human overrides.
- Frame Injection: Injects a high-priority
[SYSTEM PRIORITY INTERRUPT]block. - Variable Patching: Parses and hard-updates variables from human overrides (e.g., "Dose = 50mg").
4. The Learning Bridge (Auto-DPO)
Converts operational actions into training assets.
- Trigger: Merging a fork (approving it) while abandoning another.
- Auto-DPO: Automatically constructs a DPO object (
{ prompt, chosen, rejected }) and pushes it tocoreason-synthesis.
Installation
pip install coreason-human-layer
Usage
from uuid import uuid4
from coreason_human_layer.branch_manager import BranchManager
from coreason_human_layer.stasis import InMemoryStasisEngine
# Initialize engines
stasis = InMemoryStasisEngine()
manager = BranchManager(stasis_engine=stasis)
# Create a root branch
root_id = uuid4()
branch_id = manager.create_fork(
parent_branch_id=None,
parent_event_id=None,
root_id=root_id,
human_override_text="Initial Start",
)
# ... (Agent runs and events are appended to stasis) ...
# Create a Human Override Fork
fork_id = manager.create_fork(
parent_branch_id=branch_id,
parent_event_id=None, # or specific event ID
root_id=root_id,
human_override_text="Don't be so formal. Use a friendly tone.",
)
# ... (New branch runs) ...
# Merge the successful fork (triggers Feedback Signal)
feedback = manager.merge_branches(winning_branch_id=fork_id, losing_branch_id=branch_id)
print(f"Feedback Signal Sent: {feedback.timestamp}")
License
Copyright (c) 2025 CoReason, Inc. Licensed under the Prosperity Public License 3.0.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file coreason_human_layer-0.1.0.tar.gz.
File metadata
- Download URL: coreason_human_layer-0.1.0.tar.gz
- Upload date:
- Size: 15.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9827785c934856620e1cb688af4c2e9d0d95a700b72aa237d0f3e27cf5383216
|
|
| MD5 |
33e9b904db4f03c5b132580eda50080f
|
|
| BLAKE2b-256 |
cadb9e7e269dd2aa343a161c7b1a0064da2803c3f102337c7c61190d7310a2bb
|
Provenance
The following attestation bundles were made for coreason_human_layer-0.1.0.tar.gz:
Publisher:
publish.yml on CoReason-AI/coreason-human-layer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
coreason_human_layer-0.1.0.tar.gz -
Subject digest:
9827785c934856620e1cb688af4c2e9d0d95a700b72aa237d0f3e27cf5383216 - Sigstore transparency entry: 836847648
- Sigstore integration time:
-
Permalink:
CoReason-AI/coreason-human-layer@4bf916768ca5f7016ad464f395265ecf1ec20b39 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/CoReason-AI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4bf916768ca5f7016ad464f395265ecf1ec20b39 -
Trigger Event:
release
-
Statement type:
File details
Details for the file coreason_human_layer-0.1.0-py3-none-any.whl.
File metadata
- Download URL: coreason_human_layer-0.1.0-py3-none-any.whl
- Upload date:
- Size: 20.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c6e54c5c722e618cdb17ad3e270ab2f0641ff243926ea8813837d004670e82bd
|
|
| MD5 |
9b41dcfc9fe5d659908fcf57a52027d6
|
|
| BLAKE2b-256 |
d6867b0bae9cedfdd22707ba8a67b1b49e07944cd73b92f2f9f191fb122d62d9
|
Provenance
The following attestation bundles were made for coreason_human_layer-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on CoReason-AI/coreason-human-layer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
coreason_human_layer-0.1.0-py3-none-any.whl -
Subject digest:
c6e54c5c722e618cdb17ad3e270ab2f0641ff243926ea8813837d004670e82bd - Sigstore transparency entry: 836847697
- Sigstore integration time:
-
Permalink:
CoReason-AI/coreason-human-layer@4bf916768ca5f7016ad464f395265ecf1ec20b39 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/CoReason-AI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4bf916768ca5f7016ad464f395265ecf1ec20b39 -
Trigger Event:
release
-
Statement type: