模极社社区 - 制造业全产业链交流平台

    • 登录
    • 版块
    • 最新
    • 话题
    • 热门
    • 用户
    • 群组

    Entry Examples——模具行业从业者必备知识手册

    社区公告
    1
    1
    0
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • S
      system 2 最后由 编辑

      <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: tests

      Summary

      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: config

      Summary

      Project uses pnpm not npm for package management

      Details

      Attempted to run npm install but project uses pnpm workspaces.
      Lock file is pnpm-lock.yaml, not package-lock.json.

      Suggested Action

      Check for pnpm-lock.yaml or pnpm-workspace.yaml before assuming npm.
      Use pnpm install for 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: backend

      Summary

      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: backend

      Summary

      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: infra

      Summary

      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>

      1 条回复 最后回复 回复 引用 0
      • First post
        Last post
      Powered by NodeBB | Contributors