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
26 changes: 26 additions & 0 deletions collaborative-discussion-sidebar-audit/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Collaborative Discussion Sidebar Audit

This package adds a focused readiness layer for the real-time collaborative research editor requested in SCIBASE issue #12. It does not implement a broad editor shell, notebook runtime, reference formatter, lock recovery system, or figure/table workflow. Instead, it covers the issue requirement for a document chat or discussion sidebar per file or section.

The audit model checks whether sidebar discussions are safe to export during an active manuscript review:

- section and file scoped discussion threads
- open blockers, stale conversations, and unresolved reviewer tasks
- pinned sources and citation evidence for decisions
- conflicting accepted decisions on the same section/topic
- locked-section owner and reviewer participation
- deterministic handoff packets for review, export, and version history

## Run

```sh
npm test
npm run demo
npm run demo:video
```

`npm run demo` writes a JSON audit report and an SVG storyboard to `docs/`. `npm run demo:video` renders a short MP4 demo for reviewers.

## Why This Slice Matters

In a collaborative scientific editor, the sidebar is not just chat. It becomes the record of why a section changed, which source supports the decision, who still needs to respond, and what must be preserved when the document is exported or reviewed later. This package gives that workflow deterministic checks and a compact export packet before the larger editor UI is wired in.
Binary file not shown.
29 changes: 29 additions & 0 deletions collaborative-discussion-sidebar-audit/docs/demo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
{
"ready": false,
"project": {
"id": "scibase-paper-alpha",
"title": "Multimodal biomarker screening draft",
"reviewRound": "methods-freeze"
},
"counts": {
"sections": 3,
"threads": 4,
"decisions": 3,
"blockers": 5,
"warnings": 3,
"reviewerTasks": 1
},
"sidebarCoverage": {
"scopedSections": 3,
"totalSections": 3,
"resolvedThreads": 2,
"totalThreads": 4,
"pinnedSources": 3,
"unscopedThreads": 1
},
"findings": [
{
"severity": "blocker",
"code": "open-blocker",
"message": "Thread thr-methods-blocker is marked blocking and is still open.",
"context": {
"threadId": "thr-methods-blocker"
}
},
{
"severity": "blocker",
"code": "stale-thread",
"message": "Thread thr-methods-blocker has been idle for 8 days.",
"context": {
"threadId": "thr-methods-blocker",
"staleDays": 8
}
},
{
"severity": "warning",
"code": "locked-section-missing-review-role",
"message": "Thread thr-methods-blocker on locked section sec-methods is missing reviewer participation.",
"context": {
"threadId": "thr-methods-blocker",
"sectionId": "sec-methods",
"missingRoles": [
"reviewer"
]
}
},
{
"severity": "warning",
"code": "locked-section-missing-review-role",
"message": "Thread thr-results-decision on locked section sec-results is missing owner participation.",
"context": {
"threadId": "thr-results-decision",
"sectionId": "sec-results",
"missingRoles": [
"owner"
]
}
},
{
"severity": "blocker",
"code": "unsafe-pinned-source",
"message": "Thread thr-file-evidence pins retracted source src-old-preprint.",
"context": {
"threadId": "thr-file-evidence",
"sourceId": "src-old-preprint",
"sourceStatus": "retracted"
}
},
{
"severity": "blocker",
"code": "unknown-scope",
"message": "Thread thr-orphan-sidebar is attached to an unknown section scope.",
"context": {
"threadId": "thr-orphan-sidebar",
"scopeId": "sec-supplement"
}
},
{
"severity": "warning",
"code": "decision-missing-source",
"message": "Decision dec-methods-draft has no pinned source evidence.",
"context": {
"decisionId": "dec-methods-draft"
}
},
{
"severity": "blocker",
"code": "conflicting-decisions",
"message": "Multiple active decisions compete for sec-results:model-summary.",
"context": {
"decisionIds": [
"dec-results-adjusted",
"dec-results-conflict"
]
}
}
],
"reviewerTasks": [
{
"id": "thr-methods-blocker:resolve-blocker",
"threadId": "thr-methods-blocker",
"ownerId": "u-ada",
"title": "Resolve blocker: Resolve assay exclusion criteria",
"priority": "high"
}
],
"exportPacket": {
"generatedAt": "2026-05-16T17:00:00.000Z",
"packetHash": "ebc3395f938f09def2f2aaa386b8e119a7c73314f3d7331e04e486b7a5fb638f",
"auditDigest": "scibase-paper-alpha:5:3:1:ebc3395f938f",
"entries": [
{
"threadId": "thr-file-evidence",
"title": "Remove unsupported background citation",
"scopeType": "file",
"scopeId": "paper/introduction.md",
"sectionTitle": "Introduction",
"status": "resolved",
"blocking": false,
"ownerId": "u-max",
"participantIds": [
"u-ada",
"u-max"
],
"pinnedSourceIds": [
"src-old-preprint"
],
"decisionIds": []
},
{
"threadId": "thr-methods-blocker",
"title": "Resolve assay exclusion criteria",
"scopeType": "section",
"scopeId": "sec-methods",
"sectionTitle": "Methods",
"status": "open",
"blocking": true,
"ownerId": "u-ada",
"participantIds": [
"u-ada"
],
"pinnedSourceIds": [
"src-protocol"
],
"decisionIds": [
"dec-methods-draft"
]
},
{
"threadId": "thr-orphan-sidebar",
"title": "Unattached sidebar note",
"scopeType": "section",
"scopeId": "sec-supplement",
"sectionTitle": null,
"status": "open",
"blocking": false,
"ownerId": "u-max",
"participantIds": [
"u-max"
],
"pinnedSourceIds": [
"src-dataset"
],
"decisionIds": []
},
{
"threadId": "thr-results-decision",
"title": "Accept adjusted model summary",
"scopeType": "section",
"scopeId": "sec-results",
"sectionTitle": "Results",
"status": "resolved",
"blocking": false,
"ownerId": "u-rin",
"participantIds": [
"u-max",
"u-rin"
],
"pinnedSourceIds": [
"src-dataset"
],
"decisionIds": [
"dec-results-adjusted",
"dec-results-conflict"
]
}
]
}
}
14 changes: 14 additions & 0 deletions collaborative-discussion-sidebar-audit/docs/requirement-map.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Requirement Map

This package targets the "Document chat or discussion sidebar per file or section" requirement from SCIBASE issue #12.

| Issue capability | Coverage in this package |
| --- | --- |
| Real-time collaboration readiness | Validates sidebar participants, open blockers, reviewer ownership, and locked-section participation before export. |
| Section and file comments | Models threads scoped to either manuscript sections or file paths, then flags orphaned threads. |
| Suggestions, decisions, and discussion history | Records accepted/proposed decisions and detects conflicting active decisions for the same section/topic. |
| Version history and autosave handoff | Emits a deterministic export packet with stable hash and audit digest suitable for snapshot history. |
| Scientific source traceability | Requires pinned source evidence for decisions and blocks unsafe or missing sources. |
| Reviewer task management | Converts unresolved blocking threads into explicit reviewer tasks with owners and priority. |

The slice is deliberately narrow so it can be reviewed independently of larger editor, notebook, reference-formatting, and figure/table implementations.
15 changes: 15 additions & 0 deletions collaborative-discussion-sidebar-audit/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "collaborative-discussion-sidebar-audit",
"version": "1.0.0",
"description": "Section-scoped discussion sidebar audit tools for a collaborative research editor.",
"type": "module",
"private": true,
"scripts": {
"test": "node test/collaborative-discussion-sidebar-audit.test.js",
"demo": "node scripts/demo.js",
"demo:video": "mkdir -p docs && clang -fobjc-arc -framework Foundation -framework AppKit -framework AVFoundation -framework CoreMedia -framework CoreVideo scripts/render-demo-video.m -o /tmp/discussion-sidebar-demo && /tmp/discussion-sidebar-demo docs/demo.mp4"
},
"exports": {
".": "./src/collaborative-discussion-sidebar-audit.js"
}
}
Loading