Skip to content

Commit b64e5f8

Browse files
authored
Merge pull request #203 from ethosengine/staging
Release: merge staging into main
2 parents fe928d3 + 780ddaa commit b64e5f8

261 files changed

Lines changed: 21599 additions & 6057 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/agents/ci-pipeline.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ elohim-holochain (DNA/hApp, WASM artifacts)
2323
**Changeset Patterns** (from orchestrator):
2424
```groovy
2525
'elohim-holochain': ['holochain/dna/', 'holochain/holochain-cache-core/', 'holochain/rna/'],
26-
'elohim-edge': ['holochain/doorway/', 'holochain/edgenode/', 'holochain/elohim-storage/', 'holochain/manifests/', 'holochain/crates/'],
26+
'elohim-edge': ['doorway/', 'doorway-app/', 'holochain/edgenode/', 'holochain/elohim-storage/', 'holochain/crates/'],
2727
'elohim': ['elohim-app/', 'elohim-library/', 'VERSION'],
2828
'elohim-genesis': ['genesis/', 'data/'],
2929
'elohim-steward': ['steward/'] // manual only

.claude/agents/elohim-visual-alignment.md.save

Lines changed: 0 additions & 31 deletions
This file was deleted.

.claude/agents/gateway-storage.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ color: magenta
88

99
You are the Gateway and Storage Specialist for the Elohim Protocol. You understand the edge infrastructure that bridges web clients to the Holochain DHT.
1010

11-
**For comprehensive infrastructure context, reference `holochain/claude.md` and `holochain/EDGE-ARCHITECTURE.md`.**
11+
**For comprehensive infrastructure context, reference `holochain/claude.md`.**
1212

1313
## Architecture Principle
1414

@@ -18,7 +18,7 @@ P2P performance happens at the **agent level** (via holochain-cache-core), not a
1818

1919
## Component Structure
2020

21-
### holochain/doorway/ (Rust WebSocket Gateway)
21+
### doorway/ (Rust WebSocket Gateway)
2222

2323
| File | Purpose |
2424
|------|---------|
@@ -92,7 +92,7 @@ pub async fn run_admin_proxy(
9292

9393
```bash
9494
# Build doorway
95-
cd /projects/elohim/holochain/doorway
95+
cd /projects/elohim/doorway
9696
RUSTFLAGS='' cargo build --release
9797

9898
# Run with dev mode
@@ -109,7 +109,7 @@ curl http://localhost:8888/status | jq .
109109

110110
# Build elohim-storage
111111
cd /projects/elohim/holochain/elohim-storage
112-
RUSTFLAGS='' cargo build --release
112+
RUSTFLAGS='--cfg getrandom_backend="custom"' cargo build --release
113113
```
114114

115115
## WriteBuffer Presets

.claude/agents/quality-architect.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,19 @@ When scanning for gaps, include all projects:
146146

147147
**Depth over breadth:** Don't just grep for TODOs. Read the code around them. Understand what the feature *would* do, who it serves, and why it matters.
148148

149+
### BDD Coverage Gap Reports
150+
151+
When `orchestrator/e2e/reports/coverage-gap-report.json` exists (generated by the BDD gap scanner in CI or locally via `cd orchestrator/e2e && npm run scan:coverage`), incorporate it into your analysis:
152+
153+
1. **Read the report** — it contains `prioritizedGaps` ranked by conceptual density
154+
2. **Cross-reference with feature gaps** — the report's `epicsWithZeroTests` maps to domain pillars that have zero executable E2E coverage
155+
3. **Sprint recommendations** — use `prioritizedGaps` entries as ready-made sprint candidates. Each gap includes a `suggestedFeatureFile` path and `rationale`
156+
4. **GitHub issues** — when creating feature-gap issues from BDD gaps, include:
157+
- The gap's `domain` and `governanceLayer` in the title
158+
- The `conceptualDensity` in the technical context
159+
- Label with `bdd-gap` in addition to standard labels
160+
5. **Track convergence** — compare `summary.coveragePercent` across report timestamps to measure whether the gap-analysis loop is closing
161+
149162
## 3. User Story Generation
150163

151164
Turn discovered gaps into well-formed user stories for sprint planning.

.claude/agents/quality-sweep.md

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ Post-hooks run linting automatically on tool use. If hooks report violations in
104104
### TypeScript/Angular
105105
| Tool | Purpose | Config |
106106
|------|---------|--------|
107-
| ESLint | Code quality rules | `.eslintrc.json` |
108-
| Prettier | Code formatting | `.prettierrc` |
107+
| ESLint | Code quality rules | `eslint.config.js` (flat config) |
108+
| Prettier | Code formatting | `.prettierrc.js` |
109109
| TypeScript | Type checking | `tsconfig.json` |
110110

111111
### Rust
@@ -157,7 +157,7 @@ npx tsc -p tsconfig.app.json --noEmit
157157
### Clippy (Rust)
158158
```bash
159159
# Run clippy
160-
cd /projects/elohim/holochain/doorway
160+
cd /projects/elohim/doorway
161161
RUSTFLAGS='' cargo clippy
162162

