@opengsd/gsd-core 1.9.0 → 1.10.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.
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +2 -3
- package/.opencode/plugins/gsd-core.js +8 -1
- package/agents/gsd-code-fixer.md +131 -34
- package/agents/gsd-debugger.md +12 -246
- package/agents/gsd-executor.md +7 -5
- package/agents/gsd-integration-checker.md +3 -0
- package/agents/gsd-plan-checker.md +9 -0
- package/agents/gsd-planner.md +5 -8
- package/agents/gsd-roadmapper.md +21 -3
- package/agents/gsd-verifier.md +14 -70
- package/bin/install.js +503 -341
- package/commands/gsd/mempalace-capture.md +1 -1
- package/commands/gsd/new-milestone.md +1 -1
- package/commands/gsd/plan-phase.md +1 -1
- package/gsd-core/bin/gsd-tools.cjs +607 -63
- package/gsd-core/bin/lib/active-workstream-store.cjs +25 -0
- package/gsd-core/bin/lib/agent-install-check.cjs +38 -6
- package/gsd-core/bin/lib/api-coverage.cjs +120 -0
- package/gsd-core/bin/lib/audit.cjs +89 -1
- package/gsd-core/bin/lib/broken-windows.cjs +36 -6
- package/gsd-core/bin/lib/capability-registry.cjs +96 -110
- package/gsd-core/bin/lib/capability-validator.cjs +12 -2
- package/gsd-core/bin/lib/check-command-router.cjs +43 -1
- package/gsd-core/bin/lib/command-aliases.cjs +72 -0
- package/gsd-core/bin/lib/commands.cjs +26 -25
- package/gsd-core/bin/lib/commonjs-marker.cjs +136 -0
- package/gsd-core/bin/lib/config-loader.cjs +1 -0
- package/gsd-core/bin/lib/config.cjs +12 -1
- package/gsd-core/bin/lib/context-composer.cjs +278 -0
- package/gsd-core/bin/lib/context-predicates.cjs +506 -0
- package/gsd-core/bin/lib/core-utils.cjs +91 -12
- package/gsd-core/bin/lib/docs.cjs +3 -2
- package/gsd-core/bin/lib/external-job.cjs +19 -4
- package/gsd-core/bin/lib/frontmatter.cjs +84 -12
- package/gsd-core/bin/lib/gate-predicate-evaluator.cjs +57 -6
- package/gsd-core/bin/lib/git-base-branch.cjs +58 -15
- package/gsd-core/bin/lib/graphify.cjs +142 -27
- package/gsd-core/bin/lib/gsd2-import.cjs +27 -4
- package/gsd-core/bin/lib/host-integration.cjs +13 -1
- package/gsd-core/bin/lib/init-command-router.cjs +83 -8
- package/gsd-core/bin/lib/init.cjs +1021 -57
- package/gsd-core/bin/lib/install-engine.cjs +64 -10
- package/gsd-core/bin/lib/install-profiles.cjs +27 -1
- package/gsd-core/bin/lib/installer-migration-authoring.cjs +3 -1
- package/gsd-core/bin/lib/installer-migration-report.cjs +4 -0
- package/gsd-core/bin/lib/installer-migrations/007-retire-config-root-commonjs-marker.cjs +149 -0
- package/gsd-core/bin/lib/installer-migrations/008-cursor-retire-commands-surface.cjs +55 -0
- package/gsd-core/bin/lib/installer-migrations/009-pi-retire-reserved-hooks-dir.cjs +199 -0
- package/gsd-core/bin/lib/installer-migrations.cjs +87 -1
- package/gsd-core/bin/lib/io.cjs +28 -3
- package/gsd-core/bin/lib/markdown-sectionizer.cjs +6 -0
- package/gsd-core/bin/lib/mcp-catalog.cjs +518 -0
- package/gsd-core/bin/lib/mcp-server.cjs +135 -3
- package/gsd-core/bin/lib/milestone.cjs +106 -51
- package/gsd-core/bin/lib/phase-id.cjs +63 -0
- package/gsd-core/bin/lib/phase-locator.cjs +138 -45
- package/gsd-core/bin/lib/phase.cjs +260 -25
- package/gsd-core/bin/lib/plan-dependency-graph.cjs +232 -0
- package/gsd-core/bin/lib/planning-workspace.cjs +4 -0
- package/gsd-core/bin/lib/project-root.cjs +48 -0
- package/gsd-core/bin/lib/prompt-budget.cjs +128 -165
- package/gsd-core/bin/lib/retired-artifact-cleanup.cjs +80 -0
- package/gsd-core/bin/lib/review-lane-descriptor.cjs +99 -0
- package/gsd-core/bin/lib/review-lane-runner.cjs +30 -6
- package/gsd-core/bin/lib/roadmap-command-router.cjs +42 -9
- package/gsd-core/bin/lib/roadmap-parser.cjs +100 -18
- package/gsd-core/bin/lib/roadmap.cjs +37 -7
- package/gsd-core/bin/lib/runtime-artifact-conversion.cjs +195 -62
- package/gsd-core/bin/lib/runtime-artifact-layout.cjs +15 -3
- package/gsd-core/bin/lib/runtime-homes.cjs +154 -41
- package/gsd-core/bin/lib/runtime-hooks-surface.cjs +105 -41
- package/gsd-core/bin/lib/section-manifest.cjs +209 -0
- package/gsd-core/bin/lib/shell-command-projection.cjs +113 -27
- package/gsd-core/bin/lib/smart-entry.cjs +12 -0
- package/gsd-core/bin/lib/state-transition.cjs +73 -8
- package/gsd-core/bin/lib/state.cjs +151 -62
- package/gsd-core/bin/lib/surface.cjs +12 -1
- package/gsd-core/bin/lib/uat-predicate.cjs +11 -1
- package/gsd-core/bin/lib/uat.cjs +320 -21
- package/gsd-core/bin/lib/unusable-input.cjs +9 -0
- package/gsd-core/bin/lib/verification.cjs +29 -12
- package/gsd-core/bin/lib/verify.cjs +29 -5
- package/gsd-core/bin/lib/workflow-fragments.cjs +557 -0
- package/gsd-core/bin/lib/workstream-inventory-builder.cjs +181 -18
- package/gsd-core/bin/lib/workstream-inventory.cjs +519 -27
- package/gsd-core/bin/lib/workstream.cjs +6 -0
- package/gsd-core/bin/lib/worktree-base-ref.cjs +50 -6
- package/gsd-core/bin/lib/worktree-safety.cjs +276 -118
- package/gsd-core/bin/shared/config-schema.manifest.json +2 -0
- package/gsd-core/references/artifact-types.md +10 -3
- package/gsd-core/references/autonomous-ui-design-contract.md +42 -0
- package/gsd-core/references/debugger-techniques.md +255 -0
- package/gsd-core/references/research-documentation-lookup.md +5 -3
- package/gsd-core/references/specless-probe-fallback.md +7 -6
- package/gsd-core/references/verifier-wiring-patterns.md +100 -0
- package/gsd-core/references/worktree-branch-check.md +2 -2
- package/gsd-core/templates/summary-complex.md +2 -0
- package/gsd-core/templates/summary-minimal.md +2 -0
- package/gsd-core/templates/summary-standard.md +2 -0
- package/gsd-core/templates/summary.md +2 -0
- package/gsd-core/workflows/audit-milestone.md +3 -0
- package/gsd-core/workflows/autonomous/steps/converge-banner.md +1 -0
- package/gsd-core/workflows/autonomous/steps/converge-dispatch-bg.md +11 -0
- package/gsd-core/workflows/autonomous/steps/converge-dispatch-inline.md +7 -0
- package/gsd-core/workflows/autonomous/steps/converge-fail-fast.md +21 -0
- package/gsd-core/workflows/autonomous/steps/converge-loop.md +7 -0
- package/gsd-core/workflows/autonomous.md +32 -69
- package/gsd-core/workflows/code-review/steps/dispatch-fix.md +39 -0
- package/gsd-core/workflows/code-review/steps/structural-pre-pass.md +83 -0
- package/gsd-core/workflows/code-review.md +42 -145
- package/gsd-core/workflows/complete-milestone/steps/git-tag.md +29 -0
- package/gsd-core/workflows/complete-milestone.md +23 -81
- package/gsd-core/workflows/debug.md +9 -12
- package/gsd-core/workflows/diagnose-issues.md +22 -0
- package/gsd-core/workflows/discovery-phase.md +4 -4
- package/gsd-core/workflows/discuss-phase-assumptions/steps/auto-advance-dispatch.md +15 -0
- package/gsd-core/workflows/discuss-phase-assumptions.md +5 -16
- package/gsd-core/workflows/docs-update/steps/dispatch-monorepo-packages.md +51 -0
- package/gsd-core/workflows/docs-update.md +8 -51
- package/gsd-core/workflows/execute-phase/steps/executor-isolation-dispatch.md +34 -2
- package/gsd-core/workflows/execute-phase/steps/gap-closure-artifacts.md +50 -0
- package/gsd-core/workflows/execute-phase/steps/partial-wave.md +31 -0
- package/gsd-core/workflows/execute-phase/steps/per-plan-worktree-gate.md +19 -0
- package/gsd-core/workflows/execute-phase/steps/regression-gate-run.md +42 -0
- package/gsd-core/workflows/execute-phase/steps/regression-gate.md +43 -37
- package/gsd-core/workflows/execute-phase.md +65 -137
- package/gsd-core/workflows/execute-plan.md +1 -1
- package/gsd-core/workflows/help/modes/full.md +6 -1
- package/gsd-core/workflows/ingest-docs.md +2 -1
- package/gsd-core/workflows/new-milestone/steps/project-md-milestone-write.md +16 -0
- package/gsd-core/workflows/new-milestone/steps/reset-phase-safety.md +19 -0
- package/gsd-core/workflows/new-milestone.md +21 -38
- package/gsd-core/workflows/new-project/steps/auto-mode-config.md +176 -0
- package/gsd-core/workflows/new-project/steps/auto-mode-detection.md +32 -0
- package/gsd-core/workflows/new-project/steps/codebase-map-offer.md +18 -0
- package/gsd-core/workflows/new-project.md +13 -226
- package/gsd-core/workflows/plan-phase/steps/adr-ingest-express-path.md +15 -0
- package/gsd-core/workflows/plan-phase/steps/chunked-planning-mode.md +110 -0
- package/gsd-core/workflows/plan-phase/steps/prd-express-gate.md +8 -0
- package/gsd-core/workflows/plan-phase/steps/research-only-early-exit.md +17 -0
- package/gsd-core/workflows/plan-phase/steps/research-only-modifiers.md +16 -0
- package/gsd-core/workflows/plan-phase/steps/reviews-prerequisite.md +17 -0
- package/gsd-core/workflows/plan-phase/steps/stall-detection-helpers.md +149 -0
- package/gsd-core/workflows/plan-phase.md +49 -193
- package/gsd-core/workflows/progress/steps/forensic-audit.md +125 -0
- package/gsd-core/workflows/progress/steps/mvp-display.md +18 -0
- package/gsd-core/workflows/progress.md +11 -153
- package/gsd-core/workflows/quick/steps/discussion-phase.md +124 -0
- package/gsd-core/workflows/quick/steps/plan-checker-loop.md +111 -0
- package/gsd-core/workflows/quick/steps/quick-verification.md +46 -0
- package/gsd-core/workflows/quick/steps/research-phase.md +72 -0
- package/gsd-core/workflows/quick/steps/worktree-pre-dispatch-commit.md +37 -0
- package/gsd-core/workflows/quick.md +20 -390
- package/gsd-core/workflows/resume-project.md +3 -0
- package/gsd-core/workflows/review/steps/reviewer-instances-note-1.md +4 -0
- package/gsd-core/workflows/review/steps/reviewer-instances-note-2.md +3 -0
- package/gsd-core/workflows/review.md +15 -8
- package/gsd-core/workflows/section-manifest.json +219 -0
- package/gsd-core/workflows/sketch.md +1 -1
- package/gsd-core/workflows/spec-phase.md +17 -14
- package/gsd-core/workflows/spike-wrap-up.md +20 -5
- package/gsd-core/workflows/spike.md +50 -16
- package/gsd-core/workflows/sync-skills.md +49 -11
- package/gsd-core/workflows/transition/steps/workstream-collision-check.md +17 -0
- package/gsd-core/workflows/transition.md +8 -21
- package/gsd-core/workflows/ui-phase.md +8 -7
- package/gsd-core/workflows/update/steps/channel-banner.md +7 -0
- package/gsd-core/workflows/update.md +18 -7
- package/gsd-core/workflows/verify-phase.md +4 -7
- package/gsd-core/workflows/verify-work/steps/automated-ui-verification.md +36 -0
- package/gsd-core/workflows/verify-work/steps/mvp-uat-framing.md +21 -0
- package/gsd-core/workflows/verify-work.md +8 -58
- package/hooks/dist/gsd-agent-isolation-guard.js +428 -0
- package/hooks/dist/gsd-check-update-worker.js +14 -5
- package/hooks/dist/gsd-cursor-subagent-start.js +532 -26
- package/hooks/dist/gsd-read-injection-scanner.js +7 -0
- package/hooks/dist/gsd-statusline.js +72 -6
- package/hooks/dist/gsd-worktree-path-guard.js +2 -1
- package/hooks/dist/gsd-write-guard.js +359 -0
- package/hooks/dist/lib/isolation-sentinel.js +268 -0
- package/hooks/dist/managed-hooks-registry.cjs +2 -0
- package/hooks/gsd-agent-isolation-guard.js +428 -0
- package/hooks/gsd-check-update-worker.js +14 -5
- package/hooks/gsd-cursor-subagent-start.js +532 -26
- package/hooks/gsd-read-injection-scanner.js +7 -0
- package/hooks/gsd-statusline.js +72 -6
- package/hooks/gsd-worktree-path-guard.js +2 -1
- package/hooks/gsd-write-guard.js +359 -0
- package/hooks/hooks.json +12 -0
- package/hooks/lib/isolation-sentinel.js +268 -0
- package/hooks/managed-hooks-registry.cjs +2 -0
- package/package.json +14 -5
- package/pi/gsd.cjs +57 -12
- package/scripts/build-hooks.js +9 -0
- package/scripts/changeset/lint.cjs +9 -2
- package/scripts/changeset/serialize.cjs +5 -1
- package/scripts/gen-capability-matrix.cjs +1 -1
- package/scripts/gen-context-index.cjs +448 -0
- package/scripts/gen-inventory-manifest.cjs +101 -1
- package/scripts/gen-prompt-budget-parity-corpus.cjs +645 -0
- package/scripts/gen-registry.cjs +39 -15
- package/scripts/gen-section-manifest.cjs +638 -0
- package/scripts/generate-package-identity.cjs +4 -2
- package/scripts/lint-allow-test-rule-refs.allowlist.json +17 -31
- package/scripts/lint-compiled-artifact-sync.cjs +6 -1
- package/scripts/lint-docs-command-form.cjs +195 -0
- package/scripts/lint-docs-required.cjs +9 -1
- package/scripts/lint-emitted-drift-ack.cjs +215 -20
- package/scripts/lint-example-parser-parity.cjs +395 -0
- package/scripts/lint-test-file-count.allowlist.json +27 -1
- package/scripts/mutation-matrix.cjs +13 -0
- package/scripts/prompt-injection-scan.sh +27 -6
- package/scripts/registry-schema.cjs +323 -94
- package/scripts/run-tests.cjs +3 -2
- package/scripts/validate-registry.cjs +10 -6
- package/skills/gsd-autonomous/SKILL.md +1 -1
- package/skills/gsd-execute-phase/SKILL.md +1 -1
- package/skills/gsd-mempalace-capture/SKILL.md +1 -1
- package/skills/gsd-new-milestone/SKILL.md +1 -1
- package/skills/gsd-plan-phase/SKILL.md +2 -2
- package/vscode/package.json +1 -1
- package/scripts/gen-emitted-baseline.cjs +0 -145
package/vscode/package.json
CHANGED
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* gen-emitted-baseline.cjs — publishes the emitted-baseline artifact the
|
|
6
|
-
* differential attribution check reads via `resolveBaseline()` (#2724, ADR-2719 §5).
|
|
7
|
-
*
|
|
8
|
-
* ## Why this exists
|
|
9
|
-
*
|
|
10
|
-
* Phase 3 (#2723) built `resolveBaseline()` (tests/helpers/emitted-baseline.cjs) and its
|
|
11
|
-
* cache-key staleness discipline, but nothing produced the artifact it reads — the
|
|
12
|
-
* dual-run window instead read the baseline straight off the committed golden fixtures
|
|
13
|
-
* at the base ref (`baselineManifestsAtRef`). Phase 4 deletes those fixtures, so
|
|
14
|
-
* something has to build and publish `{version, sha, manifests, sizes}` for real.
|
|
15
|
-
*
|
|
16
|
-
* ## What it does
|
|
17
|
-
*
|
|
18
|
-
* Builds the emitted manifest set (19 real installer spawns) and the workflow/agent size
|
|
19
|
-
* maps for the tree at `--dir <path>` (default: THIS script's own checkout — i.e.
|
|
20
|
-
* whatever commit is currently checked out where `gen-emitted-baseline.cjs` itself
|
|
21
|
-
* lives). Writes the result to `--out <path>` (default `.gsd-cache/emitted-baseline.json`).
|
|
22
|
-
*
|
|
23
|
-
* `--dir` decouples "which copy of this script runs" from "which tree gets measured"
|
|
24
|
-
* (#2767). The MEASUREMENT SCHEMA — this script, and the `currentManifests`/
|
|
25
|
-
* `currentSizes`/`buildParityManifest` functions it calls — always comes from wherever
|
|
26
|
-
* `gen-emitted-baseline.cjs` itself is being run from (relative `require`s resolve
|
|
27
|
-
* there); only the tree being measured (which `bin/install.js` gets spawned, which
|
|
28
|
-
* `hooks/`/`gsd-core/workflows/`/`agents/` get read) moves to `--dir`. That is what lets
|
|
29
|
-
* a differential apply ONE definition of "the emitted manifest" to two different
|
|
30
|
-
* commits and stay comparable even as that definition evolves — see
|
|
31
|
-
* `tests/helpers/emitted-runtime.cjs`'s `buildBaselineAtRef` for the caller that
|
|
32
|
-
* exercises this for real, and why it must NOT run the `--dir` tree's own copy of this
|
|
33
|
-
* script (which may be an older version, or — for any base ref that predates the PR
|
|
34
|
-
* that added this script at all — may not exist there yet).
|
|
35
|
-
*
|
|
36
|
-
* ## Callers
|
|
37
|
-
*
|
|
38
|
-
* 1. CI's push-to-`next` job runs this straight after `next` advances (no `--dir`,
|
|
39
|
-
* measuring its own checkout), then uploads `.gsd-cache/emitted-baseline.json` as a
|
|
40
|
-
* cache entry keyed on the merge sha (.github/workflows/test.yml,
|
|
41
|
-
* `publish-emitted-baseline` job).
|
|
42
|
-
* 2. `tests/emitted-attribution.test.cjs`'s real-tree test passes
|
|
43
|
-
* `buildBaselineAtRef` (tests/helpers/emitted-runtime.cjs) to `resolveBaseline()`
|
|
44
|
-
* as the `buildFallback` for a cache miss: it checks out `base` into a throwaway
|
|
45
|
-
* `git worktree`, symlinks in `node_modules` and runs `npm run build:lib` there
|
|
46
|
-
* (this script and the test helpers are Node-builtins-only per CONTRIBUTING.md's
|
|
47
|
-
* "No external dependencies in core", but `tests/helpers/install-shared.cjs`
|
|
48
|
-
* requires the TSC-compiled, gitignored `gsd-core/bin/lib/*.cjs`, so that one build
|
|
49
|
-
* step is unavoidable), then spawns THIS repo's OWN `gen-emitted-baseline.cjs`
|
|
50
|
-
* with `--dir <worktree> --out <tmp>` and reads the artifact back.
|
|
51
|
-
*
|
|
52
|
-
* Every git subprocess is bounded (CLAUDE.md → KNOWN DEFECTS: unbounded subprocesses
|
|
53
|
-
* hang CI silently).
|
|
54
|
-
*/
|
|
55
|
-
|
|
56
|
-
const fs = require('node:fs');
|
|
57
|
-
const path = require('node:path');
|
|
58
|
-
const { execFileSync } = require('node:child_process');
|
|
59
|
-
|
|
60
|
-
const { runMain, ExitError } = require('./lib/cli-exit.cjs');
|
|
61
|
-
const { BUILD_SCRIPT } = require('../tests/helpers/install-shared.cjs');
|
|
62
|
-
const { currentManifests, currentSizes, git } = require('../tests/helpers/emitted-runtime.cjs');
|
|
63
|
-
const { BASELINE_VERSION } = require('../tests/helpers/emitted-baseline.cjs');
|
|
64
|
-
|
|
65
|
-
const REPO_ROOT = path.join(__dirname, '..');
|
|
66
|
-
const DEFAULT_OUT = path.join(REPO_ROOT, '.gsd-cache', 'emitted-baseline.json');
|
|
67
|
-
|
|
68
|
-
// Reuses emitted-runtime.cjs's `git()` (not a local execFileSync) so the
|
|
69
|
-
// `-c safe.directory=<dir>` fix for the remote runner's dubious-ownership
|
|
70
|
-
// mount (#2767) has exactly one source of truth — see that module's
|
|
71
|
-
// `safeDirArgs` doc comment.
|
|
72
|
-
function resolveHeadSha(cwd) {
|
|
73
|
-
return git(['rev-parse', 'HEAD'], { cwd }).trim();
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
function parseArgs(argv) {
|
|
77
|
-
let out = DEFAULT_OUT;
|
|
78
|
-
let dir = REPO_ROOT;
|
|
79
|
-
for (let i = 0; i < argv.length; i++) {
|
|
80
|
-
if (argv[i] === '--out') {
|
|
81
|
-
out = argv[i + 1];
|
|
82
|
-
i++;
|
|
83
|
-
} else if (argv[i] === '--dir') {
|
|
84
|
-
dir = argv[i + 1];
|
|
85
|
-
i++;
|
|
86
|
-
} else {
|
|
87
|
-
throw new ExitError(2, `gen-emitted-baseline: unknown argument "${argv[i]}"`);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
if (!out || typeof out !== 'string') {
|
|
91
|
-
throw new ExitError(2, 'gen-emitted-baseline: --out requires a path');
|
|
92
|
-
}
|
|
93
|
-
if (!dir || typeof dir !== 'string') {
|
|
94
|
-
throw new ExitError(2, 'gen-emitted-baseline: --dir requires a path');
|
|
95
|
-
}
|
|
96
|
-
return {
|
|
97
|
-
out: path.isAbsolute(out) ? out : path.join(process.cwd(), out),
|
|
98
|
-
dir: path.isAbsolute(dir) ? dir : path.join(process.cwd(), dir),
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
async function main() {
|
|
103
|
-
const { out, dir } = parseArgs(process.argv.slice(2));
|
|
104
|
-
|
|
105
|
-
if (!fs.existsSync(dir)) {
|
|
106
|
-
throw new ExitError(1, `gen-emitted-baseline: --dir "${dir}" does not exist`);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
const sha = resolveHeadSha(dir);
|
|
110
|
-
if (!/^[0-9a-f]{40}$/.test(sha)) {
|
|
111
|
-
throw new ExitError(1, `gen-emitted-baseline: HEAD of "${dir}" did not resolve to a 40-hex sha: ${sha}`);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
// hooks/dist is gitignored and built; a scoped CI checkout may not have run
|
|
115
|
-
// build:hooks yet. Idempotent, mirrors the real-tree test. Built INSIDE `dir` — the
|
|
116
|
-
// MEASURED tree's own hooks/ source, not this script's — so a `--dir` pointed at a
|
|
117
|
-
// different checkout (e.g. a base-ref worktree) reflects that checkout's hooks, not
|
|
118
|
-
// the caller's. `dir === REPO_ROOT` (the default, no `--dir`) collapses to the
|
|
119
|
-
// pre-#2767 behavior of building this own repo's hooks/dist.
|
|
120
|
-
const buildScript = dir === REPO_ROOT ? BUILD_SCRIPT : path.join(dir, 'scripts', 'build-hooks.js');
|
|
121
|
-
execFileSync(process.execPath, [buildScript], { cwd: dir, encoding: 'utf-8', stdio: 'pipe', timeout: 120_000 });
|
|
122
|
-
|
|
123
|
-
// The measurement SCHEMA (currentManifests/currentSizes/buildParityManifest) is
|
|
124
|
-
// always THIS script's own — only the tree being measured moves with `repoRoot`.
|
|
125
|
-
const manifests = currentManifests({ repoRoot: dir });
|
|
126
|
-
const sizes = currentSizes({ repoRoot: dir });
|
|
127
|
-
|
|
128
|
-
const artifact = { version: BASELINE_VERSION, sha, manifests, sizes };
|
|
129
|
-
|
|
130
|
-
fs.mkdirSync(path.dirname(out), { recursive: true });
|
|
131
|
-
fs.writeFileSync(out, `${JSON.stringify(artifact, null, 2)}\n`, 'utf8');
|
|
132
|
-
|
|
133
|
-
const familyCount = Object.keys(manifests).length;
|
|
134
|
-
const sizeCount = Object.keys(sizes).length;
|
|
135
|
-
process.stdout.write(
|
|
136
|
-
`gen-emitted-baseline: wrote ${out} (dir=${dir}, sha=${sha.slice(0, 12)}, ${familyCount} families, ${sizeCount} sized files)\n`,
|
|
137
|
-
);
|
|
138
|
-
return 0;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
if (require.main === module) {
|
|
142
|
-
runMain(main);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
module.exports = { parseArgs, resolveHeadSha, DEFAULT_OUT, REPO_ROOT };
|