openhermes 2.8.0 → 4.0.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.
Files changed (158) hide show
  1. package/CONTEXT.md +18 -0
  2. package/ETHOS.md +15 -0
  3. package/README.md +135 -292
  4. package/bootstrap.mjs +174 -512
  5. package/harness/agents/openhermes.md +87 -0
  6. package/harness/codex/CONSTITUTION.md +70 -148
  7. package/harness/codex/ROUTING.md +126 -0
  8. package/harness/commands/oh-doctor.md +26 -0
  9. package/harness/instructions/CONVENTIONS.md +206 -206
  10. package/harness/instructions/RUNTIME.md +54 -31
  11. package/harness/skills/oh-builder/SKILL.md +98 -0
  12. package/harness/skills/oh-caveman/SKILL.md +33 -0
  13. package/harness/skills/oh-expert/SKILL.md +121 -0
  14. package/harness/skills/oh-freeze/SKILL.md +28 -0
  15. package/harness/skills/oh-gauntlet/SKILL.md +119 -0
  16. package/harness/skills/oh-grill/SKILL.md +77 -0
  17. package/harness/skills/oh-guard/SKILL.md +33 -0
  18. package/harness/skills/oh-handoff/SKILL.md +33 -0
  19. package/harness/skills/oh-health/SKILL.md +90 -0
  20. package/harness/skills/oh-init/SKILL.md +78 -0
  21. package/harness/skills/oh-investigate/SKILL.md +35 -0
  22. package/harness/skills/oh-issue/SKILL.md +36 -0
  23. package/harness/skills/oh-learn/SKILL.md +28 -0
  24. package/harness/skills/oh-manifest/SKILL.md +84 -0
  25. package/harness/skills/oh-plan-review/SKILL.md +128 -0
  26. package/harness/skills/oh-planner/SKILL.md +157 -0
  27. package/harness/skills/oh-prd/SKILL.md +35 -0
  28. package/harness/skills/oh-retro/SKILL.md +33 -0
  29. package/harness/skills/oh-review/SKILL.md +110 -0
  30. package/harness/skills/oh-security/SKILL.md +110 -0
  31. package/harness/skills/oh-ship/SKILL.md +39 -0
  32. package/harness/skills/oh-skill-craft/SKILL.md +107 -0
  33. package/harness/skills/oh-skills-link/SKILL.md +29 -0
  34. package/harness/skills/oh-skills-list/SKILL.md +31 -0
  35. package/harness/skills/oh-triage/SKILL.md +36 -0
  36. package/index.mjs +3 -60
  37. package/lib/harness-resolver.mjs +77 -0
  38. package/lib/logger.mjs +62 -0
  39. package/package.json +49 -53
  40. package/test/plugins-behavioral.test.mjs +64 -0
  41. package/test/plugins.test.mjs +62 -0
  42. package/autorecall.mjs +0 -237
  43. package/curator.mjs +0 -482
  44. package/harness/commands/build-fix.md +0 -60
  45. package/harness/commands/checkpoint.md +0 -68
  46. package/harness/commands/code-review.md +0 -71
  47. package/harness/commands/doctor.md +0 -42
  48. package/harness/commands/eval.md +0 -89
  49. package/harness/commands/go-build.md +0 -87
  50. package/harness/commands/go-review.md +0 -71
  51. package/harness/commands/harness-audit.md +0 -90
  52. package/harness/commands/learn.md +0 -37
  53. package/harness/commands/loop-start.md +0 -38
  54. package/harness/commands/loop-status.md +0 -30
  55. package/harness/commands/memory-search.md +0 -37
  56. package/harness/commands/model-route.md +0 -32
  57. package/harness/commands/ohc.md +0 -13
  58. package/harness/commands/orchestrate.md +0 -88
  59. package/harness/commands/plan.md +0 -53
  60. package/harness/commands/quality-gate.md +0 -35
  61. package/harness/commands/refactor-clean.md +0 -102
  62. package/harness/commands/rust-build.md +0 -78
  63. package/harness/commands/rust-review.md +0 -65
  64. package/harness/commands/security.md +0 -93
  65. package/harness/commands/setup-pm.md +0 -65
  66. package/harness/commands/skill-create.md +0 -99
  67. package/harness/commands/test-coverage.md +0 -80
  68. package/harness/commands/update-codemaps.md +0 -81
  69. package/harness/commands/update-docs.md +0 -67
  70. package/harness/commands/verify.md +0 -68
  71. package/harness/prompts/architect.txt +0 -189
  72. package/harness/prompts/build-cpp.md +0 -98
  73. package/harness/prompts/build-error-resolver.md +0 -44
  74. package/harness/prompts/build-go.md +0 -340
  75. package/harness/prompts/build-java.md +0 -140
  76. package/harness/prompts/build-kotlin.md +0 -137
  77. package/harness/prompts/build-rust.md +0 -108
  78. package/harness/prompts/code-reviewer.md +0 -40
  79. package/harness/prompts/doc-updater.md +0 -206
  80. package/harness/prompts/docs-lookup.md +0 -71
  81. package/harness/prompts/e2e-runner.txt +0 -317
  82. package/harness/prompts/explore.md +0 -42
  83. package/harness/prompts/harness-optimizer.md +0 -42
  84. package/harness/prompts/loop-operator.md +0 -53
  85. package/harness/prompts/planner.md +0 -37
  86. package/harness/prompts/refactor-cleaner.md +0 -256
  87. package/harness/prompts/review-cpp.md +0 -81
  88. package/harness/prompts/review-database.md +0 -261
  89. package/harness/prompts/review-go.md +0 -257
  90. package/harness/prompts/review-java.md +0 -113
  91. package/harness/prompts/review-kotlin.md +0 -143
  92. package/harness/prompts/review-python.md +0 -101
  93. package/harness/prompts/review-rust.md +0 -77
  94. package/harness/prompts/security-reviewer.md +0 -42
  95. package/harness/prompts/tdd-guide.md +0 -228
  96. package/harness/rules/audit.md +0 -84
  97. package/harness/rules/checkpointing.md +0 -75
  98. package/harness/rules/context-loading.md +0 -33
  99. package/harness/rules/credential-exposure.md +0 -0
  100. package/harness/rules/delegation.md +0 -80
  101. package/harness/rules/handoff.md +0 -267
  102. package/harness/rules/memory-management.md +0 -28
  103. package/harness/rules/precedence.md +0 -52
  104. package/harness/rules/promotion.md +0 -46
  105. package/harness/rules/ranking.md +0 -64
  106. package/harness/rules/retrieval.md +0 -94
  107. package/harness/rules/runtime-guards.md +0 -196
  108. package/harness/rules/self-heal.md +0 -79
  109. package/harness/rules/session-start.md +0 -34
  110. package/harness/rules/skills-management.md +0 -165
  111. package/harness/rules/state-drift.md +0 -192
  112. package/harness/rules/verification.md +0 -88
  113. package/harness/scripts/sync-commands.mjs +0 -259
  114. package/harness/skills/.bundled_manifest +0 -17
  115. package/harness/skills/.usage.json +0 -6
  116. package/harness/skills/api-design/SKILL.md +0 -523
  117. package/harness/skills/backend-patterns/SKILL.md +0 -598
  118. package/harness/skills/coding-standards/SKILL.md +0 -549
  119. package/harness/skills/e2e-testing/SKILL.md +0 -326
  120. package/harness/skills/frontend-patterns/SKILL.md +0 -642
  121. package/harness/skills/frontend-slides/SKILL.md +0 -184
  122. package/harness/skills/security-review/SKILL.md +0 -495
  123. package/harness/skills/strategic-compact/SKILL.md +0 -131
  124. package/harness/skills/tdd-workflow/SKILL.md +0 -463
  125. package/harness/skills/verification-loop/SKILL.md +0 -126
  126. package/lib/ambient-memory.mjs +0 -167
  127. package/lib/handoff.mjs +0 -171
  128. package/lib/hardening.mjs +0 -146
  129. package/lib/memory-tools-plugin.mjs +0 -368
  130. package/lib/ohc/block-sync.mjs +0 -69
  131. package/lib/ohc/compress/search.mjs +0 -152
  132. package/lib/ohc/compress/state.mjs +0 -76
  133. package/lib/ohc/config.mjs +0 -185
  134. package/lib/ohc/message-ids.mjs +0 -178
  135. package/lib/ohc/notify.mjs +0 -135
  136. package/lib/ohc/protected-patterns.mjs +0 -55
  137. package/lib/ohc/prune-apply.mjs +0 -134
  138. package/lib/ohc/pruner.mjs +0 -608
  139. package/lib/ohc/reaper.mjs +0 -70
  140. package/lib/ohc/state.mjs +0 -265
  141. package/lib/ohc/strategies/deduplication.mjs +0 -72
  142. package/lib/ohc/strategies/index.mjs +0 -2
  143. package/lib/ohc/strategies/purge-errors.mjs +0 -43
  144. package/lib/ohc/token-utils.mjs +0 -26
  145. package/lib/ohc/updater.mjs +0 -132
  146. package/lib/paths.mjs +0 -49
  147. package/lib/schema-validator.mjs +0 -79
  148. package/lib/search.mjs +0 -48
  149. package/schemas/audit.schema.json +0 -82
  150. package/schemas/backlog.schema.json +0 -63
  151. package/schemas/checkpoint.schema.json +0 -65
  152. package/schemas/constraint.schema.json +0 -62
  153. package/schemas/decision.schema.json +0 -63
  154. package/schemas/instinct.schema.json +0 -63
  155. package/schemas/loop-state.schema.json +0 -33
  156. package/schemas/mistake.schema.json +0 -64
  157. package/schemas/verification_receipt.schema.json +0 -88
  158. package/skill-builder.mjs +0 -88
