Skip to content

Comments

[ve] Déjà Code rules, utility extractions & test coverage#7974

Merged
paullewis merged 1 commit intobreadboard-ai:mainfrom
paullewis:deja-code
Feb 23, 2026
Merged

[ve] Déjà Code rules, utility extractions & test coverage#7974
paullewis merged 1 commit intobreadboard-ai:mainfrom
paullewis:deja-code

Conversation

@paullewis
Copy link
Contributor

What

Introduces the Déjà Code pattern — detecting repeated multi-statement code and
paving it with shared utilities + ESLint rules. Also adds unit tests for the
previously untested app-screen.ts progress engine and fixes two typos.

Why

Two independent 20-line blocks in create-chiclets.ts and
create-truncated-value.ts implemented identical LLM content summarization
logic, and layout-graph.ts had an inline groupBy that duplicated a common
pattern. Extracting these into shared utilities with enforcing ESLint rules
prevents the patterns from drifting back. The app-screen.ts module powers all
progress bars but had zero direct unit tests.

Changes

Déjà Code infrastructure

  • .agent/README.md — new agent practices index
  • .agent/deja-code.md — Déjà Code concept docs
  • .agent/workflows/deja-code.md — slash-command workflow
  • .agent/rules/breadboard.md — updated memory rules
  • eslint.config.js — register two new deja-code-* rules

Utility extractions + ESLint rules

  • src/utils/summarize-llm-content.ts [NEW] — extracted LLM content
    summarization
  • eslint-rules/deja-code-prefer-summarize-llm-content.js [NEW] — enforces
    usage
  • src/utils/group-by.ts [NEW] — extracted generic groupBy
  • eslint-rules/deja-code-prefer-group-by.js [NEW] — enforces usage
  • create-chiclets.ts, create-truncated-value.ts — refactored to use
    summarizeLLMContentValue
  • layout-graph.ts — refactored to use groupBy

Tests

  • tests/utils/summarize-llm-content.test.ts [NEW] — tests for the
    extraction
  • tests/utils/group-by.test.ts [NEW] — tests for groupBy
  • tests/sca/utils/app-screen.test.ts [NEW] — 20 tests for
    createAppScreen, setScreenDuration, tickScreenProgress

Bug fixes

  • decode-error.ts — "volate" → "violate" (user-facing error copy)
  • serialization.ts — "Serilialized" → "Serialized" (internal types)

Testing

  • node --test dist/tsc/tests/sca/utils/app-screen.test.js — 20/20 pass
  • node --test dist/tsc/tests/utils/group-by.test.js — verify groupBy tests
    pass
  • node --test dist/tsc/tests/utils/summarize-llm-content.test.js — verify
    summarize tests pass
  • ESLint: run npx eslint to verify new rules flag inline patterns

@paullewis paullewis enabled auto-merge (squash) February 23, 2026 10:39
@paullewis paullewis merged commit 150597b into breadboard-ai:main Feb 23, 2026
3 checks passed
@paullewis paullewis deleted the deja-code branch February 23, 2026 10:44
@github-actions
Copy link

📊 Coverage Report

Metric PR Main Delta
Lines 98.23% 98.15% 🟢 +0.08%
Functions 98.17% 98.10% 🟢 +0.07%
Branches 94.32% 94.29% 🟢 +0.03%

🌟 More lines covered than before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant