Skip to content

v0.13.1 — Gateway audience: flip default tech → pm

Choose a tag to compare

@hanfour hanfour released this 20 May 06:52
· 92 commits to main since this release

v0.13.1 — Gateway audience: flip default techpm

Why

Same-day dogfood on v0.13.0 surfaced a product mismatch the audience-tier code has carried since v0.8.0: defaultAudience() returned { default: "tech" }, so every unknown / unconfigured user got engineer-grade replies with file paths, API names, and module references like ability.rb:4-24 and dynamic dispatch via @user.roles.each. A test channel with a non-IT teammate (PM / ops) saw the bot answer correctly but unusably — the reader doesn't read code.

The four prompts (tech / pm / biz / exec) already differentiate cleanly. The bug was that the default flipped the wrong way for a typical pmk-gateway workspace where most stakeholders are non-IT.

Fixed

  • defaultAudience() returns { default: "pm" } (packages/cli/src/gateway/config.ts). pm is the middle tier: structural findings without formulas, jargon translated (AdFormat → 「廣告版型」, scope → 「篩選條件」, AASM → 「狀態機」), PM-framed questions back to the user. Engineers still get full depth by opting in via per-user override:
pmk gateway audience set <YOUR-IT-USER-ID> tech
# or via Slack:
/pmk admin audience set <@hanfour> tech
  • Existing installs are unaffected on disk. The factory only fires when audience is missing from gateway.json. Admins who want the new behaviour can either delete the audience.default line and reload, or run pmk gateway audience default pm to flip it explicitly.

Tests

@pmk/cli 362 → 362 (unchanged). One existing back-fill assertion in gateway.test.ts flipped from default === "tech" to default === "pm" to match the new factory — the assertion's intent was always "legacy configs get back-filled with the default"; the specific value is what changed. All 412 workspace tests still pass.

Operator note

If you're already running v0.13.0 (or earlier) and want non-IT users to get the new behaviour, run on the gateway host:

pmk gateway audience default pm
pmk gateway audience set <YOUR-IT-USER-ID> tech
# Then restart the gateway so the new config snapshot is in-memory:
# Ctrl+C the foreground process, or `kill -TERM <pid>`, then `pmk gateway start`.

The audience config is loaded into memory at adapter construction (same in-memory snapshot caveat as escalation), so the change requires a restart to bite.

This is a fresh-install fix; no migration needed on existing hosts.