fpf-thinking-map 1.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. fpf_thinking_map-1.2.1/LICENSE +33 -0
  2. fpf_thinking_map-1.2.1/PKG-INFO +216 -0
  3. fpf_thinking_map-1.2.1/README.md +189 -0
  4. fpf_thinking_map-1.2.1/fpf_thinking_map/FPF_AUDIT_RESPONSE.md +88 -0
  5. fpf_thinking_map-1.2.1/fpf_thinking_map/FPF_FLOOR_MAP.md +119 -0
  6. fpf_thinking_map-1.2.1/fpf_thinking_map/FPF_SOURCE_TO_CODE_RELATION_AUDIT.md +91 -0
  7. fpf_thinking_map-1.2.1/fpf_thinking_map/README.md +266 -0
  8. fpf_thinking_map-1.2.1/fpf_thinking_map/REJECTED_C32_CANDIDATE_SYNTHESIS.md +62 -0
  9. fpf_thinking_map-1.2.1/fpf_thinking_map/REJECTED_NQD_OEE_CULTURAL_EVOLUTION.md +64 -0
  10. fpf_thinking_map-1.2.1/fpf_thinking_map/SOURCES.md +73 -0
  11. fpf_thinking_map-1.2.1/fpf_thinking_map/WHY_THIS_EXISTS.md +92 -0
  12. fpf_thinking_map-1.2.1/fpf_thinking_map/__init__.py +81 -0
  13. fpf_thinking_map-1.2.1/fpf_thinking_map/examples.py +564 -0
  14. fpf_thinking_map-1.2.1/fpf_thinking_map/guards.py +314 -0
  15. fpf_thinking_map-1.2.1/fpf_thinking_map/logic.py +444 -0
  16. fpf_thinking_map-1.2.1/fpf_thinking_map/primitives.py +454 -0
  17. fpf_thinking_map-1.2.1/fpf_thinking_map/py.typed +0 -0
  18. fpf_thinking_map-1.2.1/fpf_thinking_map/state.py +535 -0
  19. fpf_thinking_map-1.2.1/fpf_thinking_map/traversal.py +359 -0
  20. fpf_thinking_map-1.2.1/fpf_thinking_map/verify.py +1008 -0
  21. fpf_thinking_map-1.2.1/fpf_thinking_map.egg-info/PKG-INFO +216 -0
  22. fpf_thinking_map-1.2.1/fpf_thinking_map.egg-info/SOURCES.txt +24 -0
  23. fpf_thinking_map-1.2.1/fpf_thinking_map.egg-info/dependency_links.txt +1 -0
  24. fpf_thinking_map-1.2.1/fpf_thinking_map.egg-info/top_level.txt +1 -0
  25. fpf_thinking_map-1.2.1/pyproject.toml +44 -0
  26. fpf_thinking_map-1.2.1/setup.cfg +4 -0
