Skip to content

docs: harvest review lessons from PRs merged 2026-07-24 to 2026-07-31 - #10098

Draft
saltas888 wants to merge 3 commits into
stablefrom
claude/zen-albattani-7aj2t3
Draft

docs: harvest review lessons from PRs merged 2026-07-24 to 2026-07-31#10098
saltas888 wants to merge 3 commits into
stablefrom
claude/zen-albattani-7aj2t3

Conversation

@saltas888

@saltas888 saltas888 commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

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-review run 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, not develop. Retargeted on request. Since stable is behind develop by a large margin, several lessons from this run document features that don't exist on stable at all and were dropped from this PR rather than carried over describing nonexistent code:

One example (StaleEntryCleaner/clear_expired) in dev/guidelines/backend/testing.md was genericized from its original StaleLockCleaner naming for the same reason — the rule is real and durable, but the specific class it illustrated (from #10031) isn't on stable. The pruning fixes (see below) also picked up stable's own, slightly different copy of design-system.md (an older table layout with its own separate set of stale Migrated in #NNNN citations) and cleaned that up in place rather than trying to overwrite it with develop's newer table structure.

Three rounds of follow-up after the initial push, all from user review:

  1. The "no file.py:line citations" 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 its paths frontmatter to also cover markdown docs. Re-homed to dev/guidelines/documentation.md instead, 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.
  2. Added a "sweep for rot" step to the skill and reported 19 pre-existing citation-rot hits elsewhere in the docs — but didn't fix any of them. Called out for describing debt instead of removing it. Went back and fixed all 19 (dropped stale PR #NNNN / Migrated in #NNNN citations 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.md cited a method, Node._apply_template(), that no longer exists (renamed to handle_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.
  3. Retargeted to 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:

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/*.py imports stay function-local (documented exception to the top-of-file rule); a path-exclusion check must not use a bare startswith.
  • 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's initialize()/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: a Map lookup seeded from the same array you index it with is still a type lie if asserted with !.
  • dev/guidelines/documentation.md: no file.py:line citations 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-documented add_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 stale PR #NNNN/Migrated in #NNNN citations total (12 found via develop's copies, 5 more found in stable's separately-structured design-system.md table), kept the underlying prose.
  • dev/knowledge/backend/templates.md: dropped 4 stale file.py:line citations 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 #10065 is already changing. Everything here lands in dev/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 is stable, 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.lint

0 errors (pre-existing, unrelated markdownlint warnings elsewhere, unchanged by this PR).

Impact & rollout

  • Backward compatibility: docs-only, no runtime impact
  • Deployment notes: safe to merge

Checklist

  • Tests added/updated (n/a — docs-only)
  • Changelog entry added (n/a — internal docs)
  • External docs updated (n/a)
  • Internal .md docs updated (internal knowledge and AI code tools knowledge)
  • I have reviewed AI generated content

🤖 Generated with Claude Code

https://claude.ai/code/session_014BhxKtqsNFkVTV3BN3Qzpj

@github-actions github-actions Bot added the type/documentation Improvements or additions to documentation label Jul 31, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 17 files

Confidence score: 5/5

  • In dev/knowledge/backend/merge-recompute.md, referencing a non-existent _derive_family_targets method 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_targets family-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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Suggested change
`CoalescedRecomputeBuilder`'s target resolution (`_resolve_targets` / `_derive_family_targets` in
`CoalescedRecomputeBuilder`'s target resolution (`_resolve_targets` and its family-specific derive calls in

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

claude added 3 commits July 31, 2026 14:20
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
@saltas888
saltas888 force-pushed the claude/zen-albattani-7aj2t3 branch from 6ba7772 to 5b190af Compare July 31, 2026 14:24
@saltas888
saltas888 changed the base branch from develop to stable July 31, 2026 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants