docs: harvest review lessons from PRs merged 2026-07-24 to 2026-07-31 - #10098
docs: harvest review lessons from PRs merged 2026-07-24 to 2026-07-31#10098saltas888 wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
1 issue found across 17 files
Confidence score: 5/5
- In
dev/knowledge/backend/merge-recompute.md, referencing a non-existent_derive_family_targetsmethod could mislead maintainers during debugging or future edits, increasing the chance of incorrect changes in recompute target resolution; align the docs with the current_resolve_targetsfamily-derivation flow (or add a clear pointer to where that logic now lives).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="dev/knowledge/backend/merge-recompute.md">
<violation number="1" location="dev/knowledge/backend/merge-recompute.md:77">
P3: The documentation references `_derive_family_targets` as a method in `core/merge/recompute_coalescing.py`, but this method does not exist in the codebase. The family-specific derivation inside `_resolve_targets` is done through `_resolve_computed_targets` and the imported functions `derive_display_label_targets` / `derive_hfid_targets`. Consider updating the reference to match the actual code — either list the real method/function names, or use a descriptive phrase like 'the family-specific derive calls within _resolve_targets' to avoid misleading readers who search for this symbol.</violation>
</file>
Shadow auto-approve: would not auto-approve because issues were found.
Re-trigger cubic
|
|
||
| ## Adding a new resolution branch | ||
|
|
||
| `CoalescedRecomputeBuilder`'s target resolution (`_resolve_targets` / `_derive_family_targets` in |
There was a problem hiding this comment.
P3: The documentation references _derive_family_targets as a method in core/merge/recompute_coalescing.py, but this method does not exist in the codebase. The family-specific derivation inside _resolve_targets is done through _resolve_computed_targets and the imported functions derive_display_label_targets / derive_hfid_targets. Consider updating the reference to match the actual code — either list the real method/function names, or use a descriptive phrase like 'the family-specific derive calls within _resolve_targets' to avoid misleading readers who search for this symbol.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At dev/knowledge/backend/merge-recompute.md, line 77:
<comment>The documentation references `_derive_family_targets` as a method in `core/merge/recompute_coalescing.py`, but this method does not exist in the codebase. The family-specific derivation inside `_resolve_targets` is done through `_resolve_computed_targets` and the imported functions `derive_display_label_targets` / `derive_hfid_targets`. Consider updating the reference to match the actual code — either list the real method/function names, or use a descriptive phrase like 'the family-specific derive calls within _resolve_targets' to avoid misleading readers who search for this symbol.</comment>
<file context>
@@ -72,6 +72,19 @@ An empty write set dispatches nothing, which is the normal stop: an acyclic depe
+## Adding a new resolution branch
+
+`CoalescedRecomputeBuilder`'s target resolution (`_resolve_targets` / `_derive_family_targets` in
+`core/merge/recompute_coalescing.py`) branches on how precisely a change signature is known — an
+`UPDATED` event with a recorded field list resolves targets narrowly; an unscoped or otherwise
</file context>
| `CoalescedRecomputeBuilder`'s target resolution (`_resolve_targets` / `_derive_family_targets` in | |
| `CoalescedRecomputeBuilder`'s target resolution (`_resolve_targets` and its family-specific derive calls in |
There was a problem hiding this comment.
0 issues found across 4 files (changes from recent commits).
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Shadow auto-approve: would not auto-approve. Auto-approval blocked by 1 unresolved issue from previous reviews.
Re-trigger cubic
There was a problem hiding this comment.
0 issues found across 6 files (changes from recent commits).
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Shadow auto-approve: would not auto-approve. Auto-approval blocked by 1 unresolved issue from previous reviews.
Re-trigger cubic
Reviewers repeatedly had to spell out the same conventions across this week's PRs, because each lesson lived in a review thread and died there. This is a harvesting-review run over PRs merged since the last such run (#10032), turning feedback that generalizes into durable internal-doc conventions. Each candidate lesson was reconstructed against the before/after code, verified against the current codebase, and checked against what's already documented before landing — per .claude/skills/harvesting-review/. Docs-only — no code, no generated files, no schema. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014BhxKtqsNFkVTV3BN3Qzpj
…g to skill Two fixes to the previous commit's harvested lessons, from user review: - The "no file:line citations" lesson (from PR #10038) was routed to .agents/rules/code-doc-style.md by extending its `paths` frontmatter to cover dev/specs/**/*.md and dev/knowledge/**/*.md. That file is scoped to *source-code* comment/docstring hygiene (.py/.ts/.tsx) and is auto-injected into every agent turn touching those paths — extending its scope to markdown docs both mis-labels the rule's home and starts injecting code-comment guidance (irrelevant to prose docs) whenever anyone edits a spec or knowledge file. Reverted, and added the rule instead to dev/guidelines/documentation.md's existing "Don't" list, right beside the sibling PR/spec-citation rule it belongs next to. - schema-definitions.md's "Known gap: some generated value objects are hand-duplicated" note described a *current defect* in ComputedAttribute's generated model, not a durable convention — it goes stale (silently false) the moment someone fixes it, and nothing would ever revisit it. Reframed as a forward-looking rule for the next value-object generated the same way, with the specific-to-today defect description dropped. Also updated the harvesting-review skill itself: every run only ever added to the internal-doc layer, with nothing pruning stale citations, fixed defect-snapshots, or superseded narrow rules from earlier runs. A repo sweep found this is already real debt — 15 pre-existing PR-number citations and 4 pre-existing file:line citations survive from before the anti-citation rule was even written (commit 98030d5). Added §5 "Sweep for rot" to the skill: every harvest run now also greps the destination layer for the anti-patterns it already forbids, drops or fixes what it finds, and reports it under a new "Pruned or consolidated" section — so removal happens continuously, driven by the same review evidence, rather than needing a separate cleanup pass. Docs-only. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014BhxKtqsNFkVTV3BN3Qzpj
User called out that the previous commit added a "sweep for rot" step to the skill and reported 19 pre-existing citation-rot hits, but didn't fix any of them — describing debt isn't removing it, and a punch list nobody acts on is just more text added to the docs. Fixed all 19 hits found by the §5 sweep: - dev/guidelines/frontend/page-architecture.md: dropped 5 "(PR #9099)" citations, kept the behavior descriptions. - dev/guidelines/frontend/route-architecture.md: dropped the "PR #9930" citation from the DatePreferencesProvider example. - dev/knowledge/frontend/shared-components.md: dropped the "PR #9099" citation. - dev/knowledge/frontend/design-system.md: dropped 5 "Migrated in #NNNN" citations from the component inventory table and the migration-policy bullet. - dev/knowledge/backend/templates.md: dropped 4 file:line citations. While verifying each against current code (per the skill's tightened §5c), found the citations weren't just stale numbers — `Node._apply_template()` no longer exists; the method is now `handle_object_template()`. Fixed the method name too, not just the line reference. Also tightened the skill's §5c: the previous wording let a run defer cheap, mechanical hits to a "punch list ... let the user decide" — exactly the loophole that produced zero deletions last commit. Every hit from the mechanical grep is now expected to be fixed in the same PR; "Pruned or consolidated" is a changelog of what got removed, not a to-do list, and the report format note was updated to match. Deferral is reserved for a genuine judgment call (file an issue, or a section needing a fuller rewrite), never for "there were several." Docs-only. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014BhxKtqsNFkVTV3BN3Qzpj
6ba7772 to
5b190af
Compare
Why
Reviewers repeatedly had to spell out the same conventions across this week's PRs, because each lesson lived in a review thread and died there. This is a
harvesting-reviewrun over PRs merged 2026-07-24 → 2026-07-31 (the window since the last such run, #10032), turning feedback that generalizes into durable internal-doc conventions so a future author (human or agent) follows the convention the first time instead of a reviewer having to raise it again.Each candidate lesson was reconstructed against the before/after code, verified against the current codebase, and checked against what's already documented before landing — per
.claude/skills/harvesting-review/.Targets
stable, notdevelop. Retargeted on request. Sincestableis behinddevelopby a large margin, several lessons from this run document features that don't exist onstableat all and were dropped from this PR rather than carried over describing nonexistent code:dev/knowledge/frontend/diff-tree.md(the diff-tree/diff-list node-set fix, from fix: show changed nodes in diff tree when their parent is unchanged #10014) — the underlying frontend fix (build-diff-tree-items.ts) isn't onstable.dev/knowledge/backend/merge-recompute.mdinvariant note (from fix(recompute): refresh a reader's derived values when its read peer is deleted #9845) — the whole file, and the coalesced-recompute module it describes, don't exist onstable.Query.get_query_arrows()directional-Cypher lesson indatabase-schema.md/query-pattern.md(from the scope uniqueness constraints to specific objects #10053/scope uniqueness constraints to affected objects #10019/final uniqueness-constraint related touchups #10082 cluster) — that helper doesn't exist onstable.ComputedAttributegenerated-model-drift note inschema-definitions.md(from feat: separate user-facing schema (write/read) from internal model [INFP-234] #9814) — the whole "Field Visibility and the Write/Read/Internal Models" section it was attached to isn't onstable(that feature hasn't landed there either).One example (
StaleEntryCleaner/clear_expired) indev/guidelines/backend/testing.mdwas genericized from its originalStaleLockCleanernaming for the same reason — the rule is real and durable, but the specific class it illustrated (from #10031) isn't onstable. The pruning fixes (see below) also picked upstable's own, slightly different copy ofdesign-system.md(an older table layout with its own separate set of staleMigrated in #NNNNcitations) and cleaned that up in place rather than trying to overwrite it withdevelop's newer table structure.Three rounds of follow-up after the initial push, all from user review:
file.py:linecitations" lesson had been mis-routed into.agents/rules/code-doc-style.md(a source-code comment/docstring rule, auto-injected on every turn touching.py/.ts/.tsx) by extending itspathsfrontmatter to also cover markdown docs. Re-homed todev/guidelines/documentation.mdinstead, next to the sibling PR/spec-citation rule it belongs beside. Also dropped a "known gap" note that described a current code defect rather than a durable convention.PR #NNNN/Migrated in #NNNNcitations across 5 files, kept the underlying prose), and while verifying one file's citations against current code, found the rot wasn't just stale line numbers —templates.mdcited a method,Node._apply_template(), that no longer exists (renamed tohandle_object_template()); fixed that too. Also tightened the skill itself so this doesn't recur: §5's "report the rest as a punch list" escape hatch is gone — every mechanical hit is now expected to be fixed in the same PR, not deferred.stable(this update) — required rebasing the branch and dropping/adapting the develop-only-feature lessons above rather than mechanically replaying the same diff onto a base where they don't apply.Source PRs (audited against
develop, where all twelve were merged)Twelve PRs (one cluster of three related PRs counted once) were audited, one subagent per PR:
Maplookup. (lesson dropped from this PR — feature not onstable, see above)tasks/*.pybackend imports must stay function-local (asked 4 times in one PR); cubic: a generatedComputedAttributesub-model is hand-duplicated from its canonical model with no drift guard. (the drift-guard lesson dropped from this PR — feature not onstable, see above)startswith(and the same bug still lives, unfixed, inConditionalGZipMiddleware); ajtmccarty's DI/observer and settings-at-boundary findings substantially overlap with the still-open #10065, so they were not duplicated here.file.py:linecitations indev/specs/dev/knowledgedocs; a second optional filter field whose emptiness got conflated with "no filter at all"; a test whose final assertion converges via two different code paths.IS_RELATEDmatch over-resolves a self-referential relationship (dropped from this PR — helper not onstable, see above); a reused component'sinitialize()reset its index but left a sibling cache stale.CHANGELOG.mdfrom this exact mistake); cubic: a new fallback branch in the coalesced recompute resolver only widened one of the two symmetric targets it needed. (the recompute-invariant lesson dropped from this PR — feature not onstable, see above)add_tags()mid-run silently drops an earlier call's tags; the documented fix (indev/knowledge/backend/async-tasks.md) isn't linked from the guide that teaches the unsafe pattern.stable, see above); a component should take a capability-scopedProtocoleven outside a "should I mock?" trigger (overlaps with some updates for dev documentation #10065, not duplicated).Also scanned with no durable lesson: #10051 (single bot thread, rebutted correctly, no fix landed).
Not duplicated: several DI/observer/config-validation findings from #9879 and #10052 (audited in this run's research but not turned into edits here) are already comprehensively covered by the still-open #10065 — landing a competing edit to the same sections would conflict rather than help.
What changed
New rules/knowledge added:
dev/knowledge/backend/testing.md: a benchmark must exercise the exact input shape a conditional perf optimization is gated on.dev/guides/frontend/writing-component-tests.md: reset shared Jotai atoms / clear mocks / reset URL state between tests in the same file.dev/guidelines/backend/python.md:tasks/*.pyimports stay function-local (documented exception to the top-of-file rule); a path-exclusion check must not use a barestartswith.AGENTS.md: verify a specific identifier/metric/config-default claim against the diff before writing it into a changelog fragment, PR description, or ADR..agents/rules/backend-component-design.md: a component'sinitialize()/reset()must clear every derived cache, not just the field it obviously replaces.docs/docs/development/changelog.mdx+.agents/skills/creating-changelog-entries/SKILL.md: changelog fragment names must use the GitHub issue number or+, never an internal tracker ID.dev/guidelines/backend/testing.md: don't add a return value to a mutating method just so a test can assert on it; when a result is reachable via two different code paths, assert an intermediate signal too.dev/guidelines/frontend/typescript.md: aMaplookup seeded from the same array you index it with is still a type lie if asserted with!.dev/guidelines/documentation.md: nofile.py:linecitations in internal docs.Strengthened existing coverage (rule existed but a reviewer still had to raise it):
dev/guides/frontend/writing-unit-tests.md: added the module-level-singleton-needs-a-reset-hook case to the existing "keep tests independent" guidance.dev/guides/backend/creating-async-tasks.md: added a caution + cross-link to the already-documentedadd_tags()pitfall right where the guide teaches the pattern that reproduces it.Pruned (from the skill's new §5 sweep):
dev/guidelines/frontend/page-architecture.md,route-architecture.md,dev/knowledge/frontend/shared-components.md,design-system.md: dropped 17 stalePR #NNNN/Migrated in #NNNNcitations total (12 found viadevelop's copies, 5 more found instable's separately-structureddesign-system.mdtable), kept the underlying prose.dev/knowledge/backend/templates.md: dropped 4 stalefile.py:linecitations and fixed a renamed-method reference (_apply_template()→handle_object_template()) surfaced while verifying them.Skill maintenance:
.agents/skills/harvesting-review/SKILL.md: added §5 "Sweep for rot" — every run now greps the destination layer for stale citations, fixed defect-snapshots, and superseded narrow rules, and fixes them in the same PR (tightened after the first pass only reported findings without acting on them). Added a guardrail against writing defect-snapshot content as permanent docs in the first place.Docs-only — no code, no generated files, no schema.
How to review
None of the edits touch the sections
#10065is already changing. Everything here lands indev/guidelines/,dev/knowledge/,dev/guides/,docs/docs/,.agents/skills/, or a.agents/rules/*addendum to an existing file (no new.agents/rules/*file, so no added per-turn token cost). Given the base isstable, the diff intentionally omits any lesson tied to develop-only code — see the "Why" section for exactly which four were dropped and why.How to test
PATH="$PWD/docs/node_modules/.bin:$PATH" uv run invoke docs.lint0 errors (pre-existing, unrelated markdownlint warnings elsewhere, unchanged by this PR).
Impact & rollout
Checklist
🤖 Generated with Claude Code
https://claude.ai/code/session_014BhxKtqsNFkVTV3BN3Qzpj