Skip to content

Commit 5739061

Browse files
authored
Merge pull request #14 from AGIBuild/cursor/fix-dependency-graph-scattering-gpt-5.1-codex-max-xhigh-fda6
Fix dependency graph scattering
2 parents bc979b1 + 5b37536 commit 5739061

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Change: Use DependsOn as the sole dependency source
2+
3+
## Why
4+
- Manifest and runtime currently mix manifest-declared dependencies with `[DependsOn]` attributes, producing divergent graphs, inconsistent load order, and scattered diagnostics.
5+
- A single dependency source simplifies validation, improves determinism, and avoids conflicting declarations.
6+
7+
## What Changes
8+
- Build module dependency graphs exclusively from `[DependsOn]` attributes on module assemblies; ignore manifest dependency entries.
9+
- Introduce a unified dependency graph builder used by install, enable, and load flows, with shared detection for missing dependencies, cycles, and version/range mismatches.
10+
- Perform install-time validation by reading `[DependsOn]` metadata from module assemblies inside the package (without loading into the default ALC) and reject invalid modules.
11+
- Standardize dependency diagnostics (missing, cycle, version) and persist them in module state/logs; block enabling/loading when the graph is invalid.
12+
13+
## Impact
14+
- Affected specs: `runtime`
15+
- Affected code: module installer/loader pipeline, dependency graph builder, manifest processing (dependency fields ignored)
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
## ADDED Requirements
2+
### Requirement: Dependency graph from DependsOn attributes
3+
The runtime MUST build and validate module dependency graphs solely from `[DependsOn]` attributes declared on module assemblies; manifest-declared dependency entries MUST be ignored for ordering and validation.
4+
5+
#### Scenario: Install rejects missing dependency
6+
- **WHEN** the installer processes a module whose `[DependsOn]` references a module id not present in the install set or already available modules
7+
- **THEN** installation fails with a missing-dependency diagnostic naming the missing module id
8+
9+
#### Scenario: Install rejects dependency cycles
10+
- **WHEN** `[DependsOn]` declarations form a cycle
11+
- **THEN** installation rejects the module set and emits a cycle diagnostic listing the participating modules
12+
13+
#### Scenario: Install rejects unmet version or range
14+
- **WHEN** a `[DependsOn]` declaration includes a version or range that is not satisfied by the available module version
15+
- **THEN** installation fails with a version-mismatch diagnostic identifying the expected range and the available version
16+
17+
#### Scenario: Runtime load order uses attribute graph
18+
- **WHEN** the runtime computes module load or enable order
19+
- **THEN** it uses a topological order derived from `[DependsOn]` only and fails fast with diagnostics if the graph is invalid
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
## 1. Implementation
2+
- [ ] 1.1 Add `[DependsOn]` metadata reader that extracts module ids and optional versions/ranges without loading assemblies into the default ALC.
3+
- [ ] 1.2 Build a unified dependency graph builder/service consumed by install, enable, and load flows.
4+
- [ ] 1.3 Enforce install-time validation using the `[DependsOn]` graph (missing dependency, cycle, unsatisfied version/range).
5+
- [ ] 1.4 Remove manifest dependency usage from runtime paths; emit warnings if present.
6+
- [ ] 1.5 Persist standardized dependency diagnostics to module state and logs; block enable/load on invalid graphs.
7+
- [ ] 1.6 Add tests covering no-deps, missing-deps, cycles, version/range mismatch, and manifest-dependency-ignored cases.

0 commit comments

Comments
 (0)