@akagilnc/pi-workflow-roles 0.1.5712 → 0.1.5714

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.
@@ -18961,35 +18961,8 @@ async function summonParallelReviewerLenses(options) {
18961
18961
  const failure = failedResult(error);
18962
18962
  return { completeness: failure, correctness: failure };
18963
18963
  };
18964
- let sourceProjectRoot;
18965
- let targetCommit;
18966
- const statusArgs = [
18967
- "status",
18968
- "--porcelain=v1",
18969
- "--untracked-files=all",
18970
- "--",
18971
- ":/",
18972
- ":(top,exclude).claude/worktrees/**"
18973
- ];
18974
18964
  try {
18975
- sourceProjectRoot = await resolveReviewerGitToplevel(options.projectRoot);
18976
- const { stdout: statusStdout } = await execFileAsync3("git", statusArgs, {
18977
- cwd: sourceProjectRoot
18978
- });
18979
- if (statusStdout !== "") {
18980
- const diagnostic = [
18981
- "Reviewer target status gate failed:",
18982
- "git status --porcelain=v1 --untracked-files=all -- :/ ':(top,exclude).claude/worktrees/**'",
18983
- statusStdout
18984
- ].join("\n");
18985
- return dualFailure(new Error(diagnostic));
18986
- }
18987
- const { stdout: targetStdout } = await execFileAsync3(
18988
- "git",
18989
- ["rev-parse", "--verify", "HEAD^{commit}"],
18990
- { cwd: sourceProjectRoot }
18991
- );
18992
- targetCommit = targetStdout.trim();
18965
+ const sourceProjectRoot = await resolveReviewerGitToplevel(options.projectRoot);
18993
18966
  await execFileAsync3(
18994
18967
  "git",
18995
18968
  ["rev-parse", "--verify", `${options.baseRevision}^{commit}`],
@@ -19025,55 +18998,10 @@ async function summonParallelReviewerLenses(options) {
19025
18998
  summon("completeness"),
19026
18999
  summon("correctness")
19027
19000
  ]);
19028
- let results = {
19001
+ return {
19029
19002
  completeness: settled[0].status === "fulfilled" ? settled[0].value : failedResult(settled[0].reason),
19030
19003
  correctness: settled[1].status === "fulfilled" ? settled[1].value : failedResult(settled[1].reason)
19031
19004
  };
19032
- let sealDiagnostic;
19033
- try {
19034
- const { stdout: headBeforeStdout } = await execFileAsync3(
19035
- "git",
19036
- ["rev-parse", "--verify", "HEAD^{commit}"],
19037
- { cwd: sourceProjectRoot }
19038
- );
19039
- const { stdout: sealedStatusStdout } = await execFileAsync3("git", statusArgs, {
19040
- cwd: sourceProjectRoot
19041
- });
19042
- const { stdout: headAfterStdout } = await execFileAsync3(
19043
- "git",
19044
- ["rev-parse", "--verify", "HEAD^{commit}"],
19045
- { cwd: sourceProjectRoot }
19046
- );
19047
- const headBefore = headBeforeStdout.trim();
19048
- const headAfter = headAfterStdout.trim();
19049
- if (headBefore !== targetCommit || headAfter !== targetCommit || sealedStatusStdout !== "") {
19050
- sealDiagnostic = [
19051
- "Reviewer target final seal failed:",
19052
- `HEAD before status => ${headBefore}`,
19053
- `HEAD after status => ${headAfter}`,
19054
- `expected PRE_HEAD ${targetCommit}`,
19055
- "git status --porcelain=v1 --untracked-files=all -- :/ ':(top,exclude).claude/worktrees/**'",
19056
- sealedStatusStdout
19057
- ].join("\n");
19058
- }
19059
- } catch (error) {
19060
- sealDiagnostic = `Reviewer target final seal failed:
19061
- ${serializeThrownValue(error)}`;
19062
- }
19063
- if (sealDiagnostic !== void 0) {
19064
- const withSealFailure = (result) => ({
19065
- ...result,
19066
- exitCode: 1,
19067
- stderr: [result.stderr, sealDiagnostic].filter(
19068
- (text) => typeof text === "string" && text !== ""
19069
- ).join("\n")
19070
- });
19071
- results = {
19072
- completeness: withSealFailure(results.completeness),
19073
- correctness: withSealFailure(results.correctness)
19074
- };
19075
- }
19076
- return results;
19077
19005
  }
19078
19006
  async function summonGateOfficer(options) {
19079
19007
  let home = options.home;
@@ -19155,35 +19155,8 @@ async function summonParallelReviewerLenses(options) {
19155
19155
  const failure = failedResult(error);
19156
19156
  return { completeness: failure, correctness: failure };
19157
19157
  };
19158
- let sourceProjectRoot;
19159
- let targetCommit;
19160
- const statusArgs = [
19161
- "status",
19162
- "--porcelain=v1",
19163
- "--untracked-files=all",
19164
- "--",
19165
- ":/",
19166
- ":(top,exclude).claude/worktrees/**"
19167
- ];
19168
19158
  try {
19169
- sourceProjectRoot = await resolveReviewerGitToplevel(options.projectRoot);
19170
- const { stdout: statusStdout } = await execFileAsync3("git", statusArgs, {
19171
- cwd: sourceProjectRoot
19172
- });
19173
- if (statusStdout !== "") {
19174
- const diagnostic = [
19175
- "Reviewer target status gate failed:",
19176
- "git status --porcelain=v1 --untracked-files=all -- :/ ':(top,exclude).claude/worktrees/**'",
19177
- statusStdout
19178
- ].join("\n");
19179
- return dualFailure(new Error(diagnostic));
19180
- }
19181
- const { stdout: targetStdout } = await execFileAsync3(
19182
- "git",
19183
- ["rev-parse", "--verify", "HEAD^{commit}"],
19184
- { cwd: sourceProjectRoot }
19185
- );
19186
- targetCommit = targetStdout.trim();
19159
+ const sourceProjectRoot = await resolveReviewerGitToplevel(options.projectRoot);
19187
19160
  await execFileAsync3(
19188
19161
  "git",
19189
19162
  ["rev-parse", "--verify", `${options.baseRevision}^{commit}`],
@@ -19219,55 +19192,10 @@ async function summonParallelReviewerLenses(options) {
19219
19192
  summon("completeness"),
19220
19193
  summon("correctness")
19221
19194
  ]);
19222
- let results = {
19195
+ return {
19223
19196
  completeness: settled[0].status === "fulfilled" ? settled[0].value : failedResult(settled[0].reason),
19224
19197
  correctness: settled[1].status === "fulfilled" ? settled[1].value : failedResult(settled[1].reason)
19225
19198
  };
19226
- let sealDiagnostic;
19227
- try {
19228
- const { stdout: headBeforeStdout } = await execFileAsync3(
19229
- "git",
19230
- ["rev-parse", "--verify", "HEAD^{commit}"],
19231
- { cwd: sourceProjectRoot }
19232
- );
19233
- const { stdout: sealedStatusStdout } = await execFileAsync3("git", statusArgs, {
19234
- cwd: sourceProjectRoot
19235
- });
19236
- const { stdout: headAfterStdout } = await execFileAsync3(
19237
- "git",
19238
- ["rev-parse", "--verify", "HEAD^{commit}"],
19239
- { cwd: sourceProjectRoot }
19240
- );
19241
- const headBefore = headBeforeStdout.trim();
19242
- const headAfter = headAfterStdout.trim();
19243
- if (headBefore !== targetCommit || headAfter !== targetCommit || sealedStatusStdout !== "") {
19244
- sealDiagnostic = [
19245
- "Reviewer target final seal failed:",
19246
- `HEAD before status => ${headBefore}`,
19247
- `HEAD after status => ${headAfter}`,
19248
- `expected PRE_HEAD ${targetCommit}`,
19249
- "git status --porcelain=v1 --untracked-files=all -- :/ ':(top,exclude).claude/worktrees/**'",
19250
- sealedStatusStdout
19251
- ].join("\n");
19252
- }
19253
- } catch (error) {
19254
- sealDiagnostic = `Reviewer target final seal failed:
19255
- ${serializeThrownValue(error)}`;
19256
- }
19257
- if (sealDiagnostic !== void 0) {
19258
- const withSealFailure = (result) => ({
19259
- ...result,
19260
- exitCode: 1,
19261
- stderr: [result.stderr, sealDiagnostic].filter(
19262
- (text) => typeof text === "string" && text !== ""
19263
- ).join("\n")
19264
- });
19265
- results = {
19266
- completeness: withSealFailure(results.completeness),
19267
- correctness: withSealFailure(results.correctness)
19268
- };
19269
- }
19270
- return results;
19271
19199
  }
19272
19200
  async function summonGateOfficer(options) {
19273
19201
  let home = options.home;
@@ -20841,35 +20841,8 @@ async function summonParallelReviewerLenses(options) {
20841
20841
  const failure = failedResult(error);
20842
20842
  return { completeness: failure, correctness: failure };
20843
20843
  };
20844
- let sourceProjectRoot;
20845
- let targetCommit;
20846
- const statusArgs = [
20847
- "status",
20848
- "--porcelain=v1",
20849
- "--untracked-files=all",
20850
- "--",
20851
- ":/",
20852
- ":(top,exclude).claude/worktrees/**"
20853
- ];
20854
20844
  try {
20855
- sourceProjectRoot = await resolveReviewerGitToplevel(options.projectRoot);
20856
- const { stdout: statusStdout } = await execFileAsync3("git", statusArgs, {
20857
- cwd: sourceProjectRoot
20858
- });
20859
- if (statusStdout !== "") {
20860
- const diagnostic = [
20861
- "Reviewer target status gate failed:",
20862
- "git status --porcelain=v1 --untracked-files=all -- :/ ':(top,exclude).claude/worktrees/**'",
20863
- statusStdout
20864
- ].join("\n");
20865
- return dualFailure(new Error(diagnostic));
20866
- }
20867
- const { stdout: targetStdout } = await execFileAsync3(
20868
- "git",
20869
- ["rev-parse", "--verify", "HEAD^{commit}"],
20870
- { cwd: sourceProjectRoot }
20871
- );
20872
- targetCommit = targetStdout.trim();
20845
+ const sourceProjectRoot = await resolveReviewerGitToplevel(options.projectRoot);
20873
20846
  await execFileAsync3(
20874
20847
  "git",
20875
20848
  ["rev-parse", "--verify", `${options.baseRevision}^{commit}`],
@@ -20905,55 +20878,10 @@ async function summonParallelReviewerLenses(options) {
20905
20878
  summon("completeness"),
20906
20879
  summon("correctness")
20907
20880
  ]);
20908
- let results = {
20881
+ return {
20909
20882
  completeness: settled[0].status === "fulfilled" ? settled[0].value : failedResult(settled[0].reason),
20910
20883
  correctness: settled[1].status === "fulfilled" ? settled[1].value : failedResult(settled[1].reason)
20911
20884
  };
20912
- let sealDiagnostic;
20913
- try {
20914
- const { stdout: headBeforeStdout } = await execFileAsync3(
20915
- "git",
20916
- ["rev-parse", "--verify", "HEAD^{commit}"],
20917
- { cwd: sourceProjectRoot }
20918
- );
20919
- const { stdout: sealedStatusStdout } = await execFileAsync3("git", statusArgs, {
20920
- cwd: sourceProjectRoot
20921
- });
20922
- const { stdout: headAfterStdout } = await execFileAsync3(
20923
- "git",
20924
- ["rev-parse", "--verify", "HEAD^{commit}"],
20925
- { cwd: sourceProjectRoot }
20926
- );
20927
- const headBefore = headBeforeStdout.trim();
20928
- const headAfter = headAfterStdout.trim();
20929
- if (headBefore !== targetCommit || headAfter !== targetCommit || sealedStatusStdout !== "") {
20930
- sealDiagnostic = [
20931
- "Reviewer target final seal failed:",
20932
- `HEAD before status => ${headBefore}`,
20933
- `HEAD after status => ${headAfter}`,
20934
- `expected PRE_HEAD ${targetCommit}`,
20935
- "git status --porcelain=v1 --untracked-files=all -- :/ ':(top,exclude).claude/worktrees/**'",
20936
- sealedStatusStdout
20937
- ].join("\n");
20938
- }
20939
- } catch (error) {
20940
- sealDiagnostic = `Reviewer target final seal failed:
20941
- ${serializeThrownValue(error)}`;
20942
- }
20943
- if (sealDiagnostic !== void 0) {
20944
- const withSealFailure = (result) => ({
20945
- ...result,
20946
- exitCode: 1,
20947
- stderr: [result.stderr, sealDiagnostic].filter(
20948
- (text) => typeof text === "string" && text !== ""
20949
- ).join("\n")
20950
- });
20951
- results = {
20952
- completeness: withSealFailure(results.completeness),
20953
- correctness: withSealFailure(results.correctness)
20954
- };
20955
- }
20956
- return results;
20957
20885
  }
20958
20886
  async function summonGateOfficer(options) {
20959
20887
  let home = options.home;
@@ -298,35 +298,8 @@ async function summonParallelReviewerLenses(options) {
298
298
  const failure = failedResult(error);
299
299
  return { completeness: failure, correctness: failure };
300
300
  };
301
- let sourceProjectRoot;
302
- let targetCommit;
303
- const statusArgs = [
304
- "status",
305
- "--porcelain=v1",
306
- "--untracked-files=all",
307
- "--",
308
- ":/",
309
- ":(top,exclude).claude/worktrees/**"
310
- ];
311
301
  try {
312
- sourceProjectRoot = await resolveReviewerGitToplevel(options.projectRoot);
313
- const { stdout: statusStdout } = await execFileAsync("git", statusArgs, {
314
- cwd: sourceProjectRoot
315
- });
316
- if (statusStdout !== "") {
317
- const diagnostic = [
318
- "Reviewer target status gate failed:",
319
- "git status --porcelain=v1 --untracked-files=all -- :/ ':(top,exclude).claude/worktrees/**'",
320
- statusStdout
321
- ].join("\n");
322
- return dualFailure(new Error(diagnostic));
323
- }
324
- const { stdout: targetStdout } = await execFileAsync(
325
- "git",
326
- ["rev-parse", "--verify", "HEAD^{commit}"],
327
- { cwd: sourceProjectRoot }
328
- );
329
- targetCommit = targetStdout.trim();
302
+ const sourceProjectRoot = await resolveReviewerGitToplevel(options.projectRoot);
330
303
  await execFileAsync(
331
304
  "git",
332
305
  ["rev-parse", "--verify", `${options.baseRevision}^{commit}`],
@@ -362,55 +335,10 @@ async function summonParallelReviewerLenses(options) {
362
335
  summon("completeness"),
363
336
  summon("correctness")
364
337
  ]);
365
- let results = {
338
+ return {
366
339
  completeness: settled[0].status === "fulfilled" ? settled[0].value : failedResult(settled[0].reason),
367
340
  correctness: settled[1].status === "fulfilled" ? settled[1].value : failedResult(settled[1].reason)
368
341
  };
369
- let sealDiagnostic;
370
- try {
371
- const { stdout: headBeforeStdout } = await execFileAsync(
372
- "git",
373
- ["rev-parse", "--verify", "HEAD^{commit}"],
374
- { cwd: sourceProjectRoot }
375
- );
376
- const { stdout: sealedStatusStdout } = await execFileAsync("git", statusArgs, {
377
- cwd: sourceProjectRoot
378
- });
379
- const { stdout: headAfterStdout } = await execFileAsync(
380
- "git",
381
- ["rev-parse", "--verify", "HEAD^{commit}"],
382
- { cwd: sourceProjectRoot }
383
- );
384
- const headBefore = headBeforeStdout.trim();
385
- const headAfter = headAfterStdout.trim();
386
- if (headBefore !== targetCommit || headAfter !== targetCommit || sealedStatusStdout !== "") {
387
- sealDiagnostic = [
388
- "Reviewer target final seal failed:",
389
- `HEAD before status => ${headBefore}`,
390
- `HEAD after status => ${headAfter}`,
391
- `expected PRE_HEAD ${targetCommit}`,
392
- "git status --porcelain=v1 --untracked-files=all -- :/ ':(top,exclude).claude/worktrees/**'",
393
- sealedStatusStdout
394
- ].join("\n");
395
- }
396
- } catch (error) {
397
- sealDiagnostic = `Reviewer target final seal failed:
398
- ${serializeThrownValue(error)}`;
399
- }
400
- if (sealDiagnostic !== void 0) {
401
- const withSealFailure = (result) => ({
402
- ...result,
403
- exitCode: 1,
404
- stderr: [result.stderr, sealDiagnostic].filter(
405
- (text) => typeof text === "string" && text !== ""
406
- ).join("\n")
407
- });
408
- results = {
409
- completeness: withSealFailure(results.completeness),
410
- correctness: withSealFailure(results.correctness)
411
- };
412
- }
413
- return results;
414
342
  }
415
343
  async function summonGateOfficer(options) {
416
344
  let home = options.home;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akagilnc/pi-workflow-roles",
3
- "version": "0.1.5712",
3
+ "version": "0.1.5714",
4
4
  "description": "Soul-bound workflow roles for Pi",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -554,7 +554,7 @@ function withReviewerLens(
554
554
  return [...argv.slice(0, separator), "--lens", lens, ...argv.slice(separator)];
555
555
  }
556
556
 
557
- /** Git toplevel for Reviewer target status / seal checks (subdir-safe). */
557
+ /** Git toplevel for Reviewer pre-dispatch --base existence check (subdir-safe). */
558
558
  async function resolveReviewerGitToplevel(projectRoot: string): Promise<string> {
559
559
  const callerProjectRoot = await realpath(projectRoot);
560
560
  return await realpath((await execFileAsync(
@@ -570,6 +570,10 @@ async function resolveReviewerGitToplevel(projectRoot: string): Promise<string>
570
570
  * caller's public argv and only adds `--lens` (10a). No seat-specific ephemeral
571
571
  * copy — same shared tree as other seats. Lifecycle stays in this shared
572
572
  * summons seam, never in the role module (#946 / ADR 0018).
573
+ *
574
+ * Work-tree dirt and mid-batch HEAD drift are not package hard-stops (#1133):
575
+ * each ordinary Reviewer leg judges and reports object state itself; this seam
576
+ * records original child terminals as returned.
573
577
  */
574
578
  export async function summonParallelReviewerLenses(options: {
575
579
  /** Public argv after the role token; must not already carry `--lens`. */
@@ -606,37 +610,10 @@ export async function summonParallelReviewerLenses(options: {
606
610
  return { completeness: failure, correctness: failure } as const;
607
611
  };
608
612
 
609
- // Pre-dispatch target checks use git toplevel (subdir-safe). Every failure
610
- // keeps the existing dual-child batch surface.
611
- let sourceProjectRoot: string;
612
- let targetCommit: string;
613
- const statusArgs = [
614
- "status",
615
- "--porcelain=v1",
616
- "--untracked-files=all",
617
- "--",
618
- ":/",
619
- ":(top,exclude).claude/worktrees/**",
620
- ] as const;
613
+ // Pre-dispatch: only verify typed --base resolves (subdir-safe). Missing base
614
+ // keeps the dual-child batch surface. Status / HEAD are not package gates.
621
615
  try {
622
- sourceProjectRoot = await resolveReviewerGitToplevel(options.projectRoot);
623
- const { stdout: statusStdout } = await execFileAsync("git", statusArgs, {
624
- cwd: sourceProjectRoot,
625
- });
626
- if (statusStdout !== "") {
627
- const diagnostic = [
628
- "Reviewer target status gate failed:",
629
- "git status --porcelain=v1 --untracked-files=all -- :/ ':(top,exclude).claude/worktrees/**'",
630
- statusStdout,
631
- ].join("\n");
632
- return dualFailure(new Error(diagnostic));
633
- }
634
- const { stdout: targetStdout } = await execFileAsync(
635
- "git",
636
- ["rev-parse", "--verify", "HEAD^{commit}"],
637
- { cwd: sourceProjectRoot },
638
- );
639
- targetCommit = targetStdout.trim();
616
+ const sourceProjectRoot = await resolveReviewerGitToplevel(options.projectRoot);
640
617
  // Typed base from the public parse — covers --base value and --base=value alike.
641
618
  // Child legs still carry the original argv token unchanged (10a).
642
619
  await execFileAsync(
@@ -682,7 +659,7 @@ export async function summonParallelReviewerLenses(options: {
682
659
  summon("completeness"),
683
660
  summon("correctness"),
684
661
  ]);
685
- let results = {
662
+ return {
686
663
  completeness: settled[0].status === "fulfilled"
687
664
  ? settled[0].value
688
665
  : failedResult(settled[0].reason),
@@ -690,55 +667,6 @@ export async function summonParallelReviewerLenses(options: {
690
667
  ? settled[1].value
691
668
  : failedResult(settled[1].reason),
692
669
  };
693
-
694
- let sealDiagnostic: string | undefined;
695
- try {
696
- const { stdout: headBeforeStdout } = await execFileAsync(
697
- "git",
698
- ["rev-parse", "--verify", "HEAD^{commit}"],
699
- { cwd: sourceProjectRoot },
700
- );
701
- const { stdout: sealedStatusStdout } = await execFileAsync("git", statusArgs, {
702
- cwd: sourceProjectRoot,
703
- });
704
- const { stdout: headAfterStdout } = await execFileAsync(
705
- "git",
706
- ["rev-parse", "--verify", "HEAD^{commit}"],
707
- { cwd: sourceProjectRoot },
708
- );
709
- const headBefore = headBeforeStdout.trim();
710
- const headAfter = headAfterStdout.trim();
711
- if (
712
- headBefore !== targetCommit
713
- || headAfter !== targetCommit
714
- || sealedStatusStdout !== ""
715
- ) {
716
- sealDiagnostic = [
717
- "Reviewer target final seal failed:",
718
- `HEAD before status => ${headBefore}`,
719
- `HEAD after status => ${headAfter}`,
720
- `expected PRE_HEAD ${targetCommit}`,
721
- "git status --porcelain=v1 --untracked-files=all -- :/ ':(top,exclude).claude/worktrees/**'",
722
- sealedStatusStdout,
723
- ].join("\n");
724
- }
725
- } catch (error) {
726
- sealDiagnostic = `Reviewer target final seal failed:\n${serializeThrownValue(error)}`;
727
- }
728
- if (sealDiagnostic !== undefined) {
729
- const withSealFailure = (result: PublicSummonResult): PublicSummonResult => ({
730
- ...result,
731
- exitCode: 1,
732
- stderr: [result.stderr, sealDiagnostic].filter(
733
- (text): text is string => typeof text === "string" && text !== "",
734
- ).join("\n"),
735
- });
736
- results = {
737
- completeness: withSealFailure(results.completeness),
738
- correctness: withSealFailure(results.correctness),
739
- };
740
- }
741
- return results;
742
670
  }
743
671
 
744
672
  /** Gate officer summons: notary/auditor via --source-run; inspector via pointer; countersign via parentRunPath (#969 / #987). */