Break the @alkdev/taskgraph architecture specs into dependency-ordered implementation tasks across 8 component directories: setup, schema, error, graph, analysis, cost-benefit, frontmatter, api, and review. Each task has clear acceptance criteria referencing specific architecture docs. Three review tasks serve as quality gates at critical junction points (schemas-and-errors, graph-complete, complete-library). The dependency graph is validated acyclic with 9 topological levels enabling significant parallelism across independent work streams.
2.3 KiB
2.3 KiB
id, name, status, depends_on, scope, risk, impact, level
| id | name | status | depends_on | scope | risk | impact | level | ||
|---|---|---|---|---|---|---|---|---|---|
| schema/numeric-methods-and-defaults | Implement categorical numeric functions and resolveDefaults | pending |
|
narrow | low | component | implementation |
Description
Implement the standalone numeric functions that map categorical enum values to their numeric equivalents, plus resolveDefaults which fills in defaults for unassessed fields and computes derived numeric values. These live in src/analysis/defaults.ts per the project structure.
Acceptance Criteria
src/analysis/defaults.tsexports:scopeCostEstimate(scope: TaskScope): number— maps to 1.0–5.0 per tablescopeTokenEstimate(scope: TaskScope): number— maps to 500–10000 per tableriskSuccessProbability(risk: TaskRisk): number— maps to 0.50–0.98 per tableriskWeight(risk: TaskRisk): number— maps to 0.02–0.50 (equals 1 - successProbability)impactWeight(impact: TaskImpact): number— maps to 1.0–3.0 per tableresolveDefaults(attrs: Partial<TaskGraphNodeAttributes> & Pick<TaskGraphNodeAttributes, 'name'>): ResolvedTaskAttributes
- All numeric mapping tables match schemas.md exactly:
- Scope: single=1.0/500, narrow=2.0/1500, moderate=3.0/3000, broad=4.0/6000, system=5.0/10000
- Risk: trivial=0.98/0.02, low=0.90/0.10, medium=0.80/0.20, high=0.65/0.35, critical=0.50/0.50
- Impact: isolated=1.0, component=1.5, phase=2.0, project=3.0
resolveDefaultshandles null/undefined categorical fields by falling back to: risk→medium, scope→narrow, impact→isolatedresolveDefaultspopulates derived fields: costEstimate, tokenEstimate, successProbability, riskWeight, impactWeight- Label-only fields (level, priority, status) remain nullable after resolution — no default value assigned
riskWeight(risk)equals1 - riskSuccessProbability(risk)— guaranteed by implementation- Unit tests covering every enum value's numeric mapping and resolveDefaults with mixed null/present inputs
References
- docs/architecture/schemas.md — numeric method tables, ResolvedTaskAttributes definition
- docs/architecture/graph-model.md — categorical field defaults
Notes
To be filled by implementation agent
Summary
To be filled on completion