1.5 KiB
1.5 KiB
id, name, status, depends_on, scope, risk, impact, level
| id | name | status | depends_on | scope | risk | impact | level | |
|---|---|---|---|---|---|---|---|---|
| graph/export | Implement TaskGraph export methods (export, toJSON) | completed |
|
single | trivial | component | implementation |
Description
Implement the export() and toJSON() methods on TaskGraph. These wrap graphology's export() to produce TaskGraphSerialized output.
Acceptance Criteria
export(): TaskGraphSerialized— wrapsgraph.export()and validates the output conforms to theTaskGraphSerializedschematoJSON(): TaskGraphSerialized— alias forexport()(enablesJSON.stringify(graph)to work)- Exported data includes all node attributes and edge attributes (including
qualityRetention) - Round-trip:
TaskGraph.fromJSON(graph.export())produces an equivalent graph - Unit test: create graph, add tasks/edges, export, round-trip through fromJSON, verify equivalence
References
- docs/architecture/api-surface.md — export/toJSON methods
- docs/architecture/schemas.md — TaskGraphSerialized schema
Notes
Straightforward implementation. export() delegates to this._graph.export() and casts to TaskGraphSerialized. toJSON() is a simple alias so JSON.stringify(graph) works automatically.
Summary
Implemented export() and toJSON() methods on TaskGraph class.
- Modified:
src/graph/construction.ts— added export() and toJSON() methods - Modified:
test/graph.test.ts— added 10 tests covering export, toJSON, round-trip, JSON.stringify integration - Tests: 266, all passing (lint clean)