pi-harness-runtime 1.1.166 → 1.1.167

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 (118) hide show
  1. package/AGENTS.md +272 -0
  2. package/CLAUDE.md +77 -0
  3. package/SECURITY.md +21 -0
  4. package/TODO-todo-bd-sync.md +124 -0
  5. package/auto-resume-fix-prompt.md +189 -0
  6. package/harness/reports/PROJECT_STATE.md +342 -0
  7. package/harness/reports/PROVIDER_USAGE_RESEARCH.md +115 -0
  8. package/harness/reports/SESSION_STATUS.md +107 -0
  9. package/harness/skills-plan/2026-07-12-herdr-moo-skills-adaptation-plan.md +278 -0
  10. package/harness/skills-plan/2026-07-12-minimax-prompt-step1-sync.md +345 -0
  11. package/harness/skills-plan/2026-07-12-public-skill-export-and-sync-design.md +504 -0
  12. package/harness/skills-plan/ACTION-PLAN.md +108 -0
  13. package/package.json +3 -1
  14. package/packages/a2a-adapter/package.json +1 -1
  15. package/packages/agent-policy/dist/extension.d.ts +2 -1
  16. package/packages/agent-policy/dist/extension.d.ts.map +1 -1
  17. package/packages/agent-policy/dist/extension.js +8 -3
  18. package/packages/agent-policy/dist/extension.js.map +1 -1
  19. package/packages/agent-policy/dist/policy-loader.d.ts.map +1 -1
  20. package/packages/agent-policy/dist/policy-loader.js +14 -2
  21. package/packages/agent-policy/dist/policy-loader.js.map +1 -1
  22. package/packages/agent-policy/package.json +1 -1
  23. package/packages/agent-policy/src/extension.ts +9 -3
  24. package/packages/agent-policy/src/policy-loader.ts +16 -2
  25. package/packages/architecture-generator/package.json +1 -1
  26. package/packages/auth/package.json +1 -1
  27. package/packages/autonomous-refactor/package.json +1 -1
  28. package/packages/autonomous-runtime/package.json +1 -1
  29. package/packages/cache-strategy/package.json +1 -1
  30. package/packages/capability-registry/package.json +1 -1
  31. package/packages/checkpoint/package.json +1 -1
  32. package/packages/cli-plugin-sdk/package.json +1 -1
  33. package/packages/clipboard/package.json +1 -1
  34. package/packages/clipboard-plugin/package.json +1 -1
  35. package/packages/code-generation/package.json +1 -1
  36. package/packages/code-review/package.json +1 -1
  37. package/packages/codex-adapter/package.json +1 -1
  38. package/packages/codex-watcher/package.json +1 -1
  39. package/packages/config-capture/package.json +1 -1
  40. package/packages/context-compiler/package.json +1 -1
  41. package/packages/context-discovery/package.json +1 -1
  42. package/packages/context-manager/package.json +1 -1
  43. package/packages/cookie-sanitizer/package.json +1 -1
  44. package/packages/cost-optimizer/package.json +1 -1
  45. package/packages/dependency-analyzer/package.json +1 -1
  46. package/packages/django-plugin/package.json +1 -1
  47. package/packages/doc-generator/package.json +1 -1
  48. package/packages/evaluation-engine/package.json +1 -1
  49. package/packages/evaluation-runner/package.json +1 -1
  50. package/packages/event-bus/package.json +1 -1
  51. package/packages/event-store/package.json +1 -1
  52. package/packages/experience-replay/package.json +1 -1
  53. package/packages/feedback-collector/package.json +1 -1
  54. package/packages/file-copy-helper/package.json +1 -1
  55. package/packages/framework-detector/package.json +1 -1
  56. package/packages/framework-plugin-sdk/package.json +1 -1
  57. package/packages/frappe-plugin/package.json +1 -1
  58. package/packages/generic-web-plugin/package.json +1 -1
  59. package/packages/health-monitor/package.json +1 -1
  60. package/packages/intent-analyzer/package.json +1 -1
  61. package/packages/jev-judge/package.json +1 -1
  62. package/packages/knowledge-graph/package.json +1 -1
  63. package/packages/knowledge-retrieval/package.json +1 -1
  64. package/packages/laravel-plugin/package.json +1 -1
  65. package/packages/learning-engine/package.json +1 -1
  66. package/packages/mcp-adapter/package.json +1 -1
  67. package/packages/memory-engine/package.json +1 -1
  68. package/packages/milestone-manager/package.json +1 -1
  69. package/packages/model-registry/package.json +1 -1
  70. package/packages/nextjs-plugin/package.json +1 -1
  71. package/packages/notification/package.json +1 -1
  72. package/packages/observability/package.json +1 -1
  73. package/packages/okf-indexer/package.json +1 -1
  74. package/packages/paperclip-integration/package.json +1 -1
  75. package/packages/performance-optimizer/package.json +1 -1
  76. package/packages/privilege-broker/package.json +1 -1
  77. package/packages/project-analyzer/package.json +1 -1
  78. package/packages/project-bootstrap/package.json +1 -1
  79. package/packages/projection-engine/package.json +1 -1
  80. package/packages/prompt-compiler/package.json +1 -1
  81. package/packages/prompt-versioning/package.json +1 -1
  82. package/packages/provider-adapter-sdk/package.json +1 -1
  83. package/packages/provider-router/package.json +1 -1
  84. package/packages/provider-selector/package.json +1 -1
  85. package/packages/providers/package.json +1 -1
  86. package/packages/qdrant-skills/package.json +1 -1
  87. package/packages/quota-manager/package.json +1 -1
  88. package/packages/rate-limiter/package.json +1 -1
  89. package/packages/react-vite-plugin/package.json +1 -1
  90. package/packages/release-manager/package.json +1 -1
  91. package/packages/requirement-compiler/package.json +1 -1
  92. package/packages/runtime/package.json +1 -1
  93. package/packages/scheduler/package.json +1 -1
  94. package/packages/scheduler-adapter/package.json +1 -1
  95. package/packages/session/package.json +1 -1
  96. package/packages/session-api/package.json +1 -1
  97. package/packages/session-export/package.json +1 -1
  98. package/packages/shared-context/package.json +1 -1
  99. package/packages/skill-mcp-client/package.json +1 -1
  100. package/packages/skill-registry/package.json +1 -1
  101. package/packages/skills/package.json +1 -1
  102. package/packages/sprint-planner/package.json +1 -1
  103. package/packages/subscription-engine/package.json +1 -1
  104. package/packages/task-compiler/package.json +1 -1
  105. package/packages/tencentdb-memory/package.json +1 -1
  106. package/packages/tencentdb-sync/package.json +1 -1
  107. package/packages/test-data-generator/package.json +1 -1
  108. package/packages/test-generator/package.json +1 -1
  109. package/packages/todo-bd-sync/package.json +1 -1
  110. package/packages/token-estimation/package.json +1 -1
  111. package/packages/token-optimizer/package.json +1 -1
  112. package/packages/trajectory/package.json +1 -1
  113. package/packages/tui/package.json +1 -1
  114. package/packages/types/package.json +1 -1
  115. package/packages/workflow-events/package.json +1 -1
  116. package/packages/workspace-scanner/package.json +1 -1
  117. package/packages/worktree/package.json +1 -1
  118. package/packages/write-review/package.json +1 -1
