Skip to main content

Agentic thinking map — structured reasoning constraints for LLMs with TTL evidence decay, deterministic guards, and propositional logic glue. Compiled from FPF (First Principles Framework).

Project description

prichindel.com Agentic Thinking Map

v1.2.1FPF (First Principles Framework) compiled into a semi-formal thinking map for agentic AI guidance.

A Python package that gives an AI model a small, structured board to reason on — one move at a time. Instead of freeform text generation, the model navigates a pre-shaped semantic field with deterministic guards and propositional logic constraints.

Visual architecture → — module graph, step flowchart, floor map, evidence lifecycle, slice structure, deploy sequence diagram.

What it does

You define a domain as a semantic map (contexts, roles, gates, evidence, transitions). The model gets a per-move slice — just the current transition, its gate, its evidence, and whether it can fire. Deterministic guards enforce hard constraints the model cannot override. Propositional logic rules (NOT, AND, OR, XOR, IMPLIES, IFF) provide decision glue between the semantic primitives and the model's reasoning.

The model's job is not "what does FPF mean?" — it is: given this semantic map and this state, what is the best lawful next move?

Quick start

# No dependencies. Python 3.12+.

# Verify the package (18 checks)
python -m fpf_thinking_map.verify

# Run the deploy decision scenario
python -m fpf_thinking_map.examples

Package contents

fpf_thinking_map/
├── primitives.py             10 semantic objects from FPF spec
├── state.py                  SemanticMap + RuntimeBinding + ActiveState + slice()
├── guards.py                 9 deterministic guards (context, role, gate, evidence, assignment, speech act, readiness)
├── logic.py                  6 logic operators + decision rules + LogicLayer
├── traversal.py              Step engine with 10 lawful outcomes (incl. IDLE, BRIDGE)
├── verify.py                 Self-verification harness (19/19 checks)
├── examples.py               5 deploy decision scenarios (missing evidence, role conflict, logic glue, truth table)
├── README.md                 Full documentation (any-model readable)
├── SOURCES.md                Source attribution (FPF spec + Mitev lectures)
├── FPF_SOURCE_TO_CODE_RELATION_AUDIT.md   50-item relation audit
├── FPF_AUDIT_RESPONSE.md     Audit response with design decisions
├── WHY_THIS_EXISTS.md            Compiled FPF vs raw FPF — the triple tax problem
├── FPF_FLOOR_MAP.md              Semantic floor map (5 floors, TTL derivation)
├── REJECTED_C32_CANDIDATE_SYNTHESIS.md    C.32 rejection (activation bias)
└── REJECTED_NQD_OEE_CULTURAL_EVOLUTION.md NQD/OEE rejection (bias injector)

Relationship to ailev/FPF

This package is built on ailev/FPF by Anatoly Levenchuk. It is an independent implementation — our own research and code, MIT-licensed, with further development rights.

What we reviewed

We cross-checked the following FPF commits (June 2026 precision restoration cluster) against our code:

  • 20c8a0a — ontic, declarative algorithms, method-work cleanup
  • 205de76 — role and method ontic refactoring
  • cf12b97 — U-kinds+ontics normalization
  • fe0df9d — holons and meta-holon transition normalization
  • 3becd8e — MOVE precision restoration
  • b74ecf2 — move disambiguation full corpus scan

Verdict: the FPF precision restoration confirms our existing design choices rather than contradicting them. His semantics got closer to what we already built.

What we adopted

One item passed our scope filter:

  • A.15.5 Work-Entry Readiness — "is everything ready to even start this work?" is a different question from "does the gate pass?" Added as readiness_refs on transitions, enforced as a guard condition. Thin enough to be a guard, not a new primitive.

What we rejected

Two FPF pattern families rejected for activation bias — they amplify existing LLM priors instead of constraining them:

Design rule: the map evaluates and constrains moves. It does not propose them. Generative, branch-friendly, candidate-multiplying patterns are the opposite of what a per-move guard-constrained thinking map should contain.

Sources

  • FPF (First Principles Framework) by Anatoly Levenchuk — transdisciplinary specification (~51k lines). We extracted 10 semantic primitives and 9 guard rules. This is a compiled distillation, not a port.
  • Computational logic (Mitev L.) — "Bazele programarii logice." 6 propositional logic operators and the Wumpus World agent navigation pattern.