@@ -0,0 +1,33 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 prichindel.com (igareosh)
4
+
5
+ Implementation and code by prichindel.com, built with Claude Code
6
+ (Anthropic claude-sonnet-4-6).
7
+
8
+ Semantic foundations based on FPF (First Principles Framework)
9
+ by Anatoly Levenchuk (https://github.com/ailev/FPF).
10
+
11
+ This is an independent implementation — our own research, design,
12
+ and code. Not a port or copy of the FPF specification. The FPF spec
13
+ informed the semantic primitives; the compiled thinking map, TTL
14
+ evidence decay, guard engine, propositional logic layer, traversal
15
+ engine, and response contract are original work.
16
+
17
+ Permission is hereby granted, free of charge, to any person obtaining a copy
18
+ of this software and associated documentation files (the "Software"), to deal
19
+ in the Software without restriction, including without limitation the rights
20
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
21
+ copies of the Software, and to permit persons to whom the Software is
22
+ furnished to do so, subject to the following conditions:
23
+
24
+ The above copyright notice and this permission notice shall be included in all
25
+ copies or substantial portions of the Software.
26
+
27
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
28
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
29
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
30
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
31
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
32
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
33
+ SOFTWARE.
@@ -0,0 +1,216 @@
1
+ Metadata-Version: 2.4
2
+ Name: fpf-thinking-map
3
+ Version: 1.2.1
4
+ Summary: Agentic thinking map — structured reasoning constraints for LLMs with TTL evidence decay, deterministic guards, and propositional logic glue. Compiled from FPF (First Principles Framework).
5
+ Author-email: "prichindel.com" <igareosh@igareosh.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/igareosh/prichindel.com-agentic-thinking-map
8
+ Project-URL: Repository, https://github.com/igareosh/prichindel.com-agentic-thinking-map
9
+ Project-URL: Documentation, https://github.com/igareosh/prichindel.com-agentic-thinking-map#readme
10
+ Project-URL: Issues, https://github.com/igareosh/prichindel.com-agentic-thinking-map/issues
11
+ Keywords: agentic,thinking-map,llm,reasoning,propositional-logic,evidence-decay,ttl,guards,gates,semantic-map,fpf
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Intended Audience :: Science/Research
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
21
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
+ Classifier: Typing :: Typed
23
+ Requires-Python: >=3.12
24
+ Description-Content-Type: text/markdown
25
+ License-File: LICENSE
26
+ Dynamic: license-file
27
+
28
+ # prichindel.com Agentic Thinking Map
29
+
30
+ **v1.2.1** — [FPF (First Principles Framework)](https://github.com/ailev/FPF) compiled into a semi-formal thinking map for agentic AI guidance.
31
+
32
+ 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.
33
+
34
+ **[Visual architecture →](ARCHITECTURE.md)** — module graph, step flowchart, floor map, evidence lifecycle, slice structure, deploy sequence diagram.
35
+
36
+ ## What it does
37
+
38
+ 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.
39
+
40
+ 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?**
41
+
42
+ ## Quick start
43
+
44
+ ```bash
45
+ # No dependencies. Python 3.12+.
46
+
47
+ # Verify the package (18 checks)
48
+ python -m fpf_thinking_map.verify
49
+
50
+ # Run the deploy decision scenario
51
+ python -m fpf_thinking_map.examples
52
+ ```
53
+
54
+ ## Package contents
55
+
56
+ ```
57
+ fpf_thinking_map/
58
+ ├── primitives.py 10 semantic objects from FPF spec
59
+ ├── state.py SemanticMap + RuntimeBinding + ActiveState + slice()
60
+ ├── guards.py 9 deterministic guards (context, role, gate, evidence, assignment, speech act, readiness)
61
+ ├── logic.py 6 logic operators + decision rules + LogicLayer
62
+ ├── traversal.py Step engine with 10 lawful outcomes (incl. IDLE, BRIDGE)
63
+ ├── verify.py Self-verification harness (19/19 checks)
64
+ ├── examples.py 5 deploy decision scenarios (missing evidence, role conflict, logic glue, truth table)
65
+ ├── README.md Full documentation (any-model readable)
66
+ ├── SOURCES.md Source attribution (FPF spec + Mitev lectures)
67
+ ├── FPF_SOURCE_TO_CODE_RELATION_AUDIT.md 50-item relation audit
68
+ ├── FPF_AUDIT_RESPONSE.md Audit response with design decisions
69
+ ├── WHY_THIS_EXISTS.md Compiled FPF vs raw FPF — the triple tax problem
70
+ ├── FPF_FLOOR_MAP.md Semantic floor map (5 floors, TTL derivation)
71
+ ├── REJECTED_C32_CANDIDATE_SYNTHESIS.md C.32 rejection (activation bias)
72
+ └── REJECTED_NQD_OEE_CULTURAL_EVOLUTION.md NQD/OEE rejection (bias injector)
73
+ ```
74
+
75
+ ## Relationship to ailev/FPF
76
+
77
+ This package is built on [ailev/FPF](https://github.com/ailev/FPF) by Anatoly Levenchuk. It is an independent implementation — our own research and code, MIT-licensed, with further development rights.
78
+
79
+ ### What we reviewed
80
+
81
+ We cross-checked the following FPF commits (June 2026 precision restoration cluster) against our code:
82
+
83
+ - [`20c8a0a`](https://github.com/ailev/FPF/commit/20c8a0a) — ontic, declarative algorithms, method-work cleanup
84
+ - [`205de76`](https://github.com/ailev/FPF/commit/205de76) — role and method ontic refactoring
85
+ - [`cf12b97`](https://github.com/ailev/FPF/commit/cf12b97) — U-kinds+ontics normalization
86
+ - [`fe0df9d`](https://github.com/ailev/FPF/commit/fe0df9d) — holons and meta-holon transition normalization
87
+ - [`3becd8e`](https://github.com/ailev/FPF/commit/3becd8e) — MOVE precision restoration
88
+ - [`b74ecf2`](https://github.com/ailev/FPF/commit/b74ecf2) — move disambiguation full corpus scan
89
+
90
+ **Verdict**: the FPF precision restoration confirms our existing design choices rather than contradicting them. His semantics got closer to what we already built.
91
+
92
+ ### What we adopted
93
+
94
+ One item passed our scope filter:
95
+
96
+ - **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.
97
+
98
+ ### What we rejected
99
+
100
+ Two FPF pattern families rejected for activation bias — they amplify existing LLM priors instead of constraining them:
101
+
102
+ - **C.32 Candidate-Synthesis Logic** ([`10cd224`](https://github.com/ailev/FPF/commit/10cd224cef9c92043fb6821e165decd6ea05073f)) — variant racing, tradeoff-seeking, candidate-multiplying. These are motion patterns, not neutral semantic relations. See [REJECTED_C32_CANDIDATE_SYNTHESIS.md](fpf_thinking_map/REJECTED_C32_CANDIDATE_SYNTHESIS.md).
103
+ - **NQD/OEE/Cultural Evolution** (C.17–C.19, A.4) — novelty-seeking, diversity-maintaining, search-front expanding. Same activation bias class. See [REJECTED_NQD_OEE_CULTURAL_EVOLUTION.md](fpf_thinking_map/REJECTED_NQD_OEE_CULTURAL_EVOLUTION.md).
104
+
105
+ **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.
106
+
107
+ ## Sources
108
+
109
+ - **[FPF (First Principles Framework)](https://github.com/ailev/FPF)** by Anatoly Levenchuk — transdisciplinary specification (~51k lines). We extracted 10 semantic primitives and 9 guard rules. This is a compiled distillation, not a port.
110
+ - **Computational logic (Mitev L.)** — "Bazele programarii logice." 6 propositional logic operators and the Wumpus World agent navigation pattern.
111
+
112
+ Full attribution in [SOURCES.md](fpf_thinking_map/SOURCES.md).
113
+
114
+ ## Why v1.1 exists — reasoning about reasoning is the bug
115
+
116
+ 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.
117
+
118
+ 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.
119
+
120
+ **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.
121
+
122
+ 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).
123
+
124
+ ## v1.2.1 changes
125
+
126
+ - **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](fpf_thinking_map/FPF_FLOOR_MAP.md) for the 5-floor vertical map.
127
+ - **EvidenceFresh proposition** — `EvidenceFresh("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.
128
+ - **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.
129
+ - **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.
130
+ - **Slice blockers** — `slice()` 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.
131
+ - **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.
132
+ - **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.
133
+
134
+ ## Design principles
135
+
136
+ - **Only add structure when it changes agentic behavior** — not for source fidelity alone
137
+ - **Per-step chew = one move slice** — never context feast
138
+ - **Horizontal operational clarity** over vertical semantic completeness
139
+ - **Compile-time richness** over runtime payload growth
140
+
141
+ ## Using as a dependency
142
+
143
+ This package is the reasoning engine. Your domain maps run on top of it.
144
+
145
+ ```bash
146
+ pip install git+https://github.com/igareosh/prichindel.com-agentic-thinking-map.git
147
+ ```
148
+
149
+ ```python
150
+ from fpf_thinking_map import (
151
+ SemanticMap, ContextPrimitive, RolePrimitive, TransitionPrimitive,
152
+ GatePrimitive, GateCheck, EvidencePrimitive, CommitmentPrimitive,
153
+ FGR, Freshness, SemanticFloor, DeonticModality, AgencyLevel,
154
+ RuntimeBinding, ThinkingMapTraversal,
155
+ LogicLayer, DecisionRule, RuleKind, EvidenceFresh,
156
+ )
157
+
158
+ # 1. Build your domain map
159
+ sm = SemanticMap()
160
+ sm.register_context(ContextPrimitive("sales", "Sales Process",
161
+ glossary={"lead": "potential customer", "deal": "qualified opportunity"},
162
+ invariants=["no invoice without signed contract"],
163
+ ))
164
+ sm.register_role(RolePrimitive("sales_rep", "Sales Rep", "sales",
165
+ incompatible_with=["approver"],
166
+ ))
167
+ sm.register_gate(GatePrimitive("deal_gate", "Deal Gate", "sales", checks=[
168
+ GateCheck("contract", "Signed contract", required_evidence=["signed_contract"]),
169
+ ]))
170
+ sm.register_transition(TransitionPrimitive(
171
+ "qualify", "Qualify Lead", "sales", "new_lead", "qualified",
172
+ required_evidence=["contact_info"],
173
+ ))
174
+
175
+ # 2. Build your logic rules (optional)
176
+ logic = LogicLayer()
177
+ logic.add_rule(DecisionRule(
178
+ name="deal_ready",
179
+ condition=EvidenceFresh("signed_contract"),
180
+ action_if_true="proceed", action_if_false="collect_signature",
181
+ kind=RuleKind.ROUTE, tags=["sales"],
182
+ ))
183
+
184
+ # 3. Create engine and step
185
+ engine = ThinkingMapTraversal(sm, logic_layer=logic)
186
+ state = engine.build_active_state(
187
+ RuntimeBinding(task="qualify lead", actor_role_ids=["sales_rep"],
188
+ active_context_id="sales", current_evidence=["contact_info"]),
189
+ current_state="new_lead",
190
+ )
191
+ outcome = engine.step(state)
192
+ # outcome.kind → CONTINUE, COLLECT_EVIDENCE, IDLE, BRIDGE, ...
193
+ # outcome.llm_prompt_state → JSON for the model (includes response_contract)
194
+ ```
195
+
196
+ 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.
197
+
198
+ ## Compatibility
199
+
200
+ Built with Claude Code (Anthropic claude-sonnet-4-6). Tested and verified to work with:
201
+
202
+ | Model family | Status | Notes |
203
+ |-------------|--------|-------|
204
+ | **Anthropic Claude** (Sonnet, Opus, Haiku) | Works | Built and tested here. Slice size fits comfortably in context. |
205
+ | **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. |
206
+ | **Any model that reads JSON and follows structured constraints** | Should work | The package outputs plain dicts. No model-specific prompting. |
207
+
208
+ 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.
209
+
210
+ ## License
211
+
212
+ MIT. See [LICENSE](LICENSE).
213
+
214
+ ---
215
+
216
+ **prichindel.com** — v1.2.1 — 2026-06-26
@@ -0,0 +1,189 @@
1
+ # prichindel.com Agentic Thinking Map
2
+
3
+ **v1.2.1** — [FPF (First Principles Framework)](https://github.com/ailev/FPF) compiled into a semi-formal thinking map for agentic AI guidance.
4
+
5
+ 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.
6
+
7
+ **[Visual architecture →](ARCHITECTURE.md)** — module graph, step flowchart, floor map, evidence lifecycle, slice structure, deploy sequence diagram.
8
+
9
+ ## What it does
10
+
11
+ 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.
12
+
13
+ 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?**
14
+
15
+ ## Quick start
16
+
17
+ ```bash
18
+ # No dependencies. Python 3.12+.
19
+
20
+ # Verify the package (18 checks)
21
+ python -m fpf_thinking_map.verify
22
+
23
+ # Run the deploy decision scenario
24
+ python -m fpf_thinking_map.examples
25
+ ```
26
+
27
+ ## Package contents
28
+
29
+ ```
30
+ fpf_thinking_map/
31
+ ├── primitives.py 10 semantic objects from FPF spec
32
+ ├── state.py SemanticMap + RuntimeBinding + ActiveState + slice()
33
+ ├── guards.py 9 deterministic guards (context, role, gate, evidence, assignment, speech act, readiness)
34
+ ├── logic.py 6 logic operators + decision rules + LogicLayer
35
+ ├── traversal.py Step engine with 10 lawful outcomes (incl. IDLE, BRIDGE)
36
+ ├── verify.py Self-verification harness (19/19 checks)
37
+ ├── examples.py 5 deploy decision scenarios (missing evidence, role conflict, logic glue, truth table)
38
+ ├── README.md Full documentation (any-model readable)
39
+ ├── SOURCES.md Source attribution (FPF spec + Mitev lectures)
40
+ ├── FPF_SOURCE_TO_CODE_RELATION_AUDIT.md 50-item relation audit
41
+ ├── FPF_AUDIT_RESPONSE.md Audit response with design decisions
42
+ ├── WHY_THIS_EXISTS.md Compiled FPF vs raw FPF — the triple tax problem
43
+ ├── FPF_FLOOR_MAP.md Semantic floor map (5 floors, TTL derivation)
44
+ ├── REJECTED_C32_CANDIDATE_SYNTHESIS.md C.32 rejection (activation bias)
45
+ └── REJECTED_NQD_OEE_CULTURAL_EVOLUTION.md NQD/OEE rejection (bias injector)
46
+ ```
47
+
48
+ ## Relationship to ailev/FPF
49
+
50
+ This package is built on [ailev/FPF](https://github.com/ailev/FPF) by Anatoly Levenchuk. It is an independent implementation — our own research and code, MIT-licensed, with further development rights.
51
+
52
+ ### What we reviewed
53
+
54
+ We cross-checked the following FPF commits (June 2026 precision restoration cluster) against our code:
55
+
56
+ - [`20c8a0a`](https://github.com/ailev/FPF/commit/20c8a0a) — ontic, declarative algorithms, method-work cleanup
57
+ - [`205de76`](https://github.com/ailev/FPF/commit/205de76) — role and method ontic refactoring
58
+ - [`cf12b97`](https://github.com/ailev/FPF/commit/cf12b97) — U-kinds+ontics normalization
59
+ - [`fe0df9d`](https://github.com/ailev/FPF/commit/fe0df9d) — holons and meta-holon transition normalization
60
+ - [`3becd8e`](https://github.com/ailev/FPF/commit/3becd8e) — MOVE precision restoration
61
+ - [`b74ecf2`](https://github.com/ailev/FPF/commit/b74ecf2) — move disambiguation full corpus scan
62
+
63
+ **Verdict**: the FPF precision restoration confirms our existing design choices rather than contradicting them. His semantics got closer to what we already built.
64
+
65
+ ### What we adopted
66
+
67
+ One item passed our scope filter:
68
+
69
+ - **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.
70
+
71
+ ### What we rejected
72
+
73
+ Two FPF pattern families rejected for activation bias — they amplify existing LLM priors instead of constraining them:
74
+
75
+ - **C.32 Candidate-Synthesis Logic** ([`10cd224`](https://github.com/ailev/FPF/commit/10cd224cef9c92043fb6821e165decd6ea05073f)) — variant racing, tradeoff-seeking, candidate-multiplying. These are motion patterns, not neutral semantic relations. See [REJECTED_C32_CANDIDATE_SYNTHESIS.md](fpf_thinking_map/REJECTED_C32_CANDIDATE_SYNTHESIS.md).
76
+ - **NQD/OEE/Cultural Evolution** (C.17–C.19, A.4) — novelty-seeking, diversity-maintaining, search-front expanding. Same activation bias class. See [REJECTED_NQD_OEE_CULTURAL_EVOLUTION.md](fpf_thinking_map/REJECTED_NQD_OEE_CULTURAL_EVOLUTION.md).
77
+
78
+ **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.
79
+
80
+ ## Sources
81
+
82
+ - **[FPF (First Principles Framework)](https://github.com/ailev/FPF)** by Anatoly Levenchuk — transdisciplinary specification (~51k lines). We extracted 10 semantic primitives and 9 guard rules. This is a compiled distillation, not a port.
83
+ - **Computational logic (Mitev L.)** — "Bazele programarii logice." 6 propositional logic operators and the Wumpus World agent navigation pattern.
84
+
85
+ Full attribution in [SOURCES.md](fpf_thinking_map/SOURCES.md).
86
+
87
+ ## Why v1.1 exists — reasoning about reasoning is the bug
88
+
89
+ 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.
90
+
91
+ 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.
92
+
93
+ **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.
94
+
95
+ 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).
96
+
97
+ ## v1.2.1 changes
98
+
99
+ - **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](fpf_thinking_map/FPF_FLOOR_MAP.md) for the 5-floor vertical map.
100
+ - **EvidenceFresh proposition** — `EvidenceFresh("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.
101
+ - **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.
102
+ - **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.
103
+ - **Slice blockers** — `slice()` 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.
104
+ - **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.
105
+ - **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.
106
+
107
+ ## Design principles
108
+
109
+ - **Only add structure when it changes agentic behavior** — not for source fidelity alone
110
+ - **Per-step chew = one move slice** — never context feast
111
+ - **Horizontal operational clarity** over vertical semantic completeness
112
+ - **Compile-time richness** over runtime payload growth
113
+
114
+ ## Using as a dependency
115
+
116
+ This package is the reasoning engine. Your domain maps run on top of it.
117
+
118
+ ```bash
119
+ pip install git+https://github.com/igareosh/prichindel.com-agentic-thinking-map.git
120
+ ```
121
+
122
+ ```python
123
+ from fpf_thinking_map import (
124
+ SemanticMap, ContextPrimitive, RolePrimitive, TransitionPrimitive,
125
+ GatePrimitive, GateCheck, EvidencePrimitive, CommitmentPrimitive,
126
+ FGR, Freshness, SemanticFloor, DeonticModality, AgencyLevel,
127
+ RuntimeBinding, ThinkingMapTraversal,
128
+ LogicLayer, DecisionRule, RuleKind, EvidenceFresh,
129
+ )
130
+
131
+ # 1. Build your domain map
132
+ sm = SemanticMap()
133
+ sm.register_context(ContextPrimitive("sales", "Sales Process",
134
+ glossary={"lead": "potential customer", "deal": "qualified opportunity"},
135
+ invariants=["no invoice without signed contract"],
136
+ ))
137
+ sm.register_role(RolePrimitive("sales_rep", "Sales Rep", "sales",
138
+ incompatible_with=["approver"],
139
+ ))
140
+ sm.register_gate(GatePrimitive("deal_gate", "Deal Gate", "sales", checks=[
141
+ GateCheck("contract", "Signed contract", required_evidence=["signed_contract"]),
142
+ ]))
143
+ sm.register_transition(TransitionPrimitive(
144
+ "qualify", "Qualify Lead", "sales", "new_lead", "qualified",
145
+ required_evidence=["contact_info"],
146
+ ))
147
+
148
+ # 2. Build your logic rules (optional)
149
+ logic = LogicLayer()
150
+ logic.add_rule(DecisionRule(
151
+ name="deal_ready",
152
+ condition=EvidenceFresh("signed_contract"),
153
+ action_if_true="proceed", action_if_false="collect_signature",
154
+ kind=RuleKind.ROUTE, tags=["sales"],
155
+ ))
156
+
157
+ # 3. Create engine and step
158
+ engine = ThinkingMapTraversal(sm, logic_layer=logic)
159
+ state = engine.build_active_state(
160
+ RuntimeBinding(task="qualify lead", actor_role_ids=["sales_rep"],
161
+ active_context_id="sales", current_evidence=["contact_info"]),
162
+ current_state="new_lead",
163
+ )
164
+ outcome = engine.step(state)
165
+ # outcome.kind → CONTINUE, COLLECT_EVIDENCE, IDLE, BRIDGE, ...
166
+ # outcome.llm_prompt_state → JSON for the model (includes response_contract)
167
+ ```
168
+
169
+ 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.
170
+
171
+ ## Compatibility
172
+
173
+ Built with Claude Code (Anthropic claude-sonnet-4-6). Tested and verified to work with:
174
+
175
+ | Model family | Status | Notes |
176
+ |-------------|--------|-------|
177
+ | **Anthropic Claude** (Sonnet, Opus, Haiku) | Works | Built and tested here. Slice size fits comfortably in context. |
178
+ | **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. |
179
+ | **Any model that reads JSON and follows structured constraints** | Should work | The package outputs plain dicts. No model-specific prompting. |
180
+
181
+ 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.
182
+
183
+ ## License
184
+
185
+ MIT. See [LICENSE](LICENSE).
186
+
187
+ ---
188
+
189
+ **prichindel.com** — v1.2.1 — 2026-06-26
@@ -0,0 +1,88 @@
1
+ # FPF Source-to-Code Relation Audit — Response
2
+
3
+ Reviewer: prichindel.com
4
+ Date: 2026-06-24
5
+ Input: `FPF_SOURCE_TO_CODE_RELATION_AUDIT.md` (50 items)
6
+
7
+ ## Summary verdict
8
+
9
+ The audit is accurate. All 50 items are real findings — no false positives. The question is which ones to fix, which to accept as intentional compression, and which to defer.
10
+
11
+ The guiding principle: **this package is a compiled thinking map, not a FPF reimplementation**. We extracted 8 objects from a 51k-line spec. Every compression was a conscious trade: less fidelity to the source, more usability for a mid-tier model chewing a per-move slice.
12
+
13
+ The audit correctly identifies where compression crossed into **wrong-shape** (we said something the spec forbids) vs **missing** (we left something out). Wrong-shape must be fixed. Missing is a judgment call.
14
+
15
+ ---
16
+
17
+ ## Category 1: Fix now (wrong-shape or high-value missing, no runtime bloat)
18
+
19
+ These items either violate the source spec in a way that produces incorrect behavior, or are cheap to fix without widening the per-step chew.
20
+
21
+ | ID | What | Why fix | How |
22
+ |----|------|---------|-----|
23
+ | **R02** | `parent_context_id` encodes forbidden context containment | The FPF spec explicitly says "contexts do not form holarchies with each other." Our field contradicts this. | **Remove `parent_context_id` from `ContextPrimitive`.** Cross-context relation goes through bridges only. |
24
+ | **R40** | Gate lattice missing `BLOCK`; `ABSTAIN` overloaded as both "insufficient info" and "hard denial" | Source gate lattice is `abstain ≤ pass ≤ degrade ≤ block`. Our `ABSTAIN` conflates two distinct outcomes. | **Add `GateDecision.BLOCK` to the enum.** `ABSTAIN` = insufficient evidence (can be resolved). `BLOCK` = hard denial (cannot proceed). Update gate evaluation and guards. |
25
+ | **R30** | `WorkPrimitive(kind=PLAN)` compresses `WorkPlan` into `Work` | Source explicitly separates `U.Work` (occurrence) from `U.WorkPlan` (intent). Our `WorkKind` enum masks a real type distinction. | **Split into `WorkPrimitive` (enactment only) and `WorkPlanPrimitive` (planning only).** Drop `WorkKind` enum — the type IS the distinction. |
26
+ | **R05** | Context invariants stored but never enforced | Invariants are strings that nothing reads. They exist in the prompt state but are not checked by guards or logic. | **Add invariant-check guard** that evaluates invariant expressions against the current state. Even if invariants stay semi-formal (strings the LLM evaluates), they should at least appear in the guard/logic path, not just in the glossary dump. |
27
+
28
+ ## Category 2: Fix next round (genuine gaps, but require design thought)
29
+
30
+ These items are real structural absences. Fixing them adds value but requires deciding on shape. Queue for next pass.
31
+
32
+ | ID | What | Why next round | Shape sketch |
33
+ |----|------|---------------|-------------|
34
+ | **R07/R08** | No first-class `RoleAssignment` — roles bound directly via runtime IDs | The audit is right: FPF has `U.RoleAssignment` as a distinct object that binds holder to role inside a context with a time window. Our `actor_role_ids` is a shortcut. | Add `RoleAssignment` dataclass with `holder_id`, `role_id`, `context_id`, `window`. `RuntimeBinding` references assignments, not raw role IDs. `active_roles` resolves from assignments. |
35
+ | **R09** | No `RoleEnactment` — work doesn't reference the assignment it was performed under | Source says `RoleEnactment ::= <work, by: RoleAssignment>`. Our `WorkPrimitive.actor_role_id` is a loose string, not a reference to an assignment. | When R07/R08 land, add `performed_under: str` (assignment ID) to `WorkPrimitive`. |
36
+ | **R17** | `CommitmentPrimitive` lacks `subject`, `referents`, `owed_to`, `source` | Source commitment is richer: accountable subject, who it's owed to, what it refers to, where it came from. Our version only has modality + evidence refs. | Add fields. These don't widen per-step chew because commitments are only consulted when explicitly in scope. |
37
+ | **R20/R21** | No speech-act structure for communicative work | Source has `U.SpeechAct` as a `U.Work` subtype for approvals, authorizations, revocations. We have no way to model "approval as a communicative act that institutes a commitment." | Add `SpeechActPrimitive` as a `WorkPrimitive` subtype with `act_types`, `addressed_to`, `institutes`. Only enters the path when the current move is communicative. |
38
+ | **R32** | `WorkPrimitive` lacks `primary_target` and source-aligned work kinds | Source distinguishes Operational / Communicative / Epistemic work kinds and requires a primary target. | Add `work_kind` (operational/communicative/epistemic) and `primary_target` fields. |
39
+ | **R24/R25** | Evidence is flat — no typed DAG, no `verifiedBy` vs `validatedBy` distinction | Source evidence graph has typed nodes, edges, and a formal-vs-empirical anchor split. Ours is `supports: list[str]`. | Add `EvidenceEdge` dataclass with `kind` (supports/contradicts/verifies/validates) and build a minimal graph. Keep the evidence primitive itself flat; the graph is a separate structure on `SemanticMap`. |
40
+
41
+ ## Category 3: Accept as intentional compression (do not fix)
42
+
43
+ These items are correctly identified as missing, but adding them would turn the thinking map into a FPF reimplementation. The compression is the feature.
44
+
45
+ | IDs | What | Why keep compressed |
46
+ |-----|------|-------------------|
47
+ | **R01** | `ContextPrimitive` is not a `U.Holon` with a `U.Boundary` | The holonic foundation is FPF's deepest abstraction layer. We don't need Entity → Holon → System/Episteme for a thinking map. Context-as-bounded-frame is sufficient. |
48
+ | **R03** | Roles not structurally attached to context object | Roles are indexed by `context_id` globally, and `active_roles` validates context match at runtime. Attaching a role registry directly to the context object would duplicate the `SemanticMap.roles` dict. The runtime behavior is correct. |
49
+ | **R04** | Bridge lacks `fit/congruence` field | `translation_loss` is sufficient for the current use case. Adding a formal congruence level adds semantic weight without operational benefit in the thinking map. |
50
+ | **R06** | No bridge-mediated term translation path | Bridge-aware term lookup is a RAG/retrieval feature, not a thinking map feature. The map tells the LLM that a bridge exists and what the loss is; the LLM does the translation. |
51
+ | **R10/R11** | No holder-kind eligibility model | FPF's distinction between System holders (behavioral roles) and Episteme holders (status roles) is deep ontology. The thinking map doesn't need to type-check holders; it needs to check role conflicts and context scope. |
52
+ | **R12** | No assignment window / time discipline | Time windows are important in FPF for formal role lifecycle. In the thinking map, temporal validity is handled by evidence freshness and external constraints, not by role assignment windows. |
53
+ | **R13** | Authoritative vs observational role assignments | This distinction matters in formal FPF gate semantics. In the thinking map, the guard layer handles gate authority via the gate-transition binding, not via role assignment modes. |
54
+ | **R14** | `specializes` pointer not used for `requiredRoles` substitution | Role substitution is FPF's formal role algebra. The thinking map checks conflict (⊥) which is the operationally critical case. Specialization substitution is a vertical enrichment. |
55
+ | **R15** | Conflict checked as simultaneous IDs, not overlapping assignment windows | Same as R12 — window discipline is deferred. ID-based conflict check catches the operational case. |
56
+ | **R16** | No bundle operator (⊗) | Role bundles are formal role algebra. The thinking map supports multi-role binding via `actor_role_ids` and checks conflicts. Bundles add formalism without operational payoff at this level. |
57
+ | **R18** | Commitment checks reduce to evidence completion | Source wants accountable subject distinct from evidence. For the thinking map, evidence-backed commitment is the operational check. Subject accountability is a governance layer concern. |
58
+ | **R19** | No commitment conflict channel | The logic layer's `exclusive_with` handles action contradictions. Formal commitment-level conflict requires the richer commitment model from R17. |
59
+ | **R22** | No "institutes/updates/revokes" relation | This is the speech-act machinery from R20/R21. Deferred to that implementation. |
60
+ | **R23** | Publication is "just a face record" | Intentional. Publication is out of the step path. Adding projection lineage turns it into a rendering engine. |
61
+ | **R26** | No symbol carrier register (SCR/RSCR) | Deep FPF publication machinery. Not needed for a thinking map. |
62
+ | **R27** | No scope separation between design-time and run-time evidence | Good formal discipline, but the thinking map's evidence is always runtime (current_evidence). Design-time evidence doesn't enter the per-step path. |
63
+ | **R28** | No external-transformer relation for evidence production | Important in FPF for audit trails. The thinking map trusts evidence IDs as given by the binding. Externality is a governance concern. |
64
+ | **R29** | No ordered trace or method instantiation card | `method_id` is a loose pointer. For the thinking map, this is sufficient — the model doesn't need to reconstruct method instantiation chains per step. |
65
+ | **R31/R33** | Work lacks `performedBy`, `isExecutionOf` as first-class links | These are source canonical relations. The thinking map uses loose IDs (`method_id`, `actor_role_id`). First-class links would be the right shape after R07/R08/R09 land. |
66
+ | **R34** | `method_id` collapses method and method-description | FPF's Method/MethodDescription distinction. For the thinking map, a method reference is enough. |
67
+ | **R35** | No capability primitive | `U.Capability` is a system attribute in FPF. The thinking map checks role eligibility and gate passage, not capability declarations. |
68
+ | **R36** | Work lacks occurrence window, resource ledger, acceptance outcome | Full work record semantics. The thinking map tracks inputs/outputs and evidence refs. Detailed occurrence tracking is an execution engine concern. |
69
+ | **R37** | No work acceptance against spec-standard chain | CAC (Context-Assignment-Standard) checks are formal FPF acceptance. The thinking map's guards cover context and evidence, not spec-standard chains. |
70
+ | **R38** | `WorkPlan` lacks dependencies, budgets, variance dimensions | Full planning semantics. Deferred to R30 split, but detailed planning fields are execution-engine scope. |
71
+ | **R39** | No `plannedAs` / fulfilment / variance relation | Depends on R30 (WorkPlan split). Deferred. |
72
+ | **R41/R42/R43/R44** | Gate model lacks profiles, CV/GF split, decision logs, fold policies | Deep gate semantics. The thinking map's gate model (checks → tri-state → decision) covers the operational case. Profile-bound folds and decision logs are audit-trail features. |
73
+ | **R45/R46/R47/R48/R49** | Publication lacks viewpoints, pin discipline, comparator sets, publication-scope | Deep MVPK semantics. Publication is intentionally thin in the thinking map — it's a face label, not a rendering engine. |
74
+ | **R50** | Slice-first runtime is built from compressed primitives | Correct observation. This is the design: compressed primitives → small slices → usable per-step chew. Enriching primitives is the next pass (Category 2), but only fields that don't widen the slice. |
75
+
76
+ ---
77
+
78
+ ## Scorecard
79
+
80
+ | Category | Count | Action |
81
+ |----------|-------|--------|
82
+ | Fix now (wrong-shape or cheap high-value) | 4 items (R02, R05, R30, R40) | Implement this round |
83
+ | Fix next round (genuine gaps, need design) | 6 items (R07/R08, R09, R17, R20/R21, R24/R25, R32) | Queue with shape sketches |
84
+ | Intentional compression (keep as-is) | 40 items | Document as design decisions |
85
+
86
+ ---
87
+
88
+ prichindel.com | 2026-06-24 | v1.0.0