@webpieces/rules-config 0.4.677 → 0.4.679

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.
@@ -0,0 +1,91 @@
1
+ # AI-Assisted Squash-Merge Conflict Resolution (generated)
2
+
3
+ {{RUN_STATE}}
4
+
5
+ ## How the gate works
6
+
7
+ - Resolve every conflicted file in the working tree.
8
+ - Run **`pnpm {{FINISH_COMMAND}}`** — the validation + finish gate. It scans for leftover conflict
9
+ markers, checks each conflicted file has a written merge explanation, validates, and commits the
10
+ merge. It is the paired half of `{{START_COMMAND}}` — never finish with the other flow's command
11
+ (`wp-start-update` pairs with `wp-finish-update`; `wp-start-upsert-pr` pairs with
12
+ `wp-finish-upsert-pr`, which additionally runs the `nx affected` build, renders the dashboard,
13
+ and creates/updates the PR).
14
+ - **DO `git add` each file you resolve.** Staging your resolutions is your job, not the gate's, and
15
+ `git add` is **not** blocked by any guard. The gate stages with `git add -u`, which only re-stages
16
+ already-tracked paths — leave a resolution unstaged and the gate stops with "Git still reports
17
+ unmerged files" and sends you back to `git add` it.
18
+ - **Do NOT run `git commit` / `git push` / `gh pr create|edit|merge` yourself** (nor `git merge` /
19
+ `git rebase`). The `merge-in-progress-guard` hook blocks exactly those until the gate validates.
20
+ The gate does the commit. See `webpieces.git-workflow.md` → "Outcome B — CONFLICT merge" for the
21
+ full who-does-what; this file does not restate it.
22
+
23
+ ## STEP 1 — Load the merge context
24
+
25
+ Per conflicted file, `MERGE_DIR/updatemain-<safe_path>/` holds (`<safe_path>` = path with `/`→`__`):
26
+
27
+ ```
28
+ A-forkpoint.txt # file at fork point (base)
29
+ B-feature.txt # file on your feature branch
30
+ C-main.txt # file on main
31
+ B-A.diff # what your feature changed (B−A)
32
+ C-A.diff # what main changed (C−A)
33
+ ```
34
+
35
+ `updatemain-hashes.json` holds A/B/C commit hashes. To see why main changed:
36
+ `git log <A>..<C> --oneline`.
37
+
38
+ Why A/B/C are trustworthy here — and why you must never `git merge`/`git rebase` main in yourself —
39
+ is the fork-point invariant: see `webpieces.git-workflow.md` → "THE FORK POINT INVARIANT". Read it
40
+ once if `B-A.diff` or `C-A.diff` ever shows you changes you do not recognize; that is the symptom
41
+ of a polluted fork point, not of a bad diff.
42
+
43
+ ## STEP 2 — Resolve each conflicted file
44
+
45
+ For each file: read the working-tree file (the markers) and its `B-A.diff` / `C-A.diff` (intent),
46
+ then Edit to the resolved version, removing ALL conflict markers.
47
+
48
+ Strategies: goals align & non-overlapping → merge both · one side removes what the other modifies
49
+ → prefer the removal · same lines, simple (imports/format) → merge both · same lines, complex or
50
+ conflicting goals → ask the user · feature re-implements what main already squashed → prefer
51
+ main's, then re-apply only the genuinely new feature work.
52
+
53
+ **Then write a merge explanation** for each conflicted file — NOT a comment in the source (that
54
+ breaks for JSON and deleted files). Write it next to that file's diffs, at:
55
+
56
+ ```
57
+ MERGE_DIR/updatemain-<safe_path>/{{EXPLANATION_FILE}}
58
+ ```
59
+
60
+ (`<safe_path>` = the conflict file path with `/` → `__`, the same dir that holds its
61
+ `A-forkpoint.txt` / `B-A.diff` / `C-A.diff`.) In it, explain in a few sentences how you resolved
62
+ this file: which side you took where, what you combined from B-A.diff vs C-A.diff, and why. The
63
+ gate fails if any conflicted file's explanation is missing or empty. Do not paste A/B/C context
64
+ blocks into the source code.
65
+
66
+ ## STEP 3 — Run the gate (validates the merge AND finalizes it)
67
+
68
+ ```
69
+ pnpm {{FINISH_COMMAND}}
70
+ ```
71
+
72
+ - Leftover conflict markers → fix those files and re-run.
73
+ - Missing merge explanation → write it (see STEP 2) and re-run.
74
+ - Build failure → fix the TypeScript/lint errors and re-run (the gate re-stages for you).
75
+ - Missing review.json (PR flow only) → write it in the printed format (your PR review), then re-run.
76
+ - On success it commits and finalizes the merge (in the PR flow it also renders the dashboard and
77
+ creates/updates the PR).
78
+
79
+ ## Conflicted files
80
+
81
+ {{FILE_LIST}}
82
+
83
+ ## If you need to bail out
84
+
85
+ A numbered backup branch was created (e.g. `<feature>PreMerge1`). To abandon:
86
+
87
+ ```
88
+ git merge --abort 2>/dev/null; git checkout <feature> ; git branch -D {{SQUASH_BRANCH}}
89
+ ```
90
+
91
+ Then delete `{{MERGE_DIR}}/` for a clean slate.