@oss-autopilot/core 3.29.0 → 3.29.2

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.
@@ -20,6 +20,7 @@
20
20
  * Unset (the single-user default), nothing here runs.
21
21
  */
22
22
  import { execFileSync } from 'node:child_process';
23
+ import { createHash } from 'node:crypto';
23
24
  import * as fs from 'node:fs';
24
25
  import * as os from 'node:os';
25
26
  import * as path from 'node:path';
@@ -40,7 +41,9 @@ export function handoffDir() {
40
41
  }
41
42
  /** Pure: a flat file name for a branch's bundle; never a path. */
42
43
  export function bundleFileFor(branch) {
43
- return `${branch.replaceAll(/[^\w.-]/g, '_').replace(/^\.+/, '_')}.bundle`;
44
+ const stem = branch.replaceAll(/[^\w.-]/g, '_').replace(/^\.+/, '_');
45
+ const hash = createHash('sha1').update(branch).digest('hex').slice(0, 8);
46
+ return `${stem}_${hash}.bundle`;
44
47
  }
45
48
  function gitRun(args) {
46
49
  execFileSync('git', args, {
@@ -529,6 +529,16 @@ export const OVERNIGHT_DISALLOWED_TOOLS = [
529
529
  // `pnpm --dir x exec`), mirroring the `git * push` deny.
530
530
  'Bash(node * -e *)',
531
531
  'Bash(node * --eval *)',
532
+ 'Bash(node * -p *)',
533
+ 'Bash(node * -pe *)',
534
+ 'Bash(node * --print *)',
535
+ 'Bash(npm * x *)',
536
+ // The `=` forms take no space, so the space-delimited denies above miss
537
+ // them: `node --eval=<js>` runs exactly like `node --eval <js>`.
538
+ 'Bash(node --eval=*)',
539
+ 'Bash(node * --eval=*)',
540
+ 'Bash(node --print=*)',
541
+ 'Bash(node * --print=*)',
532
542
  'AskUserQuestion',
533
543
  ].join(',');
534
544
  export const OVERNIGHT_ALLOWED_TOOLS = [
@@ -107,6 +107,8 @@ export function buildScoutState(diagnostics) {
107
107
  title: '',
108
108
  skippedAt: dismissedAt,
109
109
  reason: 'dismissed',
110
+ // A dismissal is a manual decision: never let scout's TTL cull age it out.
111
+ permanent: true,
110
112
  });
111
113
  }
112
114
  // Strategy-derived personalization (#1464). `computeStrategy` returns null
@@ -120,6 +122,10 @@ export function buildScoutState(diagnostics) {
120
122
  const strategy = computeStrategy(state);
121
123
  return {
122
124
  version: 1,
125
+ // Scout 1.8.1 made this required on the inferred ScoutState type. Scout
126
+ // does not schema-parse a provided initialState, so pass its current
127
+ // revision (1) explicitly: that marks the state as already migrated.
128
+ stateRevision: 1,
123
129
  preferences: {
124
130
  githubUsername: config.githubUsername,
125
131
  languages: config.languages,
@@ -71,6 +71,9 @@ export function parseSkippedIssuesContent(content) {
71
71
  number,
72
72
  title: '',
73
73
  skippedAt: new Date(dateMs).toISOString(),
74
+ // Skip-file entries are manual skips; scout 1.8.1 only TTL-culls
75
+ // entries explicitly marked non-permanent.
76
+ permanent: true,
74
77
  });
75
78
  }
76
79
  return results;
@@ -13,6 +13,15 @@ export function isConditionalChecklistItem(line) {
13
13
  }
14
14
  // Matches markdown headings; `\S` after whitespace prevents backtracking with `.*` (#1718)
15
15
  const HEADING_RE = /^#{1,6}\s+(\S.*)/;
16
+ /**
17
+ * Matches an HTML comment that introduces a pick-one (single-select) group of
18
+ * checkboxes. Supported phrases: "exactly one", "pick one", "choose one".
19
+ * Intentionally excludes bare "one of" to avoid false positives on explanatory
20
+ * prose like "Complete one of the following only if it applies". (#1760)
21
+ */
22
+ const PICK_ONE_COMMENT_RE = /<!--[^>]*(?:exactly\s+one|pick\s+one|choose\s+one)[^>]*-->/i;
23
+ /** Matches any checkbox line (checked or unchecked). */
24
+ const ANY_CHECKBOX_RE = /^.*- \[[ x]\].*$/i;
16
25
  /**
17
26
  * Matches headings that indicate a mutually-exclusive "type of change" radio group
18
27
  * where exactly one option should be selected. (#1718)
@@ -59,6 +68,48 @@ function hasLeaveUncheckedNote(section) {
59
68
  return lower.includes('leave unchecked') && (lower.includes('not applicable') || lower.includes('n/a'));
60
69
  });
61
70
  }
71
+ /**
72
+ * Mark unchecked lines in a single pick-one run as exempt if exactly one box is
73
+ * checked. Extracted to keep `collectPickOneExemptLineIndices` within complexity
74
+ * limits.
75
+ */
76
+ function markPickOneRunExempt(lines, runStart, runEnd, exempt) {
77
+ const checkedInRun = lines.slice(runStart, runEnd).filter((l) => /- \[x\]/i.test(l)).length;
78
+ if (checkedInRun !== 1)
79
+ return;
80
+ for (let k = runStart; k < runEnd; k++) {
81
+ if (/- \[ \]/.test(lines[k]))
82
+ exempt.add(k);
83
+ }
84
+ }
85
+ /**
86
+ * Returns the set of line indices (within `lines`) that are unchecked checkbox lines
87
+ * belonging to a satisfied pick-one group. A pick-one group is a contiguous checkbox
88
+ * run immediately following an HTML comment matching PICK_ONE_COMMENT_RE. The group is
89
+ * satisfied when exactly one box in the run is checked; in that case the unchecked
90
+ * alternatives are intentional and must not be counted as incomplete. (#1760)
91
+ */
92
+ function collectPickOneExemptLineIndices(lines) {
93
+ const exempt = new Set();
94
+ let i = 0;
95
+ while (i < lines.length) {
96
+ if (!PICK_ONE_COMMENT_RE.test(lines[i])) {
97
+ i++;
98
+ continue;
99
+ }
100
+ // Advance past the comment, skipping any blank lines before the checkbox run
101
+ let j = i + 1;
102
+ while (j < lines.length && lines[j].trim() === '')
103
+ j++;
104
+ // Collect the contiguous checkbox run
105
+ const runStart = j;
106
+ while (j < lines.length && ANY_CHECKBOX_RE.test(lines[j]))
107
+ j++;
108
+ markPickOneRunExempt(lines, runStart, j, exempt);
109
+ i = j;
110
+ }
111
+ return exempt;
112
+ }
62
113
  /**
63
114
  * Analyze a single checkbox section and return its effective counts.
64
115
  * Returns null if the section should be entirely skipped.
@@ -76,7 +127,9 @@ function analyzeSectionItems(section) {
76
127
  const isTypeOfChange = section.heading !== null && TYPE_OF_CHANGE_RE.test(section.heading);
77
128
  if (isTypeOfChange && checked >= 1)
78
129
  return { checked, nonConditionalUnchecked: 0 };
79
- const nonConditionalUnchecked = uncheckedLines.filter((l) => !isConditionalChecklistItem(l));
130
+ // Pick-one groups: unchecked alternatives in a satisfied pick-one group are exempt. (#1760)
131
+ const pickOneExempt = collectPickOneExemptLineIndices(section.lines);
132
+ const nonConditionalUnchecked = section.lines.filter((l, idx) => /^.*- \[ \].*$/.test(l) && !isConditionalChecklistItem(l) && !pickOneExempt.has(idx));
80
133
  return { checked, nonConditionalUnchecked: nonConditionalUnchecked.length };
81
134
  }
82
135
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oss-autopilot/core",
3
- "version": "3.29.0",
3
+ "version": "3.29.2",
4
4
  "description": "CLI and core library for managing open source contributions",
5
5
  "type": "module",
6
6
  "bin": {
@@ -55,7 +55,7 @@
55
55
  "@octokit/plugin-retry": "^8.1.1",
56
56
  "@octokit/plugin-throttling": "^11.0.5",
57
57
  "@octokit/rest": "^22.0.1",
58
- "@oss-scout/core": "^1.8.0",
58
+ "@oss-scout/core": "^1.8.1",
59
59
  "commander": "^15.0.0",
60
60
  "zod": "^4.5.4"
61
61
  },