@@ -0,0 +1,504 @@
1
+ # Public Skill Export and Sync Design for `pi-harness-runtime`
2
+
3
+ ## Purpose
4
+
5
+ This document turns the high-level Herdr adaptation plan into a concrete design for:
6
+
7
+ 1. exporting selected MooCoding skills into `pi-harness-runtime`
8
+ 2. sanitizing them before publication
9
+ 3. adding a **sync** function because the live skill source is continuously updated
10
+
11
+ This design assumes the live private skill corpus remains here:
12
+
13
+ - `/home/frappe/frappe-bench/.claude-plugins/moocoding-skills/skills/*`
14
+
15
+ That location remains the editable operational knowledge base.
16
+
17
+ ---
18
+
19
+ ## Design Principles
20
+
21
+ ### 1. Private source stays private
22
+
23
+ The bench-side MooCoding skills directory is the authoring source of truth.
24
+
25
+ It is never treated as:
26
+
27
+ - a publishable package directory
28
+ - a public docs source
29
+ - a direct npm skill distribution source
30
+
31
+ ### 2. Sync is not publish
32
+
33
+ Because the source corpus changes often, we need sync.
34
+
35
+ But **sync must only move content into a private staging area**, never into public package assets automatically.
36
+
37
+ ### 3. Export is gated
38
+
39
+ Nothing enters `pi-harness-runtime/skills/*` until it passes:
40
+
41
+ - sanitization checks
42
+ - explicit approval
43
+ - manifest tracking
44
+
45
+ ### 4. Public package content must be reproducible
46
+
47
+ Every public skill should have traceable provenance:
48
+
49
+ - source skill path
50
+ - source fingerprint/hash
51
+ - sanitized export timestamp
52
+ - approval record
53
+
54
+ ---
55
+
56
+ ## Proposed Directory Layout
57
+
58
+ ## A. Private live source
59
+
60
+ Outside repo package boundary:
61
+
62
+ ```text
63
+ /home/frappe/frappe-bench/.claude-plugins/moocoding-skills/skills/
64
+ <skill-name>/
65
+ SKILL.md
66
+ ```
67
+
68
+ ## B. Private repo-local staging area
69
+
70
+ Inside `pi-harness-runtime`, but excluded from publishable package contents:
71
+
72
+ ```text
73
+ harness/skills-staging/
74
+ source-mirror/
75
+ <skill-name>/
76
+ SKILL.md
77
+ sanitized-candidates/
78
+ <skill-name>/
79
+ SKILL.md
80
+ reports/
81
+ sync-report.json
82
+ sanitize-report.json
83
+ approval-report.json
84
+ manifests/
85
+ source-index.json
86
+ approval-index.json
87
+ ```
88
+
89
+ Notes:
90
+
91
+ - `source-mirror/` is a synced private mirror of selected private skills
92
+ - `sanitized-candidates/` contains transformed or reviewed versions
93
+ - nothing under `harness/skills-staging/` should be treated as publishable skill content by package manifests
94
+
95
+ ## C. Public distributable area
96
+
97
+ Already exposed by package manifest:
98
+
99
+ ```text
100
+ skills/
101
+ <public-skill-name>/
102
+ SKILL.md
103
+ ```
104
+
105
+ Only approved sanitized skills may appear here.
106
+
107
+ ---
108
+
109
+ ## Lifecycle Model
110
+
111
+ Each skill moves through explicit states.
112
+
113
+ ```text
114
+ private-source
115
+ -> synced-private-mirror
116
+ -> sanitize-check
117
+ -> sanitized-candidate
118
+ -> approved
119
+ -> exported-public
120
+ ```
121
+
122
+ ### State meanings
123
+
124
+ - `private-source`: original bench-side skill
125
+ - `synced-private-mirror`: latest mirrored copy inside repo staging
126
+ - `sanitize-check`: automated/manual review in progress
127
+ - `sanitized-candidate`: safe draft pending approval
128
+ - `approved`: explicitly allowed for public export
129
+ - `exported-public`: copied into `skills/*`
130
+
131
+ ---
132
+
133
+ ## The Required Sync Function
134
+
135
+ Because the private source keeps changing, add a **one-way sync** command.
136
+
137
+ ## Sync command responsibility
138
+
139
+ The sync function should:
140
+
141
+ 1. read selected skills from the private source tree
142
+ 2. copy them into `harness/skills-staging/source-mirror/`
143
+ 3. compute fingerprints/hashes
144
+ 4. record changes since last sync
145
+ 5. never touch `skills/*`
146
+ 6. never imply approval
147
+
148
+ ## Command shape
149
+
150
+ Suggested command surface:
151
+
152
+ ```bash
153
+ bun scripts/skills-sync.ts --skill bench-commands
154
+ bun scripts/skills-sync.ts --all-from-manifest
155
+ bun scripts/skills-sync.ts --changed-only
156
+ bun scripts/skills-sync.ts --check-only
157
+ ```
158
+
159
+ ## Sync modes
160
+
161
+ ### Mode 1 — targeted sync
162
+
163
+ For one skill:
164
+
165
+ ```bash
166
+ bun scripts/skills-sync.ts --skill form-state-persistence-fix
167
+ ```
168
+
169
+ Use when preparing a specific skill for review.
170
+
171
+ ### Mode 2 — manifest-driven sync
172
+
173
+ ```bash
174
+ bun scripts/skills-sync.ts --all-from-manifest
175
+ ```
176
+
177
+ Reads a maintained allowlist of candidate private skills and refreshes their staging mirrors.
178
+
179
+ ### Mode 3 — changed-only sync
180
+
181
+ ```bash
182
+ bun scripts/skills-sync.ts --changed-only
183
+ ```
184
+
185
+ Only updates staged mirror copies when the source fingerprint differs.
186
+
187
+ ### Mode 4 — check-only sync
188
+
189
+ ```bash
190
+ bun scripts/skills-sync.ts --check-only
191
+ ```
192
+
193
+ Reports drift without copying files.
194
+
195
+ ---
196
+
197
+ ## Sync Manifest Design
198
+
199
+ Introduce a manifest that defines which private skills are even eligible for staging sync.
200
+
201
+ Example:
202
+
203
+ ```json
204
+ {
205
+ "sourceRoot": "/home/frappe/frappe-bench/.claude-plugins/moocoding-skills/skills",
206
+ "skills": [
207
+ {
208
+ "sourceName": "bench-commands",
209
+ "targetName": "bench-commands",
210
+ "sync": true,
211
+ "publicCandidate": false
212
+ },
213
+ {
214
+ "sourceName": "form-state-persistence-fix",
215
+ "targetName": "form-state-persistence-fix",
216
+ "sync": true,
217
+ "publicCandidate": true
218
+ }
219
+ ]
220
+ }
221
+ ```
222
+
223
+ Suggested file:
224
+
225
+ ```text
226
+ harness/skills-staging/manifests/source-index.json
227
+ ```
228
+
229
+ ## Why this matters
230
+
231
+ - prevents accidental sync of the entire private corpus
232
+ - makes sync selection explicit
233
+ - creates a reviewable inventory
234
+
235
+ ---
236
+
237
+ ## Sanitization Design
238
+
239
+ ## Sanitization command responsibility
240
+
241
+ The sanitization step should take a mirrored private skill and produce a candidate public version.
242
+
243
+ Suggested command:
244
+
245
+ ```bash
246
+ bun scripts/skills-sanitize.ts --skill form-state-persistence-fix
247
+ bun scripts/skills-sanitize.ts --all-approved-candidates
248
+ bun scripts/skills-sanitize.ts --check-only
249
+ ```
250
+
251
+ ## Sanitization checks
252
+
253
+ Automated checks should flag:
254
+
255
+ - client names
256
+ - internal company names when not intended for disclosure
257
+ - private domains and internal URLs
258
+ - IP addresses
259
+ - credentials, tokens, cookies, bearer strings
260
+ - SSH host aliases
261
+ - private repo URLs
262
+ - machine-specific absolute paths when not acceptable for public docs
263
+ - support references that reveal private operations
264
+
265
+ ## Sanitization outputs
266
+
267
+ For each skill, produce:
268
+
269
+ - candidate sanitized `SKILL.md`
270
+ - machine-readable report
271
+ - human-readable warnings
272
+
273
+ Suggested report path:
274
+
275
+ ```text
276
+ harness/skills-staging/reports/sanitize-report.json
277
+ ```
278
+
279
+ ## Sanitization result classes
280
+
281
+ - `pass`: no blocking issues found
282
+ - `warn`: manual review required
283
+ - `fail`: cannot proceed without edits
284
+
285
+ ---
286
+
287
+ ## Approval Design
288
+
289
+ A sanitized candidate still should not publish automatically.
290
+
291
+ Add an approval manifest, for example:
292
+
293
+ ```json
294
+ {
295
+ "skills": [
296
+ {
297
+ "targetName": "form-state-persistence-fix",
298
+ "approved": true,
299
+ "approvedBy": "manual",
300
+ "sourceHash": "abc123",
301
+ "sanitizedHash": "def456",
302
+ "approvedAt": "2026-07-12T00:00:00Z"
303
+ }
304
+ ]
305
+ }
306
+ ```
307
+
308
+ Suggested file:
309
+
310
+ ```text
311
+ harness/skills-staging/manifests/approval-index.json
312
+ ```
313
+
314
+ Approval rules:
315
+
316
+ - only `approved: true` entries may export to `skills/*`
317
+ - approval must bind to a specific sanitized hash
318
+ - if the private source changes later, the sync hash changes and approval becomes stale
319
+
320
+ ---
321
+
322
+ ## Export Design
323
+
324
+ ## Export command responsibility
325
+
326
+ The export command copies only approved sanitized candidates into the public package skill directory.
327
+
328
+ Suggested command:
329
+
330
+ ```bash
331
+ bun scripts/skills-export.ts --skill form-state-persistence-fix
332
+ bun scripts/skills-export.ts --all-approved
333
+ bun scripts/skills-export.ts --check-only
334
+ ```
335
+
336
+ ## Export rules
337
+
338
+ - source must exist in `sanitized-candidates/`
339
+ - approval record must exist and match current sanitized hash
340
+ - export target must be inside `skills/<targetName>/SKILL.md`
341
+ - export must not read directly from the private source tree
342
+
343
+ ## Export outputs
344
+
345
+ - created or updated `skills/<targetName>/SKILL.md`
346
+ - export report with source and hash provenance
347
+
348
+ ---
349
+
350
+ ## Recommended Command Pipeline
351
+
352
+ For a single skill:
353
+
354
+ ```bash
355
+ # 1. refresh private staging copy from live source
356
+ bun scripts/skills-sync.ts --skill form-state-persistence-fix
357
+
358
+ # 2. sanitize into candidate public version
359
+ bun scripts/skills-sanitize.ts --skill form-state-persistence-fix
360
+
361
+ # 3. review and mark approved in approval manifest
362
+ # (manual step or dedicated approval command)
363
+
364
+ # 4. export only approved sanitized candidate
365
+ bun scripts/skills-export.ts --skill form-state-persistence-fix
366
+ ```
367
+
368
+ ---
369
+
370
+ ## Drift and Re-Sync Behavior
371
+
372
+ Because the source skills keep changing, we need clear drift handling.
373
+
374
+ ## Drift rule
375
+
376
+ If private source hash changes after approval:
377
+
378
+ - existing public export remains as-is
379
+ - approval becomes stale for the next export cycle
380
+ - sync report must show the skill as changed
381
+ - sanitization and approval must run again before re-export
382
+
383
+ ## Why this is important
384
+
385
+ This avoids two bad outcomes:
386
+
387
+ 1. silently publishing new private content
388
+ 2. breaking provenance between approved content and exported content
389
+
390
+ ---
391
+
392
+ ## Suggested Provenance Fields
393
+
394
+ Each staged and exported skill record should track:
395
+
396
+ - `sourceName`
397
+ - `sourcePath`
398
+ - `targetName`
399
+ - `sourceHash`
400
+ - `mirrorHash`
401
+ - `sanitizedHash`
402
+ - `lastSyncedAt`
403
+ - `lastSanitizedAt`
404
+ - `lastApprovedAt`
405
+ - `lastExportedAt`
406
+ - `status`
407
+
408
+ This can live in JSON manifests or per-skill metadata files.
409
+
410
+ ---
411
+
412
+ ## Interaction with `packages/skill-registry`
413
+
414
+ This design keeps publication and runtime discovery separate.
415
+
416
+ ### Short term
417
+
418
+ No registry changes are required to begin:
419
+
420
+ - `skills/*` remains the public packaged skill surface
421
+ - staging stays private under `harness/skills-staging/*`
422
+
423
+ ### Later optional enhancement
424
+
425
+ `packages/skill-registry` may support reading:
426
+
427
+ - bundled public skills from `skills/*`
428
+ - local private staged or source skills from configured paths
429
+
430
+ But that future loader must preserve source classification:
431
+
432
+ - `public-bundled`
433
+ - `private-staged`
434
+ - `private-external`
435
+
436
+ And must never auto-publish private sources.
437
+
438
+ ---
439
+
440
+ ## Minimal First Implementation
441
+
442
+ To keep scope controlled, implement in this order:
443
+
444
+ ### Step 1
445
+
446
+ Add manifests and directory structure:
447
+
448
+ - `harness/skills-staging/manifests/source-index.json`
449
+ - `harness/skills-staging/manifests/approval-index.json`
450
+
451
+ ### Step 2
452
+
453
+ Implement `skills-sync.ts`
454
+
455
+ - explicit allowlist only
456
+ - no package exports touched
457
+
458
+ ### Step 3
459
+
460
+ Implement `skills-sanitize.ts`
461
+
462
+ - reports + candidate output
463
+ - fail/warn/pass results
464
+
465
+ ### Step 4
466
+
467
+ Implement `skills-export.ts`
468
+
469
+ - approved candidates only
470
+ - writes to `skills/*`
471
+
472
+ ### Step 5
473
+
474
+ Document operator workflow
475
+
476
+ - sync
477
+ - sanitize
478
+ - approve
479
+ - export
480
+
481
+ ---
482
+
483
+ ## Non-Goals
484
+
485
+ This design does **not** recommend:
486
+
487
+ - syncing the whole private corpus into public package directories
488
+ - publishing directly from `/home/frappe/frappe-bench/.claude-plugins/moocoding-skills/skills/*`
489
+ - replacing the live MooCoding source with `pi-harness-runtime/skills/*`
490
+ - auto-approving sanitized output without human review
491
+
492
+ ---
493
+
494
+ ## Recommendation
495
+
496
+ Add the **sync** function, but make it explicitly:
497
+
498
+ - one-way
499
+ - allowlist-driven
500
+ - private-staging-only
501
+ - provenance-aware
502
+ - separate from export
503
+
504
+ That gives you freshness from the always-changing MooCoding corpus without sacrificing privacy or accidentally turning the package into a mirror of unsanitized internal knowledge.
@@ -0,0 +1,108 @@
1
+ # Multi-Day Action Plan: 100 RFCs to Production
2
+
3
+ Based on review of all 100 RFCs (0001–0100) and IMPLEMENTATION/* entries.
4
+
5
+ ---
6
+
7
+ ## ✅ Day 1 — Already Done
8
+
9
+ - **RFC-0052 Skill Registry** — capability registry integration, `invokeBestMatch`, capability checking, extended defaults, 13 new tests (31/31 passing)
10
+ - **RFC-0060 Memory Engine** — `validateConcept`, `writeConcept`, `search`, `promoteFromBlackboard`, `extractLinks`, `exportToOkf` (18/18 passing)
11
+ - **40 new RFCs** (0061–0100) committed with stub IMPLEMENTATION directories
12
+
13
+ ---
14
+
15
+ ## 📋 Remaining Work (by priority)
16
+
17
+ ### 🔴 High Priority — Foundation Dependencies
18
+
19
+ These packages block multiple others. Must implement first.
20
+
21
+ | Package | RFC | Blocks | Key Tasks |
22
+ |---------|-----|--------|-----------|
23
+ | `framework-detector` | 0038 | 0040, 0061–0066 | Auto-detect project framework from files, env, deps |
24
+ | `framework-plugin-sdk` | 0040 | 0061–0066 | SDK for writing framework plugins, manifest schema, plugin API |
25
+ | `model-registry` | 0053 | 0054, cost-optimizer | `models.list()` pagination, alias vs snapshot, price table |
26
+ | `capability-registry` | 0051 | 0052 (done), 0091–0096 | Capability definitions, provider support matrix |
27
+
28
+ ### 🟡 Medium Priority — Core Systems
29
+
30
+ Implement these in parallel after foundation.
31
+
32
+ | Package | RFC | Key Tasks |
33
+ |---------|-----|-----------|
34
+ | `code-generation` | 0037 | Scaffold generation, template engine, multi-framework support |
35
+ | `code-review` | 0036 | AST analysis, rule engine, lint integration, multi-LLM review |
36
+ | `evaluation-engine` | 0057 | Test runner, pass/fail criteria, benchmark suite |
37
+ | `learning-engine` | 0058 | Pattern extraction, weight updates, learning from outcomes |
38
+ | `experience-replay` | 0059 | Experience storage, retrieval, replay for similar tasks |
39
+ | `performance-optimizer` | 0056 | Token estimation, context window management, cache |
40
+ | `task-compiler` | 0044 | Task graph executor, dependency resolution, parallel execution |
41
+
42
+ ### 🟢 Lower Priority — Autonomous Features (RFC 0091–0100)
43
+
44
+ These depend on core systems above. Implement after core is stable.
45
+
46
+ | Package | RFC | Description |
47
+ |---------|-----|-------------|
48
+ | `autonomous-architecture-review` | 0091 | AI reviews PRs against architecture rules |
49
+ | `autonomous-refactoring` | 0092 | Auto-suggest/apply refactors |
50
+ | `autonomous-bug-fixing` | 0093 | Auto-fix from bug reports + test failures |
51
+ | `autonomous-performance-tuning` | 0094 | Profile + suggest optimizations |
52
+ | `autonomous-security-review` | 0095 | Scan for security issues |
53
+ | `autonomous-cost-optimization` | 0096 | Suggest/reduce API costs |
54
+ | `autonomous-documentation` | 0097 | Auto-generate/update docs |
55
+ | `autonomous-knowledge-management` | 0098 | Maintain knowledge graph |
56
+ | `runtime-evolution-engine` | 0099 | Self-improve from outcomes |
57
+ | `self-developing-runtime` | 0100 | Closed loop: build -> test -> learn -> improve |
58
+
59
+ ---
60
+
61
+ ## 📅 Suggested Day Breakdown
62
+
63
+ ### Day 2: Framework Foundation
64
+ 1. `framework-detector` — detect Frappe, Next.js, React/Vite, Django, Laravel
65
+ 2. `framework-plugin-sdk` — plugin manifest schema, lifecycle hooks, TypeScript SDK
66
+ 3. Verify: `npm run build` passes, tests green
67
+
68
+ ### Day 3: Model + Capability Foundation
69
+ 1. `capability-registry` — capability definitions, provider matrix
70
+ 2. `model-registry` — paginated `models.list()`, alias/snapshot separation, pricing
71
+ 3. `cost-optimizer` — spend tracking, routing by cost/speed/length
72
+
73
+ ### Day 4: Code Intelligence
74
+ 1. `code-generation` — scaffold templates, multi-framework support
75
+ 2. `code-review` — AST parsing, rule engine, GitHub integration
76
+ 3. `evaluation-engine` — benchmark harness, pass/fail criteria
77
+
78
+ ### Day 5–7: Learning + Experience
79
+ 1. `learning-engine` — pattern extraction, weight updates
80
+ 2. `experience-replay` — storage, similarity search, retrieval
81
+ 3. `task-compiler` — parallel task execution, dependency graph
82
+
83
+ ### Day 8+: Autonomous Features
84
+ - Implement RFC 0091–0100 one by one, each with tests + integration
85
+ - Start with 0091 (architecture review) as it's most immediately useful
86
+
87
+ ---
88
+
89
+ ## !️ Key Conventions
90
+
91
+ - All packages: `src/` + `test/` + `dist/`, TypeScript, `bun test`
92
+ - Export types from `src/index.ts`
93
+ - Build before commit: `bun run build && bun test`
94
+ - Dist files (generated): commit after build
95
+ - RFC stubs (0061–0100): add actual AI brief content before implementing
96
+
97
+ ---
98
+
99
+ ## 📁 IMPLEMENTATION Structure Per RFC
100
+
101
+ Each IMPLEMENTATION/*/ has 5 files:
102
+ - **TASKS.md** — numbered implementation checklist
103
+ - **ACCEPTANCE_CRITERIA.md** — done conditions
104
+ - **FILES.md** — expected source file layout
105
+ - **AI_BRIEF.md** — detailed AI instruction for implementation
106
+ - **TESTS.md** — test scenarios
107
+
108
+ Fill in AI_BRIEF.md before starting implementation.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-harness-runtime",
3
- "version": "1.1.166",
3
+ "version": "1.1.167",
4
4
  "description": "[BETA] Codex-style /usage status + autonomous coding harness for pi. Not production ready — expect breaking changes.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -27,6 +27,7 @@