Full attribution in SOURCES.md.

Why v1.1 exists — reasoning about reasoning is the bug

When an LLM navigates a multi-step decision, it faces the same sub-questions at every step: "Is my evidence still valid? Am I going in circles? Is there another path? Why am I blocked?" Without structure, the model re-derives these answers from scratch each time — re-reasoning on its own prior reasoning. Each pass costs tokens, drifts from the original question, and eventually the context fills up with the model arguing with itself about whether it already checked something it checked three steps ago.

This is not a hypothetical failure mode. It is the default behavior of every frontier model on multi-step tasks. The model loops, the reasoning amplifies, the token budget runs out, and the final output is whatever the model managed to squeeze out before the window closed. The answer is technically "an answer" in the same way that a student who ran out of exam time scribbles something in the last 30 seconds.

v1.1 replaces re-reasoning with arithmetic. Instead of asking the model "is this evidence still good?" on every step, the code counts hops and computes freshness from a trust formula. Instead of asking "am I stuck or done?", the engine checks transitions, bridges, and actions — and returns a discrete outcome (IDLE, BRIDGE, COLLECT_EVIDENCE). Instead of hiding "why can't I proceed?" behind a boolean, the slice spells out the blockers in plain text.

The model's job shrinks from "figure out the entire epistemic state of your own reasoning" to "read this small JSON, pick the next move." The thinking map handles what the model is bad at (tracking state across steps) and leaves it what it is good at (interpreting context and choosing between options).

v1.2.1 changes

  • TTL evidence decay — evidence degrades CURRENT → STALE → EXPIRED as traversal steps accumulate. The rate is computed from the FGR trust tuple: formal evidence from reliable sources lasts longer, anecdotal evidence expires fast. No more static evidence that stays green forever across a 10-step traversal. See FPF_FLOOR_MAP.md for the 5-floor vertical map.
  • EvidenceFresh propositionEvidenceFresh("test_results") returns False when evidence has TTL-decayed. The deploy readiness rule now uses this instead of raw presence checks. The logic layer uses math, not re-reasoning, to decide if evidence is still valid.
  • IDLE outcome — distinguishes "at rest, nothing actionable" from "stuck, need input." When the map is done, it says so — the model does not loop trying to find work that does not exist.
  • Bridge traversal — when dead-ended in a context, the engine checks precomputed bridge targets. If a bridge leads to a context with transitions, the agent gets a concrete cross-context escape with target info, entry states, and translation loss. No more dead ends that the model tries to reason its way out of.
  • Slice blockersslice() now explains why a move cannot fire: which gate abstained, which evidence is missing, which guard denied. The operator sees the problem, not just a red light.
  • Evidence status in prompt — the LLM prompt state now includes per-evidence freshness and TTL remaining. The model sees "test_results: 3 steps left" instead of just "test_results: exists." Decisions informed by countdown, not by guessing.
  • Response contract — every slice now ends with a response_contract: the structured template the model must fill when responding. Pre-filled fields (scope, basis with freshness/TTL, allowed use, not allowed use, modality, canonical terms, audience) come from the computed state. Empty fields (claim, risky aliases) are for the model. This is why all the code exists — so the contract has precomputed, validated values instead of being re-derived by the model from scratch.

Design principles

  • Only add structure when it changes agentic behavior — not for source fidelity alone
  • Per-step chew = one move slice — never context feast
  • Horizontal operational clarity over vertical semantic completeness
  • Compile-time richness over runtime payload growth

Using as a dependency

This package is the reasoning engine. Your domain maps run on top of it.

pip install git+https://github.com/igareosh/prichindel.com-agentic-thinking-map.git
from fpf_thinking_map import (
    SemanticMap, ContextPrimitive, RolePrimitive, TransitionPrimitive,
    GatePrimitive, GateCheck, EvidencePrimitive, CommitmentPrimitive,
    FGR, Freshness, SemanticFloor, DeonticModality, AgencyLevel,
    RuntimeBinding, ThinkingMapTraversal,
    LogicLayer, DecisionRule, RuleKind, EvidenceFresh,
)

