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
25 changes: 25 additions & 0 deletions collab-review-freeze-lane/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Collaborative Review Freeze Lane

This submission targets [SCIBASE issue #12](https://github.com/SCIBASE-AI/SCIBASE.AI/issues/12) with a focused real-time collaborative editor module.

It models the review freeze workflow a scientific manuscript editor needs before submission: direct edits pause, reviewer comments and suggestions remain open, notebook outputs must be fresh, blocking tasks must be cleared, and a version snapshot can be exported for history or audit trails.

## What It Adds

- Section-level freeze windows for manuscript review and submission prep.
- Direct edit protection while still allowing comments, suggestions, and task updates.
- Notebook execution freshness checks before a frozen section can be released.
- Blocking reviewer comments and tasks that gate unfreezing.
- Stable version snapshots for autosave and history timelines.

## Demo

```powershell
node collab-review-freeze-lane/test.js
node collab-review-freeze-lane/demo.js
```

`demo.mp4` is the reviewer-facing video artifact for the bounty submission. It walks through the problem, implementation, acceptance path, and command validation in 8.4 seconds. `demo.svg` shows the freeze lane from active edits to reviewer clearance and version snapshot export.

See `acceptance-notes.md` for the payout-gate evidence checklist.

31 changes: 31 additions & 0 deletions collab-review-freeze-lane/acceptance-notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Acceptance Notes

This is a focused implementation for SCIBASE issue #12, not a generic AI-generated content drop. The module stays small so reviewers can inspect the review-freeze workflow, validation rules, and version snapshot behavior without pulling in a full editor stack.

## What Changed

- Added section-level freeze windows for manuscript review and submission prep.
- Added operation handling that blocks direct edits while preserving comments, suggestions, tasks, and notebook checks.
- Added clearance logic for blocking comments, open tasks, unresolved suggestions, and stale notebook outputs.
- Added stable version snapshot export for autosave, history, and audit trails.
- Added focused dependency-free tests and demo data.

## Video Demo

- `demo.mp4` shows the problem, implementation, acceptance behavior, and validation command.
- `demo.svg` provides a static workflow diagram.

## Validation

Run from the repository root:

```powershell
node collab-review-freeze-lane/test.js
node collab-review-freeze-lane/demo.js
```

Expected result: the test prints `collab-review-freeze-lane tests passed`, and the demo prints a freeze clearance packet showing blockers before and after review cleanup.

## Integration Notes

The module is dependency-free and uses plain document state objects so it can be adapted into a collaborative editor service. The next integration step is mapping these operations to SCIBASE editor events and persistence.
38 changes: 38 additions & 0 deletions collab-review-freeze-lane/demo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
"use strict";

const {
applyOperation,
buildVersionSnapshot,
createDocumentState,
evaluateFreezeReadiness
} = require("./index");

let state = createDocumentState({
documentId: "neuroscience-manuscript",
version: "1.2.0",
sections: [
{ id: "abstract", text: "Concise result summary." },
{ id: "analysis", text: "Notebook-backed analysis narrative." }
]
});

state = applyOperation(state, { type: "setExpectedExecution", sectionId: "analysis", executionHash: "exec-2026-05-16" });
state = applyOperation(state, { type: "freeze", sectionId: "analysis", reason: "journal submission gate", reviewers: ["methods", "editorial"] });
state = applyOperation(state, { type: "comment", sectionId: "analysis", id: "review-1", body: "Confirm the rerun uses the final cohort.", blocking: true });
state = applyOperation(state, { type: "task", sectionId: "analysis", id: "task-1", title: "Upload notebook execution bundle.", blocking: true });

const blocked = evaluateFreezeReadiness(state, "analysis");

state = applyOperation(state, { type: "resolveComment", sectionId: "analysis", commentId: "review-1" });
state = applyOperation(state, { type: "completeTask", sectionId: "analysis", taskId: "task-1" });
state = applyOperation(state, { type: "notebookOutput", sectionId: "analysis", executionHash: "exec-2026-05-16", overrideFreeze: true });

const ready = evaluateFreezeReadiness(state, "analysis");
const snapshot = buildVersionSnapshot(state, "analysis-section-ready");

console.log(JSON.stringify({
beforeClearance: blocked,
afterClearance: ready,
snapshot
}, null, 2));

Binary file added collab-review-freeze-lane/demo.mp4
Binary file not shown.
39 changes: 39 additions & 0 deletions collab-review-freeze-lane/demo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading