fix(qa): branch defaults, webhook content type and integration wording #40

Merged
dsh merged 1 commit from fix/qa-defaults-integrations into master 2026-10-24 01:16:13 +00:00
Owner

What

Seven defaults/integration defects from the tester sweep.

#19 — project_health false “API error”

The formatter matched /pull|pr/i against free-text errors, so security: … is unprotected matched pr. Errors are source-prefixed (issues:, pulls:, security:); match those prefixes.

#20 — security_audit / branch_protection_get hard-coded main

Added resolveTargetBranch(): explicit branch is verified against listBranches (missing → branch not found: …), otherwise getRepo().default_branch is used, falling back to main only when the lookup fails. Applied to get/set/audit and the tool descriptions.

#21 — webhooks create always failed

Forgejo requires config.content_type. The handler now sends json by default, accepts json|form|multipart (validated), and requires url. Added a webhook formatter (Webhook #1 created (type gitea)., list lines) so the id is visible instead of raw JSON.

#22 — memory_brain_sync advertised format but rejected it

format (also the default action) now returns an auto-detected, non-persisted fact (persisted:false, synced:false).

#29 — incident dry run said “Created”

The formatter branches on dryRun: Incident Ticket (dry-run): would create "…" with labels […] — pass dry_run:false to file it. plus a body preview; real creation reports #N and the URL. Also switched the default labels from the upstream type/incident/priority/critical/status/ready to house type/bug/priority/now, resolves ids, and never sends label names to Forgejo.

#30 — exact-title duplicate missed with a long body

Duplicate scoring now separates title and body similarity (max(titleSim, 0.7*titleSim + 0.3*bodySim)), so a 100 % title match is a candidate regardless of body length. Added a readable duplicate formatter.

#35 — task-tracker claimed “1 card(s) processed”

The formatter branches on the returned shape: status_map prints contract + mapping, convert_card prints the converted state/label, export_cards prints the real count, sync_card the sync result.

Verification

  • test/qa-defaults.test.mjs (19 tests) covers all seven.
  • npm test 111/111, leak scan clean, node --check clean.
  • Live: health now Open PRs: 0; audit @master; missing branch → clear error; memory format works; incident dry-run preview; duplicate #5 found; task-tracker mapping/convert/export readable; webhook create → Webhook #1 created (type gitea). → list → delete → No webhooks.

Closes #19, #20, #21, #22, #29, #30, #35.

## What Seven defaults/integration defects from the tester sweep. ### #19 — `project_health` false “API error” The formatter matched `/pull|pr/i` against free-text errors, so `security: … is unprotected` matched `pr`. Errors are source-prefixed (`issues:`, `pulls:`, `security:`); match those prefixes. ### #20 — `security_audit` / `branch_protection_get` hard-coded `main` Added `resolveTargetBranch()`: explicit branch is verified against `listBranches` (missing → `branch not found: …`), otherwise `getRepo().default_branch` is used, falling back to `main` only when the lookup fails. Applied to get/set/audit and the tool descriptions. ### #21 — `webhooks create` always failed Forgejo requires `config.content_type`. The handler now sends `json` by default, accepts `json|form|multipart` (validated), and requires `url`. Added a webhook formatter (`Webhook #1 created (type gitea).`, list lines) so the id is visible instead of raw JSON. ### #22 — `memory_brain_sync` advertised `format` but rejected it `format` (also the default action) now returns an auto-detected, non-persisted fact (`persisted:false, synced:false`). ### #29 — incident dry run said “Created” The formatter branches on `dryRun`: `Incident Ticket (dry-run): would create "…" with labels […] — pass dry_run:false to file it.` plus a body preview; real creation reports `#N` and the URL. Also switched the default labels from the upstream `type/incident`/`priority/critical`/`status/ready` to house `type/bug`/`priority/now`, resolves ids, and never sends label names to Forgejo. ### #30 — exact-title duplicate missed with a long body Duplicate scoring now separates title and body similarity (`max(titleSim, 0.7*titleSim + 0.3*bodySim)`), so a 100 % title match is a candidate regardless of body length. Added a readable duplicate formatter. ### #35 — task-tracker claimed “1 card(s) processed” The formatter branches on the returned shape: `status_map` prints contract + mapping, `convert_card` prints the converted state/label, `export_cards` prints the real count, `sync_card` the sync result. ## Verification - `test/qa-defaults.test.mjs` (19 tests) covers all seven. - `npm test` 111/111, leak scan clean, `node --check` clean. - Live: health now `Open PRs: 0`; audit `@master`; missing branch → clear error; memory `format` works; incident dry-run preview; duplicate #5 found; task-tracker mapping/convert/export readable; webhook create → `Webhook #1 created (type gitea).` → list → delete → `No webhooks.` Closes #19, #20, #21, #22, #29, #30, #35.
Use the repo default branch for security/protection tools, send config.content_type on webhook create, implement the advertised memory format action, stop parsing prose for health errors, keep exact-title duplicates, use house incident labels, and report what task-tracker actions actually did.
dsh merged commit 281eade1b4 into master 2026-10-24 01:16:13 +00:00
Sign in to join this conversation.
No description provided.