27
27
  },
28
28
  "files": [
29
29
  "*.ts",
30
+ "*.md",
30
31
  "harness/**/*.ts",
31
32
  "packages/**/src/**/*.{ts,js}",
32
33
  "packages/**/dist/**/*.{js,d.ts,js.map,d.ts.map}",
@@ -36,6 +37,7 @@
36
37
  ".pi/plugins/**/*",
37
38
  "package.json",
38
39
  "README.md",
40
+ "AGENTS.md",
39
41
  "CHANGELOG.md",
40
42
  "LICENSE",
41
43
  "config.toml.example"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/a2a-adapter",
3
- "version": "1.1.166",
3
+ "version": "1.1.167",
4
4
  "type": "module",
5
5
  "description": "Google Agent-to-Agent (A2A) protocol adapter for pi-harness",
6
6
  "main": "dist/index.js",
@@ -13,7 +13,8 @@ import type { AgentPolicyConfig } from "./types.js";
13
13
  */
14
14
  export declare function registerAgentPolicy(pi: ExtensionAPI, config: AgentPolicyConfig): void;
15
15
  /**
16
- * Register with default configuration pointing to harness AGENTS.md.
16
+ * Register with default configuration pointing to harness rules.
17
+ * Checks for AGENTS.md first, then RULES.md as fallback.
17
18
  */
18
19
  export declare function registerDefault(pi: ExtensionAPI): void;
19
20
  //# sourceMappingURL=extension.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"extension.d.ts","sourceRoot":"","sources":["../src/extension.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,YAAY,EAIb,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EACV,iBAAiB,EAElB,MAAM,YAAY,CAAC;AAapB;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,EAAE,EAAE,YAAY,EAChB,MAAM,EAAE,iBAAiB,GACxB,IAAI,CA8SN;AA8DD;;GAEG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,YAAY,GAAG,IAAI,CAYtD"}
1
+ {"version":3,"file":"extension.d.ts","sourceRoot":"","sources":["../src/extension.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,YAAY,EAIb,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EACV,iBAAiB,EAElB,MAAM,YAAY,CAAC;AAapB;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,EAAE,EAAE,YAAY,EAChB,MAAM,EAAE,iBAAiB,GACxB,IAAI,CA8SN;AA8DD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,YAAY,GAAG,IAAI,CAiBtD"}
@@ -309,14 +309,19 @@ async function checkForBlockingFindings(_ctx, piLensAvailable) {
309
309
  // Convenience Export
310
310
  // ---------------------------------------------------------------------------
311
311
  /**
312
- * Register with default configuration pointing to harness AGENTS.md.
312
+ * Register with default configuration pointing to harness rules.
313
+ * Checks for AGENTS.md first, then RULES.md as fallback.
313
314
  */
314
315
  export function registerDefault(pi) {
315
- // Resolve AGENTS.md relative to the package root (pi-harness-runtime/)
316
+ // Resolve harness rules relative to the package root (pi-harness-runtime/)
316
317
  // import.meta.url is packages/agent-policy/src/extension.ts
317
318
  // So we go up 3 levels to reach the package root
318
319
  const packageRoot = new URL("../../..", import.meta.url);
319
- const harnessRulesPath = new URL("AGENTS.md", packageRoot);
320
+ const { existsSync } = require("node:fs");
321
+ // Check for AGENTS.md first, then RULES.md as fallback
322
+ const agentsPath = new URL("AGENTS.md", packageRoot);
323
+ const rulesPath = new URL("RULES.md", packageRoot);
324
+ const harnessRulesPath = existsSync(agentsPath) ? agentsPath : rulesPath;
320
325
  registerAgentPolicy(pi, {
321
326
  harnessRulesPath,
322
327
  requireReceiptBeforeMutation: true,