@dzhechkov/p-replicator 1.5.8 → 1.5.12

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 (27) hide show
  1. package/README/ru/html/build.js +11 -3
  2. package/package.json +1 -1
  3. package/src/commands/remove.js +16 -2
  4. package/src/commands/update.js +7 -0
  5. package/templates/.claude/skills/brutal-honesty-review/SKILL.md +18 -1
  6. package/templates/.claude/skills/brutal-honesty-review/evals/brutal-honesty-review.yaml +61 -0
  7. package/templates/.claude/skills/brutal-honesty-review/schemas/output.json +291 -0
  8. package/templates/.claude/skills/brutal-honesty-review/scripts/assess-tests.sh +2 -2
  9. package/templates/.claude/skills/brutal-honesty-review/scripts/validate-config.json +34 -0
  10. package/templates/.claude/skills/cc-toolkit-generator-enhanced/SKILL.md +1 -1
  11. package/templates/.claude/skills/cc-toolkit-generator-enhanced/modules/06-package-deliver.md +1 -1
  12. package/templates/.claude/skills/goap-research-ed25519/SKILL.md +78 -371
  13. package/templates/.claude/skills/goap-research-ed25519/references/ed25519-verification.md +58 -624
  14. package/templates/.claude/skills/goap-research-ed25519/references/research-actions.md +61 -506
  15. package/templates/.claude/skills/goap-research-ed25519/references/source-evaluation.md +42 -543
  16. package/templates/.claude/skills/goap-research-ed25519/scripts/ed25519_verifier.py +427 -448
  17. package/templates/.claude/skills/goap-research-ed25519/scripts/goap_planner.py +4 -4
  18. package/templates/.claude/skills/goap-research-ed25519/scripts/test_ed25519_verifier.py +112 -0
  19. package/templates/.claude/skills/knowledge-extractor/SKILL.md +1 -1
  20. package/templates/.claude/skills/pipeline-forge/SKILL.md +5 -1
  21. package/templates/.claude/skills/requirements-validator/SKILL.md +2 -2
  22. package/templates/.claude/skills/reverse-engineering-unicorn/SKILL.md +4 -2
  23. package/templates/.claude/skills/reverse-engineering-unicorn/modules/01-intelligence.md +15 -29
  24. package/templates/.claude/skills/reverse-engineering-unicorn/modules/02-product-customers.md +4 -4
  25. package/templates/.claude/skills/reverse-engineering-unicorn/modules/03-market-competition.md +9 -16
  26. package/templates/.claude/skills/reverse-engineering-unicorn/modules/04-business-finance.md +4 -3
  27. package/templates/.claude/skills/reverse-engineering-unicorn/modules/05-growth-engine.md +3 -2
@@ -3,7 +3,7 @@
3
3
  GOAP Research Planner with Ed25519 Verification
4
4
 
5
5
  Enhanced Goal-Oriented Action Planning for research tasks with
6
- cryptographic verification support for anti-hallucination protection.
6
+ cryptographic provenance and tamper-evidence support.
7
7
 
8
8
  Features:
9
9
  - A* search for optimal research paths
