@dzhechkov/p-replicator 1.5.8 → 1.5.10
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/README/ru/html/build.js +11 -3
- package/package.json +1 -1
- package/src/commands/remove.js +16 -2
- package/src/commands/update.js +7 -0
- package/templates/.claude/skills/brutal-honesty-review/scripts/assess-tests.sh +2 -2
- package/templates/.claude/skills/cc-toolkit-generator-enhanced/SKILL.md +1 -1
- package/templates/.claude/skills/cc-toolkit-generator-enhanced/modules/06-package-deliver.md +1 -1
- package/templates/.claude/skills/goap-research-ed25519/SKILL.md +78 -371
- package/templates/.claude/skills/goap-research-ed25519/references/ed25519-verification.md +58 -624
- package/templates/.claude/skills/goap-research-ed25519/references/research-actions.md +61 -506
- package/templates/.claude/skills/goap-research-ed25519/references/source-evaluation.md +42 -543
- package/templates/.claude/skills/goap-research-ed25519/scripts/ed25519_verifier.py +427 -448
- package/templates/.claude/skills/goap-research-ed25519/scripts/goap_planner.py +4 -4
- package/templates/.claude/skills/goap-research-ed25519/scripts/test_ed25519_verifier.py +112 -0
- package/templates/.claude/skills/knowledge-extractor/SKILL.md +1 -1
- package/templates/.claude/skills/pipeline-forge/SKILL.md +5 -1
- package/templates/.claude/skills/requirements-validator/SKILL.md +2 -2
- package/templates/.claude/skills/reverse-engineering-unicorn/SKILL.md +4 -2
- package/templates/.claude/skills/reverse-engineering-unicorn/modules/01-intelligence.md +15 -29
- package/templates/.claude/skills/reverse-engineering-unicorn/modules/02-product-customers.md +4 -4
- package/templates/.claude/skills/reverse-engineering-unicorn/modules/03-market-competition.md +9 -16
- package/templates/.claude/skills/reverse-engineering-unicorn/modules/04-business-finance.md +4 -3
- package/templates/.claude/skills/reverse-engineering-unicorn/modules/05-growth-engine.md +3 -2
|
@@ -1,544 +1,99 @@
|
|
|
1
|
-
# Research Actions
|
|
1
|
+
# GOAP Research Actions with Ed25519 Provenance
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
These actions describe how to use Ed25519 safely in the GOAP research workflow. Cryptographic verification means provenance and tamper-evidence under pinned keys; it does not establish truthfulness.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## configure_pinned_issuers
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
**Purpose:** Initialize trusted issuer whitelist for verified research
|
|
9
|
-
**Preconditions:** None
|
|
10
|
-
**Effects:** `whitelist_active`, `verification_ready`
|
|
11
|
-
**Cost:** 0
|
|
12
|
-
**Implementation:**
|
|
13
|
-
```python
|
|
14
|
-
# Load default trusted issuers
|
|
15
|
-
verifier = Ed25519Verifier()
|
|
7
|
+
**Purpose:** Configure issuer -> pinned Ed25519 public key mappings.
|
|
16
8
|
|
|
17
|
-
|
|
18
|
-
|
|
9
|
+
**Preconditions:** You have obtained and reviewed the issuer public key out of band.
|
|
10
|
+
|
|
11
|
+
**Effects:** `pinned_issuers_configured`
|
|
19
12
|
|
|
20
|
-
# Set verification threshold
|
|
21
|
-
verifier.verification_threshold = 0.95 # strict mode
|
|
22
|
-
```
|
|
23
|
-
**Success criteria:** Whitelist loaded, verification system initialized
|
|
24
|
-
|
|
25
|
-
### generate_research_keypair
|
|
26
|
-
**Purpose:** Generate Ed25519 keypair for signing research artifacts
|
|
27
|
-
**Preconditions:** None
|
|
28
|
-
**Effects:** `keypair_available`, `signing_ready`
|
|
29
|
-
**Cost:** 1
|
|
30
|
-
**Implementation:**
|
|
31
13
|
```python
|
|
32
|
-
|
|
33
|
-
# Store securely - never commit private key
|
|
14
|
+
verifier.add_trusted_issuer("example.org", "ed25519:base64-public-key", status="active")
|
|
34
15
|
```
|
|
35
|
-
**Success criteria:** Keypair generated and stored securely
|
|
36
16
|
|
|
37
|
-
|
|
17
|
+
Do not add issuers without keys. A domain whitelist alone is not a crypto trust anchor.
|
|
38
18
|
|
|
39
|
-
##
|
|
40
|
-
|
|
41
|
-
### web_search_broad
|
|
42
|
-
**Purpose:** Initial exploration to identify landscape and key subtopics
|
|
43
|
-
**Preconditions:** `topic_defined`
|
|
44
|
-
**Effects:** `candidates_found`, `subtopics_identified`
|
|
45
|
-
**Cost:** 1
|
|
46
|
-
**Verification:** None (discovery phase)
|
|
47
|
-
**Implementation:**
|
|
48
|
-
```
|
|
49
|
-
Query strategy:
|
|
50
|
-
1. Start with core topic terms
|
|
51
|
-
2. Add qualifiers: "overview", "guide", "comprehensive"
|
|
52
|
-
3. Note recurring subtopics in results
|
|
53
|
-
4. Identify authoritative domains appearing frequently
|
|
54
|
-
5. Flag sources from trusted issuers for priority processing
|
|
55
|
-
```
|
|
56
|
-
**Success criteria:** ≥5 relevant results, ≥3 subtopics identified
|
|
57
|
-
|
|
58
|
-
### web_search_verified (NEW)
|
|
59
|
-
**Purpose:** Search with priority to trusted issuer sources
|
|
60
|
-
**Preconditions:** `topic_defined`, `whitelist_active`
|
|
61
|
-
**Effects:** `verified_candidates_found`, `trusted_sources_identified`
|
|
62
|
-
**Cost:** 2
|
|
63
|
-
**Verification:** Domain matching against whitelist
|
|
64
|
-
**Implementation:**
|
|
65
|
-
```
|
|
66
|
-
Query strategy:
|
|
67
|
-
1. Include site: operators for trusted domains
|
|
68
|
-
- site:reuters.com OR site:ap.org OR site:nature.com
|
|
69
|
-
2. Rank results by issuer trust level
|
|
70
|
-
3. Mark trusted vs untrusted sources
|
|
71
|
-
4. Prioritize .gov, .edu domains
|
|
72
|
-
5. Note signature availability if present
|
|
73
|
-
```
|
|
74
|
-
**Success criteria:** ≥3 results from trusted issuers
|
|
75
|
-
|
|
76
|
-
### web_search_specific
|
|
77
|
-
**Purpose:** Targeted search for specific information
|
|
78
|
-
**Preconditions:** `subtopic_identified` OR `specific_question_formed`
|
|
79
|
-
**Effects:** `detail_found`, `sources_identified`
|
|
80
|
-
**Cost:** 1
|
|
81
|
-
**Verification:** None
|
|
82
|
-
**Implementation:**
|
|
83
|
-
```
|
|
84
|
-
Query strategy:
|
|
85
|
-
1. Use exact phrases for specific claims
|
|
86
|
-
2. Include domain qualifiers ("site:gov", "site:edu")
|
|
87
|
-
3. Add date constraints for temporal queries
|
|
88
|
-
4. Use boolean operators for precision
|
|
89
|
-
```
|
|
90
|
-
**Success criteria:** Direct answers or clear source paths found
|
|
91
|
-
|
|
92
|
-
### web_search_expert
|
|
93
|
-
**Purpose:** Find authoritative voices and expert sources
|
|
94
|
-
**Preconditions:** `domain_known`
|
|
95
|
-
**Effects:** `authorities_found`, `expert_opinions_available`
|
|
96
|
-
**Cost:** 2
|
|
97
|
-
**Verification:** Credential verification
|
|
98
|
-
**Implementation:**
|
|
99
|
-
```
|
|
100
|
-
Query patterns:
|
|
101
|
-
- "[topic] expert interview"
|
|
102
|
-
- "[topic] researcher [institution]"
|
|
103
|
-
- "[topic] author [book/paper]"
|
|
104
|
-
- "[domain] professor"
|
|
105
|
-
|
|
106
|
-
Credential verification:
|
|
107
|
-
- Check institutional affiliation
|
|
108
|
-
- Verify publication history
|
|
109
|
-
- Cross-reference expert claims
|
|
110
|
-
```
|
|
111
|
-
**Success criteria:** ≥2 credentialed experts identified
|
|
112
|
-
|
|
113
|
-
---
|
|
114
|
-
|
|
115
|
-
## Content Retrieval Actions
|
|
116
|
-
|
|
117
|
-
### fetch_source
|
|
118
|
-
**Purpose:** Retrieve full content from identified URL
|
|
119
|
-
**Preconditions:** `url_known`, `source_accessible`
|
|
120
|
-
**Effects:** `content_retrieved`, `full_context_available`
|
|
121
|
-
**Cost:** 2
|
|
122
|
-
**Verification:** TLS certificate validation
|
|
123
|
-
**Implementation:**
|
|
124
|
-
- Use web_fetch tool with appropriate URL
|
|
125
|
-
- Verify TLS certificate validity
|
|
126
|
-
- Handle paywalls by noting limitation
|
|
127
|
-
- Extract key sections if full content unavailable
|
|
128
|
-
- Note retrieval timestamp
|
|
129
|
-
- Calculate content hash for integrity
|
|
130
|
-
|
|
131
|
-
### fetch_signed_source (NEW)
|
|
132
|
-
**Purpose:** Retrieve content with Ed25519 signature verification
|
|
133
|
-
**Preconditions:** `url_known`, `issuer_pubkey_available`
|
|
134
|
-
**Effects:** `signed_content_retrieved`, `signature_verified`
|
|
135
|
-
**Cost:** 3
|
|
136
|
-
**Verification:** Ed25519 signature
|
|
137
|
-
**Implementation:**
|
|
138
|
-
```python
|
|
139
|
-
# Fetch content
|
|
140
|
-
content = web_fetch(url)
|
|
19
|
+
## fetch_source
|
|
141
20
|
|
|
142
|
-
|
|
143
|
-
signature = get_signature_from_response(response)
|
|
144
|
-
pubkey = get_issuer_pubkey(issuer_domain)
|
|
21
|
+
**Purpose:** Retrieve source content and record source metadata.
|
|
145
22
|
|
|
146
|
-
|
|
147
|
-
verified = verifier.verify_signature(content, signature, pubkey)
|
|
23
|
+
**Effects:** `content_retrieved`, `source_url_recorded`, `source_hash_calculated`
|
|
148
24
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
result.confidence = 0.95
|
|
152
|
-
else:
|
|
153
|
-
result.effects.add("signature_invalid")
|
|
154
|
-
result.confidence = 0.5 # Proceed with caution
|
|
25
|
+
```python
|
|
26
|
+
source_hash = sha256(content)
|
|
155
27
|
```
|
|
156
|
-
**Success criteria:** Content retrieved, signature verified (if available)
|
|
157
28
|
|
|
158
|
-
|
|
29
|
+
The source hash is included in the canonical signed message.
|
|
159
30
|
|
|
160
|
-
##
|
|
31
|
+
## sign_extracted_facts
|
|
161
32
|
|
|
162
|
-
|
|
163
|
-
**Purpose:** Systematically extract verifiable claims
|
|
164
|
-
**Preconditions:** `content_retrieved`
|
|
165
|
-
**Effects:** `facts_cataloged`, `claims_identified`
|
|
166
|
-
**Cost:** 1
|
|
167
|
-
**Verification:** None (raw extraction)
|
|
168
|
-
**Implementation:**
|
|
169
|
-
```
|
|
170
|
-
Extraction protocol:
|
|
171
|
-
1. Identify all factual claims (dates, numbers, names, events)
|
|
172
|
-
2. Note source attribution for each fact
|
|
173
|
-
3. Flag claims needing verification
|
|
174
|
-
4. Record exact quotes with page/section reference
|
|
175
|
-
5. Distinguish facts from opinions/interpretations
|
|
176
|
-
6. Mark each fact with source_hash for integrity
|
|
177
|
-
```
|
|
33
|
+
**Purpose:** Attach researcher self-attestation to extracted facts.
|
|
178
34
|
|
|
179
|
-
### sign_extracted_facts (NEW)
|
|
180
|
-
**Purpose:** Cryptographically sign extracted facts
|
|
181
|
-
**Preconditions:** `facts_cataloged`, `keypair_available`
|
|
182
35
|
**Effects:** `signed_facts`, `researcher_signature_attached`
|
|
183
|
-
**Cost:** 2
|
|
184
|
-
**Verification:** Self-signature
|
|
185
|
-
**Implementation:**
|
|
186
|
-
```python
|
|
187
|
-
signed_facts = []
|
|
188
|
-
for fact in extracted_facts:
|
|
189
|
-
signed_fact = verifier.create_signed_fact(
|
|
190
|
-
claim=fact.claim,
|
|
191
|
-
source_url=fact.source_url,
|
|
192
|
-
source_content=fact.source_content,
|
|
193
|
-
issuer=researcher_identity
|
|
194
|
-
)
|
|
195
|
-
signed_facts.append(signed_fact)
|
|
196
|
-
```
|
|
197
|
-
**Output:** List of SignedFact objects with Ed25519 signatures
|
|
198
36
|
|
|
199
|
-
|
|
37
|
+
Self-attestation proves the research record was not altered after signing. It does not prove the source signed the claim and is capped below issuer-trusted confidence.
|
|
200
38
|
|
|
201
|
-
##
|
|
39
|
+
## verify_claim_cryptographic
|
|
202
40
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
**Preconditions:** `claim_identified`, `
|
|
206
|
-
|
|
207
|
-
**
|
|
208
|
-
**Verification:** Cross-reference (traditional)
|
|
209
|
-
**Implementation:**
|
|
210
|
-
```
|
|
211
|
-
Verification protocol:
|
|
212
|
-
1. Locate original/primary source
|
|
213
|
-
2. Cross-check with ≥2 independent sources
|
|
214
|
-
3. Check for retractions/corrections
|
|
215
|
-
4. Verify quoted individuals confirm quotes
|
|
216
|
-
5. For statistics: verify methodology, sample, timeframe
|
|
217
|
-
```
|
|
218
|
-
**Output:** Confidence rating (verified/likely/uncertain/unlikely/refuted)
|
|
219
|
-
|
|
220
|
-
### verify_claim_cryptographic (NEW)
|
|
221
|
-
**Purpose:** Verify claim with cryptographic proof
|
|
222
|
-
**Preconditions:** `claim_identified`, `signature_available`, `issuer_pubkey_known`
|
|
223
|
-
**Effects:** `cryptographically_verified` OR `signature_invalid`
|
|
224
|
-
**Cost:** 4
|
|
225
|
-
**Verification:** Ed25519 signature verification
|
|
226
|
-
**Implementation:**
|
|
227
|
-
```python
|
|
228
|
-
def verify_claim_cryptographic(fact: SignedFact) -> VerificationResult:
|
|
229
|
-
# Verify signature
|
|
230
|
-
result = verifier.verify_fact(fact)
|
|
231
|
-
|
|
232
|
-
if result.verified:
|
|
233
|
-
# Check if issuer is trusted
|
|
234
|
-
if verifier.is_trusted_issuer(fact.issuer):
|
|
235
|
-
result.confidence = 0.95
|
|
236
|
-
else:
|
|
237
|
-
result.confidence = 0.80
|
|
238
|
-
else:
|
|
239
|
-
result.confidence = 0.0
|
|
240
|
-
result.error = "Cryptographic verification failed"
|
|
241
|
-
|
|
242
|
-
# Log to verification ledger
|
|
243
|
-
verifier.verification_ledger.append(result)
|
|
244
|
-
|
|
245
|
-
return result
|
|
246
|
-
```
|
|
247
|
-
**Output:** VerificationResult with confidence score
|
|
248
|
-
|
|
249
|
-
### cross_reference
|
|
250
|
-
**Purpose:** Check consistency across multiple sources
|
|
251
|
-
**Preconditions:** `multiple_sources` (≥3)
|
|
252
|
-
**Effects:** `consistency_checked`, `contradictions_identified`
|
|
253
|
-
**Cost:** 2
|
|
254
|
-
**Verification:** None
|
|
255
|
-
**Implementation:**
|
|
256
|
-
```
|
|
257
|
-
Cross-reference matrix:
|
|
258
|
-
1. List key claims from each source
|
|
259
|
-
2. Mark agreement/disagreement for each claim
|
|
260
|
-
3. Note source reliability weighting
|
|
261
|
-
4. Identify majority consensus
|
|
262
|
-
5. Flag significant contradictions for resolution
|
|
263
|
-
```
|
|
41
|
+
**Purpose:** Verify issuer-signed facts against pinned active issuer keys.
|
|
42
|
+
|
|
43
|
+
**Preconditions:** `claim_identified`, `signature_available`, `pinned_issuer_key_available`
|
|
44
|
+
|
|
45
|
+
**Effects:** `cryptographic_provenance_verified` or `signature_rejected`
|
|
264
46
|
|
|
265
|
-
### cross_reference_signed (NEW)
|
|
266
|
-
**Purpose:** Cross-reference with signed source verification
|
|
267
|
-
**Preconditions:** `multiple_signed_sources` (≥3)
|
|
268
|
-
**Effects:** `signed_consistency_checked`, `multi_source_verified`
|
|
269
|
-
**Cost:** 3
|
|
270
|
-
**Verification:** Multi-signature verification
|
|
271
|
-
**Implementation:**
|
|
272
47
|
```python
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
if result.verified:
|
|
279
|
-
verified_facts.append(fact)
|
|
280
|
-
|
|
281
|
-
if len(verified_facts) >= 3:
|
|
282
|
-
# Check claim consistency
|
|
283
|
-
claims = [f.claim for f in verified_facts]
|
|
284
|
-
consistent = check_semantic_consistency(claims)
|
|
285
|
-
|
|
286
|
-
if consistent:
|
|
287
|
-
return CrossReferenceResult(
|
|
288
|
-
verified=True,
|
|
289
|
-
confidence=min(f.confidence for f in verified_facts) * 1.1,
|
|
290
|
-
sources_count=len(verified_facts)
|
|
291
|
-
)
|
|
292
|
-
|
|
293
|
-
return CrossReferenceResult(verified=False, confidence=0.0)
|
|
48
|
+
result = verifier.verify_fact(fact)
|
|
49
|
+
if result.verified and result.trust_class == "ISSUER_SIGNED":
|
|
50
|
+
accept_for_crypto_provenance(result)
|
|
51
|
+
else:
|
|
52
|
+
reject_or_label_unverified(result.error)
|
|
294
53
|
```
|
|
295
54
|
|
|
296
|
-
|
|
297
|
-
**Purpose:** Trace claim to original source
|
|
298
|
-
**Preconditions:** `secondary_source_cites_claim`
|
|
299
|
-
**Effects:** `primary_located` OR `primary_unavailable`
|
|
300
|
-
**Cost:** 3
|
|
301
|
-
**Verification:** None (discovery)
|
|
302
|
-
**Implementation:**
|
|
303
|
-
```
|
|
304
|
-
Tracing protocol:
|
|
305
|
-
1. Check footnotes/bibliography of secondary source
|
|
306
|
-
2. Search for original publication
|
|
307
|
-
3. For statistics: find original study/dataset
|
|
308
|
-
4. For quotes: find original interview/speech
|
|
309
|
-
5. For events: find contemporaneous reporting
|
|
310
|
-
```
|
|
55
|
+
Unknown issuer, missing pin, revoked key, embedded-key mismatch, malformed key, or invalid signature reject with confidence `0.0`.
|
|
311
56
|
|
|
312
|
-
|
|
57
|
+
## build_citation_chain
|
|
313
58
|
|
|
314
|
-
|
|
59
|
+
**Purpose:** Link signed facts with actual parent content hashes.
|
|
315
60
|
|
|
316
|
-
### build_citation_chain
|
|
317
|
-
**Purpose:** Construct linked chain of cited facts
|
|
318
|
-
**Preconditions:** `facts_cataloged`
|
|
319
61
|
**Effects:** `citation_chain_complete`
|
|
320
|
-
**Cost:** 2
|
|
321
|
-
**Verification:** Chain hash integrity
|
|
322
|
-
**Implementation:**
|
|
323
|
-
```python
|
|
324
|
-
def build_citation_chain(facts: List[SignedFact], chain_id: str) -> CitationChain:
|
|
325
|
-
chain = CitationChain(chain_id=chain_id)
|
|
326
|
-
|
|
327
|
-
for fact in facts:
|
|
328
|
-
chain.add_fact(fact) # Auto-sets parent_citation
|
|
329
|
-
|
|
330
|
-
# Calculate chain hash
|
|
331
|
-
chain_hash = chain.get_chain_hash()
|
|
332
|
-
|
|
333
|
-
return chain
|
|
334
|
-
```
|
|
335
62
|
|
|
336
|
-
### verify_citation_chain
|
|
337
|
-
**Purpose:** Verify entire citation chain integrity
|
|
338
|
-
**Preconditions:** `citation_chain_complete`
|
|
339
|
-
**Effects:** `chain_verified` OR `chain_broken`
|
|
340
|
-
**Cost:** 3
|
|
341
|
-
**Verification:** Full Ed25519 chain verification
|
|
342
|
-
**Implementation:**
|
|
343
63
|
```python
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
if all_verified and aggregate_confidence >= verifier.verification_threshold:
|
|
348
|
-
return True, aggregate_confidence
|
|
349
|
-
|
|
350
|
-
# Identify break point
|
|
351
|
-
for i, fact in enumerate(chain.facts):
|
|
352
|
-
result = verifier.verify_fact(fact)
|
|
353
|
-
if not result.verified:
|
|
354
|
-
return False, 0.0, f"Chain broken at fact {i}: {result.error}"
|
|
355
|
-
|
|
356
|
-
return all_verified, aggregate_confidence
|
|
64
|
+
chain.add_fact(parent_fact)
|
|
65
|
+
chain.add_fact(child_fact) # child.parent_hash = sha256(canonical_message(parent_fact))
|
|
66
|
+
chain_signature = verifier.sign_chain(chain)
|
|
357
67
|
```
|
|
358
68
|
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
## Analysis Actions
|
|
362
|
-
|
|
363
|
-
### identify_patterns
|
|
364
|
-
**Purpose:** Discover recurring themes and connections
|
|
365
|
-
**Preconditions:** `facts_cataloged` (≥10 facts)
|
|
366
|
-
**Effects:** `patterns_identified`, `themes_emerged`
|
|
367
|
-
**Cost:** 2
|
|
368
|
-
**Verification:** None
|
|
369
|
-
**Implementation:**
|
|
370
|
-
- Group related facts
|
|
371
|
-
- Identify temporal patterns
|
|
372
|
-
- Note causal relationships
|
|
373
|
-
- Map entity connections
|
|
374
|
-
|
|
375
|
-
### timeline_construction
|
|
376
|
-
**Purpose:** Establish chronological sequence
|
|
377
|
-
**Preconditions:** `events_found` (≥3 dated events)
|
|
378
|
-
**Effects:** `chronology_established`, `sequence_clear`
|
|
379
|
-
**Cost:** 2
|
|
380
|
-
**Verification:** None
|
|
381
|
-
**Implementation:**
|
|
382
|
-
- Order events by date
|
|
383
|
-
- Identify causation vs correlation
|
|
384
|
-
- Note gaps in timeline
|
|
385
|
-
- Mark uncertain dates
|
|
386
|
-
|
|
387
|
-
### compare_perspectives
|
|
388
|
-
**Purpose:** Document different viewpoints
|
|
389
|
-
**Preconditions:** `multiple_perspectives_found`
|
|
390
|
-
**Effects:** `viewpoints_mapped`, `disagreements_clarified`
|
|
391
|
-
**Cost:** 2
|
|
392
|
-
**Verification:** None
|
|
393
|
-
**Implementation:**
|
|
394
|
-
- Identify distinct positions
|
|
395
|
-
- Note supporting evidence for each
|
|
396
|
-
- Identify source biases
|
|
397
|
-
- Map areas of consensus vs disagreement
|
|
398
|
-
|
|
399
|
-
---
|
|
400
|
-
|
|
401
|
-
## Synthesis Actions
|
|
402
|
-
|
|
403
|
-
### synthesize_findings
|
|
404
|
-
**Purpose:** Integrate research into coherent conclusions
|
|
405
|
-
**Preconditions:** `facts_verified` (sufficient coverage), `patterns_identified`
|
|
406
|
-
**Effects:** `conclusions_formed`, `confidence_assigned`
|
|
407
|
-
**Cost:** 3
|
|
408
|
-
**Verification:** None (synthesis)
|
|
409
|
-
**Implementation:**
|
|
410
|
-
```
|
|
411
|
-
Synthesis protocol:
|
|
412
|
-
1. Review all verified facts
|
|
413
|
-
2. Weight by source reliability AND signature status
|
|
414
|
-
3. Address contradictions
|
|
415
|
-
4. Form conclusions supported by evidence
|
|
416
|
-
5. Assign confidence levels (higher for signed sources)
|
|
417
|
-
6. Note remaining uncertainties
|
|
418
|
-
7. Ensure 100% citation coverage
|
|
419
|
-
```
|
|
69
|
+
## verify_citation_chain
|
|
420
70
|
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
**
|
|
424
|
-
**Effects:** `report_delivered`
|
|
425
|
-
**Cost:** 2
|
|
426
|
-
**Verification:** None
|
|
427
|
-
**Implementation:**
|
|
428
|
-
- Follow standard report structure
|
|
429
|
-
- Include methodology section
|
|
430
|
-
- Cite all sources
|
|
431
|
-
- Present confidence assessments
|
|
432
|
-
- Document research path
|
|
433
|
-
|
|
434
|
-
### generate_signed_report (NEW)
|
|
435
|
-
**Purpose:** Produce cryptographically signed research report
|
|
436
|
-
**Preconditions:** `conclusions_formed`, `keypair_available`
|
|
437
|
-
**Effects:** `signed_report_delivered`, `verification_ledger_attached`
|
|
438
|
-
**Cost:** 3
|
|
439
|
-
**Verification:** Report signature
|
|
440
|
-
**Implementation:**
|
|
441
|
-
```python
|
|
442
|
-
def generate_signed_report(
|
|
443
|
-
findings: ResearchFindings,
|
|
444
|
-
keypair: Keypair
|
|
445
|
-
) -> SignedReport:
|
|
446
|
-
# Generate report content
|
|
447
|
-
report = format_report(findings)
|
|
448
|
-
|
|
449
|
-
# Sign report
|
|
450
|
-
signature, report_hash = verifier.sign_content(report)
|
|
451
|
-
|
|
452
|
-
# Sign verification ledger
|
|
453
|
-
ledger_sig = verifier.sign_ledger()
|
|
454
|
-
|
|
455
|
-
return SignedReport(
|
|
456
|
-
content=report,
|
|
457
|
-
signature=signature,
|
|
458
|
-
content_hash=report_hash,
|
|
459
|
-
verification_ledger=verifier.get_verification_ledger(),
|
|
460
|
-
ledger_signature=ledger_sig,
|
|
461
|
-
timestamp=datetime.utcnow().isoformat()
|
|
462
|
-
)
|
|
463
|
-
```
|
|
71
|
+
**Purpose:** Verify per-fact signatures, parent hashes, and the chain signature over ordered fact hashes.
|
|
72
|
+
|
|
73
|
+
**Effects:** `chain_verified` or `chain_broken`
|
|
464
74
|
|
|
465
|
-
---
|
|
466
|
-
|
|
467
|
-
## Recovery Actions
|
|
468
|
-
|
|
469
|
-
### expand_search
|
|
470
|
-
**Purpose:** Broaden search when stuck
|
|
471
|
-
**Preconditions:** `dead_end_reached`
|
|
472
|
-
**Effects:** `new_candidates_found` OR `topic_exhausted`
|
|
473
|
-
**Cost:** 1
|
|
474
|
-
**Verification:** None
|
|
475
|
-
**Implementation:**
|
|
476
|
-
- Use synonym expansion
|
|
477
|
-
- Try related topics
|
|
478
|
-
- Search in different languages
|
|
479
|
-
- Check academic databases
|
|
480
|
-
- Explore adjacent domains
|
|
481
|
-
- **Try non-trusted sources with caution**
|
|
482
|
-
|
|
483
|
-
### pivot_approach
|
|
484
|
-
**Purpose:** Change research strategy
|
|
485
|
-
**Preconditions:** `current_approach_ineffective`
|
|
486
|
-
**Effects:** `new_approach_active`
|
|
487
|
-
**Cost:** 1
|
|
488
|
-
**Verification:** None
|
|
489
|
-
**Implementation:**
|
|
490
|
-
- Document why current approach failed
|
|
491
|
-
- Identify alternative information paths
|
|
492
|
-
- **Consider relaxing verification threshold temporarily**
|
|
493
|
-
- Update research plan
|
|
494
|
-
- Resume with new strategy
|
|
495
|
-
|
|
496
|
-
### recover_from_verification_failure (NEW)
|
|
497
|
-
**Purpose:** Handle failed signature verification
|
|
498
|
-
**Preconditions:** `signature_invalid`
|
|
499
|
-
**Effects:** `alternative_source_found` OR `unverified_but_documented`
|
|
500
|
-
**Cost:** 2
|
|
501
|
-
**Verification:** None
|
|
502
|
-
**Implementation:**
|
|
503
75
|
```python
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
for alt in alternatives:
|
|
509
|
-
if verifier.verify_fact(alt).verified:
|
|
510
|
-
return RecoveryResult(
|
|
511
|
-
success=True,
|
|
512
|
-
alternative_fact=alt
|
|
513
|
-
)
|
|
514
|
-
|
|
515
|
-
# Document as unverified with lower confidence
|
|
516
|
-
return RecoveryResult(
|
|
517
|
-
success=False,
|
|
518
|
-
original_fact=fact,
|
|
519
|
-
confidence=0.5,
|
|
520
|
-
warning="Claim could not be cryptographically verified"
|
|
521
|
-
)
|
|
76
|
+
all_verified, aggregate_confidence, error = verifier.verify_citation_chain(
|
|
77
|
+
chain,
|
|
78
|
+
chain_signer_pubkey_b64,
|
|
79
|
+
)
|
|
522
80
|
```
|
|
523
81
|
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
##
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
| verify_citation_chain | 2 | +1 | 3 |
|
|
543
|
-
| generate_report | 2 | 0 | 2 |
|
|
544
|
-
| generate_signed_report | 2 | +1 | 3 |
|
|
82
|
+
Reordered, substituted, edited, relabeled, or moved facts fail chain verification.
|
|
83
|
+
|
|
84
|
+
## recover_from_signature_failure
|
|
85
|
+
|
|
86
|
+
**Purpose:** Continue research after a failed crypto check without pretending the claim is cryptographically verified.
|
|
87
|
+
|
|
88
|
+
**Effects:** `alternative_source_found` or `unverified_but_documented`
|
|
89
|
+
|
|
90
|
+
Rules:
|
|
91
|
+
|
|
92
|
+
- Invalid signatures are rejected, not downgraded to `0.5`.
|
|
93
|
+
- Search for another source or another pinned issuer signature.
|
|
94
|
+
- If no valid signature exists and the mode allows it, label the claim unsigned/unverified and use ordinary source evaluation.
|
|
95
|
+
- In strict/paranoid mode, do not complete the plan with unsigned or invalid claims.
|
|
96
|
+
|
|
97
|
+
## Action Cost Notes
|
|
98
|
+
|
|
99
|
+
Verification adds cost because key pinning, signature checks, and chain checks take time. That cost never substitutes for trust. Trust comes only from the verified trust class and source evaluation.
|