Fix critical architecture review issues

Critical fixes:
- Rename qualityDegradation → qualityRetention across all docs
  (semantically inverted: 0.9 meant 90% quality RETAINED, not 90%
  degradation). Updated schemas, graph-model, cost-benefit, ADRs.
- Add TaskInput → TaskGraphNodeAttributes transformation section
  to graph-model.md, documenting how Nullable(Optional) input fields
  map to Optional graph attributes
- Fix DuplicateEdgeError fields: source/target → prerequisite/dependent
  to match the established edge direction convention
- Fix resolveDefaults signature: Partial<TaskGraphNodeAttributes>
  → Partial<...> & Pick<TaskGraphNodeAttributes, 'name'> to
  require the name field
- Move Nullable helper definition before its first use in schemas.md
- Fix 'construction never throws' contradiction: rephrase to
  'construction enforces uniqueness, not data quality'
- Define all 6 enum value sets in schemas.md (previously only
  TaskScope and TaskRisk were explicit)
- Add EvConfig parameter table with defaults and semantics
- Document WorkflowCostOptions.limit parameter
- Add construction error handling table to graph-model.md
- Add graph.raw mutation safety warning to api-surface.md
- Update build-distribution.md error class list to include
  DuplicateNodeError and DuplicateEdgeError
This commit is contained in:
2026-04-26 09:13:14 +00:00
parent 13d55b981e
commit 4244c054b7
11 changed files with 113 additions and 45 deletions

View File

@@ -751,7 +751,7 @@ const TaskGraphNodeAttributesUpdate = Type.Partial(TaskGraphNodeAttributes);
type TaskGraphNodeAttributesUpdate = Static<typeof TaskGraphNodeAttributesUpdate>;
const TaskGraphEdgeAttributes = Type.Object({
qualityDegradation: Type.Optional(Type.Number()),
qualityRetention: Type.Optional(Type.Number()),
});
type TaskGraphEdgeAttributes = Static<typeof TaskGraphEdgeAttributes>;
```
@@ -838,7 +838,7 @@ const WorkflowCostOptions = Type.Object({
propagationMode: Type.Optional(
Type.Union([Type.Literal("independent"), Type.Literal("dag-propagate")])
),
defaultQualityDegradation: Type.Optional(Type.Number({ default: 0.9 })),
defaultQualityRetention: Type.Optional(Type.Number({ default: 0.9 })),
});
type WorkflowCostOptions = Static<typeof WorkflowCostOptions>;
@@ -892,7 +892,7 @@ type RiskDistributionResult = Static<typeof RiskDistributionResult>;
const DependencyEdge = Type.Object({
from: Type.String(),
to: Type.String(),
qualityDegradation: Type.Optional(Type.Number({ default: 0.9 })),
qualityRetention: Type.Optional(Type.Number({ default: 0.9 })),
});
type DependencyEdge = Static<typeof DependencyEdge>;
```