review-workspace 1.4.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,9 +3,11 @@ import { randomBytes } from 'node:crypto';
3
3
  import { createReadStream, existsSync, statSync } from 'node:fs';
4
4
  import { join } from 'node:path';
5
5
  import { validateBundle } from "../bundle/validate-bundle.js";
6
- import { publishBundle } from "../bundle/publish.js";
6
+ import { publishBundleAndExportHandoff } from "../bundle/publish-with-handoff.js";
7
7
  import { watchBundle } from "./watch-bundle.js";
8
- import { raiseQuestion, readQuestions, resolveComment, withdrawAndReplaceQuestion } from "../questions/questions-log.js";
8
+ import { raiseQuestion, resolveComment, withdrawAndReplaceQuestion } from "../questions/questions-log.js";
9
+ import { askForRepoPathOnStdin } from "../handoff/ask-repo-path.js";
10
+ import { carryForwardChain, listComments } from "../bundle/carry-forward.js";
9
11
  import { readReviewState, writeReviewState } from "../review-state/review-state.js";
10
12
  import { render } from "../renderer/render.js";
11
13
  import { buildReport } from "../export/report.js";
@@ -71,6 +73,11 @@ function readJsonBody(req) {
71
73
  }
72
74
  export function startReviewServer(bundlePath, opts = {}) {
73
75
  const writeToken = opts.writeToken ?? generateWriteToken();
76
+ const askForRepoPath = opts.askForRepoPath ?? askForRepoPathOnStdin;
77
+ // A round-N bundle (has chain.json) carries forward every still-open change-request
78
+ // from the previous round into its own log the moment it's opened — idempotent, so
79
+ // safe to repeat on every subsequent change below too.
80
+ carryForwardChain(bundlePath);
74
81
  // The served document is cached and only refreshed by the watcher below, so a
75
82
  // publish must actually trigger re-validation for /document to ever change —
76
83
  // this is what makes file watching load-bearing rather than a no-op wrapper
@@ -78,6 +85,7 @@ export function startReviewServer(bundlePath, opts = {}) {
78
85
  let latest = validateBundle(bundlePath);
79
86
  const watcher = watchBundle(bundlePath);
80
87
  watcher.emitter.on('change', () => {
88
+ carryForwardChain(bundlePath);
81
89
  latest = validateBundle(bundlePath);
82
90
  });
83
91
  const server = createServer((req, res) => {
@@ -104,7 +112,7 @@ export function startReviewServer(bundlePath, opts = {}) {
104
112
  return;
105
113
  }
106
114
  if (req.method === 'GET' && url.pathname === '/questions') {
107
- respond(200, readQuestions(bundlePath));
115
+ respond(200, listComments(bundlePath));
108
116
  return;
109
117
  }
110
118
  if (req.method === 'GET' && url.pathname === '/state') {
@@ -139,8 +147,9 @@ export function startReviewServer(bundlePath, opts = {}) {
139
147
  }
140
148
  }
141
149
  if (req.method === 'POST' && url.pathname === '/publish') {
142
- const result = publishBundle(bundlePath);
143
- respond(result.ok ? 200 : 422, result);
150
+ publishBundleAndExportHandoff(bundlePath, { ask: askForRepoPath, repoPathCachePath: opts.repoPathCachePath })
151
+ .then((result) => respond(result.ok ? 200 : 422, result))
152
+ .catch((err) => respond(500, { error: err instanceof Error ? err.message : 'publish failed' }));
144
153
  return;
145
154
  }
146
155
  if (req.method === 'POST' && url.pathname === '/questions') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "review-workspace",
3
- "version": "1.4.0",
3
+ "version": "1.6.0",
4
4
  "description": "A local, offline decision surface for reviewing a code Comparison — evidence-linked map of intent, behavior, risk, and observable effects.",
5
5
  "license": "MIT",
6
6
  "author": "Salih Sayer",