safeword 0.40.1 → 0.41.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.
package/package.json
CHANGED
package/templates/SAFEWORD.md
CHANGED
|
@@ -20,7 +20,12 @@ Each turn:
|
|
|
20
20
|
4. Incorporate what the user confirmed; narrow the open set.
|
|
21
21
|
5. When zero open questions remain and the user accepts → advance.
|
|
22
22
|
|
|
23
|
-
Research before proposing anything significant
|
|
23
|
+
Research before proposing anything significant — and the order is load-bearing:
|
|
24
|
+
|
|
25
|
+
1. **Frame** the problem and its hard constraints: prior tickets, the data model, non-negotiable framework idioms. Don't read the soft conventions yet.
|
|
26
|
+
2. **Design the ideal.** Run `/figure-it-out` to weigh 2-3 options on correctness, simplicity, and no-bloat, and pick the best architecture _as if the codebase didn't exist_. Computing this first gives the next step a yardstick.
|
|
27
|
+
3. **Survey the existing patterns** in the area you're about to touch — now, not before. Surveying earlier anchors the design to the status quo and quietly shrinks it to match.
|
|
28
|
+
4. **Reconcile.** Conform to the existing pattern by default — deviate only when the ideal is a real improvement, not taste. When your ideal diverges from what exists, record the call: to deviate, name a concrete defect of the existing pattern the ideal fixes, the call-site count you're splitting, a one-line pre-mortem ("assume this was wrong — what broke?"), and the follow-up ticket to uplevel the rest. Reversible and local → a few lines in the ticket; irreversible or cross-cutting (data model, public API) → promote to an ADR. See `./.safeword/guides/architecture-guide.md`.
|
|
24
29
|
|
|
25
30
|
Depth scales with ambiguity. Clear request → 0 turns. One open question → 1 turn. Vague idea → 2-3 turns of increasingly specific proposals.
|
|
26
31
|
|
|
@@ -102,8 +102,11 @@ The Status section uses the existing Verify Checklist format. Format with these
|
|
|
102
102
|
**Scenarios:** All N scenarios marked complete (or ❌ X/Y complete, or ⏭️ Skipped — no ticket)
|
|
103
103
|
**Dep Drift:** ✅ Clean (or ⚠️ N undocumented deps, or ⏭️ Skipped — no ARCHITECTURE.md)
|
|
104
104
|
**Parent Epic:** {id} (siblings: X/Y done) or N/A
|
|
105
|
+
**Reconcile:** ✅ No pattern deviation (or ⚠️ N deviations, M missing uplevel ticket — soft, never blocks)
|
|
105
106
|
```
|
|
106
107
|
|
|
108
|
+
**Reconcile** is soft — it never blocks the done gate. If the work introduced a pattern that diverges from existing siblings (see `.safeword/guides/architecture-guide.md` → Survey & Reconcile), confirm the ticket carries a reconcile record and every deviation has an uplevel follow-up ticket; flag any that don't. Use `N/A` when the work conformed or introduced no new pattern.
|
|
109
|
+
|
|
107
110
|
**Done-gate evidence patterns** (the stop hook validates these literal phrases — do not move or rename):
|
|
108
111
|
|
|
109
112
|
- `✓ X/X tests pass` — proves test suite ran
|
|
@@ -4,6 +4,48 @@
|
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
+
## Survey & Reconcile (Before You Propose)
|
|
8
|
+
|
|
9
|
+
The order is load-bearing (full version in `@.safeword/SAFEWORD.md` → Clarify):
|
|
10
|
+
|
|
11
|
+
1. **Frame** the hard constraints — data model, non-negotiable framework idioms, prior decisions.
|
|
12
|
+
2. **Design the ideal** with `/figure-it-out`, as if the codebase didn't exist. This is your yardstick.
|
|
13
|
+
3. **Survey** the existing patterns in the area — _now_, not before. Surveying first anchors the design to the status quo.
|
|
14
|
+
4. **Reconcile** — conform by default; record the call when your ideal diverges.
|
|
15
|
+
|
|
16
|
+
### Survey: what to look for
|
|
17
|
+
|
|
18
|
+
- **Sibling implementations** — grep the layer/feature for code that solves the same shape of problem. How is it structured?
|
|
19
|
+
- **Prior decisions** — search `ARCHITECTURE.md` and tickets for an existing ruling on this pattern.
|
|
20
|
+
- **Tests near the code** — they encode the conventions you'd be expected to match.
|
|
21
|
+
- **Call-site count** — how many places use the existing pattern? Write the number down; it is the cost of deviating.
|
|
22
|
+
|
|
23
|
+
### Reconcile: conform by default
|
|
24
|
+
|
|
25
|
+
Default to the existing pattern. Per Google's code-review standard, conform "as long as that doesn't worsen the overall code health of the system" — deviate only when your ideal is a _real_ improvement, not your taste.
|
|
26
|
+
|
|
27
|
+
**Ideal and existing agree → no decision, no record.** When they diverge, record the call (below). You can't silently conform your ideal away (that is how mediocre patterns calcify), and you can't silently deviate (that is how a codebase splits in two).
|
|
28
|
+
|
|
29
|
+
### The reconcile record
|
|
30
|
+
|
|
31
|
+
Required only when the ideal diverges from what exists:
|
|
32
|
+
|
|
33
|
+
| Field | Notes |
|
|
34
|
+
| --------------------------- | --------------------------------------------------------------------------------------------------------------- |
|
|
35
|
+
| **Direction** | Conform, or deviate |
|
|
36
|
+
| **Reason** | The load-bearing why |
|
|
37
|
+
| **Health defect** (deviate) | A _named_ failure of the existing pattern the ideal fixes. "Cleaner" is not a defect. |
|
|
38
|
+
| **Inconsistency cost** | The call-site count you're splitting (from the survey) |
|
|
39
|
+
| **Pre-mortem** | One line: "assume deviating was wrong — what broke?" Prospective hindsight surfaces costs you're discounting. |
|
|
40
|
+
| **Uplevel ticket** | The tracked follow-up to migrate the rest. Track it; don't migrate every call site now (avoid the rabbit-hole). |
|
|
41
|
+
|
|
42
|
+
**Depth scales with reversibility:**
|
|
43
|
+
|
|
44
|
+
- **Reversible + local** → the record is a few lines in the ticket.
|
|
45
|
+
- **Irreversible or cross-cutting** (data model, public API) → promote to a full Architecture Doc decision (What / Why / Trade-off / Alternatives, below) and get a second opinion that tries to _refute_ the deviation before committing.
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
7
49
|
## Document Type Decision Tree (Follow in Order)
|
|
8
50
|
|
|
9
51
|
Answer **IN ORDER**. Stop at the first "Yes":
|
|
@@ -99,6 +99,8 @@ If any answer is vague, you have open questions — surface them.
|
|
|
99
99
|
|
|
100
100
|
**When the feature leans on a library or framework** — read the installed version's docs before proposing API shapes or done-when criteria. Scope baked on training memory of a different version is silently wrong. Check `package.json` / lockfile first, then the source wired up (Context7, official docs, README at the pinned ref).
|
|
101
101
|
|
|
102
|
+
**When the feature introduces architecture or a new pattern** — design the ideal first (`/figure-it-out`), _then_ survey the existing patterns in the area and reconcile: conform by default, deviate only with a named defect and an uplevel follow-up ticket. See `.safeword/guides/architecture-guide.md` → Survey & Reconcile.
|
|
103
|
+
|
|
102
104
|
## Worked example: Phase 0 end to end
|
|
103
105
|
|
|
104
106
|
One feature walked through all four artifacts and every sub-phase gate. Slug `oauth-flow`: let an operator rotate an API key without a coordinated flag day.
|
|
@@ -106,8 +106,11 @@ The Status section uses the existing Verify Checklist format. Format with these
|
|
|
106
106
|
**Scenarios:** All N scenarios marked complete (or ❌ X/Y complete, or ⏭️ Skipped — no ticket)
|
|
107
107
|
**Dep Drift:** ✅ Clean (or ⚠️ N undocumented deps, or ⏭️ Skipped — no ARCHITECTURE.md)
|
|
108
108
|
**Parent Epic:** {id} (siblings: X/Y done) or N/A
|
|
109
|
+
**Reconcile:** ✅ No pattern deviation (or ⚠️ N deviations, M missing uplevel ticket — soft, never blocks)
|
|
109
110
|
```
|
|
110
111
|
|
|
112
|
+
**Reconcile** is soft — it never blocks the done gate. If the work introduced a pattern that diverges from existing siblings (see `.safeword/guides/architecture-guide.md` → Survey & Reconcile), confirm the ticket carries a reconcile record and every deviation has an uplevel follow-up ticket; flag any that don't. Use `N/A` when the work conformed or introduced no new pattern.
|
|
113
|
+
|
|
111
114
|
**Done-gate evidence patterns** (the stop hook validates these literal phrases — do not move or rename):
|
|
112
115
|
|
|
113
116
|
- `✓ X/X tests pass` — proves test suite ran
|