Architecture — Remove backfillLegacyAgentExecutionClassifiers and fix its failing test
Source of truth for this change set.
backfill-method-removal-plan.mdandbackfill-method-removal-testing.mdreuse the names, file paths, and identifiers defined here verbatim.Note: this repo already contains unrelated design docs named
architecture.mdandtesting.md(Agent Worker). This change set uses thebackfill-method-removal-*prefix to avoid clobbering them.
1. Overview
This is a removal / cleanup change, not a feature. It reverses a prior
commit (code_subtask add-backfill-method) that reintroduced a private
maintenance method purely to satisfy a reflection-based end-to-end test.
The reviewer's decision is explicit and takes precedence over the test:
- @v1r3n: "do not add back
backfillLegacyAgentExecutionClassifiersmethod. This method should not be added back."
The originally reported failure —
AgentSpanDeploymentContractEndToEndTest > legacyAgentClassifierBackfillUsesConcreteExecutionTimeBounds() FAILED
java.lang.NoSuchMethodException: org.conductoross.conductor.ai.agentspan.runtime.service.AgentService.backfillLegacyAgentExecutionClassifiers()
— must therefore be resolved by removing the test's dependency on the method, not by keeping the method alive. When both changes land together the suite is green and the method stays gone.
Guiding principle
The method is dead production code: it is private, is not called from any
production path (no @PostConstruct, no scheduler, no controller, no other
service), and its only caller is the test invoking it reflectively. Removing the
dead code plus the single test that pins it in place is the minimal, correct
resolution. No new behavior is introduced.
Tech stack (unchanged)
- Java 21, Gradle multi-module build.
- Modules touched:
agentspan(production) andtest-harness(integration test). - Spring Boot component model;
AgentServiceis a@Componentgated by@ConditionalOnProperty(name = "agentspan.embedded", havingValue = "true")and uses Lombok@RequiredArgsConstructor. - JUnit 5 (
org.junit.jupiter) for the affected test.
2. Scope — exact files to change
Only two files are edited. No source files are created. No new interfaces or types.
| File | Module | Action |
|---|---|---|
agentspan/src/main/java/org/conductoross/conductor/ai/agentspan/runtime/service/AgentService.java |
agentspan |
Delete the backfill method and everything used only by it (see §3). |
test-harness/src/test/java/com/netflix/conductor/test/integration/agent/AgentSpanDeploymentContractEndToEndTest.java |
test-harness |
Delete the legacyAgentClassifierBackfillUsesConcreteExecutionTimeBounds() test and its now-unused import (see §4). |
Nothing else in the repository references the removed symbols, so no other file needs to change.
3. AgentService.java — members to remove
All of the following are removed. Each is verified (see the plan doc) to have no remaining reference once the backfill method and the test are gone.
3.1 Methods
private void backfillLegacyAgentExecutionClassifiers()— currently atAgentService.java:420. The Javadoc block immediately above it (starting/** Backfill the agent execution classifier index ..., currentlyAgentService.java:407) is removed with it.private static int backfillVersionOf(Map<String, Object> metadata)— currently atAgentService.java:463, plus its/** Read the stored backfill version ... */Javadoc. Only caller is the backfill method.private void reindexAgentExecutions(String agentName)— currently atAgentService.java:476, plus its Javadoc. Only caller is the backfill method.
3.2 Constants
private static final String AGENT_CLASSIFIER_BACKFILL_VERSION = "agent_classifier_backfill_version";— currently atAgentService.java:64.private static final int AGENT_CLASSIFIER_BACKFILL_VERSION_VALUE = 2;— currently atAgentService.java:68, plus its explanatory comment.
Both constants are referenced only from the three methods above.
3.3 Field and import that become unused
Removing reindexAgentExecutions drops the sole use of the IndexDAO
dependency, so both of these are removed as well:
- Field
private final IndexDAO indexDAO;— currently atAgentService.java:75. - Import
import com.netflix.conductor.dao.IndexDAO;— currently atAgentService.java:46.
AgentServiceuses@RequiredArgsConstructor(Lombok). Removing thefinalfield also removes it from the generated constructor. This is safe becauseindexDAOis Spring-injected and no test or production code depends on it being a constructor parameter ofAgentService.
3.4 Members that MUST be kept
These are referenced elsewhere in AgentService and are not removed:
- Imports
SearchResult,WorkflowSummary,WorkflowModel— still used bysearchExecutionsRaw,searchAgentExecutions, and other methods (references atAgentService.java:600, 728, 765, 780, 973, 1548, 1553). - Fields
executionDAO,metadataDAO,workflowService,taskService,workflowExecutor, and all remaining collaborators.
4. AgentSpanDeploymentContractEndToEndTest.java — test to remove
- Delete the entire test method
void legacyAgentClassifierBackfillUsesConcreteExecutionTimeBounds() throws Exception— currently atAgentSpanDeploymentContractEndToEndTest.java:295–338, including its@Testannotation. - Remove the import
import java.lang.reflect.Method;(AgentSpanDeploymentContractEndToEndTest.java:18) only if no other test method in the file usesjava.lang.reflect.Method. It is verified unused elsewhere in the file; keep theAgentServiceimport, which the class still autowires and uses.
No replacement test is added: the behavior it exercised (a private, production-unreachable maintenance routine) no longer exists, so there is no public contract left to assert.
5. Shared identifiers (use verbatim)
Every document in this set and every edit refers to these exact names:
| Concept | Exact identifier |
|---|---|
| Removed production method | backfillLegacyAgentExecutionClassifiers |
| Removed helper (version read) | backfillVersionOf |
| Removed helper (reindex) | reindexAgentExecutions |
| Removed constant (metadata key) | AGENT_CLASSIFIER_BACKFILL_VERSION |
| Removed constant (version value) | AGENT_CLASSIFIER_BACKFILL_VERSION_VALUE |
| Removed field | indexDAO (type com.netflix.conductor.dao.IndexDAO) |
| Removed test method | legacyAgentClassifierBackfillUsesConcreteExecutionTimeBounds |
| Production class | org.conductoross.conductor.ai.agentspan.runtime.service.AgentService |
| Test class | com.netflix.conductor.test.integration.agent.AgentSpanDeploymentContractEndToEndTest |
| Metadata string literal (workflow def) | "agent_classifier_backfill_version" |
6. Non-goals
- Do not re-add the backfill method under any name or visibility.
- Do not introduce a public API, endpoint, or CLI command to replace it.
- Do not touch other tests in
AgentSpanDeploymentContractEndToEndTest. - Do not migrate or rewrite existing
"agent_classifier_backfill_version"metadata already stamped on deployed definitions; leaving stale metadata is harmless (nothing reads it after this change).
7. Convergence checklist
The change is complete when all of the following hold:
AgentService.javacontains zero occurrences ofbackfill(method, helpers, constants) and of theindexDAOfield /IndexDAOimport.AgentSpanDeploymentContractEndToEndTest.javacontains zero occurrences ofbackfilland nogetDeclaredMethod(...)referencing the removed method.- Both modules compile;
./gradlew spotlessApplyleaves no diff. AgentSpanDeploymentContractEndToEndTestruns with the removed test absent and every remaining test passing.