Factory Intelligence

Learnings Ledger

Every failure mode gets captured, tagged, and reused. This ledger is the memory layer that prevents repeated mistakes across new builds.

# Forensic Learnings

Filterable CL-FAC log extracted from PROJECT_REPORTS.md.

Showing 160 of 160 learnings parsed from PROJECT_REPORTS.md.

CL-FAC-010 CRITICAL

Factory bypassed its own tools

CL-FAC-012 CRITICAL

Orchestrator wrote scripts instead of orchestrating

CL-FAC-013 CRITICAL

Orchestrator bypassed its own review score target

CL-FAC-016 CRITICAL

Per-tenant email uniqueness breaks login

CL-FAC-020b CRITICAL

Discussion logs not saved -- training data lost

CL-FAC-029 CRITICAL

Email case sensitivity in SQLite UNIQUE constraint

CL-FAC-029b CRITICAL

Bootstrap admin registration pattern

CL-FAC-030 CRITICAL

Validate event_type matches device_type

CL-FAC-033b CRITICAL

CORS wide-open despite known factory trap

CL-FAC-053 CRITICAL

Silent Error Swallowing Epidemic

CL-FAC-054 CRITICAL

Hardcoded Secrets in Source Code

CL-FAC-055 CRITICAL

Zero or False-Positive Test Coverage

CL-FAC-058 CRITICAL

No measurable success criteria defined

CL-FAC-059 CRITICAL

Vague requirements without numerical spec

CL-FAC-061 CRITICAL

No explicit OUT-OF-SCOPE list

CL-FAC-063 CRITICAL

No Day 0 smoke test on target environment

CL-FAC-067 CRITICAL

Config files required but not created

CL-FAC-068 CRITICAL

Multi-provider architecture without cost analysis

CL-FAC-073 CRITICAL

Path traversal vulnerability in file uploads

CL-FAC-074 CRITICAL

Unrestricted CORS configuration

CL-FAC-081 CRITICAL

hot_state rebuild uses wrong column names

CL-FAC-082 CRITICAL

Task assigned without valid route

CL-FAC-086 CRITICAL

Sync sqlite3 in async FastAPI blocks event loop

CL-FAC-090 CRITICAL

Frontend/backend field name mismatch -- renders empty

CL-FAC-094 CRITICAL

Claude declares "complete" with backend only

CL-FAC-096 CRITICAL

Frontend/Backend field name mismatch (extended)

CL-FAC-097 CRITICAL

WebSocket broadcasts never called -- dead code

CL-FAC-100 CRITICAL

Claude claims "fixed" without running verification

CL-FAC-102 CRITICAL

HotState must be integrated into routes, not just exist

CL-FAC-103 CRITICAL

List endpoints need pagination from day one

CL-FAC-104 CRITICAL

Putaway tasks must auto-generate on receiving completion

CL-FAC-106 CRITICAL

Pack tasks must auto-create when all picks complete

CL-FAC-109 CRITICAL

FK validation missing on INSERT causes 500s

CL-FAC-114 CRITICAL

Blueprint claims not enforced as tests -- spec fidelity gap

CL-FAC-140 CRITICAL

gRPC services need command queues -- not inline yields

CL-FAC-141 CRITICAL

Task assignment needs a background loop

CL-FAC-143 CRITICAL

Task completion must be triggered by robot state

CL-FAC-147 CRITICAL

gRPC must use TLS + auth interceptor

CL-FAC-148 CRITICAL

Dead code subsystems -- functions never called from main flow

CL-FAC-167 CRITICAL

gRPC proto must use string-encoded decimals for billing

CL-FAC-001 HIGH

Claude --print returns prose instead of code

CL-FAC-003 HIGH

validate_code() rejects tiny files as "prose"

CL-FAC-005 HIGH

Wrong import paths -- flat vs package

CL-FAC-007 HIGH

No provider fallback on repeated failure

CL-FAC-011 HIGH

LLM adds self-import in config file

CL-FAC-014 HIGH

Gemini not given contracts for contract review

CL-FAC-015 HIGH

passlib+bcrypt incompatibility on Python 3.12+

CL-FAC-018b HIGH

Pasting file contents into CLI prompts instead of using workdir

CL-FAC-019b HIGH

Local LLMs (phi4, Qwen) never called -- Claude does everything

CL-FAC-021 HIGH

Python hash() is non-deterministic across processes

CL-FAC-021b HIGH

Claude writes files it was told to delegate

CL-FAC-023 HIGH

config.DB_PATH must be read dynamically for test isolation

CL-FAC-028 HIGH

PyJWT requires sub claim as string, not integer

CL-FAC-028b HIGH

Partial unique index for soft-delete patterns

CL-FAC-030c HIGH

from app.config import VALUE captures at import time

CL-FAC-031 HIGH

Kimi generates false positive CRITICAL findings

CL-FAC-034b HIGH

Playwright E2E promised in blueprint but never built

CL-FAC-035b HIGH

Missing "my items" endpoint for CRUD owners

CL-FAC-037b HIGH

IntegrityError on duplicate crashes instead of 409

CL-FAC-038 HIGH

FTS5 contentless tables need application-level sync

CL-FAC-040 HIGH

updated_at must update on ALL mutations

CL-FAC-041b HIGH

FTS5 injection repeated despite P11 learning

CL-FAC-042 HIGH

Trip end coordinates should use stationary position

CL-FAC-042b HIGH

Timing attack on password comparison

CL-FAC-043 HIGH

Always add final distance segment when closing trips

CL-FAC-043b HIGH

Response format mismatch -- code vs contract

CL-FAC-046 HIGH

PMO Gate 10 too weak -- checks existence not content

CL-FAC-057 HIGH

Race Conditions in Concurrent File Operations

CL-FAC-060 HIGH

Technology selection without alternatives

CL-FAC-062 HIGH

Missing Architecture Decision Records

CL-FAC-064 HIGH

Missing edge case planning

CL-FAC-065 HIGH

No performance benchmarks defined

CL-FAC-069 HIGH

ML classification without accuracy threshold

CL-FAC-070 HIGH

No dependency budget -- install size bloat

CL-FAC-071 HIGH

Corrupted .gitignore allows secrets committed

CL-FAC-072 HIGH

Weak password hashing (SHA256 no salt)

CL-FAC-076 HIGH

Permission system fail-open

CL-FAC-078 HIGH

Subprocess pipes not cleaned on exception paths

CL-FAC-079 HIGH

Database connections without context managers

CL-FAC-080 HIGH

File uploads without size limits

CL-FAC-083 HIGH

Database schema missing indexes from blueprint

CL-FAC-087 HIGH

E2E fixture scope mismatch -- tests exist but don't run

CL-FAC-088 HIGH

Collision avoidance at assignment only -- no runtime

CL-FAC-091 HIGH

Battery service exists but never called

CL-FAC-092 HIGH

WebSocket events incomplete -- only 2 of 6+ broadcast

CL-FAC-093 HIGH

datetime.utcnow() deprecated

CL-FAC-095 HIGH

142 tests pass but 5 CRITICAL bugs in code

CL-FAC-098 HIGH

Battery management not wired into ping flow

CL-FAC-099 HIGH

WebSocket URL hardcoded to wrong port

CL-FAC-105 HIGH

Inventory status must transition after putaway

CL-FAC-107 HIGH

Order status must transition through full lifecycle

CL-FAC-110 HIGH

Negative values silently accepted -- validate numeric inputs

CL-FAC-115 HIGH

No requirements.txt -- project not reproducible

CL-FAC-142 HIGH

Route planning must cover full trip -- not just first leg

CL-FAC-144 HIGH

Map data must persist to database -- not in-memory dict

CL-FAC-145 HIGH

WebSocket broadcast shape must match frontend types

CL-FAC-149 HIGH

Contract shape mismatches -- 11 fields don't match blueprint

CL-FAC-150 HIGH

Emergency stop must be immediate -- clear queue first

CL-FAC-152 HIGH

WebSocket command handler is a stub

CL-FAC-153 HIGH

Analytics events mostly never logged -- dashboard shows zeros

CL-FAC-156 HIGH

Contract Alignment -- JWT payload missing tenant_id

CL-FAC-159 HIGH

Test files must test what their name claims

CL-FAC-160 HIGH

Tests must use correct auth roles

CL-FAC-163 HIGH

Security gates must fail closed not open

CL-FAC-164 HIGH

Blueprint models must be wired or removed

CL-FAC-166 HIGH

WebSocket broadcast must be wired into ingestion flow

CL-FAC-002 MEDIUM

Qwen Coder outputs "python" on first line

CL-FAC-004 MEDIUM

pytest-asyncio fixture API changed

CL-FAC-006 MEDIUM

DaC parser fails on real LLM output

CL-FAC-008 MEDIUM

No runtime validation -- only syntax check

CL-FAC-009 MEDIUM

Prompts not built from blueprint contracts

CL-FAC-018 MEDIUM

Kimi QC penalizes out-of-scope features

CL-FAC-019 MEDIUM

Qwen Coder still generates self-imports

CL-FAC-020 MEDIUM

Kimi falsely flags valid SQLite datetime syntax

CL-FAC-024 MEDIUM

Column name whitelisting for dynamic UPDATE queries

CL-FAC-026 MEDIUM

Gemini can't find files without absolute paths

CL-FAC-027 MEDIUM

/health endpoint missing from blueprints

CL-FAC-030b MEDIUM

SQLite does not auto-update updated_at

CL-FAC-031b MEDIUM

httpx.AsyncClient per request wastes connections

CL-FAC-032 MEDIUM

Soft-delete checks needed on referenced entities

CL-FAC-032b MEDIUM

Retry endpoint must validate parent entity is active

CL-FAC-033 MEDIUM

Trailing slash redirects break httpx tests

CL-FAC-035 MEDIUM

Kimi penalizes single-process design as "critical"

CL-FAC-036b MEDIUM

Whitespace-only usernames pass validation

CL-FAC-037 MEDIUM

Generator-based DB access in WebSocket handlers

CL-FAC-038b MEDIUM

JWT payload sub must be guarded with int() conversion

CL-FAC-039 MEDIUM

Offset-based pagination required for ranked search

CL-FAC-039b MEDIUM

cursor pagination must guard `is not None` not truthy

CL-FAC-040b MEDIUM

FTS5 malformed queries crash without catch

CL-FAC-041 MEDIUM

Tag creation race condition -- use INSERT OR IGNORE

CL-FAC-044 MEDIUM

Clamp Haversine formula input to prevent float errors

CL-FAC-044b MEDIUM

WebSocket broadcast not connected to activity logging

CL-FAC-045b MEDIUM

DELETE status code inconsistency (200 vs 204)

CL-FAC-056 MEDIUM

Hardcoded Configuration Values

CL-FAC-066 MEDIUM

AI-hallucinated features without user stories

CL-FAC-075 MEDIUM

Phantom dependencies in requirements.txt

CL-FAC-077 MEDIUM

Documentation drift -- references to non-existent files

CL-FAC-084 MEDIUM

Codex scores oscillate -- contract consistency iterative

CL-FAC-085 MEDIUM

SQLite check_same_thread with FastAPI TestClient

CL-FAC-089 MEDIUM

Hardcoded WebSocket URL

CL-FAC-101 MEDIUM

Factory fixes symptoms not causes -- structural debt

CL-FAC-111 MEDIUM

Dock lifecycle incomplete -- receiving must release dock

CL-FAC-112 MEDIUM

Pack before picks complete -- add cross-entity guards

CL-FAC-146 MEDIUM

PostgreSQL column names may differ from API field names

CL-FAC-151 MEDIUM

Redis KEYS command blocks server -- use SCAN

CL-FAC-157 MEDIUM

Dead Code -- analytics markers never called

CL-FAC-158 MEDIUM

Duplicate function definitions across services

CL-FAC-161 MEDIUM

Pydantic schemas must constrain string lengths

CL-FAC-162 MEDIUM

CORS wildcards are a security risk

CL-FAC-022 LOW

FastAPI on_event deprecated -- use lifespan

CL-FAC-034 LOW

WebSocket requires accept() before close

CL-FAC-154 LOW

PMO False Positive -- "proto" in "prototype"

CL-FAC-155 LOW

OUT-OF-SCOPE "frontend" keyword triggers UI check

CL-FAC-165 LOW

PMO extracts field names as event types -- false positives

CL-FAC-017 INFO

Orchestrator followed workflow correctly (POSITIVE)

CL-FAC-025 INFO

Qwen Coder generates clean code with precise specs (POSITIVE)

CL-FAC-036 INFO

Qwen Coder handles WebSocket contracts cleanly (POSITIVE)

CL-FAC-045 INFO

Kimi score deflation is consistent -- push back firmly

CL-FAC-108 INFO

Codex sandbox cannot make HTTP requests

CL-FAC-113 INFO

Codex danger-full-access sandbox enables HTTP but slow