pi-gnosis 0.1.0
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 +13 -0
- package/LICENSE +21 -0
- package/NOTICE +7 -0
- package/README.md +56 -0
- package/bin/pi-gnosis.js +58 -0
- package/config/gnosis.config.json +51 -0
- package/framework/circuitry-first.md +18 -0
- package/framework/cleanup-policy.md +22 -0
- package/framework/obsidian-contract.md +31 -0
- package/framework/probing-policy.md +20 -0
- package/framework/research-foundations.md +46 -0
- package/framework/storage-contract.md +36 -0
- package/framework/why-kt-dag.md +18 -0
- package/graphs/README.md +15 -0
- package/graphs/cleanup.circuitry.yaml +94 -0
- package/graphs/manim-lecture.circuitry.yaml +137 -0
- package/graphs/minimal-smoke.circuitry.yaml +32 -0
- package/graphs/note-export.circuitry.yaml +116 -0
- package/graphs/research.circuitry.yaml +309 -0
- package/graphs/tutoring-session.circuitry.yaml +130 -0
- package/package.json +81 -0
- package/pi.json +42 -0
- package/scripts/check-circuitry-v02.py +148 -0
- package/skills/manim-video/SKILL.md +49 -0
- package/skills/pi-gnosis/SKILL.md +54 -0
- package/src/cleanup-policy.js +43 -0
- package/src/config.js +40 -0
- package/src/graph-template.js +10 -0
- package/src/graph-validator.js +40 -0
- package/src/index.js +8 -0
- package/src/manim-project.js +44 -0
- package/src/probe-policy.js +22 -0
- package/src/review-scheduler.js +54 -0
- package/src/storage-contract.js +42 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
circuitry: "0.2"
|
|
2
|
+
title: "Pi-GNOSIS Minimal Smoke Program"
|
|
3
|
+
description: "Small Circuitry graph for validating provider, model inheritance, resource inputs, skill loading, and expected JSON output."
|
|
4
|
+
runtime:
|
|
5
|
+
provider: pi
|
|
6
|
+
model: inherit
|
|
7
|
+
validation:
|
|
8
|
+
rules:
|
|
9
|
+
- no-self-loops
|
|
10
|
+
- no-unknown-edge-endpoints
|
|
11
|
+
- no-cycles
|
|
12
|
+
- rule: require-executable-inputs
|
|
13
|
+
executableKinds: [agent, tool]
|
|
14
|
+
resources:
|
|
15
|
+
smoke_request:
|
|
16
|
+
type: text
|
|
17
|
+
value: |
|
|
18
|
+
Verify pi-gnosis graph wiring. Do not browse. Do not write files.
|
|
19
|
+
smoke_agent:
|
|
20
|
+
type: agent
|
|
21
|
+
identity: "Pi-GNOSIS Smoke Agent"
|
|
22
|
+
model: inherit
|
|
23
|
+
inputs: [smoke_request]
|
|
24
|
+
skills: [pi-gnosis]
|
|
25
|
+
tools: []
|
|
26
|
+
expect:
|
|
27
|
+
status: str
|
|
28
|
+
provider: str
|
|
29
|
+
model: str
|
|
30
|
+
note: str
|
|
31
|
+
instructions: |
|
|
32
|
+
Return a tiny JSON object confirming that this graph uses provider pi and model inherit. Output only valid JSON matching expect.
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
circuitry: "0.2"
|
|
2
|
+
title: "Pi-GNOSIS Obsidian Export Program"
|
|
3
|
+
description: |
|
|
4
|
+
Frozen Circuitry program that turns canonical DAG state into learner-facing Obsidian-compatible notes under a safe notes root.
|
|
5
|
+
runtime:
|
|
6
|
+
provider: pi
|
|
7
|
+
model: inherit
|
|
8
|
+
validation:
|
|
9
|
+
rules:
|
|
10
|
+
- no-self-loops
|
|
11
|
+
- no-unknown-edge-endpoints
|
|
12
|
+
- no-cycles
|
|
13
|
+
- rule: require-executable-inputs
|
|
14
|
+
executableKinds: [agent, tool]
|
|
15
|
+
resources:
|
|
16
|
+
export_request:
|
|
17
|
+
type: text
|
|
18
|
+
label: "Note export request"
|
|
19
|
+
value: |
|
|
20
|
+
topic: ""
|
|
21
|
+
dag_state_path: ".pi-gnosis/state"
|
|
22
|
+
note_path: "notes"
|
|
23
|
+
apply_writes: false
|
|
24
|
+
overwrite_policy: "preserve-user-edits"
|
|
25
|
+
obsidian_contract:
|
|
26
|
+
type: text
|
|
27
|
+
label: "Obsidian contract"
|
|
28
|
+
value: |
|
|
29
|
+
Obsidian is learner-facing memory, not canonical source truth. Export 00-map.md, source-ledger.md, concepts/*.md, misconceptions.md, probes.md, review-plan.md, reflection-log.md, and manifest.md. Preserve user edits where possible. Link concepts, sources, and probes.
|
|
30
|
+
write_policy:
|
|
31
|
+
type: text
|
|
32
|
+
label: "Write policy"
|
|
33
|
+
value: |
|
|
34
|
+
Manifest first. Write only under the configured note_path. Do not delete notes. Do not overwrite user-authored sections unless explicitly asked. Mark generated sections with stable headers so future runs can update them safely.
|
|
35
|
+
dag_state_importer:
|
|
36
|
+
type: agent
|
|
37
|
+
identity: "DAG State Importer"
|
|
38
|
+
model: inherit
|
|
39
|
+
inputs: [export_request, obsidian_contract]
|
|
40
|
+
skills: [pi-gnosis]
|
|
41
|
+
tools: [read_file, grep]
|
|
42
|
+
expect:
|
|
43
|
+
imported_state_summary: str
|
|
44
|
+
source_ledger_available: bool
|
|
45
|
+
claim_ledger_available: bool
|
|
46
|
+
kt_dag_available: bool
|
|
47
|
+
missing_inputs:
|
|
48
|
+
type: list
|
|
49
|
+
items: str
|
|
50
|
+
instructions: |
|
|
51
|
+
Read only the requested DAG state. Summarize available ledgers and missing inputs. Do not write. Output only valid JSON matching expect.
|
|
52
|
+
note_plan_builder:
|
|
53
|
+
type: agent
|
|
54
|
+
identity: "Obsidian Note Plan Builder"
|
|
55
|
+
model: inherit
|
|
56
|
+
inputs: [dag_state_importer, obsidian_contract, write_policy]
|
|
57
|
+
skills: [pi-gnosis]
|
|
58
|
+
tools: []
|
|
59
|
+
expect:
|
|
60
|
+
files_to_create_or_update:
|
|
61
|
+
type: list
|
|
62
|
+
items:
|
|
63
|
+
path: str
|
|
64
|
+
purpose: str
|
|
65
|
+
update_policy: str
|
|
66
|
+
generated_section_ids:
|
|
67
|
+
type: list
|
|
68
|
+
items: str
|
|
69
|
+
user_edit_risks:
|
|
70
|
+
type: list
|
|
71
|
+
items: str
|
|
72
|
+
instructions: |
|
|
73
|
+
Build a manifest-first note plan. Use the Obsidian contract. Make clear which sections are generated and which are preserved. Output only valid JSON matching expect.
|
|
74
|
+
note_writer:
|
|
75
|
+
type: agent
|
|
76
|
+
identity: "Obsidian Note Writer"
|
|
77
|
+
model: inherit
|
|
78
|
+
inputs: [note_plan_builder, dag_state_importer, obsidian_contract, write_policy]
|
|
79
|
+
skills: [pi-gnosis]
|
|
80
|
+
tools: [read_file, write_file, edit_file]
|
|
81
|
+
expect:
|
|
82
|
+
files_written_or_planned:
|
|
83
|
+
type: list
|
|
84
|
+
items: str
|
|
85
|
+
manifest_path: str
|
|
86
|
+
skipped_files:
|
|
87
|
+
type: list
|
|
88
|
+
items: str
|
|
89
|
+
warnings:
|
|
90
|
+
type: list
|
|
91
|
+
items: str
|
|
92
|
+
instructions: |
|
|
93
|
+
If apply_writes is false, return planned content only. If writes are enabled by Pi, write only under note_path, manifest first. Preserve user sections. Include source ids and open-ended probes. Output only valid JSON matching expect.
|
|
94
|
+
note_quality_gate:
|
|
95
|
+
type: agent
|
|
96
|
+
identity: "Obsidian Note Quality Gate"
|
|
97
|
+
model: inherit
|
|
98
|
+
inputs: [note_writer, obsidian_contract, dag_state_importer]
|
|
99
|
+
skills: [pi-gnosis]
|
|
100
|
+
tools: [read_file, grep]
|
|
101
|
+
expect:
|
|
102
|
+
status: str
|
|
103
|
+
missing_required_notes:
|
|
104
|
+
type: list
|
|
105
|
+
items: str
|
|
106
|
+
unsupported_claims:
|
|
107
|
+
type: list
|
|
108
|
+
items: str
|
|
109
|
+
weak_learning_sections:
|
|
110
|
+
type: list
|
|
111
|
+
items: str
|
|
112
|
+
cleanup_candidates:
|
|
113
|
+
type: list
|
|
114
|
+
items: str
|
|
115
|
+
instructions: |
|
|
116
|
+
Verify generated notes against the contract. Check for missing source ids, missing probes, missing review prompts, broken internal links if possible, and accidental overwrite risk. Output only valid JSON matching expect.
|
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
circuitry: "0.2"
|
|
2
|
+
title: "Pi-GNOSIS Research Program"
|
|
3
|
+
description: |
|
|
4
|
+
Frozen Circuitry program for delegated source-grounded research. The graph is the multi-agent workflow: scope, query planning, source discovery, fetching, claim extraction, critique, and KT-DAG seeding.
|
|
5
|
+
runtime:
|
|
6
|
+
provider: pi
|
|
7
|
+
model: inherit
|
|
8
|
+
validation:
|
|
9
|
+
rules:
|
|
10
|
+
- no-self-loops
|
|
11
|
+
- no-unknown-edge-endpoints
|
|
12
|
+
- no-cycles
|
|
13
|
+
- rule: require-executable-inputs
|
|
14
|
+
executableKinds: [agent, tool]
|
|
15
|
+
resources:
|
|
16
|
+
user_request:
|
|
17
|
+
type: text
|
|
18
|
+
label: "Learning/research request"
|
|
19
|
+
value: |
|
|
20
|
+
topic: "automated research pipelines and agentic tutors"
|
|
21
|
+
purpose: "learn"
|
|
22
|
+
output_modes: ["dag_state", "obsidian_notes"]
|
|
23
|
+
note_path: "notes"
|
|
24
|
+
dag_state_path: ".pi-gnosis/state"
|
|
25
|
+
depth: "working"
|
|
26
|
+
learner_context: ""
|
|
27
|
+
constraints: ""
|
|
28
|
+
apply_writes: false
|
|
29
|
+
package_config:
|
|
30
|
+
type: text
|
|
31
|
+
label: "Pi-GNOSIS config snapshot"
|
|
32
|
+
value: |
|
|
33
|
+
package: pi-gnosis
|
|
34
|
+
circuitry: "0.2"
|
|
35
|
+
runtime_provider: pi
|
|
36
|
+
model: inherit
|
|
37
|
+
required_tools: [web_search, fetch_content]
|
|
38
|
+
optional_tools: [exa_search]
|
|
39
|
+
required_dependency: pi-web-access
|
|
40
|
+
optional_dependency: pi-exa-search
|
|
41
|
+
research_policy:
|
|
42
|
+
type: text
|
|
43
|
+
label: "Research policy"
|
|
44
|
+
value: |
|
|
45
|
+
Use source-ledger and claim-ledger thinking. Prefer primary papers, official docs, standards, textbook-like references, systematic reviews, and repo documentation. Separate evidence, interpretation, disagreement, and speculation. Do not use popularity as truth. Do not hide uncertainty.
|
|
46
|
+
learning_policy:
|
|
47
|
+
type: text
|
|
48
|
+
label: "Learning policy"
|
|
49
|
+
value: |
|
|
50
|
+
The learner may stop, resume, or jump topics. Build reusable state, not a one-shot explanation. Prefer open-ended probes and teach-back evidence. Never generate multiple-choice diagnostic probes.
|
|
51
|
+
storage_contract:
|
|
52
|
+
type: text
|
|
53
|
+
label: "Storage contract"
|
|
54
|
+
value: |
|
|
55
|
+
DAG state is canonical: source ledgers, claim ledgers, KT DAG, learner state, probe outcomes, review schedules, and manifests. Obsidian is learner-facing memory: notes, links, reflections, and study prompts.
|
|
56
|
+
prior_knowledge_audit:
|
|
57
|
+
type: agent
|
|
58
|
+
identity: "Prior Knowledge Auditor"
|
|
59
|
+
model: inherit
|
|
60
|
+
inputs: [user_request, learning_policy, storage_contract]
|
|
61
|
+
skills: [pi-gnosis]
|
|
62
|
+
tools: [read_file, grep]
|
|
63
|
+
expect:
|
|
64
|
+
note_evidence:
|
|
65
|
+
type: list
|
|
66
|
+
items:
|
|
67
|
+
path: str
|
|
68
|
+
evidence: str
|
|
69
|
+
inferred_prior_knowledge:
|
|
70
|
+
type: list
|
|
71
|
+
items: str
|
|
72
|
+
stale_or_missing_areas:
|
|
73
|
+
type: list
|
|
74
|
+
items: str
|
|
75
|
+
confidence: str
|
|
76
|
+
instructions: |
|
|
77
|
+
Read only if note paths or prior DAG state are available. Infer prior knowledge only from user-provided context, existing notes, or prior state. If no readable notes exist, say so. Output only valid JSON matching expect.
|
|
78
|
+
scope_architect:
|
|
79
|
+
type: agent
|
|
80
|
+
identity: "Research Scope Architect"
|
|
81
|
+
model: inherit
|
|
82
|
+
inputs: [user_request, package_config, research_policy, learning_policy, prior_knowledge_audit]
|
|
83
|
+
skills: [pi-gnosis]
|
|
84
|
+
tools: []
|
|
85
|
+
expect:
|
|
86
|
+
scope: str
|
|
87
|
+
key_questions:
|
|
88
|
+
type: list
|
|
89
|
+
items: str
|
|
90
|
+
prerequisites:
|
|
91
|
+
type: list
|
|
92
|
+
items: str
|
|
93
|
+
likely_controversies:
|
|
94
|
+
type: list
|
|
95
|
+
items: str
|
|
96
|
+
source_targets:
|
|
97
|
+
type: list
|
|
98
|
+
items: str
|
|
99
|
+
invalid_shortcuts:
|
|
100
|
+
type: list
|
|
101
|
+
items: str
|
|
102
|
+
instructions: |
|
|
103
|
+
Convert the user request into a research scope. Identify prerequisite concepts, source classes, high-risk claims, and things not to conclude without evidence. This is a planning node; do not browse here. Output only valid JSON matching expect.
|
|
104
|
+
query_planner:
|
|
105
|
+
type: agent
|
|
106
|
+
identity: "Search Query Planner"
|
|
107
|
+
model: inherit
|
|
108
|
+
inputs: [scope_architect, research_policy]
|
|
109
|
+
skills: [pi-gnosis]
|
|
110
|
+
tools: []
|
|
111
|
+
expect:
|
|
112
|
+
exa_queries:
|
|
113
|
+
type: list
|
|
114
|
+
items: str
|
|
115
|
+
web_queries:
|
|
116
|
+
type: list
|
|
117
|
+
items: str
|
|
118
|
+
official_docs_targets:
|
|
119
|
+
type: list
|
|
120
|
+
items: str
|
|
121
|
+
scholar_targets:
|
|
122
|
+
type: list
|
|
123
|
+
items: str
|
|
124
|
+
exclusion_filters:
|
|
125
|
+
type: list
|
|
126
|
+
items: str
|
|
127
|
+
instructions: |
|
|
128
|
+
Produce multiple independent queries. Include fresh/recent queries when the subject is changing. Include official repo/docs queries for software dependencies. Include academic queries for pedagogy and research workflows. Output only valid JSON matching expect.
|
|
129
|
+
source_discovery:
|
|
130
|
+
type: agent
|
|
131
|
+
identity: "Source Discovery Agent"
|
|
132
|
+
model: inherit
|
|
133
|
+
inputs: [query_planner, package_config]
|
|
134
|
+
skills: [pi-gnosis, exa-web-research, librarian]
|
|
135
|
+
tools: [exa_search, web_search]
|
|
136
|
+
expect:
|
|
137
|
+
candidate_sources:
|
|
138
|
+
type: list
|
|
139
|
+
items:
|
|
140
|
+
id: str
|
|
141
|
+
title: str
|
|
142
|
+
url: str
|
|
143
|
+
source_type: str
|
|
144
|
+
reason: str
|
|
145
|
+
priority: int
|
|
146
|
+
rejected_patterns:
|
|
147
|
+
type: list
|
|
148
|
+
items: str
|
|
149
|
+
search_log:
|
|
150
|
+
type: list
|
|
151
|
+
items: str
|
|
152
|
+
instructions: |
|
|
153
|
+
Use exa_search first when available for source discovery. Use web_search when Exa is unavailable or when broad/fresh search is better. Do not synthesize the answer. Return candidate URLs, why they matter, and rejected source patterns. Output only valid JSON matching expect.
|
|
154
|
+
source_fetcher:
|
|
155
|
+
type: agent
|
|
156
|
+
identity: "Source Fetch and Extract Agent"
|
|
157
|
+
model: inherit
|
|
158
|
+
inputs: [source_discovery, research_policy]
|
|
159
|
+
skills: [pi-gnosis, librarian]
|
|
160
|
+
tools: [fetch_content, web_search]
|
|
161
|
+
expect:
|
|
162
|
+
fetched_sources:
|
|
163
|
+
type: list
|
|
164
|
+
items:
|
|
165
|
+
id: str
|
|
166
|
+
title: str
|
|
167
|
+
url: str
|
|
168
|
+
date: str
|
|
169
|
+
author_or_org: str
|
|
170
|
+
extracted_summary: str
|
|
171
|
+
limitations: str
|
|
172
|
+
unavailable_sources:
|
|
173
|
+
type: list
|
|
174
|
+
items:
|
|
175
|
+
url: str
|
|
176
|
+
reason: str
|
|
177
|
+
instructions: |
|
|
178
|
+
Fetch the highest-priority sources with fetch_content. If a source cannot be fetched, record that plainly. Preserve URLs and dates where available. Do not invent metadata. Output only valid JSON matching expect.
|
|
179
|
+
source_ledger_builder:
|
|
180
|
+
type: agent
|
|
181
|
+
identity: "Source Ledger Builder"
|
|
182
|
+
model: inherit
|
|
183
|
+
inputs: [source_fetcher, research_policy]
|
|
184
|
+
skills: [pi-gnosis]
|
|
185
|
+
tools: []
|
|
186
|
+
expect:
|
|
187
|
+
source_ledger:
|
|
188
|
+
type: list
|
|
189
|
+
items:
|
|
190
|
+
id: str
|
|
191
|
+
source: str
|
|
192
|
+
source_type: str
|
|
193
|
+
date: str
|
|
194
|
+
reliability_notes: str
|
|
195
|
+
useful_for:
|
|
196
|
+
type: list
|
|
197
|
+
items: str
|
|
198
|
+
caveats: str
|
|
199
|
+
missing_source_classes:
|
|
200
|
+
type: list
|
|
201
|
+
items: str
|
|
202
|
+
instructions: |
|
|
203
|
+
Convert fetched sources into a source ledger. Classify official docs, primary research, benchmark/evaluation, review/survey, tooling repo, commentary, or tutorial. Output only valid JSON matching expect.
|
|
204
|
+
claim_extractor:
|
|
205
|
+
type: agent
|
|
206
|
+
identity: "Claim Ledger Extractor"
|
|
207
|
+
model: inherit
|
|
208
|
+
inputs: [source_ledger_builder, scope_architect]
|
|
209
|
+
skills: [pi-gnosis]
|
|
210
|
+
tools: []
|
|
211
|
+
expect:
|
|
212
|
+
claims:
|
|
213
|
+
type: list
|
|
214
|
+
items:
|
|
215
|
+
id: str
|
|
216
|
+
claim: str
|
|
217
|
+
source_ids:
|
|
218
|
+
type: list
|
|
219
|
+
items: str
|
|
220
|
+
confidence: str
|
|
221
|
+
disagreement: str
|
|
222
|
+
implications_for_pi_gnosis: str
|
|
223
|
+
definitions:
|
|
224
|
+
type: list
|
|
225
|
+
items:
|
|
226
|
+
term: str
|
|
227
|
+
definition: str
|
|
228
|
+
source_ids:
|
|
229
|
+
type: list
|
|
230
|
+
items: str
|
|
231
|
+
open_questions:
|
|
232
|
+
type: list
|
|
233
|
+
items: str
|
|
234
|
+
instructions: |
|
|
235
|
+
Extract atomic claims and definitions. Every claim must cite source ids from the source ledger or be marked as a hypothesis. Separate consensus from disagreement. Output only valid JSON matching expect.
|
|
236
|
+
synthesis_critic:
|
|
237
|
+
type: agent
|
|
238
|
+
identity: "Synthesis Critic"
|
|
239
|
+
model: inherit
|
|
240
|
+
inputs: [claim_extractor, source_ledger_builder, research_policy]
|
|
241
|
+
skills: [pi-gnosis]
|
|
242
|
+
tools: []
|
|
243
|
+
expect:
|
|
244
|
+
unsupported_or_weak_claims:
|
|
245
|
+
type: list
|
|
246
|
+
items: str
|
|
247
|
+
missing_counterevidence:
|
|
248
|
+
type: list
|
|
249
|
+
items: str
|
|
250
|
+
stale_risk:
|
|
251
|
+
type: list
|
|
252
|
+
items: str
|
|
253
|
+
pass_conditions:
|
|
254
|
+
type: list
|
|
255
|
+
items: str
|
|
256
|
+
verdict: str
|
|
257
|
+
instructions: |
|
|
258
|
+
Audit the claim ledger. Flag unsupported claims, missing source classes, stale evidence, and overbroad synthesis. This is a quality gate before teaching artifacts. Output only valid JSON matching expect.
|
|
259
|
+
kt_dag_seed_builder:
|
|
260
|
+
type: agent
|
|
261
|
+
identity: "KT DAG Seed Builder"
|
|
262
|
+
model: inherit
|
|
263
|
+
inputs: [claim_extractor, synthesis_critic, prior_knowledge_audit, learning_policy, storage_contract]
|
|
264
|
+
skills: [pi-gnosis]
|
|
265
|
+
tools: []
|
|
266
|
+
expect:
|
|
267
|
+
kt_dag:
|
|
268
|
+
type: dict
|
|
269
|
+
concept_nodes:
|
|
270
|
+
type: list
|
|
271
|
+
items:
|
|
272
|
+
id: str
|
|
273
|
+
label: str
|
|
274
|
+
prerequisites:
|
|
275
|
+
type: list
|
|
276
|
+
items: str
|
|
277
|
+
evidence_source_ids:
|
|
278
|
+
type: list
|
|
279
|
+
items: str
|
|
280
|
+
misconception_risk: int
|
|
281
|
+
decay_risk: int
|
|
282
|
+
learner_state_update:
|
|
283
|
+
type: dict
|
|
284
|
+
recommended_next_graphs:
|
|
285
|
+
type: list
|
|
286
|
+
items: str
|
|
287
|
+
instructions: |
|
|
288
|
+
Build a transparent KT DAG seed: concepts, prerequisite edges, contrast edges, misconception risks, decay risks, and learner evidence. Do not mark mastery without open-ended evidence. Recommend follow-up graphs, such as tutoring-session, note-export, or manim-lecture. Output only valid JSON matching expect.
|
|
289
|
+
research_output_manifest:
|
|
290
|
+
type: agent
|
|
291
|
+
identity: "Research Output Manifest Writer"
|
|
292
|
+
model: inherit
|
|
293
|
+
inputs: [source_ledger_builder, claim_extractor, synthesis_critic, kt_dag_seed_builder, storage_contract]
|
|
294
|
+
skills: [pi-gnosis]
|
|
295
|
+
tools: []
|
|
296
|
+
expect:
|
|
297
|
+
dag_state_files_to_write:
|
|
298
|
+
type: list
|
|
299
|
+
items: str
|
|
300
|
+
obsidian_exports_to_offer:
|
|
301
|
+
type: list
|
|
302
|
+
items: str
|
|
303
|
+
temp_artifacts:
|
|
304
|
+
type: list
|
|
305
|
+
items: str
|
|
306
|
+
cleanup_graph_recommended: bool
|
|
307
|
+
summary_for_pi: str
|
|
308
|
+
instructions: |
|
|
309
|
+
Produce a manifest for the main Pi agent. Do not write files in this graph unless explicitly instructed by Pi runtime policy. Include a cleanup recommendation for temporary artifacts. Output only valid JSON matching expect.
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
circuitry: "0.2"
|
|
2
|
+
title: "Pi-GNOSIS Tutoring Session Program"
|
|
3
|
+
description: |
|
|
4
|
+
Frozen Circuitry program for one non-linear tutoring turn. It reads DAG/notes evidence, chooses an open-ended probe or explanation, updates learner state, and tells Pi whether to continue, pause, export notes, or switch modality.
|
|
5
|
+
runtime:
|
|
6
|
+
provider: pi
|
|
7
|
+
model: inherit
|
|
8
|
+
validation:
|
|
9
|
+
rules:
|
|
10
|
+
- no-self-loops
|
|
11
|
+
- no-unknown-edge-endpoints
|
|
12
|
+
- no-cycles
|
|
13
|
+
- rule: require-executable-inputs
|
|
14
|
+
executableKinds: [agent, tool]
|
|
15
|
+
resources:
|
|
16
|
+
session_context:
|
|
17
|
+
type: text
|
|
18
|
+
label: "Session context"
|
|
19
|
+
value: |
|
|
20
|
+
topic: ""
|
|
21
|
+
learner_message: ""
|
|
22
|
+
dag_state_path: ".pi-gnosis/state"
|
|
23
|
+
note_path: "notes"
|
|
24
|
+
preferred_mode: "pi decides"
|
|
25
|
+
user_may_quit_any_time: true
|
|
26
|
+
tutoring_policy:
|
|
27
|
+
type: text
|
|
28
|
+
label: "Tutoring policy"
|
|
29
|
+
value: |
|
|
30
|
+
This is non-linear. The learner may stop, resume, jump ahead, ask for a video, ask for notes, or change goals. Ask at most one modality or preference question when needed. Never use multiple-choice diagnostic probes. Use open-ended evidence to update KT state.
|
|
31
|
+
kt_policy:
|
|
32
|
+
type: text
|
|
33
|
+
label: "KT policy"
|
|
34
|
+
value: |
|
|
35
|
+
Maintain an explainable KT DAG. Store evidence records rather than opaque mastery labels. Concepts can have prerequisite, contrast, misconception, analogy, and transfer edges. Move on only when evidence supports it or when the user requests a different path.
|
|
36
|
+
learner_state_reader:
|
|
37
|
+
type: agent
|
|
38
|
+
identity: "Learner State Reader"
|
|
39
|
+
model: inherit
|
|
40
|
+
inputs: [session_context, kt_policy]
|
|
41
|
+
skills: [pi-gnosis]
|
|
42
|
+
tools: [read_file, grep]
|
|
43
|
+
expect:
|
|
44
|
+
relevant_concepts:
|
|
45
|
+
type: list
|
|
46
|
+
items: str
|
|
47
|
+
evidence_found:
|
|
48
|
+
type: list
|
|
49
|
+
items: str
|
|
50
|
+
uncertain_state:
|
|
51
|
+
type: list
|
|
52
|
+
items: str
|
|
53
|
+
recommended_focus: str
|
|
54
|
+
instructions: |
|
|
55
|
+
Read available DAG state and Obsidian notes if paths exist. Summarize only evidence relevant to the current learner message. If no state exists, report empty state. Output only valid JSON matching expect.
|
|
56
|
+
turn_intent_router:
|
|
57
|
+
type: agent
|
|
58
|
+
identity: "Turn Intent Router"
|
|
59
|
+
model: inherit
|
|
60
|
+
inputs: [session_context, learner_state_reader, tutoring_policy]
|
|
61
|
+
skills: [pi-gnosis]
|
|
62
|
+
tools: []
|
|
63
|
+
expect:
|
|
64
|
+
user_intent: str
|
|
65
|
+
should_teach_now: bool
|
|
66
|
+
should_probe_now: bool
|
|
67
|
+
should_offer_modality_choice: bool
|
|
68
|
+
should_pause_or_resume: str
|
|
69
|
+
recommended_graph_after_turn: str
|
|
70
|
+
instructions: |
|
|
71
|
+
Decide what Pi should do next: explain, probe, ask one modality question, resume from notes, export notes, create a Manim lecture, or pause. Do not force a linear curriculum. Output only valid JSON matching expect.
|
|
72
|
+
open_probe_designer:
|
|
73
|
+
type: agent
|
|
74
|
+
identity: "Open Probe Designer"
|
|
75
|
+
model: inherit
|
|
76
|
+
inputs: [learner_state_reader, turn_intent_router, tutoring_policy, kt_policy]
|
|
77
|
+
skills: [pi-gnosis]
|
|
78
|
+
tools: []
|
|
79
|
+
expect:
|
|
80
|
+
probes:
|
|
81
|
+
type: list
|
|
82
|
+
items:
|
|
83
|
+
type: str
|
|
84
|
+
prompt: str
|
|
85
|
+
targeted_concepts:
|
|
86
|
+
type: list
|
|
87
|
+
items: str
|
|
88
|
+
rubric: str
|
|
89
|
+
answer_key_visibility: str
|
|
90
|
+
forbidden_formats_checked: bool
|
|
91
|
+
instructions: |
|
|
92
|
+
If probing is appropriate, write short open-ended prompts only. Allowed types include recall, explain, transfer, contrast, debug, teach-back, source-check, and worked example. Recognition-only formats are forbidden. Output only valid JSON matching expect.
|
|
93
|
+
teaching_move_planner:
|
|
94
|
+
type: agent
|
|
95
|
+
identity: "Teaching Move Planner"
|
|
96
|
+
model: inherit
|
|
97
|
+
inputs: [learner_state_reader, turn_intent_router, open_probe_designer, tutoring_policy]
|
|
98
|
+
skills: [pi-gnosis]
|
|
99
|
+
tools: []
|
|
100
|
+
expect:
|
|
101
|
+
next_pi_message: str
|
|
102
|
+
explanation_strategy: str
|
|
103
|
+
scaffold_level: str
|
|
104
|
+
what_not_to_reveal_yet:
|
|
105
|
+
type: list
|
|
106
|
+
items: str
|
|
107
|
+
user_exit_paths:
|
|
108
|
+
type: list
|
|
109
|
+
items: str
|
|
110
|
+
instructions: |
|
|
111
|
+
Draft Pi's next conversational move. Keep it natural. If asking a probe, do not include the answer before the learner responds. If explaining, include a concrete example and ask for a short teach-back. Output only valid JSON matching expect.
|
|
112
|
+
state_update_writer:
|
|
113
|
+
type: agent
|
|
114
|
+
identity: "Learner State Update Writer"
|
|
115
|
+
model: inherit
|
|
116
|
+
inputs: [learner_state_reader, turn_intent_router, open_probe_designer, teaching_move_planner, kt_policy]
|
|
117
|
+
skills: [pi-gnosis]
|
|
118
|
+
tools: []
|
|
119
|
+
expect:
|
|
120
|
+
learner_state_patch:
|
|
121
|
+
type: dict
|
|
122
|
+
evidence_to_wait_for:
|
|
123
|
+
type: list
|
|
124
|
+
items: str
|
|
125
|
+
next_review_or_probe_targets:
|
|
126
|
+
type: list
|
|
127
|
+
items: str
|
|
128
|
+
output_manifest: dict
|
|
129
|
+
instructions: |
|
|
130
|
+
Produce a state patch to be saved by Pi if appropriate. Do not claim the learner knows a concept until evidence exists. Include what evidence to wait for after Pi sends the next message. Output only valid JSON matching expect.
|
package/package.json
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "pi-gnosis",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Circuitry-first Pi package for source-grounded research, non-linear tutoring, Obsidian learning memory, and Manim lecture generation.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"private": false,
|
|
8
|
+
"engines": {
|
|
9
|
+
"node": ">=20"
|
|
10
|
+
},
|
|
11
|
+
"keywords": [
|
|
12
|
+
"pi-package",
|
|
13
|
+
"pi",
|
|
14
|
+
"circuitry",
|
|
15
|
+
"agentic-workflow",
|
|
16
|
+
"research",
|
|
17
|
+
"tutoring",
|
|
18
|
+
"knowledge-tracing",
|
|
19
|
+
"obsidian",
|
|
20
|
+
"manim"
|
|
21
|
+
],
|
|
22
|
+
"bin": {
|
|
23
|
+
"pi-gnosis": "./bin/pi-gnosis.js"
|
|
24
|
+
},
|
|
25
|
+
"exports": {
|
|
26
|
+
".": "./src/index.js",
|
|
27
|
+
"./config": "./src/config.js",
|
|
28
|
+
"./graph-template": "./src/graph-template.js",
|
|
29
|
+
"./validator": "./src/graph-validator.js",
|
|
30
|
+
"./scheduler": "./src/review-scheduler.js",
|
|
31
|
+
"./storage-contract": "./src/storage-contract.js",
|
|
32
|
+
"./probe-policy": "./src/probe-policy.js",
|
|
33
|
+
"./cleanup-policy": "./src/cleanup-policy.js",
|
|
34
|
+
"./manim-project": "./src/manim-project.js"
|
|
35
|
+
},
|
|
36
|
+
"files": [
|
|
37
|
+
"bin/",
|
|
38
|
+
"config/",
|
|
39
|
+
"graphs/",
|
|
40
|
+
"skills/",
|
|
41
|
+
"framework/",
|
|
42
|
+
"src/",
|
|
43
|
+
"scripts/",
|
|
44
|
+
"examples/",
|
|
45
|
+
"README.md",
|
|
46
|
+
"pi.json",
|
|
47
|
+
"NOTICE",
|
|
48
|
+
"CHANGELOG.md"
|
|
49
|
+
],
|
|
50
|
+
"scripts": {
|
|
51
|
+
"test": "node test/run-tests.js && python3 scripts/check-circuitry-v02.py graphs/*.circuitry.yaml && npm pack --dry-run > /tmp/pi-gnosis-pack.txt",
|
|
52
|
+
"test:node": "node test/run-tests.js",
|
|
53
|
+
"test:graphs": "python3 scripts/check-circuitry-v02.py graphs/*.circuitry.yaml",
|
|
54
|
+
"validate:graphs": "python3 scripts/check-circuitry-v02.py graphs/*.circuitry.yaml",
|
|
55
|
+
"list:graphs": "node bin/pi-gnosis.js graphs"
|
|
56
|
+
},
|
|
57
|
+
"dependencies": {
|
|
58
|
+
"@darkhorseprojects/pi-circuitry": "github:darkhorseprojects/pi-circuitry#v0.2.6",
|
|
59
|
+
"pi-web-access": "^0.10.7"
|
|
60
|
+
},
|
|
61
|
+
"optionalDependencies": {
|
|
62
|
+
"pi-exa-search": "github:najibninaba/pi-exa-search#main"
|
|
63
|
+
},
|
|
64
|
+
"peerDependencies": {
|
|
65
|
+
"@darkhorseprojects/circuitry-core": ">=0.2.6"
|
|
66
|
+
},
|
|
67
|
+
"peerDependenciesMeta": {
|
|
68
|
+
"@darkhorseprojects/circuitry-core": {
|
|
69
|
+
"optional": true
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"pi": {
|
|
73
|
+
"skills": [
|
|
74
|
+
"./skills"
|
|
75
|
+
],
|
|
76
|
+
"graphs": [
|
|
77
|
+
"./graphs"
|
|
78
|
+
],
|
|
79
|
+
"config": "./config/gnosis.config.json"
|
|
80
|
+
}
|
|
81
|
+
}
|