feat(voyage)!: marketplace handoff — rename plugins/ultraplan-local to plugins/voyage [skip-docs]
Session 5 of voyage-rebrand (V6). Operator-authorized cross-plugin scope. - git mv plugins/ultraplan-local plugins/voyage (rename detected, history preserved) - .claude-plugin/marketplace.json: voyage entry replaces ultraplan-local - CLAUDE.md: voyage row in plugin list, voyage in design-system consumer list - README.md: bulk rename ultra*-local commands -> trek* commands; ultraplan-local refs -> voyage; type discriminators (type: trekbrief/trekreview); session-title pattern (voyage:<command>:<slug>); v4.0.0 release-note paragraph - plugins/voyage/.claude-plugin/plugin.json: homepage/repository URLs point to monorepo voyage path - plugins/voyage/verify.sh: drop URL whitelist exception (no longer needed) Closes voyage-rebrand. bash plugins/voyage/verify.sh PASS 7/7. npm test 361/361.
This commit is contained in:
parent
8f1bf9b7b4
commit
7a90d348ad
149 changed files with 26 additions and 33 deletions
|
|
@ -1,114 +0,0 @@
|
|||
import { test } from 'node:test';
|
||||
import { strict as assert } from 'node:assert';
|
||||
import { validateReviewContent } from '../../lib/validators/review-validator.mjs';
|
||||
|
||||
const GOOD_REVIEW = `---
|
||||
type: trekreview
|
||||
review_version: "1.0"
|
||||
created: 2026-05-01
|
||||
task: "Add JWT auth"
|
||||
slug: jwt-auth
|
||||
project_dir: .claude/projects/2026-04-30-jwt-auth/
|
||||
brief_path: .claude/projects/2026-04-30-jwt-auth/brief.md
|
||||
scope_sha_start: abc123
|
||||
scope_sha_end: def456
|
||||
reviewed_files_count: 7
|
||||
findings:
|
||||
- 0123456789abcdef0123456789abcdef01234567
|
||||
- fedcba9876543210fedcba9876543210fedcba98
|
||||
---
|
||||
|
||||
# Review
|
||||
|
||||
## Executive Summary
|
||||
|
||||
Verdict: ALLOW.
|
||||
|
||||
## Coverage
|
||||
|
||||
| File | Treatment | Reason |
|
||||
|------|-----------|--------|
|
||||
| lib/foo.mjs | deep-review | risk |
|
||||
|
||||
## Remediation Summary
|
||||
|
||||
None.
|
||||
`;
|
||||
|
||||
test('validateReview — happy path', () => {
|
||||
const r = validateReviewContent(GOOD_REVIEW, { strict: true });
|
||||
assert.equal(r.valid, true, JSON.stringify(r.errors));
|
||||
});
|
||||
|
||||
test('validateReview — wrong type rejected (REVIEW_WRONG_TYPE)', () => {
|
||||
const t = GOOD_REVIEW.replace('type: trekreview', 'type: trekbrief');
|
||||
const r = validateReviewContent(t);
|
||||
assert.equal(r.valid, false);
|
||||
assert.ok(r.errors.find(e => e.code === 'REVIEW_WRONG_TYPE'));
|
||||
});
|
||||
|
||||
test('validateReview — missing required field (REVIEW_MISSING_FIELD)', () => {
|
||||
const t = GOOD_REVIEW.replace(/^brief_path: .*\n/m, '');
|
||||
const r = validateReviewContent(t);
|
||||
assert.equal(r.valid, false);
|
||||
assert.ok(r.errors.find(e => e.code === 'REVIEW_MISSING_FIELD' && /brief_path/.test(e.message)));
|
||||
});
|
||||
|
||||
test('validateReview — missing required body section in strict (REVIEW_MISSING_SECTION)', () => {
|
||||
const t = GOOD_REVIEW.replace(/## Coverage[\s\S]*?(?=## Remediation)/m, '');
|
||||
const r = validateReviewContent(t, { strict: true });
|
||||
assert.equal(r.valid, false);
|
||||
assert.ok(r.errors.find(e => e.code === 'REVIEW_MISSING_SECTION' && /Coverage/.test(e.message)));
|
||||
});
|
||||
|
||||
test('validateReview — Coverage section is REQUIRED (no soft demotion to make Coverage optional)', () => {
|
||||
const t = GOOD_REVIEW.replace(/## Coverage[\s\S]*?(?=## Remediation)/m, '');
|
||||
const r = validateReviewContent(t, { strict: true });
|
||||
assert.equal(r.valid, false);
|
||||
});
|
||||
|
||||
test('validateReview — soft mode demotes section errors to warnings', () => {
|
||||
const t = GOOD_REVIEW.replace(/## Remediation Summary[\s\S]*$/m, '');
|
||||
const r = validateReviewContent(t, { strict: false });
|
||||
assert.equal(r.valid, true);
|
||||
assert.ok(r.warnings.find(w => w.code === 'REVIEW_MISSING_SECTION'));
|
||||
});
|
||||
|
||||
test('validateReview — missing frontmatter is hard error (FM_MISSING)', () => {
|
||||
const r = validateReviewContent('# review\n\nno frontmatter\n');
|
||||
assert.equal(r.valid, false);
|
||||
assert.ok(r.errors.find(e => e.code === 'FM_MISSING'));
|
||||
});
|
||||
|
||||
test('validateReview — findings not an array → REVIEW_BAD_FINDINGS_TYPE', () => {
|
||||
// Replace block-style list with scalar → parser yields string
|
||||
const t = GOOD_REVIEW.replace(
|
||||
/findings:\n - 0123[\s\S]*?- fedcba[0-9a-f]+/,
|
||||
'findings: not-an-array',
|
||||
);
|
||||
const r = validateReviewContent(t);
|
||||
assert.equal(r.valid, false);
|
||||
assert.ok(
|
||||
r.errors.find(e => e.code === 'REVIEW_BAD_FINDINGS_TYPE'),
|
||||
`expected REVIEW_BAD_FINDINGS_TYPE, got: ${JSON.stringify(r.errors)}`,
|
||||
);
|
||||
});
|
||||
|
||||
test('validateReview — finding-ID not 40-char hex → REVIEW_BAD_FINDING_ID', () => {
|
||||
const t = GOOD_REVIEW.replace(
|
||||
'0123456789abcdef0123456789abcdef01234567',
|
||||
'NOT-A-VALID-HEX-ID',
|
||||
);
|
||||
const r = validateReviewContent(t);
|
||||
assert.equal(r.valid, false);
|
||||
assert.ok(r.errors.find(e => e.code === 'REVIEW_BAD_FINDING_ID'));
|
||||
});
|
||||
|
||||
test('validateReview — empty findings array is acceptable (no findings = ALLOW verdict)', () => {
|
||||
const t = GOOD_REVIEW.replace(
|
||||
/findings:\n - 0123[\s\S]*?- fedcba[0-9a-f]+/,
|
||||
'findings: []',
|
||||
);
|
||||
const r = validateReviewContent(t);
|
||||
assert.equal(r.valid, true, JSON.stringify(r.errors));
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue