@nurix/etna 0.15.7 → 0.16.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 (86) hide show
  1. package/bin/etna.js +64 -13
  2. package/data/harness-index.json +7 -5
  3. package/data/harnesses/code/CLAUDE.md +3 -7
  4. package/data/harnesses/code/agents/harness-manager.md +4 -4
  5. package/data/harnesses/code/agents/maintenance.md +1 -1
  6. package/data/harnesses/code/harness.json +4 -3
  7. package/data/harnesses/code/hooks/hooks.json +3 -17
  8. package/data/harnesses/code/hooks/prompt-recall.js +157 -0
  9. package/data/harnesses/code/hooks/session-reflect.js +283 -0
  10. package/data/harnesses/code/skills/distiller/SKILL.md +62 -60
  11. package/data/harnesses/code/skills/distiller/references/docs-mode.md +21 -21
  12. package/data/harnesses/code/skills/distiller/references/method.md +41 -41
  13. package/data/harnesses/code/skills/documentation/references/templates.md +20 -27
  14. package/data/harnesses/code-fable/CLAUDE.md +138 -0
  15. package/data/harnesses/code-fable/agents/brainstorm.md +35 -0
  16. package/data/harnesses/code-fable/agents/change-review.md +249 -0
  17. package/data/harnesses/code-fable/agents/harness-manager.md +193 -0
  18. package/data/harnesses/code-fable/agents/maintenance.md +123 -0
  19. package/data/harnesses/code-fable/agents/performance-review.md +218 -0
  20. package/data/harnesses/code-fable/agents/spec-mode.md +56 -0
  21. package/data/harnesses/code-fable/harness.json +7 -0
  22. package/data/harnesses/code-fable/hooks/hooks.json +27 -0
  23. package/data/harnesses/code-fable/hooks/lib/redact.js +37 -0
  24. package/data/harnesses/code-fable/hooks/prompt-recall.js +157 -0
  25. package/data/harnesses/code-fable/hooks/session-reflect.js +283 -0
  26. package/data/harnesses/code-fable/rules/general.md +96 -0
  27. package/data/harnesses/code-fable/rules/nomenclature.md +34 -0
  28. package/data/harnesses/code-fable/skills/boundary/SKILL.md +262 -0
  29. package/data/harnesses/code-fable/skills/boundary/references/boundary-taxonomy.md +734 -0
  30. package/data/harnesses/code-fable/skills/brainstorm/README.md +136 -0
  31. package/data/harnesses/code-fable/skills/brainstorm/SKILL.md +135 -0
  32. package/data/harnesses/code-fable/skills/brainstorm/harvest.md +26 -0
  33. package/data/harnesses/code-fable/skills/brainstorm/templates/backlog.md +39 -0
  34. package/data/harnesses/code-fable/skills/brainstorm/templates/build.md +37 -0
  35. package/data/harnesses/code-fable/skills/brainstorm/templates/decisions.md +29 -0
  36. package/data/harnesses/code-fable/skills/brainstorm/templates/doctrine.md +31 -0
  37. package/data/harnesses/code-fable/skills/brainstorm/templates/domain-model.md +25 -0
  38. package/data/harnesses/code-fable/skills/brainstorm/templates/glossary.md +19 -0
  39. package/data/harnesses/code-fable/skills/brainstorm/templates/milestones.md +43 -0
  40. package/data/harnesses/code-fable/skills/brainstorm/templates/non-goals.md +21 -0
  41. package/data/harnesses/code-fable/skills/brainstorm/templates/plan-doc.md +61 -0
  42. package/data/harnesses/code-fable/skills/brainstorm/templates/questions.md +35 -0
  43. package/data/harnesses/code-fable/skills/brainstorm/templates/references.md +28 -0
  44. package/data/harnesses/code-fable/skills/brainstorm/templates/rejected.md +29 -0
  45. package/data/harnesses/code-fable/skills/brainstorm/templates/state.md +8 -0
  46. package/data/harnesses/code-fable/skills/brainstorm/templates/tech.md +23 -0
  47. package/data/harnesses/code-fable/skills/brainstorm/templates/thesis.md +21 -0
  48. package/data/harnesses/code-fable/skills/distiller/SKILL.md +219 -0
  49. package/data/harnesses/code-fable/skills/distiller/references/docs-mode.md +526 -0
  50. package/data/harnesses/code-fable/skills/distiller/references/method.md +166 -0
  51. package/data/harnesses/code-fable/skills/documentation/SKILL.md +127 -0
  52. package/data/harnesses/code-fable/skills/documentation/references/examples.md +193 -0
  53. package/data/harnesses/code-fable/skills/documentation/references/style-guide.md +288 -0
  54. package/data/harnesses/code-fable/skills/documentation/references/templates.md +942 -0
  55. package/data/harnesses/code-fable/skills/workflow-mapper/SKILL.md +430 -0
  56. package/data/harnesses/code-fable/skills/workflow-mapper/references/patterns.md +214 -0
  57. package/data/harnesses/{re → discover}/CLAUDE.md +48 -33
  58. package/data/harnesses/{re → discover}/agents/api.md +3 -3
  59. package/data/harnesses/{re → discover}/agents/codebase.md +3 -3
  60. package/data/harnesses/{re → discover}/agents/community.md +3 -3
  61. package/data/harnesses/{re → discover}/agents/deployed-client-bundle.md +5 -5
  62. package/data/harnesses/{re → discover}/agents/distribution-artifacts.md +4 -4
  63. package/data/harnesses/{re → discover}/agents/docs.md +3 -3
  64. package/data/harnesses/{re → discover}/agents/infra-backend-fingerprint.md +2 -2
  65. package/data/harnesses/{re → discover}/agents/packages.md +3 -3
  66. package/data/harnesses/{re → discover}/agents/session.md +19 -11
  67. package/data/harnesses/{re → discover}/agents/website.md +3 -3
  68. package/data/harnesses/{re → discover}/agents/wire-capture.md +9 -7
  69. package/data/harnesses/discover/harness.json +7 -0
  70. package/data/harnesses/{re/rules/re-discovery.md → discover/rules/discovery.md} +54 -17
  71. package/data/harnesses/{re/rules/re-evaluation.md → discover/rules/evaluation.md} +12 -1
  72. package/data/harnesses/{re/rules/re-ingestion.md → discover/rules/ingestion.md} +192 -23
  73. package/data/harnesses/discover/rules/self-correction.md +177 -0
  74. package/data/harnesses/discover/rules/tradecraft.md +532 -0
  75. package/data/harnesses/hr/CLAUDE.md +91 -0
  76. package/data/harnesses/hr/harness.json +7 -0
  77. package/data/harnesses/hr/skills/interview-eval/SKILL.md +118 -0
  78. package/data/harnesses/hr/skills/interview-eval/TEMPLATE.md +124 -0
  79. package/data/harnesses/hr/skills/interview-eval/extract_session.py +418 -0
  80. package/data/harnesses/hr/skills/interview-eval/rubric.md +219 -0
  81. package/data/harnesses/kb-agi/harness.json +1 -0
  82. package/package.json +1 -1
  83. package/data/harnesses/code/hooks/post-commit.js +0 -136
  84. package/data/harnesses/code/hooks/post-tool-failure.js +0 -136
  85. package/data/harnesses/code/hooks/session-stop.js +0 -207
  86. package/data/harnesses/re/harness.json +0 -6
@@ -0,0 +1,177 @@
1
+ # Self-Correction — Defect Inspection · Run Measurement · Iterate-or-Propose
2
+
3
+ The reference for **Mode 4** (`discover` harness). After a run finishes (Discovery → Ingestion →
4
+ Evaluation), the self-correcting step does THREE things, in order:
5
+
6
+ - **A. Inspect** the finished run against a built-in **defect checklist** → a concrete list of
7
+ *behavioral defects* in the prior steps (a list, never a vibe).
8
+ - **B. Measure** the run against a fixed **rubric** → a score + vibe band. This runs **every
9
+ iteration, including the final one** — the self-correcting step ALWAYS evaluates the current run.
10
+ - **C. Iterate-or-propose.** Each defect is classified by ONE test — *does fixing it require editing a
11
+ harness file (a rule or an agent)?* — into **within-run** (auto-iterate on THIS target, no
12
+ approval) vs **harness-changing** (the approval-gated proposal). The within-run loop improves the
13
+ current run; the harness-changing list improves the NEXT, different target.
14
+
15
+ > **The two gates that bind this step (both unchanged):**
16
+ > 1. **Harness changes are approval-gated.** The main session presents `04-self-correction-proposal.md`
17
+ > and STOPS; nothing is applied until the user accepts per-item. Structural edits are flagged and
18
+ > never auto-applied.
19
+ > 2. **Cost/state/credential actions are confirmation-gated.** The within-run iterate loop is
20
+ > **read-only / no-cost only.** Any fix needing a Pass-2 / credit-spend / state-change / credential
21
+ > action routes through the explicit-confirmation gate (ingestion §7 rule 4, §9.2) — never the
22
+ > auto-loop. The loop can never silently spend money or mutate an app to chase a score.
23
+
24
+ ---
25
+
26
+ ## A. The defect checklist (what to inspect — by the mode that produced it)
27
+
28
+ Inspect the run and emit **every** defect that fired, each as:
29
+ `{mode, defect, severity (high|med|low), evidence anchor (research/<target>/…), within-run | harness-changing}`.
30
+ This list is the load-bearing output of stage A — never skip a category silently; "none in this
31
+ category" is itself recorded.
32
+
33
+ ### Discovery defects
34
+ - **Access axis mis-graded** — esp. `auth:have-login` asserted on a *claimed/expected* login that was
35
+ never live-probed (should be `auth:claimed` until confirmed); any `source`/`runtime`/`presence` value
36
+ later contradicted by what Ingestion actually found. *(high — it mis-routes the whole run)*
37
+ - **Method graded from a label, not a retrieved artifact** — `openapi-verbatim` on a page merely
38
+ *titled* OpenAPI with no served, parseable spec. *(med)*
39
+ - **A predicted-available dimension came back blocked/absent** — Discovery over-promised. *(med)*
40
+ - **A sibling-declared count/host-list treated as a ceiling**, not a floor. *(low)*
41
+ - **Scope verdict wrong** — a suite/primitive/ambiguous/ethics call that should have fired (or wrongly did). *(high)*
42
+
43
+ ### Ingestion defects
44
+ - **Redaction miss** — a secret-shaped value reached `raw/`. *(HIGH — also hard-zeros the safety axis)*
45
+ - **Method ≠ planned** — the capture used a weaker method than Discovery predicted, with no recorded reason. *(med)*
46
+ - **Missing contract artifact** — a `raw/` file the dimension's contract requires was not produced. *(med)*
47
+ - **Low completeness with no recorded gap/reason.** *(med)*
48
+ - **Blocked-where-predicted-available and not recovered** — no retry / second method / fold. *(med)*
49
+ - **Seam forked** — `api-path-catalog`/`feature-flags` written under a dimension's `raw/` instead of
50
+ appended to `dimensions/_shared/` (ingestion §6). *(med)*
51
+ - **Same artifact double-mined** and the two counts read as corroboration rather than a range. *(med)*
52
+ - **Silent absence** — a dimension dropped with no `status: absent/folded` record. *(med)*
53
+ - **Went silent / looked hung** — a long fan-out with no summary-first partial (ingestion §8). *(low)*
54
+ - **An absence asserted that contradicts a sibling**, without a second-method re-check (ingestion §7 rule 10). *(med)*
55
+
56
+ ### Evaluation defects
57
+ - **A conflict left flagged-but-unresolved** where the direct-observation tiebreaker applies. *(med)*
58
+ - **Over-promotion** — a confidence band raised without ≥2 *independent* dimensions (or on two views of one artifact). *(med)*
59
+ - **Inference overrode a direct observation.** *(high)*
60
+ - **A single-source / low-confidence claim stated as fact.** *(med)*
61
+ - **Marketed write/execution behavior promoted to fact** on a `write_side_observed:false` session. *(med)*
62
+ - **A gap not surfaced**, or a count-divergence rendered as a conflict instead of a range. *(low)*
63
+ - **The published-vs-app-own API diff omitted** where a published API exists. *(med)*
64
+
65
+ ### Cross-cutting defects
66
+ - **Provenance frontmatter incomplete or dishonest** — `status`/`confidence` not matching reality. *(high)*
67
+ - **An absent dimension not recorded as a finding.** *(low)*
68
+
69
+ > The checklist is the floor, not the ceiling — a run may exhibit a behavioral defect not listed here.
70
+ > Record a novel defect with the same shape; if it would recur on a different target, route it
71
+ > harness-changing (and it becomes a checklist addition in its own right).
72
+
73
+ ---
74
+
75
+ ## B. The measurement rubric (the score — always computed)
76
+
77
+ Five axes, 0–20 each → **/100**, so iterations are comparable and "deteriorating" is a real drop, not
78
+ noise. The score is a **heuristic to catch regression and give the loop direction** — not a precise grade.
79
+
80
+ | # | Axis (0–20) | How to score |
81
+ |---|-------------|--------------|
82
+ | 1 | **Coverage** | `20 × (dimensions captured 'complete' ÷ dimensions reachable per the access vector)`; **−4** per dimension blocked where Discovery predicted available. |
83
+ | 2 | **Provenance integrity** | `10 × (captures with complete honest frontmatter ÷ all captures)` + `10 × (evaluation claims anchored+provenance-tagged ÷ all claims)`. |
84
+ | 3 | **Reconciliation correctness** | start 20; **−3** per weighting violation (over-promotion, tiebreaker skipped, single-source-as-fact, count-divergence-as-conflict, published-vs-app diff missing where a public API exists). |
85
+ | 4 | **Calibration & safety** | gaps/absences recorded honestly + confidence bands honest, scaled to 20. **A redaction miss hard-zeros this axis** and flags the run `unsafe` regardless of the others. |
86
+ | 5 | **Defect load** | `20 − Σ(severity weight)` over stage-A defects (high=3, med=2, low=1), floored at 0. |
87
+
88
+ **Rollup:** sum the five → `score/100`. **Vibe band:** ≥85 strong · 70–84 solid · 50–69 thin · <50 weak.
89
+ Plus a one-line gestalt (e.g. "solid coverage, but evaluation over-promoted two single-source claims").
90
+
91
+ **The iteration ledger** (written into `04-self-correction-proposal.md`):
92
+
93
+ | iter | score | Δ | cover | prov | recon | calib | defects | within-run fixes applied | remaining |
94
+ |------|-------|---|-------|------|-------|-------|---------|--------------------------|-----------|
95
+ | 0 | … | — | … | … | … | … | … | (baseline) | … |
96
+ | 1 | … | +n | … | … | … | … | … | re-mined entitlements; appended seam | … |
97
+
98
+ ---
99
+
100
+ ## C. Iterate-or-propose (the loop)
101
+
102
+ **Classify every stage-A defect by one test:** *does fixing it require editing a rule or an
103
+ agent file?*
104
+
105
+ - **No → within-run.** Fixable by re-running a Mode 1–3 step on THIS target, better (re-collect a
106
+ dimension deeper, re-run a reconciliation pass, do a missed entitlements mine, run the §7-rule-10
107
+ second probe, append a forked catalog into `_shared/`, recover a blocked dimension after a trivial
108
+ fix). **The main session auto-iterates these — no approval** (within the read-only/no-cost boundary).
109
+ - **Yes → harness-changing.** A generic methodology fix the NEXT different target would also hit →
110
+ accumulate into `04-self-correction-proposal.md`, **approval-gated** (present + STOP).
111
+ - A single defect may be **both**: fix it within-run now AND propose the rule so it never recurs.
112
+
113
+ ### The loop (driven by the main session, not a sub-agent)
114
+ ```
115
+ score[0] = measure(run); best = run; iter = 0
116
+ loop:
117
+ defects = inspect(run) # stage A
118
+ within = defects.where(within-run AND read-only/no-cost)
119
+ harness = defects.where(harness-changing)
120
+ if within is empty: break # CONVERGED
121
+ apply within-run fixes → run' # re-run the cheapest affected Mode 1–3 steps
122
+ iter += 1; score[iter] = measure(run') # stage B — ALWAYS measure
123
+ if score[iter] < score[iter-1] - TOL: # REGRESSION (clear drop, not noise)
124
+ run = best; break # revert to the best prior run, stop
125
+ best = run = run'
126
+ if iter >= CAP: break # CAP ≥ 5
127
+ present(harness) as 04-self-correction-proposal.md + the iteration ledger # approval gate
128
+ ```
129
+
130
+ **Stop conditions** (any one ends the loop):
131
+ 1. **Converged** — no within-run defects remain.
132
+ 2. **Regression** — `score[iter] < score[iter-1] − TOL` → **revert to the best prior run and stop**
133
+ (never let the loop make the run worse chasing a defect). `TOL` is a small tolerance (≈2 points) so a
134
+ within-noise wobble doesn't false-stop — stop only on a *clear* drop; always keep the highest-scoring
135
+ run as `best`.
136
+ 3. **Cap** — `iter` hits the cap. **The cap is ≥ 5**: the loop must be *willing* to run at least five
137
+ iterations on a still-improving run before giving up; raise it while the score keeps climbing.
138
+
139
+ ---
140
+
141
+ ## Output — `04-self-correction-proposal.md`
142
+
143
+ ```markdown
144
+ ---
145
+ target: <slug>
146
+ proposed_at: <YYYY-MM-DD>
147
+ status: PROPOSED # → APPLIED only after per-item approval (harness-change rows)
148
+ awaiting_approval: true
149
+ run_score: <final /100> # the score of the run AS SHIPPED (post-iteration)
150
+ vibe: strong | solid | thin | weak
151
+ iterations: <n>
152
+ stopped_on: converged | regression | cap
153
+ ---
154
+ # <Target> — Self-Correction (Mode 4)
155
+ ## Run measurement (the final score + per-axis breakdown + the one-line vibe gestalt)
156
+ ## Iteration ledger (the per-iteration table — score trajectory + fixes applied each round)
157
+ ## Behavioral defects found (stage-A list: mode · defect · severity · evidence anchor · within-run|harness)
158
+ ## Within-run fixes applied (what the auto-loop re-ran on this target, and the score delta each bought)
159
+ ## Harness-change proposals (APPROVAL-GATED table: # · sev · additive|structural · finding+anchor · fix · target file)
160
+ ## Approval gate (present + STOP; main session applies accepted items, flips each to APPLIED, logs)
161
+ ```
162
+
163
+ A **thin harness-change table with a high `run_score` and `stopped_on: converged`** is the success
164
+ signal — the run self-corrected to a good state and left little for the harness to learn. A **batch**
165
+ of runs additionally rolls up into a cross-target synthesis that promotes only patterns ≥2 *independent*
166
+ targets hit (guard against a homogeneous batch: 6/6 of one category is one vote, not six).
167
+
168
+ ---
169
+
170
+ ## How Mode 4 uses this reference
171
+ Stage A — inspect against the checklist, emit the defect list. Stage B — score the run (always).
172
+ Stage C — split within-run vs harness-changing; **auto-iterate** the within-run set (read-only/no-cost,
173
+ ≥5 iterations capable, stop on regression/convergence/cap), re-measuring each round; **accumulate** the
174
+ harness-changing set into the approval-gated proposal. Present the proposal + ledger and STOP. The main
175
+ session applies accepted harness rows, flips them to APPLIED, logs the change, and (per ingestion /
176
+ the orchestrator) mirrors to the harness home. Promote only what the next, different target would hit;
177
+ prefer additive edits; structural edits are flagged, never auto-applied.