163163
# With all warnings
@@ -350,29 +350,11 @@ Remaining: Y manual issues
350350
351351
## Configuration Files
352352
353-
### ESLint (.eslintrc.json)
354-
```json
355-
{
356-
"extends": [
357-
"eslint:recommended",
358-
"@angular-eslint/recommended"
359-
],
360-
"rules": {
361-
"@typescript-eslint/no-unused-vars": "error",
362-
"@typescript-eslint/explicit-function-return-type": "warn"
363-
}
364-
}
365-
```
353+
### ESLint (eslint.config.js)
354+
Uses ESLint 9 flat config format. See `elohim-app/eslint.config.js` for the full configuration.
366355
367-
### Prettier (.prettierrc)
368-
```json
369-
{
370-
"semi": true,
371-
"singleQuote": true,
372-
"tabWidth": 2,
373-
"printWidth": 100
374-
}
375-
```
356+
### Prettier (.prettierrc.js)
357+
See `elohim-app/.prettierrc.js` for the full configuration (100 char width, single quotes, trailing commas).
376358
377359
### Clippy (clippy.toml)
378360
```toml

.claude/agents/red-team.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ grep -r "password\|token\|secret\|key" --include="*.ts" elohim-app/src/
6363
grep -r "validate\|verify\|check" --include="*.rs" holochain/dna/
6464

6565
# Find exposed endpoints
66-
grep -r "router\|route\|endpoint" --include="*.rs" holochain/doorway/
66+
grep -r "router\|route\|endpoint" --include="*.rs" doorway/
6767
```
6868

6969
### 2. Threat Modeling (STRIDE)

