json-object-editor 0.10.641 → 0.10.650
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.
- package/CHANGELOG.md +7 -0
- package/docs/Thought_Concept_for_JOE.md +137 -0
- package/img/joe-sprite.ai +1155 -758
- package/js/joe-ai.js +53 -0
- package/package.json +1 -1
- package/readme.md +7 -0
- package/server/apps/aihub.js +1 -0
- package/server/fields/core.js +40 -0
- package/server/modules/MCP.js +69 -2
- package/server/modules/ThoughtPipeline.js +585 -0
- package/server/schemas/ai_response.js +4 -0
- package/server/schemas/question.js +2 -1
- package/server/schemas/task.js +4 -1
- package/server/schemas/thought.js +280 -0
- package/server/webconfig.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## 0.10.650 - Ai Mental Model & Thoughts
|
|
2
|
+
- New `thought` schema for hypotheses/syntheses/links with about/because receipts, status, and AI lineage.
|
|
3
|
+
- ThoughtPipeline module compiles scope_object + schema summaries + accepted Thoughts into deterministic context.
|
|
4
|
+
- `runThoughtAgent` MCP tool runs the Thought agent via OpenAI Responses and writes both ai_response and thought objects.
|
|
5
|
+
- ai_responses now store `generated_thoughts[]` (hard links to Thoughts) and Thoughts store `source_ai_response`.
|
|
6
|
+
- Core `proposeThought` + `ai_responses` fields let any schema trigger Thought runs and audit results per-object.
|
|
7
|
+
|
|
1
8
|
## 0.10.638
|
|
2
9
|
- Matrix: Added schema relationship visualization page at `/_www/matrix.html` with interactive D3.js force-directed graph showing schema-to-schema relationships. Features include app-based filtering, clickable nodes with schema properties panel, SVG icons, and link labels that appear on node selection.
|
|
3
10
|
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# Thought (JOE) — the simplest, testable “world model” primitive
|
|
2
|
+
|
|
3
|
+
A **Thought** is an auditable reasoning artifact that can be created by a **human** or by an **agent/LLM**.
|
|
4
|
+
|
|
5
|
+
It exists to make reasoning **inspectable**, **editable**, and **reusable** inside JOE — not as hidden prompt text.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## The 3 Thought Types (keep it small)
|
|
10
|
+
|
|
11
|
+
We use only three types to avoid field creep and ontology soup.
|
|
12
|
+
|
|
13
|
+
### 1) Hypothesis
|
|
14
|
+
A claim that should be **vetted**.
|
|
15
|
+
|
|
16
|
+
- Purpose: capture a learning/insight that may influence decisions.
|
|
17
|
+
- **Requires:** `because[]` (at least one receipt)
|
|
18
|
+
- Usually: short statement, has a certainty score.
|
|
19
|
+
- Lifecycle: typically starts `proposed`, becomes `accepted` after review.
|
|
20
|
+
|
|
21
|
+
Example:
|
|
22
|
+
> “Client likely has insomnia driven by anxiety.”
|
|
23
|
+
|
|
24
|
+
### 2) Synthesis
|
|
25
|
+
A longer summary that **compresses** multiple objects into one coherent statement.
|
|
26
|
+
|
|
27
|
+
- Purpose: summarize/synthesize a set of objects (intake, results, notes, conditions, etc.).
|
|
28
|
+
- **Requires:** `about[]` (what is being summarized)
|
|
29
|
+
- `because[]` is optional (nice-to-have but not required).
|
|
30
|
+
- Lifecycle: can be draft/accepted depending on workflow.
|
|
31
|
+
|
|
32
|
+
Example:
|
|
33
|
+
> “Across intake + last 2 sessions, the pattern is late-night rumination, inconsistent schedule, and poor sleep onset.”
|
|
34
|
+
|
|
35
|
+
### 3) Link
|
|
36
|
+
A binary relationship claim: **A relates to B** in a specific way.
|
|
37
|
+
|
|
38
|
+
- Purpose: encode an explicit relationship between two things.
|
|
39
|
+
- **Requires:** endpoints A and B, a `relationship_type`, and `because[]`.
|
|
40
|
+
- Also typically includes a short `rationale`.
|
|
41
|
+
|
|
42
|
+
Example:
|
|
43
|
+
> “Recommendation magnesium is included in the protocol because insomnia + sleep latency + guideline resource.”
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Two concepts that prevent confusion
|
|
48
|
+
|
|
49
|
+
### About vs Because
|
|
50
|
+
These answer different questions:
|
|
51
|
+
|
|
52
|
+
- `about[]` = **What this thought concerns**
|
|
53
|
+
- Used for synthesis (“I’m summarizing these objects”)
|
|
54
|
+
- Can also attach a thought to a single object or to an itemtype/schema.
|
|
55
|
+
|
|
56
|
+
- `because[]` = **Why we believe the thought**
|
|
57
|
+
- The receipts/evidence trail for hypotheses and links.
|
|
58
|
+
- Each entry can include a `role` (why this supporting item matters) and a note.
|
|
59
|
+
|
|
60
|
+
### Binary link + multi-cause proof
|
|
61
|
+
We keep Link thoughts **binary** (A ↔ B) for clarity and reviewability.
|
|
62
|
+
|
|
63
|
+
Multi-cause reasoning (condition + client fact + resource + result) belongs in `because[]`.
|
|
64
|
+
|
|
65
|
+
This makes links:
|
|
66
|
+
- easy to query,
|
|
67
|
+
- easy to audit,
|
|
68
|
+
- easy to approve/reject individually.
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Minimal field shape (conceptual)
|
|
73
|
+
|
|
74
|
+
All Thoughts share:
|
|
75
|
+
- `thought_type` (hypothesis | synthesis | link)
|
|
76
|
+
- `statement` (human-readable)
|
|
77
|
+
- `certainty` (0–1)
|
|
78
|
+
- `author` / `created_by` (human or agent id/name)
|
|
79
|
+
- `status` (draft | proposed | accepted | rejected | superseded)
|
|
80
|
+
- `about[]` (object or itemtype/schema the thought is about)
|
|
81
|
+
- `lineage` (ai_response_id, timestamps, reviewer fields)
|
|
82
|
+
|
|
83
|
+
Link thoughts additionally use:
|
|
84
|
+
- `a: { itemtype, id }`
|
|
85
|
+
- `b: { itemtype, id }`
|
|
86
|
+
- `relationship_type` (enumerated verb)
|
|
87
|
+
- `rationale` (one sentence)
|
|
88
|
+
- `because[]` (receipts)
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Why this works as “world model” scaffolding
|
|
93
|
+
|
|
94
|
+
- Thoughts are stored as objects → **persistent**, **inspectable**, **permissionable**.
|
|
95
|
+
- Pipeline steps can include Thoughts as context blocks → the agent gets a **structured mental state**.
|
|
96
|
+
- AI can propose new Thoughts → they land as `proposed` and require review → no silent “AI truth creep”.
|
|
97
|
+
- Accepted Thoughts improve future runs measurably (you can test that).
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## MVP testing approach
|
|
102
|
+
|
|
103
|
+
1) **Manual Thoughts**
|
|
104
|
+
Create a few hypotheses, syntheses, and links. Verify they’re easy to read/edit/filter.
|
|
105
|
+
|
|
106
|
+
2) **Pipeline compile**
|
|
107
|
+
Make a pipeline that selects:
|
|
108
|
+
- overarching Thoughts (vision/constraints) by tags,
|
|
109
|
+
- protocol-scoped Thoughts by `scope_id`,
|
|
110
|
+
- tool-thoughts (rules/examples/functions) as context blocks.
|
|
111
|
+
|
|
112
|
+
Compile should be deterministic.
|
|
113
|
+
|
|
114
|
+
3) **Agent config + run**
|
|
115
|
+
Agent config references pipeline + ai_prompt template. Run produces an `ai_response`.
|
|
116
|
+
|
|
117
|
+
4) **Thought generation**
|
|
118
|
+
LLM outputs `proposed_thoughts[]` (JSON contract). Save as `proposed` and review into `accepted`.
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## Practical protocol example (clean and auditable)
|
|
123
|
+
|
|
124
|
+
Thought (Link):
|
|
125
|
+
- A = recommendation “Magnesium glycinate”
|
|
126
|
+
- B = protocol “Sleep protocol”
|
|
127
|
+
- relationship_type = included_in
|
|
128
|
+
- rationale = “Included to support sleep onset.”
|
|
129
|
+
- because[] = condition insomnia + result sleep latency + resource guideline
|
|
130
|
+
|
|
131
|
+
This single link can be accepted/rejected, and the receipts explain why.
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
If you want to extend later:
|
|
136
|
+
- Add app-scoped relationship types via a small config schema/dataset.
|
|
137
|
+
- Add an `ai_rule` schema only if you truly need conditional logic beyond binary links.
|