@@ -383,8 +383,8 @@ def find_research_plan(
383
383
  if goal_state.issubset(current_state):
384
384
  # Check if verification requirements are met
385
385
  if require_verification and current.unsigned_claims > 0:
386
- # In strict/paranoid mode, penalize but don't reject
387
- pass
386
+ # In strict/paranoid mode, unsigned or invalid claims are rejected.
387
+ continue
388
388
 
389
389
  # Reconstruct state progression
390
390
  states = [initial_state]
@@ -396,7 +396,7 @@ def find_research_plan(
396
396
 
397
397
  # Calculate confidence based on verification
398
398
  base_confidence = 1.0 - (current.unsigned_claims * 0.1)
399
- estimated_confidence = max(0.5, min(1.0, base_confidence))
399
+ estimated_confidence = min(1.0, base_confidence)
400
400
 
401
401
  return ResearchPlan(
402
402
  actions=current.actions,
@@ -0,0 +1,112 @@
1
+ #!/usr/bin/env python3
2
+ """Load-bearing security tests for ed25519_verifier.py."""
3
+
4
+ import copy
5
+ import unittest
6
+
7
+ import ed25519_verifier as ev
8
+
9
+
10
+ @unittest.skipIf(ev.CRYPTO_BACKEND is None, "No Ed25519 backend installed")
11
+ class Ed25519VerifierSecurityTests(unittest.TestCase):
12
+ def make_pinned_pair(self):
13
+ signer = ev.Ed25519Verifier(auto_generate_keypair=True)
14
+ verifier = ev.Ed25519Verifier(
15
+ trusted_issuers={
16
+ "nature.com": {
17
+ "pubkey_b64": signer.get_public_key_b64(),
18
+ "status": "active",
19
+ }
20
+ }
21
+ )
22
+ return signer, verifier
23
+
24
+ def test_attacker_self_signed_trusted_string_rejected(self):
25
+ _, verifier = self.make_pinned_pair()
26
+ attacker = ev.Ed25519Verifier(auto_generate_keypair=True)
27
+
28
+ fact = attacker.create_issuer_signed_fact(
29
+ claim="Fabricated result was published",
30
+ source_url="https://nature.com/articles/example",
31
+ source_content="attacker-controlled content",
32
+ issuer="nature.com",
33
+ )
34
+
35
+ result = verifier.verify_fact(fact)
36
+
37
+ self.assertFalse(result.verified)
38
+ self.assertEqual(result.confidence, 0.0)
39
+ self.assertNotEqual(result.confidence, 0.95)
40
+
41
+ def test_fact_signed_by_pinned_trusted_key_verifies(self):
42
+ signer, verifier = self.make_pinned_pair()
43
+
44
+ fact = signer.create_issuer_signed_fact(
45
+ claim="Pinned-key fact",
46
+ source_url="https://nature.com/articles/example",
47
+ source_content="source content",
48
+ issuer="nature.com",
49
+ )
50
+
51
+ result = verifier.verify_fact(fact)
52
+
53
+ self.assertTrue(result.verified)
54
+ self.assertEqual(result.trust_class, ev.TRUST_CLASS_ISSUER_SIGNED)
55
+ self.assertEqual(result.confidence, 0.95)
56
+
57
+ def test_relabelled_or_moved_fact_fails(self):
58
+ signer, verifier = self.make_pinned_pair()
59
+ fact = signer.create_issuer_signed_fact(
60
+ claim="Pinned-key fact",
61
+ source_url="https://nature.com/articles/example",
62
+ source_content="source content",
63
+ issuer="nature.com",
64
+ )
65
+
66
+ relabelled = copy.deepcopy(fact)
67
+ relabelled.issuer = "science.org"
68
+ relabelled_result = verifier.verify_fact(relabelled)
69
+
70
+ moved = copy.deepcopy(fact)
71
+ moved.source_url = "https://nature.com/articles/other"
72
+ moved_result = verifier.verify_fact(moved)
73
+
74
+ self.assertFalse(relabelled_result.verified)
75
+ self.assertEqual(relabelled_result.confidence, 0.0)
76
+ self.assertFalse(moved_result.verified)
77
+ self.assertEqual(moved_result.confidence, 0.0)
78
+
79
+ def test_reordered_citation_chain_fails(self):
80
+ signer, verifier = self.make_pinned_pair()
81
+ chain = ev.CitationChain(chain_id="test-chain")
82
+
83
+ for index in range(3):
84
+ chain.add_fact(
85
+ signer.create_issuer_signed_fact(
86
+ claim=f"Claim {index}",
87
+ source_url=f"https://nature.com/articles/{index}",
88
+ source_content=f"source content {index}",
89
+ issuer="nature.com",
90
+ )
91
+ )
92
+
93
+ signer.sign_chain(chain)
94
+ ok, _, error = verifier.verify_citation_chain(chain, signer.get_public_key_b64())
95
+ self.assertTrue(ok, error)
96
+
97
+ reordered = ev.CitationChain(
98
+ chain_id=chain.chain_id,
99
+ facts=[chain.facts[1], chain.facts[0], chain.facts[2]],
100
+ chain_signature=chain.chain_signature,
101
+ )
102
+ reordered_ok, _, reordered_error = verifier.verify_citation_chain(
103
+ reordered,
104
+ signer.get_public_key_b64(),
105
+ )
106
+
107
+ self.assertFalse(reordered_ok)
108
+ self.assertIn("Invalid", reordered_error)
109
+
110
+
111
+ if __name__ == "__main__":
112
+ unittest.main()
@@ -4,7 +4,7 @@ description: >
4
4
  Systematic knowledge extraction from completed projects into reusable toolkit artifacts.
5
5
  Converts project-specific code, patterns, and lessons into decontextualized, versioned,
6
6
  composable artifacts (skills, commands, hooks, rules, templates, patterns, snippets).
7
- Supports two extraction modes: continuous markers during work and dedicated harvest sessions.
7
+ Supports continuous-marker capture during work plus dedicated harvest sessions — 4 operating modes (MARKER / QUICK / FULL / AUDIT).
8
8
  Uses swarm agents for parallel extraction across artifact categories. Domain-agnostic —
9
9
  works with any tech stack, language, or project type.
10
10
  Triggers: "harvest", "extract knowledge", "toolkit harvest", "извлечь знания",
@@ -424,7 +424,11 @@ When building pipelines as distributable plugins:
424
424
  **Install Pattern:**
425
425
  ```bash
426
426
  # Remote install via curl
427
- curl -sL https://raw.githubusercontent.com/[org]/[repo]/main/install.sh | bash
427
+ # Do NOT pipe a remote script straight into a shell (curl | bash) — you run unreviewed code.
428
+ # Download, INSPECT, then execute:
429
+ curl -fsSL https://raw.githubusercontent.com/[org]/[repo]/main/install.sh -o install.sh
430
+ less install.sh # review it
431
+ bash install.sh
428
432
 
429
433
  # What install.sh does:
430
434
  # 1. Clone repo to temp directory
@@ -103,7 +103,7 @@ Always flag these terms and suggest specific replacements:
103
103
  - Add AC: "Given X, when Y, then Z within 200ms"
104
104
  ```
105
105
 
106
- ### Security Acceptance Criteria (10% bonus weight)
106
+ ### Security Acceptance Criteria (scoring: +5 present / -10 missing, see Scoring Bonus below)
107
107
 
108
108
  When requirements involve authentication, data storage, external APIs, or multi-tenancy,
109
109
  apply additional security validation:
@@ -133,7 +133,7 @@ For each requirement, generate scenarios covering:
133
133
  1. **Happy path** (1-2 scenarios) — Primary success flow
134
134
  2. **Error handling** (2-3 scenarios) — Validation, network, server errors
135
135
  3. **Edge cases** (1-2 scenarios) — Boundaries, concurrent access
136
- 4. **Security** (1-3 scenarios) — Auth bypass, injection, cross-tenant, rate limiting
136
+ 4. **Security** (generate ALL applicable from the mandatory Security BDD list above) — Auth bypass, injection, cross-tenant, rate limiting
137
137
 
138
138
  See `references/bdd-patterns.md` for Gherkin templates and examples.
139
139
 
@@ -61,7 +61,7 @@ SKILL.md (this file — orchestrator)
61
61
  |------|----------|----------|------------|------|
62
62
  | 🟢 QUICK | Static queries | Templates only | Manual X/5 | ~70 min |
63
63
  | 🔵 DEEP | GOAP A*+OODA | +GT, TRIZ, 2nd-Order, CJM proto, BS-check | Formula | ~140 min |
64
- | 🟣 VERIFIED | GOAP+Ed25519 | +Crypto signatures, audit trail | +Trusted issuers | ~170 min |
64
+ | 🟣 VERIFIED | GOAP+Ed25519 | +Provenance signatures, audit trail | Pinned issuer keys where available | ~170 min |
65
65
 
66
66
  ## Pipeline
67
67
 
@@ -174,7 +174,7 @@ After CHECKPOINT 6:
174
174
  | `перерисуй [screen]` | Change one screen |
175
175
  | `без overlay` | Clean prototype for showing clients |
176
176
 
177
- ## Anti-Hallucination Rules (ALL modes)
177
+ ## Evidence Rules (ALL modes)
178
178
 
179
179
  1. **Search First** — never answer from memory for facts
180
180
  2. **Source Attribution** — every fact → URL
@@ -182,6 +182,8 @@ After CHECKPOINT 6:
182
182
  4. **Hypotheses marked** — `[H]` tag on unverified claims
183
183
  5. **Confidence Score** — end of every module
184
184
 
185
+ In VERIFIED mode, Ed25519 proves cryptographic provenance and tamper-evidence only when a signature verifies against an active pinned issuer key. It does not prove business facts, market sizes, reviews, or financial numbers are true.
186
+
185
187
  ## Module → Skill Mapping
186
188
 
187
189
  ```
@@ -113,8 +113,10 @@ confidence = base_reliability × recency_factor
113
113
  > 1. `view(/mnt/skills/user/goap-research-ed25519/SKILL.md)`
114
114
  > 2. Установи зависимости:
115
115
  > ```bash
116
- > pip install cryptography --break-system-packages
116
+ > python3 -m venv .venv
117
+ > .venv/bin/pip install cryptography
117
118
  > ```
119
+ > `--break-system-packages` допустим только как last-resort локальный workaround, если понятен риск изменения system Python.
118
120
  > 3. Запусти инициализацию:
119
121
  > ```python
120
122
  > # Скопируй и запусти скрипт из:
@@ -124,47 +126,31 @@ confidence = base_reliability × recency_factor
124
126
 
125
127
  **Всё из режима DEEP, плюс:**
126
128
 
127
- **Trusted Issuers Whitelist (для бизнес-анализа):**
129
+ **Pinned Issuers (для бизнес-анализа):**
128
130
  ```yaml
129
131
  trusted_issuers:
130
132
  financial_data:
131
- - crunchbase.com # Level 5
132
- - pitchbook.com # Level 5
133
- - sec.gov # Level 5
134
- - bloomberg.com # Level 4
135
- tech_data:
136
- - github.com # Level 4
137
- - stackshare.io # Level 3
138
- market_data:
139
- - statista.com # Level 4
140
- - similarweb.com # Level 3
141
- - sensortower.com # Level 3
142
- media:
143
- - techcrunch.com # Level 4
144
- - reuters.com # Level 5
145
- - forbes.com # Level 3
146
- company_official:
147
- - {URL} # Level 4 (official but biased)
133
+ sec.gov:
134
+ pubkey_b64: "<pinned-ed25519-public-key>"
135
+ status: active
148
136
  ```
137
+ Домены без pinned public key не дают issuer-grade crypto trust. Их можно использовать только через обычную source evaluation.
149
138
 
150
139
  **Для каждого найденного факта:**
151
140
  1. Извлеки claim + source_url
152
141
  2. Рассчитай `source_hash = sha256(content)`
153
- 3. Проверь `issuer trusted_whitelist`
154
- 4. Подпиши: `signature = Ed25519.sign(claim + source_hash + timestamp)`
142
+ 3. Если доступна подпись issuer, проверь её против pinned active key
143
+ 4. Подписываемое сообщение: canonical JSON с `issuer`, `source_url`, `claim`, `source_hash`, `timestamp`, optional `research_context`
155
144
  5. Запиши в verification ledger
156
145
 
157
146
  **Confidence Score (расширенная формула):**
158
147
  ```
159
- confidence = base_reliability × verification_multiplier × recency_factor
160
-
161
- verification_multiplier:
162
- 1.0 — unsigned (не в whitelist)
163
- 1.2 — issuer в trusted whitelist
164
- 1.5 — подтверждено ≥2 независимыми trusted sources (chain verified)
148
+ UNVERIFIED: 0.0 для crypto provenance
149
+ SELF_ATTESTED: <=0.60
150
+ ISSUER_SIGNED: min(0.95, base_reliability × recency_factor)
165
151
  ```
166
152
 
167
- **Verification threshold:** 0.85 (moderate) факт считается verified если confidence 0.85
153
+ **Verification threshold:** 0.85 (moderate). VERIFIED означает provenance/tamper-evidence под pinned key, не истинность бизнес-факта.
168
154
 
169
155
  ---
170
156
 
@@ -324,5 +310,5 @@ Chain integrity: ✅ All N facts signed, 0 breaks
324
310
  | Output columns | 3 (Параметр, Значение, Источник) | 4 (+Confidence) | Прозрачность доверия к данным |
325
311
  | Verification | "НЕ НАЙДЕНО" | + Verification Ledger, audit trail, chain integrity | Auditability |
326
312
  | Checkpoint actions | 4 варианта | 6 вариантов (+переключение режима) | Гибкость mid-flight |
327
- | Trusted issuers | Нет | Whitelist по категориям | Anti-hallucination |
313
+ | Trusted issuers | Нет | Pinned-key whitelist | Provenance under pinned keys |
328
314
  | GOAP planning | Нет | A* pathfinding + OODA loop | Адаптивный research |
@@ -76,11 +76,11 @@ sample_size_factor: 1.0 (≥20 reviews), 0.8 (10-19), 0.5 (<10)
76
76
  > ⚙️ **Дополнительно:** `view(/mnt/skills/user/goap-research-ed25519/SKILL.md)`
77
77
 
78
78
  Всё из DEEP, плюс:
79
- - Каждая цитата клиента подписывается с `source_url_hash`
80
- - Demographic claims верифицируются через trusted issuers
79
+ - Каждая цитата клиента получает `source_hash` и, где доступно, provenance signature
80
+ - Demographic claims проверяются через обычную source evaluation; issuer-grade crypto требует pinned issuer key
81
81
  - Verification threshold: 0.85
82
82
 
83
- **Note:** Отзывы клиентов по природе субъективны Ed25519 верифицирует **что цитата реально существует по указанному URL**, а не что мнение клиента "правильное".
83
+ **Note:** Отзывы клиентов по природе субъективны. Ed25519 доказывает только provenance/tamper-evidence под pinned key или self-attested audit trail; он не доказывает, что мнение клиента "правильное" или репрезентативное.
84
84
 
85
85
  ---
86
86
 
@@ -195,7 +195,7 @@ sample_size_factor: 1.0 (≥20 reviews), 0.8 (10-19), 0.5 (<10)
195
195
  | Скилл | Режим | Как используется |
196
196
  |-------|-------|-----------------|
197
197
  | `goap-research-ed25519` | DEEP | Адаптивный поиск отзывов: A* по платформам + OODA при пустых results |
198
- | `goap-research-ed25519` | VERIFIED | + верификация существования цитат по URL |
198
+ | `goap-research-ed25519` | VERIFIED | + provenance/tamper-evidence для цитат, где есть pinned issuer signatures |
199
199
  | `references/jtbd-canvas.md` | ALL | Шаблон JTBD с примерами (Noom) |
200
200
 
201
201
  ## Checkpoint 2
@@ -163,28 +163,21 @@ Incumbent │ (-2, +1) | (0, +2) │ Ценовая война
163
163
 
164
164
  Всё из режима DEEP, плюс:
165
165
 
166
- **Trusted Issuers для Market Research:**
166
+ **Pinned Issuers для Market Research:**
167
167
  ```yaml
168
168
  trusted_issuers:
169
169
  market_reports:
170
- - statista.com # Level 4
171
- - grandviewresearch.com # Level 4
172
- - mordorintelligence.com # Level 3
170
+ sec.gov:
171
+ pubkey_b64: "<pinned-ed25519-public-key>"
172
+ status: active
173
173
  financial:
174
- - crunchbase.com # Level 5
175
- - pitchbook.com # Level 5
176
- - sec.gov # Level 5
177
- industry:
178
- - gartner.com # Level 5
179
- - mckinsey.com # Level 4
180
- - bcg.com # Level 4
181
- regulatory:
182
- - .gov domains # Level 5
183
- - europa.eu # Level 5
174
+ example-provider.com:
175
+ pubkey_b64: "<pinned-ed25519-public-key>"
176
+ status: active
184
177
  ```
185
178
 
186
- - Все TAM/SAM/SOM числа подписываются с source_hash
187
- - Competitive Matrix: каждая ячейка → verified с Confidence
179
+ - Все TAM/SAM/SOM числа получают source_hash; issuer-grade crypto используется только при valid signature under pinned active key
180
+ - Competitive Matrix: каждая ячейка → source URL + confidence; VERIFIED означает provenance/tamper-evidence, не истинность оценки
188
181
  - Verification threshold: **0.85** (moderate), повысить до **0.95** (strict) для инвестиционного due diligence
189
182
 
190
183
  ---
@@ -114,9 +114,10 @@ Physical: "Команда должна быть БОЛЬШОЙ (для скор
114
114
  > ⚙️ **Дополнительно:** `view(/mnt/skills/user/goap-research-ed25519/SKILL.md)`
115
115
 
116
116
  Всё из DEEP, плюс:
117
- - Все benchmark числа подписываются с source_hash + issuer verification
118
- - Verification threshold: **0.95** (strict) — финансовые данные требуют высокой точности
119
- - Trusted issuers: SEC, Crunchbase, PitchBook, OpenView Partners, KeyBanc, Recurly
117
+ - Все benchmark числа получают source_hash; issuer-grade crypto используется только при valid signature under pinned active key
118
+ - Verification threshold: **0.95** (strict) — финансовые данные требуют высокой точности и ordinary source evaluation
119
+ - Pinned issuers: SEC or data providers only when an Ed25519 public key is explicitly pinned. Domain names alone do not create crypto trust.
120
+ - Ed25519 не доказывает правильность benchmark числа; он доказывает только provenance/tamper-evidence подписанного сообщения.
120
121
 
121
122
  ---
122
123
 
@@ -119,9 +119,10 @@ Physical: "Продукт должен быть ПРОСТЫМ (для onboardin
119
119
  > ⚙️ **Дополнительно:** `view(/mnt/skills/user/goap-research-ed25519/SKILL.md)`
120
120
 
121
121
  Всё из DEEP, плюс:
122
- - Traffic estimates, follower counts подписываются
123
- - Channel benchmarks верифицируются через trusted issuers
122
+ - Traffic estimates и follower counts получают source_hash; issuer-grade crypto используется только при valid signature under pinned active key
123
+ - Channel benchmarks проверяются через source evaluation, а не через domain-name trust
124
124
  - Verification threshold: 0.85
125
+ - Ed25519 доказывает provenance/tamper-evidence подписанного сообщения; он не доказывает истинность traffic estimates или follower counts.
125
126
 
126
127
  ---
127
128