.claude/commands/gap-analysis.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# BDD Coverage Gap Analysis
2+
3+
Run the BDD coverage gap scanner and interpret the results for sprint planning.
4+
5+
## Steps
6+
7+
1. Run the scanner:
8+
```bash
9+
cd orchestrator/e2e && npx tsx scripts/scan-coverage.ts
10+
```
11+
12+
2. Read the generated report:
13+
```
14+
orchestrator/e2e/reports/coverage-gap-report.json
15+
```
16+
17+
3. Present an interpreted analysis with:
18+
19+
### Summary Statistics
20+
- Total conceptual scenarios (from genesis feature files)
21+
- Total executable scenarios (from Cypress + Cucumber-JS)
22+
- Coverage percentage
23+
- Number of epics with zero test coverage
24+
25+
### Top 5 Priority Gaps
26+
For each of the top 5 entries in `prioritizedGaps`:
27+
- **Domain** and **governance layer**
28+
- **Conceptual density** (how many scenarios exist conceptually)
29+
- **Rationale** for why this gap matters
30+
- **Suggested feature file** path for new executable tests
31+
32+
### Sprint Recommendations
33+
Using quality-architect user story format:
34+
35+
```
36+
**As a** [persona from the gap's user types]
37+
**I want** [executable E2E coverage for this domain]
38+
**So that** [the loop closes and regressions are caught]
39+
40+
### Acceptance Criteria
41+
- [ ] Feature file created at suggested path
42+
- [ ] Step definitions use E2EWorld, DoorwayClient, BrowserDevice patterns
43+
- [ ] At least N scenarios converted from conceptual to executable
44+
- [ ] `npm run scan:coverage` shows improved coverage for this epic
45+
```
46+
47+
### Genesis Features to Convert First
48+
For each gap, list the specific genesis feature files (`featureFile` from the conceptual scenarios) that should be translated first. Prioritize files with the most scenarios.
49+
50+
### Loop Status
51+
How many iterations of the scanner → generate → review loop have occurred (check git log for coverage-gap-report.json commits). Note the trend in coverage percentage.
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Generate Executable BDD Scenarios from Gap Report
2+
3+
Read the BDD coverage gap report and generate executable feature files + step definition skeletons for the top priority gaps.
4+
5+
**Argument**: Number of gaps to generate for (default: 3). Pass as `$ARGUMENTS`.
6+
7+
## Steps
8+
9+
1. Read the gap report:
10+
```
11+
orchestrator/e2e/reports/coverage-gap-report.json
12+
```
13+
14+
If the report doesn't exist, run the scanner first:
15+
```bash
16+
cd orchestrator/e2e && npx tsx scripts/scan-coverage.ts
17+
```
18+
19+
2. For the top N gaps (from `prioritizedGaps`, where N = `$ARGUMENTS` or 3):
20+
21+
### a. Read Source Genesis Features
22+
For each gap, find the genesis feature files that match the gap's domain + governance layer:
23+
```
24+
genesis/docs/content/elohim-protocol/{domain}/{user_type}/scenarios/{governance_layer}.feature
25+
```
26+
27+
Read these files to understand the conceptual scenarios.
28+
29+
### b. Read Existing Executable Features as Style Reference
30+
Read these files to match the executable style:
31+
- `orchestrator/e2e/features/federation/cross-doorway-content.feature` — feature file pattern
32+
- `orchestrator/e2e/steps/federation.steps.ts` — step definition pattern
33+
34+
### c. Generate Feature Files
35+
Create `.feature` files at the `suggestedFeatureFile` path from the gap report.
36+
37+
**Translation strategy**: conceptual scenarios describe human experiences. Executable scenarios test the API contracts that would support those flows. For example:
38+
- "Workers implement community meal program" -> test content creation + tagging + cross-doorway discovery
39+
- "Workers welcome community stakeholder input" -> test content creation + governance metadata + search
40+
41+
Each generated feature should:
42+
- Use `@e2e @{epic}` tags on the first line
43+
- Include a Background with doorway health checks
44+
- Translate 3-5 conceptual scenarios into executable ones
45+
- Use Given/When/Then with the existing step patterns (human registration, content creation, content discovery)
46+
- Add `@wip` tag to scenarios that need step definitions not yet implemented
47+
48+
### d. Generate Step Definition Skeletons
49+
Create skeleton step files at `orchestrator/e2e/steps/{epic}.steps.ts`.
50+
51+
Each skeleton should:
52+
- Import from `@cucumber/cucumber` (Given, When, Then)
53+
- Import `E2EWorld`, `Human`, `BrowserDevice` from the framework
54+
- Include stub step definitions matching the new feature file
55+
- Mark incomplete steps with `// TODO: implement` comments
56+
- Follow the pattern from `federation.steps.ts`
57+
58+
### e. Verify
59+
For each generated file:
60+
- Ensure the feature file parses (no syntax errors)
61+
- Ensure the step file compiles (typecheck)
62+
63+
3. Report what was generated:
64+
- List of new feature files with scenario counts
65+
- List of new step definition files
66+
- Which steps are fully implemented vs TODO
67+
- Updated coverage estimate (run scanner again)

.claude/skills/quality-orchestrator/SKILL.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,16 @@ Each file read ≈ 1-3K tokens. Fix + write ≈ similar. Plus agent instructions
323323

324324
---
325325

326+
## BDD Coverage Gap Reports as Campaign Source
327+
328+
The BDD gap scanner (`cd orchestrator/e2e && npm run scan:coverage`) produces `orchestrator/e2e/reports/coverage-gap-report.json`. This report is also generated in CI as an advisory stage.
329+
330+
**quality-architect can create campaigns from `prioritizedGaps` entries.** Each entry identifies a domain + governance layer with high conceptual density but zero executable tests. These are natural candidates for E2E coverage campaigns.
331+
332+
To generate executable scenarios from gap report entries, use `/generate-scenarios N` where N is the number of top gaps to address.
333+
334+
---
335+
326336
## Existing Infrastructure (Preserved)
327337

328338
These tools continue to work alongside the team system:
@@ -333,6 +343,7 @@ These tools continue to work alongside the team system:
333343
| `generate-campaigns.py` | Group issues into campaigns | Phase 1 |
334344
| `lint-orchestrator.py` | Status tracking, escalation queries | `show-status`, `get-escalations` |
335345
| `pre-flight-check.py` | Build health validation | Phase 1 |
346+
| `scan-coverage.ts` | BDD coverage gap scanner | `cd orchestrator/e2e && npm run scan:coverage` |
336347
| PostToolUse hooks | Auto-lint on every edit | Continuous (automatic) |
337348

338349
---

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ output/
4242
# Seed data is now version-controlled for CI access
4343
# data/lamad/**/*.json
4444

45+
# Holochain runtime
46+
.hc_live_*
47+
48+
# E2E test artifacts (generated per run, archived in CI)
49+
orchestrator/e2e/reports/
50+
4551
# Rust/Holochain
4652
target/
4753
*.happ

0 commit comments

Comments
 (0)