cc-devflow 4.5.10 → 4.5.12
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/.claude/skills/cc-act/CHANGELOG.md +23 -0
- package/.claude/skills/cc-act/PLAYBOOK.md +17 -269
- package/.claude/skills/cc-act/SKILL.md +38 -418
- package/.claude/skills/cc-act/assets/PROJECT_POSTMORTEM_INDEX_TEMPLATE.md +2 -13
- package/.claude/skills/cc-act/assets/PROJECT_POSTMORTEM_TEMPLATE.md +1 -9
- package/.claude/skills/cc-act/assets/PR_BRIEF_TEMPLATE.md +21 -177
- package/.claude/skills/cc-act/references/closure-contract.md +12 -63
- package/.claude/skills/cc-act/references/git-commit-guidelines.md +5 -5
- package/.claude/skills/cc-act/scripts/cc-act-common.sh +5 -322
- package/.claude/skills/cc-act/scripts/detect-ship-target.sh +11 -2
- package/.claude/skills/cc-act/scripts/inspect-git-index.sh +58 -0
- package/.claude/skills/cc-act/scripts/render-pr-brief.sh +40 -440
- package/.claude/skills/cc-act/scripts/verify-act-gate.sh +10 -50
- package/.claude/skills/cc-check/CHANGELOG.md +24 -0
- package/.claude/skills/cc-check/PLAYBOOK.md +19 -273
- package/.claude/skills/cc-check/SKILL.md +33 -454
- package/.claude/skills/cc-check/references/review-contract.md +12 -147
- package/.claude/skills/cc-dev/CHANGELOG.md +20 -0
- package/.claude/skills/cc-dev/PLAYBOOK.md +1 -1
- package/.claude/skills/cc-dev/SKILL.md +52 -130
- package/.claude/skills/cc-dev/scripts/resolve-cc-devflow.sh +181 -0
- package/.claude/skills/cc-do/CHANGELOG.md +17 -0
- package/.claude/skills/cc-do/PLAYBOOK.md +19 -113
- package/.claude/skills/cc-do/SKILL.md +39 -236
- package/.claude/skills/cc-do/references/execution-recovery.md +15 -109
- package/.claude/skills/cc-do/scripts/cc-do-common.sh +5 -57
- package/.claude/skills/cc-do/scripts/check-task-status.sh +35 -65
- package/.claude/skills/cc-do/scripts/mark-task-complete.sh +9 -46
- package/.claude/skills/cc-do/scripts/select-ready-tasks.sh +29 -97
- package/.claude/skills/cc-investigate/CHANGELOG.md +23 -0
- package/.claude/skills/cc-investigate/PLAYBOOK.md +20 -180
- package/.claude/skills/cc-investigate/SKILL.md +65 -513
- package/.claude/skills/cc-investigate/assets/TASKS_TEMPLATE.md +48 -95
- package/.claude/skills/cc-investigate/references/investigation-contract.md +14 -217
- package/.claude/skills/cc-next/CHANGELOG.md +6 -0
- package/.claude/skills/cc-next/PLAYBOOK.md +12 -8
- package/.claude/skills/cc-next/SKILL.md +34 -140
- package/.claude/skills/cc-plan/CHANGELOG.md +29 -0
- package/.claude/skills/cc-plan/PLAYBOOK.md +22 -161
- package/.claude/skills/cc-plan/SKILL.md +47 -640
- package/.claude/skills/cc-plan/assets/TASKS_TEMPLATE.md +30 -225
- package/.claude/skills/cc-plan/references/planning-contract.md +24 -160
- package/.claude/skills/cc-plan/scripts/next-change-key.sh +8 -44
- package/.claude/skills/cc-plan/scripts/parse-task-dependencies.js +2 -2
- package/.claude/skills/cc-plan/scripts/validate-scope.sh +1 -1
- package/.claude/skills/cc-pr-land/SKILL.md +14 -114
- package/.claude/skills/cc-pr-review/CHANGELOG.md +4 -0
- package/.claude/skills/cc-pr-review/SKILL.md +20 -103
- package/.claude/skills/cc-review/CHANGELOG.md +17 -0
- package/.claude/skills/cc-review/PLAYBOOK.md +13 -86
- package/.claude/skills/cc-review/SKILL.md +53 -241
- package/.claude/skills/cc-review/references/e2e-and-plugin-verification.md +2 -2
- package/.claude/skills/cc-review/references/implementation-review-branch.md +7 -147
- package/.claude/skills/cc-review/references/plan-review-branch.md +5 -147
- package/.claude/skills/cc-review/references/review-methods.md +10 -218
- package/.claude/skills/cc-review/scripts/collect-review-context.sh +4 -63
- package/.claude/skills/cc-roadmap/PLAYBOOK.md +1 -1
- package/.claude/skills/cc-roadmap/SKILL.md +3 -3
- package/.claude/skills/cc-simplify/CHANGELOG.md +7 -0
- package/.claude/skills/cc-simplify/SKILL.md +26 -21
- package/.claude/skills/cc-spec-init/PLAYBOOK.md +12 -48
- package/.claude/skills/cc-spec-init/SKILL.md +29 -132
- package/.claude/skills/cc-spec-init/references/spec-contract.md +8 -17
- package/CHANGELOG.md +27 -0
- package/README.md +5 -3
- package/README.zh-CN.md +5 -3
- package/bin/cc-devflow-cli.js +20 -260
- package/bin/cc-devflow.js +44 -7
- package/docs/commands/README.md +1 -1
- package/docs/commands/README.zh-CN.md +1 -1
- package/docs/examples/README.md +1 -1
- package/docs/examples/START-HERE.md +14 -14
- package/docs/examples/example-bindings.json +11 -11
- package/docs/examples/full-design-blocked/README.md +4 -6
- package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/{planning/tasks.md → task.md} +20 -15
- package/docs/examples/local-handoff/README.md +8 -11
- package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/handoff/pr-brief.md +31 -0
- package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/{planning/tasks.md → task.md} +18 -13
- package/docs/examples/pdca-loop/README.md +6 -9
- package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/handoff/pr-brief.md +9 -11
- package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/{planning/tasks.md → task.md} +18 -13
- package/docs/examples/scripts/check-example-bindings.sh +11 -62
- package/docs/guides/artifact-contract.md +10 -36
- package/docs/guides/getting-started.md +8 -7
- package/docs/guides/getting-started.zh-CN.md +8 -7
- package/docs/guides/minimize-artifacts.md +16 -116
- package/docs/guides/project-postmortem.md +14 -71
- package/lib/compiler/__tests__/skills-registry.test.js +9 -8
- package/lib/compiler/resource-copier.js +29 -0
- package/lib/skill-runtime/__tests__/archive-change.test.js +2 -2
- package/lib/skill-runtime/__tests__/benchmark-skills.test.js +109 -0
- package/lib/skill-runtime/__tests__/cli-bootstrap.integration.test.js +14 -4
- package/lib/skill-runtime/errors.js +3 -3
- package/lib/skill-runtime/index.js +5 -23
- package/lib/skill-runtime/paths.js +5 -52
- package/lib/skill-runtime/query-registry.js +4 -4
- package/lib/skill-runtime/query.js +89 -201
- package/lib/skill-runtime/store.js +4 -40
- package/lib/skill-runtime/trace.js +2 -2
- package/package.json +5 -7
- package/.claude/skills/cc-act/assets/PROJECT_POSTMORTEM_PRINCIPLES_TEMPLATE.md +0 -29
- package/.claude/skills/cc-act/assets/RELEASE_NOTE_TEMPLATE.md +0 -54
- package/.claude/skills/cc-act/scripts/generate-status-report.sh +0 -92
- package/.claude/skills/cc-act/scripts/sync-act-docs.sh +0 -355
- package/.claude/skills/cc-check/assets/REPORT_CARD_TEMPLATE.json +0 -234
- package/.claude/skills/cc-check/scripts/render-report-card.js +0 -438
- package/.claude/skills/cc-check/scripts/verify-gate.sh +0 -85
- package/.claude/skills/cc-do/scripts/build-task-context.sh +0 -175
- package/.claude/skills/cc-do/scripts/record-review-decision.sh +0 -88
- package/.claude/skills/cc-do/scripts/recover-workflow.sh +0 -82
- package/.claude/skills/cc-do/scripts/run-problem-analysis.sh +0 -70
- package/.claude/skills/cc-do/scripts/verify-task-gates.sh +0 -109
- package/.claude/skills/cc-do/scripts/write-task-checkpoint.sh +0 -92
- package/.claude/skills/cc-investigate/assets/TASK_MANIFEST_TEMPLATE.json +0 -225
- package/.claude/skills/cc-plan/assets/TASK_MANIFEST_TEMPLATE.json +0 -179
- package/.claude/skills/cc-spec-init/assets/CHANGE_META_TEMPLATE.json +0 -28
- package/.claude/skills/cc-spec-init/scripts/validate-spec-links.sh +0 -45
- package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/planning/design.md +0 -234
- package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/planning/task-manifest.json +0 -488
- package/docs/examples/full-design-blocked/changes/REQ-002-bulk-invite-import/review/report-card.json +0 -189
- package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/handoff/resume-index.md +0 -39
- package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/handoff/status.md +0 -29
- package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/planning/design.md +0 -123
- package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/planning/task-manifest.json +0 -292
- package/docs/examples/local-handoff/changes/REQ-003-audit-log-export/review/report-card.json +0 -136
- package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/handoff/status.md +0 -29
- package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/planning/design.md +0 -124
- package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/planning/task-manifest.json +0 -292
- package/docs/examples/pdca-loop/changes/REQ-001-copy-invite-link/review/report-card.json +0 -136
- package/docs/get-shit-done-strategy-audit.md +0 -518
- package/docs/skill-runtime-migration.md +0 -46
- package/lib/skill-runtime/__tests__/approve.test.js +0 -92
- package/lib/skill-runtime/__tests__/autopilot.test.js +0 -253
- package/lib/skill-runtime/__tests__/benchmark-artifacts.test.js +0 -165
- package/lib/skill-runtime/__tests__/delegation.test.js +0 -97
- package/lib/skill-runtime/__tests__/dispatch.test.js +0 -237
- package/lib/skill-runtime/__tests__/intent.test.js +0 -203
- package/lib/skill-runtime/__tests__/lifecycle.test.js +0 -169
- package/lib/skill-runtime/__tests__/planner.tdd.test.js +0 -331
- package/lib/skill-runtime/__tests__/prepare-pr.test.js +0 -126
- package/lib/skill-runtime/__tests__/query.test.js +0 -860
- package/lib/skill-runtime/__tests__/readiness.test.js +0 -53
- package/lib/skill-runtime/__tests__/release.test.js +0 -85
- package/lib/skill-runtime/__tests__/review-check-integration.test.js +0 -148
- package/lib/skill-runtime/__tests__/review-records.test.js +0 -619
- package/lib/skill-runtime/__tests__/runtime.integration.test.js +0 -351
- package/lib/skill-runtime/__tests__/schemas.test.js +0 -337
- package/lib/skill-runtime/__tests__/task-contract-migrate.test.js +0 -137
- package/lib/skill-runtime/__tests__/task-contract.test.js +0 -783
- package/lib/skill-runtime/__tests__/team-state.test.js +0 -51
- package/lib/skill-runtime/__tests__/verify-artifacts.test.js +0 -203
- package/lib/skill-runtime/__tests__/worker-run.test.js +0 -275
- package/lib/skill-runtime/__tests__/worker.test.js +0 -56
- package/lib/skill-runtime/__tests__/workflow-context-legacy-fallback.test.js +0 -31
- package/lib/skill-runtime/__tests__/workflow-context.test.js +0 -98
- package/lib/skill-runtime/artifacts.js +0 -88
- package/lib/skill-runtime/context-index.js +0 -545
- package/lib/skill-runtime/delegation.js +0 -533
- package/lib/skill-runtime/intent.js +0 -309
- package/lib/skill-runtime/lifecycle.js +0 -294
- package/lib/skill-runtime/operations/CLAUDE.md +0 -19
- package/lib/skill-runtime/operations/approve.js +0 -81
- package/lib/skill-runtime/operations/autopilot-core.js +0 -337
- package/lib/skill-runtime/operations/autopilot-execution.js +0 -307
- package/lib/skill-runtime/operations/autopilot-shared.js +0 -48
- package/lib/skill-runtime/operations/autopilot.js +0 -163
- package/lib/skill-runtime/operations/dispatch.js +0 -416
- package/lib/skill-runtime/operations/init.js +0 -60
- package/lib/skill-runtime/operations/janitor.js +0 -61
- package/lib/skill-runtime/operations/plan.js +0 -59
- package/lib/skill-runtime/operations/prepare-pr.js +0 -25
- package/lib/skill-runtime/operations/release.js +0 -99
- package/lib/skill-runtime/operations/resume.js +0 -126
- package/lib/skill-runtime/operations/review-records.js +0 -265
- package/lib/skill-runtime/operations/snapshot.js +0 -45
- package/lib/skill-runtime/operations/task-contract.js +0 -524
- package/lib/skill-runtime/operations/verify.js +0 -170
- package/lib/skill-runtime/operations/worker-run.js +0 -531
- package/lib/skill-runtime/operations/worker.js +0 -33
- package/lib/skill-runtime/planner.js +0 -539
- package/lib/skill-runtime/readiness.js +0 -84
- package/lib/skill-runtime/review-records.js +0 -123
- package/lib/skill-runtime/review.js +0 -855
- package/lib/skill-runtime/schemas.js +0 -746
- package/lib/skill-runtime/task-contract.js +0 -187
- package/lib/skill-runtime/team-state.js +0 -122
- package/lib/skill-runtime/workflow-context.js +0 -748
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
const {
|
|
2
|
-
assertShipReady,
|
|
3
|
-
deriveShipReadiness
|
|
4
|
-
} = require('../readiness');
|
|
5
|
-
|
|
6
|
-
describe('ship readiness', () => {
|
|
7
|
-
test('derives one shared readiness verdict from report-card truth', () => {
|
|
8
|
-
const report = {
|
|
9
|
-
verdict: 'pass',
|
|
10
|
-
overall: 'pass',
|
|
11
|
-
reroute: 'none',
|
|
12
|
-
specSyncReady: true,
|
|
13
|
-
blockingFindings: [],
|
|
14
|
-
gaps: [],
|
|
15
|
-
timestamp: '2026-03-25T01:11:00.000Z'
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
expect(deriveShipReadiness(report, { reportPath: '/tmp/report-card.json' })).toEqual({
|
|
19
|
-
ready: true,
|
|
20
|
-
verdict: 'pass',
|
|
21
|
-
reroute: 'none',
|
|
22
|
-
specSyncReady: true,
|
|
23
|
-
blockers: [],
|
|
24
|
-
reportPath: '/tmp/report-card.json',
|
|
25
|
-
timestamp: '2026-03-25T01:11:00.000Z'
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
test('throws named release errors from the same readiness blockers', () => {
|
|
30
|
-
const report = {
|
|
31
|
-
verdict: 'pass',
|
|
32
|
-
overall: 'pass',
|
|
33
|
-
reroute: 'cc-do',
|
|
34
|
-
specSyncReady: false,
|
|
35
|
-
blockingFindings: ['review: stale'],
|
|
36
|
-
gaps: ['spec gap'],
|
|
37
|
-
timestamp: '2026-03-25T01:11:00.000Z'
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
expect(() => assertShipReady(report, {
|
|
41
|
-
reportPath: '/tmp/report-card.json',
|
|
42
|
-
errorName: 'ReleaseReadinessError',
|
|
43
|
-
rescueAction: 'run cc-check until ship-readiness is ready before release'
|
|
44
|
-
})).toThrow(expect.objectContaining({
|
|
45
|
-
name: 'ReleaseReadinessError',
|
|
46
|
-
artifactRefs: ['/tmp/report-card.json'],
|
|
47
|
-
rescueAction: 'run cc-check until ship-readiness is ready before release',
|
|
48
|
-
details: {
|
|
49
|
-
blockers: ['reroute is cc-do', 'specSyncReady is not true', 'review: stale', 'spec gap']
|
|
50
|
-
}
|
|
51
|
-
}));
|
|
52
|
-
});
|
|
53
|
-
});
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const os = require('os');
|
|
3
|
-
const path = require('path');
|
|
4
|
-
|
|
5
|
-
const { runRelease } = require('../operations/release');
|
|
6
|
-
const {
|
|
7
|
-
getRuntimeStatePath,
|
|
8
|
-
getTaskManifestPath,
|
|
9
|
-
getReportCardPath,
|
|
10
|
-
getReleaseNotePath
|
|
11
|
-
} = require('../store');
|
|
12
|
-
|
|
13
|
-
function writeJson(filePath, value) {
|
|
14
|
-
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
15
|
-
fs.writeFileSync(filePath, `${JSON.stringify(value, null, 2)}\n`);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function writeReleaseFixture(repoRoot, reportOverrides = {}) {
|
|
19
|
-
writeJson(getRuntimeStatePath(repoRoot, 'REQ-123'), {
|
|
20
|
-
changeId: 'REQ-123',
|
|
21
|
-
goal: 'Release only when ship ready',
|
|
22
|
-
status: 'verified',
|
|
23
|
-
initializedAt: '2026-03-25T01:00:00.000Z',
|
|
24
|
-
plannedAt: '2026-03-25T01:01:00.000Z',
|
|
25
|
-
verifiedAt: '2026-03-25T01:02:00.000Z',
|
|
26
|
-
updatedAt: '2026-03-25T01:02:00.000Z'
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
writeJson(getTaskManifestPath(repoRoot, 'REQ-123'), {
|
|
30
|
-
changeId: 'REQ-123',
|
|
31
|
-
goal: 'Release only when ship ready',
|
|
32
|
-
createdAt: '2026-03-25T01:00:00.000Z',
|
|
33
|
-
updatedAt: '2026-03-25T01:02:00.000Z',
|
|
34
|
-
tasks: [
|
|
35
|
-
{
|
|
36
|
-
id: 'T001',
|
|
37
|
-
title: 'Finish change',
|
|
38
|
-
type: 'IMPL',
|
|
39
|
-
dependsOn: [],
|
|
40
|
-
touches: ['src/a.ts'],
|
|
41
|
-
run: ['echo ok'],
|
|
42
|
-
checks: [],
|
|
43
|
-
status: 'passed',
|
|
44
|
-
attempts: 1,
|
|
45
|
-
maxRetries: 1
|
|
46
|
-
}
|
|
47
|
-
],
|
|
48
|
-
metadata: {
|
|
49
|
-
source: 'default',
|
|
50
|
-
generatedBy: 'test',
|
|
51
|
-
planVersion: 1
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
writeJson(getReportCardPath(repoRoot, 'REQ-123'), {
|
|
56
|
-
changeId: 'REQ-123',
|
|
57
|
-
verdict: 'pass',
|
|
58
|
-
overall: 'pass',
|
|
59
|
-
specSyncReady: false,
|
|
60
|
-
reroute: 'cc-do',
|
|
61
|
-
quickGates: [],
|
|
62
|
-
strictGates: [],
|
|
63
|
-
review: { status: 'pass', summary: 'review-ok', details: '' },
|
|
64
|
-
blockingFindings: [],
|
|
65
|
-
gaps: [],
|
|
66
|
-
timestamp: '2026-03-25T01:03:00.000Z',
|
|
67
|
-
...reportOverrides
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
describe('runRelease', () => {
|
|
72
|
-
test('blocks reports that pass verification but are not ship ready', async () => {
|
|
73
|
-
const repoRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'cc-devflow-release-readiness-'));
|
|
74
|
-
writeReleaseFixture(repoRoot);
|
|
75
|
-
|
|
76
|
-
await expect(runRelease({ repoRoot, changeId: 'REQ-123' })).rejects.toMatchObject({
|
|
77
|
-
name: 'ReleaseReadinessError',
|
|
78
|
-
rescueAction: 'run cc-check until ship-readiness is ready before release'
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
const runtimeState = JSON.parse(fs.readFileSync(getRuntimeStatePath(repoRoot, 'REQ-123'), 'utf8'));
|
|
82
|
-
expect(runtimeState.status).toBe('verified');
|
|
83
|
-
expect(fs.existsSync(getReleaseNotePath(repoRoot, 'REQ-123'))).toBe(false);
|
|
84
|
-
});
|
|
85
|
-
});
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* [INPUT]: 依赖 runReviewSuite、临时 devflow review artifacts。
|
|
3
|
-
* [OUTPUT]: 验证 cc-check review 读取 review-findings.json 优先并按 legacy 层级 fallback。
|
|
4
|
-
* [POS]: REQ-003-minimize-workflow-artifacts T015 的 Red/Green 证据。
|
|
5
|
-
* [PROTOCOL]: 变更时更新此头部,然后检查 CLAUDE.md
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
const fs = require('fs');
|
|
9
|
-
const os = require('os');
|
|
10
|
-
const path = require('path');
|
|
11
|
-
|
|
12
|
-
const { runReviewSuite } = require('../review');
|
|
13
|
-
|
|
14
|
-
function writeJson(filePath, value) {
|
|
15
|
-
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
16
|
-
fs.writeFileSync(filePath, `${JSON.stringify(value, null, 2)}\n`);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function writeText(filePath, value) {
|
|
20
|
-
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
21
|
-
fs.writeFileSync(filePath, value);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function makeReviewRoot(changeId, changeKey) {
|
|
25
|
-
const repoRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'cc-devflow-review-check-'));
|
|
26
|
-
const reviewDir = path.join(repoRoot, 'devflow', 'changes', changeKey, 'review');
|
|
27
|
-
fs.mkdirSync(reviewDir, { recursive: true });
|
|
28
|
-
return { repoRoot, reviewDir, changeId, changeKey };
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function findingsDoc(overrides = {}) {
|
|
32
|
-
return {
|
|
33
|
-
schema: 'review-findings.v2',
|
|
34
|
-
change: 'REQ-140-review-records',
|
|
35
|
-
reviewId: 'RVW-20260512-001',
|
|
36
|
-
headSha: 'def456',
|
|
37
|
-
freshness: {
|
|
38
|
-
status: 'fresh',
|
|
39
|
-
reviewedCommit: 'def456',
|
|
40
|
-
currentCommit: 'def456',
|
|
41
|
-
commitsSinceReview: 0
|
|
42
|
-
},
|
|
43
|
-
summary: {
|
|
44
|
-
status: 'findings',
|
|
45
|
-
blockingCount: 1,
|
|
46
|
-
warningCount: 0,
|
|
47
|
-
next: 'cc-do'
|
|
48
|
-
},
|
|
49
|
-
findings: [
|
|
50
|
-
{
|
|
51
|
-
id: 'F001',
|
|
52
|
-
severity: 'important',
|
|
53
|
-
confidence: 8,
|
|
54
|
-
displayTier: 'blocking',
|
|
55
|
-
fingerprint: 'sha256:f001',
|
|
56
|
-
scope: 'inside current requirement blast radius',
|
|
57
|
-
path: 'lib/skill-runtime/review.js',
|
|
58
|
-
evidence: 'review records should be consumed before legacy report text',
|
|
59
|
-
recommendation: 'read review-findings.json first',
|
|
60
|
-
route: 'cc-do'
|
|
61
|
-
}
|
|
62
|
-
],
|
|
63
|
-
...overrides
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
async function runReviewCase(files) {
|
|
68
|
-
const ctx = makeReviewRoot('REQ-140', 'REQ-140-review-records');
|
|
69
|
-
if (files.findings) {
|
|
70
|
-
writeJson(path.join(ctx.reviewDir, 'review-findings.json'), files.findings);
|
|
71
|
-
}
|
|
72
|
-
if (files.ledger) {
|
|
73
|
-
writeText(path.join(ctx.reviewDir, 'review-ledger.jsonl'), files.ledger);
|
|
74
|
-
}
|
|
75
|
-
if (files.legacyReport) {
|
|
76
|
-
writeText(path.join(ctx.reviewDir, 'cc-review-report.md'), files.legacyReport);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
const review = await runReviewSuite({
|
|
80
|
-
repoRoot: ctx.repoRoot,
|
|
81
|
-
changeId: ctx.changeId,
|
|
82
|
-
manifest: { tasks: [] },
|
|
83
|
-
strict: false,
|
|
84
|
-
skipReview: true
|
|
85
|
-
});
|
|
86
|
-
fs.rmSync(ctx.repoRoot, { recursive: true, force: true });
|
|
87
|
-
return review;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
describe('cc-check review record fallback', () => {
|
|
91
|
-
test('reads review-findings.json before ledger or legacy report', async () => {
|
|
92
|
-
const review = await runReviewCase({
|
|
93
|
-
findings: findingsDoc(),
|
|
94
|
-
ledger: '{"schema":"review-ledger.v2","change":"REQ-140-review-records","reviewId":"RVW-20260512-002","createdAt":"2026-05-12T00:00:00.000Z","createdBy":"cc-devflow-cli","event":"review-closed","status":"clean","blockingCount":0,"warningCount":0,"next":"cc-check"}\n',
|
|
95
|
-
legacyReport: '# Legacy Report\n'
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
expect(review.recordReview).toMatchObject({
|
|
99
|
-
source: 'review-findings.json',
|
|
100
|
-
status: 'fail',
|
|
101
|
-
freshness: { status: 'fresh' }
|
|
102
|
-
});
|
|
103
|
-
expect(review.findings[0]).toMatchObject({
|
|
104
|
-
id: 'F001',
|
|
105
|
-
source: 'review-records',
|
|
106
|
-
severity: 'important',
|
|
107
|
-
displayTier: 'blocking'
|
|
108
|
-
});
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
test('falls back to ledger tail when findings doc is missing', async () => {
|
|
112
|
-
const review = await runReviewCase({
|
|
113
|
-
ledger: [
|
|
114
|
-
'{"schema":"review-ledger.v2","change":"REQ-140-review-records","reviewId":"RVW-20260512-001","createdAt":"2026-05-12T00:00:00.000Z","createdBy":"cc-devflow-cli","event":"review-started","mode":"implementation","scope":"current-diff","baseSha":"abc123","headSha":"def456","selectedNodes":[],"skippedNodes":[],"riskLanes":[]}',
|
|
115
|
-
'{"schema":"review-ledger.v2","change":"REQ-140-review-records","reviewId":"RVW-20260512-001","createdAt":"2026-05-12T00:01:00.000Z","createdBy":"cc-devflow-cli","event":"review-closed","status":"clean","blockingCount":0,"warningCount":0,"next":"cc-check"}'
|
|
116
|
-
].join('\n')
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
expect(review.recordReview).toMatchObject({
|
|
120
|
-
source: 'review-ledger.jsonl',
|
|
121
|
-
status: 'pass',
|
|
122
|
-
summary: expect.stringContaining('review ledger')
|
|
123
|
-
});
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
test('falls back to legacy cc-review-report.md with unknown freshness', async () => {
|
|
127
|
-
const review = await runReviewCase({
|
|
128
|
-
legacyReport: '# Legacy Review\n\nNo blocking findings.\n'
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
expect(review.recordReview).toMatchObject({
|
|
132
|
-
source: 'cc-review-report.md',
|
|
133
|
-
status: 'pass',
|
|
134
|
-
freshness: { status: 'unknown' }
|
|
135
|
-
});
|
|
136
|
-
});
|
|
137
|
-
|
|
138
|
-
test('blocks when all review records are missing', async () => {
|
|
139
|
-
const review = await runReviewCase({});
|
|
140
|
-
|
|
141
|
-
expect(review.status).toBe('blocked');
|
|
142
|
-
expect(review.recordReview).toMatchObject({
|
|
143
|
-
source: 'review-records',
|
|
144
|
-
status: 'blocked',
|
|
145
|
-
summary: expect.stringContaining('review-missing')
|
|
146
|
-
});
|
|
147
|
-
});
|
|
148
|
-
});
|