@v11g/agents-rock 1.0.8 → 1.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/plugins/reasoning/.claude-plugin/plugin.json +1 -1
  4. package/plugins/reasoning/evals/format-handoff-folder/graders/folder-named.md +8 -0
  5. package/plugins/reasoning/evals/format-handoff-folder/graders/skill-fired.md +7 -0
  6. package/plugins/reasoning/evals/format-handoff-folder/prompt.md +9 -0
  7. package/plugins/reasoning/evals/format-ids-and-supports/graders/ids-in-chat.md +8 -0
  8. package/plugins/reasoning/evals/format-ids-and-supports/graders/skill-fired.md +7 -0
  9. package/plugins/reasoning/evals/format-ids-and-supports/graders/supports-resolve.md +11 -0
  10. package/plugins/reasoning/evals/format-ids-and-supports/prompt.md +8 -0
  11. package/plugins/reasoning/evals/format-root-candidate-status/graders/candidate-status.md +11 -0
  12. package/plugins/reasoning/evals/format-root-candidate-status/graders/skill-fired.md +7 -0
  13. package/plugins/reasoning/evals/format-root-candidate-status/prompt.md +8 -0
  14. package/plugins/reasoning/evals/format-unsaved-continues/graders/analysis-completes.md +9 -0
  15. package/plugins/reasoning/evals/format-unsaved-continues/graders/not-saved-stated.md +9 -0
  16. package/plugins/reasoning/evals/format-unsaved-continues/graders/skill-fired.md +7 -0
  17. package/plugins/reasoning/evals/format-unsaved-continues/prompt.md +8 -0
  18. package/plugins/reasoning/skills/problem-router/README.md +6 -0
  19. package/plugins/reasoning/skills/problem-router/SKILL.md +4 -0
  20. package/plugins/reasoning/skills/problem-router/references/contract.md +114 -19
  21. package/plugins/reasoning/skills/problem-solving/README.md +6 -0
  22. package/plugins/reasoning/skills/problem-solving/SKILL.md +2 -0
  23. package/plugins/reasoning/skills/problem-solving/references/contract.md +114 -19
  24. package/plugins/reasoning/skills/problem-solving/references/interview.md +2 -0
  25. package/plugins/reasoning/skills/systemic-design/README.md +3 -0
  26. package/plugins/reasoning/skills/systemic-design/SKILL.md +2 -0
  27. package/plugins/reasoning/skills/systemic-design/references/contract.md +114 -19
  28. package/plugins/reasoning/skills/systemic-design/references/interview.md +2 -0
  29. package/plugins/reasoning/skills/systems-thinking/README.md +3 -0
  30. package/plugins/reasoning/skills/systems-thinking/SKILL.md +2 -0
  31. package/plugins/reasoning/skills/systems-thinking/frameworks/leverage-points.md +15 -6
  32. package/plugins/reasoning/skills/systems-thinking/references/contract.md +114 -19
  33. package/plugins/reasoning/skills/systems-thinking/references/interview.md +2 -0
  34. package/plugins/solution-architect/.claude-plugin/plugin.json +1 -1
  35. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/cdp.mjs +4 -1
  36. package/plugins/solution-architect/skills/analyze-requirements/scripts/lib/quality-gate.mjs +16 -1
  37. package/plugins/solution-architect/skills/analyze-requirements/scripts/test/quality-gate.test.mjs +9 -0
  38. package/plugins/solution-architect/skills/estimate/README.md +20 -15
  39. package/plugins/solution-architect/skills/estimate/SKILL.md +10 -6
  40. package/plugins/solution-architect/skills/estimate/assets/estimate-template-agentic.html +111 -138
  41. package/plugins/solution-architect/skills/estimate/assets/estimate-template.html +361 -247
  42. package/plugins/solution-architect/skills/estimate/assets/scores-review-template.html +5 -4
  43. package/plugins/solution-architect/skills/estimate/evals/evals.json +7 -7
  44. package/plugins/solution-architect/skills/estimate/references/agentic-estimation.md +4 -2
  45. package/plugins/solution-architect/skills/estimate/references/ai-multipliers.md +38 -82
  46. package/plugins/solution-architect/skills/estimate/references/interview.md +56 -35
  47. package/plugins/solution-architect/skills/estimate/references/scoring-guide.md +40 -4
  48. package/plugins/solution-architect/skills/estimate/references/techniques.md +29 -21
  49. package/plugins/solution-architect/skills/estimate/references/writing.md +75 -43
  50. package/plugins/solution-architect/skills/estimate/scripts/lib/checks.mjs +37 -5
  51. package/plugins/solution-architect/skills/estimate/scripts/lib/context-schema.mjs +35 -0
  52. package/plugins/solution-architect/skills/estimate/scripts/lib/estimate-math.mjs +17 -75
  53. package/plugins/solution-architect/skills/estimate/scripts/lib/inline.mjs +5 -5
  54. package/plugins/solution-architect/skills/estimate/scripts/lib/pricing.mjs +78 -0
  55. package/plugins/solution-architect/skills/estimate/scripts/lib/project-price.mjs +96 -0
  56. package/plugins/solution-architect/skills/estimate/scripts/lib/redact.mjs +67 -19
  57. package/plugins/solution-architect/skills/estimate/scripts/lib/roadmap.mjs +4 -5
  58. package/plugins/solution-architect/skills/estimate/scripts/lib/rollup.mjs +48 -73
  59. package/plugins/solution-architect/skills/estimate/scripts/lib/schema.mjs +28 -13
  60. package/plugins/solution-architect/skills/estimate/scripts/lib/score-csv.mjs +2 -2
  61. package/plugins/solution-architect/skills/estimate/scripts/lib/score-html.mjs +1 -1
  62. package/plugins/solution-architect/skills/estimate/scripts/lib/scoring.mjs +2 -2
  63. package/plugins/solution-architect/skills/estimate/scripts/render.mjs +1 -1
  64. package/plugins/solution-architect/skills/estimate/scripts/score-review.mjs +1 -1
  65. package/plugins/solution-architect/skills/estimate/scripts/test/browser-agentic.test.mjs +143 -0
  66. package/plugins/solution-architect/skills/estimate/scripts/test/browser.test.mjs +209 -50
  67. package/plugins/solution-architect/skills/estimate/scripts/test/compute.test.mjs +57 -32
  68. package/plugins/solution-architect/skills/estimate/scripts/test/e2e.test.mjs +52 -0
  69. package/plugins/solution-architect/skills/estimate/scripts/test/estimate-math.test.mjs +25 -112
  70. package/plugins/solution-architect/skills/estimate/scripts/test/fixtures/agentic-estimation-fail.md +0 -10
  71. package/plugins/solution-architect/skills/estimate/scripts/test/fixtures/agentic-estimation-pass.md +0 -10
  72. package/plugins/solution-architect/skills/estimate/scripts/test/fixtures/agentic-inputs.json +1 -7
  73. package/plugins/solution-architect/skills/estimate/scripts/test/fixtures/booking-inputs.json +11 -10
  74. package/plugins/solution-architect/skills/estimate/scripts/test/fixtures/estimation-fail.md +6 -0
  75. package/plugins/solution-architect/skills/estimate/scripts/test/fixtures/estimation-pass.md +17 -21
  76. package/plugins/solution-architect/skills/estimate/scripts/test/pricing.test.mjs +88 -0
  77. package/plugins/solution-architect/skills/estimate/scripts/test/project-price.test.mjs +93 -0
  78. package/plugins/solution-architect/skills/estimate/scripts/test/references.test.mjs +86 -24
  79. package/plugins/solution-architect/skills/estimate/scripts/test/render.test.mjs +185 -31
  80. package/plugins/solution-architect/skills/estimate/scripts/test/schema.test.mjs +114 -61
  81. package/plugins/solution-architect/skills/estimate/scripts/test/score-review.test.mjs +34 -1
  82. package/plugins/solution-architect/skills/estimate/scripts/test/validate.test.mjs +103 -9
  83. package/plugins/solution-architect/skills/estimate/scripts/test/xlsx-export.test.mjs +292 -71
  84. package/plugins/solution-architect/skills/new-lead/SKILL.md +4 -3
  85. package/plugins/solution-architect/skills/proposal/README.md +9 -7
  86. package/plugins/solution-architect/skills/proposal/SKILL.md +10 -7
  87. package/plugins/solution-architect/skills/proposal/evals/evals.json +29 -11
  88. package/plugins/solution-architect/skills/proposal/evals/fixtures/gate-check-unpriced-harborline/ARCHITECTURE.md +65 -0
  89. package/plugins/solution-architect/skills/proposal/evals/fixtures/gate-check-unpriced-harborline/brief.md +21 -0
  90. package/plugins/solution-architect/skills/proposal/evals/fixtures/gate-check-unpriced-harborline/estimation-inputs.json +126 -0
  91. package/plugins/solution-architect/skills/proposal/evals/fixtures/gate-check-unpriced-harborline/estimation.json +215 -0
  92. package/plugins/solution-architect/skills/proposal/evals/fixtures/pre-fed-harborline-dispatch/estimation-inputs.json +224 -34
  93. package/plugins/solution-architect/skills/proposal/evals/fixtures/pre-fed-harborline-dispatch/estimation.json +103 -114
  94. package/plugins/solution-architect/skills/proposal/evals/fixtures/pre-fed-harborline-dispatch/estimation.md +48 -22
  95. package/plugins/solution-architect/skills/proposal/evals/fixtures/pre-fed-meridian-dental/estimation-inputs.json +211 -33
  96. package/plugins/solution-architect/skills/proposal/evals/fixtures/pre-fed-meridian-dental/estimation.json +102 -117
  97. package/plugins/solution-architect/skills/proposal/evals/fixtures/pre-fed-meridian-dental/estimation.md +48 -25
  98. package/plugins/solution-architect/skills/proposal/references/interview.md +3 -6
  99. package/plugins/solution-architect/skills/proposal/references/review.md +5 -4
  100. package/plugins/solution-architect/skills/proposal/references/writing.md +33 -31
  101. package/plugins/solution-architect/skills/proposal/scripts/derive.mjs +1 -1
  102. package/plugins/solution-architect/skills/proposal/scripts/lib/checks-client.mjs +5 -22
  103. package/plugins/solution-architect/skills/proposal/scripts/lib/checks-doc.mjs +18 -8
  104. package/plugins/solution-architect/skills/proposal/scripts/lib/checks.mjs +6 -2
  105. package/plugins/solution-architect/skills/proposal/scripts/lib/figures.mjs +24 -33
  106. package/plugins/solution-architect/skills/proposal/scripts/lib/sections.mjs +1 -1
  107. package/plugins/solution-architect/skills/proposal/scripts/test/checks-client.test.mjs +50 -47
  108. package/plugins/solution-architect/skills/proposal/scripts/test/checks-doc.test.mjs +99 -40
  109. package/plugins/solution-architect/skills/proposal/scripts/test/docs.test.mjs +11 -5
  110. package/plugins/solution-architect/skills/proposal/scripts/test/e2e.test.mjs +1 -1
  111. package/plugins/solution-architect/skills/proposal/scripts/test/evals-fixtures.test.mjs +39 -0
  112. package/plugins/solution-architect/skills/proposal/scripts/test/figures.test.mjs +67 -54
  113. package/plugins/solution-architect/skills/proposal/scripts/test/fixtures/proposal-fail.md +6 -1
  114. package/plugins/solution-architect/skills/proposal/scripts/test/fixtures/proposal-pass.md +8 -12
  115. package/plugins/solution-architect/skills/proposal/scripts/test/render.test.mjs +1 -1
  116. package/plugins/solution-architect/skills/proposal/scripts/test/validate.test.mjs +3 -2
  117. package/plugins/solution-architect/skills/estimate/scripts/lib/scenario-schema.mjs +0 -39
@@ -1,9 +1,6 @@
1
1
  import { test } from 'node:test';
2
2
  import assert from 'node:assert/strict';
3
- import {
4
- pert, projectBuffer, tierFor, aiAdjust, riskBufferHours, effectiveCapacity,
5
- scenarioRollup, taskHours, SENIORITY_FACTOR, roadmapBands, dominantSeniority,
6
- } from '../lib/estimate-math.mjs';
3
+ import { pert, roadmapBands, AI_CATEGORIES } from '../lib/estimate-math.mjs';
7
4
 
8
5
  const close = (got, want) => assert.ok(Math.abs(got - want) < 1e-9, `${got} !~ ${want}`);
9
6
 
@@ -13,119 +10,35 @@ test('pert: E=(O+4M+P)/6, sigma=(P-O)/6', () => {
13
10
  close(sigma, 4);
14
11
  });
15
12
 
16
- test('project buffer is sqrt of summed squares, not a naive sum', () => {
17
- close(projectBuffer([4, 3]), 5);
18
- close(projectBuffer([]), 0);
19
- });
20
-
21
- test('factor scores map to tiers at the documented breaks', () => {
22
- // user's real example: 2+3+5+3+4 = 17 → M
23
- assert.deepEqual(tierFor({ complexity: 2, size: 3, dependencies: 5, uncertainty: 3, risk: 4 }),
24
- { total: 17, tier: 'M' });
25
- assert.equal(tierFor({ complexity: 1, size: 1, dependencies: 2, uncertainty: 3, risk: 3 }).tier, 'S');
26
- assert.equal(tierFor({ complexity: 5, size: 4, dependencies: 4, uncertainty: 3, risk: 2 }).tier, 'L');
27
- });
28
-
29
- test('tier breaks are the workbook scale: S ≤ 11, M ≤ 17, L ≤ 22, XL above', () => {
30
- const at = (total) => tierFor({ a: total }).tier;
31
- assert.equal(at(11), 'S');
32
- assert.equal(at(12), 'M');
33
- assert.equal(at(17), 'M');
34
- assert.equal(at(18), 'L');
35
- assert.equal(at(22), 'L');
36
- assert.equal(at(23), 'XL');
37
- });
38
-
39
- test('aiAdjust applies (AO + 2AR + TR)/4 plus verification overhead', () => {
40
- const e = 152 / 6; // boilerplate: red=0.65, redMax=0.8 — category only, no seniority term
41
- const want = ((e * 0.2 + 2 * (e * 0.35) + e) / 4) * 1.12;
42
- close(aiAdjust({ e, category: 'boilerplate', verificationPct: 0.12, scale: 1 }), want);
43
- });
44
-
45
- test('aiAdjust clamps reduction at 0.9 for outsized scale', () => {
46
- const got = aiAdjust({ e: 100, category: 'boilerplate', verificationPct: 0, scale: 1.5 });
47
- const red = 0.9; // 0.65 × 1.5 = 0.975 → clamped
48
- close(got, (100 * (1 - red) * 3 + 100) / 4); // redMax also clamps to 0.9 so ao == ar
49
- });
50
-
51
- test('taskHours: seniority scales base effort on the traditional path', () => {
52
- const base = { e: 100, aiAssisted: false, category: 'logic', verificationPct: 0.12 };
53
- close(taskHours({ ...base, seniority: 'senior' }), 85);
54
- close(taskHours({ ...base, seniority: 'mid' }), 100);
55
- close(taskHours({ ...base, seniority: 'junior' }), 115);
56
- });
57
-
58
- test('taskHours: a senior is never slower than a junior, with or without AI', () => {
59
- for (const aiAssisted of [false, true]) {
60
- for (const category of ['boilerplate', 'logic', 'novel']) {
61
- const at = (seniority) => taskHours({ e: 100, seniority, aiAssisted, category, verificationPct: 0.12 });
62
- assert.ok(at('senior') < at('mid') && at('mid') < at('junior'),
63
- `${aiAssisted}/${category}: ${at('senior')} < ${at('mid')} < ${at('junior')} violated`);
64
- }
13
+ test('the hours-to-money machinery is gone', async () => {
14
+ const mod = await import('../lib/estimate-math.mjs');
15
+ for (const gone of ['SENIORITY_FACTOR', 'HOURS_PER_MONTH', 'COORDINATION_TAX',
16
+ 'taskHours', 'aiAdjust', 'dominantSeniority', 'effectiveCapacity',
17
+ 'scenarioRollup', 'riskBufferHours', 'projectBuffer', 'TIER_BREAKS', 'tierFor']) {
18
+ assert.equal(mod[gone], undefined, `${gone} should no longer be exported`);
65
19
  }
20
+ assert.ok(mod.pert && mod.roadmapBands && mod.AI_CATEGORIES);
66
21
  });
67
22
 
68
- test('taskHours: AI assistance reduces hours versus the same seniority unaided', () => {
69
- for (const seniority of Object.keys(SENIORITY_FACTOR)) {
70
- const at = (aiAssisted) => taskHours({ e: 100, seniority, aiAssisted, category: 'boilerplate', verificationPct: 0.12 });
71
- assert.ok(at(true) < at(false), `${seniority}: AI ${at(true)} !< ${at(false)}`);
72
- }
73
- });
74
-
75
- // The what-if rail's roster needs the same dominant-seniority rule the
76
- // committed rollup uses — shipping it in the inlined math bundle is what
77
- // keeps the page copy and the Node copy one function.
78
- test('dominantSeniority ships with the math bundle: count wins, ties go senior', () => {
79
- assert.equal(dominantSeniority([
80
- { seniority: 'junior' }, { seniority: 'junior' }, { seniority: 'senior' },
81
- ]), 'junior');
82
- assert.equal(dominantSeniority([{ seniority: 'senior' }, { seniority: 'junior' }]), 'senior');
83
- });
84
-
85
- test('risk buffer is probability times impact, summed', () => {
86
- close(riskBufferHours([{ probability: 0.3, impactHours: 40 }, { probability: 0.5, impactHours: 16 }]), 20);
87
- });
88
-
89
- test('capacity pays a coordination tax per added engineer, floored at one', () => {
90
- close(effectiveCapacity(1), 1);
91
- close(effectiveCapacity(2), 1.8);
92
- close(effectiveCapacity(3), 2.4);
93
- close(effectiveCapacity(12), 1); // raw formula goes negative past 10 — floor holds
94
- });
95
-
96
- test('scenarioRollup: 1008h, 2 mid @45, $100/seat tooling → 4.0mo, $51,200', () => {
97
- const team = [{ seniority: 'mid', rate: 45 }, { seniority: 'mid', rate: 45 }];
98
- const got = scenarioRollup({ hours: 1008, team, toolingCostPerSeat: 100 });
99
- close(got.months, 4);
100
- close(got.laborCost, 50400);
101
- close(got.toolingCost, 800);
102
- close(got.totalCost, 51200);
103
- });
104
-
105
- // A null seat cost is an open gap, not free tooling — it prices as zero and
106
- // the interview records the assumption; the math must not turn null into NaN.
107
- test('scenarioRollup: null toolingCostPerSeat prices tooling at zero', () => {
108
- const team = [{ seniority: 'mid', rate: 45 }];
109
- const got = scenarioRollup({ hours: 140, team, toolingCostPerSeat: null });
110
- close(got.toolingCost, 0);
111
- close(got.totalCost, got.laborCost);
23
+ test('roadmapBands returns shares that sum to 1, with no months', () => {
24
+ const bands = roadmapBands({ milestones: [{ name: 'M1', hours: 75 }, { name: 'M2', hours: 25 }] });
25
+ assert.deepEqual(bands.map((b) => b.name), ['M1', 'M2']);
26
+ close(bands[0].share, 0.75);
27
+ close(bands[1].share, 0.25);
28
+ assert.equal(bands[0].startMonths, undefined);
112
29
  });
113
30
 
114
- test('roadmapBands tiles [0, months] proportionally to hours, in order', () => {
115
- const bands = roadmapBands({
116
- milestones: [{ name: 'M1', hours: 60 }, { name: 'M2', hours: 40 }],
117
- months: 5,
118
- });
119
- assert.deepEqual(bands.map((b) => b.name), ['M1', 'M2']);
120
- close(bands[0].startMonths, 0);
121
- close(bands[0].endMonths, 3);
122
- close(bands[1].startMonths, 3); // no gap: starts where M1 ends
123
- close(bands[1].endMonths, 5); // last band ends at total months
31
+ test('roadmapBands with no hours does not divide by zero', () => {
32
+ const bands = roadmapBands({ milestones: [{ name: 'M1', hours: 0 }] });
33
+ assert.ok(Number.isFinite(bands[0].share));
34
+ close(bands[0].share, 0);
124
35
  });
125
36
 
126
- test('roadmapBands: single milestone spans the whole project', () => {
127
- const bands = roadmapBands({ milestones: [{ name: 'All', hours: 90 }], months: 4.2 });
128
- assert.equal(bands.length, 1);
129
- close(bands[0].startMonths, 0);
130
- close(bands[0].endMonths, 4.2);
37
+ test('scoreSummary uses the weighted score, not the raw sum', async () => {
38
+ const { scoreSummary } = await import('../lib/scoring.mjs');
39
+ const scores = Object.fromEntries(['tech', 'size', 'deps', 'unc', 'risk']
40
+ .map((k, i) => [k, { n: [1, 3, 3, 3, 3][i], anchor: '', cite: 'x' }]));
41
+ const got = scoreSummary({ scores });
42
+ close(got.scoreTotal, 13);
43
+ assert.equal(got.tier, 'M');
131
44
  });
@@ -9,11 +9,6 @@ This will take 1–2 hours depending on complexity.
9
9
  | Planning | S | proposed |
10
10
  | API client swap | S | stated |
11
11
 
12
- | Line | Hours |
13
- | --- | --- |
14
- | Spread buffer | 0.25 |
15
- | Risk buffer | 0.15 |
16
-
17
12
  ### Out of scope
18
13
 
19
14
  - Anything not listed above.
@@ -28,11 +23,6 @@ Calibration: 20 measurement records; 1 of 4 tasks uncalibrated.
28
23
  | swap-tests | 10 | 10 | repo+agent+model | HIGH | none | proposed |
29
24
  | swap-db | not estimated | 0 | none | MED | none | proposed |
30
25
 
31
- | Scenario | Months | Total cost |
32
- | --- | --- | --- |
33
- | solo | 0.02 | $208.43 |
34
- | pair | 0.01 | $195.12 |
35
-
36
26
  ### Evidence
37
27
 
38
28
  | Id | Task | Actual (min) |
@@ -9,11 +9,6 @@ Delivery: agentic (claude-code + sonnet) · Baselines: 20 measurements, 3 shapes
9
9
  | Planning | S | proposed |
10
10
  | API client swap | S | stated |
11
11
 
12
- | Line | Hours |
13
- | --- | --- |
14
- | Spread buffer | 0.25 |
15
- | Risk buffer | 0.15 |
16
-
17
12
  ### Out of scope
18
13
 
19
14
  - Anything not listed above.
@@ -29,11 +24,6 @@ Calibration: 20 measurement records; 1 of 4 tasks uncalibrated.
29
24
  | swap-tests | 10 | 10 | repo+agent+model | HIGH | none | proposed |
30
25
  | swap-db | not estimated | 0 | none | UNCALIBRATED | none | proposed |
31
26
 
32
- | Scenario | Months | Total cost |
33
- | --- | --- | --- |
34
- | solo | 0.02 | $208.43 |
35
- | pair | 0.01 | $195.12 |
36
-
37
27
  ### Evidence
38
28
 
39
29
  | Id | Task | Actual (min) |
@@ -5,7 +5,6 @@
5
5
  "depth": "STANDARD",
6
6
  "agentContext": { "agent": "claude-code", "model": "sonnet", "repository": "project-a" },
7
7
  "measurementsPath": "FIXTURE_MEASUREMENTS",
8
- "overheadPct": 0.1,
9
8
  "assumptions": ["Existing CI pipeline stays as is"],
10
9
  "risks": [
11
10
  { "name": "SDK incompatibility", "probability": 0.3, "impactMinutes": 30, "reason": "new SDK may break integration test mocks" }
@@ -36,10 +35,5 @@
36
35
  "assumptions": [], "provenance": "proposed" }
37
36
  ]
38
37
  }
39
- ],
40
- "scenarios": [
41
- { "id": "solo", "aiAssisted": true, "toolingCostPerSeat": 100, "team": [{ "seniority": "senior", "rate": 90 }] },
42
- { "id": "pair", "aiAssisted": true, "toolingCostPerSeat": 200, "team": [{ "seniority": "senior", "rate": 90 }, { "seniority": "mid", "rate": 60 }] }
43
- ],
44
- "recommendedScenario": "solo"
38
+ ]
45
39
  }
@@ -4,9 +4,17 @@
4
4
  "technique": "three-point-pert",
5
5
  "depth": "STANDARD",
6
6
  "calibration": { "S": [20, 60], "M": [60, 160], "L": [160, 400], "XL": [400, 800] },
7
- "overheadPct": 0.35,
8
7
  "verificationPct": 0.12,
9
- "exposeRatesToClient": false,
8
+ "contextLevels": {
9
+ "codebaseMaturity": 2, "stackFamiliarity": 1, "specQuality": 3, "compliance": 1, "clientDecisions": 2
10
+ },
11
+ "contextProvenance": {
12
+ "codebaseMaturity": { "level": 2, "anchor": "young and clean", "cite": "ARCHITECTURE.md §3", "source": "derived" },
13
+ "stackFamiliarity": { "level": 1, "anchor": "core stack, done before", "cite": "interview", "source": "stated" },
14
+ "specQuality": { "level": 3, "anchor": "outline or slide deck", "cite": "requirements.json readiness 62", "source": "derived" },
15
+ "compliance": { "level": 1, "anchor": "none", "cite": "ARCHITECTURE.md §8 no PII", "source": "derived" },
16
+ "clientDecisions": { "level": 2, "anchor": "two or three", "cite": "requirements.md Part 1", "source": "derived" }
17
+ },
10
18
  "components": [
11
19
  { "id": "api", "name": "Booking API" },
12
20
  { "id": "notify", "name": "Notification Service" },
@@ -65,12 +73,5 @@
65
73
  ],
66
74
  "assumptions": [
67
75
  { "text": "single timezone", "impactIfWrong": "recompute booking-api at logic category, +30%" }
68
- ],
69
- "scenarios": [
70
- { "id": "3eng-noai", "aiAssisted": false, "toolingCostPerSeat": null,
71
- "team": [{ "seniority": "mid", "rate": 45 }, { "seniority": "mid", "rate": 45 }, { "seniority": "junior", "rate": 30 }] },
72
- { "id": "2eng-max5x", "aiAssisted": true, "toolingCostPerSeat": 100,
73
- "team": [{ "seniority": "senior", "rate": 60 }, { "seniority": "mid", "rate": 45 }] }
74
- ],
75
- "recommendedScenario": "2eng-max5x"
76
+ ]
76
77
  }
@@ -24,6 +24,12 @@ Technique: three-point PERT — detailed backlog available.
24
24
  | Slot conflict + cancellation rules | logic | 24/40/80 | 44 | MED | no recurring bookings in v1 |
25
25
  | Scheduled reminder jobs | logic | 12/20/36 | 21.33 | MED | | proposed |
26
26
 
27
+ ### Scenario comparison
28
+
29
+ | Scenario | Team | AI-assisted | Months | Cost | Notes |
30
+ | --- | --- | --- | --- | --- | --- |
31
+ | 3eng-noai | 2 mid + 1 junior | no | 0.43 | $7,266 | — |
32
+
27
33
  ### Calibration
28
34
 
29
35
  Tier hour bands used: S 20-60h · M 60-160h · L 160-400h (defaults — no
@@ -7,24 +7,15 @@
7
7
  | User can book appointment | M | 40–120 | stated |
8
8
  | Email reminders | S | 12–36 | proposed |
9
9
 
10
- Recommended delivery: 2 engineers (1 senior, 1 mid), AI-assisted — see detail.
11
-
12
- | Line | Hours |
13
- | --- | --- |
14
- | Development | 90.67 |
15
- | Overhead (35%) | 31.73 |
16
- | Risk buffer | 12 |
17
- | Estimate-spread buffer | 10.91 |
18
-
19
10
  ### Roadmap
20
11
 
21
- | Milestone | Features | Months (from start) |
12
+ | Milestone | Features | Share |
22
13
  | --- | --- | --- |
23
- | M1 - Booking core | User can book appointment | 0–0.3 |
24
- | M2 - Notifications | Email reminders | 0.3–0.4 |
14
+ | M1 - Booking core | User can book appointment | 76% |
15
+ | M2 - Notifications | Email reminders | 24% |
25
16
 
26
- Sequential delivery by the recommended scenario team. Bands are relative
27
- months, not calendar dates. Ordering: proposed.
17
+ Bands are relative shares of total effort, not durations. This estimate
18
+ produces no timeline. Ordering: proposed.
28
19
 
29
20
  ### Assumptions
30
21
 
@@ -47,14 +38,19 @@ Technique: three-point PERT — detailed backlog available.
47
38
  | Slot conflict + cancellation rules | logic | 24/40/80 | 44 | MED | no recurring bookings in v1 | proposed |
48
39
  | Scheduled reminder jobs | logic | 12/20/36 | 21.33 | MED | provider already chosen | proposed |
49
40
 
50
- ### Scenario comparison
41
+ ### Price
51
42
 
52
- | Scenario | Team | AI-assisted | Months | Cost | Notes |
53
- | --- | --- | --- | --- | --- | --- |
54
- | 3eng-noai | 2 mid + 1 junior | no | 0.43 | $7,266 | — |
55
- | 2eng-max5x | 1 senior + 1 mid | yes | 0.40 | $5,993 | recommended |
43
+ | Figure | Value |
44
+ | --- | --- |
45
+ | Presented range | $10,000 – $14,000 |
46
+ | If a single number is required | $12,000 |
47
+ | Contingency rate | 15% |
48
+ | Implied accuracy | 24% |
56
49
 
57
50
  ### Calibration
58
51
 
59
- Tier hour bands used: S 20-60h · M 60-160h · L 160-400h (defaults — no
60
- delivery history supplied).
52
+ Implied rate check: the M band's $2,750 midpoint against the 69 h behind a
53
+ comparable delivered feature is about $40/h blended — defensible for this
54
+ team. No delivery history was supplied, so the bands are the defaults;
55
+ recalibrate them against actuals roughly twice a year. Whatever AI leverage
56
+ the team has is priced into the bands already and stays as margin.
@@ -0,0 +1,88 @@
1
+ import { test } from 'node:test';
2
+ import assert from 'node:assert/strict';
3
+ import {
4
+ WEIGHTS, BANDS, weightedScore, bandFor, pointEstimate, spreadFor, featurePrice,
5
+ } from '../lib/pricing.mjs';
6
+
7
+ const close = (got, want) => assert.ok(Math.abs(got - want) < 1e-6, `${got} !~ ${want}`);
8
+ const s = (tech, size, deps, unc, risk) => ({ tech, size, deps, unc, risk });
9
+
10
+ test('weights sum to 1 and follow v2: size lightest, uncertainty heaviest', () => {
11
+ close(Object.values(WEIGHTS).reduce((a, b) => a + b, 0), 1);
12
+ assert.equal(WEIGHTS.size, 0.10);
13
+ assert.equal(WEIGHTS.unc, 0.30);
14
+ });
15
+
16
+ test('weightedScore: SUMPRODUCT(scores, weights) x 5', () => {
17
+ close(weightedScore(s(1, 3, 3, 3, 3)), 13);
18
+ close(weightedScore(s(3, 3, 4, 2, 4)), 15.5);
19
+ close(weightedScore(s(4, 4, 4, 4, 4)), 20);
20
+ });
21
+
22
+ test('bands are continuous: each price high equals the next price low', () => {
23
+ for (let i = 0; i < BANDS.length - 1; i += 1) {
24
+ assert.equal(BANDS[i].end, BANDS[i + 1].start);
25
+ assert.equal(BANDS[i].priceHigh, BANDS[i + 1].priceLow);
26
+ }
27
+ });
28
+
29
+ test('pointEstimate interpolates inside the band', () => {
30
+ close(pointEstimate(13), 2125); // 1500 + (13-11.5)/6 * 2500
31
+ close(pointEstimate(20), 7000); // 4000 + (20-17.5)/5 * 6000
32
+ close(pointEstimate(15.5), 3166.666667);
33
+ close(pointEstimate(8), 961.538462); // 500 + (8-5)/6.5 * 1000
34
+ });
35
+
36
+ test('a band boundary picks the upper band', () => {
37
+ assert.equal(bandFor(11.5).tier, 'M');
38
+ assert.equal(bandFor(17.5).tier, 'L');
39
+ assert.equal(bandFor(22.5).tier, 'XL');
40
+ });
41
+
42
+ test('all ones lands on the bottom edge without dividing by zero', () => {
43
+ close(weightedScore(s(1, 1, 1, 1, 1)), 5);
44
+ assert.equal(bandFor(5).tier, 'S');
45
+ close(pointEstimate(5), 500);
46
+ });
47
+
48
+ test('all fives lands on the top edge and stays XL', () => {
49
+ close(weightedScore(s(5, 5, 5, 5, 5)), 25);
50
+ assert.equal(bandFor(25).tier, 'XL');
51
+ close(pointEstimate(25), 25000);
52
+ });
53
+
54
+ test('spread widens faster with uncertainty than with risk', () => {
55
+ close(spreadFor({ unc: 1, risk: 1 }), 0.15);
56
+ close(spreadFor({ unc: 3, risk: 3 }), 0.35);
57
+ close(spreadFor({ unc: 4, risk: 4 }), 0.45);
58
+ close(spreadFor({ unc: 2, risk: 4 }), 0.31);
59
+ });
60
+
61
+ test('featurePrice matches the workbook row for user authentication', () => {
62
+ const f = featurePrice(s(1, 3, 3, 3, 3));
63
+ close(f.score, 13);
64
+ assert.equal(f.tier, 'M');
65
+ close(f.point, 2125);
66
+ close(f.spread, 0.35);
67
+ close(f.low, 1381.25);
68
+ close(f.high, 2868.75);
69
+ assert.equal(f.flag, '');
70
+ });
71
+
72
+ test('a spread at or above 0.4 recommends a deep estimate', () => {
73
+ assert.equal(featurePrice(s(4, 4, 4, 4, 4)).flag, 'Deep estimate recommended');
74
+ });
75
+
76
+ test('an XL feature that is also epic-sized must be split', () => {
77
+ assert.equal(featurePrice(s(5, 5, 5, 5, 5)).flag, 'SPLIT into sub-features');
78
+ });
79
+
80
+ test('an XL feature that is not epic-sized requires a deep estimate', () => {
81
+ assert.equal(featurePrice(s(5, 3, 5, 5, 5)).flag, 'Deep estimate required');
82
+ });
83
+
84
+ test('a point estimate above the threshold recommends a deep estimate', () => {
85
+ const f = featurePrice(s(5, 5, 5, 3, 3));
86
+ assert.ok(f.point >= 6000, `expected >= 6000, got ${f.point}`);
87
+ assert.equal(f.flag, 'Deep estimate recommended');
88
+ });
@@ -0,0 +1,93 @@
1
+ import { test } from 'node:test';
2
+ import assert from 'node:assert/strict';
3
+ import {
4
+ CONTEXT_FACTORS, contextMultiplier, overheadFor, contingencyRate, projectPrice,
5
+ } from '../lib/project-price.mjs';
6
+
7
+ const close = (got, want, eps = 1e-4) => assert.ok(Math.abs(got - want) < eps, `${got} !~ ${want}`);
8
+
9
+ // The workbook's own five sample features, already priced by Task 1.
10
+ const SAMPLE = [
11
+ { point: 2125, spread: 0.35, unc: 3, risk: 3 },
12
+ { point: 7000, spread: 0.45, unc: 4, risk: 4 },
13
+ { point: 3166.666667, spread: 0.31, unc: 2, risk: 4 },
14
+ { point: 961.538462, spread: 0.15, unc: 1, risk: 1 },
15
+ { point: 2958.333333, spread: 0.32, unc: 3, risk: 2 },
16
+ ];
17
+ const LEVELS = {
18
+ codebaseMaturity: 2, stackFamiliarity: 1, specQuality: 3, compliance: 1, clientDecisions: 2,
19
+ };
20
+
21
+ test('context factors cover the five v2 dimensions with four levels each', () => {
22
+ assert.deepEqual(Object.keys(CONTEXT_FACTORS).sort(), [
23
+ 'clientDecisions', 'codebaseMaturity', 'compliance', 'specQuality', 'stackFamiliarity',
24
+ ]);
25
+ for (const mults of Object.values(CONTEXT_FACTORS)) assert.equal(mults.length, 4);
26
+ });
27
+
28
+ test('context factors combine additively, not multiplicatively', () => {
29
+ close(contextMultiplier(LEVELS), 1.40);
30
+ });
31
+
32
+ test('a missing or out-of-range level falls back to a multiplier of 1', () => {
33
+ close(contextMultiplier({ ...LEVELS, compliance: 9 }), 1.40);
34
+ close(contextMultiplier({ ...LEVELS, compliance: undefined }), 1.40);
35
+ close(contextMultiplier({}), 1.0);
36
+ });
37
+
38
+ test('the composite multiplier is capped', () => {
39
+ const worst = {
40
+ codebaseMaturity: 4, stackFamiliarity: 4, specQuality: 4, compliance: 4, clientDecisions: 4,
41
+ };
42
+ close(contextMultiplier(worst), 2.5);
43
+ });
44
+
45
+ test('overheads total 62% at five features', () => {
46
+ const { totalPct, lines } = overheadFor(5);
47
+ close(totalPct, 0.62);
48
+ close(lines.integration, 0.10);
49
+ });
50
+
51
+ test('integration overhead grows per feature and caps at 25%', () => {
52
+ close(overheadFor(1).lines.integration, 0.02);
53
+ close(overheadFor(20).lines.integration, 0.25);
54
+ });
55
+
56
+ test('contingency rises with average uncertainty and risk', () => {
57
+ close(contingencyRate({ avgUnc: 2.6, avgRisk: 2.8 }), 0.158);
58
+ close(contingencyRate({ avgUnc: 0, avgRisk: 0 }), 0.05);
59
+ });
60
+
61
+ test('projectPrice reproduces the workbook total', () => {
62
+ const p = projectPrice({ features: SAMPLE, levels: LEVELS });
63
+ close(p.featurePoints, 16211.538462);
64
+ close(p.contextMultiplier, 1.40);
65
+ close(p.adjustedBase, 22696.153846, 1e-3);
66
+ close(p.overheads.amount, 14071.615385, 1e-3);
67
+ close(p.contingencyRate, 0.158);
68
+ close(p.p50, 42577.076769, 1e-2);
69
+ close(p.sigma, 9232.005917, 1e-2);
70
+ close(p.p20, 34822.1918, 1e-2);
71
+ close(p.p80, 50331.96174, 1e-2);
72
+ close(p.p95, 57763.7265, 1e-2);
73
+ assert.equal(p.presentLow, 43000);
74
+ assert.equal(p.presentHigh, 58000);
75
+ assert.equal(p.singleNumber, 50500);
76
+ close(p.impliedAccuracy, 0.216830, 1e-5);
77
+ });
78
+
79
+ test('sigma combines by root-sum-of-squares, not a plain sum', () => {
80
+ const naive = SAMPLE.reduce((sum, f) => sum + f.point * f.spread, 0);
81
+ const p = projectPrice({ features: SAMPLE, levels: LEVELS });
82
+ const buildSigma = p.sigma * p.featurePoints / p.p50;
83
+ assert.ok(buildSigma < naive, `${buildSigma} should be below the naive sum ${naive}`);
84
+ });
85
+
86
+ test('no priced features returns zeros, never NaN or Infinity', () => {
87
+ const p = projectPrice({ features: [], levels: LEVELS });
88
+ for (const k of ['featurePoints', 'p50', 'sigma', 'p80', 'impliedAccuracy']) {
89
+ assert.ok(Number.isFinite(p[k]), `${k} is ${p[k]}`);
90
+ }
91
+ assert.equal(p.p50, 0);
92
+ assert.equal(p.impliedAccuracy, 0);
93
+ });