Repository navigation
fix(doctor): guard service registry resolution and declare port maps for standalone execution - #5867
Closed
vaibhavsrv wants to merge 1 commit into
Closed
vaibhavsrv wants to merge 1 commit into
vaibhavsrv wants to merge 1 commit into
Conversation
…for standalone execution
Collaborator
|
Thanks for this contribution. |
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.
Why this matters
In
ods/scripts/ods-doctor.sh, the script provides a fallback environment loaderload_env_safe()explicitly designated for "a tree without lib/". However, immediately followingload_env_safe, line 98 calledsr_resolve_portsunconditionally without checkingdeclare -F sr_resolve_ports. In environments lackinglib/service-registry.sh(such as minimal runtime containers or standalone diagnostic runs), this caused an immediate fatal errorsr_resolve_ports: command not found. Additionally, associative arraySERVICE_PORTSwas accessed without priordeclare -Ainitialization, causing associative lookups under strict mode to treat service keys as undeclared integer variable names.This patch declares
SERVICE_PORTSandSERVICE_HEALTHas associative arrays and guardssr_resolve_portsbehinddeclare -F sr_resolve_ports, ensuring standalone executions cleanly fall back to default ports (3001for dashboard,3000for WebUI).Validation
lib/service-registry.sh; confirmed execution failed withsr_resolve_ports: command not found.test_doctor_standalone_registry.pypasses with exit code 0; doctor initializes default ports without errors whenservice-registry.shis absent.Overlap check
ods/installers/macos/with zero overlap in doctor diagnostics.ods/scripts/llm-cold-storage.sh.Risk / AI disclosure
AI-assisted investigation, implementation and CLI regressions. This strengthens function existence checks and associative array declarations during diagnostic initialization, not runtime service routing. Independent human review and platform/runtime qualification remain gates. No running configuration, deployment or upstream merge changed.
Follow-up integration evidence
Composed with #5861 at 2a24f49 without conflicts. Production and test diffs passed together; doctor and compose failure reporting suites remain intact.
Backlog composition was local-only (production/test diffs, excluding workflow/Makefile wiring); it is not an upstream merge or independent human approval. Declared live-review gates remain open.