toga-ai 1.0.785 → 1.0.786

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,73 @@
1
+ ---
2
+ type: session
3
+ slug: qa-qc-plan
4
+ title: QA/QC Task Flow automation (ClickUp + branch)
5
+ author: jcardinal
6
+ repos: [worker2, _underscore, dbchanges2]
7
+ framework: "2.0"
8
+ client: shared
9
+ status: active
10
+ created: 2026-09-08
11
+ updated: 2026-09-08
12
+ ---
13
+
14
+ # Session: qa-qc-plan
15
+ **Date:** 2026-09-08
16
+ **Project/Repo:** worker2 (+ _underscore, dbchanges2) (2.0)
17
+ **Task:** Build the ClickUp + branch automation for the team's approved QA/QC dev process (plan at `P:\Work\Dev Team\QA-QC Plan.txt`) — the **Task** flow end to end.
18
+
19
+ ---
20
+
21
+ ## What WORKED
22
+ <!-- All working-tree only; jcardinal batches to feature-qa-qc and does the merge/deploy himself. All slices reviewed clean (php-reviewer, sql-reviewer, framework-pattern, cso; CTO for design). -->
23
+ - **Auto-mirror** — `worker2/Worker/Team/Github.php` `Merge()` (mirror mode) + `_Worker_Github::Webhook` `push` case + `MIRROR_MAP`. 4 mirrors hard-reset + `--force-with-lease` to source, driven by GitHub push webhooks. CTO AGREE.
24
+ - **General Automation** — new `worker2/Worker/Clickup/GeneralAutomation.php` (all 6 plan rules); atomic Greek-letter reservation from `SubEnvironments` (guarded UPDATE + retry).
25
+ - **QA review chain** — new `worker2/Worker/Clickup/QaReview.php` (UI/FE/BE field → status; deny → Rework + revert). Entry moved to fire on ENTERING "development finished" in `_Worker_Clickup::handleDevelopmentFinished`; `runUnitTests()` is a STUB returning true.
26
+ - **Revert = rebuild-from-ledger (approach b)** — `RevertTask`/`RebuildBranch`/`recordMerge` + `REBUILDABLE_BRANCHES` + ledger table `Team.EnvironmentBranchMerges` (`dbchanges2/Team/2026-09-08a`, already run on Team). Per-repo+branch `GET_LOCK` serializes merge vs rebuild. CTO AGREE.
27
+ - **QC stage** — new `worker2/Worker/Clickup/QcReview.php` (defect + client-review webhooks) + `worker2/Worker/Clickup/QcBatch.php` (weekday 4:30pm cron) + `dbchanges2/Core/2026-09-08e` cron seed.
28
+ - **Shared helper** `_Worker_Clickup::mergeTaskBranches($customTaskId,$targetBranch)` (self-guards target via `isRebuildable`, records ledger).
29
+ - KB capture published to `_main` (5 docs) under the new lean-prime structure.
30
+
31
+ ## What did NOT work — DO NOT RETRY THESE
32
+ - **`git revert -m 1` a merge commit for the revert** — rejected by CTO: QA/QC env branches also receive `_production` merges, so mainline-parent selection and revert-of-revert give wrong diffs. Rebuild-from-ledger is the only reliable undo.
33
+ - **Webhook signature check inside the worker** — impossible: the ingestion Lambda transforms the payload before the worker sees it, so the worker can't re-verify HMAC. Must live at the Lambda over the raw body (GitHub AND ClickUp).
34
+ - **Making the ClickUp field convention a `2.0/standards/` doc** — rejected under the new lean-prime rule (a standard loads on every 2.0 session for a worker2-only rule). Put it as a worker2 feature doc instead.
35
+ - **`sed 's/$/\r/'` alone to force CRLF on this Git Bash** — silently no-ops on some files; use `perl -0pi -e 's/\r?\n/\r\n/g'`.
36
+
37
+ ## Not tried yet (candidates for next session)
38
+ - **Hotfix flow** (→ production, skips stage) — not started.
39
+ - **Feature flow** (subtask roll-ups, subtask-level reviews) — not started.
40
+ - **BE auto-approve from a GitHub PR approval** — blocked on a PR→ClickUp-task lookup (how to map a PR back to its task to set the BE Review field). BE review advances manually for now.
41
+ - **Real unit tests** — replace `runUnitTests()` stub; plan implies a CRON reading deploy test results.
42
+ - Add `taskCustomId` to the "stage review" + "to deploy" Merge dispatch sites in `Worker/Clickup.php` so those merges record to the ledger (deferred — older/unreviewed handlers).
43
+ - Extract the duplicated ClickUp field helpers (fieldById/dropdownName/optionIdByName/isChecked) shared across QaReview/QcReview/QcBatch into one place.
44
+
45
+ ## Current file state
46
+ | File | Status | Notes |
47
+ |------|--------|-------|
48
+ | worker2/Worker/Team/Github.php | modified | Merge (token via GITHUB_TOKEN env + credential helper, mirror-pair guard, force-with-lease, ledger record, branch lock, protected-delete guard) + RevertTask/RebuildBranch/recordMerge/isRebuildable(public)/REBUILDABLE_BRANCHES |
49
+ | worker2/Worker/Github.php | modified | push webhook case -> mirror dispatch; signature check note (Lambda) |
50
+ | worker2/Worker/Clickup.php | modified | GA/QaReview/QcReview fan-outs; handleDevelopmentFinished (after-status entry) + runUnitTests stub + isCheckboxChecked + mergeTaskBranches; old before-status dev-finished case removed |
51
+ | worker2/Worker/Clickup/GeneralAutomation.php | new | General Automation (6 rules) |
52
+ | worker2/Worker/Clickup/QaReview.php | new | QA review transitions |
53
+ | worker2/Worker/Clickup/QcReview.php | new | QC defect + client-review webhooks |
54
+ | worker2/Worker/Clickup/QcBatch.php | new | QC 4:30pm batch cron |
55
+ | _underscore/Component/Api/Clickup/Clickup.php | modified | new CLICK_UP_CUSTOM_FIELD_ID__* constants (TASK_TYPE_NEW, HASUICHANGES, CLIENT_APPROVAL_REQUIRED, UI/FE/BE_REVIEW, CLIENT_REVIEW, 4 defect fields). On commit 7dcf618e (feature-qa-qc), merged into toga25-desk |
56
+ | dbchanges2/Team/2026-09-08a - Create EnvironmentBranchMerges table.sql | new | merge ledger (case-sensitive collation, branch index). ALREADY RUN on Team |
57
+ | dbchanges2/Core/2026-09-08e - Insert QcBatch CronJob.sql | new | QC cron seed (v4 uuid literal, unqualified CronJobs, dtCreated NOW(), NOT EXISTS uuid OR action). NOT yet run |
58
+
59
+ ## Decisions made
60
+ - **Branch automation centralized in worker2** (not per-repo GitHub Actions) — one worker + data-driven map = zero per-repo setup. CTO AGREE.
61
+ - **Revert = rebuild-from-ledger** (reset branch to `_production` + re-merge remaining good tasks from `Team.EnvironmentBranchMerges`), not merge-commit revert. CTO AGREE.
62
+ - **ClickUp field IDs as `_Component_Api_Clickup` constants; option values resolved at runtime** — the team pattern. Task Type kept as OLD (`093170c3`, Design uses it) + NEW (`dc9f15da`, QA/QC) — do NOT repoint the shared constant.
63
+ - **Task flow only** this session; Hotfix/Feature flows are separate plan sections.
64
+ - **Unit tests stubbed** (`runUnitTests()` returns true) with a clean seam.
65
+
66
+ ## Blockers
67
+ - None blocking the Task flow (built + reviewed). External deps for FUTURE work: BE-auto-approve needs a PR->task lookup; real unit tests not built.
68
+
69
+ ## Exact next step
70
+ > When resuming: pick a remaining piece — most self-contained is the **Hotfix flow** (mirror the Task-flow QA/QC handlers but route to `_qc-hotfix` then straight to `_production`, skipping Stage; gate on Task Type == 'Hotfix'). Re-read `P:\Work\Dev Team\QA-QC Plan.txt` HOTFIX FLOW section first. Confirm worker2/dbchanges2 are on `feature-qa-qc` and `_underscore` has it merged in before editing.
71
+
72
+ ---
73
+ _Saved by /session-save on 2026-09-08_
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "toga-ai",
3
- "version": "1.0.785",
3
+ "version": "1.0.786",
4
4
  "description": "TOGA Technology Team Claude Knowledge System — shared AI coding harness with skills, knowledge base CLI, and project installer for Claude Code.",
5
5
  "keywords": [
6
6
  "claude",