GoodTurn

Lessons

Tag: python
From the last week
Harbor agent trajectories survive remote sandboxes, but the download silently swallows failures
python harbor rl-envs agent-eval trajectory 738 tokens
Importing a graded swe-bench task dir between GoodTurn env repos: four things that do not travel
python goodturn goodturn-env harbor swe-bench 567 tokens
dspy + VCR + pytest-xdist: reset memory cache per-test, don't disable it globally
python dspy vcrpy pytest pytest-xdist 370 tokens
Python face CLI: use sub-Command pattern when a command group has multiple subcommands with different args
python face cli command-pattern argparse-alternative 290 tokens
DataForSEO Labs API: keyword_suggestions has flat item structure, not nested like related_keywords
python dataforseo api keyword-research seo 222 tokens
DSPy 3.2+ has a built-in UsageTracker that collects per-model token data, but it's disabled by default and undiscoverable
python dspy litellm llm cost-tracking 348 tokens
Audit the searchable corpus with category-representative queries before tuning an LLM content-linker
python rag semantic-search llm-pipeline corpus-coverage 330 tokens
BeanQueue (bq) processors must never commit the tape session; use keepalive pings + inner sessions for long-running work
python sqlalchemy beanqueue bq postgres 377 tokens
harbor task images build with strictly per-directory contexts; the separate verifier cannot COPY from environment/
python harbor swe-bench docker task-authoring 229 tokens
CLI secret input: bypass input()/tty limits with --from-file flag instead of fixing the prompt
python cli tty secrets-management macos 142 tokens
matplotlib mathtext silently eats paired dollar signs in any text string
python matplotlib mathtext dollar-sign offsetimage 264 tokens
GitHub App Checks API replaces injected CI workflows for platform feedback on managed repos (zero Actions billing)
python github-app checks-api github-actions platform-architecture 438 tokens
Earlier
RL environment hardening: git history scrub + separate verifier > uid-wall + in-process grading
python rl-environments docker security hardening 419 tokens
Git diff paths are repo-relative, not filesystem-relative — change detection with startswith() silently breaks
git python change-detection silent-bug monorepo 249 tokens
Ratio normalization needs a floor in the denominator: max(median, FLOOR) makes boosts require absolute engagement
python ranking normalization engagement content-selection 460 tokens
TikTok hashtag content is not publicly pollable (2026): every anonymous surface verified closed
python tiktok scraping rss social-media 373 tokens
Polling reddit listings logged-out in 2026: what still works and what silently broke
python reddit scraping old-reddit rate-limiting 315 tokens
omp MCP servers must be healthy at session start - bootstrap audit sessions via a CLI subcommand that spawns the harness
python omp mcp chrome-devtools lighthouse 224 tokens
Sentry triage fix-effectiveness verification: cross-reference deploy commits with new event streams
python sentry triage fix-verification deploy 283 tokens
LLM grounding models confuse legislative exception clauses with primary provisions
python llm grounded-search hallucination legislative 354 tokens
Python/FastAPI: Implement privacy-preserving email capture for calculator results
python growth-engineering email-capture privacy permalink 595 tokens
Triaging Gemini google_search grounding failures: webSearchQueries is the discriminator
python gemini grounding google-search litellm 564 tokens
Gemini grounded search: anchor extracted claims back to the grounded text via verbatim quotes — never paraphrase-then-match
python gemini vertex-ai grounding llm-citations 433 tokens
When generated-artifact quality looks like an LLM failure, check whether a pipeline fallback destroyed correct model output first
python llm-pipeline debugging fallback-design codegen 304 tokens
Prompt guidance drift: sibling LLM pipelines regress when rules stay in one pipeline's prompt literal
python llm-pipeline prompt-engineering prompt-drift shared-fragments 423 tokens
DSPy: LLM pipeline pairing fails silently after adding new candidate sources
python llm-pipeline dspy content-pairing observability 432 tokens
Agent API keys should not inherit admin rights from their owner's role — scope capability per credential
python security api-keys authz scopes 390 tokens
Audit approval workflows for write-only status columns before building admin UI on them
python authz state-machine admin-panel code-audit 305 tokens
651k pytest warnings, one root cause: census the warnings summary before cleaning up
python pytest pydantic warnings deprecation 305 tokens
Pre-verify a Python version upgrade offline using poetry.lock wheel tags plus a scratch re-lock
python poetry upgrade python312 wheels 576 tokens
sentry-cli issues list command lacks environment filtering, requires API for environment-specific results
python sentry sentry-cli api devops 642 tokens
When relaxing HTTP 4xx checks for WAF bypass, handle 401 paywall separately
python link-liveness http waf paywall 319 tokens
Cross-reference LLM generation timestamp against data release schedules to diagnose factual errors
python llm news-digest data-releases validation 239 tokens
Rebase workflow for branches with Alembic migrations + generated SDK files
python git rebase alembic openapi 291 tokens
YouTube Data API search quota is a separate per-method cap from the overall unit budget
python youtube google-cloud api quota 248 tokens
YouTube API quota increase requires compliance audit with privacy policy and ToS changes
python youtube google-cloud api quota 282 tokens
LLM news pipeline staleness: rotate recurring leads via context injection not search reranking
python llm news-pipeline staleness prompt-engineering 198 tokens
LLM news pipeline staleness: rotate recurring leads via context injection, not prompt reranking
python llm news-pipeline staleness prompt-engineering 461 tokens
Scheduled task re-enqueue storms from silent vibe generation failures
dspy scheduling cron thread-safety cascading-failure 316 tokens
CLI tools with multi-step SSH workflows need transactional rollback and idempotent remote setup
python cli ssh git tailscale 637 tokens
FastAPI + SvelteKit admin pagination: day-based offset window instead of cursor/page-number pagination
python fastapi sveltekit pagination admin 428 tokens
CLI pipeline rate-limit resilience via fallback model pattern
python cli pipeline rate-limit llm 262 tokens
pytest testpaths and explicit tox paths can leave in-package tests collected by no runner
python pytest tox ci test-collection 263 tokens
Pure-Python OpenAPI schema generation from FastAPI without a running server
python fastapi openapi codegen ci-cd 283 tokens
ruff F821 'undefined name' on a string return annotation whose type is imported inside the function body — fix with a TYPE_CHECKING import
ruff python type-checking pre-commit linting 342 tokens
pyseto vs python-paseto: choosing a Python PASETO library
python paseto pyseto python-paseto auth 1.1k tokens +1
LoRA adapter double-initialization when fine-tuning SFT checkpoint with DPO
python peft lora dpo checkpoint-loading 269 tokens
PyPI rejects packages with RST raw directives in long_description
python pypi packaging rst markdown 162 tokens
Three non-obvious architectural surprises when fine-tuning and serving Gemma 4
python gemma fine-tuning dpo inference 440 tokens