diff --git a/.github/workflows/test-playwright-full.yml b/.github/workflows/test-playwright-full.yml index 26a1b42cf0..b1aa091a12 100644 --- a/.github/workflows/test-playwright-full.yml +++ b/.github/workflows/test-playwright-full.yml @@ -23,13 +23,13 @@ jobs: tests: name: Run Playwright tests environment: ${{ inputs.environment }} - timeout-minutes: 60 + timeout-minutes: 30 runs-on: ubuntu-latest strategy: fail-fast: false matrix: - shardIndex: [1, 2, 3, 4] - shardTotal: [4] + shardIndex: [1, 2, 3, 4, 5, 6] + shardTotal: [6] steps: - name: Checkout uses: actions/checkout@v4 @@ -115,13 +115,17 @@ jobs: working-directory: site/gatsby-site - name: Run playwright tests - run: npx playwright test playwright/e2e-full/ --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} + run: npm run test:e2e:ci working-directory: site/gatsby-site env: E2E_ADMIN_PASSWORD: ${{ secrets.E2E_ADMIN_PASSWORD }} E2E_ADMIN_USERNAME: ${{ secrets.E2E_ADMIN_USERNAME }} IS_EMPTY_ENVIRONMENT: ${{ vars.IS_EMPTY_ENVIRONMENT }} MONGODB_CONNECTION_STRING: mongodb://127.0.0.1:4110/ + GATSBY_AVAILABLE_LANGUAGES: ${{ vars.GATSBY_AVAILABLE_LANGUAGES }} + SHARD_INDEX: ${{ matrix.shardIndex }} + SHARD_TOTAL: ${{ matrix.shardTotal }} + TEST_FOLDER: playwright/e2e-full/ - uses: actions/upload-artifact@v4 if: ${{ !cancelled() }} diff --git a/.github/workflows/test-playwright.yml b/.github/workflows/test-playwright.yml index 0ecb4f0818..dc69205a54 100644 --- a/.github/workflows/test-playwright.yml +++ b/.github/workflows/test-playwright.yml @@ -23,13 +23,13 @@ jobs: tests: name: Run Playwright tests environment: ${{ inputs.environment }} - timeout-minutes: 60 + timeout-minutes: 30 runs-on: ubuntu-latest strategy: fail-fast: false matrix: - shardIndex: [1, 2, 3, 4] - shardTotal: [4] + shardIndex: [1, 2, 3, 4, 5, 6] + shardTotal: [6] steps: - name: Checkout uses: actions/checkout@v4 @@ -71,13 +71,16 @@ jobs: working-directory: site/gatsby-site - name: Run playwright tests - run: npx playwright test playwright/e2e/ --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} + run: npm run test:e2e:ci working-directory: site/gatsby-site env: E2E_ADMIN_PASSWORD: ${{ secrets.E2E_ADMIN_PASSWORD }} E2E_ADMIN_USERNAME: ${{ secrets.E2E_ADMIN_USERNAME }} IS_EMPTY_ENVIRONMENT: ${{ vars.IS_EMPTY_ENVIRONMENT }} GATSBY_AVAILABLE_LANGUAGES: ${{ vars.GATSBY_AVAILABLE_LANGUAGES }} + SHARD_INDEX: ${{ matrix.shardIndex }} + SHARD_TOTAL: ${{ matrix.shardTotal }} + TEST_FOLDER: playwright/e2e/ - uses: actions/upload-artifact@v4 if: ${{ !cancelled() }} diff --git a/site/gatsby-site/cypress/e2e/integration/apps/csettool.cy.js b/site/gatsby-site/cypress/e2e/integration/apps/csettool.cy.js deleted file mode 100644 index 48571c86f9..0000000000 --- a/site/gatsby-site/cypress/e2e/integration/apps/csettool.cy.js +++ /dev/null @@ -1,497 +0,0 @@ -import { conditionalIt } from '../../../support/utils'; -import cssettool from '../../../fixtures/classifications/cssettool.json'; -import upsertCSETv1merge from '../../../fixtures/classifications/upsertCSETv1merge.json'; - -describe('CSET tool', () => { - const url = '/apps/csettool/52/'; - - function getRow(short_name, { index } = { index: 0 }) { - return cy.get(`[data-cy="column-${short_name}"]`).eq(index).parent().parent(); - } - - conditionalIt( - !Cypress.env('isEmptyEnvironment') && Cypress.env('e2eUsername') && Cypress.env('e2ePassword'), - 'Successfully loads CSET annotator classifications', - () => { - cy.login(Cypress.env('e2eUsername'), Cypress.env('e2ePassword')); - - cy.conditionalIntercept( - '**/graphql', - (req) => req.body.operationName == 'FindClassifications', - 'FindClassifications', - cssettool - ); - - cy.visit(url); - - cy.wait(['@FindClassifications']); - - cy.waitForStableDOM(); - - getRow('Incident Number').within(() => { - // same value should resolve automatically - cy.get('[data-cy="column-CSETv1_Annotator-1"]') - .should('have.text', '52') - .should('not.have.class', 'bg-red-100'); - cy.get('[data-cy="column-CSETv1_Annotator-2"]') - .should('have.text', '52') - .should('not.have.class', 'bg-red-100'); - cy.get('[data-cy="column-result"]') - .should('have.text', '52') - .should('have.class', 'bg-green-100'); - }); - - getRow('Annotator').within(() => { - // should be skipped - cy.get('[data-cy="column-CSETv1_Annotator-1"]') - .should('have.text', '"006"') - .should('have.class', 'bg-red-100'); - cy.get('[data-cy="column-CSETv1_Annotator-2"]') - .should('have.text', 'null') - .should('have.class', 'bg-red-100'); - cy.get('[data-cy="column-result"]').should('have.text', 'skipped'); - }); - - getRow('Physical Objects').within(() => { - // should ask for disambiguation - cy.get('[data-cy="column-CSETv1_Annotator-1"]') - .should('have.text', '"yes"') - .should('have.class', 'bg-red-100'); - - cy.get('[data-cy="column-CSETv1_Annotator-2"]') - .should('have.text', '"maybe"') - .should('have.class', 'bg-red-100'); - - cy.get('[data-cy="column-result"]').should('have.text', 'Please select a column'); - }); - - getRow('Harm Distribution Basis').within(() => { - // should merge arrays automatically - cy.get('[data-cy="column-CSETv1_Annotator-1"]') - .should('have.class', 'bg-red-100') - .find('span[data-cy="item"]') - .should(($items) => { - const items = ['"none"']; - - expect($items).to.have.length(items.length); - - $items.each((index, $item) => { - expect($item).to.have.text(items[index]); - }); - }); - - cy.get('[data-cy="column-CSETv1_Annotator-2"]') - .should('have.class', 'bg-red-100') - .find('span[data-cy="item"]') - .should(($items) => { - const items = ['"ideology"', '"financial means"', '"disability"']; - - expect($items).to.have.length(items.length); - - $items.each((index, $item) => { - expect($item).to.have.text(items[index]); - }); - }); - - cy.get('[data-cy="column-result"]') - .should('have.class', 'bg-green-100') - .find('span[data-cy="item"]') - .should(($items) => { - const items = ['"none"', '"ideology"', '"financial means"', '"disability"']; - - expect($items).to.have.length(items.length); - - $items.each((index, $item) => { - expect($item).to.have.text(items[index]); - }); - }); - }); - - getRow('notes').within(() => { - // should merge arrays automatically - cy.get('[data-cy="column-CSETv1_Annotator-1"]') - .should('have.text', 'This a note from the annotator 1') - .should('have.class', 'bg-red-100'); - cy.get('[data-cy="column-CSETv1_Annotator-2"]') - .should('have.text', 'This a note from the annotator 2') - .should('have.class', 'bg-red-100'); - cy.get('[data-cy="column-result"]') - .should( - 'have.text', - 'Annotator 1: \n\n This a note from the annotator 1\n\nAnnotator 2: \n\n This a note from the annotator 2' - ) - .should('have.class', 'bg-green-100'); - }); - - getRow('Notes (special interest intangible harm)').within(() => { - // should not mix annotator numbers - cy.get('[data-cy="column-CSETv1_Annotator-1"]') - .should('have.text', '') - .should('have.class', 'bg-red-100'); - cy.get('[data-cy="column-CSETv1_Annotator-2"]') - .should('have.text', 'This is a note from Annotator 2') - .should('have.class', 'bg-red-100'); - cy.get('[data-cy="column-result"]') - .should('have.text', 'Annotator 2: \n\n This is a note from Annotator 2') - .should('have.class', 'bg-green-100'); - }); - - getRow('Entities').within(() => { - // - - cy.get('[data-cy="column-CSETv1_Annotator-1"]').should('have.class', 'bg-red-100'); - - cy.get('[data-cy="column-CSETv1_Annotator-1"]') - .get('[data-cy="entity-Joshua Brown"]') - .should('be.visible'); - cy.get('[data-cy="column-CSETv1_Annotator-1"]') - .get('[data-cy="entity-Tesla Model S"]') - .should('be.visible'); - cy.get('[data-cy="column-CSETv1_Annotator-1"]') - .get('[data-cy="entity-Frank Baressi"]') - .should('be.visible'); - - // - - cy.get('[data-cy="column-CSETv1_Annotator-2"]').should('have.class', 'bg-red-100'); - - cy.get('[data-cy="column-CSETv1_Annotator-2"]') - .get('[data-cy="entity-Joshua Brown"]') - .should('be.visible'); - - // delete a duplicated entity - - cy.get('[data-cy="column-result"]').find('[data-cy*="entity-"]').should('have.length', 4); - - cy.get('[data-cy="column-CSETv1_Annotator-2"]') - .find('[data-cy="entity-Joshua Brown"]') - .parent() - .find('button') - .click(); - - cy.get('[data-cy="column-result"]').find('[data-cy*="entity-"]').should('have.length', 3); - }); - - getRow('Estimated Harm Quantities').within(() => { - // should ask for disambiguation for different boolean values - cy.get('[data-cy="column-CSETv1_Annotator-1"]') - .should('have.text', 'true') - .should('have.class', 'bg-red-100'); - cy.get('[data-cy="column-CSETv1_Annotator-2"]') - .should('have.text', 'false') - .should('have.class', 'bg-red-100'); - cy.get('[data-cy="column-result"]') - .should('have.text', 'Please select a column') - .should('have.class', 'bg-red-100'); - }); - - cy.contains('Merge Classifications').should('be.disabled'); - - // disambiguate and submit - - getRow('Physical Objects').within(() => { - cy.get('[data-cy="column-CSETv1_Annotator-1"]').click(); - }); - - getRow('Entertainment Industry').within(() => { - cy.get('[data-cy="column-CSETv1_Annotator-1"]').click(); - }); - - getRow('Tangible Harm').within(() => { - cy.get('[data-cy="column-CSETv1_Annotator-1"]').click(); - }); - - getRow('AI System').within(() => { - cy.get('[data-cy="column-CSETv1_Annotator-1"]').click(); - }); - - getRow('User Test in Controlled Conditions').within(() => { - cy.get('[data-cy="column-CSETv1_Annotator-1"]').click(); - }); - - getRow('Estimated Harm Quantities').within(() => { - cy.get('[data-cy="column-CSETv1_Annotator-1"]').click(); - }); - - getRow('Quality Control').within(() => { - cy.get('[data-cy="column-CSETv1_Annotator-2"]').click(); - }); - - getRow( - 'There is a potentially identifiable specific entity that experienced the harm' - ).within(() => { - cy.get('[data-cy="column-CSETv1_Annotator-1"]').click(); - }); - - getRow('Harmed Class of Entities').within(() => { - cy.get('[data-cy="column-CSETv1_Annotator-1"]').click(); - }); - - getRow('Estimated Date').within(() => { - cy.get('[data-cy="column-CSETv1_Annotator-1"]').click(); - }); - - cy.conditionalIntercept( - '**/graphql', - (req) => req.body.operationName == 'UpsertClassification', - 'UpsertClassification', - upsertCSETv1merge - ); - - cy.contains('Merge Classifications').click(); - - cy.wait('@UpsertClassification').then((xhr) => { - expect(xhr.request.body.variables.query).to.deep.eq({ - incidents: { incident_id: 52 }, - namespace: 'CSETv1', - }); - - expect(xhr.request.body.variables.data).to.deep.eq({ - incidents: { link: [52] }, - reports: { link: [] }, - namespace: 'CSETv1', - notes: - 'Annotator 1: \n\n This a note from the annotator 1\n\nAnnotator 2: \n\n This a note from the annotator 2', - attributes: [ - { - short_name: 'Incident Number', - value_json: '52', - }, - { - short_name: 'Quality Control', - value_json: 'true', - }, - { - short_name: 'Physical Objects', - value_json: '"yes"', - }, - { - short_name: 'Entertainment Industry', - value_json: '"no"', - }, - { - short_name: 'Report, Test, or Study of data', - value_json: '"no"', - }, - { - short_name: 'Deployed', - value_json: '"yes"', - }, - { - short_name: 'Producer Test in Controlled Conditions', - value_json: '"no"', - }, - { - short_name: 'Producer Test in Operational Conditions', - value_json: '"no"', - }, - { - short_name: 'User Test in Controlled Conditions', - value_json: '"no"', - }, - { - short_name: 'User Test in Operational Conditions', - value_json: '"no"', - }, - { - short_name: 'Harm Domain', - value_json: '"yes"', - }, - { - short_name: 'Tangible Harm', - value_json: '"tangible harm definitively occurred"', - }, - { - short_name: 'AI System', - value_json: '"yes"', - }, - { - short_name: 'Clear link to technology', - value_json: '"yes"', - }, - { - short_name: - 'There is a potentially identifiable specific entity that experienced the harm', - value_json: 'true', - }, - { - short_name: 'AI Harm Level', - value_json: '"AI tangible harm near-miss"', - }, - { - short_name: 'AI Tangible Harm Level Notes', - value_json: - '"Annotator 1: \\n\\n The Tesla\'s autopilot failed to notice the trailer of the trucker and deploy breaks. This could have minimized damage during the crash. However, the crash was ultimately at fault of the Tesla driver."', - }, - { - short_name: 'Impact on Critical Services', - value_json: '"no"', - }, - { - short_name: 'Rights Violation', - value_json: '"no"', - }, - { - short_name: 'Involving Minor', - value_json: '"no"', - }, - { - short_name: 'Detrimental Content', - value_json: '"no"', - }, - { - short_name: 'Protected Characteristic', - value_json: '"no"', - }, - { - short_name: 'Harm Distribution Basis', - value_json: '["none","ideology","financial means","disability"]', - }, - { - short_name: 'Notes (special interest intangible harm)', - value_json: '"Annotator 2: \\n\\n This is a note from Annotator 2"', - }, - { - short_name: 'Special Interest Intangible Harm', - value_json: '"no"', - }, - { - short_name: 'Clear link to Technology', - value_json: '"no"', - }, - { - short_name: 'Harmed Class of Entities', - value_json: 'true', - }, - { - short_name: 'Annotator’s AI special interest intangible harm assessment', - value_json: '"no"', - }, - { - short_name: 'Notes (AI special interest intangible harm)', - value_json: '""', - }, - { - short_name: 'Date of Incident Year', - value_json: '"2016"', - }, - { - short_name: 'Date of Incident Month', - value_json: '"05"', - }, - { - short_name: 'Date of Incident Day', - value_json: '"07"', - }, - { - short_name: 'Estimated Date', - value_json: 'true', - }, - { - short_name: 'Multiple AI Interaction', - value_json: '"no"', - }, - { - short_name: 'Embedded', - value_json: '"yes"', - }, - { - short_name: 'Location City', - value_json: '"Williston"', - }, - { - short_name: 'Location State/Province (two letters)', - value_json: '"FL"', - }, - { - short_name: 'Location Country (two letters)', - value_json: '"US"', - }, - { - short_name: 'Location Region', - value_json: '"North America"', - }, - { - short_name: 'Infrastructure Sectors', - value_json: '[]', - }, - { - short_name: 'Operating Conditions', - value_json: '""', - }, - { - short_name: 'Notes (Environmental and Temporal Characteristics)', - value_json: '""', - }, - { - short_name: 'Entities', - value_json: - '[{"attributes":[{"short_name":"Entity","value_json":"\\"Joshua Brown\\""},{"short_name":"Named Entity","value_json":"true"},{"short_name":"Entity type","value_json":"\\"individual\\""},{"short_name":"Entity Relationship to the AI","value_json":"[\\"user\\"]"},{"short_name":"Harm Category Experienced","value_json":"\\"AI tangible harm event\\""},{"short_name":"Harm Type Experienced","value_json":"\\"physical health/safety\\""},{"short_name":"Notes (Characterizing Entities and the Harm)","value_json":"\\"Tesla Autopilot failed to detected truck and deploy its breaks. This could have minimized damaged during the crash. Ultimately, the Tesla was responsible for the crash\\""}]},{"attributes":[{"short_name":"Entity","value_json":"\\"Tesla Model S\\""},{"short_name":"Named Entity","value_json":"true"},{"short_name":"Entity type","value_json":"\\"product\\""},{"short_name":"Entity Relationship to the AI","value_json":"[\\"product containing AI\\"]"},{"short_name":"Harm Category Experienced","value_json":"\\"AI tangible harm event\\""},{"short_name":"Harm Type Experienced","value_json":"\\"physical property\\""},{"short_name":"Notes (Characterizing Entities and the Harm)","value_json":"\\"Autopilot failed to deploy breaks which could have minimized damage in the crash\\""}]},{"attributes":[{"short_name":"Entity","value_json":"\\"Frank Baressi\\""},{"short_name":"Named Entity","value_json":"true"},{"short_name":"Entity type","value_json":"\\"individual\\""},{"short_name":"Entity Relationship to the AI","value_json":"[\\"user\\"]"},{"short_name":"Harm Category Experienced","value_json":"\\"AI tangible harm event\\""},{"short_name":"Harm Type Experienced","value_json":"\\"physical property\\""},{"short_name":"Notes (Characterizing Entities and the Harm)","value_json":"\\"Truck driver hit by Tesla. Damage to truck could have been minimized by the deployment of breaks\\""}]}]', - }, - { - short_name: 'Lives Lost', - value_json: '1', - }, - { - short_name: 'Injuries', - value_json: '-2', - }, - { - short_name: 'Estimated Harm Quantities', - value_json: 'true', - }, - { - short_name: 'Notes ( Tangible Harm Quantities Information)', - value_json: '""', - }, - { - short_name: 'AI System Description', - value_json: '"Tesla Autopilot. "', - }, - { - short_name: 'Data Inputs', - value_json: - '["video input","navigation","sensor data","tra","road data","traffic","GPS"]', - }, - { - short_name: 'Sector of Deployment', - value_json: '["transportation and storage"]', - }, - { - short_name: 'Public Sector Deployment', - value_json: '"no"', - }, - { - short_name: 'Autonomy Level', - value_json: '"Autonomy2"', - }, - { - short_name: 'Notes (Information about AI System)', - value_json: '""', - }, - { - short_name: 'Intentional Harm', - value_json: '"No. Not intentionally designed to perform harm"', - }, - { - short_name: 'Physical System Type', - value_json: '"Automobile"', - }, - { - short_name: 'AI Task', - value_json: '["navigation","transportation"]', - }, - { - short_name: 'AI tools and methods', - value_json: '["Autonomous Driving"]', - }, - { - short_name: 'Notes (AI Functionality and Techniques)', - value_json: '""', - }, - ], - }); - }); - } - ); -}); diff --git a/site/gatsby-site/cypress/e2e/integration/confirmemail.cy.js b/site/gatsby-site/cypress/e2e/integration/confirmemail.cy.js deleted file mode 100644 index 0564e47aa1..0000000000 --- a/site/gatsby-site/cypress/e2e/integration/confirmemail.cy.js +++ /dev/null @@ -1,49 +0,0 @@ -describe('Confirm email', () => { - const url = '/confirmemail'; - - it('Should successfully load confirm email page', () => { - cy.visit(url); - }); - - it('Should display Invalid params messsage when token or tokenId are missing', () => { - cy.visit(`${url}?token=dummyToken`); - - cy.contains('Invalid parameters').should('exist'); - cy.get('[data-cy="confirm-login-btn"]').should('exist'); - - cy.get('#content').contains('An unknown error has occurred').should('exist'); - - cy.visit(`${url}?tokenId=dummyTokenId`); - - cy.contains('Invalid parameters').should('exist'); - cy.get('[data-cy="confirm-login-btn"]').should('exist'); - - cy.get('#content').contains('An unknown error has occurred').should('exist'); - }); - - it('Should display an error message if the confirmation failed on Atlas', () => { - cy.visit(`${url}?token=invalidToken&tokenId=invalidTokenId`); - - cy.get('[data-cy="toast"]').contains('An unknown error has occurred').should('exist'); - cy.get('[data-cy="confirm-login-btn"]').should('exist'); - - cy.get('#content').contains('An unknown error has occurred').should('exist'); - }); - - it('Should display success message if the email is confirmed on Atlas', () => { - cy.intercept('POST', '**/confirm', { - statusCode: 201, - }); - - cy.visit(`${url}?token=dummyToken&tokenId=dummyTokenId`); - - cy.get('[data-cy="toast"]').contains('Thank you for verifying your account.').should('exist'); - cy.get('[data-cy="confirm-login-btn"]').should('exist'); - - cy.get('#content').contains('Thank you for verifying your account.').should('exist'); - - cy.get('[data-cy="confirm-login-btn"]').click(); - cy.location('pathname', { timeout: 8000 }).should('eq', '/login/'); - cy.location('search', { timeout: 8000 }).should('eq', '?redirectTo=/account/'); - }); -}); diff --git a/site/gatsby-site/package.json b/site/gatsby-site/package.json index d433600fd1..6fd4c6568f 100644 --- a/site/gatsby-site/package.json +++ b/site/gatsby-site/package.json @@ -130,7 +130,7 @@ "cypress:open": "cypress open", "cypress:run": "cypress run", "test:e2e": "start-server-and-test start http://localhost:8000 cypress:open", - "test:e2e:ci": "start-server-and-test start http://localhost:8000 cypress:run", + "test:e2e:ci": "DEBUG=pw:api,pw:webserver npx playwright test $TEST_FOLDER --shard=$SHARD_INDEX/$SHARD_TOTAL", "test:api": "jest --setupFiles dotenv/config --runInBand --forceExit", "test:api:ci": "jest --runInBand --forceExit", "codegen": "graphql-codegen --config codegen.ts", diff --git a/site/gatsby-site/playwright.config.ts b/site/gatsby-site/playwright.config.ts index 4e4a9cb158..17a3725913 100644 --- a/site/gatsby-site/playwright.config.ts +++ b/site/gatsby-site/playwright.config.ts @@ -13,19 +13,19 @@ export default defineConfig({ testDir: './playwright', globalTimeout: process.env.CI ? 60 * 60 * 1000 : undefined, expect: { - timeout: process.env.CI ? 30000 : undefined, + timeout: process.env.CI ? 60000 : 30000, }, - timeout: process.env.CI ? 60000 : undefined, + timeout: process.env.CI ? 180000 : 90000, /* Run tests in files in parallel */ fullyParallel: true, /* Fail the build on CI if you accidentally left test.only in the source code. */ forbidOnly: !!process.env.CI, /* Retry on CI only */ retries: process.env.CI ? 3 : 0, - /* Opt out of parallel tests on CI. */ - workers: process.env.CI ? 1 : undefined, + // TODO: We can handle only one worker because tests share the same database and many tests are resetting the database. + workers: process.env.CI ? 1 : 1, /* Reporter to use. See https://playwright.dev/docs/test-reporters */ - reporter: process.env.CI ? 'blob' : 'html', + reporter: process.env.CI ? [['blob'], ['line', { printSteps: true }]] : 'html', /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ use: { /* Base URL to use in actions like `await page.goto('/')`. */ @@ -75,7 +75,7 @@ export default defineConfig({ /* Run your local dev server before starting the tests */ webServer: { - command: 'NODE_OPTIONS=--max-old-space-size=5600 npm run serve', + command: 'npx -y pm2 start npm --name "web-server" -- run serve && npx pm2 logs "web-server"', url: 'http://localhost:8000', reuseExistingServer: !process.env.CI, }, diff --git a/site/gatsby-site/playwright/e2e-full/admin.spec.ts b/site/gatsby-site/playwright/e2e-full/admin.spec.ts index 33311ac023..35ef3a1c55 100644 --- a/site/gatsby-site/playwright/e2e-full/admin.spec.ts +++ b/site/gatsby-site/playwright/e2e-full/admin.spec.ts @@ -5,6 +5,10 @@ import { init } from '../memory-mongo'; test.describe('Admin', () => { const baseUrl = '/admin'; + test.beforeEach(async () => { + await init(); + }); + test('Should show not enough permissions message', async ({ page }) => { await page.goto(baseUrl); await expect(page.getByText("Not enough permissions")).toBeVisible({ timeout: 30000 }); diff --git a/site/gatsby-site/playwright/e2e-full/apps/csettool.spec.ts b/site/gatsby-site/playwright/e2e-full/apps/csettool.spec.ts new file mode 100644 index 0000000000..62e68e4798 --- /dev/null +++ b/site/gatsby-site/playwright/e2e-full/apps/csettool.spec.ts @@ -0,0 +1,93 @@ +import { expect } from '@playwright/test'; +import { query, test } from '../../utils'; +import gql from 'graphql-tag'; +import { init } from '../../memory-mongo'; + +test.describe('CSET tool', () => { + const url = '/apps/csettool/2/'; + + async function getRow(page, short_name: string, index = 0) { + return page.locator(`[data-cy="column-${short_name}"]`).nth(index).locator('..').locator('..'); + } + + test('Successfully loads CSET annotator classifications', async ({ page, login }) => { + + await init(); + + await login(process.env.E2E_ADMIN_USERNAME, process.env.E2E_ADMIN_PASSWORD, { customData: { roles: ['admin'] } }); + + await page.goto(url); + await page.waitForSelector('[data-cy="column-Incident Number"]'); + + const incidentRow = await getRow(page, 'Incident Number'); + await expect(incidentRow.locator('[data-cy="column-CSETv1_Annotator-1"]')).toHaveText('2'); + await expect(incidentRow.locator('[data-cy="column-CSETv1_Annotator-1"]')).not.toHaveClass('bg-green-100'); + await expect(incidentRow.locator('[data-cy="column-CSETv1_Annotator-2"]')).toHaveText('2'); + await expect(incidentRow.locator('[data-cy="column-CSETv1_Annotator-2"]')).not.toHaveClass('bg-green-100'); + await expect(incidentRow.locator('[data-cy="column-result"]')).toHaveText('2'); + await expect(incidentRow.locator('[data-cy="column-result"]')).toHaveClass(/bg\-green\-100/); + + const annotatorRow = await getRow(page, 'Annotator'); + await expect(annotatorRow.locator('[data-cy="column-CSETv1_Annotator-1"]')).toHaveText('"005"'); + await expect(annotatorRow.locator('[data-cy="column-CSETv1_Annotator-1"]')).toHaveClass(/bg\-red\-100/); + await expect(annotatorRow.locator('[data-cy="column-CSETv1_Annotator-2"]')).toHaveText('"001"'); + await expect(annotatorRow.locator('[data-cy="column-CSETv1_Annotator-2"]')).toHaveClass(/bg\-red\-100/); + await expect(annotatorRow.locator('[data-cy="column-result"]')).toHaveText('skipped'); + + const physicalObjectsRow = await getRow(page, 'Physical Objects'); + await expect(physicalObjectsRow.locator('[data-cy="column-CSETv1_Annotator-1"]')).toHaveText('"no"'); + await expect(physicalObjectsRow.locator('[data-cy="column-CSETv1_Annotator-1"]')).toHaveClass(/bg\-red\-100/); + await expect(physicalObjectsRow.locator('[data-cy="column-CSETv1_Annotator-2"]')).toHaveText('"maybe"'); + await expect(physicalObjectsRow.locator('[data-cy="column-CSETv1_Annotator-2"]')).toHaveClass(/bg\-red\-100/); + await expect(physicalObjectsRow.locator('[data-cy="column-result"]')).toHaveText('Please select a column'); + + // Disambiguate and submit + await (await getRow(page, 'Physical Objects')).locator('[data-cy="column-CSETv1_Annotator-1"]').click(); + await (await getRow(page, 'AI System Description')).locator('[data-cy="column-CSETv1_Annotator-1"]').click(); + + + await page.getByText('Merge Classifications').click(); + + await expect(page.getByText('Classification updated ')).toBeVisible(); + + + const { data: { classifications } } = await query({ + query: gql` + query ($filter: ClassificationFilterType) { + classifications(filter: $filter) { + namespace + incidents { + incident_id + } + reports { + report_number + } + attributes { + short_name + value_json + } + } + }`, + variables: { + "filter": { + "namespace": { + "EQ": "CSETv1" + }, + "incidents": { + "EQ": 2 + } + } + } + }) + + expect(classifications).toMatchObject([ + { + namespace: 'CSETv1', + incidents: [ + { incident_id: 2 } + ], + reports: [], + } + ]); + }); +}); \ No newline at end of file diff --git a/site/gatsby-site/playwright/e2e-full/apps/variants.spec.ts b/site/gatsby-site/playwright/e2e-full/apps/variants.spec.ts index eef60ebffc..628f50a751 100644 --- a/site/gatsby-site/playwright/e2e-full/apps/variants.spec.ts +++ b/site/gatsby-site/playwright/e2e-full/apps/variants.spec.ts @@ -59,6 +59,8 @@ test.describe('Variants App', () => { test('Should Approve a Variant - Incident Editor user', async ({ page, login }) => { + await init(); + await login(process.env.E2E_ADMIN_USERNAME, process.env.E2E_ADMIN_PASSWORD, { customData: { roles: ['incident_editor'], first_name: 'John', last_name: 'Doe' } }); await page.goto(url); @@ -73,6 +75,8 @@ test.describe('Variants App', () => { test('Should Reject a Variant - Incident Editor user', async ({ page, login }) => { + await init(); + await login(process.env.E2E_ADMIN_USERNAME, process.env.E2E_ADMIN_PASSWORD, { customData: { roles: ['incident_editor'], first_name: 'John', last_name: 'Doe' } }); await page.goto(url); @@ -87,6 +91,8 @@ test.describe('Variants App', () => { test('Should Edit a Variant - Incident Editor user', async ({ page, login }) => { + await init(); + await login(process.env.E2E_ADMIN_USERNAME, process.env.E2E_ADMIN_PASSWORD, { customData: { roles: ['incident_editor'], first_name: 'John', last_name: 'Doe' } }); const newDatePublished = '2000-01-01'; diff --git a/site/gatsby-site/playwright/e2e-full/cite.spec.ts b/site/gatsby-site/playwright/e2e-full/cite.spec.ts index ad6a761bf5..63e217b59b 100644 --- a/site/gatsby-site/playwright/e2e-full/cite.spec.ts +++ b/site/gatsby-site/playwright/e2e-full/cite.spec.ts @@ -7,7 +7,8 @@ import incident50 from '../fixtures/incidents/fullIncident50.json'; import { gql } from '@apollo/client'; import { expect } from '@playwright/test'; import config from '../config'; -import { init, seedCollection, seedFixture } from '../memory-mongo'; +import { init } from '../memory-mongo'; +import { DBIncident } from '../seeds/aiidprod/incidents'; test.describe('Cite pages', () => { const discoverUrl = '/apps/discover'; @@ -419,9 +420,9 @@ test.describe('Cite pages', () => { test('Should flag an incident as not related (authenticated)', async ({ page, login }) => { - const userId = await login(config.E2E_ADMIN_USERNAME, config.E2E_ADMIN_PASSWORD); + await init(); - await init({ customData: { users: [{ userId, first_name: 'Test', last_name: 'User', roles: ['admin'] }] } }); + await login(config.E2E_ADMIN_USERNAME, config.E2E_ADMIN_PASSWORD, { customData: { first_name: 'Test', last_name: 'User', roles: ['admin'] } }); await conditionalIntercept( page, @@ -485,7 +486,7 @@ test.describe('Cite pages', () => { await expect(page.locator('head meta[name="twitter:site"]')).toHaveAttribute('content', '@IncidentsDB'); await expect(page.locator('head meta[name="twitter:creator"]')).toHaveAttribute('content', '@IncidentsDB'); - await expect(page.locator('head meta[property="og:url"]')).toHaveAttribute('content', `https://incidentdatabase.ai${url}/`); + await expect(page.locator('head meta[property="og:url"]')).toHaveAttribute('content', new RegExp(`^https://incidentdatabase.ai${url}/?$`)); await expect(page.locator('head meta[property="og:type"]')).toHaveAttribute('content', 'website'); await expect(page.locator('head meta[property="og:title"]')).toHaveAttribute('content', title); await expect(page.locator('head meta[property="og:description"]')).toHaveAttribute('content', description); @@ -635,4 +636,27 @@ test.describe('Cite pages', () => { expect(data.incident_2).toMatchObject({ editor_dissimilar_incidents: [3], editor_similar_incidents: [] }); expect(data.incident_3).toMatchObject({ editor_dissimilar_incidents: [2], editor_similar_incidents: [1] }); }); + + test('Should load incident data not yet in build', async ({ page }) => { + + const incident: DBIncident = { + incident_id: 4, + title: 'Test Title', + description: 'Incident 4 description', + date: "2020-01-01", + "Alleged deployer of AI system": ["entity1"], + "Alleged developer of AI system": ["entity2"], + "Alleged harmed or nearly harmed parties": ["entity3"], + editors: ["user1"], + reports: [1], + } + + await init({ aiidprod: { incidents: [incident] } }); + + await page.goto('/cite/4'); + + await expect(page.getByText('Incident 4: Test Title')).toBeVisible(); + await expect(page.getByText('Incident 4 description')).toBeVisible(); + await expect(page.getByText('Alleged: Entity 2 developed an AI system deployed by Entity 1, which harmed Entity 3.')).toBeVisible() + }); }); \ No newline at end of file diff --git a/site/gatsby-site/playwright/e2e-full/citeEdit.spec.ts b/site/gatsby-site/playwright/e2e-full/citeEdit.spec.ts index 50568f2912..989e4fb361 100644 --- a/site/gatsby-site/playwright/e2e-full/citeEdit.spec.ts +++ b/site/gatsby-site/playwright/e2e-full/citeEdit.spec.ts @@ -9,6 +9,11 @@ import gql from 'graphql-tag'; test.describe('Edit report', () => { const url = '/cite/edit?report_number=3&incident_id=3'; + test.beforeEach(async () => { + + await init(); + }); + test('Successfully loads', async ({ page }) => { await page.goto(url); }); @@ -17,8 +22,7 @@ test.describe('Edit report', () => { test.slow(); - const userId = await login(config.E2E_ADMIN_USERNAME, config.E2E_ADMIN_PASSWORD); - await init({ customData: { users: [{ userId, first_name: 'Test', last_name: 'User', roles: ['admin'] }] }, }, { drop: true }); + await login(config.E2E_ADMIN_USERNAME, config.E2E_ADMIN_PASSWORD, { customData: { roles: ['admin'] } }); // TODO: delete once we implement the new report history // it should be done inside the report mutation resolver @@ -147,8 +151,7 @@ test.describe('Edit report', () => { test.slow(); - const userId = await login(config.E2E_ADMIN_USERNAME, config.E2E_ADMIN_PASSWORD); - await init({ customData: { users: [{ userId, first_name: 'Test', last_name: 'User', roles: ['admin'] }] } }, { drop: true }); + await login(config.E2E_ADMIN_USERNAME, config.E2E_ADMIN_PASSWORD, { customData: { roles: ['admin'] } }); await conditionalIntercept( page, @@ -231,8 +234,7 @@ test.describe('Edit report', () => { test('Should delete incident report', async ({ page, login }) => { - const userId = await login(config.E2E_ADMIN_USERNAME, config.E2E_ADMIN_PASSWORD); - await init({ customData: { users: [{ userId, first_name: 'Test', last_name: 'User', roles: ['admin'] }] } }, { drop: true }); + await login(config.E2E_ADMIN_USERNAME, config.E2E_ADMIN_PASSWORD, { customData: { roles: ['admin'] } }); await page.goto(url); @@ -323,8 +325,7 @@ test.describe('Edit report', () => { test.slow(); - const userId = await login(config.E2E_ADMIN_USERNAME, config.E2E_ADMIN_PASSWORD); - await init({ customData: { users: [{ userId, first_name: 'Test', last_name: 'User', roles: ['admin'] }] } }, { drop: true }); + await login(config.E2E_ADMIN_USERNAME, config.E2E_ADMIN_PASSWORD, { customData: { roles: ['admin'] } }); await conditionalIntercept( page, @@ -371,9 +372,7 @@ test.describe('Edit report', () => { test('Should display the report image', async ({ page, login }) => { - const userId = await login(config.E2E_ADMIN_USERNAME, config.E2E_ADMIN_PASSWORD); - await init({ customData: { users: [{ userId, first_name: 'Test', last_name: 'User', roles: ['admin'] }] } }, { drop: true }); - + await login(config.E2E_ADMIN_USERNAME, config.E2E_ADMIN_PASSWORD, { customData: { roles: ['admin'] } }); await page.goto(url); await page.locator('[data-cy="image-preview-figure"] img').waitFor(); diff --git a/site/gatsby-site/playwright/e2e-full/classificationsEditor.spec.ts b/site/gatsby-site/playwright/e2e-full/classificationsEditor.spec.ts index 19c8a23453..d4e8893fcf 100644 --- a/site/gatsby-site/playwright/e2e-full/classificationsEditor.spec.ts +++ b/site/gatsby-site/playwright/e2e-full/classificationsEditor.spec.ts @@ -76,6 +76,9 @@ test.describe('Classifications Editor', () => { }); test('Should show classifications editor on incident page and save edited values', async ({ page, login, skipOnEmptyEnvironment }) => { + + await init(); + await login(process.env.E2E_ADMIN_USERNAME, process.env.E2E_ADMIN_PASSWORD, { customData: { roles: ['admin'] } }); await page.goto(incidentURL); @@ -141,7 +144,10 @@ test.describe('Classifications Editor', () => { }); test('Should show classifications editor on report page and add a new classification', async ({ page, login, skipOnEmptyEnvironment }) => { - await login(process.env.E2E_ADMIN_USERNAME, process.env.E2E_ADMIN_PASSWORD, { customData: { userId: 1, first_name: 'John', last_name: 'Doe', roles: ['admin'] } }); + + await init(); + + await login(process.env.E2E_ADMIN_USERNAME, process.env.E2E_ADMIN_PASSWORD, { customData: { first_name: 'John', last_name: 'Doe', roles: ['admin'] } }); await page.goto(reportURL); await waitForRequest('FindClassifications'); @@ -183,6 +189,9 @@ test.describe('Classifications Editor', () => { for (const namespace of namespaces) { test(`Should properly display and store ${namespace} classification values`, async ({ page, login, skipOnEmptyEnvironment }) => { + + await init(); + await login(process.env.E2E_ADMIN_USERNAME, process.env.E2E_ADMIN_PASSWORD, { customData: { first_name: 'John', last_name: 'Doe', roles: ['admin'] } }); await page.goto('/cite/1'); diff --git a/site/gatsby-site/playwright/e2e-full/incidents/edit.spec.ts b/site/gatsby-site/playwright/e2e-full/incidents/edit.spec.ts index 3f93544c18..bc5fec2161 100644 --- a/site/gatsby-site/playwright/e2e-full/incidents/edit.spec.ts +++ b/site/gatsby-site/playwright/e2e-full/incidents/edit.spec.ts @@ -1,5 +1,5 @@ import { expect } from '@playwright/test'; -import { conditionalIntercept, waitForRequest, test } from '../../utils'; +import { conditionalIntercept, waitForRequest, test, fillAutoComplete } from '../../utils'; import { init } from '../../memory-mongo'; test.describe('Incidents', () => { @@ -7,16 +7,15 @@ test.describe('Incidents', () => { test('Should successfully edit incident fields', async ({ page, login }) => { - const userId = await login(process.env.E2E_ADMIN_USERNAME, process.env.E2E_ADMIN_PASSWORD, { customData: { roles: ['admin'], first_name: 'John', last_name: 'Doe' } }); - await init({ customData: { users: [ - { userId, first_name: 'John', last_name: 'Doe', roles: ['admin'] }, { userId: 'pablo', first_name: 'Pablo', last_name: 'Costa', roles: ['admin'] }, ] } - }, { drop: false }); + }); + + await login(process.env.E2E_ADMIN_USERNAME, process.env.E2E_ADMIN_PASSWORD, { customData: { roles: ['admin'], first_name: 'John', last_name: 'Doe' } }); await page.goto(url); @@ -36,8 +35,7 @@ test.describe('Incidents', () => { await expect(await page.locator('[title="Sean McGregor"]')).toBeVisible(); - await page.locator('#input-editors').fill('Pablo'); - await page.locator('[aria-label="Pablo Costa"]').click(); + await fillAutoComplete(page, '#input-editors', 'Pab', 'Pablo Costa'); await conditionalIntercept(page, '**/graphql', (req) => req.postDataJSON().operationName == 'logIncidentHistory', { data: { diff --git a/site/gatsby-site/playwright/e2e-full/incidents/new.spec.ts b/site/gatsby-site/playwright/e2e-full/incidents/new.spec.ts index 919278f56e..59f66e0ea9 100644 --- a/site/gatsby-site/playwright/e2e-full/incidents/new.spec.ts +++ b/site/gatsby-site/playwright/e2e-full/incidents/new.spec.ts @@ -1,5 +1,4 @@ -import { test, conditionalIntercept, waitForRequest, query } from '../../utils'; -import { expect } from '@playwright/test'; +import { test, conditionalIntercept, waitForRequest, query, fillAutoComplete } from '../../utils'; import { init } from '../../memory-mongo'; test.describe('New Incident page', () => { @@ -11,6 +10,8 @@ test.describe('New Incident page', () => { test('Should successfully create a new incident', async ({ page, login }) => { + await init(); + test.slow(); await login(process.env.E2E_ADMIN_USERNAME, process.env.E2E_ADMIN_PASSWORD, { customData: { roles: ['admin'], first_name: 'John', last_name: 'Doe' } }); @@ -34,12 +35,7 @@ test.describe('New Incident page', () => { await page.locator('[data-cy="alleged-harmed-or-nearly-harmed-parties-input"] input').first().fill('children'); await page.keyboard.press('Enter'); - await expect(async () => { - await page.locator('#input-editors').clear(); - await page.waitForTimeout(1000); - await page.locator('#input-editors').pressSequentially('Joh', { delay: 500 }); - await page.getByText('John Doe').click({ timeout: 1000 }); - }).toPass(); + await fillAutoComplete(page, '#input-editors', 'Joh', 'John Doe'); await conditionalIntercept(page, '**/graphql', @@ -54,11 +50,13 @@ test.describe('New Incident page', () => { await waitForRequest('logIncidentHistory'); - await page.getByText(`You have successfully create Incident ${4}. View incident`).waitFor(); + await page.getByText(`You have successfully create Incident 4. View incident`).waitFor(); }); test('Should clone an incident', async ({ page, login }) => { + await init(); + test.slow(); await login(process.env.E2E_ADMIN_USERNAME, process.env.E2E_ADMIN_PASSWORD, { customData: { roles: ['admin'], first_name: 'John', last_name: 'Doe' } }); diff --git a/site/gatsby-site/playwright/e2e-full/submit.spec.ts b/site/gatsby-site/playwright/e2e-full/submit.spec.ts index a0d50b620b..ed62314a48 100644 --- a/site/gatsby-site/playwright/e2e-full/submit.spec.ts +++ b/site/gatsby-site/playwright/e2e-full/submit.spec.ts @@ -1,5 +1,5 @@ import parseNews from '../fixtures/api/parseNews.json'; -import { conditionalIntercept, waitForRequest, setEditorText, test, trackRequest, query } from '../utils'; +import { conditionalIntercept, waitForRequest, setEditorText, test, trackRequest, query, fillAutoComplete } from '../utils'; import { expect } from '@playwright/test'; import config from '../config'; import { init } from '../memory-mongo'; @@ -147,9 +147,9 @@ test.describe('The Submit form', () => { test('As editor, should submit a new incident report, adding an incident title and editors.', async ({ page, login, skipOnEmptyEnvironment }) => { - const userId = await login(config.E2E_ADMIN_USERNAME, config.E2E_ADMIN_PASSWORD); + await init(); - await init({ customData: { users: [{ userId, first_name: 'Test', last_name: 'User', roles: ['admin'] }] } }, { drop: true }); + const userId = await login(config.E2E_ADMIN_USERNAME, config.E2E_ADMIN_PASSWORD, { customData: { first_name: 'Cesar', last_name: 'Ito', roles: ['admin'] } }); await conditionalIntercept( page, @@ -201,9 +201,7 @@ test.describe('The Submit form', () => { await page.locator('[name="description"]').fill('Description'); - await page.locator('#input-incident_editors').fill('Test'); - - await page.locator('[aria-label="Test User"]').click(); + await fillAutoComplete(page, "#input-incident_editors", 'Ces', 'Cesar Ito'); await page.locator('[name="tags"]').fill('New Tag'); await page.keyboard.press('Enter'); @@ -309,7 +307,7 @@ test.describe('The Submit form', () => { await expect(page.locator(':text("Report successfully added to review queue")')).toBeVisible(); - await login(config.E2E_ADMIN_USERNAME, config.E2E_ADMIN_PASSWORD); + await login(config.E2E_ADMIN_USERNAME, config.E2E_ADMIN_PASSWORD, { customData: { first_name: 'Test', last_name: 'User', roles: ['admin'] } }); await page.goto('/apps/submitted'); @@ -390,10 +388,7 @@ test.describe('The Submit form', () => { test('Should submit a submission and link it to the current user id', async ({ page, login, skipOnEmptyEnvironment }) => { - const userId = await login(config.E2E_ADMIN_USERNAME, config.E2E_ADMIN_PASSWORD); - - await init({ customData: { users: [{ userId, first_name: 'Test', last_name: 'User', roles: ['admin'] }] } }, { drop: true }); - + const userId = await login(config.E2E_ADMIN_USERNAME, config.E2E_ADMIN_PASSWORD, { customData: { first_name: 'Test', last_name: 'User', roles: ['admin'] } }); const values = { url: 'https://incidentdatabase.ai', diff --git a/site/gatsby-site/playwright/e2e-full/utils.spec.ts b/site/gatsby-site/playwright/e2e-full/utils.spec.ts new file mode 100644 index 0000000000..ba8a5a8004 --- /dev/null +++ b/site/gatsby-site/playwright/e2e-full/utils.spec.ts @@ -0,0 +1,17 @@ +import { expect } from '@playwright/test'; +import { test } from '../utils'; +import config from '../config'; + +test.describe('Test playwright utils', () => { + + test('Login fixture should mock user and roles', async ({ page, login }) => { + + await login(config.E2E_ADMIN_USERNAME, config.E2E_ADMIN_PASSWORD, { customData: { roles: ['sarasa'], first_name: 'Fula', last_name: 'Nito' } }); + + await page.goto('/account'); + + await expect(page.getByText('Fula')).toBeVisible(); + await expect(page.getByText('Nito')).toBeVisible(); + await expect(page.getByText('sarasa')).toBeVisible(); + }); +}); \ No newline at end of file diff --git a/site/gatsby-site/playwright/e2e/integration/confirmemail.spec.ts b/site/gatsby-site/playwright/e2e/integration/confirmemail.spec.ts new file mode 100644 index 0000000000..11c6c7f0dc --- /dev/null +++ b/site/gatsby-site/playwright/e2e/integration/confirmemail.spec.ts @@ -0,0 +1,43 @@ +import { expect } from '@playwright/test'; +import { test } from '../../utils'; + +const url = '/confirmemail'; + +test.describe('Confirm email', () => { + + test('Should successfully load confirm email page', async ({ page }) => { + await page.goto(url); + }); + + test('Should display Invalid params message when token or tokenId are missing', async ({ page }) => { + await page.goto(`${url}?token=dummyToken`); + await expect(page.locator(':has-text("Invalid parameters")').first()).toBeVisible(); + await expect(page.locator('[data-cy="confirm-login-btn"]')).toBeVisible(); + await expect(page.locator('#content:has-text("An unknown error has occurred")')).toBeVisible(); + + await page.goto(`${url}?tokenId=dummyTokenId`); + await expect(page.locator(':has-text("Invalid parameters")').first()).toBeVisible(); + await expect(page.locator('[data-cy="confirm-login-btn"]')).toBeVisible(); + await expect(page.locator('#content:has-text("An unknown error has occurred")')).toBeVisible(); + }); + + test('Should display an error message if the confirmation failed on Atlas', async ({ page }) => { + await page.goto(`${url}?token=invalidToken&tokenId=invalidTokenId`); + await expect(page.locator('[data-cy="toast"]:has-text("An unknown error has occurred")')).toBeVisible(); + await expect(page.locator('[data-cy="confirm-login-btn"]')).toBeVisible(); + await expect(page.locator('#content:has-text("An unknown error has occurred")')).toBeVisible(); + }); + + test('Should display success message if the email is confirmed on Atlas', async ({ page }) => { + await page.route('**/confirm', route => route.fulfill({ status: 201 })); + await page.goto(`${url}?token=dummyToken&tokenId=dummyTokenId`); + + await expect(page.locator('[data-cy="toast"]:has-text("Thank you for verifying your account.")')).toBeVisible(); + await expect(page.locator('[data-cy="confirm-login-btn"]')).toBeVisible(); + await expect(page.locator('#content:has-text("Thank you for verifying your account.")')).toBeVisible(); + + await page.locator('[data-cy="confirm-login-btn"]').click(); + await expect(page).toHaveURL('/login/?redirectTo=/account/'); + }); + +}); diff --git a/site/gatsby-site/playwright/memory-mongo.ts b/site/gatsby-site/playwright/memory-mongo.ts index f738c95a35..18ca87a3b4 100644 --- a/site/gatsby-site/playwright/memory-mongo.ts +++ b/site/gatsby-site/playwright/memory-mongo.ts @@ -37,7 +37,7 @@ export const init = async (extra?: Record[], drop?: boolean }) => { diff --git a/site/gatsby-site/playwright/seeds/aiidprod/classifications.ts b/site/gatsby-site/playwright/seeds/aiidprod/classifications.ts index d71643ae3d..957b23fbef 100644 --- a/site/gatsby-site/playwright/seeds/aiidprod/classifications.ts +++ b/site/gatsby-site/playwright/seeds/aiidprod/classifications.ts @@ -1,3 +1,4 @@ +import { ObjectId } from 'bson'; import { Classification } from '../../../server/generated/graphql' type DBClassification = Omit @@ -7,7 +8,7 @@ type DBClassification = Omit const items: DBClassification[] = [ { - _id: "63f3d58c26ab981f33b3f9c7", + _id: new ObjectId("63f3d58c26ab981f33b3f9c7"), publish: true, reports: [], attributes: [ @@ -21,51 +22,51 @@ const items: DBClassification[] = [ }, { short_name: "Physical Objects", - value_json: "\"\"" + value_json: "\"no\"" }, { short_name: "Entertainment Industry", - value_json: "\"\"" + value_json: "\"no\"" }, { short_name: "Report, Test, or Study of data", - value_json: "\"\"" + value_json: "\"yes\"" }, { - value_json: "\"\"", + value_json: "\"no\"", short_name: "Deployed" }, { short_name: "Producer Test in Controlled Conditions", - value_json: "\"\"" + value_json: "\"no\"" }, { short_name: "Producer Test in Operational Conditions", - value_json: "\"\"" + value_json: "\"no\"" }, { short_name: "User Test in Controlled Conditions", value_json: "\"\"" }, { - value_json: "\"\"", + value_json: "\"no\"", short_name: "User Test in Operational Conditions" }, { short_name: "Harm Domain", - value_json: "\"\"" + value_json: "\"no\"" }, { short_name: "Tangible Harm", - value_json: "\"\"" + value_json: "\"yes\"" }, { short_name: "AI System", - value_json: "\"\"" + value_json: "\"yes\"" }, { short_name: "Clear link to technology", - value_json: "\"\"" + value_json: "\"no\"" }, { short_name: "There is a potentially identifiable specific entity that experienced the harm", @@ -73,19 +74,19 @@ const items: DBClassification[] = [ }, { short_name: "AI Harm Level", - value_json: "\"\"" + value_json: "\"none\"" }, { short_name: "Impact on Critical Services", - value_json: "\"\"" + value_json: "\"no\"" }, { short_name: "Rights Violation", - value_json: "\"\"" + value_json: "\"yes\"" }, { short_name: "Involving Minor", - value_json: "\"\"" + value_json: "\"no\"" }, { short_name: "Detrimental Content", @@ -265,7 +266,7 @@ const items: DBClassification[] = [ }, { - _id: "63f3d58c26ab981f33b3f9c8", + _id: new ObjectId("63f3d58c26ab981f33b3f9c8"), publish: true, reports: [5], attributes: [ @@ -520,7 +521,518 @@ const items: DBClassification[] = [ // TODO: not in graphql schema but present on db // created_at: new Date( "1722269831340") + }, + + { + "_id": new ObjectId("64bf3898da1ddcde072ec094"), + "notes": "", + "publish": true, + "reports": [], + "attributes": [ + { + "short_name": "Harm Distribution Basis", + "value_json": "[\"race\",\"sex\"]" + }, + { + "short_name": "Sector of Deployment", + "value_json": "[\"information and communication\"]" + }, + { + "short_name": "Physical Objects", + "value_json": "\"no\"" + }, + { + "short_name": "Entertainment Industry", + "value_json": "\"no\"" + }, + { + "short_name": "Report, Test, or Study of data", + "value_json": "\"no\"" + }, + { + "short_name": "Deployed", + "value_json": "\"yes\"" + }, + { + "short_name": "Producer Test in Controlled Conditions", + "value_json": "\"no\"" + }, + { + "short_name": "Producer Test in Operational Conditions", + "value_json": "\"no\"" + }, + { + "short_name": "User Test in Controlled Conditions", + "value_json": "\"no\"" + }, + { + "short_name": "User Test in Operational Conditions", + "value_json": "\"no\"" + }, + { + "short_name": "Harm Domain", + "value_json": "\"yes\"" + }, + { + "short_name": "Tangible Harm", + "value_json": "\"no tangible harm, near-miss, or issue\"" + }, + { + "value_json": "\"yes\"", + "short_name": "AI System" + }, + { + "short_name": "Clear link to technology", + "value_json": "\"yes\"" + }, + { + "short_name": "There is a potentially identifiable specific entity that experienced the harm", + "value_json": "false" + }, + { + "short_name": "AI Harm Level", + "value_json": "\"none\"" + }, + { + "short_name": "Impact on Critical Services", + "value_json": "\"no\"" + }, + { + "value_json": "\"no\"", + "short_name": "Rights Violation" + }, + { + "short_name": "Involving Minor", + "value_json": "\"no\"" + }, + { + "value_json": "\"no\"", + "short_name": "Detrimental Content" + }, + { + "value_json": "\"yes\"", + "short_name": "Protected Characteristic" + }, + { + "short_name": "Clear link to Technology", + "value_json": "\"yes\"" + }, + { + "short_name": "Harmed Class of Entities", + "value_json": "true" + }, + { + "short_name": "Annotator’s AI special interest intangible harm assessment", + "value_json": "\"yes\"" + }, + { + "short_name": "Public Sector Deployment", + "value_json": "\"no\"" + }, + { + "short_name": "Autonomy Level", + "value_json": "\"Autonomy1\"" + }, + { + "short_name": "Intentional Harm", + "value_json": "\"No. Not intentionally designed to perform harm\"" + }, + { + "value_json": "[]", + "short_name": "AI tools and methods" + }, + { + "short_name": "Peer Reviewer", + "value_json": "\"002\"" + }, + { + "short_name": "Quality Control", + "value_json": "false" + }, + { + "value_json": "\"4. Peer review complete\"", + "short_name": "Annotation Status" + }, + { + "value_json": "2", + "short_name": "Incident Number" + }, + { + "short_name": "Annotator", + "value_json": "\"005\"" + }, + { + "short_name": "AI Tangible Harm Level Notes", + "value_json": "\"\"" + }, + { + "short_name": "Notes (special interest intangible harm)", + "value_json": "\"\"" + }, + { + "short_name": "Special Interest Intangible Harm", + "value_json": "\"yes\"" + }, + { + "short_name": "Notes (AI special interest intangible harm)", + "value_json": "\"\"" + }, + { + "short_name": "Date of Incident Year", + "value_json": "\"2012\"" + }, + { + "short_name": "Date of Incident Month", + "value_json": "\"04\"" + }, + { + "short_name": "Date of Incident Day", + "value_json": "\"\"" + }, + { + "value_json": "true", + "short_name": "Estimated Date" + }, + { + "short_name": "Multiple AI Interaction", + "value_json": "\"no\"" + }, + { + "short_name": "Embedded", + "value_json": "\"no\"" + }, + { + "short_name": "Location City", + "value_json": "\"\"" + }, + { + "short_name": "Location State/Province (two letters)", + "value_json": "\"\"" + }, + { + "short_name": "Location Country (two letters)", + "value_json": "\"\"" + }, + { + "short_name": "Location Region", + "value_json": "\"Global\"" + }, + { + "value_json": "[]", + "short_name": "Infrastructure Sectors" + }, + { + "short_name": "Operating Conditions", + "value_json": "\"\"" + }, + { + "short_name": "Notes (Environmental and Temporal Characteristics)", + "value_json": "\"\"" + }, + { + "short_name": "Entities", + "value_json": "[{\"attributes\":[{\"short_name\":\"Entity\",\"value_json\":\"\\\"Kabir Alli\\\"\"},{\"short_name\":\"Named Entity\",\"value_json\":\"true\"},{\"short_name\":\"Entity type\",\"value_json\":\"\\\"individual\\\"\"},{\"short_name\":\"Entity Relationship to the AI\",\"value_json\":\"[\\\"user\\\"]\"},{\"short_name\":\"Harm Category Experienced\",\"value_json\":\"\\\"AI special interest intangible harm\\\"\"},{\"short_name\":\"Harm Type Experienced\",\"value_json\":\"\\\"disproportionate treatment based upon a protected characteristic\\\"\"}]},{\"attributes\":[{\"short_name\":\"Entity\",\"value_json\":\"\\\"Black teenagers\\\"\"},{\"short_name\":\"Named Entity\",\"value_json\":\"false\"},{\"short_name\":\"Entity type\",\"value_json\":\"\\\"group of individuals\\\"\"},{\"short_name\":\"Entity Relationship to the AI\",\"value_json\":\"[\\\"affected non-users\\\"]\"},{\"short_name\":\"Harm Category Experienced\",\"value_json\":\"\\\"AI special interest intangible harm\\\"\"},{\"short_name\":\"Harm Type Experienced\",\"value_json\":\"\\\"disproportionate treatment based upon a protected characteristic\\\"\"}]},{\"attributes\":[{\"short_name\":\"Entity\",\"value_json\":\"\\\"Google\\\"\"},{\"short_name\":\"Named Entity\",\"value_json\":\"true\"},{\"short_name\":\"Entity type\",\"value_json\":\"\\\"for-profit organization\\\"\"},{\"short_name\":\"Entity Relationship to the AI\",\"value_json\":\"[\\\"developer\\\",\\\"deployer\\\"]\"},{\"short_name\":\"Harm Category Experienced\",\"value_json\":\"\\\"not applicable\\\"\"},{\"short_name\":\"Harm Type Experienced\",\"value_json\":\"\\\"not applicable\\\"\"}]},{\"attributes\":[{\"short_name\":\"Entity\",\"value_json\":\"\\\"Google Search\\\"\"},{\"short_name\":\"Named Entity\",\"value_json\":\"true\"},{\"short_name\":\"Entity type\",\"value_json\":\"\\\"product\\\"\"},{\"short_name\":\"Entity Relationship to the AI\",\"value_json\":\"[\\\"product containing AI\\\"]\"},{\"short_name\":\"Harm Category Experienced\",\"value_json\":\"\\\"not applicable\\\"\"},{\"short_name\":\"Harm Type Experienced\",\"value_json\":\"\\\"not applicable\\\"\"}]},{\"attributes\":[{\"short_name\":\"Entity\",\"value_json\":\"\\\"Women of color\\\"\"},{\"short_name\":\"Named Entity\",\"value_json\":\"false\"},{\"short_name\":\"Entity type\",\"value_json\":\"\\\"group of individuals\\\"\"},{\"short_name\":\"Entity Relationship to the AI\",\"value_json\":\"[\\\"user\\\",\\\"affected non-user\\\"]\"},{\"short_name\":\"Harm Category Experienced\",\"value_json\":\"\\\"AI special interest intangible harm\\\"\"},{\"short_name\":\"Harm Type Experienced\",\"value_json\":\"\\\"disproportionate treatment based upon a protected characteristic\\\"\"}]}]" + }, + { + "short_name": "Lives Lost", + "value_json": "0" + }, + { + "value_json": "0", + "short_name": "Injuries" + }, + { + "short_name": "Estimated Harm Quantities", + "value_json": "false" + }, + { + "short_name": "Notes ( Tangible Harm Quantities Information)", + "value_json": "\"\"" + }, + { + "short_name": "AI System Description", + "value_json": "\"Search engine and content ranking system. \"" + }, + { + "short_name": "Data Inputs", + "value_json": "[\"images\",\"image alt tags\",\"text\"]" + }, + { + "short_name": "Notes (Information about AI System)", + "value_json": "\"\"" + }, + { + "short_name": "Physical System Type", + "value_json": "\"\"" + }, + { + "short_name": "AI Task", + "value_json": "[\"search engine optimization\"]" + }, + { + "value_json": "\"\"", + "short_name": "Notes (AI Functionality and Techniques)" + } + ], + "incidents": [2], + "namespace": "CSETv1_Annotator-1", + }, + + { + "_id": new ObjectId("6503a32f8361de7a3732d36f"), + "attributes": [ + { + "short_name": "Harm Distribution Basis", + "value_json": "[\"sex\",\"race\"]" + }, + { + "short_name": "Sector of Deployment", + "value_json": "[\"information and communication\"]" + }, + { + "value_json": "\"maybe\"", + "short_name": "Physical Objects" + }, + { + "short_name": "Entertainment Industry", + "value_json": "\"no\"" + }, + { + "value_json": "\"no\"", + "short_name": "Report, Test, or Study of data" + }, + { + "short_name": "Deployed", + "value_json": "\"yes\"" + }, + { + "value_json": "\"no\"", + "short_name": "Producer Test in Controlled Conditions" + }, + { + "short_name": "Producer Test in Operational Conditions", + "value_json": "\"no\"" + }, + { + "short_name": "User Test in Controlled Conditions", + "value_json": "\"no\"" + }, + { + "short_name": "User Test in Operational Conditions", + "value_json": "\"no\"" + }, + { + "short_name": "Harm Domain", + "value_json": "\"yes\"" + }, + { + "short_name": "Tangible Harm", + "value_json": "\"no tangible harm, near-miss, or issue\"" + }, + { + "short_name": "AI System", + "value_json": "\"yes\"" + }, + { + "short_name": "Clear link to technology", + "value_json": "\"yes\"" + }, + { + "short_name": "There is a potentially identifiable specific entity that experienced the harm", + "value_json": "false" + }, + { + "short_name": "AI Harm Level", + "value_json": "\"none\"" + }, + { + "short_name": "Impact on Critical Services", + "value_json": "\"no\"" + }, + { + "short_name": "Rights Violation", + "value_json": "\"no\"" + }, + { + "short_name": "Involving Minor", + "value_json": "\"no\"" + }, + { + "short_name": "Detrimental Content", + "value_json": "\"no\"" + }, + { + "short_name": "Protected Characteristic", + "value_json": "\"yes\"" + }, + { + "value_json": "\"yes\"", + "short_name": "Clear link to Technology" + }, + { + "short_name": "Harmed Class of Entities", + "value_json": "true" + }, + { + "short_name": "Annotator’s AI special interest intangible harm assessment", + "value_json": "\"yes\"" + }, + { + "short_name": "Public Sector Deployment", + "value_json": "\"no\"" + }, + { + "value_json": "\"Autonomy1\"", + "short_name": "Autonomy Level" + }, + { + "short_name": "Intentional Harm", + "value_json": "\"No. Not intentionally designed to perform harm\"" + }, + { + "short_name": "AI tools and methods", + "value_json": "\"\"" + }, + { + "short_name": "Peer Reviewer", + "value_json": "\"002\"" + }, + { + "short_name": "Quality Control", + "value_json": "false" + }, + { + "value_json": "\"4. Peer review complete\"", + "short_name": "Annotation Status" + }, + { + "short_name": "Incident Number", + "value_json": "2" + }, + { + "short_name": "Annotator", + "value_json": "\"001\"" + }, + { + "value_json": "\"\"", + "short_name": "AI Tangible Harm Level Notes" + }, + { + "short_name": "Notes (special interest intangible harm)", + "value_json": "\"Propagation of systemic racial bias by Google search \"" + }, + { + "value_json": "\"yes\"", + "short_name": "Special Interest Intangible Harm" + }, + { + "value_json": "\"\"", + "short_name": "Notes (AI special interest intangible harm)" + }, + { + "short_name": "Date of Incident Year", + "value_json": "\"2012\"" + }, + { + "short_name": "Date of Incident Month", + "value_json": "\"\"" + }, + { + "short_name": "Date of Incident Day", + "value_json": "\"\"" + }, + { + "short_name": "Estimated Date", + "value_json": "true" + }, + { + "value_json": "\"no\"", + "short_name": "Multiple AI Interaction" + }, + { + "short_name": "Embedded", + "value_json": "\"no\"" + }, + { + "short_name": "Location City", + "value_json": "\"\"" + }, + { + "short_name": "Location State/Province (two letters)", + "value_json": "\"\"" + }, + { + "short_name": "Location Country (two letters)", + "value_json": "\"\"" + }, + { + "short_name": "Location Region", + "value_json": "\"Global\"" + }, + { + "short_name": "Infrastructure Sectors", + "value_json": "[]" + }, + { + "short_name": "Operating Conditions", + "value_json": "\"\"" + }, + { + "value_json": "\"\"", + "short_name": "Notes (Environmental and Temporal Characteristics)" + }, + { + "short_name": "Entities", + "value_json": "[{\"attributes\":[{\"short_name\":\"Entity\",\"value_json\":\"\\\"Google\\\"\"},{\"short_name\":\"Named Entity\",\"value_json\":\"true\"},{\"short_name\":\"Entity type\",\"value_json\":\"\\\"for-profit organization\\\"\"},{\"short_name\":\"Entity Relationship to the AI\",\"value_json\":\"[\\\"developer\\\",\\\"deployer\\\"]\"},{\"short_name\":\"Harm Category Experienced\",\"value_json\":\"\\\"not applicable\\\"\"},{\"short_name\":\"Harm Type Experienced\",\"value_json\":\"\\\"not applicable\\\"\"}]},{\"attributes\":[{\"short_name\":\"Entity\",\"value_json\":\"\\\"Google Search\\\"\"},{\"short_name\":\"Named Entity\",\"value_json\":\"true\"},{\"short_name\":\"Entity type\",\"value_json\":\"\\\"product\\\"\"},{\"short_name\":\"Entity Relationship to the AI\",\"value_json\":\"[\\\"AI\\\"]\"},{\"short_name\":\"Harm Category Experienced\",\"value_json\":\"\\\"not applicable\\\"\"},{\"short_name\":\"Harm Type Experienced\",\"value_json\":\"\\\"not applicable\\\"\"}]},{\"attributes\":[{\"short_name\":\"Entity\",\"value_json\":\"\\\"Black people\\\"\"},{\"short_name\":\"Named Entity\",\"value_json\":\"false\"},{\"short_name\":\"Entity type\",\"value_json\":\"\\\"group of individuals\\\"\"},{\"short_name\":\"Entity Relationship to the AI\",\"value_json\":\"[\\\"user\\\",\\\"affected non-user\\\"]\"},{\"short_name\":\"Harm Category Experienced\",\"value_json\":\"\\\"AI special interest intangible harm\\\"\"},{\"short_name\":\"Harm Type Experienced\",\"value_json\":\"\\\"disproportionate treatment based upon a protected characteristic\\\"\"}]},{\"attributes\":[{\"short_name\":\"Entity\",\"value_json\":\"\\\"Women of color\\\"\"},{\"short_name\":\"Named Entity\",\"value_json\":\"false\"},{\"short_name\":\"Entity type\",\"value_json\":\"\\\"group of individuals\\\"\"},{\"short_name\":\"Entity Relationship to the AI\",\"value_json\":\"[\\\"user\\\",\\\"affected non-user\\\"]\"},{\"short_name\":\"Harm Category Experienced\",\"value_json\":\"\\\"AI special interest intangible harm\\\"\"},{\"short_name\":\"Harm Type Experienced\",\"value_json\":\"\\\"disproportionate treatment based upon a protected characteristic\\\"\"}]}]" + }, + { + "value_json": "0", + "short_name": "Lives Lost" + }, + { + "short_name": "Injuries", + "value_json": "0" + }, + { + "short_name": "Estimated Harm Quantities", + "value_json": "false" + }, + { + "short_name": "Notes ( Tangible Harm Quantities Information)", + "value_json": "\"\"" + }, + { + "short_name": "AI System Description", + "value_json": "\"Search engine\"" + }, + { + "value_json": "[\"Text\"]", + "short_name": "Data Inputs" + }, + { + "value_json": "\"\"", + "short_name": "Notes (Information about AI System)" + }, + { + "short_name": "Physical System Type", + "value_json": "\"\"" + }, + { + "value_json": "[\"search engine\"]", + "short_name": "AI Task" + }, + { + "short_name": "Notes (AI Functionality and Techniques)", + "value_json": "\"\"" + } + ], + "incidents": [2], + "namespace": "CSETv1_Annotator-2", + "notes": "", + "publish": true, + "reports": [], } + ] export default items; \ No newline at end of file diff --git a/site/gatsby-site/playwright/seeds/aiidprod/incidents.ts b/site/gatsby-site/playwright/seeds/aiidprod/incidents.ts index 3ff2506b4b..a7cc804355 100644 --- a/site/gatsby-site/playwright/seeds/aiidprod/incidents.ts +++ b/site/gatsby-site/playwright/seeds/aiidprod/incidents.ts @@ -1,6 +1,6 @@ import { Incident } from '../../../server/generated/graphql' -type DBIncident = Omit +export type DBIncident = Omit & { "Alleged deployer of AI system": string[], "Alleged developer of AI system": string[], "Alleged harmed or nearly harmed parties": string[] } & { reports: number[] } & { editors: string[] } diff --git a/site/gatsby-site/playwright/seeds/aiidprod/taxa.ts b/site/gatsby-site/playwright/seeds/aiidprod/taxa.ts index cc411e8914..20a412087b 100644 --- a/site/gatsby-site/playwright/seeds/aiidprod/taxa.ts +++ b/site/gatsby-site/playwright/seeds/aiidprod/taxa.ts @@ -2098,10 +2098,2881 @@ const items: DBTaxa[] = [ public: true } ], - + // TODO: ditto // created_at: "1722269934342", - } + }, + + { + _id: new ObjectId("643f1a5558f256c7dbc4dc68"), + namespace: "CSETv1_Annotator-1", + weight: 70, + complete_entities: true, + description: "# What is the CSET Taxonomy?\n\nThe CSET AI Harm Taxonomy for AIID is the second edition of the \nCSET incident taxonomy.", + dummy_fields: [ + { + field_number: "1", + short_name: "Metadata" + }, + { + field_number: "2", + short_name: "Incident Domain" + }, + { + field_number: "3", + short_name: "AI Tangible Harm Assessment" + }, + { + field_number: "4", + short_name: "Special Interest Intangible Harm" + }, + { + field_number: "5", + short_name: "AI Special Interest Intangible Harm Assessment" + }, + { + field_number: "6", + short_name: "Environmental and Temporal Characteristics" + }, + { + field_number: "7", + short_name: "Characterizing Entities and the Harm" + }, + { + field_number: "8", + short_name: "Tangible Harm Quantities " + }, + { + field_number: "9", + short_name: "Information about AI System" + }, + { + field_number: "10", + short_name: "AI Functionality and Techniques" + } + ], + field_list: [ + { + field_number: "1.1", + short_name: "Incident Number", + long_name: "The number of the incident in the AI Incident Database.", + short_description: "The number of the incident in the AI Incident Database.", + long_description: "The number of the incident in the AI Incident Database.", + display_type: "int", + mongo_type: "int", + default: "", + weight: 5, + instant_facet: false, + required: false, + public: true, + hide_search: true + }, + { + field_number: "1.2", + short_name: "Annotator", + long_name: "Person responsible for the annotations", + short_description: "This is the researcher that is responsible for applying the classifications of the CSET taxonomy.", + long_description: "An ID designating the individual who classified this incident according to the CSET taxonomy.", + display_type: "string", + mongo_type: "string", + default: "", + placeholder: "Select name here", + permitted_values: [], + weight: 5, + instant_facet: false, + required: false, + public: false, + hide_search: true + }, + { + field_number: "1.3", + short_name: "Annotation Status", + long_name: "Where in the annotation process is this incident?", + short_description: "What is the quality assurance status of the CSET classifications for this incident?", + long_description: "What is the quality assurance status of the CSET classifications for this incident?", + display_type: "enum", + mongo_type: "string", + default: "", + placeholder: "Select process status here", + permitted_values: [ + "1. Annotation in progress", + "2. Initial annotation complete", + "3. In peer review", + "4. Peer review complete", + "5. In quality control", + "6. Complete and final" + ], + weight: 10, + instant_facet: false, + required: false, + public: false, + hide_search: true, + notes: "When you start a row, switch this field from blank to “Annotation in progress” so other annotators know not to work on the same row (and can be sure it wasn’t skipped or left unfinished accidentally).\n\nOnce a row is marked “Initial annotation complete,” we will assume that any remaining blanks were left deliberately - that is, you looked, but couldn’t find enough information to fill out the blank fields. For this reason, please don’t mark a row “Initial annotation complete” until you’ve truly finished filling it out.\n\nWhen peer review begins, the assigned reviewer should switch the status to “In peer review.” When the review is complete and all comments have been resolved, either the peer reviewer or the original annotator should switch the status to “Peer review complete.”\n\nOptions 5 and 6 should only ever be selected by the project lead" + }, + { + field_number: "1.4", + short_name: "Peer Reviewer", + long_name: "Person responsible for reviewing annotations", + short_description: "This is the researcher that is responsible for ensuring the quality of the classifications applied to this incident.", + long_description: "The CSET taxonomy assigns individual researchers to each incident as the primary parties responsible for classifying the incident according to the taxonomy. This is the person responsible for assuring the integrity of annotator's classifications.", + display_type: "string", + mongo_type: "string", + default: "", + placeholder: "Select name here", + permitted_values: [], + weight: 20, + instant_facet: false, + required: false, + public: false, + hide_search: true, + notes: "The project lead will assign a peer reviewer to each incident." + }, + { + field_number: "1.5", + short_name: "Quality Control", + long_name: "Was this incident randomly selected for additional quality control?", + short_description: "Has someone flagged a potential issue with this incident's classifications? Annotators should leave this field blank.", + long_description: "The peer review process sometimes uncovers issues with the classifications that have been applied by the annotator. This field serves as a flag when there is a need for additional thought and input on the classifications applied", + display_type: "bool", + mongo_type: "bool", + default: "false", + placeholder: "", + permitted_values: [], + weight: 15, + instant_facet: false, + required: false, + public: false, + hide_search: true + }, + { + field_number: "2.1", + short_name: "Physical Objects", + long_name: "Did the incident occur in a domain with physical objects ?", + short_description: "Did the incident occur in a domain with physical objects ?", + long_description: "“Yes” if the AI system(s) is embedded in hardware that can interact with, affect, and change the physical objects (cars, robots, medical facilities, etc.). Mark “No” if the system cannot. This includes systems that inform, detect, predict, or recommend.", + display_type: "enum", + mongo_type: "string", + default: "maybe", + permitted_values: [ + "yes", + "no", + "maybe" + ], + placeholder: "", + weight: 40, + instant_facet: false, + required: false, + notes: "Context matters. AI systems embedded in hardware that can physically interact are more likely to cause death, injury, or damage." + }, + { + field_number: "2.2", + short_name: "Entertainment Industry", + long_name: "Did the AI incident occur in the entertainment industry?", + short_description: "Did the AI incident occur in the entertainment industry?", + long_description: "“Yes” if the sector in which the AI was used is associated with entertainment. “No” if it was used in a different, clearly identifiable sector. “Maybe” if the sector of use could not be determined.", + display_type: "enum", + mongo_type: "string", + default: "maybe", + permitted_values: [ + "yes", + "no", + "maybe" + ], + placeholder: "", + weight: 40, + instant_facet: false, + required: false, + notes: "Context matters. AI systems used for entertainment are less likely to result in harm. For example a deepfake used in a movie is less likely to cause harm than a deepfake used for political misinformation." + }, + { + field_number: "2.3", + short_name: "Report, Test, or Study of data", + long_name: "Was the incident about a report, test, or study of data instead of the AI itself?", + short_description: "Was the incident about a report, test, or study of data instead of the AI itself?", + long_description: "“Yes” if the incident is about a report, test, or study of the data and does not discuss an instance of injury, damage, or loss. “Maybe” if it is unclear. Otherwise mark “No.”", + display_type: "enum", + mongo_type: "string", + default: "maybe", + permitted_values: [ + "yes", + "no", + "maybe" + ], + placeholder: "", + weight: 40, + instant_facet: false, + required: false, + notes: "Sometimes there are reports about issues with the data that could be used to develop AI systems. Since there are mitigation approaches, data issues do not automatically mean that the associated AI will have issues that lead to harm. A projection or hypothesis of the harm resulting from data issues is not sufficient. There must be harm that can be clearly linked to an AI." + }, + { + field_number: "2.4", + short_name: "Deployed", + long_name: "Was the reported system (even if AI involvement is unknown) deployed or sold to users?", + short_description: "Was the reported system (even if AI involvement is unknown) deployed or sold to users?", + long_description: "“Yes” if the involved system was deployed or sold to users. “No” if it was not. “Maybe” if there is not enough information or if the use is unclear.", + display_type: "enum", + mongo_type: "string", + default: "maybe", + permitted_values: [ + "yes", + "no", + "maybe" + ], + placeholder: "", + weight: 40, + instant_facet: false, + required: false, + notes: "Systems that are not deployed or sold to users tend to still be in the development stage and hence are less likely to cause harm. However, harm can still be possible. " + }, + { + field_number: "2.5", + short_name: "Producer Test in Controlled Conditions", + long_name: "Was this a test or demonstration of an AI system done by developers, producers or researchers (versus users) in controlled conditions?", + short_description: "Was this a test or demonstration of an AI system done by developers, producers or researchers (versus users) in controlled conditions?", + long_description: "“Yes” if it was a test/demonstration performed by developers, producers or journalists in controlled conditions. “No” if it was not a test/demonstration. “No” if the test/demonstration was done by a user. “No” if the test/demonstration was in operational or uncontrolled conditions. “Maybe” otherwise.", + display_type: "enum", + mongo_type: "string", + default: "maybe", + permitted_values: [ + "yes", + "no", + "maybe" + ], + placeholder: "", + weight: 40, + instant_facet: false, + required: false, + notes: "AI system tests or demonstrations by developers, producers, or researchers in controlled environments are less likely to expose people, organizations, property, institutions, or the natural environment to harm. Controlled environments may include situations such as an isolated compute system, a regulatory sandbox, or an autonomous vehicle testing range. " + }, + { + field_number: "2.6", + short_name: "Producer Test in Operational Conditions", + long_name: "Was this a test or demonstration of an AI system done by developers, producers or researchers (versus users) in operational conditions?", + short_description: "Was this a test or demonstration of an AI system done by developers, producers or researchers (versus users) in operational conditions?", + long_description: "“Yes” if it was a test/demonstration performed by developers, producers or journalists in controlled conditions. “No” if it was not a test/demonstration. “No” if the test/demonstration was done by a user. “No” if the test/demonstration was in controlled or non-operational conditions. “Maybe” otherwise.", + display_type: "enum", + mongo_type: "string", + default: "maybe", + permitted_values: [ + "yes", + "no", + "maybe" + ], + placeholder: "", + weight: 40, + instant_facet: false, + required: false, + notes: "While almost every AI system undergoes testing or demonstration in a controlled environment, some also undergo testing or demonstration in an operational environment. Testing in operational environments still occurs before the system is deployed or sold to end-users. However, relative to controlled environments, operational environments try to closely represent real-world conditions and end-users that affect use of the AI system. Therefore, testing in an operational environment typically poses a heightened risk of harm to people, organizations, property, institutions, or the environment." + }, + { + field_number: "2.7", + short_name: "User Test in Controlled Conditions", + long_name: "Was this a test or demonstration done by users in controlled conditions?", + short_description: "Was this a test or demonstration done by users in controlled conditions?", + long_description: "“Yes” if it was a test/demonstration performed by users in controlled conditions. “No” if it was not a test/demonstration. “No” if the test/demonstration was done by developers, producers or researchers. “No” if the test/demonstration was in controlled or non-controlled conditions.“Maybe” otherwise.", + display_type: "enum", + mongo_type: "string", + default: "maybe", + permitted_values: [ + "yes", + "no", + "maybe" + ], + placeholder: "", + weight: 40, + instant_facet: false, + required: false, + notes: "The involvement of a user (versus a developer, producer, or researcher) increases the likelihood that harm can occur even if the AI system is being tested. Relative to controlled environments, controlled environments try to closely represent real-world conditions and end-users that affect use of the AI system. Therefore, testing in an controlled environment typically poses a heightened risk of harm to people, organizations, property, institutions, or the environment." + }, + { + field_number: "2.8", + short_name: "User Test in Operational Conditions", + long_name: "Was this a test or demonstration done by users in operational conditions?", + short_description: "Was this a test or demonstration done by users in operational conditions?", + long_description: "“Yes” if it was a test/demonstration performed by users in operational conditions. “No” if it was not a test/demonstration. “No” if the test/demonstration was done by developers, producers or researchers. “No” if the test/demonstration was in controlled or non-operational conditions.“Maybe” otherwise.", + display_type: "enum", + mongo_type: "string", + default: "maybe", + permitted_values: [ + "yes", + "no", + "maybe" + ], + placeholder: "", + weight: 40, + instant_facet: false, + required: false, + notes: "Sometimes, prior to deployment, the user will perform a test or demonstration of the AI system. The involvement of a user (versus a developer, producer, or researcher) increases the likelihood that harm can occur even if the AI system is being tested in controlled environments." + }, + { + field_number: "2.9", + short_name: "Harm Domain", + long_name: "Incident occurred in a domain where we could expect harm to occur?", + short_description: "Incident occurred in a domain where we could likely expect harm to occur?", + long_description: "Using the answers to the 8 domain questions, assess if the incident occurred in a domain where harm could be expected to occur. If you are unclear, input “maybe.”", + display_type: "enum", + mongo_type: "string", + default: "maybe", + permitted_values: [ + "yes", + "no", + "maybe" + ], + placeholder: "", + weight: 40, + instant_facet: false, + required: false, + hide_search: true, + notes: "Reflecting upon the previously answered questions, decide if the reported incident or instance occurred in a domain in which harm could possibly occur. This is not a decision on whether or not harm did occur. Just a reflection on the operating conditions or context of the system." + }, + { + field_number: "3.1", + short_name: "Tangible Harm", + long_name: "Did tangible harm (loss, damage or injury ) occur? ", + short_description: "Did tangible harm (loss, damage or injury ) occur? ", + long_description: "An assessment of whether tangible harm, imminent tangible harm, or non-imminent tangible harm occurred. This assessment does not consider the context of the tangible harm, if an AI was involved, or if there is an identifiable, specific, and harmed entity. It is also not assessing if an intangible harm occurred. It is only asking if tangible harm occurred and what its imminency was.", + display_type: "enum", + mongo_type: "string", + default: "unclear", + placeholder: "", + permitted_values: [ + "tangible harm definitively occurred", + "imminent risk of tangible harm (near miss) did occur", + "non-imminent risk of tangible harm (an issue) occurred", + "no tangible harm, near-miss, or issue", + "unclear" + ], + weight: 40, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "3.2", + short_name: "AI System", + long_name: "Does the incident involve an AI system?", + short_description: "Does the incident involve an AI system?", + long_description: "An assessment of whether or not an AI system was involved. It is sometimes difficult to judge between an AI and an automated system or expert rules system. In these cases select “maybe”", + display_type: "enum", + mongo_type: "string", + default: "maybe", + permitted_values: [ + "yes", + "no", + "maybe" + ], + placeholder: "", + weight: 40, + instant_facet: false, + required: false, + public: true, + notes: "Note, over time more information about the incident may become available, allowing a ‘maybe’ to be changed to a ‘yes’ or ‘no.’" + }, + { + field_number: "3.3", + short_name: "Clear link to technology", + long_name: "Can the technology be directly and clearly linked to the adverse outcome of the incident", + short_description: "Can the technology be directly and clearly linked to the adverse outcome of the incident", + long_description: "An assessment of the technology's involvement in the chain of harm. \"Yes\" indicates that the technology was involved in harm, its behavior can be directly linked to the harm, and the harm may not have occurred if the technology acted differently. \"No\", indicates that the technology's behavior cannot be linked to the harm outcome. \"Maybe\" indicates that the link is unclear.", + hide_search: true, + display_type: "enum", + mongo_type: "string", + default: "maybe", + permitted_values: [ + "yes", + "no", + "maybe" + ], + placeholder: "", + weight: 40, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "3.4", + short_name: "There is a potentially identifiable specific entity that experienced the harm", + long_name: "There is a potentially identifiable specific entity that experienced the harm", + short_description: "A potentially identifiable specific entity that experienced the harm can be characterized or identified.", + long_description: "“Yes” if it is theoretically possible to both specify and identify the entity. Having that information is not required. The information just needs to exist and be potentially discoverable. “No” if there are not any potentially identifiable specific entities or if the harmed entities are a class or subgroup that can only be characterized. ", + display_type: "bool", + mongo_type: "bool", + permitted_values: [], + placeholder: "", + default: "", + weight: 40, + instant_facet: false, + required: false, + public: true, + hide_search: true, + notes: "A potentially identifiable specific entity is an entity that can be described in detail such that the name (Mr. Joe Smith, Acme Inc, etc.) or a unique identifier (e.g. 100 Main Street, Anywhere USA) of the entity could be found. We may not know the name or identifier of the entity from the reports, but it does exist and could be found. For example, the general public is not a potentially identifiable specific entity. However, incarcerated people in the Springfield penitentiary would be specific entities because it would be possible to get a list of all the prisoners in the facility." + }, + { + field_number: "3.5", + short_name: "AI Harm Level", + long_name: "Annotator's AI tangible harm level assessment", + short_description: "An assessment of the AI tangible harm level, which takes into account the CSET definitions of AI tangible harm levels, along with the inputs for annotation fields about the AI, harm, chain of harm, and entity. ", + long_description: "An assessment of the AI tangible harm level, which takes into account the CSET definitions of AI tangible harm levels, along with the inputs for annotation fields about the AI, harm, chain of harm, and entity.", + display_type: "enum", + mongo_type: "string", + default: "unclear", + placeholder: "", + permitted_values: [ + "AI tangible harm event", + "AI tangible harm near-miss", + "AI tangible harm issue", + "none", + "unclear" + ], + weight: 40, + instant_facet: false, + required: false, + public: true, + notes: "Special interest intangible harm is determined in a different field. The determination of a special interest intangible harm is not dependant upon the AI tangible harm level" + }, + { + field_number: "3.6", + short_name: "AI Tangible Harm Level Notes", + long_name: "AI Tangible Harm Level Notes", + short_description: "Notes about the AI tangible harm level assessment", + long_description: "If for 3.5 you select unclear or leave it blank, please provide a brief description of why.\n\n You can also add notes if you want to provide justification for a level", + display_type: "long_string", + mongo_type: "string", + default: "", + placeholder: "Notes about the AI tangible harm level assessment", + permitted_values: [], + weight: 5, + instant_facet: false, + required: false, + public: true, + hide_search: true + }, + { + field_number: "4.1", + short_name: "Impact on Critical Services", + long_name: "Did this impact people's access to critical or public services (health care, social services, voting, transportation, etc)?", + short_description: "Indicates if people’s access to critical public services was impacted.", + long_description: "Did this impact people's access to critical or public services (health care, social services, voting, transportation, etc)?", + display_type: "enum", + mongo_type: "string", + default: "maybe", + permitted_values: [ + "yes", + "no", + "maybe" + ], + placeholder: "", + weight: 40, + instant_facet: false, + required: false, + public: true, + notes: "Public services include healthcare, social services, voting, public transportation, education, and consumer protection.\n\nNote, if ‘yes’ is selected then there was likely a violation of civil liberties and there was a special interest intangible harm." + }, + { + field_number: "4.2", + short_name: "Rights Violation", + long_name: "Was this a violation of human rights, civil liberties, civil rights, or democratic norms?", + short_description: "Indicate if a violation of human rights, civil rights, civil liberties, or democratic norms occurred.", + long_description: "Indicate if a violation of human rights, civil rights, civil liberties, or democratic norms occurred.", + display_type: "enum", + mongo_type: "string", + default: "maybe", + permitted_values: [ + "yes", + "no", + "maybe" + ], + placeholder: "", + weight: 40, + instant_facet: false, + required: false, + public: true, + notes: "It can often be difficult for the typical annotator to differentiate between violations of civil liberties, civil rights, human rights, and democratic norms. For this reason CSET grouped them together.\n\nHuman rights are rights inherent to all human beings, regardless of race, sex, nationality, ethnicity, language, religion, or any other status. They include the right to life and liberty, freedom from slavery and torture, freedom of opinion and expression, and the right to work and education. Civil rights are legal provisions that originate from notions of equality and can be enforced by law. Civil liberties are personal freedoms that are referenced in the Bill of Rights. Democratic norms are traditions, customs, and best practices that support democracy. An example of a democratic norm is accepting election results and facilitating a peaceful transfer of political power." + }, + { + field_number: "4.3", + short_name: "Involving Minor", + long_name: "Was a minor involved in the incident (disproportionally treated or specifically targeted/affected)", + short_description: "Was a minor involved in the incident (disproportionally treated or specifically targeted/affected)", + long_description: "Indicate if a minor was disproportionately targeted or affected", + display_type: "enum", + mongo_type: "string", + default: "maybe", + permitted_values: [ + "yes", + "no", + "maybe" + ], + placeholder: "", + weight: 40, + instant_facet: false, + required: false, + public: true, + notes: "Generally, governments have an interest in establishing heightened protections for minors. These protections are often associated with media content or privacy. For example, if an AI system illegally tracked a minor’s activity online, then answer “yes” to this question. There are instances where an AI system causes indiscriminate harm to a group of people, and it is plausible that some of those people are minors. However, in this case the entire group of people, adults and children alike, shared the distribution of harm equally and therefore the answer to this question would be “no.”" + }, + { + field_number: "4.4", + short_name: "Detrimental Content", + long_name: "Was detrimental content (misinformation, hate speech) involved?", + short_description: "Was detrimental content (misinformation, hate speech) involved?", + long_description: "Detrimental content can include deepfakes, identity misrepresentation, insults, threats of violence, eating disorder or self harm promotion, extremist content, misinformation, sexual abuse material, and scam emails. Detrimental content in itself is often not harmful, however, it can lead to or instigate injury, damage, or loss.", + display_type: "enum", + mongo_type: "string", + default: "maybe", + permitted_values: [ + "yes", + "no", + "maybe" + ], + placeholder: "", + weight: 40, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "4.5", + short_name: "Protected Characteristic", + long_name: "Was a group of people or an individual treated differently based upon a protected characteristic?", + short_description: "Was a group of people treated differently based upon a protected characteristic (e.g. race, ethnicity, creed, immigrant status, color, religion, sex, national origin, age, disability, genetic information)?", + long_description: "Protected characteristics include religion, commercial facilities, geography, age, sex, sexual orientation or gender identity, familial status (e.g., having or not having children) or pregnancy, disability, veteran status, genetic information, financial means, race or creed, Ideology, nation of origin, citizenship, and immigrant status.\n\nAt the federal level in the US, age is a protected characteristic for people over the age of 40. Minors are not considered a protected class. For this reason the CSET annotation taxonomy has a separate field to note if a minor was involved.\n\nOnly mark yes if there is clear evidence discrimination occurred. If there are conflicting accounts, mark unsure. Do not mark that discrimination occurred based on expectation alone.", + display_type: "enum", + mongo_type: "string", + default: "maybe", + permitted_values: [ + "yes", + "no", + "maybe" + ], + placeholder: "", + weight: 40, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "4.6", + short_name: "Harm Distribution Basis", + long_name: "If harms were potentially unevenly distributed among people, on what basis?", + short_description: "Indicates how the harms were potentially distributed.", + long_description: "Multiple can occur.\n\nGenetic information refers to information about a person’s genetic tests or the genetic tests of their relatives. Genetic information can predict the manifestation of a disease or disorder.", + display_type: "multi", + mongo_type: "string", + default: "unclear", + placeholder: "", + permitted_values: [ + "none", + "age", + "disability", + "familial status (e.g., having or not having children) or pregnancy", + "financial means", + "genetic information", + "geography", + "ideology", + "nation of origin, citizenship, immigrant status", + "race", + "religion", + "sex", + "sexual orientation or gender identity", + "veteran status", + "unclear", + "other" + ], + weight: 60, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "4.7", + short_name: "Notes (special interest intangible harm)", + long_name: "Input any notes that may help explain your answers.", + short_description: "Input any notes that may help explain your answers.", + long_description: "Input any notes that may help explain your answers.", + display_type: "long_string", + mongo_type: "string", + default: "", + placeholder: "Notes", + permitted_values: [], + weight: 5, + instant_facet: false, + required: false, + public: true, + hide_search: true + }, + { + field_number: "5.1", + short_name: "Special Interest Intangible Harm", + long_name: "Was there a special interest intangible harm or risk of harm?", + short_description: "An assessment of whether a special interest intangible harm occurred. This assessment does not consider the context of the intangible harm, if an AI was involved, or if there is characterizable class or subgroup of harmed entities. It is also not assessing if an intangible harm occurred. It is only asking if a special interest intangible harm occurred.", + long_description: "An assessment of whether a special interest intangible harm occurred. This assessment does not consider the context of the intangible harm, if an AI was involved, or if there is characterizable class or subgroup of harmed entities. It is also not assessing if an intangible harm occurred. It is only asking if a special interest intangible harm occurred.", + display_type: "enum", + mongo_type: "string", + default: "maybe", + permitted_values: [ + "yes", + "no", + "maybe" + ], + placeholder: "", + weight: 5, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "5.2", + short_name: "AI System", + long_name: "Does the incident involve an AI system?", + short_description: "Does the incident involve an AI system?", + long_description: "An assessment of whether or not an AI system was involved. It is sometimes difficult to judge between an AI and an automated system or expert rules system. In these cases select “maybe”", + display_type: "enum", + mongo_type: "string", + default: "maybe", + permitted_values: [ + "yes", + "no", + "maybe" + ], + placeholder: "", + weight: 40, + instant_facet: false, + required: false, + public: true, + hide_search: true, + notes: "Note, over time more information about the incident may become available, allowing a ‘maybe’ to be changed to a ‘yes’ or ‘no.’" + }, + { + field_number: "5.3", + short_name: "Clear link to Technology", + long_name: "Can the technology be directly and clearly linked to the adverse outcome of the incident?", + short_description: "Can the technology be directly and clearly linked to the adverse outcome of the incident?", + long_description: "An assessment of the technology's involvement in the chain of harm. \"Yes\" indicates that the technology was involved in harm, its behavior can be directly linked to the harm, and the harm may not have occurred if the technology acted differently. \"No\", indicates that the technology's behavior cannot be linked to the harm outcome. \"Maybe\" indicates that the link is unclear.", + display_type: "enum", + mongo_type: "string", + default: "maybe", + permitted_values: [ + "yes", + "no", + "maybe" + ], + placeholder: "", + weight: 40, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "5.4", + short_name: "Harmed Class of Entities", + long_name: "There is a characterizable class or subgroup of entities that experienced the harm", + short_description: "“Yes” if the harmed entity or entities can be characterized. “No” if there are not any characterizable entities.", + long_description: "A characterizable class or subgroup are descriptions of different populations of people. Often they are characteristics by which people qualify for special protection by a law, policy, or similar authority.\n\n Sometimes, groups may be characterized by their exposure to the incident via geographical proximity (e.g., ‘visitors to the park’) or participation in an activity (e.g.,‘Twitter users’).", + display_type: "bool", + mongo_type: "bool", + permitted_values: [], + placeholder: "", + weight: 40, + instant_facet: false, + required: false, + public: true, + hide_search: true, + notes: "" + }, + { + field_number: "5.5", + short_name: "Annotator’s AI special interest intangible harm assessment", + long_name: "The annotator’s assessment of if an AI special interest intangible harm occurred.", + short_description: "The annotator’s assessment of if an AI special interest intangible harm occurred.", + long_description: "AI tangible harm is determined in a different field. The determination of a special interest intangible harm is not dependant upon the AI tangible harm level.", + display_type: "enum", + mongo_type: "string", + default: "maybe", + permitted_values: [ + "yes", + "no", + "maybe" + ], + placeholder: "", + weight: 40, + instant_facet: false, + required: false, + public: true, + notes: "" + }, + { + field_number: "5.6", + short_name: "Notes (AI special interest intangible harm)", + long_name: "If for 5.5 you select unclear or leave it blank, please provide a brief description of why.\n\nYou can also add notes if you want to provide justification for a level.", + short_description: "If for 5.5 you select unclear or leave it blank, please provide a brief description of why.\n\nYou can also add notes if you want to provide justification for a level.", + long_description: "If for 5.5 you select unclear or leave it blank, please provide a brief description of why.\n\nYou can also add notes if you want to provide justification for a level.", + display_type: "long_string", + mongo_type: "string", + default: "", + placeholder: "Notes", + permitted_values: [], + weight: 5, + instant_facet: false, + required: false, + public: true, + hide_search: true + }, + { + field_number: "6.1", + short_name: "Date of Incident Year", + long_name: "The year in which the incident first occurred.", + short_description: "The year in which the incident occurred. If there are multiple harms or occurrences of the incident, list the earliest. If a precise date is unavailable, but the available sources provide a basis for estimating the year, estimate. Otherwise, leave blank.\n\nEnter in the format of YYYY", + long_description: "The year in which the incident occurred. If there are multiple harms or occurrences of the incident, list the earliest. If a precise date is unavailable, but the available sources provide a basis for estimating the year, estimate. Otherwise, leave blank.", + display_type: "string", + mongo_type: "string", + default: "", + placeholder: "YYYY", + permitted_values: [], + weight: 5, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "6.2", + short_name: "Date of Incident Month", + long_name: "The month in which the incident first occurred.", + short_description: "The month in which the incident occurred. If there are multiple harms or occurrences of the incident, list the earliest. If a precise date is unavailable, but the available sources provide a basis for estimating the month, estimate. Otherwise, leave blank.\n\nEnter in the format of MM", + long_description: "The month in which the incident occurred. If there are multiple harms or occurrences of the incident, list the earliest. If a precise date is unavailable, but the available sources provide a basis for estimating the month, estimate. Otherwise, leave blank.", + display_type: "string", + mongo_type: "string", + default: "", + placeholder: "MM", + permitted_values: [], + weight: 5, + instant_facet: false, + required: false, + public: true, + hide_search: true + }, + { + field_number: "6.3", + short_name: "Date of Incident Day", + long_name: "The day on which the first incident occurred.", + short_description: "The day on which the incident occurred. If a precise date is unavailable, leave blank.\n\nEnter in the format of DD", + long_description: "The day on which the incident occurred. If a precise date is unavailable, leave blank.\n\nEnter in the format of DD", + display_type: "string", + mongo_type: "string", + default: "", + placeholder: "DD", + permitted_values: [], + weight: 5, + instant_facet: false, + required: false, + public: true, + hide_search: true + }, + { + field_number: "6.4", + short_name: "Estimated Date", + long_name: "Is the date estimated?", + short_description: "“Yes” if the data was estimated. “No” otherwise.", + long_description: "“Yes” if the data was estimated. “No” otherwise.", + display_type: "bool", + mongo_type: "bool", + permitted_values: [], + placeholder: "", + weight: 5, + instant_facet: false, + required: false, + public: true, + hide_search: true + }, + { + field_number: "6.5", + short_name: "Multiple AI Interaction", + long_name: "Was the AI interacting with another AI?", + short_description: "“Yes” if two or more independently operating AI systems were involved. “No” otherwise.", + long_description: "This happens very rarely but is possible. Examples include two chatbots having a conversation with each other, or two autonomous vehicles in a crash.", + display_type: "enum", + mongo_type: "string", + default: "maybe", + permitted_values: [ + "yes", + "no", + "maybe" + ], + placeholder: "", + weight: 5, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "6.6", + short_name: "Embedded", + long_name: "Is the AI embedded in a physical system or have a physical presence?", + short_description: "“Yes” if the AI is embedded in a physical system. “No” if it is not. “Maybe” if it is unclear.", + long_description: "This question is slightly different from the one in field 2.1.1. That question asks about there being interaction with physical objects–an ability to manipulate or change. A system can be embedded in a physical object and able to interact with the physical environment, e.g. a vacuum robot. A system can be embedded in a physical object and not interact with a physical environment, e.g. a camera system that only records images when the AI detects that dogs are present. AI systems that are accessed through API, web-browser, etc by using a mobile device or computer are not considered to be embedded in hardware systems. They are accessed through hardware.", + display_type: "enum", + mongo_type: "string", + default: "maybe", + permitted_values: [ + "yes", + "no", + "maybe" + ], + placeholder: "", + weight: 5, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "6.7", + short_name: "Location City", + long_name: "If the incident occurred at a specific known location, note the city.", + short_description: "If the incident occurred at a specific known location, note the city.", + long_description: "If the incident occurred at a specific known location, note the city. If there are multiple relevant locations, enter multiple city/state/country values.", + display_type: "string", + mongo_type: "string", + default: "", + placeholder: "City", + permitted_values: [], + weight: 5, + instant_facet: false, + required: false, + public: true, + hide_search: true + }, + { + field_number: "6.8", + short_name: "Location State/Province (two letters)", + long_name: "If the incident occurred at a specific known location, note the state/province.", + short_description: "If the incident occurred at a specific known location, note the state/province.", + long_description: "If the incident occurred at a specific known location, note the state/province. If there are multiple relevant locations, enter multiple city/state/country values.", + display_type: "string", + mongo_type: "string", + default: "", + placeholder: "State or Province", + permitted_values: [], + weight: 5, + instant_facet: false, + required: false, + public: true, + hide_search: true + }, + { + field_number: "6.9", + short_name: "Location Country (two letters)", + long_name: "If the incident occurred at a specific known location, note the country. ", + short_description: "If the incident occurred at a specific known location, note the country. Follow ISO 3166 for the 2-letter country codes.", + long_description: "Follow ISO 3166 for the 2-letter country codes.\n\nIf there are multiple relevant locations, enter multiple city/state/country values.", + display_type: "string", + mongo_type: "string", + default: "", + placeholder: "Country", + permitted_values: [], + weight: 5, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "6.10", + short_name: "Location Region", + long_name: "Location Region", + short_description: "Select the region of the world where the incident occurred. If it occurred in multiple, leave blank.", + long_description: "Use this reference to map countries to regions: https://www.dhs.gov/geographic-regions", + display_type: "enum", + mongo_type: "string", + default: "unclear", + placeholder: "", + permitted_values: [ + "Global", + "Africa", + "Asia", + "Caribbean", + "Central America", + "Europe", + "North America", + "Oceania", + "South America", + "unclear" + ], + weight: 5, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "6.11", + short_name: "Infrastructure Sectors", + long_name: "Which critical infrastructure sectors were affected, if any?", + short_description: "Which critical infrastructure sectors were affected, if any?", + long_description: "Which critical infrastructure sectors were affected, if any?", + display_type: "multi", + mongo_type: "string", + default: "unclear", + placeholder: "", + permitted_values: [ + "chemical", + "commercial facilities", + "communications", + "critical manufacturing", + "dams", + "defense-industrial base", + "emergency services", + "energy", + "financial services", + "food and agriculture", + "government facilities", + "healthcare and public health", + "information technology", + "nuclear ", + "transportation", + "water and wastewater", + "Other", + "unclear" + ], + weight: 5, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "6.12", + short_name: "Operating Conditions", + long_name: "A record of any abnormal or atypical operational conditions that occurred.", + short_description: "A record of any abnormal or atypical operational conditions that occurred.", + long_description: "A record of any abnormal or atypical operational conditions that occurred. This field is most often blank.", + display_type: "list", + mongo_type: "array", + default: "", + placeholder: "e.g. raining; night; low visibility", + permitted_values: [], + weight: 5, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "6.13", + short_name: "Notes (Environmental and Temporal Characteristics)", + long_name: "Notes (Environmental and Temporal Characteristics)", + short_description: "Input any notes that may help explain your answers.", + long_description: "Input any notes that may help explain your answers.", + display_type: "long_string", + mongo_type: "string", + default: "", + placeholder: "Notes", + permitted_values: [], + weight: 5, + instant_facet: false, + required: false, + public: true, + hide_search: true + }, + { + field_number: "7", + short_name: "Entities", + long_name: "Characterizing Entities and the Harm", + short_description: "Characterizing Entities and the Harm", + long_description: "Characterizing Entities and the Harm", + display_type: "object-list", + mongo_type: "array", + hide_search: true, + subfields: [ + { + field_number: "7.1", + short_name: "Entity", + long_name: "A short 1 to 2 word description of the entity.", + short_description: "A short 1 to 2 word description of the entity. When possible use a proper name for the entity, making it a Named Entity.", + long_description: "A short 1 to 2 word description of the entity. When possible use a proper name for the entity, making it a Named Entity.\n\nAnnotate information for each entity involved in the report. Try to capture every entity directly linked to the harm. Think about the entity that experienced the harm, all of the entities between them and the AI, and then all of the entities involved in producing and deploying the AI.\n\nEmployees representing a company in a media or public relations capacity should not be included as an entity.", + display_type: "string", + mongo_type: "string", + complete_from: { + entities: true + }, + default: "", + placeholder: "", + permitted_values: [], + weight: 5, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "7.2", + short_name: "Named Entity", + long_name: "Named Entity Indicator", + short_description: "Indicates if the entity is a Named Entity.", + long_description: "Indicates if the entity is a Named Entity. “Yes” if the entity is a named entity. “No” otherwise.", + display_type: "bool", + mongo_type: "bool", + permitted_values: [], + placeholder: "", + weight: 5, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "7.3", + short_name: "Entity type", + long_name: "Indicates the type of entity", + short_description: "Indicates the type of entity", + long_description: "Indicates the type of entity. If multiple selections could characterize the entity, select the primary function of the entity.", + display_type: "enum", + mongo_type: "string", + default: "unclear", + placeholder: "Entity Type", + permitted_values: [ + "individual", + "group of individuals", + "for-profit organization", + "non-profit organization", + "government entity", + "privately owned space", + "public space", + "infrastructure", + "social or political system", + "product", + "other", + "unclear" + ], + weight: 5, + instant_facet: false, + required: false, + public: true, + hide_search: true + }, + { + field_number: "7.4", + short_name: "Entity Relationship to the AI", + long_name: "Entity Relationship to the AI", + short_description: "Indicates the entity’s relationship to the AI.", + long_description: "Indicates the entity’s relationship to the AI. Note, the smallest possible chain of harm has just two elements; an AI and an entity experiencing harm, near-miss, or issue.", + display_type: "list", + mongo_type: "array", + default: "", + placeholder: "", + permitted_values: [ + "developer", + "deployer", + "government oversight", + "user", + "AI", + "geographic area of use", + "researcher", + "product containing AI", + "watchdog" + ], + weight: 5, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "7.5", + short_name: "Harm Category Experienced", + long_name: "Was an AI special interest intangible harm, tangible harm event, near-miss, or issue experienced by this entity", + short_description: "Was an AI special interest intangible harm, tangible harm event, near-miss, or issue experienced by this entity", + long_description: "Was an AI special interest intangible harm, tangible harm event, near-miss, or issue experienced by this entity. For each recorded entity, indicate the harm category that they experienced. Because recorded entities have a variety of roles in the AI incident, not every recorded entity will experience harm.", + display_type: "enum", + mongo_type: "string", + default: "unclear", + placeholder: "", + permitted_values: [ + "AI special interest intangible harm", + "AI tangible harm event", + "AI tangible harm near-miss", + "AI tangible harm issue", + "Other harm not meeting CSET definitions", + "not applicable", + "unclear" + ], + weight: 5, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "7.6", + short_name: "Harm Type Experienced", + long_name: "Type of harm experienced by entity ", + short_description: "Indicates the type of harm experienced by the harmed entity", + long_description: "Indicates the type of harm experienced by the harmed entity. Only entities experiencing harm should have an assigned type. If the entity did not experience the harm, ‘not applicable’ should be selected.", + display_type: "enum", + mongo_type: "string", + default: "not applicable", + placeholder: "", + permitted_values: [ + "physical health/safety", + "financial loss", + "physical property", + "intangible property", + "infrastructure", + "natural environment", + "social or political systems", + "violation of human rights, civil liberties, civil rights, or democratic norms", + "detrimental content", + "disproportionate treatment based upon a protected characteristic", + "other tangible harm", + "other intangible harm", + "not applicable" + ], + weight: 5, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "7.7", + short_name: "Notes (Characterizing Entities and the Harm)", + long_name: "Notes (Characterizing Entities and the Harm)", + short_description: "Input any notes that may help explain your answers.", + long_description: "Input any notes that may help explain your answers.", + display_type: "long_string", + mongo_type: "string", + default: "", + placeholder: "Notes", + permitted_values: [], + weight: 5, + instant_facet: false, + required: false, + public: true, + hide_search: true + } + ], + default: "[]", + placeholder: "", + permitted_values: [], + weight: 5, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "8.1", + short_name: "Lives Lost", + long_name: "How many human lives were lost?", + short_description: "Indicates the number of deaths reported", + long_description: "This field cannot be greater than zero if the harm is anything besides ‘Physical health/safety.’ ", + display_type: "int", + mongo_type: "int", + default: "", + placeholder: "", + permitted_values: [], + weight: 5, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "8.2", + short_name: "Injuries", + long_name: "How many humans were injured?", + short_description: "Indicate the number of injuries reported.", + long_description: "This field cannot be greater than zero if the harm is anything besides 'Physical health/safety'.\n\nAll reported injuries should count, regardless of their severity level. If a person lost their limb and another person scraped their elbow, both cases would be considered injuries. Do not include the number of deaths in this count.", + display_type: "int", + mongo_type: "int", + default: "", + placeholder: "", + permitted_values: [], + weight: 5, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "8.3", + short_name: "Estimated Harm Quantities", + long_name: "Are any quantities estimated?", + short_description: "Indicates if the amount was estimated.", + long_description: "Indicates if the amount was estimated.", + display_type: "bool", + mongo_type: "bool", + permitted_values: [], + placeholder: "", + weight: 5, + instant_facet: false, + required: false, + hide_search: true, + public: true + }, + { + field_number: "8.4", + short_name: "Notes ( Tangible Harm Quantities Information)", + long_name: "Notes ( Tangible Harm Quantities Information)", + short_description: "Input any notes that may help explain your answers.", + long_description: "Input any notes that may help explain your answers.", + display_type: "long_string", + mongo_type: "string", + default: "", + placeholder: "Notes", + permitted_values: [], + weight: 5, + instant_facet: false, + required: false, + public: true, + hide_search: true + }, + { + field_number: "9.1", + short_name: "AI System Description", + long_name: "Description of the AI system involved", + short_description: "A description of the AI system (when possible)", + long_description: "Describe the AI system in as much detail as the reports will allow.\n\nA high level description of the AI system is sufficient, but if more technical details about the AI system are available, include them in the description as well.", + display_type: "long_string", + mongo_type: "string", + default: "", + placeholder: "Description of the AI system involved", + permitted_values: [], + weight: 5, + instant_facet: false, + required: false, + public: true, + hide_search: true + }, + { + field_number: "9.2", + short_name: "Data Inputs", + long_name: "Description of data inputs to the AI system", + short_description: "A list of the types of data inputs for the AI system.", + long_description: "This is a freeform field that can have any value. There could be multiple entries for this field.\n\nCommon ones include\n\n- still images\n- video\n- text\n- speech\n- Personally Identifiable Information\n- structured data\n- other\n- unclear\n\nStill images are static images. Video images consist of moving images. Text and speech data are considered an important category of unstructured data. They consist of written and spoken words that are not in a tabular format. Personally identifiable information is data that can uniquely identify an individual and may contain sensitive information. Structured data is often in a tabular, machine readable format and can typically be used by an AI system without much preprocessing.\n\nAvoid using ‘unstructured data’ data in this field. Instead specify the type of unstructured data; text, images, audio files, etc. It is ok to use ‘structured data’ in this field.\n\nRecord what the media report explicitly states. If the report does not explicitly state an input modality but it is likely that a particular kind of input contributed to the harm or near harm, record that input. If you are still unsure, do not record anything.", + display_type: "list", + mongo_type: "array", + default: "", + placeholder: "", + permitted_values: [], + weight: 5, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "9.3", + short_name: "Sector of Deployment", + long_name: "Indicates the sector in which the AI system is deployed", + short_description: "Indicate the sector in which the AI system is deployed", + long_description: "Indicate the sector in which the AI system is deployed\n\nThere could be multiple entries for this field.", + display_type: "multi", + mongo_type: "array", + default: "", + placeholder: "", + permitted_values: [ + "agriculture, forestry and fishing", + "mining and quarrying", + "manufacturing", + "electricity, gas, steam and air conditioning supply", + "water supply", + "construction", + "wholesale and retail trade", + "transportation and storage", + "accommodation and food service activities", + "information and communication", + "financial and insurance activities", + "real estate activities", + "professional, scientific and technical activities", + "administrative and support service activities", + "public administration", + "defense", + "law enforcement", + "Education", + "human health and social work activities", + "Arts, entertainment and recreation", + "other service activities", + "activities of households as employers", + "activities of extraterritorial organizations and bodies", + "other", + "unclear" + ], + weight: 60, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "9.4", + short_name: "Public Sector Deployment", + long_name: "Indicates whether the AI system is deployed in the public sector", + short_description: "Indicate whether the AI system is deployed in the public sector", + long_description: "Indicate whether the AI system is deployed in the public sector. The public sector is the part of the economy that is controlled and operated by the government.", + display_type: "enum", + mongo_type: "string", + default: "maybe", + permitted_values: [ + "yes", + "no", + "maybe" + ], + placeholder: "", + weight: 40, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "9.5", + short_name: "Autonomy Level", + long_name: "Autonomy Level", + short_description: "Autonomy1: The system operates independently without simultaneous human oversight, interaction, or intervention.\n\nAutonomy2: The system operates independently but with human oversight, where a human can observe and override the system’s decisions in real time.\n\nAutonomy3: The system does not independently make decisions but instead provides information to a human who actively chooses to proceed with the AI’s information.", + long_description: "Autonomy1: The system operates independently without simultaneous human oversight, interaction, or intervention.\n\nAutonomy2: The system operates independently but with human oversight, where a human can observe and override the system’s decisions in real time.\n\nAutonomy3: The system does not independently make decisions but instead provides information to a human who actively chooses to proceed with the AI’s information.", + display_type: "enum", + mongo_type: "string", + default: "", + placeholder: "", + permitted_values: [ + "Autonomy1", + "Autonomy2", + "Autonomy3", + "unclear" + ], + weight: 40, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "9.8", + short_name: "Notes (Information about AI System)", + long_name: "Notes (Information about AI System)", + short_description: "Input any notes that may help explain your answers.", + long_description: "Input any notes that may help explain your answers.", + display_type: "long_string", + mongo_type: "string", + default: "", + placeholder: "Notes", + permitted_values: [], + weight: 5, + instant_facet: false, + required: false, + public: true, + hide_search: true + }, + { + field_number: "10.1", + short_name: "Intentional Harm", + long_name: "Was the AI intentionally developed or deployed to perform the harm?", + short_description: "Was the AI intentionally developed or deployed to perform the harm?\n\nIf yes, did the AI’s behavior result in unintended or intended harm?", + long_description: "Indicates if the system was designed to do harm. If it was designed to perform harm, the field will indicate if the AI system did or did not create unintended harm–i.e. was the reported harm the harm that AI was expected to perform or a different unexpected harm? ", + display_type: "enum", + mongo_type: "string", + default: "unclear", + placeholder: "", + permitted_values: [ + "Yes. Intentionally designed to perform harm and did create intended harm", + "Yes. Intentionally designed to perform harm but created an unintended harm (a different harm may have occurred)", + "No. Not intentionally designed to perform harm", + "unclear" + ], + weight: 40, + instant_facet: false, + required: false, + public: true, + notes: "Tracking and analyzing harm from AI systems designed to do harm is valuable and worthwhile. However, analysts may want to separately analyze harm from AI systems that were or were not designed to produce the observed harm." + }, + { + field_number: "10.2", + short_name: "Physical System Type", + long_name: "Into what type of physical system was the AI integrated, if any?", + short_description: "Describe the type of physical system that the AI was integrated into.", + long_description: "Describe the type of physical system that the AI was integrated into. ", + display_type: "string", + mongo_type: "string", + default: "", + placeholder: "Physical System Type (e.g. trash sorting robot)", + permitted_values: [], + weight: 5, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "10.3", + short_name: "AI Task", + long_name: "AI task or core application area", + short_description: "Describe the AI’s application.", + long_description: "Describe the AI’s application.\n\nIt is likely that the annotator will not have enough information to complete this field. If this occurs, enter unclear.\n\nThis is a freeform field. Some possible entries are\n\n- unclear\n- human language technologies\n- computer vision\n- robotics\n- automation and/or optimization\n- other\n\nThe application area of an AI is the high level task that the AI is intended to perform. It does not describe the technical methods by which the AI performs the task. Considering what an AI’s technical methods enable it to do is another way of arriving at what an AI’s application is. \n\nIt is possible for multiple application areas to be involved. When possible pick the principle or domain area, but it is ok to select multiple areas.", + display_type: "list", + mongo_type: "array", + default: "", + placeholder: "", + permitted_values: [], + weight: 5, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "10.4", + short_name: "AI tools and methods", + long_name: "AI tools and methods", + short_description: "Describe the tools and methods that enable the AI’s application.", + long_description: "Describe the tools and methods that enable the AI’s application.\n\nIt is likely that the annotator will not have enough information to complete this field. If this occurs, enter unclear\n\nThis is a freeform field. Some possible entries are\n\n- unclear\n- reinforcement learning\n- neural networks\n- decision trees\n- bias mitigation\n- optimization\n- classifier\n- NLP/text analytics\n- continuous learning\n- unsupervised learning\n- supervised learning\n- clustering\n- prediction\n- rules\n- random forest\n\nAI tools and methods are the technical building blocks that enable the AI’s application.", + display_type: "list", + mongo_type: "array", + default: "unclear", + placeholder: "", + permitted_values: [], + weight: 40, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "10.5", + short_name: "Notes (AI Functionality and Techniques)", + long_name: "Notes (AI Functionality and Techniques)", + short_description: "Input any notes that may help explain your answers.", + long_description: "Input any notes that may help explain your answers.", + display_type: "long_string", + mongo_type: "string", + default: "", + placeholder: "Notes", + permitted_values: [], + weight: 5, + instant_facet: false, + required: false, + public: true, + hide_search: true + } + ], + + // TODO: created_at is missing from Atlas schema + // created_at: new Date("1722269934190") + }, + { + _id: new ObjectId("5f5f3b3b4f3b9b001f3b9b00"), + namespace: "CSETv1_Annotator-2", + weight: 70, + complete_entities: true, + description: "# What is the CSET Taxonomy?\n\nThe CSET AI Harm Taxonomy for AIID is the second edition of the \nCSET incident taxonomy.", + dummy_fields: [ + { + field_number: "1", + short_name: "Metadata" + }, + { + field_number: "2", + short_name: "Incident Domain" + }, + { + field_number: "3", + short_name: "AI Tangible Harm Assessment" + }, + { + field_number: "4", + short_name: "Special Interest Intangible Harm" + }, + { + field_number: "5", + short_name: "AI Special Interest Intangible Harm Assessment" + }, + { + field_number: "6", + short_name: "Environmental and Temporal Characteristics" + }, + { + field_number: "7", + short_name: "Characterizing Entities and the Harm" + }, + { + field_number: "8", + short_name: "Tangible Harm Quantities " + }, + { + field_number: "9", + short_name: "Information about AI System" + }, + { + field_number: "10", + short_name: "AI Functionality and Techniques" + } + ], + field_list: [ + { + field_number: "1.1", + short_name: "Incident Number", + long_name: "The number of the incident in the AI Incident Database.", + short_description: "The number of the incident in the AI Incident Database.", + long_description: "The number of the incident in the AI Incident Database.", + display_type: "int", + mongo_type: "int", + default: "", + weight: 5, + instant_facet: false, + required: false, + public: true, + hide_search: true + }, + { + field_number: "1.2", + short_name: "Annotator", + long_name: "Person responsible for the annotations", + short_description: "This is the researcher that is responsible for applying the classifications of the CSET taxonomy.", + long_description: "An ID designating the individual who classified this incident according to the CSET taxonomy.", + display_type: "string", + mongo_type: "string", + default: "", + placeholder: "Select name here", + permitted_values: [], + weight: 5, + instant_facet: false, + required: false, + public: false, + hide_search: true + }, + { + field_number: "1.3", + short_name: "Annotation Status", + long_name: "Where in the annotation process is this incident?", + short_description: "What is the quality assurance status of the CSET classifications for this incident?", + long_description: "What is the quality assurance status of the CSET classifications for this incident?", + display_type: "enum", + mongo_type: "string", + default: "", + placeholder: "Select process status here", + permitted_values: [ + "1. Annotation in progress", + "2. Initial annotation complete", + "3. In peer review", + "4. Peer review complete", + "5. In quality control", + "6. Complete and final" + ], + weight: 10, + instant_facet: false, + required: false, + public: false, + hide_search: true, + notes: "When you start a row, switch this field from blank to “Annotation in progress” so other annotators know not to work on the same row (and can be sure it wasn’t skipped or left unfinished accidentally).\n\nOnce a row is marked “Initial annotation complete,” we will assume that any remaining blanks were left deliberately - that is, you looked, but couldn’t find enough information to fill out the blank fields. For this reason, please don’t mark a row “Initial annotation complete” until you’ve truly finished filling it out.\n\nWhen peer review begins, the assigned reviewer should switch the status to “In peer review.” When the review is complete and all comments have been resolved, either the peer reviewer or the original annotator should switch the status to “Peer review complete.”\n\nOptions 5 and 6 should only ever be selected by the project lead" + }, + { + field_number: "1.4", + short_name: "Peer Reviewer", + long_name: "Person responsible for reviewing annotations", + short_description: "This is the researcher that is responsible for ensuring the quality of the classifications applied to this incident.", + long_description: "The CSET taxonomy assigns individual researchers to each incident as the primary parties responsible for classifying the incident according to the taxonomy. This is the person responsible for assuring the integrity of annotator's classifications.", + display_type: "string", + mongo_type: "string", + default: "", + placeholder: "Select name here", + permitted_values: [], + weight: 20, + instant_facet: false, + required: false, + public: false, + hide_search: true, + notes: "The project lead will assign a peer reviewer to each incident." + }, + { + field_number: "1.5", + short_name: "Quality Control", + long_name: "Was this incident randomly selected for additional quality control?", + short_description: "Has someone flagged a potential issue with this incident's classifications? Annotators should leave this field blank.", + long_description: "The peer review process sometimes uncovers issues with the classifications that have been applied by the annotator. This field serves as a flag when there is a need for additional thought and input on the classifications applied", + display_type: "bool", + mongo_type: "bool", + default: "false", + placeholder: "", + permitted_values: [], + weight: 15, + instant_facet: false, + required: false, + public: false, + hide_search: true + }, + { + field_number: "2.1", + short_name: "Physical Objects", + long_name: "Did the incident occur in a domain with physical objects ?", + short_description: "Did the incident occur in a domain with physical objects ?", + long_description: "“Yes” if the AI system(s) is embedded in hardware that can interact with, affect, and change the physical objects (cars, robots, medical facilities, etc.). Mark “No” if the system cannot. This includes systems that inform, detect, predict, or recommend.", + display_type: "enum", + mongo_type: "string", + default: "maybe", + permitted_values: [ + "yes", + "no", + "maybe" + ], + placeholder: "", + weight: 40, + instant_facet: false, + required: false, + notes: "Context matters. AI systems embedded in hardware that can physically interact are more likely to cause death, injury, or damage." + }, + { + field_number: "2.2", + short_name: "Entertainment Industry", + long_name: "Did the AI incident occur in the entertainment industry?", + short_description: "Did the AI incident occur in the entertainment industry?", + long_description: "“Yes” if the sector in which the AI was used is associated with entertainment. “No” if it was used in a different, clearly identifiable sector. “Maybe” if the sector of use could not be determined.", + display_type: "enum", + mongo_type: "string", + default: "maybe", + permitted_values: [ + "yes", + "no", + "maybe" + ], + placeholder: "", + weight: 40, + instant_facet: false, + required: false, + notes: "Context matters. AI systems used for entertainment are less likely to result in harm. For example a deepfake used in a movie is less likely to cause harm than a deepfake used for political misinformation." + }, + { + field_number: "2.3", + short_name: "Report, Test, or Study of data", + long_name: "Was the incident about a report, test, or study of data instead of the AI itself?", + short_description: "Was the incident about a report, test, or study of data instead of the AI itself?", + long_description: "“Yes” if the incident is about a report, test, or study of the data and does not discuss an instance of injury, damage, or loss. “Maybe” if it is unclear. Otherwise mark “No.”", + display_type: "enum", + mongo_type: "string", + default: "maybe", + permitted_values: [ + "yes", + "no", + "maybe" + ], + placeholder: "", + weight: 40, + instant_facet: false, + required: false, + notes: "Sometimes there are reports about issues with the data that could be used to develop AI systems. Since there are mitigation approaches, data issues do not automatically mean that the associated AI will have issues that lead to harm. A projection or hypothesis of the harm resulting from data issues is not sufficient. There must be harm that can be clearly linked to an AI." + }, + { + field_number: "2.4", + short_name: "Deployed", + long_name: "Was the reported system (even if AI involvement is unknown) deployed or sold to users?", + short_description: "Was the reported system (even if AI involvement is unknown) deployed or sold to users?", + long_description: "“Yes” if the involved system was deployed or sold to users. “No” if it was not. “Maybe” if there is not enough information or if the use is unclear.", + display_type: "enum", + mongo_type: "string", + default: "maybe", + permitted_values: [ + "yes", + "no", + "maybe" + ], + placeholder: "", + weight: 40, + instant_facet: false, + required: false, + notes: "Systems that are not deployed or sold to users tend to still be in the development stage and hence are less likely to cause harm. However, harm can still be possible. " + }, + { + field_number: "2.5", + short_name: "Producer Test in Controlled Conditions", + long_name: "Was this a test or demonstration of an AI system done by developers, producers or researchers (versus users) in controlled conditions?", + short_description: "Was this a test or demonstration of an AI system done by developers, producers or researchers (versus users) in controlled conditions?", + long_description: "“Yes” if it was a test/demonstration performed by developers, producers or journalists in controlled conditions. “No” if it was not a test/demonstration. “No” if the test/demonstration was done by a user. “No” if the test/demonstration was in operational or uncontrolled conditions. “Maybe” otherwise.", + display_type: "enum", + mongo_type: "string", + default: "maybe", + permitted_values: [ + "yes", + "no", + "maybe" + ], + placeholder: "", + weight: 40, + instant_facet: false, + required: false, + notes: "AI system tests or demonstrations by developers, producers, or researchers in controlled environments are less likely to expose people, organizations, property, institutions, or the natural environment to harm. Controlled environments may include situations such as an isolated compute system, a regulatory sandbox, or an autonomous vehicle testing range. " + }, + { + field_number: "2.6", + short_name: "Producer Test in Operational Conditions", + long_name: "Was this a test or demonstration of an AI system done by developers, producers or researchers (versus users) in operational conditions?", + short_description: "Was this a test or demonstration of an AI system done by developers, producers or researchers (versus users) in operational conditions?", + long_description: "“Yes” if it was a test/demonstration performed by developers, producers or journalists in controlled conditions. “No” if it was not a test/demonstration. “No” if the test/demonstration was done by a user. “No” if the test/demonstration was in controlled or non-operational conditions. “Maybe” otherwise.", + display_type: "enum", + mongo_type: "string", + default: "maybe", + permitted_values: [ + "yes", + "no", + "maybe" + ], + placeholder: "", + weight: 40, + instant_facet: false, + required: false, + notes: "While almost every AI system undergoes testing or demonstration in a controlled environment, some also undergo testing or demonstration in an operational environment. Testing in operational environments still occurs before the system is deployed or sold to end-users. However, relative to controlled environments, operational environments try to closely represent real-world conditions and end-users that affect use of the AI system. Therefore, testing in an operational environment typically poses a heightened risk of harm to people, organizations, property, institutions, or the environment." + }, + { + field_number: "2.7", + short_name: "User Test in Controlled Conditions", + long_name: "Was this a test or demonstration done by users in controlled conditions?", + short_description: "Was this a test or demonstration done by users in controlled conditions?", + long_description: "“Yes” if it was a test/demonstration performed by users in controlled conditions. “No” if it was not a test/demonstration. “No” if the test/demonstration was done by developers, producers or researchers. “No” if the test/demonstration was in controlled or non-controlled conditions.“Maybe” otherwise.", + display_type: "enum", + mongo_type: "string", + default: "maybe", + permitted_values: [ + "yes", + "no", + "maybe" + ], + placeholder: "", + weight: 40, + instant_facet: false, + required: false, + notes: "The involvement of a user (versus a developer, producer, or researcher) increases the likelihood that harm can occur even if the AI system is being tested. Relative to controlled environments, controlled environments try to closely represent real-world conditions and end-users that affect use of the AI system. Therefore, testing in an controlled environment typically poses a heightened risk of harm to people, organizations, property, institutions, or the environment." + }, + { + field_number: "2.8", + short_name: "User Test in Operational Conditions", + long_name: "Was this a test or demonstration done by users in operational conditions?", + short_description: "Was this a test or demonstration done by users in operational conditions?", + long_description: "“Yes” if it was a test/demonstration performed by users in operational conditions. “No” if it was not a test/demonstration. “No” if the test/demonstration was done by developers, producers or researchers. “No” if the test/demonstration was in controlled or non-operational conditions.“Maybe” otherwise.", + display_type: "enum", + mongo_type: "string", + default: "maybe", + permitted_values: [ + "yes", + "no", + "maybe" + ], + placeholder: "", + weight: 40, + instant_facet: false, + required: false, + notes: "Sometimes, prior to deployment, the user will perform a test or demonstration of the AI system. The involvement of a user (versus a developer, producer, or researcher) increases the likelihood that harm can occur even if the AI system is being tested in controlled environments." + }, + { + field_number: "2.9", + short_name: "Harm Domain", + long_name: "Incident occurred in a domain where we could expect harm to occur?", + short_description: "Incident occurred in a domain where we could likely expect harm to occur?", + long_description: "Using the answers to the 8 domain questions, assess if the incident occurred in a domain where harm could be expected to occur. If you are unclear, input “maybe.”", + display_type: "enum", + mongo_type: "string", + default: "maybe", + permitted_values: [ + "yes", + "no", + "maybe" + ], + placeholder: "", + weight: 40, + instant_facet: false, + required: false, + hide_search: true, + notes: "Reflecting upon the previously answered questions, decide if the reported incident or instance occurred in a domain in which harm could possibly occur. This is not a decision on whether or not harm did occur. Just a reflection on the operating conditions or context of the system." + }, + { + field_number: "3.1", + short_name: "Tangible Harm", + long_name: "Did tangible harm (loss, damage or injury ) occur? ", + short_description: "Did tangible harm (loss, damage or injury ) occur? ", + long_description: "An assessment of whether tangible harm, imminent tangible harm, or non-imminent tangible harm occurred. This assessment does not consider the context of the tangible harm, if an AI was involved, or if there is an identifiable, specific, and harmed entity. It is also not assessing if an intangible harm occurred. It is only asking if tangible harm occurred and what its imminency was.", + display_type: "enum", + mongo_type: "string", + default: "unclear", + placeholder: "", + permitted_values: [ + "tangible harm definitively occurred", + "imminent risk of tangible harm (near miss) did occur", + "non-imminent risk of tangible harm (an issue) occurred", + "no tangible harm, near-miss, or issue", + "unclear" + ], + weight: 40, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "3.2", + short_name: "AI System", + long_name: "Does the incident involve an AI system?", + short_description: "Does the incident involve an AI system?", + long_description: "An assessment of whether or not an AI system was involved. It is sometimes difficult to judge between an AI and an automated system or expert rules system. In these cases select “maybe”", + display_type: "enum", + mongo_type: "string", + default: "maybe", + permitted_values: [ + "yes", + "no", + "maybe" + ], + placeholder: "", + weight: 40, + instant_facet: false, + required: false, + public: true, + notes: "Note, over time more information about the incident may become available, allowing a ‘maybe’ to be changed to a ‘yes’ or ‘no.’" + }, + { + field_number: "3.3", + short_name: "Clear link to technology", + long_name: "Can the technology be directly and clearly linked to the adverse outcome of the incident", + short_description: "Can the technology be directly and clearly linked to the adverse outcome of the incident", + long_description: "An assessment of the technology's involvement in the chain of harm. \"Yes\" indicates that the technology was involved in harm, its behavior can be directly linked to the harm, and the harm may not have occurred if the technology acted differently. \"No\", indicates that the technology's behavior cannot be linked to the harm outcome. \"Maybe\" indicates that the link is unclear.", + hide_search: true, + display_type: "enum", + mongo_type: "string", + default: "maybe", + permitted_values: [ + "yes", + "no", + "maybe" + ], + placeholder: "", + weight: 40, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "3.4", + short_name: "There is a potentially identifiable specific entity that experienced the harm", + long_name: "There is a potentially identifiable specific entity that experienced the harm", + short_description: "A potentially identifiable specific entity that experienced the harm can be characterized or identified.", + long_description: "“Yes” if it is theoretically possible to both specify and identify the entity. Having that information is not required. The information just needs to exist and be potentially discoverable. “No” if there are not any potentially identifiable specific entities or if the harmed entities are a class or subgroup that can only be characterized. ", + display_type: "bool", + mongo_type: "bool", + permitted_values: [], + placeholder: "", + default: "", + weight: 40, + instant_facet: false, + required: false, + public: true, + hide_search: true, + notes: "A potentially identifiable specific entity is an entity that can be described in detail such that the name (Mr. Joe Smith, Acme Inc, etc.) or a unique identifier (e.g. 100 Main Street, Anywhere USA) of the entity could be found. We may not know the name or identifier of the entity from the reports, but it does exist and could be found. For example, the general public is not a potentially identifiable specific entity. However, incarcerated people in the Springfield penitentiary would be specific entities because it would be possible to get a list of all the prisoners in the facility." + }, + { + field_number: "3.5", + short_name: "AI Harm Level", + long_name: "Annotator's AI tangible harm level assessment", + short_description: "An assessment of the AI tangible harm level, which takes into account the CSET definitions of AI tangible harm levels, along with the inputs for annotation fields about the AI, harm, chain of harm, and entity. ", + long_description: "An assessment of the AI tangible harm level, which takes into account the CSET definitions of AI tangible harm levels, along with the inputs for annotation fields about the AI, harm, chain of harm, and entity.", + display_type: "enum", + mongo_type: "string", + default: "unclear", + placeholder: "", + permitted_values: [ + "AI tangible harm event", + "AI tangible harm near-miss", + "AI tangible harm issue", + "none", + "unclear" + ], + weight: 40, + instant_facet: false, + required: false, + public: true, + notes: "Special interest intangible harm is determined in a different field. The determination of a special interest intangible harm is not dependant upon the AI tangible harm level" + }, + { + field_number: "3.6", + short_name: "AI Tangible Harm Level Notes", + long_name: "AI Tangible Harm Level Notes", + short_description: "Notes about the AI tangible harm level assessment", + long_description: "If for 3.5 you select unclear or leave it blank, please provide a brief description of why.\n\n You can also add notes if you want to provide justification for a level", + display_type: "long_string", + mongo_type: "string", + default: "", + placeholder: "Notes about the AI tangible harm level assessment", + permitted_values: [], + weight: 5, + instant_facet: false, + required: false, + public: true, + hide_search: true + }, + { + field_number: "4.1", + short_name: "Impact on Critical Services", + long_name: "Did this impact people's access to critical or public services (health care, social services, voting, transportation, etc)?", + short_description: "Indicates if people’s access to critical public services was impacted.", + long_description: "Did this impact people's access to critical or public services (health care, social services, voting, transportation, etc)?", + display_type: "enum", + mongo_type: "string", + default: "maybe", + permitted_values: [ + "yes", + "no", + "maybe" + ], + placeholder: "", + weight: 40, + instant_facet: false, + required: false, + public: true, + notes: "Public services include healthcare, social services, voting, public transportation, education, and consumer protection.\n\nNote, if ‘yes’ is selected then there was likely a violation of civil liberties and there was a special interest intangible harm." + }, + { + field_number: "4.2", + short_name: "Rights Violation", + long_name: "Was this a violation of human rights, civil liberties, civil rights, or democratic norms?", + short_description: "Indicate if a violation of human rights, civil rights, civil liberties, or democratic norms occurred.", + long_description: "Indicate if a violation of human rights, civil rights, civil liberties, or democratic norms occurred.", + display_type: "enum", + mongo_type: "string", + default: "maybe", + permitted_values: [ + "yes", + "no", + "maybe" + ], + placeholder: "", + weight: 40, + instant_facet: false, + required: false, + public: true, + notes: "It can often be difficult for the typical annotator to differentiate between violations of civil liberties, civil rights, human rights, and democratic norms. For this reason CSET grouped them together.\n\nHuman rights are rights inherent to all human beings, regardless of race, sex, nationality, ethnicity, language, religion, or any other status. They include the right to life and liberty, freedom from slavery and torture, freedom of opinion and expression, and the right to work and education. Civil rights are legal provisions that originate from notions of equality and can be enforced by law. Civil liberties are personal freedoms that are referenced in the Bill of Rights. Democratic norms are traditions, customs, and best practices that support democracy. An example of a democratic norm is accepting election results and facilitating a peaceful transfer of political power." + }, + { + field_number: "4.3", + short_name: "Involving Minor", + long_name: "Was a minor involved in the incident (disproportionally treated or specifically targeted/affected)", + short_description: "Was a minor involved in the incident (disproportionally treated or specifically targeted/affected)", + long_description: "Indicate if a minor was disproportionately targeted or affected", + display_type: "enum", + mongo_type: "string", + default: "maybe", + permitted_values: [ + "yes", + "no", + "maybe" + ], + placeholder: "", + weight: 40, + instant_facet: false, + required: false, + public: true, + notes: "Generally, governments have an interest in establishing heightened protections for minors. These protections are often associated with media content or privacy. For example, if an AI system illegally tracked a minor’s activity online, then answer “yes” to this question. There are instances where an AI system causes indiscriminate harm to a group of people, and it is plausible that some of those people are minors. However, in this case the entire group of people, adults and children alike, shared the distribution of harm equally and therefore the answer to this question would be “no.”" + }, + { + field_number: "4.4", + short_name: "Detrimental Content", + long_name: "Was detrimental content (misinformation, hate speech) involved?", + short_description: "Was detrimental content (misinformation, hate speech) involved?", + long_description: "Detrimental content can include deepfakes, identity misrepresentation, insults, threats of violence, eating disorder or self harm promotion, extremist content, misinformation, sexual abuse material, and scam emails. Detrimental content in itself is often not harmful, however, it can lead to or instigate injury, damage, or loss.", + display_type: "enum", + mongo_type: "string", + default: "maybe", + permitted_values: [ + "yes", + "no", + "maybe" + ], + placeholder: "", + weight: 40, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "4.5", + short_name: "Protected Characteristic", + long_name: "Was a group of people or an individual treated differently based upon a protected characteristic?", + short_description: "Was a group of people treated differently based upon a protected characteristic (e.g. race, ethnicity, creed, immigrant status, color, religion, sex, national origin, age, disability, genetic information)?", + long_description: "Protected characteristics include religion, commercial facilities, geography, age, sex, sexual orientation or gender identity, familial status (e.g., having or not having children) or pregnancy, disability, veteran status, genetic information, financial means, race or creed, Ideology, nation of origin, citizenship, and immigrant status.\n\nAt the federal level in the US, age is a protected characteristic for people over the age of 40. Minors are not considered a protected class. For this reason the CSET annotation taxonomy has a separate field to note if a minor was involved.\n\nOnly mark yes if there is clear evidence discrimination occurred. If there are conflicting accounts, mark unsure. Do not mark that discrimination occurred based on expectation alone.", + display_type: "enum", + mongo_type: "string", + default: "maybe", + permitted_values: [ + "yes", + "no", + "maybe" + ], + placeholder: "", + weight: 40, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "4.6", + short_name: "Harm Distribution Basis", + long_name: "If harms were potentially unevenly distributed among people, on what basis?", + short_description: "Indicates how the harms were potentially distributed.", + long_description: "Multiple can occur.\n\nGenetic information refers to information about a person’s genetic tests or the genetic tests of their relatives. Genetic information can predict the manifestation of a disease or disorder.", + display_type: "multi", + mongo_type: "string", + default: "unclear", + placeholder: "", + permitted_values: [ + "none", + "age", + "disability", + "familial status (e.g., having or not having children) or pregnancy", + "financial means", + "genetic information", + "geography", + "ideology", + "nation of origin, citizenship, immigrant status", + "race", + "religion", + "sex", + "sexual orientation or gender identity", + "veteran status", + "unclear", + "other" + ], + weight: 60, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "4.7", + short_name: "Notes (special interest intangible harm)", + long_name: "Input any notes that may help explain your answers.", + short_description: "Input any notes that may help explain your answers.", + long_description: "Input any notes that may help explain your answers.", + display_type: "long_string", + mongo_type: "string", + default: "", + placeholder: "Notes", + permitted_values: [], + weight: 5, + instant_facet: false, + required: false, + public: true, + hide_search: true + }, + { + field_number: "5.1", + short_name: "Special Interest Intangible Harm", + long_name: "Was there a special interest intangible harm or risk of harm?", + short_description: "An assessment of whether a special interest intangible harm occurred. This assessment does not consider the context of the intangible harm, if an AI was involved, or if there is characterizable class or subgroup of harmed entities. It is also not assessing if an intangible harm occurred. It is only asking if a special interest intangible harm occurred.", + long_description: "An assessment of whether a special interest intangible harm occurred. This assessment does not consider the context of the intangible harm, if an AI was involved, or if there is characterizable class or subgroup of harmed entities. It is also not assessing if an intangible harm occurred. It is only asking if a special interest intangible harm occurred.", + display_type: "enum", + mongo_type: "string", + default: "maybe", + permitted_values: [ + "yes", + "no", + "maybe" + ], + placeholder: "", + weight: 5, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "5.2", + short_name: "AI System", + long_name: "Does the incident involve an AI system?", + short_description: "Does the incident involve an AI system?", + long_description: "An assessment of whether or not an AI system was involved. It is sometimes difficult to judge between an AI and an automated system or expert rules system. In these cases select “maybe”", + display_type: "enum", + mongo_type: "string", + default: "maybe", + permitted_values: [ + "yes", + "no", + "maybe" + ], + placeholder: "", + weight: 40, + instant_facet: false, + required: false, + public: true, + hide_search: true, + notes: "Note, over time more information about the incident may become available, allowing a ‘maybe’ to be changed to a ‘yes’ or ‘no.’" + }, + { + field_number: "5.3", + short_name: "Clear link to Technology", + long_name: "Can the technology be directly and clearly linked to the adverse outcome of the incident?", + short_description: "Can the technology be directly and clearly linked to the adverse outcome of the incident?", + long_description: "An assessment of the technology's involvement in the chain of harm. \"Yes\" indicates that the technology was involved in harm, its behavior can be directly linked to the harm, and the harm may not have occurred if the technology acted differently. \"No\", indicates that the technology's behavior cannot be linked to the harm outcome. \"Maybe\" indicates that the link is unclear.", + display_type: "enum", + mongo_type: "string", + default: "maybe", + permitted_values: [ + "yes", + "no", + "maybe" + ], + placeholder: "", + weight: 40, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "5.4", + short_name: "Harmed Class of Entities", + long_name: "There is a characterizable class or subgroup of entities that experienced the harm", + short_description: "“Yes” if the harmed entity or entities can be characterized. “No” if there are not any characterizable entities.", + long_description: "A characterizable class or subgroup are descriptions of different populations of people. Often they are characteristics by which people qualify for special protection by a law, policy, or similar authority.\n\n Sometimes, groups may be characterized by their exposure to the incident via geographical proximity (e.g., ‘visitors to the park’) or participation in an activity (e.g.,‘Twitter users’).", + display_type: "bool", + mongo_type: "bool", + permitted_values: [], + placeholder: "", + weight: 40, + instant_facet: false, + required: false, + public: true, + hide_search: true, + notes: "" + }, + { + field_number: "5.5", + short_name: "Annotator’s AI special interest intangible harm assessment", + long_name: "The annotator’s assessment of if an AI special interest intangible harm occurred.", + short_description: "The annotator’s assessment of if an AI special interest intangible harm occurred.", + long_description: "AI tangible harm is determined in a different field. The determination of a special interest intangible harm is not dependant upon the AI tangible harm level.", + display_type: "enum", + mongo_type: "string", + default: "maybe", + permitted_values: [ + "yes", + "no", + "maybe" + ], + placeholder: "", + weight: 40, + instant_facet: false, + required: false, + public: true, + notes: "" + }, + { + field_number: "5.6", + short_name: "Notes (AI special interest intangible harm)", + long_name: "If for 5.5 you select unclear or leave it blank, please provide a brief description of why.\n\nYou can also add notes if you want to provide justification for a level.", + short_description: "If for 5.5 you select unclear or leave it blank, please provide a brief description of why.\n\nYou can also add notes if you want to provide justification for a level.", + long_description: "If for 5.5 you select unclear or leave it blank, please provide a brief description of why.\n\nYou can also add notes if you want to provide justification for a level.", + display_type: "long_string", + mongo_type: "string", + default: "", + placeholder: "Notes", + permitted_values: [], + weight: 5, + instant_facet: false, + required: false, + public: true, + hide_search: true + }, + { + field_number: "6.1", + short_name: "Date of Incident Year", + long_name: "The year in which the incident first occurred.", + short_description: "The year in which the incident occurred. If there are multiple harms or occurrences of the incident, list the earliest. If a precise date is unavailable, but the available sources provide a basis for estimating the year, estimate. Otherwise, leave blank.\n\nEnter in the format of YYYY", + long_description: "The year in which the incident occurred. If there are multiple harms or occurrences of the incident, list the earliest. If a precise date is unavailable, but the available sources provide a basis for estimating the year, estimate. Otherwise, leave blank.", + display_type: "string", + mongo_type: "string", + default: "", + placeholder: "YYYY", + permitted_values: [], + weight: 5, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "6.2", + short_name: "Date of Incident Month", + long_name: "The month in which the incident first occurred.", + short_description: "The month in which the incident occurred. If there are multiple harms or occurrences of the incident, list the earliest. If a precise date is unavailable, but the available sources provide a basis for estimating the month, estimate. Otherwise, leave blank.\n\nEnter in the format of MM", + long_description: "The month in which the incident occurred. If there are multiple harms or occurrences of the incident, list the earliest. If a precise date is unavailable, but the available sources provide a basis for estimating the month, estimate. Otherwise, leave blank.", + display_type: "string", + mongo_type: "string", + default: "", + placeholder: "MM", + permitted_values: [], + weight: 5, + instant_facet: false, + required: false, + public: true, + hide_search: true + }, + { + field_number: "6.3", + short_name: "Date of Incident Day", + long_name: "The day on which the first incident occurred.", + short_description: "The day on which the incident occurred. If a precise date is unavailable, leave blank.\n\nEnter in the format of DD", + long_description: "The day on which the incident occurred. If a precise date is unavailable, leave blank.\n\nEnter in the format of DD", + display_type: "string", + mongo_type: "string", + default: "", + placeholder: "DD", + permitted_values: [], + weight: 5, + instant_facet: false, + required: false, + public: true, + hide_search: true + }, + { + field_number: "6.4", + short_name: "Estimated Date", + long_name: "Is the date estimated?", + short_description: "“Yes” if the data was estimated. “No” otherwise.", + long_description: "“Yes” if the data was estimated. “No” otherwise.", + display_type: "bool", + mongo_type: "bool", + permitted_values: [], + placeholder: "", + weight: 5, + instant_facet: false, + required: false, + public: true, + hide_search: true + }, + { + field_number: "6.5", + short_name: "Multiple AI Interaction", + long_name: "Was the AI interacting with another AI?", + short_description: "“Yes” if two or more independently operating AI systems were involved. “No” otherwise.", + long_description: "This happens very rarely but is possible. Examples include two chatbots having a conversation with each other, or two autonomous vehicles in a crash.", + display_type: "enum", + mongo_type: "string", + default: "maybe", + permitted_values: [ + "yes", + "no", + "maybe" + ], + placeholder: "", + weight: 5, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "6.6", + short_name: "Embedded", + long_name: "Is the AI embedded in a physical system or have a physical presence?", + short_description: "“Yes” if the AI is embedded in a physical system. “No” if it is not. “Maybe” if it is unclear.", + long_description: "This question is slightly different from the one in field 2.1.1. That question asks about there being interaction with physical objects–an ability to manipulate or change. A system can be embedded in a physical object and able to interact with the physical environment, e.g. a vacuum robot. A system can be embedded in a physical object and not interact with a physical environment, e.g. a camera system that only records images when the AI detects that dogs are present. AI systems that are accessed through API, web-browser, etc by using a mobile device or computer are not considered to be embedded in hardware systems. They are accessed through hardware.", + display_type: "enum", + mongo_type: "string", + default: "maybe", + permitted_values: [ + "yes", + "no", + "maybe" + ], + placeholder: "", + weight: 5, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "6.7", + short_name: "Location City", + long_name: "If the incident occurred at a specific known location, note the city.", + short_description: "If the incident occurred at a specific known location, note the city.", + long_description: "If the incident occurred at a specific known location, note the city. If there are multiple relevant locations, enter multiple city/state/country values.", + display_type: "string", + mongo_type: "string", + default: "", + placeholder: "City", + permitted_values: [], + weight: 5, + instant_facet: false, + required: false, + public: true, + hide_search: true + }, + { + field_number: "6.8", + short_name: "Location State/Province (two letters)", + long_name: "If the incident occurred at a specific known location, note the state/province.", + short_description: "If the incident occurred at a specific known location, note the state/province.", + long_description: "If the incident occurred at a specific known location, note the state/province. If there are multiple relevant locations, enter multiple city/state/country values.", + display_type: "string", + mongo_type: "string", + default: "", + placeholder: "State or Province", + permitted_values: [], + weight: 5, + instant_facet: false, + required: false, + public: true, + hide_search: true + }, + { + field_number: "6.9", + short_name: "Location Country (two letters)", + long_name: "If the incident occurred at a specific known location, note the country. ", + short_description: "If the incident occurred at a specific known location, note the country. Follow ISO 3166 for the 2-letter country codes.", + long_description: "Follow ISO 3166 for the 2-letter country codes.\n\nIf there are multiple relevant locations, enter multiple city/state/country values.", + display_type: "string", + mongo_type: "string", + default: "", + placeholder: "Country", + permitted_values: [], + weight: 5, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "6.10", + short_name: "Location Region", + long_name: "Location Region", + short_description: "Select the region of the world where the incident occurred. If it occurred in multiple, leave blank.", + long_description: "Use this reference to map countries to regions: https://www.dhs.gov/geographic-regions", + display_type: "enum", + mongo_type: "string", + default: "unclear", + placeholder: "", + permitted_values: [ + "Global", + "Africa", + "Asia", + "Caribbean", + "Central America", + "Europe", + "North America", + "Oceania", + "South America", + "unclear" + ], + weight: 5, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "6.11", + short_name: "Infrastructure Sectors", + long_name: "Which critical infrastructure sectors were affected, if any?", + short_description: "Which critical infrastructure sectors were affected, if any?", + long_description: "Which critical infrastructure sectors were affected, if any?", + display_type: "multi", + mongo_type: "string", + default: "unclear", + placeholder: "", + permitted_values: [ + "chemical", + "commercial facilities", + "communications", + "critical manufacturing", + "dams", + "defense-industrial base", + "emergency services", + "energy", + "financial services", + "food and agriculture", + "government facilities", + "healthcare and public health", + "information technology", + "nuclear ", + "transportation", + "water and wastewater", + "Other", + "unclear" + ], + weight: 5, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "6.12", + short_name: "Operating Conditions", + long_name: "A record of any abnormal or atypical operational conditions that occurred.", + short_description: "A record of any abnormal or atypical operational conditions that occurred.", + long_description: "A record of any abnormal or atypical operational conditions that occurred. This field is most often blank.", + display_type: "list", + mongo_type: "array", + default: "", + placeholder: "e.g. raining; night; low visibility", + permitted_values: [], + weight: 5, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "6.13", + short_name: "Notes (Environmental and Temporal Characteristics)", + long_name: "Notes (Environmental and Temporal Characteristics)", + short_description: "Input any notes that may help explain your answers.", + long_description: "Input any notes that may help explain your answers.", + display_type: "long_string", + mongo_type: "string", + default: "", + placeholder: "Notes", + permitted_values: [], + weight: 5, + instant_facet: false, + required: false, + public: true, + hide_search: true + }, + { + field_number: "7", + short_name: "Entities", + long_name: "Characterizing Entities and the Harm", + short_description: "Characterizing Entities and the Harm", + long_description: "Characterizing Entities and the Harm", + display_type: "object-list", + mongo_type: "array", + hide_search: true, + subfields: [ + { + field_number: "7.1", + short_name: "Entity", + long_name: "A short 1 to 2 word description of the entity.", + short_description: "A short 1 to 2 word description of the entity. When possible use a proper name for the entity, making it a Named Entity.", + long_description: "A short 1 to 2 word description of the entity. When possible use a proper name for the entity, making it a Named Entity.\n\nAnnotate information for each entity involved in the report. Try to capture every entity directly linked to the harm. Think about the entity that experienced the harm, all of the entities between them and the AI, and then all of the entities involved in producing and deploying the AI.\n\nEmployees representing a company in a media or public relations capacity should not be included as an entity.", + display_type: "string", + mongo_type: "string", + complete_from: { + entities: true + }, + default: "", + placeholder: "", + permitted_values: [], + weight: 5, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "7.2", + short_name: "Named Entity", + long_name: "Named Entity Indicator", + short_description: "Indicates if the entity is a Named Entity.", + long_description: "Indicates if the entity is a Named Entity. “Yes” if the entity is a named entity. “No” otherwise.", + display_type: "bool", + mongo_type: "bool", + permitted_values: [], + placeholder: "", + weight: 5, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "7.3", + short_name: "Entity type", + long_name: "Indicates the type of entity", + short_description: "Indicates the type of entity", + long_description: "Indicates the type of entity. If multiple selections could characterize the entity, select the primary function of the entity.", + display_type: "enum", + mongo_type: "string", + default: "unclear", + placeholder: "Entity Type", + permitted_values: [ + "individual", + "group of individuals", + "for-profit organization", + "non-profit organization", + "government entity", + "privately owned space", + "public space", + "infrastructure", + "social or political system", + "product", + "other", + "unclear" + ], + weight: 5, + instant_facet: false, + required: false, + public: true, + hide_search: true + }, + { + field_number: "7.4", + short_name: "Entity Relationship to the AI", + long_name: "Entity Relationship to the AI", + short_description: "Indicates the entity’s relationship to the AI.", + long_description: "Indicates the entity’s relationship to the AI. Note, the smallest possible chain of harm has just two elements; an AI and an entity experiencing harm, near-miss, or issue.", + display_type: "list", + mongo_type: "array", + default: "", + placeholder: "", + permitted_values: [ + "developer", + "deployer", + "government oversight", + "user", + "AI", + "geographic area of use", + "researcher", + "product containing AI", + "watchdog" + ], + weight: 5, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "7.5", + short_name: "Harm Category Experienced", + long_name: "Was an AI special interest intangible harm, tangible harm event, near-miss, or issue experienced by this entity", + short_description: "Was an AI special interest intangible harm, tangible harm event, near-miss, or issue experienced by this entity", + long_description: "Was an AI special interest intangible harm, tangible harm event, near-miss, or issue experienced by this entity. For each recorded entity, indicate the harm category that they experienced. Because recorded entities have a variety of roles in the AI incident, not every recorded entity will experience harm.", + display_type: "enum", + mongo_type: "string", + default: "unclear", + placeholder: "", + permitted_values: [ + "AI special interest intangible harm", + "AI tangible harm event", + "AI tangible harm near-miss", + "AI tangible harm issue", + "Other harm not meeting CSET definitions", + "not applicable", + "unclear" + ], + weight: 5, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "7.6", + short_name: "Harm Type Experienced", + long_name: "Type of harm experienced by entity ", + short_description: "Indicates the type of harm experienced by the harmed entity", + long_description: "Indicates the type of harm experienced by the harmed entity. Only entities experiencing harm should have an assigned type. If the entity did not experience the harm, ‘not applicable’ should be selected.", + display_type: "enum", + mongo_type: "string", + default: "not applicable", + placeholder: "", + permitted_values: [ + "physical health/safety", + "financial loss", + "physical property", + "intangible property", + "infrastructure", + "natural environment", + "social or political systems", + "violation of human rights, civil liberties, civil rights, or democratic norms", + "detrimental content", + "disproportionate treatment based upon a protected characteristic", + "other tangible harm", + "other intangible harm", + "not applicable" + ], + weight: 5, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "7.7", + short_name: "Notes (Characterizing Entities and the Harm)", + long_name: "Notes (Characterizing Entities and the Harm)", + short_description: "Input any notes that may help explain your answers.", + long_description: "Input any notes that may help explain your answers.", + display_type: "long_string", + mongo_type: "string", + default: "", + placeholder: "Notes", + permitted_values: [], + weight: 5, + instant_facet: false, + required: false, + public: true, + hide_search: true + } + ], + default: "[]", + placeholder: "", + permitted_values: [], + weight: 5, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "8.1", + short_name: "Lives Lost", + long_name: "How many human lives were lost?", + short_description: "Indicates the number of deaths reported", + long_description: "This field cannot be greater than zero if the harm is anything besides ‘Physical health/safety.’ ", + display_type: "int", + mongo_type: "int", + default: "", + placeholder: "", + permitted_values: [], + weight: 5, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "8.2", + short_name: "Injuries", + long_name: "How many humans were injured?", + short_description: "Indicate the number of injuries reported.", + long_description: "This field cannot be greater than zero if the harm is anything besides 'Physical health/safety'.\n\nAll reported injuries should count, regardless of their severity level. If a person lost their limb and another person scraped their elbow, both cases would be considered injuries. Do not include the number of deaths in this count.", + display_type: "int", + mongo_type: "int", + default: "", + placeholder: "", + permitted_values: [], + weight: 5, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "8.3", + short_name: "Estimated Harm Quantities", + long_name: "Are any quantities estimated?", + short_description: "Indicates if the amount was estimated.", + long_description: "Indicates if the amount was estimated.", + display_type: "bool", + mongo_type: "bool", + permitted_values: [], + placeholder: "", + weight: 5, + instant_facet: false, + required: false, + hide_search: true, + public: true + }, + { + field_number: "8.4", + short_name: "Notes ( Tangible Harm Quantities Information)", + long_name: "Notes ( Tangible Harm Quantities Information)", + short_description: "Input any notes that may help explain your answers.", + long_description: "Input any notes that may help explain your answers.", + display_type: "long_string", + mongo_type: "string", + default: "", + placeholder: "Notes", + permitted_values: [], + weight: 5, + instant_facet: false, + required: false, + public: true, + hide_search: true + }, + { + field_number: "9.1", + short_name: "AI System Description", + long_name: "Description of the AI system involved", + short_description: "A description of the AI system (when possible)", + long_description: "Describe the AI system in as much detail as the reports will allow.\n\nA high level description of the AI system is sufficient, but if more technical details about the AI system are available, include them in the description as well.", + display_type: "long_string", + mongo_type: "string", + default: "", + placeholder: "Description of the AI system involved", + permitted_values: [], + weight: 5, + instant_facet: false, + required: false, + public: true, + hide_search: true + }, + { + field_number: "9.2", + short_name: "Data Inputs", + long_name: "Description of data inputs to the AI system", + short_description: "A list of the types of data inputs for the AI system.", + long_description: "This is a freeform field that can have any value. There could be multiple entries for this field.\n\nCommon ones include\n\n- still images\n- video\n- text\n- speech\n- Personally Identifiable Information\n- structured data\n- other\n- unclear\n\nStill images are static images. Video images consist of moving images. Text and speech data are considered an important category of unstructured data. They consist of written and spoken words that are not in a tabular format. Personally identifiable information is data that can uniquely identify an individual and may contain sensitive information. Structured data is often in a tabular, machine readable format and can typically be used by an AI system without much preprocessing.\n\nAvoid using ‘unstructured data’ data in this field. Instead specify the type of unstructured data; text, images, audio files, etc. It is ok to use ‘structured data’ in this field.\n\nRecord what the media report explicitly states. If the report does not explicitly state an input modality but it is likely that a particular kind of input contributed to the harm or near harm, record that input. If you are still unsure, do not record anything.", + display_type: "list", + mongo_type: "array", + default: "", + placeholder: "", + permitted_values: [], + weight: 5, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "9.3", + short_name: "Sector of Deployment", + long_name: "Indicates the sector in which the AI system is deployed", + short_description: "Indicate the sector in which the AI system is deployed", + long_description: "Indicate the sector in which the AI system is deployed\n\nThere could be multiple entries for this field.", + display_type: "multi", + mongo_type: "array", + default: "", + placeholder: "", + permitted_values: [ + "agriculture, forestry and fishing", + "mining and quarrying", + "manufacturing", + "electricity, gas, steam and air conditioning supply", + "water supply", + "construction", + "wholesale and retail trade", + "transportation and storage", + "accommodation and food service activities", + "information and communication", + "financial and insurance activities", + "real estate activities", + "professional, scientific and technical activities", + "administrative and support service activities", + "public administration", + "defense", + "law enforcement", + "Education", + "human health and social work activities", + "Arts, entertainment and recreation", + "other service activities", + "activities of households as employers", + "activities of extraterritorial organizations and bodies", + "other", + "unclear" + ], + weight: 60, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "9.4", + short_name: "Public Sector Deployment", + long_name: "Indicates whether the AI system is deployed in the public sector", + short_description: "Indicate whether the AI system is deployed in the public sector", + long_description: "Indicate whether the AI system is deployed in the public sector. The public sector is the part of the economy that is controlled and operated by the government.", + display_type: "enum", + mongo_type: "string", + default: "maybe", + permitted_values: [ + "yes", + "no", + "maybe" + ], + placeholder: "", + weight: 40, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "9.5", + short_name: "Autonomy Level", + long_name: "Autonomy Level", + short_description: "Autonomy1: The system operates independently without simultaneous human oversight, interaction, or intervention.\n\nAutonomy2: The system operates independently but with human oversight, where a human can observe and override the system’s decisions in real time.\n\nAutonomy3: The system does not independently make decisions but instead provides information to a human who actively chooses to proceed with the AI’s information.", + long_description: "Autonomy1: The system operates independently without simultaneous human oversight, interaction, or intervention.\n\nAutonomy2: The system operates independently but with human oversight, where a human can observe and override the system’s decisions in real time.\n\nAutonomy3: The system does not independently make decisions but instead provides information to a human who actively chooses to proceed with the AI’s information.", + display_type: "enum", + mongo_type: "string", + default: "", + placeholder: "", + permitted_values: [ + "Autonomy1", + "Autonomy2", + "Autonomy3", + "unclear" + ], + weight: 40, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "9.8", + short_name: "Notes (Information about AI System)", + long_name: "Notes (Information about AI System)", + short_description: "Input any notes that may help explain your answers.", + long_description: "Input any notes that may help explain your answers.", + display_type: "long_string", + mongo_type: "string", + default: "", + placeholder: "Notes", + permitted_values: [], + weight: 5, + instant_facet: false, + required: false, + public: true, + hide_search: true + }, + { + field_number: "10.1", + short_name: "Intentional Harm", + long_name: "Was the AI intentionally developed or deployed to perform the harm?", + short_description: "Was the AI intentionally developed or deployed to perform the harm?\n\nIf yes, did the AI’s behavior result in unintended or intended harm?", + long_description: "Indicates if the system was designed to do harm. If it was designed to perform harm, the field will indicate if the AI system did or did not create unintended harm–i.e. was the reported harm the harm that AI was expected to perform or a different unexpected harm? ", + display_type: "enum", + mongo_type: "string", + default: "unclear", + placeholder: "", + permitted_values: [ + "Yes. Intentionally designed to perform harm and did create intended harm", + "Yes. Intentionally designed to perform harm but created an unintended harm (a different harm may have occurred)", + "No. Not intentionally designed to perform harm", + "unclear" + ], + weight: 40, + instant_facet: false, + required: false, + public: true, + notes: "Tracking and analyzing harm from AI systems designed to do harm is valuable and worthwhile. However, analysts may want to separately analyze harm from AI systems that were or were not designed to produce the observed harm." + }, + { + field_number: "10.2", + short_name: "Physical System Type", + long_name: "Into what type of physical system was the AI integrated, if any?", + short_description: "Describe the type of physical system that the AI was integrated into.", + long_description: "Describe the type of physical system that the AI was integrated into. ", + display_type: "string", + mongo_type: "string", + default: "", + placeholder: "Physical System Type (e.g. trash sorting robot)", + permitted_values: [], + weight: 5, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "10.3", + short_name: "AI Task", + long_name: "AI task or core application area", + short_description: "Describe the AI’s application.", + long_description: "Describe the AI’s application.\n\nIt is likely that the annotator will not have enough information to complete this field. If this occurs, enter unclear.\n\nThis is a freeform field. Some possible entries are\n\n- unclear\n- human language technologies\n- computer vision\n- robotics\n- automation and/or optimization\n- other\n\nThe application area of an AI is the high level task that the AI is intended to perform. It does not describe the technical methods by which the AI performs the task. Considering what an AI’s technical methods enable it to do is another way of arriving at what an AI’s application is. \n\nIt is possible for multiple application areas to be involved. When possible pick the principle or domain area, but it is ok to select multiple areas.", + display_type: "list", + mongo_type: "array", + default: "", + placeholder: "", + permitted_values: [], + weight: 5, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "10.4", + short_name: "AI tools and methods", + long_name: "AI tools and methods", + short_description: "Describe the tools and methods that enable the AI’s application.", + long_description: "Describe the tools and methods that enable the AI’s application.\n\nIt is likely that the annotator will not have enough information to complete this field. If this occurs, enter unclear\n\nThis is a freeform field. Some possible entries are\n\n- unclear\n- reinforcement learning\n- neural networks\n- decision trees\n- bias mitigation\n- optimization\n- classifier\n- NLP/text analytics\n- continuous learning\n- unsupervised learning\n- supervised learning\n- clustering\n- prediction\n- rules\n- random forest\n\nAI tools and methods are the technical building blocks that enable the AI’s application.", + display_type: "list", + mongo_type: "array", + default: "unclear", + placeholder: "", + permitted_values: [], + weight: 40, + instant_facet: false, + required: false, + public: true + }, + { + field_number: "10.5", + short_name: "Notes (AI Functionality and Techniques)", + long_name: "Notes (AI Functionality and Techniques)", + short_description: "Input any notes that may help explain your answers.", + long_description: "Input any notes that may help explain your answers.", + display_type: "long_string", + mongo_type: "string", + default: "", + placeholder: "Notes", + permitted_values: [], + weight: 5, + instant_facet: false, + required: false, + public: true, + hide_search: true + } + ], + + // TODO: created_at is missing from Atlas schema + // created_at: new Date("1722269934190") + }, ] export default items; \ No newline at end of file diff --git a/site/gatsby-site/playwright/utils.ts b/site/gatsby-site/playwright/utils.ts index 553272e10b..e67bfc335f 100644 --- a/site/gatsby-site/playwright/utils.ts +++ b/site/gatsby-site/playwright/utils.ts @@ -69,7 +69,7 @@ export const test = base.extend({ await page.evaluate(({ customData }) => { - localStorage.setItem('__MOCKED_CUSTOM_DATA', JSON.stringify(customData)); + localStorage.setItem('__CUSTOM_DATA_MOCK', JSON.stringify(customData)); }, { customData }); diff --git a/site/gatsby-site/server/remote.ts b/site/gatsby-site/server/remote.ts index 8132e880c7..583834ba85 100644 --- a/site/gatsby-site/server/remote.ts +++ b/site/gatsby-site/server/remote.ts @@ -24,6 +24,8 @@ const userExecutor = buildHTTPExecutor({ }, }); +// TODO: uncomment items after the subscription collection is migrated + const ignoreTypes = [ 'Quickadd', 'QuickaddQueryInput', diff --git a/site/gatsby-site/src/components/discover/CsvExport.js b/site/gatsby-site/src/components/discover/CsvExport.js index 437516dbe0..3525f8f443 100644 --- a/site/gatsby-site/src/components/discover/CsvExport.js +++ b/site/gatsby-site/src/components/discover/CsvExport.js @@ -13,10 +13,10 @@ const convertData = (hits) => { 'incident id': hit.incident_id, 'report number': hit.report_number, title: hit.title, - 'date published': format(fromUnixTime(hit.epoch_date_published), 'yyyy-MM-dd'), - 'date submitted': format(fromUnixTime(hit.epoch_date_submitted), 'yyyy-MM-dd'), - 'date modified': format(fromUnixTime(hit.epoch_date_modified), 'yyyy-MM-dd'), - 'date downloaded': format(fromUnixTime(hit.epoch_date_downloaded), 'yyyy-MM-dd'), + 'date published': format(fromUnixTime(hit.epoch_date_published ?? 0), 'yyyy-MM-dd'), + 'date submitted': format(fromUnixTime(hit.epoch_date_submitted ?? 0), 'yyyy-MM-dd'), + 'date modified': format(fromUnixTime(hit.epoch_date_modified ?? 0), 'yyyy-MM-dd'), + 'date downloaded': format(fromUnixTime(hit.epoch_date_downloaded ?? 0), 'yyyy-MM-dd'), url: hit.url, 'source domain': hit.source_domain, language: hit.language, diff --git a/site/gatsby-site/src/components/discover/QuickAccess.js b/site/gatsby-site/src/components/discover/QuickAccess.js index 1b82edb85f..bfab09824a 100644 --- a/site/gatsby-site/src/components/discover/QuickAccess.js +++ b/site/gatsby-site/src/components/discover/QuickAccess.js @@ -4,7 +4,11 @@ import { Trans } from 'react-i18next'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faSearch, faPlus } from '@fortawesome/free-solid-svg-icons'; -export default function DiscoverQuickAccess({ className = '', isCollapsed = false }) { +export default function DiscoverQuickAccess({ + className = '', + isCollapsed = false, + setNavCollapsed = null, +}) { return (
setNavCollapsed && setNavCollapsed(true)} >
@@ -33,6 +38,7 @@ export default function DiscoverQuickAccess({ className = '', isCollapsed = fals className={`ml-3 fs-5 border-1 border-transparent rounded cursor-pointer inline-block text-base font-normal text-center no-underline select-none align-middle transition-btn shadow w-1/2 ${ isCollapsed ? 'py-1 px-1' : 'pb-2 py-1.5 px-2 h-16 text-black' } bg-white hover:bg-blue-700 hover:text-white`} + onClick={() => setNavCollapsed && setNavCollapsed(true)} >
diff --git a/site/gatsby-site/src/components/sidebar/index.js b/site/gatsby-site/src/components/sidebar/index.js index c5fde1df74..c15ba84840 100644 --- a/site/gatsby-site/src/components/sidebar/index.js +++ b/site/gatsby-site/src/components/sidebar/index.js @@ -198,7 +198,7 @@ const Sidebar = ({ defaultCollapsed = false, location = null, setNavCollapsed }) }} > - +
    t.namespace === query.edit_taxonomy) ) { setScrolledToTaxonomy(query.edit_taxonomy); - taxonomiesList.find((t) => t.namespace === query.edit_taxonomy).ref.current.scrollIntoView(); + // TODO: this has a race condition where the ref is not yet set + taxonomiesList.find((t) => t.namespace === query.edit_taxonomy).ref.current?.scrollIntoView(); } }, [taxonomiesList]); diff --git a/site/gatsby-site/src/contexts/userContext/UserContextProvider.js b/site/gatsby-site/src/contexts/userContext/UserContextProvider.js index 206fa34d3c..9766aec582 100644 --- a/site/gatsby-site/src/contexts/userContext/UserContextProvider.js +++ b/site/gatsby-site/src/contexts/userContext/UserContextProvider.js @@ -202,10 +202,10 @@ export const UserContextProvider = ({ children }) => { isLoggedIn: user && user.isLoggedIn, isRole(role) { // This is to allow mocking custom data for testing purposes, (only affects client side features) - if (localStorage.getItem('__MOCKED_CUSTOM_DATA')) { - const customData = JSON.parse(localStorage.getItem('__MOCKED_CUSTOM_DATA')); + if (typeof window !== 'undefined' && window.localStorage.getItem('__CUSTOM_DATA_MOCK')) { + const customData = JSON.parse(window.localStorage.getItem('__CUSTOM_DATA_MOCK')); - return customData.roles.includes(role); + return customData.roles.includes('admin') || customData.roles.includes(role); } return ( diff --git a/site/gatsby-site/src/pages/cite/[id].js b/site/gatsby-site/src/pages/cite/[id].js index e5e4a00106..66bf88f3a7 100644 --- a/site/gatsby-site/src/pages/cite/[id].js +++ b/site/gatsby-site/src/pages/cite/[id].js @@ -21,7 +21,7 @@ function CiteDynamicPage(props) { const [incident, setIncident] = useState(null); const { data: incidentData, loading } = useQuery(FIND_FULL_INCIDENT, { - variables: { filter: { incident_id: { EQ: incident_id } } }, + variables: { filter: { incident_id: { EQ: parseInt(incident_id) } } }, }); useEffect(() => { diff --git a/site/gatsby-site/src/templates/citeDynamicTemplate.js b/site/gatsby-site/src/templates/citeDynamicTemplate.js index 3805d8a13b..36752bef22 100644 --- a/site/gatsby-site/src/templates/citeDynamicTemplate.js +++ b/site/gatsby-site/src/templates/citeDynamicTemplate.js @@ -54,7 +54,7 @@ function CiteDynamicTemplate({ }); const { data: classificationsData } = useQuery(FIND_CLASSIFICATION, { - variables: { filter: { incidents: { EQ: incident_id }, publish: true } }, + variables: { filter: { incidents: { EQ: incident_id }, publish: { EQ: true } } }, }); useEffect(() => { diff --git a/site/gatsby-site/tsconfig.json b/site/gatsby-site/tsconfig.json index e66b1100ad..7f8bb75c84 100644 --- a/site/gatsby-site/tsconfig.json +++ b/site/gatsby-site/tsconfig.json @@ -97,5 +97,8 @@ // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ "skipLibCheck": true, /* Skip type checking all .d.ts files. */ "allowJs": true - } + }, + "exclude": [ + "public" + ], } \ No newline at end of file