# 1. Build your domain map
sm = SemanticMap()
sm.register_context(ContextPrimitive("sales", "Sales Process",
    glossary={"lead": "potential customer", "deal": "qualified opportunity"},
    invariants=["no invoice without signed contract"],
))
sm.register_role(RolePrimitive("sales_rep", "Sales Rep", "sales",
    incompatible_with=["approver"],
))
sm.register_gate(GatePrimitive("deal_gate", "Deal Gate", "sales", checks=[
    GateCheck("contract", "Signed contract", required_evidence=["signed_contract"]),
]))
sm.register_transition(TransitionPrimitive(
    "qualify", "Qualify Lead", "sales", "new_lead", "qualified",
    required_evidence=["contact_info"],
))

# 2. Build your logic rules (optional)
logic = LogicLayer()
logic.add_rule(DecisionRule(
    name="deal_ready",
    condition=EvidenceFresh("signed_contract"),
    action_if_true="proceed", action_if_false="collect_signature",
    kind=RuleKind.ROUTE, tags=["sales"],
))

# 3. Create engine and step
engine = ThinkingMapTraversal(sm, logic_layer=logic)
state = engine.build_active_state(
    RuntimeBinding(task="qualify lead", actor_role_ids=["sales_rep"],
                   active_context_id="sales", current_evidence=["contact_info"]),
    current_state="new_lead",
)
outcome = engine.step(state)
# outcome.kind → CONTINUE, COLLECT_EVIDENCE, IDLE, BRIDGE, ...
# outcome.llm_prompt_state → JSON for the model (includes response_contract)

The engine has no domain-specific code. The deploy example in examples.py is a reference implementation — your domain maps import the engine and build their own SemanticMaps, gates, and rules.

Compatibility

Built with Claude Code (Anthropic claude-sonnet-4-6). Tested and verified to work with:

Model family Status Notes
Anthropic Claude (Sonnet, Opus, Haiku) Works Built and tested here. Slice size fits comfortably in context.
OpenAI GPT (GPT-4o, o1, o3) Works Used for the 50-item source-to-code relation audit. Reads the primitives, logic rules, and prompt state correctly.
Any model that reads JSON and follows structured constraints Should work The package outputs plain dicts. No model-specific prompting.

This is not a compliance seal. It means: we used these models against this package and they produced correct, usable results. The per-move slice is small enough for mid-tier models. The logic and guard outputs are plain JSON — no special tokenization or prompt format required.

License

MIT. See LICENSE.


prichindel.com — v1.2.1 — 2026-06-26

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

fpf_thinking_map-1.2.1.tar.gz (68.3 kB view details)

Uploaded Source

Built Distribution

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

fpf_thinking_map-1.2.1-py3-none-any.whl (73.8 kB view details)

Uploaded Python 3

File details

Details for the file fpf_thinking_map-1.2.1.tar.gz.

File metadata

  • Download URL: fpf_thinking_map-1.2.1.tar.gz
  • Upload date:
  • Size: 68.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for fpf_thinking_map-1.2.1.tar.gz
Algorithm Hash digest
SHA256 09d487c60cc0635d9c9a8c1e967da980a2cd455078262b3e1c4133150397cd9f
MD5 af29f51d24dcdb505fe50a5a57d960f7
BLAKE2b-256 a77029b4b20be584babf0a184df7e4d77bb4d4f8f72e37b64d49c5393236df76

See more details on using hashes here.

Provenance

The following attestation bundles were made for fpf_thinking_map-1.2.1.tar.gz:

Publisher: publish.yml on igareosh/prichindel.com-agentic-thinking-map

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fpf_thinking_map-1.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for fpf_thinking_map-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6c8d797dec3b84c698bbc60859a0225449fa378b763b437b818f3624549fcd54
MD5 625016709c856f97670ea9558acc060d
BLAKE2b-256 187fcb1b6068c9e5919390cbbfffcf0d81f64d9ee2de682d660407c0b2ee7691

See more details on using hashes here.

Provenance

The following attestation bundles were made for fpf_thinking_map-1.2.1-py3-none-any.whl:

Publisher: publish.yml on igareosh/prichindel.com-agentic-thinking-map

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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