@opengsd/gsd-core 1.4.4 → 1.5.0-rc.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.
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +3 -3
- package/agents/gsd-code-fixer.md +3 -2
- package/agents/gsd-debug-session-manager.md +2 -1
- package/agents/gsd-debugger.md +4 -3
- package/agents/gsd-executor.md +17 -16
- package/agents/gsd-intel-updater.md +38 -41
- package/agents/gsd-phase-researcher.md +8 -8
- package/agents/gsd-plan-checker.md +23 -13
- package/agents/gsd-planner.md +32 -188
- package/agents/gsd-project-researcher.md +5 -4
- package/agents/gsd-research-synthesizer.md +2 -1
- package/agents/gsd-ui-researcher.md +2 -1
- package/agents/gsd-verifier.md +12 -11
- package/bin/install.js +965 -1486
- package/commands/gsd/autonomous.md +5 -1
- package/commands/gsd/ns-manage.md +8 -1
- package/commands/gsd/ns-project.md +5 -0
- package/commands/gsd/ns-review.md +4 -1
- package/commands/gsd/ns-workflow.md +7 -1
- package/commands/gsd/plan-review-convergence.md +5 -4
- package/commands/gsd/surface.md +12 -5
- package/gemini-extension.json +1 -1
- package/gsd-core/bin/gsd-tools.cjs +198 -101
- package/gsd-core/bin/gsd_run +20 -0
- package/gsd-core/bin/lib/audit-command-router.cjs +61 -0
- package/gsd-core/bin/lib/capability-registry.cjs +2234 -0
- package/gsd-core/bin/lib/capability-state.cjs +336 -0
- package/gsd-core/bin/lib/check-command-router.cjs +133 -2
- package/gsd-core/bin/lib/cli-exit.cjs +22 -3
- package/gsd-core/bin/lib/config-loader.cjs +716 -0
- package/gsd-core/bin/lib/configuration.cjs +4 -34
- package/gsd-core/bin/lib/core-utils.cjs +198 -0
- package/gsd-core/bin/lib/core.cjs +107 -1817
- package/gsd-core/bin/lib/edge-probe.cjs +173 -0
- package/gsd-core/bin/lib/fallow-runner.cjs +63 -25
- package/gsd-core/bin/lib/federated-config.cjs +182 -0
- package/gsd-core/bin/lib/graphify-command-router.cjs +74 -0
- package/gsd-core/bin/lib/init.cjs +58 -12
- package/gsd-core/bin/lib/install-profiles.cjs +157 -3
- package/gsd-core/bin/lib/intel-command-router.cjs +116 -0
- package/gsd-core/bin/lib/intel.cjs +3 -3
- package/gsd-core/bin/lib/io.cjs +222 -0
- package/gsd-core/bin/lib/loop-host-contract.cjs +105 -0
- package/gsd-core/bin/lib/loop-resolver.cjs +460 -0
- package/gsd-core/bin/lib/model-resolver.cjs +426 -0
- package/gsd-core/bin/lib/phase-command-router.cjs +20 -0
- package/gsd-core/bin/lib/phase-id.cjs +215 -0
- package/gsd-core/bin/lib/phase-locator.cjs +148 -0
- package/gsd-core/bin/lib/phase.cjs +17 -0
- package/gsd-core/bin/lib/probe-core.cjs +257 -0
- package/gsd-core/bin/lib/profile-pipeline.cjs +2 -2
- package/gsd-core/bin/lib/roadmap-parser.cjs +443 -0
- package/gsd-core/bin/lib/roadmap.cjs +44 -1
- package/gsd-core/bin/lib/runtime-artifact-layout.cjs +92 -95
- package/gsd-core/bin/lib/runtime-config-adapter-registry.cjs +68 -29
- package/gsd-core/bin/lib/runtime-homes.cjs +163 -87
- package/gsd-core/bin/lib/runtime-hooks-surface.cjs +1439 -0
- package/gsd-core/bin/lib/runtime-name-policy.cjs +2 -1
- package/gsd-core/bin/lib/runtime-slash.cjs +7 -2
- package/gsd-core/bin/lib/shell-command-projection.cjs +13 -0
- package/gsd-core/bin/lib/state-document.cjs +8 -0
- package/gsd-core/bin/lib/state.cjs +114 -2
- package/gsd-core/bin/lib/surface.cjs +66 -14
- package/gsd-core/bin/lib/uat-predicate.cjs +329 -0
- package/gsd-core/bin/lib/update-context.cjs +4 -1
- package/gsd-core/bin/lib/verify.cjs +104 -1
- package/gsd-core/bin/lib/worktree-base-ref.cjs +33 -8
- package/gsd-core/bin/shared/model-catalog.json +11 -6
- package/gsd-core/bin/shared/runtime-aliases.manifest.json +5 -1
- package/gsd-core/references/edge-probe-fixtures/01-round-half-even/expected-coverage.json +7 -0
- package/gsd-core/references/edge-probe-fixtures/01-round-half-even/requirements.json +1 -0
- package/gsd-core/references/edge-probe-fixtures/02-merge-intervals/expected-coverage.json +8 -0
- package/gsd-core/references/edge-probe-fixtures/02-merge-intervals/requirements.json +1 -0
- package/gsd-core/references/edge-probe-fixtures/03-truncate-graphemes/expected-coverage.json +7 -0
- package/gsd-core/references/edge-probe-fixtures/03-truncate-graphemes/requirements.json +1 -0
- package/gsd-core/references/edge-probe-fixtures/04-money-rounding/expected-coverage.json +7 -0
- package/gsd-core/references/edge-probe-fixtures/04-money-rounding/requirements.json +1 -0
- package/gsd-core/references/edge-probe-fixtures/05-list-dedupe/expected-coverage.json +8 -0
- package/gsd-core/references/edge-probe-fixtures/05-list-dedupe/requirements.json +1 -0
- package/gsd-core/references/edge-probe-fixtures/06-resolved-mixed/expected-coverage.json +8 -0
- package/gsd-core/references/edge-probe-fixtures/06-resolved-mixed/requirements.json +1 -0
- package/gsd-core/references/edge-probe-fixtures/06-resolved-mixed/resolutions.json +4 -0
- package/gsd-core/references/edge-probe.md +261 -0
- package/gsd-core/references/planner-antipatterns.md +41 -0
- package/gsd-core/references/planner-guidance.md +186 -0
- package/gsd-core/references/planner-reviews.md +5 -2
- package/gsd-core/templates/phase-prompt.md +7 -7
- package/gsd-core/templates/project.md +19 -2
- package/gsd-core/templates/spec.md +12 -0
- package/gsd-core/templates/summary-complex.md +1 -0
- package/gsd-core/templates/summary-minimal.md +1 -0
- package/gsd-core/templates/summary-standard.md +1 -0
- package/gsd-core/templates/summary.md +1 -0
- package/gsd-core/workflows/_runtime-launcher.snippet.sh +1 -1
- package/gsd-core/workflows/add-backlog.md +1 -1
- package/gsd-core/workflows/add-phase.md +1 -1
- package/gsd-core/workflows/add-tests.md +1 -1
- package/gsd-core/workflows/add-todo.md +1 -1
- package/gsd-core/workflows/ai-integration-phase.md +1 -1
- package/gsd-core/workflows/audit-fix.md +1 -1
- package/gsd-core/workflows/audit-milestone.md +1 -1
- package/gsd-core/workflows/audit-uat.md +1 -1
- package/gsd-core/workflows/autonomous.md +111 -51
- package/gsd-core/workflows/check-todos.md +1 -1
- package/gsd-core/workflows/cleanup.md +1 -1
- package/gsd-core/workflows/code-review-fix.md +6 -4
- package/gsd-core/workflows/code-review.md +53 -17
- package/gsd-core/workflows/complete-milestone.md +11 -5
- package/gsd-core/workflows/debug.md +1 -1
- package/gsd-core/workflows/diagnose-issues.md +1 -1
- package/gsd-core/workflows/discuss-phase/modes/advisor.md +1 -1
- package/gsd-core/workflows/discuss-phase/modes/auto.md +1 -1
- package/gsd-core/workflows/discuss-phase/modes/chain.md +1 -1
- package/gsd-core/workflows/discuss-phase-assumptions.md +1 -1
- package/gsd-core/workflows/discuss-phase.md +8 -1
- package/gsd-core/workflows/do.md +1 -1
- package/gsd-core/workflows/docs-update.md +1 -1
- package/gsd-core/workflows/edit-phase.md +1 -1
- package/gsd-core/workflows/eval-review.md +4 -1
- package/gsd-core/workflows/execute-phase/steps/codebase-drift-gate.md +1 -1
- package/gsd-core/workflows/execute-phase/steps/post-merge-gate.md +1 -1
- package/gsd-core/workflows/execute-phase.md +8 -1
- package/gsd-core/workflows/execute-plan.md +1 -1
- package/gsd-core/workflows/explore.md +1 -1
- package/gsd-core/workflows/extract-learnings.md +1 -1
- package/gsd-core/workflows/forensics.md +1 -1
- package/gsd-core/workflows/graduation.md +1 -1
- package/gsd-core/workflows/health.md +1 -1
- package/gsd-core/workflows/help/modes/full.md +1 -1
- package/gsd-core/workflows/import.md +1 -1
- package/gsd-core/workflows/ingest-docs.md +1 -1
- package/gsd-core/workflows/insert-phase.md +1 -1
- package/gsd-core/workflows/list-workspaces.md +1 -1
- package/gsd-core/workflows/manager.md +1 -1
- package/gsd-core/workflows/map-codebase.md +1 -1
- package/gsd-core/workflows/milestone-summary.md +1 -1
- package/gsd-core/workflows/mvp-phase.md +1 -1
- package/gsd-core/workflows/new-milestone.md +9 -1
- package/gsd-core/workflows/new-project.md +9 -1
- package/gsd-core/workflows/new-workspace.md +1 -1
- package/gsd-core/workflows/next.md +1 -1
- package/gsd-core/workflows/pause-work.md +1 -1
- package/gsd-core/workflows/plan-milestone-gaps.md +1 -1
- package/gsd-core/workflows/plan-phase.md +65 -28
- package/gsd-core/workflows/plan-review-convergence.md +60 -33
- package/gsd-core/workflows/plant-seed.md +1 -1
- package/gsd-core/workflows/profile-user.md +1 -1
- package/gsd-core/workflows/progress.md +1 -1
- package/gsd-core/workflows/quick.md +2 -2
- package/gsd-core/workflows/remove-phase.md +1 -1
- package/gsd-core/workflows/remove-workspace.md +1 -1
- package/gsd-core/workflows/resume-project.md +1 -1
- package/gsd-core/workflows/review.md +1 -1
- package/gsd-core/workflows/scan.md +1 -1
- package/gsd-core/workflows/secure-phase.md +1 -1
- package/gsd-core/workflows/settings-advanced.md +7 -7
- package/gsd-core/workflows/settings-integrations.md +1 -1
- package/gsd-core/workflows/settings.md +2 -2
- package/gsd-core/workflows/ship.md +8 -1
- package/gsd-core/workflows/sketch-wrap-up.md +1 -1
- package/gsd-core/workflows/sketch.md +1 -1
- package/gsd-core/workflows/spec-phase.md +130 -1
- package/gsd-core/workflows/spike-wrap-up.md +1 -1
- package/gsd-core/workflows/spike.md +1 -1
- package/gsd-core/workflows/stats.md +1 -1
- package/gsd-core/workflows/thread.md +1 -1
- package/gsd-core/workflows/transition.md +1 -1
- package/gsd-core/workflows/ui-phase.md +1 -1
- package/gsd-core/workflows/ui-review.md +1 -1
- package/gsd-core/workflows/ultraplan-phase.md +1 -1
- package/gsd-core/workflows/update.md +2 -2
- package/gsd-core/workflows/validate-phase.md +1 -1
- package/gsd-core/workflows/verify-phase.md +1 -1
- package/gsd-core/workflows/verify-work.md +8 -1
- package/package.json +11 -3
- package/scripts/base64-scan.sh +1 -1
- package/scripts/changeset/cli.cjs +8 -1
- package/scripts/changeset/lint.cjs +38 -2
- package/scripts/ci-test-scope.cjs +21 -10
- package/scripts/gen-capability-registry.cjs +2293 -0
- package/scripts/gen-loop-host-contract.cjs +471 -0
- package/scripts/lib/allowlist-ratchet.cjs +101 -1
- package/scripts/lint-regression-test-names.allowlist.json +269 -0
- package/scripts/lint-regression-test-names.cjs +117 -0
- package/scripts/lint-test-file-count.allowlist.json +25 -4
- package/scripts/lint-windows-test-portability.cjs +178 -0
- package/scripts/prompt-injection-scan.sh +4 -4
- package/scripts/research-profiles.cjs +10 -10
- package/scripts/run-tests.cjs +133 -29
- package/scripts/secret-scan.sh +3 -3
- package/scripts/sync-next-version.cjs +133 -0
- package/scripts/sync-runtime-launcher.cjs +21 -5
- package/scripts/update-size-baseline.cjs +68 -0
- package/scripts/workflow-policy.cjs +42 -9
- package/scripts/workflow-size.cjs +90 -0
- package/scripts/run-cross-platform-tests.cjs +0 -67
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file workflow-size.cjs
|
|
5
|
+
*
|
|
6
|
+
* Single source of truth for measuring workflow `.md` file sizes in bytes.
|
|
7
|
+
*
|
|
8
|
+
* Shared by `tests/workflow-size-budget.test.cjs` (the CI guard) and
|
|
9
|
+
* `scripts/update-size-baseline.cjs` (the baseline generator) so the two can
|
|
10
|
+
* never disagree on HOW a file is measured. A divergence between the generator
|
|
11
|
+
* and the guard would silently mis-record the baseline (issue #1074).
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
const fs = require('fs');
|
|
15
|
+
const path = require('path');
|
|
16
|
+
|
|
17
|
+
const WORKFLOWS_DIR = path.join(__dirname, '..', 'gsd-core', 'workflows');
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Byte size of a file, counted as on an LF (Unix) checkout.
|
|
21
|
+
*
|
|
22
|
+
* The size budget is calibrated against `wc -c` on a Unix (LF) checkout, but
|
|
23
|
+
* these `.md` files have no `eol=lf` in `.gitattributes`, so Windows checks
|
|
24
|
+
* them out as CRLF. Counting raw on-disk bytes there adds one byte per line,
|
|
25
|
+
* a Windows-only false positive that diverges from the LF calibration basis
|
|
26
|
+
* (issue #683). Stripping CR yields the same LF byte count on every platform.
|
|
27
|
+
* This is still a raw byte count (not a trailing-newline-stripping line count).
|
|
28
|
+
*
|
|
29
|
+
* @param {string} filePath - Absolute or relative path to the file.
|
|
30
|
+
* @returns {number} LF-normalized byte length.
|
|
31
|
+
*/
|
|
32
|
+
function lfByteCount(filePath) {
|
|
33
|
+
const content = fs.readFileSync(filePath, 'utf-8');
|
|
34
|
+
return Buffer.byteLength(content.replace(/\r\n/g, '\n'), 'utf-8');
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* List top-level workflow stems (filenames without the `.md` extension), sorted.
|
|
39
|
+
* Non-recursive by design: per-mode bodies under `workflows/<name>/modes/` and
|
|
40
|
+
* templates are NOT measured — only the always-loaded top-level workflows.
|
|
41
|
+
*
|
|
42
|
+
* @param {string} [dir] - Workflows directory (defaults to the canonical one).
|
|
43
|
+
* @returns {string[]} Sorted stems, e.g. `['autonomous', 'plan-phase', ...]`.
|
|
44
|
+
*/
|
|
45
|
+
function listWorkflowStems(dir = WORKFLOWS_DIR) {
|
|
46
|
+
return fs
|
|
47
|
+
.readdirSync(dir)
|
|
48
|
+
.filter((f) => f.endsWith('.md'))
|
|
49
|
+
.map((f) => f.replace(/\.md$/, ''))
|
|
50
|
+
.sort();
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Measure every top-level `.md` file in `dir`, keyed by filename, byte sizes.
|
|
55
|
+
* Generic over directory and an optional filename predicate — used for both
|
|
56
|
+
* workflows (`gsd-core/workflows/*.md`) and agents (`agents/gsd-*.md`) so the
|
|
57
|
+
* size guards and the baseline generator share one measurement path (#1074).
|
|
58
|
+
* Non-recursive by design.
|
|
59
|
+
*
|
|
60
|
+
* @param {string} dir - Directory to scan.
|
|
61
|
+
* @param {function(string): boolean} [predicate] - Filename filter (default: all `.md`).
|
|
62
|
+
* @returns {Object<string, number>} Map of filename → LF byte size, keys sorted.
|
|
63
|
+
*/
|
|
64
|
+
function measureMdFiles(dir, predicate = () => true) {
|
|
65
|
+
const out = {};
|
|
66
|
+
const names = fs
|
|
67
|
+
.readdirSync(dir)
|
|
68
|
+
.filter((f) => f.endsWith('.md') && predicate(f))
|
|
69
|
+
.sort();
|
|
70
|
+
for (const name of names) out[name] = lfByteCount(path.join(dir, name));
|
|
71
|
+
return out;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Measure every top-level workflow file, keyed by filename (`<stem>.md`).
|
|
76
|
+
*
|
|
77
|
+
* @param {string} [dir] - Workflows directory (defaults to the canonical one).
|
|
78
|
+
* @returns {Object<string, number>} Map of `<stem>.md` → LF byte size, sorted.
|
|
79
|
+
*/
|
|
80
|
+
function measureWorkflows(dir = WORKFLOWS_DIR) {
|
|
81
|
+
return measureMdFiles(dir);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
module.exports = {
|
|
85
|
+
WORKFLOWS_DIR,
|
|
86
|
+
lfByteCount,
|
|
87
|
+
listWorkflowStems,
|
|
88
|
+
measureMdFiles,
|
|
89
|
+
measureWorkflows,
|
|
90
|
+
};
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const { spawnSync } = require('child_process');
|
|
4
|
-
const { ExitError, runMain } = require('./lib/cli-exit.cjs');
|
|
5
|
-
|
|
6
|
-
const CROSS_PLATFORM_TEST_REASON = Object.freeze({
|
|
7
|
-
PASS: 'pass',
|
|
8
|
-
TEST_FAILURE: 'test_failure',
|
|
9
|
-
INFRA_FAILURE: 'infra_failure',
|
|
10
|
-
UNKNOWN_FAILURE: 'unknown_failure',
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
function classify(exitCode, output) {
|
|
14
|
-
if (exitCode === 0) return CROSS_PLATFORM_TEST_REASON.PASS;
|
|
15
|
-
if (exitCode === 2 || /infrastructure failure|worktree\.Construct/i.test(output)) {
|
|
16
|
-
return CROSS_PLATFORM_TEST_REASON.INFRA_FAILURE;
|
|
17
|
-
}
|
|
18
|
-
if (/\bFAIL\b|\d+\s+failures?\)/i.test(output)) {
|
|
19
|
-
return CROSS_PLATFORM_TEST_REASON.TEST_FAILURE;
|
|
20
|
-
}
|
|
21
|
-
return CROSS_PLATFORM_TEST_REASON.UNKNOWN_FAILURE;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function runCrossPlatformTests(options = {}, deps = {}) {
|
|
25
|
-
const {
|
|
26
|
-
base = 'next',
|
|
27
|
-
head = 'HEAD',
|
|
28
|
-
source = '.',
|
|
29
|
-
targets = 'linux,macos',
|
|
30
|
-
cwd = process.cwd(),
|
|
31
|
-
} = options;
|
|
32
|
-
const runner = deps.spawnSync || spawnSync;
|
|
33
|
-
|
|
34
|
-
const args = ['--targets', targets, '--base', base, '--head', head, '--source', source];
|
|
35
|
-
const result = runner('gsd-test', args, { cwd, encoding: 'utf8' });
|
|
36
|
-
|
|
37
|
-
const stdout = result.stdout || '';
|
|
38
|
-
const stderr = result.stderr || '';
|
|
39
|
-
const output = `${stdout}\n${stderr}`;
|
|
40
|
-
const exitCode = Number(result.status ?? 1);
|
|
41
|
-
const reason = classify(exitCode, output);
|
|
42
|
-
|
|
43
|
-
return {
|
|
44
|
-
ok: exitCode === 0,
|
|
45
|
-
reason,
|
|
46
|
-
exitCode,
|
|
47
|
-
command: ['gsd-test', ...args].join(' '),
|
|
48
|
-
stdout,
|
|
49
|
-
stderr,
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
if (require.main === module) {
|
|
54
|
-
function main() {
|
|
55
|
-
const result = runCrossPlatformTests();
|
|
56
|
-
const line = `[cross-platform-tests] reason=${result.reason} exit=${result.exitCode}`;
|
|
57
|
-
if (result.ok) {
|
|
58
|
-
process.stdout.write(`${line}\n`);
|
|
59
|
-
return 0;
|
|
60
|
-
}
|
|
61
|
-
process.stderr.write(`${line}\n`);
|
|
62
|
-
throw new ExitError(result.exitCode);
|
|
63
|
-
}
|
|
64
|
-
runMain(main);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
module.exports = { CROSS_PLATFORM_TEST_REASON, runCrossPlatformTests };
|