happy-stacks 0.3.0 → 0.5.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 (165) hide show
  1. package/README.md +93 -40
  2. package/bin/happys.mjs +158 -16
  3. package/docs/codex-mcp-resume.md +130 -0
  4. package/docs/commit-audits/happy/leeroy-wip.commit-analysis.md +17640 -0
  5. package/docs/commit-audits/happy/leeroy-wip.commit-export.fuller-stat.md +3845 -0
  6. package/docs/commit-audits/happy/leeroy-wip.commit-inventory.md +102 -0
  7. package/docs/commit-audits/happy/leeroy-wip.commit-manual-review.md +1452 -0
  8. package/docs/commit-audits/happy/leeroy-wip.manual-review-queue.md +116 -0
  9. package/docs/happy-development.md +3 -4
  10. package/docs/isolated-linux-vm.md +82 -0
  11. package/docs/mobile-ios.md +112 -54
  12. package/docs/monorepo-migration.md +286 -0
  13. package/docs/server-flavors.md +19 -3
  14. package/docs/stacks.md +35 -0
  15. package/package.json +5 -1
  16. package/scripts/auth.mjs +32 -10
  17. package/scripts/build.mjs +55 -8
  18. package/scripts/daemon.mjs +166 -10
  19. package/scripts/dev.mjs +198 -50
  20. package/scripts/doctor.mjs +0 -4
  21. package/scripts/edison.mjs +6 -4
  22. package/scripts/env.mjs +150 -0
  23. package/scripts/env_cmd.test.mjs +128 -0
  24. package/scripts/init.mjs +8 -3
  25. package/scripts/install.mjs +207 -69
  26. package/scripts/lint.mjs +24 -4
  27. package/scripts/migrate.mjs +3 -12
  28. package/scripts/mobile.mjs +88 -104
  29. package/scripts/mobile_dev_client.mjs +83 -0
  30. package/scripts/monorepo.mjs +1096 -0
  31. package/scripts/monorepo_port.test.mjs +1470 -0
  32. package/scripts/provision/linux-ubuntu-review-pr.sh +51 -0
  33. package/scripts/review.mjs +908 -0
  34. package/scripts/review_pr.mjs +353 -0
  35. package/scripts/run.mjs +101 -21
  36. package/scripts/service.mjs +2 -2
  37. package/scripts/setup.mjs +189 -68
  38. package/scripts/setup_pr.mjs +586 -38
  39. package/scripts/stack.mjs +990 -196
  40. package/scripts/stack_archive_cmd.test.mjs +91 -0
  41. package/scripts/stack_editor_workspace_monorepo_root.test.mjs +65 -0
  42. package/scripts/stack_env_cmd.test.mjs +87 -0
  43. package/scripts/stack_happy_cmd.test.mjs +126 -0
  44. package/scripts/stack_interactive_monorepo_group.test.mjs +71 -0
  45. package/scripts/stack_monorepo_defaults.test.mjs +62 -0
  46. package/scripts/stack_monorepo_server_light_from_happy_spec.test.mjs +66 -0
  47. package/scripts/stack_server_flavors_defaults.test.mjs +55 -0
  48. package/scripts/stack_shorthand_cmd.test.mjs +55 -0
  49. package/scripts/stack_wt_list.test.mjs +128 -0
  50. package/scripts/tailscale.mjs +37 -1
  51. package/scripts/test.mjs +45 -8
  52. package/scripts/tui.mjs +395 -39
  53. package/scripts/typecheck.mjs +24 -4
  54. package/scripts/utils/auth/daemon_gate.mjs +55 -0
  55. package/scripts/utils/auth/daemon_gate.test.mjs +37 -0
  56. package/scripts/utils/auth/guided_pr_auth.mjs +79 -0
  57. package/scripts/utils/auth/guided_stack_web_login.mjs +75 -0
  58. package/scripts/utils/auth/interactive_stack_auth.mjs +72 -0
  59. package/scripts/utils/auth/login_ux.mjs +32 -13
  60. package/scripts/utils/auth/sources.mjs +26 -0
  61. package/scripts/utils/auth/stack_guided_login.mjs +353 -0
  62. package/scripts/utils/cli/cli_registry.mjs +43 -4
  63. package/scripts/utils/cli/cwd_scope.mjs +136 -0
  64. package/scripts/utils/cli/cwd_scope.test.mjs +110 -0
  65. package/scripts/utils/cli/log_forwarder.mjs +157 -0
  66. package/scripts/utils/cli/prereqs.mjs +75 -0
  67. package/scripts/utils/cli/prereqs.test.mjs +34 -0
  68. package/scripts/utils/cli/progress.mjs +126 -0
  69. package/scripts/utils/cli/verbosity.mjs +12 -0
  70. package/scripts/utils/cli/wizard.mjs +17 -9
  71. package/scripts/utils/cli/wizard_prompt_worktree_source_lazy.test.mjs +60 -0
  72. package/scripts/utils/dev/daemon.mjs +61 -4
  73. package/scripts/utils/dev/expo_dev.mjs +430 -0
  74. package/scripts/utils/dev/expo_dev.test.mjs +76 -0
  75. package/scripts/utils/dev/server.mjs +36 -42
  76. package/scripts/utils/dev_auth_key.mjs +169 -0
  77. package/scripts/utils/edison/git_roots.mjs +29 -0
  78. package/scripts/utils/edison/git_roots.test.mjs +36 -0
  79. package/scripts/utils/env/env.mjs +7 -3
  80. package/scripts/utils/env/env_file.mjs +4 -2
  81. package/scripts/utils/env/env_file.test.mjs +44 -0
  82. package/scripts/utils/expo/command.mjs +52 -0
  83. package/scripts/utils/expo/expo.mjs +20 -1
  84. package/scripts/utils/expo/metro_ports.mjs +114 -0
  85. package/scripts/utils/git/git.mjs +67 -0
  86. package/scripts/utils/git/worktrees.mjs +80 -25
  87. package/scripts/utils/git/worktrees_monorepo.test.mjs +54 -0
  88. package/scripts/utils/handy_master_secret.mjs +94 -0
  89. package/scripts/utils/mobile/config.mjs +31 -0
  90. package/scripts/utils/mobile/dev_client_links.mjs +60 -0
  91. package/scripts/utils/mobile/identifiers.mjs +47 -0
  92. package/scripts/utils/mobile/identifiers.test.mjs +42 -0
  93. package/scripts/utils/mobile/ios_xcodeproj_patch.mjs +128 -0
  94. package/scripts/utils/mobile/ios_xcodeproj_patch.test.mjs +98 -0
  95. package/scripts/utils/net/lan_ip.mjs +24 -0
  96. package/scripts/utils/net/ports.mjs +9 -1
  97. package/scripts/utils/net/tcp_forward.mjs +162 -0
  98. package/scripts/utils/net/url.mjs +30 -0
  99. package/scripts/utils/net/url.test.mjs +20 -0
  100. package/scripts/utils/paths/localhost_host.mjs +50 -3
  101. package/scripts/utils/paths/paths.mjs +159 -40
  102. package/scripts/utils/paths/paths_monorepo.test.mjs +58 -0
  103. package/scripts/utils/paths/paths_server_flavors.test.mjs +45 -0
  104. package/scripts/utils/proc/commands.mjs +2 -3
  105. package/scripts/utils/proc/parallel.mjs +25 -0
  106. package/scripts/utils/proc/pm.mjs +176 -22
  107. package/scripts/utils/proc/pm_spawn.test.mjs +76 -0
  108. package/scripts/utils/proc/pm_stack_cache_env.test.mjs +142 -0
  109. package/scripts/utils/proc/proc.mjs +136 -4
  110. package/scripts/utils/proc/proc.test.mjs +77 -0
  111. package/scripts/utils/review/base_ref.mjs +74 -0
  112. package/scripts/utils/review/base_ref.test.mjs +54 -0
  113. package/scripts/utils/review/chunks.mjs +55 -0
  114. package/scripts/utils/review/chunks.test.mjs +51 -0
  115. package/scripts/utils/review/findings.mjs +165 -0
  116. package/scripts/utils/review/findings.test.mjs +85 -0
  117. package/scripts/utils/review/head_slice.mjs +153 -0
  118. package/scripts/utils/review/head_slice.test.mjs +91 -0
  119. package/scripts/utils/review/instructions/deep.md +20 -0
  120. package/scripts/utils/review/runners/coderabbit.mjs +61 -0
  121. package/scripts/utils/review/runners/coderabbit.test.mjs +59 -0
  122. package/scripts/utils/review/runners/codex.mjs +61 -0
  123. package/scripts/utils/review/runners/codex.test.mjs +35 -0
  124. package/scripts/utils/review/slices.mjs +140 -0
  125. package/scripts/utils/review/slices.test.mjs +32 -0
  126. package/scripts/utils/review/targets.mjs +24 -0
  127. package/scripts/utils/review/targets.test.mjs +36 -0
  128. package/scripts/utils/sandbox/review_pr_sandbox.mjs +106 -0
  129. package/scripts/utils/server/flavor_scripts.mjs +98 -0
  130. package/scripts/utils/server/flavor_scripts.test.mjs +146 -0
  131. package/scripts/utils/server/mobile_api_url.mjs +61 -0
  132. package/scripts/utils/server/mobile_api_url.test.mjs +41 -0
  133. package/scripts/utils/server/prisma_import.mjs +37 -0
  134. package/scripts/utils/server/prisma_import.test.mjs +70 -0
  135. package/scripts/utils/server/ui_env.mjs +14 -0
  136. package/scripts/utils/server/ui_env.test.mjs +46 -0
  137. package/scripts/utils/server/urls.mjs +14 -4
  138. package/scripts/utils/server/validate.mjs +53 -16
  139. package/scripts/utils/server/validate.test.mjs +89 -0
  140. package/scripts/utils/service/autostart_darwin.mjs +42 -2
  141. package/scripts/utils/service/autostart_darwin.test.mjs +50 -0
  142. package/scripts/utils/stack/context.mjs +2 -2
  143. package/scripts/utils/stack/editor_workspace.mjs +6 -6
  144. package/scripts/utils/stack/interactive_stack_config.mjs +185 -0
  145. package/scripts/utils/stack/pr_stack_name.mjs +16 -0
  146. package/scripts/utils/stack/runtime_state.mjs +2 -1
  147. package/scripts/utils/stack/startup.mjs +120 -13
  148. package/scripts/utils/stack/startup_server_light_dirs.test.mjs +64 -0
  149. package/scripts/utils/stack/startup_server_light_generate.test.mjs +70 -0
  150. package/scripts/utils/stack/startup_server_light_legacy.test.mjs +88 -0
  151. package/scripts/utils/stack/stop.mjs +15 -4
  152. package/scripts/utils/stack_context.mjs +23 -0
  153. package/scripts/utils/stack_runtime_state.mjs +104 -0
  154. package/scripts/utils/stacks.mjs +38 -0
  155. package/scripts/utils/tailscale/ip.mjs +116 -0
  156. package/scripts/utils/ui/ansi.mjs +39 -0
  157. package/scripts/utils/ui/qr.mjs +17 -0
  158. package/scripts/utils/validate.mjs +88 -0
  159. package/scripts/where.mjs +2 -2
  160. package/scripts/worktrees.mjs +755 -179
  161. package/scripts/worktrees_archive_cmd.test.mjs +245 -0
  162. package/scripts/worktrees_cursor_monorepo_root.test.mjs +63 -0
  163. package/scripts/worktrees_list_specs_no_recurse.test.mjs +33 -0
  164. package/scripts/worktrees_monorepo_use_group.test.mjs +67 -0
  165. package/scripts/utils/dev/expo_web.mjs +0 -112
