Skip to content

Merge dev to main: friction params loosened + cascade-tools missing-dist UX#1312

Merged
zbigniewsobiecki merged 5 commits into
mainfrom
dev
May 10, 2026
Merged

Merge dev to main: friction params loosened + cascade-tools missing-dist UX#1312
zbigniewsobiecki merged 5 commits into
mainfrom
dev

Conversation

@zbigniewsobiecki
Copy link
Copy Markdown
Member

Summary

  • chore(friction): loosen category/severity to free-form + harden cascade-tools missing-dist UX (chore(friction): loosen category/severity to free-form + harden cascade-tools missing-dist UX #1311) — closes the prod regression from run `ff6adf00` where the agent recognized friction, fired `report-friction` 4 times, and was rejected every time by oclif's enum gate (`--severity 'medium slowdown'` taken from the gadget describe text). Loosens both params to free-form string; defers re-tightening until we have real usage data. Plus: `bin/cascade-tools.js` now traps the specific missing-dist case and emits a one-line stderr explainer instead of dumping a Node stack trace.

Test plan

  • dev CI green pre-merge (run completed)
  • Watch main CI + Build and Deploy after merge
  • Post-deploy: monitor for first successful `report-friction` invocation in prod logs (Trello card landing in cascade's `lists.friction`).

🤖 Generated with Claude Code

aaight and others added 5 commits May 10, 2026 10:15
Co-authored-by: Cascade Bot <bot@cascade.dev>
Co-authored-by: Cascade Bot <bot@cascade.dev>
Co-authored-by: Cascade Bot <bot@cascade.dev>
…de-tools missing-dist UX

Live signal from prod 2026-05-10 run ff6adf00 (cascade implementation
post the friction-prompt rewrite of #1305): the agent recognized a
textbook friction (CASCADE_ORG_ID env-var leak in tests, worked around
with `env -u`), fired `cascade-tools pm report-friction` four times,
and EVERY call exited code 2 because oclif's enum gate rejected
`--severity 'medium slowdown'` (and `'low annoyance'`). The agent then
attempted `node bin/cascade-tools.js pm report-friction --help` to
discover valid values, which crashed with `ERR_MODULE_NOT_FOUND` for
`dist/cli/bootstrap.js` because dist/ wasn't built in the workspace
checkout. Agent gave up. Report never filed.

Two distinct bugs in one trace:

1. **Enum coupling between describe text and validation.** The gadget
   defined `severity.type: 'enum'` with options ['low','medium','high',
   'critical'] AND describe text 'Severity: low annoyance, medium
   slowdown, high blocker risk, or critical hard blocker'. The describe
   injected descriptive prose alongside values. Codex's prompt-tool-
   guidance only renders `<enum>` (per formatParam in
   nativeToolPrompts.ts) — agents had only the describe + example to
   guess from, and the describe led them to 'medium slowdown' as the
   literal value.

2. **bin/cascade-tools.js dumped a raw stack trace** when dist/ was
   missing — hid the recovery path (use the installed `cascade-tools`
   from PATH inside the worker container, or `npm run build`).

Decision: defer enum tightening. Accept any string for category/severity
for now — the agent is the right place for free-form labels initially;
cluster + re-tighten later from real usage data. Plus a small UX patch
on bin/cascade-tools.js so missing dist no longer dumps a stack trace.

Changes:

- src/gadgets/pm/definitions.ts: category/severity → type:'string',
  describe text rewritten so values are listed inside parentheses
  rather than mixed with prose.
- src/gadgets/pm/core/reportFriction.ts: drop CATEGORIES/SEVERITIES
  arrays + requireEnum helper + the two requireEnum call sites; pass
  params.category/severity through verbatim.
- src/friction/types.ts: widen FrictionCategory and FrictionSeverity
  unions → `string` (preserves import paths for downstream consumers).
- bin/cascade-tools.js: wrap the `dist/cli/bootstrap.js` import in
  try-catch with a narrow regex classifier; emit one-line stderr
  message + exit 1 on missing-dist; any other module-not-found
  propagates unchanged.

Tests:

- tests/unit/gadgets/pm/definitions.test.ts: flipped enum assertions
  to string, pinned `options` is undefined (regression net for revert),
  pinned the new describe text verbatim.
- tests/unit/gadgets/pm/core/reportFriction.test.ts: replaced the
  "rejects invalid category" test with a positive test that an
  agent-invented label like 'something-not-in-the-old-enum' /
  'medium slowdown' is stored verbatim and processed.
- tests/unit/backends/toolManifests.test.ts: kept the existing
  manifest assertions (already correct — manifest generator coerces
  enum→string) + added options-undefined regression net.

No new bin test — adding spawn-based fixtures for missing-dist
introduces more fragility than value for a 5-line try-catch. The
existing tests/unit/cli/cascade-tools-help.test.ts spawn pattern
already shows known fragility (NODE_ENV stripping, dist-built skip).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ion-params-and-harden-bin

chore(friction): loosen category/severity to free-form + harden cascade-tools missing-dist UX
@zbigniewsobiecki zbigniewsobiecki merged commit f4f5318 into main May 10, 2026
15 checks passed
@codecov
Copy link
Copy Markdown

codecov Bot commented May 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants