Dated, short lessons from real AgentDescent work. Agents read this before coding. Durable rules get promoted into CODE_STANDARDS.md (and a pointer in CONTRIBUTING.md when humans need it).
- Before a change: skim every open lesson. Treat them as hard constraints until promoted or retired.
- When something bites again: add or bump a lesson the same day. Date it
(
YYYY-MM-DD, Asia/Shanghai). Keep it to trigger → wrong move → right move. - Seen N×: each recurrence increments
Seenand names the issue/PR. The first write-up isSeen 1×. - Promote after ≥3 days: once a lesson has stayed true for at least three
calendar days, move the durable rule into CODE_STANDARDS.md and leave a
one-line
Promoted → CODE_STANDARDS.md#…stub here (or delete the lesson once a test enforces it). - Security lessons stay hot: secrets, sandboxing and untrusted-rule themes stay here until a test enforces them, even after promotion.
- Write AgentDescent facts only; do not paste another project's process text.
- Seen: 3× (#404 Codex MCP server, #415 DSH install + native plugin, #423 doctor)
- Trigger: a new install path, host launcher or
doctorcheck that needs the model key (ARK_API_KEYand friends). - Wrong: a hand-written list of variable names per host, or checking only
OPENAI_API_KEY; the run then starts without a key ordoctorreports a missing key that is set. - Right: read the shared
agentdescent.integrations.FORWARDED_ENVlist (and its provider-key subset); add a test that the new path forwards exactly that list. Keys come from the environment only, never from a file you write. - Promote path: 2026-10-21 → CODE_STANDARDS.md (Secrets and real models).
- Seen: 1× (on 2026-10-19 #431–#435 are all
CONFLICTINGwithmain; they and #436–#439 all editagentdescent/__init__.pyanddocs/api.md, most alsodocs/meta-evolution.md) - Trigger: several open PRs that each export a new symbol or extend the same doc page.
- Wrong: hand-merging
docs/api.md, or leaving the PR to rot until someone else rebases it. - Right: merge
origin/main, resolve__init__.pyand the prose by hand, take main'sdocs/api.mdand rerunpython -m tools.gen_api_docs, then the fullpytest -qat the new tip (it voids any earlier PASS). - Promote path: after ≥3 days → CODE_STANDARDS.md (Generated files).
- Seen: 2× (#428 renamed its fragment after the fact; #433 carries placeholder fragments
changelog.d/999-*.md) - Trigger: adding
changelog.d/<number>-<slug>.mdbefore the number is known. - Wrong: guessing the next PR number, or reusing another PR's number.
- Right: use the issue number; with no issue, open the PR first and rename the fragment to the PR number in the same branch before review.
- Promote path: after ≥3 days → CODE_STANDARDS.md (Changelog).
- Seen: 1× (the FlyBot process port: labels, risk tiers, controller, review gate, these docs)
- Trigger: a PR that touches
.github/**,AGENTS.md,LESSONS.md,CONTRIBUTING.md,CODE_STANDARDS.md,.claude/**orpyproject.toml. - Wrong: enabling auto-merge because CI is green and the change "is only docs".
- Right:
risk_gate.pysays T3 → self-PASS at the tip, addawaiting-approval, stop. Danyang merges. - Promote path: after ≥3 days → CODE_STANDARDS.md (Merge only a reviewed tip).