Skip to content

Claude/cranky johnson#1

Closed
suda wants to merge 1 commit into
devfrom
claude/cranky-johnson
Closed

Claude/cranky johnson#1
suda wants to merge 1 commit into
devfrom
claude/cranky-johnson

Conversation

@suda
Copy link
Copy Markdown
Member

@suda suda commented Apr 9, 2026

Summary

Test Plan

  • Unit tests pass (npm test)
  • Linter passes (npm run lint)
  • Type check passes (npm run typecheck)
  • Tested manually (describe below)

Checklist

  • My code follows the project's code style
  • I have added tests for new functionality
  • I have updated documentation if needed
  • My commits follow Conventional Commits

@suda suda force-pushed the claude/cranky-johnson branch 3 times, most recently from cf42af0 to a59562e Compare April 9, 2026 18:25
Add GitLab as a second SCM integration alongside GitHub, following the
existing IntegrationModule/SCMIntegration architecture. This enables
CASCADE to process GitLab merge request webhooks and run agents against
GitLab repositories.

Key additions:
- Core GitLab module (client via @gitbeaker/rest, dual-persona model,
  SCMIntegration implementation)
- Router layer (webhook route, signature verification, adapter, queue types)
- 9 trigger handlers (MR opened, pipeline success/failure, approval,
  reviewer added, comment mention, merged, conflict detected, ready to merge)
- 11 GitLab gadgets for agent MR operations
- SCM-provider-aware context pipeline, CLI commands, tool manifests,
  and agent system prompts
- Frontend SCM tab with GitHub/GitLab provider selector
- CLI webhook commands with --gitlab-only support
- GitLab webhook CRUD via API
- Worker entry GitLab job dispatch with CASCADE_SCM_PROVIDER env var
- PR/MR URL extraction supports both /pull/NNN and /merge_requests/NNN
- Post-execution work-item linking works for GitLab MRs
- Database migration for gitlab SCM provider CHECK constraint
- glab CLI installed in worker Docker image
- 100 unit tests across 7 test files

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@suda suda force-pushed the claude/cranky-johnson branch from a59562e to 96f5136 Compare April 9, 2026 18:31
@suda suda closed this Apr 9, 2026
suda pushed a commit that referenced this pull request Jun 1, 2026
…tructured envelope, --comment alias) (mongrel-intelligence#1190)

* docs(014): spec + plans for cascade-tools agent ergonomics

Adds docs/specs/014-cascade-tools-agent-ergonomics.md plus two plans
covering shared-infra and create-pr-review adoption. Prompted by prod
run 5d993b04-6e05-4ae1-b7de-8c274cf3496b.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore(plan-014): lock plan 1 (shared-infra)

* feat(cascade-tools): plan 014/1 shared-infra — truthful prompts + envelope

Ships the root-cause fix for prod run 5d993b04-6e05-4ae1-b7de-8c274cf3496b
plus the shared infrastructure every future gadget inherits:

- System-prompt renderer (src/backends/shared/nativeToolPrompts.ts) stops
  stripping trailing 's' from array param names and claiming '<string>
  (repeatable)' for every array. Array-of-object params now render as
  `--<flag> '<json>'` with aliases appended via `|` and a one-line runnable
  example from the tool definition.
- Factory (src/gadgets/shared/cliCommandFactory.ts) gains oclif flag aliases,
  JSON parsing for array-of-object flags, file-input JSON parsing, `examples`
  wired into oclif `--help`, and Levenshtein-based 'did you mean' suggestions
  for mistyped flags (via fastest-levenshtein).
- New shared error envelope (src/gadgets/shared/errorEnvelope.ts) — every
  CLI failure emits `{"success":false,"error":{type,flag?,message,got?,
  expected?,hint?,example?}}` on stdout plus a one-line prose summary on
  stderr. All prior `this.error()` / flat `{success:false,error:"<string>"}`
  call sites migrated.
- Contracts widened: ParameterDefinition gains `cliAliases`, FileInput-
  Alternative gains `parseAs`, ToolManifest parameters carry `items`,
  `aliases`, `example`.
- Manifest generator threads the new fields through.
- bin/cascade-tools.js wraps `run()` to swallow oclif ExitError cleanly so
  the envelope isn't obscured by Node's default stack dump.

Plan-1 ACs #1mongrel-intelligence#17 all delivered. 8438/8438 unit tests passing.

Test surface delta: 57 new unit tests across errorEnvelope.test.ts,
shared-nativeToolPrompts.test.ts, and factories.test.ts. Seven legacy
assertions encoding the pre-014 error surface updated in cli/cli-command-
factory, cli/file-input-flags, cli/scm/create-pr-sidecar, cli/scm/create-
pr-review-sidecar, backends/claude-code.

Plan 2 adopts the pattern on createPRReviewDef — zero shared-file edits —
proving the declarative-metadata invariant.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore(plan-014): lock plan 2 (createprreview-adopt)

* feat(cascade-tools): plan 014/2 createprreview-adopt + spec done

Applies the spec-014 declarative-metadata pattern to createPRReviewDef:

- --comment alias for --comments (the exact muscle-memory mistake from
  prod run 5d993b04-6e05-4ae1-b7de-8c274cf3496b).
- --comments-file <path> (and - for stdin) JSON-parsed escape hatch for
  long payloads that don't survive shell quoting.
- Two declarative fields on createPRReviewDef.parameters.comments.cliAliases
  + createPRReviewDef.cli.fileInputAlternatives. Zero edits to shared
  infrastructure (cliCommandFactory, manifestGenerator, nativeToolPrompts,
  errorEnvelope) — proves spec 014's single-entrypoint invariant.

Per-plan ACs #1, #2, #3, #5, #6, mongrel-intelligence#7, mongrel-intelligence#8, mongrel-intelligence#9, mongrel-intelligence#11, mongrel-intelligence#12 auto-verified
(unit tests + build + lint + typecheck). AC #4 (binary-level smoke)
tagged [manual] because vitest fork-pool workers fail to capture
stdout/stderr from spawned binaries that do top-level await import();
the six scenarios were verified manually against the built binary and
the trace is recorded in the plan. AC mongrel-intelligence#10 n/a — integration test path
abandoned for the same reason.

All plans done. Spec 014 marked .done (docs/specs/014-*.md → .done).
CHANGELOG Unreleased updated with a per-plan entry.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant