ADRs + agent-rules sync - #68
Merged
Merged
Conversation
Four decisions that look wrong without context were only explained in comments next to the code that implements them. Promote each into a numbered ADR and cite it from the implementing docstring, per .claude/rules/conventions.md. - 0001 HNSW over IVFFlat for the track-embedding index - 0002 iTunes Search previews instead of Spotify preview_url - 0003 Two-layer error handling for agent tools - 0004 Binarize DEAP labels at each subject's own median The pgvector migration is touched in comments only; no migration code changes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The rules described the codebase as it was before the ADR directory and the frontend feature-slice registry landed, so they pointed agents at patterns that no longer exist. - conventions.md: docs/adr/ exists now; drop the "doesn't exist yet" note - vercel-ai-sdk.md: tool panels come from the registry, not a branch in the message renderer - frontend/code-conventions.md: document the feature-slice boundaries - AGENTS.md: point moved components at features/, note the registry in the data flow, and add pointers to docs/adr/ and the test tiers Both frontend rules files now match against frontend/features/**. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stage 3 of 3 in the refactor series (follows #66 and #67). Docs and agent-rules only — no app code changes.
Part A —
docs/adr/Four rationales that already lived in code comments are now numbered records, and each source cites its ADR back (per
.claude/rules/conventions.md: "the docstring that implements it cites the ADR").0001-hnsw-over-ivfflat0002-itunes-previews-over-spotify-preview-urlpreview_urlfor standard-mode apps (0/10 hits here), so iTunes Search supplies audio bytes while Spotify stays the identity source; Spotify'sduration_msanchors the match.0003-two-layer-tool-error-conventionhooks.pyfor a structured recovery payload rather than each wrapping try/except;retrieve_tracks_from_brain_state's inlineDeapFileMissingErrorcatch is the one sanctioned exception, because the hook payload drops the actionable message.0004-subject-median-label-binarization>= 5, which skews ~25/75 and bakes rater bias into LOSO folds;--label-split fixed_5reproduces the paper setting.Citations added to: the pgvector migration,
models/track_audio_embedding.py,services/audio_catalog.py,agents/hooks.py,agents/tools/retrieval_tools.py,ml/dataset.py.Migrations were touched in comments only — no migration code changed.
Part B — rules +
AGENTS.mdsync.claude/rules/conventions.md—docs/adr/exists now; the "doesn't exist yet / until then" paragraph is replaced with the four records and how to add the next one..claude/rules/frontend/vercel-ai-sdk.md— replaces the stale "panels switch onpart.type, add a branch" bullet with the registry reality from Frontend tool-panel registry + feature slices #67 (slice map + one entry,hideRawOutputwhen the panel replaces raw JSON)..claude/rules/frontend/code-conventions.md— new "Feature slices" section: slice boundaries, no slice-to-slice imports, registry as the only aggregator, relative intra-slice vs@/cross-directory.AGENTS.md— moved components now point atfeatures/{sessions,retrieval}/, plus lines for the registry, the three-tier test layout, anddocs/adr/. 116 lines, under the ~200 ceiling.frontend/features/**, which theirpaths:frontmatter predated.code-conventions.mdtesting section was already rewritten in Adopt three-tier test layout with real-Postgres integration tier #66 — verified against the tree, unchanged.Verification
pre-commit run --all-files— passed (ruff, ruff-format, mypy)pytest(unit tier) — 175 passed🤖 Generated with Claude Code