Skip to main content

Nomia

Nomia is a Python CLI for tracking alignment between business rules and code.

It lets you declare business rules in nomia.yaml, link those rules to Python functions with a decorator, capture a validated alignment snapshot, and later check whether the repository has drifted from that snapshot.

Nomia does not prove that code is semantically correct. It makes rule-code alignment explicit and reports when declared rules, linked implementations, or validated mappings have changed.

Core Workflow

Nomia has two main workflow commands:

  • nomia validate captures or updates the validated alignment state after you have reviewed and accepted the current rule-code associations.
  • nomia check checks the current repository against the validated state and reports alignment issues.

A typical workflow is:

nomia validate

Review and accept the current rule-code associations. Nomia writes the validated state to .nomia/state.json.

Later, after code or rule changes:

nomia check

Nomia compares the current repository to the last validated state and reports anything that needs review. If there are no issues, the default output is:

Nomia check completed.
Tracked rules: 3
No alignment issues found.

The tracked rule count is based on the configured rule IDs discovered from the current Nomia config.

Quick Example

Declare rules and source packages in nomia.yaml:

sources:
  - my_app

rules:
  - id: discount.eligibility
    description: Customer must be active and have no outstanding balance.

Link code to a rule:

from nomia import rule


@rule("discount.eligibility")
def is_customer_eligible(customer):
    return customer.is_active and customer.balance == 0

Capture the reviewed state:

nomia validate

Check for changes later:

nomia check

If the function body changes, the rule definition changes, a configured rule has no implementation, or a previously validated implementation is removed, check reports an alignment issue.

Commands

Nomia provides three commands:

nomia validate
nomia check
nomia audit

Global options:

nomia --config path/to/nomia.yaml check
nomia --verbose check

--config selects a Nomia config file. --verbose shows detailed discovery and import output.

nomia validate

nomia validate

Validates Nomia rule tracking and refreshes the local validation snapshot.

Use validate after you have reviewed the current rule-code associations and want to accept them as the new baseline.

On success, Nomia prints a compact summary:

Validation snapshot created. Rules tracked: 3, functions tracked: 3

If a declared rule has no discovered implementation, validation fails and reports the missing implementation.

nomia check

nomia check

Runs repository checks and reports findings.

By default, findings are informational and the command exits with code 0 when execution succeeds. Use --strict to exit with code 1 when findings are found:

nomia check --strict

Available output formats:

nomia check --format default
nomia check --format compact
nomia check --format detailed
nomia check --format json

check can report:

  • linked function code changed since the last validated snapshot
  • rule content changed since the last validated snapshot
  • a declared rule has no discovered implementation
  • a previously validated rule was removed from the config
  • a previously validated linked implementation was removed
  • a discovered rule-code association has not been validated yet

nomia audit

nomia audit

Lists discovered project functions that are not linked to a Nomia rule.

If no untracked functions are found, Nomia prints:

No untracked functions found.

Configuration

Nomia looks for a config file such as nomia.yaml.

sources:
  - my_app

rules:
  - id: orders_above_credit_limit_must_be_blocked
  - id: high_risk_customers_require_manual_approval
    title: High-risk customers require manual approval
    severity: high

sources tells Nomia where to discover Python functions. rules declares the business rule IDs that should be tracked.

What Nomia Is Not

Nomia does not:

  • infer business rules automatically
  • replace tests
  • require full rule coverage
  • enforce a domain model
  • prove that implementation behavior matches business intent

It gives you a lightweight way to notice when accepted rule-code alignment has changed and needs review.

License

This project is licensed under the terms of the MIT License.

Metadata

Release files for nomia 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nomia 0.1.0
File Size Uploaded Provenance Actions
nomia-0.1.0.tar.gz 16.0 kB Without provenance Details for nomia-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nomia 0.1.0
File Interpreter ABI Platform Actions
nomia-0.1.0-py3-none-any.whl Python 3 none any Details for nomia-0.1.0-py3-none-any.whl

Total release size: 32.0 kB

Release files / nomia-0.1.0.tar.gz

Download URL nomia-0.1.0.tar.gz
Size 16.0 kB
Tags Source
SHA-256 checksum
How to use checksums
6bcd85d074971e4d544da910479579e5af292dd001692a90ea6044b23db6d726
BLAKE2b-256 checksum
How to use checksums
c1dbb331e310a381c235d18eab7825b80d4fc72c16a87b73558fbe5fb54d9e81
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.4

Release files / nomia-0.1.0-py3-none-any.whl

Download URL nomia-0.1.0-py3-none-any.whl
Size 16.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2a4c2dcea7d6ea1abee3a3c80e723bb6c3c93bd3cd8933a584849938532ac03c
BLAKE2b-256 checksum
How to use checksums
b3ef8c627210e7a069b6e2e9885c57d56f0599f4bffd64ac17d57318db1b9812
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.4

Security for nomia 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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