happy-stacks 0.1.2 → 0.3.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/README.md +164 -89
- package/bin/happys.mjs +70 -10
- package/docs/edison.md +381 -0
- package/docs/happy-development.md +733 -0
- package/docs/menubar.md +54 -0
- package/docs/paths-and-env.md +141 -0
- package/docs/stacks.md +39 -0
- package/extras/swiftbar/auth-login.sh +5 -2
- package/extras/swiftbar/git-cache-refresh.sh +130 -0
- package/extras/swiftbar/happy-stacks.5s.sh +131 -81
- package/extras/swiftbar/happys-term.sh +15 -38
- package/extras/swiftbar/happys.sh +15 -32
- package/extras/swiftbar/install.sh +99 -13
- package/extras/swiftbar/lib/git.sh +309 -1
- package/extras/swiftbar/lib/icons.sh +2 -2
- package/extras/swiftbar/lib/render.sh +209 -80
- package/extras/swiftbar/lib/system.sh +27 -4
- package/extras/swiftbar/lib/utils.sh +311 -28
- package/extras/swiftbar/pnpm.sh +2 -1
- package/extras/swiftbar/set-interval.sh +10 -5
- package/extras/swiftbar/set-server-flavor.sh +11 -2
- package/extras/swiftbar/wt-pr.sh +9 -2
- package/package.json +2 -1
- package/scripts/auth.mjs +521 -226
- package/scripts/build.mjs +29 -10
- package/scripts/cli-link.mjs +6 -6
- package/scripts/completion.mjs +18 -11
- package/scripts/daemon.mjs +133 -31
- package/scripts/dev.mjs +196 -137
- package/scripts/doctor.mjs +44 -55
- package/scripts/edison.mjs +1853 -0
- package/scripts/happy.mjs +10 -25
- package/scripts/init.mjs +46 -31
- package/scripts/install.mjs +21 -15
- package/scripts/lint.mjs +124 -0
- package/scripts/menubar.mjs +76 -10
- package/scripts/migrate.mjs +35 -35
- package/scripts/mobile.mjs +24 -17
- package/scripts/run.mjs +122 -35
- package/scripts/self.mjs +13 -35
- package/scripts/server_flavor.mjs +7 -7
- package/scripts/service.mjs +31 -28
- package/scripts/setup.mjs +694 -0
- package/scripts/setup_pr.mjs +165 -0
- package/scripts/stack.mjs +1851 -363
- package/scripts/stop.mjs +9 -6
- package/scripts/tailscale.mjs +23 -11
- package/scripts/test.mjs +123 -0
- package/scripts/tui.mjs +526 -0
- package/scripts/typecheck.mjs +10 -31
- package/scripts/ui_gateway.mjs +3 -3
- package/scripts/uninstall.mjs +21 -13
- package/scripts/utils/auth/dev_key.mjs +163 -0
- package/scripts/utils/auth/files.mjs +56 -0
- package/scripts/utils/auth/handy_master_secret.mjs +68 -0
- package/scripts/utils/auth/login_ux.mjs +76 -0
- package/scripts/utils/auth/sources.mjs +12 -0
- package/scripts/utils/{cli_registry.mjs → cli/cli_registry.mjs} +48 -0
- package/scripts/utils/cli/flags.mjs +17 -0
- package/scripts/utils/cli/normalize.mjs +16 -0
- package/scripts/utils/{smoke_help.mjs → cli/smoke_help.mjs} +2 -2
- package/scripts/utils/{wizard.mjs → cli/wizard.mjs} +1 -1
- package/scripts/utils/crypto/tokens.mjs +14 -0
- package/scripts/utils/dev/daemon.mjs +104 -0
- package/scripts/utils/dev/expo_web.mjs +112 -0
- package/scripts/utils/dev/server.mjs +183 -0
- package/scripts/utils/{config.mjs → env/config.mjs} +8 -3
- package/scripts/utils/{dotenv.mjs → env/dotenv.mjs} +3 -0
- package/scripts/utils/{env.mjs → env/env.mjs} +64 -13
- package/scripts/utils/{env_file.mjs → env/env_file.mjs} +38 -1
- package/scripts/utils/{env_local.mjs → env/env_local.mjs} +1 -0
- package/scripts/utils/env/read.mjs +30 -0
- package/scripts/utils/env/sandbox.mjs +14 -0
- package/scripts/utils/env/values.mjs +13 -0
- package/scripts/utils/{expo.mjs → expo/expo.mjs} +7 -11
- package/scripts/utils/fs/json.mjs +25 -0
- package/scripts/utils/fs/ops.mjs +29 -0
- package/scripts/utils/fs/package_json.mjs +8 -0
- package/scripts/utils/fs/tail.mjs +12 -0
- package/scripts/utils/git/refs.mjs +26 -0
- package/scripts/utils/{worktrees.mjs → git/worktrees.mjs} +60 -4
- package/scripts/utils/net/dns.mjs +10 -0
- package/scripts/utils/{ports.mjs → net/ports.mjs} +3 -5
- package/scripts/utils/paths/canonical_home.mjs +20 -0
- package/scripts/utils/paths/localhost_host.mjs +9 -0
- package/scripts/utils/{paths.mjs → paths/paths.mjs} +14 -8
- package/scripts/utils/{runtime.mjs → paths/runtime.mjs} +4 -4
- package/scripts/utils/proc/commands.mjs +34 -0
- package/scripts/utils/proc/ownership.mjs +135 -0
- package/scripts/utils/proc/package_scripts.mjs +31 -0
- package/scripts/utils/proc/pids.mjs +11 -0
- package/scripts/utils/proc/pm.mjs +317 -0
- package/scripts/utils/{proc.mjs → proc/proc.mjs} +30 -2
- package/scripts/utils/proc/watch.mjs +63 -0
- package/scripts/utils/{happy_server_infra.mjs → server/infra/happy_server_infra.mjs} +109 -94
- package/scripts/utils/server/port.mjs +68 -0
- package/scripts/utils/{server.mjs → server/server.mjs} +36 -0
- package/scripts/utils/server/urls.mjs +91 -0
- package/scripts/utils/{validate.mjs → server/validate.mjs} +1 -1
- package/scripts/utils/service/autostart_darwin.mjs +142 -0
- package/scripts/utils/stack/context.mjs +23 -0
- package/scripts/utils/stack/dirs.mjs +27 -0
- package/scripts/utils/stack/editor_workspace.mjs +152 -0
- package/scripts/utils/stack/names.mjs +12 -0
- package/scripts/utils/stack/runtime_state.mjs +87 -0
- package/scripts/utils/stack/stacks.mjs +45 -0
- package/scripts/utils/stack/startup.mjs +208 -0
- package/scripts/utils/{stack_stop.mjs → stack/stop.mjs} +85 -42
- package/scripts/utils/ui/browser.mjs +22 -0
- package/scripts/utils/ui/text.mjs +16 -0
- package/scripts/where.mjs +17 -10
- package/scripts/worktrees.mjs +110 -64
- package/scripts/utils/pm.mjs +0 -303
- /package/scripts/utils/{args.mjs → cli/args.mjs} +0 -0
- /package/scripts/utils/{cli.mjs → cli/cli.mjs} +0 -0
- /package/scripts/utils/{fs.mjs → fs/fs.mjs} +0 -0
package/docs/edison.md
ADDED
|
@@ -0,0 +1,381 @@
|
|
|
1
|
+
## Edison in `happy-local` (Happy Stacks)
|
|
2
|
+
|
|
3
|
+
This doc explains **what Edison is**, **how it works**, and **how we use it in Happy Stacks** to reliably manage feature work across multiple Happy components (`happy`, `happy-cli`, `happy-server-light`, `happy-server`) while enforcing **stacks + worktrees** discipline.
|
|
4
|
+
|
|
5
|
+
This is intended to be handed to **any human or LLM** and be sufficient to work correctly in this repo.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## What Edison is (in one sentence)
|
|
10
|
+
|
|
11
|
+
**Edison is a task + QA + evidence + validation workflow layer** that standardizes how work is planned, executed, and verified, with generated role prompts (agents/validators/orchestrator) and trusted evidence capture.
|
|
12
|
+
|
|
13
|
+
In `happy-local`, Edison is **integrated** but **not responsible for isolation**; isolation is provided by **Happy Stacks** (component worktrees + stacks).
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Big picture: what provides isolation here
|
|
18
|
+
|
|
19
|
+
In `happy-local`:
|
|
20
|
+
|
|
21
|
+
- **Isolation is provided by Happy Stacks**
|
|
22
|
+
- **Component worktrees** live under `components/.worktrees/<component>/<owner>/<branch...>`
|
|
23
|
+
- **Stacks** live under `~/.happy/stacks/<stack>/...` and each stack has its own ports/db/cli-home/etc.
|
|
24
|
+
- **Edison worktrees are disabled**
|
|
25
|
+
- We do **not** use Edison session worktrees in this repo; they would conflict with Happy Stacks’ worktree model.
|
|
26
|
+
|
|
27
|
+
This means:
|
|
28
|
+
|
|
29
|
+
- You must **never edit** default checkouts under `components/<component>` (treat as read-only “launcher defaults”).
|
|
30
|
+
- All work must happen in **component worktrees** and be tested/validated inside the correct **stack**.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Sessions in `happy-local` (important)
|
|
35
|
+
|
|
36
|
+
Edison “sessions” still exist in `happy-local`, but **they do not create git worktrees** here because Edison worktrees are disabled (`.edison/config/worktrees.yml`).
|
|
37
|
+
|
|
38
|
+
Think of sessions in this repo as:
|
|
39
|
+
|
|
40
|
+
- **Ownership + safety gating** for task lifecycle transitions (claim/done)
|
|
41
|
+
- **Optional context** for validation bundling and session-scoped task queues
|
|
42
|
+
|
|
43
|
+
### What sessions do (and don’t) do here
|
|
44
|
+
|
|
45
|
+
- **Sessions do**:
|
|
46
|
+
- allow safely claiming tasks into a session (`task claim`)
|
|
47
|
+
- gate completing tasks (`task done` requires a session)
|
|
48
|
+
- optionally move tasks/QA into session-scoped directories under `.project/sessions/...`
|
|
49
|
+
- **Sessions do not**:
|
|
50
|
+
- create/manage git worktrees (Happy Stacks handles worktrees)
|
|
51
|
+
- persist “current session” via `.project/.session-id` (Edison only writes that inside a git worktree)
|
|
52
|
+
- Outside worktrees, prefer passing `--session <id>` or setting `AGENTS_SESSION=<id>` for your shell.
|
|
53
|
+
|
|
54
|
+
### Commands that require a session vs not
|
|
55
|
+
|
|
56
|
+
- **Requires a session**:
|
|
57
|
+
- `happys edison -- task claim <task-id> --session <session-id>`
|
|
58
|
+
- `happys edison -- task done <task-id> --session <session-id>`
|
|
59
|
+
- **Does NOT require a session**:
|
|
60
|
+
- Evidence capture: `happys edison --stack=<stack> -- evidence capture <task-id>`
|
|
61
|
+
- Validation: `happys edison --stack=<stack> -- qa validate <task-id> --execute`
|
|
62
|
+
|
|
63
|
+
### Recommended flow (implementation)
|
|
64
|
+
|
|
65
|
+
Use sessions for ownership, and Happy Stacks for isolation:
|
|
66
|
+
|
|
67
|
+
- Create a session (no worktree will be created in this repo):
|
|
68
|
+
- `happys edison -- session create --id <session-id>`
|
|
69
|
+
- Claim **component** tasks into that session:
|
|
70
|
+
- `happys edison -- task claim <task-id> --session <session-id>`
|
|
71
|
+
- Implement only in the stack’s pinned component worktrees.
|
|
72
|
+
- Mark done when finished:
|
|
73
|
+
- `happys edison -- task done <task-id> --session <session-id>`
|
|
74
|
+
|
|
75
|
+
### Recommended flow (validation-only)
|
|
76
|
+
|
|
77
|
+
If you’re only validating existing tasks, you generally **do not need to create a session**:
|
|
78
|
+
|
|
79
|
+
- `happys edison --stack=<stack> -- evidence capture <task-id>`
|
|
80
|
+
- `happys edison --stack=<stack> -- qa validate <task-id> --execute`
|
|
81
|
+
|
|
82
|
+
Note: a **parent task is not a session**. Parent tasks are planning umbrellas; sessions are for “who is working on what right now” and guarded claim/done transitions.
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## The one correct entrypoint: `happys edison`
|
|
87
|
+
|
|
88
|
+
**Do not run `edison ...` directly** in `happy-local`.
|
|
89
|
+
|
|
90
|
+
Use:
|
|
91
|
+
|
|
92
|
+
- `happys edison -- <edison args...>`
|
|
93
|
+
- `happys edison --stack=<stack> -- <edison args...>` (recommended)
|
|
94
|
+
|
|
95
|
+
Why this wrapper is mandatory:
|
|
96
|
+
|
|
97
|
+
- **Stack-scoped execution**: exports `HAPPY_STACKS_STACK` + loads the stack env file
|
|
98
|
+
- **Multi-repo evidence fingerprinting**: evidence is keyed off the actual component repos the stack points at
|
|
99
|
+
- **Fail-closed guardrails**: happy-stacks guards require the right stack + task metadata
|
|
100
|
+
- **Convenience**: **stack auto-inference** from task/QA frontmatter when a task/QA id is present
|
|
101
|
+
|
|
102
|
+
Reference:
|
|
103
|
+
|
|
104
|
+
- `.edison/guidelines/agents/HAPPY_STACKS_EDISON_WRAPPER.md`
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## Where Edison stores things in this repo
|
|
109
|
+
|
|
110
|
+
- **Config + overlays**: `.edison/`
|
|
111
|
+
- Project config: `.edison/config/*.yml`
|
|
112
|
+
- Project validator overlays: `.edison/validators/overlays/*.md`
|
|
113
|
+
- Happy Stacks pack: `.edison/packs/happy-stacks/`
|
|
114
|
+
- **Generated content** (do not edit): `.edison/_generated/`
|
|
115
|
+
- Agents/validators/constitutions/guidelines/start prompts, etc.
|
|
116
|
+
- **Tasks/QA state** (gitignored here):
|
|
117
|
+
- Global tasks: `.project/tasks/<state>/*.md`
|
|
118
|
+
- Global QA: `.project/qa/<state>/*.md`
|
|
119
|
+
- Session-scoped tasks/QA (optional): `.project/sessions/**/{tasks|qa}/...`
|
|
120
|
+
|
|
121
|
+
Note: `.project/` is gitignored in this repo by design (task/QA state is local for now).
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## Happy Stacks task model (MANDATORY)
|
|
126
|
+
|
|
127
|
+
We enforce a strict structure so stacks/worktrees are never “forgotten”:
|
|
128
|
+
|
|
129
|
+
### Parent → Track → Component
|
|
130
|
+
|
|
131
|
+
- **Parent task** (`hs_kind: parent`)
|
|
132
|
+
- Planning umbrella for a feature
|
|
133
|
+
- Declares: `components: [...]`
|
|
134
|
+
- **Not claimable**
|
|
135
|
+
- **Track task** (`hs_kind: track`)
|
|
136
|
+
- Child of a parent
|
|
137
|
+
- Owns exactly **one stack** (one stack per track)
|
|
138
|
+
- Declares: `track: upstream|fork|integration`, `stack: <name>`, `components: [...]`, `base_task: <parent-id>`
|
|
139
|
+
- **Component task** (`hs_kind: component`)
|
|
140
|
+
- Child of a track
|
|
141
|
+
- Targets exactly **one component**: `component: happy` (or `happy-cli`, etc.)
|
|
142
|
+
- Declares: `stack: <same as track>`, `base_task`, `base_worktree`
|
|
143
|
+
|
|
144
|
+
This is enforced by happy-stacks guards:
|
|
145
|
+
|
|
146
|
+
- `.edison/packs/happy-stacks/guards/task.py`
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## Planning a feature (recommended workflow)
|
|
151
|
+
|
|
152
|
+
### 1) Read the “planning slash command”
|
|
153
|
+
|
|
154
|
+
Use:
|
|
155
|
+
|
|
156
|
+
- `happys edison -- read START_PLAN_FEATURE --type start`
|
|
157
|
+
|
|
158
|
+
### 2) Create a parent task
|
|
159
|
+
|
|
160
|
+
Create the task, then fill mandatory frontmatter:
|
|
161
|
+
|
|
162
|
+
- `happys edison -- task new --id <id> --slug <slug>`
|
|
163
|
+
|
|
164
|
+
Edit the created task file to set:
|
|
165
|
+
|
|
166
|
+
- `hs_kind: parent`
|
|
167
|
+
- `components: [...]`
|
|
168
|
+
|
|
169
|
+
### 3) Scaffold everything (preferred)
|
|
170
|
+
|
|
171
|
+
Use:
|
|
172
|
+
|
|
173
|
+
- `happys edison task:scaffold <parent-task-id> --mode=upstream|fork|both --yes`
|
|
174
|
+
|
|
175
|
+
This will (idempotently):
|
|
176
|
+
|
|
177
|
+
- create track + component subtasks
|
|
178
|
+
- create stacks for tracks
|
|
179
|
+
- create component worktrees
|
|
180
|
+
- pin the stack to those worktrees
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
## Implementing a component task (agent workflow)
|
|
185
|
+
|
|
186
|
+
### Non-negotiables
|
|
187
|
+
|
|
188
|
+
- Work only inside `components/.worktrees/...`
|
|
189
|
+
- Run validation/evidence **stack-scoped**
|
|
190
|
+
- Use `happys` commands (not raw `pnpm/yarn/expo/docker`)
|
|
191
|
+
|
|
192
|
+
### Evidence capture (trusted runner)
|
|
193
|
+
|
|
194
|
+
Evidence must be captured via Edison (snapshot-based, fingerprinted):
|
|
195
|
+
|
|
196
|
+
- `happys edison --stack=<stack> -- evidence capture <task-id>`
|
|
197
|
+
|
|
198
|
+
For reviewing evidence, prefer the CLI (it is staleness-aware):
|
|
199
|
+
|
|
200
|
+
- `happys edison --stack=<stack> -- evidence status <task-id> --preset <preset>`
|
|
201
|
+
- `happys edison --stack=<stack> -- evidence show <task-id> --command <ci-command>`
|
|
202
|
+
|
|
203
|
+
Evidence commands are configured in:
|
|
204
|
+
|
|
205
|
+
- `.edison/config/ci.yml`
|
|
206
|
+
|
|
207
|
+
They call stack-scoped commands like:
|
|
208
|
+
|
|
209
|
+
- `happys stack typecheck <stack> [components...]`
|
|
210
|
+
- `happys stack lint <stack> [components...]`
|
|
211
|
+
- `happys stack build <stack>`
|
|
212
|
+
- `happys stack test <stack> [components...]`
|
|
213
|
+
|
|
214
|
+
### Validation presets (project policy)
|
|
215
|
+
|
|
216
|
+
Configured in:
|
|
217
|
+
|
|
218
|
+
- `.edison/config/validation.yml`
|
|
219
|
+
|
|
220
|
+
Presets:
|
|
221
|
+
|
|
222
|
+
- **fast**: typecheck + build + lint + **track drift review**
|
|
223
|
+
- **standard**: typecheck + build + lint + tests + **track drift review** (implementation evidence)
|
|
224
|
+
- **standard-validate**: **standard** + **CodeRabbit review evidence** (validation-only)
|
|
225
|
+
- **fast-ui**: fast + **browser UI validation** + **track drift review** (for tasks that include component `happy`)
|
|
226
|
+
- **standard-ui**: standard + **browser UI validation** + **track drift review** (implementation evidence)
|
|
227
|
+
- **standard-ui-validate**: **standard-ui** + **CodeRabbit review evidence** (validation-only)
|
|
228
|
+
- **quick**: docs-only (no command evidence)
|
|
229
|
+
|
|
230
|
+
#### CodeRabbit evidence policy (Happy Stacks)
|
|
231
|
+
|
|
232
|
+
- CodeRabbit runs as **command evidence** (`command-coderabbit.txt`), not as an Edison validator.
|
|
233
|
+
- It is **mandatory for execute-mode task validation**:
|
|
234
|
+
- `happys edison --stack=<stack> -- qa validate <task-id> --execute --preset standard-validate`
|
|
235
|
+
- It **does not run automatically**. When preflight reports it missing, capture it explicitly:
|
|
236
|
+
|
|
237
|
+
```bash
|
|
238
|
+
happys edison --stack=<stack> -- evidence capture <task-id> --preset standard-validate --only coderabbit
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
Note: `qa run` (single-validator execution) also enforces validation-only evidence in happy-local:
|
|
242
|
+
|
|
243
|
+
- `happys edison --stack=<stack> -- qa run <validator> <task-id>`
|
|
244
|
+
- If required evidence (including CodeRabbit for the `*-validate` presets) is missing, the wrapper will refuse and tell you exactly which `evidence capture` command to run.
|
|
245
|
+
|
|
246
|
+
Track drift review is intentionally fast:
|
|
247
|
+
|
|
248
|
+
- `track:coherence` is captured as **command evidence** (`command-track-coherence.txt`).
|
|
249
|
+
- The `track-drift-review` validator should **read that evidence** and should not re-run `track:coherence` unless evidence is missing/broken.
|
|
250
|
+
|
|
251
|
+
Additionally, for “what changed?” review:
|
|
252
|
+
|
|
253
|
+
- `command-task-diff.txt` captures the **full per-component diff** computed inside the stack-pinned component repos.
|
|
254
|
+
- It detects the correct base ref per repo (using the stack’s configured remote default branch, e.g. `upstream/<defaultBranch>`).
|
|
255
|
+
- Validators should treat this as the canonical “PR diff” view for code review.
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
## Browser “E2E” validator (MCP-driven UI validation)
|
|
260
|
+
|
|
261
|
+
In this repo, the `browser-e2e` validator is **not** “run Playwright test files”.
|
|
262
|
+
|
|
263
|
+
It is:
|
|
264
|
+
|
|
265
|
+
- **Start stack if needed** (Edison web server lifecycle)
|
|
266
|
+
- **Navigate the real UI** and validate flows using **Playwright MCP browser tools**
|
|
267
|
+
|
|
268
|
+
Key wiring:
|
|
269
|
+
|
|
270
|
+
- Validator prompt is composed from the core `e2e-web` pack plus a Happy overlay:
|
|
271
|
+
- Overlay: `.edison/validators/overlays/browser-e2e.md`
|
|
272
|
+
- Stack lifecycle config:
|
|
273
|
+
- `.edison/config/validation.yml`:
|
|
274
|
+
- `validation.web_servers.happy-stack` (and alias `browser-e2e`)
|
|
275
|
+
- `validation.validators.browser-e2e.web_server.ref: browser-e2e`
|
|
276
|
+
|
|
277
|
+
Important behavior:
|
|
278
|
+
|
|
279
|
+
- Edison probes the stack URL (`/health`) and starts the stack if unreachable.
|
|
280
|
+
- Edison stops the stack **only if Edison started it**.
|
|
281
|
+
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
## Validation workflow (validators / humans)
|
|
285
|
+
|
|
286
|
+
Start with:
|
|
287
|
+
|
|
288
|
+
- `happys edison -- read START_VALIDATE_TASK --type start`
|
|
289
|
+
|
|
290
|
+
Common commands:
|
|
291
|
+
|
|
292
|
+
- **Show task / QA**:
|
|
293
|
+
- `happys edison -- task show <task-id>`
|
|
294
|
+
- `happys edison -- qa show <qa-id>`
|
|
295
|
+
- **Evidence status**:
|
|
296
|
+
- `happys edison --stack=<stack> -- evidence status <task-id>`
|
|
297
|
+
- **Run validators**:
|
|
298
|
+
- `happys edison --stack=<stack> -- qa validate <task-id> --execute --preset fast|standard`
|
|
299
|
+
|
|
300
|
+
---
|
|
301
|
+
|
|
302
|
+
## How stack auto-inference works (wrapper convenience)
|
|
303
|
+
|
|
304
|
+
If you run `happys edison -- ... <task-id-or-qa-id> ...` without `--stack`,
|
|
305
|
+
the wrapper will try to infer `stack:` from frontmatter by searching:
|
|
306
|
+
|
|
307
|
+
- `.project/tasks/**`
|
|
308
|
+
- `.project/qa/**`
|
|
309
|
+
- `.project/sessions/**/{tasks|qa}/**`
|
|
310
|
+
|
|
311
|
+
If inference fails, prefer explicit `--stack=<stack>`.
|
|
312
|
+
|
|
313
|
+
---
|
|
314
|
+
|
|
315
|
+
## Operational commands you’ll use a lot (Happy Stacks)
|
|
316
|
+
|
|
317
|
+
- **Pick worktrees**:
|
|
318
|
+
- `happys wt new ...`
|
|
319
|
+
- `happys wt pr ... --use`
|
|
320
|
+
- `happys stack wt <stack> -- use <component> <owner/branch>`
|
|
321
|
+
- **Health / diagnosis**:
|
|
322
|
+
- `happys stack doctor <stack>`
|
|
323
|
+
- **Auth repair (non-interactive)**:
|
|
324
|
+
- `happys stack auth <stack> copy-from <seed>`
|
|
325
|
+
|
|
326
|
+
- **Dev UI login key (agents should only consume, not create)**:
|
|
327
|
+
- `happys auth dev-key --print`
|
|
328
|
+
- **Stop stacks (safe)**:
|
|
329
|
+
- `happys stop --except-stacks=main --yes`
|
|
330
|
+
|
|
331
|
+
See `AGENTS.md` for the full, canonical Happy Stacks discipline.
|
|
332
|
+
|
|
333
|
+
---
|
|
334
|
+
|
|
335
|
+
## Customization points (where to change behavior safely)
|
|
336
|
+
|
|
337
|
+
### Project configuration
|
|
338
|
+
|
|
339
|
+
- Evidence commands: `.edison/config/ci.yml`
|
|
340
|
+
- Validation presets + web server profiles: `.edison/config/validation.yml`
|
|
341
|
+
- Enabled packs: `.edison/config/packs.yml`
|
|
342
|
+
- Edison worktrees disabled: `.edison/config/worktrees.yml`
|
|
343
|
+
- Task/QA templates used for creation (project-owned): `.edison/config/tasks.yml`
|
|
344
|
+
|
|
345
|
+
### Project templates (task/QA creation)
|
|
346
|
+
|
|
347
|
+
These are used by Edison when creating new task/QA markdown files:
|
|
348
|
+
|
|
349
|
+
- `.edison/templates/happy-stacks/TASK.md`
|
|
350
|
+
- `.edison/templates/happy-stacks/QA.md`
|
|
351
|
+
|
|
352
|
+
### Happy-local overlays
|
|
353
|
+
|
|
354
|
+
- Validator overlay (adds Happy-specific rules): `.edison/validators/overlays/browser-e2e.md`
|
|
355
|
+
- Happy Stacks pack overlays + guards: `.edison/packs/happy-stacks/**`
|
|
356
|
+
|
|
357
|
+
---
|
|
358
|
+
|
|
359
|
+
## Common failure modes (and what to do)
|
|
360
|
+
|
|
361
|
+
- **“Do not run `edison ...` directly”**
|
|
362
|
+
- Fix: use `happys edison -- ...` (or `--stack=<stack>`)
|
|
363
|
+
- **Auth missing / machine not registered**
|
|
364
|
+
- Fix: `happys stack auth <stack> copy-from <seed>` (recommended seed: `dev-auth`)
|
|
365
|
+
- **Stack port collisions / foreign component paths**
|
|
366
|
+
- Fix: `happys stack audit --fix-workspace --fix-paths --fix-ports`
|
|
367
|
+
- **Browser validator can’t reach server**
|
|
368
|
+
- Fix: run stack doctor, ensure you’re in the correct stack context, and re-run validation:
|
|
369
|
+
- `happys stack doctor <stack>`
|
|
370
|
+
- `happys edison --stack=<stack> -- qa validate <task-id> --execute`
|
|
371
|
+
|
|
372
|
+
---
|
|
373
|
+
|
|
374
|
+
## Appendix: quick “start here” for an LLM
|
|
375
|
+
|
|
376
|
+
1. Read repo discipline: `AGENTS.md`
|
|
377
|
+
2. Start prompt: `happys edison -- read START_HAPPY_STACKS_NEW_SESSION --type start`
|
|
378
|
+
3. Plan feature: `happys edison -- read START_PLAN_FEATURE --type start`
|
|
379
|
+
4. Scaffold: `happys edison task:scaffold <parent-task-id> --mode=upstream|fork|both --yes`
|
|
380
|
+
5. Implement only in component worktrees + validate via stack-scoped evidence:
|
|
381
|
+
- `happys edison --stack=<stack> -- evidence capture <task-id>`
|