Entry Examples——模具行业从业者必备知识手册
-
<h2>Entry Examples</h2>
<p>Concrete examples of well-formatted entries with all fields.</p>
<h3>Learning: Correction</h3>
<pre><code>
[LRN-20250115-001] correction
Logged: 2025-01-15T10:30:00Z
Priority: high
Status: pending
Area: testsSummary
Incorrectly assumed pytest fixtures are scoped to function by default
Details
When writing test fixtures, I assumed all fixtures were function-scoped.
User corrected that while function scope is the default, the codebase
convention uses module-scoped fixtures for database connections to
improve test performance.Suggested Action
When creating fixtures that involve expensive setup (DB, network),
check existing fixtures for scope patterns before defaulting to function scope.Metadata
- Source: user_feedback
- Related Files: tests/conftest.py
- Tags: pytest, testing, fixtures
</code></pre>
<h3>Learning: Knowledge Gap (Resolved)</h3>
<pre><code>
[LRN-20250115-002] knowledge_gap
Logged: 2025-01-15T14:22:00Z
Priority: medium
Status: resolved
Area: configSummary
Project uses pnpm not npm for package management
Details
Attempted to run
npm installbut project uses pnpm workspaces.
Lock file ispnpm-lock.yaml, notpackage-lock.json.Suggested Action
Check for
pnpm-lock.yamlorpnpm-workspace.yamlbefore assuming npm.
Usepnpm installfor this project.Metadata
- Source: error
- Related Files: pnpm-lock.yaml, pnpm-workspace.yaml
- Tags: package-manager, pnpm, setup
Resolution
- Resolved: 2025-01-15T14:30:00Z
- Commit/PR: N/A - knowledge update
- Notes: Added to CLAUDE.md for future reference
</code></pre>
<h3>Learning: Promoted to CLAUDE.md</h3>
<pre><code>
[LRN-20250115-003] best_practice
Logged: 2025-01-15T16:00:00Z
Priority: high
Status: promoted
Promoted: CLAUDE.md
Area: backendSummary
API responses must include correlation ID from request headers
Details
All API responses should echo back the X-Correlation-ID header from
the request. This is required for distributed tracing. Responses
without this header break the observability pipeline.Suggested Action
Always include correlation ID passthrough in API handlers.
Metadata
- Source: user_feedback
- Related Files: src/middleware/correlation.ts
- Tags: api, observability, tracing
</code></pre>
<h3>Learning: Promoted to AGENTS.md</h3>
<pre><code>
[LRN-20250116-001] best_practice
Logged: 2025-01-16T09:00:00Z
Priority: high
Status: promoted
Promoted: AGENTS.md
Area: backendSummary
Must regenerate API client after OpenAPI spec changes
Details
When modifying API endpoints, the TypeScript client must be regenerated.
Forgetting this causes type mismatches that only appear at runtime.
The generate script also runs validation.Suggested Action
Add to agent workflow: after any API changes, run
pnpm run generate:api.Metadata
- Source: error
- Related Files: openapi.yaml, src/client/api.ts
- Tags: api, codegen, typescript
</code></pre>
<h3>Error Entry</h3>
<pre><code>
[ERR-20250115-A3F] docker_build
Logged: 2025-01-15T09:15:00Z
Priority: high
Status: pending
Area: infraSummary
Docker build fails on M1 Mac due to platform mismatch
Error
</code></pre>
<p>error: failed to solve: python:3.11-slim: no match for platform linux/arm64</p>
<pre><code>Context
- Command:
docker build -t myapp . - Dockerfile uses
FROM python:3.11-slim - Running on Apple Silicon (M1/M2)
Suggested Fix
Add platform flag: `doc
新手建议收藏,老手欢迎指点。
</code></pre>