fix validation responsibility boundaries - #1996
arnabnandy7 wants to merge 4 commits into
Conversation
Signed-off-by: Arnab Nandy <arnab_nandy7@yahoo.com>
Signed-off-by: Arnab Nandy <arnab_nandy7@yahoo.com>
igordayen
left a comment
There was a problem hiding this comment.
@arnabnandy7 - few comments to consider, thank you
135b60e to
6b2a8bb
Compare
|
@arnabnandy7 - please also cross-check for double-logging |
@igordayen I cross-checked the validation paths and found one additional validator-owned logging path in I’ve removed that lifecycle logging and its now-unused application-context dependency. Structural validators now return errors through |
6b2a8bb to
9fedd1d
Compare
igordayen
left a comment
There was a problem hiding this comment.
@arnabnandy7 - looks good. few inquiries:
- removal of lifecycle
afterProperties, required testing well beypond unit tests on real agents. Understood , intent to eliminate double logging, but would not seggregation by log levels mitigate the same? - document in PR invocation flow: chain of collection errors components, with final component as reporter
- new error code requires simulation of behavior on real agents.
Thank you
deleSerna
left a comment
There was a problem hiding this comment.
AS @igordayen mentioned please test with a sample agent application all the scenarios to make sure it is working as expected.
Without proof that every deployment goes through This preserves the existing lifecycle coverage while ensuring validation errors are reported at
Added invocation flow for clarity:
The focused tests cover the validator and deployment-policy paths, but the real sample-agent scenarios should also be exercised before merge. I’ve included the relevant verification command and will report the results separately rather than claiming coverage from unit tests alone. |
@deleSerna the scenarios to verify are permissive deployment, strict rejection, a valid goal/action pair, and a goal without a corresponding action. I haven’t run the sample-application verification yet. I’ll share the exact results once it has been executed. |
Signed-off-by: Arnab Nandy <arnab_nandy7@yahoo.com>
9fedd1d to
2a0d44d
Compare
|
As requested, I tested the validation scenarios using real annotated agent instances and the repository’s in-memory Verified:
Result: 11 tests run, 0 failures, 0 errors, 0 skipped. Build completed successfully. |
@arnabnandy7 - excellent! |
|
@arnabnandy7 - citing from Discord, from @tuannx " It currently assumes every goal must match an action name 1:1. That breaks condition/output-based goals like in our DSL (splitGarden, evenMoreEvilWizard) and goal getters. For instance, splitGarden executes successfully to completion at runtime, but the validator rejects it with GOAL_ACTION_NOT_FOUND. evenMoreEvilWizard in DefaultAgentValidationManagerTest was also flipped to assertFalse to match this. Could we hold off merging for a bit to fix or let me know if you need any repro details from my side. " Please provide details on reproducing this. thanks. looping @deleSerna |
Signed-off-by: Arnab Nandy <arnab_nandy7@yahoo.com>
f74a164 to
3962ecf
Compare
|
@igordayen @tuannx fix applied, you may validate on latest changes. |
Thanks @arnabnandy7 for the quick and clean fix! Validated locally against both DSL agents (splitGarden, evenMoreEvilWizard) and the unmapped goal scenario — all test cases pass and the validation boundaries align nicely. LGTM from my side! |
@tuannx thanks for validating the change. |
Summary
Fixes #1991 by separating validation, logging, and deployment-policy responsibilities.
GOAL_ACTION_NOT_FOUNDwhen a goal has no matching action.DefaultAgentValidationManager.AgentMetadataReader.skip-agent-deployment-on-error=truerejects agents with missing goal actions.Testing
./mvnw -pl embabel-agent-api -Dtest=AchievableGoalValidatorTest testValidation flow
AgentMetadataReadercreates theAgentScope.DefaultAgentValidationManageraggregates and logs the errors.AgentMetadataReaderappliesskip-agent-deployment-on-error.DefaultAgentStructureValidatorretains its lifecycle check atDEBUGlevel, whileDefaultAgentValidationManageris the final validation-error reporter.Scenario verification
The validation flow was exercised using real annotated agent instances and the in-memory
AgentPlatform.skip-agent-deployment-on-error=true.MISSING_ACTION_ANNOTATIONis logged exactly once.GOAL_ACTION_NOT_FOUNDexactly once.DefaultAgentStructureValidatorlifecycle check remains operational.Command: