Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions collaborative-alt-text-export-guard/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
reports/frames/
36 changes: 36 additions & 0 deletions collaborative-alt-text-export-guard/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Collaborative Alt Text Export Guard

This module is a self-contained accessibility export-readiness slice for the SCIBASE real-time collaborative research editor bounty.

It focuses on publication content accessibility, not editor control accessibility. Before a collaborative manuscript is exported, it checks whether figures and tables have current, non-private, scientifically useful alt text, long descriptions, table header metadata, and accessibility sign-off.

## What It Checks

- Missing or generic alt text for exportable figures and tables
- Alt text that only repeats the caption
- Complex visuals that need a long description or data summary
- Color-only encodings without non-color labels or patterns
- Table headers, scopes, and summaries for screen-reader navigation
- Stale alt text after collaborative edits or source-data changes
- Open blocking accessibility comments
- Alt text changes inside locked final-review sections without approval
- Leaks of private reviewer notes, local file paths, or protected data markers

## Files

- `index.js` exports the evaluator plus Markdown/SVG renderers.
- `sample-data.js` contains clean, revision-required, and hold-required synthetic packets.
- `test.js` covers the release decisions and high-risk findings.
- `demo.js` writes JSON, Markdown, and SVG reviewer artifacts under `reports/`.
- `make-demo-video.js` writes a short local `reports/demo.mp4` artifact with the three decisions.

## Local Verification

```sh
npm run check
npm test
npm run demo
npm run verify-video
```

No production credentials, private data, external APIs, or package installs are required.
38 changes: 38 additions & 0 deletions collaborative-alt-text-export-guard/demo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
"use strict";

const fs = require("node:fs");
const path = require("node:path");
const {
evaluateAccessibleExportPacket,
renderMarkdownReport,
renderSvgSummary
} = require("./index");
const { cleanPacket, revisionPacket, holdPacket } = require("./sample-data");

const reportsDir = path.join(__dirname, "reports");
fs.mkdirSync(reportsDir, { recursive: true });

const scenarios = [
["clean", cleanPacket],
["revision", revisionPacket],
["hold", holdPacket]
];

const manifest = scenarios.map(([name, packet]) => {
const result = evaluateAccessibleExportPacket(packet, {
now: "2026-06-01T10:15:00.000Z"
});
fs.writeFileSync(path.join(reportsDir, `${name}-report.md`), renderMarkdownReport(result));
fs.writeFileSync(path.join(reportsDir, `${name}-summary.svg`), renderSvgSummary(result));
fs.writeFileSync(path.join(reportsDir, `${name}-result.json`), `${JSON.stringify(result, null, 2)}\n`);
return {
scenario: name,
decision: result.decision,
exportAllowed: result.exportAllowed,
findings: result.findings.length,
digest: result.digest
};
});

fs.writeFileSync(path.join(reportsDir, "manifest.json"), `${JSON.stringify(manifest, null, 2)}\n`);
console.log(JSON.stringify(manifest, null, 2));
Loading