Skip to content

Commit 5a92954

Browse files
committed
merge(upstream): absorb origin/main (tiann#2040) into tip-forward WIP
Keep soup versions of conflicted toolbar/router/locale files — live tip already dogfoods tiann#2040 plus interleaved soup-only Boards/overseer/content-search.
2 parents 1cf0e0c + 3ef5295 commit 5a92954

6 files changed

Lines changed: 163 additions & 18 deletions

File tree

‎config/driver-manifest.yaml‎

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,9 +1092,8 @@ layers:
10921092

10931093
# heavygee/hapi#235 / PR #238 — Boards view (cards/chips/relative-time,
10941094
# Projects v2 /views/<n> filter capture). Renamed To-Do → Boards.
1095-
# Re-tip 2026-10-14: driver/235-todo-board-view @ 6e5ee7bc4 (= feat tip —
1096-
# isHistoryPopNavigation push-vs-pop; assignee picker name+login). Was
1097-
# 7f565cac6 (Open-session / clearable status / mention tooltip).
1095+
# Re-tip 2026-10-18: driver/235-todo-board-view @ 17c2fa61d (= feat tip —
1096+
# client-side title-only filter). Was 6e5ee7bc4 (push-vs-pop / assignee picker).
10981097
- branch: driver/235-todo-board-view
10991098

11001099
# heavygee/hapi#247 — deliberate fleet push + restore upgrade-runner; kill
@@ -1298,21 +1297,10 @@ layers:
12981297
# Not product; keeps tip-forward verify green after MachineTag absorb.
12991298
- branch: driver/fix-version-offer-query-test
13001299

1301-
# tiann/hapi#2039 / PR #2040 — narrow session toolbar. One nowrap row;
1302-
# shed by keep rank into More (blocked 2, new 4, filter 5, settings 6,
1303-
# mark-all 7, browse 8, overseer 9, import 10). Soup tip:
1304-
# driver/2039-toolbar-crowd @ d3aa1b6e0 (3b85c2cfb + blocked-search shrink test)
1305-
# Tip-unique verify marker: session-list-header-actions in web/dist
1306-
# Upstream thin: fix/2039-session-toolbar-crowd (worktree fix-2039-toolbar-crowd)
1307-
# Web-only → remat --build-web; hard-reload (no hub restart). Re-thin after dogfood bump.
1308-
- branch: driver/2039-toolbar-crowd
1309-
1310-
# Remat unblock: #2039 outer search is shrink-0 + max-w-full; blocked-header
1311-
# test still forbade shrink-0 from the earlier clear-target work. Thin tip on
1312-
# live driver 7e907c715 @ 9fb9af6d8.
1313-
# Follow-up dc858f6c7: with query chip active, #2039 folds BlockedJumpPill into
1314-
# More — blocked-search test opens overflow before asserting the pill.
1315-
- branch: driver/2039-blocked-search-test
1300+
# DROPPED 2026-10-18 #2040: driver/2039-toolbar-crowd + driver/2039-blocked-search-test
1301+
# MERGED as tiann/hapi#2040 (squash f13a1aae). Absorb from upstream/main on next remat.
1302+
# - branch: driver/2039-toolbar-crowd
1303+
# - branch: driver/2039-blocked-search-test
13161304

13171305
# #292 — DEFAULT_FLEET_UPGRADE_POLICY=auto (joining fleet = consent).
13181306
# Thin tip on soup HEAD 31e67a6ac: driver/292-fleet-default-auto @ ee9445082

‎docs/guide/pet-install.md‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,16 @@ curl -fsSL https://raw.githubusercontent.com/heavygee/hapi/main/scripts/install-
2929
`--with-systemd` works via `curl | bash` (units are embedded in the installer — no git
3030
checkout required). After install: `systemctl --user status hapi-hub hapi-runner`.
3131

32+
**Headless / service accounts** (no interactive login, no `$XDG_RUNTIME_DIR`): systemd
33+
`--user` is not running until linger is enabled. The installer **fails fast** with
34+
copy-paste for a sudo-capable person — it does **not** silently fall back to nohup:
35+
36+
```bash
37+
sudo loginctl enable-linger <user>
38+
sudo systemctl start user@$(id -u <user>).service
39+
# then re-run the same --with-systemd install (idempotent)
40+
```
41+
3242
## Finish setup
3343

3444
Open a **new terminal**, then:
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Exit reflection: session-toolbar-crowd (PR #2040)
2+
3+
## Shipped as
4+
5+
- PR(s): tiann/hapi#2040 (Fixes #2039); squash `f13a1aae`
6+
- Absorber: n/a
7+
- Session: [search clear button](/sessions/e02f4a52-4716-43ac-85f4-5b449b18f028)
8+
9+
## Non-code residue
10+
11+
- Dogfood must track the **reviewed tip**, not an older soup pin. Freezing remat while still pushing review fixes made the operator judge the wrong geometry.
12+
- Equal-width More means shedding one icon often frees nothing - plan for pairs + one-gap slack.
13+
- Search chrome floor (icon/clear/calendar) and trailing floor (machine menu + More) both have to win; flex-1 actions alone is not enough if the chip can take ~240px.
14+
- `hapi link-pr` with `existingRefs: []` does **not** replace other PR chips - hub reconciles/unions. Clear with `PUT []` then rewrite the set when retargeting.
15+
- Public issue/PR copy: do not frame width/touch toolbar bugs as Quest-only.
16+
- Lane B via `low-impact` on a ~700-line layout PR is a deliberate crowbar; size auto-B correctly failed first.
17+
18+
## Promote?
19+
20+
- [x] `none` — no durable follow-up (link-pr replace semantics already known in hub; dogfood-tip discipline is process, not a new AGENTS row)
21+
22+
## Open questions / landmines
23+
24+
- Font-scale + multi-machine + long query remains the sharp corner; another host density could still look wrong after absorb.
25+
26+
## Skip
27+
28+
- n/a

‎scripts/install-hapi-pet.sh‎

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ Usage:
8080
8181
--with-systemd Install user-level systemd units (works via curl|bash;
8282
units are embedded — no git checkout required).
83+
Needs a working systemd --user bus for this account.
84+
Headless/service users: linger + user@UID.service first
85+
(script fails fast with copy-paste if the bus is missing).
8386
--fleet-policy=POLE silent | alert | auto (default auto). Seeds settings.json
8487
fleetUpgradePolicy when unset. alert/silent are opt-outs.
8588
--skip-upstream-seal Do not wire HAPI_UPSTREAM_SEAL_URL (foundry/break-glass).
@@ -96,6 +99,56 @@ done
9699
log() { printf '==> %s\n' "$1"; }
97100
fail() { printf 'ERROR: %s\n' "$1" >&2; exit 1; }
98101

102+
# --with-systemd preflight (#294): talk to the user bus before writing units or
103+
# calling systemctl --user. Missing bus (service account, no linger, no login
104+
# session) used to die mid-install on a raw dbus error. Hard-fail with
105+
# copy-paste for a sudo-capable person; never silently fall back to nohup.
106+
hapi_pet_user_systemd_bus_ok() {
107+
command -v systemctl >/dev/null 2>&1 || return 1
108+
# show-environment needs a live user bus; is-system-running can be
109+
# "degraded" while the bus is still usable.
110+
systemctl --user show-environment >/dev/null 2>&1
111+
}
112+
113+
hapi_pet_user_linger_enabled() {
114+
local user
115+
user="$(id -un)"
116+
[[ "$(loginctl show-user "$user" -p Linger --value 2>/dev/null || true)" == "yes" ]]
117+
}
118+
119+
hapi_pet_require_user_systemd_bus() {
120+
local user uid
121+
user="$(id -un)"
122+
uid="$(id -u)"
123+
command -v systemctl >/dev/null 2>&1 \
124+
|| fail "systemctl not found — cannot install --with-systemd on this host"
125+
126+
if hapi_pet_user_systemd_bus_ok; then
127+
if ! hapi_pet_user_linger_enabled; then
128+
log "WARN: systemd --user bus is up but linger is off for ${user}."
129+
log " Units stop when this login ends. For headless pets, a sudo-capable person should run:"
130+
log " sudo loginctl enable-linger ${user}"
131+
fi
132+
return 0
133+
fi
134+
135+
fail "$(cat <<EOF
136+
--with-systemd needs a working systemd --user bus for this account (${user}),
137+
but none is available (missing \$XDG_RUNTIME_DIR / \$DBUS_SESSION_BUS_ADDRESS,
138+
or user@${uid}.service is not running).
139+
140+
A sudo-capable person must prepare the account, then re-run this install
141+
(the script is idempotent — no need to undo the partial binary/settings work):
142+
143+
sudo loginctl enable-linger ${user}
144+
sudo systemctl start user@${uid}.service
145+
146+
Then re-run the same install command. Do not substitute nohup — you asked
147+
for systemd persistence (#294).
148+
EOF
149+
)"
150+
}
151+
99152
case "$HAPI_FLEET_UPGRADE_POLICY" in
100153
silent|alert|auto) ;;
101154
*) fail "HAPI_FLEET_UPGRADE_POLICY must be silent|alert|auto (got: $HAPI_FLEET_UPGRADE_POLICY)" ;;
@@ -587,6 +640,9 @@ hapi_pet_migrate_legacy_oauth_if_needed() {
587640
# repo checkout. Keep in sync with scripts/tooling/systemd/units/user-pet/*.in —
588641
# the checkout path below prefers the companion installer when present.
589642
install_user_pet_systemd() {
643+
# Fail before writing units / any systemctl --user (thinkpadt14 field fail #294).
644+
hapi_pet_require_user_systemd_bus
645+
590646
local companion=""
591647
if [[ -n "${SCRIPT_DIR}" && -x "${SCRIPT_DIR}/tooling/install-hapi-systemd-units.sh" ]]; then
592648
companion="${SCRIPT_DIR}/tooling/install-hapi-systemd-units.sh"

‎scripts/install-hapi-pet.systemd-curl.test.sh‎

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,5 +74,55 @@ fi
7474
rg -q 'companion' "$SCRIPT" || fail "expected companion-present branch"
7575
pass "script embeds user-pet units and guards BASH_SOURCE"
7676

77+
# 5) #294: user-bus preflight fails closed without a bus (copy-paste, no silent nohup).
78+
rg -q 'hapi_pet_require_user_systemd_bus' "$SCRIPT" || fail "missing hapi_pet_require_user_systemd_bus"
79+
rg -q 'hapi_pet_require_user_systemd_bus' "$SCRIPT" || fail "install_user_pet_systemd must call preflight"
80+
# Call site is inside install_user_pet_systemd, before companion/embedded writes.
81+
awk '
82+
/^install_user_pet_systemd\(\)/ { in_fn=1 }
83+
in_fn && /hapi_pet_require_user_systemd_bus/ { found=1 }
84+
in_fn && /^}$/ { exit }
85+
END { exit found ? 0 : 1 }
86+
' "$SCRIPT" || fail "preflight must run at start of install_user_pet_systemd"
87+
88+
probe_src="$(mktemp)"
89+
bus_err="$(mktemp)"
90+
{
91+
echo 'log() { printf "==> %s\n" "$1"; }'
92+
echo 'fail() { printf "ERROR: %s\n" "$1" >&2; exit 1; }'
93+
# Three consecutive helpers: bus_ok, linger_enabled, require.
94+
awk '
95+
/^hapi_pet_user_systemd_bus_ok\(\)/ { keep=1 }
96+
keep { print }
97+
keep && /^}$/ { n++; if (n == 3) exit }
98+
' "$SCRIPT"
99+
echo 'hapi_pet_require_user_systemd_bus'
100+
} >"$probe_src"
101+
102+
# Force a missing-bus probe: wrap systemctl so --user always fails even if this
103+
# developer machine has a real user session.
104+
set +e
105+
env PATH="/usr/bin:/bin" bash -c '
106+
systemctl() {
107+
if [[ "${1:-}" == "--user" ]]; then
108+
echo "Failed to connect to user scope bus via local transport: \$DBUS_SESSION_BUS_ADDRESS and \$XDG_RUNTIME_DIR not defined" >&2
109+
return 1
110+
fi
111+
command systemctl "$@"
112+
}
113+
export -f systemctl
114+
# shellcheck disable=SC1090
115+
source "'"$probe_src"'"
116+
' >"$bus_err" 2>&1
117+
bus_rc=$?
118+
set -e
119+
[[ "$bus_rc" -ne 0 ]] || fail "preflight should fail without user bus (rc=0); out=$(cat "$bus_err")"
120+
rg -q 'enable-linger' "$bus_err" || fail "preflight stderr missing enable-linger: $(cat "$bus_err")"
121+
rg -q 'user@[0-9]+\.service' "$bus_err" || fail "preflight stderr missing user@UID.service: $(cat "$bus_err")"
122+
rg -q 'Do not substitute nohup|systemd persistence' "$bus_err" \
123+
|| fail "preflight should refuse silent nohup: $(cat "$bus_err")"
124+
pass "#294 fail-fast without user bus (copy-paste linger + user@UID)"
125+
rm -f "$probe_src" "$bus_err"
126+
77127
echo
78128
echo "All install-hapi-pet systemd curl regressions passed."

‎scripts/tooling/install-hapi-systemd-units.sh‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,19 @@ case "$PROFILE" in
432432
fi
433433
;;
434434
user-pet)
435+
# Same class of failure as install-hapi-pet.sh #294: no user bus →
436+
# raw dbus error mid-install. Fail before writing units.
437+
if ! systemctl --user show-environment >/dev/null 2>&1; then
438+
_u="$(id -un)"
439+
_uid="$(id -u)"
440+
echo "ERROR: --profile user-pet needs a working systemd --user bus for ${_u}." >&2
441+
echo " Missing \$XDG_RUNTIME_DIR / \$DBUS_SESSION_BUS_ADDRESS, or user@${_uid}.service is down." >&2
442+
echo " A sudo-capable person should run:" >&2
443+
echo " sudo loginctl enable-linger ${_u}" >&2
444+
echo " sudo systemctl start user@${_uid}.service" >&2
445+
echo " Then re-run this installer (#294)." >&2
446+
exit 1
447+
fi
435448
USER_UNIT_DIR="$HOME/.config/systemd/user"
436449
mkdir -p "$USER_UNIT_DIR"
437450
render_pair \

0 commit comments

Comments
 (0)