@v11g/agents-rock 1.0.1 → 1.0.3
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.
- package/README.md +58 -14
- package/package.json +7 -3
- package/plugins/business-analyst/.claude-plugin/plugin.json +9 -0
- package/plugins/business-analyst/skills/business-analyst/README.md +20 -0
- package/plugins/business-analyst/skills/business-analyst/SKILL.md +69 -0
- package/plugins/business-analyst/skills/business-analyst/references/ai-extension.md +37 -0
- package/plugins/business-analyst/skills/business-analyst/references/frameworks.md +53 -0
- package/plugins/business-analyst/skills/business-analyst/references/interview.md +89 -0
- package/plugins/business-analyst/skills/business-analyst/references/review.md +25 -0
- package/plugins/business-analyst/skills/business-analyst/references/writing.md +102 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/lib/checks.mjs +166 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/lib/schema.mjs +78 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/test/checks.test.mjs +188 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/test/e2e.test.mjs +17 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/test/fixtures/requirements-fail.json +205 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/test/fixtures/requirements-pass.json +59 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/test/fixtures/requirements-pass.md +63 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/test/schema.test.mjs +41 -0
- package/plugins/business-analyst/skills/business-analyst/scripts/validate.mjs +20 -0
- package/plugins/solution-architect/skills/analyze-requirements/README.md +1 -1
- package/plugins/solution-architect/skills/estimate/SKILL.md +13 -5
- package/plugins/solution-architect/skills/estimate/assets/estimate-template-agentic.html +917 -0
- package/plugins/solution-architect/skills/estimate/assets/estimate-template.html +430 -13
- package/plugins/solution-architect/skills/estimate/references/agentic-estimation.md +148 -0
- package/plugins/solution-architect/skills/estimate/references/ai-multipliers.md +10 -0
- package/plugins/solution-architect/skills/estimate/references/interview.md +20 -1
- package/plugins/solution-architect/skills/estimate/references/task-shapes.md +173 -0
- package/plugins/solution-architect/skills/estimate/references/writing.md +31 -0
- package/plugins/solution-architect/skills/estimate/scripts/compute.mjs +5 -1
- package/plugins/solution-architect/skills/estimate/scripts/lib/agentic-checks.mjs +65 -0
- package/plugins/solution-architect/skills/estimate/scripts/lib/baselines.mjs +107 -0
- package/plugins/solution-architect/skills/estimate/scripts/lib/checks.mjs +16 -7
- package/plugins/solution-architect/skills/estimate/scripts/lib/inline.mjs +14 -0
- package/plugins/solution-architect/skills/estimate/scripts/lib/measurements.mjs +59 -0
- package/plugins/solution-architect/skills/estimate/scripts/lib/redact.mjs +28 -5
- package/plugins/solution-architect/skills/estimate/scripts/lib/rollup.mjs +53 -22
- package/plugins/solution-architect/skills/estimate/scripts/lib/schema.mjs +52 -7
- package/plugins/solution-architect/skills/estimate/scripts/render.mjs +14 -3
- package/plugins/solution-architect/skills/estimate/scripts/test/baselines.test.mjs +120 -0
- package/plugins/solution-architect/skills/estimate/scripts/test/browser.test.mjs +69 -0
- package/plugins/solution-architect/skills/estimate/scripts/test/compute.test.mjs +44 -0
- package/plugins/solution-architect/skills/estimate/scripts/test/e2e.test.mjs +28 -1
- package/plugins/solution-architect/skills/estimate/scripts/test/fixtures/agentic-estimation-fail.md +55 -0
- package/plugins/solution-architect/skills/estimate/scripts/test/fixtures/agentic-estimation-pass.md +54 -0
- package/plugins/solution-architect/skills/estimate/scripts/test/fixtures/agentic-inputs.json +45 -0
- package/plugins/solution-architect/skills/estimate/scripts/test/fixtures/measurements.jsonl +20 -0
- package/plugins/solution-architect/skills/estimate/scripts/test/measurements.test.mjs +54 -0
- package/plugins/solution-architect/skills/estimate/scripts/test/references.test.mjs +25 -1
- package/plugins/solution-architect/skills/estimate/scripts/test/render.test.mjs +48 -1
- package/plugins/solution-architect/skills/estimate/scripts/test/schema.test.mjs +59 -0
- package/plugins/solution-architect/skills/estimate/scripts/test/validate.test.mjs +37 -0
- package/plugins/solution-architect/skills/estimate/scripts/test/xlsx-export.test.mjs +168 -0
- package/plugins/solution-architect/skills/estimate/scripts/test/zip.mjs +41 -0
- package/plugins/solution-architect/skills/new-lead/SKILL.md +15 -10
- package/src/cli/agents.mjs +10 -10
- package/src/cli/args.mjs +22 -3
- package/src/cli/flow.mjs +85 -0
- package/src/cli/install.mjs +7 -8
- package/src/cli/main.mjs +30 -72
- package/src/cli/prompts.mjs +84 -0
- package/src/cli/report.mjs +26 -0
- package/src/cli/scope.mjs +34 -0
- package/src/cli/targets.mjs +45 -0
- package/src/cli/uninstall.mjs +9 -10
- package/src/cli/picker.mjs +0 -78
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { test } from 'node:test';
|
|
2
2
|
import assert from 'node:assert/strict';
|
|
3
|
-
import { mkdtempSync, readFileSync } from 'node:fs';
|
|
3
|
+
import { mkdtempSync, readFileSync, writeFileSync } from 'node:fs';
|
|
4
4
|
import { execFileSync } from 'node:child_process';
|
|
5
5
|
import { tmpdir } from 'node:os';
|
|
6
6
|
import { join } from 'node:path';
|
|
@@ -32,3 +32,30 @@ test('fixture flows compute → validate → render → serve', async () => {
|
|
|
32
32
|
assert.match(await res.text(), /Booking App/);
|
|
33
33
|
} finally { srv.close(); }
|
|
34
34
|
});
|
|
35
|
+
|
|
36
|
+
// Agentic fixture flows the same pipeline, plus the honesty gate: a vague
|
|
37
|
+
// range in the md must fail validate.mjs before it can ever reach render.mjs.
|
|
38
|
+
const agenticFixture = join(scripts, 'test/fixtures/agentic-inputs.json');
|
|
39
|
+
const agenticPassMd = join(scripts, 'test/fixtures/agentic-estimation-pass.md');
|
|
40
|
+
const measurementsFixture = join(scripts, 'test/fixtures/measurements.jsonl');
|
|
41
|
+
|
|
42
|
+
test('agentic fixture flows compute → validate → render, and a vague range is refused', () => {
|
|
43
|
+
const dir = mkdtempSync(join(tmpdir(), 'estimate-e2e-agentic-'));
|
|
44
|
+
const inputs = JSON.parse(readFileSync(agenticFixture, 'utf8'));
|
|
45
|
+
inputs.measurementsPath = measurementsFixture;
|
|
46
|
+
const inputsPath = join(dir, 'inputs.json');
|
|
47
|
+
writeFileSync(inputsPath, JSON.stringify(inputs));
|
|
48
|
+
|
|
49
|
+
const json = join(dir, 'estimation.json');
|
|
50
|
+
execFileSync('node', [join(scripts, 'compute.mjs'), '--inputs', inputsPath, '--out', json]);
|
|
51
|
+
execFileSync('node', [join(scripts, 'validate.mjs'), '--md', agenticPassMd, '--json', json]); // exit 0 or throws
|
|
52
|
+
execFileSync('node', [join(scripts, 'render.mjs'), '--json', json, '--md', agenticPassMd, '--out', dir]);
|
|
53
|
+
const html = readFileSync(join(dir, 'estimate.html'), 'utf8');
|
|
54
|
+
assert.match(html, /Delivery: agentic/);
|
|
55
|
+
|
|
56
|
+
const vagueMd = readFileSync(agenticPassMd, 'utf8')
|
|
57
|
+
.replace(/(Delivery: agentic.*\n)/, '$1This will take 1–2 hours depending on complexity.\n');
|
|
58
|
+
const vagueMdPath = join(dir, 'vague.md');
|
|
59
|
+
writeFileSync(vagueMdPath, vagueMd);
|
|
60
|
+
assert.throws(() => execFileSync('node', [join(scripts, 'validate.mjs'), '--md', vagueMdPath, '--json', json]));
|
|
61
|
+
});
|
package/plugins/solution-architect/skills/estimate/scripts/test/fixtures/agentic-estimation-fail.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Booking Revamp — Estimation
|
|
2
|
+
|
|
3
|
+
## Summary
|
|
4
|
+
|
|
5
|
+
This will take 1–2 hours depending on complexity.
|
|
6
|
+
|
|
7
|
+
| Feature | Tier | src |
|
|
8
|
+
| --- | --- | --- |
|
|
9
|
+
| Planning | S | proposed |
|
|
10
|
+
| API client swap | S | stated |
|
|
11
|
+
|
|
12
|
+
| Line | Hours |
|
|
13
|
+
| --- | --- |
|
|
14
|
+
| Spread buffer | 0.25 |
|
|
15
|
+
| Risk buffer | 0.15 |
|
|
16
|
+
|
|
17
|
+
### Out of scope
|
|
18
|
+
|
|
19
|
+
- Anything not listed above.
|
|
20
|
+
|
|
21
|
+
## Estimation detail
|
|
22
|
+
|
|
23
|
+
Calibration: 20 measurement records; 1 of 4 tasks uncalibrated.
|
|
24
|
+
|
|
25
|
+
| Task | Baseline (min) | Samples | Match | Confidence | Assumptions | src |
|
|
26
|
+
| --- | --- | --- | --- | --- | --- | --- |
|
|
27
|
+
| swap-refactor | 11 | 7 | repo+agent+model | MED | old client has no dynamic call sites | stated |
|
|
28
|
+
| swap-tests | 10 | 10 | repo+agent+model | HIGH | none | proposed |
|
|
29
|
+
| swap-db | not estimated | 0 | none | MED | none | proposed |
|
|
30
|
+
|
|
31
|
+
| Scenario | Months | Total cost |
|
|
32
|
+
| --- | --- | --- |
|
|
33
|
+
| solo | 0.02 | $208.43 |
|
|
34
|
+
| pair | 0.01 | $195.12 |
|
|
35
|
+
|
|
36
|
+
### Evidence
|
|
37
|
+
|
|
38
|
+
| Id | Task | Actual (min) |
|
|
39
|
+
| --- | --- | --- |
|
|
40
|
+
| m01 | Refactor A | 6 |
|
|
41
|
+
| m02 | Refactor B | 8 |
|
|
42
|
+
| m99 | Invented run | 3 |
|
|
43
|
+
| m01 | Refactor A | 600 |
|
|
44
|
+
|
|
45
|
+
### Assumptions
|
|
46
|
+
|
|
47
|
+
| Assumption | Impact if wrong |
|
|
48
|
+
| --- | --- |
|
|
49
|
+
| Existing CI pipeline stays as is | validation task grows |
|
|
50
|
+
|
|
51
|
+
### Risks
|
|
52
|
+
|
|
53
|
+
| Risk | Probability | Impact (min) | Reason |
|
|
54
|
+
| --- | --- | --- | --- |
|
|
55
|
+
| SDK incompatibility | 30% | 30 | |
|
package/plugins/solution-architect/skills/estimate/scripts/test/fixtures/agentic-estimation-pass.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Booking Revamp — Estimation
|
|
2
|
+
|
|
3
|
+
## Summary
|
|
4
|
+
|
|
5
|
+
Delivery: agentic (claude-code + sonnet) · Baselines: 20 measurements, 3 shapes matched
|
|
6
|
+
|
|
7
|
+
| Feature | Tier | src |
|
|
8
|
+
| --- | --- | --- |
|
|
9
|
+
| Planning | S | proposed |
|
|
10
|
+
| API client swap | S | stated |
|
|
11
|
+
|
|
12
|
+
| Line | Hours |
|
|
13
|
+
| --- | --- |
|
|
14
|
+
| Spread buffer | 0.25 |
|
|
15
|
+
| Risk buffer | 0.15 |
|
|
16
|
+
|
|
17
|
+
### Out of scope
|
|
18
|
+
|
|
19
|
+
- Anything not listed above.
|
|
20
|
+
|
|
21
|
+
## Estimation detail
|
|
22
|
+
|
|
23
|
+
Calibration: 20 measurement records; 1 of 4 tasks uncalibrated.
|
|
24
|
+
|
|
25
|
+
| Task | Baseline (min) | Samples | Match | Confidence | Assumptions | src |
|
|
26
|
+
| --- | --- | --- | --- | --- | --- | --- |
|
|
27
|
+
| plan-refactor | 47.5 | 2 | global shape | LOW | none | proposed |
|
|
28
|
+
| swap-refactor | 11 | 7 | repo+agent+model | MED | old client has no dynamic call sites | stated |
|
|
29
|
+
| swap-tests | 10 | 10 | repo+agent+model | HIGH | none | proposed |
|
|
30
|
+
| swap-db | not estimated | 0 | none | UNCALIBRATED | none | proposed |
|
|
31
|
+
|
|
32
|
+
| Scenario | Months | Total cost |
|
|
33
|
+
| --- | --- | --- |
|
|
34
|
+
| solo | 0.02 | $208.43 |
|
|
35
|
+
| pair | 0.01 | $195.12 |
|
|
36
|
+
|
|
37
|
+
### Evidence
|
|
38
|
+
|
|
39
|
+
| Id | Task | Actual (min) |
|
|
40
|
+
| --- | --- | --- |
|
|
41
|
+
| m01 | Refactor A | 6 |
|
|
42
|
+
| m02 | Refactor B | 8 |
|
|
43
|
+
|
|
44
|
+
### Assumptions
|
|
45
|
+
|
|
46
|
+
| Assumption | Impact if wrong |
|
|
47
|
+
| --- | --- |
|
|
48
|
+
| Existing CI pipeline stays as is | validation task grows |
|
|
49
|
+
|
|
50
|
+
### Risks
|
|
51
|
+
|
|
52
|
+
| Risk | Probability | Impact (min) | Reason |
|
|
53
|
+
| --- | --- | --- | --- |
|
|
54
|
+
| SDK incompatibility | 30% | 30 | new SDK may break integration test mocks |
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"project": "Booking revamp",
|
|
3
|
+
"deliveryMode": "agentic",
|
|
4
|
+
"technique": "measurement-based",
|
|
5
|
+
"depth": "STANDARD",
|
|
6
|
+
"agentContext": { "agent": "claude-code", "model": "sonnet", "repository": "project-a" },
|
|
7
|
+
"measurementsPath": "FIXTURE_MEASUREMENTS",
|
|
8
|
+
"overheadPct": 0.1,
|
|
9
|
+
"assumptions": ["Existing CI pipeline stays as is"],
|
|
10
|
+
"risks": [
|
|
11
|
+
{ "name": "SDK incompatibility", "probability": 0.3, "impactMinutes": 30, "reason": "new SDK may break integration test mocks" }
|
|
12
|
+
],
|
|
13
|
+
"features": [
|
|
14
|
+
{
|
|
15
|
+
"id": "plan", "name": "Planning", "provenance": "proposed",
|
|
16
|
+
"tasks": [
|
|
17
|
+
{ "id": "plan-refactor", "shape": "planning", "model": "opus",
|
|
18
|
+
"scope": {}, "seedMinutes": { "o": 20, "m": 40, "p": 80 },
|
|
19
|
+
"assumptions": [], "provenance": "proposed" }
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"id": "client-swap", "name": "API client swap", "provenance": "stated",
|
|
24
|
+
"tasks": [
|
|
25
|
+
{ "id": "swap-refactor", "shape": "cross_file_refactor",
|
|
26
|
+
"scope": { "affectedFiles": 8, "complexity": "low" },
|
|
27
|
+
"seedMinutes": { "o": 10, "m": 20, "p": 45 },
|
|
28
|
+
"assumptions": ["old client has no dynamic call sites"], "provenance": "stated" },
|
|
29
|
+
{ "id": "swap-tests", "shape": "test_creation",
|
|
30
|
+
"scope": { "affectedFiles": 2, "complexity": "low" },
|
|
31
|
+
"seedMinutes": { "o": 5, "m": 10, "p": 20 },
|
|
32
|
+
"assumptions": [], "provenance": "proposed" },
|
|
33
|
+
{ "id": "swap-db", "shape": "database_change",
|
|
34
|
+
"scope": { "affectedFiles": 2, "complexity": "med" },
|
|
35
|
+
"seedMinutes": { "o": 15, "m": 30, "p": 60 },
|
|
36
|
+
"assumptions": [], "provenance": "proposed" }
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
"scenarios": [
|
|
41
|
+
{ "id": "solo", "plan": "max5x", "team": [{ "seniority": "senior", "rate": 90 }] },
|
|
42
|
+
{ "id": "pair", "plan": "max20x", "team": [{ "seniority": "senior", "rate": 90 }, { "seniority": "mid", "rate": 60 }] }
|
|
43
|
+
],
|
|
44
|
+
"recommendedScenario": "solo"
|
|
45
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{"task_id":"m01","task_description":"Refactor A","task_shape":"cross_file_refactor","repository":"project-a","agent":"claude-code","model":"sonnet","affected_files":9,"actual_minutes":6,"created_at":"2026-08-01T10:00:00Z"}
|
|
2
|
+
{"task_id":"m02","task_description":"Refactor B","task_shape":"cross_file_refactor","repository":"project-a","agent":"claude-code","model":"sonnet","affected_files":8,"actual_minutes":8,"created_at":"2026-08-02T10:00:00Z"}
|
|
3
|
+
{"task_id":"m03","task_description":"Refactor C","task_shape":"cross_file_refactor","repository":"project-a","agent":"claude-code","model":"sonnet","affected_files":10,"actual_minutes":9,"created_at":"2026-08-03T10:00:00Z"}
|
|
4
|
+
{"task_id":"m04","task_description":"Refactor D","task_shape":"cross_file_refactor","repository":"project-a","agent":"claude-code","model":"sonnet","affected_files":7,"actual_minutes":11,"created_at":"2026-08-04T10:00:00Z"}
|
|
5
|
+
{"task_id":"m05","task_description":"Refactor E","task_shape":"cross_file_refactor","repository":"project-a","agent":"claude-code","model":"sonnet","affected_files":8,"actual_minutes":12,"created_at":"2026-08-05T10:00:00Z"}
|
|
6
|
+
{"task_id":"m06","task_description":"Refactor F","task_shape":"cross_file_refactor","repository":"project-a","agent":"claude-code","model":"sonnet","affected_files":12,"actual_minutes":19,"created_at":"2026-08-06T10:00:00Z"}
|
|
7
|
+
{"task_id":"m07","task_description":"Refactor G","task_shape":"cross_file_refactor","repository":"project-a","agent":"claude-code","model":"sonnet","affected_files":9,"actual_minutes":34,"created_at":"2026-08-07T10:00:00Z"}
|
|
8
|
+
{"task_id":"m08","task_description":"Tests A","task_shape":"test_creation","repository":"project-a","agent":"claude-code","model":"sonnet","affected_files":2,"actual_minutes":8,"created_at":"2026-08-08T10:00:00Z"}
|
|
9
|
+
{"task_id":"m09","task_description":"Tests B","task_shape":"test_creation","repository":"project-a","agent":"claude-code","model":"sonnet","affected_files":2,"actual_minutes":9,"created_at":"2026-08-08T11:00:00Z"}
|
|
10
|
+
{"task_id":"m10","task_description":"Tests C","task_shape":"test_creation","repository":"project-a","agent":"claude-code","model":"sonnet","affected_files":3,"actual_minutes":9,"created_at":"2026-08-08T12:00:00Z"}
|
|
11
|
+
{"task_id":"m11","task_description":"Tests D","task_shape":"test_creation","repository":"project-a","agent":"claude-code","model":"sonnet","affected_files":2,"actual_minutes":10,"created_at":"2026-08-08T13:00:00Z"}
|
|
12
|
+
{"task_id":"m12","task_description":"Tests E","task_shape":"test_creation","repository":"project-a","agent":"claude-code","model":"sonnet","affected_files":1,"actual_minutes":10,"created_at":"2026-08-08T14:00:00Z"}
|
|
13
|
+
{"task_id":"m13","task_description":"Tests F","task_shape":"test_creation","repository":"project-a","agent":"claude-code","model":"sonnet","affected_files":2,"actual_minutes":10,"created_at":"2026-08-08T15:00:00Z"}
|
|
14
|
+
{"task_id":"m14","task_description":"Tests G","task_shape":"test_creation","repository":"project-a","agent":"claude-code","model":"sonnet","affected_files":3,"actual_minutes":11,"created_at":"2026-08-08T16:00:00Z"}
|
|
15
|
+
{"task_id":"m15","task_description":"Tests H","task_shape":"test_creation","repository":"project-a","agent":"claude-code","model":"sonnet","affected_files":2,"actual_minutes":11,"created_at":"2026-08-08T17:00:00Z"}
|
|
16
|
+
{"task_id":"m16","task_description":"Tests I","task_shape":"test_creation","repository":"project-a","agent":"claude-code","model":"sonnet","affected_files":2,"actual_minutes":12,"created_at":"2026-08-08T18:00:00Z"}
|
|
17
|
+
{"task_id":"m17","task_description":"Tests J","task_shape":"test_creation","repository":"project-a","agent":"claude-code","model":"sonnet","affected_files":4,"actual_minutes":13,"created_at":"2026-08-08T19:00:00Z"}
|
|
18
|
+
{"task_id":"m18","task_description":"Plan payment work","task_shape":"planning","repository":"project-b","agent":"claude-code","model":"opus","affected_files":0,"actual_minutes":55,"created_at":"2026-08-10T10:00:00Z"}
|
|
19
|
+
{"task_id":"m19","task_description":"Plan search work","task_shape":"planning","repository":"project-b","agent":"claude-code","model":"opus","affected_files":0,"actual_minutes":40,"created_at":"2026-08-11T10:00:00Z"}
|
|
20
|
+
{"task_id":"m20","task_description":"Cursor config tweak","task_shape":"configuration","repository":"project-c","agent":"cursor","model":"gpt","affected_files":1,"actual_minutes":7,"created_at":"2026-08-12T10:00:00Z"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { test } from 'node:test';
|
|
2
|
+
import assert from 'node:assert/strict';
|
|
3
|
+
import { writeFileSync, mkdtempSync } from 'node:fs';
|
|
4
|
+
import { tmpdir, homedir } from 'node:os';
|
|
5
|
+
import { join } from 'node:path';
|
|
6
|
+
import {
|
|
7
|
+
TASK_SHAPES, DEFAULT_MEASUREMENTS_PATH, expandHome, resolveMeasurementsPath,
|
|
8
|
+
checkMeasurement, loadMeasurements,
|
|
9
|
+
} from '../lib/measurements.mjs';
|
|
10
|
+
|
|
11
|
+
const fixturePath = new URL('./fixtures/measurements.jsonl', import.meta.url).pathname;
|
|
12
|
+
|
|
13
|
+
test('taxonomy carries the 13 spec shapes', () => {
|
|
14
|
+
assert.equal(TASK_SHAPES.length, 13);
|
|
15
|
+
for (const s of ['cross_file_refactor', 'planning', 'investigation', 'bug_fix']) {
|
|
16
|
+
assert.ok(TASK_SHAPES.includes(s), s);
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
test('expandHome resolves ~/ against the home directory', () => {
|
|
21
|
+
assert.equal(expandHome('~/.agents-rock/m.jsonl'), join(homedir(), '.agents-rock/m.jsonl'));
|
|
22
|
+
assert.equal(expandHome('/abs/path.jsonl'), '/abs/path.jsonl');
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
test('resolveMeasurementsPath prefers inputs override, else global default', () => {
|
|
26
|
+
assert.equal(resolveMeasurementsPath({ measurementsPath: '/x.jsonl' }), '/x.jsonl');
|
|
27
|
+
assert.equal(resolveMeasurementsPath({}), expandHome(DEFAULT_MEASUREMENTS_PATH));
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
test('checkMeasurement: valid record passes, bad fields are errors, unknown shape is a warning', () => {
|
|
31
|
+
const good = { task_shape: 'bug_fix', repository: 'r', agent: 'a', model: 'm', actual_minutes: 5 };
|
|
32
|
+
assert.deepEqual(checkMeasurement(good), { errors: [], warnings: [] });
|
|
33
|
+
const bad = checkMeasurement({ task_shape: 'bug_fix', repository: '', agent: 'a', model: 'm', actual_minutes: 0 });
|
|
34
|
+
assert.equal(bad.errors.length, 2); // repository empty, actual_minutes not positive
|
|
35
|
+
const odd = checkMeasurement({ ...good, task_shape: 'quantum_reticulation' });
|
|
36
|
+
assert.deepEqual(odd.errors, []);
|
|
37
|
+
assert.equal(odd.warnings.length, 1);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
test('loadMeasurements: missing file is empty, corrupt/invalid lines are skipped with warnings', () => {
|
|
41
|
+
assert.deepEqual(loadMeasurements('/nonexistent/nowhere.jsonl'), { records: [], warnings: [] });
|
|
42
|
+
const dir = mkdtempSync(join(tmpdir(), 'meas-'));
|
|
43
|
+
const p = join(dir, 'm.jsonl');
|
|
44
|
+
writeFileSync(p, `${JSON.stringify({ task_shape: 'bug_fix', repository: 'r', agent: 'a', model: 'm', actual_minutes: 5 })}\nnot json\n${JSON.stringify({ task_shape: 'bug_fix', repository: 'r', agent: 'a', model: 'm', actual_minutes: -1 })}\n`);
|
|
45
|
+
const { records, warnings } = loadMeasurements(p);
|
|
46
|
+
assert.equal(records.length, 1);
|
|
47
|
+
assert.equal(warnings.length, 2);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
test('the shipped fixture is fully valid', () => {
|
|
51
|
+
const { records, warnings } = loadMeasurements(fixturePath);
|
|
52
|
+
assert.equal(records.length, 20);
|
|
53
|
+
assert.deepEqual(warnings, []);
|
|
54
|
+
});
|
|
@@ -2,9 +2,11 @@ import { test } from 'node:test';
|
|
|
2
2
|
import assert from 'node:assert/strict';
|
|
3
3
|
import { readFileSync } from 'node:fs';
|
|
4
4
|
import { AI_CATEGORIES, PLAN_PRICES, TIER_BREAKS } from '../lib/estimate-math.mjs';
|
|
5
|
+
import { TASK_SHAPES } from '../lib/measurements.mjs';
|
|
5
6
|
|
|
6
7
|
const ref = (f) => readFileSync(new URL(`../../references/${f}`, import.meta.url), 'utf8');
|
|
7
|
-
const ALL = ['interview.md', 'techniques.md', 'ai-multipliers.md', 'writing.md', 'slicing.md'
|
|
8
|
+
const ALL = ['interview.md', 'techniques.md', 'ai-multipliers.md', 'writing.md', 'slicing.md',
|
|
9
|
+
'task-shapes.md', 'agentic-estimation.md'];
|
|
8
10
|
|
|
9
11
|
test('no reference doc carries placeholders', () => {
|
|
10
12
|
for (const f of ALL) assert.doesNotMatch(ref(f), /\bTBD\b|\bTODO\b/, f);
|
|
@@ -56,6 +58,28 @@ test('slicing.md carries the vertical-slice rules and split patterns', () => {
|
|
|
56
58
|
assert.ok(/## Sources/.test(doc), 'slicing.md missing Sources section');
|
|
57
59
|
});
|
|
58
60
|
|
|
61
|
+
test('task-shapes.md names every shape in the code taxonomy', () => {
|
|
62
|
+
const doc = ref('task-shapes.md');
|
|
63
|
+
for (const shape of TASK_SHAPES) assert.ok(doc.includes(shape), `task-shapes.md missing: ${shape}`);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
test('agentic-estimation.md states ladder, math bands, confidence, and sources', () => {
|
|
67
|
+
const doc = ref('agentic-estimation.md');
|
|
68
|
+
for (const needle of ['repo', 'lognormal', '1.645', 'UNCALIBRATED', 'planning',
|
|
69
|
+
'means sum', 'impactMinutes', 'measurements.jsonl']) {
|
|
70
|
+
assert.ok(doc.includes(needle), `agentic-estimation.md missing: ${needle}`);
|
|
71
|
+
}
|
|
72
|
+
assert.ok(/## Sources/.test(doc));
|
|
73
|
+
for (const src of ['erikbern.com', 'Vacanti', 'atomicobject.com']) assert.ok(doc.includes(src), src);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
test('interview.md carries the delivery-mode fork', () => {
|
|
77
|
+
const doc = ref('interview.md');
|
|
78
|
+
for (const needle of ['Delivery mode', 'TRADITIONAL', 'AGENTIC', 'agentContext', 'seed']) {
|
|
79
|
+
assert.ok(doc.includes(needle), `interview.md missing: ${needle}`);
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
|
|
59
83
|
test('method sources are cited where techniques are recommended', () => {
|
|
60
84
|
const SOURCES = {
|
|
61
85
|
'techniques.md': ['atomicobject.com', 'kmino.io', 'Modular-Earth'],
|
|
@@ -11,6 +11,9 @@ const cli = new URL('../render.mjs', import.meta.url).pathname;
|
|
|
11
11
|
const fixture = new URL('./fixtures/booking-inputs.json', import.meta.url).pathname;
|
|
12
12
|
const passMd = new URL('./fixtures/estimation-pass.md', import.meta.url).pathname;
|
|
13
13
|
const computeCli = new URL('../compute.mjs', import.meta.url).pathname;
|
|
14
|
+
const agenticFixture = new URL('./fixtures/agentic-inputs.json', import.meta.url).pathname;
|
|
15
|
+
const agenticPassMd = new URL('./fixtures/agentic-estimation-pass.md', import.meta.url).pathname;
|
|
16
|
+
const measurementsFixture = new URL('./fixtures/measurements.jsonl', import.meta.url).pathname;
|
|
14
17
|
|
|
15
18
|
function renderedPage(extra = []) {
|
|
16
19
|
const dir = mkdtempSync(join(tmpdir(), 'estimate-render-'));
|
|
@@ -20,6 +23,20 @@ function renderedPage(extra = []) {
|
|
|
20
23
|
return readFileSync(join(dir, 'estimate.html'), 'utf8');
|
|
21
24
|
}
|
|
22
25
|
|
|
26
|
+
// Agentic fixtures point measurementsPath at the shared fixture file, same
|
|
27
|
+
// as validate.test.mjs's agenticEstimation() helper.
|
|
28
|
+
function renderAgentic({ clientOnly = false } = {}) {
|
|
29
|
+
const dir = mkdtempSync(join(tmpdir(), 'estimate-render-agentic-'));
|
|
30
|
+
const inputs = JSON.parse(readFileSync(agenticFixture, 'utf8'));
|
|
31
|
+
inputs.measurementsPath = measurementsFixture;
|
|
32
|
+
const inputsPath = join(dir, 'inputs.json');
|
|
33
|
+
writeFileSync(inputsPath, JSON.stringify(inputs));
|
|
34
|
+
const json = join(dir, 'estimation.json');
|
|
35
|
+
execFileSync('node', [computeCli, '--inputs', inputsPath, '--out', json]);
|
|
36
|
+
execFileSync('node', [cli, '--json', json, '--md', agenticPassMd, '--out', dir, ...(clientOnly ? ['--client-only'] : [])]);
|
|
37
|
+
return readFileSync(join(dir, 'estimate.html'), 'utf8');
|
|
38
|
+
}
|
|
39
|
+
|
|
23
40
|
test('render refuses a deliverable that fails validation', () => {
|
|
24
41
|
const failMd = new URL('./fixtures/estimation-fail.md', import.meta.url).pathname;
|
|
25
42
|
const dir = mkdtempSync(join(tmpdir(), 'estimate-render-'));
|
|
@@ -31,7 +48,9 @@ test('render refuses a deliverable that fails validation', () => {
|
|
|
31
48
|
test('template carries exactly the five slots and no external URLs', () => {
|
|
32
49
|
const markers = [...tpl().matchAll(/<!-- slot:(\w+) -->/g)].map((m) => m[1]).sort();
|
|
33
50
|
assert.deepEqual([...new Set(markers)], ['DATA', 'FONTS', 'MATH', 'TITLE', 'VIEWER']);
|
|
34
|
-
|
|
51
|
+
// openxmlformats URIs are XML namespace identifiers the xlsx export writes
|
|
52
|
+
// into generated sheets — never fetched, so the page stays self-contained.
|
|
53
|
+
assert.doesNotMatch(tpl(), /https?:\/\/(?!www\.w3\.org|schemas\.openxmlformats\.org)/);
|
|
35
54
|
});
|
|
36
55
|
|
|
37
56
|
// Companion mode: the analyze-requirements viewer links this page, and this page links
|
|
@@ -119,3 +138,31 @@ test('the rendered page carries the roadmap section markup', () => {
|
|
|
119
138
|
assert.match(html, /id="roadmap"/);
|
|
120
139
|
assert.match(html, /roadmapRow|roadmap-row/); // renderer present, not stripped
|
|
121
140
|
});
|
|
141
|
+
|
|
142
|
+
// Agentic template routing.
|
|
143
|
+
test('agentic estimation renders the agentic template', () => {
|
|
144
|
+
const html = renderAgentic();
|
|
145
|
+
assert.match(html, /Delivery: agentic/);
|
|
146
|
+
assert.match(html, /UNCALIBRATED/);
|
|
147
|
+
assert.match(html, /Refactor A/); // evidence rendered from computed data
|
|
148
|
+
assert.doesNotMatch(html, /boilerplate/); // no AI-category machinery on this page
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
test('agentic client render still redacts rates', () => {
|
|
152
|
+
const html = renderAgentic({ clientOnly: true });
|
|
153
|
+
assert.doesNotMatch(html, /"rate":/);
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
test('agentic client render strips the measurements path, repository, and evidence descriptions', () => {
|
|
157
|
+
const full = renderAgentic();
|
|
158
|
+
assert.match(full, new RegExp(measurementsFixture.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')));
|
|
159
|
+
assert.match(full, /"repository":"project-a"/);
|
|
160
|
+
assert.match(full, /Refactor A/);
|
|
161
|
+
|
|
162
|
+
const client = renderAgentic({ clientOnly: true });
|
|
163
|
+
assert.doesNotMatch(client, new RegExp(measurementsFixture.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')));
|
|
164
|
+
assert.doesNotMatch(client, /"measurementsPath":/);
|
|
165
|
+
assert.doesNotMatch(client, /"repository":/);
|
|
166
|
+
assert.doesNotMatch(client, /Refactor A/);
|
|
167
|
+
assert.doesNotMatch(client, />undefined</); // renderEvidence tolerates a stripped description
|
|
168
|
+
});
|
|
@@ -127,3 +127,62 @@ test('a blank milestone is refused; none at all is fine', () => {
|
|
|
127
127
|
for (const f of bare.features) delete f.milestone;
|
|
128
128
|
assert.deepEqual(checkInputs(bare), []); // no milestones at all → still valid
|
|
129
129
|
});
|
|
130
|
+
|
|
131
|
+
// Agentic-mode schema branch.
|
|
132
|
+
const agenticFixturePath = new URL('./fixtures/agentic-inputs.json', import.meta.url).pathname;
|
|
133
|
+
const agenticFixture = () => JSON.parse(readFileSync(agenticFixturePath, 'utf8'));
|
|
134
|
+
|
|
135
|
+
test('agentic fixture validates clean', () => {
|
|
136
|
+
assert.deepEqual(checkInputs(agenticFixture()), []);
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
test('agentic tasks reject team-mode and script-owned fields', () => {
|
|
140
|
+
const inputs = agenticFixture();
|
|
141
|
+
Object.assign(inputs.features[1].tasks[0], { category: 'boilerplate', confidence: 'HIGH', o: 1, m: 2, p: 3 });
|
|
142
|
+
const findings = checkInputs(inputs);
|
|
143
|
+
for (const banned of ['category', 'confidence', '"o"', '"m"', '"p"']) {
|
|
144
|
+
assert.ok(findings.some((f) => f.includes(banned)), `expected finding for ${banned}: ${findings}`);
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
test('agentic tasks require shape, scope, ordered positive seedMinutes', () => {
|
|
149
|
+
const inputs = agenticFixture();
|
|
150
|
+
const task = inputs.features[1].tasks[0];
|
|
151
|
+
task.shape = 'jazz_hands';
|
|
152
|
+
task.seedMinutes = { o: 45, m: 20, p: 10 };
|
|
153
|
+
delete task.scope;
|
|
154
|
+
const findings = checkInputs(inputs);
|
|
155
|
+
assert.ok(findings.some((f) => f.includes('unknown shape')));
|
|
156
|
+
assert.ok(findings.some((f) => f.includes('seedMinutes')));
|
|
157
|
+
assert.ok(findings.some((f) => f.includes('scope')));
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
test('agentic mode requires agentContext and minute-based risks with reasons', () => {
|
|
161
|
+
const inputs = agenticFixture();
|
|
162
|
+
delete inputs.agentContext;
|
|
163
|
+
inputs.risks = [{ name: 'r', probability: 0.5, impactHours: 2 }];
|
|
164
|
+
const findings = checkInputs(inputs);
|
|
165
|
+
assert.ok(findings.some((f) => f.includes('agentContext')));
|
|
166
|
+
assert.ok(findings.some((f) => f.includes('impactMinutes')));
|
|
167
|
+
assert.ok(findings.some((f) => f.includes('reason')));
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
test('agentContext.repository, when present, must be a non-empty string', () => {
|
|
171
|
+
const inputs = agenticFixture();
|
|
172
|
+
inputs.agentContext.repository = '';
|
|
173
|
+
const findings = checkInputs(inputs);
|
|
174
|
+
assert.ok(findings.some((f) => f.includes('agentContext.repository')));
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
test('agentContext.repository is optional', () => {
|
|
178
|
+
const inputs = agenticFixture();
|
|
179
|
+
delete inputs.agentContext.repository;
|
|
180
|
+
assert.deepEqual(checkInputs(inputs), []);
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
test('deliveryMode vocabulary is enforced; team inputs stay valid', () => {
|
|
184
|
+
const inputs = agenticFixture();
|
|
185
|
+
inputs.deliveryMode = 'vibes';
|
|
186
|
+
assert.ok(checkInputs(inputs).some((f) => f.includes('deliveryMode')));
|
|
187
|
+
assert.deepEqual(checkInputs(fixture()), []); // existing booking fixture untouched
|
|
188
|
+
});
|
|
@@ -4,6 +4,7 @@ import { readFileSync } from 'node:fs';
|
|
|
4
4
|
import { execFileSync } from 'node:child_process';
|
|
5
5
|
import { checkDeliverables } from '../lib/checks.mjs';
|
|
6
6
|
import { computeEstimation } from '../lib/rollup.mjs';
|
|
7
|
+
import { loadMeasurements } from '../lib/measurements.mjs';
|
|
7
8
|
|
|
8
9
|
const read = (f) => readFileSync(new URL(`./fixtures/${f}`, import.meta.url), 'utf8');
|
|
9
10
|
const inputs = () => JSON.parse(read('booking-inputs.json'));
|
|
@@ -70,3 +71,39 @@ test('the roadmap honesty line is mandatory', () => {
|
|
|
70
71
|
const findings = checkDeliverables({ md, estimation: computeEstimation(inputs()) });
|
|
71
72
|
assert.ok(findings.some((f) => f.includes('not calendar dates')));
|
|
72
73
|
});
|
|
74
|
+
|
|
75
|
+
// Agentic deliverable checks.
|
|
76
|
+
const agenticMd = (f) => readFileSync(new URL(`./fixtures/${f}`, import.meta.url).pathname, 'utf8');
|
|
77
|
+
const measurementsFixture = new URL('./fixtures/measurements.jsonl', import.meta.url).pathname;
|
|
78
|
+
|
|
79
|
+
function agenticEstimation() {
|
|
80
|
+
const agenticInputs = JSON.parse(
|
|
81
|
+
readFileSync(new URL('./fixtures/agentic-inputs.json', import.meta.url).pathname, 'utf8'));
|
|
82
|
+
agenticInputs.measurementsPath = measurementsFixture;
|
|
83
|
+
return computeEstimation(agenticInputs, loadMeasurements(measurementsFixture).records);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
test('agentic pass fixture validates clean', () => {
|
|
87
|
+
assert.deepEqual(checkDeliverables({ md: agenticMd('agentic-estimation-pass.md'), estimation: agenticEstimation() }), []);
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
test('agentic fail fixture trips every enforcement rule', () => {
|
|
91
|
+
const findings = checkDeliverables({ md: agenticMd('agentic-estimation-fail.md'), estimation: agenticEstimation() });
|
|
92
|
+
assert.ok(findings.some((f) => /vague estimate language/.test(f)), 'vague range');
|
|
93
|
+
assert.ok(findings.some((f) => /uncalibrated/i.test(f)), 'uncalibrated masked as measured');
|
|
94
|
+
assert.ok(findings.some((f) => /evidence/i.test(f) && /m99/.test(f)), 'invented evidence');
|
|
95
|
+
assert.ok(findings.some((f) => /evidence/i.test(f) && /m01/.test(f) && /600/.test(f)), 'wrong evidence minutes');
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
test('agentic estimation without a planning task is refused', () => {
|
|
99
|
+
const estimation = agenticEstimation();
|
|
100
|
+
estimation.inputs.features = estimation.inputs.features.filter((f) => f.id !== 'plan');
|
|
101
|
+
const findings = checkDeliverables({ md: agenticMd('agentic-estimation-pass.md'), estimation });
|
|
102
|
+
assert.ok(findings.some((f) => /planning/.test(f)));
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
test('missing Delivery header line is a finding', () => {
|
|
106
|
+
const md = agenticMd('agentic-estimation-pass.md').replace(/Delivery: agentic.*\n/, '');
|
|
107
|
+
const findings = checkDeliverables({ md, estimation: agenticEstimation() });
|
|
108
|
+
assert.ok(findings.some((f) => /Delivery:/.test(f)));
|
|
109
|
+
});
|