Deepen AllocationStateEngine — Extract 4 Pure Functions#54
Merged
MohnDoe merged 8 commits intoMay 30, 2026
Merged
Conversation
Add six query methods directly on PassiveGraph instead of separate query modules: getBuildRootNodeIds, getBuildStartNodeIds, getClassStartNodeIds, getAscendancyStartNodeIds, isValidAscendancyForClass, computeEdgeKeysFromNodeIds. Callers now use a single seam (graph.someMethod()) instead of importing multiple query functions. The old query modules (getActiveRootNodeIds, getClassStartNodeIds) are deleted. Rename algorithm parameter rootNodeIds → startNodeIds throughout dependencies.ts, pathfinding.ts, and all tests to fix the code-domain naming mismatch. Update callers (Build, AllocationState) to use the new graph methods. Correct getBuildRootNodeIds to return allocatable nodes connected to start nodes (not the start nodes themselves). Add ADR 0002 documenting the decision to keep query methods on the graph object rather than in separate modules.
- Rename rootA → startA and "root-a" → "start-a" for classStart nodes to match the naming convention used elsewhere in the codebase. - Restore cheapest path comments to include "start →" prefix since paths still originate from start nodes even though start nodes are not included in the path array.
Align with ADR #2 which renamed 'root' → 'start' throughout the algorithm layer. The property held allocatable neighbor nodes (not actual root nodes), making 'root' a domain naming mismatch.
Start nodes are explicitly excluded from reachability in the allocation algorithm (they are traversal origins, not destinations). Document this decision so downstream consumers don't assume start nodes are reachable.
getBuildRootNodeIds and getClassStartNodeIds are already tested. Only getAscendancyStartNodeIds remains untested (no fixture supports it).
…methods-and-tests feat(graph): consolidate query methods on PassiveGraph interface
- Build.ts: use graph.isValidAscendancyForClass() instead of imported query - AllocationState.ts: use graph.computeEdgeKeysFromNodeIds() instead of imported query - Delete src/domain/graph/queries/ directory (logic consolidated on PassiveGraph)
…h-methods Migrate callers to PassiveGraph methods
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
No description provided.