refactor: unify Braid around one ProgramGraph with CFG/DAG projections - #98
Merged
Merged
Conversation
TypeTag now derives Ord so GraphEdge::Data (which contains TypeTag) can derive Ord for deterministic sorting. Fixes build on 1.98.0 across all CI jobs (Build, lgwks-std stable, contract probe). Also applies rustfmt normalization to graph.rs tests to satisfy cargo fmt --check.
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.
Summary
This PR begins a major architectural reset for Braid around one semantic graph kernel instead of maintaining separate intra-capsule and inter-capsule graph authorities.
Today Braid has:
braid-ir::Braid/Strandfor intra-capsule DAGs;braid-flow-ir::FlowSpec/FlowNode/FlowEdgefor orchestration;That duplication is the core source of architectural drift.
Candidate architecture
This PR introduces
braid-ir::ProgramGraphas the migration kernel:NodeIdidentity;GraphNode/GraphNodeKind;GraphEdge::{Data, Control};cfg()projection;dag()projection;CFG answers where control may flow.
DAG answers which data dependencies constrain execution.
Resource/effect conflict edges are deliberately deferred until the shared access vocabulary is ratified; this PR does not pretend parallel execution is safe yet.
Documents added
spec/braid/CANDIDATE-ARCHITECTURE.mdspec/braid/PRD-UNIFIED-GRAPH.mdspec/braid/PLAN-UNIFIED-GRAPH.mdThese are one architecture, one PRD, and one migration plan—not parallel proposals.
Code added
crates/braid-ir/src/graph.rsbraid-ir/src/lib.rsThe graph kernel is intentionally in
braid-irso planners, verifiers, runtimes, renderers, and adapters converge toward one semantic owner.Explicitly not done in this PR
This is M0+M1 only.
Not claimed:
BraidorFlowSpecyet;Next migration order
Evidence state
PLAN-UNIFIED-GRAPH.md.Scope budget
This PR intentionally avoids vocabulary changes, serializer changes, new dependencies, database work, ECS runtimes, and unrelated
lgwks_std/bot work.