Skip to content

Deepen AllocationStateEngine — Extract 4 Pure Functions#54

Merged
MohnDoe merged 8 commits into
mainfrom
48-deepen-allocationstateengine-extract-4-pure-functions
May 30, 2026
Merged

Deepen AllocationStateEngine — Extract 4 Pure Functions#54
MohnDoe merged 8 commits into
mainfrom
48-deepen-allocationstateengine-extract-4-pure-functions

Conversation

@MohnDoe
Copy link
Copy Markdown
Owner

@MohnDoe MohnDoe commented May 30, 2026

No description provided.

MohnDoe and others added 8 commits May 30, 2026 13:00
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
@MohnDoe MohnDoe linked an issue May 30, 2026 that may be closed by this pull request
@vercel
Copy link
Copy Markdown

vercel Bot commented May 30, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
poe-passive-tree Ready Ready Preview, Comment May 30, 2026 1:26pm

@MohnDoe MohnDoe merged commit 42ac77e into main May 30, 2026
4 checks passed
@MohnDoe MohnDoe deleted the 48-deepen-allocationstateengine-extract-4-pure-functions branch June 1, 2026 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deepen AllocationStateEngine — Extract 4 Pure Functions

1 participant