Skip to main content

A project-agnostic, deterministic skill-enforcement engine — the only way out is to do the work.

Project description

inertia-forge

A project-agnostic, deterministic skill-enforcement engine. The only way out is to do the work.

The forge makes a skill's methodology mechanically enforced. Invoking a skill opens a session with blocking gates. You can't manually close it, you can't skip a gate, and you can't fake evidence — the session auto-closes only when the last blocking gate is recorded with a real, hash-verified result. No escape hatch by design.

Zero LLM calls. Pure deterministic algorithms.


Install

pip install inertia-forge
# optional: real plan/task/AC gating via bpsai-pair
pip install "inertia-forge[paircoder]"

Quick start (programmatic)

from pathlib import Path
from inertia_forge import ForgeSkillBridge, get_required_steps

bridge = ForgeSkillBridge("reviewing_code", "src/", claude_session_id="my-tab")
bridge.start_session()                         # 2 blocking gates open
for phase in get_required_steps("reviewing_code"):
    bridge.record_phase(phase, Path("src"))     # auto-closes on the last green gate

Quick start (CLI)

inertia-forge skills                       # list registered skills + modes
inertia-forge start reviewing_code src/    # open a session
inertia-forge record-phase check_correctness src/
inertia-forge status
# `close` is intentionally refused while gates remain — record them instead.

Evidence modes

Each skill picks how a phase is proven, in skill_definitions.yaml:

mode what it proves for
file_analysis deterministic code analysis of the target's .py files (built-in arch rules: file size, function length, stubs, broad-except, wildcard imports, …) skills that produce/modify code
stamped SHA-256 methodology stamp — the phase ran skills whose output is insight/findings, not code (review, audit, investigation)
enforcer dispatch to a registered per-skill enforcer; falls back to stamped if none custom adversarial / structured checks
task_management real plan/task/AC state (needs [paircoder] extra) planning / task-lifecycle skills

Per-phase overrides via phase_evidence: (e.g. a code skill whose planning phase should gate on task state).

# enforcer mode is pluggable:
from inertia_forge import register_enforcer
register_enforcer("custom_review", MyEnforcer)   # cls(target); record_step/phase(...)

Configure your own skills

Resolution order (first hit wins):

  1. $INERTIA_FORGE_SKILLS=/path/to/skills.yaml
  2. ./forge_skills.yaml
  3. ./.forge/skills.yaml
  4. the packaged generic starter
my_review:
  evidence_mode: stamped
  steps: [read, check_correctness, check_security, verdict]
  gates:
    check_correctness: blocking
    verdict: blocking

Claude Code enforcement (hooks)

cd your-project
inertia-forge init        # installs hooks into .claude/ and wires settings.json

This wires four hooks so the forge enforces itself inside Claude Code:

  • UserPromptSubmit → inject the active-session banner; auto-start a session when you type /<skill>
  • PreToolUse(Bash) → block any escape command (close, abandon, direct .forge/ writes) — record-phase is the only sanctioned forge command
  • Stop → refuse to stop while blocking gates remain

Sessions are owner-scoped: a session belongs to the Claude tab that started it, so parallel tabs never trap or suppress each other. Orphaned sessions from a crashed tab expire after 24h and never block a different tab.


How it can't be cheated

  • No manual close / no abandon. The only close path is auto-close inside record-phase.
  • Real evidence. file_analysis hashes the actual bytes of the target's .py files; an empty/missing target is a P0.
  • P0 keeps the gate open. A phase that recorded findings does not satisfy its gate.
  • No bypass stamps. Evidence hashes starting with manual_release/pending/stub/… are rejected.
  • No fake phases. Phase names outside the skill's step list are P0 unknown_phase.

License

MIT. (Extracted from the INERTIA forge.)

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

inertia_forge-0.1.0.tar.gz (44.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

inertia_forge-0.1.0-py3-none-any.whl (51.6 kB view details)

Uploaded Python 3

File details

Details for the file inertia_forge-0.1.0.tar.gz.

File metadata

  • Download URL: inertia_forge-0.1.0.tar.gz
  • Upload date:
  • Size: 44.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for inertia_forge-0.1.0.tar.gz
Algorithm Hash digest
SHA256 acc55bd54c39157a03902c15b8922995ba090dbbcabb0ef8676eff057c1b96f7
MD5 35474b2f969a0c042e32a8ab5e8bcbae
BLAKE2b-256 6113dbe76ae991190d32ab2275b56e89eb85b74e118c96a2cdad85e75aed275c

See more details on using hashes here.

File details

Details for the file inertia_forge-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: inertia_forge-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 51.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for inertia_forge-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5953ad59c1ab09d3faf76f34a0dd14ec80420ab4dbac4ab8477ab304e5a4602e
MD5 a6f3c686e9a843cfec96405888f99a33
BLAKE2b-256 fc8470232aa1c4d8f4ff2e7031303c9fa58747e567b4d4d97770614ea460358d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page