@@ -1,326 +0,0 @@
1
- ---
2
- name: e2e-testing
3
- description: Playwright E2E testing patterns, Page Object Model, configuration, CI/CD integration, artifact management, and flaky test strategies.
4
- origin: ECC
5
- ---
6
-
7
- # E2E Testing Patterns
8
-
9
- Comprehensive Playwright patterns for building stable, fast, and maintainable E2E test suites.
10
-
11
- ## Test File Organization
12
-
13
- ```
14
- tests/
15
- ├── e2e/
16
- │ ├── auth/
17
- │ │ ├── login.spec.ts
18
- │ │ ├── logout.spec.ts
19
- │ │ └── register.spec.ts
20
- │ ├── features/
21
- │ │ ├── browse.spec.ts
22
- │ │ ├── search.spec.ts
23
- │ │ └── create.spec.ts
24
- │ └── api/
25
- │ └── endpoints.spec.ts
26
- ├── fixtures/
27
- │ ├── auth.ts
28
- │ └── data.ts
29
- └── playwright.config.ts
30
- ```
31
-
32
- ## Page Object Model (POM)
33
-
34
- ```typescript
35
- import { Page, Locator } from '@playwright/test'
36
-
37
- export class ItemsPage {
38
- readonly page: Page
39
- readonly searchInput: Locator
40
- readonly itemCards: Locator
41
- readonly createButton: Locator
42
-
43
- constructor(page: Page) {
44
- this.page = page
45
- this.searchInput = page.locator('[data-testid="search-input"]')
46
- this.itemCards = page.locator('[data-testid="item-card"]')
47
- this.createButton = page.locator('[data-testid="create-btn"]')
48
- }
49
-
50
- async goto() {
51
- await this.page.goto('/items')
52
- await this.page.waitForLoadState('networkidle')
53
- }
54
-
55
- async search(query: string) {
56
- await this.searchInput.fill(query)
57
- await this.page.waitForResponse(resp => resp.url().includes('/api/search'))
58
- await this.page.waitForLoadState('networkidle')
59
- }
60
-
61
- async getItemCount() {
62
- return await this.itemCards.count()
63
- }
64
- }
65
- ```
66
-
67
- ## Test Structure
68
-
69
- ```typescript
70
- import { test, expect } from '@playwright/test'
71
- import { ItemsPage } from '../../pages/ItemsPage'
72
-
73
- test.describe('Item Search', () => {
74
- let itemsPage: ItemsPage
75
-
76
- test.beforeEach(async ({ page }) => {
77
- itemsPage = new ItemsPage(page)
78
- await itemsPage.goto()
79
- })
80
-
81
- test('should search by keyword', async ({ page }) => {
82
- await itemsPage.search('test')
83
-
84
- const count = await itemsPage.getItemCount()
85
- expect(count).toBeGreaterThan(0)
86
-
87
- await expect(itemsPage.itemCards.first()).toContainText(/test/i)
88
- await page.screenshot({ path: 'artifacts/search-results.png' })
89
- })
90
-
91
- test('should handle no results', async ({ page }) => {
92
- await itemsPage.search('xyznonexistent123')
93
-
94
- await expect(page.locator('[data-testid="no-results"]')).toBeVisible()
95
- expect(await itemsPage.getItemCount()).toBe(0)
96
- })
97
- })
98
- ```
99
-
100
- ## Playwright Configuration
101
-
102
- ```typescript
103
- import { defineConfig, devices } from '@playwright/test'
104
-
105
- export default defineConfig({
106
- testDir: './tests/e2e',
107
- fullyParallel: true,
108
- forbidOnly: !!process.env.CI,
109
- retries: process.env.CI ? 2 : 0,
110
- workers: process.env.CI ? 1 : undefined,
111
- reporter: [
112
- ['html', { outputFolder: 'playwright-report' }],
113
- ['junit', { outputFile: 'playwright-results.xml' }],
114
- ['json', { outputFile: 'playwright-results.json' }]
115
- ],
116
- use: {
117
- baseURL: process.env.BASE_URL || 'http://localhost:3000',
118
- trace: 'on-first-retry',
119
- screenshot: 'only-on-failure',
120
- video: 'retain-on-failure',
121
- actionTimeout: 10000,
122
- navigationTimeout: 30000,
123
- },
124
- projects: [
125
- { name: 'chromium', use: { ...devices['Desktop Chrome'] } },
126
- { name: 'firefox', use: { ...devices['Desktop Firefox'] } },
127
- { name: 'webkit', use: { ...devices['Desktop Safari'] } },
128
- { name: 'mobile-chrome', use: { ...devices['Pixel 5'] } },
129
- ],
130
- webServer: {
131
- command: 'npm run dev',
132
- url: 'http://localhost:3000',
133
- reuseExistingServer: !process.env.CI,
134
- timeout: 120000,
135
- },
136
- })
137
- ```
138
-
139
- ## Flaky Test Patterns
140
-
141
- ### Quarantine
142
-
143
- ```typescript
144
- test('flaky: complex search', async ({ page }) => {
145
- test.fixme(true, 'Flaky - Issue #123')
146
- // test code...
147
- })
148
-
149
- test('conditional skip', async ({ page }) => {
150
- test.skip(process.env.CI, 'Flaky in CI - Issue #123')
151
- // test code...
152
- })
153
- ```
154
-
155
- ### Identify Flakiness
156
-
157
- ```bash
158
- npx playwright test tests/search.spec.ts --repeat-each=10
159
- npx playwright test tests/search.spec.ts --retries=3
160
- ```
161
-
162
- ### Common Causes & Fixes
163
-
164
- **Race conditions:**
165
- ```typescript
166
- // Bad: assumes element is ready
167
- await page.click('[data-testid="button"]')
168
-
169
- // Good: auto-wait locator
170
- await page.locator('[data-testid="button"]').click()
171
- ```
172
-
173
- **Network timing:**
174
- ```typescript
175
- // Bad: arbitrary timeout
176
- await page.waitForTimeout(5000)
177
-
178
- // Good: wait for specific condition
179
- await page.waitForResponse(resp => resp.url().includes('/api/data'))
180
- ```
181
-
182
- **Animation timing:**
183
- ```typescript
184
- // Bad: click during animation
185
- await page.click('[data-testid="menu-item"]')
186
-
187
- // Good: wait for stability
188
- await page.locator('[data-testid="menu-item"]').waitFor({ state: 'visible' })
189
- await page.waitForLoadState('networkidle')
190
- await page.locator('[data-testid="menu-item"]').click()
191
- ```
192
-
193
- ## Artifact Management
194
-
195
- ### Screenshots
196
-
197
- ```typescript
198
- await page.screenshot({ path: 'artifacts/after-login.png' })
199
- await page.screenshot({ path: 'artifacts/full-page.png', fullPage: true })
200
- await page.locator('[data-testid="chart"]').screenshot({ path: 'artifacts/chart.png' })
201
- ```
202
-
203
- ### Traces
204
-
205
- ```typescript
206
- await browser.startTracing(page, {
207
- path: 'artifacts/trace.json',
208
- screenshots: true,
209
- snapshots: true,
210
- })
211
- // ... test actions ...
212
- await browser.stopTracing()
213
- ```
214
-
215
- ### Video
216
-
217
- ```typescript
218
- // In playwright.config.ts
219
- use: {
220
- video: 'retain-on-failure',
221
- videosPath: 'artifacts/videos/'
222
- }
223
- ```
224
-
225
- ## CI/CD Integration
226
-
227
- ```yaml
228
- # .github/workflows/e2e.yml
229
- name: E2E Tests
230
- on: [push, pull_request]
231
-
232
- jobs:
233
- test:
234
- runs-on: ubuntu-latest
235
- steps:
236
- - uses: actions/checkout@v4
237
- - uses: actions/setup-node@v4
238
- with:
239
- node-version: 20
240
- - run: npm ci
241
- - run: npx playwright install --with-deps
242
- - run: npx playwright test
243
- env:
244
- BASE_URL: ${{ vars.STAGING_URL }}
245
- - uses: actions/upload-artifact@v4
246
- if: always()
247
- with:
248
- name: playwright-report
249
- path: playwright-report/
250
- retention-days: 30
251
- ```
252
-
253
- ## Test Report Template
254
-
255
- ```markdown
256
- # E2E Test Report
257
-
258
- **Date:** YYYY-MM-DD HH:MM
259
- **Duration:** Xm Ys
260
- **Status:** PASSING / FAILING
261
-
262
- ## Summary
263
- - Total: X | Passed: Y (Z%) | Failed: A | Flaky: B | Skipped: C
264
-
265
- ## Failed Tests
266
-
267
- ### test-name
268
- **File:** `tests/e2e/feature.spec.ts:45`
269
- **Error:** Expected element to be visible
270
- **Screenshot:** artifacts/failed.png
271
- **Recommended Fix:** [description]
272
-
273
- ## Artifacts
274
- - HTML Report: playwright-report/index.html
275
- - Screenshots: artifacts/*.png
276
- - Videos: artifacts/videos/*.webm
277
- - Traces: artifacts/*.zip
278
- ```
279
-
280
- ## Wallet / Web3 Testing
281
-
282
- ```typescript
283
- test('wallet connection', async ({ page, context }) => {
284
- // Mock wallet provider
285
- await context.addInitScript(() => {
286
- window.ethereum = {
287
- isMetaMask: true,
288
- request: async ({ method }) => {
289
- if (method === 'eth_requestAccounts')
290
- return ['0x1234567890123456789012345678901234567890']
291
- if (method === 'eth_chainId') return '0x1'
292
- }
293
- }
294
- })
295
-
296
- await page.goto('/')
297
- await page.locator('[data-testid="connect-wallet"]').click()
298
- await expect(page.locator('[data-testid="wallet-address"]')).toContainText('0x1234')
299
- })
300
- ```
301
-
302
- ## Financial / Critical Flow Testing
303
-
304
- ```typescript
305
- test('trade execution', async ({ page }) => {
306
- // Skip on production — real money
307
- test.skip(process.env.NODE_ENV === 'production', 'Skip on production')
308
-
309
- await page.goto('/markets/test-market')
310
- await page.locator('[data-testid="position-yes"]').click()
311
- await page.locator('[data-testid="trade-amount"]').fill('1.0')
312
-
313
- // Verify preview
314
- const preview = page.locator('[data-testid="trade-preview"]')
315
- await expect(preview).toContainText('1.0')
316
-
317
- // Confirm and wait for blockchain
318
- await page.locator('[data-testid="confirm-trade"]').click()
319
- await page.waitForResponse(
320
- resp => resp.url().includes('/api/trade') && resp.status() === 200,
321
- { timeout: 30000 }
322
- )
323
-
324
- await expect(page.locator('[data-testid="trade-success"]')).toBeVisible()
325
- })
326
- ```