NOMARK Engine — open-core agent outcome quality resolver
Project description
nomark-engine
The open-core preference resolution engine for AI agents. Python port of @nomark-ai/engine — identical resolution logic, Pydantic v2 models.
Install
pip install nomark-engine
Requires Python 3.10+.
Quick Start
from nomark_engine import create_resolver, parse_ledger, ResolverConfig
# Parse a NOMARK ledger (JSONL format)
entries = parse_ledger(open("nomark-ledger.jsonl").read())
# Create a resolver
resolver = create_resolver(ResolverConfig(entries=entries))
# Resolve all preference dimensions
result = resolver.resolve_all()
for dim, res in result.dimensions.items():
if res.winner:
print(f"{dim}: {res.winner.pref.target} (score: {res.winner.score})")
# Resolve intent from natural language
result = resolver.resolve_input("make it shorter")
for match in result.meaning_maps:
print(f"Matched: {match.trigger} -> {match.intent}")
Modules
Schema
Pydantic v2 models for all five signal types: SigPref, SigMap, SigAsn, SigMeta, SigRub. Discriminated unions via LedgerEntry.
Ledger
JSONL parser and writer with per-type capacity constraints and token estimation.
Classifier
Input tier classification: pass-through, routing, or extraction.
Resolver
Five-factor weighted scoring engine:
- Specificity (0.30) — compound scope > single scope > global
- Evidence (0.25) — signal count normalized to 20
- Recency (0.20) — linear decay over 180 days
- Stability (0.15) — contradiction ratio penalty
- Portability (0.10) — cross-context usage
Unstable dimensions (winner score < 0.4) recommend asking instead of guessing.
Decay
Time-based weight decay with contradiction acceleration.
Utility
Multi-factor utility scoring and capacity-bounded pruning.
API Reference
Core
| Export | Description |
|---|---|
create_resolver(config) |
Create a resolver instance |
parse_ledger(content) |
Parse JSONL ledger content |
write_ledger(entries) |
Serialize entries to JSONL |
classify(input) |
Classify input tier |
compute_decay(weight, decay) |
Compute decayed weight |
utility_score(entry) |
Score entry utility |
prune_to_capacity(entries) |
Prune entries within capacity |
Types
| Type | Description |
|---|---|
ResolverConfig |
Resolver configuration |
ResolverResult |
Full resolution output |
DimensionResult |
Single dimension with winner/runner-up |
LedgerEntry |
Discriminated union of signal entries |
SigPref / SigMap / SigAsn / SigMeta / SigRub |
Pydantic signal models |
Parity
This package produces identical results to @nomark-ai/engine for identical inputs. The test suites validate cross-language consistency.
License
Apache 2.0
Project details
Release history Release notifications | RSS feed
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 nomark_engine-0.1.1.tar.gz.
File metadata
- Download URL: nomark_engine-0.1.1.tar.gz
- Upload date:
- Size: 19.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
208522640b8764e680cf0f95e7f9c24e7dc9d2c0869baf34cd2c71e8f4025c65
|
|
| MD5 |
b365cd2ee86cac4d5bd332bc2f70eb18
|
|
| BLAKE2b-256 |
d306797314499fa121f363d7723aa683e06991cc4ecd0359a11dbff7b0b83129
|
Provenance
The following attestation bundles were made for nomark_engine-0.1.1.tar.gz:
Publisher:
publish.yml on NOMARJ/nomark-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nomark_engine-0.1.1.tar.gz -
Subject digest:
208522640b8764e680cf0f95e7f9c24e7dc9d2c0869baf34cd2c71e8f4025c65 - Sigstore transparency entry: 1244570394
- Sigstore integration time:
-
Permalink:
NOMARJ/nomark-sdk@57e69c7c4a645deae338e92e6bc3ee71bfef0efb -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/NOMARJ
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@57e69c7c4a645deae338e92e6bc3ee71bfef0efb -
Trigger Event:
push
-
Statement type:
File details
Details for the file nomark_engine-0.1.1-py3-none-any.whl.
File metadata
- Download URL: nomark_engine-0.1.1-py3-none-any.whl
- Upload date:
- Size: 16.5 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 |
31d900797f275012a559f1bd4d5a548ac0755effdae8e0bd6ce7b4ceb78cf1cc
|
|
| MD5 |
14626c025ec41550b02a0b818621df9a
|
|
| BLAKE2b-256 |
11cee0f673ce1cdddfda2fadc7b3e23065601ffadbeae77756f074d2c7845880
|
Provenance
The following attestation bundles were made for nomark_engine-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on NOMARJ/nomark-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nomark_engine-0.1.1-py3-none-any.whl -
Subject digest:
31d900797f275012a559f1bd4d5a548ac0755effdae8e0bd6ce7b4ceb78cf1cc - Sigstore transparency entry: 1244570432
- Sigstore integration time:
-
Permalink:
NOMARJ/nomark-sdk@57e69c7c4a645deae338e92e6bc3ee71bfef0efb -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/NOMARJ
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@57e69c7c4a645deae338e92e6bc3ee71bfef0efb -
Trigger Event:
push
-
Statement type: