Add local protocol context and workbook study prompts
Browse filesFiles changed (13)
- PROVENANCE.md+7
- README.md+4-1
- SOURCE-MANIFEST.json+14-10
- VERIFICATION.md+7
- deploy_hf.py+2-1
- docs/2026-11-15-protocol-context.mdAdded+23
- index.html+5-2
- static/app.js+93-14
- static/index.html+5-2
- static/protocols.jsAdded+95
- static/style.css+3
- tests/browser_protocols.cjsAdded+102
- tests/test_protocols.cjsAdded+85
35 unmodified lines36373835 unmodified lines## Current Veyra identityThe user rejected the first concentric-circle symbols as too close to a target. The final Orbis and Veyra identities use typography rather than circular emblems. Veyra replaces the visible Napolean Cyber Command name; storage and backup identifiers remain unchanged. The Veyra wordmark and print logo are outlined from self-hosted Manrope at weight 680. The compact open V favicon is authored SVG geometry. All artwork is local; the bundled SIL Open Font License remains applicable to the font. Earlier identity descriptions above are historical.35 unmodified lines3637383940414243444535 unmodified lines## Current Veyra identityThe user rejected the first concentric-circle symbols as too close to a target. The final Orbis and Veyra identities use typography rather than circular emblems. Veyra replaces the visible Napolean Cyber Command name; storage and backup identifiers remain unchanged. The Veyra wordmark and print logo are outlined from self-hosted Manrope at weight 680. The compact open V favicon is authored SVG geometry. All artwork is local; the bundled SIL Open Font License remains applicable to the font. Earlier identity descriptions above are historical.## Protocol study context — 2026-11-15The four local protocol summaries and review questions are original content based on RFC 9110 (HTTP), RFC 9846 (TLS 1.3; obsoletes RFC 8446), RFC 1035 (DNS), RFC 4033 (DNSSEC) and RFC 4251 (SSH). Each card links to its primary references. Protocol Explorer by Dilum Sanjaya is linked as an external learning resource at https://protocol-explorer-alpha.vercel.app/. No Explorer source code, lesson prose or packet traces are bundled. Its deployed frame restriction precludes embedding; no API or reuse license was established.Topic selection stays in temporary UI state. The external root URL contains no record-derived parameters and uses no-referrer/noopener/noreferrer. Draft prompts use the existing Expected result field and require an explicit workbook save. Storage identifiers, schema, backup versions, findings and exercise routing are unchanged. The app adds no remote asset, dependency, connection permission or automatic external request.
20 unmodified lines21222324252649 unmodified lines76777879808182838485868788899020 unmodified lines1. **Choose your material and scope.** Create an assessment, choose Python code, JSON alerts, or an exercise scenario, and describe what you are authorized to review. Use the sample input to try the workflow before entering your own material.2. **Review the results and role tasks.** Possible issues need a person to check the evidence and record a decision. The five perspectives provide suggested tasks for people, including when no possible issues are found.3. **Track fixes and keep a copy.** Record owners, decisions and follow-up work, then export a report. Download a JSON backup to preserve your workspace.Saved only in this browser: changing browsers or clearing site data can remove access to records. A report is for sharing results; a JSON backup lets you restore saved work. Raw submissions are discarded after processing. Names, scopes, generated evidence and notes can still contain sensitive information.49 unmodified lines## Verify```shnode --test tests/test_local.cjsnode --check static/app.jsnode --check static/local.js# Optional real Chromium checks; supply an existing Playwright module path:PLAYWRIGHT_MODULE=/absolute/path/to/playwright node tests/browser_storage.cjs# With the local server running:PLAYWRIGHT_MODULE=/absolute/path/to/playwright node tests/browser_ui.cjsPLAYWRIGHT_MODULE=/absolute/path/to/playwright node tests/browser_engagement.cjsPLAYWRIGHT_MODULE=/absolute/path/to/playwright node tests/browser_usability.cjs```Browser checks use an existing Playwright installation and its Chromium binary; they add no runtime dependency. Set `PLAYWRIGHT_EXECUTABLE_PATH` if using an existing compatible Chromium executable.20 unmodified lines2122232425262749 unmodified lines777879808182838485868788899091929320 unmodified lines1. **Choose your material and scope.** Create an assessment, choose Python code, JSON alerts, or an exercise scenario, and describe what you are authorized to review. Use the sample input to try the workflow before entering your own material.2. **Review the results and role tasks.** Possible issues need a person to check the evidence and record a decision. The five perspectives provide suggested tasks for people, including when no possible issues are found.For protocol-focused work, open **Protocol context** under Role tasks. Choose HTTP/HTTPS, TLS, DNS or SSH, consult the original summaries and RFC references, and optionally add study prompts to an unsaved role workbook draft. Protocol Explorer opens separately; no assessment details are included in its link.3. **Track fixes and keep a copy.** Record owners, decisions and follow-up work, then export a report. Download a JSON backup to preserve your workspace.Saved only in this browser: changing browsers or clearing site data can remove access to records. A report is for sharing results; a JSON backup lets you restore saved work. Raw submissions are discarded after processing. Names, scopes, generated evidence and notes can still contain sensitive information.49 unmodified lines## Verify```shnode --test tests/test_local.cjs tests/test_protocols.cjsnode --check static/app.jsnode --check static/local.jsnode --check static/protocols.js# Optional real Chromium checks; supply an existing Playwright module path:PLAYWRIGHT_MODULE=/absolute/path/to/playwright node tests/browser_storage.cjs# With the local server running:PLAYWRIGHT_MODULE=/absolute/path/to/playwright node tests/browser_ui.cjsPLAYWRIGHT_MODULE=/absolute/path/to/playwright node tests/browser_engagement.cjsPLAYWRIGHT_MODULE=/absolute/path/to/playwright node tests/browser_usability.cjsPLAYWRIGHT_MODULE=/absolute/path/to/playwright node tests/browser_protocols.cjs```Browser checks use an existing Playwright installation and its Chromium binary; they add no runtime dependency. Set `PLAYWRIGHT_EXECUTABLE_PATH` if using an existing compatible Chromium executable.
1234567892 unmodified lines1213141516171819202113 unmodified lines353637383940{"README.md": "1d5dcc57699bb121320202d3a4682fcdced0062f3f36efe429d7ea97ae531cd0","index.html": "338adc27ca1c8e2b4c76f0f6e24fd16940b1e1795f75196b02d913b517b7f7d5","static/index.html": "f451674f40bd2dd00cf38ede3980974a872da06b53ce3b29290b2f017237ed01","static/style.css": "f3084fbc2e02a510f66b85ac8d90a94fe7712c2c57e23bcc52f7ada663510162","static/app.js": "cdc4659f09252639bf764255e558f7d1ed72b85d7e8272199e339d33c4e21ba5","static/local.js": "d833047ee92fc0302cb1a7e6566358e141640e20455d2ccd5c658b886d4a5ab9","static/playbooks.js": "3907230561f4573801651297fde26d835d964783a175363b6434c8a4e312e80c","tests/test_local.cjs": "5610014c165d662f83706570db6f47a34929cb1c44017a8d809be2038739cabb",2 unmodified lines"tests/detection-fixtures.cjs": "1d9fed45afab9f37d7d2715a8dcf0c2e1e6c80c57821509df44d07e22b12383b","SECURITY.md": "105ac97b2c07ca5b8b20e4162bfb311bc30a6c332354648d71b65feac1d9181b","SERVICE.md": "7bdd60baeca50ef6b6c0ef72c277f3fbbc6e02a16203f19a171eeb47e79faeca","PROVENANCE.md": "4c97a589374a36c43d0e4e023b0b60fde5ea5abf59944f6a1d6d0e98802cf03c","VERIFICATION.md": "66c8a44bb563abff13bb66705cdb81e76777370323b578e301643b47380a285c","IMPROVEMENTS.md": "a31147b3c60263e26a16038de078fdc4b7a15902b5f0b1636d4df76cc606d9da","deploy_hf.py": "1530c6263dba66fe8bed25cde2b0cad7b04e6ecba8b566baa3d07b8ca0d87aa3","requirements-deploy.txt": "81672301ff63877bdaf3f00b06ebed759f2d2e04f4372c57024fef78c0ea42bf","tests/test_deploy.py": "95fcbd4f01ade35dd55f35c589fce3c6043f8c95197ab23d84aea032a0321416","docs/superpowers/specs/2026-10-31-business-improvements-design.md": "036f59ddfb6733bd46209681e1342f1380625adde151a6bfb859f2526647a069",13 unmodified lines"PRODUCT.md": "964285b9f8ff7cea6e6e2bef2a6e9543bca16572ec8a634cd879574138ca39ef","DESIGN.md": "2fcd8896bcde63241e23e091b31d0f5e7eafd27dbad095d50a13e2aa2abc7269",".impeccable/design.json": "b462e91f52d4595ef2085a40ab9f353ef97a57b10d92d71bd8949e5d576165cc","static/fonts/Manrope.ttf": "3ae11c49db0455a3cc33e37d380f20fdb8c7f8b41dc07625c177e3d87a9d6ae6","static/fonts/OFL.txt": "58172e0c0fac2cda8a37b348164bb55e44b0e69051e557e92b1d3f6910141f7b"}1234567892 unmodified lines1213141516171819202113 unmodified lines35363738394041424344{"README.md": "1dce9b537615272e8b6e8cf6e1e400059dc75751d7da9293a29cc3b2a693a270","index.html": "7c2b0146d43b2cbc78ec5af6007203befa92662489f5c75ba9f04d5824ed3f82","static/index.html": "c46aea13f5ac862bfb606152b9c96a532d6f7c571a5f67216bfb0964c781f6b2","static/style.css": "464992f71acae1af1fa3e201d0c207991509cbba34db561b5f4317a99f37f46c","static/app.js": "8cf18412edda83505fb775471d7f602c51f35a49cf777686073156222252b33c","static/local.js": "d833047ee92fc0302cb1a7e6566358e141640e20455d2ccd5c658b886d4a5ab9","static/playbooks.js": "3907230561f4573801651297fde26d835d964783a175363b6434c8a4e312e80c","tests/test_local.cjs": "5610014c165d662f83706570db6f47a34929cb1c44017a8d809be2038739cabb",2 unmodified lines"tests/detection-fixtures.cjs": "1d9fed45afab9f37d7d2715a8dcf0c2e1e6c80c57821509df44d07e22b12383b","SECURITY.md": "105ac97b2c07ca5b8b20e4162bfb311bc30a6c332354648d71b65feac1d9181b","SERVICE.md": "7bdd60baeca50ef6b6c0ef72c277f3fbbc6e02a16203f19a171eeb47e79faeca","PROVENANCE.md": "a89832285c58f3d38d9e2350925d32c688fe691809a88cc2db73fc2b4005271c","VERIFICATION.md": "433bed26655ca2b27d482f3ed0f17d6824695378adb986edd478c81997034fba","IMPROVEMENTS.md": "a31147b3c60263e26a16038de078fdc4b7a15902b5f0b1636d4df76cc606d9da","deploy_hf.py": "3625d9ba75e1e478486a4d631998620bcb86cf349f1233d2025bf65990a20476","requirements-deploy.txt": "81672301ff63877bdaf3f00b06ebed759f2d2e04f4372c57024fef78c0ea42bf","tests/test_deploy.py": "95fcbd4f01ade35dd55f35c589fce3c6043f8c95197ab23d84aea032a0321416","docs/superpowers/specs/2026-10-31-business-improvements-design.md": "036f59ddfb6733bd46209681e1342f1380625adde151a6bfb859f2526647a069",13 unmodified lines"PRODUCT.md": "964285b9f8ff7cea6e6e2bef2a6e9543bca16572ec8a634cd879574138ca39ef","DESIGN.md": "2fcd8896bcde63241e23e091b31d0f5e7eafd27dbad095d50a13e2aa2abc7269",".impeccable/design.json": "b462e91f52d4595ef2085a40ab9f353ef97a57b10d92d71bd8949e5d576165cc","static/fonts/Manrope.ttf": "6c1cf832403e6ec8e96961889b314cae33b0c2b3292c6192806060d064a89fca","static/fonts/OFL.txt": "58172e0c0fac2cda8a37b348164bb55e44b0e69051e557e92b1d3f6910141f7b","static/protocols.js": "a9eca80bb0a15f77e9e19b9bd889f818f3dd4cf38ecc57a14d7e9f8709b75019","tests/test_protocols.cjs": "c5ca1e18a1f00972a43b08ae046ac8659838d66c0e90b7901cd843619bb4d379","tests/browser_protocols.cjs": "78dd833fd7ab9926efd4363194c972a9f21506a3f46dd5d01a84e511aae5163e","docs/2026-11-15-protocol-context.md": "87dc185feafeab8ec233c4e8c734bf4b76cd5586098812b0c41df540ba3a49ae"}
105 unmodified lines106107108105 unmodified lines- Inspector warnings concern intentional warm ivory, supporting text sizes, introductory heading scale, and overview density. They are heuristic style warnings, not clean accessibility certification. Interactive keyboard and mobile flows received browser checks.- Assets, wordmarks and Manrope are self-hosted; CSP, record formats, IndexedDB identifiers and runtime dependencies remain compatible. The font license is bundled. Visible reports/backup filenames use Veyra; technical legacy format IDs retain compatibility.- This is local verification. No hosted Space was renamed, updated or deployed. Real customer data, external endpoints, OS screen readers and physical touch devices were not exercised.105 unmodified lines106107108109110111112113114115105 unmodified lines- Inspector warnings concern intentional warm ivory, supporting text sizes, introductory heading scale, and overview density. They are heuristic style warnings, not clean accessibility certification. Interactive keyboard and mobile flows received browser checks.- Assets, wordmarks and Manrope are self-hosted; CSP, record formats, IndexedDB identifiers and runtime dependencies remain compatible. The font license is bundled. Visible reports/backup filenames use Veyra; technical legacy format IDs retain compatibility.- This is local verification. No hosted Space was renamed, updated or deployed. Real customer data, external endpoints, OS screen readers and physical touch devices were not exercised.## Protocol context release — 2026-11-15The integrated source passes 50 Node checks (42 existing engine checks and eight protocol catalog/draft checks), four optional publisher tests, JavaScript syntax checks, and all five Chromium harnesses: storage, UI, engagement, usability and protocol context. The protocol harness also passed against static/index.html. Synthetic fixtures verify all four topics, fixed external link privacy attributes, no requests on topic selection, existing workbook preservation, unsaved discard, explicit save, duplicate prevention, the 2000-character boundary, Markdown export, JSON backup restore, keyboard focus and 390px overflow. Desktop rendering was inspected through the in-app browser; the mobile protocol screenshot was inspected separately.A bounded independent source review found no blocking issue. Storage and playbook modules remain byte-identical to the preceding release. These checks do not establish protocol configuration security, RFC implementation conformance or broad browser compatibility. The cards provide study questions, not evidence or findings. Graphify was not run; direct source inspection covered this small known module relationship. Hosted publication is verified separately in the release receipt.
5 unmodified lines67891011121314155 unmodified linesSOURCE_FILES=('README.md','index.html','static/index.html','static/style.css','static/app.js','static/local.js','static/playbooks.js','static/logo.svg','static/logo-print.svg','static/favicon.svg','static/fonts/Manrope.ttf','static/fonts/OFL.txt','PRODUCT.md','DESIGN.md','.impeccable/design.json','tests/test_local.cjs','tests/browser_storage.cjs','tests/browser_ui.cjs','tests/browser_engagement.cjs','tests/browser_usability.cjs','tests/legacy-snapshot.json','tests/detection-fixtures.cjs','SECURITY.md','SERVICE.md','PROVENANCE.md','VERIFICATION.md','IMPROVEMENTS.md',)5 unmodified lines6789101112131415165 unmodified linesSOURCE_FILES=('README.md','index.html','static/index.html','static/style.css','static/app.js','static/protocols.js','static/local.js','static/playbooks.js','static/logo.svg','static/logo-print.svg','static/favicon.svg','static/fonts/Manrope.ttf','static/fonts/OFL.txt','PRODUCT.md','DESIGN.md','.impeccable/design.json','tests/test_local.cjs','tests/browser_storage.cjs','tests/browser_ui.cjs','tests/browser_engagement.cjs','tests/browser_usability.cjs','tests/test_protocols.cjs','tests/browser_protocols.cjs','docs/2026-11-15-protocol-context.md','tests/legacy-snapshot.json','tests/detection-fixtures.cjs','SECURITY.md','SERVICE.md','PROVENANCE.md','VERIFICATION.md','IMPROVEMENTS.md',)
1234567891011121314151617181920212223# Protocol context integration
Approved scope: original local cards for HTTP/HTTPS, TLS, DNS and SSH in Role tasks, an attributed external Protocol Explorer link, and explicit draft prompts for existing role workbooks.
## Contract
- Same-origin static protocols.js, loaded before app.js in both entry points. No dependencies, network calls, embeds or CSP relaxation.- Explicit topic selection changes temporary UI state only. A constant external URL opens only on click, with no opener, referrer or record-derived parameters.- Add prompts opens the existing workbook dialog and appends study context to Expected result. Preserve existing text, owner, status, evidence, observations and decision. Enforce the existing 2000-character limit without truncation; repeated addition is idempotent. Nothing saves until the normal Save action.- Keep raw input disposal, exercise routing, findings, storage schemas, backup versions, snapshots and report validation unchanged. Learning material never counts as observed evidence.- Original summaries cite primary RFCs. Explorer is an external reference by Dilum Sanjaya; no Explorer code, traces or lesson prose are copied.
## Implementation and checks
1. Catalog owner writes failing unit tests, then implements four topics, fixed Explorer URL and pure bounded/idempotent draftExpected helper.2. UI owner renders a collapsible Protocol context inset and connects draft actions to the existing workbook. Preserve the app layout and keyboard controls.3. Test owner writes a failing browser acceptance flow before UI integration, then verifies selection privacy, draft/cancel/save behavior, report continuity and mobile layout.4. Run existing Node engine, deployment and browser suites; inspect desktop/mobile UI. Refresh deploy allowlist, source manifest, provenance and verification notes.5. Publish the reviewed files atomically to the existing HF Space, verify pinned release bytes/runtime and the live panel. Sync the dated GitHub source snapshot and manifest.
## Review focus
Preserve nonempty workbook notes; reject oversized additions; keep manual status/evidence unchanged; no requests on topic selection; restore old backups and retain frozen snapshots; root/static parity; visible labels/focus at 390px.9 unmodified lines101112131415161718192021106 unmodified lines1281291301311321339 unmodified linesVeyra · Security workbench</title><link href="./static/favicon.svg" rel="icon" type="image/svg+xml"/><link href="./static/style.css?v=20261107-veyra1" rel="stylesheet"/><script defer="" src="./static/playbooks.js?v=20261107-veyra1"></script><script defer="" src="./static/local.js?v=20261107-veyra1"></script><script defer="" src="./static/app.js?v=20261107-veyra1"></script></head><body>106 unmodified lines</select></div></div><label for="scope">Authorized scope</label>9 unmodified lines1011121314151617181920212223106 unmodified lines1301311321331341351369 unmodified linesVeyra · Security workbench</title><link href="./static/favicon.svg" rel="icon" type="image/svg+xml"/><link href="./static/style.css?v=20261115-protocol1" rel="stylesheet"/><script defer="" src="./static/playbooks.js?v=20261107-veyra1"></script><script defer="" src="./static/local.js?v=20261107-veyra1"></script><script defer="" src="./static/protocols.js?v=20261115-protocol1"></script><script defer="" src="./static/app.js?v=20261115-protocol1"></script></head><body>106 unmodified lines</select></div></div><p class="fine">Protocol-focused review? After creating the assessment, open Protocol context under Role tasks for study references and workbook prompts.</p><label for="scope">Authorized scope</label>
3 unmodified lines456789342 unmodified lines3523533543553563573583593603613623633643653663673683693703718 unmodified lines3803813823833843853 unmodified linesconst state = {assessments: [], assessment: null, finding: null, tab: 'ledger', client: '', ledgerSearch: '', verdict: '', severity: '', restoreText: '', originalReview: ''};const roles = [ ['red', '01', 'Red hat', 'Test assumptions', 'Test how scoped weaknesses could be misused.'], ['blue', '02', 'Blue hat', 'Strengthen defense', 'Triage alerts and plan the response.'], ['white', '03', 'White hat', 'Validate evidence', 'Check evidence, causes, and proposed fixes.'], ['black', '04', 'Black hat', 'Think like an attacker', 'Map attacker paths within the authorized scope.'], ['purple', '05', 'Purple hat', 'Close the loop', 'Connect team exercises to detection improvements.'] ];const workflows = {code: 'Code review', alerts: 'Alert triage', exercise: 'Team exercise'342 unmodified linesif (state.tab === 'queue') renderQueue(panel, a);if (state.tab === 'reports') renderReports(panel, a);if (state.tab === 'delivery') renderDelivery(panel, a);if (state.tab === 'missions') a.missions.forEach(m => {const article = el('article', undefined, 'mission');const head = el('div', undefined, 'mission-header');append(head, el('p', `${m.role.toUpperCase()} HAT`, 'eyebrow'), el('h3', m.title));append(article, head, el('p', m.objective));const steps = el('ol');m.steps.forEach(s => steps.append(el('li', s)));append(article, steps, el('p', `Deliverable: ${m.deliverable}`));m.limitations.forEach(l => article.append(el('p', `Limit: ${l}`, 'fine')));const entry = (a.workbook || []).find(item => item.role === m.role) || workbookDefault(m.role);article.append(el('p', `Workbook: ${entry.status} / Owner: ${entry.owner || 'Unassigned'}`, 'fine'));article.append(button(`Edit ${m.role} workbook`, () => openWorkbook(entry)));panel.append(article);});if (state.tab === 'coverage') {const section = el('div', undefined, 'coverage');append(section, el('h3', 'Checked boundaries & limitations'));8 unmodified linespanel.append(section);}}function renderLedger(panel, a) {const title = el('div', undefined, 'section-title');append(title, el('h2', 'Candidate findings'), el('span', 'ANALYST VERDICT REQUIRED', 'count'));3 unmodified lines4567891011342 unmodified lines3543553563573583593603613623633643653663673683693703713723733743753768 unmodified lines3853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634643 unmodified linesconst state = {assessments: [], assessment: null, finding: null, tab: 'ledger', client: '', ledgerSearch: '', verdict: '', severity: '', restoreText: '', originalReview: ''};// Study selection is temporary UI state, never part of an assessment or backup.const protocolSelection = { assessmentId: null, topicId: '' };const roles = [ ['red', '01', 'Red hat', 'Test assumptions', 'Test how scoped weaknesses could be misused.'], ['blue', '02', 'Blue hat', 'Strengthen defense', 'Triage alerts and plan the response.'], ['white', '03', 'White hat', 'Validate evidence', 'Check evidence, causes, and proposed fixes.'], ['black', '04', 'Black hat', 'Think like an attacker', 'Map attacker paths within the authorized scope.'], ['purple', '05', 'Purple hat', 'Close the loop', 'Connect team exercises to detection improvements.'] ];const workflows = {code: 'Code review', alerts: 'Alert triage', exercise: 'Team exercise'342 unmodified linesif (state.tab === 'queue') renderQueue(panel, a);if (state.tab === 'reports') renderReports(panel, a);if (state.tab === 'delivery') renderDelivery(panel, a);if (state.tab === 'missions') {renderProtocolContext(panel, a);a.missions.forEach(m => {const article = el('article', undefined, 'mission');const head = el('div', undefined, 'mission-header');append(head, el('p', `${m.role.toUpperCase()} HAT`, 'eyebrow'), el('h3', m.title));append(article, head, el('p', m.objective));const steps = el('ol');m.steps.forEach(s => steps.append(el('li', s)));append(article, steps, el('p', `Deliverable: ${m.deliverable}`));m.limitations.forEach(l => article.append(el('p', `Limit: ${l}`, 'fine')));const entry = (a.workbook || []).find(item => item.role === m.role) || workbookDefault(m.role);article.append(el('p', `Workbook: ${entry.status} / Owner: ${entry.owner || 'Unassigned'}`, 'fine'));article.append(button(`Edit ${m.role} workbook`, () => openWorkbook(entry)));panel.append(article);});}if (state.tab === 'coverage') {const section = el('div', undefined, 'coverage');append(section, el('h3', 'Checked boundaries & limitations'));8 unmodified linespanel.append(section);}}function renderProtocolContext(panel, assessment) {const catalog = globalThis.VeyraProtocols;if (!catalog) {panel.append(el('p', 'Protocol study cards are unavailable. Reload to check that the local reference file loaded.', 'fine'));return;}if (protocolSelection.assessmentId !== assessment.id) {protocolSelection.assessmentId = assessment.id;protocolSelection.topicId = '';}const section = el('details', undefined, 'protocol-context');section.id = 'protocol-context';append(section, el('summary', 'Protocol context'), el('p', 'Optional study guidance for this review. Learning material is not evidence that a control was tested.', 'fine'));const label = el('label', 'Protocol topic');label.htmlFor = 'protocol-topic';const select = el('select');select.id = 'protocol-topic';const placeholder = el('option', 'Choose a protocol');placeholder.value = '';select.append(placeholder);catalog.topics.forEach(topic => {const option = el('option', topic.title);option.value = topic.id;select.append(option);});select.value = protocolSelection.topicId;const card = el('div', undefined, 'protocol-card');card.id = 'protocol-card';function reference(label, href) {const link = el('a', label, 'text-button');link.href = href;link.target = '_blank';link.rel = 'noopener noreferrer';link.referrerPolicy = 'no-referrer';return link;}function drawTopic() {const topic = catalog.getTopic(select.value);protocolSelection.topicId = topic?.id || '';card.replaceChildren();card.hidden = !topic;if (!topic) return;append(card, el('h3', topic.title), el('p', topic.summary), el('p', topic.boundary, 'fine'), el('h4', 'Questions to review'));const questions = el('ul');topic.questions.forEach(question => questions.append(el('li', question)));const explorer = reference('Open Protocol Explorer ↗', catalog.explorerUrl);explorer.id = 'protocol-explorer';const sources = el('div', undefined, 'protocol-sources');topic.sources.forEach(source => sources.append(reference(source.label + ' ↗', source.href)));append(card, questions, explorer, el('p', `External learning tool by Dilum Sanjaya. Choose ${topic.explorerLesson} in its protocol list. The link includes no assessment details.`, 'fine'), sources, el('h4', 'Draft study prompts in a role workbook'), el('p', 'Adds context to Expected result and keeps your existing notes. Enter your own evidence, observed result and decision, then save when ready.', 'fine'));const actions = el('div', undefined, 'protocol-actions');assessment.missions.forEach(mission => {const roleLabel = roles.find(role => role[0] === mission.role)?.[2] || mission.role;const action = button(`${roleLabel} workbook`, () => {const entry = (assessment.workbook || []).find(item => item.role === mission.role) || workbookDefault(mission.role);try {const drafted = catalog.draftExpected(entry.expected || '', topic.id);openWorkbook(entry);$('#workbook-expected').value = drafted;$('#workbook-expected').focus();} catch (error) {notify(error.message, true);}});action.setAttribute('aria-label', `Add ${topic.title} prompts to ${mission.role} workbook`);actions.append(action);});card.append(actions);}select.addEventListener('change', drawTopic);append(section, label, select, card);drawTopic();panel.append(section);}function renderLedger(panel, a) {const title = el('div', undefined, 'section-title');append(title, el('h2', 'Candidate findings'), el('span', 'ANALYST VERDICT REQUIRED', 'count'));
9 unmodified lines101112131415161718192021106 unmodified lines1281291301311321339 unmodified linesVeyra · Security workbench</title><link href="./favicon.svg" rel="icon" type="image/svg+xml"/><link href="./style.css?v=20261107-veyra1" rel="stylesheet"/><script defer="" src="./playbooks.js?v=20261107-veyra1"></script><script defer="" src="./local.js?v=20261107-veyra1"></script><script defer="" src="./app.js?v=20261107-veyra1"></script></head><body>106 unmodified lines</select></div></div><label for="scope">Authorized scope</label>9 unmodified lines1011121314151617181920212223106 unmodified lines1301311321331341351369 unmodified linesVeyra · Security workbench</title><link href="./favicon.svg" rel="icon" type="image/svg+xml"/><link href="./style.css?v=20261115-protocol1" rel="stylesheet"/><script defer="" src="./playbooks.js?v=20261107-veyra1"></script><script defer="" src="./local.js?v=20261107-veyra1"></script><script defer="" src="./protocols.js?v=20261115-protocol1"></script><script defer="" src="./app.js?v=20261115-protocol1"></script></head><body>106 unmodified lines</select></div></div><p class="fine">Protocol-focused review? After creating the assessment, open Protocol context under Role tasks for study references and workbook prompts.</p><label for="scope">Authorized scope</label>
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495/* Original protocol study prompts. No traffic inspection or external service calls. */(function (root, factory) { 'use strict'; const data = factory(); if (typeof module === 'object' && module.exports) module.exports = data; else root.VeyraProtocols = data;})(typeof globalThis !== 'undefined' ? globalThis : this, function () { 'use strict';
const topics = [ { id: 'http', title: 'HTTP / HTTPS', explorerLesson: 'HTTP and HTTPS', summary: 'HTTP defines request and response semantics. HTTPS uses a secured connection for those exchanges.', boundary: 'Transport protection does not establish application authorization or safe handling of request data.', questions: [ 'Which methods and resources should each caller be allowed to use?', 'Where should HTTPS begin and end, including intermediary connections?', 'Which responses should be cacheable, and could they contain private data?' ], sources: [{label: 'RFC 9110 — HTTP Semantics', href: 'https://www.rfc-editor.org/rfc/rfc9110.html'}] }, { id: 'tls', title: 'TLS', explorerLesson: 'TLS/SSL', summary: 'TLS 1.3 negotiates cryptographic parameters and protects application data in transit.', boundary: 'Peer identity checks depend on the authentication configuration; encryption alone does not grant application permissions.', questions: [ 'Which peer identities and trust anchors should the client accept?', 'Where should TLS terminate, and which connections need separate protection?', 'If early data is enabled, which operations must account for replay?' ], // Current TLS 1.3 specification: July 2026; obsoletes RFC 8446. sources: [{label: 'RFC 9846 — TLS 1.3', href: 'https://www.rfc-editor.org/rfc/rfc9846.html'}] }, { id: 'dns', title: 'DNS', explorerLesson: 'DNS', summary: 'DNS resolves names using records, resolvers, authoritative servers, and caches.', boundary: 'Plain DNS does not authenticate answers. DNSSEC validation can authenticate signed DNS data; it does not provide confidentiality.', questions: [ 'Which resolver and authoritative sources should this environment trust?', 'How should cached records and their lifetimes affect expected behavior?', 'Is DNSSEC validation required, and how should validation failures be handled?' ], sources: [ {label: 'RFC 1035 — DNS implementation and specification', href: 'https://www.rfc-editor.org/rfc/rfc1035.html'}, {label: 'RFC 4033 — DNS security introduction and requirements', href: 'https://www.rfc-editor.org/rfc/rfc4033.html'} ] }, { id: 'ssh', title: 'SSH', explorerLesson: 'SSH', summary: 'SSH separates protected transport, user authentication, and multiplexed connection channels.', boundary: 'Host authentication and user authentication are separate checks; an encrypted session does not determine which actions a user may perform.', questions: [ 'How should clients verify the server host key and handle key changes?', 'Which user authentication methods and accounts should be permitted?', 'Which shell, forwarding, and subsystem channels should each account use?' ], sources: [{label: 'RFC 4251 — SSH protocol architecture', href: 'https://www.rfc-editor.org/rfc/rfc4251.html'}] } ];
function getTopic(id) { return topics.find(topic => topic.id === id) || null; }
function draftExpected(existingString, id) { const topic = getTopic(id); if (!topic) throw new Error('Choose a known protocol topic before drafting.'); if (typeof existingString !== 'string') throw new Error('Expected controls must be text.'); if (existingString.length > 2000) throw new Error('Expected controls exceed the 2000 character limit.'); const marker = `[Protocol study context: ${topic.id}]`; if (existingString.split(/\r?\n/).includes(marker)) return existingString; const context = [ marker, 'Study context only — not observations, evidence, or conclusions.', topic.title + ': ' + topic.summary, 'Boundary: ' + topic.boundary, ...topic.questions.map(question => '- ' + question), 'Primary references:', ...topic.sources.map(source => '- ' + source.label + ': ' + source.href) ].join('\n'); const drafted = existingString + (existingString ? '\n\n' : '') + context; if (drafted.length > 2000) throw new Error('This draft would exceed 2000 characters. Shorten the existing text before adding study context.'); return drafted; }
return {topics, explorerUrl: 'https://protocol-explorer-alpha.vercel.app/', getTopic, draftExpected};});1613 unmodified lines1614161516161613 unmodified lines.brand-wordmark { width: 126px; height: 48px; }.brand-subline { margin-top: -3px; font-size: 11px; }}1613 unmodified lines1614161516161617161816191613 unmodified lines.brand-wordmark { width: 126px; height: 48px; }.brand-subline { margin-top: -3px; font-size: 11px; }}/* Optional local study inset, using the existing Veyra controls and spacing. */.protocol-context{border-block:1px solid var(--border);padding:20px 0;margin:0 0 24px}.protocol-context>summary{font-weight:600;cursor:pointer;min-height:44px;display:list-item;padding:10px 0}.protocol-context>label{display:block;margin:16px 0 8px}.protocol-context>select{max-width:400px}.protocol-card{margin-top:24px}.protocol-card h3{margin-bottom:12px}.protocol-card h4{margin:24px 0 8px}.protocol-card li{margin-bottom:8px}.protocol-sources{display:flex;flex-wrap:wrap;gap:8px 20px;margin-top:12px}.protocol-sources a{overflow-wrap:anywhere}.protocol-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:16px}.protocol-actions button{white-space:normal}.protocol-context .fine{max-width:76ch}@media(max-width:600px){.protocol-context>select{width:100%;max-width:none}.protocol-actions{display:grid;grid-template-columns:1fr}.protocol-sources{display:block}.protocol-sources a{display:flex}}
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102'use strict';const assert = require('node:assert/strict');const fs = require('node:fs/promises');const {chromium} = require(process.env.PLAYWRIGHT_MODULE || 'playwright');(async () => { const browser = await chromium.launch({headless: true, ...(process.env.PLAYWRIGHT_EXECUTABLE_PATH ? {executablePath: process.env.PLAYWRIGHT_EXECUTABLE_PATH} : {})}); try { const context = await browser.newContext({viewport: {width: 1440, height: 1000}}); const page = await context.newPage(), errors = [], requests = []; page.on('pageerror', error => errors.push(error.message)); page.on('request', request => requests.push(request.url())); await page.goto(process.env.APP_URL || 'http://127.0.0.1:4186/'); await page.waitForFunction(() => !!window.CyberLocal); const fixture = await page.evaluate(async () => { let a = (await CyberLocal.request('/api/assessments', {method: 'POST', body: {name: 'Protocol synthetic tabletop', client: 'Synthetic only', scope: 'Fictional training discussion only', workflow: 'exercise', content: 'Fictional identity tabletop with no production targets.', authorization: true, roles: ['red', 'blue', 'white', 'black', 'purple']}})).assessment; a = (await CyberLocal.request(`/api/assessments/${a.id}/workbook`, {method: 'PATCH', body: {expected_revision: a.revision, entry: {role: 'blue', owner: 'Synthetic blue owner', status: 'in-progress', evidence: 'Existing synthetic evidence', expected: 'Existing expected note.', observed: 'Existing observed note.', decision: 'Existing decision.'}}})).assessment; return a; }); const saved = () => page.evaluate(async id => (await CyberLocal.request('/api/assessments/' + id)).assessment, fixture.id); await page.reload(); await page.getByRole('button', {name: fixture.name, exact: true}).click(); await page.locator('#tab-missions').click(); assert.equal(await page.locator('#protocol-context').count(), 1, 'Role tasks provides protocol context'); await page.locator('#protocol-context > summary').click(); const topic = page.locator('#protocol-topic'); assert.equal(await topic.locator('option').count(), 5, 'placeholder plus four curated topics'); const requestCount = requests.length; for (const id of ['http', 'tls', 'dns', 'ssh']) { await topic.selectOption(id); assert.equal(await page.locator('#protocol-card').isVisible(), true); const card = await page.locator('#protocol-card').innerText(); assert.ok(card.length > 100, `${id} has substantive local learning content`); assert.ok(await page.locator('#protocol-card a[href^="https://"]').count(), `${id} cites sources`); } await topic.selectOption('tls'); const link = page.locator('#protocol-explorer'); assert.equal(await link.getAttribute('href'), 'https://protocol-explorer-alpha.vercel.app/'); assert.equal(await link.getAttribute('target'), '_blank'); assert.ok((await link.getAttribute('rel')).split(/\s+/).includes('noopener')); assert.ok((await link.getAttribute('rel')).split(/\s+/).includes('noreferrer')); assert.equal(await link.getAttribute('referrerpolicy'), 'no-referrer'); assert.equal(requests.length, requestCount, 'topic selection causes no network requests'); assert.deepEqual(await saved(), fixture, 'learning selection does not mutate assessment'); console.log('PASS all local topics, fixed external link privacy attributes, no selection requests or mutations'); await page.getByRole('button', {name: 'Add TLS prompts to blue workbook', exact: true}).click(); await page.locator('#workbook-dialog').waitFor(); const draft = await page.locator('#workbook-expected').inputValue(); assert.ok(draft.includes('Which peer identities and trust anchors should the client accept?'), 'draft contains original TLS questions'); assert.ok(draft.startsWith('Existing expected note.'), 'append preserves existing expected note'); assert.ok(draft.length > 'Existing expected note.'.length, 'adds protocol prompts to draft'); for (const [key, value] of Object.entries({owner: 'Synthetic blue owner', status: 'in-progress', evidence: 'Existing synthetic evidence', observed: 'Existing observed note.', decision: 'Existing decision.'})) assert.equal(await page.locator('#workbook-' + key).inputValue(), value, `preserves ${key}`); assert.deepEqual(await saved(), fixture, 'opening prompt draft does not save'); page.once('dialog', dialog => dialog.accept()); await page.locator('#workbook-dialog [data-close]').first().click(); await page.locator('#workbook-dialog').waitFor({state: 'hidden'}); assert.deepEqual(await saved(), fixture, 'discarding unsaved prompt draft leaves record unchanged'); await page.getByRole('button', {name: 'Add TLS prompts to blue workbook', exact: true}).click(); assert.equal(await page.locator('#workbook-expected').inputValue(), draft); await page.locator('#workbook-form button[type=submit]').click(); await page.locator('#workbook-dialog').waitFor({state: 'hidden'}); const updated = await saved(); assert.equal(updated.workbook.find(entry => entry.role === 'blue').expected, draft); assert.equal(updated.revision, fixture.revision + 1, 'one explicit workbook save increments revision once'); assert.deepEqual(updated.findings, fixture.findings); assert.equal(updated.scenario_category, fixture.scenario_category); assert.equal(await page.locator('#protocol-topic').inputValue(), 'tls', 'topic survives assessment rerender'); if (!(await page.locator('#protocol-context').evaluate(node => node.open))) await page.locator('#protocol-context > summary').click(); await page.getByRole('button', {name: 'Add TLS prompts to blue workbook', exact: true}).click(); assert.equal(await page.locator('#workbook-expected').inputValue(), draft, 'reapplying same topic avoids duplication'); await page.locator('#workbook-dialog [data-close]').first().click(); const exports = await page.evaluate(async id => ({markdown: await CyberLocal.exportText(id, 'markdown'), backup: await CyberLocal.backupText()}), fixture.id); assert.ok(exports.markdown.includes('Which peer identities and trust anchors should the client accept?'), 'Markdown includes saved TLS prompts'); assert.equal(JSON.parse(exports.backup).records.find(record => record.id === fixture.id).workbook.find(entry => entry.role === 'blue').expected, draft); const roundtrip = await page.evaluate(async backup => { const imported = JSON.parse(backup); imported.records[0].name = 'Restored protocol synthetic tabletop'; const result = await CyberLocal.restoreBackup(JSON.stringify(imported)); const rows = (await CyberLocal.request('/api/assessments')).assessments; const row = rows.find(row => row.id !== JSON.parse(backup).records[0].id); return {result, assessment: (await CyberLocal.request('/api/assessments/' + row.id)).assessment}; }, exports.backup); assert.equal(roundtrip.result.count, 1); assert.equal(roundtrip.assessment.workbook.find(entry => entry.role === 'blue').expected, draft); console.log('PASS draft-only append, discard, explicit save, duplicate avoidance and backup round-trip'); await page.setViewportSize({width: 390, height: 844}); const details = page.locator('#protocol-context'); if (!(await details.evaluate(node => node.open))) await details.locator('summary').click(); await topic.focus(); assert.equal(await topic.evaluate(node => node === document.activeElement), true, 'selector receives keyboard focus'); assert.equal(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth + 1), true, '390px layout does not overflow'); if (process.env.ARTIFACT_DIR) { await fs.mkdir(process.env.ARTIFACT_DIR, {recursive: true}); await page.screenshot({path: process.env.ARTIFACT_DIR + '/protocol-mobile.png', fullPage: true}); } const fullRecord = await page.evaluate(async id => { const a = (await CyberLocal.request('/api/assessments/' + id)).assessment; const entry = {...a.workbook.find(entry => entry.role === 'blue'), expected: 'x'.repeat(1990)}; return (await CyberLocal.request(`/api/assessments/${id}/workbook`, {method: 'PATCH', body: {expected_revision: a.revision, entry}})).assessment; }, fixture.id); await page.reload(); await page.getByRole('button', {name: fixture.name, exact: true}).click(); await page.locator('#tab-missions').click(); await page.locator('#protocol-context > summary').click(); await page.locator('#protocol-topic').selectOption('tls'); await page.getByRole('button', {name: 'Add TLS prompts to blue workbook', exact: true}).click(); assert.match(await page.locator('#notice').innerText(), /2000|2,000/, 'oversized append explains existing field limit'); assert.equal(await page.locator('#workbook-dialog').evaluate(node => node.open), false, 'oversized append opens no partial draft'); assert.deepEqual(await saved(), fullRecord, 'oversized append never truncates or saves'); assert.deepEqual(errors, []); console.log('PASS mobile layout, keyboard focus, append size guard and no browser errors'); } finally { await browser.close(); }})().catch(error => {console.error(error); process.exitCode = 1;});12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485'use strict';const test = require('node:test');const assert = require('node:assert/strict');const fs = require('node:fs');const path = require('node:path');const vm = require('node:vm');const modulePath = path.join(__dirname, '../static/protocols.js');
test('protocol study module is available for the workbook', () => { assert.ok(fs.existsSync(modulePath), 'Expected the local protocol study module');});
test('known topics provide study questions and primary references without accepting arbitrary IDs', () => { const protocols = require(modulePath); assert.deepEqual(protocols.topics.map(topic => topic.id), ['http', 'tls', 'dns', 'ssh']); for (const id of ['http', 'tls', 'dns', 'ssh']) { const topic = protocols.getTopic(id); assert.equal(topic.id, id); assert.equal(topic.questions.length, 3); assert.ok(topic.title && topic.summary && topic.boundary && topic.explorerLesson); assert.ok(topic.sources.every(source => source.label && new URL(source.href).hostname === 'www.rfc-editor.org')); } for (const id of ['unknown', '__proto__', 'constructor', null, undefined]) { assert.equal(protocols.getTopic(id), null); assert.throws(() => protocols.draftExpected('', id), /choose|unknown|select/i); } assert.equal(protocols.explorerUrl, 'https://protocol-explorer-alpha.vercel.app/');});
test('draft appends study context while preserving every existing character', () => { const protocols = require(modulePath); const existing = ' Existing expected controls.\r\nLeave this wording. '; const drafted = protocols.draftExpected(existing, 'tls'); assert.ok(drafted.startsWith(existing + '\n\n')); assert.match(drafted.slice(existing.length), /study context/i); assert.match(drafted.slice(existing.length), /not observations, evidence, or conclusions/i); assert.ok(drafted.includes(protocols.getTopic('tls').questions[0])); assert.equal(existing, ' Existing expected controls.\r\nLeave this wording. ');});
test('repeating the same topic does not duplicate or alter the draft', () => { const protocols = require(modulePath); const once = protocols.draftExpected('Expected behavior', 'http'); assert.equal(protocols.draftExpected(once, 'http'), once); const both = protocols.draftExpected(once, 'ssh'); assert.ok(both.startsWith(once + '\n\n')); assert.ok(both.includes(protocols.getTopic('ssh').questions[0]));});
test('draft retains primary reference labels and URLs for exported study context', () => { const protocols = require(modulePath); const drafted = protocols.draftExpected('Existing controls', 'dns'); assert.ok(drafted.includes('RFC 1035 — DNS implementation and specification')); assert.ok(drafted.includes('https://www.rfc-editor.org/rfc/rfc1035.html')); assert.ok(drafted.includes('RFC 4033 — DNS security introduction and requirements')); assert.ok(drafted.includes('https://www.rfc-editor.org/rfc/rfc4033.html'));});
test('draft permits exactly 2000 characters and rejects overflow without truncation', () => { const protocols = require(modulePath); const emptyDraft = protocols.draftExpected('', 'dns'); const prefixLength = 2000 - emptyDraft.length - 2; assert.ok(prefixLength > 0); const prefix = 'x'.repeat(prefixLength); const drafted = protocols.draftExpected(prefix, 'dns'); assert.equal(drafted.length, 2000); assert.ok(drafted.startsWith(prefix + '\n\n')); assert.equal(protocols.draftExpected(drafted, 'dns'), drafted); assert.throws(() => protocols.draftExpected(prefix + 'x', 'dns'), /2000/); assert.throws(() => protocols.draftExpected(drafted + 'x', 'dns'), /2000/);});
test('draft rejects non-text values instead of coercing or discarding them', () => { const protocols = require(modulePath); for (const value of [null, undefined, {}, 123]) { assert.throws(() => protocols.draftExpected(value, 'http'), /text|string/i); }});
test('browser global supports drafting without storage or network capabilities', () => { const context = vm.createContext({}); vm.runInContext(fs.readFileSync(modulePath, 'utf8'), context); assert.equal(context.VeyraProtocols.getTopic('dns').id, 'dns'); assert.match(context.VeyraProtocols.draftExpected('', 'dns'), /study context/i);});PROVENANCE.md+7
README.md+4-1
SOURCE-MANIFEST.json+14-10
VERIFICATION.md+7
deploy_hf.py+2-1
docs/2026-11-15-protocol-context.mdAdded+23
index.html+5-2
static/app.js+93-14
static/index.html+5-2
static/protocols.jsAdded+95
static/style.css+3
tests/browser_protocols.cjsAdded+102
tests/test_protocols.cjsAdded+85