The code-knowledge index: reuse evidence before creating more software

prevent duplicate AI code shown as three duplicate components converging on one owned shared asset

Last updated September 18, 2026

4 min read

A fictional frontend team discovers three date-range pickers after an agent opens a fourth pull request. Each component works. Each handles locale, validation, and accessibility differently. The failure began before coding because nobody required evidence that the repository had been searched. This is an explicitly fictional composite, not a customer result.

In this article
  1. Duplication is a discovery and decision failure
  2. A reuse declaration makes search reviewable
  3. Indexes need freshness and ownership
  4. Measure avoided duplication without inventing savings
  5. Frequently Asked Questions
  6. What next?

Duplication is a discovery and decision failure

Agents can generate a plausible local component without knowing a shared one exists in another package. Humans do the same under time pressure. The workflow control is to move repository search into planning and make the result visible before the implementation path feels committed.

PatchTrack, 2026 bounds this claim. Observational disclosed open-source use with unknown model versions.

Evidence pointInterpretation
1Business search: date range
2Symbol search: DateRange
3Behavior search: locale validation
4Decision: extend shared component

Treat the table as a working diagnostic. Replace illustrative labels with repository evidence before making a budget, staffing, or release decision.

A reuse declaration makes search reviewable

Record at least three search forms: business language, technical symbol, and interface or behavior. List candidates with owner, dependency direction, accessibility or security constraints, and extension impact. A rejected candidate needs a reason stronger than easier to write a new one.

1Query the index. Record the artifact, owner, and completion evidence before moving on.
2Open live candidates. Record the artifact, owner, and completion evidence before moving on.
3Compare extension and creation. Record the artifact, owner, and completion evidence before moving on.
4Record the chosen path. Record the artifact, owner, and completion evidence before moving on.

Order matters because later checks inherit the intent and scope established earlier. A skipped step does not remove uncertainty. It hands that uncertainty to a reviewer under time pressure.

Indexes need freshness and ownership

PatchTrack observed developers selectively integrating and refining disclosed ChatGPT contributions for architecture, context, policy, and maintainability. The study does not prove an index prevents duplication. It supports the broader point that integration requires repository judgment beyond generation.

Google DORA 2025 adds a second evidence boundary. Observational associations, not universal causation.

A procedural fix can be inspected, rehearsed, and improved. A warning without an owner or artifact usually disappears during the next busy sprint.

Measure avoided duplication without inventing savings

Track declared reuse, extensions, new components, and duplicates found during review. Over time, inspect whether index freshness and ownership improve discovery. Do not publish a time-saving percentage until your own repository data supports it.

paqad-ai v1.67.0 was the current public release when this article was checked on July 21, 2026. Its repository describes risk routing, specialist roles, structured state, deterministic checks, documentation sync, and local audit records. These are product mechanisms, not independent outcome proof.

Use the AI workflow audit guide to map current practice, compare the bar with production-ready AI code, and use the AI coding consultant guide when the team needs outside ownership.

Three query forms used
Candidate code opened
Owner or module known
Rejection reasons recorded
New asset added to index

Decision rule: Approve new implementation only after live candidates were inspected and the reuse-or-create decision has an owner and reason.

Run the reuse-declaration template in a 45-minute working review with the product owner, module owner, and final reviewer. Do not turn it into a score. Read the decision rule aloud: Approve new implementation only after live candidates were inspected and the reuse-or-create decision has an owner and reason. Record disagreements, missing evidence, and the person responsible for the next action. Repeat the review after one real feature so the team can compare whether the artifact reduced ambiguity or only added paperwork.

Frequently Asked Questions

Does a code index guarantee reuse?

No. It improves discovery when sources are current and queries are good. A human still decides whether extension is safe, whether ownership permits it, and whether a new component is justified.

What if extending the shared component is harder?

Document the trade-off. A new component can be correct when extension would create coupling or break a stable contract. The control asks for evidence, not mandatory reuse.

How often should the index refresh?

Refresh after relevant merges or through a background process, then record the source revision in retrieval results. Stale index entries should degrade to hints and trigger live verification.

What next?

Apply the reuse-declaration template to one current feature. If the repository cannot answer the questions it exposes, install paqad-ai and test a governed workflow with local evidence and explicit human authority.

Install paqad-ai from GitHub

Recognise this in your own team?

See how a change travels from request to live in one enforced process, then tell us about your team.