wei-wuwei 0.5.0 → 0.6.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wei-wuwei",
3
- "version": "0.5.0",
3
+ "version": "0.6.1",
4
4
  "description": "為無為,則無不治 — a source-of-truth skills & agents framework that compiles to Claude Code and Codex (Cursor and Gemini CLI planned). Write once, run in every agent, govern without forcing.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -19,7 +19,7 @@
19
19
  "scripts": {
20
20
  "build": "node bin/wuwei.js build",
21
21
  "check": "node bin/wuwei.js check",
22
- "test": "sh test/smoke.sh",
22
+ "test": "sh test/smoke.sh && sh test/brief.sh",
23
23
  "install:targets": "node bin/wuwei.js install"
24
24
  },
25
25
  "engines": {
@@ -207,16 +207,19 @@ get.
207
207
  | 6 | can it be one line? | `shrink:` |
208
208
  | 7 | only then: the minimum code that works | — |
209
209
 
210
- Rung 2 is the one that has to be caught here rather than later: `stdlib:`
211
- and `native:` are visible to anyone reading the diff, while a helper three
212
- files over is invisible unless you already looked. `review:defects` looks
213
- too — **both sides gate** — and **a `reuse:` finding from either is a rung
214
- that was skipped**, so it counts in the round's convergence like any other.
210
+ Rung 2 is caught here first; `review:defects` looks too — **both sides
211
+ gate** — and **a `reuse:` finding from either is a rung that was skipped**,
212
+ so it counts in the round's convergence like any other.
215
213
 
216
214
  **The ladder shortens the solution, never the reading.** Trace every file
217
215
  the change touches and the flow it really takes first, then climb — the
218
216
  smallest change in the wrong place is not lazy, it is a second bug.
219
217
 
218
+ **A task ends with its prose sweep.** Before hand-back, grep every name,
219
+ path, number and fact the task removed, renamed or changed (`wuwei sites
220
+ <term>…`) across docs, comments, SPEC, ACCEPTANCE and phase files; fix each
221
+ hit in the same commit, and list the terms in the hand-back.
222
+
220
223
  **A fix goes at the proven cause, and when the cause is in a shared
221
224
  function, one guard there beats one per caller** — smaller diff, and the
222
225
  siblings stop being broken too. Find the call sites the way `## Invariants`
@@ -287,10 +290,8 @@ get.
287
290
  asked for. A `yagni:` on "config nobody sets" is exactly how one of these
288
291
  leaves.
289
292
 
290
- The linter clause is deliberate: wuwei does not carry its own opinion on
291
- what a project must check for — `review:code` already runs whatever the
292
- project configured. A category with no configured check and no name in
293
- `## Sign-off`'s threats is not this step's floor to enforce alone.
293
+ A category with no configured check and no name in `## Sign-off`'s threats
294
+ is not this step's floor to enforce alone.
294
295
 
295
296
  **Two ways the same size → the one that is correct on edge cases.** Fewer
296
297
  lines, never a flimsier algorithm.
@@ -347,8 +348,7 @@ get.
347
348
  and `contested` findings, **its `unread:` scopes**, and the phase's full
348
349
  range as something a lens may widen to. The unread scopes have to be passed
349
350
  explicitly and **read before the delta**: they are unchanged code by
350
- definition, so nothing else in a delta round would bring them back. Rounds 2 and 3 otherwise pay four lenses to re-read code four
351
- lenses already read.
351
+ definition, so nothing else in a delta round would bring them back.
352
352
 
353
353
  **Full scope comes back whenever the delta cannot be trusted**, and
354
354
  `wuwei-review` §6 lists when: the sync above actually moved the base, or the
@@ -372,6 +372,10 @@ get.
372
372
  find nothing, so nothing is given up — except one seam, named with the
373
373
  skip: a code-only fix can falsify prose it never touched, and until the
374
374
  stream audit only `review:defects`' prose-inside-code rule watches it.
375
+ **The mirror**: a delta with no code (§1 classifies by content) and no open
376
+ code-panel finding dispatches only `review:defects` from the code panel;
377
+ `review:code` still sits in the document panel. Each panel is sent only
378
+ its own files.
375
379
  Round 1 is untouched by this — it runs full scope, where §1's
376
380
  classification already decides which panels exist at all. Inside a phase the panel has two obligations it does not
377
381
  have standalone:
@@ -414,7 +418,8 @@ get.
414
418
  coordinate is where the defect became visible; the cause can sit in a file
415
419
  it never opened. Locate it first, and where it is not already proven that
416
420
  is `wuwei-debug-root-cause` — the skill is not only for red tests, and a
417
- finding whose cause is a guess is the same situation.
421
+ finding whose cause is a guess is the same situation. **A fix that changes
422
+ a stated fact runs step 2's prose sweep** before its commit.
418
423
 
419
424
  **The finding disappearing is not the test; the cause being gone is.** One
420
425
  closed by widening a type, wrapping the call in a `try`, deleting the
@@ -474,7 +479,8 @@ get.
474
479
  | 1 or 2 | otherwise | next round |
475
480
  | ≥ 3 | no HIGH, no MED | **exit the loop** |
476
481
  | ≥ 3 | converging, HIGH or MED still open | next round |
477
- | ≥ 2 | **`HIGH + MED` did not fall** | **stop and escalate**, recorded in the phase file |
482
+ | ≥ 2 | **`HIGH + MED` did not fall** — new findings replacing fixed ones is not falling | **stop and escalate**, recorded in the phase file |
483
+ | ≥ 2 | **one section raised MED or above two rounds running** | **stop and escalate**, offering to cut or defer that section |
478
484
 
479
485
  The round-1 exit is the only way out before three — **every lens that ran**,
480
486
  zero findings, not a size guess about the diff, and a mixed phase runs two
@@ -569,6 +575,18 @@ get.
569
575
  tree and no other), and states whether the composed result still matches
570
576
  `## Target architecture`.
571
577
 
578
+ **Work decided after the stream audit or a UAT, before the stream PR
579
+ merges, is a new phase — never a hand-cut branch:** cut on the stream
580
+ branch as `wuwei-plan-phases` step 4 cuts one (its `## Intended design`,
581
+ its ACCEPTANCE items, `review:`, `depends-on` what it actually depends on
582
+ — not "the last"), the scope change in SPEC's `## Sign-off`, `STATE.md`'s
583
+ total raised, `wuwei plan-check <stream>` green; then `wuwei claim <stream>
584
+ <NN>` cuts `wuwei/<stream>/NN-<name>`. A hand-cut branch has no phase
585
+ file: nothing `brief` or the next session sees. **Its exit:** a phase that
586
+ only fixes the audit's findings closes when the collator re-checks each
587
+ AUDIT.md row against its fix — no new panel; one that adds scope (a UAT's
588
+ new feature) gets the stream panel again, as a delta (`wuwei-review` §4).
589
+
572
590
  **Tracker**, subject to step 1's write rule:
573
591
 
574
592
  | granularity | on PR open | on merge |
@@ -121,11 +121,12 @@ tags: [planning, workflow]
121
121
  in the reverted phase, no screen claiming what is no longer so;
122
122
  - a task checklist inside the file, each task carrying **`depends-on`**
123
123
  when it has one (omit when it has none, so an absent field means
124
- independent, never forgotten). One task ≈ one commit;
124
+ independent, never forgotten). One task ≈ one commit. **A task documents
125
+ only what exists when its phase ends**: how to operate something a later
126
+ phase builds is a requirement list in that phase's file, not a runbook
127
+ here;
125
128
  - **a task dependency diagram** — mermaid, in the phase file, from the
126
- `depends-on` fields. Order in a list cannot distinguish "this must come
127
- second" from "I wrote it second"; the field carries the intent and the
128
- diagram makes it readable at a glance. Omit only for a single-task
129
+ `depends-on` fields. Omit only for a single-task
129
130
  phase, and say so in one line;
130
131
  - an `## Intended design` section — the target structure as a mermaid
131
132
  diagram: the modules/interfaces this phase adds or changes and how they
@@ -39,4 +39,5 @@ changed in one is changed in the other.
39
39
  | drift | **a cross-branch or cross-version comparison uses §6's three-dot form** (`<a>...<b>`), not `<a> <b>` — tip-to-tip answers "do these differ", not "did `<b>` change what `<a>` changed", and is wrong exactly when `<a>` moved since the merge base. Three-dot fails closed (errors with no common ancestor); state which form you used |
40
40
  | drift | **a claim about an external platform's live configuration is checked against that platform, not the repo's copy of it** — on GitHub check both `.../branches/<branch>/protection` (classic, 404s under rulesets) and `.../rules/branches/<branch>` (rulesets); GET only, `per_page=100`, every page — a list endpoint's first page is a pattern with a reach. **A platform fact the dispatcher supplied (§1) is that check**; re-query only to dispute it. Can't query it → `PLAUSIBLE`, name what went unqueried, never fall back to the repo's copy as settling it |
41
41
  | drift | **a hit on a removed name is a finding only if its clause still asserts the name as current** — a clause recording the removal is not one. Quote the clause |
42
- | claims, drift | **a suggested fix is checked against precedent, not invented** — grep the repo for how the same kind of staleness was corrected before, and match that shape. A repo with an existing convention already answered the question. **And the anchor must survive the repo's merge settings** — a commit SHA dies under `allow_squash_merge`; anchor to the file tree. **A record (a plan, a summary, a decision log) is corrected beside the sentence, dated, not rewritten** — it is also evidence of what was believed |
42
+ | claims, drift | **a suggested fix is checked against precedent, not invented** — grep the repo for how the same kind of staleness was corrected before, and match that shape. A repo with an existing convention already answered the question. **And the anchor must survive the merge** — a commit SHA dies when the target is squash-merged (recorded merge method first); anchor to the file tree. **A record (a plan, a summary, a decision log) is corrected beside the sentence, dated, not rewritten**; a self-declared snapshot (dated banner, executed phase's summary, generated codebase map) is not stale |
43
+ | claims, structure, drift | **a failure that fires only once a later phase's artifact exists is LOW at most**, its `Action` a requirement in that phase's file |
@@ -1,6 +1,11 @@
1
1
  # Stream panel (`wuwei-review` §4)
2
2
 
3
- Runs once, when every phase has merged and before the stream PR reaches main.
3
+ Runs when every phase has merged and before the stream PR reaches main —
4
+ and again, as a delta from the audited sha (the digest records both shas),
5
+ after a phase that **adds scope** after the audit merges (a UAT's new
6
+ feature). A phase that only fixes the audit's own findings gets no panel: the
7
+ collator re-checks each AUDIT.md row against its fix, as the audit's first
8
+ fixes were closed, and records the sha it checked at.
4
9
  Its subject is not a diff — it is **a delivery against the contract that
5
10
  authorised it**, a question no phase review is positioned to ask.
6
11
 
@@ -124,7 +124,7 @@ wuwei's own; lenses report in its columns.
124
124
  Four fresh subagents in one dispatch, **not one reviewer**: a reviewer holding
125
125
  the implementer's context re-reads its own work with every justification
126
126
  already in mind. Each is an agent file, so its tier and its read-only tools
127
- are what dispatch actually reads — not a claim made here.
127
+ are what dispatch reads — not a claim made here.
128
128
 
129
129
  | Reporter | Agent | Asks |
130
130
  |---|---|---|
@@ -149,10 +149,10 @@ but most carry `Bash`, and **`Bash` is bounded by instruction, not by the tool
149
149
  list**: a suite run rewrites snapshots, a build writes artifacts. **A control
150
150
  that needs a write — a mutation, a suite run against it — is taken in the
151
151
  lens's own throwaway worktree of the reviewed sha** (`wuwei worktree <lens>
152
- <sha>`, a path no other lens can pick; `--prune` after), never the
153
- dispatched tree and never another lens's: a
154
- mutation another lens reverts under you reads as "green after mutation", the
155
- second cause below. No worktree → `PLAUSIBLE`, naming the control. Base sync
152
+ <sha>`, a path no other lens can pick; the dispatcher's `--prune <sha>`
153
+ after the panel), never the dispatched tree and never another lens's: a
154
+ mutation another lens reverts under you reads as "green after mutation". No
155
+ worktree → `PLAUSIBLE`, naming the control. Base sync
156
156
  happens before dispatch, by the session dispatching — a reviewer that can move
157
157
  HEAD can change what it was sent to review.
158
158
 
@@ -235,8 +235,7 @@ mismatch between them is visible.
235
235
  Reviewing a document with no diff (`/wuwei-review <path>`) leaves the facts
236
236
  empty: say so, and `review:drift` falls back to the document's own assertions
237
237
  as the things to grep the repo for. **Tell each lens what the others
238
- cover**, the same as §2 — four identical prompts duplicate, four pointed at
239
- each other's gaps complement. **Running a gate is `review:claims`' job**:
238
+ cover**, as in §2. **Running a gate is `review:claims`' job**:
240
239
  another lens that meets one names it for `claims` instead of running it,
241
240
  unless it already ran it for a finding of its own.
242
241
 
@@ -273,10 +272,14 @@ Give the derivation or do not give the number.
273
272
 
274
273
  ## 4. Stream panel
275
274
 
276
- Runs once, when every phase has merged and before the stream PR reaches main
277
- — `--stream`, or asked for in words. **Read `references/stream.md` before
278
- dispatching**: its five audits plus §2 over the composed diff, the coverage
279
- chain, and the `wuwei:` ledger.
275
+ Runs when every phase has merged and before the stream PR reaches main.
276
+ **Read `references/stream.md` before dispatching**: its five audits plus §2
277
+ over the composed diff, the coverage chain, and the `wuwei:` ledger.
278
+
279
+ **Work the audit or a UAT decides on is a new phase, never a hand-cut
280
+ branch** (`wuwei-execute-phase` step 7). A phase fixing the audit's own
281
+ findings: the collator re-checks each AUDIT.md row, no panel. New scope: the
282
+ panel again, a delta from the audited sha.
280
283
 
281
284
  ## 5. Tools
282
285
 
package/wuwei.config.json CHANGED
@@ -24,7 +24,7 @@
24
24
  "skills/wuwei-brainstorm/skill.md": 500,
25
25
  "skills/wuwei-commit-hygiene/skill.md": 200,
26
26
  "skills/wuwei-debug-root-cause/skill.md": 300,
27
- "skills/wuwei-execute-phase/skill.md": 5400,
27
+ "skills/wuwei-execute-phase/skill.md": 5600,
28
28
  "skills/wuwei-grill/skill.md": 600,
29
29
  "skills/wuwei-legible-output/skill.md": 200,
30
30
  "skills/wuwei-map-codebase/skill.md": 1600,