@@ -0,0 +1,102 @@
1
+ # `happy` WIP branch commit inventory (`leeroy-wip`)
2
+
3
+ Generated: 2026-01-24
4
+ Worktree: `/Users/leeroy/Documents/Development/happy-local/components/.worktrees/happy/slopus/tmp/leeroy-wip`
5
+
6
+ ## Scope
7
+
8
+ - Branch: `leeroy-wip`
9
+ - HEAD: `c803115dcbdcd55c036e47c0f0cfd6e1bceb9f74`
10
+ - Upstream base ref: `upstream/main`
11
+ - Merge-base (HEAD vs `upstream/main`): `40792d9eddf7fdaabd375e00134c5cfe5aea2db5`
12
+ - Commits in scope (`upstream/main..HEAD`): `249`
13
+ - Working tree state at capture time: **dirty** (many modified + untracked files)
14
+
15
+ ## Mandatory Workflow (incremental audit → regroup → rewrite)
16
+
17
+ This workflow is designed to be incremental: you can keep auditing while new commits land, then do backups + history rewrite only when you’re ready to actually rewrite.
18
+
19
+ ### Phase 0: Audit setup (non-destructive)
20
+
21
+ 1. Record an “audit baseline” (no backups yet; no history rewriting):
22
+ - `merge-base HEAD upstream/main`
23
+ - `rev-parse HEAD`
24
+ 2. Prefer to avoid rebases on `leeroy-wip` while auditing. If the branch *does* get rebased, re-derive equivalence with `range-diff` before continuing to avoid losing audit context.
25
+
26
+ ### Phase 1: Audit commits (oldest → newest)
27
+
28
+ For each commit:
29
+
30
+ 1. Read the original message body + file stats from `docs/commit-audits/happy/leeroy-wip.commit-export.fuller-stat.md` (this file is already ordered oldest → newest).
31
+ 2. Write/track the audit for that commit in `docs/commit-audits/happy/leeroy-wip.commit-analysis.md` (also ordered oldest → newest).
32
+ 3. Classify it into a single “topic bucket” (or mark it as “mixed / needs split”).
33
+ 4. Note:
34
+ - what changed (observable behavior)
35
+ - whether the message matches the diff
36
+ - whether the commit contains unrelated changes
37
+ - suggested rewritten Conventional Commit subject (+ body notes if needed)
38
+ - dependency ordering constraints (must land before/after other topics)
39
+
40
+ Progress tracking (update manually while auditing):
41
+
42
+ - Auto-triaged commits: `249/249`
43
+ - Manually reviewed commits: `3/249`
44
+ - Current commit under manual review: (set SHA)
45
+ - Next planned topic bucket: (set)
46
+
47
+ Current state (2026-01-24):
48
+
49
+ - `docs/commit-audits/happy/leeroy-wip.commit-export.fuller-stat.md` covers all commits with full message + files + diffstat.
50
+ - `docs/commit-audits/happy/leeroy-wip.commit-analysis.md` covers all commits with a diff-based summary and flags “Manual review needed: YES” for higher-risk commits.
51
+ - `docs/commit-audits/happy/leeroy-wip.manual-review-queue.md` lists flagged commits in audit order.
52
+ - `docs/commit-audits/happy/leeroy-wip.commit-manual-review.md` contains deep-review notes for flagged commits (fill incrementally).
53
+
54
+ ### Phase 2: Keep the audit fresh (when new commits land)
55
+
56
+ When new commits are added on top of `leeroy-wip`:
57
+
58
+ 1. Regenerate the export file (so the raw messages + stats remain complete).
59
+ 2. Append the new commits to whatever “analysis” document we’re using (keeping the analysis document ordered oldest → newest).
60
+ 3. Update the progress counters (`Reviewed commits`, `Total commits`) and continue from the previous cursor.
61
+
62
+ ### Phase 3: Backup + rewrite by topic (only when ready)
63
+
64
+ Preferred approach for a long-lived WIP branch: create a fresh branch from `upstream/main` and cherry-pick topic groups (squash within a topic as needed). Validate incrementally (typecheck/tests via `happys`) after each topic group.
65
+
66
+ Before rewriting:
67
+
68
+ 1. Ensure the worktree is clean (stash or move WIP to a separate branch/worktree).
69
+ 2. Create at least two backups **immediately before** rewriting history (branch + tag, and ideally push a backup ref).
70
+ 3. Capture the “before” fingerprint:
71
+ - `range-diff upstream/main...leeroy-wip`
72
+ - `diff --stat upstream/main...leeroy-wip`
73
+
74
+ ### Phase 4: Prove equivalence
75
+
76
+ After rewrite:
77
+
78
+ - `range-diff upstream/main...<old-branch> upstream/main...<new-branch>`
79
+ - `diff --stat upstream/main...<old-branch> upstream/main...<new-branch>`
80
+
81
+ ## Full Commit Messages + Stats Export
82
+
83
+ See: `docs/commit-audits/happy/leeroy-wip.commit-export.fuller-stat.md`.
84
+
85
+ ## How To Drill Into A Commit (stack/worktree-safe)
86
+
87
+ All commands below run against the worktree directly:
88
+
89
+ ```bash
90
+ happys wt git happy slopus/tmp/leeroy-wip -- show --name-status --stat <sha>
91
+ happys wt git happy slopus/tmp/leeroy-wip -- show <sha>
92
+ happys wt git happy slopus/tmp/leeroy-wip -- show --word-diff <sha>
93
+ ```
94
+
95
+ Useful “what changed overall?” comparisons (before/after history rewrite):
96
+
97
+ ```bash
98
+ happys wt git happy slopus/tmp/leeroy-wip -- range-diff upstream/main...leeroy-wip
99
+ happys wt git happy slopus/tmp/leeroy-wip -- diff --stat upstream/main...leeroy-wip
100
+ ```
101
+
102
+ ```