@nurix/etna 0.15.2 → 0.15.4
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.md +16 -13
- package/bin/etna.js +8 -20
- package/data/harness-index.json +3 -1
- package/data/harnesses/code/CLAUDE.md +3 -17
- package/data/harnesses/code/agents/brainstorm.md +0 -1
- package/data/harnesses/code/agents/change-review.md +0 -1
- package/data/harnesses/code/agents/harness-manager.md +2 -3
- package/data/harnesses/code/agents/maintenance.md +0 -1
- package/data/harnesses/code/agents/performance-review.md +0 -1
- package/data/harnesses/code/agents/spec-mode.md +1 -2
- package/data/harnesses/code/harness.json +2 -2
- package/data/harnesses/code/rules/general.md +0 -1
- package/data/harnesses/code/rules/nomenclature.md +0 -1
- package/data/harnesses/code/skills/boundary/SKILL.md +0 -1
- package/data/harnesses/code/skills/brainstorm/SKILL.md +0 -1
- package/data/harnesses/code/skills/distiller/SKILL.md +0 -1
- package/data/harnesses/code/skills/documentation/SKILL.md +0 -1
- package/data/harnesses/code/skills/workflow-mapper/SKILL.md +0 -1
- package/data/harnesses/kb-agi/CLAUDE.md +0 -15
- package/data/harnesses/kb-agi/agents/kb-agi-init.md +0 -1
- package/data/harnesses/kb-agi/agents/kb-catch-stale.md +0 -1
- package/data/harnesses/kb-agi/agents/kb-find-gaps.md +0 -1
- package/data/harnesses/kb-agi/agents/kb-fix-links.md +0 -1
- package/data/harnesses/kb-agi/agents/kb-refresh-frontdoor.md +0 -1
- package/data/harnesses/kb-agi/agents/kb-refresh-summaries.md +0 -1
- package/data/harnesses/kb-agi/agents/kb-sync-metadata.md +0 -1
- package/data/harnesses/kb-agi/harness.json +2 -2
- package/data/harnesses/kb-agi/rules/kb.md +0 -4
- package/data/harnesses/re/CLAUDE.md +139 -0
- package/data/harnesses/re/agents/api.md +52 -0
- package/data/harnesses/re/agents/codebase.md +63 -0
- package/data/harnesses/re/agents/community.md +47 -0
- package/data/harnesses/re/agents/deployed-client-bundle.md +94 -0
- package/data/harnesses/re/agents/distribution-artifacts.md +97 -0
- package/data/harnesses/re/agents/docs.md +49 -0
- package/data/harnesses/re/agents/infra-backend-fingerprint.md +97 -0
- package/data/harnesses/re/agents/packages.md +48 -0
- package/data/harnesses/re/agents/session.md +57 -0
- package/data/harnesses/re/agents/website.md +50 -0
- package/data/harnesses/re/agents/wire-capture.md +93 -0
- package/data/harnesses/re/harness.json +6 -0
- package/data/harnesses/re/rules/re-discovery.md +266 -0
- package/data/harnesses/re/rules/re-evaluation.md +100 -0
- package/data/harnesses/re/rules/re-ingestion.md +266 -0
- package/package.json +2 -2
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
# Ingestion Contract — Dump Shape · Provenance · Ethics · Session Playbook
|
|
2
|
+
|
|
3
|
+
The reference knowledge for **Ingestion** (`re` harness, Mode 2). Every dimension dump obeys the
|
|
4
|
+
contract in §1–8 so (a) the **evaluation** mode can rely on a stable shape and weight each claim by
|
|
5
|
+
*how it was obtained*, and (b) a future agent can reproduce or extend any dump. §9 carries the
|
|
6
|
+
deepest, gated dimension's method — the logged-in browser-session playbook — which the `session`
|
|
7
|
+
agent follows.
|
|
8
|
+
|
|
9
|
+
This contract generalizes the source playbook's three-format contract (`captures/*.md` narrative +
|
|
10
|
+
`raw/*.json` verbatim + `curls.md`) to *any* dimension.
|
|
11
|
+
|
|
12
|
+
> **Contract style = "lighter".** Provenance ("how it was dumped") lives in the
|
|
13
|
+
> **`_summary.md` frontmatter**, not a separate `manifest.yaml`. There is no parallel YAML
|
|
14
|
+
> machine-spine — everything stays markdown-with-frontmatter. Evaluation reads the frontmatter
|
|
15
|
+
> to weight claims; self-correction reads it to detect under-delivery.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## 1. Folder layout
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
research/<target>/dimensions/<dimension>/
|
|
23
|
+
├── _summary.md ← decoded narrative + provenance frontmatter (human + machine read this)
|
|
24
|
+
└── raw/ ← verbatim artifacts (the reproducer reads these)
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Richer dimensions inherit the playbook contract (extra files, same `_summary.md` provenance):
|
|
28
|
+
- **session**: `dimensions/session/{_summary.md, captures/p*.md, raw/*.json, curls.md}`
|
|
29
|
+
- **wire-capture**: `dimensions/wire-capture/{_summary.md, captures/wire-narrative.md, raw/flows.json, curls.md}`
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## 2. `_summary.md` — required shape (with provenance frontmatter)
|
|
34
|
+
|
|
35
|
+
```markdown
|
|
36
|
+
---
|
|
37
|
+
dimension: <codebase|docs|packages|api|website|community|session|deployed-client-bundle|infra-backend-fingerprint|wire-capture|distribution-artifacts>
|
|
38
|
+
target: <slug>
|
|
39
|
+
status: complete | partial | blocked
|
|
40
|
+
# --- provenance (the "how it was dumped" layer evaluation weights on) ---
|
|
41
|
+
access_grade_used: <source:full | runtime:reachable | auth:have-login | presence:rich | ...>
|
|
42
|
+
method: <the ACTUAL extraction method — see §3 vocabulary>
|
|
43
|
+
completeness_pct: <0-100, honest self-estimate of reachable surface captured>
|
|
44
|
+
confidence: high | medium | low # how much to TRUST what was captured (see §3)
|
|
45
|
+
captured_at: <YYYY-MM-DD>
|
|
46
|
+
sources: [<urls / paths actually consulted>]
|
|
47
|
+
gaps: [<structured — each is a thing evaluation must NOT treat as covered>]
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
# <Target> — <Dimension> dump
|
|
51
|
+
|
|
52
|
+
## Method
|
|
53
|
+
Exactly what was done, which tools, what was skipped and why. (The prose behind the frontmatter `method`.)
|
|
54
|
+
|
|
55
|
+
## Findings
|
|
56
|
+
Ordered, concrete observations — real values (package names, versions, endpoint paths, file
|
|
57
|
+
paths, page URLs, prices). Tables liberally. The load-bearing section.
|
|
58
|
+
|
|
59
|
+
## Inferences
|
|
60
|
+
What the findings imply. Mark inference vs. fact.
|
|
61
|
+
|
|
62
|
+
## Open questions
|
|
63
|
+
What couldn't be captured and why. Never fabricate to fill a gap.
|
|
64
|
+
|
|
65
|
+
## Artifacts
|
|
66
|
+
Index of `raw/` files, one line each.
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Keep `status` and `confidence` honest — they drive the entire evaluation weighting.
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## 3. Method & confidence vocabulary (drives evaluation weighting)
|
|
74
|
+
|
|
75
|
+
`method` is one of: `clone-and-map`, `source-map-reassembly`, `registry-metadata`,
|
|
76
|
+
`openapi-verbatim`, `graphql-introspection`, `crawl-clip`, `docs-reconstructed`,
|
|
77
|
+
`bundle-string-mine`, `dns-ct-fingerprint`, `wire-tap-browser`, `wire-har`, `wire-mitmproxy`,
|
|
78
|
+
`binary-extract` (asar/apk/crx), `session-playbook`, `inferred`.
|
|
79
|
+
|
|
80
|
+
**Confidence is a function of method** (evaluation relies on this mapping):
|
|
81
|
+
- **high** — verbatim machine artifacts: `openapi-verbatim`, `graphql-introspection`, `registry-metadata`, `clone-and-map`, `binary-extract`.
|
|
82
|
+
- **medium** — `crawl-clip`, `docs-reconstructed`, `bundle-string-mine`, `dns-ct-fingerprint`, `wire-har`.
|
|
83
|
+
- **low** — `inferred`, `session-playbook` Pass-1-only, `wire-tap-browser` shapes-only, any wire-drift observation without a spec.
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## 4. `raw/*` — required shape
|
|
88
|
+
|
|
89
|
+
Structured captures (API responses, registry metadata, schemas) → JSON with a `_meta` header:
|
|
90
|
+
```json
|
|
91
|
+
{
|
|
92
|
+
"_meta": { "source": "...", "captured_at": "YYYY-MM-DD", "kind": "...", "byte_length": 0, "redactions": ["field → <REDACTED:...>"] },
|
|
93
|
+
"body": { /* verbatim, PII + secrets redacted */ },
|
|
94
|
+
"_decoded": { "field": "meaning + observed values" },
|
|
95
|
+
"_observation": "optional — what's load-bearing"
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
Prose captures (doc/marketing pages, structure maps, catalogs) → markdown with a metadata line:
|
|
99
|
+
`<!-- source: <url-or-path> · captured_at: YYYY-MM-DD · method: <method> -->`
|
|
100
|
+
|
|
101
|
+
**One file per logical artifact**, named by what it is (`endpoint-catalog.md`, `react-exports.md`,
|
|
102
|
+
`pricing.md`, `structure-map.md`).
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## 5. Size discipline — reduce, don't dump
|
|
107
|
+
|
|
108
|
+
Large artifacts (a 3 MB bundle, a 5 MB response, a 700-page sitemap) are **digested**, not pasted:
|
|
109
|
+
the schema/shape, enum distributions, one redacted representative sample, counts. A `raw/` file is
|
|
110
|
+
readable, not a memory dump. Set `digested: true` context in the artifact's `_meta`.
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## 6. The shared-surface seam rule (bundle ↔ session ↔ wire-capture)
|
|
115
|
+
|
|
116
|
+
`deployed-client-bundle` (static unauth SPA), `session` (authenticated browser runtime), and
|
|
117
|
+
`wire-capture` (non-browser client) can all surface the same **API path catalog** and **feature
|
|
118
|
+
flags**. To keep them consumable instead of triplicated:
|
|
119
|
+
|
|
120
|
+
- Use **one canonical artifact name** across all three: `raw/api-path-catalog.md` and
|
|
121
|
+
`raw/feature-flags.md`, each row carrying a `source: bundle | session | wire` column.
|
|
122
|
+
- Evaluation owns the **three-way diff** (static-declared vs browser-observed vs nonbrowser-observed)
|
|
123
|
+
in `data-model-api-surface.md`. A path that appears in `bundle` but never in `session`/`wire` is a
|
|
124
|
+
dormant/unshipped route — a finding, not noise.
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## 7. Ethics & redaction (non-negotiable — binds EVERY dimension)
|
|
129
|
+
|
|
130
|
+
Carried from the source playbook (`setup.md` §6). Violating them voids the work.
|
|
131
|
+
|
|
132
|
+
1. **Never enter credentials.** The user signs into any logged-in surface beforehand.
|
|
133
|
+
2. **Storage: shape, not values.** No raw cookies/tokens/JWT-signatures. Decode JWT *structure* with identity claims (`sub`,`email`,`phone`,`user_id`,`uid`,`sid`) redacted.
|
|
134
|
+
3. **Never save secrets.** Before any `raw/` write, redact every credential-shaped field → `<REDACTED:...>` + log in `_meta.redactions`. Field patterns: `api_key`,`*_secret`,`client_secret`,`webhook_secret`,`signing_*`,`password`,`private_key`,`access_token`/`refresh_token` in bodies, vendor-named secrets. Value patterns: `sk_live_…`/`pk_live_…` (Stripe), `sk-…` (OpenAI), `xox[bp]-…` (Slack), `AKIA…` (AWS), `gh[ps]_…` (GitHub), `AIza…` (Google), `eyJ…` (JWT), opaque base64 ≥32 chars in a credential field. Over-redact when unsure.
|
|
135
|
+
4. **Confirm before state changes** — anything that creates state, costs money, or is visible to others (even a draft toggle). State the exact action + estimated cost.
|
|
136
|
+
5. **No destructive actions.** Document the absence; move on.
|
|
137
|
+
6. **No bypassing safety harnesses** — redact, never evade.
|
|
138
|
+
7. **No exfiltration.** Captures stay local under `research/<target>/`.
|
|
139
|
+
8. **Respect TOS & robots.** For spec-writing / integration / competitive analysis — not credential theft, rate-limit bypass, or scraping.
|
|
140
|
+
|
|
141
|
+
### 7.1 wire-capture & active-interception ethics (the strictest tier)
|
|
142
|
+
|
|
143
|
+
The `wire-capture` dimension climbs a **3-rung ladder, lowest privilege first**, and records the
|
|
144
|
+
chosen rung in `_meta`:
|
|
145
|
+
|
|
146
|
+
1. **Browser network tap (default, unauth).** Chrome `read_network_requests` + the in-page
|
|
147
|
+
fetch/XHR interceptor on the **public** surface only. Capture request/response *shapes*; redact
|
|
148
|
+
in the wrapper before disk. No login. → `method: wire-tap-browser`.
|
|
149
|
+
2. **HAR export.** Export DevTools HAR of the unauth SPA's XHRs, digest to an endpoint catalog,
|
|
150
|
+
scrub `Authorization`/`Cookie`/secret-shaped values. → `method: wire-har`.
|
|
151
|
+
3. **mitmproxy / intercepting proxy — GATED, opt-in, user-run.** ONLY first-party traffic the
|
|
152
|
+
**user owns** (their own desktop/mobile/CLI client), ONLY with explicit chat authorization, ONLY
|
|
153
|
+
TOS-checked. The harness NEVER stands up a proxy against a third party's infra unattended; the
|
|
154
|
+
*user* installs the CA and routes their client — the agent only ingests exported flows. →
|
|
155
|
+
`method: wire-mitmproxy`. Same explicit-authorization loop as session Pass-2.
|
|
156
|
+
|
|
157
|
+
> Wireshark / packet capture is explicitly **not** used: for HTTPS it yields only TLS ciphertext,
|
|
158
|
+
> and a packet sweep of a third party is the bright line this harness will not cross.
|
|
159
|
+
|
|
160
|
+
### 7.2 distribution-artifacts ethics
|
|
161
|
+
Downloading a public binary (CRX/`.asar`/`.ipa`/`.apk`) and reading its manifest/strings is fine.
|
|
162
|
+
But binary **decompilation** can cross from "inspect" to "reverse-engineer in violation of EULA":
|
|
163
|
+
the agent reads the artifact's own license/EULA first and records a restrictive one as an Open
|
|
164
|
+
question rather than silently decompiling.
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## 8. Completeness check
|
|
169
|
+
A dump is complete when: `_summary.md` exists with full provenance frontmatter + honest `status`;
|
|
170
|
+
every Finding is backed by a `raw/` artifact or inline value; `raw/` artifacts have `_meta` +
|
|
171
|
+
decoding (large ones digested); redaction pass run; `gaps` recorded (never fabricated).
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## 9. The session dimension — logged-in browser-session playbook
|
|
176
|
+
|
|
177
|
+
The method for the **session** dimension: reverse-engineering the *authenticated runtime* of a
|
|
178
|
+
product by driving it through a browser (Chrome MCP) and instrumenting it. It produces a
|
|
179
|
+
section-by-section understanding of a product's wire protocol, auth, and state model **without
|
|
180
|
+
source-code access**. The `session` agent follows this section.
|
|
181
|
+
|
|
182
|
+
This is the deepest and most sensitive dimension. The ethics in §7 above bind hardest here.
|
|
183
|
+
|
|
184
|
+
### 9.1 Prerequisites (verify before anything else — all three non-negotiable)
|
|
185
|
+
|
|
186
|
+
| # | Precondition | How to verify |
|
|
187
|
+
|---|--------------|---------------|
|
|
188
|
+
| 1 | Target is **pre-logged-in** in Chrome | open the target URL in the connected tab → an authenticated surface (a dashboard, not a sign-in page). The agent never enters credentials. |
|
|
189
|
+
| 2 | **Claude Chrome extension** installed | `mcp__claude-in-chrome__tabs_context_mcp` returns live tabs |
|
|
190
|
+
| 3 | **Chrome CDP** connected | the same call returns stable tab IDs |
|
|
191
|
+
|
|
192
|
+
If any fails, return `blocked` naming the missing precondition.
|
|
193
|
+
|
|
194
|
+
### 9.2 The three-pass strategy
|
|
195
|
+
|
|
196
|
+
A single linear sweep wastes context on things you can read for free and wastes credits on
|
|
197
|
+
actions whose response shape you could infer. Use three passes.
|
|
198
|
+
|
|
199
|
+
**Pass 1 — read-only mining (no money, no state change).** If the user already has data (a
|
|
200
|
+
project, conversation, account, order), mine it first. Hit every list/state/history endpoint with
|
|
201
|
+
the existing token; capture verbatim bodies. This yields ~70% of the spec for free. Mine, by role:
|
|
202
|
+
identity (`/me`, `/account`, `/workspaces`), list (the canonical taxonomy), single-resource state
|
|
203
|
+
(server-injected vs client-sent fields), history/event-log (a whole trajectory in one call),
|
|
204
|
+
runtime/preview state, per-resource billing, account billing, feature flags/cohort, integration
|
|
205
|
+
catalog (`/mcp/`, `/integrations/`), and schema/capabilities (`/openapi.json`, `/.well-known/*`,
|
|
206
|
+
`/page-metadata`).
|
|
207
|
+
|
|
208
|
+
**Pass 2 — fresh-run validation (with explicit cost/state-change confirmation).** Only after
|
|
209
|
+
Pass 1, and only with explicit user OK stating the exact action + cheapest mode + estimated cost.
|
|
210
|
+
Catches what Pass 1 can't: the submit/write request body, live state-machine transitions, the
|
|
211
|
+
completion event, server-side resolution of shorthand, ID/slug-generation, the real iteration
|
|
212
|
+
endpoint, and the full realtime event catalog. **Legitimate to skip** if the user opts out — leave
|
|
213
|
+
write-side shapes as open questions; never fabricate them.
|
|
214
|
+
|
|
215
|
+
**Pass 3 — synthesis.** Walk the captures, pull each finding into the dimension's `_summary.md`,
|
|
216
|
+
note the cleverest design choices, defaults imposed, performance characteristics, and open
|
|
217
|
+
questions.
|
|
218
|
+
|
|
219
|
+
### 9.3 The P0 → P6 phases
|
|
220
|
+
|
|
221
|
+
The same phases apply whether the target is an AI builder, analytics dashboard, CRM, or collab tool:
|
|
222
|
+
|
|
223
|
+
| Phase | Focus |
|
|
224
|
+
|-------|-------|
|
|
225
|
+
| **P0 Surface** | routes, bundles, storage shape, the API host(s), the auth tell |
|
|
226
|
+
| **P1 Auth** | token type + issuer + storage location + refresh path; tenancy model |
|
|
227
|
+
| **P2 Core action** | the primary write — the submit/create body and its server resolution |
|
|
228
|
+
| **P3 Streaming** | the realtime transport (WS / SSE / WebChannel / Pusher / none) + event catalog |
|
|
229
|
+
| **P4 Runtime/state** | sandbox/preview/build/deploy state; the live result surface |
|
|
230
|
+
| **P5 Iteration** | the follow-up/edit endpoint (often surprisingly named) + any auto-iteration loop |
|
|
231
|
+
| **P6 Synthesis** | reconcile into the dimension's `_summary.md` + `captures/` + `curls.md` |
|
|
232
|
+
|
|
233
|
+
### 9.4 Runtime taps (Pass-1 instrumentation, run in-page)
|
|
234
|
+
|
|
235
|
+
- **WebSocket / EventSource / fetch+XHR interceptors** — wrap the constructors/methods to log
|
|
236
|
+
URLs, frames, and bodies (shapes, not secrets — redact in the wrapper before anything reaches
|
|
237
|
+
disk). Add a `SCRUB(value)` step inside the fetch wrapper so credentials never reach the harness.
|
|
238
|
+
- **Storage shape inspector** — enumerate localStorage / sessionStorage / cookies / IndexedDB
|
|
239
|
+
**key names + lengths**, never raw values.
|
|
240
|
+
- **JWT decoder** — decode the token *structure* (alg, claim names, exp) with identity claims
|
|
241
|
+
(`sub`, `email`, `phone`, `user_id`, `uid`, `sid`) redacted.
|
|
242
|
+
- If a Pusher/realtime SDK is loaded, bind a global listener to capture the event catalog.
|
|
243
|
+
|
|
244
|
+
### 9.5 The capture contract (richer than a standard dimension dump)
|
|
245
|
+
|
|
246
|
+
Under `research/<target>/dimensions/session/`:
|
|
247
|
+
|
|
248
|
+
- **`captures/p*.md`** — per-phase narrative for the human: frontmatter (title, summary, scope,
|
|
249
|
+
status), **Method** (taps run, actions taken), **Findings** (concrete values — URLs, fields,
|
|
250
|
+
status codes), **Inferences**, **Diff vs reference**, **Open questions**. Decoded, opinionated;
|
|
251
|
+
don't paste raw bodies here.
|
|
252
|
+
- **`raw/*.json`** — verbatim endpoint captures for the reproducer: a `_meta` header
|
|
253
|
+
(endpoint, auth-shape, captured_at, status, byte_length, redactions) + `body` (PII + secrets
|
|
254
|
+
redacted) + `_decoded_fields`. Digest bodies > 50 KB into a structured summary.
|
|
255
|
+
- **`curls.md`** — reproducible curl per endpoint, the auth model documented, a variables block,
|
|
256
|
+
and an endpoint-catalog table.
|
|
257
|
+
- **`_summary.md`** — the standard dimension bridge file (provenance frontmatter per §2) pointing
|
|
258
|
+
into the above, so Evaluation treats session like any other dimension. `method: session-playbook`,
|
|
259
|
+
`confidence: low` for Pass-1-only/inferred.
|
|
260
|
+
|
|
261
|
+
### 9.6 Session ethics (binds hardest here — see §7 above)
|
|
262
|
+
|
|
263
|
+
Never enter credentials; storage shape not values; redact every secret **inside the tap wrapper**
|
|
264
|
+
before it reaches disk; **confirm before any Pass-2 state change or cost** (exact action + exact
|
|
265
|
+
cost); no destructive actions; no bypassing the harness (redact, never evade); captures stay local;
|
|
266
|
+
respect TOS. The provenance/redaction rules in §1–8 apply to everything written here.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nurix/etna",
|
|
3
|
-
"version": "0.15.
|
|
4
|
-
"description": "Bootstrap a project with a Nurix harness —
|
|
3
|
+
"version": "0.15.4",
|
|
4
|
+
"description": "Bootstrap a project with a Nurix harness — copies the harness's CLAUDE.md, skills, agents, rules, and hooks directly into the project from a bundled payload (no marketplace fetch, no network).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"etna": "bin/etna.js"
|