fix(02): revise plans per checker (B1 + 4 flags) — add tabs permission for D-P2-02

- BLOCKER B1: add `tabs` to manifest.json permissions (DEC-011 Amendment 1
  cites Phase 2 D-P2-02 meta.urls feature as justification). Honors
  D-P2-02 "all tabs visible" wording verbatim. Updates manifest-i18n test
  expected permission list lockstep.
- F1: add A28 harness assertion for REQ-archive-layout strict zip-layout
  verification (5 entries, no extras).
- F2: createArchive empty-tracker fallback removed; logs warn + sets
  urls:[] instead of fake [extension-origin URL]. 02-01 RED test pins
  empty-tracker → urls:[].
- F3: 02-02 Task 3 prose deliberation struck; typed `blob-url-mint-failed`
  throw is the resolved-only contract.
- F4: 02-02 Task 3 verify block adds full-suite `npm test` after focused
  test runs.
- A27 strict-mode (Plan 02-04): REQUIRES both URLs in meta.urls; FAILS
  on length < 2.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-20 14:25:20 +02:00
parent 0608b22427
commit 9dcfcf0793
8 changed files with 496 additions and 121 deletions

View File

@@ -12,10 +12,17 @@
// after Wave-3 Task 1 landed the manifest + messages.json files. This
// file now pins the post-D-07 state as a regression guard.
//
// 2026-05-20 Plan 02-03 amendment (DEC-011 Amendment 1): manifest.json
// permissions array extended to include `"tabs"` per Phase 2 D-P2-02
// (meta.urls multi-tab visibility). The permission-set describe block
// below pins the post-amendment 8-entry set as a regression guard.
//
// References:
// - RESEARCH §10 + §11 (Chrome i18n schema; __MSG_* placeholder rules)
// - brand-decisions-v1.md D-07 override (`Mokosh — Session Capture`)
// - brand-decisions-v1.md D-08 tagline (`Thirty seconds ago, always at hand.`)
// - .planning/PROJECT.md DEC-011 Amendment 1 (`tabs` permission, 2026-05-20)
// - .planning/phases/02-stabilize-export-pipeline/02-CONTEXT.md D-P2-02
import { describe, expect, it } from 'vitest';
import { existsSync, readFileSync } from 'node:fs';
@@ -89,3 +96,35 @@ describe('Plan 01-12: _locales/ru/messages.json (primary operator locale)', () =
expect(ru.extDesc?.message).toBe('Тридцать секунд назад, всегда под рукой.');
});
});
describe('Plan 02-03 DEC-011 Amendment 1: manifest.json permissions include "tabs" (D-P2-02)', () => {
// Locked set per DEC-011 Amendment 1 (2026-05-20). `tabs` added to enable
// chrome.tabs.get(tabId).url + chrome.tabs.query for the tab-url-tracker
// (D-P2-02 meta.urls feature). Any future permission delta requires a
// formal DEC-011 amendment update — DO NOT edit this list without one.
const EXPECTED_PERMISSIONS: ReadonlyArray<string> = [
'desktopCapture',
'activeTab',
'tabs',
'downloads',
'scripting',
'storage',
'offscreen',
'notifications',
];
it('manifest.json:permissions includes "tabs" (DEC-011 Amendment 1)', () => {
const manifest = JSON.parse(readFileSync(MANIFEST_PATH, 'utf8'));
expect(Array.isArray(manifest.permissions)).toBe(true);
expect(manifest.permissions).toContain('tabs');
});
it('manifest.json:permissions has exactly the 8 entries in DEC-011 Amendment 1', () => {
const manifest = JSON.parse(readFileSync(MANIFEST_PATH, 'utf8'));
expect(Array.isArray(manifest.permissions)).toBe(true);
const actual = [...manifest.permissions].sort();
const expected = [...EXPECTED_PERMISSIONS].sort();
expect(actual).toEqual(expected);
expect(manifest.permissions.length).toBe(EXPECTED_PERMISSIONS.length);
});
});