WorkLoom Pre-Release Three-Pipeline Gate (Mandatory Red Line)
Trigger on Intent
When a user expresses an intent to "release / deploy / deliver version / publish / push this version" and the target repository uses the WorkLoom foundation (identified by: packages/base, packages/runtime, scripts/suite.ts, pnpm-workspace.yaml containing apps/* + packages/*), must execute this gate first, before any release discussion. No skipping allowed.
Three Main Pipelines (Based on WorkLoom's Three Actual Modes)
| Pipeline | Check Points | Gate Test Cases |
|---|
| ASK (Q&A Mode) | One-sentence Q&A responses normal, covering common scenarios, no timeout/error/empty return | Real questions in demo workspace: intent routing = ask, response non-empty (>10 chars), via trace left, return within 30s |
| QUEST (Task Mode) | Auto-decompose multi-step tasks from one sentence, create→decompose→execute flow complete | Real goal dispatch: decompose ≥2 steps, threads readable, event trace complete |
| Automation Pipeline | Orchestration engine normal, trigger conditions, execution logic, callback mechanism correct | Triggers enabled (≥3 per workspace), beat execution→callback recorded +1, full-base hash chain consistent |
Standard Execution Flow
docker start workloom-im-pg 2>/dev/null
pnpm db:migrate && pnpm db:seed && pnpm db:seed:video
pnpm -C apps/server dev &
pnpm suite
pnpm suite:geo
pnpm suite:hotel
pnpm release:gate
Environment Adaptation Rules
- Sandbox:
LLM_PROVIDER=mock (built-in AI model driver, deterministic orchestration fallback, offline full pipeline runnable)
- Production:
LLM_PROVIDER=deepseek|moonshot|zhipu|openai + independent deployment endpoint/secret
- Gate prints current environment context at startup, release record must document it.
Release Mandatory Red Lines
- All three main pipelines not passed → Release blocked, no exceptions.
- Historical lesson: ASK mode failure after a previous release—must run full regression before every release.
- Pre-release confirmation:
git status clean, migrations applied (pnpm db:migrate no pending), chain verification passed (pnpm db:verify-chain).
Defect Archive (Actual Gate Catches, Check First When Debugging)
| Symptom | Root Cause | Fix Location |
|---|
Second dispatch yields duplicate key threads_pkey | Readable number allocated per zone + primary key globally unique + PG does not support \d regex | Migration 0016 source function (SECURITY DEFINER global max) |
| Event "write succeeded" but not found | Source query in RLS context sees only current zone, collision with other zone's segment silently dropped idempotently | Migration 0015 biz_events_max_event_no bypass RLS at tenant scope |
| Thread number exponential explosion (T-133111..., 20-digit overflow) | PG driver returns bigint as string, +1 becomes string concatenation | Call site Number() conversion |
| Fence should review but blocks all | DSL does not support in/contains_any + missing path throws error | expr.ts DSL extension + lenient comparison context for missing paths |
| QUEST content domain goal only decomposes 1 step | planQuest template only covers hotel domain | loop.ts content production chain five-step template + dispatch injects llmCall |
| Assembly validation of other domain's Bundle always red | Probe locked to current workspace by RLS | assembly.ts switch to Bundle territory check |
| Mock test reports "mock did not cover SQL" | Source function SQL not registered in test mock | Test file adds biz_events_max_event_no match |
Cross-Product Synchronization Discipline
- Foundation fixes (
packages/base, packages/runtime, apps/server, packages/db/migrations) must be synchronized to all WorkLoom series repositories (currently: workloom, hyperreality-system), and validated per repository: suite + base unit tests + typecheck + release:gate all green before pushing each.
- Release gate script
scripts/release-gate.ts is workspace-adaptive, can be directly copied to other foundation products.
Memory Anchors
- Organization memory:
org_memory.mem-release-gate-* (ws-yunqi / ws-video / ws-geo, SOP, confidence 0.95)
- Policy document:
docs/release-checklist.md
- Executable gate:
scripts/release-gate.ts (pnpm release:gate)