vouchington-tooling 0.11.2 → 0.12.1

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.
package/README.md CHANGED
@@ -68,13 +68,15 @@ vouchington post-review
68
68
  vouchington stage-review-payload optional|required <source> <destination>
69
69
  ```
70
70
 
71
- For persistent `pnpm-install`, v4 metadata tracks structural inputs separately from the
71
+ For persistent `pnpm-install`, v5 metadata tracks structural inputs separately from the
72
72
  `--install-scripts` policy. A warm scripts-enabled tree can therefore toggle
73
73
  `true → false → true` without forced reconciliation; a tree first installed with scripts disabled
74
74
  uses one script-suppressed verification install followed by `pnpm rebuild --pending --recursive`.
75
75
  When only newly pending dependency package IDs remain, it instead rebuilds those exact IDs without
76
76
  rerunning first-party workspace hooks.
77
- An isolated native-binary mismatch uses one strict forced install only when structural provenance
77
+ If that generic rebuild leaves only pnpm's root importer marker, one root-only pending rebuild runs
78
+ the root lifecycle hook; every other residual ID remains a hard failure. An isolated native-binary
79
+ mismatch uses one strict forced install only when structural provenance
78
80
  matches, workspace links are valid, and pnpm records empty `ignoredBuilds` and `pendingBuilds` ledgers;
79
81
  otherwise it retains the script-free then strict reconciliation. Native and workspace-link health
80
82
  are verified before its metadata stamp is refreshed.
@@ -215,6 +217,7 @@ import {
215
217
  import { runRetrospectiveTranscript } from 'vouchington-tooling/retrospective-transcript'
216
218
  import { appendJournal, probeBlackboard } from 'vouchington-tooling/agent-blackboard'
217
219
  import { buildSessionFrictionReport, recordFriction } from 'vouchington-tooling/session-friction'
220
+ import { GITHUB_BODY_MAX_CHARACTERS, validateGitHubBodyLength } from 'vouchington-tooling'
218
221
  import { createPullRequest, getDiffAgainstBase, runGh, runGit } from 'vouchington-tooling/gh-cli'
219
222
  import {
220
223
  shellScriptViolations,
@@ -231,6 +234,10 @@ throws on a `run:` value that is a YAML alias or a multiline PLAIN scalar, shape
231
234
  scan safely. Both functions scan already-in-scope source text — deciding which files count as a
232
235
  shell script or a workflow/action YAML file is left to the caller.
233
236
 
237
+ `validateGitHubBodyLength` measures an issue or pull-request body against GitHub's 65,536 Unicode
238
+ code-point limit without altering it. Its result includes the UTF-8 byte count for diagnostics; that
239
+ byte count is not a validation limit.
240
+
234
241
  `agent-harness-config` merges classifier-auto and sandbox keys into Claude, Codex, Grok, and Cursor
235
242
  config files. See [docs/agent-harness-config.md](./docs/agent-harness-config.md). `--global` updates
236
243
  home-directory configs; `--repo` updates a checkout. It does not copy allowlists, hooks, or plugins.
@@ -0,0 +1,15 @@
1
+ /** GitHub's maximum issue or pull-request body length, counted in Unicode code points. */
2
+ export declare const GITHUB_BODY_MAX_CHARACTERS = 65536;
3
+ /** The measured GitHub body length and whether it fits within GitHub's character limit. */
4
+ export interface GitHubBodyLengthValidation {
5
+ readonly ok: boolean;
6
+ readonly characterCount: number;
7
+ readonly utf8ByteCount: number;
8
+ readonly maxCharacterCount: number;
9
+ }
10
+ /**
11
+ * Measures a GitHub issue or pull-request body without altering its content.
12
+ *
13
+ * GitHub's limit is evaluated in Unicode code points. UTF-8 bytes are returned only for diagnostics.
14
+ */
15
+ export declare function validateGitHubBodyLength(body: string): GitHubBodyLengthValidation;
@@ -0,0 +1,16 @@
1
+ /** GitHub's maximum issue or pull-request body length, counted in Unicode code points. */
2
+ export const GITHUB_BODY_MAX_CHARACTERS = 65_536;
3
+ /**
4
+ * Measures a GitHub issue or pull-request body without altering its content.
5
+ *
6
+ * GitHub's limit is evaluated in Unicode code points. UTF-8 bytes are returned only for diagnostics.
7
+ */
8
+ export function validateGitHubBodyLength(body) {
9
+ const characterCount = Array.from(body).length;
10
+ return {
11
+ ok: characterCount <= GITHUB_BODY_MAX_CHARACTERS,
12
+ characterCount,
13
+ utf8ByteCount: Buffer.byteLength(body, 'utf8'),
14
+ maxCharacterCount: GITHUB_BODY_MAX_CHARACTERS,
15
+ };
16
+ }
@@ -1,5 +1,7 @@
1
1
  export { createCommandRunner, runGh, runGit } from './exec.mts';
2
2
  export type { ExecFileText, RunTextCommand } from './exec.mts';
3
3
  export { getDiffAgainstBase } from './diff.mts';
4
+ export { GITHUB_BODY_MAX_CHARACTERS, validateGitHubBodyLength } from './body-length.mts';
5
+ export type { GitHubBodyLengthValidation } from './body-length.mts';
4
6
  export { assertHeadPushed, buildGhPrCreateArgs, createPullRequest, DetachedHeadError, HeadNotPushedError, HeadOutOfDateError, resolveHeadBranch, } from './pr-create.mts';
5
7
  export type { AssertHeadPushedOptions, BuildGhPrCreateArgsOptions, CreatePullRequestExecutors, CreatePullRequestOptions, } from './pr-create.mts';
@@ -1,3 +1,4 @@
1
1
  export { createCommandRunner, runGh, runGit } from './exec.mjs';
2
2
  export { getDiffAgainstBase } from './diff.mjs';
3
+ export { GITHUB_BODY_MAX_CHARACTERS, validateGitHubBodyLength } from './body-length.mjs';
3
4
  export { assertHeadPushed, buildGhPrCreateArgs, createPullRequest, DetachedHeadError, HeadNotPushedError, HeadOutOfDateError, resolveHeadBranch, } from './pr-create.mjs';
package/dist/index.d.mts CHANGED
@@ -89,5 +89,7 @@ export type { DiagnosticReportLimitOptions, DiagnosticReportSummary, } from './v
89
89
  export { createCommandRunner, runGh, runGit } from './gh-cli/index.mts';
90
90
  export type { ExecFileText, RunTextCommand } from './gh-cli/index.mts';
91
91
  export { getDiffAgainstBase } from './gh-cli/index.mts';
92
+ export { GITHUB_BODY_MAX_CHARACTERS, validateGitHubBodyLength } from './gh-cli/index.mts';
93
+ export type { GitHubBodyLengthValidation } from './gh-cli/index.mts';
92
94
  export { assertHeadPushed, buildGhPrCreateArgs, createPullRequest, DetachedHeadError, HeadNotPushedError, HeadOutOfDateError, resolveHeadBranch, } from './gh-cli/index.mts';
93
95
  export type { AssertHeadPushedOptions, BuildGhPrCreateArgsOptions, CreatePullRequestExecutors, CreatePullRequestOptions, } from './gh-cli/index.mts';
package/dist/index.mjs CHANGED
@@ -50,4 +50,5 @@ export { validateResolvedPinDelta } from './swift-resolved-pin-delta/index.mjs';
50
50
  export { DEFAULT_MAX_DIAGNOSTIC_REPORTS, DEFAULT_MAX_FORMATTED_DIAGNOSTIC_REPORTS, formatDiagnosticReportSummaries, HARD_MAX_DIAGNOSTIC_REPORTS, readDiagnosticReportSummaries, summarizeDiagnosticReport, } from './vitest-diagnostics/index.mjs';
51
51
  export { createCommandRunner, runGh, runGit } from './gh-cli/index.mjs';
52
52
  export { getDiffAgainstBase } from './gh-cli/index.mjs';
53
+ export { GITHUB_BODY_MAX_CHARACTERS, validateGitHubBodyLength } from './gh-cli/index.mjs';
53
54
  export { assertHeadPushed, buildGhPrCreateArgs, createPullRequest, DetachedHeadError, HeadNotPushedError, HeadOutOfDateError, resolveHeadBranch, } from './gh-cli/index.mjs';
@@ -52,7 +52,11 @@ export async function finalizePendingBuilds(options, runCapture, phase) {
52
52
  fail(`${phase} completed without a clear pending build ledger`);
53
53
  if (options.installScripts && before.kind === 'pending') {
54
54
  await install(['rebuild', '--pending', '--recursive'], options, 'pending scripts rebuild');
55
- const after = await pendingBuilds();
55
+ let after = await pendingBuilds();
56
+ if (after.kind === 'pending' && after.ids.length === 1 && after.ids[0] === '.') {
57
+ await install(['rebuild', '--pending', '--workspace-root'], options, 'pending workspace root rebuild');
58
+ after = await pendingBuilds();
59
+ }
56
60
  if (after.kind !== 'clear')
57
61
  fail(`${phase} completed without a clear pending build ledger`);
58
62
  }
@@ -40,12 +40,17 @@ elif [ ! -f "$PNPM_NODE_MODULES/.modules.yaml" ]; then
40
40
  printf 'pendingBuilds: []\\n' > "$PNPM_NODE_MODULES/.modules.yaml"
41
41
  fi
42
42
  case " $* " in
43
+ *' rebuild --pending --workspace-root '*)
44
+ printf 'pendingBuilds: [%s]\n' "\${PNPM_WORKSPACE_ROOT_REBUILD_PENDING_BUILDS:-}" > "$PNPM_NODE_MODULES/.modules.yaml"
45
+ ;;
43
46
  *' rebuild '*)
44
47
  if [ "\${PNPM_REPAIR_NATIVE_ON_REBUILD:-0}" = 1 ]; then
45
48
  cp "$PNPM_NATIVE_REPLACEMENT" "$PNPM_NATIVE_ADDON"
46
49
  fi
47
50
  if [ "\${PNPM_REBUILD_INVALID_LEDGER:-0}" = 1 ]; then
48
51
  printf 'pendingBuilds: invalid\n' > "$PNPM_NODE_MODULES/.modules.yaml"
52
+ elif [ -n "\${PNPM_REBUILD_PENDING_BUILDS:-}" ]; then
53
+ printf 'pendingBuilds: [%s]\n' "$PNPM_REBUILD_PENDING_BUILDS" > "$PNPM_NODE_MODULES/.modules.yaml"
49
54
  else
50
55
  printf 'pendingBuilds: []\n' > "$PNPM_NODE_MODULES/.modules.yaml"
51
56
  fi
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vouchington-tooling",
3
- "version": "0.11.2",
3
+ "version": "0.12.1",
4
4
  "description": "Vouchington CLI and extractable tooling libraries.",
5
5
  "homepage": "https://github.com/vouchington/vouchington-tooling/tree/main/packages/vouchington-tooling#readme",
6
6
  "bugs": {